From patchwork Wed May 20 17:19:30 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Stultz X-Patchwork-Id: 48811 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f198.google.com (mail-wi0-f198.google.com [209.85.212.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 77E2F21411 for ; Wed, 20 May 2015 17:19:55 +0000 (UTC) Received: by wivs14 with SMTP id s14sf22890659wiv.1 for ; Wed, 20 May 2015 10:19:53 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=uImvT6pyxaEzpSLFr5R/s7WlQnHtYuRysD2QTCJQwto=; b=BIlK0fizq0MTgicD4sEePSYrLQE1g30beYvqnCdx9LDkjljP/R8a5yxw0iGpr3oym4 HTqLBS51/QKwi6KeDtnaHGOvIsW+JHv7TbbCu//Vmgg9FCB5DaeqmOix0keQOr8/yOPN EwzYTCgYKXofXo3giF4I5mPJGgNH6WGe1zNuPK2sT7Ibxlj1bzaHz5SQOF+GllHb+CFl f96YDFXKzVDgM0ncRbUNokRbkg8TnTgcKN4JmpjDituQkpZgYLVsR08kN+gb9GgMsU2P h+atL6pwzmVh1L0Z7qru8c32wQS6t5EK07YnQwfS0hKxa+77UMpZdZq1m3N0VLvsXahr KEbA== X-Gm-Message-State: ALoCoQl5sBcibByUwvytnOwd1IICA0sPwExeb67O2YuqWCxxD/FHvFPJCNr8GSdaaN2esl8TvgLi X-Received: by 10.112.166.137 with SMTP id zg9mr27313000lbb.11.1432142393544; Wed, 20 May 2015 10:19:53 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.26.7 with SMTP id h7ls219945lag.46.gmail; Wed, 20 May 2015 10:19:53 -0700 (PDT) X-Received: by 10.112.50.236 with SMTP id f12mr6078061lbo.89.1432142393360; Wed, 20 May 2015 10:19:53 -0700 (PDT) Received: from mail-la0-f43.google.com (mail-la0-f43.google.com. [209.85.215.43]) by mx.google.com with ESMTPS id rh10si11537160lbb.105.2015.05.20.10.19.52 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 20 May 2015 10:19:52 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.43 as permitted sender) client-ip=209.85.215.43; Received: by laat2 with SMTP id t2so83847599laa.1 for ; Wed, 20 May 2015 10:19:52 -0700 (PDT) X-Received: by 10.112.13.6 with SMTP id d6mr26270983lbc.117.1432142392842; Wed, 20 May 2015 10:19:52 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.112.108.230 with SMTP id hn6csp1678476lbb; Wed, 20 May 2015 10:19:51 -0700 (PDT) X-Received: by 10.66.230.168 with SMTP id sz8mr67099293pac.4.1432142391044; Wed, 20 May 2015 10:19:51 -0700 (PDT) Received: from mail-pa0-f44.google.com (mail-pa0-f44.google.com. [209.85.220.44]) by mx.google.com with ESMTPS id rp10si15053547pab.202.2015.05.20.10.19.50 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 20 May 2015 10:19:51 -0700 (PDT) Received-SPF: pass (google.com: domain of john.stultz@linaro.org designates 209.85.220.44 as permitted sender) client-ip=209.85.220.44; Received: by padbw4 with SMTP id bw4so74074861pad.0 for ; Wed, 20 May 2015 10:19:50 -0700 (PDT) X-Received: by 10.66.63.9 with SMTP id c9mr65137797pas.40.1432142390045; Wed, 20 May 2015 10:19:50 -0700 (PDT) Received: from localhost.localdomain (c-67-170-153-23.hsd1.or.comcast.net. [67.170.153.23]) by mx.google.com with ESMTPSA id fp3sm16745952pdb.52.2015.05.20.10.19.47 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 20 May 2015 10:19:49 -0700 (PDT) From: John Stultz To: LKML Cc: Sasha Levin , Thomas Gleixner , Ingo Molnar , John Stultz Subject: [PATCH 1/7] time: make sure tz_minuteswest is set to a valid value when setting time Date: Wed, 20 May 2015 10:19:30 -0700 Message-Id: <1432142376-2077-2-git-send-email-john.stultz@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1432142376-2077-1-git-send-email-john.stultz@linaro.org> References: <1432142376-2077-1-git-send-email-john.stultz@linaro.org> X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: john.stultz@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.43 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , From: Sasha Levin Invalid values may overflow later, leading to undefined behaviour when multiplied by 60 to get the amount of seconds. Cc: Thomas Gleixner Cc: Ingo Molnar Signed-off-by: Sasha Levin Signed-off-by: John Stultz --- kernel/time/time.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/kernel/time/time.c b/kernel/time/time.c index c42c2c3..972e3bb 100644 --- a/kernel/time/time.c +++ b/kernel/time/time.c @@ -173,6 +173,10 @@ int do_sys_settimeofday(const struct timespec *tv, const struct timezone *tz) return error; if (tz) { + /* Verify we're witin the +-15 hrs range */ + if (tz->tz_minuteswest > 15*60 || tz->tz_minuteswest < -15*60) + return -EINVAL; + sys_tz = *tz; update_vsyscall_tz(); if (firsttime) {