projects
/
linux-2.6-microblaze.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f62457d
)
mctp i2c: Fix potential use-after-free
author
Matt Johnston
<matt@codeconstruct.com.au>
Fri, 25 Feb 2022 05:39:37 +0000
(13:39 +0800)
committer
Jakub Kicinski
<kuba@kernel.org>
Sat, 26 Feb 2022 06:23:29 +0000
(22:23 -0800)
The skb is handed off to netif_rx() which may free it.
Found by Smatch.
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Matt Johnston <matt@codeconstruct.com.au>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/mctp/mctp-i2c.c
patch
|
blob
|
history
diff --git
a/drivers/net/mctp/mctp-i2c.c
b/drivers/net/mctp/mctp-i2c.c
index
365c3df
..
470682c
100644
(file)
--- a/
drivers/net/mctp/mctp-i2c.c
+++ b/
drivers/net/mctp/mctp-i2c.c
@@
-338,7
+338,7
@@
static int mctp_i2c_recv(struct mctp_i2c_dev *midev)
if (status == NET_RX_SUCCESS) {
ndev->stats.rx_packets++;
- ndev->stats.rx_bytes +=
skb->
len;
+ ndev->stats.rx_bytes +=
recv
len;
} else {
ndev->stats.rx_dropped++;
}