[U-Boot] [BUG] efi_driver: crash while reading from iSCSI drive

Heinrich Schuchardt xypron.glpk at gmx.de
Thu Oct 24 03:26:27 UTC 2019



On 10/23/19 12:30 PM, AKASHI Takahiro wrote:
> On Tue, Oct 22, 2019 at 10:29:09PM +0200, Heinrich Schuchardt wrote:
>> The patch
>>
>> commit 867400677cda0fac4a411f1549fe3a61bb5ed172
>> efi_loader: disk: install FILE_SYSTEM_PROTOCOL only if available
>>
>> breaks booting my Pine A64 LTS board via iPXE and GRUB. But I assume
>> this is not at the base of the problem.
>>
>> My iSCSI drive is partitioned like this:
>>
>> Device        Boot    Start      End  Sectors  Size Id Type
>> pine-a64-lts1          2048   194559   192512   94M ef EFI   vfat
>> pine-a64-lts2 *      194560  2148351  1953792  954M 83 Linux ext2
>> pine-a64-lts3       2148352 25585663 23437312 11.2G 83 Linux ext4
>> pine-a64-lts4      25585664 67106815 41521152 19.8G 83 Linux ext4
>>
>> Looking at the debug output below the following questions arise:
>>
>> Why is ext2 not recognized as a file system?
>> Why is the system crashing when trying to read 1024 blocks from the ext4
>> partition?
>
> Try the workaround attached below.
> It seems that some fields, particularly log2blksz, in blk_dev held by
> ext_fs(of ext_filesystem in fs/ext4/ext4fs.c) are not initialized.
>
> I think that ext4's initialization code should be reworked.

Thanks for looking into this.

The error is in efi_bl_bind() (lib/efi_driver/efi_block_device.c). I
missed to use the block size of the block IO protocol to initialize
desc->blksz and desc->log2blksz.

Our FAT driver takes the sector size from the boot sector in
get_fs_info() (fs/fat/fat.c) and ignores the block descriptor which will
lead to errors if the logical sector size does not match the physical
sector size.

Best regards

Heinrich


More information about the U-Boot mailing list