]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
can: dev: prevent potential information leak in can_fill_info()
authorDan Carpenter <dan.carpenter@oracle.com>
Thu, 21 Jan 2021 06:08:05 +0000 (09:08 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 3 Feb 2021 22:23:26 +0000 (23:23 +0100)
commit184666c9a3cb52af78a7fcaca2c65e133172cda6
treefb8b79edc50721edaf207e49b54159a4902a362b
parent8cbe9e3567ab4dea3e05e8cf791b5f6e6fdf8c9c
can: dev: prevent potential information leak in can_fill_info()

[ Upstream commit b552766c872f5b0d90323b24e4c9e8fa67486dd5 ]

The "bec" struct isn't necessarily always initialized. For example, the
mcp251xfd_get_berr_counter() function doesn't initialize anything if the
interface is down.

Fixes: 52c793f24054 ("can: netlink support for bus-error reporting and counters")
Link: https://lore.kernel.org/r/YAkaRdRJncsJO8Ve@mwanda
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/can/dev.c