Received: by 2002:a05:6500:1b8f:b0:1fa:5c73:8e2d with SMTP id df15csp709923lqb; Wed, 29 May 2024 08:22:41 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVS1nNU3EfiE/SJ9UX5MYpSCps73BkPFMl8P3bOSfH9a8zNo7/BbNQJ/hl2GvNDbMXLLdonHNeWyNsItZAC/e6ODbh1/S8xGZ4WIvB64w== X-Google-Smtp-Source: AGHT+IEP/HCVYi1lJM+pqfRsq4o7GZFYUihZiutbA5BnC6c0CoqMG6cuovpKz0Dmbo1FbVMxgXSt X-Received: by 2002:a05:6a00:368d:b0:6f4:5504:59b6 with SMTP id d2e1a72fcca58-6f8f41aa960mr17014032b3a.29.1716996161566; Wed, 29 May 2024 08:22:41 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716996161; cv=pass; d=google.com; s=arc-20160816; b=eZDDnIv5K1/ziYv2mKYaALZUAwNKMGKuLBvnsljG6hBw/DX0sDz1Qu7SggA54L92g5 Rt3Y1hD5WgQQmc0E5NY1dUxs/X3XWzTHNnsIT3IRxldEIVbJ8M8mLsYVEbvr1d6t3ZlM 4o+Qh8O/15bWwTZWELhdvRcTXiClxHWNQY3RV4hYMhrXg9zuyHB+Ciql5cEdEbn3IOfV BUB04XiHpVx7Z/f+Plv5tLuHKqO74ChwCcrHGDgSRlXgVahwMg2ex8Gjyu78lGv3oAaL uWvzb1b/6KjsP+3dl4SgOrKQR7xYPJ5hhiloiOtC0deAN2X1//0DHFj8lNR4gjTwDzzk ttJw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=user-agent:in-reply-to:content-transfer-encoding :content-disposition:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:references:message-id:subject:cc:to:from:date :dkim-signature; bh=VNxcZgFfcodyps6/cP1ELd7JgcGrGVKAVdw/HXZfhHg=; fh=xjQGTpF9xsGCW5ecvGXSkrvy6ceZrc6VxkVVnTEI+Nw=; b=oCVgkEpl9Tl8rS37QleSDhLbGNxnK86QEwyCyex8346Axww05p9ahzi/qh5/wDneyB czvXvMg28MDzgsKICGbDWUold/sYq7CEtJmvafq+uTaA6DV+Ung7TbbmQD4TMcW0uMbo sSuY/s7pA7Poj0TyArOxPAI2gZfa990qJnlwnwaiggsYapELcZoaKpGlvPZcg36TyMSs 5YohxqpAP3wIvN81+EoYDZb4TmzfzvtEiyCKtgrjgSDYL0/lyqQlphxiOILGDVTQLmxU pzAw/3xSY9FMjlsi/9BxH55FOQpl4ZG38qMB9KP2UO1By8Rmm/zAH+I9Q9Xf46d5KhsH p11Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=FgNgboAs; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-194353-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-194353-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id d2e1a72fcca58-6f8fcfd7d39si10464653b3a.208.2024.05.29.08.22.41 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 May 2024 08:22:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-194353-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=FgNgboAs; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-194353-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-194353-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=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 DB4F028985B for ; Wed, 29 May 2024 15:22:09 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A6820180A85; Wed, 29 May 2024 15:21:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="FgNgboAs" 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 D30FE17BB17 for ; Wed, 29 May 2024 15:21:30 +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=1716996090; cv=none; b=nVzZl+GPZfjReIEN6hnvYHP7ZLPFdnp/UYRSQy0rOIhlTwgKUZoJjW3AVZ/Tu9iwdWgJBkffN7tpCAyucqhhuamjxfBS84G/3juzDGoTwTguRllP9rjT3+xW4j016RnbAVgaK7jlGMM1ZU8Ro+cS6cnlCmN4+iSrcMNE/0kaeDs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716996090; c=relaxed/simple; bh=TvcuEg9n5sSq+m+PI5BmZfgamlWMCayUM1VGOKQGHuo=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=BWZXULJrucKJfgnxegZKh+4C8HfGk6uqOhqAxk2UE1HLzHs1KATQKglP9dCm58FX80bSMXdtszndfsftlL0vPHnFOHBsAGuPOx33FKZZnVDFMnUHip+mh1yubXc8g5qEjcvUdhYv4LNC5s1z3GemLyYat1RZefSazDDtOFvORN0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=FgNgboAs; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id E1F55C113CC; Wed, 29 May 2024 15:21:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1716996090; bh=TvcuEg9n5sSq+m+PI5BmZfgamlWMCayUM1VGOKQGHuo=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=FgNgboAspZjEFliAH6Vtbh1m/WDWqbpBZrRCT0Wkv88OVnS57/o/x/+XOTXjvXTs+ eE01gsFT84ZHNM8qt11w7G0e6Mm9ilCA7KS40Pg9+w9ksCcazgfZ0VGh3zo9sLP+L4 K/LiuIjGXpf26zis349iv2FfyF7Fk/uw326MFqMbE8JeRBf05RGdsWM4n9DEZppwoS kCAqnVeFzPpS/oUVt9hHXValY3EfL4oO0NZFRxLq0LOKA8C3YV3JHxGiCQgN/wg4MM EyYgYEc9K9aXus0RIr/brTZrMo1LoivrFFUPTYSvsu0ui2vfq6C8KukR1Picns1Pru ZoW8aUsDTanWw== Date: Wed, 29 May 2024 16:21:23 +0100 From: Will Deacon To: Mark Rutland Cc: Barry Song <21cnbao@gmail.com>, akpm@linux-foundation.org, linux-mm@kvack.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Barry Song , Lance Yang , Ryan Roberts , David Hildenbrand , Jeff Xie , Kefeng Wang , Michal Hocko , Minchan Kim , Muchun Song , Peter Xu , Yang Shi , Yin Fengwei , Zach O'Keefe , Catalin Marinas Subject: Re: [PATCH] mm: arm64: Fix the out-of-bounds issue in contpte_clear_young_dirty_ptes Message-ID: <20240529152123.GA13782@willie-the-truck> References: <20240524005444.135417-1-21cnbao@gmail.com> 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: User-Agent: Mutt/1.10.1 (2018-07-13) On Wed, May 29, 2024 at 03:59:13PM +0100, Mark Rutland wrote: > On Tue, May 28, 2024 at 08:39:55PM +1200, Barry Song wrote: > > On Tue, May 28, 2024 at 8:26 PM Mark Rutland wrote: > > > On Fri, May 24, 2024 at 12:54:44PM +1200, Barry Song wrote: > > > > From: Barry Song > > > > > > > > We are passing a huge nr to __clear_young_dirty_ptes() right > > > > now. While we should pass the number of pages, we are actually > > > > passing CONT_PTE_SIZE. This is causing lots of crashes of > > > > MADV_FREE, panic oops could vary everytime. > > > > > > > > Fixes: 89e86854fb0a ("mm/arm64: override clear_young_dirty_ptes() batch helper") > > > > > > I was seeing ths same thing on v6.10-rc1 (syzkaller splat and reproducer > > > included at the end of the mail). The patch makes sense to me, and fixed the > > > splat in testing, so: > > > > > > Reviewed-by: Mark Rutland > > > Tested-by: Mark Rutland > > > > Thanks! > > > > > Since this only affects arm64 and is already in mainline, I assume the fix > > > should go via the arm64 tree even though the broken commit went via mm. > > > > Either mm or arm64 is fine with me, but I noticed that Andrew has already > > included it in mm-hotfixes-unstable. If it works, we may want to stick with > > that. :-) > > Going via mm is also fine by me, I had just expected it'd be quicker to > go via arm64 (and evidently I was wrong there!). :) Sorry, I was fishing! I'm happy for it to land via -mm. Will