kcov: support compat processes
authorDmitry Vyukov <dvyukov@google.com>
Fri, 8 Sep 2017 23:17:35 +0000 (16:17 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sat, 9 Sep 2017 01:26:51 +0000 (18:26 -0700)
Support compat processes in KCOV by providing compat_ioctl callback.
Compat mode uses the same ioctl callback: we have 2 commands that do not
use the argument and 1 that already checks that the arg does not overflow
INT_MAX.  This allows to use KCOV-guided fuzzing in compat processes.

Link: http://lkml.kernel.org/r/20170823100553.55812-1-dvyukov@google.com
Signed-off-by: Dmitry Vyukov <dvyukov@google.com>
Cc: <syzkaller@googlegroups.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
kernel/kcov.c

index cd771993f96f4a7ff23592f1abaea22c71444fda..3f693a0f6f3edc9e563b681ad47bf168e73d0dca 100644 (file)
@@ -270,6 +270,7 @@ static long kcov_ioctl(struct file *filep, unsigned int cmd, unsigned long arg)
 static const struct file_operations kcov_fops = {
        .open           = kcov_open,
        .unlocked_ioctl = kcov_ioctl,
+       .compat_ioctl   = kcov_ioctl,
        .mmap           = kcov_mmap,
        .release        = kcov_close,
 };