[PATCH] atari: stricter partition validation

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

 



The atari partition detect sequence has a simple sequence, if the three
consecutive characters at the offset are alphanumeric, then call it as
an atari partition. This results in many false positive where devices
are shown as ATARI partitions when they are not. There are many users
suffering this and they are finding ways to circumvent it (Search for
"linux atari partition" in your popular search engine). This is more
common with cloud based installations where a device with garbage is
used and is falsely detected as an ATARI partition.

Make the detect condition stricter so Linux does not detect them as
ATARI and continues with the detection sequence. There is already an
existing function OK_id() which checks for legitimate partition strings.
Use the function in the VALID_PARTITION() sequence.

Signed-off-by: Goldwyn Rodrigues <rgoldwyn@xxxxxxxx>

diff --git a/block/partitions/atari.c b/block/partitions/atari.c
index 9655c728262a..5f4d5faab399 100644
--- a/block/partitions/atari.c
+++ b/block/partitions/atari.c
@@ -20,7 +20,7 @@
    least one of the primary entries is ok this way */
 #define	VALID_PARTITION(pi,hdsiz)					     \
     (((pi)->flg & 1) &&							     \
-     isalnum((pi)->id[0]) && isalnum((pi)->id[1]) && isalnum((pi)->id[2]) && \
+     (OK_id((pi)->id) || memcmp((pi)->id, "XGM", 3)) &&			     \
      be32_to_cpu((pi)->st) <= (hdsiz) &&				     \
      be32_to_cpu((pi)->st) + be32_to_cpu((pi)->siz) <= (hdsiz))
 

-- 
Goldwyn



[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux