Received: by 2002:ab2:6816:0:b0:1f9:5764:f03e with SMTP id t22csp616078lqo; Thu, 16 May 2024 16:55:41 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCW5E5lLS9VgE8U5t9pjmdQLGAHPzQY3CcGVt5Y0cx84fRl8Czn1ZJvZuwQiaJ5K/JE2dAuMrHinbU0iDFGp4qHNsvHLaWoq0H4ElN4cvA== X-Google-Smtp-Source: AGHT+IFcQDjfiHhZ/OqHafWiao+dUX81ssE3Ooc5L0nX3OpKZPosqHwHNiBz7NfVCyHuaaANOIW8 X-Received: by 2002:a05:620a:29c1:b0:792:c1a7:1e91 with SMTP id af79cd13be357-792e636421cmr1403987085a.18.1715903741541; Thu, 16 May 2024 16:55:41 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715903741; cv=pass; d=google.com; s=arc-20160816; b=stUPLJN4lcYUkmrW14+wc0zkRZmXIW0QS+uJbKvcmBqp9c362CzL64D3/6e9LpwdTA O4F2spTh1iM3OFN0GueVQ6wqY7AlDyw/pCkvoPKqOFURUKl0axcuw5dXwKWAOE0lyawG FwkDVhKExfNRYvOpYoGzHoF5n2uXNUugoDs2fIj7b8lUi/xBSPNIPZ2iAL071G6xLOWK aE+Kdn4RV5VQdkOv3Ihlu3gMWRW4N+ODF90GqM91TXiRceL2rdR3q3GUJk2MFMaCWnTO gummY4BO9R0Ygpcnq1Oj+Tr1QvhWwqjN56s30Mdqj540a8bHP9RE6Xyt3m3yLedRY3oF s8qA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=/gLVcqBV3F66KdisazNL7hONRkMphSyVVTtUEh3IZ/0=; fh=K47CzIjMPbXq9fFyYYrXed34F+5zIILTnHiZxlSbz/A=; b=SqsOKwyx0prmNYuEG7H++s6U/qWCdw1pKbTy7gNmMjC3NhBHhoPSXu2Z5JL4FLmZ9L 5OvEqkAkSaljtJ/Pi91/7cgF4nhW0FF7OAZ9iHKgTa/ffL/zQlh7l+KEjRnvG2ukcty0 XqNMfMa6iZCNGl5d/SE6+Hjr1AC9r7qrTE5u4CRQ1p+gxVg9mhKi6LGrfJIWmZivRTYY YZHiPB/093iy1mr4Jge78mzhcmN9lU+FWnsE/R7fG02ygHdjeEZOwQlMBC1jOA6obv51 OVGstJYlXINme5le837KuB5+l/FJ7vyjvPidAv4RGx0WF5L+zFZC962Jvs5jYBJnSjsn 7dfw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b="E/imWOJQ"; arc=pass (i=1 spf=pass spfdomain=google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-181641-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-181641-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id af79cd13be357-792fa9f706csi444890485a.323.2024.05.16.16.55.41 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 May 2024 16:55:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-181641-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b="E/imWOJQ"; arc=pass (i=1 spf=pass spfdomain=google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-181641-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-181641-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 48A9A1C21526 for ; Thu, 16 May 2024 23:55:41 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C26412D044; Thu, 16 May 2024 23:55:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="E/imWOJQ" Received: from mail-vs1-f45.google.com (mail-vs1-f45.google.com [209.85.217.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9E85C2C6A3 for ; Thu, 16 May 2024 23:55:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.217.45 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715903734; cv=none; b=gXVR3FtowUM9k1cwTDQ9iHxV+invD2xcdRMdkeIfqh/Y7jvMF3U5Ke7zi6wjyijDcxHHggPLcLL8xbPTHpPqlbq/eykcVgg6Yn0BgZIMHythoAhOy5dxeiylN8t2MWVXqKc2JoRbvGwgvMGyN8AI3g2j9g/vbBLEmIBvID4JThg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715903734; c=relaxed/simple; bh=4pwCjRrdKlshy11Q9Qidn/PkDr98ccPmPz4v2MD8UlY=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=Yuz9Ng3hubv/6Pme9fH/z0DidEKkoWT41WcGt1VVkbZ6eBNckghPb8FYCM5XSuVVq85afOi28V21z0xswqAVhTOvlNw8THgRYb0IwU2a8Xh0m0kCzoyQdMc+0pSM5DPgW94eXqJ+6PQjDRxZVFJ1bh6w6ZZ+l7uB9m4K8OJwF1Y= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=E/imWOJQ; arc=none smtp.client-ip=209.85.217.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=google.com Received: by mail-vs1-f45.google.com with SMTP id ada2fe7eead31-47f01a027easo2430264137.0 for ; Thu, 16 May 2024 16:55:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1715903731; x=1716508531; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=/gLVcqBV3F66KdisazNL7hONRkMphSyVVTtUEh3IZ/0=; b=E/imWOJQUukqIhTYGUAHSeDRJpe2R/x3Oe9ByVALnfK124hIndaA/8Mjmdr2phBqKM u+NeUR/kYgXJZTF9KDzqa8/qGoIpf4dNDMHyidkK15c1c79VKQ9BgcSSlQxV2Ylk5OYp 4ec+y4+bcN2lFZNRS7toy2FItQ7CiMxRTwZQJz/tkxw4T0w92KbXAqZWDRqe23pZOOwJ xCetOdesSvIbcayGyrlV6mXFWl37iPVGpEyelL8b5X0eIW+Z8L5S1lFhZiBygIHTPRQU eWLEnmom0n++EIvDSroYuCc3OrBHxEaHTp8Bz01kT9VHoRUpoWm2rOCma0ULrHayezss 8oeQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715903731; x=1716508531; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=/gLVcqBV3F66KdisazNL7hONRkMphSyVVTtUEh3IZ/0=; b=XTAgLSz2Eb37QSkBL8iciQ5Sie8Dc9z/nHGGPgdf6UZfL4iyMWjZx+9EcjsGjhPs1y LJprBWTt22gTKlFDCw13Ae7UWPKklmmfQS6R6VssOgKST8ymWi65ebc71D5EiqtjirUb jP9hITx2xnYR36hIydqhfVU7IZ2WpYiXiZ0dApC43jXf+KWp2qAJlp2mXXedPZdYa3AJ hpobBkj9BHew59gwzfMbzfis84+Tk7iJlyTDYeqEui3Do9WkTqTVSoVw6bxwvW5A5EdX EOHWlQpB68Jy0QdSB3zZVB7lEswsG3pAs9vaNgOYNNABKTL1vQoyL3TdT3GRoy61BvLv /giQ== X-Forwarded-Encrypted: i=1; AJvYcCXR/X1n6R2UMkwTcbYBUjTrQP5MScAvuXUTpavVxiHHvLq8uOoRzP5pMf9RzavizhtKmmxg2VefYt90Cl4Ymomx5IACE8Mz/ajAZ29H X-Gm-Message-State: AOJu0YxbcDxY3DQvxypk0LW65VXjmskx07lrLORDP2EphezxZrdmcVtL TjEr0Kg/nPbUtpmThUNuRnb4xjMQLL5AQZwy0mKf8+Vmb7yJ8DlRsrqLokgkr+9JRF/PD9GuQkY utHzOli9FDw9byDL59+FaZfI4y5MdCti+wMxX X-Received: by 2002:a05:6102:5089:b0:485:9a12:cae with SMTP id ada2fe7eead31-4859a1210d8mr3163573137.21.1715903730652; Thu, 16 May 2024 16:55:30 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240507-b4-sio-ntp-usec-v1-1-15003fc9c2b4@google.com> <87v83gllv8.ffs@tglx> In-Reply-To: From: Justin Stitt Date: Thu, 16 May 2024 16:55:19 -0700 Message-ID: Subject: Re: [PATCH] ntp: remove accidental integer wrap-around To: Thomas Gleixner Cc: John Stultz , Stephen Boyd , Nathan Chancellor , Bill Wendling , linux-kernel@vger.kernel.org, llvm@lists.linux.dev, linux-hardening@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thu, May 16, 2024 at 4:40=E2=80=AFPM Justin Stitt wrote: > Isn't this usually supplied from the user and can be some pretty > random stuff? Are you suggesting we update > timekeeping_validate_timex() to include a check to limit the maxerror > field to (NTP_PHASE_LIMIT-(MAXFREQ / NSEC_PER_USEC))? It seems like we > should handle the overflow case where it happens: in > second_overflow(). Or, I suppose we could add a check to timekeeping_validate_timex() like: if (txc->modes & ADJ_MAXERROR) { if (txc->maxerror < 0 || txc->maxerror > NTP_PHASE_LIMIT) return -EINVAL; } > Thanks > Justin