Subject: Re: [PATCH net-next RFC 0/3] net: move .getsockopt away from __user buffers

From: David Laight <[email-masked]>
Date: Sat, 31 Jan 2026 15:37:35 +0000

On Fri, 30 Jan 2026 17:19:55 -0800
Linus Torvalds <[email-masked]> wrote:

> On Fri, 30 Jan 2026 at 14:40, David Laight <[email-masked]> wrote:
> >
> > There is not much point making the 'optval' parameter more than
> > a structure of a user and kernel address - one of which will be NULL.  
> 
> That's exactly what we do *NOT* want. Because people will get it
> wrong, and then we're back to the bad old days where trivial bugs
> result in security issues.

It can still be a (semi-)transparent structure that code isn't allowed to change.
That is no different from using iov_iter.

> Can you point to an actual case where setsockopt / getsockopt would be
> performance-critical? Typically you do it once or twice.

IIRC a really horrid one - I think for async io.
That is also one of the few where the supplied length is a lie.

	David

>               Linus