[OpenWrt-Devel] Squashfs breakage lottery with UBI WAS: [PATCH RFC 2/2] amp821xx: use newly added pad-squashfs for Meraki MR24

Christian Lamparter chunkeey at gmail.com
Fri Aug 30 14:51:10 EDT 2019


On Thursday, August 29, 2019 1:55:25 PM CEST Russell Senior wrote:
> 
> >> Fwiw, I took a little closer look at the squashfs code. I still don't
> >> quite understand it, but I sprinkled some printk()'s and got a better
> >> idea of what is happening.
> >> 
> >> With a root.squashfs of 6428672 bytes, we get the error in a call:
> >
> > Actually, the 6428672 bytes was from a later trial. Sorry for the
> > confusion. I'm not sure what the real root.squashfs size was
> > anymore. Gah. I'll need to redo it.
> 
> Here are the corresponding numbers from the retry:
> 
> root.squasfs size (from the sysupgrade.bin tarball): 6427978 bytes
> 
> squashfs_read_data(sb=(ptrval),index=0,length=6427970,next_index=16777224,output=(null))
> b=0; bytes=-322; length=8; cur_index=0
> 
> >> 
> >>   squashfs_read_data(sb=(ptrval),index=0,length=6427986,next_index=16777224,output=  (null))
> >> 
> >> it enters the loop at fs/squashfs/block.c:122 with b=0; bytes=-338; length=8; cur_index=0
> >> 
> >>     for (b = 0; bytes < length; b++, cur_index++) {
> >>         bh[b] = sb_getblk(sb, cur_index);
> >>         if (bh[b] == NULL)
> >>             goto block_release;
> >> 
> >> sb_getblk() must return NULL, because it goes to block_release and falls
> >> through to print the error message and exits with an error.
> 
Ok.

I did push a patch titled:
"build: remove harmful -nopad option from mksquashfs"
<https://git.openwrt.org/?p=openwrt/openwrt.git;a=commit;h=1c0290c5cc6258c48b8ba46b4f9c85a21de4f875> 

so, let's see if this triggers more undefined behaviour 
and exposes more hidden broken code.

Regards,
Christian



_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel



More information about the openwrt-devel mailing list