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: 62259 Delivered-To: patches@linaro.org Received: by 10.112.43.199 with SMTP id y7csp865145lbl; Thu, 18 Feb 2016 15:48:31 -0800 (PST) X-Received: by 10.55.53.207 with SMTP id c198mr12128994qka.24.1455839311349; Thu, 18 Feb 2016 15:48:31 -0800 (PST) Return-Path: Received: from mail-qg0-x231.google.com (mail-qg0-x231.google.com. [2607:f8b0:400d:c04::231]) by mx.google.com with ESMTPS id w9si192762qhc.10.2016.02.18.15.48.31 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 18 Feb 2016 15:48:31 -0800 (PST) Received-SPF: pass (google.com: domain of dave.long@linaro.org designates 2607:f8b0:400d:c04::231 as permitted sender) client-ip=2607:f8b0:400d:c04::231; Authentication-Results: mx.google.com; spf=pass (google.com: domain of dave.long@linaro.org designates 2607:f8b0:400d:c04::231 as permitted sender) smtp.mailfrom=dave.long@linaro.org; dkim=pass header.i=@linaro.org Received: by mail-qg0-x231.google.com with SMTP id y9so50683693qgd.3 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=jhaaWEobJjpVyj429R3/JppqHxtaPulV069q9S4G4BTRB2PdBK4iFDkbL6cBI+Z5eN GM/H4EK+PW9YryueAoRuKtpI/RwRYoq/CB4y2vrVZokxfBNDjs20B4GToIL5olDi2wbG FSdL/zSjLwI+KqIGf1uCZNUeFWB3DSiH4YXIpmo+M4cWixJ4FCG3vJXNPk1EiYqg0sGp vRsZGjlaD8kPgMeMwsfexmtooa0DFk3HtW63+hNSufoAuu4IsCPM3GUVk+lSbjmqqVgE iTDwBidnGkjIJMMswPNC1ZU2Mq77BBxndDxYoU25pgvlZua0nrzHnjVk2prnmHyLJJzm /HRg== X-Gm-Message-State: AG10YORF+WYB2atf83KEIXBoJAYfv0uMS7f9Rdhjo/NrfijZFTL3xa4wnkcBKtByvRuJ7loiA8g= X-Received: by 10.140.196.196 with SMTP id r187mr12702306qha.60.1455839311092; Thu, 18 Feb 2016 15:48:31 -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 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 Cc: Dave P Martin , Mark Rutland , Marc Zyngier , 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 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> 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)