[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)
committerHelmut Grohne <helmut@subdivi.de>
Sat, 8 Oct 2022 15:53:16 +0000 (16:53 +0100)
commit467bf5b3269fae04c024192653bfb088dbb98389
treefe5320702e9cffa6ff9353743bf94bff74bbc0f6
parentb10ad6ad8c48965564a56a1a2810ac7c847cc97c
[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