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

SEGV in function ControlObjectClient_setOrigin() #442

Closed
LancyRiver opened this issue Feb 23, 2023 · 1 comment
Closed

SEGV in function ControlObjectClient_setOrigin() #442

LancyRiver opened this issue Feb 23, 2023 · 1 comment

Comments

@LancyRiver
Copy link

LancyRiver commented Feb 23, 2023

Hi, team
There is a SEGV in function ControlObjectClient_setOrigin in src/iec61850/client/client_control.c:328 when called from libiec61850/examples/iec61850_client_example_control/client_example_control.c:60.

Steps to reproduce:
I used gcc 9.4 and AddressSanitizer(export CFLAGS="-g -fsanitize=address" CXXFLAGS="-g -fsanitize=address" LDFLAGS="-fsanitize=address"before make examples) to build libiec61850.
First, I run the server_example_simple in directory libiec61850/examples/server_example_simple by command sudo ./server_example_simple so that the server is set up.
Then I tested client_example_control in directory libiec61850/examples/iec61850_client_example_control by command sudo ./client_example_control.
But I got SEGV in function ControlObjectClient_setOrigin in src/iec61850/client/client_control.c:328.

ASAN Output:

$ sudo ./client_example_control
AddressSanitizer:DEADLYSIGNAL
=================================================================
==12824==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000078 (pc 0x5638e2e178dc bp 0x7ffe9101eb20 sp 0x7ffe9101eb00 T0)
==12824==The signal is caused by a READ memory access.
==12824==Hint: address points to the zero page.
    #0 0x5638e2e178db in ControlObjectClient_setOrigin src/iec61850/client/client_control.c:328
    #1 0x5638e2e06190 in main /home/saltf1sh/target/libiec61850/examples/iec61850_client_example_control/client_example_control.c:60
    #2 0x7fc4901b70b2 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x240b2)
    #3 0x5638e2e05dbd in _start (/home/saltf1sh/target/libiec61850/examples/iec61850_client_example_control/client_example_control+0x26dbd)

AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: SEGV src/iec61850/client/client_control.c:328 in ControlObjectClient_setOrigin
==12824==ABORTING
@LancyRiver
Copy link
Author

@mzillgith The fix looks fine to me. Since the bug was fixed, this issue should be closed.

arnout pushed a commit to buildroot/buildroot that referenced this issue Sep 8, 2023
Segmentation fault in example code can be exploited.
BUILD_EXAMPLES is disabled for all cmake projects.

See mz-automation/libiec61850#442

Signed-off-by: Daniel Lang <dalang@gmx.at>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
arnout pushed a commit to buildroot/buildroot that referenced this issue Sep 14, 2023
Segmentation fault in example code can be exploited.
BUILD_EXAMPLES is disabled for all cmake projects.

See mz-automation/libiec61850#442

Signed-off-by: Daniel Lang <dalang@gmx.at>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
(cherry picked from commit b25f1cb)
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
arnout pushed a commit to buildroot/buildroot that referenced this issue Sep 14, 2023
Segmentation fault in example code can be exploited.
BUILD_EXAMPLES is disabled for all cmake projects.

See mz-automation/libiec61850#442

Signed-off-by: Daniel Lang <dalang@gmx.at>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
(cherry picked from commit b25f1cb)
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
arnout pushed a commit to buildroot/buildroot that referenced this issue Sep 14, 2023
Segmentation fault in example code can be exploited.
BUILD_EXAMPLES is disabled for all cmake projects.

See mz-automation/libiec61850#442

Signed-off-by: Daniel Lang <dalang@gmx.at>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
(cherry picked from commit b25f1cb)
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
citral23 pushed a commit to citral23/buildroot that referenced this issue Sep 18, 2023
Segmentation fault in example code can be exploited.
BUILD_EXAMPLES is disabled for all cmake projects.

See mz-automation/libiec61850#442

Signed-off-by: Daniel Lang <dalang@gmx.at>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
(cherry picked from commit b25f1cb)
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant