Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp398722iof; Mon, 6 Jun 2022 05:44:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyFpQgkw2tjK0wA5Upnv7nBAeWfr2ALYN6jDMuqOHbhZyA3GfcOYSDMe0MSiZSX4kvOmV1K X-Received: by 2002:a63:5760:0:b0:3fc:4001:a2f2 with SMTP id h32-20020a635760000000b003fc4001a2f2mr20916919pgm.34.1654519448040; Mon, 06 Jun 2022 05:44:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654519448; cv=none; d=google.com; s=arc-20160816; b=iRa9kPR+FjZdUfhK2C8cHbg2F4fosnYSzI8DB4Kk6yvL14Orbrt/bS8YY+ihXo4LKz j/lgKkZUEP0cQPijo/InBbr1i9u+9nRu4py3UHQ8GIU3ESN3EyU0WprYvA3958OfUKJX Zvn7wW9Yes+UHi3wpFdbz5XVVyN5am/wZmgHoMgZC33f8Ml/Mp1r6vS74lvXVYkKlZzb lVwrQNZFLGTsfXuTOfMQIEAKqVszIktZQovpSZspmZQM76S0lhAlpJdFHzX5Zqxw0yjh DwzZwsl2tog7PO6nFlIpHJScXcR1vtOVSJP+1oBRQBtCYJCnN1s47ePD1w5nwOUaR5go 9abA== 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=S16O+A6T24T23c0/paG1pu0dx4tXfDlUNTS+nP+cphE=; b=Opz6q+OtzC3gZoPmqM/jvlbwQWnHlHIY1srQnyhzNG+7/88TLATeaEt9ptkUx5gB9n mqdVVzWEBZDt/UV9LIiFSZPDWDL97WoZw7OZeQPMWRaNLA8jNJtl/wYPyebhmvb/Vg6e enX75V09dvaFB414Oh0IOrMdvzG0k4VBT+lS+QUfFdGG88mZ5HFLHpWIpIjFdBWt9ZDx Y8dvoY+b6ncc9id+gDQrLpsG4a/Doux5HGeOQbaPUvQkFJnAfAF6qA9NPWT9ODAVfWtF +P7i2u+zuRwEzGehK/fgC9bRtFQb+jLZzu45JLEBehG/JR65bKwEGinuqzxtcpVDJi32 nXRQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=U+4ZaQnC; 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 x21-20020a1709027c1500b00163655bed22si19374320pll.501.2022.06.06.05.44.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Jun 2022 05:44:08 -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=U+4ZaQnC; 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 31E9412D1F3; Mon, 6 Jun 2022 05:39:33 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237405AbiFFMjQ (ORCPT + 99 others); Mon, 6 Jun 2022 08:39:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36480 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237386AbiFFMjP (ORCPT ); Mon, 6 Jun 2022 08:39:15 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5F8F1F99CD; Mon, 6 Jun 2022 05:39:13 -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-out1.suse.de (Postfix) with ESMTPS id D658421A67; Mon, 6 Jun 2022 12:39:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1654519151; 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=S16O+A6T24T23c0/paG1pu0dx4tXfDlUNTS+nP+cphE=; b=U+4ZaQnCAkAGLVYgMbcQ8yOw2leTw/G6XgP0SWYOPzpKwuYpVOOYoLHknUOva5iMzb3EtS M85t36oJc92vhEOXG3fj8bROYoQennKsr8Ma34tiOlPA+RSMR/AT8JPnwEBnkHxlfSl30o ULznUdIGJrExqifnQZHozgX7CxQbDEI= 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 7AA02139F5; Mon, 6 Jun 2022 12:39:11 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id TzjmHG/1nWISPwAAMHmgww (envelope-from ); Mon, 06 Jun 2022 12:39:11 +0000 Date: Mon, 6 Jun 2022 14:39:10 +0200 From: Michal =?iso-8859-1?Q?Koutn=FD?= To: Tadeusz Struk Cc: Tejun Heo , Zefan Li , Johannes Weiner , Christian Brauner , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Martin KaFai Lau , Song Liu , Yonghong Song , John Fastabend , KP Singh , cgroups@vger.kernel.org, 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 v2] cgroup: serialize css kill and release paths Message-ID: <20220606123910.GF6928@blackbody.suse.cz> References: <20220603173455.441537-1-tadeusz.struk@linaro.org> <20220603181321.443716-1-tadeusz.struk@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220603181321.443716-1-tadeusz.struk@linaro.org> 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,T_SCC_BODY_TEXT_LINE 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 Hello. On Fri, Jun 03, 2022 at 11:13:21AM -0700, Tadeusz Struk wrote: > In such scenario the css_killed_work_fn will be en-queued via > cgroup_apply_control_disable(cgrp)->kill_css(css), and bail out to > cgroup_kn_unlock(). Then cgroup_kn_unlock() will call: > cgroup_put(cgrp)->css_put(&cgrp->self), which will try to enqueue > css_release_work_fn for the same css instance, causing a list_add > corruption bug, as can be seen in the syzkaller report [1]. This hypothesis doesn't add up to me (I am sorry). The kill_css(css) would be a css associated with a subsys (css.ss != NULL) whereas css_put(&cgrp->self) is a different css just for the cgroup (css.ss == NULL). Michal