From patchwork Thu Jun 14 13:52:01 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "J. Bruce Fields" X-Patchwork-Id: 10464171 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 8535E601F9 for ; Thu, 14 Jun 2018 13:52:05 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 718CB28979 for ; Thu, 14 Jun 2018 13:52:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6643E289B5; Thu, 14 Jun 2018 13:52:05 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1050B28979 for ; Thu, 14 Jun 2018 13:52:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755102AbeFNNwD (ORCPT ); Thu, 14 Jun 2018 09:52:03 -0400 Received: from fieldses.org ([173.255.197.46]:55058 "EHLO fieldses.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755360AbeFNNwC (ORCPT ); Thu, 14 Jun 2018 09:52:02 -0400 Received: by fieldses.org (Postfix, from userid 2815) id 8755E1E2B; Thu, 14 Jun 2018 09:52:01 -0400 (EDT) Date: Thu, 14 Jun 2018 09:52:01 -0400 To: steved@redhat.com Cc: linux-nfs@vger.kernel.org, kinglongmee@gmail.com Subject: [PATCH] Reallow AUTH_NULL on v4 mounts. Message-ID: <20180614135201.GB24594@fieldses.org> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) From: bfields@fieldses.org (J. Bruce Fields) Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: "J. Bruce Fields" 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 Signed-off-by: J. Bruce Fields --- 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];