Received: by 2002:ab2:1149:0:b0:1f3:1f8c:d0c6 with SMTP id z9csp2988123lqz; Wed, 3 Apr 2024 14:45:04 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUa7BqgAuZClmTJKwH0djuJSPVb0gZt/ZCq8DvIa8m7v1XnzNdepyOdOIo9/UxZz41yXObSldbliYb/2UaG27oMpoMpncr8DcDjDHzU0w== X-Google-Smtp-Source: AGHT+IEebXDQjFLexC4GSleDQPTffLYHZyf9OiSkKeogLL6F9VZCcKplSnbDDXkPe3UxLqzUAE3W X-Received: by 2002:a17:902:e74f:b0:1dc:7bc:d025 with SMTP id p15-20020a170902e74f00b001dc07bcd025mr729880plf.4.1712180704435; Wed, 03 Apr 2024 14:45:04 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712180704; cv=pass; d=google.com; s=arc-20160816; b=tSTeS9RGsVKxj7vNwBiUjQw9YwcvI69vumS5mOm8YZNyHkV1FQwvoXn9UyopLtoI+h xllKKdjMNoHifv0C4z98glpczjoaMLzdJGlYuKSSyUJDD6nTgj59FLy69WO7eHB5+8m+ vvcOMYARsqZDdFkwShAsSEbm+jrjzvA4rznuNAw0ZWHLXxqb0rSKlpnaFlYOV+y/RAbB RkbvK+QRpGM4wl/B4qLs2I8qAk0tgJCynfFS9VfcfJpoTmRf/HGZG6pRNJcW3ZBFjtiU PlD/M8yNiBJen/abnqfkO7xEvX5/5nEuZdXjdKjVqCzrTWmZO+iju1eUI04WaAVYRgFe KBnQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :subject:cc:to:from:date:dkim-signature; bh=JkHo0F6amVr9KwOcat0C1qKHDDuSwHqOwMadPH3Qrcc=; fh=Rvrq+zO9oRv42pfywbjgf0whdReKHTyl9o0Z8zICAho=; b=b3wQhwIra9fYM1qOeaW5L25nzlwm9Bnje/r4Eij0o4RCO2DZ7hhmBkIHJlYaaWATXM 52EdXl4FWQxM9X72OCrdD2WlDWHJZXEosZeD3scpy6t89fhe0iUVni3SkQlHHgFQ0OHp fChssSALfHcD9bK+H9ZLoe9wg3iPp33RfJhN7PW3pv9iXnJ/p/xgGiTD/h5M9NfJbEd7 eR0M1PepABG76mVoCsZY7OzomDosoqwH0HzmQTT6NilRjYbSHDzWr2pyPwP8q1hD6dnQ 7ND0l/3Moaypmt4I1NR2voIjgQ4vlrftWL7rGrfjxOqA4c9KjAEi8yvyCSatXkFxDWeI X3OQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b=SeMLSi4c; arc=pass (i=1 dkim=pass dkdomain=linux-foundation.org); spf=pass (google.com: domain of linux-kernel+bounces-130652-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-130652-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id c5-20020a170902b68500b001e20290828fsi12961661pls.637.2024.04.03.14.45.04 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Apr 2024 14:45:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-130652-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b=SeMLSi4c; arc=pass (i=1 dkim=pass dkdomain=linux-foundation.org); spf=pass (google.com: domain of linux-kernel+bounces-130652-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-130652-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 0993D283D20 for ; Wed, 3 Apr 2024 21:45:01 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0D97215696B; Wed, 3 Apr 2024 21:44:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b="SeMLSi4c" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 30475156960 for ; Wed, 3 Apr 2024 21:44:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712180694; cv=none; b=qRCT/01Sqjj5AXL/ulerTsY3v8nHXEHA2JyfkVohiJfgHYhz7jruzXf9X9q7ykXJo7Fgm8QdYbFVy4F9LdRA+C8ic9U0kguAQto9WMhW/4qQPHI80Eq7fS1NxAUbdDWMEkZpf/37cZWUgJu8pAILuk96EDygE517oIjCgC3vz7g= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712180694; c=relaxed/simple; bh=CDKPrN1TxldCtbd7s9KjHV0KIdtctnJ3llKI7zwSwVA=; h=Date:From:To:Cc:Subject:Message-Id:In-Reply-To:References: Mime-Version:Content-Type; b=nQr4p72Y/D78K+GA2eg53Cy0kKcr73+td/tX9CWatgEcXUj63dDnQH7u9Am+y6EVi3teKk9ZxRrCUAS79XLJ8XWfy9K+jwICV/N35l01gDxr27ht/nIdA79P8ObEtcNUA5by28U3Va2sj31mavChcyY3rVddJOmfL41x97hVTak= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b=SeMLSi4c; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6F1B0C433F1; Wed, 3 Apr 2024 21:44:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1712180693; bh=CDKPrN1TxldCtbd7s9KjHV0KIdtctnJ3llKI7zwSwVA=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=SeMLSi4cdcTkjlXHDLRQ4ZdgokBSDp4hY6UCBlLXNt/E1ltZAxKMF/8BqAdNEsI5r EnqX3FlGkf45q/FQCnlriIjCnVkoQ5x5q3F7Bk/AP+mxYh/S/lJQ7br02WB6CsdYTj 7YezKPrh22gnLI1TtVgV275YQN2CZSEgG5mPl07k= Date: Wed, 3 Apr 2024 14:44:52 -0700 From: Andrew Morton To: syzbot Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, syzkaller-bugs@googlegroups.com, David Hildenbrand Subject: Re: [syzbot] [mm?] KCSAN: data-race in __delete_from_swap_cache / folio_mapping (3) Message-Id: <20240403144452.1c68c2be42383de895795cfd@linux-foundation.org> In-Reply-To: <00000000000092ec58061522b2c7@google.com> References: <00000000000092ec58061522b2c7@google.com> X-Mailer: Sylpheed 3.8.0beta1 (GTK+ 2.24.33; x86_64-pc-linux-gnu) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Tue, 02 Apr 2024 13:10:29 -0700 syzbot wrote: > Hello, > > syzbot found the following issue on: > > HEAD commit: 39cd87c4eb2b Linux 6.9-rc2 > git tree: upstream > console output: https://syzkaller.appspot.com/x/log.txt?x=129de21d180000 > kernel config: https://syzkaller.appspot.com/x/.config?x=d024e89f7bb376ce > dashboard link: https://syzkaller.appspot.com/bug?extid=58fc2a881f3b3df5e336 > compiler: Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40 > > Unfortunately, I don't have any reproducer for this issue yet. > > Downloadable assets: > disk image: https://storage.googleapis.com/syzbot-assets/b9b2dcffd7d5/disk-39cd87c4.raw.xz > vmlinux: https://storage.googleapis.com/syzbot-assets/5f4981fa60e6/vmlinux-39cd87c4.xz > kernel image: https://storage.googleapis.com/syzbot-assets/691f671f70ad/bzImage-39cd87c4.xz > > IMPORTANT: if you fix the issue, please add the following tag to the commit: > Reported-by: syzbot+58fc2a881f3b3df5e336@syzkaller.appspotmail.com > > ================================================================== > BUG: KCSAN: data-race in __delete_from_swap_cache / folio_mapping > > write to 0xffffea0004798fa8 of 8 bytes by task 29 on cpu 0: > __delete_from_swap_cache+0x1f2/0x290 mm/swap_state.c:161 folio->swap.val = 0; > delete_from_swap_cache+0x72/0xe0 mm/swap_state.c:241 > folio_free_swap+0x19f/0x1c0 mm/swapfile.c:1600 > free_swap_cache mm/swap_state.c:290 [inline] > free_pages_and_swap_cache+0x1d9/0x400 mm/swap_state.c:322 > __tlb_batch_free_encoded_pages mm/mmu_gather.c:136 [inline] > tlb_batch_pages_flush mm/mmu_gather.c:149 [inline] > tlb_flush_mmu_free mm/mmu_gather.c:366 [inline] > tlb_flush_mmu+0x2cf/0x440 mm/mmu_gather.c:373 > tlb_finish_mmu+0x8c/0x100 mm/mmu_gather.c:465 > __oom_reap_task_mm+0x231/0x2e0 mm/oom_kill.c:553 > oom_reap_task_mm mm/oom_kill.c:589 [inline] > oom_reap_task mm/oom_kill.c:613 [inline] > oom_reaper+0x264/0x850 mm/oom_kill.c:654 > kthread+0x1d1/0x210 kernel/kthread.c:388 > ret_from_fork+0x4b/0x60 arch/x86/kernel/process.c:147 > ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:243 > > read to 0xffffea0004798fa8 of 8 bytes by task 14567 on cpu 1: > folio_mapping+0xd2/0x110 mm/util.c:797 return swap_address_space(folio->swap); > folio_evictable mm/internal.h:256 [inline] > move_folios_to_lru+0x137/0x690 mm/vmscan.c:1808 > shrink_inactive_list mm/vmscan.c:1929 [inline] > shrink_list mm/vmscan.c:2163 [inline] > shrink_lruvec+0xbd8/0x1640 mm/vmscan.c:5687 > shrink_node_memcgs mm/vmscan.c:5873 [inline] > shrink_node+0xa78/0x15a0 mm/vmscan.c:5908 > shrink_zones mm/vmscan.c:6152 [inline] > do_try_to_free_pages+0x3cc/0xca0 mm/vmscan.c:6214 > > ... > These both point at David's 3d2c90876887 ("mm/swap: inline folio_set_swap_entry() and folio_swap_entry()") which is probably innocent, but I have to blame someone ;)