Message ID | 20210806150435.GB15586@kili (mailing list archive) |
---|---|
State | Accepted |
Commit | 06669e6880be7422bb9926f71be39c4924b92fea |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | [net-next] vrf: fix NULL dereference in vrf_finish_output() | expand |
Context | Check | Description |
---|---|---|
netdev/cover_letter | success | Link |
netdev/fixes_present | success | Link |
netdev/patch_count | success | Link |
netdev/tree_selection | success | Clearly marked for net-next |
netdev/subject_prefix | success | Link |
netdev/cc_maintainers | success | CCed 5 of 5 maintainers |
netdev/source_inline | success | Was 0 now: 0 |
netdev/verify_signedoff | success | Link |
netdev/module_param | success | Was 0 now: 0 |
netdev/build_32bit | success | Errors and warnings before: 2 this patch: 2 |
netdev/kdoc | success | Errors and warnings before: 0 this patch: 0 |
netdev/verify_fixes | success | Link |
netdev/checkpatch | success | total: 0 errors, 0 warnings, 0 checks, 8 lines checked |
netdev/build_allmodconfig_warn | success | Errors and warnings before: 2 this patch: 2 |
netdev/header_inline | success | Link |
Hello: This patch was applied to netdev/net-next.git (refs/heads/master): On Fri, 6 Aug 2021 18:04:35 +0300 you wrote: > The "skb" pointer is NULL on this error path so we can't dereference it. > Use "dev" instead. > > Fixes: 14ee70ca89e6 ("vrf: use skb_expand_head in vrf_finish_output") > Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> > --- > drivers/net/vrf.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) Here is the summary with links: - [net-next] vrf: fix NULL dereference in vrf_finish_output() https://git.kernel.org/netdev/net-next/c/06669e6880be You are awesome, thank you! -- Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html
diff --git a/drivers/net/vrf.c b/drivers/net/vrf.c index 726adf07ef31..662e26117353 100644 --- a/drivers/net/vrf.c +++ b/drivers/net/vrf.c @@ -864,7 +864,7 @@ static int vrf_finish_output(struct net *net, struct sock *sk, struct sk_buff *s if (unlikely(skb_headroom(skb) < hh_len && dev->header_ops)) { skb = skb_expand_head(skb, hh_len); if (!skb) { - skb->dev->stats.tx_errors++; + dev->stats.tx_errors++; return -ENOMEM; } }
The "skb" pointer is NULL on this error path so we can't dereference it. Use "dev" instead. Fixes: 14ee70ca89e6 ("vrf: use skb_expand_head in vrf_finish_output") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> --- drivers/net/vrf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)