Bug 274354 - net/pload: Crash at startup
Summary: net/pload: Crash at startup
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: amd64 Any
: --- Affects Only Me
Assignee: Robert Clausecker
URL: https://www.freshports.org/net/pload/
Keywords: crash, needs-qa
Depends on:
Blocks:
 
Reported: 2023-10-08 14:35 UTC by Rupert Stitzinger
Modified: 2023-10-09 07:46 UTC (History)
2 users (show)

See Also:
fbsd: maintainer-feedback+
fuz: merge-quarterly+


Attachments
patch to fix segv due to incorrect argument copying (1.88 KB, patch)
2023-10-08 15:23 UTC, J.R. Oldroyd
fbsd: maintainer-approval+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Rupert Stitzinger 2023-10-08 14:35:46 UTC
When starting pload it always crashes with "Illegal memory access" 

pload from packages: pload-0.9.5_5
Network Card / driver: Realtek 8125 / Driver: realtek-re-kmod-198.00 from packages
FreebSD: FreeBSD 13.2-RELEASE-p4 GENERIC amd64

LLDB:
$ lldb pload
(lldb) target create "pload"
Current executable set to 'pload' (x86_64).
(lldb) run
Process 1450 launched: '/usr/local/bin/pload' (x86_64)
Process 1450 stopped
* thread #1, name = 'pload', stop reason = signal SIGSEGV: invalid address (fault address: 0x68acf04)
    frame #0: 0x0000000828d2aa50 libc.so.7`strncmp + 16
libc.so.7`strncmp:
->  0x828d2aa50 <+16>: movzbl (%rdi,%rcx), %r8d
    0x828d2aa55 <+21>: movzbl (%rsi,%rcx), %eax
    0x828d2aa59 <+25>: cmpb   %al, %r8b
    0x828d2aa5c <+28>: jne    0x828d2aa77               ; <+55>
(lldb)
Comment 1 Graham Perrin 2023-10-08 14:58:20 UTC
Packages from quarterly, or latest?
Comment 2 Rupert Stitzinger 2023-10-08 15:12:22 UTC
(In reply to Graham Perrin from comment #1)
Packages: Quarterly
Comment 3 J.R. Oldroyd 2023-10-08 15:23:40 UTC
Created attachment 245500 [details]
patch to fix segv due to incorrect argument copying

Looks like there was no NULL pointer at the end of the orig_argv[] when it was copied or restored.
Comment 4 Robert Clausecker freebsd_committer freebsd_triage 2023-10-08 17:59:53 UTC
Thank you for fixing this.

Will MFH the fix into the 2023Q4 branch.
Comment 5 commit-hook freebsd_committer freebsd_triage 2023-10-09 07:42:54 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=ffaf1c4515dd11fc28fd00c97ae5c8ff78aca4e1

commit ffaf1c4515dd11fc28fd00c97ae5c8ff78aca4e1
Author:     J.R. Oldroyd <fbsd@opal.com>
AuthorDate: 2023-10-08 17:59:09 +0000
Commit:     Robert Clausecker <fuz@FreeBSD.org>
CommitDate: 2023-10-09 07:40:32 +0000

    net/pload: fix crash at startup

    Looks like there was no NULL pointer at the end of the orig_argv[] when
    it was copied or restored.

    PR:             274354
    Reported by:    Rupert Stitzinger <stitzinger_rupert@web.de>
    MFH:            2023Q4

 net/pload/Makefile            |  4 ++--
 net/pload/files/patch-pload.c | 10 ++++++----
 2 files changed, 8 insertions(+), 6 deletions(-)
Comment 6 commit-hook freebsd_committer freebsd_triage 2023-10-09 07:44:09 UTC
A commit in branch 2023Q4 references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=68016c256e8dcea59e8948722541047e89689de3

commit 68016c256e8dcea59e8948722541047e89689de3
Author:     J.R. Oldroyd <fbsd@opal.com>
AuthorDate: 2023-10-08 17:59:09 +0000
Commit:     Robert Clausecker <fuz@FreeBSD.org>
CommitDate: 2023-10-09 07:43:12 +0000

    net/pload: fix crash at startup

    Looks like there was no NULL pointer at the end of the orig_argv[] when
    it was copied or restored.

    PR:             274354
    Reported by:    Rupert Stitzinger <stitzinger_rupert@web.de>
    MFH:            2023Q4

    (cherry picked from commit ffaf1c4515dd11fc28fd00c97ae5c8ff78aca4e1)

 net/pload/Makefile            |  4 ++--
 net/pload/files/patch-pload.c | 10 ++++++----
 2 files changed, 8 insertions(+), 6 deletions(-)
Comment 7 Robert Clausecker freebsd_committer freebsd_triage 2023-10-09 07:46:53 UTC
Thank you for your contribution.