]> git.baikalelectronics.ru Git - kernel.git/commit
regset: Prevent null pointer reference on readonly regsets
authorH. Peter Anvin <hpa@zytor.com>
Fri, 2 Mar 2012 18:43:48 +0000 (10:43 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 2 Mar 2012 19:38:15 +0000 (11:38 -0800)
commit6cb5bb6f117299e4178e4dfed0891c81a402bf25
tree11bf3ac4f0d0b3961fcf1c98ee5cd1824ebd5614
parent1c123070ba37a61366afeeb8e0ec23dbe3dc39d3
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>
fs/binfmt_elf.c
include/linux/regset.h