* [PATCH net] tipc: check skb_linearize() return value in tipc_disc_rcv()
@ 2022-11-19 7:28 YueHaibing
2022-11-22 0:48 ` Jon Maloy
2022-11-22 5:00 ` patchwork-bot+netdevbpf
0 siblings, 2 replies; 3+ messages in thread
From: YueHaibing @ 2022-11-19 7:28 UTC (permalink / raw)
To: jmaloy, ying.xue, davem, edumazet, kuba, pabeni
Cc: netdev, tipc-discussion, linux-kernel, YueHaibing
If skb_linearize() fails in tipc_disc_rcv(), we need to free the skb instead of
handle it.
Fixes: 25b0b9c4e835 ("tipc: handle collisions of 32-bit node address hash values")
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
net/tipc/discover.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/net/tipc/discover.c b/net/tipc/discover.c
index e8630707901e..e8dcdf267c0c 100644
--- a/net/tipc/discover.c
+++ b/net/tipc/discover.c
@@ -211,7 +211,10 @@ void tipc_disc_rcv(struct net *net, struct sk_buff *skb,
u32 self;
int err;
- skb_linearize(skb);
+ if (skb_linearize(skb)) {
+ kfree_skb(skb);
+ return;
+ }
hdr = buf_msg(skb);
if (caps & TIPC_NODE_ID128)
--
2.17.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH net] tipc: check skb_linearize() return value in tipc_disc_rcv()
2022-11-19 7:28 [PATCH net] tipc: check skb_linearize() return value in tipc_disc_rcv() YueHaibing
@ 2022-11-22 0:48 ` Jon Maloy
2022-11-22 5:00 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: Jon Maloy @ 2022-11-22 0:48 UTC (permalink / raw)
To: YueHaibing, ying.xue, davem, edumazet, kuba, pabeni
Cc: netdev, tipc-discussion, linux-kernel
On 11/19/22 02:28, YueHaibing wrote:
> If skb_linearize() fails in tipc_disc_rcv(), we need to free the skb instead of
> handle it.
>
> Fixes: 25b0b9c4e835 ("tipc: handle collisions of 32-bit node address hash values")
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
> ---
> net/tipc/discover.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/net/tipc/discover.c b/net/tipc/discover.c
> index e8630707901e..e8dcdf267c0c 100644
> --- a/net/tipc/discover.c
> +++ b/net/tipc/discover.c
> @@ -211,7 +211,10 @@ void tipc_disc_rcv(struct net *net, struct sk_buff *skb,
> u32 self;
> int err;
>
> - skb_linearize(skb);
> + if (skb_linearize(skb)) {
> + kfree_skb(skb);
> + return;
> + }
> hdr = buf_msg(skb);
>
> if (caps & TIPC_NODE_ID128)
Acked-by: Jon Maloy <jmaloy@redhat.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH net] tipc: check skb_linearize() return value in tipc_disc_rcv()
2022-11-19 7:28 [PATCH net] tipc: check skb_linearize() return value in tipc_disc_rcv() YueHaibing
2022-11-22 0:48 ` Jon Maloy
@ 2022-11-22 5:00 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2022-11-22 5:00 UTC (permalink / raw)
To: YueHaibing
Cc: jmaloy, ying.xue, davem, edumazet, kuba, pabeni, netdev,
tipc-discussion, linux-kernel
Hello:
This patch was applied to netdev/net.git (master)
by Jakub Kicinski <kuba@kernel.org>:
On Sat, 19 Nov 2022 15:28:32 +0800 you wrote:
> If skb_linearize() fails in tipc_disc_rcv(), we need to free the skb instead of
> handle it.
>
> Fixes: 25b0b9c4e835 ("tipc: handle collisions of 32-bit node address hash values")
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
> ---
> net/tipc/discover.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
Here is the summary with links:
- [net] tipc: check skb_linearize() return value in tipc_disc_rcv()
https://git.kernel.org/netdev/net/c/cd0f64211622
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-11-22 5:00 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-19 7:28 [PATCH net] tipc: check skb_linearize() return value in tipc_disc_rcv() YueHaibing
2022-11-22 0:48 ` Jon Maloy
2022-11-22 5:00 ` patchwork-bot+netdevbpf
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).