Ownership of kernel headers

Bill maltby - LFS Related lfsbill at wlmcs.com
Sun Oct 13 14:11:18 PDT 2002


On Sun, 13 Oct 2002, Matthias Benkmann wrote:
> On Sun, 13 Oct 2002 14:16:37 -0400 Zack Winkles <sativa93 at bellsouth.net>
> wrote:
> 
> > Zack Winkles wrote:
> > > When we unpack the kernel at the beginning of chapter 5 we neglect to
> > > change their ownership to root. In their current condition if a user
> > > <snip>

> > s/chapter 5/chapter 6/g
> 
> Oops. I should have noticed myself. You got a point here. This is not only
> an issue with the kernel but some other packages as well. However,
> changing ownership after untarring is not a good solution because there is
> enough time for an attacker to replace files before ownership is changed.
> As a security measure, we could chmod go-x /lfs.

Two thoughts on this.

What about using the --same-owner command line parameter in tar? Will it
do what I think (give the numeric ID of the owner of the files used to
make the tarball)? If so, if they didn't make it as root, there is a good
chance the uid does not exist on the target. In fact, this could be
confirmed with a tar -tjvf <file-name> before the untar is done. If the
numeric ID is not valid on the target, does that close the door?

Second thought is that the untar can be done in a *very* restricted
directory (rwx------), user/groups changed while it is still there and
then the target directory is moved to where you want. IOW

    drwx------ ..... blah blah   wrk
        drwxrw-rw ..... blah blah   ncurses-5.3

Chown/grp/mod -R on ncurses-5.3 and then mv wrk/ncurses-5.3 /usr/src or
whatever. If wrk is in the same partition with usr/src, overhead is
minimal.

> MSB

-- 
Bill Maltby
billm at wlmcs.com

-- 
Unsubscribe: send email to listar at linuxfromscratch.org
and put 'unsubscribe lfs-dev' in the subject header of the message



More information about the lfs-dev mailing list