Commit 642335f
ext4: don't treat fhandle lookup of ea_inode as FS corruption
A file handle that userspace provides to open_by_handle_at() can
legitimately contain an outdated inode number that has since been reused
for another purpose - that's why the file handle also contains a generation
number.
But if the inode number has been reused for an ea_inode, check_igot_inode()
will notice, __ext4_iget() will go through ext4_error_inode(), and if the
inode was newly created, it will also be marked as bad by iget_failed().
This all happens before the point where the inode generation is checked.
ext4_error_inode() is supposed to only be used on filesystem corruption; it
should not be used when userspace just got unlucky with a stale file
handle. So when this happens, let __ext4_iget() just return an error.
Fixes: b3e6bcb ("ext4: add EA_INODE checking to ext4_iget()")
Signed-off-by: Jann Horn <[email protected]>
Reviewed-by: Jan Kara <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Theodore Ts'o <[email protected]>1 parent d5e2067 commit 642335f
1 file changed
+48
-20
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4732 | 4732 | | |
4733 | 4733 | | |
4734 | 4734 | | |
4735 | | - | |
4736 | | - | |
| 4735 | + | |
| 4736 | + | |
4737 | 4737 | | |
| 4738 | + | |
| 4739 | + | |
4738 | 4740 | | |
4739 | | - | |
4740 | | - | |
| 4741 | + | |
| 4742 | + | |
| 4743 | + | |
| 4744 | + | |
4741 | 4745 | | |
4742 | | - | |
4743 | | - | |
| 4746 | + | |
| 4747 | + | |
| 4748 | + | |
| 4749 | + | |
4744 | 4750 | | |
4745 | | - | |
4746 | | - | |
| 4751 | + | |
| 4752 | + | |
| 4753 | + | |
| 4754 | + | |
| 4755 | + | |
| 4756 | + | |
| 4757 | + | |
| 4758 | + | |
| 4759 | + | |
| 4760 | + | |
| 4761 | + | |
| 4762 | + | |
| 4763 | + | |
| 4764 | + | |
| 4765 | + | |
4747 | 4766 | | |
4748 | | - | |
4749 | | - | |
4750 | | - | |
| 4767 | + | |
| 4768 | + | |
| 4769 | + | |
| 4770 | + | |
| 4771 | + | |
4751 | 4772 | | |
4752 | 4773 | | |
4753 | 4774 | | |
| |||
4759 | 4780 | | |
4760 | 4781 | | |
4761 | 4782 | | |
4762 | | - | |
4763 | 4783 | | |
4764 | 4784 | | |
4765 | 4785 | | |
| |||
4788 | 4808 | | |
4789 | 4809 | | |
4790 | 4810 | | |
4791 | | - | |
4792 | | - | |
| 4811 | + | |
| 4812 | + | |
4793 | 4813 | | |
4794 | | - | |
| 4814 | + | |
4795 | 4815 | | |
4796 | 4816 | | |
4797 | 4817 | | |
| |||
5073 | 5093 | | |
5074 | 5094 | | |
5075 | 5095 | | |
5076 | | - | |
5077 | | - | |
5078 | | - | |
5079 | | - | |
| 5096 | + | |
| 5097 | + | |
| 5098 | + | |
| 5099 | + | |
| 5100 | + | |
| 5101 | + | |
| 5102 | + | |
| 5103 | + | |
| 5104 | + | |
| 5105 | + | |
5080 | 5106 | | |
5081 | | - | |
| 5107 | + | |
| 5108 | + | |
5082 | 5109 | | |
| 5110 | + | |
5083 | 5111 | | |
5084 | 5112 | | |
5085 | 5113 | | |
| |||
0 commit comments