Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

virt: vbox: Log unknown ioctl requests as error

Every now and then upstream adds new ioctls without notifying us,
log unknown ioctl requests as an error to catch these.

Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20200709120858.63928-8-hdegoede@redhat.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Hans de Goede and committed by
Greg Kroah-Hartman
5bc117a2 316b0035

+3 -1
+1 -1
drivers/virt/vboxguest/vboxguest_core.c
··· 1739 1739 return vbg_ioctl_log(data); 1740 1740 } 1741 1741 1742 - vbg_debug("VGDrvCommonIoCtl: Unknown req %#08x\n", req); 1742 + vbg_err_ratelimited("Userspace made an unknown ioctl req %#08x\n", req); 1743 1743 return -ENOTTY; 1744 1744 } 1745 1745
+1
drivers/virt/vboxguest/vboxguest_utils.c
··· 59 59 VBG_LOG(vbg_info, pr_info); 60 60 VBG_LOG(vbg_warn, pr_warn); 61 61 VBG_LOG(vbg_err, pr_err); 62 + VBG_LOG(vbg_err_ratelimited, pr_err_ratelimited); 62 63 #if defined(DEBUG) && !defined(CONFIG_DYNAMIC_DEBUG) 63 64 VBG_LOG(vbg_debug, pr_debug); 64 65 #endif
+1
include/linux/vbox_utils.h
··· 16 16 __printf(1, 2) void vbg_info(const char *fmt, ...); 17 17 __printf(1, 2) void vbg_warn(const char *fmt, ...); 18 18 __printf(1, 2) void vbg_err(const char *fmt, ...); 19 + __printf(1, 2) void vbg_err_ratelimited(const char *fmt, ...); 19 20 20 21 /* Only use backdoor logging for non-dynamic debug builds */ 21 22 #if defined(DEBUG) && !defined(CONFIG_DYNAMIC_DEBUG)