From patchwork Mon Nov 21 11:21:30 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Potapenko X-Patchwork-Id: 23676 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp1524951wrr; Mon, 21 Nov 2022 03:28:02 -0800 (PST) X-Google-Smtp-Source: AA0mqf4hw6BSAKVhH579spKWXtHoCbLWaPjVGtuR/eqrmXALk4arAihH0+P17+RnLGCxjSJz30vB X-Received: by 2002:a17:906:4309:b0:78d:36d7:92ae with SMTP id j9-20020a170906430900b0078d36d792aemr15501886ejm.113.1669030081824; Mon, 21 Nov 2022 03:28:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669030081; cv=none; d=google.com; s=arc-20160816; b=mAOV8BIIzVUMQw+kjK9qt2QlSDyWP4f72ijYqzNEGovryPe5f5adLIwenseVPXMHLT DBFpCLEyntGPTS00mZJd4thU/j7bsMkuYy8ewRce4VgMlbMwDk3UwJ76+Ap/Y+Y30ksf RyLNFKZNx5C98lfKHsjMxH9ubRZS8x935mw4swLOXqibuzfvEisSCVdwFxhcuSNyPz1t MTqKDSydrtrq9WrEFRbjYjQn+09ML3XOaBJWTulHXbckllRr/6PzvVTkjga60FCQzf1Z ZrE2DXe2DEHUmSaFaYiavDIl/ZjM0ujadY9XQsk2kyT8Ktrhx6Df8lKiTEIo9MvnOf2N 8abQ== 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:mime-version:date :dkim-signature; bh=Ut094+1HiZ4Cjb1djYz8ZPvCLMxdVr+mJo3AtkrOKCA=; b=BR11xgA/ON/9gKbPuN+ftz/6hhZn4X+RF/7wziVsq6lZ7xyUFPIe62L/ZWTVmdp3Br dUfE1oBhuxefVIH3+s6o2pOnHjCq0TgbpRoG15a+dKwIKsPiWIaS8HcwtzA05zxuPNRc 2bSPCD+cd5gxT14NIo2Qn8LC4F3XuZzD+NLmsAeesQMMDR5G8uCPOoJnSFrW9TvKpJSt 0NI6l2Wo1Rb2+CkJXRILZ1r71Si0PR2PcU3k6NUAo4p6BBhmB0b050VqRcO5K/WjUAWF 70OM/Kexfektt9BchxpZiwMtrHMNLHvaVyxUemgaQ7dT2wM0fnP6u1opRa9kGL40x24x G0Fg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=PtZTUVzn; 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 sa27-20020a1709076d1b00b0078d93245e23si10364955ejc.791.2022.11.21.03.27.37; Mon, 21 Nov 2022 03:28:01 -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=PtZTUVzn; 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 S229905AbiKUL0l (ORCPT + 99 others); Mon, 21 Nov 2022 06:26:41 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52814 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230247AbiKUL0J (ORCPT ); Mon, 21 Nov 2022 06:26:09 -0500 Received: from mail-ej1-x64a.google.com (mail-ej1-x64a.google.com [IPv6:2a00:1450:4864:20::64a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CF360B10DC for ; Mon, 21 Nov 2022 03:21:39 -0800 (PST) Received: by mail-ej1-x64a.google.com with SMTP id hs34-20020a1709073ea200b007ad86f91d39so6492735ejc.10 for ; Mon, 21 Nov 2022 03:21:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=cc:to:from:subject:message-id:mime-version:date:from:to:cc:subject :date:message-id:reply-to; bh=Ut094+1HiZ4Cjb1djYz8ZPvCLMxdVr+mJo3AtkrOKCA=; b=PtZTUVznvnflFwUv9SKypxZQqr7i1LRYenCMrhMEOVGiPfxccwpjsY0A4YtFeeVnlF h2lGU/CX2UGfxpSXxpMO1krIzX7InkrGi25tw16FUZGnYRG+48rz3JaSCOEXLpqgE/EM opVGk0Q/rJdXGr0oIG5tziMO7oWC8RwHnTFpjZTCghBdovVeuHaJ0UfGVV+HSRF+Mevy v/vENEx2/1GIDj3F6RVT8uC+lujEgt6uMMFBYmaBcrnbZqaZYAVFDM7x70bVO4+mtAA4 t18AcVUc3fi2I1HwUNs+HNibRi0u8zeQUEKGIUhxxWoUi8pcajXw5PvuDm5HDd/vf0M6 Dc+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:from:subject:message-id:mime-version:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=Ut094+1HiZ4Cjb1djYz8ZPvCLMxdVr+mJo3AtkrOKCA=; b=JoobevLEXLEwsjpSMKZnR/4TGAzG3/OYg+UnnJUpZrT36Hf+wcxaatqonsiVnygErD 9ZIXmOharFTj/mZm9JqtUMouNv96u3gUckCDsxjGhyQdqXOhkdCVLbjSC1ixS41yarTV 6xw62fkN9MZxKvbl4yDs0BVcejM65IMgy1V7LalENF2nHspdQSibUz7ijYsnwD0I24WG EZ9TXm7ioQH8NLzlEgT2y28/Yg1CGfFK0Jl4NpfGHU6dQmDIdxPnIk6Qb5V6tnQI3nu4 rJnNe9a1f2K8vFE48kgPajLnbnfxycYDv5O7R9j126soEjRQaat6sg7rSQ09fbA3NZd8 wa1A== X-Gm-Message-State: ANoB5pk3jYbL+Z0+vFeWz7VsEauMIDx0LcVg1om8j00uZ2iP06C+ztDO lOi1+vcVOXajI6C+i7AdYABKyc0/nTE= X-Received: from glider.muc.corp.google.com ([2a00:79e0:9c:201:db68:962:2bf6:6c7]) (user=glider job=sendgmr) by 2002:aa7:c788:0:b0:458:b9f9:9fba with SMTP id n8-20020aa7c788000000b00458b9f99fbamr16132478eds.305.1669029698340; Mon, 21 Nov 2022 03:21:38 -0800 (PST) Date: Mon, 21 Nov 2022 12:21:30 +0100 Mime-Version: 1.0 X-Mailer: git-send-email 2.38.1.584.g0f3c55d4c2-goog Message-ID: <20221121112134.407362-1-glider@google.com> Subject: [PATCH 1/5] fs: ext4: initialize fsdata in pagecache_write() 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 , syzbot+9767be679ef5016b6082@syzkaller.appspotmail.com 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?1750104886891446038?= X-GMAIL-MSGID: =?utf-8?q?1750104886891446038?= When aops->write_begin() does not initialize fsdata, KMSAN reports an error passing the latter to aops->write_end(). Fix this by unconditionally initializing fsdata. Cc: Eric Biggers Fixes: c93d8f885809 ("ext4: add basic fs-verity support") Reported-by: syzbot+9767be679ef5016b6082@syzkaller.appspotmail.com Signed-off-by: Alexander Potapenko Reviewed-by: Eric Biggers --- fs/ext4/verity.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/ext4/verity.c b/fs/ext4/verity.c index 3c640bd7ecaeb..30e3b65798b50 100644 --- a/fs/ext4/verity.c +++ b/fs/ext4/verity.c @@ -79,7 +79,7 @@ static int pagecache_write(struct inode *inode, const void *buf, size_t count, size_t n = min_t(size_t, count, PAGE_SIZE - offset_in_page(pos)); struct page *page; - void *fsdata; + void *fsdata = NULL; int res; res = aops->write_begin(NULL, mapping, pos, n, &page, &fsdata); From patchwork Mon Nov 21 11:21:31 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Potapenko X-Patchwork-Id: 23678 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp1525693wrr; Mon, 21 Nov 2022 03:29:36 -0800 (PST) X-Google-Smtp-Source: AA0mqf5bG4jf3DiMZHA2ULzlnPevEPmhPKfBTava7bwMZ22sD02Q73P2LtDu1qbiCVBULnO9yc4f X-Received: by 2002:a65:5546:0:b0:470:8f8b:c9e0 with SMTP id t6-20020a655546000000b004708f8bc9e0mr333908pgr.390.1669030176183; Mon, 21 Nov 2022 03:29:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669030176; cv=none; d=google.com; s=arc-20160816; b=F+yGiG+GbEIrJMElgWU5VwcWL1paTFnVjotniTQitd2ZeuYjDQt94MWXRAeSfQvKOt 62B28weXbrvoI42WddtqfU1ZqPZjHuabe0gXPjQJhiqqpSdkYafgIM25Y9/9RcSoumF5 F5vUS5VaYHB/MUX6aaQKGrD2+U2w4i5o1KAakrsxR47Y7uHSUPDQT9j3i7RBognz8Rl7 ChtP2rLN7MnFxeIZwRe7OipUt2E9L6Pb5yFzo/+4oDva3OdQFrklP7LmlmGd8GCTbHQk mGqzzNbsdn43uKblKK7F28krfGkyaLQCmBymyXVtSY7jSIKL/DM/bFhXom6yxQqWP4fP jZBQ== 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=V66iN5ZNYfCs2IKwl/XWPfYUEeh8Am+8/6YCzEI2D8c=; b=Mh0yx5kWjBDDXv28WqnOn8HYGUUKZiXUYDSYSvyJi6keaI/b8GnQ7YVxEZjlE2DLbn 3ClsH5rz8FolNgpdw/nSNJ5eujwel2NsgO3cEENyLEdrv2RbZTXz0z2SzNkcKO9Ln232 Z5vmwZ9bgspi6rLIugUG470kFVjxtlRQWP0bpi8rurXuMX43OUoIRdnaLWswWm8S1v3e AwsqCQlEOHgkc/HgfQHFfHgOLjUcyRxMYGBiSvlVquw6AiDGUF+JYWluPojVJpmENuPx wc38+AZtXPTEOB6w8y0Djso8qhkGm/t46qYLgUgWdWJJMn3k4Fq7zmhzPRXbSryVOcXt bFFw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=DrqkFhwq; 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 t18-20020a63b252000000b0045d1aa2a586si10572842pgo.197.2022.11.21.03.29.21; Mon, 21 Nov 2022 03:29:36 -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=DrqkFhwq; 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 S230104AbiKUL1M (ORCPT + 99 others); Mon, 21 Nov 2022 06:27:12 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51774 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230309AbiKUL0M (ORCPT ); Mon, 21 Nov 2022 06:26:12 -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 8327DBFF63 for ; Mon, 21 Nov 2022 03:21:42 -0800 (PST) Received: by mail-wr1-x44a.google.com with SMTP id u24-20020adfa198000000b00241da98e057so616739wru.22 for ; Mon, 21 Nov 2022 03:21:42 -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=V66iN5ZNYfCs2IKwl/XWPfYUEeh8Am+8/6YCzEI2D8c=; b=DrqkFhwq+x32T++mKGiLwBwBQlLcPegquOjKmY4DA36Bdlu1UHyvmrWX1hBJRhVkQ6 CuCW3GY8rqEftTjZZrLMe7/mkVQz7UfhK+xIE67b7ScIXkJpIv8j5OGL6cLYo9+mckRB K7uXn7jnhwdTz8CKtd1PZLB/aUu4HHTidPyJYgxXX5idXFCZCOZVGyv8hmv6enXEqnwn sySci2PTifGmbTVUqgKzOGBN+JGcWBPg2j+F9wLZjNT18VaSguq8lzh50Et/vzVO1B6Q 2Y+EGhsTlaR3AYtHfVR7KGPKNpJOX8E3kDw+u1VmZZUxfQ8uANGRO5Nfw1xQZ/dSm2xH GfuQ== 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=V66iN5ZNYfCs2IKwl/XWPfYUEeh8Am+8/6YCzEI2D8c=; b=Qdiv6Ox7gfXn6bAjKPIQqbHiv9Sxt9wW/pJ6rd2M4LR7OJCNY9Hplaq7Fw0YEVw+EO 2ItmXLQD5y6tzkLhmH2r6p/2HENllYXaUxcr+Qd3w+enarf0R/tmuhMjxcLI33jePu5Z 0w1BzUInc7R9GidZ7eiczKpC1RAclQkHj97JYPdUBXDTjoAXmxiloYRSCqtFtGRHanx8 hygufpX2646JL0GEElMHcvZQdrB64BKsBJog9E2wWPu+k39vCtciQ77dhT0EB0Dol+Pn hzrLEQLtjMGBszOdW7j95tmrbIxsUMnh0V3x7c4f0E6KGwE+26mBgLbgWYrdN7KrLHOI BEAA== X-Gm-Message-State: ANoB5pmwAa7rGnBtROD6CgtF5lS/CdgON4Xb+mTF4gcGsilH3mog/Cs/ Qljwv3bvh/PdoY7fLVwoYjmSxkA9flQ= X-Received: from glider.muc.corp.google.com ([2a00:79e0:9c:201:db68:962:2bf6:6c7]) (user=glider job=sendgmr) by 2002:adf:e50f:0:b0:22c:cc75:5aab with SMTP id j15-20020adfe50f000000b0022ccc755aabmr10402338wrm.143.1669029701044; Mon, 21 Nov 2022 03:21:41 -0800 (PST) Date: Mon, 21 Nov 2022 12:21:31 +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-2-glider@google.com> Subject: [PATCH 2/5] fs: affs: initialize fsdata in affs_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?1750104986087320637?= X-GMAIL-MSGID: =?utf-8?q?1750104986087320637?= 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 Acked-by: David Sterba --- fs/affs/file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/affs/file.c b/fs/affs/file.c index cefa222f7881c..8daeed31e1af9 100644 --- a/fs/affs/file.c +++ b/fs/affs/file.c @@ -880,7 +880,7 @@ affs_truncate(struct inode *inode) if (inode->i_size > AFFS_I(inode)->mmu_private) { struct address_space *mapping = inode->i_mapping; struct page *page; - void *fsdata; + void *fsdata = NULL; loff_t isize = inode->i_size; int res; From patchwork Mon Nov 21 11:21:32 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Potapenko X-Patchwork-Id: 23680 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp1525771wrr; Mon, 21 Nov 2022 03:29:43 -0800 (PST) X-Google-Smtp-Source: AA0mqf7vrcnnz1pcUBVPOVLpVpCvUbqRx3OUHPqWJlHcJT3YODGqRcJJsFk7TGVoFP5NBxMFxQc+ X-Received: by 2002:a65:4607:0:b0:477:31bc:348f with SMTP id v7-20020a654607000000b0047731bc348fmr851477pgq.72.1669030183158; Mon, 21 Nov 2022 03:29:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669030183; cv=none; d=google.com; s=arc-20160816; b=s/c4jHvHLYVtjoCm3Y4xIEG+nsEjgpL9d3iRlL0uaZIp9UZTFU5874sTc4V+EYvolz p5q1GahKSbue1zJKVU10dc/xVW0dj5FdJg4T+hphGjyUIXzYPtQdwKshGeDdsCJsjS3h qLN3IUBz8O+md5Yu7s+JoZ2kZMDs5TUPb+oYtHun2+J/7Neehq1sBG6K/sJgM9OS/Qe3 n98nOu+PP/AwNEE6kvnr5P0bEDGRK5TLnUIidyMdMGlKN1rXsrE4XHMnaveViBrsldDZ iWfHgQr68WyIYihLoXSpMWSBYxCQYstXNpoQE0GoJx0IIApd27EMYEm5sOLk8mzG0Bo/ HliQ== 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=V3ROk7430AgCjRwu8JCLeHALA6B0dvLhERaon//wlR0=; b=c71L9+qbBN2uou0MqE5YxgKIPNhf+X88rXeLfPazjZw5RHBnWdQ/apR19A0KNgm91Q XCmImqHTPvhyzDqqw3MJU0dacxtzg8UwDT52n6MTD4RBnU/kYZLf1Ar25EHwsyaETX3o GTPDHKyuqzlZ1p7KZ1TwY4EiNzqOb9q/oAaodVV+dkcc4u+9Xgm3hGk6+/q3YmyTEfWD Szz53JNUnlUkKs+wcnkJuA7SW1XqVytx3A8mb6w81iqRj0sL+P86TvvalOlenfViQE0R hrizMQ1/0if/fnxrJnh0iR0CJOJpBPFNoLnAVGLmwGkRYk1Dmx9L8nnyA1CvUNeiQz9e Kadg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=VyCfbuWO; 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 l5-20020a056a00140500b005644806915csi11429922pfu.42.2022.11.21.03.29.29; Mon, 21 Nov 2022 03:29:43 -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=VyCfbuWO; 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 S229994AbiKUL0r (ORCPT + 99 others); Mon, 21 Nov 2022 06:26:47 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51916 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229922AbiKUL0O (ORCPT ); Mon, 21 Nov 2022 06:26:14 -0500 Received: from mail-wm1-x349.google.com (mail-wm1-x349.google.com [IPv6:2a00:1450:4864:20::349]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2DB31B6B29 for ; Mon, 21 Nov 2022 03:21:45 -0800 (PST) Received: by mail-wm1-x349.google.com with SMTP id e8-20020a05600c218800b003cf634f5280so2974577wme.8 for ; Mon, 21 Nov 2022 03:21:45 -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=V3ROk7430AgCjRwu8JCLeHALA6B0dvLhERaon//wlR0=; b=VyCfbuWOem8BwV+1kbZt92/iURKerhApO5tHJL82Q3g8gJjhEf8Gf81lkNXinPV0WG 33XKENJFJcX8AOPHW1fpifSRoqxXlHBwqxVqieU0qAQ3CQLak9yv9kSmC8Cd+mpuXWqA dMw4MYS/tqwBn9HATfin7JwAng24nM99T15wf8oiaR3VGtSchxTXvOchJ46VW/seRWPz sXs38pJvJqRP0PnnJsEFB9KY5UE+hWn5HdPDuNxMBW9IoYXeVIqpE2I6F0yMLJyOGUuI BmntwbMnaWN9YoJTyImpLCf9dUeBmBP1Zw2C7sgj5r2JExdS6DMuSGOCl6Jd1Ab+9sfj 6cPQ== 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=V3ROk7430AgCjRwu8JCLeHALA6B0dvLhERaon//wlR0=; b=rz1WRjAJmlmpje5fSj1vcoH+t+EXkJrfRceD6XXXsPcT//tIFCFkXxh2ib2h+oWfcS ctf916bbNgUvA9okzvNcGWeDNsFgcXcFDcflZtPWjs2KTxu+607ZSjXnOUA75k/Re2K7 Ejz+Y2HZ2pJhyRJHPINjAtIYyyycXSGifu7ci4rwiy0os85FYnGakFZiQBPDqvxqBYrg n95s9UFR9fLdKcCg/1obeYs/G5L0VEh8tca0Wn4JUWoetCQ3nCfsBLsFkycRjfyWfZBp IIoB7bW8Ed7PIMe2sTXeAphPjx6dRMBEoYfA3UEcu1flKwuO2tf7HurcNfiAWvcNHs7x AF2w== X-Gm-Message-State: ANoB5pn7+Dd0rroirE2MH8vtnngzueZG7dqVFZ8uux+wj/BSo7cZ0FZc iMp3GWjEfnWCL8ThVpIhy9o2FASYTrg= X-Received: from glider.muc.corp.google.com ([2a00:79e0:9c:201:db68:962:2bf6:6c7]) (user=glider job=sendgmr) by 2002:a5d:6706:0:b0:241:cf90:ab1e with SMTP id o6-20020a5d6706000000b00241cf90ab1emr1020206wru.685.1669029703858; Mon, 21 Nov 2022 03:21:43 -0800 (PST) Date: Mon, 21 Nov 2022 12:21:32 +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-3-glider@google.com> Subject: [PATCH 3/5] fs: f2fs: initialize fsdata in pagecache_write() 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=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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1750104993195490170?= X-GMAIL-MSGID: =?utf-8?q?1750104993195490170?= 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: 95ae251fe828 ("f2fs: add fs-verity support") Signed-off-by: Alexander Potapenko Reviewed-by: Eric Biggers --- fs/f2fs/verity.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/f2fs/verity.c b/fs/f2fs/verity.c index c352fff88a5e6..3f4f3295f1c66 100644 --- a/fs/f2fs/verity.c +++ b/fs/f2fs/verity.c @@ -81,7 +81,7 @@ static int pagecache_write(struct inode *inode, const void *buf, size_t count, size_t n = min_t(size_t, count, PAGE_SIZE - offset_in_page(pos)); struct page *page; - void *fsdata; + void *fsdata = NULL; int res; res = aops->write_begin(NULL, mapping, pos, n, &page, &fsdata); From patchwork Mon Nov 21 11:21:33 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Potapenko X-Patchwork-Id: 23677 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp1525623wrr; Mon, 21 Nov 2022 03:29:27 -0800 (PST) X-Google-Smtp-Source: AA0mqf5jSbJSUfBzt6ziwM9JK5QocQaMK0bKiLBTcqbcwS5Ntd0O+CLELQ8dkZgnkgZ3+Efip1pj X-Received: by 2002:a05:6402:3893:b0:461:b033:90ac with SMTP id fd19-20020a056402389300b00461b03390acmr4089065edb.257.1669030167134; Mon, 21 Nov 2022 03:29:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669030167; cv=none; d=google.com; s=arc-20160816; b=ZNjXVSG4t3cbcbavjE5h4I/KEYX8olM5yhcPBt+30akr2RrEBtlrILF3klKGqJEjJA ZgW4X/UzdMtGvbJi3fHAZNnlOAljvWVifyCHJ2tEXG64LasgCm+bderNrNDmvn3KePl7 wDX6QIavyOVGPyYWj8smOHof2BRmktWl36dVCxlhCTtZqvb6KABekWCkJWeM4vuJYiTc aiaurEK9kParP1E9mRR58LOpObZAahzqDNwew2TSQG7Gu0alpgVyHS3jV7yyraYgsPD9 NmlumF6Jw9dFxyV0afcGtA0pSr078vWPyuPILsDh/z5BsvMz+ll+BbLM0WzWPpC6a9QC Tfwg== 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=iseMGXVhmQtR+5DQv6vAmctq3FLXZ3Zx0bYYW0I3bps=; b=bCMjKQxAX78dJtbaPpmqmRu5zYnOtKPJRoTayv8RM/Iq8ux5/LiDeQuBSfI45QT4qs svEgR5kS5MBet1ZroGqEcEWDI4N1bTO29YHG2qgxFysiW+HUhFQnLwwjB48nyLXw6pRj QDIWg7OWFSE0b3r4nNI0hrerDRPZnYp/91BO8KJd78qjLemo5kMBs/vFc5C9/+KKmdvj CL1Zl0RW9xBkUdW2o1wjNvh0msC4Tpz1IOc+vcArOKRpo2Zz4gHEe7ByLYUxX6mcDGvH ifi1NRCGXx0dcooPQVVg2ndzntr9B38q5g/eQ90tTsG4FrJ/EzwkziA37IG4gJnC8goR B9jA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=fvoRIPmp; 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 jg25-20020a170907971900b007a7d37e4684si8689084ejc.803.2022.11.21.03.29.00; Mon, 21 Nov 2022 03:29:27 -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=fvoRIPmp; 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 S229943AbiKUL0y (ORCPT + 99 others); Mon, 21 Nov 2022 06:26:54 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51928 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230334AbiKUL0O (ORCPT ); Mon, 21 Nov 2022 06:26:14 -0500 Received: from mail-ej1-x649.google.com (mail-ej1-x649.google.com [IPv6:2a00:1450:4864:20::649]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E171EBFF6F for ; Mon, 21 Nov 2022 03:21:47 -0800 (PST) Received: by mail-ej1-x649.google.com with SMTP id hb35-20020a170907162300b007ae6746f240so6381914ejc.12 for ; Mon, 21 Nov 2022 03:21:47 -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=iseMGXVhmQtR+5DQv6vAmctq3FLXZ3Zx0bYYW0I3bps=; b=fvoRIPmpwjc9kwZJjlC8SWhtwYdajteuU8MNnEWUMvn5GkD+yGWYPUsDcdndaw8YjK fa13YD7A3DdjmU3EhEj99KaM6rOjUxJKB/d/QJYdnY6fqKOJgZkPoO8RrrWJe1U4umr+ hiUfjkhq3hMpxwynNBwHUtYJWY9QJy0HLcUfde1YnzFDialtNBgsAL/Lpaq6bDXTMM62 N5V2k9a1D0kusoUoO9/V+NmAYKbT5IpfYNf/E/G22Vwu5YTvASjATJcEIMrdADAeDQc2 MVVCkuX8C8EJypjMeMPM03N72UYeZDw46ri4QQG9SKF+2INt3aYRQ+JZ/H1xOpAorNwU 0etA== 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=iseMGXVhmQtR+5DQv6vAmctq3FLXZ3Zx0bYYW0I3bps=; b=3Yg7EojbQephbdOOJTJIITFZSRWEsBA0xyETRTkwwPojImLeTqUVcz/1jkyR5ksvCH JsXUwDVSoYI+4Wmq0o2fAbXsGqkZsX2YUZcfKdBRGG7QC159FrWj5UivRi981p6Ap9Zo VHue7SwwcaqbryQnAHK+rPgRMBD1nGbMK1Y9e3QfoNY8v0g7Bhch7To0rftNq0W908aR qvdBdFiKjPjle7BLG08+sTZyBRuQQPIVysV+XcbVPlwr1QAzSiet+gxcW/Fa9aOli06L FF4fDhQ91QRalxeHL8LHmTDCNM0m0eDMp8DJCFjeeTujbhFeEa+whtiFjUbt7oxEu24I zwRA== X-Gm-Message-State: ANoB5pmYggKTyhxlvZfeKyo3q+rLWNX/NGwucKOMF3rOteuTkhJsrKPQ at5lKhvmDURx/UHLPb+YaHHCriGj5XA= X-Received: from glider.muc.corp.google.com ([2a00:79e0:9c:201:db68:962:2bf6:6c7]) (user=glider job=sendgmr) by 2002:a17:907:8b13:b0:781:541:6599 with SMTP id sz19-20020a1709078b1300b0078105416599mr3206798ejc.45.1669029706445; Mon, 21 Nov 2022 03:21:46 -0800 (PST) Date: Mon, 21 Nov 2022 12:21:33 +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-4-glider@google.com> Subject: [PATCH 4/5] fs: hfs: initialize fsdata in hfs_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=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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1750104976845517489?= X-GMAIL-MSGID: =?utf-8?q?1750104976845517489?= 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/hfs/extent.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/hfs/extent.c b/fs/hfs/extent.c index 3f7e9bef98743..6d1878b99b305 100644 --- a/fs/hfs/extent.c +++ b/fs/hfs/extent.c @@ -486,7 +486,7 @@ void hfs_file_truncate(struct inode *inode) inode->i_size); if (inode->i_size > HFS_I(inode)->phys_size) { struct address_space *mapping = inode->i_mapping; - void *fsdata; + void *fsdata = NULL; struct page *page; /* XXX: Can use generic_cont_expand? */ 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,