Re: [PATCH 2/3, V2] kernel: Move groups_sort to the caller of set_groups.

2017-12-19 Thread NeilBrown
On Tue, Dec 19 2017, J. Bruce Fields wrote: > On Tue, Dec 05, 2017 at 07:11:00AM +1100, NeilBrown wrote: >> On Mon, Dec 04 2017, Thiago Rafael Becker wrote: >> >> > On Mon, 4 Dec 2017, NeilBrown wrote: >> > >> >> I think you need to add groups_sort() in a few more places. >> >> Almost anywhere th

Re: [PATCH 2/3, V2] kernel: Move groups_sort to the caller of set_groups.

2017-12-19 Thread J. Bruce Fields
On Tue, Dec 05, 2017 at 07:11:00AM +1100, NeilBrown wrote: > On Mon, Dec 04 2017, Thiago Rafael Becker wrote: > > > On Mon, 4 Dec 2017, NeilBrown wrote: > > > >> I think you need to add groups_sort() in a few more places. > >> Almost anywhere that calls groups_alloc() should be considered. > >> ne

Re: [PATCH 2/3, V2] kernel: Move groups_sort to the caller of set_groups.

2017-12-05 Thread Matthew Wilcox
On Tue, Dec 05, 2017 at 09:03:02PM -0200, Thiago Rafael Becker wrote: > On Tue, 5 Dec 2017, Matthew Wilcox wrote: > > It must be relatively common to sort an already-sorted array. I wonder > > if something like this patch would be worthwhile? > > The bug happens when two threads enter sort_groups

Re: [PATCH 2/3, V2] kernel: Move groups_sort to the caller of set_groups.

2017-12-05 Thread Thiago Rafael Becker
On Tue, 5 Dec 2017, Matthew Wilcox wrote: On Tue, Dec 05, 2017 at 07:11:00AM +1100, NeilBrown wrote: As we don't seem to be pursuing this possibility is probably isn't very important, but I'd like to point out that the original fix isn't a true fix. It just sorts a shared group_info early. T

Re: [PATCH 2/3, V2] kernel: Move groups_sort to the caller of set_groups.

2017-12-05 Thread NeilBrown
On Tue, Dec 05 2017, Matthew Wilcox wrote: > On Tue, Dec 05, 2017 at 07:11:00AM +1100, NeilBrown wrote: >> As we don't seem to be pursuing this possibility is probably isn't very >> important, but I'd like to point out that the original fix isn't a true >> fix. >> It just sorts a shared group_info

Re: [PATCH 2/3, V2] kernel: Move groups_sort to the caller of set_groups.

2017-12-05 Thread Matthew Wilcox
On Tue, Dec 05, 2017 at 07:11:00AM +1100, NeilBrown wrote: > As we don't seem to be pursuing this possibility is probably isn't very > important, but I'd like to point out that the original fix isn't a true > fix. > It just sorts a shared group_info early. This does not stop corruption. > Every ti

Re: [PATCH 2/3, V2] kernel: Move groups_sort to the caller of set_groups.

2017-12-04 Thread NeilBrown
On Mon, Dec 04 2017, Thiago Rafael Becker wrote: > On Mon, 4 Dec 2017, NeilBrown wrote: > >> I think you need to add groups_sort() in a few more places. >> Almost anywhere that calls groups_alloc() should be considered. >> net/sunrpc/svcauth_unix.c, net/sunrpc/auth_gss/svcauth_gss.c, >> fs/nfsd/au

Re: [PATCH 2/3, V2] kernel: Move groups_sort to the caller of set_groups.

2017-12-04 Thread Thiago Rafael Becker
On Mon, 4 Dec 2017, J. Bruce Fields wrote: On Mon, Dec 04, 2017 at 01:39:37PM -0200, Thiago Rafael Becker wrote: On Mon, 4 Dec 2017, NeilBrown wrote: I think you need to add groups_sort() in a few more places. Almost anywhere that calls groups_alloc() should be considered. net/sunrpc/svca

Re: [PATCH 2/3, V2] kernel: Move groups_sort to the caller of set_groups.

2017-12-04 Thread J. Bruce Fields
On Mon, Dec 04, 2017 at 01:39:37PM -0200, Thiago Rafael Becker wrote: > > > On Mon, 4 Dec 2017, NeilBrown wrote: > > >I think you need to add groups_sort() in a few more places. > >Almost anywhere that calls groups_alloc() should be considered. > >net/sunrpc/svcauth_unix.c, net/sunrpc/auth_gss/s

Re: [PATCH 2/3, V2] kernel: Move groups_sort to the caller of set_groups.

2017-12-04 Thread Thiago Rafael Becker
On Mon, 4 Dec 2017, NeilBrown wrote: I think you need to add groups_sort() in a few more places. Almost anywhere that calls groups_alloc() should be considered. net/sunrpc/svcauth_unix.c, net/sunrpc/auth_gss/svcauth_gss.c, fs/nfsd/auth.c definitely need it. So are any other functions that mo

Re: [PATCH 2/3, V2] kernel: Move groups_sort to the caller of set_groups.

2017-12-03 Thread NeilBrown
On Thu, Nov 30 2017, Thiago Rafael Becker wrote: > The responsibility for calling groups_sort is now on the caller > of set_groups. > > Signed-off-by: Thiago Rafael Becker > --- > kernel/groups.c | 1 + > kernel/uid16.c| 1 + > net/sunrpc/svcauth_unix.c | 7 +++ > 3 fil

Re: [PATCH 2/3, V2] kernel: Move groups_sort to the caller of set_groups.

2017-12-03 Thread kbuild test robot
Hi Thiago, Thank you for the patch! Yet something to improve: [auto build test ERROR on linus/master] [also build test ERROR on v4.15-rc1 next-20171201] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] url: https://github.com/0day-ci/linux/c

[PATCH 2/3, V2] kernel: Move groups_sort to the caller of set_groups.

2017-11-30 Thread Thiago Rafael Becker
The responsibility for calling groups_sort is now on the caller of set_groups. Signed-off-by: Thiago Rafael Becker --- kernel/groups.c | 1 + kernel/uid16.c| 1 + net/sunrpc/svcauth_unix.c | 7 +++ 3 files changed, 9 insertions(+) diff --git a/kernel/groups.c b/kernel/