Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp5028112ybp; Mon, 7 Oct 2019 18:28:24 -0700 (PDT) X-Google-Smtp-Source: APXvYqwazktM16PwrM35yxgUTFj3OZiv4lq95tyHgGhv8jcIMJmTy+Qeblf8eOQ/sXvKoePlGDng X-Received: by 2002:aa7:c71a:: with SMTP id i26mr31931820edq.68.1570498103878; Mon, 07 Oct 2019 18:28:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570498103; cv=none; d=google.com; s=arc-20160816; b=gkn5LPq7Z8YAYp04OcGONKU/I06tUtOzsw6ApXALoxMKEObMemRtV+oB/VjL3tOLa9 OhdeK72xvBSC7P/6emg7qZht+rGupmnDFpO3YVReQ/EHlXOOp+j3gTdl/WUhovBnLSQ3 peGI4jsDN8jIHVWCMVYbnoHUMCYc3SHNuh21n0r6uYaHsICCBRPGBmiWxPXWHzL+VpIv ln0Uc0Cf7rto86snOPmHJ0s7kAsqFBTfqhPxXj4IKNSARqB/rLbiuMBMu08J7PwQ3IOJ SpRRsNfJFIU4xO4zbGQfVdI1PSIZ4N0BwQ2I7fb8ooRqtl+SjT2Qg1dG9g+FtgkIFXKw ci/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=qB+MBXxvXodPVI45bZzma1iWkoZU9vUIbwCns5yUbGM=; b=pzvfgqzjvkz1lIIz9sr2SXdtCLDMq5k2qzfX6la1snxuE02K51mPOMqNmdx+/4UAoZ qc5s4yCVxGHhJD64eSfqH9kklr3u+TVSGgzWj6eM2/F5qwePkWC1TRyEAeG5YQkNYhxw 0ZXqcTrAKMGsOS8kObW+GkwROAtzDemMzzkDhZ/u744a6YgiIVLd+Mr2UH/+8LuXbJMV NSPI6E4Tgp+5PEFz8xNJnJ/kBNKIVjouvDbrefHCIbSwaVselJ59uid7D4tydkLcgDJV nBP3w6oGcPcj+56IQVyUFZoy48z0dpWTln3OJ3XPwaieume/9/Teb2sYne412oFE8xex eIgg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z9si9852937edz.77.2019.10.07.18.28.00; Mon, 07 Oct 2019 18:28:23 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729789AbfJHB02 (ORCPT + 99 others); Mon, 7 Oct 2019 21:26:28 -0400 Received: from zeniv.linux.org.uk ([195.92.253.2]:48962 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729327AbfJHB02 (ORCPT ); Mon, 7 Oct 2019 21:26:28 -0400 Received: from viro by ZenIV.linux.org.uk with local (Exim 4.92.2 #3 (Red Hat Linux)) id 1iHeGc-00054z-D2; Tue, 08 Oct 2019 01:26:22 +0000 Date: Tue, 8 Oct 2019 02:26:22 +0100 From: Al Viro To: Hugh Dickins Cc: Laura Abbott , David Howells , Linux-MM , Linux Kernel Mailing List , linux-fsdevel@vger.kernel.org Subject: Re: mount on tmpfs failing to parse context option Message-ID: <20191008012622.GP26530@ZenIV.linux.org.uk> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.12.1 (2019-06-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Oct 07, 2019 at 05:50:31PM -0700, Hugh Dickins wrote: [sorry for being MIA - had been sick through the last week, just digging myself from under piles of mail; my apologies] > (tmpfs, very tiresomely, supports a NUMA "mpol" mount option which can > have commas in it e.g "mpol=bind:0,2": which makes all its comma parsing > awkward. I assume that where the new mount API commits bend over to > accommodate that peculiarity, they end up mishandling the comma in > the context string above.) Dumber than that, I'm afraid. mpol is the reason for having ->parse_monolithic() in the first place, all right, but the problem is simply the lack of security_sb_eat_lsm_opts() call in it. Could you check if the following fixes that one? diff --git a/mm/shmem.c b/mm/shmem.c index 0f7fd4a85db6..8dcc8d04cbaf 100644 --- a/mm/shmem.c +++ b/mm/shmem.c @@ -3482,6 +3482,12 @@ static int shmem_parse_options(struct fs_context *fc, void *data) { char *options = data; + if (options) { + int err = security_sb_eat_lsm_opts(options, &fc->security); + if (err) + return err; + } + while (options != NULL) { char *this_char = options; for (;;) {