Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp8130280imu; Tue, 4 Dec 2018 03:32:00 -0800 (PST) X-Google-Smtp-Source: AFSGD/Wn4LkbdpMoyVu7KHo6M/Ykp20WWmuyXefY8YxSseF0YUoQUI+HSz8KjpIrWeA0rFWVkKZ/ X-Received: by 2002:a63:ee0e:: with SMTP id e14mr16101701pgi.8.1543923120550; Tue, 04 Dec 2018 03:32:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543923120; cv=none; d=google.com; s=arc-20160816; b=cmZGM5BNrhU6alymOwh1+DUjbBBe7R5TTsRe/ewiAr/JuwtB/3/YxaK3dRH9qX44I7 lxfymkOCxAfrbxEKw/4GLV29CvKRrHJ2HRq+F8IMqL+RjekU+n2zi/r6y0FvheBeTWAr dVc9hkgPbvVJCUHpopthrMsb9Qwms5ZnS0LZXlequLYnLDbQNHSZKhqZ7a79/7QwQGaY JblmTkONuYe1okgHHTnAaYxcsEQIKS/YxC17Y6UXotFJSutwAvkTv0dIrdbMyK1F7318 xOj7W7P71jVhapbe8l/0zzdb1Z+PjprNFdtzQeIC++rSbLJKTF81vgPcDTov4fSG2XDn ktrQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=92xDfjhYf8Qh2ZySCZeuIi3vdxVBo7QEQ3PSVBRhtvE=; b=A0JzUiQGQZX79t+vIAne37CZJMbsfDDU5MnleKt9rAv0WI8rfdehGeYdTPnhHSaAVb UyXAXtijXdRt7kxIszS9QnGVJkmnlhH+ftCiQc42N7PDoYV1UuyVhTXCuKYXinWF34gj +JK2JVh6lzeo5IRvi1lGd9BsHJip91rsF96dtXWGnnVhZiiC1gQtScXNjqdNwTAR/LKX wA6pWFuCLgNScm0rqK29stj8HBYxPDdPWEYq8t4Z5xRvQpIBAVS35QBh4sbbKGwaQh+4 g3ZIQpeXJV9HZYKvqxCwx3fIx+EvwUK3vM9KZtkLp1WieHe6fdj67lBYR1CY58k0SZjW GqUQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=hbasjvvl; 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 g83si17487957pfb.278.2018.12.04.03.31.45; Tue, 04 Dec 2018 03:32:00 -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=hbasjvvl; 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 S1726686AbeLDK5P (ORCPT + 99 others); Tue, 4 Dec 2018 05:57:15 -0500 Received: from mail.kernel.org ([198.145.29.99]:40940 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726678AbeLDK5N (ORCPT ); Tue, 4 Dec 2018 05:57:13 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (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 55DBD214C1; Tue, 4 Dec 2018 10:57:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1543921032; bh=N/Xxol0nufN7cziuzM0OQ9tbKczP8/jHAeaarKn83fg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hbasjvvlLaZV1CGg20dnPT8P+mTIpYpYu0RRzH6AihnSh1lzbe0YYM6U91zQyUQop gf8aHTkZfyDqMdLS4xZ/Gmtr1wlPWFnojdQ3cHOCaq/UyzWhlRiFGF65f1baF9xgtY VV386ggio2GZOZ0KVjyVtsWQUIaheekEnD2hEi7Y= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Thomas Gleixner , Ingo Molnar , Peter Zijlstra , Andy Lutomirski , Linus Torvalds , Jiri Kosina , Tom Lendacky , Josh Poimboeuf , Andrea Arcangeli , David Woodhouse , Tim Chen , Andi Kleen , Dave Hansen , Casey Schaufler , Asit Mallick , Arjan van de Ven , Jon Masters , Waiman Long , Dave Stewart , Kees Cook Subject: [PATCH 4.19 054/139] ptrace: Remove unused ptrace_may_access_sched() and MODE_IBRS Date: Tue, 4 Dec 2018 11:48:55 +0100 Message-Id: <20181204103652.198716270@linuxfoundation.org> X-Mailer: git-send-email 2.19.2 In-Reply-To: <20181204103649.950154335@linuxfoundation.org> References: <20181204103649.950154335@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.19-stable review patch. If anyone has any objections, please let me know. ------------------ From: Thomas Gleixner tglx@linutronix.de commit 46f7ecb1e7359f183f5bbd1e08b90e10e52164f9 upstream The IBPB control code in x86 removed the usage. Remove the functionality which was introduced for this. Signed-off-by: Thomas Gleixner Reviewed-by: Ingo Molnar Cc: Peter Zijlstra Cc: Andy Lutomirski Cc: Linus Torvalds Cc: Jiri Kosina Cc: Tom Lendacky Cc: Josh Poimboeuf Cc: Andrea Arcangeli Cc: David Woodhouse Cc: Tim Chen Cc: Andi Kleen Cc: Dave Hansen Cc: Casey Schaufler Cc: Asit Mallick Cc: Arjan van de Ven Cc: Jon Masters Cc: Waiman Long Cc: Greg KH Cc: Dave Stewart Cc: Kees Cook Cc: stable@vger.kernel.org Link: https://lkml.kernel.org/r/20181125185005.559149393@linutronix.de Signed-off-by: Greg Kroah-Hartman --- include/linux/ptrace.h | 17 ----------------- kernel/ptrace.c | 10 ---------- 2 files changed, 27 deletions(-) --- a/include/linux/ptrace.h +++ b/include/linux/ptrace.h @@ -64,15 +64,12 @@ extern void exit_ptrace(struct task_stru #define PTRACE_MODE_NOAUDIT 0x04 #define PTRACE_MODE_FSCREDS 0x08 #define PTRACE_MODE_REALCREDS 0x10 -#define PTRACE_MODE_SCHED 0x20 -#define PTRACE_MODE_IBPB 0x40 /* shorthands for READ/ATTACH and FSCREDS/REALCREDS combinations */ #define PTRACE_MODE_READ_FSCREDS (PTRACE_MODE_READ | PTRACE_MODE_FSCREDS) #define PTRACE_MODE_READ_REALCREDS (PTRACE_MODE_READ | PTRACE_MODE_REALCREDS) #define PTRACE_MODE_ATTACH_FSCREDS (PTRACE_MODE_ATTACH | PTRACE_MODE_FSCREDS) #define PTRACE_MODE_ATTACH_REALCREDS (PTRACE_MODE_ATTACH | PTRACE_MODE_REALCREDS) -#define PTRACE_MODE_SPEC_IBPB (PTRACE_MODE_ATTACH_REALCREDS | PTRACE_MODE_IBPB) /** * ptrace_may_access - check whether the caller is permitted to access @@ -90,20 +87,6 @@ extern void exit_ptrace(struct task_stru */ extern bool ptrace_may_access(struct task_struct *task, unsigned int mode); -/** - * ptrace_may_access - check whether the caller is permitted to access - * a target task. - * @task: target task - * @mode: selects type of access and caller credentials - * - * Returns true on success, false on denial. - * - * Similar to ptrace_may_access(). Only to be called from context switch - * code. Does not call into audit and the regular LSM hooks due to locking - * constraints. - */ -extern bool ptrace_may_access_sched(struct task_struct *task, unsigned int mode); - static inline int ptrace_reparented(struct task_struct *child) { return !same_thread_group(child->real_parent, child->parent); --- a/kernel/ptrace.c +++ b/kernel/ptrace.c @@ -261,9 +261,6 @@ static int ptrace_check_attach(struct ta static int ptrace_has_cap(struct user_namespace *ns, unsigned int mode) { - if (mode & PTRACE_MODE_SCHED) - return false; - if (mode & PTRACE_MODE_NOAUDIT) return has_ns_capability_noaudit(current, ns, CAP_SYS_PTRACE); else @@ -331,16 +328,9 @@ ok: !ptrace_has_cap(mm->user_ns, mode))) return -EPERM; - if (mode & PTRACE_MODE_SCHED) - return 0; return security_ptrace_access_check(task, mode); } -bool ptrace_may_access_sched(struct task_struct *task, unsigned int mode) -{ - return __ptrace_may_access(task, mode | PTRACE_MODE_SCHED); -} - bool ptrace_may_access(struct task_struct *task, unsigned int mode) { int err;