]> git.baikalelectronics.ru Git - kernel.git/commit
security: prevent permission checking of file removal via sysfs_remove_group()
authorJames Morris <jmorris@namei.org>
Thu, 26 Apr 2007 07:12:05 +0000 (00:12 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 27 Apr 2007 17:57:33 +0000 (10:57 -0700)
commit62428c2080f72db734f9cc6e71afd58d82f449e5
treec051a915e2038825dd2f50f24fc28abb3c4a5e79
parent747dfb6ff6588c5d8122b32d483f668cdf1a401d
security: prevent permission checking of file removal via sysfs_remove_group()

Prevent permission checking from being performed when the kernel wants to
unconditionally remove a sysfs group, by introducing an kernel-only variant
of lookup_one_len(), lookup_one_len_kern().

Additionally, as sysfs_remove_group() does not check the return value of
the lookup before using it, a BUG_ON has been added to pinpoint the cause
of any problems potentially caused by this (and as a form of annotation).

Signed-off-by: James Morris <jmorris@namei.org>
Cc: Nagendra Singh Tomar <nagendra_tomar@adaptec.com>
Cc: Tejun Heo <htejun@gmail.com>
Cc: Stephen Smalley <sds@tycho.nsa.gov>
Cc: Eric Paris <eparis@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
fs/namei.c
fs/sysfs/group.c
include/linux/namei.h