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] [thread-next>] [day] [month] [year] [list]
Message-ID: <azo7y22pblcngf6y5xkzda5cew4p3kxylfse7i32hixjtld2mh@ml2bonivmpbe>
Date: Tue, 22 Jul 2025 13:41:35 +0200
From: Jan Kara <jack@...e.cz>
To: Petr Vorel <pvorel@...e.cz>
Cc: linux-ext4@...r.kernel.org, ltp@...ts.linux.it, 
	Cyril Hrubis <chrubis@...e.cz>, Theodore Ts'o <tytso@....edu>, 
	Andreas Dilger <adilger.kernel@...ger.ca>, Jan Kara <jack@...e.com>
Subject: Re: [LTP] [PATCH 1/1] ioctl_ficlone03.c: Support test on more
 filesystems

Hi!

On Tue 22-07-25 12:23:46, Petr Vorel wrote:
> ...
> > >  static void setup(void)
> 
> > I find it strange that we manage to set the FS_IMMUTABLE_FL in the setup
> > with the FS_IOC_SETFLAGS without any error. Maybe it would make sense to
> > check with ext devs what is going on here.
> 
> > > @@ -117,6 +123,10 @@ static struct tst_test test = {
> > >  			.mkfs_ver = "mkfs.xfs >= 1.5.0",
> > >  			.mkfs_opts = (const char *const []) {"-m", "reflink=1", NULL},
> > >  		},
> > > +		{.type = "ext2"},
> > > +		{.type = "ext3"},
> > > +		{.type = "ext4"},
> > > +		{.type = "tmpfs"},
> > >  		{}
> 
> While I was working on extending [1] LTP ioctl_ficlone03.c to run on more
> filesystems [2], I found that ext[2-4] don't support FS_IMMUTABLE_FL.

Why do you think FS_IMMUTABLE_FL is unsupported? ext2 was the filesystem
actually introducing it to the kernel ;)

> 	immut_fd = open(MNTPOINT"/immutable", O_CREAT | O_RDWR, 0640);
> 	mnt_file = open(MNTPOINT"/file", O_CREAT | O_RDWR, 0640);
> 	int attr = FS_IMMUTABLE_FL;
> 	ioctl(immut_fd, FS_IOC_SETFLAGS, &attr);
> 	...
> 
> 	struct file_clone_range *clone_range;
> 	ioctl(immut_fd, FICLONE, mnt_file),
> 	ioctl(immut_fd, FICLONERANGE, clone_range),
> 
> The last two ioctl() with FICLONE and FICLONERANGE get errno EOPNOTSUPP
> (instead of EPERM as on other fs). Cyril raised concern [3], why first
> ioctl() FS_IOC_SETFLAGS even works. Shouldn't it also gets EINVAL as
> vfat, exfat and ntfs get?

Unlink FICLONE and FICLONERANGE which are indeed unsupported on any ext?
based filesystem so EOPNOTSUPP seems like a correct answer to me.
So I'm confused where you see a problem.

								Honza
-- 
Jan Kara <jack@...e.com>
SUSE Labs, CR

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ