OSDN Git Service
(root)
/
tomoyo
/
tomoyo-test1.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d4edb50
)
net: dsa: sja1105: Check return value
author
Artem Chernyshev
<artem.chernyshev@red-soft.ru>
Thu, 1 Dec 2022 14:00:32 +0000
(17:00 +0300)
committer
Jakub Kicinski
<kuba@kernel.org>
Sat, 3 Dec 2022 04:46:52 +0000
(20:46 -0800)
Return NULL if we got unexpected value from skb_trim_rcsum() in
sja1110_rcv_inband_control_extension()
Fixes:
4913b8ebf8a9
("net: dsa: add support for the SJA1110 native tagging protocol")
Signed-off-by: Artem Chernyshev <artem.chernyshev@red-soft.ru>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Link:
https://lore.kernel.org/r/20221201140032.26746-3-artem.chernyshev@red-soft.ru
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/dsa/tag_sja1105.c
patch
|
blob
|
history
diff --git
a/net/dsa/tag_sja1105.c
b/net/dsa/tag_sja1105.c
index
83e4136
..
1a85125
100644
(file)
--- a/
net/dsa/tag_sja1105.c
+++ b/
net/dsa/tag_sja1105.c
@@
-665,7
+665,8
@@
static struct sk_buff *sja1110_rcv_inband_control_extension(struct sk_buff *skb,
* padding and trailer we need to account for the fact that
* skb->data points to skb_mac_header(skb) + ETH_HLEN.
*/
- pskb_trim_rcsum(skb, start_of_padding - ETH_HLEN);
+ if (pskb_trim_rcsum(skb, start_of_padding - ETH_HLEN))
+ return NULL;
/* Trap-to-host frame, no timestamp trailer */
} else {
*source_port = SJA1110_RX_HEADER_SRC_PORT(rx_header);