[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CACKFLinX=8iSEPMMyKt5v08=SuF1i2es5YDzMvmtASiFgHR9hA@mail.gmail.com>
Date: Fri, 10 Aug 2018 15:01:23 -0700
From: Michael Chan <michael.chan@...adcom.com>
To: David Miller <davem@...emloft.net>
Cc: Netdev <netdev@...r.kernel.org>,
Dan Carpenter <dan.carpenter@...cle.com>,
Vasundhara Volam <vasundhara-v.volam@...adcom.com>
Subject: Re: [PATCH net-next] bnxt_en: Fix strcpy() warnings in bnxt_ethtool.c
On Fri, Aug 10, 2018 at 2:37 PM, David Miller <davem@...emloft.net> wrote:
> From: David Miller <davem@...emloft.net>
> Date: Fri, 10 Aug 2018 14:35:45 -0700 (PDT)
>
>> From: Michael Chan <michael.chan@...adcom.com>
>> Date: Fri, 10 Aug 2018 17:02:12 -0400
>>
>>> From: Vasundhara Volam <vasundhara-v.volam@...adcom.com>
>>>
>>> This patch fixes following smatch warnings:
>>>
>>> drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c:2826 bnxt_fill_coredump_seg_hdr() error: strcpy() '"sEgM"' too large for 'seg_hdr->signature' (5 vs 4)
>>> drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c:2858 bnxt_fill_coredump_record() error: strcpy() '"cOrE"' too large for 'record->signature' (5 vs 4)
>>> drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c:2879 bnxt_fill_coredump_record() error: strcpy() 'utsname()->sysname' too large for 'record->os_name' (65 vs 32)
>>>
>>> Fixes: 6c5657d085ae ("bnxt_en: Add support for ethtool get dump.")
>>> Reported-by: Dan Carpenter <dan.carpenter@...cle.com>
>>> Signed-off-by: Vasundhara Volam <vasundhara-v.volam@...adcom.com>
>>> Signed-off-by: Michael Chan <michael.chan@...adcom.com>
>>
>> Applied, thanks Michael.
>
> Actually, I'm reverting, this may fix those three warnings, but they are replaced with
> a new one:
>
> ./include/linux/string.h:246:9: warning: ‘__builtin_strncpy’ output may be truncated copying 32 bytes from a string of length 64 [-Wstringop-truncation]
>
OK. I'm guessing strlcpy() is the right variant to use here. I will
repost v2 using strlcpy(). Thanks.
Powered by blists - more mailing lists