blockd: fix length of timeout int passed to ioctl
authorDaniel Golle <daniel@makrotopia.org>
Fri, 23 Jul 2021 23:14:57 +0000 (00:14 +0100)
committerDaniel Golle <daniel@makrotopia.org>
Fri, 23 Jul 2021 23:27:06 +0000 (00:27 +0100)
AUTOFS_IOC_SETTIMEOUT expects a pointer to an 'unsigned long' which
will result in out-of-bounds access when passing a pointer to an 'int'.
Change type of timeout to 'unsigned long'.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
blockd.c

index edca896b14886ee5fceb38ea21edbac35e8454a0..bf15f100b9035a53c973d2760c546c1556154ece 100644 (file)
--- a/blockd.c
+++ b/blockd.c
@@ -574,7 +574,7 @@ struct uloop_timeout autofs_expire_timer = {
 
 static int autofs_mount(void)
 {
-       int autofs_timeout = AUTOFS_TIMEOUT;
+       unsigned long autofs_timeout = AUTOFS_TIMEOUT;
        int kproto_version;
        int pipefd[2];
        char source[64];