summaryrefslogtreecommitdiffstats
path: root/src/testdir/crash
AgeCommit message (Collapse)Author
2023-12-11patch 9.0.2158: [security]: use-after-free in check_argument_typev9.0.2158Christian Brabandt
Problem: [security]: use-after-free in check_argument_type Solution: Reset function type pointer when freeing the function type list function pointer fp->uf_func_type may point to the same memory, that was allocated for fp->uf_type_list. However, when cleaning up a function definition (e.g. because it was invalid), fp->uf_type_list will be freed, but fp->uf_func_type may still point to the same (now) invalid memory address. So when freeing the fp->uf_type_list, check if fp->func_type points to any of those types and if it does, reset the fp->uf_func_type pointer to the t_func_any (default) type pointer closes: #13652 Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-12-04patch 9.0.2149: [security]: use-after-free in exec_instructions()v9.0.2149Christian Brabandt
Problem: [security]: use-after-free in exec_instructions() Solution: get tv pointer again [security]: use-after-free in exec_instructions() exec_instructions may access freed memory, if the GA_GROWS_FAILS() re-allocates memory. When this happens, the typval tv may still point to now already freed memory. So let's get that pointer again and compare it with tv. If those two pointers differ, tv is now invalid and we have to refresh the tv pointer. closes: #13621 Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-12-01patch 9.0.2143: [security]: buffer-overflow in ex_substitutev9.0.2143Christian Brabandt
Problem: [security]: buffer-overflow in ex_substitute Solution: clear memory after allocating When allocating the new_start pointer in ex_substitute() the memory pointer points to some garbage that the following for loop in ex_cmds.c:4743 confuses and causes it to accessing the new_start pointer beyond it's size, leading to a buffer-overlow. So fix this by using alloc_clear() instead of alloc(), which will clear the memory by NUL and therefore cause the loop to terminate correctly. Reported by @henices, thanks! closes: #13596 Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-12-01patch 9.0.2142: [security]: stack-buffer-overflow in option callback functionsv9.0.2142Christian Brabandt
Problem: [security]: stack-buffer-overflow in option callback functions Solution: pass size of errbuf down the call stack, use snprintf() instead of sprintf() We pass the error buffer down to the option callback functions, but in some parts of the code, we simply use sprintf(buf) to write into the error buffer, which can overflow. So let's pass down the length of the error buffer and use sprintf(buf, size) instead. Reported by @henices, thanks! Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-12-01patch 9.0.2141: [security]: buffer-overflow in suggest_trie_walkv9.0.2141Christian Brabandt
Problem: [security]: buffer-overflow in suggest_trie_walk Solution: Check n before using it as index into byts array Basically, n as an index into the byts array, can point to beyond the byts array. So let's double check, that n is within the expected range after incrementing it from sp->ts_curi and bail out if it would be invalid. Reported by @henices, thanks! Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-12-01patch 9.0.2140: [security]: use-after-free in win-enterv9.0.2140Christian Brabandt
Problem: [security]: use-after-free in win-enter Solution: validate window pointer before calling win_enter() win_goto() may stop visual mode, if it is active. However, this may in turn trigger the ModeChanged autocommand, which could potentially free the wp pointer which was valid before now became stale and points to now freed memory. So before calling win_enter(), let's verify one more time, that the wp pointer still points to a valid window structure. Reported by @henices, thanks! Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-11-16patch 9.0.2106: [security]: Use-after-free in win_close()v9.0.2106Christian Brabandt
Problem: [security]: Use-after-free in win_close() Solution: Check window is valid, before accessing it If the current window structure is no longer valid (because a previous autocommand has already freed this window), fail and return before attempting to set win->w_closing variable. Add a test to trigger ASAN in CI Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-10-11patch 9.0.2010: [security] use-after-free from buf_contents_changed()v9.0.2010Christian Brabandt
Problem: [security] use-after-free from buf_contents_changed() Solution: block autocommands Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-10-09patch 9.0.2004: Missing test filev9.0.2004Christian Brabandt
Problem: Missing test file Solution: git-add the file to the repo closes: #13305 Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-10-05patch 9.0.1992: [security] segfault in exmodev9.0.1992Christian Brabandt
Problem: segfault in exmode when redrawing Solution: skip gui_scroll when exmode_active Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-09-05patch 9.0.1873: [security] heap-buffer-overflow in vim_regsub_bothv9.0.1873Christian Brabandt
Problem: heap-buffer-overflow in vim_regsub_both Solution: Disallow exchanging windows when textlock is active Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-09-03patch 9.0.1859: heap-use-after-free in bt_normal()v9.0.1859Christian Brabandt
Problem: heap-use-after-free in bt_normal() Solution: check that buffer is still valid Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-09-03patch 9.0.1858: [security] heap use after free in ins_compl_get_exp()v9.0.1858Christian Brabandt
Problem: heap use after free in ins_compl_get_exp() Solution: validate buffer before accessing it Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-09-03patch 9.0.1857: [security] heap-use-after-free in is_qf_win()v9.0.1857Christian Brabandt
Problem: heap-use-after-free in is_qf_win() Solution: Check buffer is valid before accessing it Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-09-02patch 9.0.1848: [security] buffer-overflow in vim_regsub_both()v9.0.1848Christian Brabandt
Problem: buffer-overflow in vim_regsub_both() Solution: Check remaining space Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-09-02patch 9.0.1840: [security] use-after-free in do_ecmdv9.0.1840Christian Brabandt
Problem: use-after-free in do_ecmd Solution: Verify oldwin pointer after reset_VIsual() Signed-off-by: Christian Brabandt <cb@256bit.org>