[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>
Sat, 29 Jun 2024 10:27:34 +0000 (13:27 +0300)
commit1655713bef79c5ac88d782eb2a11bdf4e0d8eb7d
tree8156188a2f6052550cc5714dbcd5b76b8e2a6948
parent43a489e08b08d198195b57bf20a6b49a636a394e
[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