mirror of
https://github.com/tbsdtv/linux_media.git
synced 2025-07-24 05:01:03 +02:00
uaccess: remove CONFIG_SET_FS
There are no remaining callers of set_fs(), so CONFIG_SET_FS can be removed globally, along with the thread_info field and any references to it. This turns access_ok() into a cheaper check against TASK_SIZE_MAX. As CONFIG_SET_FS is now gone, drop all remaining references to set_fs()/get_fs(), mm_segment_t, user_addr_max() and uaccess_kernel(). Acked-by: Sam Ravnborg <sam@ravnborg.org> # for sparc32 changes Acked-by: "Eric W. Biederman" <ebiederm@xmission.com> Tested-by: Sergey Matyukevich <sergey.matyukevich@synopsys.com> # for arc changes Acked-by: Stafford Horne <shorne@gmail.com> # [openrisc, asm-generic] Acked-by: Dinh Nguyen <dinguyen@kernel.org> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
This commit is contained in:
@@ -10,39 +10,6 @@
|
||||
|
||||
#include <asm/uaccess.h>
|
||||
|
||||
#ifdef CONFIG_SET_FS
|
||||
/*
|
||||
* Force the uaccess routines to be wired up for actual userspace access,
|
||||
* overriding any possible set_fs(KERNEL_DS) still lingering around. Undone
|
||||
* using force_uaccess_end below.
|
||||
*/
|
||||
static inline mm_segment_t force_uaccess_begin(void)
|
||||
{
|
||||
mm_segment_t fs = get_fs();
|
||||
|
||||
set_fs(USER_DS);
|
||||
return fs;
|
||||
}
|
||||
|
||||
static inline void force_uaccess_end(mm_segment_t oldfs)
|
||||
{
|
||||
set_fs(oldfs);
|
||||
}
|
||||
#else /* CONFIG_SET_FS */
|
||||
typedef struct {
|
||||
/* empty dummy */
|
||||
} mm_segment_t;
|
||||
|
||||
static inline mm_segment_t force_uaccess_begin(void)
|
||||
{
|
||||
return (mm_segment_t) { };
|
||||
}
|
||||
|
||||
static inline void force_uaccess_end(mm_segment_t oldfs)
|
||||
{
|
||||
}
|
||||
#endif /* CONFIG_SET_FS */
|
||||
|
||||
/*
|
||||
* Architectures should provide two primitives (raw_copy_{to,from}_user())
|
||||
* and get rid of their private instances of copy_{to,from}_user() and
|
||||
|
Reference in New Issue
Block a user