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]
Date:   Thu, 30 Mar 2017 00:15:31 +0200
From:   Richard Weinberger <richard@....at>
To:     Ralph Sennhauser <ralph.sennhauser@...il.com>,
        Amir Goldstein <amir73il@...il.com>
Cc:     Miklos Szeredi <miklos@...redi.hu>, linux-unionfs@...r.kernel.org,
        linux-kernel <linux-kernel@...r.kernel.org>,
        linux-mtd@...ts.infradead.org, regressions@...mhuis.info,
        Artem Bityutskiy <dedekind1@...il.com>,
        Adrian Hunter <adrian.hunter@...el.com>,
        David Oberhollenzer <goliath@...ma-star.at>
Subject: Re: [REGRESSION 4.11] Commit d8514d8edb5b ("ovl: copy up regular file
 using O_TMPFILE") breaks ubifs

Ralph,

Am 29.03.2017 um 23:26 schrieb Ralph Sennhauser:
>> # create and link a tmpfile - then remove it
>> sudo rm -rf foo; sudo xfs_io -T -c "flink foo" . ; ls -l foo; sudo rm
>> foo
> 
> next-20170328, obviously without your patch:
> 
>   # xfs_io -T -c "flink foo" .
>   .: Not supported

-T tells xfs_io to create a tmpfile but you have it disabled in UBIFS.

Anyway, can you please test the attached patch?
Amir was right, UBIFS misses a corner case in ubifs_link(). ;-\

I think I understand also why we never noticed this in xfstests, UBIFS prints
only a non-fatal error while umounting the filesystem in this case.
But will test tomorrow in more detail, need some sleep now.

diff --git a/fs/ubifs/dir.c b/fs/ubifs/dir.c
index 30825d882aa9..95e348a2da29 100644
--- a/fs/ubifs/dir.c
+++ b/fs/ubifs/dir.c
@@ -748,6 +748,9 @@ static int ubifs_link(struct dentry *old_dentry, struct inode *dir,
 		goto out_fname;

 	lock_2_inodes(dir, inode);
+	if (inode->i_nlink == 0)
+		ubifs_delete_orphan(c, inode->i_ino);
+
 	inc_nlink(inode);
 	ihold(inode);
 	inode->i_ctime = ubifs_current_time(inode);

Thanks,
//richard

Powered by blists - more mailing lists