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 for Android: free password hash cracker in your pocket
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <f0f70c9326edab0cc56731f24244e86f8ba84ef4.1493727412.git.geliangtang@gmail.com>
Date:   Sat,  6 May 2017 23:34:24 +0800
From:   Geliang Tang <geliangtang@...il.com>
To:     Matias Bjorling <mb@...htnvm.io>
Cc:     Geliang Tang <geliangtang@...il.com>, linux-block@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: [PATCH] lightnvm: fix error return code of memdup_user

The error return code of memdup_user() should be -ENOMEM or -EFAULT.
So this patch changed it to PTR_ERR(info).

Signed-off-by: Geliang Tang <geliangtang@...il.com>
---
 drivers/lightnvm/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/lightnvm/core.c b/drivers/lightnvm/core.c
index 54a06c3..e8b5edd 100644
--- a/drivers/lightnvm/core.c
+++ b/drivers/lightnvm/core.c
@@ -1164,7 +1164,7 @@ static long nvm_ioctl_info(struct file *file, void __user *arg)
 
 	info = memdup_user(arg, sizeof(struct nvm_ioctl_info));
 	if (IS_ERR(info))
-		return -EFAULT;
+		return PTR_ERR(info);
 
 	info->version[0] = NVM_VERSION_MAJOR;
 	info->version[1] = NVM_VERSION_MINOR;
-- 
2.9.3

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ