Linux NFS development
 help / color / mirror / Atom feed
From: Andrew W Elble <aweits@rit.edu>
To: Jeff Layton <jlayton@poochiereds.net>
Cc: "J. Bruce Fields" <bfields@fieldses.org>,
	<linux-nfs@vger.kernel.org>,
	Anna Schumaker <schumakeranna@gmail.com>
Subject: Re: list_del corruption / unhash_ol_stateid()
Date: Tue, 04 Aug 2015 16:18:10 -0400	[thread overview]
Message-ID: <m2bnemg64d.fsf@discipline.rit.edu> (raw)
In-Reply-To: <20150730085723.0ab8e76c@tlielax.poochiereds.net> (Jeff Layton's message of "Thu, 30 Jul 2015 08:57:23 -0400")


> In any case, I think this explains where the "no readable file" warning
> is coming from, but I'm not sure yet about the mem corruption...

Forgive my shorthand, but I think this is what we're seeing:

open2              close
 create 1 (idr)
 init 2 (hashed)

                   close preprocess_seqid 3 (local ref in nfsd4_close)
		   close_open_stateid 2 -> unhashed (unhashed)

 release_open_stateid 1 -> list_del corruption (because unhashed already
                        -> should still be refcount 2?)

                   nfs4_put_stid 0 -> destroyed

 nfs4_put_stid 0 -> use after free

This also explains the '6a' as the first byte, as the final
nfs4_put_stid will decrement sc_count first. There are other permutations.

Also, the return-with-status from nfs_get_vfs_file() appears to be break_lease()
(much further down) returning -EWOULDBLOCK (in both cases, memory
corruption and the simple warning case)

Thanks,

Andy
-- 
Andrew W. Elble
aweits@discipline.rit.edu
Infrastructure Engineer, Communications Technical Lead
Rochester Institute of Technology
PGP: BFAD 8461 4CCF DC95 DA2C B0EB 965B 082E 863E C912

  reply	other threads:[~2015-08-04 20:18 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-27 15:13 list_del corruption / unhash_ol_stateid() Andrew W Elble
2015-07-27 18:06 ` Andrew W Elble
2015-07-27 20:40   ` J. Bruce Fields
2015-07-27 21:03     ` Andrew W Elble
2015-07-28 13:02   ` Jeff Layton
2015-07-28 15:01     ` Andrew W Elble
2015-07-28 15:49       ` Jeff Layton
2015-07-28 21:04         ` J. Bruce Fields
2015-07-29 15:17           ` Andrew W Elble
2015-07-29 19:52             ` Andrew W Elble
2015-07-30 11:11               ` Andrew W Elble
2015-07-30 12:57                 ` Jeff Layton
2015-08-04 20:18                   ` Andrew W Elble [this message]
2015-08-05 15:11                     ` Jeff Layton
2015-08-05 16:33                       ` Andrew W Elble
2015-08-05 17:12                         ` Jeff Layton

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=m2bnemg64d.fsf@discipline.rit.edu \
    --to=aweits@rit.edu \
    --cc=bfields@fieldses.org \
    --cc=jlayton@poochiereds.net \
    --cc=linux-nfs@vger.kernel.org \
    --cc=schumakeranna@gmail.com \
    /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