Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp3950901pxb; Mon, 4 Oct 2021 13:28:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzkuKPoEiFhYurlqzER/lTUmt7dBhcEjBwRGh6XGaNrXROb+rZhFIK4L1lWnmL0lJz9czY1 X-Received: by 2002:a05:6a00:26e9:b0:44c:654f:80e9 with SMTP id p41-20020a056a0026e900b0044c654f80e9mr5802371pfw.14.1633379311105; Mon, 04 Oct 2021 13:28:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633379311; cv=none; d=google.com; s=arc-20160816; b=R339fuWf8ltyPboFaCJwr2IFaUrd2wnKvICi3qkeOPubYE5mjnYXSDREtpXZQIH6kH wvWJ+fWYO8NBeH2pEzb/0/alrLBAIRZdU1gYXaQOnYmQFVf1LPAZB2xvPrtOHm3Y/E0z eg4TDNQFg6SrPR97Rf2/v3U6DrR2E8pn8efxaSAjEK5letQDIjcZhYyuJ/O8vj9CLIm2 edPYKLZg/OBcJ3kA4MsqydJbRovLvD61aMYzYgDxD1/1zrvWQFZpz+ny21udeLrfgwvA zj5spO6fn79I5gOIj+p7ehUxGFNjaJeydbkt0TMRuPR6EoIZSegbwZchsBXxBwuPYSKG 8P5w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=NMbNXYIDLov79i+9WQLz7APivx7j86F29jOhQS+9MhM=; b=B2pMdSMSMA8/AnJQCIEVXLz3CIdZsWJDe9ENvK2RCreeiNXhxN03NHO4nsDX3AX06j oLWj4MtYTFswNjSWkoAuYL5Kyv6fVsSkwZEQm3WCU5kBaLiY+SYLlGEkTC+tIhZJJOYY DrnI3jlFA5ND/+bL2bWqX4utqHKIzX2XnhQR0B3FQj0+JIynfDslXSTCN8DPJbkYM7wj ciRVZ0HyamEXBpALSQ9ZGRmdL6N9YZXdWuHH4USv0IH17WmgC5a2nES0ihQp3sFKU+0D ffY/+ncnIgz6iZ1CcZnQ5J/7CCGskbRCe6oB7BdY52k1DJj85zBvtIfGIk1mGGjfEuVt e9FQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=vp3cRoBa; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m10si19025054pgv.643.2021.10.04.13.28.18; Mon, 04 Oct 2021 13:28:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=vp3cRoBa; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237197AbhJDNbw (ORCPT + 99 others); Mon, 4 Oct 2021 09:31:52 -0400 Received: from mail.kernel.org ([198.145.29.99]:43088 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237097AbhJDN3z (ORCPT ); Mon, 4 Oct 2021 09:29:55 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 0C914613AD; Mon, 4 Oct 2021 13:13:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1633353202; bh=/CSU1UQt3B9EPyyzD9OkcwMM9NnbyDRvBgclPSg/Km8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vp3cRoBaCLxnZG3N5HTwWG5mi23uE7c4g/f6Mdrx1TgXkGvbPmvucmsJBixeGj/NL WtK6PTFnGCUijOK593INWtmwaK0WBQ7MbUQUAq8/dmEWKsptPvpudZGaB+n+ED9rve FttESErzOMEiG8+cB6mRvj8UpPhoMMQrkR+Ss3Tc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Takashi Sakamoto , Takashi Iwai Subject: [PATCH 5.14 036/172] ALSA: firewire-motu: fix truncated bytes in message tracepoints Date: Mon, 4 Oct 2021 14:51:26 +0200 Message-Id: <20211004125046.145124019@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211004125044.945314266@linuxfoundation.org> References: <20211004125044.945314266@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Takashi Sakamoto commit cb1bcf5ed536747013fe2b3f9bd56ce3242c295a upstream. In MOTU protocol v2/v3, first two data chunks across 2nd and 3rd data channels includes message bytes from device. The total size of message is 48 bits per data block. The 'data_block_message' tracepoints event produced by ALSA firewire-motu driver exposes the sequence of messages to userspace in 64 bit storage, however lower 32 bits are actually available since current implementation truncates 16 bits in upper of the message as a result of bit shift operation within 32 bit storage. This commit fixes the bug by perform the bit shift in 64 bit storage. Fixes: c6b0b9e65f09 ("ALSA: firewire-motu: add tracepoints for messages for unique protocol") Cc: Signed-off-by: Takashi Sakamoto Link: https://lore.kernel.org/r/20210920110734.27161-1-o-takashi@sakamocchi.jp Signed-off-by: Takashi Iwai Signed-off-by: Greg Kroah-Hartman --- sound/firewire/motu/amdtp-motu.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) --- a/sound/firewire/motu/amdtp-motu.c +++ b/sound/firewire/motu/amdtp-motu.c @@ -276,10 +276,11 @@ static void __maybe_unused copy_message( /* This is just for v2/v3 protocol. */ for (i = 0; i < data_blocks; ++i) { - *frames = (be32_to_cpu(buffer[1]) << 16) | - (be32_to_cpu(buffer[2]) >> 16); + *frames = be32_to_cpu(buffer[1]); + *frames <<= 16; + *frames |= be32_to_cpu(buffer[2]) >> 16; + ++frames; buffer += data_block_quadlets; - frames++; } }