From patchwork Mon Nov 21 11:21:34 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Potapenko X-Patchwork-Id: 23679 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp1525730wrr; Mon, 21 Nov 2022 03:29:39 -0800 (PST) X-Google-Smtp-Source: AA0mqf5LPiJsa359vUAaL+97RBEjJz70+3s5UpoeDd19/Pau7f/LPykKOhyFnRUsSKInzD8MPcjv X-Received: by 2002:a05:6402:360b:b0:468:f365:dca with SMTP id el11-20020a056402360b00b00468f3650dcamr753329edb.41.1669030179283; Mon, 21 Nov 2022 03:29:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669030179; cv=none; d=google.com; s=arc-20160816; b=pHvrygIga64DtIWITUO/dkxbuWuqXt8qPuFiin6uSkt8GXEZ8/ou4jP/1DtyXfDLj+ I671+XsOD5e+OuJvqOZXREGwxGDGPkiRzJ9zyYwv1V+k8G+5XUUGSIBdFxfyUbiErCQx BTD58CpdCupod5y6ofFZJ0k9ZaUQAYNZbEdCv9BLdfzpHDAjzmfv40cnVCnsUmWOHwDY WL2R1363bPhfEHc7wE1UclFO0Up9O6BZ2BWFCn3AL06OAoE/nPcDah6hs4xGrmubDUXR P2xyZMqxnbRD1loUMrLvsJ43V0ijTitoAtFMF2vZCyDCdQlsNAAbqT4eMMj+um7o606m 0gIA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:message-id:references :mime-version:in-reply-to:date:dkim-signature; bh=+5wrCbW2TNaYb01/tuYYFENHET5JL1U7hc5fWA+Xdi0=; b=Jt8kp20Vs614wjJYbHi0ceTbYCVhADd6M/l4ZsW0ZkpKrbEGj63ihjwjib1vlyWIBJ L81tXp09XWlB+jnjY1MKRDcMl14LazrUINn/SuTFu9Ez5agKMVik3i99ugsh7tC36L8P 5CsXkik5dp31L4FjItxB424LZya+T635jPGX3/TWXzhiba+KN2xd79ZVt8+bkiSgq+18 fLqF4c/XHEIDsbBk4kYf9K0/b914FSuZxvcrI1pHTm9Ue80UF16+kRAc0Ms+56pOD3fn 26cgZW7xAmne/DFPuXGWbCM+rtMsKtapmKafzUqoeSYUfodyWevZAS0hiJHyxsMWTPso 05Eg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=sNA18t3V; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d1-20020a056402400100b00458a650f3fasi9050143eda.409.2022.11.21.03.29.14; Mon, 21 Nov 2022 03:29:39 -0800 (PST) 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=@google.com header.s=20210112 header.b=sNA18t3V; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231214AbiKUL1H (ORCPT + 99 others); Mon, 21 Nov 2022 06:27:07 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51980 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229677AbiKUL0P (ORCPT ); Mon, 21 Nov 2022 06:26:15 -0500 Received: from mail-wr1-x44a.google.com (mail-wr1-x44a.google.com [IPv6:2a00:1450:4864:20::44a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5E233C0505 for ; Mon, 21 Nov 2022 03:21:50 -0800 (PST) Received: by mail-wr1-x44a.google.com with SMTP id s25-20020adf9799000000b00241d0801f31so951855wrb.11 for ; Mon, 21 Nov 2022 03:21:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=+5wrCbW2TNaYb01/tuYYFENHET5JL1U7hc5fWA+Xdi0=; b=sNA18t3VIhj8s/MCrsotPK65Vcuz2YR1Xj8oe9nNH5vPzwm6iPZt2X0Fc7s0yeYNzk kcVq/GLKNy4xCjOiN3dPQ1eu2GOqYtIQk02hkZfOuEd7mV/pW1ZKoMoAKwdk/WlkUczu VEFwbOMmBucZuvB4dVzjoZKobIlVhdSdhk1gHj3NlcrOxfhykMBq02Ddpx/UAcenV2d9 H6fFjTIDn+cvMsYeIEIrhjMZZ74aEv343aMnLSTE4WGvBXcbncZGKe/wfws0QqQql7yX hbiDel8fgY1EKqDLgmq6zrkoNXrs0hkyg/paKn/mCux/h6gYGaXO8Q9fqkElW74W+eCO HxRQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=+5wrCbW2TNaYb01/tuYYFENHET5JL1U7hc5fWA+Xdi0=; b=JH1/Q7JbbVbRDFJJh3oLBBRl1i1AYlF1uTDnzI23Fgqh2MLJTjVZU0ZV6KXxTWMroG 2v6YFP6Dv5nyGfeuvLodG/s+4fw+Rfn3YfgfF+Bz+GKHknyaujQxHVc8Gt2mAt6BYyWM iopuHlVPbv1HWiV+cle+TemfRQFn+gR4zKVuQOdtWlw7CBISwSfTaisLeidoHCSx93Jo 77dPrpNWuFuuvi77sqaRDyhPtSQ2Q/moEQAzD3EMBji7pzwS3YASxdmbQEKEjpVAsC0d z80UKN3cQWk5JpfDm0h2jgyrw+E9KEt7uWqHEoxSfQoIkTS6r1Y8i69roh2pUGWBWUYq StYQ== X-Gm-Message-State: ANoB5pkZobVTXHGGpWxIaHTf8w2fncv3IrO1RapaojevyCjWlpN/pxbe V0do/V3x5vbY90p0aKt+FMBceeU22/g= X-Received: from glider.muc.corp.google.com ([2a00:79e0:9c:201:db68:962:2bf6:6c7]) (user=glider job=sendgmr) by 2002:adf:f086:0:b0:22e:3725:8acc with SMTP id n6-20020adff086000000b0022e37258accmr2585059wro.330.1669029709011; Mon, 21 Nov 2022 03:21:49 -0800 (PST) Date: Mon, 21 Nov 2022 12:21:34 +0100 In-Reply-To: <20221121112134.407362-1-glider@google.com> Mime-Version: 1.0 References: <20221121112134.407362-1-glider@google.com> X-Mailer: git-send-email 2.38.1.584.g0f3c55d4c2-goog Message-ID: <20221121112134.407362-5-glider@google.com> Subject: [PATCH 5/5] fs: hfsplus: initialize fsdata in hfsplus_file_truncate() From: Alexander Potapenko To: glider@google.com Cc: linux-kernel@vger.kernel.org, akpm@linux-foundation.org, tytso@mit.edu, adilger.kernel@dilger.ca, jaegeuk@kernel.org, chao@kernel.org, linux-fsdevel@vger.kernel.org, linux-ext4@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, Eric Biggers X-Spam-Status: No, score=-9.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL autolearn=unavailable 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1750104988850788031?= X-GMAIL-MSGID: =?utf-8?q?1750104988850788031?= When aops->write_begin() does not initialize fsdata, KMSAN may report an error passing the latter to aops->write_end(). Fix this by unconditionally initializing fsdata. Suggested-by: Eric Biggers Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Signed-off-by: Alexander Potapenko --- fs/hfsplus/extents.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/hfsplus/extents.c b/fs/hfsplus/extents.c index 721f779b4ec3e..7a542f3dbe502 100644 --- a/fs/hfsplus/extents.c +++ b/fs/hfsplus/extents.c @@ -554,7 +554,7 @@ void hfsplus_file_truncate(struct inode *inode) if (inode->i_size > hip->phys_size) { struct address_space *mapping = inode->i_mapping; struct page *page; - void *fsdata; + void *fsdata = NULL; loff_t size = inode->i_size; res = hfsplus_write_begin(NULL, mapping, size, 0,