Received: by 2002:a05:6358:5282:b0:b5:90e7:25cb with SMTP id g2csp3404668rwa; Tue, 23 Aug 2022 04:20:29 -0700 (PDT) X-Google-Smtp-Source: AA6agR4rLzOy+yRun0+U8Jw2Qm5ldOexUTRKHX3EnZzG5VFloPiia7Fjp5M9nR9GhBW5+/5PEsmV X-Received: by 2002:a17:90a:d585:b0:1f4:f9a5:22a9 with SMTP id v5-20020a17090ad58500b001f4f9a522a9mr2875165pju.49.1661253628876; Tue, 23 Aug 2022 04:20:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661253628; cv=none; d=google.com; s=arc-20160816; b=xuRrYd7neIMHwPqAbjJSXkm6pobqsFo+34aCB3oHroT5yaOA82n8dpH0KuqbsRPY8X C39iF6l9B1Q8l6cXmiaNoEW5DHjtCGVXERCreqEoIFCvszO4PncJiQYi8Nmw6QoLGPs3 qApwiCYnT2ZrCl+UTsKuw4oZdtHmRqLup5/nqhEZq2ZJRkUk5xZ3zVvTmh49F+uziP9Z bia0UrD1S6URvSd5/FadQT8YjjLaZshY1hvig2oVERsCza9A3V5Tf102yJZ9ubbnrxTv vLIdwp9wSJKrlEV6XwckbGe11jbidde2vjtstyLdb+qkw5LhjHE2V6q6rSQI1Cq9PccK DwBA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=kBkWTwSCymmnMLgjUSuac9shJCGwDpPvgwh2ejb1gIU=; b=T6TIWcnl3jhWeGcX3tbvAfQQHWiBABEMfYnTyxYGSX+eb7WikayyQ+b8yO05gC4SHP W7HG4gnHJBtN9j6Mo8S9w9b8FiATBk+499aGXQbYq48jo/6AhuV5sL5o89U5rITgkIow frs+AYAccHDV41ThVzvkvLs7GPuzwPSspv2UAmXn/HtcXYxbfIVreqhC6FKbYdGH9G4a u00YiBuE4ZrBzuMPYpkbVp9LpHviw8W09++3GnFePNaZT+3gpnrS4Hfq/IO7zqGQy7Yd J07gdTm6K1wGSXmZy5X68p3m5RSRb3p90foGiYQyCsuM4JdcUCcQnbbyV/HvDdbF6En4 NCBw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=F6+9y8Np; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id pw15-20020a17090b278f00b001fb3841e074si4691414pjb.163.2022.08.23.04.20.17; Tue, 23 Aug 2022 04:20:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=F6+9y8Np; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1350737AbiHWJcp (ORCPT + 99 others); Tue, 23 Aug 2022 05:32:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38778 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1351019AbiHWJbK (ORCPT ); Tue, 23 Aug 2022 05:31:10 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2A37B9351B; Tue, 23 Aug 2022 01:38:05 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 0621061538; Tue, 23 Aug 2022 08:36:57 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 03FCDC43140; Tue, 23 Aug 2022 08:36:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1661243816; bh=MSkgAf1zIqW/oIhnY3v5vqHnCfp7wiwThy3eGepHuUI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=F6+9y8Np4FzyzxkmC5PO2s4kEeJcSjJrs831dzxQ/LLjObXweHxV+q2ZtqHemvwsB v1WtbaWPNugrZKrlet1guTPmJbKrS5Gmew1cVV8TJNmyN2IfOgDiAx5Rrw/XGJXPt5 dHDSpYp76omHIpg+b/eomWry6I49Awl6Zaax+EEg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Miklos Szeredi Subject: [PATCH 4.14 030/229] fuse: limit nsec Date: Tue, 23 Aug 2022 10:23:11 +0200 Message-Id: <20220823080054.572703405@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220823080053.202747790@linuxfoundation.org> References: <20220823080053.202747790@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Miklos Szeredi commit 47912eaa061a6a81e4aa790591a1874c650733c0 upstream. Limit nanoseconds to 0..999999999. Fixes: d8a5ba45457e ("[PATCH] FUSE - core") Cc: Signed-off-by: Miklos Szeredi Signed-off-by: Greg Kroah-Hartman --- fs/fuse/inode.c | 6 ++++++ 1 file changed, 6 insertions(+) --- a/fs/fuse/inode.c +++ b/fs/fuse/inode.c @@ -174,6 +174,12 @@ void fuse_change_attributes_common(struc inode->i_uid = make_kuid(&init_user_ns, attr->uid); inode->i_gid = make_kgid(&init_user_ns, attr->gid); inode->i_blocks = attr->blocks; + + /* Sanitize nsecs */ + attr->atimensec = min_t(u32, attr->atimensec, NSEC_PER_SEC - 1); + attr->mtimensec = min_t(u32, attr->mtimensec, NSEC_PER_SEC - 1); + attr->ctimensec = min_t(u32, attr->ctimensec, NSEC_PER_SEC - 1); + inode->i_atime.tv_sec = attr->atime; inode->i_atime.tv_nsec = attr->atimensec; /* mtime from server may be stale due to local buffered write */