From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-172.mta1.migadu.com (out-172.mta1.migadu.com [95.215.58.172]) (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 8CC152C0F81 for ; Fri, 17 Jul 2026 01:35:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784252117; cv=none; b=R1+wG1wgZeZIk9RVWgzgyRDptdJaNjxw8PXnuBp1V6V0pbucMN1smj2BWbzVrgBhtVBg2i/F78iFK6vIHRKWLIj/9bGy1q/ZFD8B8vkiLQCZIyls7Ov9k6Ykt19n6wHHzLLlVxjhXppizgZRcqOPHHfO6hJ2r81PphNcEdGyMpk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784252117; c=relaxed/simple; bh=2kmRfvTUuIJbz6daMSTOYhfVFE99m70fXUJqZwwe+rw=; h=Message-ID:Date:MIME-Version:Cc:Subject:To:References:From: In-Reply-To:Content-Type; b=ITrUARFmxX8/QzvuG1trrn8axe4Nw7iniIfLxeEwpsmxof3lmyiRxtEBvFN67Sxmf0MdlndCicwaXqYvB3sOR/YEkbVlWAgcH1C1nqG0r1YyIPcPauQo5H8BPQ8UH3Ql82ak+mNmhn8ALsyfLPIctq8AwXQzaIKatgOJc3RfQDU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=thluSFv7; arc=none smtp.client-ip=95.215.58.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="thluSFv7" Message-ID: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1784252111; 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=WEYuMCvX9cGWxVz0he6+RioCqg0TNaupBeoE5F9gTOI=; b=thluSFv77ZXB8LbpbColp+RfznUIzmfFkNANm6bFbZhCI0Mj7bHQYUrq1uBavmsQH6lmym b+snr83+KaGxdSVXQgN6lCoKZvPITJ9DzIBQrX3z6BnfFHa0zj7EyUaogvYM4186wnIB9W YRkjEiFWdLNlNCFx8/NShH9n0+vMsFI= Date: Fri, 17 Jul 2026 09:34:55 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Cc: hongfu.li@linux.dev, akpm@linux-foundation.org, liam@infradead.org, vbabka@kernel.org, jannh@google.com, pfalcato@suse.de, david@kernel.org, jeffxu@chromium.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Hongfu Li Subject: Re: [PATCH] mm/mseal: Fix range_contains_unmapped() ignoring its mm argument To: "Lorenzo Stoakes (ARM)" References: <20260716093347.75055-1-hongfu.li@linux.dev> X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Hongfu Li In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Migadu-Flow: FLOW_OUT Hi, On 7/16/26 6:19 PM, Lorenzo Stoakes (ARM) wrote: > On Thu, Jul 16, 2026 at 05:33:47PM +0800, Hongfu Li wrote: >> From: Hongfu Li >> >> range_contains_unmapped() accepts an explicit struct mm_struct *mm >> argument, yet hardcodes current->mm inside VMA_ITERATOR(), ignoring >> the passed address space. >> >> Its only caller do_mseal() currently passes current->mm, so the bug >> does not manifest right now. However this mismatch between prototype >> and implementation is a latent bug. >> >> Replace current->mm with the passed mm parameter to match the >> function prototype. >> >> Fixes: 530e09096413 ("mm/mseal: simplify and rename VMA gap check") > There's no point in a Fixes tag for something that's not a bug. > >> Signed-off-by: Hongfu Li >> --- >> mm/mseal.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/mm/mseal.c b/mm/mseal.c >> index 9781647483d1..8d82e50900ba 100644 >> --- a/mm/mseal.c >> +++ b/mm/mseal.c >> @@ -41,7 +41,7 @@ static bool range_contains_unmapped(struct mm_struct *mm, >> { >> struct vm_area_struct *vma; >> unsigned long prev_end = start; >> - VMA_ITERATOR(vmi, current->mm, start); >> + VMA_ITERATOR(vmi, mm, start); > We're never going to sensibly allow a remote mm here, and even suggesting so is > problematic. > > Sorry but I think it's just easier if I send a broader cleanup patch to fix > things up here more clearly. Got it, thanks a lot for explaining the issue with remote mm. A unified broad cleanup patch works better for this code path. I will withdraw my patch and follow your series. Feel free to reach out if you need any testing help later. Best regards, Hongfu