From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Lars Ingebrigtsen Newsgroups: gmane.emacs.bugs Subject: bug#19565: Emacs vulnerable to endless-data attack (minor) Date: Tue, 08 Oct 2019 18:27:15 +0200 Message-ID: <87zhibyzh8.fsf@gnus.org> References: <83a7ad3hlf.fsf@gnu.org> <874l0le314.fsf@gnus.org> <831rvo1qlk.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="254603"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: stefan@marxist.se, 19565@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Oct 08 18:28:13 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1iHsLM-00145W-7z for geb-bug-gnu-emacs@m.gmane.org; Tue, 08 Oct 2019 18:28:12 +0200 Original-Received: from localhost ([::1]:58294 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iHsLK-00069a-TY for geb-bug-gnu-emacs@m.gmane.org; Tue, 08 Oct 2019 12:28:10 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:41529) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iHsLD-00069M-LN for bug-gnu-emacs@gnu.org; Tue, 08 Oct 2019 12:28:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iHsLC-0005fs-Hn for bug-gnu-emacs@gnu.org; Tue, 08 Oct 2019 12:28:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:42502) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iHsLC-0005fe-EZ for bug-gnu-emacs@gnu.org; Tue, 08 Oct 2019 12:28:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1iHsLC-0006jD-9S for bug-gnu-emacs@gnu.org; Tue, 08 Oct 2019 12:28:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 08 Oct 2019 16:28:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 19565 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: security Original-Received: via spool by 19565-submit@debbugs.gnu.org id=B19565.157055204225813 (code B ref 19565); Tue, 08 Oct 2019 16:28:02 +0000 Original-Received: (at 19565) by debbugs.gnu.org; 8 Oct 2019 16:27:22 +0000 Original-Received: from localhost ([127.0.0.1]:51323 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iHsKY-0006iG-F3 for submit@debbugs.gnu.org; Tue, 08 Oct 2019 12:27:22 -0400 Original-Received: from quimby.gnus.org ([80.91.231.51]:39376) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iHsKW-0006i8-A4 for 19565@debbugs.gnu.org; Tue, 08 Oct 2019 12:27:21 -0400 Original-Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=marnie) by quimby.gnus.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1iHsKS-0007M0-7U; Tue, 08 Oct 2019 18:27:18 +0200 In-Reply-To: <831rvo1qlk.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 07 Oct 2019 19:13:11 +0300") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:168664 Archived-At: Eli Zaretskii writes: > I think this must be in terms of bytes/sec, not just bytes. E.g., I > have a spell-checker active during my entire Emacs session (which > could go on for weeks and months on end), and I don't want to get a > prompt just because the number of bytes that went in that pipe becomes > above the threshold. We may also need to measure the growth of the > Emacs memory footprint during that time, because if Emacs reads bytes > and discards them, it isn't going to be a problem, right? Yeah, that's true -- a counter wouldn't help at all here. Would checking the size of the `process-buffer' of the process be more helpful? It might be a somewhat unnatural thing to do -- Emacs doesn't give you a warning if you say (dotimes (i 100000000) (insert (make-string 80 ?a))) so perhaps that's not a good heuristic, either. So bytes/sec, as you suggest, may be the best heuristic. But it should only kick in after having received a large number of bytes, probably. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no