linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [bug report] ksm: introduce ksm_max_page_sharing per page deduplication limit
@ 2017-05-17 20:02 Dan Carpenter
  2017-05-17 21:52 ` Andrea Arcangeli
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2017-05-17 20:02 UTC (permalink / raw)
  To: aarcange; +Cc: linux-mm

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>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-05-17 21:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-05-17 20:02 [bug report] ksm: introduce ksm_max_page_sharing per page deduplication limit Dan Carpenter
2017-05-17 21:52 ` Andrea Arcangeli

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).