From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796025364; b=31NVowIojRXMV5WZyKuU306NHp3KmjlvwDNIsunKbkjJlI5CsPoxsCjN6uJS30gK+WE4 /LtujuRM2ANUhaUeoAbsjkVH+K2SnHkFPdxs/Gu+HCjdTcqHx8y5RK5HzYoctBoD8Q2kV BJ0882wcTh+AKQMvAJ4lcXKOh0rQ0+z1g3O1Pl1xhn+bn//bVedwtNvL/cEq+T4QiUE2e FfUr0tM+p/aiWdbbI2HGGXLMB7hE1AwIzgHke213PK1TUTDZURjOOmOgPdmyui2Duhl1M X3UCkjFqLljUsDB9HHgRRlzQ+b4dDNcYmuR1045A90ufP6EtP9Jmyi3k/yK4qUeq5tg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796025364; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=Js08TZ5pe4HlqH8kQtlAdhViHBBatQ3Oe8AH2vHcl0M=; b=NJrwL7vNjKhaiBGY3KvMFbBKjoUPaKOFFZTRdNsXvoRwNr449tsfF1ipG11VmEQWQnTv 8+OssRuYQjNyJRuJwbv6HqjvLsdg8vzkjaPL/Qw2/9NX/ldLgUuGvHmZN7Xnq05PyM0XY fGBX72HtyV6I+Fm7ecUuAyRqNw3QmFu2rpVKF7Jo6qhEm+7bgrU8JoQ/yv7wu0ylBW7dT XL64oKa24QcxH49NmFBC96kmxLBe+X/JXmoq7MDVR9OBeb0l2qt+EZ/dLdyu76rBjxI4K 3uEioTA2Fwuc285mMukXf1WQ4QJQnpt4E3K0J3b94gT5jgKEaLAYb1giEuH27Skft4w== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=WnpRaq8x; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CC3EF606A31C for ; Mon, 30 Nov 2026 07:56:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=WnpRaq8x Received: by smtp.kernel.org (Postfix) with ESMTPSA id 738021F0089A; Mon, 30 Nov 2026 07:56:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796025364; bh=Js08TZ5pe4HlqH8kQtlAdhViHBBatQ3Oe8AH2vHcl0M=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=WnpRaq8xlv4upTqvEhns1n/O3oBHQ/fYgVZcwjGmhS66ORA4e/EwdjfEZP3l5bQyp WoGyZoq9/L6Ooy2lPAYExyaln29X0MENifd8U4L61VSlLnMZPYl6p+6dOtYgrp+KXc GCf/uHiEisoZRSlw1HuqgFFZQRMst/2vnVLCNK6jmG8KcnIzqIsIvp0bCg9lQEeii7 HjNaeHdIF+BcP0SRXC4RRAif2vGzDtSKmnjzHeYKew6Bg2rPe5Pzo7hhKZUQy2YG+8 rA1StBPUc3It+EEzovoHJPj18HD1Ao8lMbK9E/tR4gRIGNxDBgH0xRgmQBU1+eGwpq y6AgHesJ7aL6Q== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH] ALSA: pcm: derive the audio timestamp for the DEFAULT type Reply-To: sashiko-reviews@lists.linux.dev To: "Hao Ge" Cc: linux-sound@vger.kernel.org In-Reply-To: <20261130074144.120573-1-hao.ge@linux.dev> References: <20261130074144.120573-1-hao.ge@linux.dev> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Mon, 30 Nov 2026 07:56:03 +0000 X-Mailing-List: linux-sound@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list Thank you for your contribution! Sashiko AI review found 1 potential issue to consider: - [Low] ALSA: pcm: Fixes trailer cites 4eeaaeaea1ce instead of 3179f6200188 -- commit 22b28b123f8965cc05b0606befd025969a4f6aef Author: Hao Ge > ALSA: pcm: derive the audio timestamp for the DEFAULT type > > snd_pcm_update_hw_ptr0() calls ->get_time_info() only when > audio_tstamp_config.type_requested is not DEFAULT, while > update_audio_tstamp() derives the timestamp from the buffer position > only when audio_tstamp_report.actual_type is DEFAULT. The two > conditions do not line up for a stream that requests the DEFAULT > type. The callback is never called for such a stream, so actual_type > stays at SNDRV_PCM_AUDIO_TSTAMP_TYPE_COMPAT, the zero value a > kzalloc'ed runtime starts with, and update_audio_tstamp() reads the > local audio_tstamp that was never written. This path never reaches a > driver, so it cannot be fixed driver-side. > > BUG: KMSAN: uninit-value in update_audio_tstamp+0x728/0x880 [snd_pcm] > update_audio_tstamp+0x728/0x880 [snd_pcm] > snd_pcm_update_hw_ptr0+0x189c/0x1c50 [snd_pcm] > snd_pcm_delay+0x258/0x890 [snd_pcm] > snd_pcm_common_ioctl+0x2ef/0xbc0 [snd_pcm] > snd_pcm_ioctl+0x72/0xd0 [snd_pcm] > __se_sys_ioctl+0x1be/0x340 > do_syscall_64+0x138/0x4b0 > entry_SYSCALL_64_after_hwframe+0x76/0x7e > Local variable audio_tstamp created at: > snd_pcm_update_hw_ptr0+0x9f/0x1c50 [snd_pcm] > > The reports come from a PipeWire stream querying > SNDRV_PCM_IOCTL_DELAY and SNDRV_PCM_IOCTL_STATUS64, and from the > period elapsed interrupt. > > Also take the requested type into account in > update_audio_tstamp(), and derive the timestamp from the buffer > position when the caller asked for DEFAULT, which is what the type > means. > > Fixes: 4eeaaeaea1ce ("ALSA: core: add hooks for audio timestamps") > Cc: stable@vger.kernel.org > Signed-off-by: Hao Ge [Severity: Low] Should the Fixes tag reference 3179f6200188 ("ALSA: core: add .get_time_info") instead of 4eeaaeaea1ce ("ALSA: core: add hooks for audio timestamps")? Commit 4eeaaeaea1ce ("ALSA: core: add hooks for audio timestamps") only added the legacy .wall_clock hook. Commit 3179f6200188 ("ALSA: core: add .get_time_info") introduced update_audio_tstamp(), the type_requested !=3D SNDRV_PCM_AUDIO_TSTAMP_TYPE_DEFAULT guard around ->get_time_info(), and the mismatched actual_type =3D=3D SNDRV_PCM_AUDIO_TSTAMP_TYPE_DEFAULT check. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261130074144.1205= 73-1-hao.ge@linux.dev?part=3D1