On 18 Nov 2020, at 21:15, Jessica Clarke <jrt...@freebsd.org> wrote:
> 
> On 18 Nov 2020, at 19:44, Stefan Eßer <s...@freebsd.org> wrote:
>> +            /*
>> +             * Check for some other thread already having 
>> +             * set localbase - this should use atomic ops.
>> +             * The amount of memory allocated above may leak,
>> +             * if a parallel update in another thread is not
>> +             * detected and the non-NULL pointer is overwritten.
>> +             */
> 
> Why was this committed with a known racy/leaky implementation?
> 
> What happens if I set the value with a sysctl and call this?

Notably, you go to all this trouble to have a localbase variable that
gets set, but you never actually use it properly as a cache since you
do the full lookup and only then realise that you already had a
(possibly stale) value cached.

Jess

_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to