Return-Path: Received: from mail.etersoft.ru ([91.232.225.46]:51388 "EHLO mail.etersoft.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756089AbdKNTZZ (ORCPT ); Tue, 14 Nov 2017 14:25:25 -0500 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable Date: Tue, 14 Nov 2017 22:25:23 +0300 From: Vitaly Lipatov To: Jeff Layton Cc: wine-patches , "J. Bruce Fields" , Alexander Viro , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Christoph Hellwig Subject: Re: [PATCH v3] fs/fcntl: restore checking against COMPAT_LOFF_T_MAX for F_GETLK64 In-Reply-To: <1510686778.4757.11.camel@kernel.org> References: <20171114134715.21649-1-lav@etersoft.ru> <20171114164818.6783-1-lav@etersoft.ru> <1510686778.4757.11.camel@kernel.org> Message-ID: Sender: linux-fsdevel-owner@vger.kernel.org List-ID: Jeff Layton =D0=BF=D0=B8=D1=81=D0=B0=D0=BB 14.11.17 22:12: =2E.. > Wait... >=20 > Does this do anything at all in the case where you pass in > COMPAT_LOFF_T_MAX? l_start and l_len are either off_t or loff_t > (depending on arch). >=20 > Either one will fit in the F_GETLK64/F_OFD_GETLK struct, so I don't see > a need to check here. I am not sure, can off_t be bigger than loff_t ? If not, we have just skip checking against COMPAT_LOFF_T_MAX. =2E.. >> @@ -644,7 +644,7 @@ COMPAT_SYSCALL_DEFINE3(fcntl64, unsigned int, fd,=20 >> unsigned int, cmd, >> err =3D fcntl_getlk(f.file, convert_fcntl_cmd(cmd), &flock); >> if (err) >> break; >> - err =3D fixup_compat_flock(&flock); >> + err =3D fixup_compat_flock(&flock, COMPAT_LOFF_T_MAX); >> if (err) >> return err; >> err =3D put_compat_flock64(&flock, compat_ptr(arg)); >=20 > Maybe a simpler fix would be to just remove the fixup_compat_flock call > above? >=20 > PS: if you send any more patches, please cc Christoph. He did the Ok. --=20 =D0=A1 =D1=83=D0=B2=D0=B0=D0=B6=D0=B5=D0=BD=D0=B8=D0=B5=D0=BC, =D0=92=D0=B8=D1=82=D0=B0=D0=BB=D0=B8=D0=B9 =D0=9B=D0=B8=D0=BF=D0=B0=D1=82= =D0=BE=D0=B2, Etersoft