Bug 260574 - security/tang: Update to v11 (Fix CVE-2021-4076)
Summary: security/tang: Update to v11 (Fix CVE-2021-4076)
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Daniel Engberg
URL:
Keywords: security
Depends on:
Blocks:
 
Reported: 2021-12-20 19:19 UTC by Howard Holm
Modified: 2022-02-12 23:28 UTC (History)
2 users (show)

See Also:


Attachments
Patch against current (1.32 KB, patch)
2021-12-20 19:19 UTC, Howard Holm
no flags Details | Diff
Updated patch against current (1.58 KB, patch)
2022-01-16 05:16 UTC, Howard Holm
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Howard Holm 2021-12-20 19:19:49 UTC
Created attachment 230274 [details]
Patch against current

Update to v11
- Fix possible NULL pointer dereference in find_by_thp() (262d98f)
- Fix issues reported by shellcheck (3d770c6)
- Make sure keys are created with 0440 mode (81cb455)
- Man page updates (#80)
- Improve FreeBSD support (#73)
- Move signing part out of find_by_thp() and to find_jws() - CVE-2021-4076 (#81)
Comment 1 Daniel Engberg freebsd_committer freebsd_triage 2022-01-06 02:59:44 UTC
Please use upstream release archive instead as suggested by Porters Handbook 5.4.3

"If the distribution file comes from a specific commit or tag on GitHub for which there is _no officially released file_"

https://github.com/latchset/tang/releases/download/v11/tang-11.tar.xz
Comment 2 Howard Holm 2022-01-06 11:14:16 UTC
(In reply to Daniel Engberg from comment #1)

I'm confused by your comment.  The patch was to pull the v11 tag from upstream latchset.  What should I have done differently?
Comment 3 Daniel Engberg freebsd_committer freebsd_triage 2022-01-06 17:13:19 UTC
When you use USE_GITHUB it'll pull a generated archive instead of a static one (later one is preferred). It just makes sure we do it in a consistent way in the tree (short version).
https://cgit.freebsd.org/ports/tree/Mk/bsd.sites.mk#n340

In this case you should drop USE_GITHUB (and variables used for it) and use MASTER_SITES instead. The only exception in general is when upstream distribution archive isn't usable for some reason.

MASTER_SITES= https://github.com/latchset/${PORTNAME}/releases/download/v${DISTVERSION}/

USES= ... tar:xz
Comment 4 Howard Holm 2022-01-16 05:16:58 UTC
Created attachment 231034 [details]
Updated patch against current
Comment 5 Howard Holm 2022-01-16 05:18:56 UTC
Comment on attachment 231034 [details]
Updated patch against current

Thanks for the explanation.  I think this new patch should address the concern.
Comment 6 Howard Holm 2022-01-29 18:36:43 UTC
I know people are busy, but this closes a CVE.  Is there something additional I need to do to get this committed?
Comment 7 Daniel Engberg freebsd_committer freebsd_triage 2022-01-29 22:49:23 UTC
I'll give it a go during next week
Comment 8 Daniel Engberg freebsd_committer freebsd_triage 2022-02-07 22:46:15 UTC
I'm sorry for the delay, one of the HDDs in my buildbox died last week and new hardware arrived by the weekend. I'm on this but the box needs a bit of time to transfer data but I'll get to it asap.
Comment 9 commit-hook freebsd_committer freebsd_triage 2022-02-09 22:08:00 UTC
A commit in branch main references this bug:

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

commit 21ea51a6ef6e711990ca91e5000d05a28bba345d
Author:     Howard Holm <hdholm@alumni.iastate.edu>
AuthorDate: 2022-02-09 21:58:10 +0000
Commit:     Daniel Engberg <diizzy@FreeBSD.org>
CommitDate: 2022-02-09 22:06:51 +0000

    security/tang: Update to v11

    Changelog: https://github.com/latchset/tang/releases/tag/v11
    Fixes CVE-2021-4076

    PR:             260574

 security/tang/Makefile  | 11 +++--------
 security/tang/distinfo  |  6 +++---
 security/tang/pkg-plist |  1 +
 3 files changed, 7 insertions(+), 11 deletions(-)
Comment 10 Daniel Engberg freebsd_committer freebsd_triage 2022-02-09 22:16:13 UTC
Committed, sorry for the wait.

I made a few changes to the port to make portlint happy and fixed some issues.

Move CATEGORIES entry (portlint)

USES= meson implies ninja so no need to specify it
https://cgit-beta.freebsd.org/ports/tree/Mk/Uses/meson.mk#n31

INSTALL_TARGET= install-strip isn't needed, this is more or less only used (if needed) for projects that uses GNU Autotools

USE_LDCONFIG is only used for shared libraries which this port doesn't install. (portlint)
Section "6.3. Shared Libraries" in Porters Handbook

Best regards,
Daniel
Comment 11 Howard Holm 2022-02-12 23:28:45 UTC
Thanks.  I noted the changes for future updates.  I appreciate the feedback.