Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp807420pxb; Fri, 22 Apr 2022 11:34:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyHMOBM4yhVXTTSpUf/1u9TacPpP5WLT7Gd+UBlgKnmRFJmuUNUVCUX/F+9jOzIHxla1/Mg X-Received: by 2002:a17:90b:4b45:b0:1d2:713b:637e with SMTP id mi5-20020a17090b4b4500b001d2713b637emr6923812pjb.38.1650652442344; Fri, 22 Apr 2022 11:34:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650652442; cv=none; d=google.com; s=arc-20160816; b=HIZAQjPssZcZ/T4pzVxYrCzTs02N484+7cE5a+X0oDtIO/alb4eeCibDR1E31uk1tM aTlbL7n+CrO2CbhZ4gc0iDR1FUcLG32u39oiL38RgzBP86xW8PXP+ujrUsLC2wXoG/Aw bXqGl0gg7lsObbK4HuFfRLDq8LNMTxZOzzbRPHq/36quyNGcoLCv/Iccxw7F0RIXJf8g tWmLMbtbqdPKQyKbKTTnlOx5RIefNz455KvEWn82ncDYhr1H4Tzfpa04joaBZl2TFKuf Upwv4/IC4h7QlbchfdFSm/KIEJY+6+gKWO/g28lZSRdc3igUdXmDqGRuXLwu2uI+GUuH EYNw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=XTMtHe0DEbqpErS7R1TOOp7bMasIBNeqbkGsdmdc7Ko=; b=r3impKA8vaAJrnnxnUUiZkWkSDZ6vAUE2OTmBu9gtgUdlkwPinTuxTGtjyICBu1IQw O5Eb6DnIYDYUA4/sznZoqnu29cy7/CfcKQeBa4GZtXfvlKl/3agD89ilN3XBbOGtUk+P q0O1ZhJdncFiCAmwBJ1QY+3NolugSQ0muxcDiXXwEV7du3mkcrKJom0MdTLY8YD4D+PH J4FWRCdN2IGAgwV+yac/uVo0+Cx7OwfxtZ4fhYNRyUqxklT63XL748rDOfs1elZ7j5yJ NPHcXwgE/VBJ0KxBGEhAlIu8gNy26K5yPUHPCpHWaK4mF4IZRHb6Sha+BwA1BPtQ3e2N foQw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=DmAowioW; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id bq25-20020a056a000e1900b0050ce2aeed46si3666064pfb.168.2022.04.22.11.34.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Apr 2022 11:34:02 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=DmAowioW; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 962F5116F73; Fri, 22 Apr 2022 11:02:09 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1447003AbiDVLIE (ORCPT + 99 others); Fri, 22 Apr 2022 07:08:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59492 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245078AbiDVLIE (ORCPT ); Fri, 22 Apr 2022 07:08:04 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D376D55238; Fri, 22 Apr 2022 04:05:09 -0700 (PDT) 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 85C6A1F745; Fri, 22 Apr 2022 11:05:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1650625508; 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=XTMtHe0DEbqpErS7R1TOOp7bMasIBNeqbkGsdmdc7Ko=; b=DmAowioWLy8q8gJS/SZc36jXbfkIdJwSSjsgJm84KkmORCTeRBGeM09xLnm2auCaldw7vo 9TXlA5rQ653io4fIcCQIE189VIAv9PTX/BDhefqN6exSlqsaHCa8XSG7AwoAMqnsc6wRGg 0mCC4yuHYyIqjLc3C6dpDnTg/MUIZjc= 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 2C231131BD; Fri, 22 Apr 2022 11:05:08 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id 9pPTCeSLYmIhNgAAMHmgww (envelope-from ); Fri, 22 Apr 2022 11:05:08 +0000 Date: Fri, 22 Apr 2022 13:05:06 +0200 From: Michal =?iso-8859-1?Q?Koutn=FD?= To: Tejun Heo Cc: Tadeusz Struk , cgroups@vger.kernel.org, Zefan Li , Johannes Weiner , Christian Brauner , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Martin KaFai Lau , Song Liu , Yonghong Song , John Fastabend , KP Singh , netdev@vger.kernel.org, bpf@vger.kernel.org, stable@vger.kernel.org, linux-kernel@vger.kernel.org, syzbot+e42ae441c3b10acf9e9d@syzkaller.appspotmail.com Subject: Re: [PATCH] cgroup: don't queue css_release_work if one already pending Message-ID: <20220422100400.GA29552@blackbody.suse.cz> References: <20220412192459.227740-1-tadeusz.struk@linaro.org> <20220414164409.GA5404@blackbody.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE autolearn=no 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 On Thu, Apr 21, 2022 at 02:00:56PM -1000, Tejun Heo wrote: > If this is the case, we need to hold an extra reference to be put by the > css_killed_work_fn(), right? I looked into it a bit more lately and found that there already is such a fuse in kill_css() [1]. At the same type syzbots stack trace demonstrates the fuse is ineffective > css_release+0xae/0xc0 kernel/cgroup/cgroup.c:5146 (**) > percpu_ref_put_many include/linux/percpu-refcount.h:322 [inline] > percpu_ref_put include/linux/percpu-refcount.h:338 [inline] > percpu_ref_call_confirm_rcu lib/percpu-refcount.c:162 [inline] (*) > percpu_ref_switch_to_atomic_rcu+0x5a2/0x5b0 lib/percpu-refcount.c:199 > rcu_do_batch+0x4f8/0xbc0 kernel/rcu/tree.c:2485 > rcu_core+0x59b/0xe30 kernel/rcu/tree.c:2722 > rcu_core_si+0x9/0x10 kernel/rcu/tree.c:2735 > __do_softirq+0x27e/0x596 kernel/softirq.c:305 (*) this calls css_killed_ref_fn confirm_switch (**) zero references after confirmed kill? So, I was also looking at the possible race with css_free_rwork_fn() (from failed css_create()) but that would likely emit a warning from __percpu_ref_exit(). So, I still think there's something fishy (so far possible only via artificial ENOMEM injection) that needs an explanation... Michal [1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/kernel/cgroup/cgroup.c#n5608