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 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id F3640C433F5 for ; Fri, 4 Mar 2022 16:24:28 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 2A5EB1B3C; Fri, 4 Mar 2022 17:23:37 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 2A5EB1B3C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1646411067; bh=xQRaFe0QgjjH/oFRVt6rl/YcevCZNJMqzSWaICq1rTw=; h=Date:From:To:Subject:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=SuktPs+i7JJdK1nrlOZbGNAjptTJK5xPXzXZH+OX1kzWrdVLLO2qWZ3vB3pRjH9Nt ajfnZdhaJjI7nEfN+HxSHfYvU/UxW6ONPk707GFPNDPC2NBNSTy6Uaha8lS8u1nYuM dkU6n9a2UACnfGxe/2A3Yely+aZ7ppBmNx7Lj6p0= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id CBE33F800FA; Fri, 4 Mar 2022 17:23:36 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 2B62DF801EC; Fri, 4 Mar 2022 17:23:36 +0100 (CET) Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 2893EF800F2 for ; Fri, 4 Mar 2022 17:23:29 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 2893EF800F2 Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="jfx1wbe0"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="onoG9MRx" Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out1.suse.de (Postfix) with ESMTP id B3FB121124; Fri, 4 Mar 2022 16:23:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1646411009; 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=5/hNJOqDfBSZwXE0K1TFXxWpcydZiYIJ7gXWElhDr3o=; b=jfx1wbe0HvfxWOIA/0UPqaT3XbamqGaFW83JuMQlG+an6wmPGVCxwFPqIizSymxIVebmk2 U8VoDKaNXZj1UBjJ60UQul5TjbasE9dWhogsVPGEiO6RizXVpN7t1CVoRBWEl6nkEa1igH aKp7HrOuAMxdGQtdi+1bjQenrPnHqYo= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1646411009; 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=5/hNJOqDfBSZwXE0K1TFXxWpcydZiYIJ7gXWElhDr3o=; b=onoG9MRxYjf/uHijsGVES+r0SrjgViiV7qQYZgho8fjpuPl3IJ+qlqqTlPhZnWkxkV+Uun EQz2YOnNxmtJigBQ== Received: from alsa1.suse.de (alsa1.suse.de [10.160.4.42]) by relay2.suse.de (Postfix) with ESMTP id AE18AA3B84; Fri, 4 Mar 2022 16:23:29 +0000 (UTC) Date: Fri, 04 Mar 2022 17:23:29 +0100 Message-ID: From: Takashi Iwai To: Takashi Sakamoto Subject: Re: [PATCH v2] ALSA: firewire-lib: fix uninitialized flag for AV/C deferred transaction In-Reply-To: <20220304125647.78430-1-o-takashi@sakamocchi.jp> References: <20220304125647.78430-1-o-takashi@sakamocchi.jp> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.8 Emacs/25.3 (x86_64-suse-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Cc: alsa-devel@alsa-project.org, clemens@ladisch.de X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" On Fri, 04 Mar 2022 13:56:47 +0100, Takashi Sakamoto wrote: > > AV/C deferred transaction was supported at a commit 00a7bb81c20f ("ALSA: > firewire-lib: Add support for deferred transaction") while 'deferrable' > flag can be uninitialized for non-control/notify AV/C transactions. > UBSAN reports it: > > kernel: ================================================================================ > kernel: UBSAN: invalid-load in /build/linux-aa0B4d/linux-5.15.0/sound/firewire/fcp.c:363:9 > kernel: load of value 158 is not a valid value for type '_Bool' > kernel: CPU: 3 PID: 182227 Comm: irq/35-firewire Tainted: P OE 5.15.0-18-generic #18-Ubuntu > kernel: Hardware name: Gigabyte Technology Co., Ltd. AX370-Gaming 5/AX370-Gaming 5, BIOS F42b 08/01/2019 > kernel: Call Trace: > kernel: > kernel: show_stack+0x52/0x58 > kernel: dump_stack_lvl+0x4a/0x5f > kernel: dump_stack+0x10/0x12 > kernel: ubsan_epilogue+0x9/0x45 > kernel: __ubsan_handle_load_invalid_value.cold+0x44/0x49 > kernel: fcp_response.part.0.cold+0x1a/0x2b [snd_firewire_lib] > kernel: fcp_response+0x28/0x30 [snd_firewire_lib] > kernel: fw_core_handle_request+0x230/0x3d0 [firewire_core] > kernel: handle_ar_packet+0x1d9/0x200 [firewire_ohci] > kernel: ? handle_ar_packet+0x1d9/0x200 [firewire_ohci] > kernel: ? transmit_complete_callback+0x9f/0x120 [firewire_core] > kernel: ar_context_tasklet+0xa8/0x2e0 [firewire_ohci] > kernel: tasklet_action_common.constprop.0+0xea/0xf0 > kernel: tasklet_action+0x22/0x30 > kernel: __do_softirq+0xd9/0x2e3 > kernel: ? irq_finalize_oneshot.part.0+0xf0/0xf0 > kernel: do_softirq+0x75/0xa0 > kernel: > kernel: > kernel: __local_bh_enable_ip+0x50/0x60 > kernel: irq_forced_thread_fn+0x7e/0x90 > kernel: irq_thread+0xba/0x190 > kernel: ? irq_thread_fn+0x60/0x60 > kernel: kthread+0x11e/0x140 > kernel: ? irq_thread_check_affinity+0xf0/0xf0 > kernel: ? set_kthread_struct+0x50/0x50 > kernel: ret_from_fork+0x22/0x30 > kernel: > kernel: ================================================================================ > > This commit fixes the bug. The bug has no disadvantage for the non- > control/notify AV/C transactions since the flag has an effect for AV/C > response with INTERIM (0x0f) status which is not used for the transactions > in AV/C general specification. > > Fixes: 00a7bb81c20f ("ALSA: firewire-lib: Add support for deferred transaction") > Signed-off-by: Takashi Sakamoto Thanks, applied. Takashi