Bug 280910 - [PATCH] Fix crash for "tail -F"
Summary: [PATCH] Fix crash for "tail -F"
Status: In Progress
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: 14.1-STABLE
Hardware: Any Any
: --- Affects Some People
Assignee: freebsd-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-08-18 17:05 UTC by Andre Albsmeier
Modified: 2024-08-21 16:00 UTC (History)
1 user (show)

See Also:


Attachments
PATCH fixing crash for tail -F (402 bytes, patch)
2024-08-18 17:05 UTC, Andre Albsmeier
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Andre Albsmeier 2024-08-18 17:05:36 UTC
Created attachment 252889 [details]
PATCH fixing crash for tail -F

This patch fixes a crash for "tail -F" when show() detects an error and closes the file and follow() wants to close it again.
Comment 1 commit-hook freebsd_committer freebsd_triage 2024-08-19 08:00:17 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=308399a179a49b7b858c725de10177fdb0502fd2

commit 308399a179a49b7b858c725de10177fdb0502fd2
Author:     Andre Albsmeier <mail@fbsd2.e4m.org>
AuthorDate: 2024-08-19 07:54:24 +0000
Commit:     Konstantin Belousov <kib@FreeBSD.org>
CommitDate: 2024-08-19 07:54:24 +0000

    tail -F: fix crash

    When show() detects an error and closes the file and follow() wants to
    close it again, a NULL dereference occurs.

    PR:     280910
    MFC after:      1 week

 usr.bin/tail/forward.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
Comment 2 commit-hook freebsd_committer freebsd_triage 2024-08-21 10:33:31 UTC
A commit in branch stable/14 references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=cf4a34bbc7dfee43e9983a847ecf0fa0ed1d258d

commit cf4a34bbc7dfee43e9983a847ecf0fa0ed1d258d
Author:     Andre Albsmeier <mail@fbsd2.e4m.org>
AuthorDate: 2024-08-19 07:54:24 +0000
Commit:     Konstantin Belousov <kib@FreeBSD.org>
CommitDate: 2024-08-21 10:32:49 +0000

    tail -F: fix crash

    PR:     280910

    (cherry picked from commit 308399a179a49b7b858c725de10177fdb0502fd2)

 usr.bin/tail/forward.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
Comment 3 commit-hook freebsd_committer freebsd_triage 2024-08-21 10:34:33 UTC
A commit in branch stable/13 references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=8dfa4e5b6ce2e22ef92c0ec13aa001994774c23f

commit 8dfa4e5b6ce2e22ef92c0ec13aa001994774c23f
Author:     Andre Albsmeier <mail@fbsd2.e4m.org>
AuthorDate: 2024-08-19 07:54:24 +0000
Commit:     Konstantin Belousov <kib@FreeBSD.org>
CommitDate: 2024-08-21 10:34:06 +0000

    tail -F: fix crash

    PR:     280910

    (cherry picked from commit 308399a179a49b7b858c725de10177fdb0502fd2)

 usr.bin/tail/forward.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
Comment 4 commit-hook freebsd_committer freebsd_triage 2024-08-21 16:00:08 UTC
A commit in branch releng/13.4 references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=9b945635c147feb4ac6ebf84bd19e149e9a10227

commit 9b945635c147feb4ac6ebf84bd19e149e9a10227
Author:     Andre Albsmeier <mail@fbsd2.e4m.org>
AuthorDate: 2024-08-19 07:54:24 +0000
Commit:     Konstantin Belousov <kib@FreeBSD.org>
CommitDate: 2024-08-21 15:59:21 +0000

    tail -F: fix crash

    PR:     280910
    Approved by:    re (cperciva)

    (cherry picked from commit 308399a179a49b7b858c725de10177fdb0502fd2)
    (cherry picked from commit 8dfa4e5b6ce2e22ef92c0ec13aa001994774c23f)

 usr.bin/tail/forward.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)