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:	Fri, 24 Aug 2012 19:19:04 +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>,
	"Matthew Garrett (mjg@...hat.com)" <mjg@...hat.com>,
	"dzickus@...hat.com" <dzickus@...hat.com>,
	"mikew@...gle.com" <mikew@...gle.com>
CC:	"dle-develop@...ts.sourceforge.net" 
	<dle-develop@...ts.sourceforge.net>,
	Satoru Moriya <satoru.moriya@....com>
Subject: efi_pstore: question about how to remove spinlock from a whole
 process of open/read/close of efi_pstore

Hi,

I'm sending an email to discuss how to remove spinlock from a whole process of open/read/close of efi_pstore.

[Problem]

Current efi_pstore calls kmalloc() in a read callback while holding a spinlock, efivar->lock, in an open callback.
This means efi_pstore may deadlock if it sleeps in kmalloc().

Also, there is a comment that an efivar->lock shouldn't be held when calling kmalloc().

[Idea]

In a process of open/read/close, pstore creates some files in the directory of /dev/pstore.
So, memory allocations like kmalloc() are not avoidable.
 
My idea fixing this issue is removing spinlock from a whole process of open/read/close of efi_pstore.

Currently, efivar->lock protects two things, efivar->list and ops.[gs]et_variable().
But if we can revise locks of efivar as follows, we can fix this issue.

  - Introduce a new efivar->list_lock to protect efivar->list and RCU is used while searching it.

  - An existing efivar>lock protects just ops.[gs]et_variable() calls.

Any comments are welcome.

Seiji
--
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