Skip to content

Commit 6bfce77

Browse files
committed
Merge tag 'core-entry-2023-08-28' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull core entry code update from Thomas Gleixner: "A single update to the core entry code, which removes the empty user address limit check which is a leftover of the removed TIF_FSCHECK" * tag 'core-entry-2023-08-28' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: entry: Remove empty addr_limit_user_check()
2 parents b98af53 + 1dfe3a5 commit 6bfce77

File tree

2 files changed

+1
-18
lines changed

2 files changed

+1
-18
lines changed

include/linux/syscalls.h

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -283,22 +283,6 @@ static inline int is_syscall_trace_event(struct trace_event_call *tp_event)
283283
#define SYSCALL32_DEFINE6 SYSCALL_DEFINE6
284284
#endif
285285

286-
/*
287-
* Called before coming back to user-mode. Returning to user-mode with an
288-
* address limit different than USER_DS can allow to overwrite kernel memory.
289-
*/
290-
static inline void addr_limit_user_check(void)
291-
{
292-
#ifdef TIF_FSCHECK
293-
if (!test_thread_flag(TIF_FSCHECK))
294-
return;
295-
#endif
296-
297-
#ifdef TIF_FSCHECK
298-
clear_thread_flag(TIF_FSCHECK);
299-
#endif
300-
}
301-
302286
/*
303287
* These syscall function prototypes are kept in the same order as
304288
* include/uapi/asm-generic/unistd.h. Architecture specific entries go below,

kernel/entry/common.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,8 +205,7 @@ static void exit_to_user_mode_prepare(struct pt_regs *regs)
205205

206206
arch_exit_to_user_mode_prepare(regs, ti_work);
207207

208-
/* Ensure that the address limit is intact and no locks are held */
209-
addr_limit_user_check();
208+
/* Ensure that kernel state is sane for a return to userspace */
210209
kmap_assert_nomap();
211210
lockdep_assert_irqs_disabled();
212211
lockdep_sys_exit();

0 commit comments

Comments
 (0)