From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.160.200 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796002398; b=UQLjgfynOsHyeES5OXH2OFHMcmeyHNJPF1H48CxhLD9bQAJt4cewLIAf5iJvAfIYLilD K4A87fexELWDVGV6NujShJcLUqVTg00N8XJt3dRfh5DEdPYU85SX9G+7irk8nUW+ku+en EBaNRPvnqhrKshDzrGFa4+aRAan2oLEMUI85WL6rp5InQCZ8vKRGVlVqtyJgfM5ly4BF2 9dFS74iAKcp3RQ7MbFJux0PgqHOmKRgtv8ysEyWCjjpY/gbaJi7h4VudAoZhV7qbzNOoh 5jlX/PtPxhApHhEu8aWXbM4NAVDWFLHeD8FRClByRgx9VjQMKnty/3YtBTnzFGNf4WQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796002398; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Gm-Message-State:X-Received:Date:Mime-Version:X-Mailer:Message-ID: Subject:From:To:Cc:Content-Type; bh=B/7pN8BmKjEMBOP/J1xjPO29X6U5w0DefesdPx6msYM=; b=y5mUd0uanUDzFSWcw1mOmRaVZDCG43drKVBa8v/PV07vTL9w5ncN5T/34lNOcRsUjyuY O7pgyuJWfcC6IV+gCiGE0hhYaNPMYsyg2PXBJOTsCasJiDmAvKOu7bYnO57jz+w5ByiZa NPj/7gKdAlhXE5wPBpIBHMUsiybw7UliFGYIUXrL/1kzQ4I9LJdEF76HQF7a1eTkqWGTn O0CnftGZdJ/QJZb56rudQqybf0kVaRD1xbFsdCR4kTIHwSlSoL4opPnAPje+iq+PqRqho ObLKmd5HuvoZt6Tk98SRrlmv2CHTsBnxIyoKDApx5HRMe/lDl2gDkupqZ0RIwdAWm+A== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=google.com; spf=pass smtp.mailfrom=flex--jmoroni.bounces.google.com; dkim=pass header.d=google.com header.i=@google.com header.a=rsa-sha256 header.s=20260707 header.b=ZkWPygv3; arc=none smtp.remote-ip=209.85.160.200 Received: from mail-qt1-f200.google.com (mail-qt1-f200.google.com [209.85.160.200]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 99161606A31C for ; Mon, 30 Nov 2026 01:33:17 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 99161606A31C Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--jmoroni.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.a=rsa-sha256 header.s=20260707 header.b=ZkWPygv3 Received: by mail-qt1-f200.google.com with SMTP id d75a77b69052e-55d7544d113so184152181cf.1 for ; Sun, 29 Nov 2026 17:33:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20260707; t=1796002396; x=1796607196; darn=vger.kernel.org; h=content-type:cc:to:from:subject:message-id:mime-version:date:from :to:cc:subject:date:message-id:reply-to:content-type; bh=B/7pN8BmKjEMBOP/J1xjPO29X6U5w0DefesdPx6msYM=; b=ZkWPygv3vGMxTmNPpODo1ovfINm5H/ZUNUpZN/HBcDTP0to+1Rq6U37snkUafeInAs WZkiXp3L2P5aBOXE1BPkNEGUk3w6mgGMyYkuU9b5I2TXh0/MJBKtyfSFbJkesfdMPJOT Go+lrPj6J9mOuLYbsx+jhHs3qObMLSbWuSDbdFPSzhu9RVuD71q8KYcg1mYj/2SUgRlE sHlwvg0eBxoToTO86u2py2VKxYImd3ntHreIz1pPl7cKlt8QV0wYlW8INX6bIxjvYcUM 6TA8p669zZDXemuscIVyqtP+VA2H6r+NzQB3r3/LUiiipCDaRZTvdiEJ2kcKXo6e/kzL HykA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796002396; x=1796607196; h=content-type:cc:to:from:subject:message-id:mime-version:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=B/7pN8BmKjEMBOP/J1xjPO29X6U5w0DefesdPx6msYM=; b=AN+uZuotH/EucW87bFcvYoRIrtYPv1ag3ed9KnMtgpW4rL2imSdq1Rl4RCW2rSXxZC xt24zZ8Kl/NH9TJX4vAzKs2xXqzNC/OGyQ+QkiarP8MUa7DCP0A0O+/LiQSH4Saxd53Q OuvMYyarJddqAICm3MasRX+7q3g4spy4XrDj1BvmNWM6h0mI5ohpox1HEEFid+OIEV20 k07M02FQjOC9k5PGXDUij2uHvi5qXbiMbFuDFRNSjWQntQxLgRRNc3+gXlEwIstXtWYQ VtgIHxRjPKlu7w36fPwccpt5cMfCSTwIk1cn6zT/9OlWo4VbH3pFapKSiKygXf5Zn5Rh PaPA== X-Gm-Message-State: APuU4Z/c9ax5Pc1HGPCz2kumacJlFZpI/CU8xQgAXDe9OzuueN13zCz8 DuNKnmeznXWRaNU03sEbdGzxGvZ9XzVl0PK30OLKvzWvo/Ix0V5qVje5WoLYFFhXgjzL7tKPeXY 8eKjlPLlk+Q== X-Received: from qtcpx5-n2.prod.google.com ([2002:a05:622a:e305:20b0:54a:11c2:9b05]) (user=jmoroni job=prod-delivery.src-stubby-dispatcher) by 2002:a05:622a:613:b0:54a:e748:9dea with SMTP id d75a77b69052e-55d76ae38eamr584371731cf.69.1796002396252; Sun, 29 Nov 2026 17:33:16 -0800 (PST) Date: Mon, 30 Nov 2026 01:32:59 +0000 X-Mailing-List: linux-rdma@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list Mime-Version: 1.0 X-Mailer: git-send-email 2.56.1.839.g22a8290db9-goog Message-ID: <20261130013307.2848330-1-jmoroni@google.com> Subject: [PATCH rdma-next 0/8] RDMA/irdma: Fix validation of user and iWARP input From: Jacob Moroni To: tatyana.e.nikolova@intel.com, jgg@ziepe.ca, leon@kernel.org Cc: linux-rdma@vger.kernel.org, jdz@google.com, Jacob Moroni Content-Type: text/plain; charset="UTF-8" This series fixes several issues in irdma where input from user space or from the network is not validated properly. Patches 1-5 are reachable from user space through uverbs: - Patches 1 and 2 fix QP and SRQ ID leaks in the create error paths. - Patches 3-5 add missing validation of the queue memory and queue sizes provided by user space. rdma-core does not send any of the requests that are now rejected. Patches 6-8 are in the iWARP connection setup path, where the driver parses raw TCP segments and MPA frames from the peer: - Patches 6 and 7 validate the TCP header length and the TCP options. - Patch 8 fixes the handling of the MPA v2 private data length. Testing: - Patches 1-5 were tested on GEN3 HW. perftest, pyverbs and a subset of rdma-unit-test give the same results with and without them. A test program that issues the malformed requests through the uverbs write interface confirms that they are now rejected and that the IDs are no longer leaked. - Patches 6-8 were tested on an E830 in iWARP mode as described in each patch, with the whole series applied. Jacob Moroni (8): RDMA/irdma: Fix QP ID leak when QP creation fails early RDMA/irdma: Fix SRQ ID leak when the SRQ depth is rejected RDMA/irdma: Reject a PBL backed CQ shadow area RDMA/irdma: Validate legacy user QP sizes RDMA/irdma: Check user queue buffers against the queue size RDMA/irdma: Validate iWARP TCP header lengths RDMA/irdma: Validate iWARP TCP option lengths RDMA/irdma: Fix MPA v2 private data length handling drivers/infiniband/hw/irdma/cm.c | 64 +++++++++++++++++++++-------- drivers/infiniband/hw/irdma/puda.c | 4 ++ drivers/infiniband/hw/irdma/utils.c | 7 ++++ drivers/infiniband/hw/irdma/verbs.c | 53 ++++++++++++++++++++++-- drivers/infiniband/hw/irdma/verbs.h | 4 ++ 5 files changed, 110 insertions(+), 22 deletions(-) base-commit: a8671ee9bde18105775c2307bc71b0933bd24ed4 -- 2.56.1.839.g22a8290db9-goog