Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp1862923rwb; Fri, 19 Aug 2022 10:37:50 -0700 (PDT) X-Google-Smtp-Source: AA6agR7uJvRNMyGXTGc3ZQD1r7tmxG7JnxgIGNWYRnLfo4hG73OdqMQ/YiJ8uRgQaiyewIRxPRmR X-Received: by 2002:a17:902:e80c:b0:16f:8663:6c57 with SMTP id u12-20020a170902e80c00b0016f86636c57mr8488669plg.102.1660930670186; Fri, 19 Aug 2022 10:37:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660930670; cv=none; d=google.com; s=arc-20160816; b=k4DIDMIO+DaWPYxQKUXpE7XivzIxSajUAd06xrqM4VReqCQaBUqsWhZRxM4XCR/Ies 9IxwzHyOL429bs9vpdp9KLoZK3ohkhKR9BOtHv7wLiCk4vjpLcz1VqyiNjfXi1K+Y73u 1jjHizg3a1cWHVFRNCXMCPMbKSVYp3h+pGPaFchE9GDcRclnBO7mSf1DFbscHt822bcs stqfqcTcKelKIHlcjHmpSd01ZoJHZUqANgOghLsVfUlndMiF3ulEy5QxvaVrLZLP86u5 IoPFX8Zqv2e6ff1G0IQ46cQd03idAn25NaYYvzbDZBZmu1QpkSEt27jjZnngh7i/QbpX SFPQ== 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=0CN/kF/X4y2nwWqIM7P/nRJhK6QQLZlsD8Ko9K+Z6ps=; b=HENvNw0o6NKbka6FxvEyN0sasWQkbi+J4v0RAKyKC/MY8Mj9ET9dqiR6CNILaPEvUF 50olD4blyC4GPxnsiqX7R4eArlEiRn9zk0i7/45EuYC5yVOfVVJWNTnLoPLouk7LOboP 92Q2jNDNLQRKc6aRNHkz8flJL7GZJ61sIIPJFIZ0vUOjT1e4PtbXmgnnMSRIvXtdzscX zUsI5mP0gb7k56/BobrstT78EglfvyJzB7sO86EfXgfeCniekCJUYa3omSVWPQS1KLv0 KuEVXRA5eBtkQRuI5SxDN72Dh/qEYk/Q9YYFmKviipSICjY46LpcgbMO46KuEtwTl+VB GzMw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=s71VWx76; 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 n4-20020a654884000000b0041d17e08467si4561830pgs.381.2022.08.19.10.37.39; Fri, 19 Aug 2022 10:37:50 -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=s71VWx76; 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 S1350512AbiHSPzN (ORCPT + 99 others); Fri, 19 Aug 2022 11:55:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40036 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1350571AbiHSPyV (ORCPT ); Fri, 19 Aug 2022 11:54:21 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 30FBB106FBA; Fri, 19 Aug 2022 08:49:40 -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 4039161724; Fri, 19 Aug 2022 15:49:39 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3F54FC433D7; Fri, 19 Aug 2022 15:49:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660924178; bh=2mjJAQmsdN9zFTMGHiXbeqb7KdcpnHmUaKz7zq041e0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=s71VWx7695HR8+cn5swIoLZsHGy1hYZGOOa+Ek1lWt4r8mH295WEDRZOId6/7Nz3o OTjDAZ6XUux5IP536QIPmW5W3AZET2uj6krhsnliU03pq3GM9myf6uuji6bdAGTMO5 v7Gc4q5J9EBqCsxisAMY4EUfGCLURQlHFZMonrzE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Miklos Szeredi Subject: [PATCH 5.10 053/545] fuse: limit nsec Date: Fri, 19 Aug 2022 17:37:03 +0200 Message-Id: <20220819153831.603561318@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220819153829.135562864@linuxfoundation.org> References: <20220819153829.135562864@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 @@ -182,6 +182,12 @@ void fuse_change_attributes_common(struc inode->i_uid = make_kuid(fc->user_ns, attr->uid); inode->i_gid = make_kgid(fc->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 */