summaryrefslogtreecommitdiffstats
path: root/include/linux/bio.h
diff options
context:
space:
mode:
authorKent Overstreet2012-10-12 22:18:27 +0200
committerKent Overstreet2013-03-23 22:15:26 +0100
commit6fda981cafbf908acd11e1e636fec50e99d56a47 (patch)
treebe6c8b95551a6081745ab937241dc4a3ef348676 /include/linux/bio.h
parentblock: Avoid deadlocks with bio allocation by stacking drivers (diff)
downloadkernel-qcow2-linux-6fda981cafbf908acd11e1e636fec50e99d56a47.tar.gz
kernel-qcow2-linux-6fda981cafbf908acd11e1e636fec50e99d56a47.tar.xz
kernel-qcow2-linux-6fda981cafbf908acd11e1e636fec50e99d56a47.zip
block: Fix a buffer overrun in bio_integrity_split()
bio_integrity_split() seemed to be confusing pointers and arrays - bip_vec in bio_integrity_payload was an array appended to the end of the payload, so the bio_vecs in struct bio_pair should have come after the bio_integrity_payload they're for. Fix it by making bip_vec a pointer to the inline vecs - a later patch is going to make more use of this pointer. Signed-off-by: Kent Overstreet <koverstreet@google.com> CC: Jens Axboe <axboe@kernel.dk> CC: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'include/linux/bio.h')
-rw-r--r--include/linux/bio.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/include/linux/bio.h b/include/linux/bio.h
index b31036ff779f..81004fdcc277 100644
--- a/include/linux/bio.h
+++ b/include/linux/bio.h
@@ -182,7 +182,9 @@ struct bio_integrity_payload {
unsigned short bip_idx; /* current bip_vec index */
struct work_struct bip_work; /* I/O completion */
- struct bio_vec bip_vec[0]; /* embedded bvec array */
+
+ struct bio_vec *bip_vec;
+ struct bio_vec bip_inline_vecs[0];/* embedded bvec array */
};
#endif /* CONFIG_BLK_DEV_INTEGRITY */