Re: [PATCH] asm-generic: fix buffer overflow read in __strncpy_from_user

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Jun 27, 2022 at 8:32 AM Yangxi Xiang <xyangxi5@xxxxxxxxx> wrote:
>
> a common calling pattern is strncpy_from_user(buf, user_ptr, sizeof(buf)).
> However a buffer-overflow read occurs in this loop when reading the last
> byte. Fix it by early checking the available bytes.
>
> Signed-off-by: Yangxi Xiang <xyangxi5@xxxxxxxxx>
> ---

This function was removed in commit 98b861a30431 ("asm-generic: uaccess:
remove inline strncpy_from_user/strnlen_user"), and the new version in
lib/strncpy_from_user.c does not have the problem

On which architecture and kernel version do you see the problem?

      Arnd



[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux