projects
/
platform
/
kernel
/
linux-rpi.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
433c07a
)
tipc: Fix potential OOB in tipc_link_proto_rcv()
author
YueHaibing
<yuehaibing@huawei.com>
Sat, 3 Dec 2022 09:46:35 +0000
(17:46 +0800)
committer
Paolo Abeni
<pabeni@redhat.com>
Tue, 6 Dec 2022 11:58:38 +0000
(12:58 +0100)
Fix the potential risk of OOB if skb_linearize() fails in
tipc_link_proto_rcv().
Fixes: 5cbb28a4bf65 ("tipc: linearize arriving NAME_DISTR and LINK_PROTO buffers")
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Link:
https://lore.kernel.org/r/20221203094635.29024-1-yuehaibing@huawei.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
net/tipc/link.c
patch
|
blob
|
history
diff --git
a/net/tipc/link.c
b/net/tipc/link.c
index e260c0d557f5cfed3e5b54845261ccee066c7d2c..b3ce24823f50354c694da21f6c3dbad25f249294 100644
(file)
--- a/
net/tipc/link.c
+++ b/
net/tipc/link.c
@@
-2224,7
+2224,9
@@
static int tipc_link_proto_rcv(struct tipc_link *l, struct sk_buff *skb,
if (tipc_own_addr(l->net) > msg_prevnode(hdr))
l->net_plane = msg_net_plane(hdr);
- skb_linearize(skb);
+ if (skb_linearize(skb))
+ goto exit;
+
hdr = buf_msg(skb);
data = msg_data(hdr);