Received: by 10.213.65.68 with SMTP id h4csp897740imn; Tue, 27 Mar 2018 10:47:40 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/TLWdjHrbI60wOeqjYzQt+gawBTL0e+KIeZSUa1smgX5J5duNwj8X2F1RqB2hrd38m3NeV X-Received: by 10.101.99.149 with SMTP id h21mr164177pgv.345.1522172860359; Tue, 27 Mar 2018 10:47:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522172860; cv=none; d=google.com; s=arc-20160816; b=qK+2lfJW2Ba45sZqQ53g8ko4AEYlWh7hX+aiIDanV8pWg1endn4CGSLmr0IoIlhlE7 SbEhk4gPxXPoftJYl1l1kvaQ+Is+F0q3MMylQSpk9djxlrQ2wvDz1wjczvknOB9UOjr/ WUWyfqjzyPqJjoC1bdnPRtqf4coDNC9BWEkv1e2od8f7AAxv33Y5YL/dgPeEcgV6eomZ TVsFGI/bSuNP8SW7hN8buQR2UDwM5RznVFFQBwB7Ovu/dJxvygwU4utyQgidx+FcXZkB 6e6gr5fmjh4sXJO6/+ccgIWXnV3qYaE1sa2mvR/2Y63jb+9kzy/5OpVlnlhUGW7AGJCC 593g== 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 :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=+Rx5gR4mY+GXPJQxtA7Iuk+ev6aQqoZrnq9+cgo1kjw=; b=eirfdm8pffeb1HPkV7qMOCVW33NcsYCpLXzDZOpo7pov/2ovLJP9B7/vivF5f3I+B4 CPuiqlQO9NaKWn1Ng+7Vnh8z+wRMIXHv0ItIYm7tUKSBqbuRKpcVUvWe6A4MRHmxRKea uMauHliOGYc0/VaHqPIz7+Q0aCzlUfYC6Qz6jn6WtrJedco4yR1zD63nj+Y5XKgBxC/a PLCyfklVPrI7E+VTvhTDCrD8PrOLfn4WdGkbivA+SzLY8ocCpAvRoMymvsK+T6Tp95eZ ZCSrTY+dQ7l20XSe/kRy4F4qLeiorFE77u1/013k70eiZrUFUhf+l+7Hs0hzIIgj8aEc 69OA== 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 t10-v6si1643284plh.231.2018.03.27.10.47.25; Tue, 27 Mar 2018 10:47:40 -0700 (PDT) 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 S1753880AbeC0QdN (ORCPT + 99 others); Tue, 27 Mar 2018 12:33:13 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:43776 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753865AbeC0QdK (ORCPT ); Tue, 27 Mar 2018 12:33:10 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id C6F62EB5; Tue, 27 Mar 2018 16:33:09 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dave Hansen , "Eric W. Biederman" Subject: [PATCH 4.9 62/67] signal/testing: Dont look for __SI_FAULT in userspace Date: Tue, 27 Mar 2018 18:27:54 +0200 Message-Id: <20180327162731.072188869@linuxfoundation.org> X-Mailer: git-send-email 2.16.3 In-Reply-To: <20180327162726.702411083@linuxfoundation.org> References: <20180327162726.702411083@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.9-stable review patch. If anyone has any objections, please let me know. ------------------ From: Eric W. Biederman commit d12fe87e62d773e81e0cb3a123c5a480a10d7d91 upstream. Fix the debug print statements in these tests where they reference si_codes and in particular __SI_FAULT. __SI_FAULT is a kernel internal value and should never be seen by userspace. While I am in there also fix si_code_str. si_codes are an enumeration there are not a bitmap so == and not & is the apropriate operation to test for an si_code. Cc: Dave Hansen Fixes: 5f23f6d082a9 ("x86/pkeys: Add self-tests") Fixes: e754aedc26ef ("x86/mpx, selftests: Add MPX self test") Signed-off-by: "Eric W. Biederman" Signed-off-by: Greg Kroah-Hartman --- tools/testing/selftests/x86/mpx-mini-test.c | 3 +-- tools/testing/selftests/x86/protection_keys.c | 13 ++++++------- 2 files changed, 7 insertions(+), 9 deletions(-) --- a/tools/testing/selftests/x86/mpx-mini-test.c +++ b/tools/testing/selftests/x86/mpx-mini-test.c @@ -419,8 +419,7 @@ void handler(int signum, siginfo_t *si, br_count++; dprintf1("#BR 0x%jx (total seen: %d)\n", status, br_count); -#define __SI_FAULT (3 << 16) -#define SEGV_BNDERR (__SI_FAULT|3) /* failed address bound checks */ +#define SEGV_BNDERR 3 /* failed address bound checks */ dprintf2("Saw a #BR! status 0x%jx at %016lx br_reason: %jx\n", status, ip, br_reason); --- a/tools/testing/selftests/x86/protection_keys.c +++ b/tools/testing/selftests/x86/protection_keys.c @@ -224,19 +224,18 @@ void dump_mem(void *dumpme, int len_byte } } -#define __SI_FAULT (3 << 16) -#define SEGV_BNDERR (__SI_FAULT|3) /* failed address bound checks */ -#define SEGV_PKUERR (__SI_FAULT|4) +#define SEGV_BNDERR 3 /* failed address bound checks */ +#define SEGV_PKUERR 4 static char *si_code_str(int si_code) { - if (si_code & SEGV_MAPERR) + if (si_code == SEGV_MAPERR) return "SEGV_MAPERR"; - if (si_code & SEGV_ACCERR) + if (si_code == SEGV_ACCERR) return "SEGV_ACCERR"; - if (si_code & SEGV_BNDERR) + if (si_code == SEGV_BNDERR) return "SEGV_BNDERR"; - if (si_code & SEGV_PKUERR) + if (si_code == SEGV_PKUERR) return "SEGV_PKUERR"; return "UNKNOWN"; }