Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 406247 - net-im/skype-2.2.0.35-r1: Sandbox violation with USE="pax-kernel" & Not working with >=paxctl-0.6
Summary: net-im/skype-2.2.0.35-r1: Sandbox violation with USE="pax-kernel" & Not worki...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Matthew Thode ( prometheanfire )
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-02-29 06:29 UTC by Richard Grenville
Modified: 2012-03-01 16:27 UTC (History)
2 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Richard Grenville 2012-02-29 06:29:10 UTC
The first problem is, with the current net-im/skype-2.2.0.35-r1 ebuild emerge skype with USE='pax-kernel' would result in a sandbox violation:

----------------------------
>>> Install skype-2.2.0.35-r1 into /var/tmp/portage/net-im/skype-2.2.0.35-r1/image/ category net-im
...
 * PT PaX marking -m
 *      /opt/skype/skype
ACCESS DENIED  open_wr:      /opt/skype/skype
ACCESS DENIED  open_wr:      /opt/skype/skype
ACCESS DENIED  open_wr:      /opt/skype/skype
----------------------------

The cause is this line in the ebuild:
  pax-mark m /opt/skype/skype || die
There should be a "${D}" before /opt/skype/skype.

However there comes the second problem: pax-mark m "${D}/opt/skype/skype" does not actually work, since according to pax-utils.eclass, pax-mark m "${D}/opt/skype/skype" would firstly cause it to execute:
 paxctl -qm /var/tmp/portage/net-im/skype-2.2.0.35-r1/image//opt/skype/skype
It would fail since "file /opt/skype/skype does not have a PT_PAX_FLAGS program header", then it executes:
 paxctl -qcm /var/tmp/portage/net-im/skype-2.2.0.35-r1/image//opt/skype/skype
Which would be succesful, so pax-mark.eclass considers it's working and returns to the ebuild. Nonetheless, a "paxctl -cm"-ed skype does not run. Skype tells you the binary is corrupted and you should reinstall skype, which was once discussed here:
https://bugs.gentoo.org/show_bug.cgi?id=302589
The solution is what mori rámar pointed out in the comment #38:
  pax-mark Cm "${D}/opt/skype/skype" || die

And the third problem appears. I have paxctl-0.6 installed, currently it's ~x86/~amd64, and seemingly for paxctl-0.6, paxctl -Cm "/opt/skype/skype" breaks the skype executable somehow.

----------------------------
# paxctl -Cm /opt/skype/skype
file /opt/skype/skype got a new PT_PAX_FLAGS program header

# paxctl -v /opt/skype/skype
PaX control v0.6
Copyright 2004,2005,2006,2007,2009,2010,2011,2012 PaX Team <pageexec@freemail.hu>

file /opt/skype/skype is not a valid ELF executable (invalid SHT_ entry:0)
----------------------------

Since paxctl failed, the -m is not applied, and skype gets killed for allocating RWX memory on a PaX-enabled kernel.

And downgrading paxctl to 0.5 fixes it for me. So it might make sense to DEPEND on pax-kernel? ( <sys-apps/paxctl-0.6 ) for now in the skype ebuild, unless you guys could figure what prevented /opt/skype/skype from being successfully "paxctl -Cm"-ed for paxctl-0.6.


Reproducible: Always
Comment 1 Matthew Thode ( prometheanfire ) archtester Gentoo Infrastructure gentoo-dev Security 2012-02-29 09:07:09 UTC
Fixed the paxctl and the ${D} error.  Going to look into the paxctl-0.6 problem more.

${D} should not have been needed in eapi4 I thought :|
Comment 2 Anthony Basile gentoo-dev 2012-02-29 11:46:40 UTC
> And the third problem appears. I have paxctl-0.6 installed, currently it's
> ~x86/~amd64, and seemingly for paxctl-0.6, paxctl -Cm "/opt/skype/skype"
> breaks the skype executable somehow.
> 

That's why paxctl-0.6 is marked ~arch.  We need to fix this for paxctl-0.5.  Since paxctl -c/-C is on the way out (slowly but surely) and we will have a new way of doing pax markings for binaries that don't have PT_PAX hearders (no not EI_PAX either) we may never stabilize paxctl-0.6.
Comment 3 Sergey Zhuga 2012-03-01 16:18:31 UTC
Same issue. Downgrading paxctl to 0.5 has solved the problem.
Comment 4 Matthew Thode ( prometheanfire ) archtester Gentoo Infrastructure gentoo-dev Security 2012-03-01 16:27:59 UTC
I'm gonna go ahead and close the bug here since the pax issue is unrelated and the sandbox breakage is fixed, so...