[vlc-devel] [PATCH v3 04/10] core: use refcounter helper for pictures

Rémi Denis-Courmont remi at remlab.net
Fri Jul 6 18:40:51 CEST 2018

Le keskiviikkona 4. heinäkuuta 2018, 12.17.58 EEST Romain Vimont a écrit :
> On Wed, Jul 04, 2018 at 12:02:45PM +0300, Rémi Denis-Courmont wrote:
> > I never said that uint was enough for anything
> Is uint not enough for normal usage (some objects are intended to be
> refcounted many many times)

By that argument, you could use unsigned int instead of size_t and yet you 
don't. I don't see how you can ensure less than 1<<32 references on 64-bits 
system in the general case.

> or not enough as a security reason against malicious usage?

Again, the whole point of Elena's refcount_t in kernel is that 32-bits 
overflow causes security issues, notably use after free.

I don't know why the kernel decided to use more complex code to prevent 
overflow, rather than simply switch to ulong. Probably because of 32-bits 
platforms and/or to save comparatively expensive kernel memory.


More information about the vlc-devel mailing list