Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp1464956rwl; Thu, 5 Jan 2023 14:08:21 -0800 (PST) X-Google-Smtp-Source: AMrXdXuQfBfAv0EMVJu5P0C/B6ts8rAZ7Cb6GsTB+WQ2etfDJzu0V8a4AuFDskQOpqxbAw1vHFM5 X-Received: by 2002:a05:6a20:9585:b0:af:dbe9:4466 with SMTP id iu5-20020a056a20958500b000afdbe94466mr61054617pzb.31.1672956501083; Thu, 05 Jan 2023 14:08:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672956501; cv=none; d=google.com; s=arc-20160816; b=nlKs6A2+cM0vnzBw1C1shfJgXRc7pfTutPqsmC7tbSjNZBFKtWvVf2TAFbY3BrKpFW 8yNzQ1StKMzzjWLmj/UdoU574ULIYT11KwcQ0EGSx/wwaF0S63bKWPTYWknnUbIhPQmR 1C9CXcMOKDZ/dNySOS2x733xtrUmb66AjJ73crxFbPCRhCxDBf7kHRZrEOIg6sFP2NgH r1xpnOKlE1KR/UEh5OSp2JRPslfjGENX3LvczF35JNDQN3mdHjtN1obcCE/+WGEUPyMR zor8tOyasTgfh8O4gUJmNB4EZ9VkDC1Q0WawTkSQdisFI3hvUie/qPVoZOyPQQz3SvVZ rmvQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=AiDogmSekfQ136iq07144KY/Kq2S6U3J1wMNG/6kVak=; b=zktbOVjbcz7mrHRKMYvOmBq5F7Lj6LZ2OfHcYXnXzYvqTlGkE2fIHMIJ0hBsdaQ2cS 6Zx+n4HFCRkei81wcdf905JPIui17jUvs5etHjGrfVEnHPn94L8vRE41E1NG4BajON4F fXA21+aDQE16pMo2u/xNFpGdj4k8n69FFrGedM2js9RAnASTdpNtSUP8Ih4ppRAkJxKY InHj5/Sre61//MHz/bMjb7SBe61ZV09YyZUasAVIg06f0S8Vzxr5LOVHhTB+jJowTNJL g9SQjuDeTcoxVaEe/yHLjKvdXghY3BjFkAmjywrRJpZPL1Tl2htvVhhVBxzQbVUnULV+ X61w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=fMVHXBR9; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g18-20020a63f412000000b004784654214fsi38144421pgi.442.2023.01.05.14.08.12; Thu, 05 Jan 2023 14:08:21 -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=@linux-foundation.org header.s=google header.b=fMVHXBR9; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236067AbjAEVyo (ORCPT + 55 others); Thu, 5 Jan 2023 16:54:44 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40486 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236015AbjAEVyU (ORCPT ); Thu, 5 Jan 2023 16:54:20 -0500 Received: from mail-qt1-x829.google.com (mail-qt1-x829.google.com [IPv6:2607:f8b0:4864:20::829]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CFB04676DD for ; Thu, 5 Jan 2023 13:54:18 -0800 (PST) Received: by mail-qt1-x829.google.com with SMTP id a16so31190080qtw.10 for ; Thu, 05 Jan 2023 13:54:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=AiDogmSekfQ136iq07144KY/Kq2S6U3J1wMNG/6kVak=; b=fMVHXBR9f8COfqWuTLGIOdUfjxsWONJHOpmAedSE6QNMQXzIKWtSIeEaIowL951f6a v2/YTCyesQk0a+DcPRVmUX9F+EVNzVbxhY0/Wqa9dKGl36gIUUMd60gbkZsuFHkclYV3 Tw1uzLULJMgrKgxKfeXDnbaa5pFPV+dBFzP0A= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=AiDogmSekfQ136iq07144KY/Kq2S6U3J1wMNG/6kVak=; b=YL1ezs0KnPtkyMfSsONI9OpfWAIA+OJU2zawGFMdDnljY8RDmLaopZQFAmnAM/x30y 7X+QXBO32WfluC6PxLIl/9KL7PkDdGD207EPDdH6+E1ZthrIW4QPuFS4yjr3qr6p6KIB 53avaVs6WVyr/i0m3RoHmFU2iVJo4klW/chrYwycIO7k5ibYdJQWgUs8diliX23YPQPj /VpUyRNoOp6ZQK29m8oZslkBOS4OJ+PO/Nb6BQTiuayGi6qHBR4LD4/JVz+C1mF8ZuJl jdzqSeZKQZXgZ0avp/jpNNgvMFQcf88LX8+hkmDFMwLfxDO4GezHXCnyFM4aIIOyt2f5 QLPA== X-Gm-Message-State: AFqh2kqUIpSFyd+j/HzajGnT6ddFQtxmM67X83nzasLyPxoUQ7qK4lbW nwuD4H+8FkZ7BYemBMrZPWYB0HTCaSIM2xsa X-Received: by 2002:ac8:4f53:0:b0:3a7:e02e:7cc4 with SMTP id i19-20020ac84f53000000b003a7e02e7cc4mr68170986qtw.32.1672955657432; Thu, 05 Jan 2023 13:54:17 -0800 (PST) Received: from mail-qk1-f174.google.com (mail-qk1-f174.google.com. [209.85.222.174]) by smtp.gmail.com with ESMTPSA id d136-20020ae9ef8e000000b006fae7e6204bsm25775391qkg.108.2023.01.05.13.54.15 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 05 Jan 2023 13:54:15 -0800 (PST) Received: by mail-qk1-f174.google.com with SMTP id k3so18548961qki.13 for ; Thu, 05 Jan 2023 13:54:15 -0800 (PST) X-Received: by 2002:a37:a93:0:b0:6ff:812e:a82f with SMTP id 141-20020a370a93000000b006ff812ea82fmr2294231qkk.336.1672955655473; Thu, 05 Jan 2023 13:54:15 -0800 (PST) MIME-Version: 1.0 References: <000000000000dbce4e05f170f289@google.com> <5f45bb9a-5e00-48dd-82b0-46b19b1b98a3@app.fastmail.com> <1bd49fc0-d64f-4eb8-841a-4b09e178b5fd@gmail.com> In-Reply-To: <1bd49fc0-d64f-4eb8-841a-4b09e178b5fd@gmail.com> From: Linus Torvalds Date: Thu, 5 Jan 2023 13:53:59 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [syzbot] [hfs?] WARNING in hfs_write_inode To: Michael Schmitz Cc: Arnd Bergmann , syzbot , Andrew Morton , christian.brauner@ubuntu.com, Damien Le Moal , jlayton@kernel.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com, Matthew Wilcox , ZhangPeng , Viacheslav Dubeyko , linux-m68k@lists.linux-m68k.org, flar@allandria.com Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS 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 On Thu, Jan 5, 2023 at 1:35 PM Michael Schmitz wrote: > > Looking at Linus' patch, I wonder whether the missing fd.entrylength > size test in the HFS_IS_RSRC(inode) case was due to the fact that a > file's resource fork may be empty? But if that is the case, then the subsequent hfs_bnode_read would return garbage, no? And then writing it back after the update would be even worse. So adding that + if (fd.entrylength < sizeof(struct hfs_cat_file)) + goto out; would seem to be the right thing anyway. No? But I really don't know the code, so this is all from just looking at it and going "that makes no sense". Maybe it _does_ make sense to people who have more background on it. Linus