From: Simon Horman <horms@kernel.org>
To: matt@codeconstruct.com.au
Cc: Jeremy Kerr <jk@codeconstruct.com.au>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
netdev@vger.kernel.org, stable@vger.kernel.org,
Dung Cao <dung@os.amperecomputing.com>
Subject: Re: [PATCH net] mctp i2c: handle NULL header address
Date: Fri, 18 Oct 2024 21:06:06 +0100 [thread overview]
Message-ID: <20241018200606.GC1697@kernel.org> (raw)
In-Reply-To: <20241018-mctp-i2c-null-dest-v1-1-ba1ab52966e9@codeconstruct.com.au>
On Fri, Oct 18, 2024 at 11:07:56AM +0800, Matt Johnston via B4 Relay wrote:
> From: Matt Johnston <matt@codeconstruct.com.au>
>
> daddr can be NULL if there is no neighbour table entry present,
> in that case the tx packet should be dropped.
Hi Matt,
Is there also a situation where saddr can be null?
The patch adds that check but it isn't mentioned here.
>
> Fixes: f5b8abf9fc3d ("mctp i2c: MCTP I2C binding driver")
> Cc: stable@vger.kernel.org
> Reported-by: Dung Cao <dung@os.amperecomputing.com>
> Signed-off-by: Matt Johnston <matt@codeconstruct.com.au>
> ---
> drivers/net/mctp/mctp-i2c.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git drivers/net/mctp/mctp-i2c.c drivers/net/mctp/mctp-i2c.c
> index 4dc057c121f5..e70fb6687994 100644
> --- drivers/net/mctp/mctp-i2c.c
> +++ drivers/net/mctp/mctp-i2c.c
Unfortunately tooling expects an extra level of the directory hierarchy,
something like the following. And is unable to apply this patch in
it's current form.
diff --git a/drivers/net/mctp/mctp-i2c.c b/drivers/net/mctp/mctp-i2c.c
index 4dc057c121f5..e70fb6687994 100644
--- a/drivers/net/mctp/mctp-i2c.c
+++ b/drivers/net/mctp/mctp-i2c.c
> @@ -588,6 +588,9 @@ static int mctp_i2c_header_create(struct sk_buff *skb, struct net_device *dev,
> if (len > MCTP_I2C_MAXMTU)
> return -EMSGSIZE;
>
> + if (!daddr || !saddr)
> + return -EINVAL;
> +
> lldst = *((u8 *)daddr);
> llsrc = *((u8 *)saddr);
>
>
> ---
--
pw-bot: changes-requested
next prev parent reply other threads:[~2024-10-18 20:06 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-18 3:07 [PATCH net] mctp i2c: handle NULL header address Matt Johnston via B4 Relay
2024-10-18 20:06 ` Simon Horman [this message]
2024-10-19 4:03 ` 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=20241018200606.GC1697@kernel.org \
--to=horms@kernel.org \
--cc=davem@davemloft.net \
--cc=dung@os.amperecomputing.com \
--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=stable@vger.kernel.org \
/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).