Skip to contentSkip to conversation

Revert "configs/qemu_arm_versatile_defconfig: increase SD card image size to 64MiB"

PATCH New Romain Naour 2 participants 4 messages Nov 8, 2020 – Nov 10, 2020 Arm/versatile express platform

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 Revert "configs/qemu_arm_versatile_defconfig: increase SD card image size to 64MiB"

qemu_arm_versatile doesn't use SD card interface but SCSI, so there is no need to increase the image size.
The change was for qemu_arm_vexpress_defconfig instead (notice the name of the defconfig used in gitlab).

This reverts commit cb62a8e0a2b88b6c1b3ffe74e9eb370bf686fa62.

---
 configs/qemu_arm_versatile_defconfig | 2 --
 1 file changed, 2 deletions(-)
configs/qemu_arm_versatile_defconfig +0 -2
index 280c313407..6dc212397c 100644
@@ -13,8 +13,6 @@ BR2_TARGET_ROOTFS_EXT2=y
 # Image
 BR2_ROOTFS_POST_IMAGE_SCRIPT="board/qemu/post-image.sh"
 BR2_ROOTFS_POST_SCRIPT_ARGS="$(BR2_DEFCONFIG)"
-# Qemu >= 5.1 requires SD card size to be a power of 2, e.g. 64 MiB.
-BR2_TARGET_ROOTFS_EXT2_SIZE="64M"
 
 # Linux headers same as kernel, a 5.4 series
 BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_5_4=y
Signature · 1 line
2.25.4
#1 lore raw

PATCH 2/2 configs/qemu_arm_vexpress_defconfig: increase SD card image size to 64MiB

Since Qemu 5.1, this defconfig doesn't boot due to the to small SD card image size (60MB).

qemu-system-arm: sd_init failed: Invalid SD card size: 60 MiB
SD card size has to be a power of 2, e.g. 64 MiB.
You can resize disk images with 'qemu-img resize <imagefile> <new-size>' (note that this will lose data if you make the image smaller than it currently is).
qemu-system-arm: sd_init failed

From [1]:
"While the possibility to use small SD card images has been seen as a feature, it became a bug with CVE-2020-13253, where the guest is able to do OOB read/write accesses past the image size end."

The qemu_arm_vexpress_tz_defconfig doesn't trigger such issue since it doesn't use the same filesystem support (i.e doesn't use -drive file=output/images/rootfs.ext2,if=sd,format=raw).

Fixes:
https://gitlab.com/kubu93/buildroot/-/jobs/766482935

[1] https://git.qemu.org/?p=qemu.git;a=commitdiff;h=a9bcedd15a5834ca9ae6c3a97933e85ac7edbd36

---
 configs/qemu_arm_vexpress_defconfig | 2 ++
 1 file changed, 2 insertions(+)
configs/qemu_arm_vexpress_defconfig +2 -0
index f99b87c17a..3066bc855b 100644
@@ -16,6 +16,8 @@ BR2_TARGET_ROOTFS_EXT2=y
 # Image
 BR2_ROOTFS_POST_IMAGE_SCRIPT="board/qemu/post-image.sh"
 BR2_ROOTFS_POST_SCRIPT_ARGS="$(BR2_DEFCONFIG)"
+# Qemu >= 5.1 request an SD card size to be a power of 2, e.g. 64 MiB.
+BR2_TARGET_ROOTFS_EXT2_SIZE="64M"
 
 # Linux headers same as kernel, a 5.4 series
 BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_5_4=y
Signature · 1 line
2.25.4
#2 lore raw

PATCH 2/2 configs/qemu_arm_vexpress_defconfig: increase SD card image size to 64MiB

Quoted 18 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Romain" == Romain Naour <[email protected]> writes:

Since Qemu 5.1, this defconfig doesn't boot due to the to small SD card image size (60MB).
qemu-system-arm: sd_init failed: Invalid SD card size: 60 MiB
SD card size has to be a power of 2, e.g. 64 MiB.
You can resize disk images with 'qemu-img resize <imagefile> <new-size>' (note that this will lose data if you make the image smaller than it currently is).
qemu-system-arm: sd_init failed

From [1]:
"While the possibility to use small SD card images has been seen as a feature, it became a bug with CVE-2020-13253, where the guest is able to do OOB read/write accesses past the image size end."

The qemu_arm_vexpress_tz_defconfig doesn't trigger such issue since it doesn't use the same filesystem support (i.e doesn't use -drive file=output/images/rootfs.ext2,if=sd,format=raw).

Quoted 6 lines

Fixes:
https://gitlab.com/kubu93/buildroot/-/jobs/766482935

[1] https://git.qemu.org/?p=qemu.git;a=commitdiff;h=a9bcedd15a5834ca9ae6c3a97933e85ac7edbd36

Committed, thanks.

Signature · 1 line
Bye, Peter Korsgaard
#3 lore raw

PATCH 1/2 Revert "configs/qemu_arm_versatile_defconfig: increase SD card image size to 64MiB"

In reply to Romain Naour
Quoted 10 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Romain" == Romain Naour <[email protected]> writes:

qemu_arm_versatile doesn't use SD card interface but SCSI, so there is no need to increase the image size.
The change was for qemu_arm_vexpress_defconfig instead (notice the name of the defconfig used in gitlab).

This reverts commit cb62a8e0a2b88b6c1b3ffe74e9eb370bf686fa62.

Committed, thanks.

Signature · 1 line
Bye, Peter Korsgaard