linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Greg Freemyer <greg.freemyer@gmail.com>
To: Kazuya Mio <k-mio@sx.jp.nec.com>
Cc: linux-ext4@vger.kernel.org, Theodore Tso <tytso@mit.edu>
Subject: Re: [PATCH 3/3] e4defrag: avoid unsuccessful return in non-privileged user
Date: Wed, 30 Sep 2009 14:37:24 -0400	[thread overview]
Message-ID: <87f94c370909301137s40f09b7wb08ca7dee9f8dd15@mail.gmail.com> (raw)
In-Reply-To: <4AC3073D.9070606@sx.jp.nec.com>

2009/9/30 Kazuya Mio <k-mio@sx.jp.nec.com>:
> If non-privileged user does e4defrag, e4defrag returns 1 despite
> its success. This patch fixes this problem.
>
> Signed-off-by: Kazuya Mio <k-mio@sx.jp.nec.com>
> ---
>
>  e4defrag.c |    1 +
>  1 file changed, 1 insertion(+)
> diff --git a/misc/e4defrag.c b/misc/e4defrag.c
> index 94f8529..98dda92 100644
> --- a/misc/e4defrag.c
> +++ b/misc/e4defrag.c
> @@ -2025,6 +2025,7 @@ int main(int argc, char *argv[])
>                                if (!(mode_flag & DETAIL) &&
>                                                current_uid != ROOT_UID) {
>                                        printf(" Done.\n");
> +                                       success_flag = 1;
>                                        continue;
>                                }

I should know this, but this patch made me wonder about the underlying
implementation of EXT4_IOC_MOVE_EXT.

After EXT4_IOC_MOVE_EXT is called, can userspace somehow modify the
defragged file?

ie. If I only have readonly access to a file and I call
EXT4_IOC_MOVE_EXT to replace some of the data blocks, is it possible
now for me to write data to the donor_fd and thus modify the data in
the original file?

Greg
-- 
Greg Freemyer
Head of EDD Tape Extraction and Processing team
Litigation Triage Solutions Specialist
http://www.linkedin.com/in/gregfreemyer
Preservation and Forensic processing of Exchange Repositories White Paper -
<http://www.norcrossgroup.com/forms/whitepapers/tng_whitepaper_fpe.html>

The Norcross Group
The Intersection of Evidence & Technology
http://www.norcrossgroup.com
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2009-09-30 18:37 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-30  7:22 [PATCH 3/3] e4defrag: avoid unsuccessful return in non-privileged user Kazuya Mio
2009-09-30 18:37 ` Greg Freemyer [this message]
2009-10-01  8:16   ` Kazuya Mio

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=87f94c370909301137s40f09b7wb08ca7dee9f8dd15@mail.gmail.com \
    --to=greg.freemyer@gmail.com \
    --cc=k-mio@sx.jp.nec.com \
    --cc=linux-ext4@vger.kernel.org \
    --cc=tytso@mit.edu \
    /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;
as well as URLs for NNTP newsgroup(s).