-
-
Notifications
You must be signed in to change notification settings - Fork 360
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
passing null values to upsc results in kernel segmentation fault #2052
Labels
bug
impacts-release-2.7.4
Issues reported against NUT release 2.7.4 (maybe vanilla or with minor packaging tweaks)
impacts-release-2.8.0
Issues reported against NUT release 2.8.0 (maybe vanilla or with minor packaging tweaks)
portability
We want NUT to build and run everywhere possible
Milestone
Comments
Nice find, never hit that :)
That's with master?
Also, it is known as "segfault", not "kernel fault". Although your syslog
emitter could be kernel's default catcher for null pointer dereference
(what probably happens here).
…On Thu, Sep 14, 2023, 20:16 Rysz ***@***.***> wrote:
when bash scripting with upsc it could happen that null variables are
passed to upsc by mistake, reproducible with the terminal command upsc
$UPS@$HOST for example - which would result in: upsc @ when those
variables are in fact not set and/or null.
upsc @ currently results in a kernel segmentation fault, see:
***@***.***:~# upsc $UPS@$HOST
Segmentation fault
Sep 14 20:06:27 Tower kernel: upsc[28685]: segfault at 8 ip 000014a0bbce4236 sp 00007ffd21f42468 error 4 in libc-2.37.so[14a0bbc58000+169000] likely on CPU 1 (core 1, socket 0)
Sep 14 20:06:27 Tower kernel: Code: 00 00 66 90 66 0f ef c0 66 0f ef c9 66 0f ef d2 66 0f ef db 48 89 f8 48 89 f9 48 81 e1 ff 0f 00 00 48 81 f9 cf 0f 00 00 77 6a <f3> 0f 6f 20 66 0f 74 e0 66 0f d7 d4 85 d2 74 04 0f bc c2 c3 48 83
is there a way to recover from such an (easy to happen) mistake better
than with a kernel fault - perhaps such a malformation in the arguments
could be caught before it would throw the kernel in distress?
—
Reply to this email directly, view it on GitHub
<#2052>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAMPTFART3BY44U2ZZL3MITX2NCWFANCNFSM6AAAAAA4YRNSJU>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
yes, compiled from today's state of master branch |
Thanks! PR #2053 should solve this:
|
jimklimov
added a commit
to jimklimov/nut
that referenced
this issue
Sep 14, 2023
…ion to return NULL if input was NULL (and log it) [networkupstools#2052] Signed-off-by: Jim Klimov <[email protected]>
jimklimov
added a commit
to jimklimov/nut
that referenced
this issue
Sep 14, 2023
… inputs [networkupstools#2052] Signed-off-by: Jim Klimov <[email protected]>
jimklimov
added a commit
to jimklimov/nut
that referenced
this issue
Sep 14, 2023
Signed-off-by: Jim Klimov <[email protected]>
jimklimov
added
bug
portability
We want NUT to build and run everywhere possible
impacts-release-2.8.0
Issues reported against NUT release 2.8.0 (maybe vanilla or with minor packaging tweaks)
impacts-release-2.7.4
Issues reported against NUT release 2.7.4 (maybe vanilla or with minor packaging tweaks)
labels
Sep 14, 2023
jimklimov
added a commit
to jimklimov/nut
that referenced
this issue
Sep 14, 2023
…y upsname and/or hostname[:port] parts, to report problems as such [networkupstools#2052] Signed-off-by: Jim Klimov <[email protected]>
jimklimov
added a commit
to jimklimov/nut
that referenced
this issue
Sep 16, 2023
… definition to return NULL if input was NULL (and log it) [networkupstools#2052]" This reverts commit 05610d1. Seems to cause segfaults on its own, maybe something relied on older behavior (non-NULLs returned in case of bad inputs?) To investigate separately later...
jimklimov
added a commit
to jimklimov/nut
that referenced
this issue
Sep 16, 2023
…was NULL (and log it) [networkupstools#2052] Signed-off-by: Jim Klimov <[email protected]>
confirmed working on my system now - thanks a lot |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
bug
impacts-release-2.7.4
Issues reported against NUT release 2.7.4 (maybe vanilla or with minor packaging tweaks)
impacts-release-2.8.0
Issues reported against NUT release 2.8.0 (maybe vanilla or with minor packaging tweaks)
portability
We want NUT to build and run everywhere possible
when bash scripting with
upsc
it could happen that null variables are passed toupsc
by mistake, reproducible with the terminal commandupsc $UPS@$HOST
for example - which would result in:upsc @
when those variables are in fact not set and/or null.upsc @
currently results in a kernel segmentation fault on latest master, see:is there a way to recover from such an (easy to happen) mistake better than with a segmentation fault - perhaps such a malformation in the arguments could be caught before it would throw the kernel in distress?
OS: Slackware 15.0, NUT compiled from master
The text was updated successfully, but these errors were encountered: