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]
Message-ID: <20120402135455.GA15588@elgon.mountain>
Date:	Mon, 2 Apr 2012 16:54:56 +0300
From:	Dan Carpenter <dan.carpenter@...cle.com>
To:	Divyesh Shah <dpshah@...gle.com>
Cc:	Jens Axboe <axboe@...nel.dk>, linux-kernel@...r.kernel.org
Subject: question about blkio_get_stat()

Hi Divyesh,

Smatch complains that we go outside the array in blkio_get_stat().

block/blk-cgroup.c
   731          if (type == BLKIO_STAT_DEQUEUE)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^
BLKIO_STAT_DEQUEUE is 9.

   732                  return blkio_fill_stat(key_str, MAX_KEY_LEN - 1,
   733                                          blkg->stats.dequeue, cb, dev);
   734  #endif
   735  
   736          for (sub_type = BLKIO_STAT_READ; sub_type < BLKIO_STAT_TOTAL;
   737                          sub_type++) {
   738                  blkio_get_key_name(sub_type, dev, key_str, MAX_KEY_LEN, false);
   739                  cb->fill(cb, key_str, blkg->stats.stat_arr[type][sub_type]);
                                                    ^^^^^^^^^^^^^^^^^^^^
This array only has 4 elements and if "type" is 9 we're past the end of
array.

   740          }

It's odd that Smatch only started complaining about this now, but this
code has been there for years.  I'm puzzled by what changed.  Sorry if
there is something obvious I have missed.

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