diff options
author | Benjamin Berg <benjamin.berg@intel.com> | 2024-07-03 16:45:30 +0300 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2024-07-03 18:09:49 +0300 |
commit | 7911b650a0708a3ee3412d80838b9574b21a53c8 (patch) | |
tree | 5fabae2329b2f660020b4e55c61492ebe559c777 /arch/um/kernel | |
parent | 6d8992e49e2aed3ee2d73b88050f40f26ae6bf86 (diff) | |
download | linux-7911b650a0708a3ee3412d80838b9574b21a53c8.tar.xz |
um: remove LDT support
The current LDT code has a few issues that mean it should be redone in a
different way once we always start with a fresh MM even when cloning.
In a new and better world, the kernel would just ensure its own LDT is
clear at startup. At that point, all that is needed is a simple function
to populate the LDT from another MM in arch_dup_mmap combined with some
tracking of the installed LDT entries for each MM.
Note that the old implementation was even incorrect with regard to
reading, as it copied out the LDT entries in the internal format rather
than converting them to the userspace structure.
Removal should be fine as the LDT is not used for thread-local storage
anymore.
Signed-off-by: Benjamin Berg <benjamin.berg@intel.com>
Link: https://patch.msgid.link/20240703134536.1161108-7-benjamin@sipsolutions.net
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'arch/um/kernel')
-rw-r--r-- | arch/um/kernel/skas/mmu.c | 8 | ||||
-rw-r--r-- | arch/um/kernel/skas/stub.c | 11 |
2 files changed, 0 insertions, 19 deletions
diff --git a/arch/um/kernel/skas/mmu.c b/arch/um/kernel/skas/mmu.c index 681839cdd795..968e254cf709 100644 --- a/arch/um/kernel/skas/mmu.c +++ b/arch/um/kernel/skas/mmu.c @@ -46,13 +46,6 @@ int init_new_context(struct task_struct *task, struct mm_struct *mm) goto out_free; } - ret = init_new_ldt(to_mm, from_mm); - if (ret < 0) { - printk(KERN_ERR "init_new_context_skas - init_ldt" - " failed, errno = %d\n", ret); - goto out_free; - } - return 0; out_free: @@ -80,5 +73,4 @@ void destroy_context(struct mm_struct *mm) os_kill_ptraced_process(mmu->id.u.pid, 1); free_pages(mmu->id.stack, ilog2(STUB_DATA_PAGES)); - free_ldt(mmu); } diff --git a/arch/um/kernel/skas/stub.c b/arch/um/kernel/skas/stub.c index 8773529b5048..5d52ffa682dc 100644 --- a/arch/um/kernel/skas/stub.c +++ b/arch/um/kernel/skas/stub.c @@ -45,17 +45,6 @@ static __always_inline int syscall_handler(struct stub_data *d) return -1; } break; - case STUB_SYSCALL_LDT: - res = stub_syscall3(__NR_modify_ldt, sc->ldt.func, - (unsigned long) &sc->ldt.desc, - sizeof(sc->ldt.desc)); - /* We only write, so the expected result is zero */ - if (res) { - d->err = res; - d->syscall_data_len = i; - return -1; - } - break; default: d->err = -95; /* EOPNOTSUPP */ d->syscall_data_len = i; |