Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp594305imu; Thu, 22 Nov 2018 02:24:27 -0800 (PST) X-Google-Smtp-Source: AJdET5czKdkP719gUG91DZbMWmjjjv1NimTtTC8IiiLjUXqlPm1HFnx0MkR681w7IjspjYNDEk1g X-Received: by 2002:a62:6c89:: with SMTP id h131-v6mr10810209pfc.12.1542882267723; Thu, 22 Nov 2018 02:24:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542882267; cv=none; d=google.com; s=arc-20160816; b=jiFOOvpCveok4hhLam02k0IlmMydH7DhLTmxZTdcxFQ6Al3c9bbNyVpN7I2kbjUeVL vgTNrRCm85E3R5+2XeU6J3GdjfZbw787IMYI0uDvVOWLNlg6vRFq8jB8xVL9K7BBPiwd fN+jhM4O5WR5CW3vAw6b7gJ+amQGSW/NAVKD1loLy/CO1XLb1DRe73fatA2TWTe5X1fL uwtTFm1nLp9kZmT+5nHSpuvkldOxqdMpmBByrHbJGHxvhaHOvryfYgPH0hdObdfuYTYv r0lYJYb5JFETurHyovCS3NMfow79u+8cmvpsNwPhfhoKSxcoESH/Pwyw8xRVAMgRCCiN kPWg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature; bh=VyNHIBXtFDS+cVZOd6sNt/XlOQsEufwFcnOV1DdA7FM=; b=U36FN0LvSP4mIy8SUDosLvTt3M/7CAjBKP8SaFw5sHnoF4PzWJZeEIlcmpMnCbVgAO Zpb0lPPPPX0cZfuzLw0/HlNjI+TXBlxfyhlIgXJflkGN0GBIOpfGSPZIbGIDt8yLuTuN jYYgXQSOwunWaxxTlw+y+QuGnrxYXdKmMwZGiapjmugVXZrGGYSaj8OdT0gYcIPrDeAz hkMX20lhnF4w3wYBYRycz+NQluME9KaocAw2dSi7bb623/PrlEhqJQYvQsnD+vxVyZub N9f0A+7p04mG/Xfjt3qksPPLFNdivCk8DNLjASJ2dBRihkHpysfUiKEvtG3Fxc+K2fkb 7PlA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=DhzgnrTe; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y29si6979610pgk.376.2018.11.22.02.24.13; Thu, 22 Nov 2018 02:24:27 -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=@kernel.org header.s=default header.b=DhzgnrTe; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390525AbeKVJsK (ORCPT + 99 others); Thu, 22 Nov 2018 04:48:10 -0500 Received: from mail.kernel.org ([198.145.29.99]:38932 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390489AbeKVJsE (ORCPT ); Thu, 22 Nov 2018 04:48:04 -0500 Received: from localhost (c-71-205-112-160.hsd1.co.comcast.net [71.205.112.160]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 824E5214C4; Wed, 21 Nov 2018 23:11:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1542841895; bh=Gp5ut8Yvjk0UdEW8rghdryCsZib248qHknetthCXLWU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:In-Reply-To: References:From; b=DhzgnrTeTtMYEX22GsCPtI+EWk4ti4TBYYc6/nmpgTSKH82u1WMAFmU6myDyp5iBk 2sFy0VeDpuNSx8RWgdH0Gt7F5dKcIgDrSxghb+jg18JfhX6S2ID2VZ8f0N2+EOnXlA O8gINzizNul4aS5FHEjZCeXb7f7RwPUg+Lx/bMtI= From: Andy Lutomirski To: x86@kernel.org Cc: LKML , Yu-cheng Yu , Dave Hansen , Peter Zijlstra , Borislav Petkov , Andy Lutomirski Subject: [PATCH v2 5/5] x86/vsyscall/64: Use X86_PF constants in the simulated #PF error code Date: Wed, 21 Nov 2018 15:11:26 -0800 Message-Id: X-Mailer: git-send-email 2.17.2 In-Reply-To: References: In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Rather than hardcoding 6 with a comment, use the defined constants. Signed-off-by: Andy Lutomirski --- 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; -- 2.17.2