Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp2983255lqp; Mon, 25 Mar 2024 15:36:02 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUPWOxKEZ7fEUh++BMIIYT5+Bk8tTEHU2VTOhvthUIwUiCbUAd2geMiFrW+Fs1M/SH61e8QTgkcs3TiP80HrZHdYP47VWIqTIHpgT59og== X-Google-Smtp-Source: AGHT+IHPOvwbXR8hHqbv4vFURn7tmECsLWQ3havgQa1bUChZlTqXpU7g3ejE6Lr8sO8zjy8BmgMj X-Received: by 2002:a17:902:c211:b0:1e0:64bd:51ac with SMTP id 17-20020a170902c21100b001e064bd51acmr6969446pll.22.1711406161728; Mon, 25 Mar 2024 15:36:01 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711406161; cv=pass; d=google.com; s=arc-20160816; b=BkS26RfzDa/km28AhTfgXQs2MZi6C41P3ZYMXdJfo+UOXr8Dwpg3XyHs/QE8Ktl2Ev e6sBchWIPKidfWGzsvwwzHiW2RWJyYpnENm7xNmLeYUZ5fgAh4aL4DMtdAzJ9v71s+/l SHn9ME/ftY+4tK1Py8D/6G1ANNAvJ/19T1MdjcomLhmI5HzmyJBs4pEUzigy5yrHeIhx eSUvvyYMoOWEWQpcF6GqKNFOOu4j4Dm/4hz/p4PidFyBLhfoo+wllHjJ68FUiVjAFplx c3asYD4Bca1yLZHKWezGs97h13feO0c82//ClLkBE8h/vanIXkNXa4bP/D2k6ulkFwiV 9XCw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=message-id:mime-version:list-unsubscribe:list-subscribe:list-id :precedence:content-transfer-encoding:references:in-reply-to:subject :cc:to:from:date; bh=UclVC5TUuacQtw8LteqZT6tP4wbtrOMeCdE5sCs/DJs=; fh=QcFoz6ZtJ6k6m1HIhatKCfHZdxvy2xgbHAwKXadCmg4=; b=khE3kCXW1Ra2w1TqTeNQ4ScXQ27iCIMcxKkS6DssjmTG14DRaWRrQYryHt7iOf5mSZ 1MpmD2xsz0E0vwLwIQYBh1yNeNKO1yFZ35B7yiwneqWFGTc9FuM0tWtIanECJJY8t1+Y g/6sKyaqGSR2nwEVg59nLLUcuvW7YnsvUhNwHff1qTNCx6wQE7ir63S8eHmo809vh1xw Y06/Be4fOgOXKgywixg4uugXwRYQSnqxbeIY5vxI2Q4ZD38rxdx6l78stTD9zPK24luo /Lxp570IUrfsKkLIF37ksRlUywEHlBm1V1YiUg0msx4lNhDXX8q54ZFP4UQ/+MhT3cju 4sEQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=zju.edu.cn); spf=pass (google.com: domain of linux-kernel+bounces-117257-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-117257-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id me4-20020a170902fc4400b001dd8b379602si6274078plb.52.2024.03.25.15.36.01 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Mar 2024 15:36:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-117257-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=zju.edu.cn); spf=pass (google.com: domain of linux-kernel+bounces-117257-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-117257-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 9F22AB26665 for ; Mon, 25 Mar 2024 16:29:20 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7A23A15E5AB; Mon, 25 Mar 2024 14:29:22 +0000 (UTC) Received: from zju.edu.cn (mail.zju.edu.cn [61.164.42.155]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D19F615DBCC; Mon, 25 Mar 2024 14:29:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=61.164.42.155 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711376961; cv=none; b=CQStE9B889lv6qUAGPB9MJFY2bZYVlFv3MGQ5l7NRGa9oLCq6loNpZlWrzk7PFDbGhKQZvm4Av7PBdjoBz4gGESYnHAX+mo9yFIe2ZUOFnF+1GfDZuDmeDUbBzvyWj64TwzpIttSAIZ6tCCOTHyp5G4AHhuC8Ovp1O43RaSDYMA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711376961; c=relaxed/simple; bh=UclVC5TUuacQtw8LteqZT6tP4wbtrOMeCdE5sCs/DJs=; h=Date:From:To:Cc:Subject:In-Reply-To:References:Content-Type: MIME-Version:Message-ID; b=oaCs6gkx3RON3caV3QTo8ITlpfyzTDia8+7rhudEu+tPjof0D4o7OQaHjofxbpFxEgXaJcdIfgTUfAgb8iMHIBPvhRzfF609RlkBsZ2UZl/wQHlVH6/rrwQB5qwFvoRpkJWBaZ4YiIRnl1HsHkAfZ7v43tLJKC9MCaWBd2R5wRU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=zju.edu.cn; spf=pass smtp.mailfrom=zju.edu.cn; arc=none smtp.client-ip=61.164.42.155 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=zju.edu.cn Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=zju.edu.cn Received: from duoming$zju.edu.cn ( [106.117.100.135] ) by ajax-webmail-mail-app2 (Coremail) ; Mon, 25 Mar 2024 22:26:42 +0800 (GMT+08:00) Date: Mon, 25 Mar 2024 22:26:42 +0800 (GMT+08:00) X-CM-HeaderCharset: UTF-8 From: duoming@zju.edu.cn To: "Takashi Iwai" Cc: linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org, tiwai@suse.com, perex@perex.cz Subject: Re: [PATCH] ALSA: sh: aica: reorder cleanup operations to avoid UAF bug X-Priority: 3 X-Mailer: Coremail Webmail Server Version 2023.4-cmXT5 build 20231205(37e20f0e) Copyright (c) 2002-2024 www.mailtech.cn zju.edu.cn In-Reply-To: <871q7yybeb.wl-tiwai@suse.de> References: <20240325033946.47052-1-duoming@zju.edu.cn> <871q7yybeb.wl-tiwai@suse.de> Content-Transfer-Encoding: base64 Content-Type: text/plain; charset=UTF-8 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <43e102f3.61dc.18e7601a2f2.Coremail.duoming@zju.edu.cn> X-Coremail-Locale: zh_CN X-CM-TRANSID:by_KCgBnR5yjiQFmetpgAQ--.21222W X-CM-SenderInfo: qssqjiasttq6lmxovvfxof0/1tbiAwQLAWYBgRkAmQAAsr X-Coremail-Antispam: 1Ur529EdanIXcx71UUUUU7IcSsGvfJ3iIAIbVAYjsxI4VWxJw CS07vEb4IE77IF4wCS07vE1I0E4x80FVAKz4kxMIAIbVAFxVCaYxvI4VCIwcAKzIAtYxBI daVFxhVjvjDU= T24gTW9uLCAyNSBNYXIgMjAyNCAwOToxNjoxMiArMDEwMCBUYWthc2hpIEl3YWkgd3JvdGU6Cj4g PiBUaGUgZHJlYW1jYXN0Y2FyZC0+dGltZXIgY291bGQgc2NoZWR1bGUgdGhlIHNwdV9kbWFfd29y ayBhbmQgdGhlCj4gPiBzcHVfZG1hX3dvcmsgY291bGQgYWxzbyBhcm0gdGhlIGRyZWFtY2FzdGNh c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