public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
* bug report: sd:  off by one in sd_read_block_limits()
@ 2010-03-02  8:21 Dan Carpenter
  2010-03-02 13:12 ` Martin K. Petersen
  0 siblings, 1 reply; 8+ messages in thread
From: Dan Carpenter @ 2010-03-02  8:21 UTC (permalink / raw)
  To: Martin K. Petersen; +Cc: James E.J. Bottomley, linux-scsi, kernel-janitors

drivers/scsi/sd.c +1986 sd_read_block_limits(39) warn: buffer overflow 'buffer' 32 <= 32
  1951          const int vpd_len = 32;
  1952          unsigned char *buffer = kmalloc(vpd_len, GFP_KERNEL);

	[snip]

  1984                  if (buffer[32] & 0x80)

	This is past the end of the array.

  1985                          q->limits.discard_alignment =
  1986                                  get_unaligned_be32(&buffer[32]) & ~(1 << 31);
  1987          }

regards,
dan carpenter

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2010-03-03  7:08 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-02  8:21 bug report: sd: off by one in sd_read_block_limits() Dan Carpenter
2010-03-02 13:12 ` Martin K. Petersen
2010-03-02 13:21   ` Martin K. Petersen
2010-03-02 13:31     ` Matthew Wilcox
2010-03-02 13:36     ` Martin K. Petersen
2010-03-02 14:56       ` Matthew Wilcox
2010-03-03  7:08       ` James Bottomley
2010-03-02 13:44     ` Martin K. Petersen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox