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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <602813bb-096b-44b4-af1d-95681769c943@ursulin.net>
Date: Mon, 8 Dec 2025 08:37:05 +0100
From: Tvrtko Ursulin <tursulin@...ulin.net>
To: David Laight <david.laight.linux@...il.com>,
 Ard Biesheuvel <ardb@...nel.org>
Cc: Ard Biesheuvel <ardb+git@...gle.com>, linux-kernel@...r.kernel.org,
 Jani Nikula <jani.nikula@...ux.intel.com>,
 Joonas Lahtinen <joonas.lahtinen@...ux.intel.com>,
 Rodrigo Vivi <rodrigo.vivi@...el.com>, David Airlie <airlied@...il.com>,
 Simona Vetter <simona@...ll.ch>, intel-gfx@...ts.freedesktop.org,
 dri-devel@...ts.freedesktop.org
Subject: Re: [PATCH] drm/i195: Fix format string truncation warning


On 05/12/2025 19:28, David Laight wrote:
> On Fri, 5 Dec 2025 11:48:08 +0100
> Ard Biesheuvel <ardb@...nel.org> wrote:
>
>> On Sun, 9 Nov 2025 at 19:00, Ard Biesheuvel <ardb@...nel.org> wrote:
> ...
>>>> But I guess much prettier fix would be to simply grow the buffer.
>>>>   
>>>   
>> OK, so something like
>>
>> --- a/drivers/gpu/drm/i915/intel_memory_region.h
>> +++ b/drivers/gpu/drm/i915/intel_memory_region.h
>> @@ -72,7 +72,7 @@ struct intel_memory_region {
>>          u16 instance;
>>          enum intel_region_id id;
>>          char name[16];
>> -       char uabi_name[16];
>> +       char uabi_name[20];
> The observant will notice the 7 bytes of padding following 'private',
> and another 7 a little later on.
> (I' pretty sure 'bool' is u8).

Oh well, them holes love to be added over time.

Anyway, I have pushed this patch to drm-intel-gt-next so it will appear 
in 6.20. Only now I realised I could have suggested to add someĀ  Fixes: 
tag to it, so it would get automatically picked for 6.19.

My colleagues who are handling drm-intel-next-fixes for 6.19 could 
perhaps manually pick it up.

Tvrtko

>
> So extending the buffer doesn't even grow the structure.
> The string is only used when printing some stats.
> I got lost in a list of #defines and function pointers trying to find
> the actual function that did the 'printf'.
>
> 	David
>
>>          bool private; /* not for userspace */
>>
>>          struct {
>>
>>
>>
>>>> Also, hm, how come gcc does not find the mem->name vsnprintf from
>>>> intel_memory_region_set_name?
>>>>   
>>>   
>> AFAICT, intel_memory_region_set_name() is never called with a format
>> string that could produce more than 15/16 bytes of output.
>>


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ