Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp2284112rwb; Thu, 8 Dec 2022 23:29:22 -0800 (PST) X-Google-Smtp-Source: AA0mqf4bgm8+5VYJLP4/ec8BAsgKNrsoH754trOf9AN08+CYgDqtCcinBPnjOgjqnXQjEf/lrk51 X-Received: by 2002:a17:906:1146:b0:7ae:cda1:76d0 with SMTP id i6-20020a170906114600b007aecda176d0mr3655859eja.15.1670570962151; Thu, 08 Dec 2022 23:29:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670570962; cv=none; d=google.com; s=arc-20160816; b=a+glCGvjLxnLuj95FIYHu9ougl+6cJ04Csj/6b0/ckJqvwwr6Y3C59bBLo7Iv4yukn ba0NIsJL1VUcMzjiBpWfgtIw9iu5PY4XQMZH9+KEGlDTUYe41aQyK0g8lrDHHSZK7uv6 WUA77LJACt2aR7rLhvFMnw0CrbtLI3C95QaeLX7lU5AajikkreNlz/YX208x3EId7+a4 nHaxsrPTq5FFvAqSf359TX2jq/8V4XSXNh9lFu25NcAyiR7E04YWjxxFTB5Ag+GBzJYN PbzCt5bbj/KDSpvlz6H+e56fpMQNxr92WNX9hukyNvYGjdyQxdxJOxHViBuKp3M2JOye mm5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:date:from:dkim-signature; bh=l5+rNzDfs1zsypdoRqJxdk+waRpxcBnDQcEOJe8SCHM=; b=UIW2lfPU6CeEK3nrSyR7kSKeXVL6RHkUBcCw51FRKv0gZMQyX4h6pa0lZTWmdf9pIT X8DEwHWNOYcSfHuKjhcMjUouckSb+08bf1DlUKtEJtELgzvZRXuxwFTdh2mnyx9grYxw 8uUEh9+SALWMbeeZSreQ6N57CiLIMF1H5zVygdlHrJxYiG8ieCSjCHlp2QSvOIWJpozk PF6kph+fbPnGPj+95tEEDiZ8ng5rr953HS9NWEVeErUNCLD+x3Wo9wuBRObabkuUDFi6 YBY9+rfMj2tVgvx6AgxdDjr5O/GAM2UBaDe5MqkYad8ccrV6/c1xn1I49QjafQbU4rLk H32w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=n11oX8Rz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ww2-20020a170907084200b007a953d421bbsi585880ejb.322.2022.12.08.23.29.04; Thu, 08 Dec 2022 23:29:22 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=n11oX8Rz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S229760AbiLIHJq (ORCPT + 74 others); Fri, 9 Dec 2022 02:09:46 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52636 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229512AbiLIHJo (ORCPT ); Fri, 9 Dec 2022 02:09:44 -0500 Received: from mail-wm1-x334.google.com (mail-wm1-x334.google.com [IPv6:2a00:1450:4864:20::334]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 042BB25C49; Thu, 8 Dec 2022 23:09:42 -0800 (PST) Received: by mail-wm1-x334.google.com with SMTP id v7so2904210wmn.0; Thu, 08 Dec 2022 23:09:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:date:from:from:to :cc:subject:date:message-id:reply-to; bh=l5+rNzDfs1zsypdoRqJxdk+waRpxcBnDQcEOJe8SCHM=; b=n11oX8Rz9D6UWbDalnNpX6HxE7SvzadtkFPJa5QD8b90Eee3KsWJD1CSqAnNkV00mD h4euS6LoKlURhSoMTCdev/5GEIvQnZCvvCzGWTnGHRzBiOHzAtCXQwAy/hWp6aYKMO1r Hy33EvzZe/w7SR+no0EpmkyckFFGdsUXx6aKCqm1U+4ms/W57RhhGgYUf2Ddd+IJ+Azv kHopm2CnKlCw+/QArRxbcEN8wPjS0SdMf6exxTkeUzW2AUuK2YVbYClyqeUQJDw579Gh nmSn7XPGnywricthZv+HmOC7uiqP38RMdnsIA3BHd7eSA1sL3xOHl3RuApopLwaAyOus /Idg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:date:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=l5+rNzDfs1zsypdoRqJxdk+waRpxcBnDQcEOJe8SCHM=; b=4bclhTZF3IHYHPKwt03ndobZlfw4havKIHTEtMNxB7w8lKzwBiKYWpnr6pdoKKwBNf HhCx8sD5M9KIjAXyNWsm+kUYMkI/EZx7CZa6AcWVnMP11/AhnOetb49oUdWx83fn/uSR MrwCdZ+LTDTDJUbZTycK7OO/e75IGz0en3rd0Vuiww61qJX8YM+fo5m4SzdGAxqaKX0j aXWtPXqws8YCMLL0iu/agZIu2WXFUYKAHFX5MHt39wcPQqz/o2e4U69njMsCyBGSzFT5 xV01DbFPMGxy8tc8YqbZfwXHlXYOqKxxQ4lJVkPa0Vm4TuFU9yWlja2CknEKJjKWDZZy xITw== X-Gm-Message-State: ANoB5pntDHGuhO4OOnH1SATRxRirwRwkt4E77FyL8u0CWV6GfNcDW9Ly UGCFdBaF5WH3uEX2M83Lgj8HicUU2yMeLw== X-Received: by 2002:a05:600c:6899:b0:3d1:cf66:3afa with SMTP id fn25-20020a05600c689900b003d1cf663afamr3748540wmb.19.1670569780354; Thu, 08 Dec 2022 23:09:40 -0800 (PST) Received: from krava ([83.240.62.58]) by smtp.gmail.com with ESMTPSA id t6-20020a05600c41c600b003b4935f04a4sm1094320wmh.5.2022.12.08.23.09.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Dec 2022 23:09:39 -0800 (PST) From: Jiri Olsa X-Google-Original-From: Jiri Olsa Date: Fri, 9 Dec 2022 08:09:36 +0100 To: Jiri Olsa Cc: Alexei Starovoitov , Hao Sun , Peter Zijlstra , bpf , Alexei Starovoitov , Daniel Borkmann , John Fastabend , Andrii Nakryiko , Martin KaFai Lau , Song Liu , Yonghong Song , KP Singh , Stanislav Fomichev , Hao Luo , David Miller , Jakub Kicinski , Jesper Dangaard Brouer , Linux Kernel Mailing List , netdev , Thorsten Leemhuis Subject: Re: BUG: unable to handle kernel paging request in bpf_dispatcher_xdp Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Dec 09, 2022 at 12:02:24AM +0100, Jiri Olsa wrote: > On Thu, Dec 08, 2022 at 11:26:45PM +0100, Jiri Olsa wrote: > > On Thu, Dec 08, 2022 at 07:06:59PM +0100, Jiri Olsa wrote: > > > On Thu, Dec 08, 2022 at 09:48:52AM -0800, Alexei Starovoitov wrote: > > > > On Wed, Dec 7, 2022 at 11:57 AM Alexei Starovoitov > > > > wrote: > > > > > > > > > > On Tue, Dec 6, 2022 at 7:18 AM Jiri Olsa wrote: > > > > > > > > > > > > On Tue, Dec 06, 2022 at 02:46:43PM +0800, Hao Sun wrote: > > > > > > > Hao Sun 于2022年12月6日周二 11:28写道: > > > > > > > > > > > > > > > > Hi, > > > > > > > > > > > > > > > > The following crash can be triggered with the BPF prog provided. > > > > > > > > It seems the verifier passed some invalid progs. I will try to simplify > > > > > > > > the C reproducer, for now, the following can reproduce this: > > > > > > > > > > > > > > > > HEAD commit: ab0350c743d5 selftests/bpf: Fix conflicts with built-in > > > > > > > > functions in bpf_iter_ksym > > > > > > > > git tree: bpf-next > > > > > > > > console log: https://pastebin.com/raw/87RCSnCs > > > > > > > > kernel config: https://pastebin.com/raw/rZdWLcgK > > > > > > > > Syz reproducer: https://pastebin.com/raw/4kbwhdEv > > > > > > > > C reproducer: https://pastebin.com/raw/GFfDn2Gk > > > > > > > > > > > > > > > > > > > > > > Simplified C reproducer: https://pastebin.com/raw/aZgLcPvW > > > > > > > > > > > > > > Only two syscalls are required to reproduce this, seems it's an issue > > > > > > > in XDP test run. Essentially, the reproducer just loads a very simple > > > > > > > prog and tests run repeatedly and concurrently: > > > > > > > > > > > > > > r0 = bpf$PROG_LOAD(0x5, &(0x7f0000000640)=@base={0x6, 0xb, > > > > > > > &(0x7f0000000500)}, 0x80) > > > > > > > bpf$BPF_PROG_TEST_RUN(0xa, &(0x7f0000000140)={r0, 0x0, 0x0, 0x0, 0x0, > > > > > > > 0x0, 0xffffffff, 0x0, 0x0, 0x0, 0x0, 0x0}, 0x48) > > > > > > > > > > > > > > Loaded prog: > > > > > > > 0: (18) r0 = 0x0 > > > > > > > 2: (18) r6 = 0x0 > > > > > > > 4: (18) r7 = 0x0 > > > > > > > 6: (18) r8 = 0x0 > > > > > > > 8: (18) r9 = 0x0 > > > > > > > 10: (95) exit > > > > > > > > > > > > hi, > > > > > > I can reproduce with your config.. it seems related to the > > > > > > recent static call change: > > > > > > c86df29d11df bpf: Convert BPF_DISPATCHER to use static_call() (not ftrace) > > > > > > > > > > > > I can't reproduce when I revert that commit.. Peter, any idea? > > > > > > > > > > Jiri, > > > > > > > > > > I see your tested-by tag on Peter's commit c86df29d11df. > > > > > I assume you're actually tested it, but > > > > > this syzbot oops shows that even empty bpf prog crashes, > > > > > so there is something wrong with that commit. > > > > > > > > > > What is the difference between this new kconfig and old one that > > > > > you've tested? > > > > I attached the diff, 'config-issue' is the one that reproduces the issue > > > > > > > > > > > > I'm trying to understand the severity of the issues and > > > > > whether we need to revert that commit asap since the merge window > > > > > is about to start. > > > > > > > > Jiri, Peter, > > > > > > > > ping. > > > > > > > > cc-ing Thorsten, since he's tracking it now. > > > > > > > > The config has CONFIG_X86_KERNEL_IBT=y. > > > > Is it related? > > > > > > sorry for late reply.. I still did not find the reason, > > > but I did not try with IBT yet, will test now > > > > no difference with IBT enabled, can't reproduce the issue > > > > ok, scratch that.. the reproducer got stuck on wifi init :-\ > > after I fix that I can now reproduce on my local config with > IBT enabled or disabled.. it's something else I'm getting the error also when reverting the static call change, looking for good commit, bisecting I'm getting fail with: f0c4d9fc9cc9 (tag: v6.1-rc4) Linux 6.1-rc4 v6.1-rc1 is ok jirka