Date: Tue, 30 Mar 2021 00:44:52 +0100 From: "Alexander V. Chernikov" <melifaro@ipfw.ru> To: Cy Schubert <Cy.Schubert@cschubert.com> Cc: "Alexander V. Chernikov" <melifaro@FreeBSD.org>, "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: 9fa8d1582b44 - main - Put bandaid for nhgrp_dump_sysctl() malloc KASSERT(). Message-ID: <8FEA74E1-246F-45E3-9794-330029DCD53E@ipfw.ru> In-Reply-To: <202103292332.12TNWXSv007193@slippy.cwsent.com> References: <202103292315.12TNFFmZ050152@gitrepo.freebsd.org> <202103292332.12TNWXSv007193@slippy.cwsent.com>
next in thread | previous in thread | raw e-mail | index | archive | help
> On 30 Mar 2021, at 00:32, Cy Schubert <Cy.Schubert@cschubert.com> = wrote: >=20 > In message <202103292315.12TNFFmZ050152@gitrepo.freebsd.org>, = "Alexander V.=20 > Che > rnikov" writes: >> The branch main has been updated by melifaro: >>=20 >> URL: = https://cgit.FreeBSD.org/src/commit/?id=3D9fa8d1582b44b4850d40699c9adb1047= >> 32328b7d >>=20 >> commit 9fa8d1582b44b4850d40699c9adb104732328b7d >> Author: Alexander V. Chernikov <melifaro@FreeBSD.org> >> AuthorDate: 2021-03-29 23:12:11 +0000 >> Commit: Alexander V. Chernikov <melifaro@FreeBSD.org> >> CommitDate: 2021-03-29 23:12:11 +0000 >>=20 >> Put bandaid for nhgrp_dump_sysctl() malloc KASSERT(). >>=20 >> Recent rtsock changes widened epoch and covered = nhgrp_dump_sysctl(), >> resulting in `netstat -4On` triggering with KASSERT. >>=20 >> MFC after: 1 day >> --- >> sys/net/route/nhgrp_ctl.c | 4 +++- >> 1 file changed, 3 insertions(+), 1 deletion(-) >>=20 >> diff --git a/sys/net/route/nhgrp_ctl.c b/sys/net/route/nhgrp_ctl.c >> index b228c3bcee37..2896730458b5 100644 >> --- a/sys/net/route/nhgrp_ctl.c >> +++ b/sys/net/route/nhgrp_ctl.c >> @@ -806,7 +806,9 @@ nhgrp_dump_sysctl(struct rib_head *rh, struct = sysctl_req=20 >> *w) >> sz =3D sizeof(struct rt_msghdr) + sizeof(struct nhgrp_external); >> sz +=3D 2 * sizeof(struct nhgrp_container); >> sz +=3D 2 * sizeof(struct nhgrp_nhop_external) * = RIB_MAX_MPATH_WIDTH; >> - buffer =3D malloc(sz, M_TEMP, M_WAITOK); >> + buffer =3D malloc(sz, M_TEMP, M_MOWAIT); > ^ > This appears to be a typo. Fixed typo, build, tested but forgot to amend the commit. 0c2a0e038002cba423161aeed8f358ffb4fb2836 should fix it. >=20 >> + if (buffer =3D=3D NULL) >> + return (ENOMEM); >>=20 >> NET_EPOCH_ENTER(et); >> NHOPS_RLOCK(ctl); >>=20 >=20 >=20 >=20 > --=20 > Cheers, > Cy Schubert <Cy.Schubert@cschubert.com> > FreeBSD UNIX: <cy@FreeBSD.org> Web: https://FreeBSD.org > NTP: <cy@nwtime.org> Web: https://nwtime.org >=20 > The need of the many outweighs the greed of the few.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?8FEA74E1-246F-45E3-9794-330029DCD53E>