netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Simon Horman <horms@kernel.org>
To: Jakub Kicinski <kuba@kernel.org>
Cc: Matt Johnston <matt@codeconstruct.com.au>,
	Jeremy Kerr <jk@codeconstruct.com.au>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Paolo Abeni <pabeni@redhat.com>,
	netdev@vger.kernel.org,
	syzbot+e76d52dadc089b9d197f@syzkaller.appspotmail.com,
	syzbot+1065a199625a388fce60@syzkaller.appspotmail.com
Subject: Re: [PATCH net] net: mctp: Don't access ifa_index when missing
Date: Thu, 8 May 2025 18:10:35 +0100	[thread overview]
Message-ID: <20250508171035.GM3339421@horms.kernel.org> (raw)
In-Reply-To: <20250506175830.15aefdbb@kernel.org>

On Tue, May 06, 2025 at 05:58:30PM -0700, Jakub Kicinski wrote:
> On Tue, 6 May 2025 17:07:53 +0100 Simon Horman wrote:
> > > +	if (cb->nlh->nlmsg_len >= nlmsg_msg_size(sizeof(*hdr))) {
> > > +		hdr = nlmsg_data(cb->nlh);  
> > 
> > FWIIW, I think the scope of the declaration of hdr can be reduced to this block.
> > (Less positive ease, so to speak.)
> 
> We wouldn't be able to sizeof(*hdr) if we move it?

Yes, of course.
Sorry for missing that.

> 
> I have a different request :) Matt, once this ends up in net-next
> (end of this week) could you refactor it to use nlmsg_payload() ?
> It doesn't exist in net but this is exactly why it was added.
> 

  reply	other threads:[~2025-05-08 17:10 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-05  9:05 [PATCH net] net: mctp: Don't access ifa_index when missing Matt Johnston
2025-05-06 16:07 ` Simon Horman
2025-05-07  0:58   ` Jakub Kicinski
2025-05-08 17:10     ` Simon Horman [this message]
2025-05-07  1:06 ` Jakub Kicinski
2025-05-07  1:24   ` Matt Johnston
2025-05-07  1:41     ` Jakub Kicinski
2025-05-07  2:13       ` Matt Johnston
2025-05-07  2:20         ` Jakub Kicinski
2025-05-07  3:48           ` Matt Johnston

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=20250508171035.GM3339421@horms.kernel.org \
    --to=horms@kernel.org \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=jk@codeconstruct.com.au \
    --cc=kuba@kernel.org \
    --cc=matt@codeconstruct.com.au \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=syzbot+1065a199625a388fce60@syzkaller.appspotmail.com \
    --cc=syzbot+e76d52dadc089b9d197f@syzkaller.appspotmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).