Received: by 10.213.65.68 with SMTP id h4csp2117505imn; Sun, 8 Apr 2018 20:08:32 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+tPdut2AtL14fdarnpH4qCv9HZHfw0qROO9isDe+wbnSPQR5EqyzaWB2OxveUkqEjBe0Oy X-Received: by 10.101.67.76 with SMTP id k12mr6341175pgq.39.1523243312815; Sun, 08 Apr 2018 20:08:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523243312; cv=none; d=google.com; s=arc-20160816; b=D4xVARfpTWu8Thw43qRYCO9E9/Nal65/+J5C9LmD3uGiFk2Lkyxk2uKBMedqPvpxAN xws0kDZlTSACSxpeKX2Jus93pbYhCtDUEb6mkflbnRVgOIG+PcNdD89jhC0NHHmNifWr s9O/0prRW1ObIoo0NOFzmR5ikUFu2kNfnel2VZ9xeg56EyDpznKUZqqauhTKMMyFDxdW depdrkHk/U/nDJoLaXbPG+QuCeR404q4Wrzw9LDrlUdR1i01o7I5ZODm1n+zO6/gCkCC as+Va9P46INisA3Et/X0wRRHvfuHu+FFXzI7g1bGjzYpW9gNToSoLX+yWrzmgQMdQ5pL 87bw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :spamdiagnosticmetadata:spamdiagnosticoutput:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=ncme75TnUWrFp40PTE+DVllzqVbosr7gxGo7cLxjhmY=; b=wIm2uxfcdQwPrM60512MXlNaUvtGtRhgHW35xBYutsMSV2lFtsowAyeScyj+Yo4SNz kXpP2ZegqBF6fV3zl7FGSEdlQUdkGddjO6zdMtUn9uxsC2m19TJ/JdjFCmtzbz1WV5aK sjWyTvMW7Kgx0fbiUryc6GwyxPB9MW8Qvqo6e8Zos3jCFMXG9e/Dkz/hf/OUirNiuDlz q4liRW5BnxsYgVeV4EJFvVRbFS6ElQqdcKO3sH1nBQl1bVXGQFyMhFktrqh31vGs/UG0 kpKTIU0Wv5ErJOVTSBldaL822ph/LAa5EnuTLun951RL61T1np2l7L3r2cPFw7QO0zrZ +4tA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=LT/bnem0; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 64-v6si15940306plf.627.2018.04.08.20.07.55; Sun, 08 Apr 2018 20:08:32 -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; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=LT/bnem0; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757668AbeDICEH (ORCPT + 99 others); Sun, 8 Apr 2018 22:04:07 -0400 Received: from mail-co1nam03on0101.outbound.protection.outlook.com ([104.47.40.101]:32931 "EHLO NAM03-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1756383AbeDIAcD (ORCPT ); Sun, 8 Apr 2018 20:32:03 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=ncme75TnUWrFp40PTE+DVllzqVbosr7gxGo7cLxjhmY=; b=LT/bnem0MpiUSN5ycXYmE94Djm+BckcyoIDeYKk3auGdxA2GCqE5ScTEUh0MwjYMF6tIy0h6lK1KctAvy15mz1K8tD4CvHCsQCBiDd5K8jYhQgUZNgkG7ABYSG8v4F9j/vlgRcw+uAMLX22t4NOPSnK9dIgii1QVd2BlFse3iWQ= Received: from DM5PR2101MB1032.namprd21.prod.outlook.com (52.132.128.13) by DM5PR2101MB1126.namprd21.prod.outlook.com (52.132.132.166) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.696.0; Mon, 9 Apr 2018 00:31:59 +0000 Received: from DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::8109:aef0:a777:7059]) by DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::8109:aef0:a777:7059%2]) with mapi id 15.20.0696.003; Mon, 9 Apr 2018 00:31:59 +0000 From: Sasha Levin To: "stable@vger.kernel.org" , "linux-kernel@vger.kernel.org" CC: "Luis R. Rodriguez" , Jessica Yu , Al Viro , Sasha Levin Subject: [PATCH AUTOSEL for 4.9 188/293] fs: warn in case userspace lied about modprobe return Thread-Topic: [PATCH AUTOSEL for 4.9 188/293] fs: warn in case userspace lied about modprobe return Thread-Index: AQHTz5k+eUfPN3Az6EK5dPqovdg1uA== Date: Mon, 9 Apr 2018 00:25:21 +0000 Message-ID: <20180409002239.163177-188-alexander.levin@microsoft.com> References: <20180409002239.163177-1-alexander.levin@microsoft.com> In-Reply-To: <20180409002239.163177-1-alexander.levin@microsoft.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [52.168.54.252] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;DM5PR2101MB1126;7:BR2EmWU2Husjn7th176OSNXYH12kHoQd9+2/jVw0BMnAwTn3roCXGpJx09BWQVnBIkL1T0AXOd8kJwT9Jf01GD54qEP+d5rf5I3Aw8dQBmkQkDNEmAV2yy+xcy/sNo9vNl4keTL0B43gxyxIa3M4VwMnQ/L5D42ewT7N+svVLGQJbASnZ1II1FaOXiJryxxJzwg0LNkXfpUmAl2WNCSogZyYmbY/3AjxE+Xr9AOsm7HmKqr21bzeXQ0xbQexeyq7;20:qsC1aC+J61CHhieudzrBIWAzpQByHPs3msTy0ZccoaJQTqCEGHfWm79v1FdvLOMpIlqoFzB3qvAQdZOspm+1QbgTD4igyly91IqhOfBiFcb8pr5nPXA5yecOg7jEPkdtjqdxMw8eeuUa1hWLojer45gwp7iUR6i2leSJKGYliLU= X-MS-Office365-Filtering-Correlation-Id: d09f7bfb-43db-4f89-514e-08d59db14e6d x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(4534165)(4627221)(201703031133081)(201702281549075)(5600026)(4604075)(3008032)(48565401081)(2017052603328)(7193020);SRVR:DM5PR2101MB1126; x-ms-traffictypediagnostic: DM5PR2101MB1126: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Alexander.Levin@microsoft.com; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(28532068793085)(89211679590171)(84791874153150)(46150409022019); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(8211001083)(61425038)(6040522)(2401047)(8121501046)(5005006)(3231221)(944501327)(52105095)(3002001)(93006095)(93001095)(10201501046)(6055026)(61426038)(61427038)(6041310)(20161123560045)(20161123564045)(20161123558120)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011);SRVR:DM5PR2101MB1126;BCL:0;PCL:0;RULEID:;SRVR:DM5PR2101MB1126; x-forefront-prvs: 0637FCE711 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(366004)(39380400002)(396003)(39860400002)(346002)(376002)(189003)(199004)(2616005)(476003)(81156014)(8676002)(81166006)(3846002)(486006)(2900100001)(6436002)(186003)(478600001)(72206003)(110136005)(54906003)(6306002)(2906002)(86612001)(6666003)(2501003)(26005)(10090500001)(102836004)(6512007)(6116002)(14454004)(966005)(5250100002)(10290500003)(1076002)(446003)(3280700002)(3660700001)(11346002)(8936002)(25786009)(59450400001)(6506007)(106356001)(4326008)(107886003)(36756003)(105586002)(53936002)(86362001)(66066001)(6486002)(99286004)(5660300001)(316002)(22452003)(305945005)(76176011)(97736004)(68736007)(7736002)(22906009)(217873001);DIR:OUT;SFP:1102;SCL:1;SRVR:DM5PR2101MB1126;H:DM5PR2101MB1032.namprd21.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: gmrushgs7GqUbF084R243TGDrqo8VrFwgG9hp8yUBW+PQiAQUFTiBv7PIIaqYlIb/ZA0Yy3GQ6nvb4nLXObLjByYlVKFkMZTzuyrvBlfnltafD0JrIfZ8JjOLe/ATm3VZYD+9mcndlbgfkuYV4rAmvMVuRafTp7BkdvwWmTck4tJ5ECJ/lfYN3aRgaI9cFoOPKYSQfKWE/fvCQ9e8aJ3ODsaGGkeuKNnoSqbC8Is5S8G9axVK+aqw8g9/QF0+3G0id4JnPbbjC5FJDl07MQVVu3QKC8XebzBsDp7/m89NAxoWXYbwpSl+CV+u+3C1AoQzodD1vI+6hVsGKrpHRB8sAkYPds76/RVCnqpn0A4xjMDkFI2p8HF8DVrEPObVWE8YVQeVFJ3aa9724bqeRHJ1cwqqE0whwMyXuSlhCmCpGQ= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: d09f7bfb-43db-4f89-514e-08d59db14e6d X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Apr 2018 00:25:21.1595 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR2101MB1126 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: "Luis R. Rodriguez" [ Upstream commit 41124db869b7e00e12052555f8987867ac01d70c ] kmod <=3D v19 was broken -- it could return 0 to modprobe calls, incorrectly assuming that a kernel module was built-in, whereas in reality the module was just forming in the kernel. The reason for this is an incorrect userspace heuristics. A userspace kmod fix is available for it [0], however should userspace break again we could go on with an failed get_fs_type() which is hard to debug as the request_module() is detected as returning 0. The first suspect would be that there is something worth with the kernel's module loader and obviously in this case that is not the issue. Since these issues are painful to debug complain when we know userspace has outright lied to us. [0] http://git.kernel.org/cgit/utils/kernel/kmod/kmod.git/commit/libkmod/li= bkmod-module.c?id=3Dfd44a98ae2eb5eb32161088954ab21e58e19dfc4 Suggested-by: Rusty Russell Cc: Jessica Yu Signed-off-by: Luis R. Rodriguez Signed-off-by: Al Viro Signed-off-by: Sasha Levin --- fs/filesystems.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/fs/filesystems.c b/fs/filesystems.c index c5618db110be..cd7ba6301a60 100644 --- a/fs/filesystems.c +++ b/fs/filesystems.c @@ -275,8 +275,10 @@ struct file_system_type *get_fs_type(const char *name) int len =3D dot ? dot - name : strlen(name); =20 fs =3D __get_fs_type(name, len); - if (!fs && (request_module("fs-%.*s", len, name) =3D=3D 0)) + if (!fs && (request_module("fs-%.*s", len, name) =3D=3D 0)) { fs =3D __get_fs_type(name, len); + WARN_ONCE(!fs, "request_module fs-%.*s succeeded, but still no fs?\n", l= en, name); + } =20 if (dot && fs && !(fs->fs_flags & FS_HAS_SUBTYPE)) { put_filesystem(fs); --=20 2.15.1