]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/4.16.4/um-use-posix-ucontext_t-instead-of-struct-ucontext.patch
Fixes for 4.19
[thirdparty/kernel/stable-queue.git] / releases / 4.16.4 / um-use-posix-ucontext_t-instead-of-struct-ucontext.patch
1 From 4d1a535b8ec5e74b42dfd9dc809142653b2597f6 Mon Sep 17 00:00:00 2001
2 From: Krzysztof Mazur <krzysiek@podlesie.net>
3 Date: Wed, 15 Nov 2017 11:12:39 +0100
4 Subject: um: Use POSIX ucontext_t instead of struct ucontext
5
6 From: Krzysztof Mazur <krzysiek@podlesie.net>
7
8 commit 4d1a535b8ec5e74b42dfd9dc809142653b2597f6 upstream.
9
10 glibc 2.26 removed the 'struct ucontext' to "improve" POSIX compliance
11 and break programs, including User Mode Linux. Fix User Mode Linux
12 by using POSIX ucontext_t.
13
14 This fixes:
15
16 arch/um/os-Linux/signal.c: In function 'hard_handler':
17 arch/um/os-Linux/signal.c:163:22: error: dereferencing pointer to incomplete type 'struct ucontext'
18 mcontext_t *mc = &uc->uc_mcontext;
19 arch/x86/um/stub_segv.c: In function 'stub_segv_handler':
20 arch/x86/um/stub_segv.c:16:13: error: dereferencing pointer to incomplete type 'struct ucontext'
21 &uc->uc_mcontext);
22
23 Cc: stable@vger.kernel.org
24 Signed-off-by: Krzysztof Mazur <krzysiek@podlesie.net>
25 Signed-off-by: Richard Weinberger <richard@nod.at>
26 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
27
28 ---
29 arch/um/os-Linux/signal.c | 2 +-
30 arch/x86/um/stub_segv.c | 2 +-
31 2 files changed, 2 insertions(+), 2 deletions(-)
32
33 --- a/arch/um/os-Linux/signal.c
34 +++ b/arch/um/os-Linux/signal.c
35 @@ -160,7 +160,7 @@ static void (*handlers[_NSIG])(int sig,
36
37 static void hard_handler(int sig, siginfo_t *si, void *p)
38 {
39 - struct ucontext *uc = p;
40 + ucontext_t *uc = p;
41 mcontext_t *mc = &uc->uc_mcontext;
42 unsigned long pending = 1UL << sig;
43
44 --- a/arch/x86/um/stub_segv.c
45 +++ b/arch/x86/um/stub_segv.c
46 @@ -11,7 +11,7 @@
47 void __attribute__ ((__section__ (".__syscall_stub")))
48 stub_segv_handler(int sig, siginfo_t *info, void *p)
49 {
50 - struct ucontext *uc = p;
51 + ucontext_t *uc = p;
52
53 GET_FAULTINFO_FROM_MC(*((struct faultinfo *) STUB_DATA),
54 &uc->uc_mcontext);