lkml.org 
[lkml]   [2021]   [Nov]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH] tty: vt: keyboard: do not copy an extra-byte in copy_to_user
From
On 11/6/21 22:20, Ajay Garg wrote:
> I vote for David's strscpy "fix", as it is simple, and does away with
> the dependency on the length of "func_table[kb_func]".
>

strscpy fix sounds reasonable to me. just to be save in future.

There is only one thing I am wondering about: translation table entries
are set by user using this struct

struct kbsentry {
unsigned char kb_func;
unsigned char kb_string[512];
};

it means entries cannot be longer than sizeof(kbsentry::kb_string) - 1
at all. Do we need extra branching with strscpy() or do we need to do
anything else here?



With regards,
Pavel Skripkin

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