From: Stefan Ring <stefanrin@gmail.com>
To: darrick.wong@oracle.com
Cc: linux-xfs@vger.kernel.org
Subject: Re: [PATCH 2/2] xfs_metadump: Zap more stale data
Date: Fri, 26 Oct 2018 07:32:35 +0200 [thread overview]
Message-ID: <CAAxjCEw5GTy+aK2e13ZeofJARA9OaLMYO-Etmo=DRA-MfVSQAw@mail.gmail.com> (raw)
In-Reply-To: <20181023154922.GC28243@magnolia>
On Tue, Oct 23, 2018 at 5:49 PM Darrick J. Wong <darrick.wong@oracle.com> wrote:
>
> On Thu, Oct 11, 2018 at 09:44:24PM +0200, Stefan Ring wrote:
> > I have empirically found and tried to fix some places where stale data was not
> > properly zeroed out.
> >
> > In the order of the code changes:
> >
> > - The "freeindex" blocks in inode directories, from last entry to end of block.
> > - XFS_DIR{2,3}_LEAFN_MAGIC, from last entry to end of block.
> > - In btree format inodes before as well as after the btree pointers.
> > - In dev inodes, everything after the header.
> > ---
> > db/metadump.c | 106 +++++++++++++++++++++++++++++++++++++++++++++++++++++-----
> > 1 file changed, 98 insertions(+), 8 deletions(-)
> >
> > diff --git a/db/metadump.c b/db/metadump.c
> > index ff96860d..c8213d41 100644
> > --- a/db/metadump.c
> > +++ b/db/metadump.c
> > @@ -2118,6 +2173,21 @@ process_btinode(
> > }
> >
> > pp = XFS_BMDR_PTR_ADDR(dib, 1, maxrecs);
> > +
> > + if (zero_stale_data) {
> > + char *top;
> > + int used;
> > +
> > + /* Space before btree pointers */
> > + top = (char*)XFS_BMDR_PTR_ADDR(dib, 1, nrecs);
> > + memset(top, 0, (char*)pp - top);
> > +
> > + /* Space after btree pointers */
> > + top = (char*)&pp[nrecs];
> > + used = top - (char*)dip;
> > + memset(top, 0, mp->m_sb.sb_inodesize - used);
>
> Er... this zaps everything past the end of the bmbt pointers, which
> means that this can zero the attr fork root.
True, this is broken. I'll play around a little more with this one.
next prev parent reply other threads:[~2018-10-26 14:08 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-11 19:44 [PATCH v3 0/2] Try to squash metadump data leaks Stefan Ring
2018-10-11 19:44 ` [PATCH 1/2] xfs_metadump: Extend zapping to multi fsb dir blocks Stefan Ring
2018-10-23 15:10 ` Eric Sandeen
2018-10-25 15:08 ` Eric Sandeen
2018-10-25 16:44 ` Stefan Ring
2018-10-11 19:44 ` [PATCH 2/2] xfs_metadump: Zap more stale data Stefan Ring
2018-10-23 15:49 ` Darrick J. Wong
2018-10-25 16:42 ` Stefan Ring
2018-10-26 20:23 ` Stefan Ring
2018-10-26 5:32 ` Stefan Ring [this message]
2018-10-25 15:50 ` [PATCH v3 0/2] Try to squash metadump data leaks Eric Sandeen
2018-10-26 0:36 ` Eric Sandeen
2018-10-26 5:29 ` Stefan Ring
2018-10-26 12:36 ` Eric Sandeen
2018-10-26 18:37 ` Stefan Ring
-- strict thread matches above, loose matches on Subject: below --
2018-10-11 19:23 [PATCH v2 " Stefan Ring
2018-10-11 19:23 ` [PATCH 2/2] xfs_metadump: Zap more stale data Stefan Ring
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='CAAxjCEw5GTy+aK2e13ZeofJARA9OaLMYO-Etmo=DRA-MfVSQAw@mail.gmail.com' \
--to=stefanrin@gmail.com \
--cc=darrick.wong@oracle.com \
--cc=linux-xfs@vger.kernel.org \
/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).