[bug report] ksm: introduce ksm_max_page_sharing per page deduplication limit

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@xxxxxxxxx";> email@xxxxxxxxx </a>



[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]
  Powered by Linux