提交 d4116f82 编写于 作者: L Linus Torvalds

Merge branch 'for-linus' of...

Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/security-testing-2.6

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/security-testing-2.6:
  sysfs: Don't leak secdata when a sysfs_dirent is freed.
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
#include <linux/completion.h> #include <linux/completion.h>
#include <linux/mutex.h> #include <linux/mutex.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/security.h>
#include "sysfs.h" #include "sysfs.h"
DEFINE_MUTEX(sysfs_mutex); DEFINE_MUTEX(sysfs_mutex);
...@@ -285,6 +286,9 @@ void release_sysfs_dirent(struct sysfs_dirent * sd) ...@@ -285,6 +286,9 @@ void release_sysfs_dirent(struct sysfs_dirent * sd)
sysfs_put(sd->s_symlink.target_sd); sysfs_put(sd->s_symlink.target_sd);
if (sysfs_type(sd) & SYSFS_COPY_NAME) if (sysfs_type(sd) & SYSFS_COPY_NAME)
kfree(sd->s_name); kfree(sd->s_name);
if (sd->s_iattr && sd->s_iattr->ia_secdata)
security_release_secctx(sd->s_iattr->ia_secdata,
sd->s_iattr->ia_secdata_len);
kfree(sd->s_iattr); kfree(sd->s_iattr);
sysfs_free_ino(sd->s_ino); sysfs_free_ino(sd->s_ino);
kmem_cache_free(sysfs_dir_cachep, sd); kmem_cache_free(sysfs_dir_cachep, sd);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册