From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751660AbdH1PcL (ORCPT ); Mon, 28 Aug 2017 11:32:11 -0400 Received: from mx1.redhat.com ([209.132.183.28]:35888 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750866AbdH1PcJ (ORCPT ); Mon, 28 Aug 2017 11:32:09 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com DEDE66146A Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=esyr@redhat.com Date: Mon, 28 Aug 2017 17:32:43 +0200 From: Eugene Syromiatnikov To: Arnd Bergmann Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, y2038@lists.linaro.org, Mauro Carvalho Chehab , linux-api@vger.kernel.org, linux-samsung-soc@vger.kernel.org, ldv@altlinux.org, glebfm@altlinux.org Subject: Re: [3/7,media] dvb: don't use 'time_t' in event ioctl Message-ID: <20170828153243.GA27121@asgard.redhat.com> References: <1442332148-488079-4-git-send-email-arnd@arndb.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1442332148-488079-4-git-send-email-arnd@arndb.de> User-Agent: Mutt/1.5.23 (2014-03-12) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Mon, 28 Aug 2017 15:32:09 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Sep 15, 2015 at 05:49:04PM +0200, Arnd Bergmann wrote: > 'struct video_event' is used for the VIDEO_GET_EVENT ioctl, implemented > by drivers/media/pci/ivtv/ivtv-ioctl.c and > drivers/media/pci/ttpci/av7110_av.c. The structure contains a 'time_t', > which will be redefined in the future to be 64-bit wide, causing an > incompatible ABI change for this ioctl. > > As it turns out, neither of the drivers currently sets the timestamp > field, and it is presumably useless anyway because of the limited > resolutions (no sub-second times). This means we can simply change > the structure definition to use a 'long' instead of 'time_t' and > remain compatible with all existing user space binaries when time_t > gets changed. > > If anybody ever starts using this field, they have to make sure not > to use 1970 based seconds in there, as those overflow in 2038. > > Signed-off-by: Arnd Bergmann > --- > include/uapi/linux/dvb/video.h | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/include/uapi/linux/dvb/video.h b/include/uapi/linux/dvb/video.h > index d3d14a59d2d5..6c7f9298d7c2 100644 > --- a/include/uapi/linux/dvb/video.h > +++ b/include/uapi/linux/dvb/video.h > @@ -135,7 +135,8 @@ struct video_event { > #define VIDEO_EVENT_FRAME_RATE_CHANGED 2 > #define VIDEO_EVENT_DECODER_STOPPED 3 > #define VIDEO_EVENT_VSYNC 4 > - __kernel_time_t timestamp; > + /* unused, make sure to use atomic time for y2038 if it ever gets used */ > + long timestamp; This change breaks x32 ABI (and possibly MIPS n32 ABI), as __kernel_time_t there is 64 bit already: https://sourceforge.net/p/strace/mailman/message/36015326/ Note the change in structure size from 0x20 to 0x14 for VIDEO_GET_EVENT command in linux/x32/ioctls_inc0.h. > union { > video_size_t size; > unsigned int frame_rate; /* in frames per 1000sec */