Received: by 2002:a05:6358:111d:b0:dc:6189:e246 with SMTP id f29csp1965903rwi; Tue, 1 Nov 2022 02:03:04 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6JSRDWyoWCZ99+jcvS9rngECubWzHu3PCygDaxAQC/v3oiO1GE3BTPqzKqXYsygaR00hVK X-Received: by 2002:a17:907:75f4:b0:7ad:b868:ccf2 with SMTP id jz20-20020a17090775f400b007adb868ccf2mr14253934ejc.733.1667293384072; Tue, 01 Nov 2022 02:03:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667293384; cv=none; d=google.com; s=arc-20160816; b=pUk0XwswIiVTh2PEBBne2Us59OhQjwtcb6/nriUdvxRKH9VCmVIemjcxDJLd3pvxpa mIHksdBv2P4PPMu3L1cfgXFaqThEa8/pkYtIknZmARSFHSxcCJvCnqLGFankTx/BieVS ZDyTykKakceQiP16ESXaEPeCFw6FeAsDTi6D1/w1lSBAuweEr3glqul4FRwagtiVzBYT 0HHHrQpgbS5RYNxg2WpMn+bbVNrIZ9qcLDuKp5sXJhMPTg/nPt5e8CJLUBs8VU2ZpnCr vOXEkVzYbUFv0pkKUPwbfsLHSHRd7+NkYbRydI/nV/2ePp6j4qCBKhrBvznJR64MC9K3 BWHw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:references:in-reply-to :subject:cc:to:from:message-id:date:dkim-signature:dkim-signature; bh=CwmF+GF8TFJ1DJcjepgRHGxKQmBCUwUcD5eX9NLO3jQ=; b=1ICX8cHGyqbWY+vxKM2rB27SnX0S0Y4ZtJARcdZ3VUB49XvTywOHhjo3GpIny+sXHA 8mGEuFwUbfGYz/R5btcz6+4E48otkDhKhvKihL+DXqJz7AFytQ15//nem7eraTUezLWN gQ40tYUwzI9XqOXchIJKtDXUt6661Ho2Ttyj4cQsBr3MkkHXC7O2cRkP12jEfRAQ/j6V sH9HbaYuTdOhM8cZsWUH+BcZ8YPNVA1x9p3MRUmK4wqPxNWypmgMI83Y4Z/ckaIjeWj7 blYNUkAHYSvvMho264rwJHeLOI3Bv3exNCnJi1YIX+Sr7o+eD3aXRjg8/iZPlf10Uu/m 9dxQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b="qvWgpbe/"; dkim=neutral (no key) header.i=@suse.de; 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=NONE dis=NONE) header.from=suse.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s4-20020a50d484000000b00447dfae6181si10431939edi.235.2022.11.01.02.02.21; Tue, 01 Nov 2022 02:03:04 -0700 (PDT) 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=@suse.de header.s=susede2_rsa header.b="qvWgpbe/"; dkim=neutral (no key) header.i=@suse.de; 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=NONE dis=NONE) header.from=suse.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229889AbiKAIVs (ORCPT + 97 others); Tue, 1 Nov 2022 04:21:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52488 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229462AbiKAIVr (ORCPT ); Tue, 1 Nov 2022 04:21:47 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0041218394 for ; Tue, 1 Nov 2022 01:21:42 -0700 (PDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id AF0DF1FE4D; Tue, 1 Nov 2022 08:21:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1667290901; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=CwmF+GF8TFJ1DJcjepgRHGxKQmBCUwUcD5eX9NLO3jQ=; b=qvWgpbe/emohvXjwWNSBIyY5uNizh9A+X2Y/scGu9wtK6upAfM+ySEtC2zqYtbswgxG+hm tqHn2snnoRvpFtOi+InpK6dZvkE+HMtKRWLypjWWXJLYmHHKpUu+VXHey01825DdUzmOou 29v0DuUskqHeaXByLr7f7bnHPQW6vx0= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1667290901; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=CwmF+GF8TFJ1DJcjepgRHGxKQmBCUwUcD5eX9NLO3jQ=; b=8yBk+eGkgjLrqU3GH/7ug0JKi1BAZP3oLqWWN5VQESCK6/HveEoDb9p/WzezT1OA4Gsde+ gAsQHSjLIkiAGeCw== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 794911346F; Tue, 1 Nov 2022 08:21:41 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id xp6pHBXXYGMaIQAAMHmgww (envelope-from ); Tue, 01 Nov 2022 08:21:41 +0000 Date: Tue, 01 Nov 2022 09:21:41 +0100 Message-ID: <871qqn84q2.wl-tiwai@suse.de> From: Takashi Iwai To: Steven Rostedt Cc: Takashi Iwai , regressions@lists.linux.dev, linux-kernel@vger.kernel.org, postix@posteo.eu Subject: Re: [REGRESSION 6.0.x / 6.1.x] NULL dereferencing at tracing In-Reply-To: <20221031144850.5522b036@rorschach.local.home> References: <87h6zklb6n.wl-tiwai@suse.de> <20221031144850.5522b036@rorschach.local.home> User-Agent: Wanderlust/2.15.9 (Almost Unreal) Emacs/27.2 Mule/6.0 MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,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 Mon, 31 Oct 2022 19:48:50 +0100, Steven Rostedt wrote: > > On Mon, 31 Oct 2022 08:11:28 +0100 > Takashi Iwai wrote: > > > Hi Steven, > > > > we've got a bug report indicating the NULL dereference at the recent > > tracing changes, showing at the start of KDE. The details including > > the dmesg are found at: > > https://bugzilla.opensuse.org/show_bug.cgi?id=1204705 > > > > It was reported at first for 6.0.3, and confirmed that the problem > > persists with 6.1-rc, too. > > > > The culprit seems to be the commit > > f3ddb74ad0790030c9592229fb14d8c451f4e9a8 > > tracing: Wake up ring buffer waiters on closing of the file > > and reverting it seems fixing the problem. > > > > Could you take a look? > > > > > > Can you apply this to see if it fixes it? > > I'm guessing there's a path to the release of the file descriptor where > the ring buffer isn't allocated (and this expected it to be). > > I'll investigate further to see if I can find that path. For avoiding confusion: the follow up post in this thread https://lore.kernel.org/71829e56-a13f-0462-37a7-a4d64c16f561@posteo.de is from Alex, who is the original bug reporter on openSUSE Bugzilla. The test result looks negative, unfortunately. Takashi > > -- Steve > > diff --git a/kernel/trace/ring_buffer.c b/kernel/trace/ring_buffer.c > index 199759c73519..c1c7ce4c6ddb 100644 > --- a/kernel/trace/ring_buffer.c > +++ b/kernel/trace/ring_buffer.c > @@ -937,6 +937,9 @@ void ring_buffer_wake_waiters(struct trace_buffer *buffer, int cpu) > struct ring_buffer_per_cpu *cpu_buffer; > struct rb_irq_work *rbwork; > > + if (!buffer) > + return; > + > if (cpu == RING_BUFFER_ALL_CPUS) { > > /* Wake up individual ones too. One level recursion */ >