From: Przemek Kitszel <przemyslaw.kitszel@intel.com>
To: Qianqiang Liu <qianqiang.liu@163.com>, Ahmed Zaki <ahmed.zaki@intel.com>
Cc: <intel-wired-lan@lists.osuosl.org>, <anthony.l.nguyen@intel.com>,
<linux-kernel@vger.kernel.org>, <netdev@vger.kernel.org>
Subject: Re: [Intel-wired-lan] Is this an out-of-bounds issue?
Date: Mon, 16 Sep 2024 11:19:32 +0200 [thread overview]
Message-ID: <b7dabc2d-19a4-42f4-ba5c-31e1803d821a@intel.com> (raw)
In-Reply-To: <c9c582a2-2d72-4258-ad67-8d159cf256d6@intel.com>
On 9/16/24 10:10, Przemek Kitszel wrote:
> On 9/13/24 15:13, Qianqiang Liu wrote:
>> The code in drivers/net/ethernet/intel/ice/ice_parser_rt.c:
>>
>> 114 static void ice_bst_key_init(struct ice_parser_rt *rt,
>> 115 struct ice_imem_item *imem)
>> 116 {
>> 117 u8 tsr = (u8)rt->gpr[ICE_GPR_TSR_IDX];
>> 118 u16 ho = rt->gpr[ICE_GPR_HO_IDX];
>> 119 u8 *key = rt->bst_key;
>> 120 int idd, i;
>> 121
>> 122 idd = ICE_BST_TCAM_KEY_SIZE - 1;
>> 123 if (imem->b_kb.tsr_ctrl)
>> 124 key[idd] = tsr;
>> 125 else
>> 126 key[idd] = imem->b_kb.prio;
>>
>> The "ICE_BST_TCAM_KEY_SIZE" macro is 20, so "idd" is 20 - 1 = 19.
>> "key" equals "rt->bst_key" which is an array, and the size of the
>> array is ICE_BST_KEY_SIZE which is 10.
>> Is it possible that 'key[idd]' might access invalid memory?
>> Should the "idd" be "ICE_BST_KEY_SIZE"?
>>
>> - idd = ICE_BST_TCAM_KEY_SIZE - 1;
>> + idd = ICE_BST_KEY_SIZE - 1;
>>
>
> We already have a fix for that from Ahmed, but it is not yet public.
> @Ahmed, please follow up.
>
ugh, sorry, it's already public:
https://lore.kernel.org/all/20240823230847.172295-1-ahmed.zaki@intel.com/
awaits our VAL
next prev parent reply other threads:[~2024-09-16 9:19 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-13 13:13 Is this an out-of-bounds issue? Qianqiang Liu
2024-09-16 8:10 ` Przemek Kitszel
2024-09-16 9:19 ` Przemek Kitszel [this message]
2024-09-16 9:36 ` [Intel-wired-lan] " Qianqiang Liu
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=b7dabc2d-19a4-42f4-ba5c-31e1803d821a@intel.com \
--to=przemyslaw.kitszel@intel.com \
--cc=ahmed.zaki@intel.com \
--cc=anthony.l.nguyen@intel.com \
--cc=intel-wired-lan@lists.osuosl.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=qianqiang.liu@163.com \
/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