From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9AF07C433FE for ; Mon, 17 Oct 2022 08:33:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230324AbiJQIdX (ORCPT ); Mon, 17 Oct 2022 04:33:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38096 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230227AbiJQIdD (ORCPT ); Mon, 17 Oct 2022 04:33:03 -0400 Received: from mail-lj1-x22f.google.com (mail-lj1-x22f.google.com [IPv6:2a00:1450:4864:20::22f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3DCD740559 for ; Mon, 17 Oct 2022 01:33:02 -0700 (PDT) Received: by mail-lj1-x22f.google.com with SMTP id bs14so13047292ljb.9 for ; Mon, 17 Oct 2022 01:33:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=azrjkTSUa/x73/5WnmuPzRdP/HPez6bDQxOpksGkhRA=; b=a/oDAz3xURgSlah+zDO2fzFzfvSFrEjmCsQ5CtmV5wpy8/L51Q77OK5k7mJq+LosYE RDJCxvRoEXZS65qMQOnrKu6I9wkhUaPEiyHo/NWSrMkHLiva7vvcuRRaZ3Z2Q44s3sfl EvRB3rWoOYqNbHfiOiSOLVn/sZa+2u6b7EbV7urnZXdD3prc0O/Ddpp0UNb8jMFdVh7H mNPXpUp5rjHVCeF1JbMiorLWQ+P8IWxh+Ro0RWHT2VHqIjGWHAQ/gveZL6ep25X6ZAnZ NBOvAMgMz/qIgTYTo0t2OtD4TIYyFuNUdp8KuqNGvdQuayInWZbNLoBWdlSiwE/zSHUc HgRQ== 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=azrjkTSUa/x73/5WnmuPzRdP/HPez6bDQxOpksGkhRA=; b=2/YrUOY5NIYzEk1K2qtjSPXKJVEoCYxZ7JRkVjNZMH8yVtRPkVSopTrZ/51pZpxfbL ZrImS4E5BaN8JXFgmh1FJMX1Sb3WpINudbVyZtZYCeZ9Vbowtr8MGAgFyIngwpg6lhbt xK/GleBMQQ4qVxFHM5IY9XSfBaSiZ0FcR/XWWtWEEu254Elp6cIqBZ53JE7mahpl/HOf hgbOL9w6ScAAeGkwfSqW+npKwHUN2qyVHgz0qrhqlA2lWaMa9UmpkCePmY4jq6PhxqGW KndRFrPWS0D3HHB/21r0cTkVoLyI8+wM9V+Cp/DV9a5dZ31Og+QXOlU5CZHVZ8RRVTmO 6o9Q== X-Gm-Message-State: ACrzQf1JscYdb7InpbQJgLzGoeMYRqG+diAYH3aPcY7jZQOOOJJtqeIq jJ1GwfpJjqHUs8UXNtGESMnBMfUUYBpyYldgFSn4Ew== X-Google-Smtp-Source: AMsMyM5v5LDC0BBL5gYqehs/SqfSDyUe3Uxe1Ev3owdj68C4Qz8wqJvfTKXOJXJGGPXuN1JCNY46IEZom7aRnXaTplE= X-Received: by 2002:a2e:978e:0:b0:26e:8ad6:6d5b with SMTP id y14-20020a2e978e000000b0026e8ad66d5bmr3880239lji.363.1665995580212; Mon, 17 Oct 2022 01:33:00 -0700 (PDT) MIME-Version: 1.0 References: <20221014084837.1787196-1-hrkanabar@gmail.com> <20221014084837.1787196-6-hrkanabar@gmail.com> In-Reply-To: From: Dmitry Vyukov Date: Mon, 17 Oct 2022 10:32:48 +0200 Message-ID: Subject: Re: [PATCH RFC 5/7] fs/xfs: support `DISABLE_FS_CSUM_VERIFICATION` config option To: "Darrick J. Wong" Cc: Hrutvik Kanabar , Hrutvik Kanabar , Marco Elver , Aleksandr Nogikh , kasan-dev@googlegroups.com, Alexander Viro , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, "Theodore Ts'o" , Andreas Dilger , linux-ext4@vger.kernel.org, Chris Mason , Josef Bacik , David Sterba , linux-btrfs@vger.kernel.org, Jaegeuk Kim , Chao Yu , linux-f2fs-devel@lists.sourceforge.net, linux-xfs@vger.kernel.org, Namjae Jeon , Sungjong Seo , Anton Altaparmakov , linux-ntfs-dev@lists.sourceforge.net Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org On Fri, 14 Oct 2022 at 17:44, Darrick J. Wong wrote: > > On Fri, Oct 14, 2022 at 08:48:35AM +0000, Hrutvik Kanabar wrote: > > From: Hrutvik Kanabar > > > > When `DISABLE_FS_CSUM_VERIFICATION` is enabled, return truthy value for > > `xfs_verify_cksum`, which is the key function implementing checksum > > verification for XFS. > > > > Signed-off-by: Hrutvik Kanabar > > NAK, we're not going to break XFS for the sake of automated fuzz tools. Hi Darrick, What do you mean by "break"? If this config is not enabled the behavior is not affected as far as I see. > You'll have to adapt your fuzzing tools to rewrite the block header > checksums, like the existing xfs fuzz testing framework does. See > the xfs_db 'fuzz -d' command and the relevant fstests. > > --D > > > --- > > fs/xfs/libxfs/xfs_cksum.h | 5 ++++- > > 1 file changed, 4 insertions(+), 1 deletion(-) > > > > diff --git a/fs/xfs/libxfs/xfs_cksum.h b/fs/xfs/libxfs/xfs_cksum.h > > index 999a290cfd72..ba55b1afa382 100644 > > --- a/fs/xfs/libxfs/xfs_cksum.h > > +++ b/fs/xfs/libxfs/xfs_cksum.h > > @@ -76,7 +76,10 @@ xfs_verify_cksum(char *buffer, size_t length, unsigned long cksum_offset) > > { > > uint32_t crc = xfs_start_cksum_safe(buffer, length, cksum_offset); > > > > - return *(__le32 *)(buffer + cksum_offset) == xfs_end_cksum(crc); > > + if (IS_ENABLED(CONFIG_DISABLE_FS_CSUM_VERIFICATION)) > > + return 1; > > + else > > + return *(__le32 *)(buffer + cksum_offset) == xfs_end_cksum(crc); > > } > > > > #endif /* _XFS_CKSUM_H */ > > -- > > 2.38.0.413.g74048e4d9e-goog > > > > -- > You received this message because you are subscribed to the Google Groups "kasan-dev" group. > To unsubscribe from this group and stop receiving emails from it, send an email to kasan-dev+unsubscribe@googlegroups.com. > To view this discussion on the web visit https://groups.google.com/d/msgid/kasan-dev/Y0mD0LcNvu%2BQTlQ9%40magnolia.