mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-25 08:02:56 +00:00
regset: Prevent null pointer reference on readonly regsets
The regset common infrastructure assumed that regsets would always have .get and .set methods, but not necessarily .active methods. Unfortunately people have since written regsets without .set methods. Rather than putting in stub functions everywhere, handle regsets with null .get or .set methods explicitly. Signed-off-by: H. Peter Anvin <hpa@zytor.com> Reviewed-by: Oleg Nesterov <oleg@redhat.com> Acked-by: Roland McGrath <roland@hack.frob.com> Cc: <stable@vger.kernel.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
1f033c1a6e
commit
c8e252586f
2 changed files with 7 additions and 1 deletions
|
@ -1421,7 +1421,7 @@ static int fill_thread_core_info(struct elf_thread_core_info *t,
|
|||
for (i = 1; i < view->n; ++i) {
|
||||
const struct user_regset *regset = &view->regsets[i];
|
||||
do_thread_regset_writeback(t->task, regset);
|
||||
if (regset->core_note_type &&
|
||||
if (regset->core_note_type && regset->get &&
|
||||
(!regset->active || regset->active(t->task, regset))) {
|
||||
int ret;
|
||||
size_t size = regset->n * regset->size;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue