public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCHSET v2 0/3] xfs: fix buffer cancellation table leak during log recovery
@ 2022-05-24  5:35 Darrick J. Wong
  2022-05-24  5:35 ` [PATCH 1/3] xfs: refactor buffer cancellation table allocation Darrick J. Wong
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Darrick J. Wong @ 2022-05-24  5:35 UTC (permalink / raw)
  To: djwong; +Cc: Christoph Hellwig, linux-xfs, david

Hi all,

As part of solving the memory leaks and UAF problems, kmemleak also
reported that log recovery will leak the table used to hash buffer
cancellations if the recovery fails.  Fix this problem by creating
alloc/free helpers that initialize and free the hashtable contents
correctly.

v2: rebase against most recent for-next

If you're going to start using this mess, you probably ought to just
pull from my git trees, which are linked below.

This is an extraordinary way to destroy everything.  Enjoy!
Comments and questions are, as always, welcome.

--D

kernel git tree:
https://git.kernel.org/cgit/linux/kernel/git/djwong/xfs-linux.git/log/?h=log-recovery-leak-fixes-5.19
---
 fs/xfs/libxfs/xfs_log_recover.h |   14 +++++---
 fs/xfs/xfs_buf_item_recover.c   |   66 +++++++++++++++++++++++++++++++++++++++
 fs/xfs/xfs_log_priv.h           |    3 --
 fs/xfs/xfs_log_recover.c        |   34 +++++++-------------
 4 files changed, 85 insertions(+), 32 deletions(-)


^ permalink raw reply	[flat|nested] 10+ messages in thread
* [PATCHSET 0/3] xfs: fix buffer cancellation table leak during log recovery
@ 2022-05-18 18:55 Darrick J. Wong
  2022-05-18 18:55 ` [PATCH 1/3] xfs: refactor buffer cancellation table allocation Darrick J. Wong
  0 siblings, 1 reply; 10+ messages in thread
From: Darrick J. Wong @ 2022-05-18 18:55 UTC (permalink / raw)
  To: djwong; +Cc: linux-xfs, david

Hi all,

As part of solving the memory leaks and UAF problems, kmemleak also
reported that log recovery will leak the table used to hash buffer
cancellations if the recovery fails.  Fix this problem by creating
alloc/free helpers that initialize and free the hashtable contents
correctly.

If you're going to start using this mess, you probably ought to just
pull from my git trees, which are linked below.

This is an extraordinary way to destroy everything.  Enjoy!
Comments and questions are, as always, welcome.

--D

kernel git tree:
https://git.kernel.org/cgit/linux/kernel/git/djwong/xfs-linux.git/log/?h=log-recovery-leak-fixes-5.19
---
 fs/xfs/libxfs/xfs_log_recover.h |    2 ++
 fs/xfs/xfs_buf_item_recover.c   |   45 +++++++++++++++++++++++++++++++++++++++
 fs/xfs/xfs_log_recover.c        |   23 ++++++++------------
 3 files changed, 56 insertions(+), 14 deletions(-)


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

end of thread, other threads:[~2022-05-27  1:26 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-05-24  5:35 [PATCHSET v2 0/3] xfs: fix buffer cancellation table leak during log recovery Darrick J. Wong
2022-05-24  5:35 ` [PATCH 1/3] xfs: refactor buffer cancellation table allocation Darrick J. Wong
2022-05-27  1:24   ` Dave Chinner
2022-05-24  5:35 ` [PATCH 2/3] xfs: don't leak xfs_buf_cancel structures when recovery fails Darrick J. Wong
2022-05-27  1:25   ` Dave Chinner
2022-05-24  5:36 ` [PATCH 3/3] xfs: convert buf_cancel_table allocation to kmalloc_array Darrick J. Wong
2022-05-27  1:25   ` Dave Chinner
  -- strict thread matches above, loose matches on Subject: below --
2022-05-18 18:55 [PATCHSET 0/3] xfs: fix buffer cancellation table leak during log recovery Darrick J. Wong
2022-05-18 18:55 ` [PATCH 1/3] xfs: refactor buffer cancellation table allocation Darrick J. Wong
2022-05-19  8:35   ` Christoph Hellwig
2022-05-19 18:01     ` Darrick J. Wong

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox