Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp8403795ybc; Fri, 29 Nov 2019 09:59:45 -0800 (PST) X-Google-Smtp-Source: APXvYqwKXSGTzOb+6vdM5tRGqV/Xk/gcNXeHLTf8S6WvoVCLEaWhXn3ikLRlah7k4j1lKkQE3Cbe X-Received: by 2002:a05:6402:305b:: with SMTP id bu27mr47600253edb.191.1575050384898; Fri, 29 Nov 2019 09:59:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575050384; cv=none; d=google.com; s=arc-20160816; b=KMVqAqIFfZSKiHy0eXfbjgW98t6l9PvACiUI6WvcnfLtPFtZGJCQ24k6zH1SP5y/O8 hqTrxhpFg+7p7H5UW1wRlcoAoroS4/0ii7jHiychv/RXh0ADxmRs99lQ8YSvX0Uc2Y4u Etk1WLNCF3ILztAN1/7EaE4FYTiI4HYC/YNTNuTxzNB3N48kNSPa7wklGjnTr2vntleI jCLM7hDg0cB8kJ8O40ccgjZaf4vXVp1oAiZX/URMRoVx9dTpV39zHY3k6sViKrvp5jiI QPsJtB2uFGUQP8HtW//W+lsdb6hDcaoos1gr+O1Gco1IjLhPjCAGjGROzdDv64BxI6d8 UwLQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=WBr6NbHr7VrXfmX0qHal0EVv3+IgY+/KCBuv+IaQ5FA=; b=nBCOBgeRWixf66A31naymjnBbcCp2Ikfg/BUitPVpA2N0DJ1AVdsMymQY4y41hkDaM ec8GJxz5CsdVBGIVPZO1bdypouTTNmOI7HF4Tczq4wEsRmVoE0sVNYdPsWXYOVYxG9y6 3QN0lH3yrCoWx0ODY5Ps/kaxcWo3KDYSH/DhcMHuI6Ij2rk6HDjott/cGhd3gs5h0bsr rNC9kNDRHg+YzSWS+6cFnagA/Hf9r3nKSTmCowKGpHADV9LLnIQz2kiS3AZi/+eRq8oh gwdnbRzyw+LykwjaTB/tPOfBglQ905m+iAEmCXfQB0eHo7kfbqGhBkWAijCeKCyGXMeZ mr/Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=JiaaasDm; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w23si8425179edr.447.2019.11.29.09.59.21; Fri, 29 Nov 2019 09:59:44 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=JiaaasDm; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727172AbfK2R56 (ORCPT + 99 others); Fri, 29 Nov 2019 12:57:58 -0500 Received: from mail.kernel.org ([198.145.29.99]:49010 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727146AbfK2R56 (ORCPT ); Fri, 29 Nov 2019 12:57:58 -0500 Received: from willie-the-truck (236.31.169.217.in-addr.arpa [217.169.31.236]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 48EF52158A; Fri, 29 Nov 2019 17:57:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1575050277; bh=vJOOfAq3Itw/Da/jBhb+gwC+mqd4jGT+yyfYWoBfvIg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=JiaaasDmwLWpaT4HcbZdvzWAQu8WbCJzug4hwNE77iy5qXSzcwV+Q4WEPEji8woKM 16Y3mO9CSK4VZuH2Yy0p7rEkVqWMOd+J/y4Z55Nv6AwyBWJUvdT4Z4/wdLEn1A9zfS woNgtdfkmeLyXqNGiNE+a/+uTg++rjz5fTfK2xF4= Date: Fri, 29 Nov 2019 17:57:53 +0000 From: Will Deacon To: Christian Brauner Cc: linux-kernel@vger.kernel.org, bsingharora@gmail.com, dvyukov@google.com, elver@google.com, parri.andrea@gmail.com, stable@vger.kernel.org, syzbot+c5d03165a1bd1dead0c1@syzkaller.appspotmail.com, syzkaller-bugs@googlegroups.com Subject: Re: [PATCH v6] taskstats: fix data-race Message-ID: <20191129175752.GB29789@willie-the-truck> References: <20191009114809.8643-1-christian.brauner@ubuntu.com> <20191021113327.22365-1-christian.brauner@ubuntu.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191021113327.22365-1-christian.brauner@ubuntu.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Oct 21, 2019 at 01:33:27PM +0200, Christian Brauner wrote: > When assiging and testing taskstats in taskstats_exit() there's a race > when writing and reading sig->stats when a thread-group with more than > one thread exits: > > cpu0: > thread catches fatal signal and whole thread-group gets taken down > do_exit() > do_group_exit() Nit: I don't think this is the signal-handling path. > taskstats_exit() > taskstats_tgid_alloc() > The tasks reads sig->stats without holding sighand lock. > > cpu1: > task calls exit_group() > do_exit() > do_group_exit() Nit: These ^^ seem to be the wrong way round. Will