Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp3560302pxb; Mon, 1 Mar 2021 13:21:46 -0800 (PST) X-Google-Smtp-Source: ABdhPJxBX+RqlZwy+09NLrbScQtgovd8I0rHTqhvB+vjFpolc9wd8kJT30FgXMkjtFACvMNap1CF X-Received: by 2002:a17:906:8593:: with SMTP id v19mr18027572ejx.32.1614633705826; Mon, 01 Mar 2021 13:21:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614633705; cv=none; d=google.com; s=arc-20160816; b=WnnNj1naAcEwHVJ4ko8Imm4+GmZh6KaDANdrXVhjqu50enwCOcquuheBL2aMDdWnuB fTrDNpit3s9oG56TekEezlv8CViw23oR1QmhQvNIvfoD2QETHSkt/WygdhBVVxwZZUyG fW2rl+HdAbFYEnWB9cVebOSVtmBsAIeK7BdyADJIZpVTaaAR207dtp87YVdXXHimI0q4 PPIcKvZd2jOc5q8+cokDPyGMJVJzIkpfa+v5ICUFQuPqU9CxBIX5ot4Rgymr6aF0Ytsf RRjZ855VO6mRFbYvWRHLaV4cFPMHa0VHSyVLIdekMKZdAg53tTYcdCPwNCsY8TbznB3l Ugng== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=HCdJAp+e49+2W9DhMuevzeTpme6fi7ke96l53EklY3c=; b=so9uRiYAiE1dCQixc6Tf7djdigOdy3r7uGGZWslJ5d9kZHs3B8CPc5S1mP/fO3Xq9V 1rEpJxz68mps+yRhsy06EGr5DUgxq1U5Tz5F8MJC9EZkrmo4HpiS/HMwaRBD0z8fo/oz 6AtPlCgRJ8XTOR6scvogHWNtbbzR5kNRlilfSq20i4pAjq4pxiW2pxNigsdNxKCwQdG/ 1rLhCr3aOWe7n6eTYaNGiWnDl7PKGkwn1jIkpSGoyAs0sqaM2/mvRpCJr0wZu1W5N/Pi EWbgEf+KOVyH4cgqnOq2O/SL1v6BOKd11BmXPCsdGv/hhFah2r9q4B+mJMcrxLdsd73p xgSA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Pu0+jh+s; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t8si10065755edd.473.2021.03.01.13.21.23; Mon, 01 Mar 2021 13:21:45 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Pu0+jh+s; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243051AbhCAVRK (ORCPT + 99 others); Mon, 1 Mar 2021 16:17:10 -0500 Received: from mail.kernel.org ([198.145.29.99]:51394 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235811AbhCAROC (ORCPT ); Mon, 1 Mar 2021 12:14:02 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 3DDCD65042; Mon, 1 Mar 2021 16:45:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1614617137; bh=gXbvBo7gC3gwCUnskLruRZA2ZXWf8pL0VuSO9q3H7kI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Pu0+jh+sudVj3tCP5KQVHrV3CgY/k08dT1158S6oemOXzq8xYyCNjRTByeIZQfsaR d/Kp4+So5sCS8tEbFKl90qrFEWyrnEka6ufyS7Oi+advwxA2d2WhYe53oUp43y2NcN AkYtpPwDzaRiOKQKsHRMJa/F4qSWDqCj/xADW8h0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, He Zhe , Will Deacon Subject: [PATCH 4.19 215/247] arm64: uprobe: Return EOPNOTSUPP for AARCH32 instruction probing Date: Mon, 1 Mar 2021 17:13:55 +0100 Message-Id: <20210301161042.196645943@linuxfoundation.org> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210301161031.684018251@linuxfoundation.org> References: <20210301161031.684018251@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: He Zhe commit d47422d953e258ad587b5edf2274eb95d08bdc7d upstream. As stated in linux/errno.h, ENOTSUPP should never be seen by user programs. When we set up uprobe with 32-bit perf and arm64 kernel, we would see the following vague error without useful hint. The sys_perf_event_open() syscall returned with 524 (INTERNAL ERROR: strerror_r(524, [buf], 128)=22) Use EOPNOTSUPP instead to indicate such cases. Signed-off-by: He Zhe Link: https://lore.kernel.org/r/20210223082535.48730-1-zhe.he@windriver.com Cc: Signed-off-by: Will Deacon Signed-off-by: Greg Kroah-Hartman --- arch/arm64/kernel/probes/uprobes.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/arch/arm64/kernel/probes/uprobes.c +++ b/arch/arm64/kernel/probes/uprobes.c @@ -41,7 +41,7 @@ int arch_uprobe_analyze_insn(struct arch /* TODO: Currently we do not support AARCH32 instruction probing */ if (mm->context.flags & MMCF_AARCH32) - return -ENOTSUPP; + return -EOPNOTSUPP; else if (!IS_ALIGNED(addr, AARCH64_INSN_SIZE)) return -EINVAL;