All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] nfs: Don't assume we have a security structure
@ 2014-03-11 21:11 Anna Schumaker
  2014-03-11 21:27 ` Trond Myklebust
  2014-03-11 21:31 ` Weston Andros Adamson
  0 siblings, 2 replies; 9+ messages in thread
From: Anna Schumaker @ 2014-03-11 21:11 UTC (permalink / raw)
  To: Trond.Myklebust, linux-nfs

If the i_security field isn't set then security_dentry_init_security()
won't initialize some of the values used by the security label.  This
causes my client to hit a BUG_ON() while encoding a label of size
-2128927414.

I hit this bug while testing on a client without SELinux installed.

Signed-off-by: Anna Schumaker <anna.schumaker@netapp.com>
---
 fs/nfs/nfs4proc.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index b8cd560..994ccc2 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -105,6 +105,9 @@ nfs4_label_init_security(struct inode *dir, struct dentry *dentry,
 	if (nfs_server_capable(dir, NFS_CAP_SECURITY_LABEL) == 0)
 		return NULL;
 
+	if (!dir->i_security)
+		return NULL;
+
 	err = security_dentry_init_security(dentry, sattr->ia_mode,
 				&dentry->d_name, (void **)&label->label, &label->len);
 	if (err == 0)
-- 
1.9.0


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

end of thread, other threads:[~2014-03-12 13:19 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-11 21:11 [PATCH] nfs: Don't assume we have a security structure Anna Schumaker
2014-03-11 21:27 ` Trond Myklebust
2014-03-11 22:00   ` Trond Myklebust
2014-03-12  0:38     ` Eric Paris
2014-03-12  1:06       ` Jeffrey Layton
2014-03-12  9:21         ` Trond Myklebust
2014-03-12 10:22           ` Jeff Layton
2014-03-12 13:19             ` Anna Schumaker
2014-03-11 21:31 ` Weston Andros Adamson

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.