Commit Graph

17309 Commits

Author SHA1 Message Date
Sergey Bronnikov 2a1a411eaf [ci] Add fuzzing workflow
Patch adds a fuzzing workflow to GH Actions. Workflow will guarantee
that building fuzzing tests is healthy.
2023-06-08 09:45:25 +02:00
Armin Novak 979610b1fd [winpr,stream] assert valid pointer 2023-06-08 08:13:16 +02:00
Armin Novak 98b7c88df7 [proxy,modules] fix bitmap filter drdynvc write 2023-06-08 08:13:16 +02:00
Armin Novak b05eacb99e [build] fixed compilation warnings 2023-06-08 08:13:16 +02:00
Armin Novak 8f6b42b817 [build] update clang build script 2023-06-08 08:13:16 +02:00
Armin Novak 381183f421 [core,gateway] align RPC_FAULT_CODES
some architectures require alignment (apple looking at you)
2023-06-08 08:11:05 +02:00
Armin Novak 47e9503385 [codec,dsp] fix unused variable warning 2023-06-08 08:11:05 +02:00
Armin Novak 970f0c54e8 [stream] use const correct Stream_Pointer access 2023-06-08 08:09:33 +02:00
Armin Novak 2de7399e52 [winpr,stream] change Stream_Pointer return to void*
Eliminates possible type warnings as we return a void*
If a specific type is desired, use the Stream_PointerAs macro.
2023-06-08 08:09:33 +02:00
Armin Novak d0c5b1ae42 [codec,dsp] fix ffmpeg deprecations 2023-06-08 08:09:33 +02:00
Armin Novak 81e95e51ca [winpr,ncrypt] log problems during cert enumeration 2023-06-07 23:05:54 +02:00
Sergey Bronnikov 62697e58d9 [libfreerdp] Pass a zero-terminated string to freerdp_assistance_parse_file_buffer
```
READ of size 2 at 0x602000000091 thread T0
SCARINESS: 14 (2-byte-read-heap-buffer-overflow)
    #0 0x4c6fb9 in StrstrCheck(void*, char*, char const*, char const*) /src/llvm-project/compiler-rt/lib/asan/../sanitizer_common/sanitizer_common_interceptors.inc:580:5
    #1 0x4c6df1 in strstr /src/llvm-project/compiler-rt/lib/asan/../sanitizer_common/sanitizer_common_interceptors.inc:597:5
    #2 0x56c9ba in freerdp_assistance_parse_file_buffer /src/FreeRDP/libfreerdp/common/assistance.c:743:6
    #3 0x56b58e in parse_file_buffer /src/FreeRDP/libfreerdp/common/test/TestFuzzCommonAssistanceParseFileBuffer.c:11:11
    #4 0x56b58e in LLVMFuzzerTestOneInput /src/FreeRDP/libfreerdp/common/test/TestFuzzCommonAssistanceParseFileBuffer.c:20:2
    #5 0x43f5e3 in fuzzer::Fuzzer::ExecuteCallback(unsigned char const*, unsigned long) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:611:15
    #6 0x440994 in fuzzer::Fuzzer::ReadAndExecuteSeedCorpora(std::__Fuzzer::vector<fuzzer::SizedFile, std::__Fuzzer::allocator<fuzzer::SizedFile> >&) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:804:3
```
2023-06-07 14:25:57 +02:00
Sergey Bronnikov 3266dc984a [libfreerdp] Fix TestFuzzCommonAssistanceHexStringToBin
Test breaks contract in freerdp_assistance_hex_string_to_bin():
function expects zero-terminated string. Patch fixes that.
2023-06-07 14:25:57 +02:00
Sergey Bronnikov d8254c5ff3 [libfreerdp] Fix msan's use-of-uninitialized-value
Uninitialized bytes in __interceptor_strlen at offset 0 inside [0x701000000040, 1)
==220==WARNING: MemorySanitizer: use-of-uninitialized-value
    #0 0x535c13 in freerdp_assistance_hex_string_to_bin /src/FreeRDP/libfreerdp/common/assistance.c:711:11
    #1 0x533deb in LLVMFuzzerTestOneInput /src/FreeRDP/libfreerdp/common/test/TestFuzzCommonAssistanceHexStringToBin.c:5:15
    #2 0x43f5f3 in fuzzer::Fuzzer::ExecuteCallback(unsigned char const*, unsigned long) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:611:15
    #3 0x4409a4 in fuzzer::Fuzzer::ReadAndExecuteSeedCorpora(std::__Fuzzer::vector<fuzzer::SizedFile, std::__Fuzzer::allocator<fuzzer::SizedFile> >&) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:804:3
    #4 0x440e79 in fuzzer::Fuzzer::Loop(std::__Fuzzer::vector<fuzzer::SizedFile, std::__Fuzzer::allocator<fuzzer::SizedFile> >&) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:857:3
    #5 0x4304df in fuzzer::FuzzerDriver(int*, char***, int (*)(unsigned char const*, unsigned long)) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerDriver.cpp:912:6
    #6 0x459b32 in main /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerMain.cpp:20:10
    #7 0x7effc08bb082 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x24082) (BuildId: 1878e6b475720c7c51969e69ab2d276fae6d1dee)
    #8 0x420f1d in _start (/tmp/not-out/tmpu5o6go0a/TestFuzzCommonAssistanceHexStringToBin+0x420f1d)
2023-06-07 14:25:57 +02:00
Armin Novak a4c6b36a19 [build] fix memory sanitizer stack frame warnings 2023-06-07 09:14:45 +02:00
akallabeth 734ae69756 [winpr] fix some msan warnings
initialize local stack variables
2023-06-07 09:14:45 +02:00
Armin Novak 8ec0b1262e [client,common] add /args-from:env
allow reading command line from a environment variable
2023-06-06 10:39:48 +02:00
Armin Novak b40e20ce85 [gateway,rdg] fix a leak and NULL access in RDG 2023-06-05 15:47:05 +02:00
Armin Novak 1b7b597f02 [cmake] add option to enable/disable building X11 2023-06-05 14:15:03 +02:00
Armin Novak a0fd9cf957 [client,sdl] encapsulate c++ context
to properly initialize c++ us a heap allocated wrapper class
2023-06-05 14:15:03 +02:00
Sergey Bronnikov b1ae467ae2 [libfreerdp/common] Add fuzzing tests
Part of #5063
Closes #6681
2023-06-05 11:28:48 +02:00
Sergey Bronnikov 1c0c804981 [cmake] Introduce a target for building fuzzing tests
Part of #5063
2023-06-05 11:28:48 +02:00
Sergey Bronnikov 2b7f09ea3c [clang-format] remove duplicate option
```
/home/sergeyb/sources/MRG/oss-fuzz/FreeRDP/.clang-format:110:1: error: duplicated mapping key 'ObjCSpaceAfterProperty'
ObjCSpaceAfterProperty: false
^~~~~~~~~~~~~~~~~~~~~~
Error reading /home/sergeyb/sources/MRG/oss-fuzz/FreeRDP/.clang-format: Invalid argument
```
2023-06-05 11:28:48 +02:00
Armin Novak 9a7aa8dbac [core,rdp] log rdp_read_share_control_header
in rdp_read_share_control_header read and log all available header data
before checking remaining length.
2023-06-05 11:07:30 +02:00
akallabeth 00b393c094 [channels,rdpdr] enforce client state checks
Keep track of client channel state and abort on invalid messages for a
certain state
2023-06-05 09:56:43 +02:00
Armin Novak d0bf018e95 [test] fix uninitialized variables in test case 2023-05-31 17:44:41 +02:00
Armin Novak da7c3b688f [client,sdl] use unique_ptr for SDL_Surface et al 2023-05-31 11:29:21 +02:00
Armin Novak 68995ddffb [client,sdl] wrap WinPR event in class 2023-05-31 11:29:21 +02:00
Armin Novak ccbcc4cb65 [client,sdl] wrap critical section in class 2023-05-31 11:29:21 +02:00
Armin Novak 63ed6dc771 [client,sdl] use std::thread 2023-05-31 11:29:21 +02:00
Armin Novak 16cbe8882d [client,sdl] unique_ptr for input 2023-05-31 11:29:21 +02:00
Armin Novak 1a74d832de [client,sdl] unique_ptr for display channel 2023-05-31 11:29:21 +02:00
Armin Novak 324e8c7813 [client,sdl] use SDL_WaitEvent 2023-05-31 11:29:21 +02:00
Armin Novak 3e44efc841 [cmake] use FindX11 from CMake 3.13 2023-05-31 11:05:56 +02:00
akallabeth 28b0821ec6 [cmake] build xfreerdp standalone project 2023-05-31 11:05:56 +02:00
Armin Novak ba98aa0a8c [winpr] add atexit calls for WLog and SSL providers
C11 atexit cleanup handler are used to call cleanup routines for WLog
and SSL on program termination. This removes false positives when using
ASAN runtime memory debugger
2023-05-30 15:42:39 +02:00
Armin Novak 481ba1581c [client,sdl] fixed warning in webview 2023-05-30 15:42:39 +02:00
Armin Novak 4545783dff [client,x11] always only send available clipboard 2023-05-30 13:42:28 +02:00
Armin Novak e3f660e11f [channels,cliprdr] fix sending of empty format list 2023-05-30 13:42:28 +02:00
akallabeth d71c58a04b [core,licensing] allow all SEC_AUTODETECT_REQ messages
follow up to fdcc36dd8d
autodetect messages also seem to be sent over global channel id
instead of message channel id
2023-05-26 11:52:54 +02:00
akallabeth 87b8c25392 [cmake] only check client deps for standalone builds 2023-05-26 11:38:32 +02:00
akallabeth f941a1ec8e [cmake] unify RPATH settings and client deps detection 2023-05-26 11:38:32 +02:00
akallabeth dc5ec9c196 [cmake] sfreerdp-client standalone build 2023-05-26 11:38:32 +02:00
Sergey Bronnikov 3cbef821c0 [cmake] Enable static building
OSS Fuzz strongly recommends static linking for tests [1]. Patch enables
static linking for a fuzzing test added in commit
2ad1469612 ("Add fuzzer for
certificate_data_set_pem()").

1. https://google.github.io/oss-fuzz/further-reading/fuzzer-environment/#runtime-dependencies
2023-05-25 19:39:24 +02:00
Sergey Bronnikov 9b355c3b0c [packaging] fix a typo 2023-05-25 19:39:24 +02:00
akallabeth 98fb56b767 [channels,cliprdr] implement client clipboard direction filter
* Filter remote -> local or local -> remote clipboard depending on
  setting.
* Filter remote -> local or local -> remote file clipboard
  depending on setting.
2023-05-25 16:26:39 +02:00
akallabeth 7288680bdd [client,common] add clipboard feature mask
allow selectivly enabling or disabling clipboard direction and file
support
2023-05-25 16:26:39 +02:00
akallabeth 393577750e [settings] add FreeRDP_ClipboardFeatureMask 2023-05-25 16:26:39 +02:00
akallabeth b8f7b59fff [warnings] fix casts and return 2023-05-24 08:24:32 +02:00
akallabeth 9f2d22c975 [client,sdl] refactor webview 2023-05-24 08:24:32 +02:00