Message ID | 1605298325-3705-1-git-send-email-subashab@codeaurora.org (mailing list archive) |
---|---|
State | Accepted |
Commit | fc70f5bf5e525dde81565f0a30d5e39168062eba |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | [net] net: qualcomm: rmnet: Fix incorrect receive packet handling during cleanup | 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 |
netdev/subject_prefix | success | Link |
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: 0 this patch: 0 |
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, 11 lines checked |
netdev/build_allmodconfig_warn | success | Errors and warnings before: 0 this patch: 0 |
netdev/header_inline | success | Link |
netdev/stable | success | Stable not CCed |
Hello: This patch was applied to netdev/net.git (refs/heads/master): On Fri, 13 Nov 2020 13:12:05 -0700 you wrote: > During rmnet unregistration, the real device rx_handler is first cleared > followed by the removal of rx_handler_data after the rcu synchronization. > > Any packets in the receive path may observe that the rx_handler is NULL. > However, there is no check when dereferencing this value to use the > rmnet_port information. > > [...] Here is the summary with links: - [net] net: qualcomm: rmnet: Fix incorrect receive packet handling during cleanup https://git.kernel.org/netdev/net/c/fc70f5bf5e52 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/ethernet/qualcomm/rmnet/rmnet_handlers.c b/drivers/net/ethernet/qualcomm/rmnet/rmnet_handlers.c index 29a7bfa..3d7d3ab 100644 --- a/drivers/net/ethernet/qualcomm/rmnet/rmnet_handlers.c +++ b/drivers/net/ethernet/qualcomm/rmnet/rmnet_handlers.c @@ -188,6 +188,11 @@ rx_handler_result_t rmnet_rx_handler(struct sk_buff **pskb) dev = skb->dev; port = rmnet_get_port_rcu(dev); + if (unlikely(!port)) { + atomic_long_inc(&skb->dev->rx_nohandler); + kfree_skb(skb); + goto done; + } switch (port->rmnet_mode) { case RMNET_EPMODE_VND: