Commit 32fe905
committed
ubifs: Fix O_TMPFILE corner case in ubifs_link()
It is perfectly fine to link a tmpfile back using linkat().
Since tmpfiles are created with a link count of 0 they appear
on the orphan list, upon re-linking the inode has to be removed
from the orphan list again.
Ralph faced a filesystem corruption in combination with overlayfs
due to this bug.
Cc: <[email protected]>
Cc: Ralph Sennhauser <[email protected]>
Cc: Amir Goldstein <[email protected]>
Reported-by: Ralph Sennhauser <[email protected]>
Tested-by: Ralph Sennhauser <[email protected]>
Reported-by: Amir Goldstein <[email protected]>
Fixes: 474b937 ("ubifs: Implement O_TMPFILE")
Signed-off-by: Richard Weinberger <[email protected]>1 parent c3d9fda commit 32fe905
1 file changed
+7
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
748 | 748 | | |
749 | 749 | | |
750 | 750 | | |
| 751 | + | |
| 752 | + | |
| 753 | + | |
| 754 | + | |
| 755 | + | |
751 | 756 | | |
752 | 757 | | |
753 | 758 | | |
| |||
768 | 773 | | |
769 | 774 | | |
770 | 775 | | |
| 776 | + | |
| 777 | + | |
771 | 778 | | |
772 | 779 | | |
773 | 780 | | |
| |||
0 commit comments