Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp4038343imm; Mon, 18 Jun 2018 08:10:44 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJTs7W5DIvEHIsLo1gW3WBHDANLAGVpGfdotk6YQohPCiAOf0Pf5RlptCdUffg4MJjIJHsZ X-Received: by 2002:a62:a60e:: with SMTP id t14-v6mr13929705pfe.241.1529334644320; Mon, 18 Jun 2018 08:10:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529334644; cv=none; d=google.com; s=arc-20160816; b=WbTgrkFBmpmZudOJ9zZTDe6Jaw+YwWKQfEZ4uHkIOrdqTBf8lLqSE4mmjx6SpXO/rT OL1RcMZqjS3QfMUuPCXQ/daQfKV9CPxzMg5m87K9YO6yEyza4rm1WDr009MqOtVqU0jQ nsJsW+cy/v+P86NtHuOQGNhz06P/O5lySHOblzhlczX0YYHGSKbJdLTbHfgQs20cBLv+ +4SGlK91XOlIUOyZbTdiH9tB6ICJnNL4ccQ3Mduos2QBX3jlSNGBtTU/uoNMezmUWK94 HnDpR/vhGZQok1GNPRepkkpgGGSdlRMApVquRRBJN6f2g7pwUMCVitkQGKmmenza5Byu w5hQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=bSCADI/o8pXaiWMK0RfAvTgPGlFuZIfhfvdk2+vaBDA=; b=hpsA8MnUjqtGHurIXNp2T1ucnHzFAVuxKD0oLKzW+SIP+zm5YjynF/Q3d83XKeUnX1 5nX1XWcl5mQzAuWHO+E5C5ljeekZIIFPn2sp2a2COR6xqFQiEKoBKJOe6RJ1arBJIWgy t8pfhhY7e28twO3xm23ozcj4XKsef7akRvQBIMcckHhrEjrcEUk+sPV1HmQK7G/kRfap FiUaGY95IovA9fLfdHPK8j1Md8fnEy9ECXDd2QYManja/CcwhJWKAlLwdlem4iae6ddI WxCPUDDCwZtM66R8CgaGtxYosUGFuZ/YU+BMUFb/9hS36eR5ZplA41vuivJWcUARqJsE 4sAQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b2-v6si12267085pgt.611.2018.06.18.08.10.30; Mon, 18 Jun 2018 08:10:44 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935820AbeFRPJs (ORCPT + 99 others); Mon, 18 Jun 2018 11:09:48 -0400 Received: from mout.kundenserver.de ([212.227.126.133]:37515 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935783AbeFRPJp (ORCPT ); Mon, 18 Jun 2018 11:09:45 -0400 Received: from wuerfel.lan ([95.208.111.237]) by mrelayeu.kundenserver.de (mreue006 [212.227.15.129]) with ESMTPA (Nemesis) id 0MDr1W-1fR7t63QvW-00H8FZ; Mon, 18 Jun 2018 17:09:38 +0200 From: Arnd Bergmann To: Greg Kroah-Hartman , =?UTF-8?q?Arve=20Hj=C3=B8nnev=C3=A5g?= , Todd Kjos , Martijn Coenen Cc: y2038@lists.linaro.org, Riley Andrews , Arnd Bergmann , Nathan Chancellor , Alistair Strachan , devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Subject: [PATCH] staging: android/vsoc: stop using 'timespec' Date: Mon, 18 Jun 2018 17:09:09 +0200 Message-Id: <20180618150933.1130612-1-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 X-Provags-ID: V03:K1:epIpnDGNxThKxTKXqv+3YABcHqa2ID3BYxNR4H1TqAQBWT3HyHf ksfuZfrRMT4tn6rzVBThFkIrz1SgBudxm9ijg981BBC/mzxF1yeHyJ3mX5v2r1ilxG2Kdfb stJg38fGIre5CGF7eBon2YR1FarlKQEdsSCYX7Ovwcdq376IWbqfZzUCGxJobG+FTkS0coA H8DM9hZggTJ8frLKN/IEw== X-UI-Out-Filterresults: notjunk:1;V01:K0:Dd36o3RPJ0E=:OFY6/mpqescaHELkLLM3GL 4jjQ/eToHpCJ/2UWzCXuvPNiqBsRTeEoj5u6Yv0rx5OrI8gj3bAW97JZPwONJiyEJk36o17DV A3SV7GfGhKJ9PDUHPyHweXypx4vmpOBzp5p42JmJyuRiE6p+LBPtGxuTnmJAVE2+7LsFeNPED AQ6sFVwBvN4Svnbu31HUSvzvJO79k1sXtEslwuOtHOQ/poH0O0RJzcVGSC7WTSiXnyGu5cBFs vqd2MIDTsOnNVrN4D5vOIm5XTHJfQYGg+X3HWHYtFkVwv07/tobqlRzLfbGdDc/gNKBn014r3 w/GKWbffc0mFHm3YRqw0cOOLPpP4qBn3Q58yrv+wPb97QxmIEt/N5bM1dlo9fJ3XYDX6zIr4o kLk3Vl4YCdmzAAEYAmg8wh7Br7k1mR9uMVLPd+12gfXbRG4N+4KQpMnN5TcLskwo6CQ04TGcF 2bdt1vnd9wnxC5G5MPrJ7v4BlXTR0vSqhvyr/rqcbwk1++JDx7BdbODxk55t/2atwf+fT9ZA+ wdAD7FWODbt+5jDrB86JQqvWo2MIYGkBUEHhCE058/nbjh+BwfebQCXjltRpHAfCbGqWNmraP 2xbnTVMWTx0hWnGOl2k2zMDaQ1lInB0r4V9DW6hMJKsI3fjNbJC1I8T6tUnsi6bBjtHHao7t8 FlJrHq4RTqHjiF6mGOj17Bv/i+BBWWRaDmLLvYblduf55dAvdcCbQQsp6uVIM8ztXt2Y= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The timespec structure suffers from the y2038 overflow and should not be used. This changes handle_vsoc_cond_wait() to use ktime_t directly. Signed-off-by: Arnd Bergmann --- drivers/staging/android/vsoc.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/drivers/staging/android/vsoc.c b/drivers/staging/android/vsoc.c index 806beda1040b..22571abcaa4e 100644 --- a/drivers/staging/android/vsoc.c +++ b/drivers/staging/android/vsoc.c @@ -405,7 +405,7 @@ static int handle_vsoc_cond_wait(struct file *filp, struct vsoc_cond_wait *arg) int ret = 0; struct vsoc_device_region *region_p = vsoc_region_from_filep(filp); atomic_t *address = NULL; - struct timespec ts; + ktime_t wake_time; /* Ensure that the offset is aligned */ if (arg->offset & (sizeof(uint32_t) - 1)) @@ -433,14 +433,13 @@ static int handle_vsoc_cond_wait(struct file *filp, struct vsoc_cond_wait *arg) * We do things this way to flatten differences between 32 bit * and 64 bit timespecs. */ - ts.tv_sec = arg->wake_time_sec; - ts.tv_nsec = arg->wake_time_nsec; - - if (!timespec_valid(&ts)) + if (arg->wake_time_nsec >= NSEC_PER_SEC) return -EINVAL; + wake_time = ktime_set(arg->wake_time_sec, arg->wake_time_nsec); + hrtimer_init_on_stack(&to->timer, CLOCK_MONOTONIC, HRTIMER_MODE_ABS); - hrtimer_set_expires_range_ns(&to->timer, timespec_to_ktime(ts), + hrtimer_set_expires_range_ns(&to->timer, wake_time, current->timer_slack_ns); hrtimer_init_sleeper(to, current); -- 2.9.0