Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp2524474ybi; Mon, 17 Jun 2019 06:22:05 -0700 (PDT) X-Google-Smtp-Source: APXvYqzohaOgg7RndS6IncOpO1uSW3hMwS3ErVre23LoWdPPU8PhbiQVM2C5WWPdgWxY/LsAvcCA X-Received: by 2002:a17:902:27a8:: with SMTP id d37mr108434497plb.150.1560777724939; Mon, 17 Jun 2019 06:22:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560777724; cv=none; d=google.com; s=arc-20160816; b=q9KIVDTD7xcABSHco1iQMzjmWPFKgYbM1o9l/7FEhSoHeV4ZqrEUp3+Tugg+NdDc6r okhNqBq80EMrhhslEaQ7Aopzu2OBynU9Zj14M4aj47w81tr/6sKa0OID94wbSdsaHhcN aAw1Jr7s0fc1LD0G+CwaJEsI33PZGu9ivhfWsJLej0aQDTX4SVnMtwYr5LARCx80h9I/ VPbozzjDTyFBAUdU9W+zVT33Yq+0DONQ4LsA0DI8vgWo5qR57AjubQRo8PYI3bJzwLFm 7yoN7fHXMAKHKjeKo0Ykxml9ZNSP6uqfTaeQ8rY5Vtgql7WspeV0k19jfwszqkuSJbU5 kh6Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=r8ME177Rh0DKvjVW6jR9L7bsKG65bPaRHD41oBgQbM0=; b=05dACQ5wkvrD0TJjinLVl7he/aV+QJ8RBgV900GgzFYdaYkPVhja65bni+FLKgisBf Yok/MVxiGdh6dIqKwkapuhAFRC3RjMG17oOVuVk4jUL1AXgh6nmqo11zkmnwU0sCTj1W ze2TI9U6/utDLqZhpqLi596br9jVPVpT2IV3co/rswWLnQBN1QnaI9JJOj+UFcJw+9Ec fvJl3CNIyAhADRlFKJvfqhydx3ZN5ShA/j3LPpM2T2lroN8NA2LaDB/q9qsRXdWx4MHM Djqici01dXY5iG8/Qmc0CicyDOf1xPjc+ObkRBR0uhu93oczkPAzRqaCGtyNKUKrFtXy 1ZMw== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x4si10231190pgr.249.2019.06.17.06.21.48; Mon, 17 Jun 2019 06:22:04 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726759AbfFQNVg (ORCPT + 99 others); Mon, 17 Jun 2019 09:21:36 -0400 Received: from mx1.redhat.com ([209.132.183.28]:53234 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725906AbfFQNVg (ORCPT ); Mon, 17 Jun 2019 09:21:36 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 3ED1A3004582; Mon, 17 Jun 2019 13:21:36 +0000 (UTC) Received: from localhost (holly.tpb.lab.eng.brq.redhat.com [10.43.134.11]) by smtp.corp.redhat.com (Postfix) with ESMTPS id EE7CB7EA20; Mon, 17 Jun 2019 13:21:34 +0000 (UTC) Date: Mon, 17 Jun 2019 15:21:33 +0200 From: Miroslav Lichvar To: Thomas Gleixner Cc: =?utf-8?B?57u05bq355+z?= , John Stultz , sboyd@kernel.org, LKML , swkhack@qq.com Subject: Re: [PATCH] time: fix a assignment error in ntp module Message-ID: <20190617132133.GA7851@localhost> References: <20190422093421.47896-1-swkhack@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.11.3 (2019-02-01) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.44]); Mon, 17 Jun 2019 13:21:36 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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? 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. -- Miroslav Lichvar