linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: aarcange@redhat.com
Cc: linux-mm@kvack.org
Subject: [bug report] ksm: introduce ksm_max_page_sharing per page deduplication limit
Date: Wed, 17 May 2017 23:02:55 +0300	[thread overview]
Message-ID: <20170517200255.67kvej2onwv54psi@mwanda> (raw)

Hello Andrea Arcangeli,

The patch 1073fbb7013b: "ksm: introduce ksm_max_page_sharing per page
deduplication limit" from May 13, 2017, leads to the following static
checker warning:

	mm/ksm.c:1442 __stable_node_chain()
	warn: 'stable_node' was already freed.

mm/ksm.c
  1433  static struct stable_node *__stable_node_chain(struct stable_node **_stable_node,
  1434                                                 struct page **tree_page,
  1435                                                 struct rb_root *root,
  1436                                                 bool prune_stale_stable_nodes)
  1437  {
  1438          struct stable_node *stable_node = *_stable_node;
  1439          if (!is_stable_node_chain(stable_node)) {
  1440                  if (is_page_sharing_candidate(stable_node)) {
  1441                          *tree_page = get_ksm_page(stable_node, false);
  1442                          return stable_node;

There is a comment about this somewhere down the call tree but if
get_ksm_page() fails then we're returning a freed pointer here which is
gnarly.

  1443                  }
  1444                  return NULL;
  1445          }
  1446          return stable_node_dup(_stable_node, tree_page, root,
  1447                                 prune_stale_stable_nodes);
  1448  }


regards,
dan carpenter

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

             reply	other threads:[~2017-05-17 20:03 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-17 20:02 Dan Carpenter [this message]
2017-05-17 21:52 ` Andrea Arcangeli

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=20170517200255.67kvej2onwv54psi@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=aarcange@redhat.com \
    --cc=linux-mm@kvack.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