Re: [apparmor] [patch 0/8] mod_apparmor fixes and improvements

2014-01-23 Thread Steve Beattie
On Wed, Jan 22, 2014 at 12:47:46PM -0800, Steve Beattie wrote: This patch set is a series of fixes and improvements for mod_apparmor. It improves on the previously sent logging patch, fixes a bug in how AADefaultHatName's value is stored, modifies mod_apparmor to use the server/vhost name (aka

[apparmor] [patch 02/11] mod_apparmor: use trace1 loglevel for developer-oriented debug messages [v2]

2014-01-23 Thread Steve Beattie
Apache 2.4 added addition logging levels. This patch converts some of the log messages that are more intended for mod_apparmor development and debugging than for sysadmins configuring mod_apparmor to use trace1 (APLOG_TRACE1) level instead. Since apache 2.2. does not contain this level (or

[apparmor] [patch 05/11] mod_apparmor: improve initial and exit aa_change_hat call log message [v2]

2014-01-23 Thread Steve Beattie
This patch adds the name of the hat to the log message about the initial aa_change_hat call, just to be explicit about what's happening when debugging and changes the formatting slightly of the exiting change_hat log message. Patch history: v1: initial version v2: tweak output of exit trace

[apparmor] [patch 03/11] mod_apparmor: convert debug_dump_uri to use trace loglevel [resend]

2014-01-23 Thread Steve Beattie
This patch converts the debug_dump_uri() function to use the trace loglevels and enable it all the time, rather than just when DEBUG is defined at compile time. Signed-off-by: Steve Beattie st...@nxnw.org --- changehat/mod_apparmor/mod_apparmor.c | 18 +++--- 1 file changed, 7

[apparmor] [patch 10/11] mod_apparmor: eliminate unnecessary back out aa_change_hat() calls

2014-01-23 Thread Steve Beattie
This patch removes unnecessary back out aa_change_hat() calls that occur if the prior call to aa_change_hat() call failed. It used to be case that an aa_change_hat() call that failed would result in the task being placed in a profile with no permissions except the ability to aa_change_hat() back

[apparmor] [patch] libapparmor: fix aa_change_hat token format string

2014-01-23 Thread Steve Beattie
This patch fixes the format string for the magic token in aa_change_hat to match the type of the magic token (long). Without this, on 64 bit platforms, only the bottom 32 bits of the token would be used. aa_change_hatv() has the correct format string, so an aa_change_hatv() call followed by an

[apparmor] [patch 11/11] mod_apparmor: include errno in log messages for failures

2014-01-23 Thread Steve Beattie
This patch includes the errno in the log messages generated by two different failed aa_change_hat() calls and the failure to open /dev/urandom to get the random token, to further ease failure diagnosis. Signed-off-by: Steve Beattie st...@nxnw.org --- changehat/mod_apparmor/mod_apparmor.c | 11

[apparmor] [patch 00/11] mod_apparmor fixes and improvements [v2]

2014-01-23 Thread Steve Beattie
This patch set is a series of fixes and improvements for mod_apparmor; it: - improves on the previously sent logging patches, - fixes a bug in how AADefaultHatName's value is stored, - modifies mod_apparmor to use the server/vhost name (aka ServerName) as the default value of

[apparmor] [patch 04/11] mod_apparmor: convert change_hat to aa_change_hat() [resend]

2014-01-23 Thread Steve Beattie
mod_apparmor never got converted to use the renamed aa_change_hat() call (there's a compatibility macro in sys/apparmor.h); this patch does that as well as converting the type of the magic_token to long from int. (This patch is somewhat mooted by a later patch in the series to convert to using

[apparmor] [patch 08/11] mod_apparmor: convert aa_change_hat()s into single aa_change_hatv() [v2]

2014-01-23 Thread Steve Beattie
This patch converts the request entry point from using multiple (if necessary) aa_change_hat() calls into a single aa_change_hatv() call, simplifying the code a bit, requiring fewer round trips between mod_apparmor and the kernel for each request, as well as providing more information when the

[apparmor] [patch 09/11] mod_apparmor: add logging for AAHatName/AADefaultHatName policy misconfig

2014-01-23 Thread Steve Beattie
This patch adds code that checks the resulting hat that apache gets placed into, and verifies that if the apache configuration specified that an AAHatName or AADefaultHatName should have been the resulting hat. If it wasn't, emit a warning message to the apache log, as this likely indicates a

[apparmor] [patch 06/11] mod_apparmor: fix AADefaultHatName storage [resend]

2014-01-23 Thread Steve Beattie
When defining an AADefaultHatName entry, it was being stored in the passed mconfig location, which is not the module specific server config, but instead the top level (i.e. no path defined) default directory/location config. This would be superceded by a more specific directory config if it

Re: [apparmor] [patch] libapparmor: fix aa_change_hat token format string

2014-01-23 Thread John Johansen
On 01/23/2014 02:44 AM, Steve Beattie wrote: This patch fixes the format string for the magic token in aa_change_hat to match the type of the magic token (long). Without this, on 64 bit platforms, only the bottom 32 bits of the token would be used. aa_change_hatv() has the correct format

Re: [apparmor] [patch 01/11] mod_apparmor: fix logging [v3]

2014-01-23 Thread John Johansen
On 01/23/2014 02:45 AM, Steve Beattie wrote: The apache2 mod_apparmor module was failing to log debugging messages when the apache loglevel was set to debug or lower (i.e. traceN). This patch fixes it by using ap_log_rerror() (for request specific messages, with the request passed for context)

Re: [apparmor] [patch 02/11] mod_apparmor: use trace1 loglevel for developer-oriented debug messages [v2]

2014-01-23 Thread John Johansen
On 01/23/2014 02:45 AM, Steve Beattie wrote: Apache 2.4 added addition logging levels. This patch converts some of the log messages that are more intended for mod_apparmor development and debugging than for sysadmins configuring mod_apparmor to use trace1 (APLOG_TRACE1) level instead. Since

Re: [apparmor] [patch 05/11] mod_apparmor: improve initial and exit aa_change_hat call log message [v2]

2014-01-23 Thread John Johansen
On 01/23/2014 02:45 AM, Steve Beattie wrote: This patch adds the name of the hat to the log message about the initial aa_change_hat call, just to be explicit about what's happening when debugging and changes the formatting slightly of the exiting change_hat log message. Patch history:

Re: [apparmor] [patch 06/11] mod_apparmor: fix AADefaultHatName storage [resend]

2014-01-23 Thread John Johansen
On 01/23/2014 02:45 AM, Steve Beattie wrote: When defining an AADefaultHatName entry, it was being stored in the passed mconfig location, which is not the module specific server config, but instead the top level (i.e. no path defined) default directory/location config. This would be superceded

Re: [apparmor] [patch 07/11] mod_apparmor: make the ServerName be the default AADefaultHatName [resend]

2014-01-23 Thread John Johansen
On 01/23/2014 02:45 AM, Steve Beattie wrote: Bug: https://bugs.launchpad.net/ubuntu/+source/apparmor/+bug/1207424 This patch makes the default value for AADefaultHatName be the server/vhost name, which can be specified in apache via the ServerName configuration declaration. It can be

Re: [apparmor] [patch 10/11] mod_apparmor: eliminate unnecessary back out aa_change_hat() calls

2014-01-23 Thread John Johansen
On 01/23/2014 02:45 AM, Steve Beattie wrote: This patch removes unnecessary back out aa_change_hat() calls that occur if the prior call to aa_change_hat() call failed. It used to be case that an aa_change_hat() call that failed would result in the task being placed in a profile with no

Re: [apparmor] [patch 1/3] dovecot profiles: introduce tunables/dovecot

2014-01-23 Thread John Johansen
On 01/19/2014 08:58 AM, Christian Boltz wrote: Hello, this patch introduces tunables/dovecot (with @{DOVECOT_MAILSTORE}) and replaces the mail storage location in various dovecot-related profiles with this variable. It also adds nice copyright headers (I hope I got the bzr log right ;-)

Re: [apparmor] [patch] update winbindd profile

2014-01-23 Thread John Johansen
On 01/19/2014 08:03 AM, Christian Boltz wrote: Hello, this patch includes several updates for the winbindd profile that the openSUSE package collected over the last months. - add abstractions/samba to usr.sbin.winbindd profile (and cleanup things that are included in the abstraction -

Re: [apparmor] [patch 2/3] dovecot profiles: add profiles for new dovecot 2.x binaries

2014-01-23 Thread John Johansen
On 01/19/2014 08:58 AM, Christian Boltz wrote: Hello, dovecot 2.x comes with several new binaries in /usr/lib/dovecot. This patch adds profiles for /usr/lib/dovecot/anvil /usr/lib/dovecot/auth /usr/lib/dovecot/config /usr/lib/dovecot/dict /usr/lib/dovecot/dovecot-lda

Re: [apparmor] [patch 3/3] dovecot profiles: update usr.sbin.dovecot profile for dovecot 2.x

2014-01-23 Thread John Johansen
On 01/19/2014 09:03 AM, Christian Boltz wrote: Hello, the usr.sbin.dovecot profile needs several updates for dovecot 2.x, including - capability dac_override and kill - Px for various binaries in /usr/lib/dovecot/ The patch also adds a nice copyright header (I hope I got the bzr log

Re: [apparmor] [patch 1/3] dovecot profiles: introduce tunables/dovecot

2014-01-23 Thread Christian Boltz
Hello, Am Donnerstag, 23. Januar 2014 schrieb John Johansen: On 01/19/2014 08:58 AM, Christian Boltz wrote: this patch introduces tunables/dovecot (with @{DOVECOT_MAILSTORE}) and replaces the mail storage location in various dovecot-related profiles with this variable. It also adds

Re: [apparmor] [patch 1/3] dovecot profiles: introduce tunables/dovecot

2014-01-23 Thread John Johansen
On 01/23/2014 06:37 AM, Christian Boltz wrote: Hello, Am Donnerstag, 23. Januar 2014 schrieb John Johansen: On 01/19/2014 08:58 AM, Christian Boltz wrote: this patch introduces tunables/dovecot (with @{DOVECOT_MAILSTORE}) and replaces the mail storage location in various dovecot-related

Re: [apparmor] [patch 01/11] mod_apparmor: fix logging [v3]

2014-01-23 Thread Christian Boltz
Hello, Am Donnerstag, 23. Januar 2014 schrieb Steve Beattie: On Thu, Jan 23, 2014 at 03:04:53AM -0800, John Johansen wrote: Looks good, though I did find myself wishing for a patch to rename immunix to apparmor. Yeah, as well as a patch to fix up some of the whitespace quirks (lots of

Re: [apparmor] [patch 08/11] mod_apparmor: convert aa_change_hat()s into single aa_change_hatv() [v2]

2014-01-23 Thread Steve Beattie
On Thu, Jan 23, 2014 at 04:00:54AM -0800, John Johansen wrote: So with the aa_change_hat format string bug fixed in another one of your patches do you think its worth converting the aa_change_hat(NULL, token); calls to aa_change_hatv(NULL, token); ? This should allow this module to be

Re: [apparmor] [patch 09/11] mod_apparmor: add logging for AAHatName/AADefaultHatName policy misconfig

2014-01-23 Thread Steve Beattie
On Thu, Jan 23, 2014 at 03:49:51AM -0800, John Johansen wrote: On 01/23/2014 02:45 AM, Steve Beattie wrote: This patch adds code that checks the resulting hat that apache gets placed into, and verifies that if the apache configuration specified that an AAHatName or AADefaultHatName should

Re: [apparmor] [patch 01/11] mod_apparmor: fix logging [v3]

2014-01-23 Thread Steve Beattie
On Thu, Jan 23, 2014 at 02:19:55PM -0800, John Johansen wrote: On 01/23/2014 01:59 PM, Christian Boltz wrote: Nevertheless, I'll probably take the risk and test 2.8 with the latest mod_apparmor.c as soon as you commit your patches to trunk. (I want one big patch, not copypaste from 11

Re: [apparmor] [patch 09/11] mod_apparmor: add logging for AAHatName/AADefaultHatName policy misconfig

2014-01-23 Thread John Johansen
On 01/23/2014 02:33 PM, Steve Beattie wrote: On Thu, Jan 23, 2014 at 03:49:51AM -0800, John Johansen wrote: On 01/23/2014 02:45 AM, Steve Beattie wrote: This patch adds code that checks the resulting hat that apache gets placed into, and verifies that if the apache configuration specified

Re: [apparmor] [patch 09/11] mod_apparmor: add logging for AAHatName/AADefaultHatName policy misconfig

2014-01-23 Thread Christian Boltz
Hello, Am Donnerstag, 23. Januar 2014 schrieb Steve Beattie: It kind of points to a minor deficiency in aa_change_hatv()'s interface, in that you know you successfully changed to hat or not, but not which one. That sounds like we should find a way to change that ;-) Does aa_change_hatv

Re: [apparmor] [patch 09/11] mod_apparmor: add logging for AAHatName/AADefaultHatName policy misconfig

2014-01-23 Thread John Johansen
On 01/23/2014 03:42 PM, Christian Boltz wrote: Hello, Am Donnerstag, 23. Januar 2014 schrieb Steve Beattie: It kind of points to a minor deficiency in aa_change_hatv()'s interface, in that you know you successfully changed to hat or not, but not which one. That sounds like we should find