lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHk-=wi7p9bKgZt1E1BWE-NjwSRDBQs=Coviiz0ZTQy9OhHvPg@mail.gmail.com>
Date: Wed, 2 Apr 2025 14:07:54 -0700
From: Linus Torvalds <torvalds@...ux-foundation.org>
To: David Laight <david.laight.linux@...il.com>
Cc: Stanislav Fomichev <stfomichev@...il.com>, Stefan Metzmacher <metze@...ba.org>, 
	Breno Leitao <leitao@...ian.org>, Jens Axboe <axboe@...nel.dk>, 
	Pavel Begunkov <asml.silence@...il.com>, Jakub Kicinski <kuba@...nel.org>, Christoph Hellwig <hch@....de>, 
	Karsten Keil <isdn@...ux-pingi.de>, Ayush Sawal <ayush.sawal@...lsio.com>, 
	Andrew Lunn <andrew+netdev@...n.ch>, "David S. Miller" <davem@...emloft.net>, 
	Eric Dumazet <edumazet@...gle.com>, Paolo Abeni <pabeni@...hat.com>, Simon Horman <horms@...nel.org>, 
	Kuniyuki Iwashima <kuniyu@...zon.com>, Willem de Bruijn <willemb@...gle.com>, David Ahern <dsahern@...nel.org>, 
	Marcelo Ricardo Leitner <marcelo.leitner@...il.com>, Xin Long <lucien.xin@...il.com>, 
	Neal Cardwell <ncardwell@...gle.com>, Joerg Reuter <jreuter@...na.de>, 
	Marcel Holtmann <marcel@...tmann.org>, Johan Hedberg <johan.hedberg@...il.com>, 
	Luiz Augusto von Dentz <luiz.dentz@...il.com>, Oliver Hartkopp <socketcan@...tkopp.net>, 
	Marc Kleine-Budde <mkl@...gutronix.de>, Robin van der Gracht <robin@...tonic.nl>, 
	Oleksij Rempel <o.rempel@...gutronix.de>, kernel@...gutronix.de, 
	Alexander Aring <alex.aring@...il.com>, Stefan Schmidt <stefan@...enfreihafen.org>, 
	Miquel Raynal <miquel.raynal@...tlin.com>, Alexandra Winter <wintera@...ux.ibm.com>, 
	Thorsten Winkler <twinkler@...ux.ibm.com>, James Chapman <jchapman@...alix.com>, 
	Jeremy Kerr <jk@...econstruct.com.au>, Matt Johnston <matt@...econstruct.com.au>, 
	Matthieu Baerts <matttbe@...nel.org>, Mat Martineau <martineau@...nel.org>, 
	Geliang Tang <geliang@...nel.org>, Krzysztof Kozlowski <krzk@...nel.org>, 
	Remi Denis-Courmont <courmisch@...il.com>, Allison Henderson <allison.henderson@...cle.com>, 
	David Howells <dhowells@...hat.com>, Marc Dionne <marc.dionne@...istor.com>, 
	Wenjia Zhang <wenjia@...ux.ibm.com>, Jan Karcher <jaka@...ux.ibm.com>, 
	"D. Wythe" <alibuda@...ux.alibaba.com>, Tony Lu <tonylu@...ux.alibaba.com>, 
	Wen Gu <guwen@...ux.alibaba.com>, Jon Maloy <jmaloy@...hat.com>, 
	Boris Pismenny <borisp@...dia.com>, John Fastabend <john.fastabend@...il.com>, 
	Stefano Garzarella <sgarzare@...hat.com>, Martin Schiller <ms@....tdt.de>, Björn Töpel <bjorn@...nel.org>, 
	Magnus Karlsson <magnus.karlsson@...el.com>, 
	Maciej Fijalkowski <maciej.fijalkowski@...el.com>, Jonathan Lemon <jonathan.lemon@...il.com>, 
	Alexei Starovoitov <ast@...nel.org>, Daniel Borkmann <daniel@...earbox.net>, 
	Jesper Dangaard Brouer <hawk@...nel.org>, netdev@...r.kernel.org, linux-kernel@...r.kernel.org, 
	linux-sctp@...r.kernel.org, linux-hams@...r.kernel.org, 
	linux-bluetooth@...r.kernel.org, linux-can@...r.kernel.org, 
	dccp@...r.kernel.org, linux-wpan@...r.kernel.org, linux-s390@...r.kernel.org, 
	mptcp@...ts.linux.dev, linux-rdma@...r.kernel.org, rds-devel@....oracle.com, 
	linux-afs@...ts.infradead.org, tipc-discussion@...ts.sourceforge.net, 
	virtualization@...ts.linux.dev, linux-x25@...r.kernel.org, 
	bpf@...r.kernel.org, isdn4linux@...tserv.isdn4linux.de, 
	io-uring@...r.kernel.org
Subject: Re: [RFC PATCH 0/4] net/io_uring: pass a kernel pointer via optlen_t
 to proto[_ops].getsockopt()

On Wed, 2 Apr 2025 at 13:46, David Laight <david.laight.linux@...il.com> wrote:
>
> The problem is that the generic code has to deal with all the 'wild stuff'.
> It is also common to do non-sequential accesses - so iov_iter doesn't match
> at all.
> There also isn't a requirement for scatter-gather.

Note that the generic code has special cases for the simple stuff,
which is all that the sockopt code would need.

Now, that's _particularly_ true for the "single user address range"
thing, where there's a special ITER_UBUF thing.

We don't actually have a "single kernel range" version of that, but
ITER_KVEC is simple to use, and the sockopt code could say "I only
ever look at the first buffer".

It's ok to just not handle all the cases, and you don't *have* to use
the generic "copy_from_iter()" routines if you don't want to.

In fact, I would expect that something like sockopt generally wouldn't
want to use the normal iter copying routines, since those are
basically all geared towards "copy and update the iter".

           Linus

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ