linux-next.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Coverity: page_zone(): Memory - corruptions
@ 2022-11-02 19:52 coverity-bot
  0 siblings, 0 replies; only message in thread
From: coverity-bot @ 2022-11-02 19:52 UTC (permalink / raw)
  To: Yajun Deng
  Cc: Andrew Morton, Gustavo A. R. Silva, linux-next, linux-hardening

Hello!

This is an experimental semi-automated report about issues detected by
Coverity from a scan of next-20221102 as part of the linux-next scan project:
https://scan.coverity.com/projects/linux-next-weekly-scan

You're getting this email because you were associated with the identified
lines of code (noted below) that were touched by commits:

  Tue Nov 1 17:26:18 2022 -0700
    5cb2ae82a4c4 ("mm: simplify page_zone() and get_deferred_split_queue() with page_pgdat()")

Coverity reported the following:

*** CID 1527097:  Memory - corruptions  (OVERRUN)
/include/linux/mm.h: 1458 in page_zone()
1452     {
1453     	return NODE_DATA(page_to_nid(page));
1454     }
1455
1456     static inline struct zone *page_zone(const struct page *page)
1457     {
vvv     CID 1527097:  Memory - corruptions  (OVERRUN)
vvv     "&page_pgdat(page)->node_zones[page_zonenum(page)]" evaluates to an address that is at byte offset 114688 of an array of 81920 bytes.
1458     	return &page_pgdat(page)->node_zones[page_zonenum(page)];
1459     }
1460
1461     static inline struct zone *folio_zone(const struct folio *folio)
1462     {
1463     	return page_zone(&folio->page);

If this is a false positive, please let us know so we can mark it as
such, or teach the Coverity rules to be smarter. If not, please make
sure fixes get into linux-next. :) For patches fixing this, please
include these lines (but double-check the "Fixes" first):

Reported-by: coverity-bot <keescook+coverity-bot@chromium.org>
Addresses-Coverity-ID: 1527097 ("Memory - corruptions")
Fixes: 5cb2ae82a4c4 ("mm: simplify page_zone() and get_deferred_split_queue() with page_pgdat()")

The problem appears to be the difference between page_zonenum()
returning up to ZONES_MASK-many, and node_zones[] being sized
precisely...

Thanks for your attention!

-- 
Coverity-bot

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-11-02 19:52 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-02 19:52 Coverity: page_zone(): Memory - corruptions coverity-bot

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