[lvc-project] [PATCH net-next] l2tp: fix incorrect parameter validation in the pppol2tp_getsockopt() function

Tom Parkin tparkin at katalix.com
Wed Mar 6 17:32:59 MSK 2024


On  Wed, Mar 06, 2024 at 13:46:07 +0000, Gavrilov Ilia wrote:
> On 3/6/24 16:14, Tom Parkin wrote:
> > As it stands right now in the l2tp_ppp.c code, I think the check on
> > len will end up doing nothing, as you point out.
> > 
> > So moving the len check to before the min_t() call may in theory
> > possibly catch out (insane?) userspace code passing in negative
> > numbers which may "work" with the current kernel code.
> > 
> > I wonder whether its safer therefore to remove the len check
> > altogether?
> 
> Thank you for answer.
> 
> In my opinion, it is better to leave the 'len' check. This way it will 
> be easier for the user to understand where the error is.

Fair enough.

My concern was that in doing so we add a new behaviour which userspace
may notice and care about, but realistically I'm probably being
paranoid to imagine that any such userspace exists.

Thanks for your work on l2tp_ppp.c :-)

Reviewed-by: Tom Parkin <tparkin at katalix.com>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://linuxtesting.org/pipermail/lvc-project/attachments/20240306/216d8b29/attachment.pgp>


More information about the lvc-project mailing list