xfs
[Top] [All Lists]

Re: [RFC 11/32] xfs: convert to struct inode_time

To: Theodore Ts'o <tytso@xxxxxxx>
Subject: Re: [RFC 11/32] xfs: convert to struct inode_time
From: Roger Willcocks <roger@xxxxxxxxxxxxxxxx>
Date: Tue, 03 Jun 2014 14:09:43 +0100
Cc: "H. Peter Anvin" <hpa@xxxxxxxxx>, Nicolas Pitre <nicolas.pitre@xxxxxxxxxx>, linux-arch@xxxxxxxxxxxxxxx, Linux NFS Mailing List <linux-nfs@xxxxxxxxxxxxxxx>, Arnd Bergmann <arnd@xxxxxxxx>, LKML Kernel <linux-kernel@xxxxxxxxxxxxxxx>, xfs@xxxxxxxxxxx, Christoph Hellwig <hch@xxxxxxxxxxxxx>, Chuck Lever <chuck.lever@xxxxxxxxxx>, john.stultz@xxxxxxxxxx, lftan@xxxxxxxxxx, linux-fsdevel <linux-fsdevel@xxxxxxxxxxxxxxx>, geert@xxxxxxxxxxxxxx, tglx@xxxxxxxxxxxxx, joseph@xxxxxxxxxxxxxxxx
Delivered-to: xfs@xxxxxxxxxxx
In-reply-to: <20140602233212.GA2060@xxxxxxxxx>
References: <1401480116-1973111-1-git-send-email-arnd@xxxxxxxx> <8618458.1EVJCoVbkH@wuerfel> <alpine.LFD.2.11.1406012121430.17310@xxxxxxxxxxx> <4178301.j9kWdGCRLC@wuerfel> <6868F108-F0B2-423F-AE31-90DF86A5B7DD@xxxxxxxxxx> <20140602153124.GH30598@xxxxxxxxx> <538CB085.5000502@xxxxxxxxx> <20140602222954.GA29690@xxxxxxxxx> <538CFB83.20703@xxxxxxxxx> <20140602233212.GA2060@xxxxxxxxx>
On Mon, 2014-06-02 at 19:32 -0400, Theodore Ts'o wrote:

> Linux's time(2) can return (time_t) -1 and set errno to EFAULT, per
> the Posix specification:
> 
> SYSCALL_DEFINE1(time, time_t __user *, tloc)
> {
>       time_t i = get_seconds();
> 
>       if (tloc) {
>               if (put_user(i,tloc))
>                       return -EFAULT;
>       }
>       force_successful_syscall_return();
>       return i;
> }

get_seconds() returns an unsigned long so there's potential for overflow
here.

--
Roger



<Prev in Thread] Current Thread [Next in Thread>