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 for Android: free password hash cracker in your pocket
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <A5ED84D3BB3A384992CBB9C77DEDA4D414A3E17B@USINDEM103.corp.hds.com>
Date:	Fri, 11 Jan 2013 18:08:52 +0000
From:	Seiji Aguchi <seiji.aguchi@....com>
To:	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"Luck, Tony (tony.luck@...el.com)" <tony.luck@...el.com>,
	"dzickus@...hat.com" <dzickus@...hat.com>,
	"anton.vorontsov@...aro.org" <anton.vorontsov@...aro.org>
CC:	"dle-develop@...ts.sourceforge.net" 
	<dle-develop@...ts.sourceforge.net>,
	Satoru Moriya <satoru.moriya@....com>
Subject: [PATCH v4 0/2] pstore,efi_pstore: Avoid deadlock in non-blocking
 paths

Changelog 
v3 -> v4
 - Add EXPORT_SYMBOL_GPL(pstore_cannot_block_path) to build successfully
   with CONFIG_EFI_VARS=m. (PATCH 1/2)

v2 -> v3
 - Merge modifications of pstore part in 2/2 to 1/2.
 - Rename pstore_is_non_blocking_path() to pstore_cannot_block_path().

v1 -> v2
 - Erase a logic checking the number of online cpus.
 - Create a patchset to fix deadlocking issue in both pstore filesystem and
   efi_pstore driver.
   - Introduce a function, is_non_blocking_path(), to check if pstore 
     is in panic and emergency-restart paths (PATCH 1/2)
   - Avoid efi_pstore_driver is blocked in non-blocking paths
     such as nmi, panic and emergency-restart paths (PATCH 2/2)

[Issue]

There are some paths in kernel which shouldn't be blocked, 
like NMI, panic case after stopping cpus, emergency-restart.

On the other hand, current pstore avoids blocking in a NMI path 
but it may be blocked in other paths.
Also, an efi_pstore driver may be blocked in all of those paths 
because it simply takes a spin lock at writing time.

If they are blocked in those paths, the system will hang up and
it has a big impact for users.

Here is an example scenario which pstore is blocked in panic path.

 - cpuA grabs psinfo->buf_lock
 - cpuB panics and calls smp_send_stop
 - smp_send_stop sends IRQ to cpuA
   after 1 second, cpuB gives up on cpuA and sends an NMI instead
 - cpuA is now in an NMI handler while still holding buf_lock.
   And then, cpuB is deadlocked by taking efi_pstore->lock again.

This case may happen if a firmware has a bug and cpuA is stuck in it.

[Solution]

This patchset avoids that pstore and efi_pstore driver are blocked 
in the non-blocking paths like NMI, panic, and emrgency-restart
by introducing a function checking if they are in those paths.
Please see each patch for detailed explanations.

Seiji Aguchi (2):
  [PATCH v4 1/2] pstore: Avoid deadlock in panic and emergency-restart path
  [PATCH v4 2/2] efi_pstore: Avoid deadlock in non-blocking paths

 drivers/firmware/efivars.c |   11 ++++++++++-
 fs/pstore/platform.c       |   35 +++++++++++++++++++++++++++++------
 include/linux/pstore.h     |    6 ++++++
 3 files changed, 45 insertions(+), 7 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