From bac9f154acd175afdf702cb7d7f5de1254b4b119 Mon Sep 17 00:00:00 2001 From: Heiko Carstens Date: Wed, 26 May 2010 23:26:20 +0200 Subject: [PATCH] [S390] kprobes: forbid probing of stnsm/stosm/epsw The probed instructions will be executed in a single stepped and irq disabled context. Therefore the results of stnsm, stosm and epsw would be wrong if probed. So let's just disallow probing of these functions. If really needed a fixup could be written for each of them, but I doubt it's worth it. Signed-off-by: Heiko Carstens Signed-off-by: Martin Schwidefsky --- arch/s390/kernel/kprobes.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/s390/kernel/kprobes.c b/arch/s390/kernel/kprobes.c index 3d34eef5a2c3..2a3d2bf6f083 100644 --- a/arch/s390/kernel/kprobes.c +++ b/arch/s390/kernel/kprobes.c @@ -63,6 +63,8 @@ int __kprobes is_prohibited_opcode(kprobe_opcode_t *instruction) case 0x0b: /* bsm */ case 0x83: /* diag */ case 0x44: /* ex */ + case 0xac: /* stnsm */ + case 0xad: /* stosm */ return -EINVAL; } switch (*(__u16 *) instruction) { @@ -72,6 +74,7 @@ int __kprobes is_prohibited_opcode(kprobe_opcode_t *instruction) case 0xb258: /* bsg */ case 0xb218: /* pc */ case 0xb228: /* pt */ + case 0xb98d: /* epsw */ return -EINVAL; } return 0; -- 2.39.2