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-next>] [day] [month] [year] [list]
Date:   Fri,  6 Sep 2019 17:10:10 +0200
From:   Arnd Bergmann <arnd@...db.de>
To:     Bernard Metzler <bmt@...ich.ibm.com>,
        Doug Ledford <dledford@...hat.com>,
        Jason Gunthorpe <jgg@...pe.ca>
Cc:     Arnd Bergmann <arnd@...db.de>, Jason Gunthorpe <jgg@...lanox.com>,
        Stephen Rothwell <sfr@...b.auug.org.au>,
        Andrew Morton <akpm@...ux-foundation.org>,
        John Hubbard <jhubbard@...dia.com>, linux-rdma@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: [PATCH] rdma/siw: fix NOMMU build

On kernels without CONFIG_MMU, we get a link error for the siw
driver:

drivers/infiniband/sw/siw/siw_mem.o: In function `siw_umem_get':
siw_mem.c:(.text+0x4c8): undefined reference to `can_do_mlock'

I don't know whether this driver is able to work at all without
an MMU, but it's easy to avoid the link problem by adding another
compile-time check.

Fixes: 2251334dcac9 ("rdma/siw: application buffer management")
Signed-off-by: Arnd Bergmann <arnd@...db.de>
---
 drivers/infiniband/sw/siw/siw_mem.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/infiniband/sw/siw/siw_mem.c b/drivers/infiniband/sw/siw/siw_mem.c
index e99983f07663..b3b614c07fdb 100644
--- a/drivers/infiniband/sw/siw/siw_mem.c
+++ b/drivers/infiniband/sw/siw/siw_mem.c
@@ -374,7 +374,7 @@ struct siw_umem *siw_umem_get(u64 start, u64 len, bool writable)
 	unsigned int foll_flags = FOLL_WRITE;
 	int num_pages, num_chunks, i, rv = 0;
 
-	if (!can_do_mlock())
+	if (!IS_ENABLED(CONFIG_MMU) || !can_do_mlock())
 		return ERR_PTR(-EPERM);
 
 	if (!len)
-- 
2.20.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ