Thread (3 messages) 3 messages, 2 authors, 2021-08-11

Re: [PATCH v2] i2c: dev: zero out array used for i2c reads from userspace

From: Wolfram Sang <wsa@kernel.org>
Date: 2021-08-10 20:55:31
Also in: lkml, stable

On Thu, Jul 29, 2021 at 04:35:32PM +0200, Greg Kroah-Hartman wrote:
If an i2c driver happens to not provide the full amount of data that a
user asks for, it is possible that some uninitialized data could be sent
to userspace.  While all in-kernel drivers look to be safe, just be sure
by initializing the buffer to zero before it is passed to the i2c driver
so that any future drivers will not have this issue.

Also properly copy the amount of data recvieved to the userspace buffer,
as pointed out by Dan Carpenter.

Reported-by: Eric Dumazet <edumazet@google.com>
Cc: Dan Carpenter <redacted>
Cc: stable <redacted>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Fixed checkpatch warning "WARNING: Invalid email format for stable:
'stable [off-list ref]', prefer 'stable@vger.kernel.org' " and
applied to for-current, thanks!

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