Received: by 10.213.65.68 with SMTP id h4csp897887imn; Tue, 27 Mar 2018 10:47:51 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+I+tdUJ6bQqYXgx9fwsy1h2JsiCNdX0vX9TXj9tEp/Mv2X+MDnmHu2nWrdzNtvDTPiJyFx X-Received: by 10.99.140.87 with SMTP id q23mr189274pgn.258.1522172871484; Tue, 27 Mar 2018 10:47:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522172871; cv=none; d=google.com; s=arc-20160816; b=Y5/ZTupBd6iD+TPs3ZmfVmikQwEO58RJGcW3+OYcTt1XhQGspIKxnnMuhN/Bi0XJ1Q BUCxtTHkzz5QSZaiI6qoVjaqD/vyoi9BdZZD+e3J9dzusOhW7DLvWU8Fpe03Grro6J7a k3dEkfkai4J40v7oOdDNxaVVO0BLVgwW3wLwsjr6G+WgrTmefi55S+z9dYw9SbTKqT0o RNxWAztHe4u2HKQLTxlZyKVSAKpzIFtDu0vSdOl9HcZQIrOlhcOxcYG1SDVw3/BTPe9A Uz4s4b2rTULqlzGRuQ0WkWE1e8rxIsyMQutBxIp2yPPlrb8lV+W5Zf3DQGraQqHFD/rN UIow== 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=7jUaMHxAW7aYARxVRhGZxGnK+kiyfNI4XD8UMBgr1H0=; b=UblxCy5moHllIBxyQXLhDujBMF+pyS+FDyyBj98AItcSLGjDnUSNx0pB5wmrb7HuHJ 9FyvY+qG7/M8OpblxfEdVZR/tuKSkdFbCx7waC3mJKk5xlqYr/WIJ5h17WojkG7pQ5Ir PJP7JJZiNvcO6E1QKm83YHpDN+qrpQyB/c1QS4fvkz3ojIib9GqQ6/NuGHuZmo/kMZCc N3ScZnSzefIWUFkH7TWSRbPwTrmgfLQ/MDgtz4zJd4WwKXdZp7mTplwYWUUs87YKSgB5 7cxH5IWgFEDNfHEEBqhon4++Qzb/jXsQAHyzj6RMc8/9HI9kQX01Ke6YAbOleE98J651 pUJg== 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 i21si1304196pfk.34.2018.03.27.10.47.37; Tue, 27 Mar 2018 10:47:51 -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 S1753864AbeC0QdK (ORCPT + 99 others); Tue, 27 Mar 2018 12:33:10 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:43742 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753852AbeC0QdH (ORCPT ); Tue, 27 Mar 2018 12:33:07 -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 190991163; Tue, 27 Mar 2018 16:33:06 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Andy Lutomirski , Borislav Petkov , Dave Hansen , Linus Torvalds , Peter Zijlstra , Thomas Gleixner , Ingo Molnar Subject: [PATCH 4.9 61/67] selftests/x86/protection_keys: Fix syscall NR redefinition warnings Date: Tue, 27 Mar 2018 18:27:53 +0200 Message-Id: <20180327162730.988300693@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: Andy Lutomirski commit 693cb5580fdb026922363aa103add64b3ecd572e upstream. On new enough glibc, the pkey syscalls numbers are available. Check first before defining them to avoid warnings like: protection_keys.c:198:0: warning: "SYS_pkey_alloc" redefined Signed-off-by: Andy Lutomirski Cc: Borislav Petkov Cc: Dave Hansen Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: stable@vger.kernel.org Link: http://lkml.kernel.org/r/1fbef53a9e6befb7165ff855fc1a7d4788a191d6.1509794321.git.luto@kernel.org Signed-off-by: Ingo Molnar Signed-off-by: Greg Kroah-Hartman --- tools/testing/selftests/x86/protection_keys.c | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) --- a/tools/testing/selftests/x86/protection_keys.c +++ b/tools/testing/selftests/x86/protection_keys.c @@ -188,17 +188,29 @@ void lots_o_noops_around_write(int *writ #define u64 uint64_t #ifdef __i386__ -#define SYS_mprotect_key 380 -#define SYS_pkey_alloc 381 -#define SYS_pkey_free 382 + +#ifndef SYS_mprotect_key +# define SYS_mprotect_key 380 +#endif +#ifndef SYS_pkey_alloc +# define SYS_pkey_alloc 381 +# define SYS_pkey_free 382 +#endif #define REG_IP_IDX REG_EIP #define si_pkey_offset 0x14 + #else -#define SYS_mprotect_key 329 -#define SYS_pkey_alloc 330 -#define SYS_pkey_free 331 + +#ifndef SYS_mprotect_key +# define SYS_mprotect_key 329 +#endif +#ifndef SYS_pkey_alloc +# define SYS_pkey_alloc 330 +# define SYS_pkey_free 331 +#endif #define REG_IP_IDX REG_RIP #define si_pkey_offset 0x20 + #endif void dump_mem(void *dumpme, int len_bytes)