Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp1443994rwl; Thu, 5 Jan 2023 13:48:07 -0800 (PST) X-Google-Smtp-Source: AMrXdXvquRgiXlKv1WJrP4c28hEx46mOG5SfJB9hP/6SFQWtw1o7T+ucmJuYFxjN8zzcV121AzFl X-Received: by 2002:a17:902:b591:b0:18f:aa25:46d with SMTP id a17-20020a170902b59100b0018faa25046dmr68903906pls.38.1672955286954; Thu, 05 Jan 2023 13:48:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672955286; cv=none; d=google.com; s=arc-20160816; b=m4jIlsi9SGtN2hyfnjwS9B7XFSz4W1tBMTTWyydS287y96tgNKDNzOjuznpHgm4Ymx GnNe6zP6Cj0EEkrajwugKSStb7wDowil8Ok2mLWQU4/zkFYxqSeMNKE6D5zwQfrw+5is tfFS6UKSLlbOuYZC4VD21o13K2GkIfdoalY+gtuPVEh2X2VmM+vTfChCBCKG5Ykfe2j+ 4C8dg1ZgL1CnVuerATmqoa56WHofn14fy9F/xaATReKTsLLMZG19oJIsS9YVgLWx69t2 WjY/8beYy9dzp9rStEjpdJtW5dq8amnvnuA8VTzcVLC71ds0Q7QW3rqrWuD7M+mvP7Qx bVXg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to :mime-version:user-agent:date:message-id:subject:from:references:cc :to:dkim-signature; bh=qS8dYeQhr6rkdNYW42bpwedt2Pigt8o7DrRMO2YKtVU=; b=OHeLxd9ZmOn4h4+fdO7hIOIlXeo8AxexW/sfz3eWfBtd7sXjQFPe9f9BuSBJznSYGK D/jvJ2cYu2qiDInXXsrIomk7CCLpNreYA5cxPONT6Pw2FuQbetVQL5HUmnmadSbmQk3f 6YnHMn3GeRgIjxyOjLW7y/0qLkdtHxOFpjqxQnDQ/ei+DFfJlAu9dDQnWEZluf9X20OX JRSruPwGIhW6GHl1BRO9htUeNcQfrxPGGGJj8wUpaJ1uFuRUPSgHqx0W3NxnMmqzAvG3 t13z1mIse09CYFLh+djVP95H9STwT/NN+P3qeEHGypCNECJGOtTebrZThb1/bmTPUXJu gSUw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=UCgyrtdL; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d17-20020a170903231100b00192cce3632esi12983833plh.117.2023.01.05.13.47.59; Thu, 05 Jan 2023 13:48:06 -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=@gmail.com header.s=20210112 header.b=UCgyrtdL; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235590AbjAEVfF (ORCPT + 55 others); Thu, 5 Jan 2023 16:35:05 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56918 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233552AbjAEVfD (ORCPT ); Thu, 5 Jan 2023 16:35:03 -0500 Received: from mail-pl1-x636.google.com (mail-pl1-x636.google.com [IPv6:2607:f8b0:4864:20::636]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2F85F6719F; Thu, 5 Jan 2023 13:35:03 -0800 (PST) Received: by mail-pl1-x636.google.com with SMTP id w3so9057259ply.3; Thu, 05 Jan 2023 13:35:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:subject:from:references:cc:to:from:to:cc:subject:date :message-id:reply-to; bh=qS8dYeQhr6rkdNYW42bpwedt2Pigt8o7DrRMO2YKtVU=; b=UCgyrtdLtFsbGmj/eBbq/f3ZZiJB/MKhu+RLWoa3idj3eAnIDuWC8TMlDlv7fVqkgS yDQuTp7NTBi87IpnaEHOvOogUuAsh1Q2MquSyivxTvRKZHpVO3JdAFQlxG8RPHCo0nxN ZvVH8ZoXwbVVGf9f4yH65qY+IkZnelbQGn7dOaVl8RPn9QnISWceookRfQk0g3nPkfpM +sfqiDANuikeNxN6Rhc6372iqF6pU950h2IDed+nfgMUvEiq97GfyatWdnmBUfr7TpM5 OkW8YWg0asew5JNPOgiSIGrzonn2qg1Og3y6SoOCDfRUzcFCfxFas++1qTWd4Kvfj1c2 5IJw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:subject:from:references:cc:to:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=qS8dYeQhr6rkdNYW42bpwedt2Pigt8o7DrRMO2YKtVU=; b=abKTeaGkJhks1OjliYKDXD1oKAabjp7peqDo4JMLIW4Xdh7xlAJjC6SloeF2aG1qF5 onIHYoSWiFRFrmmkPE7lab4sD8X9lb4RX2Z9RmxBaPiFuArjJfwyzb/AJKSuUvR03fUT 7T/tuH8uGcuVGdBIpbwHfZeYSzqIqn+zs6VxPPabIvZjjGvdVsS1JHV3sx8VwhrIjqcI VaGvpaShPBGF6ggdhtCM2EnWiBylGl3yecAohC7dotD6/Yj5nu5RqZwlE129uhuVYl8o x7yVEiTW0rWlap4yGSeGEOVIkM5P1hwjqzQqUSfztI5xNUawiaXlfT5hnLuy08zptmX3 uzUA== X-Gm-Message-State: AFqh2ko0z5du8OlOso+8trEx+kh+UoZ0Kf9Iix6rC5xKFfqkh/dpnsLb xBIu9FQAaBrW92b9uxNfe34= X-Received: by 2002:a17:90a:f698:b0:226:9f:e871 with SMTP id cl24-20020a17090af69800b00226009fe871mr34089497pjb.21.1672954502659; Thu, 05 Jan 2023 13:35:02 -0800 (PST) Received: from Schmitz-MacBook-Pro.local (122-62-142-61-fibre.sparkbb.co.nz. [122.62.142.61]) by smtp.googlemail.com with ESMTPSA id g6-20020a17090a640600b00225ffb9c43dsm1777712pjj.5.2023.01.05.13.34.56 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 05 Jan 2023 13:35:01 -0800 (PST) To: Arnd Bergmann , Linus Torvalds Cc: 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 References: <000000000000dbce4e05f170f289@google.com> <5f45bb9a-5e00-48dd-82b0-46b19b1b98a3@app.fastmail.com> From: Michael Schmitz Subject: Re: [syzbot] [hfs?] WARNING in hfs_write_inode Message-ID: <1bd49fc0-d64f-4eb8-841a-4b09e178b5fd@gmail.com> Date: Fri, 6 Jan 2023 10:34:53 +1300 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-5.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,NICE_REPLY_A, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS 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 Hi Arnd, Am 05.01.23 um 11:33 schrieb Arnd Bergmann: > On Wed, Jan 4, 2023, at 20:06, Linus Torvalds wrote: >> I suspect this code is basically all dead. From what I can tell, hfs >> only gets updates for >> >> (a) syzbot reports >> >> (b) vfs interface changes > There is clearly no new work going into it, and most data exchange > with MacOS would use HFS+, but I think there are still some users. PowerPC yaboot boot partitions spring to mind here. Plain HFS is still used in places where it can't be replaced AFAIK. > >> and the last real changes seem to have been by Ernesto A. Fern=C3=A1nd= ez >> back in 2018. >> >> Hmm. Looking at that code, we have another bug in there, introduced by= >> an earlier fix for a similar issue: commit 8d824e69d9f3 ("hfs: fix OOB= >> Read in __hfs_brec_find") added >> >> + if (HFS_I(main_inode)->cat_key.CName.len > HFS_NAMELEN) >> + return -EIO; >> >> but it's after hfs_find_init(), so it should actually have done a >> hfs_find_exit() to not leak memory. >> >> So we should probably fix that too. >> >> Something like this ENTIRELY UNTESTED patch? 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? Adding Brad Boyer (bfind.c author) to Cc. Brad might know what fd.entrylength should be set to in such a case. Cheers, =C2=A0=C2=A0=C2=A0 Michael >> >> Do we have anybody who looks at hfs? > Adding Viacheslav Dubeyko to Cc, he's at least been reviewing > patches for HFS and HFS+ somewhat recently. The linux-m68k > list may have some users dual-booting old MacOS. > > Viacheslav, see the start of the thread at > https://lore.kernel.org/lkml/000000000000dbce4e05f170f289@google.com/ > > Arnd