grub-devel
[Top][All Lists]
Advanced

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

Re: [PATCH] Warn the user to edit environment block by grub-editenv


From: Michael Chang
Subject: Re: [PATCH] Warn the user to edit environment block by grub-editenv
Date: Thu, 7 Nov 2019 08:48:00 +0000

On Tue, Nov 05, 2019 at 12:49:08PM +0100, Javier Martinez Canillas wrote:
> Hello Michael,
> 
> On 11/5/19 10:20 AM, Michael Chang wrote:
> > The environment block is a preallocated 1024-byte file serves as persistent
> > storage for environment variables. It has its own format which is sensitive 
> > to
> > corruption if using editor doesn't know how to process it. Besides the 
> > editor
> > may inadvertantly change size allocation that could have it sparse the
> > filesystem which could lead to unexpected outcome.
> >
> 
> Yes, we also get reports about this issue: 
> https://bugzilla.redhat.com/show_bug.cgi?id=1625124
>  
> > This patch adds message in grubenv file to warn the user from editing it by
> > tools other than grub-editenv.
> > 
> 
> Agreed that users should be warned that the file should only be edited with
> the GRUB tools.
> 
> I also wonder if grub-editenv can't be made more robust and correct a grubenv
> file (i.e: filling the missing # characters / removing any extra # character)
> if is found to be corrupted and not having the expected size.

IMHO when people trying to read grubenv file they didn't expect the
sanitization from happening, as that might be troublesome to describe
problem if anyone wants to troubleshoot issue related to malformed
grubenv which is just victim of filesystem corruption and like.

I personally wouldn't mind if the function is provided as separate
command and backup original file somewhere ..

> 
> > Signed-off-by: Michael Chang <address@hidden>
> > ---
> >  util/editenv.c | 12 +++++++++---
> >  1 file changed, 9 insertions(+), 3 deletions(-)
> > 
> 
> The patch looks good to me.
> 
> Reviewed-by: Javier Martinez Canillas <address@hidden>

Thanks a lot for your feedback and review. :)

Regards,
Michael

> 
> Best regards,
> -- 
> Javier Martinez Canillas
> Software Engineer - Desktop Hardware Enablement
> Red Hat



reply via email to

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