From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 7346B285C92; Mon, 22 Sep 2025 19:38:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1758569894; cv=none; b=NbQIAa/6a87YMepznl1r/8eKJgNbjm8mLEUvhok8kLOvILdHpPKoA8Lc4UvCiA0fFHwFXn4sk9C4sLqUEL0md9IPuPO9z23wHg482GifgXp04XfDiE8HDyto2rxmUw/59798w5kdnJEny4OGMOkzaPvFAk+A22T9JzZ8EuVkgeE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1758569894; c=relaxed/simple; bh=1UiOja34AIWGiOYjffT8EcytZOLXh3+p+U5hzoVIsBk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Ke8u4atM+L0AE1XoV0icAXr3dj0/5M4MbSi0lznH20lYP/PijxaCAQF99QuWTuVadDFkNlqJgv9/fkNvPOtNJ2ie1HQkZs2MH3gwjBezian7iTTYMYzczs4dHFs+lnyV1hTp01Gvbke8vKx7IrQOkq2dnb0gkSmJdZGGSm3pNfs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=wTBj9mEK; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="wTBj9mEK" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0C11BC4CEF5; Mon, 22 Sep 2025 19:38:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1758569894; bh=1UiOja34AIWGiOYjffT8EcytZOLXh3+p+U5hzoVIsBk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=wTBj9mEK8zGTmeYKZfn+NFHbXzvAsaqgG/UMd6emAMUkBXO5Ptffcs5VXmkZyv26p TMHhiL3wr733Vmv0JQvxBMsdBQWwmXovo/F0lUzXbL0JfNSMmsWtqiNLCeavRqfy/N FH2+B6a5g/XJAzFVucDFAlq/DoFm7GmA04QtqEv8= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Alexey Nepomnyashih , Jakub Kicinski , Sasha Levin Subject: [PATCH 6.12 030/105] net: liquidio: fix overflow in octeon_init_instr_queue() Date: Mon, 22 Sep 2025 21:29:13 +0200 Message-ID: <20250922192409.699937726@linuxfoundation.org> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20250922192408.913556629@linuxfoundation.org> References: <20250922192408.913556629@linuxfoundation.org> User-Agent: quilt/0.68 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.12-stable review patch. If anyone has any objections, please let me know. ------------------ From: Alexey Nepomnyashih [ Upstream commit cca7b1cfd7b8a0eff2a3510c5e0f10efe8fa3758 ] The expression `(conf->instr_type == 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. Fixes: f21fb3ed364b ("Add support of Cavium Liquidio ethernet adapters") Signed-off-by: Alexey Nepomnyashih Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin --- 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/drivers/net/ethernet/cavium/liquidio/request_manager.c index de8a6ce86ad7e..12105ffb5dac6 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 |= BIT_ULL(iq_no); /* Set the 32B/64B mode for each input queue */ - oct->io_qmask.iq64B |= ((conf->instr_type == 64) << iq_no); + oct->io_qmask.iq64B |= ((u64)(conf->instr_type == 64) << iq_no); iq->iqcmd_64B = (conf->instr_type == 64); oct->fn_list.setup_iq_regs(oct, iq_no); -- 2.51.0