summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorJonas Rabenstein <jonas.rabenstein@studium.uni-erlangen.de>2019-05-21 22:46:45 +0200
committerJens Axboe <axboe@kernel.dk>2019-06-29 10:33:57 -0600
commita9b25b4cf2b76d320afc999f881ccb805fecdd84 (patch)
tree2137106246ef1e5ae9afdc4677a93c1df4ca22fa /include
parentc9888443413e4e06013e482fc484dbb9c559c145 (diff)
block: sed-opal: ioctl for writing to shadow mbr
Allow modification of the shadow mbr. If the shadow mbr is not marked as done, this data will be presented read only as the device content. Only after marking the shadow mbr as done and unlocking a locking range the actual content is accessible. Co-authored-by: David Kozub <zub@linux.fjfi.cvut.cz> Signed-off-by: Jonas Rabenstein <jonas.rabenstein@studium.uni-erlangen.de> Signed-off-by: David Kozub <zub@linux.fjfi.cvut.cz> Reviewed-by: Scott Bauer <sbauer@plzdonthack.me> Reviewed-by: Jon Derrick <jonathan.derrick@intel.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'include')
-rw-r--r--include/linux/sed-opal.h1
-rw-r--r--include/uapi/linux/sed-opal.h8
2 files changed, 9 insertions, 0 deletions
diff --git a/include/linux/sed-opal.h b/include/linux/sed-opal.h
index f834e8a1495f..53c28d750a45 100644
--- a/include/linux/sed-opal.h
+++ b/include/linux/sed-opal.h
@@ -41,6 +41,7 @@ static inline bool is_sed_ioctl(unsigned int cmd)
case IOC_OPAL_SECURE_ERASE_LR:
case IOC_OPAL_PSID_REVERT_TPR:
case IOC_OPAL_MBR_DONE:
+ case IOC_OPAL_WRITE_SHADOW_MBR:
return true;
}
return false;
diff --git a/include/uapi/linux/sed-opal.h b/include/uapi/linux/sed-opal.h
index 5681f55d334b..c6d035fa1b6c 100644
--- a/include/uapi/linux/sed-opal.h
+++ b/include/uapi/linux/sed-opal.h
@@ -106,6 +106,13 @@ struct opal_mbr_done {
__u8 __align[7];
};
+struct opal_shadow_mbr {
+ struct opal_key key;
+ const __u64 data;
+ __u64 offset;
+ __u64 size;
+};
+
#define IOC_OPAL_SAVE _IOW('p', 220, struct opal_lock_unlock)
#define IOC_OPAL_LOCK_UNLOCK _IOW('p', 221, struct opal_lock_unlock)
#define IOC_OPAL_TAKE_OWNERSHIP _IOW('p', 222, struct opal_key)
@@ -120,5 +127,6 @@ struct opal_mbr_done {
#define IOC_OPAL_SECURE_ERASE_LR _IOW('p', 231, struct opal_session_info)
#define IOC_OPAL_PSID_REVERT_TPR _IOW('p', 232, struct opal_key)
#define IOC_OPAL_MBR_DONE _IOW('p', 233, struct opal_mbr_done)
+#define IOC_OPAL_WRITE_SHADOW_MBR _IOW('p', 234, struct opal_shadow_mbr)
#endif /* _UAPI_SED_OPAL_H */