Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 55671 - RO permissions on genpatches-base breaks UNIPATCH_EXCLUDE
Summary: RO permissions on genpatches-base breaks UNIPATCH_EXCLUDE
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Hardened (show other bugs)
Hardware: All All
: High normal (vote)
Assignee: x86-kernel@gentoo.org (DEPRECATED)
URL:
Whiteboard:
Keywords:
: 55761 (view as bug list)
Depends on:
Blocks:
 
Reported: 2004-06-30 05:34 UTC by Roy Marples (RETIRED)
Modified: 2004-08-01 09:11 UTC (History)
5 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
1315_alpha-sysctl-uac.err (1315_alpha-sysctl-uac.err,7.96 KB, text/plain)
2004-07-01 03:13 UTC, Boris
Details
kernel-2.eclass-20040704.diff (kernel-2.eclass-20040704.diff,512 bytes, patch)
2004-07-04 15:24 UTC, solar (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Roy Marples (RETIRED) gentoo-dev 2004-06-30 05:34:58 UTC
Trying it install hardened-dev-sources-2.6.5 results in a "hang" after seeing "* genpatches-2.6-7.38-base.tar.bz2 unpacked".

Pressing enter causes the patching process to continue
The output is as follows

uberserver hardened-dev-sources # emerge hardened-dev-sources
Calculating dependencies ...done!
>>> emerge (1 of 1) sys-kernel/hardened-dev-sources-2.6.7 to /
>>> md5 src_uri ;-) linux-2.6.7.tar.bz2
>>> md5 src_uri ;-) hardened-patches-2.6-7.2.tar.bz2
>>> md5 src_uri ;-) genpatches-2.6-7.38-base.tar.bz2
>>> Preparing to unpack...
>>> Unpacking source...
>>> Unpacking linux-2.6.7.tar.bz2 to /var/tmp/portage/hardened-dev-sources-2.6.7/work
 * hardened-patches-2.6-7.2.tar.bz2 unpacked
 * genpatches-2.6-7.38-base.tar.bz2 unpacked

 * Excluding Patch #1315
 * From: /patches/2/genpatches-2.6-7.38
 * Applying 1000_grsecurity-2.0.1-2.6.7.patch...                          [ ok ]
 * Applying 1300_linux-2.6.4-selinux-hooks.patch...                       [ ok ]
 * Applying 1305_linux-2.6.7-selinux-ipaddr.patch...                      [ ok ]
 * Applying 1310_linux-2.6.5-extra_sec_ops.patch...                       [ ok ]
 * Applying 2010_tcp-stealth-2.6.7.patch...                               [ ok ]
 * Applying 3000_netdev-random-core-2.6.7.patch...                        [ ok ]
 * Applying 3005_netdev-random-drivers-2.6.7.patch...                     [ ok ]
 * Applying 1310_k8_cardbus_io.patch...                                   [ ok ]
 * Applying 1315_alpha-sysctl-uac.patch...                                [ !! ]

 * Please attach /var/tmp/portage/hardened-dev-sources-2.6.7/temp/1315_alpha-sysctl-uac.err to any bug you may post.

!!! ERROR: sys-kernel/hardened-dev-sources-2.6.7 failed.
!!! Function unipatch, Line 485, Exitcode 0
!!! Unable to dry-run patch.

tseng on #gentoo-hardened tried to help me fix this, but to no avail :(
He thinks it's a kernel-2.eclass error, but mine matches his.


Portage 2.0.50-r8 (hardened-x86-2004.0, gcc-3.3.3, glibc-2.3.3.20040420-r0, 2.6.5-hardened-r5)
=================================================================
System uname: 2.6.5-hardened-r5 i686 VIA Nehemiah
Gentoo Base System version 1.4.16
Autoconf: sys-devel/autoconf-2.59-r3
Automake: sys-devel/automake-1.8.3
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CFLAGS="-O2 -march=i686 -pipe -mmmx -msse -mfpmath=sse -fprefetch-loop-arrays -fomit-frame-pointer"
CHOST="i686-pc-linux-gnu"
COMPILER="gcc3"
CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3/share/config /usr/share/config /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-O2 -march=i686 -pipe -mmmx -msse -mfpmath=sse -fprefetch-loop-arrays -fomit-frame-pointer"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoaddcvs ccache sandbox sfperms strict userpriv usersandbox"
GENTOO_MIRRORS="http://www.mirror.ac.uk/sites/www.ibiblio.org/gentoo/
                http://www.ibiblio.org/gentoo"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage"
USE="acl apache2 berkdb chroot crypt fam gdbm hardened imap libwww maildir mmx nls nptl pam perl pic pie png postgres python readline sasl slang sse ssl tcpd threads x86 zlib"
Comment 1 Brandon Hale (RETIRED) gentoo-dev 2004-06-30 05:38:09 UTC
This is freaky weird, I can merge no problem on three boxes.
Could any kernel herders try and figure out what the deal is here? I'm
pretty sure its not my bug, if its valid at all.
Comment 2 Roy Marples (RETIRED) gentoo-dev 2004-06-30 05:49:44 UTC
Sorry, first line should read

Trying it install hardened-dev-sources-2.6.7 results in a "hang" after seeing "* genpatches-2.6-7.38-base.tar.bz2 unpacked".


2.6.5-r5 installs fine....
Comment 3 Boris 2004-07-01 03:13:05 UTC
Created attachment 34568 [details]
1315_alpha-sysctl-uac.err

Same problem here.

The ebuild completely hangs after displaying "*
genpatches-2.6-7.38-base.tar.bz2 unpacked" and does nothing until you press
enter, which causes the same output as listed above.

I attached the file mentioned above
(/var/tmp/portage/hardened-dev-sources-2.6.7/temp/1315_alpha-sysctl-uac.err).


Another very weird behavior occours when I stop the process (Crtl-Z) and
background it (bg) a simple "ps" will stop it again (output listed bellow).
This does not happen before the ebuild "hangs"...

-------------------------------------------
[..]
 * hardened-patches-2.6-7.2.tar.bz2 unpacked
 * genpatches-2.6-7.38-base.tar.bz2 unpacked

[1]+  Stopped		      emerge sys-kernel/hardened-dev-sources
root@xxx (~)# bg
[1]+ emerge sys-kernel/hardened-dev-sources &
root@xxx (~)# ps
  PID TTY	   TIME CMD
29951 pts/3    00:00:00 su
 9646 pts/3    00:00:00 bash
  916 pts/3    00:00:04 emerge
32322 pts/3    00:00:00 ps

[1]+  Stopped		      emerge sys-kernel/hardened-dev-sources
root@xxx (~)#
Comment 4 Roy Marples (RETIRED) gentoo-dev 2004-07-01 04:02:15 UTC
Odd thing is that it works on a server here at work - which as pretty much the same configuration as my home server with the error as I admin them both. The main difference is that works server is a P4 instead of a VIA C3-2.
Comment 5 Roy Marples (RETIRED) gentoo-dev 2004-07-02 01:44:02 UTC
Same error with hardened-dev-sources-2.6.7-r1
Comment 6 Boris 2004-07-02 13:55:28 UTC
I added 'set -x' and PS4='[${LINENO}]+' to the kernel-2.eclass and found out, that the skript hangs in an rm-call in line 440 (437 in the unedited file).

After removing the I/O-redirection from line 437 in kernel-2.eclass I found out that the file is write-protected.

------------- output ------------- 
[..]
[437]+rm /var/tmp/portage/hardened-dev-sources-2.6.7-r1/work/patches/2/genpatches-2.6-7.38/1315_alpha-sysctl-uac.patch
rm: remove write-protected regular file `/var/tmp/portage/hardened-dev-sources-2.6.7-r1/work/patches/2/genpatches-2.6-7.38/1315_alpha-sysctl-uac.patch'? 
-------------  end  -------------

As a quick workaround you can simply press 'y' + enter at this point and the patch will be excluded:
------------- output ------------- 
 * Excluding Patch #1315_alpha
 * From: /patches/2/genpatches-2.6-7.38
-------------  end  -------------


I hope this helps!
Comment 7 Brandon Hale (RETIRED) gentoo-dev 2004-07-03 05:50:43 UTC
The patches that I inherit from gentoo-dev-sources (genpatches-2.6-${GPV}-base.tar.bz2) looks to be the problem here. If you unpack the tarball (im using 2.6-7.38 currently), you will notice that the files are read-only. This throws a fork into the rm.
Comment 8 Brandon Hale (RETIRED) gentoo-dev 2004-07-03 05:53:45 UTC
Could someone with the issue test this as a fix:
Unpack genpatches, add write permissions, repack, and update the ebuilds
digest. See if the merge still hangs.
Comment 9 Greg Kroah-Hartman (RETIRED) gentoo-dev 2004-07-03 11:35:47 UTC
All new genpatches are set to read-only, so this will be a constant problem in
the future...
Comment 10 Jason Waldhelm 2004-07-03 19:11:59 UTC
i had _exactly_ the same error as the reporter of this bug (hitting enter made it continue, but it would fail in the same place).  i repackaged genpatches as Brandon (tseng) suggested in Comment #8, and the emerge completed successfully.

# emerge info
Portage 2.0.51_pre12 (default-x86-1.4, gcc-3.3.3, glibc-2.3.3.20040420-r0, 2.6.7-mm2)
=================================================================
System uname: 2.6.7-mm2 i686 Intel(R) Pentium(R) 4 Mobile CPU 2.00GHz
Gentoo Base System version 1.5.1
ccache version 2.3 [enabled]
Autoconf: sys-devel/autoconf-2.59-r4
Automake: sys-devel/automake-1.8.5-r1
Binutils: sys-devel/binutils-2.14.90.0.8-r1
ACCEPT_KEYWORDS="x86 ~x86"
AUTOCLEAN="yes"
CFLAGS="-O3 -march=pentium4 -funroll-loops -fprefetch-loop-arrays -fomit-frame-pointer -pipe"
CHOST="i686-pc-linux-gnu"
COMPILER="gcc3"
CONFIG_PROTECT="/etc /usr/X11R6/lib/X11/xkb /usr/kde/2/share/config /usr/kde/3.2/share/config /usr/kde/3.3/share/config /usr/kde/3/share/config /usr/share/config /usr/share/texmf/dvipdfm/config/ /usr/share/texmf/dvips/config/ /usr/share/texmf/tex/generic/config/ /usr/share/texmf/tex/platex/config/ /usr/share/texmf/xdvi/ /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-O2 -mcpu=i686 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoaddcvs ccache sandbox userpriv"
GENTOO_MIRRORS="ftp://mirror.iawnet.sandia.gov/pub/gentoo/"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync6.us.gentoo.org/gentoo-portage"
USE="X aalib aavm alsa apache2 apm avi berkdb cdr crypt cups dvd encode esd exiscan-acl fbcon foomaticdb gdbm gif gpm gtk gtk2 imlib java jpeg kde kerberos ldap libg++ libwww mad mikmod motif mpeg ncurses nls nptl oggvorbis opengl pam pdflib perl png postgres ppds python qt quicktime readline samba sdl slang spell sse ssl svga tcpd tetex truetype usb x86 xml2 xmms xv zlib"
Comment 11 Brandon Hale (RETIRED) gentoo-dev 2004-07-04 14:39:27 UTC
Greg, based on #9 , should I assume you have no intentions of helping
to solve this?
Comment 12 solar (RETIRED) gentoo-dev 2004-07-04 15:24:56 UTC
Created attachment 34800 [details, diff]
kernel-2.eclass-20040704.diff

I've not encountered this bug, but I think/hope this patch might do the trick
for you guys that are having problems.
Comment 13 Greg Kroah-Hartman (RETIRED) gentoo-dev 2004-07-04 15:50:53 UTC
No, it's not that I have no intention of helping, just trying to point out that
the temporary fix of changing the single permission of that file isn't going to
help out in the long run.

This needs a ebuild fix, like the one that was just posted :)
Comment 14 Brandon Hale (RETIRED) gentoo-dev 2004-07-04 16:07:16 UTC
Update: If I dont hear back from johnm (kernel-2 maintainer), I intend to
commit this trivial fix. Greg, feel free to beat me to that, as you are the kernel
team proper. Thanks for looking into the bug.
Comment 15 John Mylchreest (RETIRED) gentoo-dev 2004-07-04 16:28:57 UTC
I have no problems with this going directly in.
Thanks for pointing out the problem
Comment 16 Brandon Hale (RETIRED) gentoo-dev 2004-07-04 16:49:36 UTC
The eclass is updated in CVS. This problem should disappear shortly.
Thanks to everyone who helped out here and on the hardened ml.
Comment 17 solar (RETIRED) gentoo-dev 2004-07-04 22:56:12 UTC
Just a note.. for the kernel team.
But the kernel-2.eclass is using sys-apps/module-init-tools vs virtual/modutils , and modules-init-tools does not build from all hosts/libcs.
Comment 18 Brandon Hale (RETIRED) gentoo-dev 2004-08-01 09:11:35 UTC
*** Bug 55761 has been marked as a duplicate of this bug. ***