Re: [RFC][PATCH 11/11] security: AppArmor - Exportnamespace semaphore

From: Stephen Smalley
Date: Fri Apr 21 2006 - 09:57:42 EST


On Thu, 2006-04-20 at 15:11 -0700, Linda A. Walsh wrote:
> The *current* accepted way to get pathnames going into system
> calls is to trap the syscall vector as audit currently does --
> a method subject to race conditions. There is no way to implement
> pathname-based security (or auditing) without providing hooks
> in each of the relevant system calls after they have copied their
> arguments from user space, safely into kernel space. Decoding
> the arguments (including copying them from user space) twice allows
> for a window during which the user-space arguments can still be
> changed by a user-level process. You can't copy the arguments from
> userspace, twice, and expect that the userspace memory will be
> remain the same between the two "copies".

They aren't being copied twice. Look at getname() in fs/namei.c, and
note the call to audit_getname(). The native Linux 2.6 audit framework
combines processing at entry/exit with certain hooks placed at key
locations to collect the necessary information, without requiring the
degree of invasiveness of the SGI CAPP auditing patches of long ago.

--
Stephen Smalley
National Security Agency

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/