From patchwork Wed Mar 9 05:32:17 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Long X-Patchwork-Id: 63706 Delivered-To: patches@linaro.org Received: by 10.112.199.169 with SMTP id jl9csp2457673lbc; Tue, 8 Mar 2016 21:33:08 -0800 (PST) X-Received: by 10.98.71.92 with SMTP id u89mr42908011pfa.100.1457501588276; Tue, 08 Mar 2016 21:33:08 -0800 (PST) Return-Path: Received: from mail-pa0-x22c.google.com (mail-pa0-x22c.google.com. [2607:f8b0:400e:c03::22c]) by mx.google.com with ESMTPS id g4si9877992pat.65.2016.03.08.21.33.07 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 08 Mar 2016 21:33:08 -0800 (PST) Received-SPF: pass (google.com: domain of dave.long@linaro.org designates 2607:f8b0:400e:c03::22c as permitted sender) client-ip=2607:f8b0:400e:c03::22c; Authentication-Results: mx.google.com; spf=pass (google.com: domain of dave.long@linaro.org designates 2607:f8b0:400e:c03::22c as permitted sender) smtp.mailfrom=dave.long@linaro.org; dkim=pass header.i=@linaro.org Received: by mail-pa0-x22c.google.com with SMTP id fe3so14358424pab.1 for ; Tue, 08 Mar 2016 21:33:07 -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=iRQ1G6clZ1a9ctj97p5/tySW4bj/ZSHOxEj/hJVfzZAsgzfHCZDpz8F3WRTemgKmG2 ZuIioTdlKwI217wwBrW4UQwTAEKzoBqKLdDWPjUQQTf7lSmj06UHh5X7f+Ui+sl7gxuj xFqF0hWciAPu+F5UM4fO0GQIBUyrNjUnwbC0E= 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=l8anRAFQ/RULUgdcc/YFC7Gr+gpmEboc4O/VHhwvWxaXEgp3t0i9MsfIEiY/HWFLPZ 5gF3jd4be7qjz+tkkFf352naDE7TJJeWYT5Ef1gm2f6ZEfRBESMtsC1G2fp6/W89Jyjy Xp3LBet1JdCYLo3WxNpbfbNHtDSComoJfGu0Bui2ULhvJ8acSE1rcjbOvVnj9ZQSs5MV tvvRakOiyp2koSX8TzI1stxuvwY7qoYRMB0fm+k6oITyuF63Txq6+Y1Wxn6w/vSNDrxy nVe4nyZveRsavCrFOMa2MNc0NLfZEpRcsvfxgnUnhtGWOhMTFuky34XxrH7DtFE/lxda GglA== X-Gm-Message-State: AD7BkJJ9MKisgGpI3jznHsc2C+ZIqKPCKCBPGpFQOba8OhqTLzIYJJWtQn97N7hp75/1z2kdDcI= X-Received: by 10.66.237.39 with SMTP id uz7mr46327078pac.141.1457501587830; Tue, 08 Mar 2016 21:33:07 -0800 (PST) Return-Path: Received: from solstice.IMGCGCW.net (110-170-137-3.static.asianet.co.th. [110.170.137.3]) by smtp.googlemail.com with ESMTPSA id v9sm8799041pfi.50.2016.03.08.21.33.00 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 08 Mar 2016 21:33:07 -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 v11 3/9] arm64: add copy_to/from_user to kprobes blacklist Date: Wed, 9 Mar 2016 00:32:17 -0500 Message-Id: <1457501543-24197-4-git-send-email-dave.long@linaro.org> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1457501543-24197-1-git-send-email-dave.long@linaro.org> References: <1457501543-24197-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)