Received: by 2002:a89:2c3:0:b0:1ed:23cc:44d1 with SMTP id d3csp129704lqs; Mon, 4 Mar 2024 18:18:03 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXUKcNWUXbrzS+9Z4QEL7sBf3CIp/MiJ4/WAT/wPXjd76ylpkC5VmCnOvPnxSETbk1RC+m0cuXBJX3fE+HdKXhU0SSJlwtI6KlKFGT0mw== X-Google-Smtp-Source: AGHT+IGr6q1F2ntnJq5FiYKKk7B77nDqTKE5ZP19KNkVGY5YGEcIpdUlXn0tAwUd2VadH9MZuvq8 X-Received: by 2002:ad4:4045:0:b0:690:7770:e6d4 with SMTP id r5-20020ad44045000000b006907770e6d4mr692862qvp.34.1709605082910; Mon, 04 Mar 2024 18:18:02 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709605082; cv=pass; d=google.com; s=arc-20160816; b=bH4aRQOLWRul0+YV0UUxth4QJIlNGAwYsANn8vRNk6+CODOaNqnvaQMpI647ha/hop woM3GSXEIdpHQZg5QXV4MljITexp8TJw0W+7YfSkVwNPkmApw632HFctFd2I69OjXpmz meEIiod+xvsfX87DPoRL5uqNouXD+TTCMs0aCafuxZqTa9hbdRJtdrl/Q5we0TgClHzG rQyMHLjz9IQgt2GkmGRnBi1J1NPdyivna93ip74MdXp2ZcKG8YeH+Pnkeo2jZFAxxr+i NulGrdCKAgm6LJAPFtD+hKPCKqU6sqRIK194LIk83CjRaoisB3l1d0FN/VcoVEf8EsH7 AiJA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :subject:cc:to:from:date:dkim-signature; bh=Vf7ga+69rktGnQ6MLiBZYdtLAPO5MhkKVAzEKIflNBs=; fh=bJ5tu5coD9HvMzNdpNWA8Kz1Wt+HYcw0N2dE0vylvKM=; b=1Ex39SsL9qIiRBLBPW5ec+YGdHk1SbbKfhj09eAXvTASPNUzPrFeRWKflHwUwa6l9e ltwNAZdg5cZ0XN4yzdnuJQBXz33Ss9L4Yh/FCp/g0zZ5B3KcoyTNZC4kXc/VE98idCd4 NyKyd7ot55Pdlvh+EoiCFxKbGIjOt8Slu3dNsWMpCfcTdOqZFvNt99b0OocZEd6JlY+H X0A7r1tXs9mRwbFnf3gfNvQXqwfpgPMx+nresdf3tFRyhq8YpxQBkcxsXzLOB9t83tL2 9Oo4WQ2jU5lUIrpAECQqYOCrJhnun4rVQyf71daQoG9UEQnfTm8VsJAqwVaR7rn40rpo A8Qw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=QjZgwG0h; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-91544-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-91544-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id t9-20020a05621421a900b0069017f7208dsi11203856qvc.59.2024.03.04.18.18.02 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Mar 2024 18:18:02 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-91544-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=QjZgwG0h; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-91544-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-91544-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com 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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 87DDF1C22669 for ; Tue, 5 Mar 2024 02:18:02 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7C43918046; Tue, 5 Mar 2024 02:17:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="QjZgwG0h" Received: from mail-pl1-f169.google.com (mail-pl1-f169.google.com [209.85.214.169]) (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 5129C10A39; Tue, 5 Mar 2024 02:17:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.169 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709605071; cv=none; b=SflFwTLY3t5OYm3aLRlnSWDbIC3ZH4UfKdVt7hgjmz1XRLi1waT8dmZYjBY9RK+G25mYxTYMsN/zbwFKg/z4rI6Pk8n78syQGX9kDA5iYQ4KQmyqxJSusQVJ1cKUcPelegog0pdMxQtZfyhicIKcmlvhgNRTG5WZgVt190duchA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709605071; c=relaxed/simple; bh=mZ+cF6bQtTgVKW3RQ7HEBaJGWu8tdS6ZvNSVk1b+WvI=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=lCZeXY+AdMNWAL9DHrBOROVaP03lHRS1U2jgKR2YoBMTB5ZL8/RRKC5gLppdm+eco41s6O70W3EJ+JcHAAMB/YjYD6qaqnzIjGdLopz2DsI4oNe2GwDQQSUCip/eNFyvlYhtO3RGKKd2UWej7eA3uoTlv2RvWo/V/14O5hEFMKo= 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=QjZgwG0h; arc=none smtp.client-ip=209.85.214.169 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 Received: by mail-pl1-f169.google.com with SMTP id d9443c01a7336-1dbd32cff0bso43630505ad.0; Mon, 04 Mar 2024 18:17:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1709605069; x=1710209869; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=Vf7ga+69rktGnQ6MLiBZYdtLAPO5MhkKVAzEKIflNBs=; b=QjZgwG0hjfy5EHdRKFZw3d7DfmKYYP5aopSVcwK6DamfDs9Rsb7lCLNfRJxKFPbbgx PI9HY9y5mBWJDTYPQUfEXWv/NPu5qqZ+9Zxr6w4q6kW6eslEDBZIpfKSivYiOqIFmcss m6XwzM60rdfrQag62klMcsbZPY0dUc8ozWMr/61awwOv6xDeTQ0drIz521bAmDeIDxBz F/fCrNI+RFBQRuNvITACVNyxw/tF9YqzIEpXUF4IWsZIr8kn0n6qBe0nninj0Yfh4Z4/ owxK0aHzLbF48WUPXLJ6H7+lvIgyCP21+JWRIHFBK4lddANf97qjcnL271McLoagvPVm bJIw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709605069; x=1710209869; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Vf7ga+69rktGnQ6MLiBZYdtLAPO5MhkKVAzEKIflNBs=; b=Ir917vNcrTKnpwtik6TvAS1AvrhyIpFgoXA+zEaQyUZGFeCwsTL9liET0YWlxJPTC8 rNcl6em/a8vTr3qaiWJ8FnqFTuQRMAfeHo5zMXDFx1hR29Qq1NeUf9Ql4ZW6EYM5kazM VyN9EEf9+XeoZ0b88/8vKYh6hAX7QTh4TbsHHnk4MErNYt+ygz/EHfBsxZVfIRngg9NH Gy96qP2Y9lVtsg8E0DNLhQ3O1goUGl8A6lp9VTqMtC4HOyH3QZsSGS/k44pJ8AQmUbvn s44MxiEu8N+un8vB29KTo+HVIjvZmr1yYPhIRzuXuroepXqWm7D+OqHAhmMakldw1R2m PTTg== X-Forwarded-Encrypted: i=1; AJvYcCUjUT8hDiEWfbsequythCu/yiwPm/UsUP8CVGRjImOd1AvBD5hAqnxzgCoyL2IERdsfVFJ/oyVzjPK11PJtUBtJVlM3PxYq6LzjLeenR0yjx7OfZ4wD8aOMRbetyk/ymh1lt44n58jekC9BJA== X-Gm-Message-State: AOJu0Yy29OyiepFo129dDVrMltmxHHNDoK7BdjS7UYUTCYZfkJGjJ99E 8JQMsJiMa6QPEqsodmJjpzrGuzUZfl4E/8JOMMWMFfveJ5oEIA8rEGx2wim9 X-Received: by 2002:a17:903:120e:b0:1dc:ca74:7018 with SMTP id l14-20020a170903120e00b001dcca747018mr656911plh.36.1709605069283; Mon, 04 Mar 2024 18:17:49 -0800 (PST) Received: from localhost ([156.236.96.164]) by smtp.gmail.com with ESMTPSA id y9-20020a1709027c8900b001db717d2dbbsm9153781pll.210.2024.03.04.18.17.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Mar 2024 18:17:49 -0800 (PST) Date: Tue, 5 Mar 2024 10:17:42 +0800 From: Yue Hu To: Gao Xiang Cc: linux-erofs@lists.ozlabs.org, syzbot+7bc44a489f0ef0670bd5@syzkaller.appspotmail.com, Tetsuo Handa , syzkaller-bugs@googlegroups.com, LKML , Roberto Sassu , linux-fsdevel@vger.kernel.org Subject: Re: [PATCH] erofs: fix uninitialized page cache reported by KMSAN Message-ID: <20240305101742.00000a0a.zbestahu@gmail.com> In-Reply-To: <20240304035339.425857-1-hsiangkao@linux.alibaba.com> References: <20240304035339.425857-1-hsiangkao@linux.alibaba.com> X-Mailer: Claws Mail 4.1.1 (GTK 3.24.34; x86_64-w64-mingw32) 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-Transfer-Encoding: 7bit On Mon, 4 Mar 2024 11:53:39 +0800 Gao Xiang wrote: > syzbot reports a KMSAN reproducer [1] which generates a crafted > filesystem image and causes IMA to read uninitialized page cache. > > Later, (rq->outputsize > rq->inputsize) will be formally supported > after either large uncompressed pclusters (> block size) or big > lclusters are landed. However, currently there is no way to generate > such filesystems by using mkfs.erofs. > > Thus, let's mark this condition as unsupported for now. > > [1] https://lore.kernel.org/r/0000000000002be12a0611ca7ff8@google.com > > Reported-by: syzbot+7bc44a489f0ef0670bd5@syzkaller.appspotmail.com > Fixes: 1ca01520148a ("erofs: refine z_erofs_transform_plain() for sub-page block support") > Signed-off-by: Gao Xiang > --- > fs/erofs/decompressor.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/fs/erofs/decompressor.c b/fs/erofs/decompressor.c > index d4cee95af14c..2ec9b2bb628d 100644 > --- a/fs/erofs/decompressor.c > +++ b/fs/erofs/decompressor.c > @@ -323,7 +323,8 @@ static int z_erofs_transform_plain(struct z_erofs_decompress_req *rq, > unsigned int cur = 0, ni = 0, no, pi, po, insz, cnt; > u8 *kin; > > - DBG_BUGON(rq->outputsize > rq->inputsize); > + if (rq->outputsize > rq->inputsize) > + return -EOPNOTSUPP; > if (rq->alg == Z_EROFS_COMPRESSION_INTERLACED) { > cur = bs - (rq->pageofs_out & (bs - 1)); > pi = (rq->pageofs_in + rq->inputsize - cur) & ~PAGE_MASK; Reviewed-by: Yue Hu