diff options
author | Matthew Wilcox (Oracle) <willy@infradead.org> | 2022-01-13 16:44:19 -0500 |
---|---|---|
committer | Matthew Wilcox (Oracle) <willy@infradead.org> | 2022-01-13 16:50:50 -0500 |
commit | 6840f9094f2bd788a316d8cb0a4e42538d3e47dd (patch) | |
tree | fdf243f4cbabe294b4091af6c4696801a24e6e97 /include/linux/pagevec.h | |
parent | 455e73a07f6e288b0061dfcf4fcf54fa9fe06458 (diff) | |
download | linux-6840f9094f2bd788a316d8cb0a4e42538d3e47dd.tar.gz linux-6840f9094f2bd788a316d8cb0a4e42538d3e47dd.tar.bz2 linux-6840f9094f2bd788a316d8cb0a4e42538d3e47dd.zip |
pagevec: Initialise folio_batch->percpu_pvec_drained
When UBSAN is enabled, it reports an invalid value in __pagevec_release()
when accessing pvec->percpu_pvec_drained, which is simply whatever
garbage was on the stack. Initialise it when initialising the rest of
the folio_batch.
Fixes: 10331795fb79 ("pagevec: Add folio_batch")
Reported-by: Randy Dunlap <rdunlap@infradead.org>
Tested-by: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Diffstat (limited to 'include/linux/pagevec.h')
-rw-r--r-- | include/linux/pagevec.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/pagevec.h b/include/linux/pagevec.h index dda8d5868c81..67b1246f136b 100644 --- a/include/linux/pagevec.h +++ b/include/linux/pagevec.h @@ -111,6 +111,7 @@ static_assert(offsetof(struct pagevec, pages) == static inline void folio_batch_init(struct folio_batch *fbatch) { fbatch->nr = 0; + fbatch->percpu_pvec_drained = false; } static inline unsigned int folio_batch_count(struct folio_batch *fbatch) |