Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp2235882ybv; Fri, 21 Feb 2020 11:28:20 -0800 (PST) X-Google-Smtp-Source: APXvYqyLq1elKpBJ0VpfJ4mWKW25OP35d+bUEWmqg4FCpyio/eSdqmA5lYYDQg1Gi0/fq4gdPWwh X-Received: by 2002:a9d:116:: with SMTP id 22mr6542257otu.149.1582313300298; Fri, 21 Feb 2020 11:28:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582313300; cv=none; d=google.com; s=arc-20160816; b=ZQGGP0aNde1SdntGatzIvUNnhDxJQ3eLxg0MkB4WaH76dI8CIc8aNBpqds4fNhlAY7 duA2p7P4gfjRV3PAVneefwBOKalH+D6ElCX1nzBgcHVhBhpbdUJZZf9huc8KtsCJhjE1 H59iYyM/LYKO00nvrXIi9sB1jZdE/8okHLbr1xjNAWGzgPPije2bW+vAyDNssv45/T6t UbISV+NYeSmraWEDry339jUGaNLNALE/P+7oTSTkxC5Q+chuMD9VQhGAlPl9N/1qRiDi RtXTJpMrb6yTmyvLVr3TjISl+6MnDPxBjEuDV94Pu3d9wXUCYkXnfeqLruiHuONt1K6Q 3Pjg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=dySq1l3asr1HRFdBoND5+/A1oxOW8lUHSK+OCHfNPcA=; b=aGrobSUIccNTD+fzdbkQZqvlV2tcc/HMORiZbdrzxZwWT45QfKSMI0rq9cqKXZWL5o FCSiYYsFu+1oZgrc56BNVNO486kOgqBPmQCotyfnnNPVYBU8Ra9u6xnspw6kQgD3gZsF zmg6e5qfT7IscMQ/SCJ+UC/qZOZ56pNK/2LLfCVjb/BLQesv+k6udYXSLeytE42TDajU LFfvK+84PgnhF66fVvuXfrrOb+VywK5e+uShPwrZtqjM63nndopQOKAsVEBADaY1k60O MeKkTqTU6/2qu++mOfJKl0C3aiYpWdFUR0rxI6xouLxHvREm8rNIYEaofDiBM8IZVC0A 1N2w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=equBr8Ze; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q126si1205453oia.8.2020.02.21.11.28.07; Fri, 21 Feb 2020 11:28:20 -0800 (PST) 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=@linux-foundation.org header.s=google header.b=equBr8Ze; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729773AbgBUT0u (ORCPT + 99 others); Fri, 21 Feb 2020 14:26:50 -0500 Received: from mail-lf1-f66.google.com ([209.85.167.66]:39893 "EHLO mail-lf1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729454AbgBUT0t (ORCPT ); Fri, 21 Feb 2020 14:26:49 -0500 Received: by mail-lf1-f66.google.com with SMTP id n30so1486215lfh.6 for ; Fri, 21 Feb 2020 11:26:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=dySq1l3asr1HRFdBoND5+/A1oxOW8lUHSK+OCHfNPcA=; b=equBr8Zes6R6b4rIEzwkzyJRJj85yEFZ26p5vYyReOS3ME6RWlBTWy9VGIlLMUnpUO z1IhW/3DdktZWYIDolZ9Gt29wooAukLmK6Msln/B0PjQp9OpY1QqxN7yYIfsYKTngNLH +AupZ4Eiah1/lhSBwy16fcgaZwAeblakPYzQ8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=dySq1l3asr1HRFdBoND5+/A1oxOW8lUHSK+OCHfNPcA=; b=P0yp27ZSd8H9nEt0I+0uvGYAyaJVU/HHE+5SyCRFpawRMcrlsoUh38n9eCBPEOQ5yg SmX7ZxkdtEUT94+ZjKAfZUeREZ3doailZoBAWqxBTfIFvIcn3QAqmCX1l26gYXd+f5Oe /n0JQ2d05hnrfBgpw/L9oNcIWLYThPKS3ntYozSFzKilrSkKd1daOU8RL8jxp37acTWK 8XtUodp7v1uVIVSHgOHuCVOYygX4X1e99PKrs62Tw8ewUTVkKFHFqlytHQMHkJmxtXEX XYGZy/tvIzjR8tYOhOIoZj/UU8S98Ky8DYBo8wmtYgJPpELYZ6X7sKj4rAvdVQ4AiY2f DBlg== X-Gm-Message-State: APjAAAX1kMJ3Afr3zZNLLN4H1e0dcIDUW7hx+T64GMgq0a4RjwqhkEt/ 2BpWlk1KTC1LJAaGzPeqIdEfLuEuJg0= X-Received: by 2002:a05:6512:1106:: with SMTP id l6mr5611340lfg.147.1582313206981; Fri, 21 Feb 2020 11:26:46 -0800 (PST) Received: from mail-lf1-f41.google.com (mail-lf1-f41.google.com. [209.85.167.41]) by smtp.gmail.com with ESMTPSA id d24sm2095404lja.82.2020.02.21.11.26.45 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 21 Feb 2020 11:26:46 -0800 (PST) Received: by mail-lf1-f41.google.com with SMTP id z5so2262899lfd.12 for ; Fri, 21 Feb 2020 11:26:45 -0800 (PST) X-Received: by 2002:a05:6512:687:: with SMTP id t7mr21192197lfe.30.1582313205540; Fri, 21 Feb 2020 11:26:45 -0800 (PST) MIME-Version: 1.0 References: <6A09F721-0AD9-4B86-AB3E-563A1CF5ABDE@amacapital.net> In-Reply-To: <6A09F721-0AD9-4B86-AB3E-563A1CF5ABDE@amacapital.net> From: Linus Torvalds Date: Fri, 21 Feb 2020 11:26:29 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] mm/tlb: Fix use_mm() vs TLB invalidate To: Andy Lutomirski Cc: Peter Zijlstra , Andrew Morton , Linux Kernel Mailing List , Jens Axboe , Kees Cook , Jann Horn , Will Deacon Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Feb 21, 2020 at 11:22 AM Andy Lutomirski wrot= e: > > In this particular case, if we actually flub this, we are very likely to = cause data corruption =E2=80=94 we=E2=80=99re about to do user access with = the wrong mm. So? IF this ever triggers, it has presumably been around for decades. Nobody noticed. Adding a WARN_ON_ONCE() means that somebody will now notice. Good. Adding a BUG_ON() will now possibly mean that the machine is dead, and is not sending the bug-report to anybody. It's not going to hit, of course. But if you are 100% sure of that, then it shouldn't exist at all. And if you're not 100% sure of it, then it's going to be in some very unusual circumstances (possibly some odd driver subsystem that does something completely wrong - wouldn't be the first time), and the last thing you want to do is lose the information about it. So BUG_ON() is basically ALWAYS 100% the wrong thing to do. The argument that "there could be memory corruption" is complete and utter garbage. See above why. Stop it. Seriously. Linus