From: Breno Leitao <leitao@debian.org>
To: Paolo Abeni <pabeni@redhat.com>
Cc: Chas Williams <3chas3@gmail.com>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>,
Simon Horman <horms@kernel.org>,
Magnus Karlsson <magnus.karlsson@intel.com>,
Maciej Fijalkowski <maciej.fijalkowski@intel.com>,
Stanislav Fomichev <sdf@fomichev.me>,
Alexei Starovoitov <ast@kernel.org>,
Daniel Borkmann <daniel@iogearbox.net>,
Jesper Dangaard Brouer <hawk@kernel.org>,
John Fastabend <john.fastabend@gmail.com>,
Jon Maloy <jmaloy@redhat.com>,
Alexandra Winter <wintera@linux.ibm.com>,
Thorsten Winkler <twinkler@linux.ibm.com>,
James Chapman <jchapman@katalix.com>,
David Howells <dhowells@redhat.com>,
Marc Dionne <marc.dionne@auristor.com>,
David Heidelberg <david+nfc@ixit.cz>,
Samuel Ortiz <sameo@linux.intel.com>,
linux-atm-general@lists.sourceforge.net, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org, bpf@vger.kernel.org,
tipc-discussion@lists.sourceforge.net,
linux-s390@vger.kernel.org, linux-afs@lists.infradead.org,
oe-linux-nfc@lists.linux.dev, kernel-team@meta.com
Subject: Re: [PATCH net-next v2 3/7] atm: convert to getsockopt_iter
Date: Wed, 20 May 2026 08:50:54 -0700 [thread overview]
Message-ID: <ag3XTX5rXE4tNbsT@gmail.com> (raw)
In-Reply-To: <eada2df3-7e3f-46a5-b290-fe0e8975a1bb@redhat.com>
Hello Paolo,
On Tue, May 19, 2026 at 04:04:12PM +0200, Paolo Abeni wrote:
> On 5/15/26 10:32 AM, Breno Leitao wrote:
> > @@ -797,13 +798,13 @@ int vcc_setsockopt(struct socket *sock, int level, int optname,
> > }
> >
> > int vcc_getsockopt(struct socket *sock, int level, int optname,
> > - char __user *optval, int __user *optlen)
> > + sockopt_t *opt)
> > {
> > struct atm_vcc *vcc;
> > + int val;
>
> I *think* you should use 'unsigned long' here to avoid user-visible
> changes due to put_user() replacement.
I initially used 'unsigned long' in v1, but that proved incorrect and was
flagged by sashiko:
https://lore.kernel.org/all/agXhTGVurhrJmBNu@gmail.com/
The issue is that we need a 4-byte operation here since both __SO_SIZE
and SO_SETCLP are 4 bytes. Using an 8-byte type causes copy_to_iter() to
truncate the copy to 4 bytes while returning 4, which could result in
copying the upper portion of the 8-byte value (potentially all zeros,
depending on endianness).
Thanks for the review,
--breno
next prev parent reply other threads:[~2026-05-20 15:51 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-15 8:32 [PATCH net-next v2 0/7] net: convert atm/xdp/af_iucv/l2tp_ppp/rxrpc/tipc to getsockopt_iter Breno Leitao
2026-05-15 8:32 ` [PATCH net-next v2 1/7] af_iucv: take socket lock around SO_MSGSIZE getsockopt Breno Leitao
2026-05-15 20:45 ` Stanislav Fomichev
2026-05-18 12:00 ` Alexandra Winter
2026-05-20 16:03 ` Breno Leitao
2026-05-20 16:49 ` Breno Leitao
2026-05-16 8:34 ` sashiko-bot
2026-05-20 16:14 ` Breno Leitao
2026-05-15 8:32 ` [PATCH net-next v2 2/7] af_iucv: convert to getsockopt_iter Breno Leitao
2026-05-18 12:00 ` Alexandra Winter
2026-05-15 8:32 ` [PATCH net-next v2 3/7] atm: " Breno Leitao
2026-05-19 14:04 ` Paolo Abeni
2026-05-20 15:50 ` Breno Leitao [this message]
2026-05-15 8:32 ` [PATCH net-next v2 4/7] xdp: " Breno Leitao
2026-05-15 8:32 ` [PATCH net-next v2 5/7] l2tp: ppp: " Breno Leitao
2026-05-15 8:32 ` [PATCH net-next v2 6/7] rxrpc: " Breno Leitao
2026-05-15 8:32 ` [PATCH net-next v2 7/7] tipc: " Breno Leitao
2026-05-19 14:08 ` Paolo Abeni
2026-05-20 15:51 ` Breno Leitao
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ag3XTX5rXE4tNbsT@gmail.com \
--to=leitao@debian.org \
--cc=3chas3@gmail.com \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=davem@davemloft.net \
--cc=david+nfc@ixit.cz \
--cc=dhowells@redhat.com \
--cc=edumazet@google.com \
--cc=hawk@kernel.org \
--cc=horms@kernel.org \
--cc=jchapman@katalix.com \
--cc=jmaloy@redhat.com \
--cc=john.fastabend@gmail.com \
--cc=kernel-team@meta.com \
--cc=kuba@kernel.org \
--cc=linux-afs@lists.infradead.org \
--cc=linux-atm-general@lists.sourceforge.net \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-s390@vger.kernel.org \
--cc=maciej.fijalkowski@intel.com \
--cc=magnus.karlsson@intel.com \
--cc=marc.dionne@auristor.com \
--cc=netdev@vger.kernel.org \
--cc=oe-linux-nfc@lists.linux.dev \
--cc=pabeni@redhat.com \
--cc=sameo@linux.intel.com \
--cc=sdf@fomichev.me \
--cc=tipc-discussion@lists.sourceforge.net \
--cc=twinkler@linux.ibm.com \
--cc=wintera@linux.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.