Skip to content

Commit

Permalink
net: qualcomm: rmnet: Fix possible null dereference in command proces…
Browse files Browse the repository at this point in the history
…sing

If a command packet with invalid mux id is received, the packet would
not have a valid endpoint. This invalid endpoint maybe dereferenced
leading to a crash. Identified by manual code inspection.

Fixes: 3352e6c ("net: qualcomm: rmnet: Convert the muxed endpoint to hlist")
Signed-off-by: Subash Abhinov Kasiviswanathan <subashab@codeaurora.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Subash Abhinov Kasiviswanathan authored and David S. Miller committed Feb 19, 2018
1 parent 4dba8bb commit f57bbaa
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions drivers/net/ethernet/qualcomm/rmnet/rmnet_map_command.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ static u8 rmnet_map_do_flow_control(struct sk_buff *skb,
}

ep = rmnet_get_endpoint(port, mux_id);
if (!ep) {
kfree_skb(skb);
return RX_HANDLER_CONSUMED;
}

vnd = ep->egress_dev;

ip_family = cmd->flow_control.ip_family;
Expand Down

0 comments on commit f57bbaa

Please sign in to comment.