linux(4): Properly allocate buffer for kern_getdirentries in readdir

Looks like prior to ino64 project the size of the struct linux_dirent
was greater (or equal) to the size of the native struct dirent so the
native dirent fit into the buffer. After ino64 project the size of the
native struct dirent has increased.

Spotted by gcc12.
MFC after:		2 weeks
This commit is contained in:
Dmitry Chagin 2023-07-19 00:44:15 +03:00
parent 9efad6f9e1
commit fc1c787aa0

View file

@ -560,7 +560,7 @@ linux_readdir(struct thread *td, struct linux_readdir_args *args)
struct l_dirent *linux_dirent;
int buflen, error;
buflen = LINUX_RECLEN(LINUX_NAME_MAX);
buflen = sizeof(*bdp);
buf = malloc(buflen, M_TEMP, M_WAITOK);
error = kern_getdirentries(td, args->fd, buf, buflen,