grub-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Proposal: fs/iso9660: Prevent skipping CE or ST at start of continuation


From: Thomas Schmitt
Subject: Proposal: fs/iso9660: Prevent skipping CE or ST at start of continuation area
Date: Fri, 16 Dec 2022 10:42:13 +0100

Hi,

i believe that the problem about CE entries sitting at the start of a SUSP
continuation area could be quite easily solved after patch [2/4] was applied,
which changes the for-loop to a while loop with the entry-advance step at its
end.

So i propose to Lidong Chen to handle this problem by another patch in
the series, which comes after [2/4] (then [2/5]).
Please verify that my thoughts about CE (and additionally about ST) are
correct and consider the following diff, which compiles but is not tested
otherwise.

I agree in advance to changing my "Signed-off-by:" to "Suggested-by:" if
deemed appropriate.

------------------------------------------------------------------------

fs/iso9660: Prevent skipping CE or ST at start of continuation area

If processing of a SUSP CE entry leads to a continuation area which begins
by entry CE or ST, then these entries were skipped without interpretation.
In case of CE this would lead to premature end of processing the SUSP entries
of the file.
In case of ST this could cause following non-SUSP bytes to be interpreted
as SUSP entries.

Signed-off-by: Thomas Schmitt <scdbackup@gmx.net>

--- grub-core/fs/iso9660.c.lidong_chen_patch_2  2022-12-15 11:46:50.654295924 
+0100
+++ grub-core/fs/iso9660.c.lidong_chen_patch_2_ce_fix   2022-12-16 
10:05:52.990599283 +0100
@@ -336,6 +336,12 @@ grub_iso9660_susp_iterate (grub_fshelp_n
            }

          entry = (struct grub_iso9660_susp_entry *) sua;
+
+         if (grub_strncmp ((char *) entry->sig, "CE", 2) == 0
+             || grub_strncmp ((char *) entry->sig, "ST", 2) == 0)
+             /* The hook function will not process CE or ST.
+                Advancing to the next entry would skip them. */
+             continue;
        }

       if (hook (entry, hook_arg))

------------------------------------------------------------------------


Have a nice day :)

Thomas




reply via email to

[Prev in Thread] Current Thread [Next in Thread]