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: <1455269766-2994-6-git-send-email-deepa.kernel@gmail.com>
Date:	Fri, 12 Feb 2016 01:35:59 -0800
From:	Deepa Dinamani <deepa.kernel@...il.com>
To:	linux-fsdevel@...r.kernel.org, y2038@...ts.linaro.org
Cc:	Arnd Bergmann <arnd@...db.de>, Dave Chinner <david@...morbit.com>,
	"Theodore Ts'o" <tytso@....edu>, linux-kernel@...r.kernel.org
Subject: [RFC v2a 05/12] fs: cifs: Use vfs_time_get_real_* time functions

The VFS inode timestamps are not y2038 safe as they use
struct timespec. These will be changed to use struct timespec64
instead and that is y2038 safe.
But, since the above data type conversion will break the end
file systems, use vfs_time aliases here to access inode times.

Variables in the patch are passed into functions that also take
inode times as argument. Hence, using vfs_time aliases here is
necessary so that they can change to use 64 bit time along with
vfs.

Signed-off-by: Deepa Dinamani <deepa.kernel@...il.com>
---
 fs/cifs/cifsencrypt.c | 2 +-
 fs/cifs/cifssmb.c     | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/fs/cifs/cifsencrypt.c b/fs/cifs/cifsencrypt.c
index ee1e674..2b606e2 100644
--- a/fs/cifs/cifsencrypt.c
+++ b/fs/cifs/cifsencrypt.c
@@ -485,7 +485,7 @@ find_timestamp(struct cifs_ses *ses)
 		blobptr += attrsize; /* advance attr value */
 	}
 
-	ktime_get_real_ts(&ts);
+	vfs_get_real_ts(&ts);
 	return cpu_to_le64(cifs_UnixTimeToNT(ts));
 }
 
diff --git a/fs/cifs/cifssmb.c b/fs/cifs/cifssmb.c
index b3b3fa4..4c1deae 100644
--- a/fs/cifs/cifssmb.c
+++ b/fs/cifs/cifssmb.c
@@ -479,11 +479,11 @@ decode_lanman_negprot_rsp(struct TCP_Server_Info *server, NEGOTIATE_RSP *pSMBr)
 		 */
 		int val, seconds, remain, result;
 		struct vfs_time ts;
-		unsigned long utc = get_seconds();
+		unsigned long long utc = vfs_get_real_seconds();
 		ts = cnvrtDosUnixTm(rsp->SrvTime.Date,
 				    rsp->SrvTime.Time, 0);
-		cifs_dbg(FYI, "SrvTime %d sec since 1970 (utc: %d) diff: %d\n",
-			 (int)ts.tv_sec, (int)utc,
+		cifs_dbg(FYI, "SrvTime %lld sec since 1970 (utc: %lld) diff: %d\n",
+			 (long long)ts.tv_sec, (long long)utc,
 			 (int)(utc - ts.tv_sec));
 		val = (int)(utc - ts.tv_sec);
 		seconds = abs(val);
-- 
1.9.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ