Bug 27024 - Wrong access (read_only, 3, 4) attribute for readlinkat
Summary: Wrong access (read_only, 3, 4) attribute for readlinkat
Status: RESOLVED FIXED
Alias: None
Product: glibc
Classification: Unclassified
Component: stdio (show other bugs)
Version: unspecified
: P2 normal
Target Milestone: 2.33
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-12-06 14:45 UTC by Martin Liska
Modified: 2021-02-07 15:24 UTC (History)
4 users (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:
fweimer: security-


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Liska 2020-12-06 14:45:41 UTC
Since g:06febd8c670, there's a bad access attribute:

posix/unistd.h:

/* Like readlink but a relative PATH is interpreted relative to FD.  */
extern ssize_t readlinkat (int __fd, const char *__restrict __path,
			   char *__restrict __buf, size_t __len)
     __THROW __nonnull ((2, 3)) __wur __attr_access ((__read_only__, 3, 4));
#endif

it guess it should be write_only.

@Martin: Can you please take a look?
Comment 1 Richard Li 2021-01-06 03:53:09 UTC
Encountered this bug too.

Got a warning, something like "buffer may be used uninitialized".  Changing it to write_only fixes it.
Comment 2 Martin Liska 2021-01-06 05:21:25 UTC
@Martin: May I please ping this issue..
Comment 3 Martin Sebor 2021-01-06 15:53:19 UTC
Ah, yes, thanks!  I remembered you'd CC'd me on a bug but couldn't find it.  I now see why: I searched for msebor@gmail.com and it's under @redhat.com.
Comment 4 Martin Liska 2021-01-06 16:07:17 UTC
Heh. I guess the fix is quite easy..
Comment 6 Martin Sebor 2021-01-10 20:52:35 UTC
Fixed in g:2cd361b511.