]> git.baikalelectronics.ru Git - kernel.git/commitdiff
firewire: cdev: fix potential leak of kernel stack due to uninitialized value
authorTakashi Sakamoto <o-takashi@sakamocchi.jp>
Thu, 12 May 2022 11:20:37 +0000 (20:20 +0900)
committerTakashi Iwai <tiwai@suse.de>
Fri, 17 Jun 2022 08:43:11 +0000 (10:43 +0200)
Recent change brings potential leak of value on kernel stack to userspace
due to uninitialized value.

This commit fixes the bug.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Fixes: 64645b8e74e6 ("firewire: add kernel API to access CYCLE_TIME register")
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Link: https://lore.kernel.org/r/20220512112037.103142-1-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Iwai <tiwai@suse.de>
drivers/firewire/core-cdev.c

index c9fe5903725a5f841d5947747badbe616b28e762..9c89f7d53e99db123b4f553e49ab35aa3bfa18fe 100644 (file)
@@ -1211,7 +1211,7 @@ static int ioctl_get_cycle_timer2(struct client *client, union ioctl_arg *arg)
        struct fw_cdev_get_cycle_timer2 *a = &arg->get_cycle_timer2;
        struct fw_card *card = client->device->card;
        struct timespec64 ts = {0, 0};
-       u32 cycle_time;
+       u32 cycle_time = 0;
        int ret = 0;
 
        local_irq_disable();