Re: [PATCH] APPARMOR: Fix NULL Pointer dereference while __add_new_profile

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: John Johansen
Date: Tuesday, November 30, 2010 - 3:19 am

On 11/26/2010 07:18 AM, wzt.wzt@gmail.com wrote:
NAK, we can't just fail adding the profile to the policy here.  If this
was an error we would need to either return an error or handle it before
the this function was called.

In this case when __lookup_parent fails it sets error = -ENOENT before jumping
to audit:

The way the audit routines work is that they will return the error passed
into them with a few exceptions.  If in complain mode it can override,
the apparmor set eperm and eaccess error codes, and it can return errors that
occurred during auditing.

So in this case the error condition is guaranteed to be set and
__add_new_profile will never get called.

Currently this isn't very clear in the code and it could use a comment, or
maybe even some reworking so that the failure path calls audit_policy directly


--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [PATCH] APPARMOR: Fix NULL Pointer dereference while _ ..., John Johansen, (Tue Nov 30, 3:19 am)