Commit dd69edd
get_signal: hide_si_addr_tag_bits: fix the usage of uninitialized ksig
ksig->ka and ksig->info are not initialized if get_signal() returns 0 or
if the caller is PF_USER_WORKER.
Check signr != 0 before SA_EXPOSE_TAGBITS and move the "out" label down.
The latter means that ksig->sig won't be initialized if a PF_USER_WORKER
thread gets a fatal signal but this is fine, PF_USER_WORKER's don't use
ksig. And there is nothing new, in this case ksig->ka and ksig-info are
not initialized anyway. Add a comment.
Link: https://lkml.kernel.org/r/20240226165650.GA20829@redhat.com
Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Cc: Christian Brauner <brauner@kernel.org>
Cc: Eric W. Biederman <ebiederm@xmission.com>
Cc: Peter Collingbourne <pcc@google.com>
Cc: Wen Yang <wenyang.linux@foxmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>1 parent 49fd5f5 commit dd69edd
1 file changed
Lines changed: 6 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2881 | 2881 | | |
2882 | 2882 | | |
2883 | 2883 | | |
2884 | | - | |
2885 | | - | |
| 2884 | + | |
| 2885 | + | |
| 2886 | + | |
2886 | 2887 | | |
2887 | 2888 | | |
2888 | 2889 | | |
| |||
2894 | 2895 | | |
2895 | 2896 | | |
2896 | 2897 | | |
2897 | | - | |
| 2898 | + | |
2898 | 2899 | | |
2899 | 2900 | | |
2900 | | - | |
| 2901 | + | |
2901 | 2902 | | |
2902 | | - | |
| 2903 | + | |
2903 | 2904 | | |
2904 | 2905 | | |
2905 | 2906 | | |
| |||
0 commit comments