OpenAFS Master Repository branch, master, updated. openafs-devel-1_9_2-519-gbcc3569

Gerrit Code Review gerrit@openafs.org
Tue, 30 Jun 2026 15:18:38 -0400


The following commit has been merged in the master branch:
commit bcc356963798050cccc22c18928d726f7e17f8ca
Author: Marcio Barbosa <mbarbosa@sinenomine.net>
Date:   Wed Jun 24 13:20:47 2026 +0000

    volser: Fix VLDB entry handling in UV_ConvertRO()
    
    Currently, when updating the VLDB entry during a volume conversion,
    UV_ConvertRO() may add a new RW site and write past the end of the
    fixed-size arrays in 'struct nvldbentry' if the VLDB entry already
    contains NMAXNSERVERS sites. The comment block mentions how the server
    will reject the entry if 'entry->nServers' is too large (which is true),
    but we'll still write past the end of the arrays in that case, possibly
    corrupting stack memory. Also, if 'rwserver' is set, 'entry->nServers'
    will be reduced afterwards and so the server may accept the entry.
    
    To fix this problem, refactor the VLDB entry update logic to make site
    addition and removal handling more explicit. Add a bounds check before
    inserting a new RW site and return ENOSPC if no free slot is available.
    Also ensure that removed entries are always cleared.
    
    This commit also moves the VLDB entry modification logic to before the
    actual volume conversion. By doing this, we can fail early and avoid
    leaving leftovers behind.
    
    While here, format parts of this modified code according to the current
    formatting standards.
    
    Change-Id: I68342bedc7c6fa6c87dcbaed5c018583fd75bdeb
    Reviewed-on: https://gerrit.openafs.org/16841
    Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
    Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
    Tested-by: BuildBot <buildbot@rampaginggeek.com>
    Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
    Reviewed-by: Andrew Deason <adeason@sinenomine.net>

 src/volser/vsprocs.c | 110 ++++++++++++++++++++++++++++++++-------------------
 1 file changed, 69 insertions(+), 41 deletions(-)

-- 
OpenAFS Master Repository