From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (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 5756D1AC88C; Thu, 15 Aug 2024 10:57:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723719473; cv=none; b=Aa7nJxkSeTJs1frqjhxik73BPzkPbYcr18TbPEM083kpS9iQTyr/oSoc6FarAMb0axCf1/ILT5K60Fz2kF/TCW7w0dAvNUJnDuWTqXUFlMsmYbesDPgQoHGPC7hYg1uAmlLTPpSa/DUY0RqQMGgkleBJ+DjihfgX+k0w9BzdfIs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723719473; c=relaxed/simple; bh=OR897adyomGx6ta2gTUOROeKGS/AwcNG/7KEA8caKhw=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=H+eFr3wld2MLRXK+RpIWVS1IGm5xkBZlVbLM7k2K60B8foNcTsrqOqndrmKfgkSNQ9e4N1ABexoU62Zvw7r9Q7tZBYVrGOFIZU+o0tf2bBm1O7giEGifYXC4mUI6kQ5oD8m5hEiHJIg03tYte9MEYz/VKSZb5ctJ5jQGBKCvf8o= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=fNHIL7NF; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=hBt6hR7X; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="fNHIL7NF"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="hBt6hR7X" From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1723719470; 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: in-reply-to:in-reply-to:references:references; bh=A8ebSU8/6XZn/8ULIh3Q/WZP2fvFGkPefnWFmwKN9UM=; b=fNHIL7NFy3j+g1DPbddkuRqf4tichpEWQzTSwt6b6rliU183ZQD9rSaVnUWWNOHOw8HxGJ iNfUp5aUvemQt+MO8csAQlcO/EouyMWWMrhOHxQxgZqSGyI21RRhRlKOGB6L8eglJt8euy +M8zDp1lPZV9eHiatQ5k9ufmnewcYyd9ieo5ztSsqKES9aDTHfwZop0zV7//44hr42pGB4 ODsD2FgLM95i76U73TJXduX/DDhMthuu/wAsnrmo6N9rSJgXUXMt3jlw7UtT+bM5Hdok9D WJw1vKd1TQOHi+MbRI28f63aV51DOu2xsi1ZvYbNT1CKY23Dt2Yg3DGp5OqdvA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1723719470; 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: in-reply-to:in-reply-to:references:references; bh=A8ebSU8/6XZn/8ULIh3Q/WZP2fvFGkPefnWFmwKN9UM=; b=hBt6hR7XhsC4/kP0g8rbOg1cvUe/nPv9tT3CbjPUmAXR2oeyPOnkbfwScKFrED+4Dc/IcZ VDvjKRn8LLEx34CA== To: "Kirill A. Shutemov" Cc: Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , "Rafael J. Wysocki" , Andy Lutomirski , Peter Zijlstra , Baoquan He , Ard Biesheuvel , Tom Lendacky , Andrew Morton , Thomas Zimmermann , Sean Christopherson , linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org, Kai Huang Subject: Re: [PATCHv2 1/4] x86/mm/ident_map: Fix virtual address wrap to zero In-Reply-To: <5iijyqzxd3ccranzvmfgvf3mvkesfbjsuggtuppa5wf6z444dd@ft5h2m6u2ggw> References: <20240814124613.2632226-1-kirill.shutemov@linux.intel.com> <20240814124613.2632226-2-kirill.shutemov@linux.intel.com> <87cymaoqj4.ffs@tglx> <5iijyqzxd3ccranzvmfgvf3mvkesfbjsuggtuppa5wf6z444dd@ft5h2m6u2ggw> Date: Thu, 15 Aug 2024 12:57:49 +0200 Message-ID: <87wmkim4sy.ffs@tglx> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain On Thu, Aug 15 2024 at 12:15, Kirill A. Shutemov wrote: > On Wed, Aug 14, 2024 at 09:25:35PM +0200, Thomas Gleixner wrote: >> On Wed, Aug 14 2024 at 15:46, Kirill A. Shutemov wrote: >> > Calculation of 'next' virtual address doesn't protect against wrapping >> > to zero. It can result in page table corruption and hang. The >> > problematic case is possible if user sets high x86_mapping_info::offset. >> >> So this should have a Fixes tag, right? > > Well, I guess we can add > > Fixes: e4630fdd4763 ("x86/power/64: Always create temporary identity mapping correctly") > > but the bug is not triggirable with current upstream code. > > It only wraps to zero if you touch top PGD entry. There's no such users in > upstream. Only hibernate_64.c uses x86_mapping_info::offset and it works > on direct mapping range which is not top PGD entry. Fair enough, but please mention that in the change log.