The attached patch (applied onto src commit d068ea16e32 or later) modifies some kernel interfaces to force callers to do something with the return value. It might break some kmod ports, so an exp-run of at least those ports would be appreciated.
Created attachment 247321 [details] patch Attached the patch.
Some failure logs: https://pkg-status.freebsd.org/gohan04/data/mainamd64PR275986-default-foo/2024-01-01_09h01m47s/logs/errors/acpi_call-1.0.1_1.log https://pkg-status.freebsd.org/gohan04/data/mainamd64PR275986-default-foo/2024-01-01_09h01m47s/logs/errors/aoe-1.2.0_4.log https://pkg-status.freebsd.org/gohan04/data/mainamd64PR275986-default-foo/2024-01-01_09h01m47s/logs/errors/linux_dvbwrapper-kmod-1.0_1.log https://pkg-status.freebsd.org/gohan04/data/mainamd64PR275986-default-foo/2024-01-01_09h01m47s/logs/errors/mbgtools-f.1.0.0.log https://pkg-status.freebsd.org/gohan04/data/mainamd64PR275986-default-foo/2024-01-01_09h01m47s/logs/errors/opencbm-kmod-0.4.99.104.log
(In reply to Antoine Brodin from comment #2) Thanks. These all need to be patched. I did that locally here: https://github.com/markjdb/freebsd-ports/tree/main-copyinout-checking Most of those ports don't have maintainers so I'm not sure how to get them approved. I did create one review: https://reviews.freebsd.org/D43273 Would it be possible to retry with these patches, and see if any other kmods fail?
Ports patch approved.
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=0524b7ffff66cbc220a165480cc553e8d18bdc91 commit 0524b7ffff66cbc220a165480cc553e8d18bdc91 Author: Mark Johnston <markj@FreeBSD.org> AuthorDate: 2024-01-02 18:07:59 +0000 Commit: Mark Johnston <markj@FreeBSD.org> CommitDate: 2024-01-03 00:59:29 +0000 sysutils/mbgtools: Add error checking for copyin() and copyout() calls This will be required soon, and the previous lack of such error handling was a bug. PR: 275986 Approved by: antoine sysutils/mbgtools/Makefile | 1 + .../mbgtools/files/patch-mbglib_common_macioctl.h (new) | 17 +++++++++++++++++ 2 files changed, 18 insertions(+)
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=823c8faa750685c75c8a9a701f0e36808dd7bd48 commit 823c8faa750685c75c8a9a701f0e36808dd7bd48 Author: Mark Johnston <markj@FreeBSD.org> AuthorDate: 2024-01-02 18:10:47 +0000 Commit: Mark Johnston <markj@FreeBSD.org> CommitDate: 2024-01-03 01:00:26 +0000 net/aoe: Fix error handling for a copyout() call This will soon be required by the base system. PR: 275986 Approved by: antoine net/aoe/Makefile | 2 +- net/aoe/files/patch-aoeblk.c (new) | 23 ++++++++++++++++++ net/aoe/files/patch-aoecmd.c | 48 ++++++++++++++++++++++++++++++++++---- 3 files changed, 67 insertions(+), 6 deletions(-)
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=e6728be27592820616fb830006265b973d1764d1 commit e6728be27592820616fb830006265b973d1764d1 Author: Mark Johnston <markj@FreeBSD.org> AuthorDate: 2024-01-02 18:21:22 +0000 Commit: Mark Johnston <markj@FreeBSD.org> CommitDate: 2024-01-03 01:00:31 +0000 multimedia/linux_dvbwrapper: Add error handling for copyout() calls The base system will soon require all copyout() calls to have explicit handling of return values. PR: 275986 Approved by: antoine multimedia/linux_dvbwrapper-kmod/Makefile | 2 +- .../files/patch-linux__dvbwrapper.c | 31 ++++++++++++++++++---- 2 files changed, 27 insertions(+), 6 deletions(-)
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=eaa12eb57a422be10df72d567aea693dcafc6c19 commit eaa12eb57a422be10df72d567aea693dcafc6c19 Author: Mark Johnston <markj@FreeBSD.org> AuthorDate: 2024-01-03 16:58:37 +0000 Commit: Mark Johnston <markj@FreeBSD.org> CommitDate: 2024-01-03 16:59:53 +0000 comms/opencbm-kmod: Add error handling for copyin() and copyout() calls This will be required soon as my intent is to annotate copyin() and related functions with __result_use_check. Moreover, the lack of error handling here is a real bug. The patch was submitted upstream as well. PR: 275986 Approved by: zirias Differential Revision: https://reviews.freebsd.org/D43273 comms/opencbm-kmod/Makefile | 1 + .../files/patch-compat-freebsd-14 (gone) | 34 -------------- comms/opencbm-kmod/files/patch-opencbm.c (new) | 54 ++++++++++++++++++++++ 3 files changed, 55 insertions(+), 34 deletions(-)
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=d0d5a75f66a400f72b5206debdf60ca5fa05da53 commit d0d5a75f66a400f72b5206debdf60ca5fa05da53 Author: Mark Johnston <markj@FreeBSD.org> AuthorDate: 2024-01-02 18:18:53 +0000 Commit: Mark Johnston <markj@FreeBSD.org> CommitDate: 2024-01-03 21:53:33 +0000 sysutils/acpi_call: Check for errors from copyout() The base system will soon require all copyout() calls to either preserve the return value or explicitly ignore it. PR: 275986 Approved by: antoine sysutils/acpi_call/Makefile | 2 +- sysutils/acpi_call/files/patch-acpi__call.c | 12 ++++++++---- 2 files changed, 9 insertions(+), 5 deletions(-)
This is all committed now. Thanks Antoine!