lkml.org 
[lkml]   [2023]   [Aug]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2 7/7] netfilter: xtables: refactor deprecated strncpy
Justin Stitt <justinstitt@google.com> wrote:
> Prefer `strscpy_pad` as it's a more robust interface whilst maintaing
> zero-padding behavior.
>
> There may have existed a bug here due to both `tbl->repl.name` and
> `info->name` having a size of 32 as defined below:
> | #define XT_TABLE_MAXNAMELEN 32
>
> This may lead to buffer overreads in some situations -- `strscpy` solves
> this by guaranteeing NUL-termination of the dest buffer.

I don't think we need to use _pad here.

\
 
 \ /
  Last update: 2023-08-09 22:21    [W:0.066 / U:0.228 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site