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=-2.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS 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 982A6C48BE8 for ; Fri, 18 Jun 2021 16:34:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 64EA6613D5 for ; Fri, 18 Jun 2021 16:34:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235534AbhFRQge (ORCPT ); Fri, 18 Jun 2021 12:36:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45592 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235935AbhFRQgd (ORCPT ); Fri, 18 Jun 2021 12:36:33 -0400 Received: from mail-lj1-x22c.google.com (mail-lj1-x22c.google.com [IPv6:2a00:1450:4864:20::22c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 900B7C061574 for ; Fri, 18 Jun 2021 09:34:23 -0700 (PDT) Received: by mail-lj1-x22c.google.com with SMTP id d13so14772586ljg.12 for ; Fri, 18 Jun 2021 09:34:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Lkx42xvDJRPSSnKdE8DLKotr/K3bpuE6WK8sAqlkMFA=; b=kqJZynKRAB1GJSoqQ8pKRtKMM9MKibVCAbqQgExwErxnzyoc3eMU+kNItLgXShxPAz ACNpJA0irAaJWzgXrrJQohoa8/c0o2I6Pkffffv1xo/GOW1RDYMhppf295+ZvCaQlavU nU7isK9YGn7LZeYzfqhuU1I4OIy9Z9vtMenHRc/Wnvqeo4TJ7aFbEpPV4+USdEbSdRee 3LTqXParE3sHX7bEi1AcetYqKRWQaMgWATIxGzJV+fowM8rFVJrgGhz/7DQ5tGjjspzN 9YV2XvUY9QbpXpq9BzUg5Ue0kcmOtzawtjxoXqRwrl/jiqUu2wiEIavXeJpDtNMcrs2T pqdA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Lkx42xvDJRPSSnKdE8DLKotr/K3bpuE6WK8sAqlkMFA=; b=KJBpD+IrTjw9SmFfhwjoBbxyMEolSYY+GBqHMhcqkt5QosB5uACP16AunoGbFqX8oq PCozdZukrQTFGWWB9GL65weRNMbWXkQC+IwC0o0AHqZgxHjCwCsGusdTcG+qstHVNvlU jRBKuscT64Olx80k9U5asQ1hKMFvifB4ZEKkHw0RjFjexDZHEOzkubolN/qD4hPm7Vuu s8J7Iex90cuyUcvPimpqht4RAHzJ/aGfjiJBfsDXnpOGeAtlZH8OlW+IegoouKDnIaU4 R+Ov9odLYcrlakaentQpBDU3Tua9qwphMlFq4UuuvQ6XqaUtx9badxqOfyIVAbjB+sR2 A0hw== X-Gm-Message-State: AOAM533x2qfZgUH3kWA/1bJJIps4z0QBQiXfVfAXod9c31qZIk+wMMEH Z5hW3QChdqaZfItymPkW9/UqJQ5YkAMQOSnbp/A= X-Google-Smtp-Source: ABdhPJxsgzCMHGRE3Ma/2pyFgGPrqFfc7/nFHMvYmphpGnBcbM7SVnyZ1TYWqgKxfPO4vS308VQ+CehePK4cD9PiP1s= X-Received: by 2002:a05:651c:102a:: with SMTP id w10mr9874798ljm.486.1624034061960; Fri, 18 Jun 2021 09:34:21 -0700 (PDT) MIME-Version: 1.0 References: <20200728152122.1292756-1-jean-philippe@linaro.org> In-Reply-To: From: Alexei Starovoitov Date: Fri, 18 Jun 2021 09:34:10 -0700 Message-ID: Subject: Re: [PATCH bpf-next 0/1] arm64: Add BPF exception tables To: Ravi Bangoria 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" Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: bpf@vger.kernel.org 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. > 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. Separately we probably need to replace the NULL check with addr >= TASK_SIZE_MAX to close this issue though it's a bit artificial. 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=-0.7 required=3.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED 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 17577C48BDF for ; Fri, 18 Jun 2021 16:35:59 +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 DB5C2613D5 for ; Fri, 18 Jun 2021 16:35:58 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DB5C2613D5 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.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-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:Subject:Message-ID:Date:From: In-Reply-To:References:MIME-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=4pFOyQlBZ74S6evDlsJ7/j97KW7xR/tobETPIk/QViA=; b=nXUM5g7cMIQFEA 3+RNQoIyn4EZLeSGULZfwZaeb57iRfN43CRNlKMtkVjHykspGiwCq7FPCJSFQAwY2lq0DIw63rnLs ntBvJqlesCcPELjR0vs2eXpr5pe4xhuSgPylXVlTY3dPtv8PgKjwrAoWV1sijyHsF4peOeeQWLr58 DV4z3AxplLq7X886VRAlc6/UobEOh942Gj1pSgXM8BOK3QQzadKFE7EG/7klhq8GK62Po61dBao74 BG13bRSDdJnHut1fgLOpxyg8l1jKiFPlk/PNPLSOcNqvmoRF4wyhDj53JnE6pxvCFyCtFvqxRP6qT J1GGKbbSX9HH/hGVnaQw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1luHRr-00Exgj-9c; Fri, 18 Jun 2021 16:34:27 +0000 Received: from mail-lj1-x22a.google.com ([2a00:1450:4864:20::22a]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1luHRo-00Exg9-DB for linux-arm-kernel@lists.infradead.org; Fri, 18 Jun 2021 16:34:25 +0000 Received: by mail-lj1-x22a.google.com with SMTP id x14so14820689ljp.7 for ; Fri, 18 Jun 2021 09:34:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Lkx42xvDJRPSSnKdE8DLKotr/K3bpuE6WK8sAqlkMFA=; b=kqJZynKRAB1GJSoqQ8pKRtKMM9MKibVCAbqQgExwErxnzyoc3eMU+kNItLgXShxPAz ACNpJA0irAaJWzgXrrJQohoa8/c0o2I6Pkffffv1xo/GOW1RDYMhppf295+ZvCaQlavU nU7isK9YGn7LZeYzfqhuU1I4OIy9Z9vtMenHRc/Wnvqeo4TJ7aFbEpPV4+USdEbSdRee 3LTqXParE3sHX7bEi1AcetYqKRWQaMgWATIxGzJV+fowM8rFVJrgGhz/7DQ5tGjjspzN 9YV2XvUY9QbpXpq9BzUg5Ue0kcmOtzawtjxoXqRwrl/jiqUu2wiEIavXeJpDtNMcrs2T pqdA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Lkx42xvDJRPSSnKdE8DLKotr/K3bpuE6WK8sAqlkMFA=; b=HuKIV90Y7fJtDpV4di3kRS2yZOGIrBDP0SkmhkrlkHfCwlPsZ09b2XSEJ9DGsJdzD5 LkXXigPOp3sWKJ25UyZZjA1wcQl14wBZm15NlsHLqDwGk3iOdLWalV6LN8OjdTF9yf+j 5AkR/4l40wI2U6ho5rJIKEtbyPdmHa8I2Caj56VKszt3c37Sbl5w1vAiu6QpXriGukbU 8L4zbh3dkeNIRAK/XXmQwAE6K3+NsR0w/MH8wEC9z2g5vQxQmj8iIMCQEztofiwZu0SY Ho4XsQ6RvSBvlklms95QLgMNfC0cgWLo9v4YoGjQbSJx4wVXp8ywzP8kCKfyWLgl5o3O OdRw== X-Gm-Message-State: AOAM533Xi5arfq/GafZxdW9Hhp6MKYrLAQ8KvM5Mi6c3xV2wyQt8TxJV 5Kmu0S5nKouQc7Gdt6qFAx/ZjWRD8SE4EP6In30= X-Google-Smtp-Source: ABdhPJxsgzCMHGRE3Ma/2pyFgGPrqFfc7/nFHMvYmphpGnBcbM7SVnyZ1TYWqgKxfPO4vS308VQ+CehePK4cD9PiP1s= X-Received: by 2002:a05:651c:102a:: with SMTP id w10mr9874798ljm.486.1624034061960; Fri, 18 Jun 2021 09:34:21 -0700 (PDT) MIME-Version: 1.0 References: <20200728152122.1292756-1-jean-philippe@linaro.org> In-Reply-To: From: Alexei Starovoitov Date: Fri, 18 Jun 2021 09:34:10 -0700 Message-ID: Subject: Re: [PATCH bpf-next 0/1] arm64: Add BPF exception tables To: Ravi Bangoria 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" X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210618_093424_491411_83745FD5 X-CRM114-Status: GOOD ( 13.64 ) 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-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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. > 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. Separately we probably need to replace the NULL check with addr >= TASK_SIZE_MAX to close this issue though it's a bit artificial. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel