From c49a7adad04a349bf4d428fdef75416293c9d779 Mon Sep 17 00:00:00 2001 From: Jan200101 Date: Sat, 26 Sep 2020 20:55:07 +0200 Subject: kernel 5.8.11 --- ...re-a-specific-error-code-in-bdev_del_part.patch | 38 ---- SOURCES/pdx86-SW_TABLET_MODE-fixes.patch | 212 +++++++++++++++++++++ ...Fix-security-label-length-not-being-reset.patch | 150 +++++++++++++++ 3 files changed, 362 insertions(+), 38 deletions(-) delete mode 100644 SOURCES/block-restore-a-specific-error-code-in-bdev_del_part.patch create mode 100644 SOURCES/pdx86-SW_TABLET_MODE-fixes.patch create mode 100644 SOURCES/v2-nfs-Fix-security-label-length-not-being-reset.patch (limited to 'SOURCES') diff --git a/SOURCES/block-restore-a-specific-error-code-in-bdev_del_part.patch b/SOURCES/block-restore-a-specific-error-code-in-bdev_del_part.patch deleted file mode 100644 index 476eb1a..0000000 --- a/SOURCES/block-restore-a-specific-error-code-in-bdev_del_part.patch +++ /dev/null @@ -1,38 +0,0 @@ -From 10b34a18180269103dafc68f1a4257ae61c87415 Mon Sep 17 00:00:00 2001 -From: Sasha Levin -Date: Tue, 8 Sep 2020 16:15:06 +0200 -Subject: block: restore a specific error code in bdev_del_partition - -From: Christoph Hellwig - -[ Upstream commit 88ce2a530cc9865a894454b2e40eba5957a60e1a ] - -mdadm relies on the fact that deleting an invalid partition returns --ENXIO or -ENOTTY to detect if a block device is a partition or a -whole device. - -Fixes: 08fc1ab6d748 ("block: fix locking in bdev_del_partition") -Reported-by: kernel test robot -Signed-off-by: Christoph Hellwig -Signed-off-by: Jens Axboe -Signed-off-by: Sasha Levin ---- - block/partitions/core.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/block/partitions/core.c b/block/partitions/core.c -index 534e11285a8d4..b45539764c994 100644 ---- a/block/partitions/core.c -+++ b/block/partitions/core.c -@@ -529,7 +529,7 @@ int bdev_del_partition(struct block_device *bdev, int partno) - - bdevp = bdget_disk(bdev->bd_disk, partno); - if (!bdevp) -- return -ENOMEM; -+ return -ENXIO; - - mutex_lock(&bdevp->bd_mutex); - mutex_lock_nested(&bdev->bd_mutex, 1); --- -2.25.1 - diff --git a/SOURCES/pdx86-SW_TABLET_MODE-fixes.patch b/SOURCES/pdx86-SW_TABLET_MODE-fixes.patch new file mode 100644 index 0000000..3fa9f84 --- /dev/null +++ b/SOURCES/pdx86-SW_TABLET_MODE-fixes.patch @@ -0,0 +1,212 @@ +From 9126d28cf4e537ef5e77006c51b1a24ad8e8170b Mon Sep 17 00:00:00 2001 +From: Hans de Goede +Date: Fri, 11 Sep 2020 13:34:42 +0200 +Subject: [PATCH 1/2] platform/x86: intel-vbtn: Fix SW_TABLET_MODE always + reporting 1 on the HP Pavilion 11 x360 + +Commit cfae58ed681c ("platform/x86: intel-vbtn: Only blacklist +SW_TABLET_MODE on the 9 / "Laptop" chasis-type") restored SW_TABLET_MODE +reporting on the HP stream x360 11 series on which it was previously broken +by commit de9647efeaa9 ("platform/x86: intel-vbtn: Only activate tablet +mode switch on 2-in-1's"). + +It turns out that enabling SW_TABLET_MODE reporting on devices with a +chassis-type of 10 ("Notebook") causes SW_TABLET_MODE to always report 1 +at boot on the HP Pavilion 11 x360, which causes libinput to disable the +kbd and touchpad. + +The HP Pavilion 11 x360's ACPI VGBS method sets bit 4 instead of bit 6 when +NOT in tablet mode at boot. Inspecting all the DSDTs in my DSDT collection +shows only one other model, the Medion E1239T ever setting bit 4 and it +always sets this together with bit 6. + +So lets treat bit 4 as a second bit which when set indicates the device not +being in tablet-mode, as we already do for bit 6. + +While at it also prefix all VGBS constant defines with "VGBS_". + +Fixes: cfae58ed681c ("platform/x86: intel-vbtn: Only blacklist SW_TABLET_MODE on the 9 / "Laptop" chasis-type") +Signed-off-by: Hans de Goede +--- + drivers/platform/x86/intel-vbtn.c | 12 ++++++++---- + 1 file changed, 8 insertions(+), 4 deletions(-) + +diff --git a/drivers/platform/x86/intel-vbtn.c b/drivers/platform/x86/intel-vbtn.c +index e85d8e58320c..f443619e1e7e 100644 +--- a/drivers/platform/x86/intel-vbtn.c ++++ b/drivers/platform/x86/intel-vbtn.c +@@ -15,9 +15,13 @@ + #include + #include + ++/* Returned when NOT in tablet mode on some HP Stream x360 11 models */ ++#define VGBS_TABLET_MODE_FLAG_ALT 0x10 + /* When NOT in tablet mode, VGBS returns with the flag 0x40 */ +-#define TABLET_MODE_FLAG 0x40 +-#define DOCK_MODE_FLAG 0x80 ++#define VGBS_TABLET_MODE_FLAG 0x40 ++#define VGBS_DOCK_MODE_FLAG 0x80 ++ ++#define VGBS_TABLET_MODE_FLAGS (VGBS_TABLET_MODE_FLAG | VGBS_TABLET_MODE_FLAG_ALT) + + MODULE_LICENSE("GPL"); + MODULE_AUTHOR("AceLan Kao"); +@@ -72,9 +76,9 @@ static void detect_tablet_mode(struct platform_device *device) + if (ACPI_FAILURE(status)) + return; + +- m = !(vgbs & TABLET_MODE_FLAG); ++ m = !(vgbs & VGBS_TABLET_MODE_FLAGS); + input_report_switch(priv->input_dev, SW_TABLET_MODE, m); +- m = (vgbs & DOCK_MODE_FLAG) ? 1 : 0; ++ m = (vgbs & VGBS_DOCK_MODE_FLAG) ? 1 : 0; + input_report_switch(priv->input_dev, SW_DOCK, m); + } + +-- +2.28.0 + +From d26d82852e926fee13b5fa71cc004da391aaa5e3 Mon Sep 17 00:00:00 2001 +From: Hans de Goede +Date: Wed, 16 Sep 2020 16:14:39 +0200 +Subject: [PATCH 2/2] platform/x86: asus-wmi: Fix SW_TABLET_MODE always + reporting 1 on many different models +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Commit b0dbd97de1f1 ("platform/x86: asus-wmi: Add support for +SW_TABLET_MODE") added support for reporting SW_TABLET_MODE using the +Asus 0x00120063 WMI-device-id to see if various transformer models were +docked into their keyboard-dock (SW_TABLET_MODE=0) or if they were +being used as a tablet. + +The new SW_TABLET_MODE support (naively?) assumed that non Transformer +devices would either not support the 0x00120063 WMI-device-id at all, +or would NOT set ASUS_WMI_DSTS_PRESENCE_BIT in their reply when querying +the device-id. + +Unfortunately this is not true and we have received many bug reports about +this change causing the asus-wmi driver to always report SW_TABLET_MODE=1 +on non Transformer devices. This causes libinput to think that these are +360 degree hinges style 2-in-1s folded into tablet-mode. Making libinput +suppress keyboard and touchpad events from the builtin keyboard and +touchpad. So effectively this causes the keyboard and touchpad to not work +on many non Transformer Asus models. + +This commit fixes this by using the existing DMI based quirk mechanism in +asus-nb-wmi.c to allow using the 0x00120063 device-id for reporting +SW_TABLET_MODE on Transformer models and ignoring it on all other models. + +Fixes: b0dbd97de1f1 ("platform/x86: asus-wmi: Add support for SW_TABLET_MODE") +BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=209011 +BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=1875339 +BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=1875828 +BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=1876997 +Reported-by: Samuel Čavoj +Signed-off-by: Hans de Goede +--- + drivers/platform/x86/asus-nb-wmi.c | 32 ++++++++++++++++++++++++++++++ + drivers/platform/x86/asus-wmi.c | 16 ++++++++------- + drivers/platform/x86/asus-wmi.h | 1 + + 3 files changed, 42 insertions(+), 7 deletions(-) + +diff --git a/drivers/platform/x86/asus-nb-wmi.c b/drivers/platform/x86/asus-nb-wmi.c +index 680c3640e013..1d9fbabd02fb 100644 +--- a/drivers/platform/x86/asus-nb-wmi.c ++++ b/drivers/platform/x86/asus-nb-wmi.c +@@ -115,6 +115,10 @@ static struct quirk_entry quirk_asus_vendor_backlight = { + .wmi_backlight_set_devstate = true, + }; + ++static struct quirk_entry quirk_asus_use_kbd_dock_devid = { ++ .use_kbd_dock_devid = true, ++}; ++ + static int dmi_matched(const struct dmi_system_id *dmi) + { + pr_info("Identified laptop model '%s'\n", dmi->ident); +@@ -488,6 +492,34 @@ static const struct dmi_system_id asus_quirks[] = { + }, + .driver_data = &quirk_asus_ga502i, + }, ++ { ++ .callback = dmi_matched, ++ .ident = "Asus Transformer T100TA / T100HA / T100CHI", ++ .matches = { ++ DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."), ++ /* Match *T100* */ ++ DMI_MATCH(DMI_PRODUCT_NAME, "T100"), ++ }, ++ .driver_data = &quirk_asus_use_kbd_dock_devid, ++ }, ++ { ++ .callback = dmi_matched, ++ .ident = "Asus Transformer T101HA", ++ .matches = { ++ DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."), ++ DMI_MATCH(DMI_PRODUCT_NAME, "T101HA"), ++ }, ++ .driver_data = &quirk_asus_use_kbd_dock_devid, ++ }, ++ { ++ .callback = dmi_matched, ++ .ident = "Asus Transformer T200TA", ++ .matches = { ++ DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."), ++ DMI_MATCH(DMI_PRODUCT_NAME, "T200TA"), ++ }, ++ .driver_data = &quirk_asus_use_kbd_dock_devid, ++ }, + {}, + }; + +diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c +index 8f4acdc06b13..ae6289d37faf 100644 +--- a/drivers/platform/x86/asus-wmi.c ++++ b/drivers/platform/x86/asus-wmi.c +@@ -365,12 +365,14 @@ static int asus_wmi_input_init(struct asus_wmi *asus) + if (err) + goto err_free_dev; + +- result = asus_wmi_get_devstate_simple(asus, ASUS_WMI_DEVID_KBD_DOCK); +- if (result >= 0) { +- input_set_capability(asus->inputdev, EV_SW, SW_TABLET_MODE); +- input_report_switch(asus->inputdev, SW_TABLET_MODE, !result); +- } else if (result != -ENODEV) { +- pr_err("Error checking for keyboard-dock: %d\n", result); ++ if (asus->driver->quirks->use_kbd_dock_devid) { ++ result = asus_wmi_get_devstate_simple(asus, ASUS_WMI_DEVID_KBD_DOCK); ++ if (result >= 0) { ++ input_set_capability(asus->inputdev, EV_SW, SW_TABLET_MODE); ++ input_report_switch(asus->inputdev, SW_TABLET_MODE, !result); ++ } else if (result != -ENODEV) { ++ pr_err("Error checking for keyboard-dock: %d\n", result); ++ } + } + + err = input_register_device(asus->inputdev); +@@ -2114,7 +2116,7 @@ static void asus_wmi_handle_event_code(int code, struct asus_wmi *asus) + return; + } + +- if (code == NOTIFY_KBD_DOCK_CHANGE) { ++ if (asus->driver->quirks->use_kbd_dock_devid && code == NOTIFY_KBD_DOCK_CHANGE) { + result = asus_wmi_get_devstate_simple(asus, + ASUS_WMI_DEVID_KBD_DOCK); + if (result >= 0) { +diff --git a/drivers/platform/x86/asus-wmi.h b/drivers/platform/x86/asus-wmi.h +index 4f31b68642a0..1a95c172f94b 100644 +--- a/drivers/platform/x86/asus-wmi.h ++++ b/drivers/platform/x86/asus-wmi.h +@@ -33,6 +33,7 @@ struct quirk_entry { + bool wmi_backlight_native; + bool wmi_backlight_set_devstate; + bool wmi_force_als_set; ++ bool use_kbd_dock_devid; + int wapf; + /* + * For machines with AMD graphic chips, it will send out WMI event +-- +2.28.0 + diff --git a/SOURCES/v2-nfs-Fix-security-label-length-not-being-reset.patch b/SOURCES/v2-nfs-Fix-security-label-length-not-being-reset.patch new file mode 100644 index 0000000..60f61c3 --- /dev/null +++ b/SOURCES/v2-nfs-Fix-security-label-length-not-being-reset.patch @@ -0,0 +1,150 @@ +From patchwork Tue Sep 15 21:42:52 2020 +Content-Type: text/plain; charset="utf-8" +MIME-Version: 1.0 +Content-Transfer-Encoding: 7bit +X-Patchwork-Submitter: Jeffrey Mitchell +X-Patchwork-Id: 11777881 +Return-Path: +Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org + [172.30.200.123]) + by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9BEEA618 + for ; + Tue, 15 Sep 2020 21:44:46 +0000 (UTC) +Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) + by mail.kernel.org (Postfix) with ESMTP id 600CF20731 + for ; + Tue, 15 Sep 2020 21:44:46 +0000 (UTC) +Authentication-Results: mail.kernel.org; + dkim=pass (1024-bit key) header.d=starlab.io header.i=@starlab.io + header.b="aJuHPsEZ" +Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand + id S1728066AbgIOVoW (ORCPT + ); + Tue, 15 Sep 2020 17:44:22 -0400 +Received: from mail-dm3gcc02on2104.outbound.protection.outlook.com + ([40.107.91.104]:22176 + "EHLO GCC02-DM3-obe.outbound.protection.outlook.com" + rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP + id S1727845AbgIOVnq (ORCPT ); + Tue, 15 Sep 2020 17:43:46 -0400 +ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; + b=gP59+M9kP3ZEQtpnFruwMJTxipkpx5mXy/SAn2tLXN3JL4qzMJ1ovTpHbiAiF/nRgN+JWCDnMI8WCCcRMUXjnFduBiNpgILfXKaDFIuooiqrtNQxzbDEq+ZXqd/6dyBNj6iD6CmIZdrBoo6eEZJhIR2gVWzt1Zu1x2I8WkY2+RjJDlgZrfvNwRcw/4U3TdF97r5ksdewF0BlNby6ZExrsumudCVvW+WO8hM/di5362QOMxgKtlaqtFHQX4/sqqgAZs6qXS1WZMpGBjKNYO3kZhTdRl0X06MFZ2UnBUMt/P9Vh4IpyS3dUHF9DQWGbOXmF9OR97gJSP4UYP6Vo+NIvg== +ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; + s=arcselector9901; + h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; + bh=5XTZZ/aS36tpTnR5M4LBDQk4eW6LhdJERW6/8ZQBdjg=; + b=AEMkmqRUg3UZV5ehyVTDA4QkihRZ0LrGTYP4+eEdl+HOkLUjAoN3uBVLLoJlH2fPtc1OtuPBOe6RA6OE3dr3FKkRGBU86TJAfPr8Mr8nkNHkKcK2wXE2uMFPinGFNIq8DVH2P5c8qKxMSe/e48ddMFm/cKT/T6YCQHAtxWOBQSrZM9Gm3Dci1Vc6xbAceeaIrV7uqIAt+aSmcu7+HnZT3PDT1IsxxgdT5xexteAv8RKROzjmpwlzYCMuMeLNN2zV7TMVCaqZUkMQEe6MjAsvnvQ4erXTZ1441TMna1uCIsttHHrkV3rb9UABF9g5P5ffrbNzUXeKwEMYjUjUFq6SXg== +ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass + smtp.mailfrom=starlab.io; dmarc=pass action=none header.from=starlab.io; + dkim=pass header.d=starlab.io; arc=none +DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=starlab.io; + s=selector2; + h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; + bh=5XTZZ/aS36tpTnR5M4LBDQk4eW6LhdJERW6/8ZQBdjg=; + b=aJuHPsEZcvYEP98mtq2JKo/LbYpT9T2mpgQahKfEPFXnrB3ajaaj7edTDPFd88SsdHU/wC7pVNVj0g8Ybc9hBn483uen/K+fV2fNe2IiND7jJO/8+jusNVQEVcBbNcaGNFA1idd4Us3/7XC9AqnJ7uKjYcLlkpDC5MooQ2ALKLA= +Authentication-Results: starlab.io; dkim=none (message not signed) + header.d=none;starlab.io; dmarc=none action=none header.from=starlab.io; +Received: from SA9PR09MB5246.namprd09.prod.outlook.com (2603:10b6:806:4b::9) + by SA9PR09MB5376.namprd09.prod.outlook.com (2603:10b6:806:44::20) with + Microsoft SMTP Server (version=TLS1_2, + cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3370.16; Tue, 15 Sep + 2020 21:43:23 +0000 +Received: from SA9PR09MB5246.namprd09.prod.outlook.com + ([fe80::e90f:c1b7:2964:d2ac]) by SA9PR09MB5246.namprd09.prod.outlook.com + ([fe80::e90f:c1b7:2964:d2ac%7]) with mapi id 15.20.3370.019; Tue, 15 Sep 2020 + 21:43:23 +0000 +From: Jeffrey Mitchell +To: Trond Myklebust , + Anna Schumaker , + "J . Bruce Fields" +Cc: linux-nfs@vger.kernel.org, linux-kernel@vger.kernel.org, + Jeffrey Mitchell +Subject: [PATCH v2] nfs: Fix security label length not being reset +Date: Tue, 15 Sep 2020 16:42:52 -0500 +Message-Id: <20200915214252.262881-1-jeffrey.mitchell@starlab.io> +X-Mailer: git-send-email 2.25.1 +In-Reply-To: <20200914154958.55451-1-jeffrey.mitchell@starlab.io> +References: <20200914154958.55451-1-jeffrey.mitchell@starlab.io> +X-ClientProxiedBy: SN4PR0701CA0023.namprd07.prod.outlook.com + (2603:10b6:803:28::33) To SA9PR09MB5246.namprd09.prod.outlook.com + (2603:10b6:806:4b::9) +MIME-Version: 1.0 +X-MS-Exchange-MessageSentRepresentingType: 1 +Received: from jeffrey-work-20 (75.1.70.238) by + SN4PR0701CA0023.namprd07.prod.outlook.com (2603:10b6:803:28::33) with + Microsoft SMTP Server (version=TLS1_2, + cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3370.16 via Frontend + Transport; Tue, 15 Sep 2020 21:43:22 +0000 +X-Mailer: git-send-email 2.25.1 +X-Originating-IP: [75.1.70.238] +X-MS-PublicTrafficType: Email +X-MS-Office365-Filtering-Correlation-Id: f6b6cbb7-73d3-494f-9182-08d859c05e6a +X-MS-TrafficTypeDiagnostic: SA9PR09MB5376: +X-MS-Exchange-Transport-Forked: True +X-Microsoft-Antispam-PRVS: + +X-MS-Oob-TLC-OOBClassifiers: OLM:9508; +X-MS-Exchange-SenderADCheck: 1 +X-Microsoft-Antispam: BCL:0; +X-Microsoft-Antispam-Message-Info: + ve0rVm2dgAEEJAHk636eMFSzbaG54N1EjudpqWLYW0DylXWpm1XPdYOKGIJ7OQAUpYFiKRVvvCCHJyBpHbHzGKC4nG5t9P4JC8cVt7aPrOwpeaPSxWzUaFp0k9bOYDPZUOJ8XLYLs7IY1pk2rtYoLLTdDcfG5Kzzo2J3bIaePbV3MKzQ0UsODbgcJZlEpmQscx6xeqDlu+uG1mYjrtw5UiZLSQAD5lbkudMm2EmmZLEYqmYHzwFZpOujih7ONUEwBPmwH3cgEdqhdth5H9fRA5RelGwfRwMIn7uLA+/xqi7XnIvhkfvfdF/IyPz3eBCA +X-Forefront-Antispam-Report: + CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SA9PR09MB5246.namprd09.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(396003)(39830400003)(346002)(136003)(376002)(366004)(16526019)(186003)(107886003)(4326008)(8676002)(8936002)(36756003)(6496006)(66946007)(2906002)(15650500001)(52116002)(66556008)(66476007)(316002)(6666004)(86362001)(26005)(5660300002)(1076003)(44832011)(83380400001)(478600001)(2616005)(110136005)(956004)(6486002);DIR:OUT;SFP:1102; +X-MS-Exchange-AntiSpam-MessageData: + q4wBhvrjMzSF6Plz5Ht6sf9Uu69ig8LJutAd8jEyaoRDqKTewYyNQQYzV/bQE3XEV4LlM1hb3ypXtn2UD9kZ/IWTmgpl/Y1MFe+L1ElTHVh//V3w7gSJ81b08ickMgWfthsYiUVGueTLp5bDY8dzcUXctkSBIycLijlMk9+jcS/InJxM/w8oiMk/mNtfX7EFuhtrsvQyWRN5ixKH/jgHOhkH7+r8SK5ywKJUxitBRQHXKyBbJ9wi7nEbTIzYCW4WKtrnhYoNWNvKgjBUWA0LPrhxeO1sXAk5oq+Vuw0Oo4uzI4RtN84ucfhZCYEh5tbZXN7/hZ7VucAojcwKizYByZwF9Y7Tms+Qu6o+0mYEg8rv3674tDIbW55gvLpoClnMmUgAKEzNg3gEgaTkoYgW2ASPlIsKNy1rO+ukeMT7BSsbPQRBapQYtCSIs/TsmQcBp2XuuNqtXEhKJNwc+yV3tT3/D7hfCg9JfhdCwpS03f5o4OZPzwW+O0EF3E4KpZkQ81iTRmt6v5H+6f57VRofr6IckSvmbX+Mwbis7sXKBegIgGp8/a87r847npRq68Rao6ZDV+Z7R7M5FYP/bzJZOIWJmmn8EIoY/0as0nZmCFPxewig4O+RKwxixWqNxIYAEZZWR96si8n53nHTsMOJHQ== +X-OriginatorOrg: starlab.io +X-MS-Exchange-CrossTenant-Network-Message-Id: + f6b6cbb7-73d3-494f-9182-08d859c05e6a +X-MS-Exchange-CrossTenant-AuthSource: SA9PR09MB5246.namprd09.prod.outlook.com +X-MS-Exchange-CrossTenant-AuthAs: Internal +X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Sep 2020 21:43:22.8388 + (UTC) +X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted +X-MS-Exchange-CrossTenant-Id: 5e611933-986f-4838-a403-4acb432ce224 +X-MS-Exchange-CrossTenant-MailboxType: HOSTED +X-MS-Exchange-CrossTenant-UserPrincipalName: + chYVMMkYAvfiR0om1oU7hkRD1vHWk8vWKpUFgxhDUxbYALnkAu4ki99P8nO5pZmG5IsEx33nXgcNyg9tcTPVyxPI/upgYllWlX/Q0iCwT6Q= +X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA9PR09MB5376 +Sender: linux-nfs-owner@vger.kernel.org +Precedence: bulk +List-ID: +X-Mailing-List: linux-nfs@vger.kernel.org + +nfs_readdir_page_filler() iterates over entries in a directory, reusing +the same security label buffer, but does not reset the buffer's length. +This causes decode_attr_security_label() to return -ERANGE if an entry's +security label is longer than the previous one's. This error, in +nfs4_decode_dirent(), only gets passed up as -EAGAIN, which causes another +failed attempt to copy into the buffer. The second error is ignored and +the remaining entries do not show up in ls, specifically the getdents64() +syscall. + +Reproduce by creating multiple files in NFS and giving one of the later +files a longer security label. ls will not see that file nor any that are +added afterwards, though they will exist on the backend. + +In nfs_readdir_page_filler(), reset security label buffer length before +every reuse + +Signed-off-by: Jeffrey Mitchell +--- +v2: Added explanation from cover letter as requested by J. Bruce Fields + + + fs/nfs/dir.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c +index e732580fe47b..cb52db9a0cfb 100644 +--- a/fs/nfs/dir.c ++++ b/fs/nfs/dir.c +@@ -579,6 +579,9 @@ int nfs_readdir_page_filler(nfs_readdir_descriptor_t *desc, struct nfs_entry *en + xdr_set_scratch_buffer(&stream, page_address(scratch), PAGE_SIZE); + + do { ++ if (entry->label) ++ entry->label->len = NFS4_MAXLABELLEN; ++ + status = xdr_decode(desc, entry, &stream); + if (status != 0) { + if (status == -EAGAIN) -- cgit v1.2.3