Hello,
I get the following error message: Can't load '/home/pdupre/Spectroscopy/test/blib/arch/auto/ttt/ttt.so' for module ttt: /home/pdupre/Spectroscopy/test/blib/arch/auto/ttt/ttt.so: cannot restore segment prot after reloc: Permission denied at /usr/lib/perl5/DynaLoader.pm line 200.
If I remove the SELinux enforcing mode to permissive, then it works fine.
The file ttt.so is generate by myself in user mode and I cannot access it. This strange !! how can I get rid of this problem ?
Thank.
On Mon, 2 May 2011 00:49:33 +0100 (BST) Patrick Dupre wrote:
The file ttt.so is generate by myself in user mode and I cannot access it. This strange !! how can I get rid of this problem ?
I've seen something like this before. I believe you have to add some flags when linking to mark the object file as promising not to execute on the stack. The default linker options don't do this, so selinux assumes the worst.
I'm afraid I don't remember the details of how you add those flags though.
On Sun, 1 May 2011 19:58:36 -0400 Tom Horsley wrote:
On Mon, 2 May 2011 00:49:33 +0100 (BST) Patrick Dupre wrote:
The file ttt.so is generate by myself in user mode and I cannot access it. This strange !! how can I get rid of this problem ?
I've seen something like this before. I believe you have to add some flags when linking to mark the object file as promising not to execute on the stack. The default linker options don't do this, so selinux assumes the worst.
I'm afraid I don't remember the details of how you add those flags though.
Found a good page on this. I bet you have some assembly code as part of your library, and the source is missing the magic voo-doo to promise never to execute the stack, so they taint the whole object file.
Here's a good reference (a gentoo page, but not really gentoo specific):
On 05/02/2011 01:49 AM, Patrick Dupre wrote:
cannot restore segment prot after reloc
From a little googling I understand this should fix the error:
chcon -t texrel_shlib_t /home/pdupre/Spectroscopy/test/blib/arch/auto/ttt/ttt.so
Iirc the actual fix has something to do with compiler flags and not touching the stack (or something like that).
Regards, Patrick
On Sunday, May 01, 2011 20:00:51 Patrick Lists wrote:
On 05/02/2011 01:49 AM, Patrick Dupre wrote:
cannot restore segment prot after reloc
From a little googling I understand this should fix the error:
chcon -t texrel_shlib_t /home/pdupre/Spectroscopy/test/blib/arch/auto/ttt/ttt.so
Iirc the actual fix has something to do with compiler flags and not touching the stack (or something like that).
Your work-around will get it done, but...
Dont't do that. Make a position independent library so relocation is not needed.
Compile with -fpic and you won't require relocation.
By the way, this has nothing to do with execution on the stack.
On Sun, 1 May 2011, Garry T. Williams wrote:
On Sunday, May 01, 2011 20:00:51 Patrick Lists wrote:
On 05/02/2011 01:49 AM, Patrick Dupre wrote:
cannot restore segment prot after reloc
From a little googling I understand this should fix the error:
chcon -t texrel_shlib_t /home/pdupre/Spectroscopy/test/blib/arch/auto/ttt/ttt.so
Iirc the actual fix has something to do with compiler flags and not touching the stack (or something like that).
Your work-around will get it done, but...
Dont't do that. Make a position independent library so relocation is not needed.
Compile with -fpic and you won't require relocation.
THis does not help. It seems that it is an issue with libstdc++-3-libc6.2-2-2.10.0.so But I cannot recompile the code. the source is not available compat-libstdc++-296-2.96-143.src.rpm / compat-gcc-296-2.96-143.src.rpm
It should be on download.fedora.redhat.com which is done.