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:   Wed,  7 Aug 2019 02:04:24 +0800
From:   Xinpeng Liu <danielliu861@...il.com>
To:     sumit.semwal@...aro.org, gustavo@...ovan.org
Cc:     linux-media@...r.kernel.org, dri-devel@...ts.freedesktop.org,
        linaro-mm-sig@...ts.linaro.org, linux-kernel@...r.kernel.org,
        Xinpeng Liu <danielliu861@...il.com>
Subject: [PATCH] fence: checking for NULL pointer after dereferencing it.

drivers/dma-buf/dma-fence.c:131 in function dma_fence_signal_locked,
if (WARN_ON(!fence)) should be before lockdep_assert_held(fence->lock);
otherwise there is not any meaning.

Signed-off-by: Xinpeng Liu <danielliu861@...il.com>
---
 drivers/dma-buf/dma-fence.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/dma-buf/dma-fence.c b/drivers/dma-buf/dma-fence.c
index 59ac96e..0b11063 100644
--- a/drivers/dma-buf/dma-fence.c
+++ b/drivers/dma-buf/dma-fence.c
@@ -131,10 +131,9 @@ int dma_fence_signal_locked(struct dma_fence *fence)
 	struct dma_fence_cb *cur, *tmp;
 	int ret = 0;
 
-	lockdep_assert_held(fence->lock);
-
 	if (WARN_ON(!fence))
 		return -EINVAL;
+	lockdep_assert_held(fence->lock);
 
 	if (test_and_set_bit(DMA_FENCE_FLAG_SIGNALED_BIT, &fence->flags)) {
 		ret = -EINVAL;
-- 
1.8.3.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ