After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 741216 - crash on NULL deref in metatree.c
crash on NULL deref in metatree.c
Status: RESOLVED DUPLICATE of bug 598561
Product: gvfs
Classification: Core
Component: metadata
1.23.x
Other Linux
: Normal normal
: ---
Assigned To: gvfs-maint
gvfs-maint
Depends on:
Blocks:
 
 
Reported: 2014-12-07 14:01 UTC by Mikael Magnusson
Modified: 2014-12-08 08:24 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
fixes crash (418 bytes, text/plain)
2014-12-07 14:01 UTC, Mikael Magnusson
  Details
metadata: Handle failure if files are not readable (10.23 KB, patch)
2014-12-08 08:24 UTC, Ross Lagerwall
none Details | Review

Description Mikael Magnusson 2014-12-07 14:01:09 UTC
Created attachment 292251 [details]
fixes crash

  • #0 copy_tree_to_builder
    at metatree.c line 2123
  • #1 meta_tree_flush_locked
    at metatree.c line 2293
  • #2 meta_tree_flush
    at metatree.c line 2315
  • #3 writeout_timeout
    at meta-daemon.c line 62
  • #4 ??
    from /usr/lib64/libglib-2.0.so.0
  • #5 g_main_context_dispatch
    from /usr/lib64/libglib-2.0.so.0
  • #6 ??
    from /usr/lib64/libglib-2.0.so.0
  • #7 g_main_loop_run
    from /usr/lib64/libglib-2.0.so.0
  • #8 main
    at meta-daemon.c line 551

(the line numbers are from 1.20 but the same bug is in 1.23). Patch that masks the crash attached, no idea if you should abort earlier.

To reproduce the crash, chmod 000 ~/.local/share/gvfs-metadata and save a jpg from firefox, then wait a minute.
Comment 1 Ross Lagerwall 2014-12-08 07:18:25 UTC
Thanks for the report. I'll try come up with a patch that errors out earlier soon.
Comment 2 Ondrej Holy 2014-12-08 08:23:35 UTC
I've already draft of patch to fix it, I think it needs more work. We have to be sure that metadata daemon does not crash if meta_tree_init fails...

See the duplicated bug and also Bug 643268.

*** This bug has been marked as a duplicate of bug 598561 ***
Comment 3 Ross Lagerwall 2014-12-08 08:24:38 UTC
Created attachment 292286 [details] [review]
metadata: Handle failure if files are not readable

If the gvfs-metadata directory is not readable, handle the
failure by returning NULL if meta_tree_open fails.
Note that failing to open a tree for reading is not an
error, but failing to open for writing is an error.

Fix up several callers to handle a NULL tree without
crashing.