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 8A3D63B1EC2 for ; Tue, 12 May 2026 14:18:30 +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=1778595510; cv=none; b=n4+Ihb6y5Pb0GUC4WPV/sz3F8NCUdVKF7I0UHFGbZD0kxql/SGrWbLj4YkcYHFwIJnMfU8Od8UgXXwd9gLYFYab+aEmQ0LUvCvfRb8NgS5omAV+Qz/J9xIS6EhoqlGeCGfGGYgOdflbZidNtc50lr7qpqpvVN2Xdm0ACrlDS8nQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778595510; c=relaxed/simple; bh=NhBasVjfMMoRfPaqgg2ZnINc2JE7sUR69HZyytleOtY=; h=Subject:To:Cc:From:Date:Message-ID:MIME-Version:Content-Type; b=U4Kska4FnReFfv40PCvgvR5yGt99mlpm+24+Yb2OI0rfbryloMtiRi7Da1ty488cSuIkZIxBqiVgDoZ81C7HjfyM6Dpyf6Vo5dQe6o1wjqem/7DjKjD26qfuM3gpXrxwZ5NoknI5fsGWu0GJ8FxekkQMwW+r3W1hJr0DvxvMrRU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=LvPfeuOa; 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="LvPfeuOa" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2124EC2BCF5; Tue, 12 May 2026 14:18:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1778595510; bh=NhBasVjfMMoRfPaqgg2ZnINc2JE7sUR69HZyytleOtY=; h=Subject:To:Cc:From:Date:From; b=LvPfeuOaZeS7trz6wABad7ocGjp18jh2Q5DcBR0X5VFXGfD6BCYVWVuXjJqh/+gdR q8xy6DQ+6ldLPQuogBcFXePXYKlmnGp7hT62XgvsbjNnKAAmlYks/Z2adBeWztZMDZ QfweH7dV2phlGCkZ2hVfbKKbGizN2Rhhp+gm9Sa0= Subject: FAILED: patch "[PATCH] RDMA/mana: Validate rx_hash_key_len" failed to apply to 6.6-stable tree To: jgg@ziepe.ca,jgg@nvidia.com,longli@microsoft.com Cc: From: Date: Tue, 12 May 2026 16:15:37 +0200 Message-ID: <2026051237-palpitate-lumping-b73c@gregkh> Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit The patch below does not apply to the 6.6-stable tree. If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to . To reproduce the conflict and resubmit, you may use the following commands: git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-6.6.y git checkout FETCH_HEAD git cherry-pick -x 6dd2d4ad9c8429523b1c220c5132bd551c006425 # git commit -s git send-email --to '' --in-reply-to '2026051237-palpitate-lumping-b73c@gregkh' --subject-prefix 'PATCH 6.6.y' HEAD^.. Possible dependencies: thanks, greg k-h ------------------ original commit in Linus's tree ------------------ >From 6dd2d4ad9c8429523b1c220c5132bd551c006425 Mon Sep 17 00:00:00 2001 From: Jason Gunthorpe Date: Tue, 28 Apr 2026 13:17:37 -0300 Subject: [PATCH] RDMA/mana: Validate rx_hash_key_len Sashiko points out that rx_hash_key_len comes from a uAPI structure and is blindly passed to memcpy, allowing the userspace to trash kernel memory. Bounds check it so the memcpy cannot overflow. Cc: stable@vger.kernel.org Fixes: 0266a177631d ("RDMA/mana_ib: Add a driver for Microsoft Azure Network Adapter") Link: https://sashiko.dev/#/patchset/0-v2-1c49eeb88c48%2B91-rdma_udata_rep_jgg%40nvidia.com?part=1 Link: https://patch.msgid.link/r/4-v1-41f3135e5565+9d2-rdma_ai_fixes1_jgg@nvidia.com Reviewed-by: Long Li Signed-off-by: Jason Gunthorpe diff --git a/drivers/infiniband/hw/mana/qp.c b/drivers/infiniband/hw/mana/qp.c index 645581359cee..f7bb0d1f0f80 100644 --- a/drivers/infiniband/hw/mana/qp.c +++ b/drivers/infiniband/hw/mana/qp.c @@ -21,6 +21,9 @@ static int mana_ib_cfg_vport_steering(struct mana_ib_dev *dev, gc = mdev_to_gc(dev); + if (rx_hash_key_len > sizeof(req->hashkey)) + return -EINVAL; + req_buf_size = struct_size(req, indir_tab, MANA_INDIRECT_TABLE_DEF_SIZE); req = kzalloc(req_buf_size, GFP_KERNEL); if (!req)