Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp2360579imj; Mon, 11 Feb 2019 01:15:29 -0800 (PST) X-Google-Smtp-Source: AHgI3IY189TBNKv597kPk+vtPNUQYRGsVuO9AQrHqGXhUhRS87HYgF220cNb6w0niwlT1sWsJgZy X-Received: by 2002:a62:2702:: with SMTP id n2mr36403134pfn.29.1549876529506; Mon, 11 Feb 2019 01:15:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549876529; cv=none; d=google.com; s=arc-20160816; b=FKs845aO27phccLHNXyIchsjfvCVquvzI2AjylGPQo5f5lrUHLr+68T/IgN7UjUca0 Kz6nRXkE4ZzcZ8gYpIacWnfEIDOZNffGIhGN/gMquei+VC3gl2OrybQ7cAv6X3X17OkB ox73PXBGk7N0EEfUAq5LyThtfK6jtylg4EeS27Og8zP8BwVFu+KD/9RuEz92pkh3oLeu D3QxK1TVDn7PcoaeLQ0VoWu0Mzqad/mOTN/+bD6dfUzecvJIK/bkVtvgbjfzCa/ZsQVY 47HFzCWZA45v1S7n8NK+Mrk03LOqBAfhJvCfCMPVFOw2Dgpnq2YLuXON914F/MlJ554/ 47mw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date; bh=S1NLxpHkmff+T11JJhN/kNa/P1/6tBrjzmij8ISSZuA=; b=RIEI+fdVzyPK/QgqhXfxbZ+H2kFBlDSmKIm8XxJJPwfmX0lIqNYEsNTpCWIfq/+Glg IYScVdJFv0Rg98Ci3gYBGN/DHm8268O8X3pWUUQA80x1A7xixma4iQuXPMlzV/rU7Sp8 g7DyjK9FQKlH25GqcbOnl85FckN3jhPEhFVCk63FFit33kF2kKvIunxaR6xCAoe6Uzie 0cVGy8UR5BDBbXGZGWwp8ArTXr/AxylzzsSnbWL1hcLfgf+eFzRvbTiwxMQA32LZrrK5 KqatoV9/L6R/NxdOE9gxNuv2JAbHHfBfNUY9xusV6FjMAi5MTsDS2/eTf0fnS2lhpBLX 0bjQ== ARC-Authentication-Results: i=1; mx.google.com; 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 o125si2570799pfo.242.2019.02.11.01.15.12; Mon, 11 Feb 2019 01:15:29 -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; 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 S1726308AbfBKJPI (ORCPT + 99 others); Mon, 11 Feb 2019 04:15:08 -0500 Received: from Galois.linutronix.de ([146.0.238.70]:38234 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725962AbfBKJPH (ORCPT ); Mon, 11 Feb 2019 04:15:07 -0500 Received: from [5.158.153.53] (helo=nanos.lab.linutronix.de) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1gt7g8-0000Zl-9H; Mon, 11 Feb 2019 10:15:04 +0100 Date: Mon, 11 Feb 2019 10:15:03 +0100 (CET) From: Thomas Gleixner To: Alexandre Chartre cc: LKML , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" , Josh Poimboeuf , x86@kernel.org, Peter Zijlstra Subject: Re: [PATCH] x86/alternatives: check int3 breakpoint physical addresses In-Reply-To: <8995b3b4-b805-c8c7-95a8-a39ab000f289@oracle.com> Message-ID: References: <1548428249-8258-1-git-send-email-alexandre.chartre@oracle.com> <8995b3b4-b805-c8c7-95a8-a39ab000f289@oracle.com> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 11 Feb 2019, Alexandre Chartre wrote: > On 02/10/2019 10:23 PM, Thomas Gleixner wrote: > > On Fri, 25 Jan 2019, Alexandre Chartre wrote: > > > Note that this issue has been observed and reproduced with a custom kernel > > > with some code mapped to different virtual addresses and using jump labels > > > As jump labels use text_poke_bp(), crashes were sometimes observed when > > > updating jump labels. > > > > Rightfully so. text_poke_bp() pokes at the kernels text mapping which is > > very well defined and unique. Why would you map the same text to different > > virtual addresses and then use a randomly chosen one to poke at it? > > > > As an example, we used to have per-CPU SYSCALL entry trampoline [1] where the > entry_SYSCALL_64_trampoline function was mapped to a different virtual address > for each CPU. So, a syscall would execute entry_SYSCALL_64_trampoline() from a > different virtual address depending on the CPU being used. With that code, > adding a jump label in entry_SYSCALL_64_trampoline() causes the described > issue. Right, but we knew that and there was no reason to put a jump label into that. AFAICT we don't have anything like this in the kernel. That said, I'm not opposed to apply the patch as is, I just wanted to get a better understanding about the background. Thanks, tglx