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: <d27d0784-7f88-4351-943e-5c464a7d95df@linaro.org>
Date: Wed, 24 Apr 2024 06:09:16 +0200
From: Krzysztof Kozlowski <krzysztof.kozlowski@...aro.org>
To: Sumit Gupta <sumitg@...dia.com>, robh@...nel.org, conor+dt@...nel.org,
 maz@...nel.org, mark.rutland@....com, treding@...dia.com,
 jonathanh@...dia.com
Cc: devicetree@...r.kernel.org, linux-kernel@...r.kernel.org,
 linux-tegra@...r.kernel.org, amhetre@...dia.com, bbasu@...dia.com
Subject: Re: [Patch v3 2/2] memory: tegra: make sid and broadcast regions
 optional

On 23/04/2024 21:46, Sumit Gupta wrote:
> 
> 
> 
>>>>>
>>>>>    static inline u32 mc_readl(const struct tegra_mc *mc, unsigned long offset)
>>>>> diff --git a/drivers/memory/tegra/tegra186.c b/drivers/memory/tegra/tegra186.c
>>>>> index 1b3183951bfe..716582255eeb 100644
>>>>> --- a/drivers/memory/tegra/tegra186.c
>>>>> +++ b/drivers/memory/tegra/tegra186.c
>>>>> @@ -26,20 +26,16 @@
>>>>>    static int tegra186_mc_probe(struct tegra_mc *mc)
>>>>>    {
>>>>>         struct platform_device *pdev = to_platform_device(mc->dev);
>>>>> +     struct resource *res;
>>>>>         unsigned int i;
>>>>> -     char name[8];
>>>>> +     char name[14];
>>>>
>>>> How is it relevant? I don't see this being used in your diff.
>>>>
>>>>
>>>> Best regards,
>>>> Krzysztof
>>>>
>>>
>>> Did this change for below warning coming with 'W=1'.
>>>
>>> ../drivers/memory/tegra/tegra186.c: In function tegra186_mc_probe:
>>> ../drivers/memory/tegra/tegra186.c:51:49: warning: %u directive output
>>> may be truncated writing between 1 and 10 bytes into a region of size 6
>>> [8;;https://gc
>>> c.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wformat-truncation=-Wformat-truncation=8;;]
>>>      51 |                 snprintf(name, sizeof(name), "ch%u", i);
>>>         |                                                 ^~
>>> ../drivers/memory/tegra/tegra186.c:51:46: note: directive argument in
>>> the range [0, 4294967294]
>>>      51 |                 snprintf(name, sizeof(name), "ch%u", i);
>>>         |                                              ^~~~~~
>>> ../drivers/memory/tegra/tegra186.c:51:17: note: snprintf output between
>>> 4 and 13 bytes into a destination of size 8
>>>      51 |                 snprintf(name, sizeof(name), "ch%u", i);
>>>         |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>>
>> I asked how this is relevant to this change and you answer there is a
>> warning. If the warning was there, your answer is really just deflecting
>> the topic, so obviously this is new warning. Which part of code uses
>> longer name?
>>
>> BTW, really, such answers do not make review of your code smoother.
>>
>> Best regards,
>> Krzysztof
>>
> 
> Apologies for not explaining it earlier.
> 
> I increased the buffer size to suppress a static check warning in the
> existing code due to big range of 'unsigned int i', if copied to small
> name buffer.
> 
> Seems like the warning is harmless as the maximum value of num_channels
> is 16. I will remove it and keep the buffer size as 8 in the next
> version.
> 

That's not the point. For the third time: how is it relevant to this
change here? Was or was not the warning before?

Best regards,
Krzysztof


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ