Received: by 2002:a05:7412:37c9:b0:e2:908c:2ebd with SMTP id jz9csp985735rdb; Tue, 19 Sep 2023 17:07:58 -0700 (PDT) X-Google-Smtp-Source: AGHT+IErUp9/k6DcAD+HPYe1oTZetm/O1DpEG5GIY9oN+K3ImLN0wDuauZryBduyicdPlwH2w27u X-Received: by 2002:a05:6a21:1a0:b0:138:68b9:138e with SMTP id le32-20020a056a2101a000b0013868b9138emr5442069pzb.8.1695168477669; Tue, 19 Sep 2023 17:07:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695168477; cv=none; d=google.com; s=arc-20160816; b=0wwUGtIVrw8ucpbujc7AfX+wSEFIOIgw4gRWsIrKa/lmMyveEsoItZVZ8oguq/EWGh LojUEC8RnYY+YFl4tw6YTmFKkTvcGWogUFG6/iPff4SN18jmTch5/+6WR8VTAa1qLwAw KzNT4wO++vSTyIf1lIBaxLdal5x/AiPx4frCxRq1YeiLWLSIHWyMgUuTzE2TCt0gEM+J n3523T9kN5TVVEgDbpanax5t3GvRidTK7iobfWL0iMALJCRF+4+qfXZBEdb/sA4/RaR7 DSwG7JcNbUB0SVczPo3MDfJZ7ShrQOJjYiCS/kMpPsd4/UEtxrfCgHlAKbG9W/peRHgW sfeA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=rf2MsE0QRbUtAnaD3OhEqfmgpq4OLQ94+2y/+SBxQck=; fh=Ga5hcxJJeNutZNFJT64MWux9wkMsFpIqcGnT36ZEmys=; b=ElCglti7VsKqZM1A80ixO+nZlePiBxwJ/MgEcQtCbprLaboBK/nDnm2tPANbuzzNlF WKL3rg16Fc2BNS18YJWKAoJeg3/f5OFDuEGukGWxg9qcE8wWexJi/wxW4pwhE7invNtF Pi+9n+RCvUrZWLqu2bZQ6MLkTZx7+9Y903byPH/hisIe6iMG1N8u0CxwibiIHzNpAui8 wryWuZSRfMM1WmbvB3+ENuISX1xknvvrkEKzQA9RU/IS0jC6YDvKYvSBX0uATuJBgk+L Em4ljqBwyye7eZsNizyK8L6+pxuwxqumYgfml4xFQslkJFBZ5neh4/ictR0vcwfSOqch qfjQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=KLDmxlVA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id a5-20020a655c85000000b0057755c96163si4232450pgt.14.2023.09.19.17.07.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Sep 2023 17:07:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=KLDmxlVA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id BE7A7808E64A; Tue, 19 Sep 2023 11:50:19 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232477AbjISSuT (ORCPT + 99 others); Tue, 19 Sep 2023 14:50:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42318 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232084AbjISSuR (ORCPT ); Tue, 19 Sep 2023 14:50:17 -0400 Received: from mail-lj1-x235.google.com (mail-lj1-x235.google.com [IPv6:2a00:1450:4864:20::235]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3EBA39D for ; Tue, 19 Sep 2023 11:50:08 -0700 (PDT) Received: by mail-lj1-x235.google.com with SMTP id 38308e7fff4ca-2b962c226ceso98578441fa.3 for ; Tue, 19 Sep 2023 11:50:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; t=1695149406; x=1695754206; darn=vger.kernel.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=rf2MsE0QRbUtAnaD3OhEqfmgpq4OLQ94+2y/+SBxQck=; b=KLDmxlVAg5/b7kAqJumojDYupoyU4pQtuvW6K2HHxEqB+p278MdmvpzZJYDYnO91CW RWIzxhVL2O4q6F54xcEImtvRYDOJAFqnOqgAIrwJn2dg2B8MnOSgtL9YC/YBwOj2gVpW meSFs7ZE0DPak1Km60L6TGysXdIAdEzRYtuOk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695149406; x=1695754206; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=rf2MsE0QRbUtAnaD3OhEqfmgpq4OLQ94+2y/+SBxQck=; b=DgCqRGRYBdslwHKvZT3XsdUuXCWUuYp5+ZUMS2CEaKzjaWZWWWlCwX2niIDEqmD4kN E4nk2gFWwD0mSUA7w4hZAAIvdITjbVLiocmxRJKicc85/+IFGbzN9YaA6BCWZ5UwGfkI UbbAxKZiydNLCanF7W8Uq5z2sAFzIdCTfGWrbebXjNOLysee7jaMsbh/eQ7kx2URchhX NuN15pAkIRwlB2u0UEhGQOAq3/FD4Gx7jn7LrogusAXafxoN4tBnEOyqfWeoFsa5Xyi+ e9op2gyp04XPAIBjzzT9Wn5RfgtTlNeApSl4P9zoF3cwQauzSjph9hkdprX1Zt4/78Dk 30Aw== X-Gm-Message-State: AOJu0YydaWK/2GGUJj/umMbRq0KEcm22n2ZYj70hPptjs3/hniedaiwi O08dnMCTqkR3agUS54LTzf7Rr915WpJJtAE26FANKEXM X-Received: by 2002:a2e:9617:0:b0:2bc:b6ce:eab with SMTP id v23-20020a2e9617000000b002bcb6ce0eabmr214907ljh.51.1695149406511; Tue, 19 Sep 2023 11:50:06 -0700 (PDT) Received: from mail-ed1-f50.google.com (mail-ed1-f50.google.com. [209.85.208.50]) by smtp.gmail.com with ESMTPSA id gy18-20020a170906f25200b009a9fbeb15f5sm8103853ejb.46.2023.09.19.11.50.06 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 19 Sep 2023 11:50:06 -0700 (PDT) Received: by mail-ed1-f50.google.com with SMTP id 4fb4d7f45d1cf-532784c8770so2024775a12.1 for ; Tue, 19 Sep 2023 11:50:06 -0700 (PDT) X-Received: by 2002:a50:ee14:0:b0:530:d8df:afaa with SMTP id g20-20020a50ee14000000b00530d8dfafaamr219079eds.41.1695149405833; Tue, 19 Sep 2023 11:50:05 -0700 (PDT) MIME-Version: 1.0 References: <20230915105933.495735-1-matteorizzo@google.com> <7a4f5128-28fd-3c5f-34c2-1c34f4448174@intel.com> <1d7573c0-ebbc-6ed2-f152-1045eb0542f9@os.amperecomputing.com> In-Reply-To: From: Linus Torvalds Date: Tue, 19 Sep 2023 11:49:48 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [RFC PATCH 00/14] Prevent cross-cache attacks in the SLUB allocator To: Matteo Rizzo Cc: Ingo Molnar , "Lameter, Christopher" , Dave Hansen , penberg@kernel.org, rientjes@google.com, iamjoonsoo.kim@lge.com, akpm@linux-foundation.org, vbabka@suse.cz, roman.gushchin@linux.dev, 42.hyeyoo@gmail.com, keescook@chromium.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, linux-mm@kvack.org, linux-hardening@vger.kernel.org, tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com, x86@kernel.org, hpa@zytor.com, corbet@lwn.net, luto@kernel.org, peterz@infradead.org, jannh@google.com, evn@google.com, poprdi@google.com, jordyzomer@google.com Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Tue, 19 Sep 2023 11:50:19 -0700 (PDT) On Tue, 19 Sept 2023 at 08:48, Matteo Rizzo wrote: > > On Mon, 18 Sept 2023 at 20:05, Linus Torvalds > wrote: > > > > ... and equally importantly, what about DMA? > > I'm not exactly sure what you mean by this, I don't think this should > affect the performance of DMA. I was more worried about just basic correctness. We've traditionally had a lot of issues with using virtual addresses for dma, simply because we've got random drivers, and I'm not entirely convinced that your "virt_to_phys()" update will catch it all. IOW, even on x86-64 - which is hopefully better than most architectures because it already has that double mapping issue - we have things like unsigned long paddr = (unsigned long)vaddr - __PAGE_OFFSET; in other places than just the __phys_addr() code. The one place I grepped for looks to be just boot-time AMD memory encryption, so wouldn't be any slab allocation, but ... Linus