lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <175917739970.3755404.1234135227705143771.b4-ty@oracle.com>
Date: Mon, 29 Sep 2025 22:36:47 -0400
From: "Martin K. Petersen" <martin.petersen@...cle.com>
To: hare@...e.de, James.Bottomley@...senPartnership.com,
        linux-scsi@...r.kernel.org, Alok Tiwari <alok.a.tiwari@...cle.com>
Cc: "Martin K . Petersen" <martin.petersen@...cle.com>,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] scsi: libfc: Fix potential buffer overflow in fc_ct_ms_fill()

On Mon, 15 Sep 2025 11:37:57 -0700, Alok Tiwari wrote:

> The fc_ct_ms_fill() helper currently formats the OS name and version
> into entry->value using "%s v%s". Since init_utsname()->sysname and
> ->release are unbounded strings, snprintf() may attempt to write more
> than FC_FDMI_HBA_ATTR_OSNAMEVERSION_LEN bytes, triggering a
> -Wformat-truncation warning with W=1.
> 
> In file included from drivers/scsi/libfc/fc_elsct.c:18:
> drivers/scsi/libfc/fc_encode.h: In function ‘fc_ct_ms_fill.constprop’:
> drivers/scsi/libfc/fc_encode.h:359:30: error: ‘%s’ directive output may
> be truncated writing up to 64 bytes into a region of size between 62
> and 126 [-Werror=format-truncation=]
>   359 |                         "%s v%s",
>       |                              ^~
>   360 |                         init_utsname()->sysname,
>   361 |                         init_utsname()->release);
>       |                         ~~~~~~~~~~~~~~~~~~~~~~~
> drivers/scsi/libfc/fc_encode.h:357:17: note: ‘snprintf’ output between
> 3 and 131 bytes into a destination of size 128
>   357 |                 snprintf((char *)&entry->value,
>       |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>   358 |                         FC_FDMI_HBA_ATTR_OSNAMEVERSION_LEN,
>       |                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>   359 |                         "%s v%s",
>       |                         ~~~~~~~~~
>   360 |                         init_utsname()->sysname,
>       |                         ~~~~~~~~~~~~~~~~~~~~~~~~
>   361 |                         init_utsname()->release);
>       |                         ~~~~~~~~~~~~~~~~~~~~~~~~
> 
> [...]

Applied to 6.18/scsi-queue, thanks!

[1/1] scsi: libfc: Fix potential buffer overflow in fc_ct_ms_fill()
      https://git.kernel.org/mkp/scsi/c/072fdd4b0be9

-- 
Martin K. Petersen

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ