Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 678028

Summary: sys-fs/squashtools-4.3-r2(?) with sys-libs/musl - unsquashfs: segmentation fault in ? at ?
Product: Gentoo Linux Reporter: malinowski
Component: OverlaysAssignee: Gentoo LiveCD Package Maintainers <livecd>
Status: RESOLVED TEST-REQUEST    
Severity: normal CC: gentoo
Priority: Normal Keywords: PATCH
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: Squashfs-tools - fix for stack overflow

Description malinowski 2019-02-14 19:56:00 UTC
Created attachment 565412 [details, diff]
Squashfs-tools - fix for stack overflow

sys-fs/squashfs-tools segfaults on musl due to a stack overflow when using unsquashfs. Details here: https://sourceforge.net/p/squashfs/bugs/59/

Thanks to @vaeth for helping me find the cause, and @ncopa (Alpine Dev) for the patch! 

N.B. I'm currently not running musl so if someone could check this again that would be appreciated, hence no strace logs. I've attached the patch however. If memory serves correctly, this was caused when trying to unsquashfs something.
Comment 1 Jeroen Roovers (RETIRED) gentoo-dev 2019-02-14 21:21:55 UTC
Assuming this is about unsquashfs.
Comment 2 Jeroen Roovers (RETIRED) gentoo-dev 2019-02-14 21:22:53 UTC
Which version are you using?
Comment 3 malinowski 2019-02-14 23:31:50 UTC
(In reply to Jeroen Roovers from comment #2)
> Which version are you using?

Hi. If I had to recall, it was 4.3-r2 - I was using amd64 around June 2018.
Comment 4 Jeroen Roovers (RETIRED) gentoo-dev 2019-02-16 10:37:27 UTC
If you can reproduce the problem with a later version we might have something to fix (or alternatively stabilise).
Comment 5 Michael 'veremitz' Everitt 2019-10-21 06:51:35 UTC
Looks like we need to file a PR at https://github.com/plougher/squashfs-tools . This is somewhat overdue a fix, and all downstreams (us included) will benefit!
Comment 6 Jeroen Roovers (RETIRED) gentoo-dev 2019-10-21 07:39:40 UTC
(In reply to Michael 'veremitz' Everitt from comment #5)
> Looks like we need to file a PR at
> https://github.com/plougher/squashfs-tools . This is somewhat overdue a fix,
> and all downstreams (us included) will benefit!

https://github.com/plougher/squashfs-tools/commit/ba215d73e153a6f237088b4ecb88c702bb4d4183
Comment 7 Michael 'veremitz' Everitt 2019-10-21 13:45:35 UTC
(In reply to Jeroen Roovers from comment #6)
> (In reply to Michael 'veremitz' Everitt from comment #5)
> > Looks like we need to file a PR at
> > https://github.com/plougher/squashfs-tools . This is somewhat overdue a fix,
> > and all downstreams (us included) will benefit!
> 
> https://github.com/plougher/squashfs-tools/commit/
> ba215d73e153a6f237088b4ecb88c702bb4d4183

WFM, well spotted ! :]
Comment 8 Jeroen Roovers (RETIRED) gentoo-dev 2019-10-21 16:22:03 UTC
(In reply to Michael 'veremitz' Everitt from comment #7)
> (In reply to Jeroen Roovers from comment #6)
> > (In reply to Michael 'veremitz' Everitt from comment #5)
> > > Looks like we need to file a PR at
> > > https://github.com/plougher/squashfs-tools . This is somewhat overdue a fix,
> > > and all downstreams (us included) will benefit!
> > 
> > https://github.com/plougher/squashfs-tools/commit/
> > ba215d73e153a6f237088b4ecb88c702bb4d4183
> 
> WFM, well spotted ! :]

It works for everyone so long as no one uses the unsquashfs code to create a library.
Comment 9 Jeroen Roovers (RETIRED) gentoo-dev 2019-10-21 16:23:02 UTC
Anyway, please try 4.4 and report back here.