Bug 243057 - wrong mbuf passed to key_sendup_mbuf by key_spdacquire
Summary: wrong mbuf passed to key_sendup_mbuf by key_spdacquire
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: 11.2-RELEASE
Hardware: Any Any
: --- Affects Only Me
Assignee: Mark Johnston
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-01-03 13:39 UTC by Masse Nicolas
Modified: 2025-01-20 00:29 UTC (History)
2 users (show)

See Also:


Attachments
Pass result to key_sendup_mbuf instead of m (424 bytes, patch)
2020-01-03 13:39 UTC, Masse Nicolas
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Masse Nicolas 2020-01-03 13:39:54 UTC
Created attachment 210416 [details]
Pass result to key_sendup_mbuf instead of m

The method key_spdacquire pass the parameter "m" to key_sendup_mbuf, or this parameter is always NULL (due to the for loop above).
It should pass the mbuf "result instead"
Comment 1 Andrey V. Elsukov freebsd_committer freebsd_triage 2020-01-04 10:48:28 UTC
I think the patch is correct. However this part of code is unused, this is why it has never triggered the assertion. SPDACQUIRE message was not implemented and it is not hooked to the key_typesw.
Comment 2 Mark Johnston freebsd_committer freebsd_triage 2020-01-16 17:50:51 UTC
(In reply to Masse Nicolas from comment #0)
How did you notice the problem?
Comment 3 commit-hook freebsd_committer freebsd_triage 2025-01-06 23:23:22 UTC
A commit in branch main references this bug:

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

commit 378a2b155aaf853933df5b53e174b3880826488c
Author:     Mark Johnston <markj@FreeBSD.org>
AuthorDate: 2025-01-06 23:20:08 +0000
Commit:     Mark Johnston <markj@FreeBSD.org>
CommitDate: 2025-01-06 23:20:18 +0000

    netipsec: Pass the right mbuf up

    Note that key_spdacquire() is dead code, as the SADB_X_SPDACQUIRE
    message handler is not set.

    PR:             243057
    MFC after:      2 weeks

 sys/netipsec/key.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Comment 4 commit-hook freebsd_committer freebsd_triage 2025-01-20 00:28:24 UTC
A commit in branch stable/14 references this bug:

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

commit 65da23709d2047c996fb9434e68c2ce90ecdc1bb
Author:     Mark Johnston <markj@FreeBSD.org>
AuthorDate: 2025-01-06 23:20:08 +0000
Commit:     Mark Johnston <markj@FreeBSD.org>
CommitDate: 2025-01-20 00:26:35 +0000

    netipsec: Pass the right mbuf up

    Note that key_spdacquire() is dead code, as the SADB_X_SPDACQUIRE
    message handler is not set.

    PR:             243057
    MFC after:      2 weeks

    (cherry picked from commit 378a2b155aaf853933df5b53e174b3880826488c)

 sys/netipsec/key.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)