lkml.org 
[lkml]   [2021]   [Nov]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RESEND PATCH] Input: elantech - Fix stack out of bound access in elantech_change_report_id()
On Tue, Nov 16, 2021 at 09:32:34AM +0100, Wolfram Sang wrote:
> On Tue, Nov 16, 2021 at 08:22:23AM +0100, Andrea Righi wrote:
> > The array param[] in elantech_change_report_id() must be at least 3
> > bytes, because elantech_read_reg_params() is calling ps2_command() with
> > PSMOUSE_CMD_GETINFO, that is going to access 3 bytes from param[], but
> > it's defined in the stack as an array of 2 bytes, therefore we have a
> > potential stack out-of-bounds access here, also confirmed by KASAN:
>
> I think a comment in the code why the array size is 3 when only 2 values
> are defined would be helpful. Like a short summary of the above.
>

Good idea, I like it, I'll send a v2 adding such comment.

Thanks!
-Andrea

\
 
 \ /
  Last update: 2021-11-16 10:53    [W:0.027 / U:1.192 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site