Russell Coker: Executable Stack and Shared Objects
When running SE Linux you will notice that most applications are not permitted to run with an executable stack. One example of this is libsmpeg0 which is used by the game Freeciv [1]. When you attempt to run the Freeciv client program on a Debian/Etch system with a default SE Linux configuration (as described in my post on how to install SE Linux on Debian in 5 minutes [2]) then you will find that it doesn’t work.
When this happens the following will be logged to the kernel log and is available through dmesg and usually in /var/log/kern.log (Debian/Etch doesn’t have auditd included, the same problem on a Fedora, RHEL, or CentOS system in a typical configuration would be logged to /var/log/audit/audit.log):
audit(1191741164.671:974): avc: denied execstack for pid=30823 comm=”civclient” scontext=rjc:system_r:unconfined_t:s0 tcontext=rjc:system_r:unconfined_t:s0 tclass=process The relevant parts are in bold. The problem with this message in the message log is that you don’t know which shared object caused the problem. As civclient is normally run from the GUI you are given no other information. So the thing to do is to run it at the command-line (the avc message tells you that civclient is the name of the failing command) and you get the following result:
$ civclient
civclient: error while loading shared libraries: libsmpeg-0.4.so.0: cannot enable executable stack as shared object requires: Permission denied This makes it clear which shared object is at fault. The next thing to do is to test the object by using execstack to set it to not need an executable stack. The command execstack -q /usr/lib/libsmpeg-0.4.so.0.1.4 will give an “X” as the first character of the output to indicate that the shared object requests an executable stack. The command execstack -c /usr/lib/libsmpeg-0.4.so.0.1.4 will change the shared object to not request an executable stack. After making such a change to a shared object the next thing to do is to test the application and see if it works correctly. In every case that I’ve seen the shared object has not needed such access and the application has worked correctly. As an aside, there is a bug in execstack in that it will break sym-links. Make sure that the second parameter it is given is the shared object not the sym-link to it which was created by ldconfig. See Debian bug 445594 [3] and CentOS bug 2377 [4]. The correct thing to do is to fix the bug in the source (not just modify the resulting binary). On page 8 of Ulrich Drepper’s document about non-SE Linux security [5] there is a description of both the possible solutions to this problem. One is to add a line containing “.section .note.GNU-stack,"",@progbits” to the start of the assembler file in question (which is what I suggested in Debian bug report 445595 [6]). The other is to add the parameters “-Wa,--execstack” to the command-line for the GNU assembler - of course this doesn’t work if you use a different assembler. In the near future I will establish an apt repository for Debian/Etch i386 packages related to SE Linux. One of the packages will be a libsmpeg0 package compiled to not need an executable stack. But it would be good if bug fixes such as this one could be included in future updates to Etch.
audit(1191741164.671:974): avc: denied execstack for pid=30823 comm=”civclient” scontext=rjc:system_r:unconfined_t:s0 tcontext=rjc:system_r:unconfined_t:s0 tclass=process The relevant parts are in bold. The problem with this message in the message log is that you don’t know which shared object caused the problem. As civclient is normally run from the GUI you are given no other information. So the thing to do is to run it at the command-line (the avc message tells you that civclient is the name of the failing command) and you get the following result:
$ civclient
civclient: error while loading shared libraries: libsmpeg-0.4.so.0: cannot enable executable stack as shared object requires: Permission denied This makes it clear which shared object is at fault. The next thing to do is to test the object by using execstack to set it to not need an executable stack. The command execstack -q /usr/lib/libsmpeg-0.4.so.0.1.4 will give an “X” as the first character of the output to indicate that the shared object requests an executable stack. The command execstack -c /usr/lib/libsmpeg-0.4.so.0.1.4 will change the shared object to not request an executable stack. After making such a change to a shared object the next thing to do is to test the application and see if it works correctly. In every case that I’ve seen the shared object has not needed such access and the application has worked correctly. As an aside, there is a bug in execstack in that it will break sym-links. Make sure that the second parameter it is given is the shared object not the sym-link to it which was created by ldconfig. See Debian bug 445594 [3] and CentOS bug 2377 [4]. The correct thing to do is to fix the bug in the source (not just modify the resulting binary). On page 8 of Ulrich Drepper’s document about non-SE Linux security [5] there is a description of both the possible solutions to this problem. One is to add a line containing “.section .note.GNU-stack,"",@progbits” to the start of the assembler file in question (which is what I suggested in Debian bug report 445595 [6]). The other is to add the parameters “-Wa,--execstack” to the command-line for the GNU assembler - of course this doesn’t work if you use a different assembler. In the near future I will establish an apt repository for Debian/Etch i386 packages related to SE Linux. One of the packages will be a libsmpeg0 package compiled to not need an executable stack. But it would be good if bug fixes such as this one could be included in future updates to Etch.
- [1] http://en.wikipedia.org/wiki/Freeciv
- [2] http://etbe.coker.com.au/2006/12/08/se-linux-on-debian-in-5-minutes/
- [3] http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=445594
- [4] http://bugs.centos.org/view.php?id=2377
- [5] http://people.redhat.com/drepper/nonselsec.pdf
- [6] http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=445595
On request I just added three new incarnations of
...and I like that one, as one may expect.
With only 30% ball possession, France won against New Zealand. They
transformed the very few occasions to score tries and finally, thanks to a
magic inspiration by Fred Michalak, relayed by Yannick Jauzion, their last
try made them win 20-18.
The french defense was....close to heroic (179 tackles, whiles NZ tackled 36
times!), particularly at the end of the
match, where the NZ bulldozer was trying to score one very last try.
Not everything was perfect in this match (particularly a disaster in
line-outs: I have never been fond of Rafael Ibanez, but it seems to be time
for him to retire...), and only the courage made them win.
I really wish I could have been in Cardiff to celebrate this. Champagne...
So, rendez-vous to our English friends next week-end, in Stade de France.
Given their match today, that will be though, again.
Tomorrow, South-Africa-Fiji (yet another suprise?) and Argentina-Scotland.
Eh, why not France-Argentina as final?
Back around 1999, I was really interested in getting all of
After 6 weeks of teaching and over 2 months in my new apartment, I am making a short escape from NYC to visit my mom and sister in PR. In my Impacts of Technology class, we just finished a week on large-scale and complex technological systems, with a focus on industrial farming. We read a few sections of Micahel Pollan’s fanstastic book, The Ominvore’s Dilemma, which combines the odd qualities of being seductively alluring (thanks to his exquisite writing) and repulsive (thanks to the content, well at least the part on factory animal “farming”). I can’t recommend it enough and look forward to reading the rest, when I find the (magical) time to do so.
Now that I am at the airport, I am struck at how little I know about this place, which is also a large and complex technological system and I bet revealing its technological and cultural innards would provide as fascinating (although not quite as gross) of a story as that of factory animal farming.
There are many questions I would love answered: How exactly is coordination secured and what are the toughest elements to airport coordination? Where are the lines of cooperation and those of competition between airlines? What factors and values go into the design of the airport? (I know that for one thing, in American airports, there rarely seems to be enough electrical jacks; I am now sitting under the telephones, the only place with jacks in terminal 8 at JFK, and the funny thing is that there are a row of 7 unused phones and only one jack and I am sure it would be more useful to have 1 pay phone and a row of 7 jacks, instead). What sorts of airport technologies have put people out of jobs? What technologies have created new job opportunities? What sorts of social hierarchies are there in airports? Like who runs the big show? Is it a CEO? Or is something more like a university provost? What is standardized by the FAA, and what elements are more flexible, and thus different airport to airport? Is there a sense of camaraderie among airport employees, or are loyalties built primarily among employees of one airline or among the classes of workers? Given that unions are quite strong among airport employees and from the top (pilots) down (food workers), what is the political culture of airports/employees like? (I remember once overhearing a group of machinist and ground crew talking about the ugly face of globalization and NAFTA over coffee and I was dumbfounded and pretty psyched too). Are airports one of the few last remaining places in th US that provides for decent job security? Why do so many of the ground crew have such athletic, bulging calves?
As I have been such a good girl recently, I deserved some prize. I’ve always been in love with tiny light lappys, so I got myself one from ebay. It’s a 10″ 800 MHz Sony Vaio that weights slightly above 1 Kg, which means that I’d be able to carry it to anywhere I want. Debian has installed smoothly on it, even though I’ve had some problems due to the lack of CD/DVD and floppy drives, and my inability to make Debian Installer start from an USB pen. Most of it seems to be working properly right now, only small configuration issues are still pending. I’m really happy
Via
This Monday, state secretary Bijlevelt of interior affairs finally decided that any current type of voting computer
Sarah had been complaining that MythTV hadn't recorded an episode of The
Simpsons in months. It was indeed strange, as you could see that it was
going to record episodes if you looked at the upcoming recordings.
The other night we happened to be watching some recorded TV around the time
an episode was scheduled to be recorded, and sure enough, it started
recording one.
When we finished watching what we were watching, the episode had vanished. I
didn't think I'd seen anything relevant to auto-expiry in the logs for the
backend.
A few days later, another episode was recorded. We even watched it. It
disappeared afterwards.
I was sufficiently curious at this point as to what was going on. It turned
out that way back in the distant past when I set up MythTV, I misunderstood
what "recording groups" were. When I set up recordings of throw-away things
like the news, I created a recording group called "Short retention", assuming
I could go somewhere else and make stuff in that group get expired quicker
than stuff in the "Default" recording group.
(Incidentally, I only in the last few months discovered the veritable
cornucopia of things that you can do from the recordings listing screen when
you press the Menu/M button on the remote/keyboard. The recording groups now
make much more sense)
I think there's the word "storage" somewhere in the user-interface around
this area, which may have been what confused me. Turns out that I never
went and tried to set this mythical expiry policy up, because that's not how
auto-expiry works. The choices (as of 0.20) are "Oldest show first", "Lowest
priority first" and some sort of weighted combination of the two.
It turns out that I had it configured for "Lowest priority first", and
The Simpsons had the lowest priority of all TV shows, so that it'd
always lose out in the event of any scheduling conflicts.
The SAN's perpetually full, so it's always auto-expiring stuff, and The
Simpsons are what get expired first by this policy. Kinda funny really.
So I switched the policy around to the weight combination of priority and
age, and now it's going to auto-expire recordings from a year ago. Hooray.
Adrian (also sent by email):
So we finally need 64 bit CPUs in all our gadgets!
(After having seen OpenXchange's SyncML code fail horribly on dates that are
beyond 2038, which is something you quickly arrive at if people enter birthdays
as repeating appointments until infinity.)
Update: Neil Williams has some
Joey writes about