[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 09/17] fs: When checking if a block list goes past the end of
From: |
Patrick Steinhardt |
Subject: |
Re: [PATCH 09/17] fs: When checking if a block list goes past the end of the disk, make sure the total size of the disk is in grub native sector sizes, otherwise there will be blocks at the end of the disk unaccessible by block lists. |
Date: |
Thu, 30 Jul 2020 17:26:26 +0200 |
On Wed, Jul 29, 2020 at 04:50:14PM -0500, development@efficientek.com wrote:
> From: Glenn Washburn <development@efficientek.com>
The commit message header is quite long. Could you please shorten it to
at most 80 characters and maybe put remaining info into the message
body?
>
> Signed-off-by: Glenn Washburn <development@efficientek.com>
> ---
> grub-core/kern/fs.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/grub-core/kern/fs.c b/grub-core/kern/fs.c
> index fb30da9f4..14c17df74 100644
> --- a/grub-core/kern/fs.c
> +++ b/grub-core/kern/fs.c
> @@ -139,6 +139,7 @@ grub_fs_blocklist_open (grub_file_t file, const char
> *name)
> unsigned i;
> grub_disk_t disk = file->device->disk;
> struct grub_fs_block *blocks;
> + grub_size_t total_native_sectors;
>
> /* First, count the number of blocks. */
> do
> @@ -156,6 +157,7 @@ grub_fs_blocklist_open (grub_file_t file, const char
> *name)
> return 0;
>
> file->size = 0;
> + total_native_sectors = disk->total_sectors << (disk->log_sector_size -
> GRUB_DISK_SECTOR_BITS);
> p = (char *) name;
> for (i = 0; i < num; i++)
> {
> @@ -181,7 +183,7 @@ grub_fs_blocklist_open (grub_file_t file, const char
> *name)
> goto fail;
> }
>
> - if (disk->total_sectors < blocks[i].offset + blocks[i].length)
> + if (total_native_sectors < blocks[i].offset + blocks[i].length)
> {
> grub_error (GRUB_ERR_BAD_FILENAME, "beyond the total sectors");
> goto fail;
> --
> 2.25.1
>
signature.asc
Description: PGP signature
- Re: [PATCH 05/17] luks: Add support for LUKS2 in (proc)/luks_script, (continued)
- [PATCH 07/17] cryptodisk, luks: Allow special processing for comparing UUIDs., development, 2020/07/29
- [PATCH 08/17] cryptodisk: Unregister cryptomount command when removing module., development, 2020/07/29
- [PATCH 12/17] fs: Allow number of blocks in block list to be optional, where length will be defaulted to the length of the device., development, 2020/07/29
- [PATCH 11/17] cryptodisk: Rename total_length field in grub_cryptodisk_t to total_sectors., development, 2020/07/29
- [PATCH 09/17] fs: When checking if a block list goes past the end of the disk, make sure the total size of the disk is in grub native sector sizes, otherwise there will be blocks at the end of the disk unaccessible by block lists., development, 2020/07/29
- Re: [PATCH 09/17] fs: When checking if a block list goes past the end of the disk, make sure the total size of the disk is in grub native sector sizes, otherwise there will be blocks at the end of the disk unaccessible by block lists.,
Patrick Steinhardt <=
- [PATCH 10/17] cryptodisk: Properly handle non-512 byte sized sectors., development, 2020/07/29
- [PATCH 14/17] cryptodisk: Add header line to procfs entry and crypto and source device names., development, 2020/07/29
- [PATCH 13/17] loopback: Add procfs entry 'loopbacks' to output configured loopback devices., development, 2020/07/29
- [PATCH 16/17] luks2: Ensure that bit fields of grub_luks2_digest_t in luks2_parse_digest are initialized before returning., development, 2020/07/29
- [PATCH 15/17] cryptodisk: Add a couple comments noting the usage of a couple fields in grub_cryptodisk_t as is done for grub_disk_t., development, 2020/07/29
- [PATCH 17/17] luks2: Fix use of incorrect index and some error messages., development, 2020/07/29