From patchwork Tue Mar 1 02:57:21 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Long X-Patchwork-Id: 8461281 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 4ACDAC0553 for ; Tue, 1 Mar 2016 03:03:08 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 6C04B2021F for ; Tue, 1 Mar 2016 03:03:07 +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 9CE16201EC for ; Tue, 1 Mar 2016 03:03:06 +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 1aaaZ0-0004Vc-DP; Tue, 01 Mar 2016 03:01:30 +0000 Received: from mail-qk0-x22f.google.com ([2607:f8b0:400d:c09::22f]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1aaaYS-0003wz-6D for linux-arm-kernel@lists.infradead.org; Tue, 01 Mar 2016 03:00:57 +0000 Received: by mail-qk0-x22f.google.com with SMTP id s5so64644180qkd.0 for ; Mon, 29 Feb 2016 19:00:35 -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=R+R2gpncdHRRbXIYZ8fAUydJhE0taN3HLKtOawiZUec2lkvZd2v3M6bqRj+0X8JmBm 484lfIg342m9dKtHVH/aaZ13DmQ16v1tcmAKL739m0LWWnoKziZaElbL9LM9a7/6Hb8A yrJUeyzAxfgbz6vr5RgeFoQpyjiUp7AOlQvM0= 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=QEVhejKEHym5Csw7K6PW1uHJPt7FrCoYaJ2jf7X4NyiEtvjp7bu+2gLO1giG2J+KgH vazpgwbbYtJN926cEumXsBMAAWGkWN+jBN5FdHPH7IN3j8DzYxcxvma2R3oA1a6GZkWo TsP+KTZ6m3O/ok8tF0YKOtakZLn1Adu6/7ZuivuTrsjtqAI101sfcZldYNQ8H1lEfiur 8NnlgufR87UTcfgePvMjQJq1Nl3yR0ynBxGv46mjZL2MkR8RyDTp28ve5uVG6fKxX7aG ADxlwPEIjwnGd6xddUM3CR0br5rzW6NVzeB9V8+N1AuHqyble6T804HSRH2yWPY2pbt0 DU+Q== X-Gm-Message-State: AD7BkJLsbgF01CCTRiMCgtMgELpMTP+bNvef+b70E+nrxDmc6vyebCx4tze/WPPEK2zGXR+o X-Received: by 10.55.72.196 with SMTP id v187mr19659351qka.97.1456801234997; Mon, 29 Feb 2016 19:00:34 -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 h5sm12195344qge.48.2016.02.29.19.00.33 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 29 Feb 2016 19:00:34 -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, Marc Zyngier Subject: [PATCH v10 3/9] arm64: add copy_to/from_user to kprobes blacklist Date: Mon, 29 Feb 2016 21:57:21 -0500 Message-Id: <1456801047-29014-4-git-send-email-dave.long@linaro.org> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1456801047-29014-1-git-send-email-dave.long@linaro.org> References: <1456801047-29014-1-git-send-email-dave.long@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160229_190056_453286_9B7A7ED2 X-CRM114-Status: GOOD ( 10.41 ) 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" , 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)