Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

HWPOISON/signalfd: add support for addr_lsb

Similar change as to signal delivery: copy out the si_addr_lsb field
to user space in signalfd

Signed-off-by: Hidetoshi Seto <seto.hidetoshi@jp.fujitsu.com>
Signed-off-by: Andi Kleen <ak@linux.intel.com>

authored by

Hidetoshi Seto and committed by
Andi Kleen
b8aeec34 6b0cd00b

+12 -1
+10
fs/signalfd.c
··· 99 99 #ifdef __ARCH_SI_TRAPNO 100 100 err |= __put_user(kinfo->si_trapno, &uinfo->ssi_trapno); 101 101 #endif 102 + #ifdef BUS_MCEERR_AO 103 + /* 104 + * Other callers might not initialize the si_lsb field, 105 + * so check explicitly for the right codes here. 106 + */ 107 + if (kinfo->si_code == BUS_MCEERR_AR || 108 + kinfo->si_code == BUS_MCEERR_AO) 109 + err |= __put_user((short) kinfo->si_addr_lsb, 110 + &uinfo->ssi_addr_lsb); 111 + #endif 102 112 break; 103 113 case __SI_CHLD: 104 114 err |= __put_user(kinfo->si_pid, &uinfo->ssi_pid);
+2 -1
include/linux/signalfd.h
··· 33 33 __u64 ssi_utime; 34 34 __u64 ssi_stime; 35 35 __u64 ssi_addr; 36 + __u16 ssi_addr_lsb; 36 37 37 38 /* 38 39 * Pad strcture to 128 bytes. Remember to update the ··· 44 43 * comes out of a read(2) and we really don't want to have 45 44 * a compat on read(2). 46 45 */ 47 - __u8 __pad[48]; 46 + __u8 __pad[46]; 48 47 }; 49 48 50 49