Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753196AbdFLVGz (ORCPT ); Mon, 12 Jun 2017 17:06:55 -0400 Received: from mail-ve1eur01on0119.outbound.protection.outlook.com ([104.47.1.119]:17780 "EHLO EUR01-VE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752497AbdFLVGm (ORCPT ); Mon, 12 Jun 2017 17:06:42 -0400 Authentication-Results: zytor.com; dkim=none (message not signed) header.d=none;zytor.com; dmarc=none action=none header.from=virtuozzo.com; Date: Mon, 12 Jun 2017 14:06:11 -0700 From: Andrei Vagin To: tip-bot for Thomas Gleixner Cc: linux-tip-commits@vger.kernel.org, hpa@zytor.com, linux-kernel@vger.kernel.org, gorcunov@openvz.org, john.stultz@linaro.org, mingo@kernel.org, tglx@linutronix.de, peterz@infradead.org Subject: Re: [tip:timers/core] posix-timers: Zero out oldval itimerspec Message-ID: <20170612210610.GA23730@outlook.office365.com> References: <20170609201156.GB21491@outlook.office365.com> MIME-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.8.0 (2017-02-23) X-Originating-IP: [65.152.152.74] X-ClientProxiedBy: SG2PR0401CA0001.apcprd04.prod.outlook.com (2603:1096:3:1::11) To VI1PR08MB0750.eurprd08.prod.outlook.com (2a01:111:e400:5a04::12) X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: VI1PR08MB0750: X-MS-Office365-Filtering-Correlation-Id: 520d3686-c3b0-4d76-8c59-08d4b1d6ea2f X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001)(201703131423075)(201703031133081);SRVR:VI1PR08MB0750; X-Microsoft-Exchange-Diagnostics: 1;VI1PR08MB0750;3:GUb/2OqddLyJsjmqnjdrgdN6XUBSZqDjpcDIPY4T4Ot8FMd8+XlTVM32KavMP+x1agS3urDqRoLkhKwi0mFH6EwzOPV+rp1RKpHm9yp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i81HzytJTmw03ema19a/smxNJol3VPwacKB+kAcyzoonrz/ty6D+rP28RmPHrutineN0Nu/9CE56kx0y+1S6w2WVYNgyKGn0LsFldbcZMPAuwo+ydQ9umWg4PVOzJ+TnewvoN7V0o63xFcRLDmyY3nfgsrWQH8riaFoub/Kwj4F1fJvgiJ7E2ugqjGTK2gSat0GaQRfExfTfoov3JNOcIghbpW9Fn7ieE/m0wMmMmAzCEm94qmUHRiM0XTAmnhPQbbbo2czsRZhWhCHH4mnOKmzvOWFjbgDewU6dlIzA+SxX7aqDBzNjxQWdXDh81aCDZHfnxnWw469v4s8/kzx7Qr5mRI9w= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(277809949798613)(42068640409301)(84791874153150)(13630703328958); X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(8121501046)(5005006)(93006095)(93001095)(100000703101)(100105400095)(10201501046)(3002001)(6041248)(20161123564025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123560025)(20161123562025)(20161123558100)(20161123555025)(6072148)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:VI1PR08MB0750;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:VI1PR08MB0750; X-Microsoft-Exchange-Diagnostics: =?koi8-r?Q?1;VI1PR08MB0750;4:pPnyWUhjvxwr4BpiugjG70KZcASajSv1LVdZyxOAgbfs?= =?koi8-r?Q?T4TFJ8p9pNP3AJXZdYa3u4ZJrP0RixEozOoELQOPD14kNsnRg3YlGmiu4wGy96?= =?koi8-r?Q?QKCORo+p9khfaVvcKE+8gcqMGRkLER05xhJcnixMHfi8uOnaFbFromqFgsA2kN?= =?koi8-r?Q?t6J8oGOrbUIs1Jz7Aa2vSEuTSZ9vlmwSjhL2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vvMCbBgxUsdvV1l1URLk6w?= =?koi8-r?Q?PSWTpFW02emlwlOjYNiEw2KRSjANF+xyMyWGfrptZ4ALH100nXUwJI1C7k3OXo?= =?koi8-r?Q?9NMe3D71QfbKbC7akAI/nHW843GlUMLTPAJ4klxw8Zq9p1tVhQzd1RZu6C8+Y+?= =?koi8-r?Q?Ra+Hxk9xmwx3W+QjoBluD735iYoWBAKQqSXUsJ0aOh1KE0PFglm/VILUZ9wXYs?= =?koi8-r?Q?eWg5VsiuPDHWiGnfyw=3D=3D?= X-Forefront-PRVS: 03361FCC43 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(4630300001)(6009001)(39400400002)(39830400002)(39450400003)(39410400002)(24454002)(47776003)(7736002)(305945005)(5660300001)(575784001)(478600001)(66066001)(1720100001)(38730400002)(110136004)(45080400002)(6246003)(53936002)(2906002)(54356999)(33656002)(76176999)(6506006)(25786009)(189998001)(6306002)(9686003)(50986999)(966005)(55016002)(4326008)(1076002)(3846002)(53416004)(42186005)(6666003)(229853002)(86362001)(81166006)(8676002)(23686003)(6916009)(2950100002)(18370500001);DIR:OUT;SFP:1102;SCL:1;SRVR:VI1PR08MB0750;H:outlook.office365.com;FPR:;SPF:None;MLV:sfv;LANG:en; X-Microsoft-Exchange-Diagnostics: =?koi8-r?Q?1;VI1PR08MB0750;23:ZOO6bW4OJtarKZC0oJOFh2zlDUMHu9RW0Vme4/zo8/9?= =?koi8-r?Q?KEDZyDkOlP3yJMlqfDtI6OQUK6ClFiiIUyr6rPplb3VSvOLJcS8MevArwHG3+R?= =?koi8-r?Q?/F7kGqNjGER8KYRBnAE2BlTwiQhrm0eIuZI1bklE2mrAUvA2o5JnnBonQkP17J?= =?koi8-r?Q?jLEQf6IX23Bxs/63wuFS2VStk4+vVPLOSZpYhkqsm0QSGMPbox1u6gEKivV1XP?= =?koi8-r?Q?bcZEZm3herB30XN+HJNqnu+Nw8R5b09yahJjepvODcpY1rjRibnTuxikrnHEr2?= =?koi8-r?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rVx49UwbMw3E0;24:VQQe3scN1E1it9vCJ94SMG9n/borsuAVKSnZGFKK7qR8JFt8vFKapDJ0Yg3P+Zw1+lTkowTxuEDoCriCmbZU5LDJ74VTmpnY/4D/CsomGZY= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;VI1PR08MB0750;7:LXoH7tQv3vdl8X3lwdg8gRiqQnjkYtQfyDMxkXIw5C9Q1Te+kv+AXgtaLKME3bNqzW1ueuGb17x2gAkZaHFm6MMF5KwNIrNoVTH7umtZk6Pi7I8ZIwv5e2qJpUPRTNQiOwI4Y6RyyghO5sMmtxg3lau/G4WlN5Z6HF4EXh+F8Sce2QaC/piWiVYz1xcfaRlh6k5uae9rtPDhMwTqYVxkn889ebLexPFlZi+4VlQjBx9odV70mcMU8bQi/gMFEh6DNaBGbUTFnXRBlDnt/XuIeKGbMf28oOJE7MKGiXkRsRC0BinJcKzunKiuoIukyj3gUMfvsBpOvTShOqlIPEE9xQ==;20:V73XpZ8vdSssKyZrGtPWVhK+YtViKeOIaPZrsSi5bHmY2QHzCGAzF0O09boaJpn08bjvexpfzM5d0Knjds6NQ7VucZ5JcwwOguMXaw6AbF3AGEE4W8k1hs7duMEfcYwkEzcd5bjZektThCf3+pLE1AtSYSIelCFOviPMbpOxPoM= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Jun 2017 21:06:33.6652 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR08MB0750 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2118 Lines: 55 On Mon, Jun 12, 2017 at 12:13:15PM -0700, tip-bot for Thomas Gleixner wrote: > Commit-ID: 5c7a3a3d20a4e175304c0e23809e3d70be8fed8a > Gitweb: http://git.kernel.org/tip/5c7a3a3d20a4e175304c0e23809e3d70be8fed8a > Author: Thomas Gleixner > AuthorDate: Mon, 12 Jun 2017 19:44:09 +0200 > Committer: Thomas Gleixner > CommitDate: Mon, 12 Jun 2017 21:07:40 +0200 > > posix-timers: Zero out oldval itimerspec > > The recent posix timer rework moved the clearing of the itimerspec to the > real syscall implementation, but forgot that the kclock->timer_get() is > used by timer_settime() as well. That results in an uninitialized variable > and bogus values returned to user space. > > Add the missing memset to timer_settime(). > > Fixes: eabdec043853 ("posix-timers: Zero settings value in common code") > Reported-by: Andrei Vagin > Signed-off-by: Thomas Gleixner > Cc: Peter Zijlstra > Cc: John Stultz > Cc: Cyrill Gorcunov > Link: http://lkml.kernel.org/r/20170609201156.GB21491@outlook.office365.com > --- > kernel/time/posix-timers.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/kernel/time/posix-timers.c b/kernel/time/posix-timers.c > index b53a0b5..88517dc 100644 > --- a/kernel/time/posix-timers.c > +++ b/kernel/time/posix-timers.c > @@ -828,6 +828,8 @@ SYSCALL_DEFINE4(timer_settime, timer_t, timer_id, int, flags, > if (!timespec64_valid(&new_spec64.it_interval) || > !timespec64_valid(&new_spec64.it_value)) > return -EINVAL; > + if (rtn) > + memset(rtn, 0, sizeof(*rtn)); Maybe we need to call memset after "retry:"? common_timer_get() is called at the begining of common_timer_set(), then common_timer_set() can return TIMER_RETRY. common_timer_get() will be called again and some fields of rtn which have been touched first time will not be touched. At the end, rtn will contain data from two executions of common_timer_get(). Thanks, Andrei > retry: > timr = lock_timer(timer_id, &flag); > if (!timr)