Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp3078115rwb; Mon, 15 Aug 2022 17:35:03 -0700 (PDT) X-Google-Smtp-Source: AA6agR6dw8ewND6PaKYj/vCSPWCuItQ3Rg+kUVEuizbCwrCoWwPRhtgWzqTkX6YEt3BWEf9XD4ex X-Received: by 2002:a05:6402:156:b0:440:b458:93df with SMTP id s22-20020a056402015600b00440b45893dfmr17031968edu.337.1660610102919; Mon, 15 Aug 2022 17:35:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660610102; cv=none; d=google.com; s=arc-20160816; b=P0A5B+1Y/nPAzOjHKwXr/dRhL4P7C63dgEv0vvwkTdNWtqpbGFFr+mRVcb2gvdq8WT 6NOcSVF/gWEW4Ql38+5nFgeP6LTV0wVTXzltqrJ/vTQRr0tcw3xPacW/1cnO1kn/SEhV nzIngs4xD5Aw/AQ0wqVF8IHvgbLcb2L01jdAf8Nd1dVKbD7C/Ds9VKIaZ4xhpwIm2a/C d/irTscoCZquIj6VLdDIUrl5g0feFePqW0fgtefKmHKBYvjb1SItZai9pAXF25mXqg8T GQ8vV/z9Mc1jTEg/98RP1g4AY1etb6ulP3PFoidx6NXpdwfdc2w8I+UIEqb6bx1eMOrY Y83g== 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=rG5vzlRMHc736uWs66bmMQsy5XQD7zhonTKuIdJ4H2E=; b=LQXCigW70NtFV2zO9Kgv8Ju6jzdcKU+oCDhmxeuNQzNeUHmkNDezT05sI1PWYeyjX4 AHZBRa+MB+2AMJJfZ0dLCB+mxm85CvxAHdbdyc8ogFsqM7CQEv9VBISs1ssSuiQOT6D4 FNh1cOKJYSn9twPY3Cfe4A8GXmOlr3yVamI2LBgsN0LoKrvzR0vCmnFttHtpd4jeBMJF MYRIbLzfk0QlIvwd5JUebUCKQThUJa34UlqrDgP6HRYw5g5HPw4PhbdVgHSL4GUzuyh+ GhW3dWyUujECEhtsxi4Yx7i5ISZBpfd+Cea4RRa3KcLk+uk7v1mSZm+mH7LC2UTIrRDp szgg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=QqBFGDj8; 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 nd38-20020a17090762a600b0073159d67b74si9221975ejc.46.2022.08.15.17.34.37; Mon, 15 Aug 2022 17:35:02 -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=QqBFGDj8; 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 S1347662AbiHOWWf (ORCPT + 99 others); Mon, 15 Aug 2022 18:22:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56396 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1350533AbiHOWR6 (ORCPT ); Mon, 15 Aug 2022 18:17:58 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6605D1232D6; Mon, 15 Aug 2022 12:41:06 -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 51E9CB80EAB; Mon, 15 Aug 2022 19:41:02 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id ACE9EC433D6; Mon, 15 Aug 2022 19:41:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660592461; bh=NNc+ZgAIT93P7mkNlp5ZcQKWVmmubeiDsVrAA3uW0tI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QqBFGDj83NFXm4Wl1/slM5gE1c0T6j5CpWhNgAz47+c2DwcVS4lKV5F5Hv8FSMyKq RMjdVDW2kkGAFRNGGjnN1LpCbQYuL51w5UgtX+vNmJlryL4Jkts6qpPEf5Qoof13fW Tg88RWq3zxxqSP1gMVk93YUxEvE80CQ9PZknea8M= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Miklos Szeredi Subject: [PATCH 5.19 0113/1157] fuse: limit nsec Date: Mon, 15 Aug 2022 19:51:09 +0200 Message-Id: <20220815180444.150408212@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180439.416659447@linuxfoundation.org> References: <20220815180439.416659447@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 @@ -180,6 +180,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 */