From nobody Thu Oct 2 10:53:01 2025 Received: from mail.nppct.ru (mail.nppct.ru [195.133.245.4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B7C6730BF5A for ; Wed, 17 Sep 2025 15:40:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.133.245.4 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1758123618; cv=none; b=ZE0gjYo3xjnhgMi6ZScjEyw8wrtmgDc/0d2ckWXsmgJwcNf3Nz9bmR9mtnkmvg8fDIggpEY88MO1+puzOpvaNKc5nLLsfnMzEsMEoGXaUsNh4WmRAQCz1uu075QqV0VkcB/KoZfiB6b7LLZyia5aCFX/8VTbXstKCjp8h3+FS3I= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1758123618; c=relaxed/simple; bh=W+nAB7mlSdd0jKuQKWnzw6YNuQNulCyIVJxWcBkg+d0=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=ffFdkqn8Jmo154ru/6sbYWvMKWLQEPZpZgHPnt0P/D3gfjy4pQt/enMvzbZ5x5e/02KPay06OixiM6UoAV8ZlsGKv/MvDo2+kuQHisfoQa5K3iy+4vSk2qSBXGCRamBMIclUh4aU5zS5l/Ae3HMFkcLAIC3tCElk41RZS/xbLx4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=nppct.ru; spf=pass smtp.mailfrom=nppct.ru; dkim=pass (1024-bit key) header.d=nppct.ru header.i=@nppct.ru header.b=mUK7Y2JD; arc=none smtp.client-ip=195.133.245.4 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=nppct.ru Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nppct.ru Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=nppct.ru header.i=@nppct.ru header.b="mUK7Y2JD" Received: from mail.nppct.ru (localhost [127.0.0.1]) by mail.nppct.ru (Postfix) with ESMTP id 487691C1287 for ; Wed, 17 Sep 2025 18:31:22 +0300 (MSK) Authentication-Results: mail.nppct.ru (amavisd-new); dkim=pass (1024-bit key) reason="pass (just generated, assumed good)" header.d=nppct.ru DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=nppct.ru; h= content-transfer-encoding:mime-version:x-mailer:message-id:date :date:subject:subject:to:from:from; s=dkim; t=1758123080; x= 1758987081; bh=W+nAB7mlSdd0jKuQKWnzw6YNuQNulCyIVJxWcBkg+d0=; b=m UK7Y2JDolCC4ftU69n3P0AGiWfHotidgiNjBSyT7VJzTPEEd0HaKE/GN6stqlu66 haIlkdCUTF96H/gv+sIkGAW7jlt1hWJagZhisNwuGuByGOiPGbbFiOjS78Edbr4+ Ts1eq5o6vgLqO6dcCSXlXmRMfzMjXKtfZmfT+97O8A= X-Virus-Scanned: Debian amavisd-new at mail.nppct.ru Received: from mail.nppct.ru ([127.0.0.1]) by mail.nppct.ru (mail.nppct.ru [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id LmnvrL22j1He for ; Wed, 17 Sep 2025 18:31:20 +0300 (MSK) Received: from localhost.localdomain (unknown [87.249.24.51]) by mail.nppct.ru (Postfix) with ESMTPSA id 024D61C0CC1; Wed, 17 Sep 2025 18:31:18 +0300 (MSK) From: Alexey Nepomnyashih To: Andrew Lunn Cc: Alexey Nepomnyashih , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, lvc-project@linuxtesting.org, stable@vger.kernel.org Subject: [PATCH] net: liquidio: fix overflow in octeon_init_instr_queue() Date: Wed, 17 Sep 2025 15:30:58 +0000 Message-ID: <20250917153105.562563-1-sdl@nppct.ru> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The expression `(conf->instr_type =3D=3D 64) << iq_no` can overflow because `iq_no` may be as high as 64 (`CN23XX_MAX_RINGS_PER_PF`). Casting the operand to `u64` ensures correct 64-bit arithmetic. Found by Linux Verification Center (linuxtesting.org) with SVACE. Cc: stable@vger.kernel.org # v4.2+ Fixes: f21fb3ed364b ("Add support of Cavium Liquidio ethernet adapters") Signed-off-by: Alexey Nepomnyashih --- drivers/net/ethernet/cavium/liquidio/request_manager.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/cavium/liquidio/request_manager.c b/drive= rs/net/ethernet/cavium/liquidio/request_manager.c index de8a6ce86ad7..12105ffb5dac 100644 --- a/drivers/net/ethernet/cavium/liquidio/request_manager.c +++ b/drivers/net/ethernet/cavium/liquidio/request_manager.c @@ -126,7 +126,7 @@ int octeon_init_instr_queue(struct octeon_device *oct, oct->io_qmask.iq |=3D BIT_ULL(iq_no); =20 /* Set the 32B/64B mode for each input queue */ - oct->io_qmask.iq64B |=3D ((conf->instr_type =3D=3D 64) << iq_no); + oct->io_qmask.iq64B |=3D ((u64)(conf->instr_type =3D=3D 64) << iq_no); iq->iqcmd_64B =3D (conf->instr_type =3D=3D 64); =20 oct->fn_list.setup_iq_regs(oct, iq_no); --=20 2.43.0