Date: Mon, 27 Mar 2023 17:11:25 +0100 From: Alexander Chernikov <melifaro@freebsd.org> To: Shawn Webb <shawn.webb@hardenedbsd.org> Cc: "src-committers@freebsd.org" <src-committers@FreeBSD.org>, "dev-commits-src-all@freebsd.org" <dev-commits-src-all@FreeBSD.org>, "dev-commits-src-main@freebsd.org" <dev-commits-src-main@FreeBSD.org> Subject: Re: git: 19e43c163c64 - main - netlink: add netlink KPI to the kernel by default Message-ID: <4C61BC36-8977-48A6-9A51-EB6D415DB4CB@freebsd.org> In-Reply-To: <20230327153934.6lghvi7cnqodhig3@mutt-hbsd> References: <202303271355.32RDtqJ9006858@gitrepo.freebsd.org> <20230327153934.6lghvi7cnqodhig3@mutt-hbsd>
next in thread | previous in thread | raw e-mail | index | archive | help
[-- Attachment #1 --] > On 27 Mar 2023, at 16:39, Shawn Webb <shawn.webb@hardenedbsd.org> wrote: > > On Mon, Mar 27, 2023 at 01:55:52PM +0000, Alexander V. Chernikov wrote: >> The branch main has been updated by melifaro: >> >> URL: https://cgit.FreeBSD.org/src/commit/?id=19e43c163c64636d2590dca006e22f18d22f48b2 >> >> commit 19e43c163c64636d2590dca006e22f18d22f48b2 >> Author: Alexander V. Chernikov <melifaro@FreeBSD.org> >> AuthorDate: 2023-03-27 11:59:30 +0000 >> Commit: Alexander V. Chernikov <melifaro@FreeBSD.org> >> CommitDate: 2023-03-27 13:55:44 +0000 >> >> netlink: add netlink KPI to the kernel by default >> >> This change does the following: >> >> Base Netlink KPIs (ability to register the family, parse and/or >> write a Netlink message) are always present in the kernel. Specifically, >> * Implementation of genetlink family/group registration/removal, >> some base accessors (netlink_generic_kpi.c, 260 LoC) are compiled in >> unconditionally. >> * Basic TLV parser functions (netlink_message_parser.c, 507 LoC) are >> compiled in unconditionally. >> * Glue functions (netlink<>rtsock), malloc/core sysctl definitions >> (netlink_glue.c, 259 LoC) are compiled in unconditionally. >> * The rest of the KPI _functions_ are defined in the netlink_glue.c, >> but their implementation calls a pointer to either the stub function >> or the actual function, depending on whether the module is loaded or not. >> >> This approach allows to have only 1k LoC out of ~3.7k LoC (current >> sys/netlink implementation) in the kernel, which will not grow further. >> It also allows for the generic netlink kernel customers to load >> successfully without requiring Netlink module and operate correctly >> once Netlink module is loaded. >> >> Reviewed by: imp >> MFC after: 2 weeks >> Differential Revision: https://reviews.freebsd.org/D39269 >> --- >> sys/conf/files | 4 +- >> sys/conf/options | 2 +- >> sys/modules/carp/Makefile | 2 +- >> sys/modules/netlink/Makefile | 6 +- >> sys/net/route.c | 19 --- >> sys/netinet/ip_carp.c | 2 + >> sys/netlink/netlink_ctl.h | 10 +- >> sys/netlink/netlink_domain.c | 24 --- >> sys/netlink/netlink_generic.c | 282 +++-------------------------------- >> sys/netlink/netlink_generic_kpi.c | 279 ++++++++++++++++++++++++++++++++++ >> sys/netlink/netlink_io.c | 2 + >> sys/netlink/netlink_message_writer.c | 22 +-- >> sys/netlink/netlink_message_writer.h | 86 +++++++++++ >> sys/netlink/netlink_module.c | 26 +++- >> sys/netlink/netlink_var.h | 44 ++++++ >> sys/netlink/route/iface.c | 2 + >> sys/netlink/route/neigh.c | 2 + >> sys/netlink/route/nexthop.c | 2 + >> sys/netlink/route/rt.c | 2 + >> 19 files changed, 497 insertions(+), 321 deletions(-) >> >> diff --git a/sys/conf/files b/sys/conf/files >> index 629283f7c071..94cd7135b277 100644 >> --- a/sys/conf/files >> +++ b/sys/conf/files >> @@ -4424,10 +4424,12 @@ netipsec/xform_ipcomp.c optional ipsec inet | ipsec inet6 >> netipsec/xform_tcp.c optional ipsec inet tcp_signature | \ >> ipsec inet6 tcp_signature | ipsec_support inet tcp_signature | \ >> ipsec_support inet6 tcp_signature >> +netlink/netlink_generic_kpi.c standard >> +netlink/netlink_glue.c standard > > It appears netlink/netlink_glue.c was missed from this commit: Sorry for the breakage, should be fixed in d3a49f62a284. > > cc: error: no such file or directory: '/usr/src/sys/netlink/netlink_glue.c' > cc: error: no input files > > Thanks, > > -- > Shawn Webb > Cofounder / Security Engineer > HardenedBSD > > https://git.hardenedbsd.org/hardenedbsd/pubkeys/-/raw/master/Shawn_Webb/03A4CBEBB82EA5A67D9F3853FF2E67A277F8E1FA.pub.asc [-- Attachment #2 --] <html><head><meta http-equiv="content-type" content="text/html; charset=us-ascii"></head><body style="overflow-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;"><meta http-equiv="content-type" content="text/html; charset=us-ascii"><div style="overflow-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;"><br><div><br><blockquote type="cite"><div>On 27 Mar 2023, at 16:39, Shawn Webb <shawn.webb@hardenedbsd.org> wrote:</div><br class="Apple-interchange-newline"><div><meta charset="UTF-8"><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;">On Mon, Mar 27, 2023 at 01:55:52PM +0000, Alexander V. Chernikov wrote:</span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><blockquote type="cite" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; text-decoration: none;">The branch main has been updated by melifaro:<br><br>URL: https://cgit.FreeBSD.org/src/commit/?id=19e43c163c64636d2590dca006e22f18d22f48b2<br><br>commit 19e43c163c64636d2590dca006e22f18d22f48b2<br>Author: Alexander V. Chernikov <melifaro@FreeBSD.org><br>AuthorDate: 2023-03-27 11:59:30 +0000<br>Commit: Alexander V. Chernikov <melifaro@FreeBSD.org><br>CommitDate: 2023-03-27 13:55:44 +0000<br><br> netlink: add netlink KPI to the kernel by default<br><br> This change does the following:<br><br> Base Netlink KPIs (ability to register the family, parse and/or<br> write a Netlink message) are always present in the kernel. Specifically,<br> * Implementation of genetlink family/group registration/removal,<br> some base accessors (netlink_generic_kpi.c, 260 LoC) are compiled in<br> unconditionally.<br> * Basic TLV parser functions (netlink_message_parser.c, 507 LoC) are<br> compiled in unconditionally.<br> * Glue functions (netlink<>rtsock), malloc/core sysctl definitions<br> (netlink_glue.c, 259 LoC) are compiled in unconditionally.<br> * The rest of the KPI _functions_ are defined in the netlink_glue.c,<br> but their implementation calls a pointer to either the stub function<br> or the actual function, depending on whether the module is loaded or not.<br><br> This approach allows to have only 1k LoC out of ~3.7k LoC (current<br> sys/netlink implementation) in the kernel, which will not grow further.<br> It also allows for the generic netlink kernel customers to load<br> successfully without requiring Netlink module and operate correctly<br> once Netlink module is loaded.<br><br> Reviewed by: imp<br> MFC after: 2 weeks<br> Differential Revision: https://reviews.freebsd.org/D39269<br>---<br>sys/conf/files | 4 +-<br>sys/conf/options | 2 +-<br>sys/modules/carp/Makefile | 2 +-<br>sys/modules/netlink/Makefile | 6 +-<br>sys/net/route.c | 19 ---<br>sys/netinet/ip_carp.c | 2 +<br>sys/netlink/netlink_ctl.h | 10 +-<br>sys/netlink/netlink_domain.c | 24 ---<br>sys/netlink/netlink_generic.c | 282 +++--------------------------------<br>sys/netlink/netlink_generic_kpi.c | 279 ++++++++++++++++++++++++++++++++++<br>sys/netlink/netlink_io.c | 2 +<br>sys/netlink/netlink_message_writer.c | 22 +--<br>sys/netlink/netlink_message_writer.h | 86 +++++++++++<br>sys/netlink/netlink_module.c | 26 +++-<br>sys/netlink/netlink_var.h | 44 ++++++<br>sys/netlink/route/iface.c | 2 +<br>sys/netlink/route/neigh.c | 2 +<br>sys/netlink/route/nexthop.c | 2 +<br>sys/netlink/route/rt.c | 2 +<br>19 files changed, 497 insertions(+), 321 deletions(-)<br><br>diff --git a/sys/conf/files b/sys/conf/files<br>index 629283f7c071..94cd7135b277 100644<br>--- a/sys/conf/files<br>+++ b/sys/conf/files<br>@@ -4424,10 +4424,12 @@ netipsec/xform_ipcomp.c<span class="Apple-tab-span" style="white-space: pre;"> </span><span class="Apple-tab-span" style="white-space: pre;"> </span>optional ipsec inet | ipsec inet6<br>netipsec/xform_tcp.c<span class="Apple-tab-span" style="white-space: pre;"> </span><span class="Apple-tab-span" style="white-space: pre;"> </span>optional ipsec inet tcp_signature | \<br><span class="Apple-tab-span" style="white-space: pre;"> </span><span class="Apple-converted-space"> </span>ipsec inet6 tcp_signature | ipsec_support inet tcp_signature | \<br><span class="Apple-tab-span" style="white-space: pre;"> </span><span class="Apple-converted-space"> </span>ipsec_support inet6 tcp_signature<br>+netlink/netlink_generic_kpi.c<span class="Apple-tab-span" style="white-space: pre;"> </span>standard<br>+netlink/netlink_glue.c<span class="Apple-tab-span" style="white-space: pre;"> </span><span class="Apple-tab-span" style="white-space: pre;"> </span>standard<br></blockquote><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;">It appears netlink/netlink_glue.c was missed from this commit:</span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"></div></blockquote>Sorry for the breakage, should be fixed in d3a49f62a284.<br><blockquote type="cite"><div><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;">cc: error: no such file or directory: '/usr/src/sys/netlink/netlink_glue.c'</span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;">cc: error: no input files</span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;">Thanks,</span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;">--<span class="Apple-converted-space"> </span></span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;">Shawn Webb</span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;">Cofounder / Security Engineer</span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;">HardenedBSD</span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><a href="https://git.hardenedbsd.org/hardenedbsd/pubkeys/-/raw/master/Shawn_Webb/03A4CBEBB82EA5A67D9F3853FF2E67A277F8E1FA.pub.asc" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;">https://git.hardenedbsd.org/hardenedbsd/pubkeys/-/raw/master/Shawn_Webb/03A4CBEBB82EA5A67D9F3853FF2E67A277F8E1FA.pub.asc</a></div></blockquote></div><br></div></body></html>
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4C61BC36-8977-48A6-9A51-EB6D415DB4CB>
