Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Memory sanitizer tests fail on IMAP test 800 in socksd.c #12117

Closed
dfandrich opened this issue Oct 14, 2023 · 2 comments
Closed

Memory sanitizer tests fail on IMAP test 800 in socksd.c #12117

dfandrich opened this issue Oct 14, 2023 · 2 comments
Labels

Comments

@dfandrich
Copy link
Contributor

I did this

Since commit d755a5f (the cause is more likely commit fb4415d) the memory-sanitizer builds started permafailing while logging a use-of-uninitialized-value error on test 800:

==59654==WARNING: MemorySanitizer: use-of-uninitialized-value
    #0 0x55dcded6edfe in sockit /home/runner/work/curl/curl/tests/server/socksd.c:386:6
    #1 0x55dcded6e013 in incoming /home/runner/work/curl/curl/tests/server/socksd.c:747:20
    #2 0x55dcded69d2d in main /home/runner/work/curl/curl/tests/server/socksd.c:1120:20
    #3 0x7f7255c29d8f  (/lib/x86_64-linux-gnu/libc.so.6+0x29d8f) (BuildId: 229b7dc509053fe4df5e29e8629911f0c3bc66dd)
    #4 0x7f7255c29e3f in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x29e3f) (BuildId: 229b7dc509053fe4df5e29e8629911f0c3bc66dd)
    #5 0x55dcdecb13b4 in _start (/home/runner/work/curl/curl/tests/server/socksd+0x1e3b4) (BuildId: 75bb7da4a9d1b8bc20394ef67cff926cfab5d34b)

SUMMARY: MemorySanitizer: use-of-uninitialized-value /home/runner/work/curl/curl/tests/server/socksd.c:386:6 in sockit

I expected the following

The test server should run without error.

curl/libcurl version

curl 8.4.0-DEV (x86_64-pc-linux-gnu)

operating system

Linux fv-az877-675 6.2.0-1012-azure #12~22.04.1-Ubuntu SMP Thu Sep 7 14:07:14 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux

@jay
Copy link
Member

jay commented Oct 14, 2023

I just saw that. I'm on it. What happens is (I think) my socks overflow test causes a disconnect without data sent and that's the access violation uninitialized value in the server (because it assumes something was sent).

jay added a commit to jay/curl that referenced this issue Oct 14, 2023
- Add additional checking for missing and too-short SOCKS5 handshake
  messages.

Prior to this change the SOCKS5 test server did not check that all parts
of the handshake were received successfully. If those parts were missing
or too-short then the server would access uninitialized memory.

This issue was discovered in CI job 'memory-sanitizer' test results.
Test 2055 was failing due to the SOCKS5 test server not running. It was
not running because either it crashed or memory sanitizer aborted it
during Test 728. Test 728 connects to the SOCKS5 test server on a
redirect but does not send any data on purpose. The test server was not
prepared for that.

Reported-by: Dan Fandrich

Fixes curl#12117
Closes #xxxx
@jay
Copy link
Member

jay commented Oct 14, 2023

I've added some additional SOCKS5 handshake checking to socksd in #12118 but I think it is also an issue that the tests do not stop when memory sanitizer causes a server to abort.

@jay jay closed this as completed in 0dd0bb0 Oct 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging a pull request may close this issue.

2 participants