Re: [PATCH 2/7] fsck.cramfs: fix crash when superblock size is too small

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tuesday 23 January 2018, Tobias Stc3b6ckmann wrote:
> > This hopefully fixes the original problem addressed by the reverted
> > patch 7cb962c7.
>
> It does.
>
> >  	/* What are valid superblock sizes? */
> > -	if (super.size < sizeof(struct cramfs_super))
> > +	if (super.size < *start + sizeof(struct cramfs_super))
>
> And this is a more elegant (and working) solution. I was not sure how
> much adjustment this if-statement can handle due to the comment.

The comment is a bit stupid. Actually super.size should be a multiple of 
PAGE_SIZE of the running kernel to be able to mount it on the current 
system. I've relaxed this requirement to be able to fsck a cramfs from 
other systems. This is IMO a nice feature because in real life cramfs 
will be created often on cross-compiler hosts to be deployed to another 
embedded system. Though maybe we should add a warning like "This image 
is not mountable on the current system".

>
> Thanks and sorry for the regression,

All fine, you discovered a bug I made. :)

> Tobias
> --
> To unsubscribe from this list: send the line "unsubscribe util-linux"
> in the body of a message to majordomo@xxxxxxxxxxxxxxx
> More majordomo info at  http://vger.kernel.org/majordomo-info.html


--
To unsubscribe from this list: send the line "unsubscribe util-linux" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux