Commit 45cf976
xfs: fix log recovery buffer allocation for the legacy h_size fixup
Commit a70f9fe ("xfs: detect and handle invalid iclog size set by
mkfs") added a fixup for incorrect h_size values used for the initial
umount record in old xfsprogs versions. Later commit 0c771b9
("xfs: clean up calculation of LR header blocks") cleaned up the log
reover buffer calculation, but stoped using the fixed up h_size value
to size the log recovery buffer, which can lead to an out of bounds
access when the incorrect h_size does not come from the old mkfs
tool, but a fuzzer.
Fix this by open coding xlog_logrec_hblks and taking the fixed h_size
into account for this calculation.
Fixes: 0c771b9 ("xfs: clean up calculation of LR header blocks")
Reported-by: Sam Sun <[email protected]>
Signed-off-by: Christoph Hellwig <[email protected]>
Reviewed-by: Brian Foster <[email protected]>
Reviewed-by: "Darrick J. Wong" <[email protected]>
Signed-off-by: Chandan Babu R <[email protected]>1 parent 0370f9b commit 45cf976
1 file changed
+14
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2999 | 2999 | | |
3000 | 3000 | | |
3001 | 3001 | | |
3002 | | - | |
| 3002 | + | |
3003 | 3003 | | |
3004 | 3004 | | |
3005 | 3005 | | |
| |||
3055 | 3055 | | |
3056 | 3056 | | |
3057 | 3057 | | |
3058 | | - | |
3059 | | - | |
3060 | | - | |
3061 | | - | |
| 3058 | + | |
| 3059 | + | |
| 3060 | + | |
| 3061 | + | |
| 3062 | + | |
| 3063 | + | |
| 3064 | + | |
| 3065 | + | |
| 3066 | + | |
| 3067 | + | |
| 3068 | + | |
| 3069 | + | |
| 3070 | + | |
3062 | 3071 | | |
3063 | 3072 | | |
3064 | 3073 | | |
3065 | | - | |
3066 | 3074 | | |
3067 | 3075 | | |
3068 | 3076 | | |
| |||
0 commit comments