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>] [day] [month] [year] [list]
Date:   Tue, 9 May 2017 09:35:51 -0400
From:   Steven Rostedt <rostedt@...dmis.org>
To:     Linus Torvalds <torvalds@...ux-foundation.org>
Cc:     LKML <linux-kernel@...r.kernel.org>,
        Ingo Molnar <mingo@...nel.org>,
        Andrew Morton <akpm@...ux-foundation.org>,
        Matthias Kaehlcke <mka@...omium.org>
Subject: [GIT PULL] tracing: Use cpumask_available() to check if cpumask
 variable may be used


Linus,

This is a trivial patch that changes a check for a cpumask from a NULL
pointer to using cpumask_available(), which will do the check. This is
because cpumasks when not allocated are always set, and clang complains
about it.

I was just recently pinged about this patch. It required
cpumask_available() to be in your tree first.

Please pull the latest trace-v4.12-3 tree, which can be found at:


  git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace.git
trace-v4.12-3

Tag SHA1: 7eae248e169b333baaec1abe2878dcb7f1de3eeb
Head SHA1: 4dbbe2d8e95c351157f292ece067f985c30c7b53


Matthias Kaehlcke (1):
      tracing: Use cpumask_available() to check if cpumask variable may be used

----
 kernel/trace/trace.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
---------------------------
commit 4dbbe2d8e95c351157f292ece067f985c30c7b53
Author: Matthias Kaehlcke <mka@...omium.org>
Date:   Fri Apr 21 16:41:10 2017 -0700

    tracing: Use cpumask_available() to check if cpumask variable may be used
    
    This fixes the following clang warning:
    
    kernel/trace/trace.c:3231:12: warning: address of array 'iter->started'
      will always evaluate to 'true' [-Wpointer-bool-conversion]
            if (iter->started)
    
    Link: http://lkml.kernel.org/r/20170421234110.117075-1-mka@chromium.org
    
    Signed-off-by: Matthias Kaehlcke <mka@...omium.org>
    Signed-off-by: Steven Rostedt (VMware) <rostedt@...dmis.org>

diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index 4ad4420b33d6..c4536c449021 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -3311,13 +3311,14 @@ static void test_cpu_buff_start(struct trace_iterator *iter)
 	if (!(iter->iter_flags & TRACE_FILE_ANNOTATE))
 		return;
 
-	if (iter->started && cpumask_test_cpu(iter->cpu, iter->started))
+	if (cpumask_available(iter->started) &&
+	    cpumask_test_cpu(iter->cpu, iter->started))
 		return;
 
 	if (per_cpu_ptr(iter->trace_buffer->data, iter->cpu)->skipped_entries)
 		return;
 
-	if (iter->started)
+	if (cpumask_available(iter->started))
 		cpumask_set_cpu(iter->cpu, iter->started);
 
 	/* Don't print started cpu buffer for the first entry of the trace */

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ