On 15/11/2016 10:46, Stéphane Glondu wrote:
The attached patch avoids using by by just reading the symlink length, and adjusting the size in case the symlink length increased in between through really bad concurrency luck.Sorry, I should have really tested it, here is a fixed patch.+ if (lstat(String_val(path), &sb) != -1) { + buflen = sb.st_size + 1; + }Shouldn't the type be verified before setting buflen this way? What if someone calls netsys_readlinkat on a very big (non-symlink) file?
Besides, path may be relative to dirfd, so the patch seems wrong. fstatat should be used instead.
Cheers, -- Stéphane