Patch "mctp i2c: handle NULL header address" has been added to the 6.6-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    mctp i2c: handle NULL header address

to the 6.6-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     mctp-i2c-handle-null-header-address.patch
and it can be found in the queue-6.6 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit ab7dfb1d001cc24cccc2c81999765e8a4cbc7e6e
Author: Matt Johnston <matt@xxxxxxxxxxxxxxxxxxxx>
Date:   Tue Oct 22 18:25:14 2024 +0800

    mctp i2c: handle NULL header address
    
    [ Upstream commit 01e215975fd80af81b5b79f009d49ddd35976c13 ]
    
    daddr can be NULL if there is no neighbour table entry present,
    in that case the tx packet should be dropped.
    
    saddr will usually be set by MCTP core, but check for NULL in case a
    packet is transmitted by a different protocol.
    
    Fixes: f5b8abf9fc3d ("mctp i2c: MCTP I2C binding driver")
    Cc: stable@xxxxxxxxxxxxxxx
    Reported-by: Dung Cao <dung@xxxxxxxxxxxxxxxxxxxxxx>
    Signed-off-by: Matt Johnston <matt@xxxxxxxxxxxxxxxxxxxx>
    Reviewed-by: Simon Horman <horms@xxxxxxxxxx>
    Link: https://patch.msgid.link/20241022-mctp-i2c-null-dest-v3-1-e929709956c5@xxxxxxxxxxxxxxxxxxxx
    Signed-off-by: Jakub Kicinski <kuba@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/net/mctp/mctp-i2c.c b/drivers/net/mctp/mctp-i2c.c
index b37a9e4bade4a..20b8d7d528baf 100644
--- a/drivers/net/mctp/mctp-i2c.c
+++ b/drivers/net/mctp/mctp-i2c.c
@@ -547,6 +547,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);
 




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux