Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp2231354ybv; Fri, 21 Feb 2020 11:22:52 -0800 (PST) X-Google-Smtp-Source: APXvYqxtcrfHYCdEIRUuVe5zOzFczGLqXV7vdJxU+7SXQMoHgOs5WfKbogLvomKTI557N/VHFImn X-Received: by 2002:a9d:6c8d:: with SMTP id c13mr30033349otr.277.1582312972679; Fri, 21 Feb 2020 11:22:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582312972; cv=none; d=google.com; s=arc-20160816; b=EtfFp/9/eY2kiySIBWEpXftf1GZ1gByi0OYL6KsUBHn+BmXUxyk1FNvUXAtAhGwqC1 p/XVG8iFFEzSy8p3KgEo4LyWXBLY83jFk4IErL/VVGZMyIyFaglQ3vFLIyb+9gQy5kOx z387sElCTEZxKuxbNmMg9AYQQVvgySHCzbxgnrlkLkrMg5MfLf+e+0cMo+GOcPsYKr+g MSyZE5KVvJMU5jWTokJG/yKdHG1JL6e0DI/0b59SQikIcI34WnxDMOtZOxOaaIVnolWo dP+mw3aB2m4zItt9JUVvTEt2SvsuGiJJ2Uc8YXnppKccvHHb7ZPjZRHl+s3gJO8Gb6F0 vHCQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:in-reply-to:cc:references:message-id :date:subject:mime-version:from:content-transfer-encoding :dkim-signature; bh=babJojdCDy0YFs2iVGK6X7zs9deO0pqtiXujS29YD44=; b=TkpoTqM+W6uRxCQc2mHR+dphaLwTM54KmnjON7EdMOuzvG57Oj1lIaTqhTBM3EqiWS 2pk2loWfrWj+0TeFEeUX9+Q7hPv11a3IuUpGzn2ydPenHlkZcx9Z11gKFBN6+SM3a3Kx BrZGZhR1ED8l4gAhmxn3rqCnT0LS22nydc10SGYI23jG7KZqZ6/LQP4ohAzr9mzlLcOy XmMoT5Wiyvgxp/Cyd9eDtQSju1bWYMIl56ZKlkURgkBhpcQsn+BhTD627MLh4ZspCVF5 DfTLNmI4LG1goLWAJErhU2smcV3gdSuiyZm4J0A32DvtE/7XGCsEY+bccFJd/vU8EZWb MIeQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amacapital-net.20150623.gappssmtp.com header.s=20150623 header.b=CJkwaRDw; 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 s11si1187317oic.57.2020.02.21.11.22.40; Fri, 21 Feb 2020 11:22:52 -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=@amacapital-net.20150623.gappssmtp.com header.s=20150623 header.b=CJkwaRDw; 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 S1729747AbgBUTWW (ORCPT + 99 others); Fri, 21 Feb 2020 14:22:22 -0500 Received: from mail-pf1-f196.google.com ([209.85.210.196]:41823 "EHLO mail-pf1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726423AbgBUTWW (ORCPT ); Fri, 21 Feb 2020 14:22:22 -0500 Received: by mail-pf1-f196.google.com with SMTP id j9so1736439pfa.8 for ; Fri, 21 Feb 2020 11:22:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amacapital-net.20150623.gappssmtp.com; s=20150623; h=content-transfer-encoding:from:mime-version:subject:date:message-id :references:cc:in-reply-to:to; bh=babJojdCDy0YFs2iVGK6X7zs9deO0pqtiXujS29YD44=; b=CJkwaRDwnuJBn0C4v1Ltjfn9GF0b2pewUCw30smmKBLfZs4zRmMmDsgFkUdIYKzsyy hB5perK5p3i1wSNVsj8Vo7g4ohOgdtvtAKo8M+3xZSRkPS9QNX/a6yvJMdGXgHKSz8Wo snspxoVchaHx5HaO2sPszMzJITp1bYuLtHVRzOgyNDYni5/DAO0W7Cj9TdsnJgmt1ei2 pjwkM8rj9YK8ndNQCSAbD0MoFfEMU7lqxVe7LPGWb1lnOCHobBcCTvwbvbKhntI7HtXt GzlGeK8AtrVMnKkPL9wFUuPKXMAQeJywGOVgfzfjrzvaLVsvwUs/11Y9cE4SPsmQiAR2 hgSg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:content-transfer-encoding:from:mime-version :subject:date:message-id:references:cc:in-reply-to:to; bh=babJojdCDy0YFs2iVGK6X7zs9deO0pqtiXujS29YD44=; b=LRd3eYKcvrQpDCWkETq5TeS08C01AXKAj9eLeIXxsahaW2kefD36J6hZLjcz9RTNUP H5DLegqL9XYmcB7JmsaSfvrGZZnIh9DOAieOOeHzmAipG2oS3XOa5al6JMgcqC3OPcAv zi9WzRpazBqnrdrNsMn63d8CD1mBoKVs0YBCs62FntfnlRJLK+sVHjyoqY8ZI/jx8m+3 E08nCFJutEFaGjhyuufWfSlt4O6Hk0SUO8YXostY+iPT1J1pJ4lFrIZVvsRv/XyEiiHt a9mOvz2sdLPIokzMzY4Wh2ZvtaLMI5ch3GnKIeV0RHspuIx+b7hTcXJITALb49tUI0Zf i1uw== X-Gm-Message-State: APjAAAVX/mC6SYfF2wtrL58MREj4kb6rz56S8aGqH0ZrNsUTzqbnE6xz jDOPVFYSR3C2eyjXZdooh4pTdg== X-Received: by 2002:a63:7558:: with SMTP id f24mr39204054pgn.259.1582312941795; Fri, 21 Feb 2020 11:22:21 -0800 (PST) Received: from ?IPv6:2601:646:c200:1ef2:4c99:8e8b:baf2:422? ([2601:646:c200:1ef2:4c99:8e8b:baf2:422]) by smtp.gmail.com with ESMTPSA id g16sm3364584pgb.54.2020.02.21.11.22.20 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 21 Feb 2020 11:22:21 -0800 (PST) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable From: Andy Lutomirski Mime-Version: 1.0 (1.0) Subject: Re: [PATCH] mm/tlb: Fix use_mm() vs TLB invalidate Date: Fri, 21 Feb 2020 11:22:16 -0800 Message-Id: <6A09F721-0AD9-4B86-AB3E-563A1CF5ABDE@amacapital.net> References: Cc: Peter Zijlstra , Andrew Morton , Linux Kernel Mailing List , Jens Axboe , Kees Cook , Jann Horn , Will Deacon In-Reply-To: To: Linus Torvalds X-Mailer: iPhone Mail (17D50) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > On Feb 21, 2020, at 11:19 AM, Linus Torvalds wrote: >=20 > =EF=BB=BFOn Fri, Feb 21, 2020 at 3:11 AM Peter Zijlstra wrote: >>=20 >> + BUG_ON(!(tsk->flags & PF_KTHREAD)); >> + BUG_ON(tsk->mm !=3D NULL); >=20 > Stop this craziness. >=20 > There is absolutely ZERO excuse for this kind of garbage. >=20 > Making this a BUG_ON() will just cause all the possible debugging info > to be thrown away and lost, and you often have a dead machine. >=20 > For absolutely no good reason. >=20 > Make it a WARN_ON_ONCE(). If it triggers, everything works the way it > always did, but we get notified. >=20 > Stop with the stupid crazy BUG_ON() crap already. It is actively _bad_ > for debugging. >=20 > =20 In this particular case, if we actually flub this, we are very likely to cau= se data corruption =E2=80=94 we=E2=80=99re about to do user access with the w= rong mm. So I suppose we could switch to init_mm and carry on. *Something* will crash= , but it probably won=E2=80=99t corrupt data or take down the machine.=