All of lore.kernel.org
 help / color / mirror / Atom feed
* LSM check for renaming private inode?
@ 2010-01-16 13:59 Tetsuo Handa
  0 siblings, 0 replies; only message in thread
From: Tetsuo Handa @ 2010-01-16 13:59 UTC (permalink / raw)
  To: linux-security-module; +Cc: linux-fsdevel

Hello.

int security_inode_rename(struct inode *old_dir, struct dentry *old_dentry,
			  struct inode *new_dir, struct dentry *new_dentry)
{
	if (unlikely(IS_PRIVATE(old_dentry->d_inode) ||
	    (new_dentry->d_inode && IS_PRIVATE(new_dentry->d_inode))))
		return 0;
	return security_ops->inode_rename(old_dir, old_dentry,
					  new_dir, new_dentry);
}

int security_path_rename(struct path *old_dir, struct dentry *old_dentry,
			 struct path *new_dir, struct dentry *new_dentry)
{
	if (unlikely(IS_PRIVATE(old_dentry->d_inode) ||
	    (new_dentry->d_inode && IS_PRIVATE(new_dentry->d_inode))))
		return 0;
	return security_ops->path_rename(old_dir, old_dentry, new_dir,
					 new_dentry);
}

I just come to wonder why the condition is "||".
If source inode is private, destination inode (which is not always private)
will be deleted without LSM's permission check.
If destination inode is private, source inode (which is not always private)
will be renamed without LSM's permission check.
I think it is not good to grant deleting/renaming !IS_PRIVATE(inode) without
LSM's permission check.

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2010-01-16 13:59 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-01-16 13:59 LSM check for renaming private inode? Tetsuo Handa

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.