From: Paolo Bonzini <pbonzini@redhat.com>
To: Hannes Reinecke <hare@suse.de>
Cc: "Nicholas A. Bellinger" <nab@linux-iscsi.org>,
Nic Bellinger <nab@daterainc.com>,
target-devel@vger.kernel.org, linux-scsi@vger.kernel.org
Subject: Re: [PATCH 2/2] target_core_spc: bounds check for spc_emulate_inquiry()
Date: Fri, 20 Dec 2013 23:53:00 +0100 [thread overview]
Message-ID: <52B4CA4C.5090601@redhat.com> (raw)
In-Reply-To: <52B3E7FD.9030504@suse.de>
Il 20/12/2013 07:47, Hannes Reinecke ha scritto:
>> >
>> > How about changing the local buffer to heap memory instead, and bumping
>> > SE_INQUIRY_BUF to 1024 bytes..?
>> >
> Ok. But then we should have a quick check at the start
>
> if (cmd->data_length > SE_INQUIRY_BUF)
> len = cmd->data_length
> else
> len = SE_INQUIRY_BUF
>
> to catch oversized requests.
Why do you need it? If inquiry data is always <1K, when
cmd->data_length is large you can just need to write zeroes to the
buffer after the first SE_INQUIRY_BUF bytes.
Paolo
next prev parent reply other threads:[~2013-12-20 22:53 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-12-19 13:36 [PATCH 0/2] Handle data underflow Hannes Reinecke
2013-12-19 13:36 ` [PATCH 1/2] target_core_alua: check for buffer overflow Hannes Reinecke
2013-12-19 21:43 ` Nicholas A. Bellinger
2013-12-19 13:36 ` [PATCH 2/2] target_core_spc: bounds check for spc_emulate_inquiry() Hannes Reinecke
2013-12-19 22:11 ` Nicholas A. Bellinger
2013-12-20 6:47 ` Hannes Reinecke
2013-12-20 22:53 ` Paolo Bonzini [this message]
2013-12-22 2:53 ` Nicholas A. Bellinger
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=52B4CA4C.5090601@redhat.com \
--to=pbonzini@redhat.com \
--cc=hare@suse.de \
--cc=linux-scsi@vger.kernel.org \
--cc=nab@daterainc.com \
--cc=nab@linux-iscsi.org \
--cc=target-devel@vger.kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.