From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1kOpMu-0003T5-R1 for mharc-grub-devel@gnu.org; Sat, 03 Oct 2020 17:47:04 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48480) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kOpMt-0003RR-9b for grub-devel@gnu.org; Sat, 03 Oct 2020 17:47:03 -0400 Received: from mail-ot1-x32b.google.com ([2607:f8b0:4864:20::32b]:38591) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kOpMo-0002JZ-LH for grub-devel@gnu.org; Sat, 03 Oct 2020 17:47:02 -0400 Received: by mail-ot1-x32b.google.com with SMTP id y5so4995828otg.5 for ; Sat, 03 Oct 2020 14:46:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=efficientek-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=BYrRhOFCPrkI2QGKVa1JQEfqgZAC5qYx1cmWocu0d7Y=; b=fQAOKZ7kz+nBC6cDmeYd6G/1GB2ViNdyI9nI7LuFu2Ofbj6A99w3ZyO92f4u5vEymK aI9TtA/D+dZNHJhhwriqbnDJPgt6m2pk9EKkivk0UjKxaevjdY402LE7Q75gtkumXAjA KNcla8u+VgoqVs6higAuAJHi5WlLtLz6K7RgxlddVdNOFkd462fu2sn8zHue0mG7aviG vrSUdvN0EZtvdotiWz6PWnsebTxYBWj5Q00Zb0mJxGzTTpipkFdc3QraAdNXDv/9NeSN EKUUCYej6qSUqwtR3qXqA7dIHzOBOYrGbO8L/X8Vtm52CVEkqVILgvGF6Q23hsXuSRmG TXkA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=BYrRhOFCPrkI2QGKVa1JQEfqgZAC5qYx1cmWocu0d7Y=; b=mLIEh1+T/7Tlvs0Rwc+zSNXc8/FHPS5CFfPfJc9XjjMLO68ZLP/+zQz7HQ/DPN7940 BR7frUEAsSqmiZKTWRt9gOV2k2qJM4HovtvrX1qejTGfYfjaS0bMvHFi7Wqr0LYs4j6q 6zbWv3gJUxt8gc80XC7+mvKxlEcsAt+PPkMo0Cjr6/2JanV20s7FFpIt6FqsIynAJTwM Rt1Hw/ooaE2d+22L4eETCO6Rv3e1TpoJYcCZZ59lovQqMXbJYD2apuFdGg/xcmPCXX2P YD5CGMk6oBqXc71gNNqEGD0UHPFBvP4Dtl/WgGh0hISL0jngX7aff4S08m7rBIsBv8rk 8/kg== X-Gm-Message-State: AOAM531l8C207vg90fhuFXcnfHklJ1H91e91EC5NT+lO2eBoSkSG4GF1 Tm7Dw9wldrpRCxIicKPeKj3Ka+IRbx/jjw== X-Google-Smtp-Source: ABdhPJy9v16oWTFcNyqtem+PKxuhlomvEwJcTNcpOodwLWhMy0ubdX5ty7zBG/9cTHradypILemWLQ== X-Received: by 2002:a9d:8d2:: with SMTP id 76mr6143991otf.270.1601761616775; Sat, 03 Oct 2020 14:46:56 -0700 (PDT) Received: from crass-HP-ZBook-15-G2.lan ([136.49.44.103]) by smtp.gmail.com with ESMTPSA id f26sm1495415otq.50.2020.10.03.14.46.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 03 Oct 2020 14:46:56 -0700 (PDT) From: Glenn Washburn To: grub-devel@gnu.org Cc: Daniel Kiper , Patrick Steinhardt , Glenn Washburn Subject: [PATCH 00/10] Cryptodisk fixes for v2.06 redux Date: Sat, 3 Oct 2020 16:45:53 -0500 Message-Id: X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2607:f8b0:4864:20::32b; envelope-from=development@efficientek.com; helo=mail-ot1-x32b.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Oct 2020 21:47:03 -0000 This series is meant to address concerns Daniel had for patches 3, 4, 8, and 9 of Daniel's series with subject "[PATCH 0/9] Cryptodisk fixes for v2.06". These were patches authored by me and which Daniel handed back for me to take the lead in getting accepted. This series warrants a new thread because several patches were split and new patches have been added to addresses suggestions from Daniel. The comments from Daniel can be seen in the following ML messages: 3: https://lists.gnu.org/archive/html/grub-devel/2020-09/msg00071.html 4: https://lists.gnu.org/archive/html/grub-devel/2020-09/msg00070.html 8: https://lists.gnu.org/archive/html/grub-devel/2020-09/msg00021.html 9: https://lists.gnu.org/archive/html/grub-devel/2020-09/msg00069.html Patches 1 and 2 are equivalent to patch 3 of the previous series, which was split into patch 1 which fixed the indexing and error message bugs and patch 2 which improves readability of the code. Patch 3 is new and related to patches 1 and 2. It uses the keyslot number that cryptsetup understand when displaying the keyslot to the user. Patch 4 has not changed from patch 4 of the previous series, except the adding of a line in the commit mesage mentioning the removal of the empty statement. Daniel's suggestion to rename total_length to total_sectors is implemented in patch 8. The other two suggestions, handling partial LUKS2 sectors and grub_strtoull() errors, I don't believe warrant action as I argued in more detail here: https://lists.gnu.org/archive/html/grub-devel/2020-10/msg00020.html Patch 5 has also not changed from the equivalent patch 8 of the previous series, but a more detailed commit message has been added per Daniel's suggestion. Patch 6, previously patch 9, has been updated to change how the IV is updated for plain and plain64 modes. This change is functionally equivalent to the previous patch, but more easy to understand. A comment has been added to aid that end. Also, the commit message was changed to be less confusing. Patch 7 comes out of a suggestion by Daniel in the previous patch 9. Some numerical literals are replaced with macros to compute those values. The appropriately named macros aid in understanding the code. Note: I have not functionally tested this as it affects mostly geli encrypted volumes which are on *BSD, which I do not use. The code compiles, and I expect it to work, but I would appreciate any *BSD geli users to verify that this still works for them. Patches 8, 9, and 10 make no functional changes to the code. They solely rename some identifiers. Patch 8 as mentioned above, was suggested by Daniel. Patches 9 and 10 are in the same vein in that they aid in the understanding of the code by more accurately describing what the identifiers represent. Glenn Washburn (10): luks2: Fix use of incorrect index and some grub_error() messages. luks2: Improve readability in luks2_get_keyslot. luks2: Use more intuitive keyslot key instead of index when naming keyslot. luks2: grub_cryptodisk_t->total_length is the max number of device native sectors cryptodisk: Fix cipher IV mode 'plain64' always being set as 'plain'. cryptodisk: Properly handle non-512 byte sized sectors. cryptodisk: Replace some literals with constants in grub_cryptodisk_endecrypt. cryptodisk: Rename total_length field in grub_cryptodisk_t to total_sectors. cryptodisk: Rename offset in grub_cryptodisk_t to offset_sectors. luks2: Rename source disk variabled named 'disk' to 'source' as in luks.c. grub-core/disk/cryptodisk.c | 78 +++++++++++++++++++--------------- grub-core/disk/geli.c | 4 +- grub-core/disk/luks.c | 9 ++-- grub-core/disk/luks2.c | 84 ++++++++++++++++++++----------------- include/grub/cryptodisk.h | 18 ++++++-- include/grub/types.h | 3 ++ 6 files changed, 116 insertions(+), 80 deletions(-) -- 2.27.0