Received: by 2002:a05:6358:5282:b0:b5:90e7:25cb with SMTP id g2csp3397506rwa; Tue, 23 Aug 2022 04:13:39 -0700 (PDT) X-Google-Smtp-Source: AA6agR4iygAherq0+xxtnn6bMSZDfqCPGvvMsxNcIaoWJ7zCjKpBdo1aubDMG8ZFPGzDdJtwix7O X-Received: by 2002:a65:6393:0:b0:41d:8edf:e296 with SMTP id h19-20020a656393000000b0041d8edfe296mr20501617pgv.0.1661253218944; Tue, 23 Aug 2022 04:13:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661253218; cv=none; d=google.com; s=arc-20160816; b=B0LwptmLjdZ+F2tllGwmY0R9XjN3cPe8XLCu8Mx9zl7890lsJOy2laB70SEQnbUFKi WR0ueXOlsRh89Obf8zoYP6fUpm5yWz/XMZyHNIPFlr/6DRqVaUdMcrS2lfSP/Xd5UIpw uC687gO6GWoWfS2H3Jfsj6enwwHYV9MAIy62dltRrS/SR9XhKitzr+n4Xyj19PGWdmJI V9BMvtX6IA3U7ot3YWHGkcZz5Jep/vKsrleGlBFBPVPNoKQUESyuIdQGWx67idDjINZi aSHRdQTqmwR1Lbmli5kxbPr1M9y5h2zDPScfinfrgRn+250odI7UBeXPdPB3XCUdJatO MEZg== 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=2uGEtp5roIHrNIxaks9zfqTJXcyTO+BURo9xXnfd1bE=; b=ZGBPVTIz2ljTycuQnn5FjX7Ktm45ss8SGEGjB6itjynbdt0w08CRdW0lhrD0sf1s3p Bldo05Y76YoqADQ+CsamKDUL8yudLneqQxw8RD83riB3XeLq/nB+ul74onwQeG2m8YXo giPPR4DbQ/SXSFtu6Wx13OtjAtv7drofKFOF+WSo7kJStNTjjg+zHmA8QUr9sm2Mewph 7dhC97vcgTDxNiZzDGCor/tYSsJ1zCY/1Sse4y5y3/N4yknWGAy2xCHWEKKXKF/raHMF 01VpVDZ5RtS0VuIhmFaQ5cfpfX545T2HeNbmFngs20IqW0ek5mOiKkprR70u4BV16Gqv UPlA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=wmSd4gVe; 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 my4-20020a17090b4c8400b001fb1c8591f1si7522962pjb.135.2022.08.23.04.13.26; Tue, 23 Aug 2022 04:13:38 -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=wmSd4gVe; 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 S1352285AbiHWKF0 (ORCPT + 99 others); Tue, 23 Aug 2022 06:05:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44488 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352016AbiHWKBF (ORCPT ); Tue, 23 Aug 2022 06:01:05 -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 6544127B2D; Tue, 23 Aug 2022 01:48:36 -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 20EEC61386; Tue, 23 Aug 2022 08:48:36 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 262B7C433C1; Tue, 23 Aug 2022 08:48:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1661244515; bh=hG3JMbhdNDO2gZbIp193qOzFN0q0GOPDtuYxgu3A/pg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=wmSd4gVelAHIb39fyTlN3tGL3HgPR/IBUNPOnXJZ9xpBUTwg5R/4EOx0w/oo/xaul suf+5WHq9YUI85TSeN7wnGjeVrS74heHYmuT0XWMrbZBB0UpGIDFZqCc9Wcrnb3f6/ bgBB1qI5ovOJtzwafX/xODvrc7JOW2ebaTrpuUug= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dan Carpenter , Namjae Jeon , Konstantin Komarov Subject: [PATCH 5.15 105/244] fs/ntfs3: Dont clear upper bits accidentally in log_replay() Date: Tue, 23 Aug 2022 10:24:24 +0200 Message-Id: <20220823080102.523538028@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220823080059.091088642@linuxfoundation.org> References: <20220823080059.091088642@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: Dan Carpenter commit 926034353d3c67db1ffeab47dcb7f6bdac02a263 upstream. The "vcn" variable is a 64 bit. The "log->clst_per_page" variable is a u32. This means that the mask accidentally clears out the high 32 bits when it was only supposed to clear some low bits. Fix this by adding a cast to u64. Fixes: b46acd6a6a62 ("fs/ntfs3: Add NTFS journal") Signed-off-by: Dan Carpenter Reviewed-by: Namjae Jeon Signed-off-by: Konstantin Komarov Signed-off-by: Greg Kroah-Hartman --- fs/ntfs3/fslog.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/fs/ntfs3/fslog.c +++ b/fs/ntfs3/fslog.c @@ -5057,7 +5057,7 @@ undo_action_next: goto add_allocated_vcns; vcn = le64_to_cpu(lrh->target_vcn); - vcn &= ~(log->clst_per_page - 1); + vcn &= ~(u64)(log->clst_per_page - 1); add_allocated_vcns: for (i = 0, vcn = le64_to_cpu(lrh->target_vcn),