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, 19 Sep 2018 19:25:47 +0800
From:   YueHaibing <yuehaibing@...wei.com>
To:     <akpm@...ux-foundation.org>, <dbueso@...e.de>,
        <manfred@...orfullife.com>, <ebiederm@...ssion.com>,
        <viro@...iv.linux.org.uk>, <linux@...inikbrodowski.net>,
        <ebiggers@...gle.com>
CC:     <linux-kernel@...r.kernel.org>, YueHaibing <yuehaibing@...wei.com>
Subject: [PATCH -next] ipc/shm: Use ERR_CAST to return error code

Fix gcc warning:
ipc/shm.c: In function 'shm_lock'
ipc/shm.c:210:2: note: randstruct: casting between randomized structure pointer types (ssa): 'struct shmid_kernel' and 'struct kern_ipc_perm'

Signed-off-by: YueHaibing <yuehaibing@...wei.com>
---
 ipc/shm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ipc/shm.c b/ipc/shm.c
index 4cd402e..1c65fb3 100644
--- a/ipc/shm.c
+++ b/ipc/shm.c
@@ -206,7 +206,7 @@ static inline struct shmid_kernel *shm_lock(struct ipc_namespace *ns, int id)
 	 * Callers of shm_lock() must validate the status of the returned ipc
 	 * object pointer and error out as appropriate.
 	 */
-	return (void *)ipcp;
+	return ERR_CAST(ipcp);
 }
 
 static inline void shm_lock_by_ptr(struct shmid_kernel *ipcp)
-- 
1.8.3.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ