mirror of
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD.git
synced 2024-11-14 22:32:30 +01:00
Fix fsck_ufs segfaults with gjournal (SU+J)
The segfault was being hit in ckfini() (sbin/fsck_ffs/fsutil.c) while attempting to traverse the buffer cache to flush dirty buffers. The tail queue used for the buffer cache was not initialized before dropping into gjournal_check(). Move the buffer initialization earlier so that it has been done before calling gjournal_check(). Reported by: crypt47, nvass Fix by: Robert Wing Tested by: Robert Wing PR: 255030 PR: 255979 MFC after: 3 days Sponsored by: Netflix
This commit is contained in:
parent
fdbc86cf79
commit
f190f9193b
@ -272,6 +272,7 @@ checkfilesys(char *filesys)
|
||||
* exit status will cause a foreground check to be run.
|
||||
*/
|
||||
sblock_init();
|
||||
bufinit();
|
||||
if (bkgrdcheck) {
|
||||
if ((fsreadfd = open(filesys, O_RDONLY)) < 0 || readsb(0) == 0)
|
||||
exit(3); /* Cannot read superblock */
|
||||
|
@ -298,7 +298,6 @@ setup(char *dev)
|
||||
(uintmax_t)numdirs * sizeof(struct inoinfo *));
|
||||
goto badsb;
|
||||
}
|
||||
bufinit();
|
||||
if (sblock.fs_flags & FS_DOSOFTDEP)
|
||||
usedsoftdep = 1;
|
||||
else
|
||||
|
Loading…
Reference in New Issue
Block a user