From patchwork Thu Feb 18 23:48:16 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Long X-Patchwork-Id: 8355081 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id CC8B99F399 for ; Thu, 18 Feb 2016 23:51:13 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D4BE6203B5 for ; Thu, 18 Feb 2016 23:51:12 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 10C28201EC for ; Thu, 18 Feb 2016 23:51:12 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1aWYKF-0004tY-Hb; Thu, 18 Feb 2016 23:49:35 +0000 Received: from mail-qg0-x229.google.com ([2607:f8b0:400d:c04::229]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1aWYJY-0004DT-2r for linux-arm-kernel@lists.infradead.org; Thu, 18 Feb 2016 23:48:54 +0000 Received: by mail-qg0-x229.google.com with SMTP id b35so49886415qge.0 for ; Thu, 18 Feb 2016 15:48:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=vQGzCmyCrN5UU6kxBkEsLnap27i6pEePd3EDzfboqgQ=; b=TtppajNXdHKVwIqq5ZPbNpUElxqC1zf3QHar/CJJkMkxIPA1ER8qTjOmJITe/cwDYH FcbEmpQ78Eh5ZgaDNFGFZoLwCDU58uvXaJZuFjNUyax/yBIshCGjyGgMIupXzZn6I+oi yvdoATWUwSXP1KclCFFL1RAOOk9tnJBujAGQw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=vQGzCmyCrN5UU6kxBkEsLnap27i6pEePd3EDzfboqgQ=; b=j/psT7gbdUdUiqwSW1jdE07UDpSipPnm2VKpcqwkWU6ZBcEGNcpF/scvrVN85I33t2 MZgvEOmhIzxlOUptWAgxp/9XOx9AioXpT36spNkUdxACNAdj8M8BooSZ6sjO0q8XSVqT GTiLjOBQiNU2kRWizuQ0fXbxqi7i7x53X8hltwGPu7WU3ASvlEHdexl7rJHn1507p+JH g+0ex4SwBMXW6bnBhqP6lO/Fs09hk3YitSiOon5GXNniuGEjxfgMt5/WF4oogdqnC8YO FSYSaZT/QXzz00N/nrdpyAHUX4lhSFfwwCgy5OsECjhAqGeIRXlVJKNUuR235FBXnmwx +row== X-Gm-Message-State: AG10YORH0EpCRfCTUlJvkgM7rt9woqBSF3YmaekAGounzvd1YMFPFjEuDZz+9mbgvn226zK5 X-Received: by 10.140.196.196 with SMTP id r187mr12702306qha.60.1455839311092; Thu, 18 Feb 2016 15:48:31 -0800 (PST) Received: from localhost.localdomain (pool-72-71-243-249.cncdnh.fast00.myfairpoint.net. [72.71.243.249]) by smtp.googlemail.com with ESMTPSA id w70sm3711845qge.13.2016.02.18.15.48.29 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 18 Feb 2016 15:48:30 -0800 (PST) From: David Long To: Catalin Marinas , Will Deacon , Sandeepa Prabhu , William Cohen , Pratyush Anand , Steve Capper , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 3/8] arm64: add copy_to/from_user to kprobes blacklist Date: Thu, 18 Feb 2016 18:48:16 -0500 Message-Id: <1455839301-26464-4-git-send-email-dave.long@linaro.org> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1455839301-26464-1-git-send-email-dave.long@linaro.org> References: <1455839301-26464-1-git-send-email-dave.long@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160218_154852_345291_16B05150 X-CRM114-Status: GOOD ( 10.06 ) X-Spam-Score: -2.7 (--) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , Petr Mladek , Viresh Kumar , John Blackwood , Feng Kan , Zi Shen Lim , Dave P Martin , Yang Shi , Vladimir Murzin , Kees Cook , "Suzuki K. Poulose" , Marc Zyngier , Mark Brown , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Ard Biesheuvel , Greg Kroah-Hartman , Mark Salyzyn , James Morse , Christoffer Dall , Andrew Morton , Robin Murphy , Jens Wiklander , Balamurugan Shanmugam MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: "David A. Long" Currrently taking exceptions when accessing user data from a kprobe'd instruction doesn't work. Avoid this situation by blacklisting the relevant functions. Signed-off-by: David A. Long --- arch/arm64/lib/copy_from_user.S | 1 + arch/arm64/lib/copy_to_user.S | 1 + 2 files changed, 2 insertions(+) diff --git a/arch/arm64/lib/copy_from_user.S b/arch/arm64/lib/copy_from_user.S index 4699cd7..0ac2131 100644 --- a/arch/arm64/lib/copy_from_user.S +++ b/arch/arm64/lib/copy_from_user.S @@ -66,6 +66,7 @@ .endm end .req x5 + .section .kprobes.text,"ax",%progbits ENTRY(__copy_from_user) ALTERNATIVE("nop", __stringify(SET_PSTATE_PAN(0)), ARM64_HAS_PAN, \ CONFIG_ARM64_PAN) diff --git a/arch/arm64/lib/copy_to_user.S b/arch/arm64/lib/copy_to_user.S index 7512bbb..e4eb84c 100644 --- a/arch/arm64/lib/copy_to_user.S +++ b/arch/arm64/lib/copy_to_user.S @@ -65,6 +65,7 @@ .endm end .req x5 + .section .kprobes.text,"ax",%progbits ENTRY(__copy_to_user) ALTERNATIVE("nop", __stringify(SET_PSTATE_PAN(0)), ARM64_HAS_PAN, \ CONFIG_ARM64_PAN)