Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
SUSE:SLE-12-SP5:Update
xfsprogs.20283
xfsprogs-xfs_repair-initialize-realloced-bplist...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File xfsprogs-xfs_repair-initialize-realloced-bplist-in-longform_d.patch of Package xfsprogs.20283
From 1624c340a53012b4afd1194d990890c140e3fb66 Mon Sep 17 00:00:00 2001 From: Eric Sandeen <sandeen@redhat.com> Date: Tue, 30 Oct 2018 16:51:55 -0500 Subject: [PATCH] xfs_repair: initialize realloced bplist in longform_dir2_entry_check Git-commit: 1624c340a53012b4afd1194d990890c140e3fb66 Patch-mainline: v4.19.0-rc1 References: bsc#1187832 If we need to realloc the bplist[] array holding buffers for a given directory, we don't initialize the new slots. This causes a problem if the directory has holes, because those slots never get filled in. At the end of the function we call libxfs_putbuf for every non-null slot, and any uninitialized slots are segfault landmines. Make sure we initialize all new slots to NULL for this reason. Reported-by: Oleg Davydov <burunduk3@gmail.com> Signed-off-by: Eric Sandeen <sandeen@redhat.com> Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com> Signed-off-by: Eric Sandeen <sandeen@sandeen.net> Acked-by: Anthony Iliopoulos <ailiop@suse.com> --- repair/phase6.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/repair/phase6.c b/repair/phase6.c index e017326951f5..dc1cf8b9d4bb 100644 --- a/repair/phase6.c +++ b/repair/phase6.c @@ -2335,6 +2335,8 @@ longform_dir2_entry_check(xfs_mount_t *mp, db = xfs_dir2_da_to_db(mp->m_dir_geo, da_bno); if (db >= num_bps) { + int last_size = num_bps; + /* more data blocks than expected */ num_bps = db + 1; bplist = realloc(bplist, num_bps * sizeof(struct xfs_buf*)); @@ -2342,6 +2344,9 @@ longform_dir2_entry_check(xfs_mount_t *mp, do_error(_("realloc failed in %s (%zu bytes)\n"), __func__, num_bps * sizeof(struct xfs_buf*)); + /* Initialize the new elements */ + for (i = last_size; i < num_bps; i++) + bplist[i] = NULL; } if (isblock) -- 2.32.0
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor