lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 7 Feb 2012 17:11:55 +0300
From:	Dan Carpenter <dan.carpenter@...cle.com>
To:	Jens Axboe <axboe@...nel.dk>
Cc:	linux-kernel@...r.kernel.org
Subject: integer overflows in kernel/relay.c

My static checker is warning about integer overflows in kernel/relay.c

relay_create_buf()
   170  
   171          buf->padding = kmalloc(chan->n_subbufs * sizeof(size_t *), GFP_KERNEL);
                                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
This can only overflow on 32bit systems.

   172          if (!buf->padding)
   173                  goto free_buf;
   174  

relay_open()
   582          chan->version = RELAYFS_CHANNEL_VERSION;
   583          chan->n_subbufs = n_subbufs;
   584          chan->subbuf_size = subbuf_size;
   585          chan->alloc_size = FIX_SIZE(subbuf_size * n_subbufs);
                                            ^^^^^^^^^^^^^^^^^^^^^^^
   586          chan->parent = parent;

These come from the user in blk_trace_setup() and they aren't capped.
I'm not sure what the maximum size to use is.

regards,
dan carpenter
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ