Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs

Pull vfs fix from Al Viro:
"Fix for 3.15 breakage of fcntl64() in arm OABI compat. -stable
fodder"

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
[PATCH] arm: fix handling of F_OFD_... in oabi_fcntl64()

+39 -38
+39 -38
arch/arm/kernel/sys_oabi-compat.c
··· 193 193 pid_t l_pid; 194 194 } __attribute__ ((packed,aligned(4))); 195 195 196 + static long do_locks(unsigned int fd, unsigned int cmd, 197 + unsigned long arg) 198 + { 199 + struct flock64 kernel; 200 + struct oabi_flock64 user; 201 + mm_segment_t fs; 202 + long ret; 203 + 204 + if (copy_from_user(&user, (struct oabi_flock64 __user *)arg, 205 + sizeof(user))) 206 + return -EFAULT; 207 + kernel.l_type = user.l_type; 208 + kernel.l_whence = user.l_whence; 209 + kernel.l_start = user.l_start; 210 + kernel.l_len = user.l_len; 211 + kernel.l_pid = user.l_pid; 212 + 213 + fs = get_fs(); 214 + set_fs(KERNEL_DS); 215 + ret = sys_fcntl64(fd, cmd, (unsigned long)&kernel); 216 + set_fs(fs); 217 + 218 + if (!ret && (cmd == F_GETLK64 || cmd == F_OFD_GETLK)) { 219 + user.l_type = kernel.l_type; 220 + user.l_whence = kernel.l_whence; 221 + user.l_start = kernel.l_start; 222 + user.l_len = kernel.l_len; 223 + user.l_pid = kernel.l_pid; 224 + if (copy_to_user((struct oabi_flock64 __user *)arg, 225 + &user, sizeof(user))) 226 + ret = -EFAULT; 227 + } 228 + return ret; 229 + } 230 + 196 231 asmlinkage long sys_oabi_fcntl64(unsigned int fd, unsigned int cmd, 197 232 unsigned long arg) 198 233 { 199 - struct oabi_flock64 user; 200 - struct flock64 kernel; 201 - mm_segment_t fs = USER_DS; /* initialized to kill a warning */ 202 - unsigned long local_arg = arg; 203 - int ret; 204 - 205 234 switch (cmd) { 206 235 case F_OFD_GETLK: 207 236 case F_OFD_SETLK: ··· 238 209 case F_GETLK64: 239 210 case F_SETLK64: 240 211 case F_SETLKW64: 241 - if (copy_from_user(&user, (struct oabi_flock64 __user *)arg, 242 - sizeof(user))) 243 - return -EFAULT; 244 - kernel.l_type = user.l_type; 245 - kernel.l_whence = user.l_whence; 246 - kernel.l_start = user.l_start; 247 - kernel.l_len = user.l_len; 248 - kernel.l_pid = user.l_pid; 249 - local_arg = (unsigned long)&kernel; 250 - fs = get_fs(); 251 - set_fs(KERNEL_DS); 212 + return do_locks(fd, cmd, arg); 213 + 214 + default: 215 + return sys_fcntl64(fd, cmd, arg); 252 216 } 253 - 254 - ret = sys_fcntl64(fd, cmd, local_arg); 255 - 256 - switch (cmd) { 257 - case F_GETLK64: 258 - if (!ret) { 259 - user.l_type = kernel.l_type; 260 - user.l_whence = kernel.l_whence; 261 - user.l_start = kernel.l_start; 262 - user.l_len = kernel.l_len; 263 - user.l_pid = kernel.l_pid; 264 - if (copy_to_user((struct oabi_flock64 __user *)arg, 265 - &user, sizeof(user))) 266 - ret = -EFAULT; 267 - } 268 - case F_SETLK64: 269 - case F_SETLKW64: 270 - set_fs(fs); 271 - } 272 - 273 - return ret; 274 217 } 275 218 276 219 struct oabi_epoll_event {