From: "Thomas Schmitt" <scdbackup@gmx.net>
To: grub-devel@gnu.org
Cc: lidong.chen@oracle.com, fengtao40@huawei.com, yanan@huawei.com,
daniel.kiper@oracle.com, lichenca2005@gmail.com
Subject: Re: [PATCH v2 0/5] fs/iso9660: Fix out-of-bounds read
Date: Wed, 18 Jan 2023 17:31:18 +0100 [thread overview]
Message-ID: <129543930331941016732@scdbackup.webframe.org> (raw)
In-Reply-To: <cover.1673991546.git.lidong.chen@oracle.com>
Hi,
On Wed, 18 Jan 2023 08:23:53 +0000 Lidong Chen <lidong.chen@oracle.com> wrote:
> Thomas also pointed out the issue of the potential endless
> loops by CE. Since the sugguested fix requires a bit more
> investigation, and as Thomas pointed out that it should be
> handled in a separate patch, the fix is not included in this
> this v2 patches set. Because I am not an expert, it would
> be better that someone else can work on it. For the background
> info and the comments, please see this email. The bottom half
> of the email addressed the endless loop issue:
>
> https://www.mail-archive.com/grub-devel@gnu.org/msg35785.html
I had a look at Linux fs/isofs/rock.c about the handling of CE loops.
It works with a hop counter like my current untested proposal for GRUB,
which i made in above mail.
But Linux is very restrictive:
/* Maximum number of Rock Ridge continuation entries */
#define RR_MAX_CE_ENTRIES 32
...
ret = -EIO;
if (++rs->cont_loops >= RR_MAX_CE_ENTRIES)
goto out;
So probably my proposed limit of a million is just oversized. But i think
that 32 would be too low.
The Linux limit is bad news for people who want to put larger data blobs
into SUSP controlled blocks, because the size of a continuation area is
also restricted by Linux to a single block of 2048 bytes.
The EIO in case of too much CE entries does not show up in the system log
or on the terminal. Just the file is not listed and not accessible:
$ wc /mnt/iso/x
wc: /mnt/iso/x: No such file or directory
I understand from source code and experiments that the actual maximum
number of CE hops in Linux is 31 rather than 32.
libisofs and xorriso are in the process of getting an adjustable curb to
prevent the production of ISO filesystems with files which would not show
up in Linux. I decided for 100,000 hops as hard limit but set the default
to 31.
(SUSP prescribes that entries of unknown type be "ignored and skipped",
which Linux normally does fine. Here it could do better.)
Have a nice day :)
Thomas
next prev parent reply other threads:[~2023-01-18 16:32 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-18 8:23 [PATCH v2 0/5] fs/iso9660: Fix out-of-bounds read Lidong Chen
2023-01-18 8:23 ` [PATCH v2 1/5] fs/iso9660: Add check to prevent infinite loop Lidong Chen
2023-01-18 16:07 ` Thomas Schmitt
2023-01-19 1:34 ` Lidong Chen
2023-01-18 8:23 ` [PATCH v2 2/5] fs/iso9660: Prevent read past the end of system use area Lidong Chen
2023-01-18 16:12 ` Thomas Schmitt
2023-01-18 8:23 ` [PATCH v2 3/5] fs/iso9660: Avoid reading past the entry boundary Lidong Chen
2023-01-18 16:14 ` Thomas Schmitt
2023-01-18 8:23 ` [PATCH v2 4/5] fs/iso9660: Incorrect check for " Lidong Chen
2023-01-18 16:17 ` Thomas Schmitt
2023-01-18 8:23 ` [PATCH v2 5/5] fs/iso9660: Prevent skipping CE or ST at start of continuation area Lidong Chen
2023-01-18 16:21 ` Thomas Schmitt
2023-01-19 1:25 ` Lidong Chen
2023-01-18 16:31 ` Thomas Schmitt [this message]
2023-01-19 1:22 ` [PATCH v2 0/5] fs/iso9660: Fix out-of-bounds read Lidong Chen
2023-01-19 11:58 ` Thomas Schmitt
2023-01-20 2:29 ` Lidong Chen
2023-01-20 11:49 ` Thomas Schmitt
2023-01-20 19:31 ` Lidong Chen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=129543930331941016732@scdbackup.webframe.org \
--to=scdbackup@gmx.net \
--cc=daniel.kiper@oracle.com \
--cc=fengtao40@huawei.com \
--cc=grub-devel@gnu.org \
--cc=lichenca2005@gmail.com \
--cc=lidong.chen@oracle.com \
--cc=yanan@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.