linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2 RESEND] vfs: Fix crashes when reading /proc/mounts
@ 2018-12-11 17:24 Jan Kara
  2018-12-11 17:24 ` [PATCH 1/2] vfs: Provide function to grab superblock reference Jan Kara
  2018-12-11 17:24 ` [PATCH 2/2] proc: Protect readers of /proc/mounts from remount Jan Kara
  0 siblings, 2 replies; 10+ messages in thread
From: Jan Kara @ 2018-12-11 17:24 UTC (permalink / raw)
  To: Al Viro; +Cc: linux-fsdevel, Jan Kara

Hello,

resending this patch series since I got no reply for almost two months.  This
patch series aims at fixing possible races between functions formatting output
for /proc/mounts and friends and remount. Especially ->show_options functions
of filesystems are not counting with the fact that options can change under
them and thus races can result in bogus output or outright crashes (like was
the case with ext4 handling of quota mount option, or udf could crash when
printing charset name, or xfs when printing log device name etc.).

Admittedly the patch 2/2 is somewhat ugly because namespace_sem ranks below
sb->s_umount semaphore but I think it is bearable. Al, what do you think?

								Honza

^ permalink raw reply	[flat|nested] 10+ messages in thread
* [PATCH 0/2 v2] vfs: Fix crashes when reading /proc/mounts
@ 2018-12-18 13:46 Jan Kara
  2018-12-18 13:46 ` [PATCH 2/2] proc: Protect readers of /proc/mounts from remount Jan Kara
  0 siblings, 1 reply; 10+ messages in thread
From: Jan Kara @ 2018-12-18 13:46 UTC (permalink / raw)
  To: Al Viro; +Cc: linux-fsdevel, Jan Kara

Hello,

this is a second revision of the patch series which aims at fixing possible
races between functions formatting output for /proc/mounts and friends and
remount. Especially ->show_options functions of filesystems are not counting
with the fact that options can change under them and thus races can result in
bogus output or outright crashes (like was the case with ext4 handling of quota
mount option, or udf could crash when printing charset name, or xfs when
printing log device name etc.).

Since v1, I have changed the logic so that all the locking & restart magic
happens in m_show() so that we don't bail back to traverse(), then m_start(),
and then back to m_show(). Al, is it better this way?

I was not able to get rid of the hold_sb() helper which you didn't like much as
namespace_sem is private to fs/namespace.c and we need to drop it after
acquiring sb reference and before blocking on sb->s_umount semaphore. So
hold_sb() still looked like the least painful solution.

								Honza

^ permalink raw reply	[flat|nested] 10+ messages in thread
* [PATCH 0/2] vfs: Fix crashes when reading /proc/mounts
@ 2018-10-18 13:17 Jan Kara
  2018-10-18 13:17 ` [PATCH 2/2] proc: Protect readers of /proc/mounts from remount Jan Kara
  0 siblings, 1 reply; 10+ messages in thread
From: Jan Kara @ 2018-10-18 13:17 UTC (permalink / raw)
  To: Al Viro; +Cc: Ted Tso, linux-fsdevel, linux-ext4, linux-xfs, Jan Kara

Hello,

this patch series aims at fixing possible races between functions formatting
output for /proc/mounts and friends and remount. Especially ->show_options
functions of filesystems are not counting with the fact that options can
change under them and thus races can result in bogus output or outright
crashes (like was the case with ext4 handling of quota mount option, or udf
could crash when printing charset name, or xfs when printing log device name
etc.).

Admittedly the patch 2/2 is somewhat ugly because namespace_sem ranks below
sb->s_umount semaphore but I think it is bearable. Al, what do you think?

								Honza

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

end of thread, other threads:[~2018-12-18 13:46 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-12-11 17:24 [PATCH 0/2 RESEND] vfs: Fix crashes when reading /proc/mounts Jan Kara
2018-12-11 17:24 ` [PATCH 1/2] vfs: Provide function to grab superblock reference Jan Kara
2018-12-11 17:24 ` [PATCH 2/2] proc: Protect readers of /proc/mounts from remount Jan Kara
2018-12-11 18:36   ` Al Viro
2018-12-11 18:37     ` Al Viro
2018-12-11 18:58   ` Al Viro
2018-12-11 19:14     ` Al Viro
2018-12-12 12:56       ` Jan Kara
  -- strict thread matches above, loose matches on Subject: below --
2018-12-18 13:46 [PATCH 0/2 v2] vfs: Fix crashes when reading /proc/mounts Jan Kara
2018-12-18 13:46 ` [PATCH 2/2] proc: Protect readers of /proc/mounts from remount Jan Kara
2018-10-18 13:17 [PATCH 0/2] vfs: Fix crashes when reading /proc/mounts Jan Kara
2018-10-18 13:17 ` [PATCH 2/2] proc: Protect readers of /proc/mounts from remount Jan Kara

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