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: <1474367764-9555-13-git-send-email-Ram.Amrani@cavium.com>
Date:   Tue, 20 Sep 2016 13:36:04 +0300
From:   Ram Amrani <Ram.Amrani@...ium.com>
To:     <davem@...emloft.net>, <dledford@...hat.com>
CC:     <Ariel.Elior@...ium.com>, <Michal.Kalderon@...ium.com>,
        <Yuval.Mintz@...ium.com>, <rajesh.borundia@...ium.com>,
        <linux-rdma@...r.kernel.org>, <netdev@...r.kernel.org>,
        Ram amrani <Ram.Amrani@...ium.com>
Subject: [RFC v2 12/12] IB/core: add a protection to ib_get_dma_mr

From: Ram amrani <Ram.Amrani@...ium.com>

Add a check that prevents ib_get_dma_mr from executing if
IB_ACCESS_MW_BIND is set.

Signed-off-by: Ram Amrani <Ram.Amrani@...ium.com>
---
 drivers/infiniband/core/verbs.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/infiniband/core/verbs.c b/drivers/infiniband/core/verbs.c
index f2b776e..8cc6f79 100644
--- a/drivers/infiniband/core/verbs.c
+++ b/drivers/infiniband/core/verbs.c
@@ -1400,6 +1400,9 @@ struct ib_mr *ib_get_dma_mr(struct ib_pd *pd, int mr_access_flags)
 	if (err)
 		return ERR_PTR(err);
 
+	if (mr_access_flags & IB_ACCESS_MW_BIND)
+		return ERR_PTR(-EINVAL);
+
 	mr = pd->device->get_dma_mr(pd, mr_access_flags);
 
 	if (!IS_ERR(mr)) {
-- 
1.8.3.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ