From nobody Tue Jun 16 12:42:25 2026 Received: from mail-qk1-f179.google.com (mail-qk1-f179.google.com [209.85.222.179]) (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 BB9592E7F17 for ; Sun, 19 Apr 2026 21:22:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.179 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776633738; cv=none; b=pEpSNcu2OdtE5dVGVAPft0Q5VIPddQf6IzvWZLC2KgkzEd/4ZEotk8IKdeAy6+xUWBsc+F6gsK9KCIz6iFfIy4GK0xAadRwUNIyVk8QDAH6WOUfVaPszfsYRlramhz727YCwo6biFSb+m7WenRjflB8yUSFIBJfD0kqjU/2YcAk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776633738; c=relaxed/simple; bh=8bXWAUwuXeHpNnD3ARKgWX+5UoBQj6FtEd1TUTI+88U=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=nhy+29XBWE5hyKFrloiuncZcs8fNkC6lG3vBBjvazY91xMgZsTMGcJW4nSZziELxqiFVg45wBY72XJXUabfUDSoeL2uu7haPgCJysGDg6ibW6krONz7iPhe0zr63gOguPJtPwL5Ozpny8Xlo4F5YjsQ3CIV4SHOgJl7DoPR2/Ak= 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=kvKoPMlO; arc=none smtp.client-ip=209.85.222.179 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="kvKoPMlO" Received: by mail-qk1-f179.google.com with SMTP id af79cd13be357-8d4f78fc9f6so273210785a.3 for ; Sun, 19 Apr 2026 14:22:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1776633736; x=1777238536; 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=lgjr9000CxEsC1rRZgD66eWlAXXvm6i1E9C0yOGBCjc=; b=kvKoPMlOq0FxaF4Qz+PxUC41kJKOfrGEYO+vtH9oVeyo3fRqfJbEVjmnwGYZQ92WyW GHF8XHkC3LOGCx0vdeuYwWj9WTkIDnEg4SEPeWX1JCtXtICEAxJ9Qslnvmz949PdmrVl lVu179JZyZtWLnM/RMQFZbHMSaMJBhxmXnK01+KSxLaeEA9nogOwc6EsDcmSCbzyxvH8 SwlajIGxieouBbmC3Oocj/n/u+3zcdIwHUBDLjC1RMy/GzK8dFXrGYOx6+Mwl28nsJ51 UZ4AdNsbWaUoMfnpiDJzI9CJHMmrztXHYwDq5oT9LnEQILBkiMEZTyEeU8AgL9It9bWJ Q5YQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1776633736; x=1777238536; 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=lgjr9000CxEsC1rRZgD66eWlAXXvm6i1E9C0yOGBCjc=; b=fPkOFk1eAoigpGN4xniePVLtnRvlp1612zMzrEUq070PyWmSvw6BwweIfQdkL1nwJj e8rS5gCIi/f9OcW3Tz0b6um1/ynrVDmrtxs2kXFha/xUIczpK3NazezX24iUtPV5vLGP heCXxt3Y1lSY80+F90ZtECFiv2oU+Ad1aoyjThzoJXcZjzpM4c+TN4O202xRFjOJxLXV Guis3hEQXUnvCgaYPxmoNs+RDusOjI3xlxac/+ZUZGOS/pH0kUQj7VJVAie34kPEkMeZ xmXG50zFP9z26JDPW2qkcYC/8SeLwVuRTEulRoxUTr5oOc6ZwLEamLZwbhL9sX2JoCbT PvcA== X-Forwarded-Encrypted: i=1; AFNElJ/3DzuYj9Knpfn/9lNRdg8wW/ppJ8Wxyrdiqt7qGBV6yPhuQcFRRqb3gpvLYc/9GucqNNy8cmuIUu2vjGM=@vger.kernel.org X-Gm-Message-State: AOJu0Yw3DRkGB31RR1BpONh2l3cPUkeeUeP3rfKhW0y0QB96XLh2hbhW uG68H8362EZnUjrrAsuORXpIn8Aivt6NLpvfQ2RyJPBTNLzSWGSXajz+ X-Gm-Gg: AeBDies9IqGQFDE3quNJCSSdpYz3/2067fUqQDdO5yZyAPEu0uOFSS767gceshhY8Bm lFxXiv5rSkmJ6eHj6eJrxiAVqK6VIWzQav+AmObQQSJi1or0WzWEw8vxHdTq+Z+yDY30LCyw5y1 C26lHifq01b7nTjWRHhvqbmjLodiZyR31yGXBi369QeE0u2BHrqzwxcUG1XKlll1qbufUExNCuA Xy7FvgkR/kZslshd7muweQlSxYb5bmy6r1qnkxLJZAnJ3HPdzNbfHljQ+756YcJGCZqOgu6BN8g 6MAmVEn98hop4saWEYQcbYspoyw8Y8en9U1DTpVNBPj1XWUJAhzyLV0gfVI62RaTYf9+VTEwhqa cIQZ0RnmGInV3tqDYTCW+4Mz3gQixXtea34SRmpz4R4TjxkAIdzVOAipiOz8lF+q6LaKlJT9D4s u/03ovPO309cy4GnXAET1jZie1StImkcjj1q+bVrCNbc6I72v6HjG+r1HcNRyz1cPWPV2UTEFr6 sRAV82RM9RqFoiz2DORoqO9pEhoGmKDYltTHFHxHQ== X-Received: by 2002:a05:620a:4489:b0:8dc:5094:ea79 with SMTP id af79cd13be357-8e79189e3c1mr1524677385a.39.1776633735681; Sun, 19 Apr 2026 14:22:15 -0700 (PDT) Received: from server0 (c-68-48-65-54.hsd1.mi.comcast.net. [68.48.65.54]) by smtp.gmail.com with ESMTPSA id af79cd13be357-8e7d65c1321sm654849185a.15.2026.04.19.14.22.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 19 Apr 2026 14:22:14 -0700 (PDT) From: Michael Bommarito To: Jan Kara Cc: Edward Adam Davis , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: [PATCH 1/2] isofs: validate Rock Ridge CE continuation extent against volume size Date: Sun, 19 Apr 2026 17:21:54 -0400 Message-ID: <20260419212155.2169382-2-michael.bommarito@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260419212155.2169382-1-michael.bommarito@gmail.com> References: <20260419212155.2169382-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" rock_continue() reads rs->cont_extent verbatim from the Rock Ridge CE record and passes it to sb_bread() without checking that the block number is within the mounted ISO 9660 volume. commit e595447e177b ("[PATCH] rock.c: handle corrupted directories") added cont_offset and cont_size rejection for the CE continuation but did not validate the extent block number itself. commit f54e18f1b831 ("isofs: Fix infinite looping over CE entries") later capped the CE chain length at RR_MAX_CE_ENTRIES =3D 32 but again left the block number unchecked. With a crafted ISO mounted via udisks2 (desktop optical auto-mount) or via CAP_SYS_ADMIN mount, rs->cont_extent can therefore point at an out-of-range block or at blocks belonging to an adjacent filesystem on the same block device. sb_bread() on an out-of-range block returns NULL cleanly via the block layer EIO path, so there is no memory-safety violation. For in-range reads of adjacent- filesystem data, the CE buffer is parsed as Rock Ridge records and only the text of SL sub-records reaches userspace through readlink(), which makes the info-leak channel narrow and difficult to exploit; still, rejecting the malformed CE outright matches the rejection shape already present in the same function for cont_offset and cont_size. Add an ISOFS_SB(sb)->s_nzones bounds check to rock_continue() next to the existing offset/size rejection, printing the same corrupted-directory-entry notice. Fixes: f54e18f1b831 ("isofs: Fix infinite looping over CE entries") Cc: stable@vger.kernel.org Assisted-by: Claude:claude-opus-4-7 Signed-off-by: Michael Bommarito --- fs/isofs/rock.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/fs/isofs/rock.c b/fs/isofs/rock.c index 6fe6dbd0c740..1232fab59a4e 100644 --- a/fs/isofs/rock.c +++ b/fs/isofs/rock.c @@ -101,6 +101,15 @@ static int rock_continue(struct rock_state *rs) goto out; } =20 + if ((unsigned)rs->cont_extent >=3D ISOFS_SB(rs->inode->i_sb)->s_nzones) { + printk(KERN_NOTICE "rock: corrupted directory entry. " + "extent=3D%u out of volume (nzones=3D%lu)\n", + (unsigned)rs->cont_extent, + ISOFS_SB(rs->inode->i_sb)->s_nzones); + ret =3D -EIO; + goto out; + } + if (rs->cont_extent) { struct buffer_head *bh; =20 --=20 2.53.0 From nobody Tue Jun 16 12:42:25 2026 Received: from mail-qk1-f169.google.com (mail-qk1-f169.google.com [209.85.222.169]) (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 DA77A30DD2F for ; Sun, 19 Apr 2026 21:22:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.169 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776633739; cv=none; b=LFz5Ita02K3OvjZ9Fp5dhAhy9G8oLLHiO2UaYZdmo3xIfHy3431NDskXFf6waXKh2BPyV2tzcuxEKBMEMsngotiSvnOE1sqOoXbFsQoYmps1Q73RkeFbdbqFBfjdHZlzYMdbTYjo5mqCoSWMnOowB6nLsLiG29CDLPMekYihAnM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776633739; c=relaxed/simple; bh=iyYciPGfOWS+PP4eS+FUuE/6DmHsutqvGRb809Gt3a4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=T/O2y3voWoBqbN6YIDOTo2yS0gu2ybNNzOLidRJa4Ybx5fKoSYGUPDzM9P8szxwXTwDWBRnZII2gX949TL42zcKby6NgwfPGBwjQTFIFTBURVMiq4wb7dhSo1IRhbyecKyGfZ2TCs+0jr7RDlnXUCwYDVfjgR2I9SX36NyHMx3A= 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=HzHHOgUh; arc=none smtp.client-ip=209.85.222.169 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="HzHHOgUh" Received: by mail-qk1-f169.google.com with SMTP id af79cd13be357-8d560ede296so268051885a.0 for ; Sun, 19 Apr 2026 14:22:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1776633737; x=1777238537; 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=xR/LK1vY5jMYZYpJbaDoVbD4RzkYk8NMN3z+ldfPAwI=; b=HzHHOgUhWj+nC27pznyTLokTvYsk54RJ+D0dyQE3u549ihFLTnAUp/1JALCrY80q9s eL8Bj4UrOuRWz2ZOYWDTeezP4z8JUMEvOeZdi0s1yEXs78QqtnumGZT9+oSzuUWbqjZE ElDUot6NCb6lPGwG9+0vcaJhxQsZyD5nJoMQsc7TzbpF8c3aaFOms0jhVUuxZhRrMERT 4n6mQZIJHLVOSeyX0opgINAFGacKdg+qHG7nsDOWY6LE3rVj6w/RDEumflNRj/sRXd1m RCBURDP+iQVP4hsJLIGdKg8kOuDXwCavgD+b2Qk/SwD7Cy1mnMknjV9rr+sNc1Lbzoyq xsNQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1776633737; x=1777238537; 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=xR/LK1vY5jMYZYpJbaDoVbD4RzkYk8NMN3z+ldfPAwI=; b=DkL0up7nqCZixgcRw36nimB/o8tw25Wc7nMNYXzJ5snB1oceZtP3hX+9jBOIXLHffj e5MfmIgKg6UynoqwDk1ah6pThw0XPDjwkYWybMbwzuZLW7zT2HyNhvycmQ5fQg8q31EN g294B2brc0uIppzamvbZKKl7o3g29QKvTPiMFvKSW8SETxOLlUPmczTfd/dMH43eBocG lnuMyRbIOZMBiB6mysiZc7h1vg42HAFqnQUoSguhU7plWAvdNrEsB7jdXnnuRCXbCEdl 6dYDyY+WoY3U86swUWHYVd5U43KGOc6+TVtMJ9U+pOCZpFjStIn1hsIB4Uwc3JyYt1fA DrnQ== X-Forwarded-Encrypted: i=1; AFNElJ/PEj5JhLml9LnvQMby/aiyGPRyrX3svDwVgMaxGAdHH1NAREtDEDNaDHTrKNpQAFBem4X2gzpm0mnIZZk=@vger.kernel.org X-Gm-Message-State: AOJu0YwfghHIJCARJTy6hEcHhRK8FLxRqJZfe9r2Xr56DnGc0qaVceP6 G3ureEvghuczvCI0d4tGrkqXqOFyRSfVT9QgHJIpu2UzFeqKEjujmkLdredr/nIv X-Gm-Gg: AeBDievEDH+IeSgl9Hr2SrK1KPRG7dJ6IzOQyWmKY+A1xZ55iYOKDq8vjYaPnTEJRTa OTS7GVa27GB+NFR/txG/eY1736FjRm0b7D993ZX+ovVNifF+w0R2QJwU+Y/Cmkf61gb29vOyKAn gJcILISt/oSiUj7olnk9I53K7QG5HwwA4G3YVGhxca0gLEdb0+JPhW56L0l/3dNwBs6SiN65mkd cKO+thIQis9Xyz0JTkJriopKl+onalu+J1YistMsmJ+rCgwJVhN3/YHzr9VAy1+/t0ObH57uQtd TOAZ7cou/TixaeP3DcwJmUGlaZVjtsnRXkv97CFnAneD2xEJebyfnHhKTAcwi+zAiq3Q2z3t+uY j1EQ74HLkm2QkUZbFW1Rnz3/NYOiBVfFBRX3oGcDVYYShFfsW1en2wwLlfns2/wEqcPuNb0ESqF tkLxdEg9rgB2+1ZNBQSAPe2EPQhoEjd6YlSH+Lw82Y5BmwyZrRchP0UgsvyGVjWI+shZrFeHpNr dktSR4GOQjEaky/9dL93gg/sztkjns= X-Received: by 2002:a05:620a:44c3:b0:8d6:39c0:e6b2 with SMTP id af79cd13be357-8e793047868mr1577053385a.62.1776633736831; Sun, 19 Apr 2026 14:22:16 -0700 (PDT) Received: from server0 (c-68-48-65-54.hsd1.mi.comcast.net. [68.48.65.54]) by smtp.gmail.com with ESMTPSA id af79cd13be357-8e7d65c1321sm654849185a.15.2026.04.19.14.22.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 19 Apr 2026 14:22:16 -0700 (PDT) From: Michael Bommarito To: Jan Kara Cc: Edward Adam Davis , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: [PATCH 2/2] isofs: validate block number from NFS file handle in isofs_export_iget Date: Sun, 19 Apr 2026 17:21:55 -0400 Message-ID: <20260419212155.2169382-3-michael.bommarito@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260419212155.2169382-1-michael.bommarito@gmail.com> References: <20260419212155.2169382-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" isofs_fh_to_dentry() and isofs_fh_to_parent() pass an attacker- controlled block number (ifid->block or ifid->parent_block) from the NFS file handle to isofs_export_iget(), which only rejects block =3D=3D 0 before calling isofs_iget() and ultimately sb_bread(). A crafted file handle with fh_len sufficient to pass the check added by commit 0405d4b63d08 ("isofs: Prevent the use of too small fid") can still drive the server to read any in-range block on the backing device as if it were an iso_directory_record. That earlier fix was assigned CVE-2025-37780. sb_bread() on an out-of-range block returns NULL cleanly via the EIO path, so there is no memory-safety violation. For in-range reads of adjacent-partition data on the same block device, the unrelated bytes end up in iso_inode_info fields that reach the NFS client as dentry metadata. The deployment surface (isofs exported over NFS from loop-mounted images) is narrow and requires an authenticated NFS peer, but the malformed-file-handle class is reportable as hardening next to the existing CVE-2025-37780 fix. Reject block >=3D ISOFS_SB(sb)->s_nzones in isofs_export_iget() so the check covers both isofs_fh_to_dentry() and isofs_fh_to_parent() call sites with a single line. Fixes: 0405d4b63d08 ("isofs: Prevent the use of too small fid") Cc: stable@vger.kernel.org Assisted-by: Claude:claude-opus-4-7 Signed-off-by: Michael Bommarito --- fs/isofs/export.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/isofs/export.c b/fs/isofs/export.c index 421d247fae52..78f80c1a5c54 100644 --- a/fs/isofs/export.c +++ b/fs/isofs/export.c @@ -24,7 +24,7 @@ isofs_export_iget(struct super_block *sb, { struct inode *inode; =20 - if (block =3D=3D 0) + if (block =3D=3D 0 || block >=3D ISOFS_SB(sb)->s_nzones) return ERR_PTR(-ESTALE); inode =3D isofs_iget(sb, block, offset); if (IS_ERR(inode)) --=20 2.53.0