Suspected memory leak in xenial backport of fix for CVE-2019-13012
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
glib2.0 (Ubuntu) |
In Progress
|
High
|
Leonidas S. Barbosa | ||
Precise |
Fix Released
|
Undecided
|
Leonidas S. Barbosa | ||
Trusty |
In Progress
|
Undecided
|
Leonidas S. Barbosa | ||
Xenial |
Fix Released
|
Undecided
|
Leonidas S. Barbosa |
Bug Description
(This is only from source code inspection, not tested in real use - I don't actually use Ubuntu.)
The upstream fix for CVE-2019-13012 included this change:
- g_file_
+ g_mkdir_
However, g_file_peek_path() was only introduced in GLib 2.56. The backport in the xenial package has this instead:
- g_file_
+ g_mkdir_
This is not equivalent. The difference between g_file_peek_path() and the older g_file_get_path() is that g_file_get_path() makes a copy, which must be freed with g_free() after use. As a result, there is now a memory leak.
A non-leaky backport would look something like this, which is what I've done in a proposed backport for Debian 9 'stretch':
+ char *dir;
...
- g_file_
+ dir = g_file_get_path (kfsb->dir);
+ g_mkdir_
+ g_free (dir);
CVE References
Changed in glib2.0 (Ubuntu): | |
assignee: | nobody → Leonidas S. Barbosa (leosilvab) |
Changed in glib2.0 (Ubuntu): | |
status: | New → In Progress |
Changed in glib2.0 (Ubuntu Precise): | |
status: | New → In Progress |
Changed in glib2.0 (Ubuntu Trusty): | |
status: | New → In Progress |
Changed in glib2.0 (Ubuntu Xenial): | |
status: | New → In Progress |
Changed in glib2.0 (Ubuntu Precise): | |
assignee: | nobody → Leonidas S. Barbosa (leosilvab) |
Changed in glib2.0 (Ubuntu Trusty): | |
assignee: | nobody → Leonidas S. Barbosa (leosilvab) |
Changed in glib2.0 (Ubuntu Xenial): | |
assignee: | nobody → Leonidas S. Barbosa (leosilvab) |
Thanks for the report Simon! Leo, could you have a look?