diff options
Diffstat (limited to 'fs')
-rw-r--r-- | fs/block_dev.c | 4 | ||||
-rw-r--r-- | fs/compat_ioctl.c | 9 | ||||
-rw-r--r-- | fs/fuse/dir.c | 2 | ||||
-rw-r--r-- | fs/namei.c | 6 | ||||
-rw-r--r-- | fs/nfs/dir.c | 2 | ||||
-rw-r--r-- | fs/open.c | 11 |
6 files changed, 18 insertions, 16 deletions
diff --git a/fs/block_dev.c b/fs/block_dev.c index 99d6af811747..b3171fb0dc9a 100644 --- a/fs/block_dev.c +++ b/fs/block_dev.c | |||
@@ -681,8 +681,8 @@ retry: | |||
681 | if (!bd_may_claim(bdev, whole, holder)) | 681 | if (!bd_may_claim(bdev, whole, holder)) |
682 | return -EBUSY; | 682 | return -EBUSY; |
683 | 683 | ||
684 | /* if someone else is claiming, wait for it to finish */ | 684 | /* if claiming is already in progress, wait for it to finish */ |
685 | if (whole->bd_claiming && whole->bd_claiming != holder) { | 685 | if (whole->bd_claiming) { |
686 | wait_queue_head_t *wq = bit_waitqueue(&whole->bd_claiming, 0); | 686 | wait_queue_head_t *wq = bit_waitqueue(&whole->bd_claiming, 0); |
687 | DEFINE_WAIT(wait); | 687 | DEFINE_WAIT(wait); |
688 | 688 | ||
diff --git a/fs/compat_ioctl.c b/fs/compat_ioctl.c index 5ead3763bba5..63ae85831464 100644 --- a/fs/compat_ioctl.c +++ b/fs/compat_ioctl.c | |||
@@ -601,8 +601,11 @@ static int ioc_settimeout(unsigned int fd, unsigned int cmd, | |||
601 | } | 601 | } |
602 | 602 | ||
603 | /* Bluetooth ioctls */ | 603 | /* Bluetooth ioctls */ |
604 | #define HCIUARTSETPROTO _IOW('U', 200, int) | 604 | #define HCIUARTSETPROTO _IOW('U', 200, int) |
605 | #define HCIUARTGETPROTO _IOR('U', 201, int) | 605 | #define HCIUARTGETPROTO _IOR('U', 201, int) |
606 | #define HCIUARTGETDEVICE _IOR('U', 202, int) | ||
607 | #define HCIUARTSETFLAGS _IOW('U', 203, int) | ||
608 | #define HCIUARTGETFLAGS _IOR('U', 204, int) | ||
606 | 609 | ||
607 | #define BNEPCONNADD _IOW('B', 200, int) | 610 | #define BNEPCONNADD _IOW('B', 200, int) |
608 | #define BNEPCONNDEL _IOW('B', 201, int) | 611 | #define BNEPCONNDEL _IOW('B', 201, int) |
@@ -1328,6 +1331,8 @@ COMPATIBLE_IOCTL(HCISETLINKPOL) | |||
1328 | COMPATIBLE_IOCTL(HCISETLINKMODE) | 1331 | COMPATIBLE_IOCTL(HCISETLINKMODE) |
1329 | COMPATIBLE_IOCTL(HCISETACLMTU) | 1332 | COMPATIBLE_IOCTL(HCISETACLMTU) |
1330 | COMPATIBLE_IOCTL(HCISETSCOMTU) | 1333 | COMPATIBLE_IOCTL(HCISETSCOMTU) |
1334 | COMPATIBLE_IOCTL(HCIBLOCKADDR) | ||
1335 | COMPATIBLE_IOCTL(HCIUNBLOCKADDR) | ||
1331 | COMPATIBLE_IOCTL(HCIINQUIRY) | 1336 | COMPATIBLE_IOCTL(HCIINQUIRY) |
1332 | COMPATIBLE_IOCTL(HCIUARTSETPROTO) | 1337 | COMPATIBLE_IOCTL(HCIUARTSETPROTO) |
1333 | COMPATIBLE_IOCTL(HCIUARTGETPROTO) | 1338 | COMPATIBLE_IOCTL(HCIUARTGETPROTO) |
diff --git a/fs/fuse/dir.c b/fs/fuse/dir.c index 3cdc5f78a406..431be0795b6b 100644 --- a/fs/fuse/dir.c +++ b/fs/fuse/dir.c | |||
@@ -1016,7 +1016,7 @@ static int fuse_permission(struct inode *inode, int mask) | |||
1016 | exist. So if permissions are revoked this won't be | 1016 | exist. So if permissions are revoked this won't be |
1017 | noticed immediately, only after the attribute | 1017 | noticed immediately, only after the attribute |
1018 | timeout has expired */ | 1018 | timeout has expired */ |
1019 | } else if (mask & MAY_ACCESS) { | 1019 | } else if (mask & (MAY_ACCESS | MAY_CHDIR)) { |
1020 | err = fuse_access(inode, mask); | 1020 | err = fuse_access(inode, mask); |
1021 | } else if ((mask & MAY_EXEC) && S_ISREG(inode->i_mode)) { | 1021 | } else if ((mask & MAY_EXEC) && S_ISREG(inode->i_mode)) { |
1022 | if (!(inode->i_mode & S_IXUGO)) { | 1022 | if (!(inode->i_mode & S_IXUGO)) { |
diff --git a/fs/namei.c b/fs/namei.c index 868d0cb9d473..42d2d28fb827 100644 --- a/fs/namei.c +++ b/fs/namei.c | |||
@@ -282,8 +282,7 @@ int inode_permission(struct inode *inode, int mask) | |||
282 | if (retval) | 282 | if (retval) |
283 | return retval; | 283 | return retval; |
284 | 284 | ||
285 | return security_inode_permission(inode, | 285 | return security_inode_permission(inode, mask); |
286 | mask & (MAY_READ|MAY_WRITE|MAY_EXEC|MAY_APPEND)); | ||
287 | } | 286 | } |
288 | 287 | ||
289 | /** | 288 | /** |
@@ -1484,8 +1483,7 @@ static int handle_truncate(struct path *path) | |||
1484 | */ | 1483 | */ |
1485 | error = locks_verify_locked(inode); | 1484 | error = locks_verify_locked(inode); |
1486 | if (!error) | 1485 | if (!error) |
1487 | error = security_path_truncate(path, 0, | 1486 | error = security_path_truncate(path); |
1488 | ATTR_MTIME|ATTR_CTIME|ATTR_OPEN); | ||
1489 | if (!error) { | 1487 | if (!error) { |
1490 | error = do_truncate(path->dentry, 0, | 1488 | error = do_truncate(path->dentry, 0, |
1491 | ATTR_MTIME|ATTR_CTIME|ATTR_OPEN, | 1489 | ATTR_MTIME|ATTR_CTIME|ATTR_OPEN, |
diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c index e60416d3f818..832e9e239324 100644 --- a/fs/nfs/dir.c +++ b/fs/nfs/dir.c | |||
@@ -1953,7 +1953,7 @@ int nfs_permission(struct inode *inode, int mask) | |||
1953 | if ((mask & (MAY_READ | MAY_WRITE | MAY_EXEC)) == 0) | 1953 | if ((mask & (MAY_READ | MAY_WRITE | MAY_EXEC)) == 0) |
1954 | goto out; | 1954 | goto out; |
1955 | /* Is this sys_access() ? */ | 1955 | /* Is this sys_access() ? */ |
1956 | if (mask & MAY_ACCESS) | 1956 | if (mask & (MAY_ACCESS | MAY_CHDIR)) |
1957 | goto force_lookup; | 1957 | goto force_lookup; |
1958 | 1958 | ||
1959 | switch (inode->i_mode & S_IFMT) { | 1959 | switch (inode->i_mode & S_IFMT) { |
@@ -110,7 +110,7 @@ static long do_sys_truncate(const char __user *pathname, loff_t length) | |||
110 | 110 | ||
111 | error = locks_verify_truncate(inode, NULL, length); | 111 | error = locks_verify_truncate(inode, NULL, length); |
112 | if (!error) | 112 | if (!error) |
113 | error = security_path_truncate(&path, length, 0); | 113 | error = security_path_truncate(&path); |
114 | if (!error) | 114 | if (!error) |
115 | error = do_truncate(path.dentry, length, 0, NULL); | 115 | error = do_truncate(path.dentry, length, 0, NULL); |
116 | 116 | ||
@@ -165,8 +165,7 @@ static long do_sys_ftruncate(unsigned int fd, loff_t length, int small) | |||
165 | 165 | ||
166 | error = locks_verify_truncate(inode, file, length); | 166 | error = locks_verify_truncate(inode, file, length); |
167 | if (!error) | 167 | if (!error) |
168 | error = security_path_truncate(&file->f_path, length, | 168 | error = security_path_truncate(&file->f_path); |
169 | ATTR_MTIME|ATTR_CTIME); | ||
170 | if (!error) | 169 | if (!error) |
171 | error = do_truncate(dentry, length, ATTR_MTIME|ATTR_CTIME, file); | 170 | error = do_truncate(dentry, length, ATTR_MTIME|ATTR_CTIME, file); |
172 | out_putf: | 171 | out_putf: |
@@ -367,7 +366,7 @@ SYSCALL_DEFINE1(chdir, const char __user *, filename) | |||
367 | if (error) | 366 | if (error) |
368 | goto out; | 367 | goto out; |
369 | 368 | ||
370 | error = inode_permission(path.dentry->d_inode, MAY_EXEC | MAY_ACCESS); | 369 | error = inode_permission(path.dentry->d_inode, MAY_EXEC | MAY_CHDIR); |
371 | if (error) | 370 | if (error) |
372 | goto dput_and_out; | 371 | goto dput_and_out; |
373 | 372 | ||
@@ -396,7 +395,7 @@ SYSCALL_DEFINE1(fchdir, unsigned int, fd) | |||
396 | if (!S_ISDIR(inode->i_mode)) | 395 | if (!S_ISDIR(inode->i_mode)) |
397 | goto out_putf; | 396 | goto out_putf; |
398 | 397 | ||
399 | error = inode_permission(inode, MAY_EXEC | MAY_ACCESS); | 398 | error = inode_permission(inode, MAY_EXEC | MAY_CHDIR); |
400 | if (!error) | 399 | if (!error) |
401 | set_fs_pwd(current->fs, &file->f_path); | 400 | set_fs_pwd(current->fs, &file->f_path); |
402 | out_putf: | 401 | out_putf: |
@@ -414,7 +413,7 @@ SYSCALL_DEFINE1(chroot, const char __user *, filename) | |||
414 | if (error) | 413 | if (error) |
415 | goto out; | 414 | goto out; |
416 | 415 | ||
417 | error = inode_permission(path.dentry->d_inode, MAY_EXEC | MAY_ACCESS); | 416 | error = inode_permission(path.dentry->d_inode, MAY_EXEC | MAY_CHDIR); |
418 | if (error) | 417 | if (error) |
419 | goto dput_and_out; | 418 | goto dput_and_out; |
420 | 419 | ||