Received: by 2002:ab2:710b:0:b0:1ef:a325:1205 with SMTP id z11csp404300lql; Mon, 11 Mar 2024 06:25:55 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUvbNHmjwsCxpOg1dKwAvqsFf9a6u0tt5Jbg3ByvFAV5/hv7ITUJHQ0haNSt9uYwe3cV2YzUUZLryH91YOK+vamD9ZAOYnz2VAkq/vCug== X-Google-Smtp-Source: AGHT+IGX5oEESwuYbgQdTvfmtYWIsxo+x0ZY3i73q0T8EDcxa8ib32VizKq5WvBHFKkuFsGjTpeU X-Received: by 2002:a17:903:4283:b0:1d9:7ab0:5e20 with SMTP id ju3-20020a170903428300b001d97ab05e20mr6237864plb.69.1710163555189; Mon, 11 Mar 2024 06:25:55 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710163555; cv=pass; d=google.com; s=arc-20160816; b=smNWSYj3LWlsBS7HooTmFpUqJOyyCvxh7g7DgJ2walfSnznSPW+1NH3uVW1dN7XelR af/ODBzazbO5LNPCxrmmSybCOqZuIms+59olspztankhXvrkyMyhckqMMbdV6wRk6lzf 4JnTFtFAkV3cVxcM/8EdK7Sz5jTn2b0IgaysVoRb7EyhoBtSa1qvVqNv19tjB5tNqN2w AjXPXtUHLRaGSg5fQhm97mc039BcUrtM9eLn7PBE4uJMnWVp1eekvc7wolC0NpXrkm0U DiNSEBxazUPN6bod4MZwHGdGDEZN8HCTciLq8ZFjdI5Nzq1aP8es+sKwEM0rXug/bmVx PqwQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:references :in-reply-to:subject:cc:to:from:dkim-signature:dkim-signature :dkim-signature:dkim-signature; bh=CJbAerBqTbOOE1+wiI2WyrWukn4dJy5uIYJHUCts2AY=; fh=M+848ZYETQd9MP09iGRVRSjdEH8S3C/0FeViqeEClNQ=; b=Ma1z7uhzcphBfqtZaTGYT1q8NUe+RalGClVhmfYmnGquPL/7FwOgjYzkPbvYQC59N7 bmT5Tv3PwuDp11Ikx6fZrHKXcyjMJ/puNa2PODa3Nn0hiKDlQ6Za4oG5net3xMur4tmg VmnKR9L65L78iyy0KL7ctdupX7Zi2wlOygKesD5ChqKKicc+dYGwCVydkupuMLvAmNgb DC6YqThRkwpN92gQabFeL3SNYR0Df3m0ElvIY0inzwp/zIO1uK3A3k1NVkcGshl6VCX4 SkTfoMmtkZtJvuKpOIdW2P0TntC9WlR+sZ/cIaAeh1J0YBLgO6njH43joaPw9KH69VsY YA0w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=v5kj+ak5; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b="gPFBFEt/"; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; arc=pass (i=1 spf=pass spfdomain=suse.de dkim=pass dkdomain=suse.de dkim=pass dkdomain=suse.de dmarc=pass fromdomain=suse.de); spf=pass (google.com: domain of linux-ext4+bounces-1592-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-ext4+bounces-1592-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id d16-20020a170902ced000b001dca5fa8051si4735709plg.43.2024.03.11.06.25.54 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Mar 2024 06:25:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4+bounces-1592-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=v5kj+ak5; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b="gPFBFEt/"; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; arc=pass (i=1 spf=pass spfdomain=suse.de dkim=pass dkdomain=suse.de dkim=pass dkdomain=suse.de dmarc=pass fromdomain=suse.de); spf=pass (google.com: domain of linux-ext4+bounces-1592-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-ext4+bounces-1592-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id D3305281AFE for ; Mon, 11 Mar 2024 13:25:54 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8FDD53EA62; Mon, 11 Mar 2024 13:23:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="v5kj+ak5"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="XDy1K3kw"; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="gPFBFEt/"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="+81grTX6" X-Original-To: linux-ext4@vger.kernel.org Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 041C344C94; Mon, 11 Mar 2024 13:23:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710163416; cv=none; b=N0r2dt5Av87GbURdtddyGaAlT4JB+8exMPj7Fe3o1bUzjR9SZwv85ZAXtFlqVXx5Axx65LJSkYtXgspvHa5ERDgZhnABf07lj8GvkXaeXWafNmU78k28NrI29TCNLPKXdH/61uuEXhCuIQpCWHHMTNuW3/j4A/TUXCHsjtAHHfI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710163416; c=relaxed/simple; bh=brj7PcDebxzqy5h/4qUh9EuMYF6nl92kPq5iO4h0qlo=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=dKGFep3BKSMoEeQsciBH0XDl6i1p5t7E3T4h3pkHvbi7PDZxceFDoMU24fa1vdqgsSFayR6B6isk/Y9HQETDGw8TEzsQKeuPUGasuxpynFbvCqW+VHCB6AeaVBGIajE9KVXG5LTuvDtxAP42m2PI8L3ZmIFGiDOGeZfK0OOAuVo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de; spf=pass smtp.mailfrom=suse.de; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=v5kj+ak5; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=XDy1K3kw; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=gPFBFEt/; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=+81grTX6; arc=none smtp.client-ip=195.135.223.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.de Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [10.150.64.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 1B5095C6F9; Mon, 11 Mar 2024 13:23:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1710163412; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=CJbAerBqTbOOE1+wiI2WyrWukn4dJy5uIYJHUCts2AY=; b=v5kj+ak5ixoKhwkClCLxwWmQlsBerHX+GElP1+wVjkkTZwJ5DiQyEX79QIeg8xByZJTk2S r1Jn3x4O+piA8WeDQSURdSUMMGKahuBfIl5jO+aM1n64QQeWZ0cmy3NBpoDrFjW77/xFEW G5E1RPtFESZ9dleWttKaVxZeX0xB7x0= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1710163412; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=CJbAerBqTbOOE1+wiI2WyrWukn4dJy5uIYJHUCts2AY=; b=XDy1K3kwBLDjAjRAqdufyorJpTP1CEScUh+3UhLZfLp45DGZAT360LfDiBMSw/COKxkFa1 7bI7/iJgR9WxqOAA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1710163410; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=CJbAerBqTbOOE1+wiI2WyrWukn4dJy5uIYJHUCts2AY=; b=gPFBFEt/hhRUBNldPBe6CJkUyRAbwoNtDaTuoikTAtKSH7UTOHh2LIyyea01EwbrvBrgtR 9rHt0UqLPm6HB7WUl+Kndn/t1+6WRVvaQtjgpW1Zu4fCoctEcn1Gj+oqe1UA7bRZHtASwo 3H31eLj9QDP6bjr9cSRNHYSHuM44W8U= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1710163410; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=CJbAerBqTbOOE1+wiI2WyrWukn4dJy5uIYJHUCts2AY=; b=+81grTX6TA27Urm9RoHwlcpr4VPQeFv/2t4x24NL5id9ej1P7CGqVXNtcQwhky7UBUyRaB UPbWI/lNaLlXwnBg== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 4FDD113695; Mon, 11 Mar 2024 13:23:29 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id d50qENEF72UxVgAAD6G6ig (envelope-from ); Mon, 11 Mar 2024 13:23:29 +0000 Received: from localhost (brahms.olymp [local]) by brahms.olymp (OpenSMTPD) with ESMTPA id 8b1d090d; Mon, 11 Mar 2024 13:23:25 +0000 (UTC) From: Luis Henriques To: Miklos Szeredi Cc: "Theodore Ts'o" , Andreas Dilger , Alexander Viro , Christian Brauner , Jan Kara , Amir Goldstein , linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-unionfs@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 3/3] ovl: fix the parsing of empty string mount parameters In-Reply-To: (Miklos Szeredi's message of "Mon, 11 Mar 2024 11:53:03 +0100") References: <20240307160225.23841-1-lhenriques@suse.de> <20240307160225.23841-4-lhenriques@suse.de> <87le6p6oqe.fsf@suse.de> Date: Mon, 11 Mar 2024 13:23:25 +0000 Message-ID: <87cys0x5pu.fsf@suse.de> Precedence: bulk X-Mailing-List: linux-ext4@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Level: Authentication-Results: smtp-out2.suse.de; none X-Spamd-Result: default: False [-3.10 / 50.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; URIBL_BLOCKED(0.00)[suse.de:email,szeredi.hu:email]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; FREEMAIL_ENVRCPT(0.00)[gmail.com]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; RCVD_COUNT_THREE(0.00)[4]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; RCPT_COUNT_SEVEN(0.00)[11]; DBL_BLOCKED_OPENRESOLVER(0.00)[szeredi.hu:email,suse.de:email]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_LAST(0.00)[]; FREEMAIL_CC(0.00)[mit.edu,dilger.ca,zeniv.linux.org.uk,kernel.org,suse.cz,gmail.com,vger.kernel.org]; MID_RHS_MATCH_FROM(0.00)[]; BAYES_HAM(-3.00)[100.00%] X-Spam-Score: -3.10 X-Spam-Flag: NO Miklos Szeredi writes: > On Mon, 11 Mar 2024 at 11:34, Luis Henriques wrote: >> >> Miklos Szeredi writes: >> >> > On Thu, 7 Mar 2024 at 19:17, Luis Henriques wrote: >> >> >> >> This patch fixes the usage of mount parameters that are defined as st= rings >> >> but which can be empty. Currently, only 'lowerdir' parameter is in t= his >> >> situation for overlayfs. But since userspace can pass it in as 'flag' >> >> type (when it doesn't have a value), the parsing will fail because a >> >> 'string' type is assumed. >> > >> > I don't really get why allowing a flag value instead of an empty >> > string value is fixing anything. >> > >> > It just makes the API more liberal, but for what gain? >> >> The point is that userspace may be passing this parameter as a flag and >> not as a string. I came across this issue with ext4, by doing something >> as simple as: >> >> mount -t ext4 -o usrjquota=3D /dev/sda1 /mnt/ >> >> (actually, the trigger was fstest ext4/053) >> >> The above mount should succeed. But it fails because 'usrjquota' is set >> to a 'flag' type, not 'string'. > > The above looks like a misparsing, since the equals sign clearly > indicates that this is not a flag. No, not really. The same thing happens without the '=3D': mount -t ext4 -o usrjquota /dev/loop0p1 /mnt/=20 mount: /mnt: wrong fs type, bad option, bad superblock on /dev/loop0p1, mis= sing codepage or helper program, or other error. dmesg(1) may have more information after failed mount system call. The parsing code gets a FSCONFIG_SET_FLAG instead of FSCONFIG_SET_STRING. >> Note that I couldn't find a way to reproduce the same issue in overlayfs >> with this 'lowerdir' parameter. But looking at the code the issue is >> similar. > > In overlayfs the empty lowerdir parameter has a special meaning when > lowerdirs are appended instead of parsed in one go. As such it won't > be used from /etc/fstab for example, as that would just result in a > failed mount. > > I don't see a reason to allow it as a flag for overlayfs, since that > just add ambiguity to the API. Fine with me. But it'd be nice to double-check (by testing) that when overlayfs gets a 'lowerdir' without a value it really is doing what you'd expect it to do. Cheers, --=20 Lu=C3=ADs