From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f44.google.com (mail-wm1-f44.google.com [209.85.128.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 620053B6C00 for ; Tue, 21 Apr 2026 10:43:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.44 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776768205; cv=none; b=kgJWa79fvUQohqbNL0UpVgMFInU29WN9GC2OpTozj2JA0h222oDDx3AoGx6FO70PXQySYzGjNQFmQO0sjF7xuC1ldQXtBLpYpMAUZMSIcCk0Tnykv8X96zrTIVSMpJuHvJ68cene5FfkqKX4G8RR/vv43IX5gUlKTdfZm3yUXjg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776768205; c=relaxed/simple; bh=aP0lPJ6UDRCs3klI8R2iWMLw4Mz1jP808DcQt3T8elw=; h=From:To:Cc:Subject:Date:Message-ID:Content-Type:MIME-Version; b=ORznnASLLw8NCaKvfWTqh2RzUqMhL6g+VQNuTXMIjTwmr30a9wUhnOmNliGu8eohYwAg21WImjByWOkI/zIxgM54kdK5LRtzAZBkBwGAtfjVvsRS6v5u41jGYFH2toQh86UHqVUhNqc8cRWNVrHW5hb2dD+Ucr0oCHJ3onBGApM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=DOy3V98y; arc=none smtp.client-ip=209.85.128.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="DOy3V98y" Received: by mail-wm1-f44.google.com with SMTP id 5b1f17b1804b1-483487335c2so41450985e9.2 for ; Tue, 21 Apr 2026 03:43:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1776768203; x=1777373003; darn=vger.kernel.org; h=mime-version:content-transfer-encoding:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=aP0lPJ6UDRCs3klI8R2iWMLw4Mz1jP808DcQt3T8elw=; b=DOy3V98ymIVu/hrsNeFB4DXt5sShMYk+0wE9hI+BfZ24mDbZbz/h2wzO9rNQOp2lLk Fk7kfjp1o17Y3gchUnhGRQs4obJ4aQfHcztNMIYycqtZ6TSuo7kwht4v8f5qW589h5D8 wotL+eSc6i8h5mNdPmkdwmYpYf3dbdWH3MGiWPsSreIbVqSk62F/42zJFGxx2hK23BQf pgDsO2jfoP2f4XTGhmtU605lTXM0+lGdAnWE57irjh7CJehlW3s4QdTaybgQLHIjtC0f 5EgOhHY6USGAg7Kng8aCgSMIMfwQ69QwI+Qa1Rgmhhm/9ylVsqLzKh6utfq+tq5m1n0t o88Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1776768203; x=1777373003; h=mime-version:content-transfer-encoding:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=aP0lPJ6UDRCs3klI8R2iWMLw4Mz1jP808DcQt3T8elw=; b=ikbsbUkszaTxMkbI5ot53jUA2EvifPCcozpRBIOx+WOW8o0IUMptN7bXIOoRkuXjI4 1xst6srT2eo1dKZ43/4YusQnDfM/q8Y8T7YJ+LNNcpnInNCNb5cT0lZZdqmItJ9vFh5D JZP9VaZSMJd2Fci/XT+bkFAbtoGdeanvmPyZKLDq4dHwjaL13P0xadVC1WyOjlz+JCmN PiXqNbO52dQMGrVwDo7Vz52K+NePtZ4kIWB5o/46pf0rmalnFzbfZpo1R2QKUQHmar1Q Bcomx5uW4ErIKXZIkvtoBjGyCkpeuvBAmWe1WQ5ENWtgO2erb5kk9HSUALw8HVyhhOcb GoIQ== X-Gm-Message-State: AOJu0YzVcKerGzvU53QFgMWA0QnYBudknnzxwuOkZSX8tO0pef6JJO+I 1J7NgH3IXP1+8Mps2VbN6dUYhbM+GFq6TZ/CdzP/P3B2r3yK6eh9Erc= X-Gm-Gg: AeBDievbLHIkJrGBe6DtZWo8DGSQAzojGSx13upych4zRYXESrE5EUKvbqDM813pgSQ /yA0NZTflfLomMg7mKJiiSL9Mwq896wPzlRdcrC968pBtzP8Y73MvmyKQ4pO6z64sfrVmxS5ZBt xQISY92oEWOet3wpUEbPqfuVwBFxfG8HeO5agJvNllsUjMywi9/DZNJs11kzfrgHWR14XUlMq2d +yMAp++dRnDOa+A4i8xGFvTlz+A0dqLnlKTUE0JcS3ffwYUdJaeqDUK7uZDwN5omftiwJBukCQ8 ABtUKxYLxwR4Y84oXLOCVVBcdjJlUquKRVltUdpShzvc7lskfXvLAJiEY4vtE6teEnvFaDFlPnQ GeW4xhMiqJ7Ug7t5kP+MqKs21gI3xgr6jkmvRdsrgAPmPytmyWxQvwEaR9QgvF0ioX9SFqw6cPy 3h X-Received: by 2002:a05:600c:a31a:b0:488:b239:77ec with SMTP id 5b1f17b1804b1-488fb778db4mr185488585e9.17.1776768202538; Tue, 21 Apr 2026 03:43:22 -0700 (PDT) Received: from debian ([2001:41d0:303:db6b::]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-48919f54572sm65854675e9.26.2026.04.21.03.43.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Apr 2026 03:43:21 -0700 (PDT) From: Tristan Madani To: Jan Kara Cc: linux-kernel@vger.kernel.org, syzbot+969e250fc7983fc7417c@syzkaller.appspotmail.com Subject: Re: [PATCH] udf: propagate error from udf_fiiter_add_entry Date: Tue, 21 Apr 2026 10:43:21 -0000 Message-ID: <177676820132.2330022.14119116265609139764@gmail.com> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 On Mon, 20 Apr 2026, Jan Kara wrote: > Thanks for the patch. Did you analyze how it happened that the directory > iteration fixing up tags failed? Because if it fails like this, we have > practically wiped the directory which is not great. So if we are missing > some directory consistency check before we start converting it, it would be > good to add it instead of just failing like this later. Good point. The syzbot reproducer uses a crafted filesystem image where the inline directory data passes inode loading but contains entries that fail udf_verify_fi() during iteration (e.g., bad tagIdent or CRC length mismatch). The problem is that by the time we iterate in udf_expand_dir_adinicb() to fix up tagLocation, we've already changed the allocation type and moved the data to a new block. If the iteration then fails, the directory is in an inconsistent state. The right fix would be to validate the inline directory entries BEFORE starting the conversion -- iterate once to verify all entries pass udf_verify_fi(), then proceed with the block allocation and tag fixup only if validation succeeds. That way we never start a destructive conversion on data we can't fully iterate. I can send a v2 with this approach: a pre-conversion validation pass using udf_fiiter_init/advance (which calls udf_verify_fi internally), and only proceed if the full iteration succeeds. The error propagation from v1 would remain as a safety net in case anything goes wrong despite the pre-check. Would that be the approach you have in mind? Thanks, Tristan