The recent introduction of blkid_new_probe() and blkid_free_probe() in the
dynamically linked libblkid-tiny caused the dlopen'd libblkid.so to call into
the wrong version of blkid_new_probe() within blkid_new_probe_from_filename(),
leading to memory corruption and eventual segmentation faults.
Fixes:
b82c5c1 ("libblkid-tiny: add functions for allocating & freeing probe struct")
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
__ul_attribute__((warn_unused_result));
/* probe.c */
-extern blkid_probe blkid_new_probe(void)
+extern blkid_probe blkidtiny_new_probe(void)
__ul_attribute__((warn_unused_result));
extern blkid_probe blkid_new_probe_from_filename(const char *filename)
__ul_attribute__((warn_unused_result));
-extern void blkid_free_probe(blkid_probe pr);
+extern void blkidtiny_free_probe(blkid_probe pr);
extern void blkid_reset_probe(blkid_probe pr);
struct list_head buffers; /* list of buffers */
};
-struct blkid_struct_probe *blkid_new_probe(void);
-void blkid_free_probe(struct blkid_struct_probe *pr);
+struct blkid_struct_probe *blkidtiny_new_probe(void);
+void blkidtiny_free_probe(struct blkid_struct_probe *pr);
extern int probe_block(char *block, struct blkid_struct_probe *pr);
extern int mkblkdev(void);
static int blkid_probe_reset_buffers(struct blkid_struct_probe *pr);
-struct blkid_struct_probe *blkid_new_probe(void)
+struct blkid_struct_probe *blkidtiny_new_probe(void)
{
struct blkid_struct_probe *pr;
return pr;
}
-void blkid_free_probe(struct blkid_struct_probe *pr)
+void blkidtiny_free_probe(struct blkid_struct_probe *pr)
{
if (!pr)
return;
struct blkid_struct_probe *pr;
char *type, *dev, *uuid, *label, *version;
- pr = blkid_new_probe();
+ pr = blkidtiny_new_probe();
if (!pr)
return NULL;
}
}
- blkid_free_probe(pr);
+ blkidtiny_free_probe(pr);
return info;
}