From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754711AbbEPH3B (ORCPT ); Sat, 16 May 2015 03:29:01 -0400 Received: from mout.kundenserver.de ([212.227.17.13]:56073 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752705AbbEPH24 (ORCPT ); Sat, 16 May 2015 03:28:56 -0400 From: Arnd Bergmann To: Thomas Gleixner Cc: y2038@lists.linaro.org, baolin.wang@linaro.org, albert.aribaud@3adev.fr, john.stultz@linaro.org, bamvor.zhangjian@linaro.org, ruchandani.tina@gmail.com, linux-api@vger.kernel.org, linux-kernel@vger.kernel.org, libc-alpha@sourceware.org Subject: Re: [PATCH 13/19] y2038: add compat handling for sys_semtimedop Date: Sat, 16 May 2015 09:28:49 +0200 Message-ID: <2124771.PTAe8S6R1g@wuerfel> User-Agent: KMail/4.11.5 (Linux/3.16.0-10-generic; KDE/4.11.5; x86_64; ; ) In-Reply-To: References: <1430929826-318934-1-git-send-email-arnd@arndb.de> <1430929826-318934-14-git-send-email-arnd@arndb.de> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Provags-ID: V03:K0:x1AKFbWqmrE9/hvptgfimxw220cbGVOgBg1W+W2UOV8Pzq4YDUv 4/68okLOB+Q07+W1/u84JNyOPV+Us8w+o/1y6ofY68ODqr17t5dU5udpJU8N0gZjWcgiYOC 5tW5ngYO3bf1olDkvrUvx9fPt/gxfEug+MLLiEwSVA9GkxgPV+QkNAEmEdHGvLYvlQCJ7un p+c4+KQ9AeMpDSLrOWF7w== X-UI-Out-Filterresults: notjunk:1; Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Saturday 16 May 2015 00:46:44 Thomas Gleixner wrote: > On Wed, 6 May 2015, Arnd Bergmann wrote: > > +SYSCALL_DEFINE4(semtimedop, int, semid, struct sembuf __user *, tsops, > > + unsigned, nsops, > > + const struct __kernel_timespec __user *, timeout) > > +{ > > + unsigned long jiffies_left = 0; > > + > > + if (timeout) { > > + struct timespec64 _timeout; > > + if (get_timespec64(&_timeout, timeout)) > > Moo. I had to look 3 times to get not confused by the extra > underscore. What's wrong with a proper variable name which is easy to > distinguish? > > > + return -EFAULT; > > > + if (_timeout.tv_sec < 0 || _timeout.tv_nsec < 0 || > > + _timeout.tv_nsec >= 1000000000L) > > + return -EINVAL; > > We have proper helper functions to validate time specs. I tried to change the existing code as little as possible, but I agree with your points here. I'll add a cleanup patch to fix the current code before my own patches. Arnd