Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp4875777iob; Mon, 9 May 2022 03:49:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyGDTla52YYbXprPFSGbBhFT5InsMWsScHSv9oOCr1bK7tH4oruPRfaVlvJtNZWSJ8k3LgB X-Received: by 2002:a17:903:1210:b0:15e:8373:d4b8 with SMTP id l16-20020a170903121000b0015e8373d4b8mr15690469plh.11.1652093370887; Mon, 09 May 2022 03:49:30 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1652093370; cv=pass; d=google.com; s=arc-20160816; b=e4k21DxwtLZSs+H7+gxV2D1y42+AptBRsTLn5+VuI0ATMf4H8lOKSyt+aqfYyuawCh L6DeuxyCZb636NwODVdOPsYUtDOPf0U3/2XyV3kIcduldS7lPlxzmTra59ighxqrmCf/ ZZv0E7sBQo1SnAb8OuuKzb4eYAAiO78YmKFj+FmExyhA36inDm94+XfHrxF+E1CSCdYb CKoZ4sKou9d8E7+4um1gg6LakVA/5j65jT+PPB08L2Fcj85PA5Xmx7R/t1HbK2MR1Hoc /gycPJWceVb7f0bCCVXDpQn6qNeS6tQ/9jWVkjmfd3TmnWKmbtzTejoGKpO9EZNGOtQQ +CaA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-disposition:message-id :subject:cc:to:from:date:dkim-signature:dkim-signature; bh=G0rR36ThSFIbChCVzEJAhRJGTNn9TQ8DD6TrDp57kpw=; b=vM5VXwUPhamata+PVEYTTs5Z8BdNERh5JVQHONg1slG4KmqZHVgRBBG2DTGiZTpd2B SJeY1ba4brV3QzYFv83MzMfL9DmPHjAj6e/4EqJQF7OvsUd3iHGZirbDRhBR6I31Am3N GcVaMuCjlh32LzqdieEzbjax4fgY7+1LCGrtITnu8RGA/rMUUtiE/GQJqL1kdUjpC9RX JCoIQALRFvuC8ZliUTNQr8df+kzBN74icz8i2X41M230RBx/2Ikm69niuNrmZa2doHRc 7X+K2/oohCLDXSrFFqecDaoe5aTZqHP//Tur/HCJqMLAo68zyvERAWdmlLM7byUf9rgW n9Gg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2021-07-09 header.b=0LziLibL; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b="R/3NVtMX"; arc=pass (i=1 spf=pass spfdomain=oracle.com dkim=pass dkdomain=oracle.com dmarc=pass fromdomain=oracle.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id j37-20020a634a65000000b003c64100b08dsi13527591pgl.507.2022.05.09.03.49.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 May 2022 03:49:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2021-07-09 header.b=0LziLibL; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b="R/3NVtMX"; arc=pass (i=1 spf=pass spfdomain=oracle.com dkim=pass dkdomain=oracle.com dmarc=pass fromdomain=oracle.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id A5DD2237246; Mon, 9 May 2022 03:10:02 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238049AbiEIJfQ (ORCPT + 99 others); Mon, 9 May 2022 05:35:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42292 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237898AbiEIJHx (ORCPT ); Mon, 9 May 2022 05:07:53 -0400 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6009E1C742E; Mon, 9 May 2022 02:04:00 -0700 (PDT) Received: from pps.filterd (m0246631.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 24978wF5024511; Mon, 9 May 2022 09:03:48 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=date : from : to : cc : subject : message-id : content-type : mime-version; s=corp-2021-07-09; bh=G0rR36ThSFIbChCVzEJAhRJGTNn9TQ8DD6TrDp57kpw=; b=0LziLibLDpxT58KbSr2wHfV8Nl2FzeGmf9O8584hkqGU2V9yOtCZvkLy0sB3N4nRbbbm +SIVMhsQP7guoMXfo9yWgJB0FoT6TjDs3f7KN24sKjbqo/gm2BBsNCV4rWfsqCiwW5GV VmEkas+gIgVWhMihIm5M5SLERA7CBG3izuOKvdwRkt5yRu4Bh8FWLrSdU4p+EhxS4/R8 Elhfc0RgqLWEuBcGSCd9gF4682d53HJtRwA/kNpb5zUowQhmbDN/0g2i4Lap+gmWOZMG JLpSepldc0qWDl9draWD77EwjUjlKsLxPrxMSM1rhNh1qSnrM4xte5sklksArzIoAwxW 3g== Received: from phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta02.appoci.oracle.com [147.154.114.232]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3fwfj2auye-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 09 May 2022 09:03:48 +0000 Received: from pps.filterd (phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (8.16.1.2/8.16.1.2) with SMTP id 2498tYPW001573; Mon, 9 May 2022 09:03:47 GMT Received: from nam12-mw2-obe.outbound.protection.outlook.com (mail-mw2nam12lp2047.outbound.protection.outlook.com [104.47.66.47]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com with ESMTP id 3fwf71efg1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 09 May 2022 09:03:47 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fBlSfrpunt8dk3XeRi9uCEXurLQEPaPIyQjNf9UyJvIjtIxjwnI++2VpLFz8KPi1w40uNEwuklF6sXiOVayshzplFU9plUHSM+1EPVBl1+2aZyrKYIgpgBbtW73hLQkxmhgED2YikD7cfvz6HSbuqdh7Hk8s3c/hecaGVrzkBRH0ZehcADiwVC1aP/aA1HF1rC/zxB2Ak5YnWRQhMZfoJS/Xb6mNTJaXzQTX1/NLbX5QC59JzTj7C3FB1T1oRNxghR/tPH1DTBjXcOlNA7m/1Yh1QlZijcOzE9T7QVCNuKVGtJKpD/qbHMA7CuARRkQsMmO2jCZE4UDJqDpTgqgjpg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=G0rR36ThSFIbChCVzEJAhRJGTNn9TQ8DD6TrDp57kpw=; b=IG0xVCIJV+b9zAbvOKoORWPYOfMobpfEg3w9JbroO9+2McYvllfRV8U47K5Azd2gAKSfMdfXENek4NRDwbblQikjNPXo7vtpPOnTwiAx769cchKQ9NCVMJ1ui/QwW9ucPfJz3DNBISQ54SuEnY7HCsqD8ZhBdTnmJeMDa0zoftToE8ynyM1mCXi1MqWqY8iKWGJoEdOYfwJdl527jhQn/qgAodx+11ytxPM0eud7R5wJH9/zGTzMfvyimBWFBmsKw2rsEgS91zcUqxdBF2BZMr9RhjUZGrhf+mgtQwjIe9kXx3xoKdLqgMGy883jNvrJ2iXoCa/4s5ARIMQk9HUJ5g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=G0rR36ThSFIbChCVzEJAhRJGTNn9TQ8DD6TrDp57kpw=; b=R/3NVtMXgSJYv6jeLn4YevCXE2bMzylghqtMjpmTmWe0SMgKzu5Q311nno5xVdzcqyZhTpUO41Hq5tZM27ZVD7RJlQlqBv6uH6d09mwcdu/GFlAeYGPj77EAd0jeLSm6At9YVXRt51uN7dgOeo/qLzmtgyXqELNNOBW5GvK35M0= Received: from MWHPR1001MB2365.namprd10.prod.outlook.com (2603:10b6:301:2d::28) by SJ0PR10MB4542.namprd10.prod.outlook.com (2603:10b6:a03:2da::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5227.21; Mon, 9 May 2022 09:03:45 +0000 Received: from MWHPR1001MB2365.namprd10.prod.outlook.com ([fe80::c053:117c:bd99:89ba]) by MWHPR1001MB2365.namprd10.prod.outlook.com ([fe80::c053:117c:bd99:89ba%5]) with mapi id 15.20.5227.020; Mon, 9 May 2022 09:03:45 +0000 Date: Mon, 9 May 2022 12:03:35 +0300 From: Dan Carpenter To: Konstantin Komarov Cc: ntfs3@lists.linux.dev, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [PATCH] fs/ntfs3: Don't clear upper bits accidentally in log_replay() Message-ID: Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Mailer: git-send-email haha only kidding X-ClientProxiedBy: ZR0P278CA0110.CHEP278.PROD.OUTLOOK.COM (2603:10a6:910:20::7) To MWHPR1001MB2365.namprd10.prod.outlook.com (2603:10b6:301:2d::28) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: aadff312-bb46-465a-27eb-08da319ad26a X-MS-TrafficTypeDiagnostic: SJ0PR10MB4542:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: sHd8f5t1+qwBigVmCqztxoBJpLMRknVcKTXqJCV/9GjGRjj8bEIT5F9ajNgFKwAtcTg714J/ZgNrKVi7DgrCRifsX5t9/uYzbp/EN2WZdDxD+iHd3Zmyx9QDDux5a8tOoBmQLdquvoON2muG9iE6o8JWMlPa0rpLcCrJls7Wk2bKlOQUvHGmPusPXtWGbB2Rh5szcqmUr/X82U436DYhIZ7ykC3OQcViIxkShowAyZFGeXtCL72uQkUYSUA5Oz+L6tNWm3aHuHUiXG4X69B5Hxu4v/k3e3WvG59UVOfM9AOBEfGYSDMN+QkX83cw2eMMR4POLO+c0qD8PurQD+BlLjvm6wwSWXYLd2GH8EgXxxvNhcE39fyj4qIvRmcLXxf/VTdvU35ut+45dVsH33/lbQOoKworgwXjRmZGmAY1Lgy7X1Vt5XKgisir7SXWqb/tvywHusduRTwTjiKuG/B028IilGTkEgeEfBDQ6poUgImq/o28las5UADUpIu84c2jgdghfmSHi7Nw3JK6QDoVvcPmtJ2roqFe2MKowN+07RNo4UrTNimRp3xMSRb1njbAygiT7hPlkMbML2DQG21FE6Zws7kPaJLUFh0obhcMI6XSSymdNhxELkOn0/i+t3nI40iZrMF4C123rT5ozb0nwY4RfAXg1nugd6eK6vw2KaEqwhDCRyePvSw66WRVGEPYVDFhY6Mazhhlx1+ZAab/kmPjAZVBU3kJLUVWKLtrCaI= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MWHPR1001MB2365.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230001)(7916004)(366004)(66946007)(6486002)(316002)(66556008)(6666004)(26005)(6512007)(4744005)(44832011)(9686003)(508600001)(66476007)(186003)(2906002)(52116002)(8676002)(4326008)(6916009)(86362001)(38100700002)(33716001)(38350700002)(6506007)(83380400001)(8936002)(5660300002)(67856001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?wMyAFU1jTqD/cO+2uvNHBuHlCHATgdP5LOCGTh1ep6kBYwrojHoj0wJKeE3A?= =?us-ascii?Q?7NVvfuYBKzay4l4e3JnYM10WmcxblfQgqkFzS0slGA49GinOxbseLdztkWbR?= =?us-ascii?Q?D6rh92rPwS6sBItnxz9IJD47r7LLFpmDAA69tjW2UYdKxOTnbM79rJEqbs6w?= =?us-ascii?Q?YW5Z4LWEE21vOWDHsTaCa+IKlHQsyfYMLeTad/5a583jvl9sLoCeUa4gTyb6?= =?us-ascii?Q?LQKM6R9UlPOcprTDdxCmnxq9OlLDh0T0MmxqCLqk8ln7D7kW8cjDIdrWn953?= =?us-ascii?Q?KbzCJ51R0MKAPItIy1+Jd+0MFK8WBAsm7gB1/w077UqCUkZPV3El7aNvLZv9?= =?us-ascii?Q?YvUQaPOtxUoYdWcd6+7S2iSFDsNN3LsGzAq5Ny4v44QUBTYWgy188DwFBH9S?= =?us-ascii?Q?+/hh2bJ4KX+dKkXqOwHsutIOptdHXfsFcAtub3QBWEfu7BlN8YErTMnq1CiV?=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aLzsV97JcYl1GK9kbCRhmGVFwtHZvuuxruL?= =?us-ascii?Q?io3doY+3Kt4Eh6uRYmfFqPBvrQuTaxf2zveCP616euk4ZLQkKJfR6BUiNvLo?= =?us-ascii?Q?43qPSfkIdVX3nVvUd8kt3QNe/lof9TwFd2+n/jCbkXMW2HgCTfQt0u4Q6eGM?= =?us-ascii?Q?Jzd4rQ0hRZOqCDSymG0K+kK/8NaLVy8iQvIlM6bWoxchrcbup+IEqopxk4hn?= =?us-ascii?Q?kAkxeT4doVBzA3mhjuDYNm9iaNZylrGFmRoeYJy2u/Q0vYxXLToLJF97NLao?= =?us-ascii?Q?9Ph8h//J8egy1nKWcW9wj2xWNDgnXHcBNu8HQlV7Cjlx5mwEbOsXIqX70es8?= =?us-ascii?Q?ulOJ9jDLn5/SF/2MqrXw5xk/sWUJ9zVrUh03KT0woXVGSvISJYwk2Ojv5bMn?= =?us-ascii?Q?drCxzAa4pIEXQvXi9tdYsPhItMTbmXw=3D?= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: aadff312-bb46-465a-27eb-08da319ad26a X-MS-Exchange-CrossTenant-AuthSource: MWHPR1001MB2365.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 May 2022 09:03:45.3899 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: neyKhC/CJnWv/Kwk70yueQsI9/gywRa03MXdFagFDh8svysM2lVgPWXPQmIg6WRyN5h9W1nu7Yj6gcZwO3LJO5p/+o8kfh8e3CrisVDCef8= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR10MB4542 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.486,18.0.858 definitions=2022-05-09_02:2022-05-09,2022-05-09 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 malwarescore=0 suspectscore=0 phishscore=0 spamscore=0 bulkscore=0 mlxscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2202240000 definitions=main-2205090051 X-Proofpoint-ORIG-GUID: IlReYy-NMdxDB1E6KTGJVh48mjVlGbZI X-Proofpoint-GUID: IlReYy-NMdxDB1E6KTGJVh48mjVlGbZI X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 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 --- Why am I getting new Smatch warnings in old ntfs3 code? It is a mystery. fs/ntfs3/fslog.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/ntfs3/fslog.c b/fs/ntfs3/fslog.c index 915f42cf07bc..0da339fda2f4 100644 --- a/fs/ntfs3/fslog.c +++ b/fs/ntfs3/fslog.c @@ -5057,7 +5057,7 @@ int log_replay(struct ntfs_inode *ni, bool *initialized) 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), -- 2.35.1