Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp1358740ybl; Sun, 18 Aug 2019 01:47:10 -0700 (PDT) X-Google-Smtp-Source: APXvYqyGhHjHKqPqKB1gTcgwl/RhOrWDhvJBok/04ChnkbWRwdnPZd8AFX8tbZ/j04gLJ8z3AFo5 X-Received: by 2002:a63:31cc:: with SMTP id x195mr14795659pgx.147.1566118030442; Sun, 18 Aug 2019 01:47:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566118030; cv=none; d=google.com; s=arc-20160816; b=suQ/0mqc8fJhFT/IgiMDCYsjKLmef5VU0aZeOz0gucOoczvQXUxG6f+Ecyocn8ACn6 W4LaF8Zc6qfZikG3C3y7b6fXoJLDbY6x7MHGrWv++kGnZBFAnkUZ0iF1QSchvmdWn45F SurrskXg8iOvQo0AL4O59h14XhVZNvmI9fjLXwdNWU+sXbQIF0a5Zoq5yoy1YkFy/nKQ aLWLcTC14ZJADkwD34dSI0q4t7KC+eGJMx+4JDxifxn/BIRRQ9OyG68fFo56Hw0Mc550 PGklOUUbCUES94Uv+ohTp4dor+mwyedgZwNKKaJzbfpgX6S7TzYy7Q3sHx3XylKhOUoQ oJnw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=U8+VQlxBUgWnoM/I+xVbuaXKkxs6yTI0ZywaCHT91wQ=; b=wWfCs+Vn/8mpgQKcJ/Php2Dzd7GyHoz+arR6obC81urjsikUO3x9fNokFB3ps69nZz ornunIo9Dysvd/hMeZ1K7K61n1vnDWbXLdxU4Hp7aCUXNjQBMVJZR6brpwM7Wwuw3Hjd 62hEEMKgU40riFMJcdg28ciHGEkllPZL9UZN1qe/G0Q7JrwMG+t6CQRd0SWOw6zOsiAV or4BmZpG9X90jqNvhqrtP0Xuj5tDX4FsRuLnXEN2wjHckDQWh/5w7gCPsofInIDxTqsW LxJQLL/yIHIFqix66EgnmcnAxrbAwwvVupXA24HMkDf7JzjDkv53fg7j1LBSgYhA2O1D CdGw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@aol.com header.s=a2048 header.b=M0TR0d7f; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=aol.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f95si1235068plb.146.2019.08.18.01.46.54; Sun, 18 Aug 2019 01:47:10 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@aol.com header.s=a2048 header.b=M0TR0d7f; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=aol.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726627AbfHRIpn (ORCPT + 99 others); Sun, 18 Aug 2019 04:45:43 -0400 Received: from sonic301-21.consmr.mail.gq1.yahoo.com ([98.137.64.147]:46018 "EHLO sonic301-21.consmr.mail.gq1.yahoo.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726605AbfHRIpn (ORCPT ); Sun, 18 Aug 2019 04:45:43 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aol.com; s=a2048; t=1566117941; bh=U8+VQlxBUgWnoM/I+xVbuaXKkxs6yTI0ZywaCHT91wQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From:Subject; b=M0TR0d7fH7+wgv0LnSYGhuOrHKfGjOQx7n0R4fEY11s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53F49EjyDxBA7.eqmhEVuu8.5zsrxTKOWin6cvesJuN 2gNYJPbBDGyjO3uYd.b3aBWxqUXYq2xI4Bctn5Slef0JUyyjUpczjbfaF.UJRW0qdFzLFtXEFoyD p5ZOYtK5Og6uqsTVd_B.xpLK0J56uGv8ZAKeUntsTLH5SBFt2URMPbGoIQPLN.fztahf.s65AVcM BLN3Qrstum6sHHuBr4QjowVdbQJ7y0yHLxJVnTJEODm_olmIS6wJgNiGQ_nQmJLumRGNib3B3NqP hiG577EJlQomKG6S2WJ5FK1jN1tDwUPIGE9NFSbYyMp4M_PelQd1PxaaHYvUeLhOraSxUVfXSYyY 6z72p8OjS.cgZVxZsDxkK8UG961df1uDTqeG6rIEsdo0CeRcReJQljOSHRZ_rm9zREWz5wKfLOws fA5wDsCBqNZnWkoPRp9Ah7xcMQxeP8bo2S9rLTVJBlkqvSjChaXLyi.A7FqlF9liXh1ObALSq_BY s5fpoZq2IYxLEGSg0bNkgbo3MebhHys7nTofo Received: from sonic.gate.mail.ne1.yahoo.com by sonic301.consmr.mail.gq1.yahoo.com with HTTP; Sun, 18 Aug 2019 08:45:41 +0000 Received: by smtp427.mail.gq1.yahoo.com (Oath Hermes SMTP Server) with ESMTPA ID 7f42aa3751c9ef91b2ab4c4b10094af7; Sun, 18 Aug 2019 08:45:41 +0000 (UTC) Date: Sun, 18 Aug 2019 16:45:25 +0800 From: Gao Xiang To: Richard Weinberger Cc: Greg Kroah-Hartman , Al Viro , linux-fsdevel , devel , linux-erofs , linux-kernel , Andrew Morton , Stephen Rothwell , tytso , Pavel Machek , David Sterba , Amir Goldstein , Christoph Hellwig , Darrick , Dave Chinner , Jaegeuk Kim , Jan Kara , torvalds , Chao Yu , Miao Xie , Li Guifu , Fang Wei , Gao Xiang Subject: Re: [PATCH] erofs: move erofs out of staging Message-ID: <20190818084521.GA17909@hsiangkao-HP-ZHAN-66-Pro-G1> References: <20190817082313.21040-1-hsiangkao@aol.com> <1746679415.68815.1566076790942.JavaMail.zimbra@nod.at> <20190817220706.GA11443@hsiangkao-HP-ZHAN-66-Pro-G1> <1163995781.68824.1566084358245.JavaMail.zimbra@nod.at> <20190817233843.GA16991@hsiangkao-HP-ZHAN-66-Pro-G1> <1405781266.69008.1566116210649.JavaMail.zimbra@nod.at> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1405781266.69008.1566116210649.JavaMail.zimbra@nod.at> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Aug 18, 2019 at 10:16:50AM +0200, Richard Weinberger wrote: > ----- Urspr?ngliche Mail ----- > >> While digging a little into the code I noticed that you have very few > >> checks of the on-disk data. > >> For example ->u.i_blkaddr. I gave it a try and created a > >> malformed filesystem where u.i_blkaddr is 0xdeadbeef, it causes the kernel > >> to loop forever around erofs_read_raw_page(). > > > > I don't fuzz all the on-disk fields for EROFS, I will do later.. > > You can see many in-kernel filesystems are still hardening the related > > stuff. Anyway, I will dig into this field you mentioned recently, but > > I think it can be fixed easily later. > > This is no excuse to redo all these bugs. :-) I agree with you, but what can we do now is trying our best to fuzz all the fields. So, what is your opinion about EROFS? > > I know that many in-kernel filesystems trust the disk ultimately, this is a > problem and huge attack vector. I EROFS already has many error handing paths to recover corrupted images, and your discovery is a bug out of one error handing path miswritten by me. I cannot make a guarantee that all the new things (every new kernel version will introduce new feature / new code) are bug-free since I am not a machine or code parser. My answer about this EROFS will be more stable with our development, we have a dedicated team with paid job, and since we currently use EROFS on the top of dm-verity for current Android, which will keep us from corrupted images. But yes, we will focus on fuzzing all the images for generic usages, and we will backport all these patches to old stable versions. Thanks, Gao Xiang > > Thanks, > //richard