mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "tip-bot2 for Guilherme Giacomo Simoes" <tip-bot2@linutronix.de>
To: linux-tip-commits@vger.kernel.org
Cc: Guilherme Giacomo Simoes <trintaeoitogc@gmail.com>,
	Thomas Gleixner <tglx@kernel.org>,
	thomas.weissschuh@linutronix.de, x86@kernel.org,
	linux-kernel@vger.kernel.org
Subject: [tip: x86/urgent] x86/vdso: Fix incorrect size in munmap() on map_vdso() failure
Date: Tue, 19 May 2026 14:41:19 -0000	[thread overview]
Message-ID: <177920167991.711.4337013511598192038.tip-bot2@tip-bot2> (raw)
In-Reply-To: <20260503191609.551817-1-trintaeoitogc@gmail.com>

The following commit has been merged into the x86/urgent branch of tip:

Commit-ID:     b088fe35019433541225d315263d8477899e0657
Gitweb:        https://git.kernel.org/tip/b088fe35019433541225d315263d8477899e0657
Author:        Guilherme Giacomo Simoes <trintaeoitogc@gmail.com>
AuthorDate:    Sun, 03 May 2026 16:16:09 -03:00
Committer:     Thomas Gleixner <tglx@kernel.org>
CommitterDate: Tue, 19 May 2026 16:36:34 +02:00

x86/vdso: Fix incorrect size in munmap() on map_vdso() failure

In map_vdso(), if a failure occurs during the installation of the VVAR
mappings, the error path attempts to clean up previously allocated mappings
using do_munmap(). However, the cleanup for the VVAR mapping is incorrectly
using image->size (the size of the vDSO text) instead of the actual size
allocated for the VVAR area.

Replace the incorrect do_munmap() image->size parameter with the constant
VDSO_NR_PAGES * PAGE_SIZE. Ensure the unmap size exactly matches the size
used during the vdso_install_vvar_mapping() phase to provide a symmetrical
and complete teardown of the memory region.

Fixes: e93d2521b27f ("x86/vdso: Split virtual clock pages into dedicated mapping")
Signed-off-by: Guilherme Giacomo Simoes <trintaeoitogc@gmail.com>
Signed-off-by: Thomas Gleixner <tglx@kernel.org>
Reviewed-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
Link: https://patch.msgid.link/20260503191609.551817-1-trintaeoitogc@gmail.com
---
 arch/x86/entry/vdso/vma.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/entry/vdso/vma.c b/arch/x86/entry/vdso/vma.c
index a6bfcc8..d903bce 100644
--- a/arch/x86/entry/vdso/vma.c
+++ b/arch/x86/entry/vdso/vma.c
@@ -178,7 +178,7 @@ static int map_vdso(const struct vdso_image *image, unsigned long addr)
 	if (IS_ERR(vma)) {
 		ret = PTR_ERR(vma);
 		do_munmap(mm, text_start, image->size, NULL);
-		do_munmap(mm, addr, image->size, NULL);
+		do_munmap(mm, addr, VDSO_NR_PAGES * PAGE_SIZE, NULL);
 		goto up_fail;
 	}
 

      parent reply	other threads:[~2026-05-19 14:41 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-03 19:16 [PATCH] x86/vdso: fix incorrect size in munmap during map_vdso failure Guilherme Giacomo Simoes
2026-05-05 11:39 ` Thomas Weißschuh
2026-05-05 12:24   ` Guilherme Giacomo Simoes
2026-05-18 13:13     ` Guilherme Giacomo Simoes
2026-05-19 14:41 ` tip-bot2 for Guilherme Giacomo Simoes [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=177920167991.711.4337013511598192038.tip-bot2@tip-bot2 \
    --to=tip-bot2@linutronix.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=tglx@kernel.org \
    --cc=thomas.weissschuh@linutronix.de \
    --cc=trintaeoitogc@gmail.com \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®