Bug 144953

Summary: [SOUP] Network Cache: NetworkProcess segfault when file system doesn't support xattrs
Product: WebKit Reporter: Ting-Wei Lan <lantw44>
Component: New BugsAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: cgarcia
Priority: P2 Keywords: Gtk, Soup
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Linux   
Attachments:
Description Flags
Patch mrobinson: review+

Description Ting-Wei Lan 2015-05-13 09:53:35 PDT
tmpfs doesn't support user_xattr on Linux. Therefore, if an user have its ~/.cache/epiphany on tmpfs, setting xattr::birthtime fails. When WebKit tries to read the value back in Source/WebKit2/NetworkProcess/cache/NetworkCacheFileSystemPosix.h, it will pass a null pointer to g_ascii_strtoull. This can cause segfault in WebKitNetworkProcess.
Comment 1 Ting-Wei Lan 2015-05-13 09:57:48 PDT
This problem also causes WebKitNetworkProcess to segfault on FreeBSD because it doesn't support xattr. Fortunately, FreeBSD has st_birthtime field in struct stat, so we can reuse PLATFORM(COCOA) code in NetworkCacheFileSystemPosix.h.
Comment 2 Carlos Garcia Campos 2015-05-13 09:59:24 PDT
Created attachment 253035 [details]
Patch
Comment 3 Carlos Garcia Campos 2015-05-13 10:02:48 PDT
(In reply to comment #1)
> This problem also causes WebKitNetworkProcess to segfault on FreeBSD because
> it doesn't support xattr. Fortunately, FreeBSD has st_birthtime field in
> struct stat, so we can reuse PLATFORM(COCOA) code in
> NetworkCacheFileSystemPosix.h.

Cool, that's a different issue, though. Could you file another bug report for that?
Comment 4 Carlos Garcia Campos 2015-05-13 23:00:50 PDT
Committed r184330: <http://trac.webkit.org/changeset/184330>
Comment 5 Ting-Wei Lan 2015-05-13 23:21:35 PDT
(In reply to comment #3)
> (In reply to comment #1)
> > This problem also causes WebKitNetworkProcess to segfault on FreeBSD because
> > it doesn't support xattr. Fortunately, FreeBSD has st_birthtime field in
> > struct stat, so we can reuse PLATFORM(COCOA) code in
> > NetworkCacheFileSystemPosix.h.
> 
> Cool, that's a different issue, though. Could you file another bug report
> for that?

https://bugs.webkit.org/show_bug.cgi?id=144989