<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<pre style="margin: 1.71429em 0px; padding-top: 0.857143em; padding-bottom: 0.857143em; border-radius: 0.375rem;"><div class="elementToProof" style="text-align: left; text-indent: 0px; line-height: 1.71429; white-space: normal; font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);"><br></div><div class="elementToProof" style="text-align: left; text-indent: 0px; line-height: 1.71429; font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);"><code>
</code><code style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif;">Hi Salvatore,
Following up on your request, I checked the upstream GRUB bug report for this issue: https://savannah.gnu.org/bugs/?66603
The bug is still open. A maintainer (Vladimir Serbinenko) commented in December 2024 about a plan to switch to libgcrypt functions, but there hasn't been recent activity.
I have added a comment to the upstream bug report asking for an update on the libgcrypt plan and whether applying the direct constant-time fix (similar to the one proposed upstream and the patch I submitted here) would be acceptable in the meantime, given the ongoing impact on Debian.
I will report back here if there are further updates from upstream.
Thanks,</code><code>
</code>Mostafa</div></pre>
<div class="elementToProof" style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div id="appendonsend"></div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> Salvatore Bonaccorso <salvatore.bonaccorso@gmail.com> on behalf of Salvatore Bonaccorso <carnil@debian.org><br>
<b>Sent:</b> Thursday, May 1, 2025 1:07 AM<br>
<b>To:</b> Amin, Mostafa <Mostafa.Amin@windriver.com><br>
<b>Cc:</b> pkg-grub-devel@alioth-lists.debian.net <pkg-grub-devel@alioth-lists.debian.net>; team@security.debian.org <team@security.debian.org>; 1102217@bugs.debian.org <1102217@bugs.debian.org><br>
<b>Subject:</b> Re: CVE-2024-56738: Fix for grub_crypto_memcmp to use constant-time algorithm</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">CAUTION: This email comes from a non Wind River email account!<br>
Do not click links or open attachments unless you recognize the sender and know the content is safe.<br>
<br>
Hi Mostafa,<br>
<br>
On Tue, Apr 29, 2025 at 04:12:03PM +0000, Amin, Mostafa wrote:<br>
> Dear Security team,<br>
><br>
> I am submitting a fix for CVE-2024-56738 affecting the GRUB2 package in Debian.<br>
><br>
> Description of the vulnerability:<br>
> GNU GRUB (aka GRUB2) through 2.12 does not use a constant-time<br>
> algorithm for grub_crypto_memcmp and thus allows side-channel<br>
> attacks. The current implementation returns early when a difference<br>
> is found, which can lead to timing attacks that reveal information<br>
> about the compared data.<br>
><br>
> Affected Debian versions:<br>
> - bookworm<br>
> - bullseye<br>
> - trixie/sid<br>
><br>
> The fix implements a constant-time comparison algorithm that:<br>
> 1. Uses bitwise operations (XOR and OR) instead of conditional branching<br>
> 2. Always processes all bytes regardless of whether differences are found<br>
> 3. Uses volatile to prevent compiler optimizations that could reintroduce timing issues<br>
><br>
> I've verified that the patch is syntactically correct and implements<br>
> proper constant-time comparison according to cryptographic best<br>
> practices.<br>
><br>
><br>
> I've attached the patch file to this email.<br>
<br>
TTBOMK, this has not yet been fixed upstream itself and the upstream<br>
bug <a href="https://savannah.gnu.org/bugs/?66603">https://savannah.gnu.org/bugs/?66603</a> is not yet acted on, is this<br>
correct?<br>
<br>
Is this correct?<br>
<br>
If so I think the first step would be to make it accepted upstream<br>
change at which point it can flow down to Debian as well.<br>
<br>
Can you ping upstream on the upstream status (and report back to us as<br>
well?). Ideally by including again the bugreport #1102217 in Debian.<br>
<br>
Regards,<br>
Salvatore<br>
</div>
</span></font></div>
</body>
</html>