mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 03:27:44 -04:00
signal: Don't use structure initializers for struct siginfo
The siginfo structure has all manners of holes with the result that a structure initializer is not guaranteed to initialize all of the bits. As we have to copy the structure to userspace don't even try to use a structure initializer. Instead use clear_siginfo followed by initializing selected fields. This gives a guarantee that uninitialized kernel memory is not copied to userspace. Signed-off-by: "Eric W. Biederman" <[email protected]>
This commit is contained in:
parent
66e0f26315
commit
5f74972ce6
9 changed files with 89 additions and 60 deletions
|
|
@ -65,12 +65,14 @@ unhandled_exception(const char *str, struct pt_regs *regs, siginfo_t *info)
|
|||
#define DO_ERROR_INFO(signr, str, name, sicode) \
|
||||
int name(unsigned long address, struct pt_regs *regs) \
|
||||
{ \
|
||||
siginfo_t info = { \
|
||||
.si_signo = signr, \
|
||||
.si_errno = 0, \
|
||||
.si_code = sicode, \
|
||||
.si_addr = (void __user *)address, \
|
||||
}; \
|
||||
siginfo_t info; \
|
||||
\
|
||||
clear_siginfo(&info); \
|
||||
info.si_signo = signr; \
|
||||
info.si_errno = 0; \
|
||||
info.si_code = sicode; \
|
||||
info.si_addr = (void __user *)address; \
|
||||
\
|
||||
return unhandled_exception(str, regs, &info);\
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue