Re: [PATCH 2/3] fsck: actually detect bad file modes in trees

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

 



On Wed, Aug 10, 2022 at 02:35:32PM -0700, Junio C Hamano wrote:

> Jeff King <peff@xxxxxxxx> writes:
> 
> > We use the normal tree_desc code to iterate over trees in fsck, meaning
> > we only see the canonicalized modes it returns. And hence we'd never see
> > anything unexpected, since it will coerce literally any garbage into one
> > of our normal and accepted modes.
> 
> Wow.  I did know canon_mode() deliberately discarding the extra
> permission bits on trees and blobs, but it was that bad to mark
> whatever it does not understand as a gitlink.  That is simply
> horrible.

Yeah, I noticed that, as well. It might actually be reasonable to put a
die() at the end of that canon_mode() function. It's rather unfriendly,
but then, treating nonsense as a gitlink is likely to just result in the
caller ending up aborting anyway.

Outside the scope of my patch, though. :)

-Peff



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux