Staging: rtl8192e: Fix potential NULL pointer dereference
Subsystems (2)
PATCH 1/1 Staging: rtl8192e: Fix potential NULL pointer dereference
We need to make sure the struct rtllib_device pointer ieee is not NULL after the goto rx_dropped label since it is dereferenced there.
--- drivers/staging/rtl8192e/rtllib_rx.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/staging/rtl8192e/rtllib_rx.c +2 -1
@@ -1496,7 +1496,8 @@ int rtllib_rx(struct rtllib_device *ieee, struct sk_buff *skb,return ret; rx_dropped: - ieee->stats.rx_dropped++; +if (ieee) + ieee->stats.rx_dropped++;return 0 ; }EXPORT_SYMBOL (rtllib_rx);
Signature · 1 line
1.7.10.4
Greg Kroah-Hartman
maintainerQuoted 13 lines · Emil Goode
We need to make sure the struct
rtllib_devicepointer ieee is not NULL after the gotorx_droppedlabel since it is dereferenced there.Signed-off-by Emil Goode <[email protected]>--- drivers/staging/rtl8192e/rtllib_rx.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)drivers/staging/rtl8192e/rtllib_rx.c +0
-0
drivers/staging/rtl8192e/rtllib_rx.c int rtllib_rx(struct rtllib_device *ieee, struct sk_buff *skb, · line 1503
Quoted 9 lines
drivers/staging/rtl8192e/rtllib_rx.c +2
-1@@ -1496,7 +1496,8 @@ int rtllib_rx(struct rtllib_device *ieee, struct sk_buff *skb,return ret; rx_dropped: - ieee->stats.rx_dropped++; +if (ieee) + ieee->stats.rx_dropped++;return 0 ; }EXPORT_SYMBOL (rtllib_rx);
Is this something that is hitting users today in the tree, or is this just a bug you found looking at the code?
thanks,
greg k-h
Hello Greg,
Quoted 16 lines · Greg Kroah-Hartman
Quoted 15 lines · Emil Goode
We need to make sure the struct
rtllib_devicepointer ieee is not NULL after the gotorx_droppedlabel since it is dereferenced there.Signed-off-by Emil Goode <[email protected]>--- drivers/staging/rtl8192e/rtllib_rx.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)drivers/staging/rtl8192e/rtllib_rx.c +0
-0@@ -1496,7 +1496,8 @@ int rtllib_rx(struct rtllib_device *ieee, struct sk_buff *skb,return ret;
Quoted 10 lines
drivers/staging/rtl8192e/rtllib_rx.c int rtllib_rx(struct rtllib_device *ieee, struct sk_buff *skb, · line 1503
Quoted 7 lines
drivers/staging/rtl8192e/rtllib_rx.c +2
-1rx_dropped: - ieee->stats.rx_dropped++; +if (ieee) + ieee->stats.rx_dropped++;return 0 ; }EXPORT_SYMBOL (rtllib_rx);Is this something that is hitting users today in the tree, or is this just a bug you found looking at the code?
It's a static checker fix and I'm not aware of any impact on users. If you want I will resend with that information added?
Best regards,
Emil Goode
Greg Kroah-Hartman
maintainerQuoted 30 lines · Emil Goode
Hello Greg,
Quoted 16 lines · Greg Kroah-Hartman
Quoted 15 lines · Emil Goode
We need to make sure the struct
rtllib_devicepointer ieee is not NULL after the gotorx_droppedlabel since it is dereferenced there.Signed-off-by Emil Goode <[email protected]>--- drivers/staging/rtl8192e/rtllib_rx.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)drivers/staging/rtl8192e/rtllib_rx.c +0
-0@@ -1496,7 +1496,8 @@ int rtllib_rx(struct rtllib_device *ieee, struct sk_buff *skb,return ret;Quoted 10 lines
drivers/staging/rtl8192e/rtllib_rx.c int rtllib_rx(struct rtllib_device *ieee, struct sk_buff *skb, · line 1503
Quoted 7 lines
drivers/staging/rtl8192e/rtllib_rx.c +2
-1rx_dropped: - ieee->stats.rx_dropped++; +if (ieee) + ieee->stats.rx_dropped++;return 0 ; }EXPORT_SYMBOL (rtllib_rx);Is this something that is hitting users today in the tree, or is this just a bug you found looking at the code?
Quoted 2 lines
It's a static checker fix and I'm not aware of any impact on users. If you want I will resend with that information added?
No, that's fine, just trying to see which kernel to apply this to...
thanks,
greg k-h