LWN.net Logo

Allocating uninitialized file blocks

Allocating uninitialized file blocks

Posted Apr 19, 2012 15:44 UTC (Thu) by joey (subscriber, #328)
Parent article: Allocating uninitialized file blocks

I was just reading yesterday about a torrent program that used the equivilant option in Windows. So every partially downloaded torrent file exposes other "deleted" data. Ugh.


(Log in to post comments)

Allocating uninitialized file blocks

Posted Apr 19, 2012 20:51 UTC (Thu) by intgr (subscriber, #39733) [Link]

> that used the equivilant option in Windows

Are you saying that there's an equivalent to the new proposed FALLOC_FL_NO_HIDE_STALE flag too? I'd be surprised. Can you link to the discussion?

(Maybe you're just confused. I'm sure there is a fallocate() equivalent feature in Windows -- but fallocate() doesn't leak any foreign file data, without this new proposed flag)

Allocating uninitialized file blocks

Posted Apr 19, 2012 21:22 UTC (Thu) by Fowl (subscriber, #65667) [Link]

That would be the SetFileValidData function, which "is useful in very limited scenarios. "

To use it requires the SE_MANAGE_VOLUME_NAME privilege (ie. raw disk access).

"Applications should call SetFileValidData only on files that restrict access to those entities that have SE_MANAGE_VOLUME_NAME access. The application must ensure that the unwritten ranges of the file are never exposed, or security issues can result as follows."

[Something about giving just enough rope to hang yourself / trusting programmers to know what they're doing.]

Copyright © 2013, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds