Harshit Mogalapalli 62ac247355 HID: mcp2221: prevent a buffer overflow in mcp_smbus_write()
Smatch Warning:
drivers/hid/hid-mcp2221.c:388 mcp_smbus_write() error: __memcpy()
'&mcp->txbuf[5]' too small (59 vs 255)
drivers/hid/hid-mcp2221.c:388 mcp_smbus_write() error: __memcpy() 'buf'
too small (34 vs 255)

The 'len' variable can take a value between 0-255 as it can come from
data->block[0] and it is user data. So add an bound check to prevent a
buffer overflow in memcpy().

Fixes: 67a95c21463d ("HID: mcp2221: add usb to i2c-smbus host bridge")
Signed-off-by: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2022-07-21 11:54:40 +02:00
2022-05-24 14:56:38 -07:00
2022-05-23 14:04:14 -07:00
2022-05-24 15:13:30 -07:00
2022-05-24 13:50:39 -07:00
2022-05-24 15:21:15 -07:00
2022-05-24 12:37:24 -07:00
2022-05-24 14:23:10 -07:00
2022-05-24 12:27:09 -07:00
2022-05-24 13:09:13 -07:00
2022-05-24 13:16:50 -07:00
2022-05-24 13:50:39 -07:00
2022-05-23 20:49:45 -07:00
2022-05-24 13:16:50 -07:00
2022-03-31 11:59:03 -07:00
2022-05-24 11:11:13 -07:00
2022-05-24 15:21:15 -07:00

Linux kernel
============

There are several guides for kernel developers and users. These guides can
be rendered in a number of formats, like HTML and PDF. Please read
Documentation/admin-guide/README.rst first.

In order to build the documentation, use ``make htmldocs`` or
``make pdfdocs``.  The formatted documentation can also be read online at:

    https://www.kernel.org/doc/html/latest/

There are various text files in the Documentation/ subdirectory,
several of them using the Restructured Text markup notation.

Please read the Documentation/process/changes.rst file, as it contains the
requirements for building and running the kernel, and information about
the problems which may result by upgrading your kernel.
Description
No description provided
Readme 5.7 GiB
Languages
C 97.6%
Assembly 1%
Shell 0.5%
Python 0.3%
Makefile 0.3%