From patchwork Tue Dec 16 10:28:05 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adolf Belka X-Patchwork-Id: 9380 Return-Path: Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519) (Client CN "mail01.haj.ipfire.org", Issuer "R12" (verified OK)) by web04.haj.ipfire.org (Postfix) with ESMTPS id 4dVtS9673kz3wpy for ; Tue, 16 Dec 2025 10:28:25 +0000 (UTC) Received: from mail02.haj.ipfire.org (mail02.haj.ipfire.org [IPv6:2001:678:b28::201]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519) (Client CN "mail02.haj.ipfire.org", Issuer "E8" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 4dVtS81XVdz6Lj for ; Tue, 16 Dec 2025 10:28:24 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [IPv6:::1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4dVtS46KrJz34GY for ; Tue, 16 Dec 2025 10:28:20 +0000 (UTC) X-Original-To: development@lists.ipfire.org Received: from mail01.ipfire.org (mail01.haj.ipfire.org [IPv6:2001:678:b28::25]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519) (Client CN "mail01.haj.ipfire.org", Issuer "R12" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 4dVtRz2y1Mz33CF for ; Tue, 16 Dec 2025 10:28:15 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail01.ipfire.org (Postfix) with ESMTPSA id 4dVtRx0D9Sz45Y; Tue, 16 Dec 2025 10:28:12 +0000 (UTC) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003ed25519; t=1765880893; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=cOaWUO0AEphYuUsbUdt7GUFO55C52bWYdPyRhFJ+1Q4=; b=gTb0Wt1zWZCEPY3KGcw8gjkp0nCZk0bnwS1n/pvco7yq7BfmxZg699TDS4bk/j6MBMRqec sqQGwwVu8i0AtmDg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003rsa; t=1765880893; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=cOaWUO0AEphYuUsbUdt7GUFO55C52bWYdPyRhFJ+1Q4=; b=eEYH+G2Ts+GefFFg85zX/YjE5fawK0kTyOxZZ1Rz7+8zOhFkk+5VUc5GS4mzcZAJ5ZVr9B KJQl9lLHoxfppSCFNwaAys8ZK2nL8LInxyocfNHal47FF1qgK7O6h4SmuOzuVMKGXYBjSF tBpeCGD1ucaGs5BB9uEmZFr9IkWvOxtExL4/Ep0NEN97nTTca+67vn20BmheLskdqg8YSB /C4xDoJyjfm+Mkpd9mH49E/63627u8cGSqa3vRttON4QR00AExQuNvqjykk/bkfww+R1AU or9FobIRMVouuMfPGX+Am4yjFw/jZ1tCKwUVvAjoLTg/uqWmesBQtlnMTJ5fsg== From: Adolf Belka To: development@lists.ipfire.org Cc: Adolf Belka Subject: [PATCH] readline: Update to version 8.3 patch 3 Date: Tue, 16 Dec 2025 11:28:05 +0100 Message-ID: <20251216102805.3606194-11-adolf.belka@ipfire.org> In-Reply-To: <20251216102805.3606194-1-adolf.belka@ipfire.org> References: <20251216102805.3606194-1-adolf.belka@ipfire.org> Precedence: list List-Id: List-Subscribe: , List-Unsubscribe: , List-Post: List-Help: Sender: Mail-Followup-To: MIME-Version: 1.0 - Update from version 8.3 patch 1 to 8.3 patch 3 - No change to rootfile - Changelog 8.3-003 A SIGINT during a reverse i-search can cause a segmentation fault due to accessing data freed by a signal handler. 8.3-002 If an application calls rl_save_prompt, which sets rl_prompt to NULL, without calling rl_set_prompt to set it to a new value, readline redisplay can dereference a NULL pointer. Signed-off-by: Adolf Belka --- lfs/readline | 4 +- src/patches/readline/readline83-002 | 44 ++++++++++++++++ src/patches/readline/readline83-003 | 78 +++++++++++++++++++++++++++++ 3 files changed, 124 insertions(+), 2 deletions(-) create mode 100644 src/patches/readline/readline83-002 create mode 100644 src/patches/readline/readline83-003 diff --git a/lfs/readline b/lfs/readline index 3546de678..57ecea815 100644 --- a/lfs/readline +++ b/lfs/readline @@ -25,8 +25,8 @@ include Config VER = 8.3 -PATCHVER = 1 -# https://ftp.gnu.org/gnu/readline/ +PATCHVER = 3 +# https://ftp.gnu.org/gnu/readline/ THISAPP = readline-$(VER) DL_FILE = $(THISAPP).tar.gz diff --git a/src/patches/readline/readline83-002 b/src/patches/readline/readline83-002 new file mode 100644 index 000000000..356318de3 --- /dev/null +++ b/src/patches/readline/readline83-002 @@ -0,0 +1,44 @@ + READLINE PATCH REPORT + ===================== + +Readline-Release: 8.3 +Patch-ID: readline83-002 + +Bug-Reported-by: Tobias Powalowski +Bug-Reference-ID: <6465ed69-d2da-4277-92cf-1046bc97ca60@pm.me> +Bug-Reference-URL: https://lists.gnu.org/archive/html/bug-readline/2025-07/msg00005.html + +Bug-Description: + +If an application calls rl_save_prompt, which sets rl_prompt to NULL, +without calling rl_set_prompt to set it to a new value, readline redisplay +can dereference a NULL pointer. + +Patch (apply with `patch -p0'): + +*** ../readline-8.3/display.c Fri May 2 09:20:32 2025 +--- display.c Sun Jul 6 17:16:28 2025 +*************** +*** 784,788 **** + /* Useful shorthand used by rl_redisplay, update_line, rl_move_cursor_relative */ + #define INVIS_FIRST() (local_prompt_invis_chars[0]) +! #define WRAP_OFFSET(line, offset) ((line <= prompt_last_screen_line) ? local_prompt_invis_chars[line] : 0) + + #define W_OFFSET(line, offset) ((line) == 0 ? offset : 0) +--- 784,788 ---- + /* Useful shorthand used by rl_redisplay, update_line, rl_move_cursor_relative */ + #define INVIS_FIRST() (local_prompt_invis_chars[0]) +! #define WRAP_OFFSET(line, offset) ((line <= prompt_last_screen_line && local_prompt_invis_chars) ? local_prompt_invis_chars[line] : 0) + + #define W_OFFSET(line, offset) ((line) == 0 ? offset : 0) +*** ../readline-8.2/patchlevel 2013-11-15 08:11:11.000000000 -0500 +--- patchlevel 2014-03-21 08:28:40.000000000 -0400 +*************** +*** 1,3 **** + # Do not edit -- exists only for use by patch + +! 1 +--- 1,3 ---- + # Do not edit -- exists only for use by patch + +! 2 diff --git a/src/patches/readline/readline83-003 b/src/patches/readline/readline83-003 new file mode 100644 index 000000000..dd7fe4f19 --- /dev/null +++ b/src/patches/readline/readline83-003 @@ -0,0 +1,78 @@ + READLINE PATCH REPORT + ===================== + +Readline-Release: 8.3 +Patch-ID: readline83-003 + +Bug-Reported-by: penguin p +Bug-Reference-ID: +Bug-Reference-URL: https://lists.gnu.org/archive/html/bug-bash/2025-08/msg00080.html + +Bug-Description: + +A SIGINT during a reverse i-search can cause a segmentation fault due to +accessing data freed by a signal handler. + +Patch (apply with `patch -p0'): + +*** ../readline-8.3-patched/input.c Tue Jul 8 15:37:13 2025 +--- input.c Fri Aug 22 15:04:05 2025 +*************** +*** 976,984 **** + if (rl_signal_event_hook) + (*rl_signal_event_hook) (); +! #if defined (READLINE_CALLBACKS) +! else if (osig == SIGINT && (ostate & RL_STATE_CALLBACK) && (ostate & (RL_STATE_ISEARCH|RL_STATE_NSEARCH|RL_STATE_NUMERICARG))) + /* just these cases for now */ + _rl_abort_internal (); +- #endif + } + } +--- 1004,1012 ---- + if (rl_signal_event_hook) + (*rl_signal_event_hook) (); +! /* If the application's SIGINT handler returns, make sure we abort out of +! searches and numeric arguments because we've freed necessary state. */ +! if (osig == SIGINT && (ostate & (RL_STATE_ISEARCH|RL_STATE_NSEARCH|RL_STATE_NUMERICARG))) + /* just these cases for now */ + _rl_abort_internal (); + } + } +*** ../readline-8.3-patched/isearch.c Thu Jun 5 09:22:11 2025 +--- isearch.c Tue Aug 19 14:55:55 2025 +*************** +*** 890,899 **** + _rl_isearch_cleanup (_rl_search_cxt *cxt, int r) + { + if (r >= 0) + _rl_isearch_fini (cxt); + _rl_scxt_dispose (cxt, 0); +- _rl_iscxt = 0; +- +- RL_UNSETSTATE(RL_STATE_ISEARCH); + + return (r != 0); +--- 890,901 ---- + _rl_isearch_cleanup (_rl_search_cxt *cxt, int r) + { ++ RL_UNSETSTATE(RL_STATE_ISEARCH); ++ if (cxt == 0) ++ return (r != 0); ++ ++ _rl_iscxt = 0; + if (r >= 0) + _rl_isearch_fini (cxt); + _rl_scxt_dispose (cxt, 0); + + return (r != 0); +*** ../readline-8.3/patchlevel 2013-11-15 08:11:11.000000000 -0500 +--- patchlevel 2024-03-21 08:28:40.000000000 -0400 +*************** +*** 1,3 **** + # Do not edit -- exists only for use by patch + +! 2 +--- 1,3 ---- + # Do not edit -- exists only for use by patch + +! 3