linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3, V2] Move groups_sort outisde of set_groups
@ 2017-11-30 13:04 Thiago Rafael Becker
  2017-11-30 13:04 ` [PATCH 1/3, V2] kernel: make groups_sort globally visible Thiago Rafael Becker
                   ` (3 more replies)
  0 siblings, 4 replies; 39+ messages in thread
From: Thiago Rafael Becker @ 2017-11-30 13:04 UTC (permalink / raw)
  To: bfields; +Cc: linux-nfs, linux-fsdevel, linux-kernel, Thiago Rafael Becker

In cases where group_info is cached (e.g. sunrpc), multiplpe
threads may call set_groups with a freshly created group_info
cache (e.g. nfsd), and attempt to sort them simultaneously,
which configures a race condition that can overwrite some
groups in the cache and lead to errors. In the case of nfsd,
the client was receiving EPERM if the group used to provide
authorization was overwritten by this race condition.

In an email exchange with bfields, we agreed that it seems
unintuitive that the groups are sorted on set_groups, and that
it would be better to move the responsibility of sorting to
the caller of set_groups.

These patches:
 - Export groups_sort in include/linux/cred.h
 - Add a call to groups_sort after the groups are inserted in
   group_info
 - Remove the call to sort_groups from set_groups

Thiago Rafael Becker (3):
  kernel: make groups_sort globally visible
  kernel: Move groups_sort to the caller of set_groups.
  kernel: set_groups doesn't call groups_sort anymore.

 include/linux/cred.h      | 1 +
 kernel/groups.c           | 6 ++++--
 kernel/uid16.c            | 1 +
 net/sunrpc/svcauth_unix.c | 7 +++++++
 4 files changed, 13 insertions(+), 2 deletions(-)

-- 
2.9.5


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

end of thread, other threads:[~2018-01-08 16:40 UTC | newest]

Thread overview: 39+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-30 13:04 [PATCH 0/3, V2] Move groups_sort outisde of set_groups Thiago Rafael Becker
2017-11-30 13:04 ` [PATCH 1/3, V2] kernel: make groups_sort globally visible Thiago Rafael Becker
2017-11-30 13:04 ` [PATCH 2/3, V2] kernel: Move groups_sort to the caller of set_groups Thiago Rafael Becker
2017-12-03 12:56   ` kbuild test robot
2017-12-04  1:42   ` NeilBrown
2017-12-04 15:39     ` Thiago Rafael Becker
2017-12-04 15:47       ` J. Bruce Fields
2017-12-04 19:00         ` Thiago Rafael Becker
2017-12-04 20:11       ` NeilBrown
2017-12-05 21:28         ` Matthew Wilcox
2017-12-05 22:05           ` NeilBrown
2017-12-05 23:03           ` Thiago Rafael Becker
2017-12-05 23:23             ` Matthew Wilcox
2017-12-19 16:30         ` J. Bruce Fields
2017-12-19 20:14           ` NeilBrown
2017-11-30 13:04 ` [PATCH 3/3, V2] kernel: set_groups doesn't call groups_sort anymore Thiago Rafael Becker
2017-12-05 14:05 ` [PATCH 0/3 v3] Move groups_sort outisde of set_groups Thiago Rafael Becker
2017-12-05 14:05   ` [PATCH 1/3 v3] kernel: make groups_sort globally visible Thiago Rafael Becker
2017-12-05 14:05   ` [PATCH 2/3 v3] kernel: Move groups_sort to the caller of set_groups Thiago Rafael Becker
2017-12-05 18:55     ` [PATCH 2/3] " Thiago Rafael Becker
2017-12-05 22:08       ` NeilBrown
2017-12-05 18:57     ` [PATCH 2/3 v3] " Thiago Rafael Becker
2017-12-05 14:05   ` [PATCH 3/3 v3] kernel: set_groups doesn't call groups_sort anymore Thiago Rafael Becker
2017-12-06 19:27   ` [PATCH 0/3 v3] Move groups_sort outisde of set_groups J. Bruce Fields
2017-12-11 13:28   ` [PATCH v4] kernel: make groups_sort calling a responsibility group_info allocators Thiago Rafael Becker
2017-12-11 14:27     ` Matthew Wilcox
2017-12-11 15:14       ` [PATCH v5] " Thiago Rafael Becker
2017-12-11 15:24         ` Matthew Wilcox
2017-12-11 16:18         ` J. Bruce Fields
2017-12-11 21:43         ` NeilBrown
2018-01-02 14:54         ` David Howells
2018-01-02 21:01           ` [PATCH] Documentation: security/credentials.rst: explain need to sort group_list NeilBrown
2018-01-02 21:04             ` Matthew Wilcox
2018-01-06 18:09               ` Jonathan Corbet
2018-01-06 20:20                 ` Matthew Wilcox
2018-01-06 22:36                   ` Randy Dunlap
2018-01-08 16:36                   ` Jonathan Corbet
2018-01-07 23:39                 ` NeilBrown
2018-01-08 16:40                   ` Jonathan Corbet

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