Re: [RFC PATCH 0/4] net/io_uring: pass a kernel pointer via optlen_t to proto[_ops].getsockopt()

David Laight <[email protected]> Wed, 2 Apr 2025 13:35:20 +0100
Newsgroups gmane.linux.kernel.virtualization,gmane.linux.network,gmane.linux.kernel,gmane.linux.hams,gmane.linux.bluez.kernel,gmane.linux.can,gmane.linux.drivers.rdma,gmane.network.tipc.general,gmane.linux.x25,gmane.linux.kernel.bpf,gmane.linux.isdn.i4l.user,gmane.linux.kernel.io-uring
Message-ID <20250402133520.40451468@pumpkin>
On Tue, 1 Apr 2025 17:40:19 -0700
Linus Torvalds <[email protected]> wrote:

> "
> 
> On Mon, 31 Mar 2025 at 13:11, Stefan Metzmacher <[email protected]> wrote:
> >
> > But as Linus don't like 'sockptr_t' I used a different approach.  
> 
> So the sockptr_t thing has already happened. I hate it, and I think
> it's ugly as hell, but it is what it is.
> 
> I think it's a complete hack and having that "kernel or user" pointer
> flag is disgusting.

I have proposed a patch which replaced it with a structure.
That showed up some really hacky code in IIRC io_uring.

Using sockptr_t for the buffer was one thing, the generic code
can't copy the buffer to/from user because code lies about the length.

But using for the length is just brain-dead.
That is fixed size and can be copied from/to user by the wrapper.
The code bloat reduction will be significant.

	David