Bug 256502 - cpucontrol: fix extended signature matching code
Summary: cpucontrol: fix extended signature matching code
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: Unspecified
Hardware: amd64 Any
: --- Affects Many People
Assignee: Mark Johnston
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-06-09 15:49 UTC by Dan Nelson
Modified: 2021-06-20 19:12 UTC (History)
1 user (show)

See Also:


Attachments
diff (319 bytes, patch)
2021-06-09 15:49 UTC, Dan Nelson
no flags Details | Diff
diff in git format (491 bytes, patch)
2021-06-09 20:40 UTC, Dan Nelson
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dan Nelson 2021-06-09 15:49:03 UTC
Created attachment 225663 [details]
diff

There's a bug in the code that checks to see if a firmware file matches the running cpu that results in firmware files with an extended signature table always matching.  Luckily the kernel ends up failing the update so no harm is done.  The attached patch makes the code always fail if no match is found, instead of accidentally falling through to the "matched:" label.
Comment 1 Mark Johnston freebsd_committer freebsd_triage 2021-06-09 20:16:44 UTC
Looks right to me.  If you attach a full git commit with author, commit message, etc. I'll commit that directly, otherwise I'll commit with Submitted by:.
Comment 2 Dan Nelson 2021-06-09 20:40:14 UTC
Created attachment 225673 [details]
diff in git format

Something like this?  If that doesn't work, you can just do a normal commit with a submitted-by line.
Comment 3 Mark Johnston freebsd_committer freebsd_triage 2021-06-09 21:00:38 UTC
(In reply to Dan Nelson from comment #2)
Sorry I didn't clarify, I meant a patch file generated with git format-patch.  This is fine though.
Comment 4 commit-hook freebsd_committer freebsd_triage 2021-06-14 21:35:12 UTC
A commit in branch main references this bug:

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

commit 87799c5f85dc0aed7e53ca841504e3b2ffc88498
Author:     Dan Nelson <dnelson_1901@yahoo.com>
AuthorDate: 2021-06-14 19:28:16 +0000
Commit:     Mark Johnston <markj@FreeBSD.org>
CommitDate: 2021-06-14 21:34:07 +0000

    cpucontrol: fix extended signature matching code to avoid fallthough

    PR:             256502
    MFC after:      1 week

 usr.sbin/cpucontrol/intel.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
Comment 5 commit-hook freebsd_committer freebsd_triage 2021-06-20 19:11:30 UTC
A commit in branch stable/11 references this bug:

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

commit 5fb914cdc18acf9070002af69832973a6472f7ac
Author:     Dan Nelson <dnelson_1901@yahoo.com>
AuthorDate: 2021-06-14 19:28:16 +0000
Commit:     Mark Johnston <markj@FreeBSD.org>
CommitDate: 2021-06-20 19:11:18 +0000

    cpucontrol: fix extended signature matching code to avoid fallthough

    PR:             256502

    (cherry picked from commit 87799c5f85dc0aed7e53ca841504e3b2ffc88498)

 usr.sbin/cpucontrol/intel.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
Comment 6 commit-hook freebsd_committer freebsd_triage 2021-06-20 19:11:31 UTC
A commit in branch stable/12 references this bug:

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

commit d8d0df35b353f9f0ae507d40b699a689a06ac252
Author:     Dan Nelson <dnelson_1901@yahoo.com>
AuthorDate: 2021-06-14 19:28:16 +0000
Commit:     Mark Johnston <markj@FreeBSD.org>
CommitDate: 2021-06-20 19:10:28 +0000

    cpucontrol: fix extended signature matching code to avoid fallthough

    PR:             256502

    (cherry picked from commit 87799c5f85dc0aed7e53ca841504e3b2ffc88498)

 usr.sbin/cpucontrol/intel.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
Comment 7 commit-hook freebsd_committer freebsd_triage 2021-06-20 19:12:31 UTC
A commit in branch stable/13 references this bug:

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

commit 659f77766031145ff2af2fc56da210cfbb6d249f
Author:     Dan Nelson <dnelson_1901@yahoo.com>
AuthorDate: 2021-06-14 19:28:16 +0000
Commit:     Mark Johnston <markj@FreeBSD.org>
CommitDate: 2021-06-20 19:10:21 +0000

    cpucontrol: fix extended signature matching code to avoid fallthough

    PR:             256502

    (cherry picked from commit 87799c5f85dc0aed7e53ca841504e3b2ffc88498)

 usr.sbin/cpucontrol/intel.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
Comment 8 Mark Johnston freebsd_committer freebsd_triage 2021-06-20 19:12:59 UTC
Thanks for the patch.