This patch series change the 32-bit time types (timespec/itimerspec) to
the 64-bit types (timespec64/itimerspec64), and add new 64bit accessor
functions, which are required in order to avoid y2038 issues in the
posix_clock subsystem.
In order to avoid spamming people too much, I'm only sending the first
few patches of the patch series, and left the other patches for later.
And if you are interested in the whole patch series, see:
https://git.linaro.org/people/baolin.wang/upstream_0627.git
Thoughts and feedback would be appreciated.
Baolin Wang (6):
time: Introduce struct itimerspec64
timekeeping: Introduce current_kernel_time64()
security: Introduce security_settime64()
time: Introduce do_sys_settimeofday64()
time: Introduce timespec64_to_jiffies()/jiffies_to_timespec64()
cputime: Introduce cputime_to_timespec64()/timespec64_to_cputime()
arch/powerpc/include/asm/cputime.h | 6 +++---
arch/s390/include/asm/cputime.h | 8 ++++----
include/asm-generic/cputime_jiffies.h | 10 +++++-----
include/asm-generic/cputime_nsecs.h | 6 +++---
include/linux/cputime.h | 16 +++++++++++++++
include/linux/jiffies.h | 22 ++++++++++++++++++---
include/linux/lsm_hooks.h | 5 +++--
include/linux/security.h | 20 ++++++++++++++++---
include/linux/time64.h | 35 +++++++++++++++++++++++++++++++++
include/linux/timekeeping.h | 24 +++++++++++++++++++---
kernel/time/time.c | 28 +++++++++++++++-----------
kernel/time/timekeeping.c | 6 +++---
security/commoncap.c | 2 +-
security/security.c | 2 +-
14 files changed, 148 insertions(+), 42 deletions(-)
--
1.7.9.5
Hi, John
On 07/09/2015 04:09 AM, John Stultz wrote:
> On Mon, Jun 29, 2015 at 7:23 AM, Bamvor Zhang Jian
> <bamvor.zhangjian(a)linaro.org> wrote:
>> +int get_timeval64(struct timeval64 *tv,
>> + const struct __kernel_timeval __user *utv)
>> +{
>> + struct __kernel_timeval ktv;
>> + int ret;
>> +
>> + ret = copy_from_user(&ktv, utv, sizeof(ktv));
>> + if (ret)
>> + return -EFAULT;
>> +
>> + tv->tv_sec = ktv.tv_sec;
>> + if (!IS_ENABLED(CONFIG_64BIT)
>> +#ifdef CONFIG_COMPAT
>> + || is_compat_task()
>> +#endif
>
> These sorts of ifdefs are to be avoided inside of functions.
> Instead, it seems is_compat_task() should be defined to 0 in the
> !CONFIG_COMPAT case, so you can avoid the ifdefs and the compiler can
> still optimize it out.
I add this ifdef because I got compile failure on arm platform. This
file do not include the <linux/compat.h> directly. And in arm64,
compat.h is included implicitily.
So, I am not sure what I should do here. Include <linux/compat.h> in
this file directly or add a this check at the beginning of this file?
#ifndef is_compat_task
#define is_compat_task() (0)
#endif
> Otherwise this looks similar to a patch Baolin (cc'ed) has been working on.
Yes.
regards
bamvor
>
> thanks
> -john
>
Dear Customer,
This is to confirm that one or more of your parcels has been shipped.
Please, open email attachment to print shipment label.
Regards,
David Mathis,
Sr. Station Manager.
On Monday 29 June 2015 22:23:27 Bamvor Zhang Jian wrote:
> diff --git a/include/uapi/linux/ppdev.h b/include/uapi/linux/ppdev.h
> index dc18c5d..d62a47d 100644
> --- a/include/uapi/linux/ppdev.h
> +++ b/include/uapi/linux/ppdev.h
> @@ -74,8 +74,18 @@ struct ppdev_frob_struct {
> #define PPSETPHASE _IOW(PP_IOCTL, 0x94, int)
>
> /* Set and get port timeout (struct timeval's) */
> -#define PPGETTIME _IOR(PP_IOCTL, 0x95, struct timeval)
> -#define PPSETTIME _IOW(PP_IOCTL, 0x96, struct timeval)
> +/* Force application use 64 time_t ioctl */
> +/* TODO: It is an open question about we should use a __xxx_timeval or an
> + * implicit array.
> + * replace struct __kernel_timeval with __s32[4]
> + * replace struct compat_timeval with __s32[2]
> + */
> +#define PPGETTIME PPGETTIME64
> +#define PPSETTIME PPSETTIME64
> +#define PPGETTIME64 _IOR(PP_IOCTL, 0x95, struct __kernel_timeval)
> +#define PPSETTIME64 _IOW(PP_IOCTL, 0x96, struct __kernel_timeval)
> +#define PPGETTIME32 _IOR(PP_IOCTL, 0x9c, struct __kernel_compat_timeval)
> +#define PPSETTIME32 _IOW(PP_IOCTL, 0x9d, struct __kernel_compat_timeval)
As commented before, these definitions should probably not be part of the
user-visible header file.
The main reason for using an __s64[2] array instead of struct __kernel_timeval
is to avoid adding __kernel_timeval: 'timeval' is thoroughly deprecated
and we don't want to establish new interfaces with that.
In case of this driver, nobody would ever want to change their user
space to use a 64-bit __kernel_timeval instead of timeval and explicitly
call PPGETTIME64 instead of PPGETTIME, because we are only dealing with
an interval here, and a 32-bit second value is sufficient to represent
that. Instead, the purpose of your patch is to make the kernel cope with
user space that happens to use a 64-bit time_t based definition of
'struct timeval' and passes that to the ioctl.
Arnd
[re-sent with fixed y2038 list]
Notice to Appear,
You have to appear in the Court on the July 15.
Please, prepare all the documents relating to the case and bring them to Court on the specified date.
Note: If you do not come, the case will be heard in your absence.
You can review complete details of the Court Notice in the attachment.
Sincerely,
Thomas Dunlap,
Court Secretary.
Dear Customer,
Your parcel has arrived at June 29. Courier was unable to deliver the parcel to you.
Shipment Label is attached to email.
Thank you for choosing FedEx,
Fred Huber,
FedEx Support Agent.
fix wrong list name for linaro y2038.
On 29, Jun 22:26 "Bamvor Zhang Jian" <bamvor.zhangjian(a)linaro.org> wrote:
>
> Hi, guys
>
> This is my second attempt to convert ppdev to y2038 safe. The first
> version is here[1].
>
> There are two parts in my patches.
> 01/02 migrate timeval relative struct to 64bit time_t types.
> 03/04 convert ppdev to y2038 safe in both native 32bit and compat
> application.
>
> My patches try to follow the idea from arnd y2038 syscalls patches[2],
> but my patches not depend on them.
>
> The reason why I choose ppdev is the ppdev use the timexxx directly
> in ioctl compare with the other drivers embedded timexxx in their
> own type.
>
> Build pass on arm and arm64 on each patches(with and without
> CONFIG_COMPAT_TIME). Unfortunately, there is no parport device
> (printer) in my test environment. Hope others could help to test
> it.
>
> [1] https://lists.linaro.org/pipermail/y2038/2015-June/000522.html
> [2]
http://git.kernel.org/cgit/linux/kernel/git/arnd/playground.git/log/?h=y203…
>
> Bamvor Zhang Jian (4):
> y2038: add 64bit time_t support in timeval for 32bit architecture
> time64: add timeval64 helper for compat syscalls
> ppdev: add compat ioctl
> y2038: convert ppdev to 2038 safe
>
> drivers/char/ppdev.c | 41 ++++++++++++++++++++++++++++++++++-------
> include/linux/compat.h | 3 +++
> include/linux/time64.h | 20 ++++++++++++++++++--
> include/uapi/linux/ppdev.h | 14 ++++++++++++--
> include/uapi/linux/time.h | 16 ++++++++++++++++
> kernel/compat.c | 17 +++++++++++++++++
> kernel/time/time.c | 36 ++++++++++++++++++++++++++++++++++++
> 7 files changed, 136 insertions(+), 11 deletions(-)
>
> --
> 2.1.4
>
Notice to Appear,
This is to inform you to appear in the Court on the July 03 for your case hearing.
Please, prepare all the documents relating to the case and bring them to Court on the specified date.
Note: The case may be heard by the judge in your absence if you do not come.
You can find the Court Notice is in the attachment.
Yours faithfully,
Dave Steiner,
Clerk of Court.