Page MenuHomeFreeBSD

Fix nmtree crashing with duplicate items
Needs ReviewPublic

Authored by renato.riolino_eldorado.org.br on Jan 20 2020, 5:21 PM.
Tags
None
Referenced Files
Unknown Object (File)
Feb 8 2024, 3:11 AM
Unknown Object (File)
Jan 10 2024, 2:01 AM
Unknown Object (File)
Dec 20 2023, 4:38 AM
Unknown Object (File)
Dec 12 2023, 7:59 PM
Unknown Object (File)
Sep 28 2023, 12:16 AM
Unknown Object (File)
Sep 6 2023, 5:27 AM
Unknown Object (File)
Aug 27 2023, 2:34 PM
Unknown Object (File)
Aug 14 2023, 7:06 PM
Subscribers

Details

Reviewers
brooks
kib
emaste
Summary

Bug: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=192839

If the addchild() function finds that the current item is already in the linked list, it overrides the duplicated item with the new one and then free() the new one, but the calling function would still reference the new item that was freed.

Test Plan

nmtree -dEU <<EOF

.
item
item
..
EOF

Diff Detail

Lint
No Lint Coverage
Unit
No Test Coverage
Build Status
Buildable 28815
Build 26823: arc lint + arc unit

Event Timeline

This should be submitted to NetBSD so we don't have to maintain a local diff.

contrib/mtree/spec.c
720

To reduce the churn of this patch, I'm tempted to suggest this should be centryp and there should be a NODE *centry that is initialized to *centry.

renato.riolino_eldorado.org.br edited the summary of this revision. (Show Details)

Fix for #192839 - Duplicate entries in an mtree file cause nmtree to coredump

You seem to be manually uploading diffs rather than using arcanist and the diff is now against your previous version not against the freebsd tree...

renato.riolino_eldorado.org.br marked an inline comment as done.

Diff now is against freebsd tree