[{"id":3676760,"web_url":"http://patchwork.ozlabs.org/comment/3676760/","msgid":"<20260413134334.GP469338@kernel.org>","list_archive_url":null,"date":"2026-04-13T13:43:34","subject":"Re: [Intel-wired-lan] [PATCH iwl-net v2 6/6] ixgbe: fix integer\n overflow and wrong bit position in ixgbe_validate_rtr()","submitter":{"id":82748,"url":"http://patchwork.ozlabs.org/api/people/82748/","name":"Simon Horman","email":"horms@kernel.org"},"content":"On Wed, Apr 08, 2026 at 03:11:54PM +0200, Aleksandr Loktionov wrote:\n> Two bugs in the same loop in ixgbe_validate_rtr():\n> \n> 1. The 3-bit traffic-class field was extracted by shifting a u32 and\n>    assigning the result directly to a u8.  For user priority 0 this is\n>    harmless; for UP[5..7] the shift leaves bits [15..21] in the u32\n>    which are then silently truncated when stored in u8.  Mask with\n>    IXGBE_RTRUP2TC_UP_MASK before the assignment so only the intended\n>    3 bits are kept.\n> \n> 2. When clearing an out-of-bounds entry the mask was always shifted by\n>    the fixed constant IXGBE_RTRUP2TC_UP_SHIFT (== 3), regardless of\n>    which loop iteration was being processed.  This means only UP1 (bit\n>    position 3) was ever cleared; UP0,2..7 (positions 0, 6, 9, ..., 21)\n>    were left unreset, so invalid TC mappings persisted in hardware and\n>    could mis-steer received packets to the wrong traffic class.\n>    Use i * IXGBE_RTRUP2TC_UP_SHIFT to target the correct 3-bit field\n>    for each iteration.\n> \n> Swap the operand order in the mask expression to place the constant\n> on the right per kernel coding style (noted by David Laight).\n> \n> Fixes: e7589eab9291 (\"ixgbe: consolidate, setup for multiple traffic classes\")\n> Cc: stable@vger.kernel.org\n> Signed-off-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>\n> ---\n> v1 -> v2:\n>  - Add Fixes: tag; reroute to iwl-net (wrong bit positions cause packet\n>    mis-steering); swap to (reg >> ...) & MASK operand order per David\n>    Laight.\n\nReviewed-by: Simon Horman <horms@kernel.org>","headers":{"Return-Path":"<intel-wired-lan-bounces@osuosl.org>","X-Original-To":["incoming@patchwork.ozlabs.org","intel-wired-lan@lists.osuosl.org"],"Delivered-To":["patchwork-incoming@legolas.ozlabs.org","intel-wired-lan@lists.osuosl.org"],"Authentication-Results":["legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=osuosl.org header.i=@osuosl.org header.a=rsa-sha256\n header.s=default header.b=P/oEFost;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=osuosl.org\n (client-ip=2605:bc80:3010::138; helo=smtp1.osuosl.org;\n envelope-from=intel-wired-lan-bounces@osuosl.org;\n receiver=patchwork.ozlabs.org)"],"Received":["from smtp1.osuosl.org (smtp1.osuosl.org [IPv6:2605:bc80:3010::138])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fvTC35dPfz1y2d\n\tfor <incoming@patchwork.ozlabs.org>; Mon, 13 Apr 2026 23:43:43 +1000 (AEST)","from localhost (localhost [127.0.0.1])\n\tby smtp1.osuosl.org (Postfix) with ESMTP id 24FAC8475C;\n\tMon, 13 Apr 2026 13:43:42 +0000 (UTC)","from smtp1.osuosl.org ([127.0.0.1])\n by localhost (smtp1.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP\n id CvvCvyz2fCs4; Mon, 13 Apr 2026 13:43:41 +0000 (UTC)","from lists1.osuosl.org (lists1.osuosl.org [140.211.166.142])\n\tby smtp1.osuosl.org (Postfix) with ESMTP id 5488D846E6;\n\tMon, 13 Apr 2026 13:43:41 +0000 (UTC)","from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137])\n by lists1.osuosl.org (Postfix) with ESMTP id 04C87237\n for <intel-wired-lan@lists.osuosl.org>; Mon, 13 Apr 2026 13:43:40 +0000 (UTC)","from localhost (localhost [127.0.0.1])\n by smtp4.osuosl.org (Postfix) with ESMTP id EA7C042325\n for <intel-wired-lan@lists.osuosl.org>; Mon, 13 Apr 2026 13:43:39 +0000 (UTC)","from smtp4.osuosl.org ([127.0.0.1])\n by localhost (smtp4.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP\n id QT49qVs4Iuvc for <intel-wired-lan@lists.osuosl.org>;\n Mon, 13 Apr 2026 13:43:39 +0000 (UTC)","from tor.source.kernel.org (tor.source.kernel.org [172.105.4.254])\n by smtp4.osuosl.org (Postfix) with ESMTPS id 4DC934229C\n for <intel-wired-lan@lists.osuosl.org>; Mon, 13 Apr 2026 13:43:39 +0000 (UTC)","from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58])\n by tor.source.kernel.org (Postfix) with ESMTP id 17A1D6091C;\n Mon, 13 Apr 2026 13:43:38 +0000 (UTC)","by smtp.kernel.org (Postfix) with ESMTPSA id C7A04C2BCB4;\n Mon, 13 Apr 2026 13:43:36 +0000 (UTC)"],"X-Virus-Scanned":["amavis at osuosl.org","amavis at osuosl.org"],"X-Comment":"SPF check N/A for local connections - client-ip=140.211.166.142;\n helo=lists1.osuosl.org; envelope-from=intel-wired-lan-bounces@osuosl.org;\n receiver=<UNKNOWN> ","DKIM-Filter":["OpenDKIM Filter v2.11.0 smtp1.osuosl.org 5488D846E6","OpenDKIM Filter v2.11.0 smtp4.osuosl.org 4DC934229C"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=osuosl.org;\n\ts=default; t=1776087821;\n\tbh=JZRbzp28INPhxUNdsYLMyoaBffxpzsTwUo9FanaDUQk=;\n\th=Date:From:To:Cc:References:In-Reply-To:Subject:List-Id:\n\t List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe:\n\t From;\n\tb=P/oEFost/ciFp+dJLW8I21S5zt5hMKFrbf7ygGPvAx6i5gEXMOGL5hyd3rMa3rp1S\n\t IeIBFAEloNx4R2nDEzh746bORT0uC3Hl/mZ2Erc1DXbjk4r/hJNauUYzwqEdpREcWo\n\t Aua0E9nUrY3iYczn/8w2p3c8tB/Z2L0zYZ758Vwndg0NZQyRpo8x87ORJ6DcPXeBh6\n\t tHmb2gRSCfDlBMtpJllY5dghAty+t8RN+W3aQxHVhoIcbAOc8toGV6Y5I0dDZECIIg\n\t qFdvKRp3tHaGUVlYL/Vwnq72aeZmTI6nHSt+kSrvmmJrxcO1atS3ItTuc3tYLNJuij\n\t JpZC7hf1VycpQ==","Received-SPF":"Pass (mailfrom) identity=mailfrom; client-ip=172.105.4.254;\n helo=tor.source.kernel.org; envelope-from=horms@kernel.org;\n receiver=<UNKNOWN>","DMARC-Filter":"OpenDMARC Filter v1.4.2 smtp4.osuosl.org 4DC934229C","Date":"Mon, 13 Apr 2026 14:43:34 +0100","From":"Simon Horman <horms@kernel.org>","To":"Aleksandr Loktionov <aleksandr.loktionov@intel.com>","Cc":"intel-wired-lan@lists.osuosl.org, anthony.l.nguyen@intel.com,\n netdev@vger.kernel.org","Message-ID":"<20260413134334.GP469338@kernel.org>","References":"<20260408131154.2661818-1-aleksandr.loktionov@intel.com>\n <20260408131154.2661818-7-aleksandr.loktionov@intel.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=us-ascii","Content-Disposition":"inline","In-Reply-To":"<20260408131154.2661818-7-aleksandr.loktionov@intel.com>","X-Mailman-Original-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple;\n d=kernel.org; s=k20201202; t=1776087817;\n bh=ZFAMrSY8jw7Ij+knpPaJsB0Cm3Po6aQaaQ3IiLfQUog=;\n h=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n b=oUoG8juz+ZV1bFSwY92yONhOy4d/ti0+M/1zb31HvLm6g16/O1wIDHFZiCIG2VG0Y\n /us+KqUkPoMCCHTTPVYI7Xxay43OefA5cRgFJLG/PEHil7xCbvu6fM3z1trgq2I3pe\n LEXfALQd5ZOqRMYrdZmuGsaNqGl2XMGuYJKLapES5rLxWmCkAk3egTZam5mSCilxcA\n 8uexhE7jAF0Z/46Y22oiKXROxwL8OF2CBtELixs11prlorUcgZcZuqeQ6sDg0Ol1Ac\n ZB0srmiOvhhpxkFFV0YlpajtzdjW3A2bXRzu2T5ad392Kp0chl4c7VNI8zjuOfnBmi\n lK3BHjwEuDYhg==","X-Mailman-Original-Authentication-Results":["smtp4.osuosl.org;\n dmarc=pass (p=quarantine dis=none)\n header.from=kernel.org","smtp4.osuosl.org;\n dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org\n header.a=rsa-sha256 header.s=k20201202 header.b=oUoG8juz"],"Subject":"Re: [Intel-wired-lan] [PATCH iwl-net v2 6/6] ixgbe: fix integer\n overflow and wrong bit position in ixgbe_validate_rtr()","X-BeenThere":"intel-wired-lan@osuosl.org","X-Mailman-Version":"2.1.30","Precedence":"list","List-Id":"Intel Wired Ethernet Linux Kernel Driver Development\n <intel-wired-lan.osuosl.org>","List-Unsubscribe":"<https://lists.osuosl.org/mailman/options/intel-wired-lan>,\n <mailto:intel-wired-lan-request@osuosl.org?subject=unsubscribe>","List-Archive":"<http://lists.osuosl.org/pipermail/intel-wired-lan/>","List-Post":"<mailto:intel-wired-lan@osuosl.org>","List-Help":"<mailto:intel-wired-lan-request@osuosl.org?subject=help>","List-Subscribe":"<https://lists.osuosl.org/mailman/listinfo/intel-wired-lan>,\n <mailto:intel-wired-lan-request@osuosl.org?subject=subscribe>","Errors-To":"intel-wired-lan-bounces@osuosl.org","Sender":"\"Intel-wired-lan\" <intel-wired-lan-bounces@osuosl.org>"}},{"id":3676779,"web_url":"http://patchwork.ozlabs.org/comment/3676779/","msgid":"<20260413140226.GQ469338@kernel.org>","list_archive_url":null,"date":"2026-04-13T14:02:26","subject":"Re: [Intel-wired-lan] [PATCH iwl-net v2 6/6] ixgbe: fix integer\n overflow and wrong bit position in ixgbe_validate_rtr()","submitter":{"id":82748,"url":"http://patchwork.ozlabs.org/api/people/82748/","name":"Simon Horman","email":"horms@kernel.org"},"content":"On Mon, Apr 13, 2026 at 02:43:34PM +0100, Simon Horman wrote:\n> On Wed, Apr 08, 2026 at 03:11:54PM +0200, Aleksandr Loktionov wrote:\n> > Two bugs in the same loop in ixgbe_validate_rtr():\n> > \n> > 1. The 3-bit traffic-class field was extracted by shifting a u32 and\n> >    assigning the result directly to a u8.  For user priority 0 this is\n> >    harmless; for UP[5..7] the shift leaves bits [15..21] in the u32\n> >    which are then silently truncated when stored in u8.  Mask with\n> >    IXGBE_RTRUP2TC_UP_MASK before the assignment so only the intended\n> >    3 bits are kept.\n> > \n> > 2. When clearing an out-of-bounds entry the mask was always shifted by\n> >    the fixed constant IXGBE_RTRUP2TC_UP_SHIFT (== 3), regardless of\n> >    which loop iteration was being processed.  This means only UP1 (bit\n> >    position 3) was ever cleared; UP0,2..7 (positions 0, 6, 9, ..., 21)\n> >    were left unreset, so invalid TC mappings persisted in hardware and\n> >    could mis-steer received packets to the wrong traffic class.\n> >    Use i * IXGBE_RTRUP2TC_UP_SHIFT to target the correct 3-bit field\n> >    for each iteration.\n> > \n> > Swap the operand order in the mask expression to place the constant\n> > on the right per kernel coding style (noted by David Laight).\n> > \n> > Fixes: e7589eab9291 (\"ixgbe: consolidate, setup for multiple traffic classes\")\n> > Cc: stable@vger.kernel.org\n> > Signed-off-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>\n> > ---\n> > v1 -> v2:\n> >  - Add Fixes: tag; reroute to iwl-net (wrong bit positions cause packet\n> >    mis-steering); swap to (reg >> ...) & MASK operand order per David\n> >    Laight.\n> \n> Reviewed-by: Simon Horman <horms@kernel.org>\n\nSorry, I was a little too hasty there.\n\nAI generated code review points out that the cited commit\ndoesn't seem to have introduced the code being fixed,\nand that perhaps this Fixes tag would be more appropriate.\n\nFixes: 8b1c0b24d9af (\"ixgbe: configure minimal packet buffers to support TC\")\n\nI will also forward on a review from Sashiko, although it\nis for an existing bug and thus is strictly FYI.","headers":{"Return-Path":"<intel-wired-lan-bounces@osuosl.org>","X-Original-To":["incoming@patchwork.ozlabs.org","intel-wired-lan@lists.osuosl.org"],"Delivered-To":["patchwork-incoming@legolas.ozlabs.org","intel-wired-lan@lists.osuosl.org"],"Authentication-Results":["legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=osuosl.org header.i=@osuosl.org header.a=rsa-sha256\n header.s=default header.b=TYg6kHRr;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=osuosl.org\n (client-ip=140.211.166.138; helo=smtp1.osuosl.org;\n envelope-from=intel-wired-lan-bounces@osuosl.org;\n receiver=patchwork.ozlabs.org)"],"Received":["from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fvTcq2rg7z1xtJ\n\tfor <incoming@patchwork.ozlabs.org>; Tue, 14 Apr 2026 00:02:35 +1000 (AEST)","from localhost (localhost [127.0.0.1])\n\tby smtp1.osuosl.org (Postfix) with ESMTP id 461898475C;\n\tMon, 13 Apr 2026 14:02:33 +0000 (UTC)","from smtp1.osuosl.org ([127.0.0.1])\n by localhost (smtp1.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP\n id wUj5kmMvgcW1; Mon, 13 Apr 2026 14:02:32 +0000 (UTC)","from lists1.osuosl.org (lists1.osuosl.org [140.211.166.142])\n\tby smtp1.osuosl.org (Postfix) with ESMTP id 7CD41841BC;\n\tMon, 13 Apr 2026 14:02:32 +0000 (UTC)","from smtp3.osuosl.org (smtp3.osuosl.org [IPv6:2605:bc80:3010::136])\n by lists1.osuosl.org (Postfix) with ESMTP id AF663237\n for <intel-wired-lan@lists.osuosl.org>; Mon, 13 Apr 2026 14:02:31 +0000 (UTC)","from localhost (localhost [127.0.0.1])\n by smtp3.osuosl.org (Postfix) with ESMTP id 9BCB6608B1\n for <intel-wired-lan@lists.osuosl.org>; Mon, 13 Apr 2026 14:02:31 +0000 (UTC)","from smtp3.osuosl.org ([127.0.0.1])\n by localhost (smtp3.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP\n id n1R0ZpksbLMV for <intel-wired-lan@lists.osuosl.org>;\n Mon, 13 Apr 2026 14:02:31 +0000 (UTC)","from sea.source.kernel.org (sea.source.kernel.org\n [IPv6:2600:3c0a:e001:78e:0:1991:8:25])\n by smtp3.osuosl.org (Postfix) with ESMTPS id F155360ED7\n for <intel-wired-lan@lists.osuosl.org>; Mon, 13 Apr 2026 14:02:30 +0000 (UTC)","from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58])\n by sea.source.kernel.org (Postfix) with ESMTP id 394B3441C0;\n Mon, 13 Apr 2026 14:02:30 +0000 (UTC)","by smtp.kernel.org (Postfix) with ESMTPSA id 1F623C2BCAF;\n Mon, 13 Apr 2026 14:02:28 +0000 (UTC)"],"X-Virus-Scanned":["amavis at osuosl.org","amavis at osuosl.org"],"X-Comment":"SPF check N/A for local connections - client-ip=140.211.166.142;\n helo=lists1.osuosl.org; envelope-from=intel-wired-lan-bounces@osuosl.org;\n receiver=<UNKNOWN> ","DKIM-Filter":["OpenDKIM Filter v2.11.0 smtp1.osuosl.org 7CD41841BC","OpenDKIM Filter v2.11.0 smtp3.osuosl.org F155360ED7"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=osuosl.org;\n\ts=default; t=1776088952;\n\tbh=yDI/S1cf2z4jAKp7tXIb7f2qhf89hxakF7BSm1HpTAw=;\n\th=Date:From:To:Cc:References:In-Reply-To:Subject:List-Id:\n\t List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe:\n\t From;\n\tb=TYg6kHRr0a6liTQJ7GnW/q4J6stw+KRnYcHawO6sjLixZuuFzio8PBq3yUtrHqGtF\n\t qPTUvX4fXAKDy+Y2vIe6PViI/9TGyAYVih4UdncStGiA3DvHxNlfSPQMy8WHiMukJ+\n\t SSGmTSOUhewrmy9iPbxkUhXx9mWUSCnJgcMs7bTVVTIzRWZSUej58kXePIufBEj4XE\n\t eILiwc71KV2xcHfXg+wq4vSUkTHcaSrIJ/YJ2fjuML9dkM0ho24ZUDKrobLvFfd1ju\n\t DOXxySCYbHZDXYyChW0Kn2TamvEuQbvb6hADDZiYlFLVVL+IE5oavnhEenvBy8/xYw\n\t N39M9kY9v+WyA==","Received-SPF":"Pass (mailfrom) identity=mailfrom;\n client-ip=2600:3c0a:e001:78e:0:1991:8:25; helo=sea.source.kernel.org;\n envelope-from=horms@kernel.org; receiver=<UNKNOWN>","DMARC-Filter":"OpenDMARC Filter v1.4.2 smtp3.osuosl.org F155360ED7","Date":"Mon, 13 Apr 2026 15:02:26 +0100","From":"Simon Horman <horms@kernel.org>","To":"Aleksandr Loktionov <aleksandr.loktionov@intel.com>","Cc":"intel-wired-lan@lists.osuosl.org, anthony.l.nguyen@intel.com,\n netdev@vger.kernel.org","Message-ID":"<20260413140226.GQ469338@kernel.org>","References":"<20260408131154.2661818-1-aleksandr.loktionov@intel.com>\n <20260408131154.2661818-7-aleksandr.loktionov@intel.com>\n <20260413134334.GP469338@kernel.org>","MIME-Version":"1.0","Content-Type":"text/plain; charset=us-ascii","Content-Disposition":"inline","In-Reply-To":"<20260413134334.GP469338@kernel.org>","X-Mailman-Original-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple;\n d=kernel.org; s=k20201202; t=1776088950;\n bh=lsCmK8bgfymrGWmfnrdu1HhqbYmux52O5R+oq3QNKiw=;\n h=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n b=TrHvvPzrpaItVhm08JmAQ2LYc1MyMWm5ZlJgajH2XrONzWtxui2XUkOlSEA6SjRrn\n JWxyBP38OFwqjqr4nN+52tbPPgBT28Q0TpaeRFlc6NSfWPA9Faox1scws8YQTJrpKD\n asmbtxTCSwiskLxl2sGMpV0Ntr1eGYa0XHELW5SHmbc+2eo2BSMye23okJaRP2Id2J\n mSRh2QM0HsGvP0o/z04EGtlud04GcO+gktRQr/oAu2PArDfb+8nSjdszoFUEvoPPRr\n tlwLJ/3DwadsQ1VblrpnvCoS6Kc7bNJRtDlcztSEFvm7TmHq6aN6qL7Be+3PhyMldb\n pkLEY4qsNClCg==","X-Mailman-Original-Authentication-Results":["smtp3.osuosl.org;\n dmarc=pass (p=quarantine dis=none)\n header.from=kernel.org","smtp3.osuosl.org;\n dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org\n header.a=rsa-sha256 header.s=k20201202 header.b=TrHvvPzr"],"Subject":"Re: [Intel-wired-lan] [PATCH iwl-net v2 6/6] ixgbe: fix integer\n overflow and wrong bit position in ixgbe_validate_rtr()","X-BeenThere":"intel-wired-lan@osuosl.org","X-Mailman-Version":"2.1.30","Precedence":"list","List-Id":"Intel Wired Ethernet Linux Kernel Driver Development\n <intel-wired-lan.osuosl.org>","List-Unsubscribe":"<https://lists.osuosl.org/mailman/options/intel-wired-lan>,\n <mailto:intel-wired-lan-request@osuosl.org?subject=unsubscribe>","List-Archive":"<http://lists.osuosl.org/pipermail/intel-wired-lan/>","List-Post":"<mailto:intel-wired-lan@osuosl.org>","List-Help":"<mailto:intel-wired-lan-request@osuosl.org?subject=help>","List-Subscribe":"<https://lists.osuosl.org/mailman/listinfo/intel-wired-lan>,\n <mailto:intel-wired-lan-request@osuosl.org?subject=subscribe>","Errors-To":"intel-wired-lan-bounces@osuosl.org","Sender":"\"Intel-wired-lan\" <intel-wired-lan-bounces@osuosl.org>"}},{"id":3676782,"web_url":"http://patchwork.ozlabs.org/comment/3676782/","msgid":"<20260413140307.715409-1-horms@kernel.org>","list_archive_url":null,"date":"2026-04-13T14:03:07","subject":"Re: [Intel-wired-lan] [PATCH iwl-net v2 6/6] ixgbe: fix integer\n overflow and wrong bit position in ixgbe_validate_rtr()","submitter":{"id":82748,"url":"http://patchwork.ozlabs.org/api/people/82748/","name":"Simon Horman","email":"horms@kernel.org"},"content":"From: 'Simon Horman' <horms@kernel.org>\n\nThis is an AI-generated review of your patch. The human sending this\nemail has considered the AI review valid, or at least plausible.\nFull review at: https://sashiko.dev\n---\nixgbe: fix integer overflow and wrong bit position in ixgbe_validate_rtr()\n\nThis commit fixes two bugs in ixgbe_validate_rtr() by masking the\ntraffic-class field properly before assigning it to a u8, and correctly\nshifting the mask for clearing out-of-bounds entries.\n\nCc: stable@vger.kernel.org\n\n> diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c\n> index 5ff462a848feb..8ebf717ce4017 100644\n> --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c\n> +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c\n> @@ -9782,11 +9782,12 @@ static void ixgbe_validate_rtr(struct ixgbe_adapter *adapter, u8 tc)\n>  \trsave = reg;\n>  \n>  \tfor (i = 0; i < MAX_TRAFFIC_CLASS; i++) {\n> -\t\tu8 up2tc = reg >> (i * IXGBE_RTRUP2TC_UP_SHIFT);\n> +\t\tu8 up2tc = (reg >> (i * IXGBE_RTRUP2TC_UP_SHIFT)) &\n> +\t\t\t   IXGBE_RTRUP2TC_UP_MASK;\n>  \n>  \t\t/* If up2tc is out of bounds default to zero */\n>  \t\tif (up2tc > tc)\n\nThis wasn't introduced by this patch, but is there a pre-existing off-by-one\nerror in this bounds check?\n\nIf tc represents the number of enabled traffic classes (e.g., 4), the valid TC\nindices would be 0 through tc - 1. If up2tc equals tc, it would be out of\nbounds, but the condition up2tc > tc will evaluate to false and the invalid\nmapping won't be cleared.\n\nCould this allow an invalid UP-to-TC mapping to persist in the hardware\nregister, potentially causing received packets to be mis-steered to an\nuninitialized or non-existent traffic class queue?\n\nShould the condition be corrected to ensure up2tc is strictly less than tc\nwhen tc > 0?\n\n> -\t\t\treg &= ~(0x7 << IXGBE_RTRUP2TC_UP_SHIFT);\n> +\t\t\treg &= ~(IXGBE_RTRUP2TC_UP_MASK << (i * IXGBE_RTRUP2TC_UP_SHIFT));\n>  \t}","headers":{"Return-Path":"<intel-wired-lan-bounces@osuosl.org>","X-Original-To":["incoming@patchwork.ozlabs.org","intel-wired-lan@lists.osuosl.org"],"Delivered-To":["patchwork-incoming@legolas.ozlabs.org","intel-wired-lan@lists.osuosl.org"],"Authentication-Results":["legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=osuosl.org header.i=@osuosl.org header.a=rsa-sha256\n header.s=default header.b=cSYubW+c;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=osuosl.org\n (client-ip=2605:bc80:3010::138; helo=smtp1.osuosl.org;\n envelope-from=intel-wired-lan-bounces@osuosl.org;\n receiver=patchwork.ozlabs.org)"],"Received":["from smtp1.osuosl.org (smtp1.osuosl.org [IPv6:2605:bc80:3010::138])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fvTfq1yJ0z1xtJ\n\tfor <incoming@patchwork.ozlabs.org>; Tue, 14 Apr 2026 00:04:19 +1000 (AEST)","from localhost (localhost [127.0.0.1])\n\tby smtp1.osuosl.org (Postfix) with ESMTP id 7E92A846DA;\n\tMon, 13 Apr 2026 14:04:17 +0000 (UTC)","from smtp1.osuosl.org ([127.0.0.1])\n by localhost (smtp1.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP\n id aa2RbqzdMryN; Mon, 13 Apr 2026 14:04:16 +0000 (UTC)","from lists1.osuosl.org (lists1.osuosl.org [140.211.166.142])\n\tby smtp1.osuosl.org (Postfix) with ESMTP id 2DC17841BC;\n\tMon, 13 Apr 2026 14:04:16 +0000 (UTC)","from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137])\n by lists1.osuosl.org (Postfix) with ESMTP id 7ECE7237\n for <intel-wired-lan@lists.osuosl.org>; Mon, 13 Apr 2026 14:04:14 +0000 (UTC)","from localhost (localhost [127.0.0.1])\n by smtp4.osuosl.org (Postfix) with ESMTP id 64F1342089\n for <intel-wired-lan@lists.osuosl.org>; Mon, 13 Apr 2026 14:04:14 +0000 (UTC)","from smtp4.osuosl.org ([127.0.0.1])\n by localhost (smtp4.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP\n id 9tEW7FT8rvgK for <intel-wired-lan@lists.osuosl.org>;\n Mon, 13 Apr 2026 14:04:13 +0000 (UTC)","from sea.source.kernel.org (sea.source.kernel.org\n [IPv6:2600:3c0a:e001:78e:0:1991:8:25])\n by smtp4.osuosl.org (Postfix) with ESMTPS id 7436441292\n for <intel-wired-lan@lists.osuosl.org>; Mon, 13 Apr 2026 14:04:13 +0000 (UTC)","from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58])\n by sea.source.kernel.org (Postfix) with ESMTP id 201BD4041D;\n Mon, 13 Apr 2026 14:04:13 +0000 (UTC)","by smtp.kernel.org (Postfix) with ESMTPSA id 9062CC2BCAF;\n Mon, 13 Apr 2026 14:04:11 +0000 (UTC)"],"X-Virus-Scanned":["amavis at osuosl.org","amavis at osuosl.org"],"X-Comment":"SPF check N/A for local connections - client-ip=140.211.166.142;\n helo=lists1.osuosl.org; envelope-from=intel-wired-lan-bounces@osuosl.org;\n receiver=<UNKNOWN> ","DKIM-Filter":["OpenDKIM Filter v2.11.0 smtp1.osuosl.org 2DC17841BC","OpenDKIM Filter v2.11.0 smtp4.osuosl.org 7436441292"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=osuosl.org;\n\ts=default; t=1776089056;\n\tbh=v1C5qdQnf7YIMB+iEYlsrIwDfbPEhXXGWNFrTiSabBA=;\n\th=From:To:Cc:Date:In-Reply-To:References:Subject:List-Id:\n\t List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe:\n\t From;\n\tb=cSYubW+cXebksU+PtUQ2y606Kd+lM0f0gmDs+9mAfrKvy7frgUaUUaIyod6ZMQbTL\n\t iP4g8KtSeGBe9IUN/kKplcngBGEeqO9AmYoqsNLyOm8Ovz88Oh8Nx4JMiiKBZoVZZV\n\t RdTTHbjc4MbFWRnt6kIx74AIw44GsUyrMepy+A1YmGKmQ8VkqJl9Cdz8Q3w9Q1tx2L\n\t QpoSE2os4evAYP7VbiGv4m0VQiFz8LgoVKKsqnQRYat5vNtBZLtAfT6xOPK000XCf6\n\t WrrlmhhDdvKDYa+UWStdZfktV3/hzNM7vM9k36fZGRAA9cxKKfFiMJOelS+a4wDceY\n\t Kf3YZkQlZczUA==","Received-SPF":"Pass (mailfrom) identity=mailfrom;\n client-ip=2600:3c0a:e001:78e:0:1991:8:25; helo=sea.source.kernel.org;\n envelope-from=horms@kernel.org; receiver=<UNKNOWN>","DMARC-Filter":"OpenDMARC Filter v1.4.2 smtp4.osuosl.org 7436441292","From":"Simon Horman <horms@kernel.org>","To":"aleksandr.loktionov@intel.com","Cc":"'Simon Horman' <horms@kernel.org>, intel-wired-lan@lists.osuosl.org,\n anthony.l.nguyen@intel.com, netdev@vger.kernel.org, stable@vger.kernel.org","Date":"Mon, 13 Apr 2026 15:03:07 +0100","Message-ID":"<20260413140307.715409-1-horms@kernel.org>","X-Mailer":"git-send-email 2.53.0","In-Reply-To":"<20260408131154.2661818-7-aleksandr.loktionov@intel.com>","References":"<20260408131154.2661818-7-aleksandr.loktionov@intel.com>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","X-Mailman-Original-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple;\n d=kernel.org; s=k20201202; t=1776089052;\n bh=PZPocgNq/t+BoK9YO0g4NcHOvsEnwrcuzcTMgVzbDRc=;\n h=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n b=sQ/rI1UvHOQ+roW0A6IDSgDJ1b0pLaQvXe5zqkw+FVGVpWk8EG1wK8fGIagzv6Mim\n 4O8BpTNUTZPrNHweOqewPuZft/QR4+jHezJ/glnRr/F91wRA6HcCOzM7ormX8x8lds\n dR9IPCfYKcSZNwExOtF+Y78WtWLmejYpNQ92Ya7SH8y2HcZL4Tf4TVsEw+uehCRszU\n lUy0lOI5KQVDIewL3zdcwlsxR2nJw6h0XZda++ue09kUXr6LITbszedrYV4YeMqXUi\n D1ylNUlHp0S5hV4a0Xk971C+ZxKs2YgRY1oIAkHAgxmQ7oEVUsrCPzOWi7WeIfzBL4\n E/Fmsl2sCLMMQ==","X-Mailman-Original-Authentication-Results":["smtp4.osuosl.org;\n dmarc=pass (p=quarantine dis=none)\n header.from=kernel.org","smtp4.osuosl.org;\n dkim=pass (2048-bit key,\n unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256\n header.s=k20201202 header.b=sQ/rI1Uv"],"Subject":"Re: [Intel-wired-lan] [PATCH iwl-net v2 6/6] ixgbe: fix integer\n overflow and wrong bit position in ixgbe_validate_rtr()","X-BeenThere":"intel-wired-lan@osuosl.org","X-Mailman-Version":"2.1.30","Precedence":"list","List-Id":"Intel Wired Ethernet Linux Kernel Driver Development\n <intel-wired-lan.osuosl.org>","List-Unsubscribe":"<https://lists.osuosl.org/mailman/options/intel-wired-lan>,\n <mailto:intel-wired-lan-request@osuosl.org?subject=unsubscribe>","List-Archive":"<http://lists.osuosl.org/pipermail/intel-wired-lan/>","List-Post":"<mailto:intel-wired-lan@osuosl.org>","List-Help":"<mailto:intel-wired-lan-request@osuosl.org?subject=help>","List-Subscribe":"<https://lists.osuosl.org/mailman/listinfo/intel-wired-lan>,\n <mailto:intel-wired-lan-request@osuosl.org?subject=subscribe>","Errors-To":"intel-wired-lan-bounces@osuosl.org","Sender":"\"Intel-wired-lan\" <intel-wired-lan-bounces@osuosl.org>"}}]