Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp2980891pxb; Sun, 29 Aug 2021 09:20:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwTGvCeurxbevQUdERBRvpmdGC8WZnH3NFnEQl6SmbDzXpehqWP1IYZAiTSNad6H9ugwJeU X-Received: by 2002:a05:6402:45:: with SMTP id f5mr488091edu.68.1630254011338; Sun, 29 Aug 2021 09:20:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630254011; cv=none; d=google.com; s=arc-20160816; b=jR5ICzlS4FTQgBKEzZemmt051vepu611qFOq9+O42iTJeFyJwFIYD6/fO4EQeVEHfl K0srsmBL1VfVLUOA+i/6AKywpm4WX8dqGD5UjZuoROwtbKP2pHNeGJDd6XMBs7rn2vKY eHznne4pxGz1cPreLp1cy7Vq8UBQckznVibvmNsWC47Jo1Rnkmd+wLAoBh0cowQga0dD a8Jn2JRlE0LZMW29vKWQ2jowZfpAQ1YSEa+D4UBpHJQtx/K03MVEYoWm6rHgPhEKXbB2 dtvq2M+lmGcdilnQINzkLoKmdRgPY+c71mHut3bnGu/yU1ylBh0uxdfRV1UdJR90VBi2 ZpoA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-language:content-transfer-encoding :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=OmBd/dba7Hd0Y9xrgKB7ltF5Zc4u0m++/2CuJot78gE=; b=H8qfFtMlwoPV9Ar495i0Q+Y+cY1+zOJr+V7xEx+zH6WGAjvszIsqPAYRbtrThYON/1 JvSqNM0ykFMpSIXCv5oG4kaadJZbGT8H7gfXqCQalfXtAWpNQ0oOYsW8JPiq5jb9vyWi kMnp5p8gLpsRS+NcEQ3qHXqQVjhCwCsyb4c7ojuYWzDBV2TO2BSld3Da9zbxzpp/EfKZ uFLaPoQQLteiy8UMGmBY1kIv66FQv8yD3PYiHrqgZORv3lprZLxLy34a68avIwKN59cL CU460drukLVksjLHVi76ELvBc51mUsrP5s9sYgYJOBB3RU3psJhOn+24IcLD+LZHuGQH AJHQ== ARC-Authentication-Results: i=1; mx.google.com; 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=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z1si3598067edl.531.2021.08.29.09.19.39; Sun, 29 Aug 2021 09:20:11 -0700 (PDT) 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; 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=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235713AbhH2QSu (ORCPT + 99 others); Sun, 29 Aug 2021 12:18:50 -0400 Received: from mga18.intel.com ([134.134.136.126]:11013 "EHLO mga18.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235624AbhH2QSt (ORCPT ); Sun, 29 Aug 2021 12:18:49 -0400 X-IronPort-AV: E=McAfee;i="6200,9189,10091"; a="205298898" X-IronPort-AV: E=Sophos;i="5.84,361,1620716400"; d="scan'208";a="205298898" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Aug 2021 09:17:55 -0700 X-IronPort-AV: E=Sophos;i="5.84,361,1620716400"; d="scan'208";a="509319308" Received: from akleen-mobl1.amr.corp.intel.com (HELO [10.212.238.58]) ([10.212.238.58]) by orsmga001-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Aug 2021 09:17:54 -0700 Subject: Re: [PATCH v4 11/15] pci: Add pci_iomap_shared{,_range} To: "Michael S. Tsirkin" Cc: Dan Williams , "Kuppuswamy, Sathyanarayanan" , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Peter Zijlstra , Andy Lutomirski , Bjorn Helgaas , Richard Henderson , Thomas Bogendoerfer , James E J Bottomley , Helge Deller , "David S . Miller" , Arnd Bergmann , Jonathan Corbet , Peter H Anvin , Dave Hansen , Tony Luck , Kirill Shutemov , Sean Christopherson , Kuppuswamy Sathyanarayanan , X86 ML , Linux Kernel Mailing List , Linux PCI , linux-alpha@vger.kernel.org, linux-mips@vger.kernel.org, linux-parisc@vger.kernel.org, sparclinux@vger.kernel.org, linux-arch , Linux Doc Mailing List , virtualization@lists.linux-foundation.org References: <20210805005218.2912076-1-sathyanarayanan.kuppuswamy@linux.intel.com> <20210805005218.2912076-12-sathyanarayanan.kuppuswamy@linux.intel.com> <20210823195409-mutt-send-email-mst@kernel.org> <26a3cce5-ddf7-cbe6-a41e-58a2aea48f78@linux.intel.com> <20210824053830-mutt-send-email-mst@kernel.org> <20210829112105-mutt-send-email-mst@kernel.org> From: Andi Kleen Message-ID: <09b340dd-c8a8-689c-4dad-4fe0e36d39ae@linux.intel.com> Date: Sun, 29 Aug 2021 09:17:53 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 MIME-Version: 1.0 In-Reply-To: <20210829112105-mutt-send-email-mst@kernel.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > Let's be frank, even without encryption disabling most drivers - > especially weird ones that poke at hardware before probe - > is far safer than keeping them, but one loses a bunch of features. Usually we don't lose features at all. None of the legacy drivers are needed on a guest (or even a modern native system). It's all just all for old hardware. Maybe in 20+ years it can be all removed, but we can't wait that long. > IOW all this hardening is nice but which security/feature tradeoff > to take it a policy decision, not something kernel should do > imho. There's no mechanism to push this kind of policy to user space. Users don't have control what initcalls run. At the time they execute there isn't even any user space yet. Even if they could somehow control them it's very unlikely they would understand them and make an informed decision. Doing it at build time is not feasible either since we want to run on standard distribution kernels. For modules we have a policy mechanism (prevent udev probing by preventing enumeration), and that is implemented, but only handling modules is not enough. The compiled in drivers have to be handled too, otherwise you have gaping holes in the protection. We don't prevent users manually loading modules that might probe, but that is a policy decision that users actually sensibly make in user space. Also I changing this single call really that bad? It's not that we changing anything drastic here, just give the low level subsystem a better hint about the intention. If you don't like the function name, could make it an argument instead? -Andi >