Re: [PATCH 1/9] Unionfs: security convert lsm into a static interface fix

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Erez Zadok
Date: Monday, October 22, 2007 - 5:48 pm

In message <20071022082231.GA15132@infradead.org>, Christoph Hellwig writes:

Why?  Are you concerned that the security policy may change after a module
is loaded?  My understanding of the security code is that it should handle
this, even if people call security_*() functions directly.  When I look at
the security_* functions in security.c, to me they very much smell like
global wrappers that others can call, b/c they refer to private/global ops
vectors that one should not be referencing directly.  For example:

int security_file_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
{
	return security_ops->file_ioctl(file, cmd, arg);
}


I can probably get rid of having unionfs call security_inode_permission, by
calling permission() myself and carefully post-process its return code
(unionfs needs to "ignore" EROFS initially, to allow copyup to take place).

But security_file_ioctl doesn't have any existing helper I can call.  I can
introduce a trivial vfs_security_file_ioctl wrapper to security_file_ioctl,
but what about the already existing *19* exported security_* functions in
security/security.c?  Do you want to see simple wrappers for all of them?
It seems redundant to add a one-line wrapper around an already one-line
function around security_ops->XXX.  Plus, some of the existing exported
security_* functions are file-system related, others are networking, etc.  So
we'll need wrappers whose names are prefixed appropriately: vfs_*, net_*,
etc.

Thanks,
Erez.
-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[GIT PULL -mm] 0/9 Unionfs updates/cleanups/fixes, Erez Zadok, (Sun Oct 21, 4:51 pm)
Re: [PATCH 1/9] Unionfs: security convert lsm into a stati ..., Christoph Hellwig, (Mon Oct 22, 1:22 am)
Re: [PATCH 1/9] Unionfs: security convert lsm into a stati ..., Erez Zadok, (Mon Oct 22, 5:48 pm)
Re: [PATCH 1/9] Unionfs: security convert lsm into a stati ..., Christoph Hellwig, (Tue Oct 23, 2:07 am)