All of lore.kernel.org
 help / color / mirror / Atom feed
From: bfields@fieldses.org (J. Bruce Fields)
To: steved@redhat.com
Cc: linux-nfs@vger.kernel.org, kinglongmee@gmail.com
Subject: [PATCH] Reallow AUTH_NULL on v4 mounts.
Date: Thu, 14 Jun 2018 09:52:01 -0400	[thread overview]
Message-ID: <20180614135201.GB24594@fieldses.org> (raw)

From: "J. Bruce Fields" <bfields@redhat.com>

Kinglong Mee noted that the loop in seicnfo_addflavor (which sets the
security flavors allowed on the v4 pseudoroot) was adding flavors 1 and
0 twice; this is because flav_map ends with these entries:

	{ "unix",       AUTH_UNIX               },
        { "sys",        AUTH_SYS                },
        { "null",       AUTH_NULL               },
        { "none",       AUTH_NONE               },

where AUTH_UNIX == AUTH_SYS == 1 and AUTH_NULL == AUTH_NONE == 1.  We
need to allow two names for each of those two security flavors for
historical reasons.

The patch correctly fixed this by fixing the check for a duplicate
flavor number in secinfo_addflavor().  However it also went one step
further and rejected the flavor number 0.  This is unnecessary and
causes the kernel to fail any NFSv4 mounts using AUTH_NULL.

The fact that we've apparently gone a few years without anyone noticing
this suggests AUTH_NULL isn't used very much!  Still, this should be
fixed....

Fixes: e69eaaf93626
Cc: Kinglong Mee <kinglongmee@gmail.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
---
 utils/mountd/v4root.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/utils/mountd/v4root.c b/utils/mountd/v4root.c
index d735dbfe192d..c93bd4db51c8 100644
--- a/utils/mountd/v4root.c
+++ b/utils/mountd/v4root.c
@@ -69,9 +69,6 @@ set_pseudofs_security(struct exportent *pseudo, int flags)
 	for (flav = flav_map; flav < flav_map + flav_map_size; flav++) {
 		struct sec_entry *new;
 
-		if (!flav->fnum)
-			continue;
-
 		i = secinfo_addflavor(flav, pseudo);
 		new = &pseudo->e_secinfo[i];
 
-- 
2.17.1


             reply	other threads:[~2018-06-14 13:52 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-14 13:52 J. Bruce Fields [this message]
2018-06-14 14:21 ` [PATCH] Reallow AUTH_NULL on v4 mounts Chuck Lever
2018-06-14 14:33   ` Bruce Fields

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180614135201.GB24594@fieldses.org \
    --to=bfields@fieldses.org \
    --cc=kinglongmee@gmail.com \
    --cc=linux-nfs@vger.kernel.org \
    --cc=steved@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.