OpenAFS Master Repository branch, openafs-stable-1_8_x, updated. openafs-stable-1_8_16_1-18-gb52839f
Gerrit Code Review
gerrit@openafs.org
Thu, 8 Oct 2026 12:07:06 -0400
The following commit has been merged in the openafs-stable-1_8_x branch:
commit b52839f04d91d79b5716c2690ba7f76de990453e
Author: Andrew Deason <adeason@sinenomine.net>
Date: Tue May 19 15:45:49 2026 -0500
LINUX: Grab unixuser refs in osi_proc.c
In order to implement the 'unixusers' /proc pseudo-file, osi_proc.c
contains code to iterate over unixusers. The uu_*() functions are
seq_operations callbacks that are called approximately like this
pseudocode:
p = uu_start();
while (p != NULL) {
uu_show(p);
p = uu_next(p);
}
uu_stop(p);
Since commit 89b22dfe86 (libafs: Implement unixuser RW locks) in OpenAFS
1.7.1, uu_show() drops the ref for the current unixuser 'tu' before
acquiring afs_xuser. If 'tu' is freed while we're waiting for afs_xuser,
we'll dereference freed memory when uu_next() examines tu->next to get
the next unixuser.
Change osi_proc.c to grab and release unixuser refs while traversing
unixusers, like we did for other files in change I849132fc08 (afs:
Introduce and use afs_UserScan()).
In uu_start(), this simply involves using afs_UserScan(), but in other
callers, grab the refs manually, since we iterate over unixusers one at
a time instead of directly via a for() loop.
In uu_next(), also acquire AFS_GLOCK(), since we are now manipulating
tu->refCount for various users.
FIXES 135623
Reviewed-on: https://gerrit.openafs.org/16833
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Marcio Brito Barbosa <mbarbosa@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit 6db6df90e3827f751a3507f73a22b838a741511f)
Change-Id: I97397b25337231d2ec7afa5d2c17d4b441c5d396
Reviewed-on: https://gerrit.openafs.org/17008
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Marcio Brito Barbosa <mbarbosa@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
src/afs/LINUX/osi_proc.c | 38 ++++++++++++++++++++++++++++++++------
1 file changed, 32 insertions(+), 6 deletions(-)
--
OpenAFS Master Repository