Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp2883612rwb; Mon, 15 Aug 2022 13:15:53 -0700 (PDT) X-Google-Smtp-Source: AA6agR7yRt6WN6cuobBmBoC8Y0gnfKaODTtsiyNpwaXvvNG8wXTp/td6KIr+qeCUsKKMMCKudj/f X-Received: by 2002:a05:6402:e98:b0:441:a982:45bc with SMTP id h24-20020a0564020e9800b00441a98245bcmr15548392eda.239.1660594552928; Mon, 15 Aug 2022 13:15:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660594552; cv=none; d=google.com; s=arc-20160816; b=RGz+lTAlpGRYI6wv0GV13YZFQwTPeczjTB85n8FVBuTWB5Jgphoa4qjRZPjSqZ9hYE CHJOaSXGwlWjvH+i6HTLejrN9tllBuhRwEVoaFGOJEJkvlMAHAP7Bows25kJvb96hmdy cjVNA0HMaOE5DbOAQ2FoB+5lNOHnJVV+/cWDrUATJbPF0fn1LlMcCP6GPyCJOBUMZnqd VVQF9l+qe+DuiFi+DeDfUMbcxGgfN7yh3m9D0ZRUSw/CjqyNw9zooIO9Iv+OR4JExKVq FtqSk/M6EY3YJ7SuqJ33aXAJGTFP7Txdji/2BQMEf2w32UMOutUs6Ut7NVkjZadMd1X0 IdsA== 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=dDm7INDkzwiEltBpnvpHEme5FEICC+UexafkzcNSwkU=; b=gx0FpbbIvxsOPyHD49XPDHpEIROIrceg7Mui7/Yv6kMxxStYgV4HQe40vDwoMix+Fn gRdxl6HeNUtGZ/OKmXTaZP9H5CoTPIoANxcAVdqp1f1WM21gnaSHm5LObio5YnDggdzJ UMx7VO2mJStgsOG8svGPOefh3evQcg2a0W4mSYccBF4X09pj6kn8LMH8le2V296/j0d7 oEdKrLpaivOksSKVJ+c2MWIKZCNFsDEDxIQbduJ7Jt9o5f+EdQu2TEX/GbW/DplO+Oeq HI+GxgvyEoVSVsY/UZJNopmNSd2M8K8GrP0rY6/Ykllcae51K6tVf1UnjA9AbSnMjOyw mXpA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Q6XuKC7L; 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 f14-20020a056402004e00b0043bd24198desi7353101edu.526.2022.08.15.13.15.26; Mon, 15 Aug 2022 13:15:52 -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=Q6XuKC7L; 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 S241188AbiHOSXD (ORCPT + 99 others); Mon, 15 Aug 2022 14:23:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43464 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241190AbiHOSWY (ORCPT ); Mon, 15 Aug 2022 14:22:24 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E2B3A2D1D4; Mon, 15 Aug 2022 11:17:18 -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 ams.source.kernel.org (Postfix) with ESMTPS id 5A721B81071; Mon, 15 Aug 2022 18:17:18 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B1ECEC433D7; Mon, 15 Aug 2022 18:17:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660587437; bh=OAQyXy/GOFj54iggXsaKPN5H0YYyEtjyZS1gECRg3/A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Q6XuKC7L8x5Frs8sxGdjW4j0sT5slZ6g4xewzDB2hHW3jYracjIolNRIS+yrbg6EE nDGsqDjXu/tsrgTPzu2KHxU9PEtk2LJy0fhozml4DtFWClZf1I+uCQL7y0uvNUVSbB aTsGJAfqE6IJoXGG+VFitBZp0z6xTjYUS8A7srFM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Miklos Szeredi Subject: [PATCH 5.15 085/779] fuse: limit nsec Date: Mon, 15 Aug 2022 19:55:29 +0200 Message-Id: <20220815180340.921319448@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180337.130757997@linuxfoundation.org> References: <20220815180337.130757997@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 @@ -181,6 +181,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 */