lkml.org 
[lkml]   [2023]   [Oct]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH] dm ioctl: replace deprecated strncpy with strscpy_pad
Date
On Mon, 25 Sep 2023 06:54:51 +0000, Justin Stitt wrote:
> `strncpy` is deprecated for use on NUL-terminated destination strings
> [1] and as such we should prefer more robust and less ambiguous string
> interfaces.
>
> We expect `spec->target_type` to be NUL-terminated based on its use with
> a format string after `dm_table_add_target()` is called
> | r = dm_table_add_target(table, spec->target_type,
> | (sector_t) spec->sector_start,
> | (sector_t) spec->length,
> | target_params);
> ... wherein `spec->target_type` is passed as parameter `type` and later
> printed with DMERR:
> | DMERR("%s: %s: unknown target type", dm_device_name(t->md), type);
>
> [...]

Applied to for-next/hardening, thanks!

[1/1] dm ioctl: replace deprecated strncpy with strscpy_pad
https://git.kernel.org/kees/c/0f3f34ea3798

Take care,

--
Kees Cook

\
 
 \ /
  Last update: 2023-10-24 23:21    [W:0.982 / U:0.184 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site