From owner-dev-commits-src-all@freebsd.org Mon Mar 29 23:45:06 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 716625B046A; Mon, 29 Mar 2021 23:45:06 +0000 (UTC) (envelope-from melifaro@ipfw.ru) Received: from forward105p.mail.yandex.net (forward105p.mail.yandex.net [77.88.28.108]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4F8Thc6Lctz4vGv; Mon, 29 Mar 2021 23:45:04 +0000 (UTC) (envelope-from melifaro@ipfw.ru) Received: from forward103q.mail.yandex.net (forward103q.mail.yandex.net [IPv6:2a02:6b8:c0e:50:0:640:b21c:d009]) by forward105p.mail.yandex.net (Yandex) with ESMTP id ED8AD4D44318; Tue, 30 Mar 2021 02:44:55 +0300 (MSK) Received: from vla1-e8d3e6f22b4d.qloud-c.yandex.net (vla1-e8d3e6f22b4d.qloud-c.yandex.net [IPv6:2a02:6b8:c0d:3603:0:640:e8d3:e6f2]) by forward103q.mail.yandex.net (Yandex) with ESMTP id E97CF61E0002; Tue, 30 Mar 2021 02:44:55 +0300 (MSK) Received: from vla5-8422ddc3185d.qloud-c.yandex.net (vla5-8422ddc3185d.qloud-c.yandex.net [2a02:6b8:c18:3495:0:640:8422:ddc3]) by vla1-e8d3e6f22b4d.qloud-c.yandex.net (mxback/Yandex) with ESMTP id tIeqWUQAHV-itIGe8uc; Tue, 30 Mar 2021 02:44:55 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfw.ru; s=mail; t=1617061495; bh=5RbpEIzX1A0O5VJBNaNlnq+3RIZvFeFobeVDipN5Ufc=; h=To:In-Reply-To:Subject:Cc:From:Message-Id:References:Date; b=lCUPOd5ayxGBRUw8+BNdDaVhE+1OWVcsBkZfIwqKr2/hHuePTGHC0t4Pv81cRqsmL OwNrVTW1iVVmHj3ndkZU1lU7Q/z8o6xAolAe2kacKDvoXw67Yt/1X7Vl55RjlWTSNC ffZlvw9ip+GtYaRmEzNU6a+vxazCX6GED25qrSPE= Received: by vla5-8422ddc3185d.qloud-c.yandex.net (smtp/Yandex) with ESMTPSA id vWCIIdsTjL-isJGsZCH; Tue, 30 Mar 2021 02:44:54 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client certificate not present) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.60.0.2.21\)) Subject: Re: git: 9fa8d1582b44 - main - Put bandaid for nhgrp_dump_sysctl() malloc KASSERT(). From: "Alexander V. Chernikov" In-Reply-To: <202103292332.12TNWXSv007193@slippy.cwsent.com> Date: Tue, 30 Mar 2021 00:44:52 +0100 Cc: "Alexander V. Chernikov" , "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Content-Transfer-Encoding: quoted-printable Message-Id: <8FEA74E1-246F-45E3-9794-330029DCD53E@ipfw.ru> References: <202103292315.12TNFFmZ050152@gitrepo.freebsd.org> <202103292332.12TNWXSv007193@slippy.cwsent.com> To: Cy Schubert X-Mailer: Apple Mail (2.3654.60.0.2.21) X-Rspamd-Queue-Id: 4F8Thc6Lctz4vGv X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=ipfw.ru header.s=mail header.b=lCUPOd5a; dmarc=none; spf=pass (mx1.freebsd.org: domain of melifaro@ipfw.ru designates 77.88.28.108 as permitted sender) smtp.mailfrom=melifaro@ipfw.ru X-Spamd-Result: default: False [-3.00 / 15.00]; TO_DN_EQ_ADDR_SOME(0.00)[]; TO_DN_SOME(0.00)[]; MV_CASE(0.50)[]; R_SPF_ALLOW(-0.20)[+ip4:77.88.0.0/18]; RWL_MAILSPIKE_GOOD(0.00)[77.88.28.108:from]; RCPT_COUNT_FIVE(0.00)[5]; RCVD_COUNT_THREE(0.00)[4]; DKIM_TRACE(0.00)[ipfw.ru:+]; NEURAL_HAM_SHORT(-1.00)[-1.000]; FROM_EQ_ENVFROM(0.00)[]; RCVD_TLS_LAST(0.00)[]; RBL_DBL_DONT_QUERY_IPS(0.00)[77.88.28.108:from]; ASN(0.00)[asn:13238, ipnet:77.88.0.0/18, country:RU]; MIME_TRACE(0.00)[0:+]; MID_RHS_MATCH_FROM(0.00)[]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; R_DKIM_ALLOW(-0.20)[ipfw.ru:s=mail]; FREEFALL_USER(0.00)[melifaro]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[ipfw.ru]; SPAMHAUS_ZRD(0.00)[77.88.28.108:from:127.0.2.255]; TO_MATCH_ENVRCPT_SOME(0.00)[]; MAILMAN_DEST(0.00)[dev-commits-src-all,dev-commits-src-main] X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Mar 2021 23:45:06 -0000 > On 30 Mar 2021, at 00:32, Cy Schubert = 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 >> AuthorDate: 2021-03-29 23:12:11 +0000 >> Commit: Alexander V. Chernikov >> 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 > FreeBSD UNIX: Web: https://FreeBSD.org > NTP: Web: https://nwtime.org >=20 > The need of the many outweighs the greed of the few.