All of lore.kernel.org
 help / color / mirror / Atom feed
From: Matt Johnston <matt@codeconstruct.com.au>
To: Jakub Kicinski <kuba@kernel.org>
Cc: Jeremy Kerr <jk@codeconstruct.com.au>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Paolo Abeni <pabeni@redhat.com>, Simon Horman <horms@kernel.org>,
	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: Wed, 07 May 2025 11:48:28 +0800	[thread overview]
Message-ID: <eca4d35dc5aa150547317f805633abc70ae994ca.camel@codeconstruct.com.au> (raw)
In-Reply-To: <20250506192030.7228fcc9@kernel.org>

On Tue, 2025-05-06 at 19:20 -0700, Jakub Kicinski wrote:
> On Wed, 07 May 2025 10:13:19 +0800 Matt Johnston wrote:
> > > I see your point. And existing user space may expect filtering
> > > even if !cb->strict_check but family is set to AF_MCTP?  
> > 
> > Yes, given mctp_dump_addrinfo() has always applied a filter, mctp-specific
> > programs likely expect that behaviour.
> 
> Okay, so would this make all known user space happy?
> 
> 	if (!msg short) {
> 		ifindex = ifm->ifa_index
> 	} else {
> 		if (cb->strict_check)
> 			return error
> 	}

I think that would work well. Some old non-mctp programs might send a full
header but garbage ifa_index (the original reason for strict_check), but that
would just filter out some interfaces which should be OK - that userspace
wouldn't be handling AF_MCTP responses anyway. I'll give it some testing and
get a v2. Thanks for the review.

I'll have a look at nlmsg_payload() for later. 

Cheers,
Matt

      reply	other threads:[~2025-05-07  3:48 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
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 [this message]

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=eca4d35dc5aa150547317f805633abc70ae994ca.camel@codeconstruct.com.au \
    --to=matt@codeconstruct.com.au \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=jk@codeconstruct.com.au \
    --cc=kuba@kernel.org \
    --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 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.