From: Dan Carpenter <error27@gmail.com>
To: "Martin K. Petersen" <martin.petersen@oracle.com>
Cc: "James E.J. Bottomley" <James.Bottomley@suse.de>,
linux-scsi@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: bug report: sd: off by one in sd_read_block_limits()
Date: Tue, 2 Mar 2010 11:21:35 +0300 [thread overview]
Message-ID: <20100302082135.GA6218@bicker> (raw)
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
next reply other threads:[~2010-03-02 8:21 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-03-02 8:21 Dan Carpenter [this message]
2010-03-02 13:12 ` bug report: sd: off by one in sd_read_block_limits() 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20100302082135.GA6218@bicker \
--to=error27@gmail.com \
--cc=James.Bottomley@suse.de \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox