Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp3724193rdh; Tue, 28 Nov 2023 01:58:50 -0800 (PST) X-Google-Smtp-Source: AGHT+IFTWlYc2HmZVQjVwxW+MUOQeqB6bfaVrrsVKNSNvDdxaor5aVfI2+0dkerorZozFjOuPB9z X-Received: by 2002:a05:6808:10d2:b0:3af:d955:261a with SMTP id s18-20020a05680810d200b003afd955261amr18307693ois.7.1701165530138; Tue, 28 Nov 2023 01:58:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701165530; cv=none; d=google.com; s=arc-20160816; b=miQupeSmZ+crUQZ3qErdEMgxOKFaiB8OSDs7KreYJc7vUS3Ys7Dkek/tuh7fsLhxm5 lMWY0pV4fDVvd6Jf2Esltb4QnVsNOjXOGYjXqtebwt0cbixA5vWYE09T5gbC45lqnZLl +p0OLN/VicNVR7OJre26Jwkr4v1SYYfEQwYAvWdjAT7/moPLm/qglggXpVQFYxWDi5MZ UKfVixMagIdfbGG770cd3oqxPzhrMO2Kgdd3eItriwFlrZZNqBakSHS7oNdxDKoUzhjb iVy3w9XfNEk6P1nkb8yClq6OldGiFm+41Pzm14rvNcRCepiyB+cjy3cyoSehIitdW9BV vXzQ== 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:date :message-id:subject:references:in-reply-to:cc:to:from:dkim-signature; bh=Ryu7HIw5N8AZfIWNCdTBKIrOr8i1YKSuw7Ba26zv++k=; fh=bUdNCoc96NwnndOZMgARGzMNY5eLxGKGp7eeq5XvUfg=; b=NeuyQRlr69sC2zk8luuwFqbIpJMebahvP+RMTecmY/UtfLeXywsyevD5sgwbuGaX/X L/dii6bGhl2bQr23gD53WQTqDYDIj9Vg3zN+DYSIcxtYODNIiuX/cLIDBzXbnh2OX0xO 71W9VXpha3ATW2VV30aPCDbyr3ktuTNe8lXLwISvME4WiMHhazhPOrMQo/M10WeSZgz0 LUr2L7RNt2uPpJX/IEQ7QFc5wVklzoEVBIKZQJ3ReWidhOKmnB5RcEYgZLxniouXjRX0 4aE3V308yzqTr5rnC2EHEXL45L3jL/TuhYou77msvrxgT92Ya+2RCmyZpIRKEItZlR4D npvw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=m6C5rTA2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id h22-20020a056a00219600b006b0cfed2c77si11842124pfi.135.2023.11.28.01.58.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Nov 2023 01:58:50 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=m6C5rTA2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 10193804C509; Tue, 28 Nov 2023 01:58:49 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232697AbjK1J6h (ORCPT + 99 others); Tue, 28 Nov 2023 04:58:37 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50096 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229714AbjK1J6f (ORCPT ); Tue, 28 Nov 2023 04:58:35 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5282CDD for ; Tue, 28 Nov 2023 01:58:42 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 30C22C433C8; Tue, 28 Nov 2023 09:58:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1701165522; bh=5ArrUEd+VDRb8Mp2oGnmeMS9uZXS+0nOcVm4HzoTmAE=; h=From:To:Cc:In-Reply-To:References:Subject:Date:From; b=m6C5rTA2jAjEF8afeKlTB6aBB9Y5ULymK2S/fsN64B3SFI91nsJ6ePILQZqYd9eSY mAweO/BFcgEkt6UqPYBX19PmJ9vxOQxLdfXLtsFMAX8HtzdA6prob5zH4W3nN2oyUF 32SQbTFqlZMIog6XdU2X9+hJzfbcM+E01OpMIjjqnDBcn5qRsN9q97q+AmZByEioxm a+SpdW2IGa9U3m/Vrgdm++h0wKzuNkN8e6SCsicjYGJivIlw1fa0eZzxG16nM+r52N T0oPjRqtiodzRpUZi2YQKOPcCvydBjMfi4neVq8Fo62ly1aHxVRJ33yKgYalYvsw0w Gt2MLo5g/4Brw== From: Vinod Koul To: Bard Liao , Pierre-Louis Bossart , Sanyog Kale , Shreyas NC , alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, Krzysztof Kozlowski Cc: stable@vger.kernel.org In-Reply-To: <20231124180136.390621-1-krzysztof.kozlowski@linaro.org> References: <20231124180136.390621-1-krzysztof.kozlowski@linaro.org> Subject: Re: [PATCH] soundwire: stream: fix NULL pointer dereference for multi_link Message-Id: <170116551879.73476.11576514501948917974.b4-ty@kernel.org> Date: Tue, 28 Nov 2023 15:28:38 +0530 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Mailer: b4 0.12.3 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Tue, 28 Nov 2023 01:58:49 -0800 (PST) On Fri, 24 Nov 2023 19:01:36 +0100, Krzysztof Kozlowski wrote: > If bus is marked as multi_link, but number of masters in the stream is > not higher than bus->hw_sync_min_links (bus->multi_link && m_rt_count >= > bus->hw_sync_min_links), bank switching should not happen. The first > part of do_bank_switch() code properly takes these conditions into > account, but second part (sdw_ml_sync_bank_switch()) relies purely on > bus->multi_link property. This is not balanced and leads to NULL > pointer dereference: > > [...] Applied, thanks! [1/1] soundwire: stream: fix NULL pointer dereference for multi_link commit: e199bf52ffda8f98f129728d57244a9cd9ad5623 Best regards, -- ~Vinod