History

Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace

Pull namespace updates from Eric Biederman: "Life has been busy and I have not gotten half as much done this round as I would have liked. I delayed it so that a minor conflict resolution with the mips tree could spend a little time in linux-next before I sent this pull request. This includes two long delayed user namespace changes from Kirill Tkhai. It also includes a very useful change from Serge Hallyn that allows the security capability attribute to be used inside of user namespaces. The practical effect of this is people can now untar tarballs and install rpms in user namespaces. It had been suggested to generalize this and encode some of the namespace information information in the xattr name. Upon close inspection that makes the things that should be hard easy and the things that should be easy more expensive. Then there is my bugfix/cleanup for signal injection that removes the magic encoding of the siginfo union member from the kernel internal si_code. The mips folks reported the case where I had used FPE_FIXME me is impossible so I have remove FPE_FIXME from mips, while at the same time including a return statement in that case to keep gcc from complaining about unitialized variables. I almost finished the work to get make copy_siginfo_to_user a trivial copy to user. The code is available at: git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace.git neuter-copy_siginfo_to_user-v3 But I did not have time/energy to get the code posted and reviewed before the merge window opened. I was able to see that the security excuse for just copying fields that we know are initialized doesn't work in practice there are buggy initializations that don't initialize the proper fields in siginfo. So we still sometimes copy unitialized data to userspace" * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace: Introduce v3 namespaced file capabilities mips/signal: In force_fcr31_sig return in the impossible case signal: Remove kernel interal si_code magic fcntl: Don't use ambiguous SIG_POLL si_codes prctl: Allow local CAP_SYS_ADMIN changing exe_file security: Use user_namespace::level to avoid redundant iterations in cap_capable() userns,pidns: Verify the userns for new pid namespaces signal/testing: Don't look for __SI_FAULT in userspace signal/mips: Document a conflict with SI_USER with SIGFPE signal/sparc: Document a conflict with SI_USER with SIGFPE signal/ia64: Document a conflict with SI_USER with SIGFPE signal/alpha: Document a conflict with SI_USER for SIGTRAP

Linus Torvalds committed 9 years ago

Commit dd198ce2 parents 89fd915 076a9bc40 files · +622 −297Browse files

Showing the changes to include/uapi (2 of 40 files). Show all

Unified · Split

2 files
  1. include/uapi/asm-generic/siginfo.h +46 −69
  2. include/uapi/linux/capability.h +19 −3
include/uapi/asm-generic/siginfo.h+46−69
@@ -151,29 +151,6 @@ typedef struct siginfo { · 150 unmodified lines
151#define si_arch _sifields._sigsys._arch151#define si_arch _sifields._sigsys._arch
152#endif152#endif
153 153
154#ifdef __KERNEL__
155#define __SI_MASK 0xffff0000u
156#define __SI_KILL (0 << 16)
157#define __SI_TIMER (1 << 16)
158#define __SI_POLL (2 << 16)
159#define __SI_FAULT (3 << 16)
160#define __SI_CHLD (4 << 16)
161#define __SI_RT (5 << 16)
162#define __SI_MESGQ (6 << 16)
163#define __SI_SYS (7 << 16)
164#define __SI_CODE(T,N) ((T) | ((N) & 0xffff))
165#else /* __KERNEL__ */
166#define __SI_KILL 0
167#define __SI_TIMER 0
168#define __SI_POLL 0
169#define __SI_FAULT 0
170#define __SI_CHLD 0
171#define __SI_RT 0
172#define __SI_MESGQ 0
173#define __SI_SYS 0
174#define __SI_CODE(T,N) (N)
175#endif /* __KERNEL__ */
176
177/*154/*
178 * si_code values155 * si_code values
179 * Digital reserves positive values for kernel-generated signals.156 * Digital reserves positive values for kernel-generated signals.
@@ -181,8 +158,8 @@ typedef struct siginfo { · 1 unmodified line
181#define SI_USER 0 /* sent by kill, sigsend, raise */158#define SI_USER 0 /* sent by kill, sigsend, raise */
182#define SI_KERNEL 0x80 /* sent by the kernel from somewhere */159#define SI_KERNEL 0x80 /* sent by the kernel from somewhere */
183#define SI_QUEUE -1 /* sent by sigqueue */160#define SI_QUEUE -1 /* sent by sigqueue */
184#define SI_TIMER __SI_CODE(__SI_TIMER,-2) /* sent by timer expiration */161#define SI_TIMER -2 /* sent by timer expiration */
185#define SI_MESGQ __SI_CODE(__SI_MESGQ,-3) /* sent by real time mesq state change */162#define SI_MESGQ -3 /* sent by real time mesq state change */
186#define SI_ASYNCIO -4 /* sent by AIO completion */163#define SI_ASYNCIO -4 /* sent by AIO completion */
187#define SI_SIGIO -5 /* sent by queued SIGIO */164#define SI_SIGIO -5 /* sent by queued SIGIO */
188#define SI_TKILL -6 /* sent by tkill system call */165#define SI_TKILL -6 /* sent by tkill system call */
@@ -194,86 +171,86 @@ typedef struct siginfo { · 5 unmodified lines
194/*171/*
195 * SIGILL si_codes172 * SIGILL si_codes
196 */173 */
197#define ILL_ILLOPC (__SI_FAULT|1) /* illegal opcode */174#define ILL_ILLOPC 1 /* illegal opcode */
198#define ILL_ILLOPN (__SI_FAULT|2) /* illegal operand */175#define ILL_ILLOPN 2 /* illegal operand */
199#define ILL_ILLADR (__SI_FAULT|3) /* illegal addressing mode */176#define ILL_ILLADR 3 /* illegal addressing mode */
200#define ILL_ILLTRP (__SI_FAULT|4) /* illegal trap */177#define ILL_ILLTRP 4 /* illegal trap */
201#define ILL_PRVOPC (__SI_FAULT|5) /* privileged opcode */178#define ILL_PRVOPC 5 /* privileged opcode */
202#define ILL_PRVREG (__SI_FAULT|6) /* privileged register */179#define ILL_PRVREG 6 /* privileged register */
203#define ILL_COPROC (__SI_FAULT|7) /* coprocessor error */180#define ILL_COPROC 7 /* coprocessor error */
204#define ILL_BADSTK (__SI_FAULT|8) /* internal stack error */181#define ILL_BADSTK 8 /* internal stack error */
205#define NSIGILL 8182#define NSIGILL 8
206 183
207/*184/*
208 * SIGFPE si_codes185 * SIGFPE si_codes
209 */186 */
210#define FPE_INTDIV (__SI_FAULT|1) /* integer divide by zero */187#define FPE_INTDIV 1 /* integer divide by zero */
211#define FPE_INTOVF (__SI_FAULT|2) /* integer overflow */188#define FPE_INTOVF 2 /* integer overflow */
212#define FPE_FLTDIV (__SI_FAULT|3) /* floating point divide by zero */189#define FPE_FLTDIV 3 /* floating point divide by zero */
213#define FPE_FLTOVF (__SI_FAULT|4) /* floating point overflow */190#define FPE_FLTOVF 4 /* floating point overflow */
214#define FPE_FLTUND (__SI_FAULT|5) /* floating point underflow */191#define FPE_FLTUND 5 /* floating point underflow */
215#define FPE_FLTRES (__SI_FAULT|6) /* floating point inexact result */192#define FPE_FLTRES 6 /* floating point inexact result */
216#define FPE_FLTINV (__SI_FAULT|7) /* floating point invalid operation */193#define FPE_FLTINV 7 /* floating point invalid operation */
217#define FPE_FLTSUB (__SI_FAULT|8) /* subscript out of range */194#define FPE_FLTSUB 8 /* subscript out of range */
218#define NSIGFPE 8195#define NSIGFPE 8
219 196
220/*197/*
221 * SIGSEGV si_codes198 * SIGSEGV si_codes
222 */199 */
223#define SEGV_MAPERR (__SI_FAULT|1) /* address not mapped to object */200#define SEGV_MAPERR 1 /* address not mapped to object */
224#define SEGV_ACCERR (__SI_FAULT|2) /* invalid permissions for mapped object */201#define SEGV_ACCERR 2 /* invalid permissions for mapped object */
225#define SEGV_BNDERR (__SI_FAULT|3) /* failed address bound checks */202#define SEGV_BNDERR 3 /* failed address bound checks */
226#define SEGV_PKUERR (__SI_FAULT|4) /* failed protection key checks */203#define SEGV_PKUERR 4 /* failed protection key checks */
227#define NSIGSEGV 4204#define NSIGSEGV 4
228 205
229/*206/*
230 * SIGBUS si_codes207 * SIGBUS si_codes
231 */208 */
232#define BUS_ADRALN (__SI_FAULT|1) /* invalid address alignment */209#define BUS_ADRALN 1 /* invalid address alignment */
233#define BUS_ADRERR (__SI_FAULT|2) /* non-existent physical address */210#define BUS_ADRERR 2 /* non-existent physical address */
234#define BUS_OBJERR (__SI_FAULT|3) /* object specific hardware error */211#define BUS_OBJERR 3 /* object specific hardware error */
235/* hardware memory error consumed on a machine check: action required */212/* hardware memory error consumed on a machine check: action required */
236#define BUS_MCEERR_AR (__SI_FAULT|4)213#define BUS_MCEERR_AR 4
237/* hardware memory error detected in process but not consumed: action optional*/214/* hardware memory error detected in process but not consumed: action optional*/
238#define BUS_MCEERR_AO (__SI_FAULT|5)215#define BUS_MCEERR_AO 5
239#define NSIGBUS 5216#define NSIGBUS 5
240 217
241/*218/*
242 * SIGTRAP si_codes219 * SIGTRAP si_codes
243 */220 */
244#define TRAP_BRKPT (__SI_FAULT|1) /* process breakpoint */221#define TRAP_BRKPT 1 /* process breakpoint */
245#define TRAP_TRACE (__SI_FAULT|2) /* process trace trap */222#define TRAP_TRACE 2 /* process trace trap */
246#define TRAP_BRANCH (__SI_FAULT|3) /* process taken branch trap */223#define TRAP_BRANCH 3 /* process taken branch trap */
247#define TRAP_HWBKPT (__SI_FAULT|4) /* hardware breakpoint/watchpoint */224#define TRAP_HWBKPT 4 /* hardware breakpoint/watchpoint */
248#define NSIGTRAP 4225#define NSIGTRAP 4
249 226
250/*227/*
251 * SIGCHLD si_codes228 * SIGCHLD si_codes
252 */229 */
253#define CLD_EXITED (__SI_CHLD|1) /* child has exited */230#define CLD_EXITED 1 /* child has exited */
254#define CLD_KILLED (__SI_CHLD|2) /* child was killed */231#define CLD_KILLED 2 /* child was killed */
255#define CLD_DUMPED (__SI_CHLD|3) /* child terminated abnormally */232#define CLD_DUMPED 3 /* child terminated abnormally */
256#define CLD_TRAPPED (__SI_CHLD|4) /* traced child has trapped */233#define CLD_TRAPPED 4 /* traced child has trapped */
257#define CLD_STOPPED (__SI_CHLD|5) /* child has stopped */234#define CLD_STOPPED 5 /* child has stopped */
258#define CLD_CONTINUED (__SI_CHLD|6) /* stopped child has continued */235#define CLD_CONTINUED 6 /* stopped child has continued */
259#define NSIGCHLD 6236#define NSIGCHLD 6
260 237
261/*238/*
262 * SIGPOLL si_codes239 * SIGPOLL (or any other signal without signal specific si_codes) si_codes
263 */240 */
264#define POLL_IN (__SI_POLL|1) /* data input available */241#define POLL_IN 1 /* data input available */
265#define POLL_OUT (__SI_POLL|2) /* output buffers available */242#define POLL_OUT 2 /* output buffers available */
266#define POLL_MSG (__SI_POLL|3) /* input message available */243#define POLL_MSG 3 /* input message available */
267#define POLL_ERR (__SI_POLL|4) /* i/o error */244#define POLL_ERR 4 /* i/o error */
268#define POLL_PRI (__SI_POLL|5) /* high priority input available */245#define POLL_PRI 5 /* high priority input available */
269#define POLL_HUP (__SI_POLL|6) /* device disconnected */246#define POLL_HUP 6 /* device disconnected */
270#define NSIGPOLL 6247#define NSIGPOLL 6
271 248
272/*249/*
273 * SIGSYS si_codes250 * SIGSYS si_codes
274 */251 */
275#define SYS_SECCOMP (__SI_SYS|1) /* seccomp triggered */252#define SYS_SECCOMP 1 /* seccomp triggered */
276#define NSIGSYS 1253#define NSIGSYS 1
277 254
278/*255/*
279 * sigevent definitions256 * sigevent definitions
include/uapi/linux/capability.h+19−3
@@ -60,9 +60,13 @@ typedef struct __user_cap_data_struct { · 59 unmodified lines
60#define VFS_CAP_U32_2 260#define VFS_CAP_U32_2 2
61#define XATTR_CAPS_SZ_2 (sizeof(__le32)*(1 + 2*VFS_CAP_U32_2))61#define XATTR_CAPS_SZ_2 (sizeof(__le32)*(1 + 2*VFS_CAP_U32_2))
62 62
63#define XATTR_CAPS_SZ XATTR_CAPS_SZ_263#define VFS_CAP_REVISION_3 0x03000000
64#define VFS_CAP_U32 VFS_CAP_U32_264#define VFS_CAP_U32_3 2
65#define VFS_CAP_REVISION VFS_CAP_REVISION_265#define XATTR_CAPS_SZ_3 (sizeof(__le32)*(2 + 2*VFS_CAP_U32_3))
66
67#define XATTR_CAPS_SZ XATTR_CAPS_SZ_3
68#define VFS_CAP_U32 VFS_CAP_U32_3
69#define VFS_CAP_REVISION VFS_CAP_REVISION_3
66 70
67struct vfs_cap_data {71struct vfs_cap_data {
68 __le32 magic_etc; /* Little endian */72 __le32 magic_etc; /* Little endian */
@@ -72,6 +76,18 @@ struct vfs_cap_data { · 3 unmodified lines
72 } data[VFS_CAP_U32];76 } data[VFS_CAP_U32];
73};77};
74 78
79/*
80 * same as vfs_cap_data but with a rootid at the end
81 */
82struct vfs_ns_cap_data {
83 __le32 magic_etc;
84 struct {
85 __le32 permitted; /* Little endian */
86 __le32 inheritable; /* Little endian */
87 } data[VFS_CAP_U32];
88 __le32 rootid;
89};
90
75#ifndef __KERNEL__91#ifndef __KERNEL__
76 92
77/*93/*

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t