Received: by 2002:ab2:3c46:0:b0:1f5:f2ab:c469 with SMTP id x6csp76990lqf; Thu, 25 Apr 2024 23:13:14 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVPqZ5EiKBQjc+S3Mk/OLZ4jZNqVYI2EPeq3E6nq01kXxvzuc98Ly9hCQCQ+Aki5ogaANWCLn8CSvOj1JQid4vhJyNcgpe6mts5srHY4A== X-Google-Smtp-Source: AGHT+IHo4mYiC2bbuSFGXur3aLTf+29dlIIZLimhPZD9Y/PE8U3E4fEEm4YsRz4+e1vjUmWD/uDm X-Received: by 2002:a05:6808:2012:b0:3c8:43df:aa3d with SMTP id q18-20020a056808201200b003c843dfaa3dmr2356986oiw.10.1714111994442; Thu, 25 Apr 2024 23:13:14 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714111994; cv=pass; d=google.com; s=arc-20160816; b=ndkjNpzmXPym4V2TFP35Gtsv5rGpnAEt6wBxdnVPPzsdW4w44wjUK3QzFxDTJJMvEG QPA/Ce370+7zEAVfP81JhUvoHMXcDEcZFjLfUnUHTC+KIRacf4Tno0zWcfjF0Enb6yM5 +n2fHhr714fD6ajlWeSS7h7te6EKKfl7R9625j9rfRxH2U93e2cbNjqlBkHTFfhPfsub iqCN4cUdjh9u59/TbXXGFi9ZSfQu3e+BGc1S92xXJ6WlgEcz9Fiit4WfdvQgOYozQxBh 0KdLCI7J3iDCE3CddFqs9pZFZiDgwpcyhEnOD4O+2XQ+9hY6vqa+r0wuzAQPi3Uw/ZM+ CYqg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=bXuxQSeK9EhyAEvn7EIbpyezyLZhRR4SZi6ic3qEHyY=; fh=wDnqSJ5jD3wzgsQbyO11hnuET1OXJsOUXE4ade0VquE=; b=eAJ+TPmH4bLm/imaII1cKits//jV79fgR3PHWW6baOgXN+Tqzh4MnhwcWw4ckvDnbg ukeynfDHzoxzSgeYFs8XchEONswev2GE/OmkKBrypMORRY3CkkUoDaOam9Bua/gMGL27 WOgOeSNTImXC1Onaf+YzeMaMrpBCStmLAFPXf52M+3YmBKZN4AguZi8aEq68MYgMlxZp eQreBBuXvqhwRLjSKwsjolqp6e6r/pTy0R7nBkdTmiPyENZZHEq52oh/DOuXEBll/TZl CklitI8yv5AEUqfIt+IO0HT/5vJ1/w23HaTjmR9FHusdmdtk5IiwYv75Gc6Xg+5CQxx3 CJMA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=ap5js1Vf; arc=pass (i=1 dkim=pass dkdomain=infradead.org); spf=pass (google.com: domain of linux-kernel+bounces-159548-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-159548-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id q4-20020a63d604000000b005dbedf04f68si14762179pgg.10.2024.04.25.23.13.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Apr 2024 23:13:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-159548-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=ap5js1Vf; arc=pass (i=1 dkim=pass dkdomain=infradead.org); spf=pass (google.com: domain of linux-kernel+bounces-159548-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-159548-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id DE312281192 for ; Fri, 26 Apr 2024 06:13:13 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3D4A213A41C; Fri, 26 Apr 2024 06:13:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="ap5js1Vf" Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 342C92F2F; Fri, 26 Apr 2024 06:13:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.137.202.133 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714111987; cv=none; b=Xm7Cm1Tt/SKiYq0SdMJFL8O5ekLuMSA+ot3ozKIbMtmUlccaI0rEths7/tVZy2EJF14s2nFA8sbqrA/Vmgh4YGhfAoDPHBXGyXfEDOiLiFJ8Ze9+wnAeWALeqKQCO4kIYKiPHpj0j8LOqKVOuBEvcT25h5A5iNsTEd1XYm/FpD8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714111987; c=relaxed/simple; bh=5fiEOv77X5MtDshrhcX7AT7EaPP4Cfvs3HIW1CqwulY=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=DBcUE1zdUcIyPFIZqgBnPoYS0LoNgHcgCO32JVHzeOd9sVGs8LfdB+VkPgPriV5vz0YcLE1D3Uid+ZEjvdlB4j4yekJAtDitmty3q8iAYtyVcHJD/I9jqxGQYUp23Ystuov/uNnjq1z+r96VpMZLxZhwd5Gy8FZUUN9GWjixY3w= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org; spf=none smtp.mailfrom=bombadil.srs.infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=ap5js1Vf; arc=none smtp.client-ip=198.137.202.133 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=bombadil.srs.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=bXuxQSeK9EhyAEvn7EIbpyezyLZhRR4SZi6ic3qEHyY=; b=ap5js1VfrH/g8G8XbPp1QnRWe8 GNFhL6G/y7S24a7lmUv9ZiTH/d9yipZXWlqNYb1EHFWkmSZSYVaHFWC/ahi6krrscrNJK/cn4lX8E Nld7M7FYXExhEKNd0W79+2Xs6ZrW39Cxkg8I1xd8wSWNXvfIXSsNo5DX65kRktfXtXeFKiDiUcWK+ 3LPgxS0IqQFOofZx0z25LCImjqQ9EcXVdOMH0C/wnsITtdbiwC+1dFIX4nkjkokGOByPDJYX5+7S1 UOgXFfR+uoWt/jrxEwvFom2hyMbJb+L+p/Kt0zIRKZd0uFmCCcva6RnHik0K6l97hnNVikigDoVXS 6oEOd5Kg==; Received: from hch by bombadil.infradead.org with local (Exim 4.97.1 #2 (Red Hat Linux)) id 1s0EpV-0000000BGaD-0O3G; Fri, 26 Apr 2024 06:13:05 +0000 Date: Thu, 25 Apr 2024 23:13:05 -0700 From: Christoph Hellwig To: Brian Foster Cc: Christoph Hellwig , Sam Sun , linux-kernel@vger.kernel.org, linux-xfs@vger.kernel.org, djwong@kernel.org, chandan.babu@oracle.com, syzkaller-bugs@googlegroups.com, xrivendell7@gmail.com Subject: Re: [Linux kernel bug] KASAN: slab-out-of-bounds Read in xlog_cksum Message-ID: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html On Thu, Apr 25, 2024 at 09:57:54AM -0400, Brian Foster wrote: > On Thu, Apr 25, 2024 at 06:12:23AM -0700, Christoph Hellwig wrote: > > This triggers the workaround for really old xfsprogs putting in a > > bogus h_size: > > > > [ 12.101992] XFS (loop0): invalid iclog size (0 bytes), using lsunit (65536 bytes) > > > > but then calculates the log recovery buffer size based on the actual > > on-disk h_size value. The patch below open codes xlog_logrec_hblks and > > fixes this particular reproducer. But I wonder if we should limit the > > workaround. Brian, you don't happpen to remember how old xfsprogs had > > to be to require your workaround (commit a70f9fe52daa8)? > > > > No, but a little digging turns up xfsprogs commit 20fbd4593ff2 ("libxfs: > format the log with valid log record headers"), which I think is what > you're looking for..? That went in around v4.5 or so, so I suppose > anything earlier than that is affected. Thanks. I was kinda hoping we could exclude v5 file systems from that workaround, but it is needed way too recent for that. Maybe we can specificly check for the wrongly hardcoded XLOG_HEADER_CYCLE_SIZE instead of allowing any value?