From patchwork Mon Jul 16 16:10:52 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 142051 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp2604443ljj; Mon, 16 Jul 2018 09:12:24 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcrxHTx4FjXgdvCgEWiF6wwsJN1/6Bp+7z6PlWp8EOb36W2xEDn96rZHE28WRoQFVxoTETo X-Received: by 2002:a62:5543:: with SMTP id j64-v6mr2425388pfb.188.1531757543919; Mon, 16 Jul 2018 09:12:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531757543; cv=none; d=google.com; s=arc-20160816; b=sfm/sHCSnrT19jtBz1s0C2t5pzlcwdLlZFX+oafH/H4NkYBxGQ3ZKZhdLqrxrURqVi hkIqVNR8ZJAkqagB5PUzL8h5gEp93sfCpuP1BzcIyx6ahSC719S+D17h4Bg0r7sk5JOV XG0m96UqEQxb0AX1zCN7ri18azoCaFcHbiSn1mLWoNfIu70Vcc3i3Ml4yxbmm3WoNqz+ 9BM2/G+U3UdfjNR+T+tbyfLg7qM80z2+ougRjF3qWXQSS/hYMrRfWSLdUoVEGJlHAeKD qS2xldONn5t/Zc/TKWDgTcfWNAnzoxoZYJHCSa4OcvtDIQwA+9x97iF3A4d486iaspDU JkFA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :delivered-to:sender:list-help:list-post:list-archive:list-subscribe :list-unsubscribe:list-id:precedence:mailing-list:dkim-signature :domainkey-signature:arc-authentication-results; bh=E3B3WelTDoojsEBvno9+IV6zY7CxGv/JQVJE2ATeGj0=; b=k94hGjgr3glqpBRRSmcODOKZz8Dw68QjgKDGyeh5PTXFextJxRMvNjMCVac6OH99SE WATA1607m091lzyXP97Nde3zY9fgYcVkzpoTYi6GMKnMKw5Y15aWJ0L8C7JDFuYb761/ xfDfu5XdtteYsu04qIEdCplPQd4O4J/oVeR3559HHfWJ089p0qOfu4k0ANfjw1GHj5oC I83d8vi7tCMVMVW/hQjZCUWD0Z2k/E1zXj2J/UgfQyBrm68zANK3gPlmyUB4LPAZcElM HtM8DbGEfiiYCKSBYYEiBXYAeAX4/HAQlZG4Nc79qAtNMxpxS+UFtu+P/z9MkpU3YiOu 2tNw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=lywZqynr; spf=pass (google.com: domain of libc-alpha-return-94325-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="libc-alpha-return-94325-patch=linaro.org@sourceware.org" Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id c31-v6si26826127pgl.126.2018.07.16.09.12.23 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 16 Jul 2018 09:12:23 -0700 (PDT) Received-SPF: pass (google.com: domain of libc-alpha-return-94325-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=lywZqynr; spf=pass (google.com: domain of libc-alpha-return-94325-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="libc-alpha-return-94325-patch=linaro.org@sourceware.org" DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id:in-reply-to :references; q=dns; s=default; b=eehDfIrWJKdv41bsbGxnQd//fh5cns3 lbq8McpLJ3uw0E0KDvw82hDaZ2vofrf+Rf2n3mTjMxfwiyE3LQUwNriRAoYUXJU3 9CfW4vidWmVII/rHt/4cb6rX6g2B9qU8e94AhbQVV7C5xOcljLkb63qzrO+iPO6z bspLDeCpNHG0= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id:in-reply-to :references; s=default; bh=X1P7zjIH1aKQrHrgzkXh77Sz0zI=; b=lywZq ynrwVWljFlpYtQdBCZVIvaz/MMGhdCA3z+taYDQjSoK6LoobwVetK67RXiJ1Ysqw MLwecK+k1kz/IlCYiIuBqEFMCYQdJ1O1stPXRO4ec6q9dYY6lIxzY/utVpi0B5dk F+oQvja8pV3yQdIZXMViai3tDhWSjV9UuFc9VI= Received: (qmail 21716 invoked by alias); 16 Jul 2018 16:12:04 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 21671 invoked by uid 89); 16 Jul 2018 16:12:03 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-25.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_LAZY_DOMAIN_SECURITY, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 spammy=H*Ad:U*viro, Hx-spam-relays-external:ESMTPA X-HELO: mout.kundenserver.de From: Arnd Bergmann To: tglx@linutronix.de Cc: y2038@lists.linaro.org, hch@infradead.org, linux-api@vger.kernel.org, linux-arch@vger.kernel.org, libc-alpha@sourceware.org, albert.aribaud@3adev.fr, netdev@vger.kernel.org, viro@zeniv.linux.org.uk, peterz@infradead.org, dvhart@infradead.org, ebiederm@xmission.com, linux@dominikbrodowski.net, Arnd Bergmann Subject: [PATCH v2 06/17] y2038: Change sys_utimensat() to use __kernel_timespec Date: Mon, 16 Jul 2018 18:10:52 +0200 Message-Id: <20180716161103.16239-7-arnd@arndb.de> In-Reply-To: <20180716161103.16239-1-arnd@arndb.de> References: <20180716161103.16239-1-arnd@arndb.de> When 32-bit architectures get changed to support 64-bit time_t, utimensat() needs to use the new __kernel_timespec structure as its argument. The older utime(), utimes() and futimesat() system calls don't need a corresponding change as they are no longer used on C libraries that have 64-bit time support. As we do for the other syscalls that have timespec arguments, we reuse the 'compat' syscall entry points to implement the traditional four interfaces, and only leave the new utimensat() as a native handler, so that the same code gets used on both 32-bit and 64-bit kernels on each syscall. Signed-off-by: Arnd Bergmann --- fs/utimes.c | 2 +- include/linux/syscalls.h | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) -- 2.9.0 diff --git a/fs/utimes.c b/fs/utimes.c index 69d4b6ba1bfb..ca2c02a7985c 100644 --- a/fs/utimes.c +++ b/fs/utimes.c @@ -166,7 +166,7 @@ long do_utimes(int dfd, const char __user *filename, struct timespec64 *times, } SYSCALL_DEFINE4(utimensat, int, dfd, const char __user *, filename, - struct timespec __user *, utimes, int, flags) + struct __kernel_timespec __user *, utimes, int, flags) { struct timespec64 tstimes[2]; diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h index 615cc9b374cf..45c04d75eb95 100644 --- a/include/linux/syscalls.h +++ b/include/linux/syscalls.h @@ -513,7 +513,8 @@ asmlinkage long sys_timerfd_gettime(int ufd, struct __kernel_itimerspec __user * /* fs/utimes.c */ asmlinkage long sys_utimensat(int dfd, const char __user *filename, - struct timespec __user *utimes, int flags); + struct __kernel_timespec __user *utimes, + int flags); /* kernel/acct.c */ asmlinkage long sys_acct(const char __user *name); From patchwork Mon Jul 16 16:10:57 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 142057 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp2604729ljj; Mon, 16 Jul 2018 09:12:41 -0700 (PDT) X-Google-Smtp-Source: AAOMgpc9Vh2XdAGGsUxj1j29AI7xp3PWzqriVKAiWh8m8V2dVZ1E4e0wCLE/rEtFMZUnaJp/2KD7 X-Received: by 2002:a63:40c7:: with SMTP id n190-v6mr16077575pga.116.1531757561416; Mon, 16 Jul 2018 09:12:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531757561; cv=none; d=google.com; s=arc-20160816; b=vsMC8g5u8UW7NknCOYh1oRsIP+rzJ67KTYIKqiyYwRIGZGgprjr12ItW5AFBiRvYvh A8+ytI48rrk4MEbBE27aHC5KnGG0uN4nFE47FvH0ggAj1XNv9kGo6zni9OcvYnrkejT5 urejngWd9U3MeO38Isf9/bN89AnMNkRoCdeXmjJfb+8YZxcnF7TmCdpva6fFaJRstS6O ohyTyj6S/ghG2ViQJxbElpH5/lZqkioMsA+9ySu3Hqii2OPXgYnbzCbEaEjWLG5Ipvvp 7pNXlt98G8VtP1cHDeTwNq13/1NGvPwT+Kth2Brx6f3bEBnDUhFD5YhuIU3qr7epeMu1 vEgg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :delivered-to:sender:list-help:list-post:list-archive:list-subscribe :list-unsubscribe:list-id:precedence:mailing-list:dkim-signature :domainkey-signature:arc-authentication-results; bh=qxEGeHx+AWUQjYCj+De/habDm3mr+QeBxPP5COM/2Yk=; b=kTEDA/15DaLiRc6rE6sPvUbl6KYCH5MmIXUpj6E8ABvQgA9P9/Ow6O2UAa+M1fj7he LW8jVNmXoDPxSaSc8Xui6oHUJK9IT20ISauJqW+u3xGowL+un40/q8QOvvhzDraWtYVs BmBQRNCRYfwOgL7oCf53dazb980fWRsrKmeCbiXuC8fgfMqmkak3JWie8I69ND/K9WBq 2uBEpvUMj4Rw37/ne/L9UM0z7BiGSk9pZUgL7BJpvHgRPG2trB4WFf7WbQs5cOmMKq+f zeg/Cs0fXR03iEDOuJHjdxmP7xXDOckfsfY8RmyDRtd4GSeoLlzyHzN3TylNjmqtuIyG mStQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=gNRpVh62; spf=pass (google.com: domain of libc-alpha-return-94327-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="libc-alpha-return-94327-patch=linaro.org@sourceware.org" Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id h18-v6si30691438pfn.158.2018.07.16.09.12.41 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 16 Jul 2018 09:12:41 -0700 (PDT) Received-SPF: pass (google.com: domain of libc-alpha-return-94327-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=gNRpVh62; spf=pass (google.com: domain of libc-alpha-return-94327-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="libc-alpha-return-94327-patch=linaro.org@sourceware.org" DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id:in-reply-to :references; q=dns; s=default; b=YxXULNulF9NwWu0L8OOvVtDkHswBiCW mQHln7tIyTflgJ11C+w0YTW414hNMJ5qxJ5Id2nEEenPESAoeRs8yNdVSABn8c20 qcvulS9S1ldvIqLyquQq/xdQ3NHsECdzL5/qJePY7hSgPUmatNhyq8H0cRgUa2wk RrhbVlzIanjU= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id:in-reply-to :references; s=default; bh=6THWs4Xe5nVYpWxofrGo3OcNDXc=; b=gNRpV h62jUmDXsG7YlHCrjCgyinEWA0dC4g5glvumDgoGbtOaG9Aoc8fur4G7BUBl2J8w b0ErM2C2raXETowMhgJdlLINBAxp5EwtbzCE5Ol0/V+IATeojqhb1rbi+fnFGGqI BiLTx1/LIsXBKLGPVs30imSauqAA/j2wVC34fc= Received: (qmail 22095 invoked by alias); 16 Jul 2018 16:12:06 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 21913 invoked by uid 89); 16 Jul 2018 16:12:05 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-25.9 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_LAZY_DOMAIN_SECURITY, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 spammy= X-HELO: mout.kundenserver.de From: Arnd Bergmann To: tglx@linutronix.de Cc: y2038@lists.linaro.org, hch@infradead.org, linux-api@vger.kernel.org, linux-arch@vger.kernel.org, libc-alpha@sourceware.org, albert.aribaud@3adev.fr, netdev@vger.kernel.org, viro@zeniv.linux.org.uk, peterz@infradead.org, dvhart@infradead.org, ebiederm@xmission.com, linux@dominikbrodowski.net, Arnd Bergmann Subject: [PATCH v2 11/17] y2038: Prepare sched_rr_get_interval for __kernel_timespec Date: Mon, 16 Jul 2018 18:10:57 +0200 Message-Id: <20180716161103.16239-12-arnd@arndb.de> In-Reply-To: <20180716161103.16239-1-arnd@arndb.de> References: <20180716161103.16239-1-arnd@arndb.de> This is a preparation patch for converting sys_sched_rr_get_interval to work with 64-bit time_t on 32-bit architectures. The 'interval' argument is changed to struct __kernel_timespec, which will be redefined using 64-bit time_t in the future. The compat version of the system call in turn is enabled for compilation with CONFIG_COMPAT_32BIT_TIME so the individual 32-bit architectures can share the handling of the traditional argument with 64-bit architectures providing it for their compat mode. Signed-off-by: Arnd Bergmann --- include/linux/syscalls.h | 2 +- kernel/sched/core.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) -- 2.9.0 diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h index fc98024d3b5e..1a22bb4285bf 100644 --- a/include/linux/syscalls.h +++ b/include/linux/syscalls.h @@ -614,7 +614,7 @@ asmlinkage long sys_sched_yield(void); asmlinkage long sys_sched_get_priority_max(int policy); asmlinkage long sys_sched_get_priority_min(int policy); asmlinkage long sys_sched_rr_get_interval(pid_t pid, - struct timespec __user *interval); + struct __kernel_timespec __user *interval); /* kernel/signal.c */ asmlinkage long sys_restart_syscall(void); diff --git a/kernel/sched/core.c b/kernel/sched/core.c index 5d12eab09429..2deb11269fcb 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -5265,7 +5265,7 @@ static int sched_rr_get_interval(pid_t pid, struct timespec64 *t) * an error code. */ SYSCALL_DEFINE2(sched_rr_get_interval, pid_t, pid, - struct timespec __user *, interval) + struct __kernel_timespec __user *, interval) { struct timespec64 t; int retval = sched_rr_get_interval(pid, &t); @@ -5276,7 +5276,7 @@ SYSCALL_DEFINE2(sched_rr_get_interval, pid_t, pid, return retval; } -#ifdef CONFIG_COMPAT +#ifdef CONFIG_COMPAT_32BIT_TIME COMPAT_SYSCALL_DEFINE2(sched_rr_get_interval, compat_pid_t, pid, struct compat_timespec __user *, interval)