grub-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH v6 00/12] Cryptodisk fixes for v2.06 redux


From: Glenn Washburn
Subject: [PATCH v6 00/12] Cryptodisk fixes for v2.06 redux
Date: Fri, 27 Nov 2020 03:03:32 -0600

This is a minor update to v5. There's a commit message fix, changes to debug
messages to add some more information on error, and an extra patch which
removes unused arguments to grub_error in luks2_parse_segment and
luks2_parse_digest.

Glenn

Glenn Washburn (12):
  luks2: Add slot_key member to struct grub_luks2_keyslot/segment/digest
  luks2: Use more intuitive slot key instead of index in user messages.
  luks2: Remove unused argument in grub_error
  cryptodisk: Replace some literals with constants in
    grub_cryptodisk_endecrypt
  luks2: grub_cryptodisk_t->total_sectors is the max number of device
    native sectors
  cryptodisk: Properly handle non-512 byte sized sectors
  luks2: Better error handling when setting up the cryptodisk
  luks2: Error check segment.sector_size
  whitespace: convert 8 spaces to tabs.
  mips: Enable __clzdi2()
  misc: Add grub_log2ull macro for calculating log base 2 of 64-bit
    integers
  luks2: Use grub_log2ull to calculate log_sector_size and improve
    readability

 grub-core/disk/cryptodisk.c  |  64 +++++++++------
 grub-core/disk/luks.c        |   5 +-
 grub-core/disk/luks2.c       | 153 ++++++++++++++++++++++++++++-------
 grub-core/kern/compiler-rt.c |   2 +-
 include/grub/compiler-rt.h   |   2 +-
 include/grub/cryptodisk.h    |   8 +-
 include/grub/disk.h          |  16 ++++
 include/grub/misc.h          |   3 +
 include/grub/types.h         |   5 ++
 9 files changed, 198 insertions(+), 60 deletions(-)

Range-diff against v5:
 1:  e2fbfa3ad =  1:  6262aefe9 luks2: Add slot_key member to struct 
grub_luks2_keyslot/segment/digest
 2:  a7be73eb2 !  2:  3cd52834b luks: Use more intuitive slot key instead of 
index in user messages.
    @@ Metadata
     Author: Glenn Washburn <development@efficientek.com>
     
      ## Commit message ##
    -    luks: Use more intuitive slot key instead of index in user messages.
    +    luks2: Use more intuitive slot key instead of index in user messages.
     
         Use the slot key name in the json array rather than the 0 based index 
in the
         json array for keyslots, segments, and digests. This is less confusing 
for
 -:  --------- >  3:  8527be145 luks2: Remove unused argument in grub_error
 3:  2598569ee =  4:  1a248b679 cryptodisk: Replace some literals with 
constants in grub_cryptodisk_endecrypt
 4:  6d67abeb4 =  5:  45f5d644f luks2: grub_cryptodisk_t->total_sectors is the 
max number of device native sectors
 5:  450a8b5a7 =  6:  6e01cafb1 cryptodisk: Properly handle non-512 byte sized 
sectors
 6:  268cceda5 !  7:  d8927c6bc luks2: Better error handling when setting up 
the cryptodisk
    @@ grub-core/disk/luks2.c: luks2_recover_key (grub_disk_t source,
     +      if (max_crypt_sectors < crypt->offset_sectors)
     +  {
     +    grub_dprintf ("luks2", "Segment \"%"PRIuGRUB_UINT64_T"\" has offset"
    -+                           " greater than source disk size, skipping\n",
    -+                           segment.slot_key);
    ++                           " %"PRIuGRUB_UINT64_T" which is greater than"
    ++                           " source disk size %"PRIuGRUB_UINT64_T","
    ++                           " skipping\n",
    ++                           segment.slot_key, crypt->offset_sectors,
    ++                           max_crypt_sectors);
     +    continue;
     +  }
     +
    @@ grub-core/disk/luks2.c: luks2_recover_key (grub_disk_t source,
     +      {
     +        /* TODO: Unparsable number-string, try to use the whole disk */
     +        grub_dprintf ("luks2", "Segment \"%"PRIuGRUB_UINT64_T"\" size"
    -+                               " is not a parsable number\n",
    -+                               segment.slot_key);
    ++                               " \"%s\" is not a parsable number\n",
    ++                               segment.slot_key, segment.size);
     +        continue;
     +      }
     +    else if(grub_errno == GRUB_ERR_OUT_OF_RANGE)
    @@ grub-core/disk/luks2.c: luks2_recover_key (grub_disk_t source,
     +         * be very large or the string is incorrect.
     +         */
     +        grub_dprintf ("luks2", "Segment \"%"PRIuGRUB_UINT64_T"\" size"
    -+                               " overflowed 64-bit unsigned integer,"
    ++                               " %s overflowed 64-bit unsigned integer,"
     +                               " the end of the crypto device will be"
     +                               " inaccessible\n",
    -+                               segment.slot_key);
    ++                               segment.slot_key, segment.size);
     +        if (crypt->total_sectors > max_crypt_sectors)
     +          crypt->total_sectors = max_crypt_sectors;
     +      }
 7:  cce3b042e =  8:  fcd7aadb7 luks2: Error check segment.sector_size
 8:  249967edc =  9:  61f77a1a8 whitespace: convert 8 spaces to tabs.
 9:  88490d61e = 10:  d71d26701 mips: Enable __clzdi2()
10:  5f3ae1e2d = 11:  8aa295f77 misc: Add grub_log2ull macro for calculating 
log base 2 of 64-bit integers
11:  cc56ab2a0 = 12:  7050a4ace luks2: Use grub_log2ull to calculate 
log_sector_size and improve readability
-- 
2.27.0




reply via email to

[Prev in Thread] Current Thread [Next in Thread]