Page 1 of 1

Clamav bytecode feature isn't compatible with PaX

PostPosted: Thu Jul 22, 2010 7:52 am
by Dwokfur
https://wwws.clamav.net/bugzilla/show_bug.cgi?id=2092
http://bugs.gentoo.org/show_bug.cgi?id=326199

https://wwws.clamav.net/bugzilla/show_b ... d=2092#c39
It raises two questions:
1. What is the neat way of detecting PaX running on a system?
2. Edwin Török says PaX allows RWX mapping and kills the program after that.

I wonder if PaXTeam could comment on these...

Regards:
Dw.

Re: Clamav bytecode feature isn't compatible with PaX

PostPosted: Thu Jul 22, 2010 8:12 am
by spender
The latest version of the grsecurity patches will deny an RWX mapping instead of demoting it to RW. This should allow clamav to fall back to interpreter mode as it currently does with SELinux when execmem is revoked, without needing any special PaX detection.

-Brad

Re: Clamav bytecode feature isn't compatible with PaX

PostPosted: Thu Jul 22, 2010 8:15 am
by spender
So then the choice for the user becomes:
Do I want JIT? chpax -m if so
Am I OK with the performance of interpreter mode? leave binary as-is

-Brad

Re: Clamav bytecode feature isn't compatible with PaX

PostPosted: Thu Jul 22, 2010 8:35 am
by edwin
spender wrote:The latest version of the grsecurity patches will deny an RWX mapping instead of demoting it to RW. This should allow clamav to fall back to interpreter mode as it currently does with SELinux when execmem is revoked, without needing any special PaX detection.

-Brad


What can be done for older versions of grsecurity? There are quite a few users complaining that ClamAV crashes under PaX.

Is there a way to detect whether PaX is running, and it would deny execmem / demote RWX mapping?

Re: Clamav bytecode feature isn't compatible with PaX

PostPosted: Thu Jul 22, 2010 9:06 am
by spender
In /proc/self/status there's a line beginning with "PaX:" that could be used to check for the existence of PaX and what options are enabled on the particular binary.

-Brad

Re: Clamav bytecode feature isn't compatible with PaX

PostPosted: Thu Jul 22, 2010 3:43 pm
by edwin
Thanks, I wrote a patch that detects PaX and fallbacks to interpreter if MPROTECT is enabled:
https://wwws.clamav.net/bugzilla/attachment.cgi?id=1391