besides the problem with incorrect error reporting, the real reason is what Brad mentioned already (well, almost icon_wink.gif: chpax wants to write to the given binary which is not possible if it is running as an executable (which means that the kernel mmap()'ed it with VM_DENYWRITE). so you have to temporarily kill/stop the given service, chpax then restart it (which you'd have to do anyway since the PaX flags take effect on execution only, this will be true even in the future where you can specify them in the ACL system). btw, you should try out the ET_DYN version of sshd, i think it's a critical enough service to deserve it.
Thanks, that indeed was the problem.. And I'll try that ET_DYN version, too
PaX kills a process for one reason only: when it tried to execute code from a non-executable area (and that's never a false positive, i.e. there's nothing that could be wrong with that). also, the error message does give you more information, there's a second line that shows some memory context, it'd help if you posted both lines here. what makes it strange in your case is that you say that after having disabled the PaX flags it was still killed (by PaX, presumably). that's impossible given the program (PaX) logic, so i'd like to know every detail to reproduce it.
Ah, right..I think I found out the problem.. looks like an user error after all
I first disabled Paging based PAGE_EXEC for the program and checked out that it was
disabled and then i disabled other flags, including Segmentation based PAGE_EXEC
and checked out that it was disabled, too..
But i didn't notice that when I disabled Segmentation based PAGE_EXEC with -s it
at the same time enabled Paging based PAGE_EXEC again for some reason
Looks like there were either one of those enabled every time i ran it..
both weren't disabled at the same time
Are those two somehow conflicting or is there some other reason why disabling one
sometimes enables the other one?
And now that I finally managed to disable both of them, and tried the program
it indeed did segmentation fault
(No idea why it still would try to execute code from a
non-executable are, unless segmentation faults always do that, though)
Anyway. looks like pax did exactly what it was supposed to do..
Here are those lines from dmesg anyways, probably no need for them now, though..
First two lines came when i ran it through xinetd, and other two when i ran it in standalone
mode.. strange that there's no "From x.x.x.x" when it's ran in standalone mode?
PAX: From x.x.x.x: terminating task: /usr/sbin/sshd2(sshd2):24602, uid/euid: 3243/3243, EIP: 401686C8, ESP: BFFFE2C0
PAX: bytes at EIP: c0 86 16 40 c0 86 16 40 10 11 11 08 10 11 11 08 b8 11 11 08
PAX: terminating task: /usr/sbin/sshd2(sshd2):23543, uid/euid: 3243/3243, EIP: 401686D8, ESP: BFFFECD0
PAX: bytes at EIP: d0 86 16 40 d0 86 16 40 18 f0 10 08 18 f0 10 08 e0 86 16 40