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 org.kernel.vger.dccp,dev.linux.lists.mptcp,dev.linux.lists.virtualization,org.kernel.vger.bpf,org.kernel.vger.io-uring,org.kernel.vger.linux-bluetooth,org.kernel.vger.linux-can,org.kernel.vger.linux-hams,org.kernel.vger.linux-kernel,org.kernel.vger.linux-rdma,org.kernel.vger.linux-s390,org.kernel.vger.linux-sctp,org.kernel.vger.linux-wpan,org.kernel.vger.linux-x25,org.kernel.vger.netdev
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