mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-29 13:53:33 +00:00
fcntl: don't leak fd reference when fixup_compat_flock fails
[ Upstream commit9280a601e6
] Currently we just return err here, but we need to put the fd reference first. Fixes:94073ad77f
(fs/locks: don't mess with the address limit in compat_fcntl64) Signed-off-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: Sasha Levin <alexander.levin@verizon.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
0c7e787bfc
commit
6e9c2a05c3
1 changed files with 2 additions and 3 deletions
|
@ -632,9 +632,8 @@ COMPAT_SYSCALL_DEFINE3(fcntl64, unsigned int, fd, unsigned int, cmd,
|
|||
if (err)
|
||||
break;
|
||||
err = fixup_compat_flock(&flock);
|
||||
if (err)
|
||||
return err;
|
||||
err = put_compat_flock(&flock, compat_ptr(arg));
|
||||
if (!err)
|
||||
err = put_compat_flock(&flock, compat_ptr(arg));
|
||||
break;
|
||||
case F_GETLK64:
|
||||
case F_OFD_GETLK:
|
||||
|
|
Loading…
Reference in a new issue