lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 7 Sep 2021 01:29:03 +0000
From:   "Zhang, Qiang" <Qiang.Zhang@...driver.com>
To:     "bristot@...hat.com" <bristot@...hat.com>,
        "rostedt@...dmis.org" <rostedt@...dmis.org>,
        "bristot@...nel.org" <bristot@...nel.org>,
        "mingo@...hat.com" <mingo@...hat.com>
CC:     "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v2] trace/osnoise: Fix missed cpus_read_unlock() in
 start_per_cpu_kthreads()

Hi  Daniel

Do you have time to review this modification?

Thanks
Qiang.zhang 

________________________________________
From: Zhang, Qiang <qiang.zhang@...driver.com>
Sent: Tuesday, 31 August 2021 10:28
To: bristot@...hat.com; rostedt@...dmis.org; bristot@...nel.org; mingo@...hat.com
Cc: linux-kernel@...r.kernel.org
Subject: [PATCH v2] trace/osnoise: Fix missed cpus_read_unlock() in start_per_cpu_kthreads()

From: "Qiang.Zhang" <qiang.zhang@...driver.com>

When start_kthread() return error, the cpus_read_unlock() need
to be called.

Fixes: c8895e271f79 ("trace/osnoise: Support hotplug operations")
Cc: <stable@...r.kernel.org> # v5.14+
Signed-off-by: Qiang.Zhang <qiang.zhang@...driver.com>
---
 v1->v2:
 Modify submission information and code style, add tags.

 kernel/trace/trace_osnoise.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/kernel/trace/trace_osnoise.c b/kernel/trace/trace_osnoise.c
index 65b08b8e5bf8..ce053619f289 100644
--- a/kernel/trace/trace_osnoise.c
+++ b/kernel/trace/trace_osnoise.c
@@ -1548,7 +1548,7 @@ static int start_kthread(unsigned int cpu)
 static int start_per_cpu_kthreads(struct trace_array *tr)
 {
        struct cpumask *current_mask = &save_cpumask;
-       int retval;
+       int retval = 0;
        int cpu;

        cpus_read_lock();
@@ -1568,13 +1568,13 @@ static int start_per_cpu_kthreads(struct trace_array *tr)
                retval = start_kthread(cpu);
                if (retval) {
                        stop_per_cpu_kthreads();
-                       return retval;
+                       break;
                }
        }

        cpus_read_unlock();

-       return 0;
+       return retval;
 }

 #ifdef CONFIG_HOTPLUG_CPU
--
2.17.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ