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 28F4FC46467 for ; Wed, 18 Jan 2023 16:51:05 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 3FCFB7A14; Wed, 18 Jan 2023 17:50:13 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 3FCFB7A14 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1674060663; bh=6/fSz5vIWu3dKV6YZbSV9ZyoRev7jRdcIvDkfY1T0Oo=; h=Date:From:To:Subject:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: Cc:From; b=PJLZkjsJojRDTaWdAoDy9QCyVT+7A0Oq8IfbXrHMBwOY0SphBvWys3Gv4IlwyTT1g XytJlxg3ZIpQ/0GWK/S1Ev2VJSmZfJ874chChjgzQQLWPjQQQ3/rYI6yyTs5vkNolx dak3hOcr+rejHuwtjsBn+y5TNTHGywatjVtU9xSc= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id C8C78F80083; Wed, 18 Jan 2023 17:50:12 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 47009F80482; Wed, 18 Jan 2023 17:50:11 +0100 (CET) Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 86339F8024C for ; Wed, 18 Jan 2023 17:50:06 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 86339F8024C Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key, unprotected) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=f8jAvJuw; dkim=pass header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=Hy98FmnO 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 A119A5C14E; Wed, 18 Jan 2023 16:50:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1674060606; 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=XkmJQVrqLSeTF9iJLCagcw76EQJugVv+kmxMiIsVImQ=; b=f8jAvJuwkPrwqgi3ZEmxbxVDbynlq9g955krgcudjN09lUn2JXfk9SaHFUhbuVqbm9eMAX t1y0osHKdMxXFRIeOe6egdYkyUmf2F10fGfOdOpIQsOJ44g8gQcKCyrgu2SfcGNGeihHEL wv6TVsHxN34ibXImQdHptQBexelbAsQ= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1674060606; 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=XkmJQVrqLSeTF9iJLCagcw76EQJugVv+kmxMiIsVImQ=; b=Hy98FmnO2RH4Ku2yYJPiL0iBb0jfOw2MAhJo3478YPGA1itARE6G21C9VJv4HXVQsp4uSz 2RVNHkajElOJDtAQ== 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 7434B138FE; Wed, 18 Jan 2023 16:50:06 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id d5DMGz4jyGOTNAAAMHmgww (envelope-from ); Wed, 18 Jan 2023 16:50:06 +0000 Date: Wed, 18 Jan 2023 17:50:05 +0100 Message-ID: <87edrr6b42.wl-tiwai@suse.de> From: Takashi Iwai To: Dan Carpenter Subject: Re: [PATCH] ALSA: fireface: fix locking bug in ff400_copy_msg_to_user() In-Reply-To: References: 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-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.29 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: , Cc: alsa-devel@alsa-project.org, Clemens Ladisch , kernel-janitors@vger.kernel.org, Takashi Iwai Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" On Tue, 17 Jan 2023 15:17:29 +0100, Dan Carpenter wrote: > > The ff400_copy_msg_to_user() function drops the spin lock to call > copy_to_user(). However, if the copy_to_user() fails, then it must > take the lock again before returning. Failure to take the lock leads > to a double unlock in the caller, hwdep_read(). > > Fixes: acdebd8b4c0c ("ALSA: fireface: implement message parser for Fireface 400") > Signed-off-by: Dan Carpenter Thanks, applied. Takashi