From: Breno Leitao <leitao@debian.org>
To: David Heidelberg <david@ixit.cz>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>,
Paolo Abeni <pabeni@redhat.com>, Simon Horman <horms@kernel.org>
Cc: oe-linux-nfc@lists.linux.dev, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org, sdf.kernel@gmail.com,
Breno Leitao <leitao@debian.org>,
kernel-team@meta.com
Subject: [PATCH net-next 1/2] nfc: llcp: widen getsockopt value locals to u32
Date: Wed, 08 Jul 2026 04:51:58 -0700 [thread overview]
Message-ID: <20260708-getsockopt_phase3-v1-1-d8394f2fc554@debian.org> (raw)
In-Reply-To: <20260708-getsockopt_phase3-v1-0-d8394f2fc554@debian.org>
nfc_llcp_getsockopt() returns each option as a u32 (written through a
(u32 __user *) cast), but the temporary variables are smaller than that,
and they are promoted at write side, example:
u8 rw;
put_user(rw, (u32 __user *) optval)
That is fine, but I want to widen the rw/miux/remote_miu locals from
u8/u16 to u32 so the following getsockopt_iter conversion can pass their
address to copy_to_iter(), which expects an object of the exact width.
No functional change.
PS: I am sending this as a separated patch to make sure this conversion
explictly reviewable.
Signed-off-by: Breno Leitao <leitao@debian.org>
---
net/nfc/llcp_sock.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/net/nfc/llcp_sock.c b/net/nfc/llcp_sock.c
index 5558d8a4d48b3..94850fbe3620d 100644
--- a/net/nfc/llcp_sock.c
+++ b/net/nfc/llcp_sock.c
@@ -308,8 +308,7 @@ static int nfc_llcp_getsockopt(struct socket *sock, int level, int optname,
struct sock *sk = sock->sk;
struct nfc_llcp_sock *llcp_sock = nfc_llcp_sock(sk);
int len, err = 0;
- u16 miux, remote_miu;
- u8 rw;
+ u32 miux, remote_miu, rw;
pr_debug("%p optname %d\n", sk, optname);
--
2.53.0-Meta
next prev parent reply other threads:[~2026-07-08 11:52 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-08 11:51 [PATCH net-next 0/2] nfc: llcp: Move to .getsockopt_iter Breno Leitao
2026-07-08 11:51 ` Breno Leitao [this message]
2026-07-08 11:51 ` [PATCH net-next 2/2] nfc: llcp: convert to getsockopt_iter Breno Leitao
2026-07-30 13:07 ` [PATCH net-next 0/2] nfc: llcp: Move to .getsockopt_iter 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=20260708-getsockopt_phase3-v1-1-d8394f2fc554@debian.org \
--to=leitao@debian.org \
--cc=davem@davemloft.net \
--cc=david@ixit.cz \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=kernel-team@meta.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=oe-linux-nfc@lists.linux.dev \
--cc=pabeni@redhat.com \
--cc=sdf.kernel@gmail.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.