public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jim Meyering <jim@meyering.net>
To: "Pádraig Brady" <P@draigBrady.com>
Cc: Matthias Schniedermeyer <ms@citd.de>,
	Luke Kenneth Casson Leighton <lkcl@lkcl.net>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Pavel Machek <pavel@ucw.cz>, Coreutils <coreutils@gnu.org>
Subject: Re: ext3 hacked filesystem (by debian exim4 exploit) available for analysis and bugreporting
Date: Sat, 30 Jul 2011 11:14:16 +0200	[thread overview]
Message-ID: <87bowcyvtj.fsf@rho.meyering.net> (raw)
In-Reply-To: <4E33397F.4010908@draigBrady.com> ("Pádraig Brady"'s message of "Fri, 29 Jul 2011 23:51:43 +0100")

Pádraig Brady wrote:
...
> `strace lsattr ...` shows it calls ioctl (...FS_IOC_GETFLAGS...)
> So there would be overhead.
> The output of ls is fairly constrained too for compat reasons.

One way by which ls -l could inform us that a file has
"attributes" like that would be via what POSIX calls the
"optional alternate access method flag".  Currently,
it can be a space, a "+", or a ".":

Since coreutils-7.1 (Feb 2009), ls -l has been doing this:

    ls -l now marks SELinux-only files with the less obtrusive '.',
    rather than '+'.  A file with any other combination of MAC and ACL
    is still marked with a '+'.

Using other printable characters to denote attributes (trumping
SELinux, MAC and ACL settings) is possible.  Does any other ls
implementation already do that?  There would be the cost of the
additional ioctl... we'd have to measure that before deciding
whether to impose this on every use of ls -l.

Another possibility is to further overload the file type decorations
("*", "|", "="), that you see with -F.  Already, "*" is obviously
not a type indicator, so adding more attributes is not shocking.

> However these flags are not specific to ext2 so it would fit
> quite well from that perspective.
> It might be something we could add to the stat command at least?

Yes, this definitely deserves a new stat format directive or two.
At least one for each single-byte "attribute" described in chattr(1),
and maybe another for a readable string so we don't have to look up
the likes of "T" ("top" dir hint, for orlov block allocator) and
"t" (no-tail-merge).

  parent reply	other threads:[~2011-07-30  9:14 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-25 12:08 ext3 hacked filesystem (by debian exim4 exploit) available for analysis and bugreporting Luke Kenneth Casson Leighton
2011-07-25 13:45 ` Matthias Schniedermeyer
2011-07-25 21:08   ` Luke Kenneth Casson Leighton
2011-07-29 19:59     ` Pavel Machek
2011-07-29 21:31       ` Matthias Schniedermeyer
2011-07-29 22:51         ` Pádraig Brady
2011-07-30  2:47           ` Kyle Moffett
2011-07-30  9:14           ` Jim Meyering [this message]
2011-07-30 13:03             ` Luke Kenneth Casson Leighton
2011-07-30 13:15           ` Luke Kenneth Casson Leighton
2011-07-30 12:58       ` Luke Kenneth Casson Leighton

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87bowcyvtj.fsf@rho.meyering.net \
    --to=jim@meyering.net \
    --cc=P@draigBrady.com \
    --cc=coreutils@gnu.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lkcl@lkcl.net \
    --cc=ms@citd.de \
    --cc=pavel@ucw.cz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox