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" <ebiederm@xmission.com>
This commit is contained in:
@@ -21,8 +21,9 @@ extern void die_if_kernel(char *, struct pt_regs *, long);
|
||||
|
||||
int send_fault_sig(struct pt_regs *regs)
|
||||
{
|
||||
siginfo_t siginfo = { 0, 0, 0, };
|
||||
siginfo_t siginfo;
|
||||
|
||||
clear_siginfo(&siginfo);
|
||||
siginfo.si_signo = current->thread.signo;
|
||||
siginfo.si_code = current->thread.code;
|
||||
siginfo.si_addr = (void *)current->thread.faddr;
|
||||
|
Reference in New Issue
Block a user