From: Benjamin Berg <benjamin@sipsolutions.net>
To: linux-arch@vger.kernel.org, linux-um@lists.infradead.org,
x86@kernel.org, briannorris@chromium.org
Cc: linux-kernel@vger.kernel.org, kasan-dev@googlegroups.com,
Benjamin Berg <benjamin.berg@intel.com>
Subject: [PATCH 0/3] KASAN fix for arch_dup_task_struct (x86, um)
Date: Tue, 17 Dec 2024 21:27:42 +0100 [thread overview]
Message-ID: <20241217202745.1402932-1-benjamin@sipsolutions.net> (raw)
From: Benjamin Berg <benjamin.berg@intel.com>
On the x86 and um architectures struct task_struct is dynamically
sized depending on the size required to store the floating point
registers. After adding this feature to UML it sometimes triggered
KASAN errors as the memcpy in arch_dup_task_struct read past
init_task.
In my own testing, the reported KASAN error was for a read into the
redzone of the next global variable (init_sighand). Due to padding,
the reported area was already far past the size of init_task.
Note that on x86 the dynamically allocated area of struct task_struct
is quite a bit smaller and may not even exist. This might explain why
this error has not been noticed before.
This problem was reported by Brian Norris <briannorris@chromium.org>.
Benjamin
Benjamin Berg (3):
vmlinux.lds.h: remove entry to place init_task onto init_stack
um: avoid copying FP state from init_task
x86: avoid copying dynamic FP state from init_task
arch/um/kernel/process.c | 10 +++++++++-
arch/x86/kernel/process.c | 10 +++++++++-
include/asm-generic/vmlinux.lds.h | 1 -
3 files changed, 18 insertions(+), 3 deletions(-)
--
2.47.1
next reply other threads:[~2024-12-17 20:30 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-17 20:27 Benjamin Berg [this message]
2024-12-17 20:27 ` [PATCH 1/3] vmlinux.lds.h: remove entry to place init_task onto init_stack Benjamin Berg
2025-02-26 13:15 ` [tip: x86/fpu] vmlinux.lds.h: Remove " tip-bot2 for Benjamin Berg
2024-12-17 20:27 ` [PATCH 2/3] um: avoid copying FP state from init_task Benjamin Berg
2025-01-20 13:36 ` Thomas Weißschuh
2024-12-17 20:27 ` [PATCH 3/3] x86: avoid copying dynamic " Benjamin Berg
2025-02-26 13:08 ` Ingo Molnar
2025-02-26 13:19 ` Benjamin Berg
2025-02-26 13:23 ` Ingo Molnar
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=20241217202745.1402932-1-benjamin@sipsolutions.net \
--to=benjamin@sipsolutions.net \
--cc=benjamin.berg@intel.com \
--cc=briannorris@chromium.org \
--cc=kasan-dev@googlegroups.com \
--cc=linux-arch@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-um@lists.infradead.org \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.