1082 Commits

Author SHA1 Message Date
longpanda
ff7ee9c10e 1.1.00 release v1.1.00 2025-01-22 19:32:29 +08:00
Liangbin Lian
f43461a16c
loader/linux: Ensure the newc pathname is NULL-terminated (#3082)
Per "man 5 cpio", the namesize in the cpio header includes the trailing
NUL byte of the pathname and the pathname is followed by NUL bytes, but
the current implementation ignores the trailing NUL byte when making
the newc header. Although make_header() tries to pad the pathname string,
the padding won't happen when strlen(name) + sizeof(struct newc_head)
is a multiple of 4, and the non-NULL-terminated pathname may lead to
unexpected results.

Assume that a file is created with 'echo -n aaaa > /boot/test12' and
loaded by grub2:

    linux /boot/vmlinuz
    initrd newc:test12:/boot/test12 /boot/initrd

The initrd command eventually invoked grub_initrd_load() and sent
't''e''s''t''1''2' to make_header() to generate the header:

00000070  30 37 30 37 30 31 33 30  31 43 41 30 44 45 30 30  |070701301CA0DE00|
00000080  30 30 38 31 41 34 30 30  30 30 30 33 45 38 30 30  |0081A4000003E800|
00000090  30 30 30 30 36 34 30 30  30 30 30 30 30 31 36 33  |0000640000000163|
000000a0  37 36 45 34 35 32 30 30  30 30 30 30 30 34 30 30  |76E4520000000400|
000000b0  30 30 30 30 30 38 30 30  30 30 30 30 31 33 30 30  |0000080000001300|
000000c0  30 30 30 30 30 30 30 30  30 30 30 30 30 30 30 30  |0000000000000000|
000000d0  30 30 30 30 30 36 30 30  30 30 30 30 30 30 74 65  |00000600000000te|
                                                                  ^namesize
000000e0  73 74 31 32 61 61 61 61  30 37 30 37 30 31 30 30  |st12aaaa07070100|
                   ^^ end of the pathname

Since strlen("test12") + sizeof(struct newc_head) is 116 = 29 * 4,
make_header() didn't pad the pathname, and the file content followed
"test12" immediately. This violates the cpio format and may trigger such
error during linux boot:

    Initramfs unpacking failed: ZSTD-compressed data is trunc

To avoid the potential problems, this commit counts the trailing NUL byte
in when calling make_header() and adjusts the initrd size accordingly.

Now the header becomes

00000070  30 37 30 37 30 31 33 30  31 43 41 30 44 45 30 30  |070701301CA0DE00|
00000080  30 30 38 31 41 34 30 30  30 30 30 33 45 38 30 30  |0081A4000003E800|
00000090  30 30 30 30 36 34 30 30  30 30 30 30 30 31 36 33  |0000640000000163|
000000a0  37 36 45 34 35 32 30 30  30 30 30 30 30 34 30 30  |76E4520000000400|
000000b0  30 30 30 30 30 38 30 30  30 30 30 30 31 33 30 30  |0000080000001300|
000000c0  30 30 30 30 30 30 30 30  30 30 30 30 30 30 30 30  |0000000000000000|
000000d0  30 30 30 30 30 37 30 30  30 30 30 30 30 30 74 65  |00000700000000te|
                                                                  ^namesize
000000e0  73 74 31 32 00 00 00 00  61 61 61 61 30 37 30 37  |st12....aaaa0707|
                      ^^ end of the pathname

Besides the trailing NUL byte, make_header() pads 3 more NUL bytes, and
the user can safely read the pathname without a further check.

To conform to the cpio format, the headers for "TRAILER!!!" are also
adjusted to include the trailing NUL byte, not ignore it.


Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>

Signed-off-by: Gary Lin <glin@suse.com>
Co-authored-by: Gary Lin <glin@suse.com>
2025-01-22 19:19:29 +08:00
longpanda
377e3fb7bc Fix the boot issue of SystemRescue 11.02+ (#2958) (#3058) 2025-01-22 19:07:08 +08:00
longpanda
f62bd1be14 support eweOS ISO (#3068) 2025-01-22 18:24:09 +08:00
longpanda
b11c38779d docker file 2024-11-16 17:00:25 +08:00
longpanda
f202542c62 docker compose up 2024-11-16 12:38:43 +08:00
longpanda
279491a36a Update to latest Shim (Fix verifying shim SBAT data failed) #2947 2024-11-16 12:34:39 +08:00
longpanda
cb209f9b9e 1.0.99 v1.0.99 2024-06-08 17:26:33 +08:00
Andrei Stepanov
b7b2f6a5c1
Update Russian translation (#2857) 2024-06-08 17:10:31 +08:00
Zohir Tamda
3967fb5fb5
Fix French language (#2850)
Co-authored-by: tamdaz <tamda.zohir.pro@gmail.com>
2024-06-08 17:10:07 +08:00
bovirus
a2ad95792d
Fixed Italian language (#2840) 2024-06-08 17:09:53 +08:00
Re*Index. (ot_inc)
791308d2ce
Japanese Fix typo. (#2839)
* Japanese translation Fixed.

* Fix typo

Fix Typo.
2024-06-08 17:09:26 +08:00
longpanda
0ffb1b15ef Fix the issue that VTOY_LINUX_REMOUNT option does not take effect in latest openSUSE. (#2551) 2024-05-25 18:13:52 +08:00
longpanda
d6e1730ca0 Fix the install issue for /dev/mdX device. (#2846) 2024-05-23 19:30:11 +08:00
longpanda
4d55f505f9 Fix the UEFI boot issue for some computer. 2024-05-22 22:53:55 +08:00
longpanda
30a61ac5c4 1.0.98 release v1.0.98 2024-05-19 23:14:49 +08:00
Re*Index. (ot_inc)
9b79831516
Japanese translation Fixed. (#2808) 2024-05-19 16:43:20 +08:00
jermanuts
af2d6bc247
Update ar_AR.json (#2755)
* Update ar_AR.json

* Update ar_AR.json
2024-05-19 16:41:51 +08:00
bovirus
d8ae740427
Update Italian help/menu (#2752) 2024-05-19 16:41:37 +08:00
Samuel Johnson
b685157ae3
Minor Update on README.md for Consistency (#2687) 2024-05-19 16:41:12 +08:00
Fabian-Gruenbichler
3f6ddb6fb6
support zvol devices (#2678)
their partitions are exposed as "/dev/zdXXpY", handle accordingly.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2024-05-19 16:39:34 +08:00
Zhymabek Roman
b8838b305d
Adding root user check to ExtendPersistentImg (as in CreatePersistentImg) (#2633)
* Adding root user check & Enhance help info

* Update root user check
2024-05-19 16:35:22 +08:00
Batuhan
00de8b932d
Update tr_TR.txt (#2618)
corrected grammar mistakes, fixed typos
2024-05-19 16:29:13 +08:00
WebSnke
1e49dbe957
Update German translation (#2612) 2024-05-19 16:28:35 +08:00
Ida Bagus
580416facc
Update languages.json (#2600)
minor update for indonesian language
2024-05-19 16:28:25 +08:00
gcf
75cf728fa9
The gpt pointer is not initialized, and when offset < 0, it may result in freeing unallocated memory. (#2499)
Signed-off-by: yuxiaojun <yuxiaojun1011@outlook.com>
Co-authored-by: yuxiaojun <yuxiaojun1011@outlook.com>
2024-05-19 16:27:19 +08:00
Ikko Eltociear Ashimine
8723aeb4cc
fix typo in diskio.h (#2497)
fucntion -> function
2024-05-19 16:25:42 +08:00
SunderB
dc9a99bb20
Correct some spelling and grammar in BuildVentoyFromSource.txt (#2491) 2024-05-19 16:24:41 +08:00
Hoang Nguyen
a40456d9d2
Added Vietnamese language support for GRUB and updated Vietnamese translation of the installer (#2362)
* Updated Vietnamese language

Added new translation for `STR_4KN_UNSUPPORTED` and retouched in some places

* Added Vietnamese language support for GRUB menu

* Removed vi_VN from helplist and menulist
2024-05-19 16:17:54 +08:00
Balázs Úr
bdab55e8aa
Updated Hungarian translation (#2836) 2024-05-19 16:11:30 +08:00
longpanda
1b2483ec14 Skip trash directory by default. (#2831) 2024-05-19 16:00:46 +08:00
longpanda
c16e76130b Fix VTOY_LINUX_REMOUNT option for latest CentOS 9 Stream. (#2827) 2024-05-19 15:35:05 +08:00
longpanda
d672af4819 Support ext4 fs with checksum seed feature. 2024-05-19 12:14:02 +08:00
longpanda
712f10e86a Fix VTOY_LINUX_REMOUNT feature in RHEL 9.4+ (#2827) 2024-05-14 14:59:12 +08:00
longpanda
2be340d2e8 update 2024-05-12 14:57:19 +08:00
longpanda
b77ef718b4 bugfix 2024-05-12 12:37:12 +08:00
longpanda
72f5710b88 Fix arch iso boot issue (#2825 #2824) 2024-05-12 12:36:58 +08:00
longpanda
ee7da60d88 Fix the boot issue for latest KAOS. 2024-04-06 23:53:07 +08:00
longpanda
44fb9f4564 Fix the VTOY_LINUX_REMOUNT option on latest linux kernel 2024-04-06 21:22:17 +08:00
longpanda
3f65f0ef03 1.0.97 release v1.0.97 2024-01-24 15:02:32 +08:00
longpanda
4faa5e4344 update tool 2024-01-24 13:35:27 +08:00
longpanda
c7693d4ecd Fix VTOY_LINUX_REMOUNT option does not work with latest linux kernel version. (#2661 #2674) 2024-01-24 12:09:29 +08:00
longpanda
4527e1db79 Add support for FreeBSD 14.0 2024-01-23 09:08:23 +08:00
longpanda
757cacf274 Fix Proxmox 8.1 boot issue. (#2657) 2023-12-04 23:00:31 +08:00
longpanda
39703cabb7 Fix the VentoyPlugson issue that default_file value is wrong for more than 10 theme files. (#2608) 2023-10-14 22:15:24 +08:00
longpanda
854d17a4e9 1.0.96 release v1.0.96 2023-10-06 22:39:39 +08:00
Maicol Battistini
a326b13fc3
Added italian translation (#2580) 2023-10-06 22:33:17 +08:00
longpanda
3ff1867a2a Fix the warning prompt for Ventoy2Disk.sh (#2593) 2023-10-06 22:05:39 +08:00
longpanda
7f63a1c327 Fix the issue that VTOY_LINUX_REMOUNT=1 does not work on some distros (e.g. Pop OS/openSUSE/Ubuntu 23.04) (#2475 #2551) 2023-10-06 21:12:34 +08:00
longpanda
d617985093 Add escaping for path in VentoyPlugson.sh (#2585) 2023-10-06 16:43:26 +08:00