Received: by 2002:a05:6358:5282:b0:b5:90e7:25cb with SMTP id g2csp3404040rwa; Tue, 23 Aug 2022 04:19:52 -0700 (PDT) X-Google-Smtp-Source: AA6agR7U9RoaadVVV9iJuc6TEsSoMZHULv+6ql1z0HNVk5z6RQ8Jg67jrgptcFCYsTOsKFdHx7sv X-Received: by 2002:a05:6a00:1a44:b0:52a:ecd5:bbef with SMTP id h4-20020a056a001a4400b0052aecd5bbefmr24359163pfv.28.1661253592625; Tue, 23 Aug 2022 04:19:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661253592; cv=none; d=google.com; s=arc-20160816; b=KIDnj5+JPnF4oG8lbJOX+Npk2qJat9HiF7m6PmgLGClq+LKu6JM3NePADcfUmDCUAs nopCx0k4yNpV57m2zdm5rij+K3Vxydmttjk0ln9Oxs6S7D9K4gPyUXF8XE1pMXYg+8rQ XN1Vea1Q9fBi0hHxrugUhLFuTPAW2pTp1eFGh2LLDPxtKAlNrIdoDXS9vvEL19ROL9Xa UrBWmg82b79B2TVF/vIPr/D26qGYd7LC3BIJ+PgiYXzbUfI8FPZRo9rAixrZo+Eew1dM wyNVE9VxaEYvRHxLNdAv/71KsKWBkk9T9PArpgbHyIx04/WDBJX4N/Be3GV/ax8RyT3u CNEA== 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=yq6kY3sKHk1jDPM1Y+YM68vZ9Pf3I85oANIS+RLXKI8=; b=Sie3GD0ClUN6zeydCA0/c1cBLE5L0tGoO7xRJIKHkVzowuKLbf/WH36mvx+HSg2c8g N7ZYon+YuoXiv9ePKd23vkqAjCz8CyK/ec885CwyQ+AAcW+ShiLFNCWaxvY39hlZnHif wRjbANx1th1xNbwid5yw4ykIG02WP4JpRK4xbfB+9GA4aqMKeSXSRgJcPy6/VzkRodjF UE284teowmVG10BEzmTMZNYgVJcApp0/LGgA1phK/W5rpcBk2Uviyw6X5pdEatU08G9D pAcIrmrJUfq48YYqnBHMSfNkoQRj2RvwobfdnI8t3WZmeu88xulfT68NHLBLS4uhu2yi Pjhw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=aniY1XOc; 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 v70-20020a638949000000b0041ce068604csi15162310pgd.763.2022.08.23.04.19.41; Tue, 23 Aug 2022 04:19: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=aniY1XOc; 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 S1354844AbiHWKdV (ORCPT + 99 others); Tue, 23 Aug 2022 06:33:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53154 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1354334AbiHWKRI (ORCPT ); Tue, 23 Aug 2022 06:17:08 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 80B4374BB3; Tue, 23 Aug 2022 02:01:24 -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 8C58561576; Tue, 23 Aug 2022 09:01:20 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 783DCC433B5; Tue, 23 Aug 2022 09:01:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1661245280; bh=30MAri+rhxUHrgjZnI2YujfjWyEN/ZHjt5LHygb/svM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=aniY1XOcMFkV1yq1WcdXyHTept98S8frBewUu8Ch/oW/tA0RbcztTlxl0W1Mm686R mBTJShFiOh8nasYoo82elzOW69mZH1AHMBsXV9jALvthq+YaRnryVOO4SRWcQGrfxv hHsHcui9ZHVq632jmO5tXQM+mjSO1GIKr/PWPf4g= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Miklos Szeredi Subject: [PATCH 4.19 028/287] fuse: limit nsec Date: Tue, 23 Aug 2022 10:23:17 +0200 Message-Id: <20220823080101.226424778@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220823080100.268827165@linuxfoundation.org> References: <20220823080100.268827165@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(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 */