All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michael Chang <MChang@suse.com>
To: Javier Martinez Canillas <javierm@redhat.com>
Cc: The development of GNU GRUB <grub-devel@gnu.org>
Subject: Re: [PATCH] Warn the user to edit environment block by grub-editenv
Date: Thu, 7 Nov 2019 08:48:00 +0000	[thread overview]
Message-ID: <20191107084753.GD4084@mazu> (raw)
In-Reply-To: <f2a0fd47-3603-ebf7-e618-559414d99d92@redhat.com>

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 <mchang@suse.com>
> > ---
> >  util/editenv.c | 12 +++++++++---
> >  1 file changed, 9 insertions(+), 3 deletions(-)
> > 
> 
> The patch looks good to me.
> 
> Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>

Thanks a lot for your feedback and review. :)

Regards,
Michael

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


  reply	other threads:[~2019-11-07  8:50 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-05  9:20 [PATCH] Warn the user to edit environment block by grub-editenv Michael Chang
2019-11-05 11:49 ` Javier Martinez Canillas
2019-11-07  8:48   ` Michael Chang [this message]
2019-11-05 11:58 ` Daniel Kiper

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191107084753.GD4084@mazu \
    --to=mchang@suse.com \
    --cc=grub-devel@gnu.org \
    --cc=javierm@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.