Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp3090428pxb; Mon, 16 Nov 2020 05:40:36 -0800 (PST) X-Google-Smtp-Source: ABdhPJwb1qcPPcqYc+wL4Fqy/qF0a/FkhBnlwSVOcDSiR/Wpg2nNfQB07iGpiU+kJMIuYbsRp5JW X-Received: by 2002:aa7:cc0e:: with SMTP id q14mr15018186edt.326.1605534036269; Mon, 16 Nov 2020 05:40:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605534036; cv=none; d=google.com; s=arc-20160816; b=j64R+XYwi3PPoJscU2DN2Y6clHMM2UhtHFruf5ZUBdALxh+CzoQCPBeVAKGpdeVdpd NBjH+N/kOeoe5paja1qOo7dKAE4SM8IDZdDvLHokXMlpiJ8X8ayCzT5u3RC+tcGIB8c+ 7JlpzFuynnFlawqBDKI4BEdlqy0lnIEsoSUkSGXPAjWZChYC/VzMAdTWj7vEs9OxXABw BgzuFPPUSyUsuVBxzL85zbbMMz8pA+dudCcgSXaIauloGt+Ltoep+FaTxNYiRNRLT6zg Qz34YRF6Fg2e8M4WpQdm7pPgns7NBxt5ZZgpwE89UExN995h945geQqiwCDjhIWRnfD2 YbiQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=dWeaN/nGyVOapaqnYKOPSjDBSNQCNt5OkvgWb8fXvg0=; b=GsZHfi+Ox7kigxITGgMGBIIFY/uh4rdv1ZJ5rxje3zkTYc1gIb6PS7ZEsH17dVjgw+ je3Jo2mKhJvs8jJK+bwIS1GvOcjfKzArDCSzc1HUCzt/dPTCsiWOjXNSOONbhRBxyS9W NCZ2GQTZZm5XHfEMP86OoGs+m3kaILlqgT4+sYxoMoOEDnt9Bjtb11HOnzwquBjB0ZTc wkmcGMNoRwaZ9RxPLc67FYKPcKe60ZVlF7+F+ESXa9PYPPJ1rtAYbaH9pFMQpVlpLomH mFy74+7TCcQ0kztYby9rDAlcNwM7G6M+75j0lcRcI2TRgnD82oFPJao4/1TgJRZLl7SI TkEg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="t/3JTz1V"; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ga12si12784801ejc.14.2020.11.16.05.40.12; Mon, 16 Nov 2020 05:40:36 -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=@gmail.com header.s=20161025 header.b="t/3JTz1V"; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729327AbgKPNht (ORCPT + 99 others); Mon, 16 Nov 2020 08:37:49 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36442 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728879AbgKPNhs (ORCPT ); Mon, 16 Nov 2020 08:37:48 -0500 Received: from mail-vs1-xe43.google.com (mail-vs1-xe43.google.com [IPv6:2607:f8b0:4864:20::e43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 16E67C0613CF for ; Mon, 16 Nov 2020 05:37:48 -0800 (PST) Received: by mail-vs1-xe43.google.com with SMTP id r14so9112667vsa.13 for ; Mon, 16 Nov 2020 05:37:48 -0800 (PST) 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=dWeaN/nGyVOapaqnYKOPSjDBSNQCNt5OkvgWb8fXvg0=; b=t/3JTz1Vz+AHx+7HmYy6rF69zY2etWreBILyA4tiJReKyMKWqMMvMtYPuOonusasgP /4pd8juJicbK7odNNPg+SpBaPJafsgr9HNaw1iXwWwRcfAkCPvbC4qCuTNrcS83ucMou LwRqlywHPPf1XDkCSMdmWG3PBI/5bFpihhrRpArvezmloFslLfXj/QAJlzhTC74Vf3G4 AAO9Z33OHpp5JEVnV3k9wMdigpqU7hqX+Kx/Zt94VxvsJWluiCj28n3Si3UJtcOhGWNd gHY+kx6lDtjxf6Ar8cL1e8wUg0FgMR9TNzONsW4pFIzHrGPUMVMYudOsJzmFuNin8xoz XpHw== 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=dWeaN/nGyVOapaqnYKOPSjDBSNQCNt5OkvgWb8fXvg0=; b=Nv6g4ga2noaL9XDkIp2K8PT5NSuejVUh14vz7J29X46LLopox6cmhiU0/YVTnmLnbq B7U8cgu+kxdm3Jf96cr+DcHQlqe4FuDoKELL7ugEL+XGMR0PPoMPTWZWeZ9YBZ3u0FjT j8BfDvS9I9e2oKTaZx8I4Jg6FGj1wKnBdzHEoT8Kkc91EWSoGpbhO4AKLbMsJPKkBjQx 6/aOTy6IfTdZbzwnSM606yIDK5dos3fjIY3qxlWDZXKsIZFzA/eEKwdp8cDGrND06P24 tb/GQnnKIEAs5uCNp6y8bl/IXkODzYyjgzqNjlHJ2epP/eLiFDLfYUXv0YaR7xmBqari UL2Q== X-Gm-Message-State: AOAM533eDwnP7X50Li1OLyGy0c9vmcETHJvJZMd7xgZRY1kXCBICJZ6N VYJ1poO8wXrWgf0d8i8dd18aCJj8Fqw= X-Received: by 2002:a67:ed4b:: with SMTP id m11mr7508617vsp.14.1605533866772; Mon, 16 Nov 2020 05:37:46 -0800 (PST) Received: from mail-vs1-f49.google.com (mail-vs1-f49.google.com. [209.85.217.49]) by smtp.gmail.com with ESMTPSA id s137sm2215222vks.36.2020.11.16.05.37.45 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 16 Nov 2020 05:37:45 -0800 (PST) Received: by mail-vs1-f49.google.com with SMTP id z123so9142115vsb.0 for ; Mon, 16 Nov 2020 05:37:45 -0800 (PST) X-Received: by 2002:a67:e210:: with SMTP id g16mr8140769vsa.28.1605533864970; Mon, 16 Nov 2020 05:37:44 -0800 (PST) MIME-Version: 1.0 References: <20201113121502.GB7578@xsang-OptiPlex-9020> In-Reply-To: From: Willem de Bruijn Date: Mon, 16 Nov 2020 08:37:08 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [net] 0b726f6b31: BUG:unable_to_handle_page_fault_for_address To: Alexander Lobakin Cc: "David S. Miller" , Jakub Kicinski , Alexey Kuznetsov , Hideaki YOSHIFUJI , Paolo Abeni , Steffen Klassert , Network Development , linux-kernel , 0day robot , lkp@lists.01.org, kernel test robot Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Nov 16, 2020 at 8:07 AM Alexander Lobakin wrote: > > From: Willem de Bruijn > Date: Fri, 13 Nov 2020 10:51:36 -0500 > > Hi! > > > On Fri, Nov 13, 2020 at 7:00 AM kernel test robot wrote: > >> > >> > >> Greeting, > >> > >> FYI, we noticed the following commit (built with gcc-9): > >> > >> commit: 0b726f6b318a07644b6c2388e6e44406740f4754 ("[PATCH v3 net] net: udp: fix Fast/frag0 UDP GRO") > >> url: https://github.com/0day-ci/linux/commits/Alexander-Lobakin/net-udp-fix-Fast-frag0-UDP-GRO/20201110-052215 > >> base: https://git.kernel.org/cgit/linux/kernel/git/davem/net.git 4e0396c59559264442963b349ab71f66e471f84d > >> > >> in testcase: apachebench > >> version: > >> with following parameters: > >> > >> runtime: 300s > >> concurrency: 2000 > >> cluster: cs-localhost > >> cpufreq_governor: performance > >> ucode: 0x7000019 > >> > >> test-description: apachebench is a tool for benchmarking your Apache Hypertext Transfer Protocol (HTTP) server. > >> test-url: https://httpd.apache.org/docs/2.4/programs/ab.html > >> > >> > >> on test machine: 16 threads Intel(R) Xeon(R) CPU D-1541 @ 2.10GHz with 48G memory > >> > >> caused below changes (please refer to attached dmesg/kmsg for entire log/backtrace): > >> > >> > >> If you fix the issue, kindly add following tag > >> Reported-by: kernel test robot > >> > >> > >> [ 28.582714] BUG: unable to handle page fault for address: fffffffffffffffa > >> [ 28.590164] #PF: supervisor read access in kernel mode > >> [ 28.590164] #PF: error_code(0x0000) - not-present page > >> [ 28.590165] PGD c7e20d067 P4D c7e20d067 PUD c7e20f067 PMD 0 > >> [ 28.590169] Oops: 0000 [#1] SMP PTI > >> [ 28.590171] CPU: 15 PID: 0 Comm: swapper/15 Not tainted 5.10.0-rc2-00373-g0b726f6b318a #1 > >> [ 28.590172] Hardware name: Supermicro SYS-5018D-FN4T/X10SDV-8C-TLN4F, BIOS 1.1 03/02/2016 > >> [ 28.590177] RIP: 0010:__udp4_lib_rcv+0x547/0xbe0 > >> [ 28.590178] Code: 74 0a f6 45 3c 80 74 04 44 8b 4d 28 48 8b 55 58 48 83 e2 fe 74 07 8b 52 7c 85 d2 75 06 8b 95 90 00 00 00 48 8b be f0 04 00 00 <44> 8b 58 0c 8b 48 10 55 41 55 44 89 de 41 51 41 89 d1 44 89 d2 e8 > >> [ 28.590179] RSP: 0018:ffffc900003b4bb8 EFLAGS: 00010246 > >> [ 28.590180] RAX: ffffffffffffffee RBX: 0000000000000011 RCX: ffff888c7bc580e2 > >> [ 28.590181] RDX: 0000000000000002 RSI: ffff88810ddc8000 RDI: ffffffff82d68f00 > >> [ 28.590182] RBP: ffff888c7bf8f800 R08: 00000000000003b7 R09: 0000000000000000 > >> [ 28.590182] R10: 0000000000003500 R11: 0000000000000000 R12: ffff888c7bc580e2 > >> [ 28.590183] R13: ffffffff82e072b0 R14: ffffffff82d68f00 R15: 0000000000000034 > >> [ 28.590184] FS: 0000000000000000(0000) GS:ffff888c7fdc0000(0000) knlGS:0000000000000000 > >> [ 28.590185] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 > >> [ 28.590186] CR2: fffffffffffffffa CR3: 0000000c7e20a006 CR4: 00000000003706e0 > >> [ 28.590186] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 > >> [ 28.590187] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 > >> [ 28.590187] Call Trace: > >> [ 28.590189] > >> [ 28.590193] ip_protocol_deliver_rcu+0xc5/0x1c0 > >> [ 28.590196] ip_local_deliver_finish+0x4b/0x60 > >> [ 28.738714] ip_local_deliver+0x6e/0x140 > >> [ 28.738717] ip_sublist_rcv_finish+0x57/0x80 > >> [ 28.738719] ip_sublist_rcv+0x199/0x240 > >> [ 28.750730] ip_list_rcv+0x13a/0x160 > >> [ 28.750733] __netif_receive_skb_list_core+0x2a9/0x2e0 > >> [ 28.750736] netif_receive_skb_list_internal+0x1d3/0x320 > >> [ 28.764743] gro_normal_list+0x19/0x40 > >> [ 28.764747] napi_complete_done+0x68/0x160 > >> [ 28.773197] igb_poll+0x63/0x320 > >> [ 28.773198] net_rx_action+0x136/0x3a0 > >> [ 28.773201] __do_softirq+0xe1/0x2c3 > >> [ 28.773204] asm_call_irq_on_stack+0x12/0x20 > >> [ 28.773205] > >> [ 28.773208] do_softirq_own_stack+0x37/0x40 > >> [ 28.773211] irq_exit_rcu+0xd2/0xe0 > >> [ 28.773213] common_interrupt+0x74/0x140 > >> [ 28.773216] asm_common_interrupt+0x1e/0x40 > >> [ 28.773219] RIP: 0010:cpuidle_enter_state+0xd2/0x360 > > > > This was expected. This v3 of the patch has already been superseded by > > one that addresses this lookup: > > Wait. This page fault happens on IP receive, which is performed after > all GRO processing. At this point, all headers are pulled to skb->head, > and no GRO helpers are needed to access them. > The function that causes that, __udp4_lib_rcv(), uses ip_hdr() a lot, > and it's safe. There should be another questionable point. Right, patch v3 calls skb_gro_network_header from __udp4_lib_lookup_skb, which is called from __udp4_lib_rcv, the function at which the crash is reported. @@ -534,7 +534,7 @@ static inline struct sock *__udp4_lib_lookup_skb(struct sk_buff *skb, __be16 sport, __be16 dport, struct udp_table *udptable) { - const struct iphdr *iph = ip_hdr(skb); + const struct iphdr *iph = skb_gro_network_header(skb);