Re: [PATCH] ACPI: OSI: refactor deprecated strncpy

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

 



On Fri, Sep 15, 2023 at 5:16 AM Kees Cook <keescook@xxxxxxxxxxxx> wrote:
>
> On Mon, Sep 11, 2023 at 08:36:44PM +0000, Justin Stitt wrote:
> > `strncpy` is deprecated for use on NUL-terminated destination strings [1].
> >
> > We know `osi->string` is a NUL-terminated string due to its eventual use
> > in `acpi_install_interface()` and `acpi_remove_interface()` which expect
> > a `acpi_string` which has been specifically typedef'd as:
> > |  typedef char *acpi_string; /* Null terminated ASCII string */
> >
> > ... and which also has other string functions used on it like `strlen`.
> > Furthermore, padding is not needed in this instance either.
>
> Following the callers, I agree, this doesn't need %NUL padding -- it's
> always processed as a regular C string.
>
> Reviewed-by: Kees Cook <keescook@xxxxxxxxxxxx>

Applied as 6.7 material, thanks!





[Index of Archives]     [Linux IBM ACPI]     [Linux Power Management]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]
  Powered by Linux