Skip to contentSkip to conversation

mysql 4.1 requires shlib_t:file execmod?

gentoo-hardened Antoine Martin 2 participants 6 messages Oct 22, 2005 – Oct 24, 2005 5 messages not in the archive SELinux security module

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw
Quoted 10 lines · On Sat, 2005-10-22 at 16:53 +0200, [email protected] wrote:
Quoted 8 lines · Antoine Martin

I've upgraded a (gentoo x86 selinux) system from MySQL 4.0 to 4.1, and since then some of the software that uses mysql-libs refuse to run without 'shlib_t:file execmod'.

ie: when starting postfix (built and rebuilt with mysql support):
postfix: error while loading shared
libraries: /usr/lib/libmysqlclient.so.14: cannot restore segment prot after reloc: Permission denied

Quoted 6 lines

the reason might be text relocations, even though they should have been fixed already upstream. see long story at

http://bugs.gentoo.org/show_bug.cgi?id=42968
http://bugs.mysql.com/bug.php?id=11642
From the two threads above it looks like the fix should have gone in

4.1.14 (which is what I am running now)

Quoted 3 lines

what does scanelf -T /usr/lib/libmysqlclient.so.14 report? if it's not text relocs, then post an strace please.

Is scanelf a PaX tool?

Antoine

--
This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.

A message that is not in the archive (sent off-list or not yet received): [email protected]

#3 lore raw
Quoted 6 lines · On Sat, 2005-10-22 at 17:53 +0200, [email protected] wrote:
Quoted 3 lines · Antoine Martin
Quoted 2 lines

what does scanelf -T /usr/lib/libmysqlclient.so.14 report? if it's not text relocs, then post an strace please.

Is scanelf a PaX tool?

app-misc/pax-utils

Thanks,

scanelf -T /usr/lib/libmysqlclient.so.14 shows nothing at all.
(I also tried adding a -R, even -a shows nothing!)

Antoine

--
This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.

A message that is not in the archive (sent off-list or not yet received): 1130002276.8908.28.camel@alto

#5 lore raw
Quoted 15 lines · solar
Quoted 4 lines · Antoine Martin
Quoted 3 lines · On Sat, 2005-10-22 at 17:53 +0200, [email protected] wrote:
Quoted 2 lines · Antoine Martin
Quoted 2 lines

what does scanelf -T /usr/lib/libmysqlclient.so.14 report? if it's not text relocs, then post an strace please.

Quoted 8 lines
Quoted 3 lines
Quoted 1 line

Is scanelf a PaX tool?

app-misc/pax-utils

Thanks,

scanelf -T /usr/lib/libmysqlclient.so.14 shows nothing at all.
(I also tried adding a -R, even -a shows nothing!)

Quoted 5 lines

This should help pinpoint whats up. Post the results of the following commands.

emerge portage-utils pax-utils ; # If you don't already have both.

I didn't.

Quoted 3 lines

#1
qlist mysql | scanelf -qtf -

TEXTREL  /usr/lib/mysql/libmysqlclient.so
TEXTREL  /usr/lib/mysql/libmysqlclient_r.so
TEXTREL  /usr/lib/libmysqlclient.so
TEXTREL  /usr/lib/libmysqlclient.so.14.0.0
TEXTREL  /usr/lib/libmysqlclient_r.so
TEXTREL  /usr/lib/libmysqlclient_r.so.14.0.0
Quoted 3 lines

#2
scanelf -a /usr/lib/libmysqlclient.so.14

Nothing here

Quoted 4 lines

#3
scanelf -a $(qfile -C $(scanelf -BF%n /usr/lib/libmysqlclient.so.14 \
| awk '{print $1}'| tr , ' ' ) | cut -d '(' -f 2 | tr ')' ' ' )

scanelf: Unknown option

Quoted 5 lines
Signature · 3 lines
-- 
solar <[email protected]>
Gentoo Linux

--
This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.

A message that is not in the archive (sent off-list or not yet received): 1130004616.8908.38.camel@alto

#7 lore raw
Quoted 9 lines
Quoted 8 lines
Quoted 2 lines

#1
qlist mysql | scanelf -qtf -

TEXTREL  /usr/lib/mysql/libmysqlclient.so
TEXTREL  /usr/lib/mysql/libmysqlclient_r.so
TEXTREL  /usr/lib/libmysqlclient.so
TEXTREL  /usr/lib/libmysqlclient.so.14.0.0
TEXTREL  /usr/lib/libmysqlclient_r.so
TEXTREL  /usr/lib/libmysqlclient_r.so.14.0.0
Quoted 3 lines

Looks like you do infact have textrels in your mysql. I've seen this happen before when linked with a miscompiled libcrypto.so

I've rebuilt openssl, but this hasn't helped...

Quoted 6 lines
Quoted 3 lines
Quoted 2 lines

#2
scanelf -a /usr/lib/libmysqlclient.so.14

Nothing here

If nothing here then chances are your running scanelf while trying to enforce and no such policy exists for scanelf.

I must have done it wrong (it works even in enforcing mode now):

TYPE PAX STK/REL/PTL TEXTREL RPATH BIND FILE
ET_DYN ---xe- RW- --- RW- TEXTREL -
LAZY /usr/lib/libmysqlclient.so.14

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

#3

TYPE PAX STK/REL/PTL TEXTREL RPATH BIND FILE

ET_DYN ---xe- RW- R-- RW-    -      -   LAZY /lib/libcrypt.so.1
ET_DYN ---xe- RW- R-- RW-    -      -   LAZY /lib/libnsl.so.1
ET_DYN ---xe- RW- R-- RW-    -      -   LAZY /lib/libm.so.6
ET_DYN ---xe- RW- --- RW-    -      -   LAZY /lib/libz.so.1
ET_DYN ---xe- RW- R-- RW-    -      -   NOW /lib/libc.so.6

--
This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.

A message that is not in the archive (sent off-list or not yet received): [email protected]

#9 lore raw
Quoted 6 lines · On Sat, 2005-10-22 at 19:24 +0200, [email protected] wrote:
Quoted 3 lines · Antoine Martin

scanelf -T /usr/lib/libmysqlclient.so.14 shows nothing at all.
(I also tried adding a -R, even -a shows nothing!)

ok, so it's not textrels, can you post an strace output then?

Ah, I thought I could, but strace won't run in enforcing mode (which is needed to make it break)
strace: ptrace(PTRACE_TRACEME, ...): Permission denied

And since there is no audit message, I don't know how to allow it.

Thanks
Antoine

--
This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.

#10 lore raw
Quoted 11 lines · Antoine Martin
Quoted 6 lines · On Sat, 2005-10-22 at 19:24 +0200, [email protected] wrote:
Quoted 3 lines · Antoine Martin

scanelf -T /usr/lib/libmysqlclient.so.14 shows nothing at all.
(I also tried adding a -R, even -a shows nothing!)

ok, so it's not textrels, can you post an strace output then?

Ah, I thought I could, but strace won't run in enforcing mode (which is needed to make it break) strace: ptrace(PTRACE_TRACEME, ...): Permission denied

It's easy to modify policy to allow this:

can_ptrace(sysadm_t, mysqld_t)

Signature · 9 lines
http://www.coker.com.au/selinux/   My NSA Security Enhanced Linux packages
http://www.coker.com.au/bonnie++/  Bonnie++ hard drive benchmark
http://www.coker.com.au/postal/    Postal SMTP/POP benchmark
http://www.coker.com.au/~russell/  My home page

--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to [email protected] with
the words "unsubscribe selinux" without quotes as the message.