GNU bug report logs - #75924
maint: fix s390 buffer flushes

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: gzip; Reported by: Eduard Stefes <eduard.stefes@HIDDEN>; merged with #74651, #75911; dated Wed, 29 Jan 2025 14:20:02 UTC; Maintainer for gzip is bug-gzip@HIDDEN.
Merged 74651 75911 75924. Request was from Paul Eggert <eggert@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

Message received at 75924 <at> debbugs.gnu.org:


Received: (at 75924) by debbugs.gnu.org; 29 Jan 2025 18:59:11 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Jan 29 13:59:11 2025
Received: from localhost ([127.0.0.1]:43041 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1tdDHK-00054R-Vz
	for submit <at> debbugs.gnu.org; Wed, 29 Jan 2025 13:59:11 -0500
Received: from mail.cs.ucla.edu ([131.179.128.66]:44638)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <eggert@HIDDEN>)
 id 1tdDHI-00053u-7a
 for 75924 <at> debbugs.gnu.org; Wed, 29 Jan 2025 13:59:09 -0500
Received: from localhost (localhost [127.0.0.1])
 by mail.cs.ucla.edu (Postfix) with ESMTP id 6990A3C01409D;
 Wed, 29 Jan 2025 10:59:01 -0800 (PST)
Received: from mail.cs.ucla.edu ([127.0.0.1])
 by localhost (mail.cs.ucla.edu [127.0.0.1]) (amavis, port 10032) with ESMTP
 id 5fYUfPa14gy5; Wed, 29 Jan 2025 10:59:00 -0800 (PST)
Received: from localhost (localhost [127.0.0.1])
 by mail.cs.ucla.edu (Postfix) with ESMTP id C7DCE3C00E40A;
 Wed, 29 Jan 2025 10:59:00 -0800 (PST)
DKIM-Filter: OpenDKIM Filter v2.10.3 mail.cs.ucla.edu C7DCE3C00E40A
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cs.ucla.edu;
 s=9D0B346E-2AEB-11ED-9476-E14B719DCE6C; t=1738177140;
 bh=30Dl/QGs+9KAOCzXlbldg6eJWBmdcIeDeFyansz3W68=;
 h=Message-ID:Date:MIME-Version:To:From;
 b=Kse4k9sgeTD6Hp1htFjIUwSjeAh2nKTRqvYkk+oximREIy8mJwtc5lqtyIE9GmoeO
 d5qJA7QgjHhCqEHBTvKHOnXBf7vM4hgFN94aRWYrP+1wmZKz1nRZ4NCJj04xpcuH3x
 w3+MtfK7WcN6qbbBbn3kBdAAg2YUiqTgdZ8ge/edt1MXPo2ae+a5oFl7OHaiTcXdGd
 XnXVLYTsb8Sm2Z0MdyIoMrQZYTUfxxgYQirVIwGk/I+oNL8NvI/fvg+M6py7CxRn/A
 esNRvasAWDrhN3KW01AOh18hWE9JQ+uoMKMSVwd/PXHqTQw/Jznqbb5xHVD7TT2b4S
 z3qIgWH3oRIew==
X-Virus-Scanned: amavis at mail.cs.ucla.edu
Received: from mail.cs.ucla.edu ([127.0.0.1])
 by localhost (mail.cs.ucla.edu [127.0.0.1]) (amavis, port 10026) with ESMTP
 id NAa-8441Z6Cw; Wed, 29 Jan 2025 10:59:00 -0800 (PST)
Received: from [192.168.254.12] (unknown [47.154.28.214])
 by mail.cs.ucla.edu (Postfix) with ESMTPSA id A7FFB3C01409D;
 Wed, 29 Jan 2025 10:59:00 -0800 (PST)
Content-Type: multipart/mixed; boundary="------------5LqlOc0V6pAowN6PHGzA9t0E"
Message-ID: <45df1f77-1deb-46ae-9dbf-446bf192d9e9@HIDDEN>
Date: Wed, 29 Jan 2025 10:58:59 -0800
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: bug#75924: maint: fix s390 buffer flushes
To: Eduard Stefes <eduard.stefes@HIDDEN>
References: <5a8f263c4687100fceef43bf6a06a0b840af5180.camel@HIDDEN>
 <20250129141836.69050-1-eduard.stefes@HIDDEN>
Content-Language: en-US
From: Paul Eggert <eggert@HIDDEN>
Organization: UCLA Computer Science Department
In-Reply-To: <20250129141836.69050-1-eduard.stefes@HIDDEN>
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 75924
Cc: 75924 <at> debbugs.gnu.org, Ilya Leoshkevich <iii@HIDDEN>,
 Andreas Hasenack <andreas.hasenack@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

This is a multi-part message in MIME format.
--------------5LqlOc0V6pAowN6PHGzA9t0E
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Thanks for the bug report. I installed the attached, a bit simpler than 
the patch you suggested; can you please give it a try?

Also, is there a related bug near dfltcc.c line 375? That is, when 
(inptr == insize && fill_inbuf (1) == EOF && param->cf), won't insize 
then be zero, so that gzip will go into an infinite loop attempting to 
read past EOF?
--------------5LqlOc0V6pAowN6PHGzA9t0E
Content-Type: text/x-patch; charset=UTF-8;
 name="0001-gzip-fix-problem-with-s390-buffer-flushes.patch"
Content-Disposition: attachment;
 filename="0001-gzip-fix-problem-with-s390-buffer-flushes.patch"
Content-Transfer-Encoding: base64

RnJvbSA1MTA4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ZXBvcnRzIGxlbmd0aHMgb2Yg
bXVsdGltZW1iZXIgaW5wdXRzLgogICBbYnVnIGludHJvZHVjZWQgaW4gZ3ppcC0xLjEyXQog
CmRpZmYgLS1naXQgYS9kZmx0Y2MuYyBiL2RmbHRjYy5jCmluZGV4IGZjZGMwNWEuLmM5N2Ux
OWUgMTAwNjQ0Ci0tLSBhL2RmbHRjYy5jCisrKyBiL2RmbHRjYy5jCkBAIC00MzQsMTEgKzQz
NCw3IEBAIGRmbHRjY19pbmZsYXRlICgpCiAgICAgICAgIGZsdXNoX291dGJ1ZiAoKTsKICAg
ICAgIGlmIChpbnB0ciA9PSBpbnNpemUpCiAgICAgICAgIHsKLSAgICAgICAgICBpZiAoZmls
bF9pbmJ1ZiAoMSkgPT0gRU9GKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAvKiBQ
cmVtYXR1cmUgRU9GLiAgKi8KLSAgICAgICAgICAgICAgcmV0dXJuIDI7Ci0gICAgICAgICAg
ICB9CisgICAgICAgICAgZmlsbF9pbmJ1ZiAoMCk7CiAgICAgICAgICAgaW5wdHIgPSAwOwog
ICAgICAgICB9CiAKLS0gCjIuNDUuMgoK

--------------5LqlOc0V6pAowN6PHGzA9t0E--




Information forwarded to bug-gzip@HIDDEN:
bug#75924; Package gzip. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 29 Jan 2025 14:19:03 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Jan 29 09:19:03 2025
Received: from localhost ([127.0.0.1]:40436 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1td8uB-0004p7-4o
	for submit <at> debbugs.gnu.org; Wed, 29 Jan 2025 09:19:03 -0500
Received: from lists.gnu.org ([2001:470:142::17]:56126)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <eduard.stefes@HIDDEN>)
 id 1td8u8-0004ot-Hw
 for submit <at> debbugs.gnu.org; Wed, 29 Jan 2025 09:18:57 -0500
Received: from eggs.gnu.org ([2001:470:142:3::10])
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eduard.stefes@HIDDEN>)
 id 1td8tz-00045j-Kn
 for bug-gzip@HIDDEN; Wed, 29 Jan 2025 09:18:48 -0500
Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eduard.stefes@HIDDEN>)
 id 1td8tx-00061S-PB
 for bug-gzip@HIDDEN; Wed, 29 Jan 2025 09:18:47 -0500
Received: from pps.filterd (m0353729.ppops.net [127.0.0.1])
 by mx0a-001b2d01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 50T5Nx0Q013583;
 Wed, 29 Jan 2025 14:18:41 GMT
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=cc
 :content-transfer-encoding:date:from:in-reply-to:message-id
 :mime-version:references:subject:to; s=pp1; bh=N25n+PSGsyHAH0s+t
 wvSbgEfcsPgnq+b4F3TOWBG+Q4=; b=qTQPk/eVHUuyinD5ImdrnQCwi9WjnBge5
 mXASPeIKKO2hV4tceGj1A+YFVGUjjLusfBLTtVJYi2EDfVjbJgRYhCpyCmiiIqrL
 hjZtPW86USsYeZ2qIi70nypEH/7OYa/KwuX/EkMz3v0HklHg80mEDTD10Z5gcJhw
 kjhrqejsqU57ylO76jNZCSiT3VQw2vuzMrR+HQCqdVkCBK8VHkN57yVAU458drvK
 5gffgfWCpiw9U2HYsRQ2yrCgDV8n2Hr8Xfp0IF347Y55Ovet69GaARQ1Y1umdzT3
 4asTtdr7G9RMyt3JrmScOF8cyaWjRtJsy45m2yDZZYq0Ug/TVWTDg==
Received: from ppma22.wdc07v.mail.ibm.com
 (5c.69.3da9.ip4.static.sl-reverse.com [169.61.105.92])
 by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 44fe58aand-1
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT);
 Wed, 29 Jan 2025 14:18:41 +0000 (GMT)
Received: from pps.filterd (ppma22.wdc07v.mail.ibm.com [127.0.0.1])
 by ppma22.wdc07v.mail.ibm.com (8.18.1.2/8.18.1.2) with ESMTP id 50TCke8T012351;
 Wed, 29 Jan 2025 14:18:40 GMT
Received: from smtprelay01.fra02v.mail.ibm.com ([9.218.2.227])
 by ppma22.wdc07v.mail.ibm.com (PPS) with ESMTPS id 44dany94su-1
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT);
 Wed, 29 Jan 2025 14:18:40 +0000
Received: from smtpav01.fra02v.mail.ibm.com (smtpav01.fra02v.mail.ibm.com
 [10.20.54.100])
 by smtprelay01.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id
 50TEIcsF50987512
 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK);
 Wed, 29 Jan 2025 14:18:38 GMT
Received: from smtpav01.fra02v.mail.ibm.com (unknown [127.0.0.1])
 by IMSVA (Postfix) with ESMTP id 6A7102008C;
 Wed, 29 Jan 2025 14:18:38 +0000 (GMT)
Received: from smtpav01.fra02v.mail.ibm.com (unknown [127.0.0.1])
 by IMSVA (Postfix) with ESMTP id 232072008A;
 Wed, 29 Jan 2025 14:18:38 +0000 (GMT)
Received: from li-c118b070-7b37-438b-956b-2188fa4197f0.ibm.com.com (unknown
 [9.171.34.19]) by smtpav01.fra02v.mail.ibm.com (Postfix) with ESMTP;
 Wed, 29 Jan 2025 14:18:38 +0000 (GMT)
From: Eduard Stefes <eduard.stefes@HIDDEN>
To: bug-gzip <bug-gzip@HIDDEN>
Subject: maint: fix s390 buffer flushes
Date: Wed, 29 Jan 2025 15:18:36 +0100
Message-ID: <20250129141836.69050-1-eduard.stefes@HIDDEN>
X-Mailer: git-send-email 2.48.1
In-Reply-To: <5a8f263c4687100fceef43bf6a06a0b840af5180.camel@HIDDEN>
References: <5a8f263c4687100fceef43bf6a06a0b840af5180.camel@HIDDEN>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-TM-AS-GCONF: 00
X-Proofpoint-GUID: nVTOSvgUUzXhiTVxv77WsY2-cut4Glvf
X-Proofpoint-ORIG-GUID: nVTOSvgUUzXhiTVxv77WsY2-cut4Glvf
X-Proofpoint-Virus-Version: vendor=baseguard
 engine=ICAP:2.0.293,Aquarius:18.0.1057,Hydra:6.0.680,FMLib:17.12.68.34
 definitions=2025-01-29_02,2025-01-29_01,2024-11-22_01
X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0
 clxscore=1015 spamscore=0
 lowpriorityscore=0 mlxlogscore=304 bulkscore=0 impostorscore=0
 priorityscore=1501 mlxscore=0 adultscore=0 malwarescore=0 suspectscore=0
 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1
 engine=8.19.0-2411120000 definitions=main-2501290113
Received-SPF: pass client-ip=148.163.156.1; envelope-from=eduard.stefes@HIDDEN;
 helo=mx0a-001b2d01.pphosted.com
X-Spam_score_int: -27
X-Spam_score: -2.8
X-Spam_bar: --
X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
 DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,
 RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=0.001,
 RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001,
 SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: submit
Cc: Andreas Hasenack <andreas.hasenack@HIDDEN>,
 Eduard Stefes <eduard.stefes@HIDDEN>, Ilya Leoshkevich <iii@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Problem reported by Nick Rosbrook in:
https://bugs.launchpad.net/ubuntu/+source/rsyslog/+bug/2083700

align the behavior of dfltcc_inflate to do the same as gzip_inflate
when it hits a premature EOF
---
 dfltcc.c    | 6 +++++-
 tests/hufts | 6 ++++--
 2 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/dfltcc.c b/dfltcc.c
index 811c1f8..5d421bb 100644
--- a/dfltcc.c
+++ b/dfltcc.c
@@ -18,6 +18,7 @@
 #include <config.h>
 
 #include <stdlib.h>
+#include <errno.h>
 
 #ifdef HAVE_SYS_SDT_H
 # include <sys/sdt.h>
@@ -437,7 +438,10 @@ dfltcc_inflate ()
           if (fill_inbuf (1) == EOF)
             {
               /* Premature EOF.  */
-              return 2;
+              flush_outbuf ();
+              errno = 0;
+              read_error ();
+              __builtin_unreachable ();
             }
           inptr = 0;
         }
diff --git a/tests/hufts b/tests/hufts
index c464ef6..6dbb8ac 100755
--- a/tests/hufts
+++ b/tests/hufts
@@ -40,10 +40,12 @@ compare exp err || fail=1
 
 printf '\037\213\010\000\060\060\060\060\060\060\144\000\000\000' > bug33501 \
   || framework_failure_
-printf '\ngzip: stdin: invalid compressed data--format violated\n' >exp33501 \
+printf '\ngzip: stdin: invalid compressed data--format violated\n' > exp33501.1 \
+  || framework_failure_
+printf '\ngzip: stdin: unexpected end of file\n' > exp33501.2 \
   || framework_failure_
 returns_ 1 gzip -d <bug33501 >out33501 2> err33501-raw || fail=1
 sed "$clean_stderr" err33501-raw > err33501 || framework_failure_
-compare exp33501 err33501 || fail=1
+compare exp33501.1 err33501 || compare exp33501.2 err33501 || fail=1
 
 Exit $fail
-- 
2.48.1





Acknowledgement sent to Eduard Stefes <eduard.stefes@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gzip@HIDDEN. Full text available.
Report forwarded to bug-gzip@HIDDEN:
bug#75924; Package gzip. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Wed, 29 Jan 2025 19:15:01 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.