Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp2637153ybi; Mon, 17 Jun 2019 08:07:11 -0700 (PDT) X-Google-Smtp-Source: APXvYqxLFjpeJ+k3c7Dai8dif9JaNenGREhrTeGUG51P06vgphGQphq4bR4JTIbdmW+1EYJ97MZ5 X-Received: by 2002:a17:902:d897:: with SMTP id b23mr18998353plz.214.1560784031569; Mon, 17 Jun 2019 08:07:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560784031; cv=none; d=google.com; s=arc-20160816; b=RJaHSnukW7gxzS+ee0/pbziA7QwrD4hXUpnymL7rv6dp629R0EtIvBVyr2cr+BbfUf R0/QCnOxOkfjgR0RWlTiAbDqnZUf7zOL2tQf8GjuHZeE730Y3q9Bc+SSGbZBFVK8N46t Yfm7gg8sH833i7Kl034j2f+VvItERfy2847kkbkKf+waWwtiRiyRPMZJ14zgC8/QiLqH gn6dkdluGANA5ihSruxxIc1/5TpMl4vVtq8jiv4TvRLx8Da/lDih4IZaVmRBmbod9upB 2lWbCBtxPOVCj+tIBo6gAY17M5zuOQpazOAexueRPfodf7XLw891ItJBQmIjM5NB+fMb 7ueg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date; bh=macetpnY2x9eSgADR8hZrezlPOQ3PgOiXLBNj3YZ30Y=; b=ZmfRwwaIL5VXka3CVo+xWphOM/u80JB/p53Ou5Yh5uvdx4t6lmFVyNCaoXUs1kwy55 bxoO/0n+ifg57cTNwc88V9k+Td/TxKLUuNzEHZ3iu/5PzpU/ilHKbqtM8GA5YM2cDwNQ w/TpMQvmYSUfrb+j4Fmq9DyEu9UynrQDG+x84rcVaL1K7SS/01ljrpBRABYFxRrl/HVo +X1zFfC6LsOQKjJpMIhKyjIkQuzc43hZRmOG30fzSSdrpvUpbtuKcSlI6RNMOfjCMoe5 RL8ctznHf9uCCFPczSxwoFExQP9qOBS5i167PkwiLp15+GIC4v19MiGs+MHqkcSXzgeX 8g5A== 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 s19si7280391pga.534.2019.06.17.08.06.54; Mon, 17 Jun 2019 08:07:11 -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 S1728281AbfFQPGo (ORCPT + 99 others); Mon, 17 Jun 2019 11:06:44 -0400 Received: from Galois.linutronix.de ([146.0.238.70]:44387 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727121AbfFQPGn (ORCPT ); Mon, 17 Jun 2019 11:06:43 -0400 Received: from [5.158.153.52] (helo=nanos.tec.linutronix.de) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1hctDP-0004mS-V4; Mon, 17 Jun 2019 17:06:36 +0200 Date: Mon, 17 Jun 2019 17:06:35 +0200 (CEST) From: Thomas Gleixner To: Miroslav Lichvar cc: =?GB2312?B?zqy/tcqv?= , John Stultz , sboyd@kernel.org, LKML , swkhack@qq.com Subject: Re: [PATCH] time: fix a assignment error in ntp module In-Reply-To: <20190617132133.GA7851@localhost> Message-ID: References: <20190422093421.47896-1-swkhack@gmail.com> <20190617132133.GA7851@localhost> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="8323329-54536811-1560783995=:1854" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --8323329-54536811-1560783995=:1854 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8BIT Miroslav, On Mon, 17 Jun 2019, Miroslav Lichvar wrote: > On Mon, Jun 17, 2019 at 02:14:57PM +0200, Thomas Gleixner wrote: > > On Mon, 17 Jun 2019, 维康石 wrote: > > > Yes,the >UINT_MAX value can be passed by > > > syscall adjtimex->do_adjtimex->__do_adjtimex->process_adjtimex_modes by the > > > proper arugments. > > > > So there is clearly some sanity check missing, but surely not that > > type cast. > > As the offset is saved in an int (and returned via adjtimex() in the > tai field), should be the maximum INT_MAX? Right. > We probably also want to avoid overflow in the offset on a leap second > and the CLOCK_TAI clock itself, so maybe it would make sense to > specify a much smaller maximum like 1000000? > > Even 1000 should be good enough for near future. Negative values are > not allowed anyway. If the Earth's rotation changed significantly > (e.g. hitting a very large asteroid), there probably wouldn't be > anyone left to care about TAI. Hehehe. I leave it to you to find a sane limit taking all the possible events into account :) Thanks, tglx --8323329-54536811-1560783995=:1854--