[PATCH] iconv: Accept redundant shift sequences in IBM1364 [BZ #26224]
authorArjun Shankar <arjun@redhat.com>
Wed, 4 Nov 2020 11:19:38 +0000 (12:19 +0100)
committerAdrian Bunk <bunk@debian.org>
Tue, 23 Apr 2024 16:23:00 +0000 (19:23 +0300)
commit778b9435303faeb52665d59b61a67f39c920adab
tree6974f2904c120c4752ae37af77fd36fc18f306ee
parent7bb2ec83d49211ffbf04a9db6bf84b58255e7ce6
[PATCH] iconv: Accept redundant shift sequences in IBM1364 [BZ #26224]

The IBM1364, IBM1371, IBM1388, IBM1390 and IBM1399 character sets
share converter logic (iconvdata/ibm1364.c) which would reject
redundant shift sequences when processing input in these character
sets.  This led to a hang in the iconv program (CVE-2020-27618).

This commit adjusts the converter to ignore redundant shift sequences
and adds test cases for iconv_prog hangs that would be triggered upon
their rejection.  This brings the implementation in line with other
converters that also ignore redundant shift sequences (e.g. IBM930
etc., fixed in commit 692de4b3960d).

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
Beware that in the Debian build, tst-iconv_prog.sh fails to pick up the built
IBM1364.so and tests the system one instead. As such, the test case will fail
on the initial build, but succeed on subsequent ones.

Gbp-Pq: Topic all
Gbp-Pq: Name git-CVE-2020-27618-iconv-Accept-redundant-shift-sequences-in-IBM1364-BZ.diff
iconv/tst-iconv_prog.sh
iconvdata/ibm1364.c