From: Colin King <hidden> Date: 2017-09-08 15:02:43
From: Colin Ian King <redacted>
The assignment of net via call sock_net will dereference sk. This
is performed before a sanity null check on sk, so there could be
a potential null dereference on the sock_net call if sk is null.
Fix this by assigning net after the sk null check. Also replace
the sk == NULL with the more usual !sk idiom.
Detected by CoverityScan CID#1431862 ("Dereference before null check")
Fixes: 384317ef4187 ("can: network namespace support for CAN_BCM protocol")
Signed-off-by: Colin Ian King <redacted>
---
net/can/bcm.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
From: Oliver Hartkopp <socketcan@hartkopp.net> Date: 2017-09-08 17:46:28
On 09/08/2017 05:02 PM, Colin King wrote:
From: Colin Ian King <redacted>
The assignment of net via call sock_net will dereference sk. This
is performed before a sanity null check on sk, so there could be
a potential null dereference on the sock_net call if sk is null.
Fix this by assigning net after the sk null check. Also replace
the sk == NULL with the more usual !sk idiom.
Detected by CoverityScan CID#1431862 ("Dereference before null check")
Fixes: 384317ef4187 ("can: network namespace support for CAN_BCM protocol")
Signed-off-by: Colin Ian King <redacted>
Acked-by: Oliver Hartkopp <socketcan@hartkopp.net>
Thanks Collin!
On Fri, Sep 8, 2017 at 1:46 PM, Oliver Hartkopp [off-list ref] wrote:
On 09/08/2017 05:02 PM, Colin King wrote:
quoted
From: Colin Ian King <redacted>
The assignment of net via call sock_net will dereference sk. This
is performed before a sanity null check on sk, so there could be
a potential null dereference on the sock_net call if sk is null.
Fix this by assigning net after the sk null check. Also replace
the sk == NULL with the more usual !sk idiom.
Detected by CoverityScan CID#1431862 ("Dereference before null check")
Fixes: 384317ef4187 ("can: network namespace support for CAN_BCM
protocol")
Signed-off-by: Colin Ian King <redacted>
Acked-by: Oliver Hartkopp <socketcan@hartkopp.net>
I don't see this one queued up in the net or net-next trees. Did it
fall through the cracks or did it get queued up elsewhere? Seems like
it's a good candidate to get into 4.14?
josh
From: Oliver Hartkopp <socketcan@hartkopp.net> Date: 2017-10-16 17:35:43
On 10/16/2017 06:37 PM, Josh Boyer wrote:
On Fri, Sep 8, 2017 at 1:46 PM, Oliver Hartkopp [off-list ref] wrote:
quoted
On 09/08/2017 05:02 PM, Colin King wrote:
quoted
From: Colin Ian King <redacted>
The assignment of net via call sock_net will dereference sk. This
is performed before a sanity null check on sk, so there could be
a potential null dereference on the sock_net call if sk is null.
Fix this by assigning net after the sk null check. Also replace
the sk == NULL with the more usual !sk idiom.
Detected by CoverityScan CID#1431862 ("Dereference before null check")
Fixes: 384317ef4187 ("can: network namespace support for CAN_BCM
protocol")
Signed-off-by: Colin Ian King <redacted>
Acked-by: Oliver Hartkopp <socketcan@hartkopp.net>
I don't see this one queued up in the net or net-next trees. Did it
fall through the cracks or did it get queued up elsewhere? Seems like
it's a good candidate to get into 4.14?
It definitely is!
Marc is our responsible guy for CAN related upstreams - but he seems to
be busy as I already poked him here:
https://marc.info/?l=linux-can&m=150771819505097&w=2
If he doesn't send a pull request by beginning of next week, I would ask
Dave to grab these patches - to get them into 4.14.
Best regards,
Oliver
From: Marc Kleine-Budde <mkl@pengutronix.de> Date: 2017-10-17 10:28:37
On 09/08/2017 05:02 PM, Colin King wrote:
From: Colin Ian King <redacted>
The assignment of net via call sock_net will dereference sk. This
is performed before a sanity null check on sk, so there could be
a potential null dereference on the sock_net call if sk is null.
Fix this by assigning net after the sk null check. Also replace
the sk == NULL with the more usual !sk idiom.
Detected by CoverityScan CID#1431862 ("Dereference before null check")
Fixes: 384317ef4187 ("can: network namespace support for CAN_BCM protocol")
Signed-off-by: Colin Ian King <redacted>
Applied to can.
Tnx,
Marc
--
Pengutronix e.K. | Marc Kleine-Budde |
Industrial Linux Solutions | Phone: +49-231-2826-924 |
Vertretung West/Dortmund | Fax: +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686 | http://www.pengutronix.de |