Linux s390 Architecture development
 help / color / mirror / Atom feed
* [PATCH net-next] net/smc: validate smc_diag_req length before reading diag_ext
@ 2026-11-20 11:37 Mahanta Jambigi
  2026-11-20 11:40 ` sashiko-bot
  2026-11-20 11:43 ` netdev-bot+sinfo
  0 siblings, 2 replies; 3+ messages in thread
From: Mahanta Jambigi @ 2026-11-20 11:37 UTC (permalink / raw)
  To: andrew+netdev, davem, edumazet, kuba, pabeni, alibuda, dust.li,
	sidraya
  Cc: hidayath, pasic, horms, tonylu, guwen, netdev, linux-s390,
	linux-rdma, Mahanta Jambigi

__sock_diag_cmd() only validates nlmsg_len against sizeof(struct
sock_diag_req) (2 bytes). smc_diag_handler_dump() schedules a dump
without a further check, so the dump path reads diag_ext at offset 3 of
struct smc_diag_req from uninitialised skb tailroom. Add the missing
nlmsg_len guard, matching every other sock_diag handler.

Fixes: f16a7dd5cf27 ("smc: netlink interface for SMC sockets")
Signed-off-by: Mahanta Jambigi <mjambigi@linux.ibm.com>
---
 net/smc/smc_diag.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/net/smc/smc_diag.c b/net/smc/smc_diag.c
index 15485a08d9a0..ed578279dcd0 100644
--- a/net/smc/smc_diag.c
+++ b/net/smc/smc_diag.c
@@ -245,6 +245,9 @@ static int smc_diag_handler_dump(struct sk_buff *skb, struct nlmsghdr *h)
 {
 	struct net *net = sock_net(skb->sk);

+	if (nlmsg_len(h) < sizeof(struct smc_diag_req))
+		return -EINVAL;
+
 	if (h->nlmsg_type == SOCK_DIAG_BY_FAMILY &&
 	    h->nlmsg_flags & NLM_F_DUMP) {
 		{
-- 
2.50.1 (Apple Git-155)


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH net-next] net/smc: validate smc_diag_req length before reading diag_ext
  2026-11-20 11:37 [PATCH net-next] net/smc: validate smc_diag_req length before reading diag_ext Mahanta Jambigi
@ 2026-11-20 11:40 ` sashiko-bot
  2026-11-20 11:43 ` netdev-bot+sinfo
  1 sibling, 0 replies; 3+ messages in thread
From: sashiko-bot @ 2026-11-20 11:40 UTC (permalink / raw)
  To: Mahanta Jambigi
  Cc: linux-s390, linux-rdma, Heiko Carstens, Vasily Gorbik,
	Alexander Gordeev, Christian Borntraeger

> __sock_diag_cmd() only validates nlmsg_len against sizeof(struct
> sock_diag_req) (2 bytes). smc_diag_handler_dump() schedules a dump
> without a further check, so the dump path reads diag_ext at offset 3 of
> struct smc_diag_req from uninitialised skb tailroom. Add the missing
> nlmsg_len guard, matching every other sock_diag handler.
> 
> Fixes: f16a7dd5cf27 ("smc: netlink interface for SMC sockets")
> Signed-off-by: Mahanta Jambigi <mjambigi@linux.ibm.com>

Sashiko has reviewed this patch and found no issues.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261120113708.3950966-1-mjambigi@linux.ibm.com?part=1


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH net-next] net/smc: validate smc_diag_req length before reading diag_ext
  2026-11-20 11:37 [PATCH net-next] net/smc: validate smc_diag_req length before reading diag_ext Mahanta Jambigi
  2026-11-20 11:40 ` sashiko-bot
@ 2026-11-20 11:43 ` netdev-bot+sinfo
  1 sibling, 0 replies; 3+ messages in thread
From: netdev-bot+sinfo @ 2026-11-20 11:43 UTC (permalink / raw)
  To: Mahanta Jambigi
  Cc: andrew+netdev, davem, edumazet, kuba, pabeni, alibuda, dust.li,
	sidraya, hidayath, pasic, horms, tonylu, guwen, netdev,
	linux-s390, linux-rdma

Hi!

This is an automated message. This series looks like a fix, but its
commit messages seem to be missing some information:

 - How the issue was discovered, e.g. hit in production, hit during
   development, syzbot report, manual code inspection, LLM or static
   analysis tool scan.

 - Whether the issue was actually triggered, or is only theoretical
   (e.g. found by LLM and not proven at runtime). If it was triggered
   please include the symptoms, like the stack trace or kernel messages.

Please do not repost the series just to address the above. Instead,
reply to this email with the missing information, so that reviewers
can take it into account.

*IMPORTANT*: If you do repost (for other reasons) - please include
the relevant info in the cover letter or commit messages.
-- 
The evaluation is done by an LLM so it may be wrong, if you think
that is the case please reply and explain.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-11-20 11:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-20 11:37 [PATCH net-next] net/smc: validate smc_diag_req length before reading diag_ext Mahanta Jambigi
2026-11-20 11:40 ` sashiko-bot
2026-11-20 11:43 ` netdev-bot+sinfo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox