From 173291784749503b0826a9a9f6c0aa98eb904599 Mon Sep 17 00:00:00 2001 From: Tan Xiaojun Date: Wed, 10 Apr 2019 18:34:54 +0800 Subject: [PATCH] kabi: reserve space for scsi related structure hulk inclusion category: feature bugzilla: 13276 CVE: NA ------------------------------- Reserve space for the structure in scsi. Signed-off-by: Tan Xiaojun Reviewed-by: Xie XiuQi Signed-off-by: Yang Yingliang --- drivers/scsi/sd.h | 5 +++++ include/scsi/scsi_cmnd.h | 6 ++++++ include/scsi/scsi_device.h | 13 +++++++++++++ include/scsi/scsi_host.h | 13 +++++++++++++ 4 files changed, 37 insertions(+) diff --git a/drivers/scsi/sd.h b/drivers/scsi/sd.h index a7d4f50b67d4..2a139386b34d 100644 --- a/drivers/scsi/sd.h +++ b/drivers/scsi/sd.h @@ -2,6 +2,8 @@ #ifndef _SCSI_DISK_H #define _SCSI_DISK_H +#include + /* * More than enough for everybody ;) The huge number of majors * is a leftover from 16bit dev_t days, we don't really need that @@ -117,6 +119,9 @@ struct scsi_disk { unsigned urswrz : 1; unsigned security : 1; unsigned ignore_medium_access_errors : 1; + + KABI_RESERVE(1) + KABI_RESERVE(2) }; #define to_scsi_disk(obj) container_of(obj,struct scsi_disk,dev) diff --git a/include/scsi/scsi_cmnd.h b/include/scsi/scsi_cmnd.h index 3b26ea119c8b..4c47157c01cc 100644 --- a/include/scsi/scsi_cmnd.h +++ b/include/scsi/scsi_cmnd.h @@ -2,6 +2,7 @@ #ifndef _SCSI_SCSI_CMND_H #define _SCSI_SCSI_CMND_H +#include #include #include #include @@ -147,6 +148,11 @@ struct scsi_cmnd { int flags; /* Command flags */ unsigned char tag; /* SCSI-II queued command tag */ + + KABI_RESERVE(1) + KABI_RESERVE(2) + KABI_RESERVE(3) + KABI_RESERVE(4) }; /* diff --git a/include/scsi/scsi_device.h b/include/scsi/scsi_device.h index 202f4d6a4342..d0de8e8579eb 100644 --- a/include/scsi/scsi_device.h +++ b/include/scsi/scsi_device.h @@ -2,6 +2,7 @@ #ifndef _SCSI_SCSI_DEVICE_H #define _SCSI_SCSI_DEVICE_H +#include #include #include #include @@ -227,6 +228,13 @@ struct scsi_device { struct mutex state_mutex; enum scsi_device_state sdev_state; struct task_struct *quiesced_by; + + KABI_RESERVE(1) + KABI_RESERVE(2) + KABI_RESERVE(3) + KABI_RESERVE(4) + KABI_RESERVE(5) + KABI_RESERVE(6) unsigned long sdev_data[0]; } __attribute__((aligned(sizeof(unsigned long)))); @@ -311,6 +319,11 @@ struct scsi_target { char scsi_level; enum scsi_target_state state; void *hostdata; /* available to low-level driver */ + + KABI_RESERVE(1) + KABI_RESERVE(2) + KABI_RESERVE(3) + KABI_RESERVE(4) unsigned long starget_data[0]; /* for the transport */ /* starget_data must be the last element!!!! */ } __attribute__((aligned(sizeof(unsigned long)))); diff --git a/include/scsi/scsi_host.h b/include/scsi/scsi_host.h index 5c1df26e1d4f..29268cc34fe6 100644 --- a/include/scsi/scsi_host.h +++ b/include/scsi/scsi_host.h @@ -2,6 +2,7 @@ #ifndef _SCSI_SCSI_HOST_H #define _SCSI_SCSI_HOST_H +#include #include #include #include @@ -486,6 +487,11 @@ struct scsi_host_template { */ unsigned int cmd_size; struct scsi_host_cmd_pool *cmd_pool; + + KABI_RESERVE(1) + KABI_RESERVE(2) + KABI_RESERVE(3) + KABI_RESERVE(4) }; /* @@ -704,6 +710,13 @@ struct Scsi_Host { */ struct device *dma_dev; + KABI_RESERVE(1) + KABI_RESERVE(2) + KABI_RESERVE(3) + KABI_RESERVE(4) + KABI_RESERVE(5) + KABI_RESERVE(6) + /* * We should ensure that this is aligned, both for better performance * and also because some compilers (m68k) don't automatically force -- GitLab