grub-devel
[Top][All Lists]
Advanced

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

Re: chmod of generated grub.cfg


From: Felix Zielcke
Subject: Re: chmod of generated grub.cfg
Date: Sun, 06 Sep 2009 17:17:34 +0200

Am Sonntag, den 06.09.2009, 17:09 +0200 schrieb Robert Millan:
> On Sun, Sep 06, 2009 at 04:58:40PM +0200, Felix Zielcke wrote:
> > 
> > Ok here's now a patch.
> > Robert do you think this can go into 1.97?
> 
> For 1.97 I'd be more comfortable with a simple s/444/400/.  An automated check
> smells like it could have corner cases.  In fact I found one:
> 
> > @@ -260,6 +260,11 @@ for i in ${grub_mkconfig_dir}/* ; do
> >    esac
> >  done
> >  
> > +if [ "x${grub_cfg}" != "x" ] && grep -q "^password " ${grub_cfg}.new ; then
> > +  chmod 400 ${grub_cfg}.new || grub_warn "Could not make ${grub_cfg}.new 
> > readable by only root.\
> > +  This means your password is readable by everyone"
> > +fi
> 
> There's a short time window in which /boot/grub/grub.cfg.new exists, has been
> fully generated, and its mode is 444 rather than 400.  An attacker could poll
> this file and with some luck extract a password from it.
> 

Oh right. So how about this?

-- 
Felix Zielcke
Proud Debian Maintainer

Attachment: chmod.diff.2
Description: Text document


reply via email to

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