From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id BE13DC4332F for ; Tue, 15 Nov 2022 20:07:44 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 45E2C6B0073; Tue, 15 Nov 2022 15:07:44 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 40ED76B0074; Tue, 15 Nov 2022 15:07:44 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2D65E6B0075; Tue, 15 Nov 2022 15:07:44 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 1DCED6B0073 for ; Tue, 15 Nov 2022 15:07:44 -0500 (EST) Received: from smtpin13.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id E32E0160B23 for ; Tue, 15 Nov 2022 20:07:43 +0000 (UTC) X-FDA: 80136762006.13.221C9CD Received: from mail-pj1-f48.google.com (mail-pj1-f48.google.com [209.85.216.48]) by imf24.hostedemail.com (Postfix) with ESMTP id 7544D18000B for ; Tue, 15 Nov 2022 20:07:42 +0000 (UTC) Received: by mail-pj1-f48.google.com with SMTP id m6-20020a17090a5a4600b00212f8dffec9so14899141pji.0 for ; Tue, 15 Nov 2022 12:07:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=j8ZywzlJ9gNLgr5ZzI2h5JaTktuRQJCarasUQLptVEY=; b=dKbzgUC9lipQYhQKT4GhjUAiDdSRWBKVcBbQMPN1V3PUtSgyYPryZTwr9HFhvUN2o3 l+mE1qmz9jXdxnv0uPg8+IJtxAZBQN7PJijbWjNp15QBVey2+4hS/ocuX2d3eVna7B5m nzSiOieEFcE+3L2g3syoyQVvA/4QoFPvKIfZnsBIxfIEnufUs0gWG0s3V9AfSO3r8rh4 1KrMF2Xp9pigKaQnYqo+VvjioB/XN1Ip0f5vva9Uk64tXaXK2ywSj51lrBKh5T1GOGNd tCmGhva7k2HHPk4BwlZbJm7g+E6l08qN2hpYHYeShL9epGvO+4jYHGxL/FOYWnoQ43a1 1+tg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=j8ZywzlJ9gNLgr5ZzI2h5JaTktuRQJCarasUQLptVEY=; b=HIZOCgzvydE8YljidHWjiIG1wwCdJpoAllNAtdafZ1AKAsHxepg09a08+PLcB7fTv/ koAadyfkR9mXSFgaQ/s4Iup1cLrt3Oj2OsgA2r/4j4TPmBYmuG5rLDrkF8m0s45Eemx2 +debI7BUyhGFva5iZx8BWOsDIPtijy/MEyNJRUpjP0Y3/r8+sp+pMRAKiZAPLBjYOc82 yKccM+/R5h4XKUdmJP6gsNcMjMZmK7oL6TmBEJXDrE3wiXrlCfwG+hdGyPv1cZg2cx3P 9l5MLrWknrQjciwXiJu7HfRdK6Qn802dSV6k+XVNKg8yZ2NcRScfejrVPgEul8gcKhrL D5iQ== X-Gm-Message-State: ANoB5pl98AwtQdMQ/OWFsyvcw5FjN9B2XUdACM+7XYttjIE2MAboBCVw RLHOduo79CC/DJAsas4auvUlSA== X-Google-Smtp-Source: AA0mqf4UEiJrFW1Ur8F4d6USvMZzw+qUbciplyzqE9PFTAP68TQk9VTB4aIT0vQGLHAv1V0fFTE1bA== X-Received: by 2002:a17:902:d70e:b0:185:57b6:13c3 with SMTP id w14-20020a170902d70e00b0018557b613c3mr5632758ply.116.1668542861279; Tue, 15 Nov 2022 12:07:41 -0800 (PST) Received: from google.com (7.104.168.34.bc.googleusercontent.com. [34.168.104.7]) by smtp.gmail.com with ESMTPSA id g11-20020a170902e38b00b00186c3af9644sm10182578ple.273.2022.11.15.12.07.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Nov 2022 12:07:40 -0800 (PST) Date: Tue, 15 Nov 2022 20:07:36 +0000 From: Sean Christopherson To: Andrew Morton Cc: syzbot , linux-kernel@vger.kernel.org, linux-mm@kvack.org, syzkaller-bugs@googlegroups.com, kvm@vger.kernel.org Subject: Re: [syzbot] kernel BUG in workingset_activation (2) Message-ID: References: <000000000000a2c79f05ed84c7f9@google.com> <20221115112729.1c82988047557e45765cc42d@linux-foundation.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221115112729.1c82988047557e45765cc42d@linux-foundation.org> ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1668542862; a=rsa-sha256; cv=none; b=2enVIM+an335hISjVX9ALTr/+Is+XFJMAmKGnvNReZO+PGQqcoEyniLBy3cGbHKRWmS7FT 6dNLr72KzkUyWNPilKm6qwk75TCAbIL6HwroOfPYwzHxKGWqYFv44kIKkTWXUmJGeMqtq5 wDKQwSBcRDtYTkQfLpwRQab/EYGoTiQ= ARC-Authentication-Results: i=1; imf24.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=dKbzgUC9; spf=pass (imf24.hostedemail.com: domain of seanjc@google.com designates 209.85.216.48 as permitted sender) smtp.mailfrom=seanjc@google.com; dmarc=pass (policy=reject) header.from=google.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1668542862; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=j8ZywzlJ9gNLgr5ZzI2h5JaTktuRQJCarasUQLptVEY=; b=umxSEBNmTXfcmfqsPiIjpVvo/uRb/gcBj6ieOJCxAN3AYcjAHzBIbAPvBuhjBtrIjaRDSj vyCxgUvSwst8zKYPvC+1MLLHIgaHgqoSSOpZcs7mfNSfZA97KLA8aemreuPJLv5qtyK4LF l2hNQIiNYrxT4vvLWTOc0tPWDeCQVC0= X-Rspam-User: X-Stat-Signature: tqt77etq17c7w11c1seihi5zz6oti3wj X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: 7544D18000B Authentication-Results: imf24.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=dKbzgUC9; spf=pass (imf24.hostedemail.com: domain of seanjc@google.com designates 209.85.216.48 as permitted sender) smtp.mailfrom=seanjc@google.com; dmarc=pass (policy=reject) header.from=google.com X-HE-Tag: 1668542862-535816 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Tue, Nov 15, 2022, Andrew Morton wrote: > On Tue, 15 Nov 2022 08:23:44 -0800 syzbot wrote: > > > Hello, > > > > syzbot found the following issue on: > > Thanks. > > > HEAD commit: f4bc5bbb5fef Merge tag 'nfsd-5.17-2' of git://git.kernel.o.. > > git tree: upstream > > console output: https://syzkaller.appspot.com/x/log.txt?x=16c683d8700000 > > kernel config: https://syzkaller.appspot.com/x/.config?x=5707221760c00a20 > > dashboard link: https://syzkaller.appspot.com/bug?extid=644848628d5e12d5438c > > compiler: gcc (Debian 10.2.1-6) 10.2.1 20210110, GNU ld (GNU Binutils for Debian) 2.35.2 > > syz repro: https://syzkaller.appspot.com/x/repro.syz?x=1691d2c2700000 > > C reproducer: https://syzkaller.appspot.com/x/repro.c?x=16cde752700000 > > > > Bisection is inconclusive: the issue happens on the oldest tested release. > > > > bisection log: https://syzkaller.appspot.com/x/bisect.txt?x=174c8174700000 > > final oops: https://syzkaller.appspot.com/x/report.txt?x=14cc8174700000 > > console output: https://syzkaller.appspot.com/x/log.txt?x=10cc8174700000 > > > > IMPORTANT: if you fix the issue, please add the following tag to the commit: > > Reported-by: syzbot+644848628d5e12d5438c@syzkaller.appspotmail.com > > > > do_one_initcall+0x103/0x650 init/main.c:1300 > > do_initcall_level init/main.c:1373 [inline] > > do_initcalls init/main.c:1389 [inline] > > do_basic_setup init/main.c:1408 [inline] > > kernel_init_freeable+0x6b1/0x73a init/main.c:1613 > > kernel_init+0x1a/0x1d0 init/main.c:1502 > > ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295 > > ------------[ cut here ]------------ > > kernel BUG at include/linux/memcontrol.h:470! > > That's > > VM_BUG_ON_FOLIO(folio_test_slab(folio), folio); > > in folio_memcg_rcu(). > > I'll cc the KVM list. Thanks! Saw this internally, was waiting for it to hit the lists. I haven't been able to repro the syzkaller test (abuses /dev/bus/usb crud), but I believe the issue is that KVM attempts to mark a kmalloc'd page as accessed. workingset_activation() doesn't expect this and invokes folio_memcg_rcu() on a SLAB page, which triggers the VM_BUG. I suspect this can be reproduced with a KVM selftest by mapping KVM's own vcpu->run memory into the guest. I'll give that a shot. In the meantime... #sys test https://github.com/sean-jc/linux.git x86/no_slab_accessed