From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qt1-f182.google.com (mail-qt1-f182.google.com [209.85.160.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 36548292B2E for ; Fri, 10 Jul 2026 02:29:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.182 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783650579; cv=none; b=daWa8/gIwcjxeAChCrhZzWfPt+HyelUX/zNg6dzfwRlUb85lNHsxlb7nubimBIKu7+f5ZMvpwvL1Z4pgUiF3sN8PNyZM+qLe0yR+EhdY5oKn4Is/1tcTtbEB4jqH7AIUWvZAcl/ok+jvCGrqjsqz42meLnLUEz76HjQ8Aua0cN8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783650579; c=relaxed/simple; bh=d0G78OZFJtynCYU0Yb+pYf0nAFBSfE7NY4RUeGFmbTI=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=leQzjVFeyK8Ic3aC37K3f1lohV8RrcC8K0n6anha7bqgdIvDMlXnrEOoJjU6JVh91zc3LX7Iz5Ih5/cHbq46sQapXedAhqTzNAqPk+wzqohW5IHyIg1K7Qs5Yspv+iuSrXmXFckP/T5O84ezSk4U+OAkt75GEa5+6cBu1VTWfu4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=k4U+iSm1; arc=none smtp.client-ip=209.85.160.182 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="k4U+iSm1" Received: by mail-qt1-f182.google.com with SMTP id d75a77b69052e-51c0c68aa31so2612681cf.3 for ; Thu, 09 Jul 2026 19:29:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1783650577; x=1784255377; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to:content-type; bh=T/Wt9nwIkWLRPZshqrH2chvmAQIMoCZXZuZQFMmUS0Y=; b=k4U+iSm1ioHpmAPYyfuFjeJPigZro3lwotaD/N0kwCOTzmoMmB2wN31izvyprSyMyw v+clGE+WfTunM4If4rcqAGc1CLf9N/J0BpYNVjtb9vagRvJCrBlgQGPUZHpOUVewYpu6 5gEiE0e1f2NyZWriLDf9gmy9Fp9W8E1Vg3fOBhKJTmD5A50g7ogyojVR0/CwHNOG+uvr sUU/upIyAhqGYbI0svwm0yFGnRw5HjL8CjWwReLzv8ZmAxRzLU+HLOBN1JhhsglVYeUk ZuvHZgHr61hxkd+sR66A98WveG8VtbOt9Z6gRkjEbcBf8fsqXH8vinm4zMHYdUUuSC7M EnSg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783650577; x=1784255377; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=T/Wt9nwIkWLRPZshqrH2chvmAQIMoCZXZuZQFMmUS0Y=; b=OCP+FyaMHHYrHxge0TPKRoBTE+tdIXW0dm5mKLD1HmlUIIf3gIWeDf4chdic2U+PSc FMcuvt+/ZhNHHg8GGWJNxa26QNZ8z6xehSerAiekZnkOxz6IEGvrZ8sBcOH2jHoxZB4A MZJQ9DAqqeQQwtIB4CZGnZX+FzgaT572pf1wffDjp/HeH4X3mPaQ6WBGmzRDS0wRlyfB 8NdVhfF++S7MhWqkdaaX6ksL18/L5Zby5AxhnNM4pEEk0qdi7h5Gu8b0k4q4T7w6iN57 M4bSj2eGZaSUSv3Y+9rOJw3iu7kn75QFoz0zbmO4CkNunXL70Qyd40MR3DrC2MFsbYsi 6nHw== X-Forwarded-Encrypted: i=1; AHgh+RoYGzHl2UgsBGElsEzjvuoQA5r2Fvl80kNdF1I7d2tdqYHNGSwYtqT/i85VxSssYzmPkmKBn/JNAmO2duA=@vger.kernel.org X-Gm-Message-State: AOJu0YxFEie/aLAww69E51NJiFFuWe7rGwIa64eStfFbecVXMAfA4COa L81C5t+Am3O18fjeXdBH6OrqCJHmv3o/KKNN8MFUbXOLFPKsfBTO+s2f X-Gm-Gg: AfdE7ckSBnWXdcSzRjsmcWkv3QOw2iZ4FEB74kNKAG+kjm+JSzcl9oyR1UFss9ORVcO w33evJOKbDwBwu8mqiMxXY3wDWZFzPbrW0Hcge+xjz8cOQy0rFC2fJk2ksNWPkGWfAbXIQbUAUJ cXH1RL9fhgr61hBypf2xLOp43F2nkVfMpOslBHpnZ4znkEtgQpvGFgxgQWQbulhe/RufIugLA+T cEsm/zi4xcfAt6cTQ6Ammq9ruo3ZM35EMTInQ7E/OBJDt8gNaaNawhPWoidYMHe0mDv8UaAccTs +FwhxfLvL1lMFKS1BtpxkKI230By6uz3X9cFVGN0TXIJZaiIYugcUFF62DLn4hpMETK+7gerHrP NrdFWAKKWLvYj7jZmO+eZ5AZWxQ9g4epobv+PbWMCPZJaLqZqcUMlcJlO5uT3BAZk7/xNvvtbWr lRbzxtsV3gLnL4J3HHeL9zAAr/7klWLJLot3GRHK+yfzqCJ+UH/OhEUrsiKVq+mqNuarQjOFasA DAP2szljbAJXxeWsFxl1mqGJZauPmBz X-Received: by 2002:a05:622a:4308:b0:51c:a2ca:3fc0 with SMTP id d75a77b69052e-51ca2ca5e00mr32009521cf.23.1783650577094; Thu, 09 Jul 2026 19:29:37 -0700 (PDT) Received: from server0.tail6e7dd.ts.net (c-68-48-65-54.hsd1.mi.comcast.net. [68.48.65.54]) by smtp.gmail.com with ESMTPSA id d75a77b69052e-51caafd8b4fsm6951101cf.31.2026.07.09.19.29.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Jul 2026 19:29:36 -0700 (PDT) From: Michael Bommarito To: "James E.J. Bottomley" , "Martin K. Petersen" , Justin Tee Cc: Paul Ely , James Smart , linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: [PATCH 0/2] scsi: lpfc: bound EDC descriptor TLV walk Date: Thu, 9 Jul 2026 22:29:30 -0400 Message-ID: <20260710022932.3741311-1-michael.bommarito@gmail.com> X-Mailer: git-send-email 2.53.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 7bit An adjacent Fibre Channel fabric peer or device can crash an LPFC host with a malformed EDC ELS frame. lpfc_els_rcv_edc() trusts the EDC descriptor-list length from the received frame without checking that it fits in the actual ELS payload, so a short frame with an oversized descriptor-list length walks the TLV list past the receive buffer and trips a KASAN slab-out-of-bounds read in the ELS receive path. Patch 1 passes the received payload length into lpfc_els_rcv_edc(), rejects truncated EDC headers and descriptor lists larger than the payload, and avoids logging a third payload word unless it is present. Patch 2 adds same-translation-unit KUnit/KASAN coverage: a benign EDC frame that must still parse and the malformed frame that must now be rejected. Reproduced with the KUnit/KASAN test on f5459048c38a: stock trips BUG: KASAN: slab-out-of-bounds in lpfc_els_rcv_edc after the benign control passes; patched rejects the frame and both cases pass. Cc: stable@vger.kernel.org Michael Bommarito (2): scsi: lpfc: bound EDC descriptor list by payload length scsi: lpfc: add KUnit coverage for EDC descriptor bounds drivers/scsi/Kconfig | 7 ++ drivers/scsi/lpfc/lpfc_els.c | 195 ++++++++++++++++++++++++++++++++--- 2 files changed, 189 insertions(+), 13 deletions(-) -- 2.53.0