Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp919968pxf; Wed, 7 Apr 2021 15:05:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxBuH4uKJDMR7GhubkRvbmoX/zQdTar+4NWDp+OkrNpk1ikluDkw0O3NrQasuWClenye6DC X-Received: by 2002:aa7:8bd4:0:b029:1fa:9f1b:1cd1 with SMTP id s20-20020aa78bd40000b02901fa9f1b1cd1mr4850760pfd.31.1617833116586; Wed, 07 Apr 2021 15:05:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617833116; cv=none; d=google.com; s=arc-20160816; b=oawgss5HwjncQGyz52BUyOharCYRCKIUF6buuj6ALKZgFp4yAOuG3c2Q/GWGOTu7ME NieCiOok3iueP9skaiab48nIK0aQRPFrd5Zeq4RPOx2toG5Rxo/ivITnAJSjajjITSTR yxkLklnaEth+h/QcAUPTr9VI/XmgeZE15FsJHBdWa+QU7ZjISBtUSc4oP6EBOHX4pmAM K8AUF9/4RFzsVBIT+hcSRATcV+Ypc1bi1DqJR19UPCQQJKjRQq5/oUBoFZAdU4Szo5Id mwYXF8HUmnBe9aqiCAPYnWevWtoNprjdggdwK/gTBL1rZZc966U4qqy/iO1gZVPA5CtQ 6oRg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=lR4HjhpfT7Q4Vo+Wt3lVbKX5Wx7rTwYicT74GM2+xNI=; b=dGq5gRhbR28Oh5Tx40d1pLc3/mnVg9ZZiFFCa9D97LEb+z5uti0DPNyTXhKYLe/nb3 GF15MRSkHi6NfUI9l8aL/D9wdxtmuoJPuEDKcU9JrZ6uIwQdhTHMWQVmfM9esKO1OUer 1asVtcL6PJUGbiLaMv5XgcA0Gm9G0KX3cDqc+5aTn5TssUu9uI+boFl1dLh9s9txA+/j +KVyg/5pSFU6+tBB6XKz3z4RgCCHJuqxDH4UGWZrfD4wBwsOcxvbObAr3oD0wWtarXvJ Xj9sK+Yu+tNfmeKRTjwUWHYxLHYT4v2+68AGAwUCyEMeweJvzrZBLSMGJfYIMAiMy9+F 2+Qg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=GbyN1jVA; 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=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v8si6772380pjn.156.2021.04.07.15.05.00; Wed, 07 Apr 2021 15:05:16 -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; dkim=pass header.i=@alien8.de header.s=dkim header.b=GbyN1jVA; 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=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232109AbhDGVSb (ORCPT + 99 others); Wed, 7 Apr 2021 17:18:31 -0400 Received: from mail.skyhub.de ([5.9.137.197]:51382 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232049AbhDGVS3 (ORCPT ); Wed, 7 Apr 2021 17:18:29 -0400 Received: from zn.tnic (p200300ec2f08fb0020f55c189e926593.dip0.t-ipconnect.de [IPv6:2003:ec:2f08:fb00:20f5:5c18:9e92:6593]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.skyhub.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id DEDB71EC0345; Wed, 7 Apr 2021 23:18:17 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1617830298; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:in-reply-to:in-reply-to: references:references; bh=lR4HjhpfT7Q4Vo+Wt3lVbKX5Wx7rTwYicT74GM2+xNI=; b=GbyN1jVATBLorJv4BVyplZeZdx3/XUSg8LeGrAB5RfCI2sWwIRwYZou8M40d1lL2/VQWpY /V/p/bBwRY2bw/6nwMfYuJVCQLszUG6jLFieqeuGTO1exSKHEcuyqSc2Dfu+QEN7Gg+2FM vTAysXYGeqakxS/nZOii94xTguM58+8= Date: Wed, 7 Apr 2021 23:18:16 +0200 From: Borislav Petkov To: Tony Luck Cc: x86@kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, Andy Lutomirski , Aili Yao , HORIGUCHI =?utf-8?B?TkFPWUEoIOWggOWPo+OAgOebtOS5nyk=?= Subject: Re: [PATCH 3/4] mce/copyin: fix to not SIGBUS when copying from user hits poison Message-ID: <20210407211816.GP25319@zn.tnic> References: <20210326000235.370514-1-tony.luck@intel.com> <20210326000235.370514-4-tony.luck@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20210326000235.370514-4-tony.luck@intel.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Mar 25, 2021 at 05:02:34PM -0700, Tony Luck wrote: > Andy Lutomirski pointed out that sending SIGBUS to tasks that > hit poison in the kernel copying syscall parameters from user > address space is not the right semantic. What does that mean exactly? From looking at the code, that is this conditional: if (t == EX_HANDLER_UACCESS && regs && is_copy_from_user(regs)) { m->kflags |= MCE_IN_KERNEL_RECOV; m->kflags |= MCE_IN_KERNEL_COPYIN; so what does the above have to do with syscall params? If it is about us being in ring 0 and touching user memory and eating poison in same *user* memory while doing so, then sure, that makes sense. > So stop doing that. Add a new kill_me_never() call back that > simply unmaps and offlines the poison page. Right, that's the same as handling poisoned user memory. Thx. -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette