Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp342353pxb; Thu, 25 Feb 2021 04:11:42 -0800 (PST) X-Google-Smtp-Source: ABdhPJyc8W2OmJlTm58f9WpwMjxUHtjHK+9e8FscnlJttdORjP4QoY4QtVXhOsVDhLc/bWCJZBOk X-Received: by 2002:a50:f9c6:: with SMTP id a6mr2523492edq.240.1614255102342; Thu, 25 Feb 2021 04:11:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614255102; cv=none; d=google.com; s=arc-20160816; b=mfMShDiiMnCMPuIAfDF5Iyk+TcREOIW4bk8wm5sFHb5B5F7oM2SXkFvtjLhXxUEXzK FUo8ZHMee26dvVk43ZynWsJ2ohkaj8rPyrxkADPpuyICGMOVH3c2Rl5oQj1zuEsroRhW gICHe1/AWM5qyXWMuQcHp6RQPpHKeOgCQVLSdAY32vuAXaxsYxbT9HAJJ62D61yfncSe HXwMHERC/2aSRmSVseNgvCLEf8bIHbUwHVZ8IyQv/f2ttIHOowvfyE5ci85nM+7yB/m3 gXPkX1dYWjvDqZwURNp6y1wZtK3lp4yQpAWYe4FIPLuUxwC4SfLCCqdilFQWEephrQpA J0ZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:references:in-reply-to :subject:cc:to:from:message-id:date; bh=puOJxIa4yCxll2xUxuFlcjiBkxiKdmevWYSGk8tsSKQ=; b=RhUVM1U1WT+6yINJO1yfcjSOHU5ucFN0zOX5YpTIv5JnamHErPZ70qvIwiQkj6/chK Rgx9EWkvqFfBZT97lSJBEoS6vByBQJsE5fmGFMIw3lgye5TBjNchCvu8NJemvBfb9Soe dS5V3cG5IWpHuQfsTjFK+1qy5F3XPE0FnJcNZHL+OUi+xR/J66n2mq4Evyenb8B43h3R 4RuYpYHnZtaS2959ubNT4OpQBZyfsn61ZYMr/iowEb4Q85N08f6tJRnfPns+n/JdXADb 09P0ZYnoTVxoB43+HA3n0+k7Hoxg5q/WuGQ9AIj3bnvLH7hUpQ9B3RwkEOvg9dughHPh wINg== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e23si3127984edu.203.2021.02.25.04.11.19; Thu, 25 Feb 2021 04:11:42 -0800 (PST) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230459AbhBYMIu (ORCPT + 99 others); Thu, 25 Feb 2021 07:08:50 -0500 Received: from mx2.suse.de ([195.135.220.15]:51874 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229571AbhBYMIn (ORCPT ); Thu, 25 Feb 2021 07:08:43 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 939BFAC1D; Thu, 25 Feb 2021 12:08:02 +0000 (UTC) Date: Thu, 25 Feb 2021 13:08:02 +0100 Message-ID: From: Takashi Iwai To: Anton Yakovlev Cc: , , , "Michael S. Tsirkin" , Jaroslav Kysela , Takashi Iwai , Jason Wang , Subject: Re: [PATCH v5 2/9] ALSA: virtio: add virtio sound driver In-Reply-To: References: <20210222153444.348390-1-anton.yakovlev@opensynergy.com> <20210222153444.348390-3-anton.yakovlev@opensynergy.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.8 Emacs/25.3 (x86_64-suse-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 25 Feb 2021 12:51:36 +0100, Anton Yakovlev wrote: > > > Now I'm wondering whether it's safe to do that from this place. > > Basically device_reprobe() unbinds the device that releases the full > > resources once including the devm_* stuff. And this work itself is in > > a part of devm allocated resource, so it'll be released there. That > > said, we might hit use-after-free... This needs to be verified. > > It's safe. Suicide kernel workers are funny but possible things. Since > the kernel itself (AFAIU) assumes such a situation and does not access > the worker structure after the callback function call. Indeed, process_one_work() in workqueue.c assures no access to the work object after the callback. Then this must be fine. Good to know! thanks, Takashi