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-next>] [day] [month] [year] [list]
Message-Id: <20110919212040.745370781@goodmis.org>
Date:	Mon, 19 Sep 2011 17:20:40 -0400
From:	Steven Rostedt <rostedt@...dmis.org>
To:	linux-kernel@...r.kernel.org
Cc:	Ingo Molnar <mingo@...e.hu>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Thomas Gleixner <tglx@...utronix.de>,
	Peter Zijlstra <peterz@...radead.org>,
	Christoph Lameter <cl@...ux.com>
Subject: [RFC][PATCH 0/5] Introduce checks for preemptable code for this_cpu_read/write()

I just found out that the this_cpu_*() functions do not perform the
test to see if the usage is in atomic or not. Thus, the blind
conversion of the per_cpu(*, smp_processor_id()) and the get_cpu_var()
code to this_cpu_*() introduce the regression to detect the hard
to find case where a per cpu variable is used in preempt code that
migrates and causes bugs.

I'm adding back a simple call to smp_processor_id() to
this_cpu_read() and this_cpu_write() to see what errors I find.
I found 4 places that required touch up. 3 were areas that the race
is known and we don't care, but the memcg looks very buggy.

Anyway, if I had known that the this_cpu_*() code removed this
smp_processor_id() check, I would have NAK'd all the changes to the tracing
code.

I only modified this_cpu_read and *_write() I may decide other this_cpu_*
code should be updated too. Especially the ones that return a value.

-- Steve

Steven Rostedt (5):
      x86: Remove const_udelay() caring about which cpu var it uses
      mm: Switch mod_state() to __this_cpu_read()
      memcg: Disable preemption in memcg_check_events()
      printk: Have wake_up_klogd() use __this_cpu_write()
      percpu: Add preempt checks back into this_cpu_read/write()

----
 arch/x86/lib/delay.c   |    2 +-
 include/linux/percpu.h |   17 +++++++++++++++--
 kernel/printk.c        |    2 +-
 mm/memcontrol.c        |    2 ++
 mm/vmstat.c            |    4 ++--
 5 files changed, 21 insertions(+), 6 deletions(-)
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ