grub-devel
[Top][All Lists]
Advanced

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

Re: [PATCH 2/3] osdep/unix/getroot.c: Clean up redundant code


From: Vladimir 'phcoder' Serbinenko
Subject: Re: [PATCH 2/3] osdep/unix/getroot.c: Clean up redundant code
Date: Fri, 26 Jan 2024 01:35:30 +0300



Le mar. 23 janv. 2024, 17:44, Daniel Kiper <dkiper@net-space.pl> a écrit :
Mate,

Next time please respond to all people/addresses in the original
email...

On Mon, Jan 22, 2024 at 02:09:38PM +0000, Mate Kukri wrote:
> Dear Alec, and grub-devel,
>
> I haven't checked the specific code in question, but do we really want
> to be removing such null-assignments? (Thinking about multiple patches
> exactly like this).
>
> In correct code, they are of course redundant by definition, however
> their intended purpose is that if the code happens to be incorrect,
> they turn use-after-free bugs into zero page accesses.
>
> Since static analysis of a language like C is inherently conservative,
> it is entirely possible that it is detecting the redundant assignment,
> but not the use after free it would have prevented.

We know the Coverity makes mistakes. So, we carefully check its reports.
These ones are not exceptions. Here the Coverity is correct and it is
safe to remove redundant code. I expect somebody was changing the code
at some point and forgot to drop surplus assignments.
Nope. It was to keep an invariant and ensure we don't double-free 

reply via email to

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