Miquel Raynal 2ac0baab4a fs/squashfs: sqfs_read: Prevent arbitrary code execution
Following Jincheng's report, an out-of-band write leading to arbitrary
code execution is possible because on one side the squashfs logic
accepts directory names up to 65535 bytes (u16), while U-Boot fs logic
accepts directory names up to 255 bytes long.

Prevent such an exploit from happening by capping directory name sizes
to 255. Use a define for this purpose so that developers can link the
limitation to its source and eventually kill it some day by dynamically
allocating this array (if ever desired).

Link: https://lore.kernel.org/all/CALO=DHFB+yBoXxVr5KcsK0iFdg+e7ywko4-e+72kjbcS8JBfPw@mail.gmail.com
Reported-by: Jincheng Wang <jc.w4ng@gmail.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Tested-by: Jincheng Wang <jc.w4ng@gmail.com>
2022-06-16 15:22:55 -04:00
..
2022-01-19 18:11:34 +01:00
2022-05-20 12:36:48 +02:00
2022-01-19 18:11:34 +01:00
2022-01-19 18:11:34 +01:00
2022-04-11 10:00:30 -04:00
2022-01-19 18:11:34 +01:00
2022-01-19 18:11:34 +01:00
2022-01-19 18:11:34 +01:00
2022-01-19 18:11:34 +01:00
2022-01-19 18:11:34 +01:00
2022-01-30 01:25:00 +00:00
2022-01-30 01:25:00 +00:00
2022-01-30 01:25:00 +00:00
2022-01-30 01:25:00 +00:00
2022-01-30 01:25:00 +00:00
2022-01-30 01:25:00 +00:00
2022-01-19 18:11:34 +01:00
2022-01-19 18:11:34 +01:00
2022-01-19 18:11:34 +01:00
2022-01-19 18:11:34 +01:00
2022-04-25 10:00:04 -04:00
2022-04-25 10:00:04 -04:00
2022-01-19 18:11:34 +01:00
2022-01-19 18:11:34 +01:00
2022-01-19 18:11:34 +01:00
2022-01-19 18:11:34 +01:00
2022-04-06 14:01:42 -04:00
2022-05-28 10:59:27 +02:00
2022-01-19 18:11:34 +01:00
2022-03-30 13:02:55 -04:00
2022-03-30 13:02:55 -04:00
2022-01-19 18:11:34 +01:00
2022-01-19 18:11:34 +01:00
2022-01-19 18:11:34 +01:00
2022-01-19 18:11:34 +01:00
2022-01-19 18:11:34 +01:00
2022-01-19 18:11:34 +01:00
2022-01-19 18:11:34 +01:00
2022-01-19 18:11:34 +01:00
2022-01-19 18:11:34 +01:00
2022-01-19 18:11:34 +01:00
2022-02-03 12:16:01 -05:00
2022-01-15 10:57:22 +01:00
2022-01-19 18:11:34 +01:00
2022-03-15 16:19:29 -04:00
2022-04-06 14:01:42 -04:00
2022-03-10 08:28:36 -05:00
2022-01-19 18:11:34 +01:00
2021-07-07 19:52:22 -04:00
2021-04-10 08:04:42 -04:00
2022-01-19 18:11:34 +01:00
2022-01-19 18:11:34 +01:00
2022-01-19 18:11:34 +01:00
2022-01-19 18:11:34 +01:00
2022-01-19 18:11:34 +01:00
2022-01-19 18:11:34 +01:00
2022-01-19 18:11:34 +01:00
2022-01-19 18:11:34 +01:00
2022-01-19 18:11:34 +01:00
2021-08-30 14:13:28 -04:00
2022-02-09 09:16:47 -05:00
2022-01-19 18:11:34 +01:00
2021-10-31 08:46:44 -04:00
2022-01-19 18:11:34 +01:00
2022-01-19 18:11:34 +01:00
2022-01-19 18:11:34 +01:00
2022-01-19 18:11:34 +01:00
2022-04-28 09:26:44 -04:00
2021-11-20 10:53:00 +01:00
2022-03-10 08:28:36 -05:00
2022-01-19 18:11:34 +01:00
2022-01-19 18:11:34 +01:00
2022-01-19 18:11:34 +01:00
2022-01-24 10:35:10 -05:00
2022-06-15 15:39:56 +09:00
2021-12-27 08:41:38 -05:00
2021-09-28 12:03:20 -04:00
2022-01-19 18:11:34 +01:00
2022-01-19 18:11:34 +01:00
2022-01-19 18:11:34 +01:00
2022-01-19 18:11:34 +01:00
2022-01-19 18:11:34 +01:00
2022-01-19 18:11:34 +01:00
2022-01-19 18:11:34 +01:00
2022-01-19 18:11:34 +01:00
2021-07-07 19:52:24 -04:00
2022-01-19 18:11:34 +01:00
2021-04-12 17:44:55 -04:00
2022-01-19 18:11:34 +01:00
2022-01-19 18:11:34 +01:00
2022-01-19 18:11:34 +01:00
2022-02-09 09:16:48 -05:00
2022-01-19 18:11:34 +01:00
2022-04-01 15:03:13 -04:00
2022-04-01 16:56:54 -04:00
2022-01-19 18:11:34 +01:00
2022-01-19 18:11:34 +01:00
2022-01-19 18:11:34 +01:00
2022-01-19 18:11:34 +01:00
2022-01-19 18:11:34 +01:00
2022-05-02 09:58:13 -04:00
2022-04-06 14:03:17 -04:00
2022-01-26 23:23:17 +01:00
2022-01-19 18:11:34 +01:00
2022-01-19 18:11:34 +01:00
2022-01-19 18:11:34 +01:00
2022-01-19 18:11:34 +01:00
2022-01-19 18:11:34 +01:00
2022-01-19 18:11:34 +01:00
2022-01-19 18:11:34 +01:00
2022-01-19 18:11:34 +01:00
2022-01-19 18:11:34 +01:00
2022-01-19 18:11:34 +01:00
2022-01-19 18:11:34 +01:00
2022-01-19 18:11:34 +01:00
2022-01-19 18:11:34 +01:00
2022-03-28 20:17:20 +02:00
2022-01-19 18:11:34 +01:00
2022-01-19 18:11:34 +01:00
2022-01-19 18:11:34 +01:00