Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp1859866ybl; Thu, 15 Aug 2019 02:27:07 -0700 (PDT) X-Google-Smtp-Source: APXvYqwFruEuDm3Ig8rRCFkMEutDBcX65YlSJaSqgKHGftrPFWdY80ydbEgYGfyepNQl8W1NV79p X-Received: by 2002:a63:484d:: with SMTP id x13mr2785696pgk.122.1565861227338; Thu, 15 Aug 2019 02:27:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565861227; cv=none; d=google.com; s=arc-20160816; b=hVd4VrQtmJgSsOV8Tq4HIwEgsucWTjnZ2zthXLMJu1Rl1hEy5X9A8tnsqAcEATo9Qe nfbQQdT2mANivT2RanouCwxycFKrpXAJ27vq+Rv5+S6n9HrH5x45BfBCY0oEtp6muy3O lRKcm1gptv7HObAQd7q24sSZZlLQtAW6FGxvBCxQpdMnzthwHZY+s9Bel8rd5RbI9jtO FWaiqmUp0PXHfIH1pLfvTWqoed+KC5LvKHY6dOErx3WHHMF1syADUhishHz+gQz56sZJ 4W/fZAYE91EAuR8rc65/Mao6GiYE57GF1dpmW5t5iKHIencOLcydi9owxStjugHEvFZZ /ICQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=aZmlSbSoGN2ekqovELptFGKofnjDQpd1ygPvVVtI/RI=; b=EqczEYnhYTYXop2tcHLr6pZtAP9qrFwDuL/DHFXBu6cX1u6pPZt3OmBREbRWLRWV10 RGjbeWWMdkDG/HSkeIHL7UzeiH2SNDSyWWV1sNW61EmlmNkqV2+DW5q2Yn4GInSdUf/i VrMaQd5cJnJnsmhT49JrsYeQUY6sekMzV8OOU4c5QZjsE/H7iHGd1C8TdQRvxI1wiTxw nzt0KuD+DVGLks4N3aEx14aiBBoKpbl/o9iudMd69iIW9N+LyDQM272lu2ZqjrH6bW40 ddbh1gBRP+RrgwgvxfxoGdg1BkQ4ioOwMTUvqlQaVF5io47VhIX54L4kURJkLV3Vq5Nf vR4g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 1si1626670plv.44.2019.08.15.02.26.39; Thu, 15 Aug 2019 02:27:07 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730269AbfHOIw0 (ORCPT + 99 others); Thu, 15 Aug 2019 04:52:26 -0400 Received: from www62.your-server.de ([213.133.104.62]:39516 "EHLO www62.your-server.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726027AbfHOIwZ (ORCPT ); Thu, 15 Aug 2019 04:52:25 -0400 Received: from sslproxy05.your-server.de ([78.46.172.2]) by www62.your-server.de with esmtpsa (TLSv1.2:DHE-RSA-AES256-GCM-SHA384:256) (Exim 4.89_1) (envelope-from ) id 1hyBUW-0002oE-KV; Thu, 15 Aug 2019 10:52:16 +0200 Received: from [178.193.45.231] (helo=pc-63.home) by sslproxy05.your-server.de with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.89) (envelope-from ) id 1hyBUW-0009OD-DW; Thu, 15 Aug 2019 10:52:16 +0200 Subject: Re: WARNING in is_bpf_text_address To: Hillf Danton , syzbot Cc: "ast@kernel.org" , "bpf@vger.kernel.org" , "bvanassche@acm.org" , "dvyukov@google.com" , "hawk@kernel.org" , "jakub.kicinski@netronome.com" , "johannes.berg@intel.com" , "johannes@sipsolutions.net" , "john.fastabend@gmail.com" , "linux-kernel@vger.kernel.org" , "longman@redhat.com" , "netdev@vger.kernel.org" , "syzkaller-bugs@googlegroups.com" , will@kernel.org References: <20190811083658.10748-1-hdanton@sina.com> From: Daniel Borkmann Message-ID: Date: Thu, 15 Aug 2019 10:52:15 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.2 MIME-Version: 1.0 In-Reply-To: <20190811083658.10748-1-hdanton@sina.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Authenticated-Sender: daniel@iogearbox.net X-Virus-Scanned: Clear (ClamAV 0.100.3/25542/Thu Aug 15 10:25:56 2019) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 8/11/19 10:36 AM, Hillf Danton wrote: > On Sun, 11 Aug 2019 08:24:09 +0800 >> >> syzbot has found a reproducer for the following crash on: >> >> HEAD commit: 451577f3 Merge tag 'kbuild-fixes-v5.3-3' of git://git.kern.. >> git tree: upstream >> console output: https://syzkaller.appspot.com/x/log.txt?x=120850a6600000 >> kernel config: https://syzkaller.appspot.com/x/.config?x=2031e7d221391b8a >> dashboard link: https://syzkaller.appspot.com/bug?extid=bd3bba6ff3fcea7a6ec6 >> compiler: clang version 9.0.0 (/home/glider/llvm/clang 80fee25776c2fb61e74c1ecb1a523375c2500b69) >> syz repro: https://syzkaller.appspot.com/x/repro.syz?x=130ffe4a600000 >> C reproducer: https://syzkaller.appspot.com/x/repro.c?x=17137d2c600000 >> >> The bug was bisected to: >> >> commit a0b0fd53e1e67639b303b15939b9c653dbe7a8c4 >> Author: Bart Van Assche >> Date: Thu Feb 14 23:00:46 2019 +0000 >> >> locking/lockdep: Free lock classes that are no longer in use Hey Bart, don't think it's related in any way to your commit. I'll allocate some time on working on this issue today, thanks! >> bisection log: https://syzkaller.appspot.com/x/bisect.txt?x=152f6a9da00000 >> final crash: https://syzkaller.appspot.com/x/report.txt?x=172f6a9da00000 >> console output: https://syzkaller.appspot.com/x/log.txt?x=132f6a9da00000 >> >> IMPORTANT: if you fix the bug, please add the following tag to the commit: >> Reported-by: syzbot+bd3bba6ff3fcea7a6ec6@syzkaller.appspotmail.com >> Fixes: a0b0fd53e1e6 ("locking/lockdep: Free lock classes that are no longer in use") >> >> WARNING: CPU: 0 PID: 9604 at kernel/bpf/core.c:851 bpf_jit_free+0x1a8/0x1f0 >> Kernel panic - not syncing: panic_on_warn set ... >> CPU: 0 PID: 9604 Comm: kworker/0:5 Not tainted 5.3.0-rc3+ #71 >> Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS >> Google 01/01/2011 >> Workqueue: events bpf_prog_free_deferred >> Call Trace: >> __dump_stack lib/dump_stack.c:77 [inline] >> dump_stack+0x1d8/0x2f8 lib/dump_stack.c:113 >> panic+0x25c/0x799 kernel/panic.c:219 >> __warn+0x22f/0x230 kernel/panic.c:576 >> report_bug+0x190/0x290 lib/bug.c:186 >> BUG: unable to handle page fault for address: fffffbfff4001000 >> #PF: supervisor read access in kernel mode >> #PF: error_code(0x0000) - not-present page >> PGD 21ffee067 P4D 21ffee067 PUD 21ffed067 PMD 936de067 PTE 0 >> Oops: 0000 [#1] PREEMPT SMP KASAN >> CPU: 0 PID: 9604 Comm: kworker/0:5 Not tainted 5.3.0-rc3+ #71 >> Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS >> Google 01/01/2011 >> Workqueue: events bpf_prog_free_deferred >> RIP: 0010:bpf_get_prog_addr_region kernel/bpf/core.c:537 [inline] >> RIP: 0010:bpf_tree_comp kernel/bpf/core.c:600 [inline] >> RIP: 0010:__lt_find include/linux/rbtree_latch.h:115 [inline] >> RIP: 0010:latch_tree_find include/linux/rbtree_latch.h:208 [inline] >> RIP: 0010:bpf_prog_kallsyms_find kernel/bpf/core.c:674 [inline] >> RIP: 0010:is_bpf_text_address+0x201/0x3b0 kernel/bpf/core.c:709 >> Code: 85 c4 f5 ff 4d 39 f4 76 10 e8 7b c2 f5 ff 49 83 c7 10 eb 46 0f 1f 44 >> 00 00 4c 89 e0 48 c1 e8 03 48 b9 00 00 00 00 00 fc ff df <0f> b6 04 08 84 >> c0 75 7d 41 8b 1c 24 48 c1 e3 0c 4c 01 e3 48 89 df >> RSP: 0018:ffff888097eff828 EFLAGS: 00010806 >> RAX: 1ffffffff4001000 RBX: 0000000000000001 RCX: dffffc0000000000 >> RDX: ffff88809f1e0280 RSI: ffffffffff7a5520 RDI: ffffffffa0008000 >> RBP: ffff888097eff860 R08: ffffffff817dc73b R09: 0000000000000001 >> R10: fffffbfff117be6d R11: 0000000000000000 R12: ffffffffa0008000 >> R13: 0000000000000000 R14: ffffffffff7a5520 R15: ffff88809a46b2f8 >> FS: 0000000000000000(0000) GS:ffff8880aea00000(0000) knlGS:0000000000000000 >> CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 >> CR2: fffffbfff4001000 CR3: 0000000095d73000 CR4: 00000000001406f0 >> DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 >> DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 >> Call Trace: > [pruned] > > Pair bpf_prog_kallsyms_del_all() with bpf_prog_free() to silence > WARNING at kernel/bpf/core.c:851, see __bpf_prog_release() in > net/core/filter.c for why. > > --- a/kernel/bpf/core.c > +++ b/kernel/bpf/core.c > @@ -1987,6 +1987,7 @@ void bpf_prog_free(struct bpf_prog *fp) > { > struct bpf_prog_aux *aux = fp->aux; > > + bpf_prog_kallsyms_del_all(fp); > INIT_WORK(&aux->work, bpf_prog_free_deferred); > schedule_work(&aux->work); > } > --- a/kernel/bpf/syscall.c > +++ b/kernel/bpf/syscall.c > @@ -1328,7 +1328,6 @@ static void __bpf_prog_put(struct bpf_pr > perf_event_bpf_event(prog, PERF_BPF_EVENT_PROG_UNLOAD, 0); > /* bpf_prog_free_id() must be called first */ > bpf_prog_free_id(prog, do_idr_lock); > - bpf_prog_kallsyms_del_all(prog); > btf_put(prog->aux->btf); > kvfree(prog->aux->func_info); > bpf_prog_free_linfo(prog); > -- >