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  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:	Mon, 9 Jan 2012 17:22:24 +0100 (CET)
From:	Lukas Czerner <lczerner@...hat.com>
To:	"Ted Ts'o" <tytso@....edu>
cc:	Lukas Czerner <lczerner@...hat.com>, linux-ext4@...r.kernel.org
Subject: Re: [PATCH] ext4: setattr: Forbid setting data journalling when
 delalloc enabled

On Mon, 9 Jan 2012, Ted Ts'o wrote:

> On Mon, Jan 09, 2012 at 04:45:03PM +0100, Lukas Czerner wrote:
> > Ext4 does not support data journalling with delayed allocation enabled.
> > We even does not allow to mount the file system with delayed allocation
> > and data journalling enabled, but it can be set via FS_IOC_SETFLAGS
> > which is wrong.
> > 
> > When data journalling and delayed allocation is enabled it can lead to
> > troubles. Here is one example how to reproduce an oops:
> > 
> >  mkfs.ext4 /dev/sdd
> >  mount /dev/sdd /mnt/test1
> >  dd if=/dev/zero of=/mnt/test1/file bs=1M count=4
> >  chattr +j /mnt/test1/file
> >  dd if=/dev/zero of=/mnt/test1/file bs=1M count=4 conv=notrunc
> >  chattr -j /mnt/test1/file
> > 
> > Signed-off-by: Lukas Czerner <lczerner@...hat.com>
> 
> Don't we also need to add a check in ext4_should_journal_data() in
> fs/ext4/ext4_jbd2.h?  Otherwise we could get in trouble if the data
> journalling flag had been set previously when the file system was
> mounted nodelalloc.

Ah, of course you're right. We should add a check into
ext4_should_journal_data().

> 
> In fact it could be argued that we don't need to return EOPNOSUPP, or
> printk a message, but simply make sure that the data journal flag is
> ignored in if delayed allocation is enabled.  If that's true, we can
> allow the user to set or clear the journal flag as much as they like;
> it would just be ignored.

I am fine with ignoring the flag silently without any information for
the user that the flag will be ignored when delalloc is enabled. After
all it should be clear from documentation that we do not allow data
journalling and delayed allocation together.

Thanks!

-Lukas

> 
> Thanks,
> 
> 					- Ted
> 

-- 
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists