Re: [PATCH v2] x86/kaslr: Remove two redundant if checks
From: Borislav Petkov
Date: Sun Aug 02 2026 - 00:41:13 EST
On Fri, Jul 31, 2026 at 09:39:34AM +0200, Thorsten Blum wrote:
> The loop in slots_fetch_random() either returns the slot address or
> exits with i == slot_area_index, making the if check redundant. Drop it.
>
> In choose_random_location(), the if (*output != random_addr) check used
> to guard an add_identity_map() call.
Are you sure it did that?
-> 8391c73c96f2 ("x86/KASLR: Randomize virtual address separately")
You actually removed the comment which says what it did.
And what's wrong with the check?
--
Regards/Gruss,
Boris.
https://people.kernel.org/tglx/notes-about-netiquette