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-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <201711242103.FIH57396.FOFVJtQFLSMOHO@I-love.SAKURA.ne.jp>
Date:   Fri, 24 Nov 2017 21:03:28 +0900
From:   Tetsuo Handa <penguin-kernel@...ove.SAKURA.ne.jp>
To:     mhocko@...nel.org, david@...morbit.com
Cc:     hch@...radead.org, darrick.wong@...cle.com,
        linux-xfs@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2] xfs: handle register_shrinker error

Michal Hocko wrote:
> Thanks. Updated patch below
> ---
> From 1009db61988c48c9a9e327a9d076945b29b02eee Mon Sep 17 00:00:00 2001
> From: Michal Hocko <mhocko@...e.com>
> Date: Thu, 23 Nov 2017 17:13:40 +0100
> Subject: [PATCH] xfs: fortify xfs_alloc_buftarg error handling

Do we need below patch on top of Michal's patch?
KM_NOFS was added by commit b17cb364dbbbf65a ("xfs: fix missing KM_NOFS
tags to keep lockdep happy"). If not needed, some comment is expected.

---
 fs/xfs/xfs_buf.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/fs/xfs/xfs_buf.c b/fs/xfs/xfs_buf.c
index 4c6e86d..b73fc76 100644
--- a/fs/xfs/xfs_buf.c
+++ b/fs/xfs/xfs_buf.c
@@ -1806,6 +1806,7 @@ struct xfs_buf *
 	struct dax_device	*dax_dev)
 {
 	xfs_buftarg_t		*btp;
+	unsigned int nofs_flag = memalloc_nofs_save();
 
 	btp = kmem_zalloc(sizeof(*btp), KM_SLEEP | KM_NOFS);
 
@@ -1829,6 +1830,7 @@ struct xfs_buf *
 	btp->bt_shrinker.flags = SHRINKER_NUMA_AWARE;
 	if (register_shrinker(&btp->bt_shrinker))
 		goto error_pcpu;
+	memalloc_nofs_restore(nofs_flag);
 	return btp;
 
 error_pcpu:
@@ -1837,6 +1839,7 @@ struct xfs_buf *
 	list_lru_destroy(&btp->bt_lru);
 error_free:
 	kmem_free(btp);
+	memalloc_nofs_restore(nofs_flag);
 	return NULL;
 }
 
-- 
1.8.3.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ