lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Tue, 29 Nov 2022 08:51:05 -0800
From:   Jaegeuk Kim <jaegeuk@...nel.org>
To:     Eric Biggers <ebiggers@...nel.org>
Cc:     linux-fscrypt@...r.kernel.org, linux-fsdevel@...r.kernel.org,
        linux-ext4@...r.kernel.org, linux-f2fs-devel@...ts.sourceforge.net,
        Matthew Wilcox <willy@...radead.org>, Chao Yu <chao@...nel.org>
Subject: Re: [PATCH v4] fsverity: stop using PG_error to track error status

On 11/28, Eric Biggers wrote:
> On Mon, Nov 28, 2022 at 10:48:41PM -0800, Jaegeuk Kim wrote:
> > >  static void f2fs_finish_read_bio(struct bio *bio, bool in_task)
> > >  {
> > >  	struct bio_vec *bv;
> > >  	struct bvec_iter_all iter_all;
> > > +	struct bio_post_read_ctx *ctx = bio->bi_private;
> > >  
> > > -	/*
> > > -	 * Update and unlock the bio's pagecache pages, and put the
> > > -	 * decompression context for any compressed pages.
> > > -	 */
> > >  	bio_for_each_segment_all(bv, bio, iter_all) {
> > >  		struct page *page = bv->bv_page;
> > >  
> > >  		if (f2fs_is_compressed_page(page)) {
> > > -			if (bio->bi_status)
> > > +			if (!ctx->decompression_attempted)
> > 
> > If seems this causes a panic due to the ctx nullified by f2fs_verify_bio.
> > 
> 
> Thanks for catching that!  I've sent out v5 that checks for 'ctx &&
> !ctx->decompression_attempted' here.  That's the right thing to do, since if ctx
> is NULL then decompression must have been attempted.
> 
> I'd like to get rid of freeing the bio_post_read_ctx in f2fs_verify_bio().
> But I believe it's still needed, at least in theory.
> 
> Do you have a suggestion for testing f2fs compression + verity with xfstests?
> I missed this because compression isn't covered by the "verity" group tests.
> Maybe there should be an "f2fs/compress" config in xfstests-bld that uses mkfs
> and mount options that cause all files to be automatically compressed, similar
> to how f2fs/encrypt automatically encrypts all files with test_dummy_encryption.

I used for fsstress+fault_injection+shutdown loop with compressed and
non-compressed directories with:

# mkfs.f2fs -f -O extra_attr -O project_quota -O compression -g android /dev/$DEV
# mount -t f2fs -o discard,fsync_mode=nobarrier,reserve_root=32768,checkpoint_merge,atgc,compress_cache /dev/$DEV $TESTDIR
# mkdir $TESTDIR/comp
# f2fs_io setflags compression $TESTDIR/comp
# fsstress [options] -d $TESTDIR/comp

I think you can simply mount with "-o compress_extension=*" to compress
everything.

> 
> - Eric

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ