SOLARIS: fix for AFS_PAG_ONEGROUP_ENV for Solaris 11
commitb146c2d54ff3bd99f2c4674eb88d5af417a194d7
authorMichael Meffie <mmeffie@sinenomine.net>
Thu, 12 Jan 2017 17:27:36 +0000 (12 12:27 -0500)
committerBenjamin Kaduk <kaduk@mit.edu>
Thu, 12 Jan 2017 18:25:20 +0000 (12 13:25 -0500)
tree029a87a55e61aa715de326a767c8dc3dfefdaf44
parenta92a3a0675d941536103b60d708a6b3305b9b8fa
SOLARIS: fix for AFS_PAG_ONEGROUP_ENV for Solaris 11

Fix a bug introduced in commit aab1e71628e6a4ce68c5e59e2f815867438280d1
in which a pointer was incorrectly checked for a NULL value.

Fixes a crash when a PAG is set on Solaris.

    # mdb unix.1 vmcore.1
    > ::status
    ...
    panic message:
    BAD TRAP: type=e (#pf Page fault) rp=fffffffc802ba8f0 addr=0 occurred in
      module "afs" due to a NULL pointer dereference
    > ::stack
    pag_to_gidset+0x145()
    setpag+0xcc()
    AddPag+0x3a()
    afs_setpag+0x58()
    Afs_syscall+0x115()

The crash occurs since gidslot is NULL during the assignment:

    *gidslot = pagvalue;

Change-Id: Ic4d50c6b046d10faa49cd4363692e0302707583d
Reviewed-on: https://gerrit.openafs.org/12508
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
src/afs/SOLARIS/osi_groups.c