Received: by 2002:a05:6358:5282:b0:b5:90e7:25cb with SMTP id g2csp3293007rwa; Tue, 23 Aug 2022 02:08:29 -0700 (PDT) X-Google-Smtp-Source: AA6agR4mM36wmlK9QBamRGtHlGu00IB52b/RMKFKJ8Ad9xjAyJz+NPo23QVLOk9gRIF44fast3m5 X-Received: by 2002:a05:6402:5241:b0:447:47:5bf1 with SMTP id t1-20020a056402524100b0044700475bf1mr2889667edd.227.1661245708899; Tue, 23 Aug 2022 02:08:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661245708; cv=none; d=google.com; s=arc-20160816; b=YOC40wvk7kxW0QxnszsvOT4BjCDi+BgeGok16PqNBMWeLoVlh0GlZ7AnLYD7xvIg14 g1lC2F6YQbaLhaXR4hua4li0n3JYRgWJMCGH7zflSM4Zt4tyyrHs73tYXNURhvmuALgv +XpjNxFd2c3JLIe8IcdBbxW+GP+yBTv3RseSzTIMnUOUgwv/jmqDCEKzSzOogUQFPAOG mJKkrWML/Q6asvxLqwyTn3ORSMkIAjY18vEvLuWp8hVzR21UonZADCaLoVE2qEHBP40b 4VuH4fIvvA48jEtb/hnkCRuhWhPTJb/zvyVQ32a2hAt3IiXrJ+ibXLDv7c9V0snP8X36 L6Pw== 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=M575V/VdbIQdw8AtXKGXOrbcjP/pvCIg4BXMqJ1i6XKVIqHRINS+RlVRMPXWTL2WrA A66M6gGbVoaJKDRmeqrwXJHfAQ3XAviHhruspvzbx8zFtp1dO4IxhZdYCHLWwq3TGLax jCPhX9L02O8g/MmsE8TH8A0Wj1oUq2b/uCkD9DlLJjVuJ9at8f4s2yFPZvbgaTb2gF9U gN5p8BFtRouWbKPezbzILIjldyvQbOgWLzPSVV/wIYsiYhmUYMUX49/4UMAus5lynY1Z guzh+rudFiVHcEGvjl2WzR6jnrvv1Wd6TMd1AKFVGVXlJ2gPruB2VJru3pNYVfpvi8V3 5NEg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=S4tk9VYt; 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 i9-20020a05640242c900b00446c5e10fbesi1999508edc.32.2022.08.23.02.08.00; Tue, 23 Aug 2022 02:08:28 -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=S4tk9VYt; 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 S1346575AbiHWIog (ORCPT + 99 others); Tue, 23 Aug 2022 04:44:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34540 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348895AbiHWIl7 (ORCPT ); Tue, 23 Aug 2022 04:41:59 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DEB8A7AC10; Tue, 23 Aug 2022 01:20:05 -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 619CF612FE; Tue, 23 Aug 2022 08:20:05 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D39CEC433C1; Tue, 23 Aug 2022 08:20:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1661242804; bh=hG3JMbhdNDO2gZbIp193qOzFN0q0GOPDtuYxgu3A/pg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=S4tk9VYtKUXF4dqZORrAzF7QrCbsNgRjbOp+a/5DcxPs38gK8t0HW+5X4qleH4eJD 4d8dbp56HmqyilGTtDr4zmx8W/m+BAj8TrV+bAovkApCffXBBs763YSrO/HRtMdIYe 0A9T1PfltjDOVSwDAJcEQwnsW8nbeW/tHBG8S5tA= 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.19 162/365] fs/ntfs3: Dont clear upper bits accidentally in log_replay() Date: Tue, 23 Aug 2022 10:01:03 +0200 Message-Id: <20220823080124.991671071@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220823080118.128342613@linuxfoundation.org> References: <20220823080118.128342613@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),