From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#56108: 29.0.50; ASAN use-after-free in re_match_2_internal Date: Wed, 22 Jun 2022 19:19:52 +0300 Message-ID: <83sfnwisbb.fsf@gnu.org> References: <83mte7kv7c.fsf@gnu.org> <32e548cc-ffd3-4669-ad9a-317c130b0c93@Spark> <83a6a4kec0.fsf@gnu.org> <6e56407a-b564-4aa9-b74c-78883727ef09@Spark> <831qvgkc8d.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="840"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 56108@debbugs.gnu.org To: Gerd =?UTF-8?Q?M=C3=B6llmann?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Jun 22 18:22:15 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1o437P-000AZX-Hd for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 22 Jun 2022 18:22:15 +0200 Original-Received: from localhost ([::1]:44870 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o437O-00067a-Ew for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 22 Jun 2022 12:22:14 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:59376) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o436E-00059Q-U1 for bug-gnu-emacs@gnu.org; Wed, 22 Jun 2022 12:21:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:42549) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o436E-0007Uy-Lf for bug-gnu-emacs@gnu.org; Wed, 22 Jun 2022 12:21:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1o436E-0005hW-ES for bug-gnu-emacs@gnu.org; Wed, 22 Jun 2022 12:21:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 22 Jun 2022 16:21:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 56108 X-GNU-PR-Package: emacs Original-Received: via spool by 56108-submit@debbugs.gnu.org id=B56108.165591480921827 (code B ref 56108); Wed, 22 Jun 2022 16:21:02 +0000 Original-Received: (at 56108) by debbugs.gnu.org; 22 Jun 2022 16:20:09 +0000 Original-Received: from localhost ([127.0.0.1]:36446 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o435M-0005fy-Pu for submit@debbugs.gnu.org; Wed, 22 Jun 2022 12:20:09 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:45932) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o435L-0005fY-Ct for 56108@debbugs.gnu.org; Wed, 22 Jun 2022 12:20:07 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:45982) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o435G-00073q-4O; Wed, 22 Jun 2022 12:20:02 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=g7QIxwlyyI/etQF5HRU0FsDHKHw2umpXlWXuioADZ/s=; b=abF/ZqH0ayhqXOgVvnWL 0G46sSafLnQQu01ZkGhfFcS2V9PKH5tUOHGnAIWL8BsUHf/OcnZLdPeZCHPxCcx400XcKPSzMdqZW HPILqOBpCVf/kA4YEKr2hc1HOHokG28y8pZeivM0ElfH/frMtubuY2MViviG4HF5ZyXwmb3yjHNuw bOLCVbeNj1Yinbt6Ns/N3xjyQd/9Kv2yseLRZUBlzGjrbZ3HvCRCnSgKdx/voWfB7OaL8sjGpbbgP ClIqz7gJ+X/agwNLMAaVUUBXZsao8/9p/F5a6WWtlz13gEawY3EfkhjhOFfAo8IDHVZ+CI6mvTcIR rrBp20BtiMXOCA==; Original-Received: from [87.69.77.57] (port=4688 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o435F-0000vW-JY; Wed, 22 Jun 2022 12:20:01 -0400 In-Reply-To: (message from Gerd =?UTF-8?Q?M=C3=B6llmann?= on Wed, 22 Jun 2022 17:11:55 +0200) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:235040 Archived-At: > Date: Wed, 22 Jun 2022 17:11:55 +0200 > From: Gerd Möllmann > Cc: 56108@debbugs.gnu.org > > Maybe I have something. Could you please check? > > Please read the following list from the bottom up, i.e. re_match... calls maybe_quit etc. > > maybe_gc > Ffuncall > call2 > signal_or_quit (eval.c:1741) > quit (eval.c:1697) > process_quit_flag (eval.c:1657) > probably_quit (eval.c:1864) > maybe_quit (lisp.h:3681) > re_match_2_internal (regexp-emacs.c:4691) > > If this is true a GC can be triggered under very specific circumstances involving edebug, if the comment in > signal_or_quit is right. > > And I might have used edebug, I'm not 100% sure anymore. Sounds plausible. signal-hook-function should be non-nil to trigger the call2 call inside signal_or_quit. In addition to Edebug, Tramp also sets that. So yes, it could happen, with some "luck". I think the next step is to add the missing freeze_pattern calls and see if that fixes the problem?