diff options
author | Jason Gunthorpe <jgg@nvidia.com> | 2023-04-04 11:03:24 -0300 |
---|---|---|
committer | Jason Gunthorpe <jgg@nvidia.com> | 2023-04-04 11:04:30 -0300 |
commit | 692d42d411b7db6a76382537fccbee3a12a2bcdb (patch) | |
tree | 24770529cf173188bc5d2d0d9331c0ac723b631e /fs/locks.c | |
parent | c52159b5be7894540acdc7a35791c0b57097fa4c (diff) | |
parent | 13a0d1ae7ee6b438f5537711a8c60cba00554943 (diff) |
Merge branch 'iommufd/for-rc' into for-next
The following selftest patch requires both the bug fixes and the
improvements of the selftest framework.
* iommufd/for-rc:
iommufd: Do not corrupt the pfn list when doing batch carry
iommufd: Fix unpinning of pages when an access is present
iommufd: Check for uptr overflow
Linux 6.3-rc5
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Diffstat (limited to 'fs/locks.c')
-rw-r--r-- | fs/locks.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/locks.c b/fs/locks.c index 66b4eef09db5..df8b26a42524 100644 --- a/fs/locks.c +++ b/fs/locks.c @@ -1863,9 +1863,10 @@ int generic_setlease(struct file *filp, long arg, struct file_lock **flp, void **priv) { struct inode *inode = file_inode(filp); + vfsuid_t vfsuid = i_uid_into_vfsuid(file_mnt_idmap(filp), inode); int error; - if ((!uid_eq(current_fsuid(), inode->i_uid)) && !capable(CAP_LEASE)) + if ((!vfsuid_eq_kuid(vfsuid, current_fsuid())) && !capable(CAP_LEASE)) return -EACCES; if (!S_ISREG(inode->i_mode)) return -EINVAL; @@ -2425,7 +2426,6 @@ int fcntl_getlk64(struct file *filp, unsigned int cmd, struct flock64 *flock) if (flock->l_pid != 0) goto out; - cmd = F_GETLK64; fl->fl_flags |= FL_OFDLCK; fl->fl_owner = filp; } |