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: 63285 Delivered-To: patches@linaro.org Received: by 10.112.199.169 with SMTP id jl9csp1586709lbc; Mon, 29 Feb 2016 19:00:38 -0800 (PST) X-Received: by 10.140.231.80 with SMTP id b77mr25409589qhc.56.1456801235604; Mon, 29 Feb 2016 19:00:35 -0800 (PST) Return-Path: Received: from mail-qk0-x236.google.com (mail-qk0-x236.google.com. [2607:f8b0:400d:c09::236]) by mx.google.com with ESMTPS id w107si28893374qge.8.2016.02.29.19.00.35 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 29 Feb 2016 19:00:35 -0800 (PST) Received-SPF: pass (google.com: domain of dave.long@linaro.org designates 2607:f8b0:400d:c09::236 as permitted sender) client-ip=2607:f8b0:400d:c09::236; Authentication-Results: mx.google.com; spf=pass (google.com: domain of dave.long@linaro.org designates 2607:f8b0:400d:c09::236 as permitted sender) smtp.mailfrom=dave.long@linaro.org; dkim=pass header.i=@linaro.org Received: by mail-qk0-x236.google.com with SMTP id x1so64638400qkc.1 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=KDLnScxwkRZs/irMhp9pGAuK2+muUZpg+vgL9qD1HV38j+sj8yvO5O9QvYn+twCfHU TzwX4YIT+teQZYs5xnSal51S5qVjPCfqovyXubGZi86mPFM9mi8BJmyVJotsvfydllqb iunAKor0Ehq5nF4yKb5oh25BNq/YoQ8C0Rk5Ec545RzN3M6I16mPYCgF4VVbKWjJ1Euc qAMEG6QeCmXk0y1u0uRWcicmxFZOZOCzkWV6JBeuuRhQbGpx7cJblddBG6vsThi4+Jzd OibhwNt9Skbzy5fM2WIuQJjSErHQaCC0UMLBq4mbSt5AWnP+U3R1cYIyxWv78wnD3LMs krWg== X-Gm-Message-State: AD7BkJJKn2FwWunFi05bfqaoqQoik0wxEf4bUkjh/AgTQ3BB4Fcfk164u+3ZjEQfzVcFWg7xGHM= X-Received: by 10.55.72.196 with SMTP id v187mr19659351qka.97.1456801234997; Mon, 29 Feb 2016 19:00:34 -0800 (PST) Return-Path: 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 Cc: Dave P Martin , Mark Rutland , Robin Murphy , Ard Biesheuvel , Jens Wiklander , Christoffer Dall , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Yang Shi , Greg Kroah-Hartman , Viresh Kumar , "Suzuki K. Poulose" , Kees Cook , Zi Shen Lim , John Blackwood , Feng Kan , Balamurugan Shanmugam , James Morse , Vladimir Murzin , Mark Salyzyn , Petr Mladek , Andrew Morton , Mark Brown 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> 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(+) -- 2.5.0 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)