From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754183AbbEMHz1 (ORCPT ); Wed, 13 May 2015 03:55:27 -0400 Received: from mout.kundenserver.de ([212.227.126.187]:60090 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753235AbbEMHzX (ORCPT ); Wed, 13 May 2015 03:55:23 -0400 From: Arnd Bergmann To: y2038@lists.linaro.org Cc: Baolin Wang , Thomas Gleixner , Xunlei Pang , linux-kernel@vger.kernel.org, John Stultz , Heena Sirwani Subject: Re: [Y2038] [PATCH v3 14/22] time:Introduce the do_sys_settimeofday64() function with timespec64 type Date: Wed, 13 May 2015 09:55:11 +0200 Message-ID: <12457722.qPr7nkVa6l@wuerfel> User-Agent: KMail/4.11.5 (Linux/3.16.0-10-generic; KDE/4.11.5; x86_64; ; ) In-Reply-To: References: <1431343162-29918-1-git-send-email-baolin.wang@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Provags-ID: V03:K0:wegCS3dPsoVAbWw9iKBiTuWJB0MoDTRUPAp64+MjReTUbxhkeQv f1joqoeaGVVW0WMfcHHMEIChueWWg7i5CnIrFShspGzpw4QMYz0/ER5uTTZFrERBCMVtjxP PTcC63ihuha8r6by8k6aGKAYeBBQTxmo1cO/iy5/xTzeSKMAS2EX4t9w02U+uikekH9W38Y UFYLpmQBFrH8UJl4O80qQ== X-UI-Out-Filterresults: notjunk:1; Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wednesday 13 May 2015 10:43:25 Baolin Wang wrote: > > > -int do_sys_settimeofday(const struct timespec *tv, const struct > > timezone *tz) > > > +int do_sys_settimeofday64(const struct timespec64 *tv, const struct > > timezone *tz) > > > { > > > static int firsttime = 1; > > > int error = 0; > > > + struct timespec ts; > > > > > > - if (tv && !timespec_valid(tv)) > > > + if (tv && !timespec64_valid(tv)) > > > return -EINVAL; > > > > > > - error = security_settime(tv, tz); > > > + ts = timespec64_to_timespec(*tv); > > > + error = security_settime(&ts, tz); > > > > How is that 2038 safe? Not at all. > > > > I told you before that we fix the underlying functions before we add > > such bogosities. > > > > > Thanks for your comments, and i'll continue to repair my patch. > But could you explain what the defects in do_sys_settimeofday64 > function? Thanks. What Thomas meant here is that you should first fix security_settime to take a timespec64 argument. I guess you could introduce a security_settime64() function first, using another inline wrapper to provide the existing security_settime() API. security_settime() does not actually use the time argument, so this is a fairly easy thing to do. Arnd