Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1930085imu; Fri, 23 Nov 2018 02:13:34 -0800 (PST) X-Google-Smtp-Source: AFSGD/VlTSnj2vAdd/pP9kRRYdzwML6I+/tm3i/gnPbwTo4KLmEBdS/+SMJIT+DUjGATal5y2WWu X-Received: by 2002:a17:902:365:: with SMTP id 92mr14332011pld.327.1542968014734; Fri, 23 Nov 2018 02:13:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542968014; cv=none; d=google.com; s=arc-20160816; b=ygb3pLVbbRJiOpbsPuZni0FIXy1jNK6cyNghPFzHcmu9SVCz38qEue3W6eN/mGSL36 rvnND92uoFG0WoMxrsGTWlf1DYt14WnLYCFbBiecLokBXlGfkutvfgZmnM6S081VnRNs rEstKEDt8nerPvV5UhB969O8Tutnpkn6W6mG+0JgTEppd+q6/Ars2muTxLrrN+vGi1+u p/Hx48DXjjkRcPS7cqsUBJtBIf1ZOR0tb6+w7eJP3viOWLQONusZXrTp3i/C0qPHELKL 4ExADYUwCDZyskus2QVdBwhlDVvvTpNMWfHi45CWFcjZrZnNO55Q0AN1teCoy/mAYjfr hyBg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-disposition :content-transfer-encoding:mime-version:robot-unsubscribe:robot-id :git-commit-id:subject:to:references:in-reply-to:reply-to:cc :message-id:from:date; bh=loXkp3cjvR7P+yLBQ763MOhck8Bjz33N4tT1tOEAKnM=; b=pqV3l0ZKc4Yvu/wy3X+KzYxLF/5Ske6pJU1Nyxvq2EhY8ACso/6cqoLQjLuaz7Ov9T wryS6dXVejOj6q1nJt6amwzRSx32old9MAOyC2kCirvbPdzkNuE/l2k9UEIKYOh7V26c PCUMAxy+IEY8XmIVsdAytQl4uAUgmolKkNxkLtmYZ8/Mx+GZx/FuorIQBlPW1ol3QQiL +kPMdew8JADLn9ElWWoHBtA8F7ihqwwJnDqCvWM8DVTwdV5ws4lIJhc/X9nPGcf5hAOM nxxJ5a0pHOz0Z4YF6ZO7uBMyOQ5UD/nga3WFNq+lpMS/yzgNfyx+e2q6N1LlULvEwPfJ Mi6w== 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 v6si42388397pfj.167.2018.11.23.02.13.20; Fri, 23 Nov 2018 02:13:34 -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 S2393946AbeKVUut (ORCPT + 99 others); Thu, 22 Nov 2018 15:50:49 -0500 Received: from terminus.zytor.com ([198.137.202.136]:50987 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387936AbeKVUut (ORCPT ); Thu, 22 Nov 2018 15:50:49 -0500 Received: from terminus.zytor.com (localhost [127.0.0.1]) by terminus.zytor.com (8.15.2/8.15.2) with ESMTPS id wAMABdiE3743814 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 22 Nov 2018 02:11:39 -0800 Received: (from tipbot@localhost) by terminus.zytor.com (8.15.2/8.15.2/Submit) id wAMABdrN3743811; Thu, 22 Nov 2018 02:11:39 -0800 Date: Thu, 22 Nov 2018 02:11:39 -0800 X-Authentication-Warning: terminus.zytor.com: tipbot set sender to tipbot@zytor.com using -f From: tip-bot for Andy Lutomirski Message-ID: Cc: torvalds@linux-foundation.org, tglx@linutronix.de, luto@kernel.org, riel@surriel.com, mingo@kernel.org, bp@alien8.de, peterz@infradead.org, dave.hansen@linux.intel.com, hpa@zytor.com, linux-kernel@vger.kernel.org, yu-cheng.yu@intel.com Reply-To: yu-cheng.yu@intel.com, torvalds@linux-foundation.org, tglx@linutronix.de, luto@kernel.org, riel@surriel.com, bp@alien8.de, mingo@kernel.org, peterz@infradead.org, dave.hansen@linux.intel.com, hpa@zytor.com, linux-kernel@vger.kernel.org In-Reply-To: References: To: linux-tip-commits@vger.kernel.org Subject: [tip:x86/mm] x86/vsyscall/64: Use X86_PF constants in the simulated #PF error code Git-Commit-ID: af2ebdcf044039e89da3cd44c0f04dea317020c5 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00, T_DATE_IN_FUTURE_96_Q autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on terminus.zytor.com Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: af2ebdcf044039e89da3cd44c0f04dea317020c5 Gitweb: https://git.kernel.org/tip/af2ebdcf044039e89da3cd44c0f04dea317020c5 Author: Andy Lutomirski AuthorDate: Wed, 21 Nov 2018 15:11:26 -0800 Committer: Ingo Molnar CommitDate: Thu, 22 Nov 2018 09:24:27 +0100 x86/vsyscall/64: Use X86_PF constants in the simulated #PF error code Rather than hardcoding 6 with a comment, use the defined constants. Signed-off-by: Andy Lutomirski Cc: Borislav Petkov Cc: Dave Hansen Cc: H. Peter Anvin Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Rik van Riel Cc: Thomas Gleixner Cc: Yu-cheng Yu Link: http://lkml.kernel.org/r/e023f20352b0d05a8b0205629897917262d2ad68.1542841400.git.luto@kernel.org Signed-off-by: Ingo Molnar --- arch/x86/entry/vsyscall/vsyscall_64.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/entry/vsyscall/vsyscall_64.c b/arch/x86/entry/vsyscall/vsyscall_64.c index 85fd85d52ffd..d78bcc03e60e 100644 --- a/arch/x86/entry/vsyscall/vsyscall_64.c +++ b/arch/x86/entry/vsyscall/vsyscall_64.c @@ -102,7 +102,7 @@ static bool write_ok_or_segv(unsigned long ptr, size_t size) if (!access_ok(VERIFY_WRITE, (void __user *)ptr, size)) { struct thread_struct *thread = ¤t->thread; - thread->error_code = 6; /* user fault, no page, write */ + thread->error_code = X86_PF_USER | X86_PF_WRITE; thread->cr2 = ptr; thread->trap_nr = X86_TRAP_PF;