Skip to content

Commit f57bbaa

Browse files
Subash Abhinov Kasiviswanathandavem330
authored andcommitted
net: qualcomm: rmnet: Fix possible null dereference in command processing
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 <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 4dba8bb commit f57bbaa

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

drivers/net/ethernet/qualcomm/rmnet/rmnet_map_command.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,11 @@ static u8 rmnet_map_do_flow_control(struct sk_buff *skb,
3838
}
3939

4040
ep = rmnet_get_endpoint(port, mux_id);
41+
if (!ep) {
42+
kfree_skb(skb);
43+
return RX_HANDLER_CONSUMED;
44+
}
45+
4146
vnd = ep->egress_dev;
4247

4348
ip_family = cmd->flow_control.ip_family;

0 commit comments

Comments
 (0)