bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] fix NFSv4 acl detection on F39


From: Paul Eggert
Subject: Re: [PATCH] fix NFSv4 acl detection on F39
Date: Mon, 15 May 2023 14:32:00 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0

On 2023-05-15 12:43, Ondrej Valousek wrote:
You feed listxattr() with a buffer sized like trivial_NFS4_attr_buf - that just 
does not seem to be correct right? That trivial_NFS4_attr_buf serves smth 
completely different.

All that listxattr needs is a nonzero-sized buffer. It's OK for a union to hold unrelated objects so long as it doesn't hold them at the same time, which is the case here.

The code could allocate two distinct stack buffers of different types, but that'd use more stack space and put more pressure on caches. It could even allocate the distinct buffers in non-overlapping compound statements, but GCC isn't good about optimizating that and anyway the code would get trickier in a different way.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]