Thread (3 messages) 3 messages, 3 authors, 2021-06-21

Re: [PATCH] can: j1939: prevent allocation of j1939 filter for optlen = 0

From: Marc Kleine-Budde <mkl@pengutronix.de>
Date: 2021-06-21 07:47:46
Also in: netdev

On 20.06.2021 14:38:42, Norbert Slusarek wrote:
If optval != NULL and optlen = 0 are specified for SO_J1939_FILTER in
j1939_sk_setsockopt(), memdup_sockptr() will return ZERO_PTR for 0 size
allocation. The new filter will be mistakenly assigned ZERO_PTR.
This patch checks for optlen != 0 and filter will be assigned NULL
in case of optlen = 0.

Fixes: a7b75c5a8c41 ("net: pass a sockptr_t into ->setsockopt")
Signed-off-by: Norbert Slusarek <redacted>
The problem was in the initial commit, too. Changed Fixes tags
accordingly to:

| Fixes: 9d71dd0c7009 ("can: add support of SAE J1939 protocol")

applied to linux-can/testing

regards,
Marc

-- 
Pengutronix e.K.                 | Marc Kleine-Budde           |
Embedded Linux                   | https://www.pengutronix.de  |
Vertretung West/Dortmund         | Phone: +49-231-2826-924     |
Amtsgericht Hildesheim, HRA 2686 | Fax:   +49-5121-206917-5555 |

Attachments

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help