From f1494ed1d318542baa9480cfd44d040a92635129 Mon Sep 17 00:00:00 2001 From: Heiko Carstens Date: Mon, 9 Jun 2008 15:49:57 -0700 Subject: iucv: fix section mismatch warning. WARNING: net/iucv/built-in.o(.exit.text+0x9c): Section mismatch in reference from the function iucv_exit() to the variable .cpuinit.data:iucv_cpu_notifier This warning is caused by a reference from unregister_hotcpu_notifier() from an exit function to a cpuinitdata annotated data structurre. This is a false positive warning since for the non CPU_HOTPLUG case unregister_hotcpu_notifier() is a nop. Use __refdata instead of __cpuinitdata to get rid of the warning. Signed-off-by: Heiko Carstens Signed-off-by: Ursula Braun Signed-off-by: David S. Miller --- net/iucv/iucv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'net/iucv') diff --git a/net/iucv/iucv.c b/net/iucv/iucv.c index 918970762131..2d43175b0cdb 100644 --- a/net/iucv/iucv.c +++ b/net/iucv/iucv.c @@ -598,7 +598,7 @@ static int __cpuinit iucv_cpu_notify(struct notifier_block *self, return NOTIFY_OK; } -static struct notifier_block __cpuinitdata iucv_cpu_notifier = { +static struct notifier_block __refdata iucv_cpu_notifier = { .notifier_call = iucv_cpu_notify, }; -- cgit v1.2.3 From 7b9d1b22a382aa221018c19880ee22c44467feec Mon Sep 17 00:00:00 2001 From: Heiko Carstens Date: Mon, 9 Jun 2008 15:50:30 -0700 Subject: iucv: prevent cpu hotplug when walking cpu_online_map. The code used preempt_disable() to prevent cpu hotplug, however that doesn't protect for cpus being added. So use get_online_cpus() instead. Signed-off-by: Heiko Carstens Signed-off-by: Martin Schwidefsky Signed-off-by: Ursula Braun Signed-off-by: David S. Miller --- net/iucv/iucv.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'net/iucv') diff --git a/net/iucv/iucv.c b/net/iucv/iucv.c index 2d43175b0cdb..531a206ce7a6 100644 --- a/net/iucv/iucv.c +++ b/net/iucv/iucv.c @@ -474,14 +474,14 @@ static void iucv_setmask_mp(void) { int cpu; - preempt_disable(); + get_online_cpus(); for_each_online_cpu(cpu) /* Enable all cpus with a declared buffer. */ if (cpu_isset(cpu, iucv_buffer_cpumask) && !cpu_isset(cpu, iucv_irq_cpumask)) smp_call_function_single(cpu, iucv_allow_cpu, NULL, 0, 1); - preempt_enable(); + put_online_cpus(); } /** @@ -521,16 +521,17 @@ static int iucv_enable(void) goto out; /* Declare per cpu buffers. */ rc = -EIO; - preempt_disable(); + get_online_cpus(); for_each_online_cpu(cpu) smp_call_function_single(cpu, iucv_declare_cpu, NULL, 0, 1); - preempt_enable(); if (cpus_empty(iucv_buffer_cpumask)) /* No cpu could declare an iucv buffer. */ goto out_path; + put_online_cpus(); return 0; out_path: + put_online_cpus(); kfree(iucv_path_table); out: return rc; @@ -545,7 +546,9 @@ out: */ static void iucv_disable(void) { + get_online_cpus(); on_each_cpu(iucv_retrieve_cpu, NULL, 0, 1); + put_online_cpus(); kfree(iucv_path_table); } -- cgit v1.2.3 From 469689a4dd476c1be6750deea5f59528a17b8b4a Mon Sep 17 00:00:00 2001 From: Ursula Braun Date: Mon, 9 Jun 2008 15:51:03 -0700 Subject: af_iucv: exploit target message class support of IUCV The first 4 bytes of data to be sent are stored additionally into the message class field of the send request. A receiving target program (not an af_iucv socket program) can make use of this information to pre-screen incoming messages. Signed-off-by: Ursula Braun Signed-off-by: David S. Miller --- net/iucv/af_iucv.c | 1 + 1 file changed, 1 insertion(+) (limited to 'net/iucv') diff --git a/net/iucv/af_iucv.c b/net/iucv/af_iucv.c index 7b0038f45b16..58e4aee3e696 100644 --- a/net/iucv/af_iucv.c +++ b/net/iucv/af_iucv.c @@ -644,6 +644,7 @@ static int iucv_sock_sendmsg(struct kiocb *iocb, struct socket *sock, } txmsg.class = 0; + memcpy(&txmsg.class, skb->data, skb->len >= 4 ? 4 : skb->len); txmsg.tag = iucv->send_tag++; memcpy(skb->cb, &txmsg.tag, 4); skb_queue_tail(&iucv->send_skb_q, skb); -- cgit v1.2.3 From d0236f8f8223ad841f461ea3a635d452d194806b Mon Sep 17 00:00:00 2001 From: Akinobu Mita Date: Tue, 15 Jul 2008 02:09:53 -0700 Subject: iucv: fix memory leak in cpu hotplug error path. Fix memory leak in error path in CPU_UP_PREPARE notifier. Signed-off-by: Akinobu Mita Signed-off-by: David S. Miller --- net/iucv/iucv.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'net/iucv') diff --git a/net/iucv/iucv.c b/net/iucv/iucv.c index 531a206ce7a6..d8e0635aace0 100644 --- a/net/iucv/iucv.c +++ b/net/iucv/iucv.c @@ -567,8 +567,11 @@ static int __cpuinit iucv_cpu_notify(struct notifier_block *self, return NOTIFY_BAD; iucv_param[cpu] = kmalloc_node(sizeof(union iucv_param), GFP_KERNEL|GFP_DMA, cpu_to_node(cpu)); - if (!iucv_param[cpu]) + if (!iucv_param[cpu]) { + kfree(iucv_irq_data[cpu]); + iucv_irq_data[cpu] = NULL; return NOTIFY_BAD; + } break; case CPU_UP_CANCELED: case CPU_UP_CANCELED_FROZEN: -- cgit v1.2.3 From fb65a7c091529bfffb1262515252c0d0f6241c5c Mon Sep 17 00:00:00 2001 From: "David S. Miller" Date: Sun, 20 Jul 2008 10:18:44 -0700 Subject: iucv: Fix bad merging. Noticed by Stephen Rothwell. Signed-off-by: David S. Miller --- net/iucv/iucv.c | 10 ---------- 1 file changed, 10 deletions(-) (limited to 'net/iucv') diff --git a/net/iucv/iucv.c b/net/iucv/iucv.c index a598c7384840..265b1b289a32 100644 --- a/net/iucv/iucv.c +++ b/net/iucv/iucv.c @@ -523,12 +523,8 @@ static int iucv_enable(void) rc = -EIO; get_online_cpus(); for_each_online_cpu(cpu) -<<<<<<< HEAD:net/iucv/iucv.c - smp_call_function_single(cpu, iucv_declare_cpu, NULL, 0, 1); -======= smp_call_function_single(cpu, iucv_declare_cpu, NULL, 1); preempt_enable(); ->>>>>>> 5b664cb235e97afbf34db9c4d77f08ebd725335e:net/iucv/iucv.c if (cpus_empty(iucv_buffer_cpumask)) /* No cpu could declare an iucv buffer. */ goto out_path; @@ -551,13 +547,7 @@ out: */ static void iucv_disable(void) { -<<<<<<< HEAD:net/iucv/iucv.c - get_online_cpus(); - on_each_cpu(iucv_retrieve_cpu, NULL, 0, 1); - put_online_cpus(); -======= on_each_cpu(iucv_retrieve_cpu, NULL, 1); ->>>>>>> 5b664cb235e97afbf34db9c4d77f08ebd725335e:net/iucv/iucv.c kfree(iucv_path_table); } -- cgit v1.2.3