Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932572AbaFCNJt (ORCPT ); Tue, 3 Jun 2014 09:09:49 -0400 Received: from b.mx.filmlight.ltd.uk ([77.107.81.251]:15105 "HELO b.mx.filmlight.ltd.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S932530AbaFCNJq (ORCPT ); Tue, 3 Jun 2014 09:09:46 -0400 Subject: Re: [RFC 11/32] xfs: convert to struct inode_time From: Roger Willcocks To: "Theodore Ts'o" Cc: "H. Peter Anvin" , Nicolas Pitre , linux-arch@vger.kernel.org, Linux NFS Mailing List , Arnd Bergmann , LKML Kernel , xfs@oss.sgi.com, Christoph Hellwig , Chuck Lever , john.stultz@linaro.org, lftan@altera.com, linux-fsdevel , geert@linux-m68k.org, tglx@linutronix.de, joseph@codesourcery.com In-Reply-To: <20140602233212.GA2060@thunk.org> References: <1401480116-1973111-1-git-send-email-arnd@arndb.de> <8618458.1EVJCoVbkH@wuerfel> <4178301.j9kWdGCRLC@wuerfel> <6868F108-F0B2-423F-AE31-90DF86A5B7DD@oracle.com> <20140602153124.GH30598@thunk.org> <538CB085.5000502@zytor.com> <20140602222954.GA29690@thunk.org> <538CFB83.20703@zytor.com> <20140602233212.GA2060@thunk.org> Content-Type: text/plain Date: Tue, 03 Jun 2014 14:09:43 +0100 Message-Id: <1401800983.6065.272.camel@montana.filmlight.ltd.uk> Mime-Version: 1.0 X-Mailer: Evolution 2.12.3 (2.12.3-19.el5) Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/