Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp1608954pxb; Thu, 16 Sep 2021 11:01:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxfGj69LUdqUpLoThdQVAlm/BReM5fOVw23ScSILYBfhbKaeMDPZY5OVFn/jZHb8bXapKG7 X-Received: by 2002:a92:ce85:: with SMTP id r5mr4672378ilo.159.1631815268813; Thu, 16 Sep 2021 11:01:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631815268; cv=none; d=google.com; s=arc-20160816; b=RSW+zLdcgvazPBTQup4ZTgpa4iFHKedDxIB6CCJyqIu69KVbwxPngJ9g0MUBHS6CGC od+dGNd+F2js5zt8cCg2+HxnGXX1Pf1P8fP8/x8Gu/xPPtx9s26oD4rRsaKbT+l3d7XV rfr79xYe9WrIJsXisl539EI5U+6KexfY4hpnHIrmnAh3p6dYFpeZCJ+v93Y4wF9dUr2l f7PTcWbA82/IcRaOijaqp3z48HG74BCeJkb1ZT4aajyae50QqpikF9Y7UblQJkhyW2rV XMbpMmBNfs+6dIxWaCGHQTwO88jPvbEb0ACxPEWxPuMhNNrB5ODOg6Jv6hCfRMMJXJvf uOkg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:mime-version :dkim-signature; bh=rykHFh6yFE4CaM814tm8TY2UWUMlofffOYtoxuMYRSo=; b=Q9PFupgAMWnfoYoP6+D8uX8WC/TjbihMuWmxu5sn5ADZDvsC6tfxIbuVeBFReNtruW CE2SGUCKn6XHSn8SxChY2qyxz73DrEdBB/3Xibz1DI/ac38MxrapeIZwtHiQboAa1XeR jpTbTiOifwucXgKe007T3vFysk5R6EUe9my3S4M+u6Xx1RWbgOHGmsHsK0TuGuDXAi2k TibzxNzbO6Z8p7DfDmGyLQyUvE7KakXIdjwY3eF+8edAgI5u9aY0mcrcKoAsqUlruvYe ySoT9LmJGpQ2/+12RzGPH9XQdXj9CSJ/Toa/Of8+ekAzah66Ades+7rfy+mvdU2uKNIU HDXQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=O1dUMib0; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g12si3595522ile.52.2021.09.16.11.00.57; Thu, 16 Sep 2021 11:01:08 -0700 (PDT) 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; dkim=pass header.i=@gmail.com header.s=20210112 header.b=O1dUMib0; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235740AbhIPNzu (ORCPT + 99 others); Thu, 16 Sep 2021 09:55:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40112 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235722AbhIPNz1 (ORCPT ); Thu, 16 Sep 2021 09:55:27 -0400 Received: from mail-pj1-x102e.google.com (mail-pj1-x102e.google.com [IPv6:2607:f8b0:4864:20::102e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BE19DC0613C1; Thu, 16 Sep 2021 06:54:06 -0700 (PDT) Received: by mail-pj1-x102e.google.com with SMTP id me5-20020a17090b17c500b0019af76b7bb4so6923574pjb.2; Thu, 16 Sep 2021 06:54:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:from:date:message-id:subject:to:cc; bh=rykHFh6yFE4CaM814tm8TY2UWUMlofffOYtoxuMYRSo=; b=O1dUMib0ofHE7WN6YIT5myCn0PW1FFOUSWt9/aXuJYikEjQwlS84Rs8++m498iU71I CVhBwagbZapM5vM9TTwNDIYVY/jRI8wtib5XSkTrOtjUxSKdBH54n+0ib6yOHFIzshZ/ f1a5zXy1IZQBFenwnyKnHVCuc2nXlKChOBTVoubeltWFKPpFLB59wzukZEZQeVLLR+Gu fWajzwMXF+0akOFaWaGoNF2qvj6UTGXXt0vW+f0Xk20oRA64JnijsZkhtetxR9AaQMv+ zriJAUuC3OrP8l/ZV3cZNAsumC1W2zJ8SXimO1amnQho5X3ZG/hGSSbEFQMnsnzIMOON Eiug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:from:date:message-id:subject:to:cc; bh=rykHFh6yFE4CaM814tm8TY2UWUMlofffOYtoxuMYRSo=; b=aB14ZrFtbnKehaZdTtcQK83TCeHf51yP9sCpRuyyOsiVaWkxT4qCLbaAReLsl5YHkZ iCgnQV51FSpUHSgfPOBtC8mQasetsmhH1hChVM0pG+j3Uwr4Z4yip/rpki9Uwj8pq3vo SrICSceYYn+xp4b5No8tyHy4bi+wBnrpfmDKL8PaXjvX3Mgs4AhdgfhR8EaujfEOQy9e l/8uBLtUnhocCZBlR6aGDAiv3lxCCC9XGQRS2VhoQ6S0EgR5FjzUuSV3XkR4WplY4rFe WmCGmnmIweS9brMlxda/w1heC1+FqmsGxFfJ3Mz/s/QuKdNKowXe1SN1s683OVQ4A+Og SXGw== X-Gm-Message-State: AOAM533tNwuhoqFpiY7K5Tx1WpMJ+/Slhqtv3wpXwnRbsMSYWKW6F0LI pypp7vJL6xP8vk4pfikLadU+5OssjWKDNDY28KgrhnHIrDIH3vQ= X-Received: by 2002:a17:90b:4b52:: with SMTP id mi18mr6184468pjb.112.1631800446177; Thu, 16 Sep 2021 06:54:06 -0700 (PDT) MIME-Version: 1.0 From: Hao Sun Date: Thu, 16 Sep 2021 21:53:55 +0800 Message-ID: Subject: KCSAN: data-race in cgroup_rstat_flush_locked / cgroup_rstat_updated To: Linux Kernel Mailing List Cc: cgroups@vger.kernel.org, hannes@cmpxchg.org, lizefan.x@bytedance.com, tj@kernel.org Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi KCSAN reported the following data race during the kernel booting when using Healer to fuzz the latest Linux kernel. HEAD commit: ff1ffd71d5f0 Merge tag 'hyperv-fixes-signed-20210915' git tree: upstream console output: https://paste.ubuntu.com/p/s4kFHrHCNh/ kernel config: https://paste.ubuntu.com/p/FjTsrWnBVM/ If you fix this issue, please add the following tag to the commit: Reported-by: Hao Sun ================================================================== BUG: KCSAN: data-race in cgroup_rstat_flush_locked / cgroup_rstat_updated write to 0xffffe8ffffc194d0 of 8 bytes by task 8 on cpu 1: cgroup_rstat_cpu_pop_updated kernel/cgroup/rstat.c:139 [inline] cgroup_rstat_flush_locked+0x282/0x760 kernel/cgroup/rstat.c:161 cgroup_rstat_flush_irqsafe+0x24/0x40 kernel/cgroup/rstat.c:218 mem_cgroup_flush_stats mm/memcontrol.c:5354 [inline] flush_memcg_stats_work+0x34/0x60 mm/memcontrol.c:5366 process_one_work+0x402/0x910 kernel/workqueue.c:2297 worker_thread+0x638/0xac0 kernel/workqueue.c:2444 kthread+0x243/0x280 kernel/kthread.c:319 ret_from_fork+0x1f/0x30 read to 0xffffe8ffffc194d0 of 8 bytes by task 1245 on cpu 0: cgroup_rstat_updated+0x53/0x1b0 kernel/cgroup/rstat.c:38 __count_memcg_events+0x43/0x50 mm/memcontrol.c:788 __activate_page+0x50b/0x5f0 mm/swap.c:309 pagevec_lru_move_fn+0x1c4/0x2d0 mm/swap.c:197 activate_page mm/swap.c:338 [inline] mark_page_accessed+0x47d/0x550 mm/swap.c:422 zap_pte_range+0x5cc/0xdb0 mm/memory.c:1359 zap_pmd_range mm/memory.c:1481 [inline] zap_pud_range mm/memory.c:1510 [inline] zap_p4d_range mm/memory.c:1531 [inline] unmap_page_range+0x2dc/0x3d0 mm/memory.c:1552 unmap_single_vma+0x157/0x210 mm/memory.c:1597 unmap_vmas+0xd0/0x180 mm/memory.c:1629 exit_mmap+0x235/0x470 mm/mmap.c:3171 __mmput+0x27/0x1d0 kernel/fork.c:1115 mmput+0x3d/0x50 kernel/fork.c:1136 exit_mm+0x2dc/0x3d0 kernel/exit.c:501 do_exit+0x3e0/0x14f0 kernel/exit.c:812 do_group_exit+0xa4/0x1a0 kernel/exit.c:922 __do_sys_exit_group+0xb/0x10 kernel/exit.c:933 __se_sys_exit_group+0x5/0x10 kernel/exit.c:931 __x64_sys_exit_group+0x16/0x20 kernel/exit.c:931 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x44/0xa0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae value changed: 0xffff888101bc2010 -> 0x0000000000000000 Reported by Kernel Concurrency Sanitizer on: CPU: 0 PID: 1245 Comm: syz-executor Not tainted 5.15.0-rc1+ #8 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.13.0-1ubuntu1.1 04/01/2014