dynup/kpatch — pull request #266 by jstancek (2014-06-26 12:52:01+00:00)
Title: kmod/core: be more verbose when activness safety check fails

Print some basic info and stack trace for task when activness
safety check fails.

Example (hrtimer2.patch):
```diff
diff --git a/kernel/hrtimer.c b/kernel/hrtimer.c
index e268e26..f62bb4d 100644
--- a/kernel/hrtimer.c
+++ b/kernel/hrtimer.c
@@ -1611,6 +1611,9 @@ long hrtimer_nanosleep(struct timespec *rqtp, struct timespec __user *rmtp,
if (rt_task(current))
slack = 0;

+	if (jiffies==0)
+	printk("what?\n");
+
hrtimer_init_on_stack(&t.timer, clockid, mode);
hrtimer_set_expires_range_ns(&t.timer, timespec_to_ktime(*rqtp), slack);
if (do_nanosleep(&t, mode))
```

```
# insmod kpatch-hrtimer2.ko
insmod: ERROR: could not insert module kpatch-hrtimer2.ko: Device or resource busy

# dmesg -c
[ 9068.120800] kpatch: module verification failed: signature and/or required key missing - tainting kernel
[ 9078.996730] kpatch: activeness safety check failed for hrtimer_nanosleep
[ 9079.003419] PID: 793 Comm: irqbalance
[ 9079.007076] [] schedule+0x29/0x70
[ 9079.012029] [] do_nanosleep+0xc5/0x130
[ 9079.017413] [] hrtimer_nanosleep+0xad/0x170
[ 9079.023230] [] ? hrtimer_get_res+0x50/0x50
[ 9079.028961] [] ? do_nanosleep+0x71/0x130
[ 9079.034517] [] SyS_nanosleep+0x7e/0x90
[ 9079.039899] [] system_call_fastpath+0x16/0x1b

# kill 793

# insmod kpatch-hrtimer2.ko
insmod: ERROR: could not insert module kpatch-hrtimer2.ko: Device or resource busy

# dmesg -c
[ 9771.359986] kpatch: activeness safety check failed for hrtimer_nanosleep
[ 9771.366674] PID: 799 Comm: atd
[ 9771.369723] [] schedule+0x29/0x70
[ 9771.374676] [] do_nanosleep+0xc5/0x130
[ 9771.380060] [] hrtimer_nanosleep+0xad/0x170
[ 9771.385878] [] ? hrtimer_get_res+0x50/0x50
[ 9771.391607] [] ? do_nanosleep+0x71/0x130
[ 9771.397164] [] SyS_nanosleep+0x7e/0x90
[ 9771.402549] [] system_call_fastpath+0x16/0x1b

```