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]
Message-ID: <20190423090118.GA465@bharath12345-Inspiron-5559>
Date:   Tue, 23 Apr 2019 14:31:18 +0530
From:   Bharath Vedartham <linux.bhar@...il.com>
To:     dushistov@...l.ru
Cc:     linux.bhar@...il.com, linux-kernel@...r.kernel.org
Subject: [PATCH] fs/ufs: Force type conversion from __fs16 to u16

This patch fixes the sparse warning:
warning: restricted __fs16 degrades to integer

inode->ui_u1.oldids.ui_suid is of type __fs16, a restricted integer.
0XFFFF is a 16 bit unsigned integer. Use __force to fix the sparse
warning.

Signed-off-by: Bharath Vedartham <linux.bhar@...il.com>
---
 fs/ufs/util.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/ufs/util.h b/fs/ufs/util.h
index 1fd3011..b03143f 100644
--- a/fs/ufs/util.h
+++ b/fs/ufs/util.h
@@ -195,7 +195,7 @@ ufs_get_inode_uid(struct super_block *sb, struct ufs_inode *inode)
 	case UFS_UID_44BSD:
 		return fs32_to_cpu(sb, inode->ui_u3.ui_44.ui_uid);
 	case UFS_UID_EFT:
-		if (inode->ui_u1.oldids.ui_suid == 0xFFFF)
+		if ((__force u16)inode->ui_u1.oldids.ui_suid == 0xFFFF)
 			return fs32_to_cpu(sb, inode->ui_u3.ui_sun.ui_uid);
 		/* Fall through */
 	default:
@@ -229,7 +229,7 @@ ufs_get_inode_gid(struct super_block *sb, struct ufs_inode *inode)
 	case UFS_UID_44BSD:
 		return fs32_to_cpu(sb, inode->ui_u3.ui_44.ui_gid);
 	case UFS_UID_EFT:
-		if (inode->ui_u1.oldids.ui_suid == 0xFFFF)
+		if ((__force u16)inode->ui_u1.oldids.ui_suid == 0xFFFF)
 			return fs32_to_cpu(sb, inode->ui_u3.ui_sun.ui_gid);
 		/* Fall through */
 	default:
-- 
2.7.4

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ