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>] [day] [month] [year] [list]
Date:	Tue, 4 Sep 2012 22:08:18 +0000
From:	Seiji Aguchi <seiji.aguchi@....com>
To:	Seiji Aguchi <seiji.aguchi@....com>,
	Mike Waychison <mikew@...gle.com>,
	"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>,
	"linux-efi@...r.kernel.org" <linux-efi@...r.kernel.org>
CC:	"dle-develop@...ts.sourceforge.net" 
	<dle-develop@...ts.sourceforge.net>,
	Satoru Moriya <satoru.moriya@....com>
Subject: [RESEND][PATCH v4 3/3] efi_pstore: Skiping scheduling a workqueue
 in cases other than oops

[Problem]
 efi_pstore creates sysfs files when logging kernel messages to NVRAM.
 Currently, the sysfs files are updated in a workqueue which is registered in a write callback.

 On the other hand, situations which users need the sysfs files are when they erase entries or oops happen 
 because a system will  be down and users can't access to sysfs files in other cases like panic, reboot or emergency_restart.

 Also, if kernel panics due to a bug of workqueue operations and a write callback of efi_pstore is called in
 panic case, efi_pstore may fail due to a failure of schedule_work(). 
 And panic_notifier_chain()/emergency_restart() is not kicked if efi_pstore fails.  
   This may cause user's unwanted result.

[Patch Description]
 This patch registers a workqueue updating sysfs entries in cases where users erase entries or oops happen only,
 and skips it in other cases like panic, reboot or emergency_start.

Signed-off-by: Seiji Aguchi <seiji.aguchi@....com>

---
 drivers/firmware/efivars.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/drivers/firmware/efivars.c b/drivers/firmware/efivars.c
index cd16ea6..d5911fd 100644
--- a/drivers/firmware/efivars.c
+++ b/drivers/firmware/efivars.c
@@ -746,7 +746,12 @@ static int efi_pstore_write(enum pstore_type_id type,
 
 	spin_unlock_irqrestore(&efivars->lock, flags);
 
-	schedule_work(&efivar_work);
+	/*
+	 * The user may want to update sysfs for this write
+	 * when they erase an entry via /dev/pstore or oops happen.
+	 */
+	if (!size || reason == KMSG_DUMP_OOPS)
+		schedule_work(&efivar_work);
 
 	*id = part;
 	return ret;
-- 
1.7.1
--
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