From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B8705C2B9F4 for ; Tue, 22 Jun 2021 07:13:19 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 843B760698 for ; Tue, 22 Jun 2021 07:13:19 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 843B760698 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.ibm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Content-Type: Content-Transfer-Encoding:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date:Message-ID:References: Cc:To:Subject:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=RhBVyudeUl0PCFxJY8TyqIEjyLi8i/A7W6b+Yx28iVk=; b=LrWPbFkJBPMMiN4jK7DZ2EpHsJ fRgCuiOFQvj/5uzin+FTUDglSyj+yT27BwXNpfks6Yi35gjgY0/iPcB7iUuWvBZshoxWZmXVvA2Ba T+VIl1jUtzpCqDr1e+4UcUdQ6jeH62+vI6G6yCfKUf3KF974uSYitP4+Yl7k0QLKItjlfU+dq6w53 nQYDmkmIvOAwhSsZX9Zx8tk4lTjUXtkXf4U1fp1eK6Y7zXnprBwb3T1jIv7Cq03lXZVxJhaKLW9HI O6IRqtrub0sN4O8ltMSun0qd+SKtSIUy45vvEbne+iEKhOGuTiT7BNQGnx4QrACZWPzESQr3fvzAG k1Tiqxkw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lvaZK-005xf3-3x; Tue, 22 Jun 2021 07:11:34 +0000 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1lvaZG-005xdt-HD for linux-arm-kernel@lists.infradead.org; Tue, 22 Jun 2021 07:11:32 +0000 Received: from pps.filterd (m0127361.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 15M73tJ4026652; Tue, 22 Jun 2021 03:11:10 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : subject : to : cc : references : message-id : date : mime-version : in-reply-to : content-type : content-transfer-encoding; s=pp1; bh=DmFy3Ba0GQktUP84N/Xh5kSVt/I7Z6RAqewGIHWSsOw=; b=ZFtoLB7lFXWOH+lMB/4NA1zlcFoElVyxQA0SywE0eGzHTkc6AzneeunZU/mv8bMNDu/S bzHVNnLUqojO582zOEYskwIHrAmn/Qlzi3/zDQrny95C6KezT7T/PJRjwUIwz91wUt/Z Sqeb+GZL2Wq0LITa0z/2df5RuTNxhZJ/TxsbDn0Drv+vS3AqaGohGqk1q7Zpgefb2Mb1 tc2c6MPvz8tdDyvVFfPZmPz15GD9HEXlLl4aaB+rC32smNhgulzM174f3tDBP+LUIoAA DeTDRFndeml1kpaHOipplXK3sHpdZUPD+ijjW++QMA6jkVN81/5EYuWtC6hku3LLAzHL uw== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 39ba85hm9j-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 22 Jun 2021 03:11:10 -0400 Received: from m0127361.ppops.net (m0127361.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.43/8.16.0.43) with SMTP id 15M73old025895; Tue, 22 Jun 2021 03:11:10 -0400 Received: from ppma03ams.nl.ibm.com (62.31.33a9.ip4.static.sl-reverse.com [169.51.49.98]) by mx0a-001b2d01.pphosted.com with ESMTP id 39ba85hm8t-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 22 Jun 2021 03:11:10 -0400 Received: from pps.filterd (ppma03ams.nl.ibm.com [127.0.0.1]) by ppma03ams.nl.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 15M784nb015650; Tue, 22 Jun 2021 07:11:08 GMT Received: from b06avi18626390.portsmouth.uk.ibm.com (b06avi18626390.portsmouth.uk.ibm.com [9.149.26.192]) by ppma03ams.nl.ibm.com with ESMTP id 399878993d-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 22 Jun 2021 07:11:08 +0000 Received: from b06wcsmtp001.portsmouth.uk.ibm.com (b06wcsmtp001.portsmouth.uk.ibm.com [9.149.105.160]) by b06avi18626390.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 15M79ngk32899492 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 22 Jun 2021 07:09:49 GMT Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id EE11AA405F; Tue, 22 Jun 2021 07:11:05 +0000 (GMT) Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 7DCDDA405C; Tue, 22 Jun 2021 07:10:59 +0000 (GMT) Received: from [9.199.39.114] (unknown [9.199.39.114]) by b06wcsmtp001.portsmouth.uk.ibm.com (Postfix) with ESMTP; Tue, 22 Jun 2021 07:10:59 +0000 (GMT) From: Ravi Bangoria Subject: Re: [PATCH bpf-next 0/1] arm64: Add BPF exception tables To: Alexei Starovoitov Cc: Daniel Borkmann , Alexei Starovoitov , Catalin Marinas , Will Deacon , Zi Shen Lim , Martin KaFai Lau , Song Liu , Yonghong Song , Andrii Nakryiko , John Fastabend , KP Singh , Jean-Philippe Brucker , linux-arm-kernel , bpf , "Naveen N. Rao" , Ravi Bangoria References: <20200728152122.1292756-1-jean-philippe@linaro.org> Message-ID: <3bc13a55-c0c4-e2fe-762c-794138adebf6@linux.ibm.com> Date: Tue, 22 Jun 2021 12:40:57 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.1 MIME-Version: 1.0 In-Reply-To: Content-Language: en-US X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: R2pniiIf8D9jys73ZpSG380JQPRrTxja X-Proofpoint-GUID: TenCV2jNI72BffM_rrIWYqe56dqr0-H8 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.391, 18.0.790 definitions=2021-06-22_04:2021-06-21, 2021-06-22 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 phishscore=0 lowpriorityscore=0 suspectscore=0 malwarescore=0 bulkscore=0 adultscore=0 mlxlogscore=999 spamscore=0 clxscore=1015 impostorscore=0 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104190000 definitions=main-2106220043 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210622_001130_858671_3019D54A X-CRM114-Status: GOOD ( 25.97 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi Alexei, On 6/18/21 10:04 PM, Alexei Starovoitov wrote: > On Wed, Jun 16, 2021 at 11:58 PM Ravi Bangoria > wrote: >> >> $ dmesg >> [ 166.864325] BUG: unable to handle page fault for address: 0000000000d12345 >> [ 166.864336] #PF: supervisor read access in kernel mode >> [ 166.864338] #PF: error_code(0x0000) - not-present page >> >> 0xd12345 is unallocated userspace address. Similarly, I also tried with > > that's unfortunately expected, since this is a user address. Sure. fwiw, it works with bpf_probe_read(). >> p->dte = (void *)0xffffffffc1234567 after confirming it's not allocated >> to kernel or any module address. I see the same failure with it too. > > This one is surprising though. Sounds like a bug in exception table > construction. Can you debug it to see what's causing it? > First check that do_kern_addr_fault() is invoked in this case. > And then fixup_exception() and why search_bpf_extables() > cannot find it. It seems the commit 4c5de127598e1 ("bpf: Emit explicit NULL pointer checks for PROBE_LDX instructions.") added few instructions before actual load but does not consider those additional instruction while calculating extable offset. Let me prepare a fix. > Separately we probably need to replace the NULL check > with addr >= TASK_SIZE_MAX to close this issue though it's a bit artificial. Ravi _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel