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

Null pointer dereference #186

Closed
alexeys85 opened this issue Oct 2, 2022 · 6 comments
Closed

Null pointer dereference #186

alexeys85 opened this issue Oct 2, 2022 · 6 comments

Comments

@alexeys85
Copy link
Contributor

I've encountered a problem when using reload config command from smcroutectl. Stacktrace shows that this if statement:

smcroute/src/pidfile.c

Lines 77 to 78 in cf5cc48

if (!access(pidfile_path, R_OK) && pid == pidfile_pid) {
utimensat(0, pidfile_path, NULL, 0);

becomes true and NULL passes to utimensat function with following dereference:
TIMESPEC_TO_TIMEVAL(&tv[0], &ts[0]);

@troglobit
Copy link
Owner

Interesting, you're triggering the replacement function. What libc are you building against?

@troglobit
Copy link
Owner

(Obviously I'll get on it to fix the utimensat() replacement, I'm just curious.)

@alexeys85
Copy link
Contributor Author

Well, I'm using Ubuntu 22.04 and just wrongly included utimensat.c to build :)

@troglobit
Copy link
Owner

Aha, well that should be automatically detected by the configure script. If you're doing some sort of hybrid build, you don't need it on GLIBC. Also, please remember the GNU license restrictions and implications if you're incorporating parts/whole of SMCRoute in another application.

@alexeys85
Copy link
Contributor Author

We don't incorporate any parts of SMCRoute in our apps. I just wanted to add cmake support :)

@troglobit
Copy link
Owner

OK, got it! Then FYI, all the stuff in lib/ are replacement functions in case the system doesn't have it.

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

2 participants