2

If there are files or folders the current user should be denied access to, should their sizes be displayed when the user asks, for example with the ls -l command on Linux or the places the Windows Explorer shell puts this information? Alternatively, should the OS show the size without the denied file(s)/folder(s)?

I can see the merits of both sides of this argument. In some cases, the user should be denied access to any information on these files & folders, and that includes their sizes. However, if a user, who is not an administrator at the moment but wants to see how much space is left to install programs etc. (more on Windows than Linux, as Linux has a better permissions system in my opinion), he/she may want to know this. Also, many times the OS denies access to "files that are important to the running of the computer and should never be touched even by super-ultra-mega-users", but if these files get too big, the user may wish to know. Usually there are tools to find this out, and I suppose there is always some way to find out/fix it, but there are always those edge cases.

I am looking at whether the parent/ancestor folder's true size should be shown, because I understand there are times where the denied files/folders shouldn't be shown at all, much less their sizes. I also acknowledge that there are different sizes the OS can show, such as "size on disk" or "apparent size", so you don't have to go into this.

So should the OS deny access to information about the sizes of these files? Should there be a special permission just for sizes of files, or is there already? How do OS's usually deal with this?

migrated from cs.stackexchange.com Apr 25 '14 at 8:24

This question came from our site for students, researchers and practitioners of computer science.

  • This question was migrated from Stack Overflow from this question. The close votes were coming in slowly and I didn't want to wait so I did it myself. – trysis Apr 23 '14 at 18:37
  • 2
    This question is not so much about the scientific foundation of OS or filesystems but about implementation considertions. It is probably better off on Information Security and/or User Experience; where do you want me to migrate it to? – Raphael Apr 24 '14 at 5:57
  • Wow, I think this is the first question I've seen go to 3 sites. – trysis Apr 25 '14 at 18:43
  • There should be a badge for that! – Evil Closet Monkey Oct 6 '14 at 21:56
3

Not an answer, but two related thoughts:

  1. Side channel attacks: In cryptography, the usual mode of attack is access to some encrypted information (ciphertext) along with some information on the corresponding unencrypted information (plaintext). Side channel attacks, in contrast, access unintended outputs of the encryption and decryption operators, such as the effect of keys on power consumption. In your example, the contents of the file is the "plaintext", and its size is a "side channel". In some cases, the size could betray important information: maybe the file is updated each time a packet arrives, and then you could tell from the file size when this happens.

  2. Subliminal channels and steganography: This is the complementary phenomenon in which the extra information acts in your benefit. Suppose for example that you want to communicate with someone without anyone knowing. You publish an innocent-looking post on your blog, but if you look at each 11th letter then it spells out a message. This is known as a subliminal channel, and in practice you'd probably want to be less obvious. In your example, the contents of the file is the superliminal channel, while the size of the file is the subliminal channel. Assuming that we don't want to allow this kind of hidden communication (why would we?), this is another reason for hiding the file size.

In Unix, the stat system call requires no permissions on the file being looked at, but it requires execute permission on all the directories on the path leading to the file. So if you wanted to hide the size of a file, your only option is to put it in an "opaque" directory.

  • Interesting thoughts, thanks. If you can use these attacks, I would think you could use an easier, more direct attack, but every little bit of info helps an attacker. For the stat call, it can also be called on folders, but does it only report combined size of child files/folders it has execute permissions of the parents of? – trysis Apr 23 '14 at 20:01
  • I don't know the behavior of stat of directories, if you have a superuser account on your computer perhaps you could try it out. – Yuval Filmus Apr 23 '14 at 20:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.