Commit 1b45cc5
ext4: fix potential out of bound read in ext4_fc_replay_scan()
For scan loop must ensure that at least EXT4_FC_TAG_BASE_LEN space. If remain
space less than EXT4_FC_TAG_BASE_LEN which will lead to out of bound read
when mounting corrupt file system image.
ADD_RANGE/HEAD/TAIL is needed to add extra check when do journal scan, as this
three tags will read data during scan, tag length couldn't less than data length
which will read.
Cc: stable@kernel.org
Signed-off-by: Ye Bin <yebin10@huawei.com>
Link: https://lore.kernel.org/r/20220924075233.2315259-4-yebin10@huawei.com
Signed-off-by: Theodore Ts'o <tytso@mit.edu>1 parent dcc5827 commit 1b45cc5
1 file changed
Lines changed: 36 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1976 | 1976 | | |
1977 | 1977 | | |
1978 | 1978 | | |
| 1979 | + | |
| 1980 | + | |
| 1981 | + | |
| 1982 | + | |
| 1983 | + | |
| 1984 | + | |
| 1985 | + | |
| 1986 | + | |
| 1987 | + | |
| 1988 | + | |
| 1989 | + | |
| 1990 | + | |
| 1991 | + | |
| 1992 | + | |
| 1993 | + | |
| 1994 | + | |
| 1995 | + | |
| 1996 | + | |
| 1997 | + | |
| 1998 | + | |
| 1999 | + | |
| 2000 | + | |
| 2001 | + | |
| 2002 | + | |
| 2003 | + | |
| 2004 | + | |
| 2005 | + | |
| 2006 | + | |
1979 | 2007 | | |
1980 | 2008 | | |
1981 | 2009 | | |
| |||
2032 | 2060 | | |
2033 | 2061 | | |
2034 | 2062 | | |
2035 | | - | |
| 2063 | + | |
2036 | 2064 | | |
2037 | 2065 | | |
2038 | 2066 | | |
| 2067 | + | |
| 2068 | + | |
| 2069 | + | |
| 2070 | + | |
| 2071 | + | |
2039 | 2072 | | |
2040 | 2073 | | |
2041 | 2074 | | |
| |||
2146 | 2179 | | |
2147 | 2180 | | |
2148 | 2181 | | |
2149 | | - | |
| 2182 | + | |
2150 | 2183 | | |
2151 | 2184 | | |
2152 | 2185 | | |
| |||
2156 | 2189 | | |
2157 | 2190 | | |
2158 | 2191 | | |
| 2192 | + | |
2159 | 2193 | | |
2160 | 2194 | | |
2161 | 2195 | | |
| |||
0 commit comments