From owner-dev-commits-src-all@freebsd.org Mon Feb 8 16:08:23 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 7D998538525; Mon, 8 Feb 2021 16:08:23 +0000 (UTC) (envelope-from lutz@iks-jena.de) Received: from annwfn.iks-jena.de (annwfn.iks-jena.de [IPv6:2001:4bd8::19]) (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 4DZ9tH28x3z4S9S; Mon, 8 Feb 2021 16:08:22 +0000 (UTC) (envelope-from lutz@iks-jena.de) X-SMTP-Sender: IPv6:2001:4bd8:0:666:248:54ff:fe12:ee3f Received: from belenus.iks-jena.de (belenus.iks-jena.de [IPv6:2001:4bd8:0:666:248:54ff:fe12:ee3f]) by annwfn.iks-jena.de (8.15.2/8.15.2) with ESMTPS id 118G8HKv017537 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Mon, 8 Feb 2021 17:08:17 +0100 X-MSA-Host: belenus.iks-jena.de Received: (from lutz@localhost) by belenus.iks-jena.de (8.14.3/8.14.1/Submit) id 118G8Ho2005150; Mon, 8 Feb 2021 17:08:17 +0100 Date: Mon, 8 Feb 2021 17:08:17 +0100 From: Lutz Donnerhacke To: Mark Johnston Cc: Lutz Donnerhacke , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 45d75e3ac3fb - main - netgraph/ng_base: Allow larger BINARY2ASCII conversions Message-ID: <20210208160817.GA4953@belenus.iks-jena.de> References: <202102081335.118DZB5F024911@gitrepo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-message-flag: Please send plain text messages only. Thank you. User-Agent: Mutt/1.5.17 (2007-11-01) X-Rspamd-Queue-Id: 4DZ9tH28x3z4S9S X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] 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, 08 Feb 2021 16:08:23 -0000 On Mon, Feb 08, 2021 at 10:18:06AM -0500, Mark Johnston wrote: > On Mon, Feb 08, 2021 at 01:35:11PM +0000, Lutz Donnerhacke wrote: > > The branch main has been updated by donner: > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=45d75e3ac3fb5bf8230ca28dc09b48c6e5ed7a4f > > > > commit 45d75e3ac3fb5bf8230ca28dc09b48c6e5ed7a4f > > Author: Lutz Donnerhacke > > AuthorDate: 2021-02-07 21:07:34 +0000 > > Commit: Lutz Donnerhacke > > CommitDate: 2021-02-08 13:31:58 +0000 > > > > netgraph/ng_base: Allow larger BINARY2ASCII conversions > > > > Allocate the necessary memory for the conversion dynamically starting > > with a value which is sufficient for almost all normal cases. > > Is there some upper bound on the length of the input message? Yes. Quote from D23840: : Of course, to transmit the data via the ng_socket, the buffer sizes needs : to be adjusted manually. : net.graph.recvspace: 204800 : net.graph.maxdgram: 204800 : To transmit arbitary large data, it's better to change the ng_socket : interface (incl. libnetgraph), but that is out of scope of this issue : here. > If not, a sufficiently large input looks like it could cause an infinite > loop by triggering overflow in the bufSize *= 2 calculation. That's a valid point. Thank you. > I also wonder why the same change was not made for ASCII2BINARY. Because it's usually a compression. If you are able to send the ASCII message, the binary message is shorter and will match anyway. But to answer your question: It was not part of the PR, it's an nonissue.