On 1/19/21 7:17 AM, Dan Carpenter wrote:
Hi Marc,
url:
https://github.com/0day-ci/linux/commits/Marc-Kleine-Budde/MAINTAINERS-ad...
base: f50e2f9f791647aa4e5b19d0064f5cabf630bf6e
config: i386-randconfig-m021-20210114 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
Reported-by: Dan Carpenter <dan.carpenter(a)oracle.com>
smatch warnings:
drivers/net/can/dev/length.c:38 can_fd_len2dlc() error: buffer overflow 'len2dlc'
49 <= 49
vim +/len2dlc +38 drivers/net/can/dev/length.c
d4b90befe4bfafa1 Marc Kleine-Budde 2021-01-13 32 /* map the sanitized data length to an
appropriate data length code */
d4b90befe4bfafa1 Marc Kleine-Budde 2021-01-13 33 u8 can_fd_len2dlc(u8 len)
d4b90befe4bfafa1 Marc Kleine-Budde 2021-01-13 34 {
6ae761ad6c0557f0 Marc Kleine-Budde 2021-01-13 35 if (len > ARRAY_SIZE(len2dlc))
^
This should be >=
ACK. We noticed that after I send the pull request, but before
it was merged. I send an updated pull request which contains
the fixed version. See:
| 652562e5ff06 can: length: can_fd_len2dlc(): simplify length calculcation
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 |