lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Wed, 20 May 2015 13:16:21 -0500
From:	Steve French <smfrench@...il.com>
To:	Jeff Layton <jeff.layton@...marydata.com>
Cc:	Chengyu Song <csong84@...ech.edu>,
	Steve French <sfrench@...ba.org>,
	"linux-cifs@...r.kernel.org" <linux-cifs@...r.kernel.org>,
	samba-technical <samba-technical@...ts.samba.org>,
	LKML <linux-kernel@...r.kernel.org>, taesoo@...ech.edu,
	changwoo@...ech.edu, sanidhya@...ech.edu,
	Byoungyoung Lee <blee@...ech.edu>,
	Pavel Shilovsky <piastryyy@...il.com>
Subject: Re: [PATCH 1/1] cifs: potential missing check for posix_lock_file_wait

merged into cifs-2.6.git for-next

On Fri, Apr 3, 2015 at 7:11 AM, Jeff Layton <jeff.layton@...marydata.com> wrote:
> On Tue, 24 Mar 2015 20:18:49 -0400
> Chengyu Song <csong84@...ech.edu> wrote:
>
>> posix_lock_file_wait may fail under certain circumstances, and its result is
>> usually checked/returned. But given the complexity of cifs, I'm not sure if
>> the result is intentially left unchecked and always expected to succeed.
>>
>> Signed-off-by: Chengyu Song <csong84@...ech.edu>
>> ---
>>  fs/cifs/file.c | 4 ++--
>>  1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/fs/cifs/file.c b/fs/cifs/file.c
>> index a94b3e6..beef67b 100644
>> --- a/fs/cifs/file.c
>> +++ b/fs/cifs/file.c
>> @@ -1553,8 +1553,8 @@ cifs_setlk(struct file *file, struct file_lock *flock, __u32 type,
>>               rc = server->ops->mand_unlock_range(cfile, flock, xid);
>>
>>  out:
>> -     if (flock->fl_flags & FL_POSIX)
>> -             posix_lock_file_wait(file, flock);
>> +     if (flock->fl_flags & FL_POSIX && !rc)
>> +             rc = posix_lock_file_wait(file, flock);
>>       return rc;
>>  }
>>
>
> (cc'ing Pavel since he wrote a lot of this code)
>
> I think your patch looks correct -- if we (for instance) get a memory
> allocation failure while trying to set the local lock then I think we
> probably don't want to return success. So...
>
>     Acked-by: Jeff Layton <jeff.layton@...marydata.com>



-- 
Thanks,

Steve
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ