diff options
author | Jo-Philipp Wich <jo@mein.io> | 2019-12-22 19:46:05 +0100 |
---|---|---|
committer | Jo-Philipp Wich <jo@mein.io> | 2019-12-22 19:54:42 +0100 |
commit | b4e25d54035c5092e8e9b46ab63500e95ac8c730 (patch) | |
tree | 9290e83dfc6f5399497f89a5a42129da60b51d3d | |
parent | 111a43f8c64683e79859dcb3f4b7aa437e24502b (diff) | |
download | fstools-b4e25d54035c5092e8e9b46ab63500e95ac8c730.tar.gz |
libblkid-tiny: fix symbol collision with full libblkid
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>
-rw-r--r-- | libblkid-tiny/blkid.h | 4 | ||||
-rw-r--r-- | libblkid-tiny/libblkid-tiny.h | 4 | ||||
-rw-r--r-- | libblkid-tiny/probe.c | 4 | ||||
-rw-r--r-- | probe.c | 4 |
4 files changed, 8 insertions, 8 deletions
diff --git a/libblkid-tiny/blkid.h b/libblkid-tiny/blkid.h index 799e699..be16b8f 100644 --- a/libblkid-tiny/blkid.h +++ b/libblkid-tiny/blkid.h @@ -215,11 +215,11 @@ extern char *blkid_evaluate_spec(const char *spec, blkid_cache *cache) __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); diff --git a/libblkid-tiny/libblkid-tiny.h b/libblkid-tiny/libblkid-tiny.h index aa87fd9..f0922b5 100644 --- a/libblkid-tiny/libblkid-tiny.h +++ b/libblkid-tiny/libblkid-tiny.h @@ -62,8 +62,8 @@ struct blkid_struct_probe 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); diff --git a/libblkid-tiny/probe.c b/libblkid-tiny/probe.c index ae7e708..bf68840 100644 --- a/libblkid-tiny/probe.c +++ b/libblkid-tiny/probe.c @@ -14,7 +14,7 @@ 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; @@ -27,7 +27,7 @@ struct blkid_struct_probe *blkid_new_probe(void) return pr; } -void blkid_free_probe(struct blkid_struct_probe *pr) +void blkidtiny_free_probe(struct blkid_struct_probe *pr) { if (!pr) return; @@ -24,7 +24,7 @@ probe_path_tiny(const char *path) struct blkid_struct_probe *pr; char *type, *dev, *uuid, *label, *version; - pr = blkid_new_probe(); + pr = blkidtiny_new_probe(); if (!pr) return NULL; @@ -53,7 +53,7 @@ probe_path_tiny(const char *path) } } - blkid_free_probe(pr); + blkidtiny_free_probe(pr); return info; } |