Received: by 10.213.65.68 with SMTP id h4csp898287imn; Tue, 27 Mar 2018 10:48:21 -0700 (PDT) X-Google-Smtp-Source: AIpwx48cRRx28QhcHZFN6GD8mvuSjctVaSL9dGYdruI5K16CqKUQGJDLxaq1xY4qyj+G6AK4QdUg X-Received: by 2002:a17:902:e5:: with SMTP id a92-v6mr288783pla.26.1522172901455; Tue, 27 Mar 2018 10:48:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522172901; cv=none; d=google.com; s=arc-20160816; b=0zwodPA2OeqQuqWlaMndvRWjzIBFyMTUjCpNJTvPpC60YnQT4RmKtgo2uLylVmPWtF U5+j38lIMFcMjOvAtnCsZNjauqKc59PJbmuzF+3VjyfnPtdLSOwj8HvUl5QenzJA+sly BoL/2/7CBZREKQXNnvymrl6aRwyhRRcDBe8Yia8Hn5nHMh6tt7xx8oTvMQyURQpirZJU E3NsVg/tjJq71+uGd9c3kfZx2ZM5UILsZKCoQU62xql7GNdRNvJxQJsL5TovvE21GuGR byWicwreh+1HeB1egdH5C5DT9grMqiTnt55wdEUN/4kgk4MY8I1f6aCXnzgjxKiOTrkN Yrrg== 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=gfvmjOm5FMEfoG5KL95GWOWwQFYGVlSABjXuO1cgYzk=; b=swiIdPRKNxmNDasxfW7HWxU1rgURpzdIDE8jHxmfJHJo1d/QFKOgk7S1dXyRg3S9hh l7Q7+9kM9nECxfCgNVVyCsZcmzIhlOqO28PSt57dvRfCPCB9zLE8WWdmIUeTww1vly1F Onq+WEg6B0m8lw0OlvD++0sDlwdnRSErINjOKQyykXSuBKy3jUJQxHTHAOWkSOSM1n1q AN8Wj9DGUcRH2e2uEXYUFQg7x3f62MJcOVto8VO2wZWkRtkaYIktlE/topDHJdcGZxVE Tv0R6hZ+S68nHm6nJwO7cqEgTb47U2BBIPKRoCT4qIJFblUFfEqTKPyMGtshiSBfoh6v 1PSA== 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 i72si1137149pgd.705.2018.03.27.10.48.07; Tue, 27 Mar 2018 10:48:21 -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 S1753850AbeC0QdH (ORCPT + 99 others); Tue, 27 Mar 2018 12:33:07 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:43726 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753839AbeC0QdF (ORCPT ); Tue, 27 Mar 2018 12:33:05 -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 5E5AE113B; Tue, 27 Mar 2018 16:33:04 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dave Hansen , Ingo Molnar , Shuah Khan Subject: [PATCH 4.9 60/67] selftests, x86, protection_keys: fix wrong offset in siginfo Date: Tue, 27 Mar 2018 18:27:52 +0200 Message-Id: <20180327162730.911979074@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: Dave Hansen commit 2195bff041486eb7fcceaf058acaedcd057efbdc upstream. The siginfo contains a bunch of information about the fault. For protection keys, it tells us which protection key's permissions were violated. The wrong offset in here leads to reading garbage and thus failures in the tests. We should probably eventually move this over to using the kernel's headers defining the siginfo instead of a hard-coded offset. But, for now, just do the simplest fix. Signed-off-by: Dave Hansen Cc: Ingo Molnar Cc: Shuah Khan Signed-off-by: Shuah Khan Signed-off-by: Greg Kroah-Hartman --- tools/testing/selftests/x86/protection_keys.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/tools/testing/selftests/x86/protection_keys.c +++ b/tools/testing/selftests/x86/protection_keys.c @@ -192,7 +192,7 @@ void lots_o_noops_around_write(int *writ #define SYS_pkey_alloc 381 #define SYS_pkey_free 382 #define REG_IP_IDX REG_EIP -#define si_pkey_offset 0x18 +#define si_pkey_offset 0x14 #else #define SYS_mprotect_key 329 #define SYS_pkey_alloc 330