OSDN Git Service

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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 12 Mar 2012 17:32:41 +0000 (10:32 -0700)
commitec521c173fe9b56343808dfde63e3d75b223da07
tree7745f764c077a9709ee842d93ec82ad3fd50edb8
parentca32b5c30d690d299e814fa98284a00d56e72339
regset: Prevent null pointer reference on readonly regsets

commit c8e252586f8d5de906385d8cf6385fee289a825e upstream.

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>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/binfmt_elf.c
include/linux/regset.h