lkml.org 
[lkml]   [2021]   [Nov]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH v2] tty: vt: keyboard: initialize "kbs" so that kfree(kbs) runs fine even if kbs is not kmalloced.
Hi Pavel,

Thanks for the review.

>
> Please, don't put change log into commit message. It should go under ---
>

Ok, many thanks Pavel.
Will take care in all my future patches.


>
> These is only one caller of vt_do_kdgkb_ioctl, which simple does:
>
>
> case KDGKBSENT:
> case KDSKBSENT:
> return vt_do_kdgkb_ioctl(cmd, up, perm);
>
> It means, that cmd can not be different from KDGKBSENT and KDSKBSENT.
>
> I guess, you found this "issue" via static analysis tool like smatch or
> smth similar, but this bug is impossible right now.
>

Yes, following was reported by smatch (amongst others) :
vt_do_kdgkb_ioctl() error: uninitialized symbol 'kbs'.


Regarding the current state, "vt_do_kdgkb_ioctl" should ideally behave
correctly independently, without bothering whether a cmd is a valid
one. From that perspective, it makes sense to ensure that kfree never
crashes.

However, I don't have any strong opinions on what is right or what is
wrong, as long as things work fine.

So, if there is a general consensus that the change should not be made
currently, I would be ok.
In case the change should be made, kindly let me know, I will post the
v3 patch (making change as per the review-comment of moving changelog
below ---).


Thanks and Regards,
Ajay

\
 
 \ /
  Last update: 2021-11-06 13:17    [W:0.096 / U:3.296 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site