aboutsummaryrefslogtreecommitdiffstats
path: root/include/target/target_core_backend.h
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2012-09-05 17:09:15 +0200
committerNicholas Bellinger <nab@linux-iscsi.org>2012-09-05 17:20:28 -0700
commitd5829eac5f7cfff89c6d1cf11717eee97cf030d0 (patch)
tree9acff1b99c654235b5ad4534735fdaf03a9c5a45 /include/target/target_core_backend.h
parenttarget: simplify code around transport_get_sense_data (diff)
downloadlinux-d5829eac5f7cfff89c6d1cf11717eee97cf030d0.tar.gz
linux-d5829eac5f7cfff89c6d1cf11717eee97cf030d0.zip
target: fix use-after-free with PSCSI sense data
The pointer to the sense buffer is fetched by transport_get_sense_data, but this is called by target_complete_ok_work long after pscsi_req_done has freed the struct that contains it. Pass instead the fabric's sense buffer to transport_complete, and copy the data to it directly in transport_complete. Setting SCF_TRANSPORT_TASK_SENSE also becomes a duty of transport_complete. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Cc: stable@vger.kernel.org Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Diffstat (limited to 'include/target/target_core_backend.h')
-rw-r--r--include/target/target_core_backend.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/include/target/target_core_backend.h b/include/target/target_core_backend.h
index f1405d335a96..941c84bf1065 100644
--- a/include/target/target_core_backend.h
+++ b/include/target/target_core_backend.h
@@ -23,7 +23,9 @@ struct se_subsystem_api {
struct se_device *(*create_virtdevice)(struct se_hba *,
struct se_subsystem_dev *, void *);
void (*free_device)(void *);
- int (*transport_complete)(struct se_cmd *cmd, struct scatterlist *);
+ void (*transport_complete)(struct se_cmd *cmd,
+ struct scatterlist *,
+ unsigned char *);
int (*parse_cdb)(struct se_cmd *cmd);
ssize_t (*check_configfs_dev_params)(struct se_hba *,
d9c28464&follow=1'>string.h: un-fortify memcpy_and_padMartin Wilck1-13/+2 2017-09-11nvme-pci: implement the HMB entry number and size limitationsChristoph Hellwig4-2/+13 2017-09-11nvme-pci: propagate (some) errors from host memory buffer setupChristoph Hellwig1-6/+12 2017-09-11nvme-pci: use appropriate initial chunk size for HMB allocationAkinobu Mita1-1/+1 2017-09-11nvme-pci: fix host memory buffer allocation fallbackChristoph Hellwig1-18/+30 2017-09-11nvme: fix lightnvm checkChristoph Hellwig4-35/+14 2017-09-11block: fix integer overflow in __blkdev_sectors_to_bio_pages()Mikulas Patocka1-2/+2 2017-09-11block: sed-opal: Set MBRDone on S3 resume path if TPER is MBREnabledScott Bauer2-0/+33 2017-09-11block: tolerate tracing of NULL bioGreg Thelen1-3/+2 2017-09-11x86/cpu: Remove unused and undefined __generic_processor_info() declarationDou Liyang2-2/+1 2017-09-11sched/fair: Fix nuisance kernel-doc warningRandy Dunlap1-1/+1 2017-09-10Revert "firmware: add sanity check on shutdown/suspend"Linus Torvalds2-110/+0 2017-09-10m68k: Add braces to __pmd(x) initializer to kill compiler warningGeert Uytterhoeven1-1/+1 2017-09-10x86/mm/64: Fix an incorrect warning with CONFIG_DEBUG_VM=y, !PCIDAndy Lutomirski1-1/+1 2017-09-09sparc64: Handle additional cases of no fault loadsRob Gardner1-0/+51 2017-09-09sparc64: speed up etrap/rtrap on NG2 and later processorsAnthony Yznaga5-6/+45 2017-09-09Bluetooth: Properly check L2CAP config option output buffer lengthBen Seri1-37/+43 2017-09-09NFS: Count the bytes of skipped subrequests in nfs_lock_and_join_requests()Trond Myklebust1-1/+5 2017-09-09NFS: Don't hold the group lock when calling nfs_release_request()Trond Myklebust1-1/+1 2017-09-09libnvdimm, btt: fix format string warningsRandy Dunlap1-2/+2 2017-09-09remove gperf left-overs from build systemLinus Torvalds1-9/+0 2017-09-09NFS: Remove pnfs_generic_transfer_commit_list()Trond Myklebust2-41/+4 2017-09-09NFS: nfs_lock_and_join_requests and nfs_scan_commit_list can deadlockTrond Myklebust2-9/+22 2017-09-09ARM: 8691/1: Export save_stack_trace_tsk()Dustin Brown1-0/+1 2017-09-08bpf: make error reporting in bpf_warn_invalid_xdp_action more clearDaniel Borkmann2-3/+7 2017-09-08Revert "mdio_bus: Remove unneeded gpiod NULL check"Florian Fainelli1-2/+4 2017-09-08bpf: devmap, use cond_resched instead of cpu_relaxJohn Fastabend1-1/+1 2017-09-08bpf: add support for sockmap detach programsJohn Fastabend4-16/+72 2017-09-08net: rcu lock and preempt disable missing around generic xdpJohn Fastabend1-9/+16 2017-09-08bpf: don't select potentially stale ri->map from buggy xdp progsDaniel Borkmann2-2/+35 2017-09-08net: tulip: Constify tulip_tblKees Cook2-2/+2 2017-09-08net: ethernet: ti: netcp_core: no need in netif_napi_delIvan Khoronzhuk1-1/+0 2017-09-08davicom: Display proper debug level up to 6Mathieu Malaterre1-1/+1 2017-09-08net: phy: sfp: rename dt properties to match the bindingBaruch Siach1-2/+2