From: Greg Kroah-Hartman Date: Thu, 16 Nov 2017 16:50:04 +0000 (+0100) Subject: 3.18-stable patches X-Git-Tag: v3.18.82~10 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f6214580bd5b4901d71dcbc5316dcb6db47db67c;p=thirdparty%2Fkernel%2Fstable-queue.git 3.18-stable patches added patches: security-keys-add-config_keys_compat-to-kconfig.patch target-iscsi-fix-iscsi-task-reassignment-handling.patch --- diff --git a/queue-3.18/security-keys-add-config_keys_compat-to-kconfig.patch b/queue-3.18/security-keys-add-config_keys_compat-to-kconfig.patch new file mode 100644 index 00000000000..84f894ce145 --- /dev/null +++ b/queue-3.18/security-keys-add-config_keys_compat-to-kconfig.patch @@ -0,0 +1,102 @@ +From 47b2c3fff4932e6fc17ce13d51a43c6969714e20 Mon Sep 17 00:00:00 2001 +From: Bilal Amarni +Date: Thu, 8 Jun 2017 14:47:26 +0100 +Subject: security/keys: add CONFIG_KEYS_COMPAT to Kconfig + +From: Bilal Amarni + +commit 47b2c3fff4932e6fc17ce13d51a43c6969714e20 upstream. + +CONFIG_KEYS_COMPAT is defined in arch-specific Kconfigs and is missing for +several 64-bit architectures : mips, parisc, tile. + +At the moment and for those architectures, calling in 32-bit userspace the +keyctl syscall would return an ENOSYS error. + +This patch moves the CONFIG_KEYS_COMPAT option to security/keys/Kconfig, to +make sure the compatibility wrapper is registered by default for any 64-bit +architecture as long as it is configured with CONFIG_COMPAT. + +[DH: Modified to remove arm64 compat enablement also as requested by Eric + Biggers] + +Signed-off-by: Bilal Amarni +Signed-off-by: David Howells +Reviewed-by: Arnd Bergmann +cc: Eric Biggers +Signed-off-by: James Morris +Cc: James Cowgill +Signed-off-by: Greg Kroah-Hartman + +--- + arch/powerpc/Kconfig | 5 ----- + arch/s390/Kconfig | 3 --- + arch/sparc/Kconfig | 3 --- + arch/x86/Kconfig | 4 ---- + security/keys/Kconfig | 4 ++++ + 5 files changed, 4 insertions(+), 15 deletions(-) + +--- a/arch/powerpc/Kconfig ++++ b/arch/powerpc/Kconfig +@@ -1070,11 +1070,6 @@ source "arch/powerpc/Kconfig.debug" + + source "security/Kconfig" + +-config KEYS_COMPAT +- bool +- depends on COMPAT && KEYS +- default y +- + source "crypto/Kconfig" + + config PPC_LIB_RHEAP +--- a/arch/s390/Kconfig ++++ b/arch/s390/Kconfig +@@ -332,9 +332,6 @@ config COMPAT + config SYSVIPC_COMPAT + def_bool y if COMPAT && SYSVIPC + +-config KEYS_COMPAT +- def_bool y if COMPAT && KEYS +- + config SMP + def_bool y + prompt "Symmetric multi-processing support" +--- a/arch/sparc/Kconfig ++++ b/arch/sparc/Kconfig +@@ -542,9 +542,6 @@ config SYSVIPC_COMPAT + depends on COMPAT && SYSVIPC + default y + +-config KEYS_COMPAT +- def_bool y if COMPAT && KEYS +- + endmenu + + source "net/Kconfig" +--- a/arch/x86/Kconfig ++++ b/arch/x86/Kconfig +@@ -2471,10 +2471,6 @@ config COMPAT_FOR_U64_ALIGNMENT + config SYSVIPC_COMPAT + def_bool y + depends on SYSVIPC +- +-config KEYS_COMPAT +- def_bool y +- depends on KEYS + endif + + endmenu +--- a/security/keys/Kconfig ++++ b/security/keys/Kconfig +@@ -20,6 +20,10 @@ config KEYS + + If you are unsure as to whether this is required, answer N. + ++config KEYS_COMPAT ++ def_bool y ++ depends on COMPAT && KEYS ++ + config PERSISTENT_KEYRINGS + bool "Enable register of persistent per-UID keyrings" + depends on KEYS diff --git a/queue-3.18/series b/queue-3.18/series index e92797a5a13..32e31d4ebfd 100644 --- a/queue-3.18/series +++ b/queue-3.18/series @@ -16,3 +16,5 @@ sctp-reset-owner-sk-for-data-chunks-on-out-queues-when-migrating-a-sock.patch ipv6-flowlabel-do-not-leave-opt-tot_len-with-garbage.patch ipip-only-increase-err_count-for-some-certain-type-icmp-in-ipip_err.patch ip6_gre-only-increase-err_count-for-some-certain-type-icmpv6-in-ip6gre_err.patch +security-keys-add-config_keys_compat-to-kconfig.patch +target-iscsi-fix-iscsi-task-reassignment-handling.patch diff --git a/queue-3.18/target-iscsi-fix-iscsi-task-reassignment-handling.patch b/queue-3.18/target-iscsi-fix-iscsi-task-reassignment-handling.patch new file mode 100644 index 00000000000..67aab444c5e --- /dev/null +++ b/queue-3.18/target-iscsi-fix-iscsi-task-reassignment-handling.patch @@ -0,0 +1,82 @@ +From 59b6986dbfcdab96a971f9663221849de79a7556 Mon Sep 17 00:00:00 2001 +From: Bart Van Assche +Date: Thu, 5 Jan 2017 12:39:57 +0100 +Subject: target/iscsi: Fix iSCSI task reassignment handling + +From: Bart Van Assche + +commit 59b6986dbfcdab96a971f9663221849de79a7556 upstream. + +Allocate a task management request structure for all task management +requests, including task reassignment. This change avoids that the +se_tmr->response assignment dereferences an uninitialized se_tmr +pointer. + +Reported-by: Moshe David +Signed-off-by: Bart Van Assche +Reviewed-by: Hannes Reinecke +Reviewed-by: Christoph Hellwig +Cc: Moshe David +Signed-off-by: Nicholas Bellinger +Signed-off-by: Greg Kroah-Hartman + + +--- + drivers/target/iscsi/iscsi_target.c | 19 +++++++------------ + include/target/target_core_base.h | 1 + + 2 files changed, 8 insertions(+), 12 deletions(-) + +--- a/drivers/target/iscsi/iscsi_target.c ++++ b/drivers/target/iscsi/iscsi_target.c +@@ -1749,7 +1749,7 @@ iscsit_handle_task_mgt_cmd(struct iscsi_ + struct iscsi_tm *hdr; + int out_of_order_cmdsn = 0, ret; + bool sess_ref = false; +- u8 function; ++ u8 function, tcm_function = TMR_UNKNOWN; + + hdr = (struct iscsi_tm *) buf; + hdr->flags &= ~ISCSI_FLAG_CMD_FINAL; +@@ -1795,10 +1795,6 @@ iscsit_handle_task_mgt_cmd(struct iscsi_ + * LIO-Target $FABRIC_MOD + */ + if (function != ISCSI_TM_FUNC_TASK_REASSIGN) { +- +- u8 tcm_function; +- int ret; +- + transport_init_se_cmd(&cmd->se_cmd, + &lio_target_fabric_configfs->tf_ops, + conn->sess->se_sess, 0, DMA_NONE, +@@ -1835,15 +1831,14 @@ iscsit_handle_task_mgt_cmd(struct iscsi_ + return iscsit_add_reject_cmd(cmd, + ISCSI_REASON_BOOKMARK_NO_RESOURCES, buf); + } +- +- ret = core_tmr_alloc_req(&cmd->se_cmd, cmd->tmr_req, +- tcm_function, GFP_KERNEL); +- if (ret < 0) +- return iscsit_add_reject_cmd(cmd, ++ } ++ ret = core_tmr_alloc_req(&cmd->se_cmd, cmd->tmr_req, tcm_function, ++ GFP_KERNEL); ++ if (ret < 0) ++ return iscsit_add_reject_cmd(cmd, + ISCSI_REASON_BOOKMARK_NO_RESOURCES, buf); + +- cmd->tmr_req->se_tmr_req = cmd->se_cmd.se_tmr_req; +- } ++ cmd->tmr_req->se_tmr_req = cmd->se_cmd.se_tmr_req; + + cmd->iscsi_opcode = ISCSI_OP_SCSI_TMFUNC; + cmd->i_state = ISTATE_SEND_TASKMGTRSP; +--- a/include/target/target_core_base.h ++++ b/include/target/target_core_base.h +@@ -231,6 +231,7 @@ enum tcm_tmreq_table { + TMR_LUN_RESET = 5, + TMR_TARGET_WARM_RESET = 6, + TMR_TARGET_COLD_RESET = 7, ++ TMR_UNKNOWN = 0xff, + }; + + /* fabric independent task management response values */