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:   Mon,  5 Jun 2017 11:55:38 +0800
From:   Jia-Ju Bai <baijiaju1990@....com>
To:     dhowells@...hat.com
Cc:     linux-cachefs@...hat.com, linux-kernel@...r.kernel.org,
        Jia-Ju Bai <baijiaju1990@....com>
Subject: [PATCH] cachefiles: Fix a sleep-in-atomic bug in cachefiles_printk_object

The driver may sleep under a write spin lock, and the function 
call path is:
cachefiles_mark_object_active (acquire the lock by write_lock)
  cachefiles_printk_object
    kmalloc(GFP_NOIO) --> may sleep
cachefiles_mark_object_buried (acquire the lock by write_lock)
  cachefiles_printk_object
    kmalloc(GFP_NOIO) --> may sleep

To fix it, "GFP_NOIO" is replaced with "GFP_ATOMIC".

Signed-off-by: Jia-Ju Bai <baijiaju1990@....com>
---
 fs/cachefiles/namei.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/cachefiles/namei.c b/fs/cachefiles/namei.c
index 41df8a2..d0f76e7 100644
--- a/fs/cachefiles/namei.c
+++ b/fs/cachefiles/namei.c
@@ -83,7 +83,7 @@ static noinline void cachefiles_printk_object(struct cachefiles_object *object,
 {
 	u8 *keybuf;
 
-	keybuf = kmalloc(CACHEFILES_KEYBUF_SIZE, GFP_NOIO);
+	keybuf = kmalloc(CACHEFILES_KEYBUF_SIZE, GFP_ATOMIC);
 	if (object)
 		__cachefiles_printk_object(object, "", keybuf);
 	if (xobject)
-- 
1.7.9.5


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ