From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (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 7BF723DD52C for ; Thu, 23 Jul 2026 09:15:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784798135; cv=none; b=WOmDGjuOK/Bhw4bnIW7YflZRcmCJtChG+mtALgo5Tlix0RTP0Ia9CFvafojL4nma+xzOqsO9TI5uomPZ6NuuWC0/Sr68t5j1a7O1j13S/MaJchbzFKDvw5Cshe2hBas04OcUzCQ1I3lmSlf3OCo3vVleK2w/+u4TSrTbzCdyU1U= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784798135; c=relaxed/simple; bh=/r59B+4fbS2XEZA7YWBaen4M7zk7M6FzVG8lMCu5vdA=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=d2Ofo7tho3JvExVrrdN5G4dgE2jJOFDqrXijLZtZEsak1C4PWDgdqyzpGZEntcbBruUAmGR5k0lSwdsZXq0BdmAVANpAc7xW2vhYOrqfN716tY0hJz8NQ85KtbdGSaBgAr8toTY6rAJLPNBNkgaGb0H8IjC7lemuirTaudZHKRQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=WYEhTiqR; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b=YNV2U+O8; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="WYEhTiqR"; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b="YNV2U+O8" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1784798129; h=from:from: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:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=HFDQsWaV4YVMqaytcd/qULKOMwPiXTV9I3KQpj/1PB4=; b=WYEhTiqRlpe1bu5fdwDiuxmU8TBupREdCAej0k/He3vq60p3sPvTPaa8Ru4k1N9BLdg98v EZFd7sP1FGQgmYQiMLmUfwN06oQtiy/Qj61jN/PhdRYvT1fjaPgroB1joPjzd8SMVslp6J 7dY9im7lsqIr7u2uMKgagY55cnL3BpU= Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-247-0o8bkK8HNNG_Pvggq8_l0A-1; Thu, 23 Jul 2026 05:15:27 -0400 X-MC-Unique: 0o8bkK8HNNG_Pvggq8_l0A-1 X-Mimecast-MFC-AGG-ID: 0o8bkK8HNNG_Pvggq8_l0A_1784798126 Received: by mail-wm1-f70.google.com with SMTP id 5b1f17b1804b1-49545071724so4729965e9.0 for ; Thu, 23 Jul 2026 02:15:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1784798126; x=1785402926; darn=vger.kernel.org; h=in-reply-to:content-transfer-encoding:content-disposition :content-type:mime-version:references:message-id:subject:cc:to:from :date:from:to:cc:subject:date:message-id:reply-to:content-type; bh=HFDQsWaV4YVMqaytcd/qULKOMwPiXTV9I3KQpj/1PB4=; b=YNV2U+O8DXMc27VzT143onyvFDSFoL3NCqnbxv4g4BrbI4TWSHuuwqgX2qFOq8n5nq tN1SsOrjPHDOFrOBBM/UHD9NsaWHh7eJbmSlTpCf+ATHB+0g3Vr9HeTX6g2O9APoZHai oCaDCB2RjgRp388spIWxUA6Vxp1uhWV0kNjkH99O8uy+fj5GKwNMSY7nK15reE3ihMwH dCQTbPEQtbuOrWj59XZARyjVU/0y58TdXr7hZyT6DjA6JRcP7ki6kuyPuwEkjkKKa8PS EiCPTkCsW4SNMnvnOdCWHHryiDQOJJO+ZGUn1eZz+kC8k/ZELxm607UMw4KC+qznSAER Ar3w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784798126; x=1785402926; h=in-reply-to:content-transfer-encoding:content-disposition :content-type:mime-version:references:message-id:subject:cc:to:from :date:x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to:content-type; bh=HFDQsWaV4YVMqaytcd/qULKOMwPiXTV9I3KQpj/1PB4=; b=XPSIZW644Wq0a2r4foHQqRruT6IUwkbA9zUtDsUrW4HhJbqKxQZVfHzxAao0PLumRj U9Oc3UhB+5q5TSrGjNspGF5e+EAoXgWW4efK3s70+Khs6JMd7s5RjEL5aVcLxJIOTsfM JOxayoVm5NCWI5azPAGOcTPdnSh5YFdtBrBIYi/SZkNcP3zRzZzqbu41/VltUAj9ruba f5Fwr0HLm1teMvMQOXoBqcxBl5tPhOC9wpiVGJJINBFXOUSkpecvaM7EqHZ+CEVAEXiN v8bhlto57AjmR9xJ0zMDxzlmHfc6kzMvlplOT5PlauSRklejHHDYYurdtNOV2jyh2HTC fT3A== X-Forwarded-Encrypted: i=1; AHgh+RqaoSGsZZH1Q1QcYIO/ETcMTVrtBhk6n4hqK16eLMCqxHHymYodm6lRSXaHyued6akUupNDzEmYjL+NtEQ=@vger.kernel.org X-Gm-Message-State: AOJu0YwDfcmdbIKkpquOQOitOzi6u9KFZLihc6g+DkOd7EY9wYEake60 TpMauwqArpsOEU+3DAbGJ3gMvTrzTV0vffYlkNtrRCjGpGTfmvQFbnLcYIli/KZS9CXodqo5aWX CBcpfn/oMzgrAb986I3D+S8+gwpVf7dVxDIGHiPIRjBq/jSaAGaXU9RWHORpL5hFpuw== X-Gm-Gg: AR+sD12J++1Ggxlo+QnpiyJ09Q24vu5dRJay4LmNf67MWaqpS/lfFZ3Kc4bs+orS5fY kr4upq0YofxYb7vmy9Og70tR2fCUH3r4D6+YoN2OVpTi5qk9FtgFz4eQUOwdGA1k12aRxEy7Xqu wiXAQ7BR2cipGKRiRH2Hq0tPOr3u2HdGHlZN6+VWg76wfjrTIuk+NaxbNUV4KtiSh7IKMcU0Ge6 3UGJp5nhXLb853F4uD2YNxDiunMtW3QoSZ1FD3NMfi5LreGYJ2NylQuwyjYsu3EfNmFUnHFQqMP Mv/29F41puyUrsBZihsJYRp73X6z/Up0sQvnDr/3ivNAkPv5Azw+WcHbtx9bdHb30oXtB/nN3Hy PpZno9db9KjxXH+eiXr/K1g== X-Received: by 2002:a05:600c:548a:b0:493:eb71:5cc6 with SMTP id 5b1f17b1804b1-49573d0eac1mr23927595e9.27.1784798126319; Thu, 23 Jul 2026 02:15:26 -0700 (PDT) X-Received: by 2002:a05:600c:548a:b0:493:eb71:5cc6 with SMTP id 5b1f17b1804b1-49573d0eac1mr23927055e9.27.1784798125726; Thu, 23 Jul 2026 02:15:25 -0700 (PDT) Received: from redhat.com (IGLD-80-230-37-66.inter.net.il. [80.230.37.66]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4956b72fac1sm108575995e9.1.2026.07.23.02.15.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Jul 2026 02:15:24 -0700 (PDT) Date: Thu, 23 Jul 2026 05:15:21 -0400 From: "Michael S. Tsirkin" To: Link Lin Cc: Andrew Morton , Vlastimil Babka , David Hildenbrand , virtualization@lists.linux.dev, linux-mm@kvack.org, linux-kernel@vger.kernel.org, prasin@google.com, rientjes@google.com, duenwen@google.com, jasowang@redhat.com, xuanzhuo@linux.alibaba.com, Ammar Faizi , jiaqiyan@google.com, ahwilkins@google.com, Greg Thelen , Alexander Duyck , jthoughton@google.com, stable@vger.kernel.org Subject: Re: [PATCH v3] mm/page_reporting: use system_freezable_wq to fix UAF during suspend Message-ID: <20260723051327-mutt-send-email-mst@kernel.org> References: <20260721005603.1710551-1-linkl@google.com> <20260722173639.34d3f58413354218b24a5b0d@linux-foundation.org> 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=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: On Wed, Jul 22, 2026 at 09:07:04PM -0700, Link Lin wrote: > On Tue, Jul 21, 2026 at 5:36 PM Andrew Morton wrote: > > hm, now where did that come from. I can find no such commit and that's > > the second time this very unusual thing has happened in 30 minutes! I > > wonder what's going on. > > > > I'll use > > 36e66c554b5c ("mm: introduce Reported pages") > > OK? > > Yes, that Fixes tag is perfectly OK. I pulled the previous hash from > an internal downstream tree by mistake. Thank you for catching that > and correcting it! > > > The bug is very old so I won't fast-track this fix into 7.2-rcX. > > Completely understood and agreed. > > > AI review pointed at a possible pre-existing use-after-free issue, > > related to virtio-balloon. But I think this is a rephrasing of the > > issue it flagged against your v2 patch. > > I actually looked closely at Sashiko's flag, and to my surprise, it is not a > rephrasing—it caught a completely separate, valid edge case. > > My patch fixes the UAF on the PM suspend/teardown path. However, Sashiko noticed > a UAF on the PM *restore* error path. If virtballoon_restore() fails during > init_vqs(), it aborts without unregistering the page reporting worker. When > system_freezable_wq thaws, the reporting worker wakes up and dereferences the > now-dangling vb->reporting_vq pointer. > > Since it's a driver-specific lifecycle bug rather than a core MM workqueue > issue, I will write up a separate follow-up patch to address it in > virtio_balloon.c > shortly. > > Thank you again for shepherding this fix into -mm! > > Best, > Link I suspect rest of work items we have, e.g. update_balloon_stats_work/update_balloon_size_work all have issues around freeze/restore and error handling. -- MST