sunrpc: svcauth_gss_register_pseudoflavor must reject duplicate registrations.
authorNeilBrown <neilb@suse.de>
Fri, 22 May 2020 02:01:33 +0000 (12:01 +1000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 22 Jun 2020 07:31:24 +0000 (09:31 +0200)
commit4a68a2e25e20a896444f172801be95d1d182992b
treefe665ed79a7562ca747615116076742df636b9fe
parente4f7a7260737a040d43c64c0eb1421daeb83f583
sunrpc: svcauth_gss_register_pseudoflavor must reject duplicate registrations.

commit d47a5dc2888fd1b94adf1553068b8dad76cec96c upstream.

There is no valid case for supporting duplicate pseudoflavor
registrations.
Currently the silent acceptance of such registrations is hiding a bug.
The rpcsec_gss_krb5 module registers 2 flavours but does not unregister
them, so if you load, unload, reload the module, it will happily
continue to use the old registration which now has pointers to the
memory were the module was originally loaded.  This could lead to
unexpected results.

So disallow duplicate registrations.

Link: https://bugzilla.kernel.org/show_bug.cgi?id=206651
Cc: stable@vger.kernel.org (v2.6.12+)
Signed-off-by: NeilBrown <neilb@suse.de>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/sunrpc/auth_gss/svcauth_gss.c