Commit 25e5cb7
nvme-tcp: fix possible crash in write_zeroes processing
We cannot look at blk_rq_payload_bytes without first checking
that the request has a mappable physical segments first (e.g.
blk_rq_nr_phys_segments(rq) != 0) and only then to take the
request payload bytes. This caused us to send a wrong sgl to
the target or even dereference a non-existing buffer in case
we actually got to the data send sequence (if it was in-capsule).
Reported-by: Tony Asleson <tasleson@redhat.com>
Suggested-by: Chaitanya Kulkarni <Chaitanya.Kulkarni@wdc.com>
Signed-off-by: Sagi Grimberg <sagi@grimberg.me>
Signed-off-by: Keith Busch <kbusch@kernel.org>
Signed-off-by: Christoph Hellwig <hch@lst.de>1 parent d038dd8 commit 25e5cb7
1 file changed
+7
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
174 | 174 | | |
175 | 175 | | |
176 | 176 | | |
177 | | - | |
178 | 177 | | |
179 | 178 | | |
180 | 179 | | |
181 | 180 | | |
182 | 181 | | |
183 | | - | |
184 | 182 | | |
185 | | - | |
186 | | - | |
| 183 | + | |
| 184 | + | |
187 | 185 | | |
188 | 186 | | |
189 | 187 | | |
| |||
2164 | 2162 | | |
2165 | 2163 | | |
2166 | 2164 | | |
2167 | | - | |
| 2165 | + | |
| 2166 | + | |
| 2167 | + | |
2168 | 2168 | | |
2169 | 2169 | | |
2170 | 2170 | | |
| |||
2191 | 2191 | | |
2192 | 2192 | | |
2193 | 2193 | | |
2194 | | - | |
| 2194 | + | |
| 2195 | + | |
2195 | 2196 | | |
2196 | 2197 | | |
2197 | 2198 | | |
| |||
0 commit comments