]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commitdiff
irda: do not leak initialized list.dev to userspace
authorColin Ian King <colin.king@canonical.com>
Thu, 17 Aug 2017 22:14:58 +0000 (23:14 +0100)
committerDavid S. Miller <davem@davemloft.net>
Fri, 18 Aug 2017 23:21:51 +0000 (16:21 -0700)
list.dev has not been initialized and so the copy_to_user is copying
data from the stack back to user space which is a potential
information leak. Fix this ensuring all of list is initialized to
zero.

Detected by CoverityScan, CID#1357894 ("Uninitialized scalar variable")

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/irda/af_irda.c

index 2e6990f8b80b6b4cc1d59665b0154a81790e1788..23fa7c8b09a5861e2acc042775830cc2dac4e0f4 100644 (file)
@@ -2213,7 +2213,7 @@ static int irda_getsockopt(struct socket *sock, int level, int optname,
 {
        struct sock *sk = sock->sk;
        struct irda_sock *self = irda_sk(sk);
-       struct irda_device_list list;
+       struct irda_device_list list = { 0 };
        struct irda_device_info *discoveries;
        struct irda_ias_set *   ias_opt;        /* IAS get/query params */
        struct ias_object *     ias_obj;        /* Object in IAS */