All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] selinux: fix dentry_open() error check
@ 2006-11-27  6:16 Akinobu Mita
  2006-11-27  6:35 ` Christoph Hellwig
  2006-11-27 15:29 ` James Morris
  0 siblings, 2 replies; 4+ messages in thread
From: Akinobu Mita @ 2006-11-27  6:16 UTC (permalink / raw)
  To: linux-kernel; +Cc: Stephen Smalley, James Morris

The return value of dentry_open() shoud be checked by IS_ERR().

Cc: Stephen Smalley <sds@tycho.nsa.gov>
Cc: James Morris <jmorris@namei.org>
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>

---
 security/selinux/hooks.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Index: work-fault-inject/security/selinux/hooks.c
===================================================================
--- work-fault-inject.orig/security/selinux/hooks.c
+++ work-fault-inject/security/selinux/hooks.c
@@ -1760,7 +1760,8 @@ static inline void flush_unauthorized_fi
 						get_file(devnull);
 					} else {
 						devnull = dentry_open(dget(selinux_null), mntget(selinuxfs_mount), O_RDWR);
-						if (!devnull) {
+						if (IS_ERR(devnull)) {
+							devnull = NULL;
 							put_unused_fd(fd);
 							fput(file);
 							continue;

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2006-11-27 15:29 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-11-27  6:16 [PATCH] selinux: fix dentry_open() error check Akinobu Mita
2006-11-27  6:35 ` Christoph Hellwig
2006-11-27  6:58   ` Akinobu Mita
2006-11-27 15:29 ` James Morris

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.