Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp882281pxb; Tue, 3 Nov 2020 15:26:06 -0800 (PST) X-Google-Smtp-Source: ABdhPJx++Ujg7YAa4VyXmNQ0iKq7ZcEYz/S8lwu6vkquKEe7P+5K/PJHeGUiLabNqbZFtqNGSfNA X-Received: by 2002:a17:906:9513:: with SMTP id u19mr12541989ejx.350.1604445966730; Tue, 03 Nov 2020 15:26:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604445966; cv=none; d=google.com; s=arc-20160816; b=Yi/2S/kiA9ixFQqrc0eeRQmNbCtASZVnnm4xQimTPGkBgDj7/aveFPqzLyRxTL0oLo cOOXuyy558GFLs5k2K8aPUjxehHDwh44+XxoCDavazUPQNp7PwE02mW9yfA44Wokm1nR ysKTviIlyg7HeRSSjuba4omYIvNmkkx3abqE22KLTTDKXgEMSRxWZl9kWfi03j7XnyQM KoJJaBlZKZKDH6qD/zJc152XEbxXL9N19u6+UxUxLo9fnyVte4NkHMjHLLDabWQOZ5Q9 efBQGrVuISY+sAwk2GFfocaBm3sZP3xvAquqorzW7Sl35iRN3Lj80E2xvE73hnlL+Alv KHmw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=4EeWVKrgKe025myVUCw43b99xARSw/n1nAsoL7mHH1A=; b=HWpN1NmUX/+DsQ6DaowQNvmq9CFMqCn1QeeTOWGcmoL1+S+8RrXpU443DA2oy4LhUS xl1kJfShqK9wCdwKeXSNKEVxi/OmvgrNhqSsK4/3DRFayZ3V5i4z0WImIhFN2IBPAxl7 +LD90eaxQ8k+5ZXZH0lE4+pQvFLOJPeJPzP/gVjhW4keU4KXPvm/jTbzhWJi2mTmeFQp Y3z0iv91uKOMhqN2URMrEjyRhduP8JgfFIMq5QCROvHPumUZxx3Z6HVRGeVGspcV7Gdg Bf12d7AofakJhbId4qF6JXQ9Ei9mV2bNRj8Jb2Z4GOdOHqHesREhuwwjOUx42VWZfdTN ETaA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=azz92gHu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r26si264538ejb.420.2020.11.03.15.25.43; Tue, 03 Nov 2020 15:26:06 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=azz92gHu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388445AbgKCVSg (ORCPT + 99 others); Tue, 3 Nov 2020 16:18:36 -0500 Received: from mail.kernel.org ([198.145.29.99]:49224 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388466AbgKCVJQ (ORCPT ); Tue, 3 Nov 2020 16:09:16 -0500 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id AF0F7205ED; Tue, 3 Nov 2020 21:09:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1604437756; bh=nqUWH7qrzBm7yLCgxxq27EhWc7fb88HHtfPF7aPKomU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=azz92gHuxKUZTJrZQUSkBASZsfaNL3WBliowRD7kCgi7tAm78YWFju3XqvMVPaZOk mmsacQGpygIon9bdYPYIeSYsjMeTqaJbQTl7DTWwWWGeARn19kLEtp1YlZMIDpgOuh GaRawAa2YqFI9PHI53Hm7etaa+Jf7CJ4T8KxQxd4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Michael Schaller , Ard Biesheuvel , dann frazier Subject: [PATCH 4.14 003/125] efivarfs: Replace invalid slashes with exclamation marks in dentries. Date: Tue, 3 Nov 2020 21:36:20 +0100 Message-Id: <20201103203156.913655523@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201103203156.372184213@linuxfoundation.org> References: <20201103203156.372184213@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Michael Schaller commit 336af6a4686d885a067ecea8c3c3dd129ba4fc75 upstream. Without this patch efivarfs_alloc_dentry creates dentries with slashes in their name if the respective EFI variable has slashes in its name. This in turn causes EIO on getdents64, which prevents a complete directory listing of /sys/firmware/efi/efivars/. This patch replaces the invalid shlashes with exclamation marks like kobject_set_name_vargs does for /sys/firmware/efi/vars/ to have consistently named dentries under /sys/firmware/efi/vars/ and /sys/firmware/efi/efivars/. Signed-off-by: Michael Schaller Link: https://lore.kernel.org/r/20200925074502.150448-1-misch@google.com Signed-off-by: Ard Biesheuvel Signed-off-by: dann frazier Signed-off-by: Greg Kroah-Hartman --- fs/efivarfs/super.c | 3 +++ 1 file changed, 3 insertions(+) --- a/fs/efivarfs/super.c +++ b/fs/efivarfs/super.c @@ -145,6 +145,9 @@ static int efivarfs_callback(efi_char16_ name[len + EFI_VARIABLE_GUID_LEN+1] = '\0'; + /* replace invalid slashes like kobject_set_name_vargs does for /sys/firmware/efi/vars. */ + strreplace(name, '/', '!'); + inode = efivarfs_get_inode(sb, d_inode(root), S_IFREG | 0644, 0, is_removable); if (!inode)