From: Sasha Levin <sashal@kernel.org>
To: stable@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: Pan Bian <bianpan2016@163.com>,
"David S . Miller" <davem@davemloft.net>,
Sasha Levin <sashal@kernel.org>,
netdev@vger.kernel.org
Subject: [PATCH AUTOSEL 4.14 50/69] rapidio/rionet: do not free skb before reading its length
Date: Wed, 5 Dec 2018 04:42:28 -0500 [thread overview]
Message-ID: <20181205094247.6556-50-sashal@kernel.org> (raw)
In-Reply-To: <20181205094247.6556-1-sashal@kernel.org>
From: Pan Bian <bianpan2016@163.com>
[ Upstream commit cfc435198f53a6fa1f656d98466b24967ff457d0 ]
skb is freed via dev_kfree_skb_any, however, skb->len is read then. This
may result in a use-after-free bug.
Fixes: e6161d64263 ("rapidio/rionet: rework driver initialization and removal")
Signed-off-by: Pan Bian <bianpan2016@163.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/rionet.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/rionet.c b/drivers/net/rionet.c
index e9f101c9bae2..bfbb39f93554 100644
--- a/drivers/net/rionet.c
+++ b/drivers/net/rionet.c
@@ -216,9 +216,9 @@ static int rionet_start_xmit(struct sk_buff *skb, struct net_device *ndev)
* it just report sending a packet to the target
* (without actual packet transfer).
*/
- dev_kfree_skb_any(skb);
ndev->stats.tx_packets++;
ndev->stats.tx_bytes += skb->len;
+ dev_kfree_skb_any(skb);
}
}
--
2.17.1
next prev parent reply other threads:[~2018-12-05 9:42 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20181205094247.6556-1-sashal@kernel.org>
2018-12-05 9:41 ` [PATCH AUTOSEL 4.14 09/69] netfilter: nf_tables: fix use-after-free when deleting compat expressions Sasha Levin
2018-12-05 9:41 ` [PATCH AUTOSEL 4.14 17/69] netfilter: xt_hashlimit: fix a possible memory leak in htable_create() Sasha Levin
2018-12-05 9:42 ` [PATCH AUTOSEL 4.14 32/69] bpf: fix check of allowed specifiers in bpf_trace_printk Sasha Levin
2018-12-05 9:42 ` [PATCH AUTOSEL 4.14 33/69] ipvs: call ip_vs_dst_notifier earlier than ipv6_dev_notf Sasha Levin
2018-12-05 9:42 ` [PATCH AUTOSEL 4.14 40/69] netfilter: ipv6: Preserve link scope traffic original oif Sasha Levin
2018-12-05 9:42 ` [PATCH AUTOSEL 4.14 44/69] net: thunderx: fix NULL pointer dereference in nic_remove Sasha Levin
2018-12-05 9:42 ` [PATCH AUTOSEL 4.14 46/69] netfilter: nf_tables: deactivate expressions in rule replecement routine Sasha Levin
2018-12-05 9:42 ` [PATCH AUTOSEL 4.14 48/69] igb: fix uninitialized variables Sasha Levin
2018-12-05 9:42 ` [PATCH AUTOSEL 4.14 49/69] ixgbe: recognize 1000BaseLX SFP modules as 1Gbps Sasha Levin
2018-12-05 9:42 ` Sasha Levin [this message]
2018-12-05 9:42 ` [PATCH AUTOSEL 4.14 51/69] net: hisilicon: remove unexpected free_netdev Sasha Levin
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=20181205094247.6556-50-sashal@kernel.org \
--to=sashal@kernel.org \
--cc=bianpan2016@163.com \
--cc=davem@davemloft.net \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--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).