Re: [sdl-qemu] [PATCH] tests/qtest: fix heap-use-after-free

2024-11-11 Thread Prasad Pandit
Hi, On Mon, 11 Nov 2024 at 22:51, Alexey Khoroshilov wrote: > On 11.11.2024 16:35, Дмитрий Фролов wrote: > Not allowed to read the exact memory area, because it is marked as freed. > > As far as I understand, heap-use-after-free means a situation when code > allocates memory then frees it and th

Re: [sdl-qemu] [PATCH] tests/qtest: fix heap-use-after-free

2024-11-11 Thread Alexey Khoroshilov
On 11.11.2024 16:35, Дмитрий Фролов wrote: > > > On 11.11.2024 15:51, Prasad Pandit wrote: >> On Mon, 11 Nov 2024 at 17:41, Дмитрий Фролов wrote: >>> Above loop dereferences the pointer env, which is pointing to >>> the memory area, which is not allowed to read. >> * Not allowed to read environmen

Re: [PATCH] tests/qtest: fix heap-use-after-free

2024-11-11 Thread Дмитрий Фролов
On 11.11.2024 15:51, Prasad Pandit wrote: On Mon, 11 Nov 2024 at 17:41, Дмитрий Фролов wrote: Above loop dereferences the pointer env, which is pointing to the memory area, which is not allowed to read. * Not allowed to read environment variables? Is it because Debian/clang does not support

Re: [PATCH] tests/qtest: fix heap-use-after-free

2024-11-11 Thread Prasad Pandit
On Mon, 11 Nov 2024 at 17:41, Дмитрий Фролов wrote: > Above loop dereferences the pointer env, which is pointing to > the memory area, which is not allowed to read. * Not allowed to read environment variables? Is it because Debian/clang does not support the '**envp' parameter? Is '**envp' set to

Re: [PATCH] tests/qtest: fix heap-use-after-free

2024-11-11 Thread Дмитрий Фролов
On 11.11.2024 14:47, Prasad Pandit wrote: On Mon, 11 Nov 2024 at 14:37, Dmitry Frolov wrote: "int main(int argc, char **argv, char** envp)" is non-standart Microsoft`s extention of the C language and it`s not portable. In my particular case (Debian 13, clang-16) this raises wild-pointer dere

Re: [PATCH] tests/qtest: fix heap-use-after-free

2024-11-11 Thread Prasad Pandit
On Mon, 11 Nov 2024 at 14:37, Dmitry Frolov wrote: > "int main(int argc, char **argv, char** envp)" is non-standart > Microsoft`s extention of the C language and it`s not portable. > In my particular case (Debian 13, clang-16) this raises wild-pointer > dereference with ASAN message "heap-use-afte

[PATCH] tests/qtest: fix heap-use-after-free

2024-11-11 Thread Dmitry Frolov
"int main(int argc, char **argv, char** envp)" is non-standart Microsoft`s extention of the C language and it`s not portable. In my particular case (Debian 13, clang-16) this raises wild-pointer dereference with ASAN message "heap-use-after-free". Signed-off-by: Dmitry Frolov --- tests/qtest/qos