From nobody Mon May 25 05:12:29 2026 Received: from mail-qt1-f173.google.com (mail-qt1-f173.google.com [209.85.160.173]) (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 7954848165A for ; Mon, 18 May 2026 14:12:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.173 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779113526; cv=none; b=FJk2iRgxT7zz0LjGxfXrLyen5vrSkZWU4XUXVFsKTtvC2sw+gmrBPdGJL6Peqrzjk0jqUu5Ndhfi0dvPJKoFeWvkDFISajEZoAlwW3C1oTeX57loZyhz57hdusws9OMgTPhoFNRF9J+KjW9OQyVHVBC0Z9RW611YnwKlkuLjidc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779113526; c=relaxed/simple; bh=l9ZNwR9fd21ubMirXhvgBcTPShRXtd/vfNweHUFlK9E=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=IzqY0N0GY/AIZ0oA4wMj/2lbSP5lBmtNcnCXzhQdl/rH+lrdhzcam98D4mwn5YHKwxS1tTu41ZLbmvx78mQgQuFp4Be13d54bS96ZEZU0C3PRL8oqAPPWb2+eU8YBnWJg332VfgS+usP0wFLsMrG3JSqsBStm8wiAHQClketPbY= 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=oNCfON7Q; arc=none smtp.client-ip=209.85.160.173 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="oNCfON7Q" Received: by mail-qt1-f173.google.com with SMTP id d75a77b69052e-50e614fdb42so20132461cf.3 for ; Mon, 18 May 2026 07:12:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1779113524; x=1779718324; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=2bFAXmewb45iCgStxAKNd1eKekO8h8rumHyO3Nn0r1s=; b=oNCfON7Q3/Y2/bTcqVWfLTfe40JlqMR1zIk8oc6VCuuKbfEOvUwRFmDGRHCvhxcFbJ moM9ZEpxMIrkVljdLnK0jrpKPH1pydf85ioS4gdMpyeGtC7DWFwloU3l66EhQpRunH+x pZm6pRqj7VGF8jIIYHuHqcvp1+EEWy1nFS2Q0JWbeQcXrdDAbKK5WXv0/xwrQfOnGpIb cROIrQ+2s0gQnF90qO107dNWWZUM7l+axpZJAQj+nYJdPcOQ53yxiED6MIkJEQvVVXd4 LzQt1nvttVfi5IYShw4bIbiouXktf98ujRlsEdFsMVyT3Misnw1qoh51EYaS0A159DHv yjvQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1779113524; x=1779718324; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=2bFAXmewb45iCgStxAKNd1eKekO8h8rumHyO3Nn0r1s=; b=iyNAG7ebWSOolJYPxutA14xVGgH5j8i14MRBdhCShgcPShTY//g0Ql9uJFC8BDvx/K 1YMm5eC5pUBbg3BEYsuqfkCuPa/llY0wrOMys19XSDeukZAPUnCVImlEdZke4bnf0o8p bHRN6O0V/f3fLDFXFI7F9VCP0xcD8NzGhx/xyqjphXwfrV0Ut4GJbmLl0wxezNLOCrlv 7h7smveGLYuvVQOCB6xxTz7/rGPntFOq8UkIaMZVD99YiRUl5qkrUbjexWqncd/mta0Q kGSKWXSkMGERf1AYrwCpGvtEsChogq4XLkfZoEZcDnJAQRWib0RrFOClF+35wkY3A8BP xdHQ== X-Forwarded-Encrypted: i=1; AFNElJ+dPW0qhEMrYd/YOByKdfkuBcQU/7C61eR/psS3E+CmFtHvV4KLwiCqDj3shVpT5oR3v+ZOrqLtuA5iJRI=@vger.kernel.org X-Gm-Message-State: AOJu0YyOfRoGl0vDHceQPAHOABb3q7KucbxW0hkF3RPZUBNG+PtcmcF6 NCFgGf4wPtom8nphfTEJtGOJ6RXT8QEhg7JL17BoJzOn8Xv+ydorcTwx X-Gm-Gg: Acq92OGH/ENR+mmSBSObuftR+vaSfu4XUBofh39xlfiotxUwaKC6wHxjT1dP6OueBJG a0zlV5LUm8cwd1oAvvxQ8ErwrMLkbxXtsQqBcgXY2xwR9+tgc+6I1YClsBfMYVkKF5bNb4jkrzW pPYQvg9DectDB89BwFEfNThcN3AJF+CiU2Q7C1hqWbGj8YpIAfqYpwFAl0Y/AY6Ap5G2dz8x8hw Y5qlgIkD1GQ1P9WG++AM5UojkQybP1XIaluG+f9tZtvt6ii6NPvO3JhOEhjvaykeGctAOp3/aIx CY4o7+93Fu/QgZeh4q8dP9CTuHAd5Qm/YAns5WQqHQbBfwF+66LKHk/q/Mh4vn0v6obEM/kt766 8fslP9z0UQylgLMjgMfzlAkqJ9dtzijFcirnFDzol2iTs/v38qNFa9GAKoZJqR48/piYXJgTDr+ 1swum42/JKUKoChiJMAN28L4QTw02xHRAv8JCuEn7Kj9vDUjJNkFISf94H3Qn4n4pj/ZFyC0IHl LThtPQRqyLEu41QWhgUB1i6HdKyPCbqLKPREeM5CFY= X-Received: by 2002:a05:622a:1181:b0:50f:c36a:3821 with SMTP id d75a77b69052e-5165a1e7b22mr216863421cf.34.1779113524155; Mon, 18 May 2026 07:12:04 -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-51645688c13sm132490731cf.1.2026.05.18.07.12.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 May 2026 07:12:03 -0700 (PDT) From: Michael Bommarito To: Hannes Reinecke , "Martin K . Petersen" , "James E . J . Bottomley" Cc: Robert Love , Vasu Dev , Joe Eykholt , Saurav Kashyap , Javed Hasan , Nilesh Javali , Karan Tilak Kumar , Sesidhar Baddela , Arun Easi , Kees Cook , linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] scsi: fcoe: reject FIP descriptors with zero fip_dlen in CVL walker Date: Mon, 18 May 2026 10:11:50 -0400 Message-ID: <20260518141150.2755252-2-michael.bommarito@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260518141150.2755252-1-michael.bommarito@gmail.com> References: <20260518141150.2755252-1-michael.bommarito@gmail.com> 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" drivers/scsi/fcoe/fcoe_ctlr.c::fcoe_ctlr_recv_clr_vlink() advanced the descriptor cursor by an attacker-supplied fip_dlen without ever requiring dlen >=3D sizeof(struct fip_desc) in the default branch. The named descriptor cases (FIP_DT_MAC, FIP_DT_NAME, FIP_DT_VN_ID) checked their per-type minimum lengths, but a FIP_DT_NON_CRITICAL descriptor (fip_dtype >=3D 128, which the standard requires receivers to silently ignore) skipped that check entirely. An unauthenticated L2 peer on the FCoE control VLAN could hang fcoe_ctlr_recv_work on an fcoe, qedf, or bnx2fc initiator indefinitely by emitting one FIP CVL frame whose single descriptor had fip_dtype =3D=3D FIP_DT_NON_CRITICAL and fip_dlen =3D=3D 0: the cursor advanced zero bytes per iteration and the loop condition rlen >=3D sizeof(*desc) stayed true forever, blocking every subsequent FIP frame on that controller. Tighten the outer dlen guard to also reject dlen < sizeof(struct fip_desc), so a malformed descriptor whose length cannot even cover the descriptor header is rejected before the switch. This is the same lower-bound the named cases already apply and is the minimum scope that closes the loop. Fixes: 97c8389d54b9 ("[SCSI] fcoe, libfcoe: Add support for FIP. FCoE disco= very and keep-alive.") Cc: stable@vger.kernel.org Assisted-by: Claude:claude-opus-4-7 Signed-off-by: Michael Bommarito --- drivers/scsi/fcoe/fcoe_ctlr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/fcoe/fcoe_ctlr.c b/drivers/scsi/fcoe/fcoe_ctlr.c index 02cd4410efca7..496ddd45f74da 100644 --- a/drivers/scsi/fcoe/fcoe_ctlr.c +++ b/drivers/scsi/fcoe/fcoe_ctlr.c @@ -1385,7 +1385,7 @@ static void fcoe_ctlr_recv_clr_vlink(struct fcoe_ctlr= *fip, =20 while (rlen >=3D sizeof(*desc)) { dlen =3D desc->fip_dlen * FIP_BPW; - if (dlen > rlen) + if (dlen < sizeof(*desc) || dlen > rlen) goto err; /* Drop CVL if there are duplicate critical descriptors */ if ((desc->fip_dtype < 32) && --=20 2.53.0