Commit 3ba733f
ext4: avoid cycles in directory h-tree
A maliciously corrupted filesystem can contain cycles in the h-tree
stored inside a directory. That can easily lead to the kernel corrupting
tree nodes that were already verified under its hands while doing a node
split and consequently accessing unallocated memory. Fix the problem by
verifying traversed block numbers are unique.
Cc: stable@vger.kernel.org
Signed-off-by: Jan Kara <jack@suse.cz>
Link: https://lore.kernel.org/r/20220518093332.13986-2-jack@suse.cz
Signed-off-by: Theodore Ts'o <tytso@mit.edu>1 parent 46c116b commit 3ba733f
1 file changed
Lines changed: 19 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
777 | 777 | | |
778 | 778 | | |
779 | 779 | | |
780 | | - | |
| 780 | + | |
781 | 781 | | |
782 | 782 | | |
783 | 783 | | |
784 | 784 | | |
785 | 785 | | |
| 786 | + | |
| 787 | + | |
786 | 788 | | |
787 | 789 | | |
788 | 790 | | |
| |||
854 | 856 | | |
855 | 857 | | |
856 | 858 | | |
| 859 | + | |
| 860 | + | |
857 | 861 | | |
858 | 862 | | |
859 | 863 | | |
| |||
882 | 886 | | |
883 | 887 | | |
884 | 888 | | |
885 | | - | |
| 889 | + | |
| 890 | + | |
| 891 | + | |
| 892 | + | |
| 893 | + | |
| 894 | + | |
| 895 | + | |
| 896 | + | |
| 897 | + | |
| 898 | + | |
| 899 | + | |
886 | 900 | | |
| 901 | + | |
887 | 902 | | |
888 | | - | |
| 903 | + | |
889 | 904 | | |
890 | 905 | | |
891 | 906 | | |
892 | 907 | | |
893 | 908 | | |
| 909 | + | |
894 | 910 | | |
895 | 911 | | |
896 | 912 | | |
| |||
0 commit comments