From: Ferruh Yigit <ferruh.yigit@amd.com>
To: Jiawen Wu <jiawenwu@trustnetic.com>,
'Jian Wang' <jianwang@trustnetic.com>,
'Ferruh Yigit' <ferruh.yigit@intel.com>
Cc: dev@dpdk.org, stable@dpdk.org,
'Luca Boccassi' <luca.boccassi@microsoft.com>
Subject: Re: [PATCH v2] net/txgbe: fix out of bound access
Date: Mon, 20 Nov 2023 09:53:39 +0000 [thread overview]
Message-ID: <b43afb57-af69-4912-b6fe-04ed70fc2d6b@amd.com> (raw)
In-Reply-To: <0d2a01da1b54$072551a0$156ff4e0$@trustnetic.com>
On 11/20/2023 1:51 AM, Jiawen Wu wrote:
> On Friday, November 17, 2023 6:12 PM, Ferruh.Yigit@amd.com wrote:
>> Reported by SuSe CI [1] by GCC [2], possibly false positive. Error:
>>
>> In function 'txgbe_host_interface_command',
>> inlined from 'txgbe_host_interface_command'
>> at ../drivers/net/txgbe/base/txgbe_mng.c:104:1,
>> inlined from 'txgbe_hic_reset'
>> at ../drivers/net/txgbe/base/txgbe_mng.c:345:9:
>> ../drivers/net/txgbe/base/txgbe_mng.c:145:36:
>> error: array subscript 2 is outside array bounds ofr
>> 'struct txgbe_hic_reset[1]' [-Werror=array-bounds=]
>> 145 | buffer[bi] = rd32a(hw, TXGBE_MNGMBX, bi);
>> ../drivers/net/txgbe/base/txgbe_mng.c: In function 'txgbe_hic_reset':
>> ../drivers/net/txgbe/base/txgbe_mng.c:331:32:
>> note: at offset 8 into object 'reset_cmd' of size 8
>> 331 | struct txgbe_hic_reset reset_cmd;
>> | ^~~~~~~~~
>>
>> Access to buffer done based on command code, the case complained by
>> FW_RESET_CMD has short buffer but this code path only taken with command
>> 0x30, so this shouldn't be a problem.
>>
>> Command 0x30 no more used, removing this exception check that cause
>> build error.
>>
>> [1]
>> https://build.opensuse.org/public/build/home:bluca:dpdk/openSUSE_Factory_ARM/armv7l/dpdk-20.11/_log
>>
>> [2]
>> gcc 13.2.1 "cc (SUSE Linux) 13.2.1 20230912
>>
>> Fixes: 35c90ecccfd4 ("net/txgbe: add EEPROM functions")
>> Cc: stable@dpdk.org
>>
>> Reported-by: Luca Boccassi <luca.boccassi@microsoft.com>
>> Signed-off-by: Ferruh Yigit <ferruh.yigit@amd.com>>
> Reviewed-by: Jiawen Wu <jiawenwu@trustnetic.com>
>
Applied to dpdk-next-net/main, thanks.
prev parent reply other threads:[~2023-11-20 9:54 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-16 14:07 [PATCH] " Ferruh Yigit
2023-11-16 15:16 ` Luca Boccassi
2023-11-17 2:45 ` Jiawen Wu
2023-11-17 9:15 ` Ferruh Yigit
2023-11-17 10:12 ` [PATCH v2] " Ferruh Yigit
2023-11-20 1:51 ` Jiawen Wu
2023-11-20 9:53 ` Ferruh Yigit [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=b43afb57-af69-4912-b6fe-04ed70fc2d6b@amd.com \
--to=ferruh.yigit@amd.com \
--cc=dev@dpdk.org \
--cc=ferruh.yigit@intel.com \
--cc=jianwang@trustnetic.com \
--cc=jiawenwu@trustnetic.com \
--cc=luca.boccassi@microsoft.com \
--cc=stable@dpdk.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).