From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on sa.local.altlinux.org X-Spam-Level: X-Spam-Status: No, score=-1.6 required=5.0 tests=BAYES_00, DNS_FROM_AHBL_RHSBL, RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Date: Mon, 21 Mar 2016 10:41:52 +0100 From: Hanno =?UTF-8?B?QsO2Y2s=?= To: kbd@lists.altlinux.org Message-ID: <20160321104152.654b0d38@pc1> X-Mailer: Claws Mail 3.13.2 (GTK+ 2.24.29; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="=_zucker.schokokeks.org-9813-1458553303-0001-2" Subject: [kbd] Invalid out of bounds memory read when running make check X-BeenThere: kbd@lists.altlinux.org X-Mailman-Version: 2.1.12 Precedence: list Reply-To: Linux console tools development discussion List-Id: Linux console tools development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Mar 2016 09:41:49 -0000 Archived-At: List-Archive: This is a MIME-formatted message. If you see this text it means that your E-mail software does not support MIME-formatted messages. --=_zucker.schokokeks.org-9813-1458553303-0001-2 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hi, When compiling kbd (latest version 2.0.3) with address sanitizer and running the test suite (make check) it will show a global out of bounds memory read. I have attached the address sanitizer error message at the end of this mail. I have not fully tracked down the bug, but the error happens in the file ksyms.c in line 203. The test that's causing this can be manually run with ./libkeymap-dumpkeys ./dumpkeys.ua-ws.map SEPARATE_LINE FALSE in the tests dir. This line from dumpkeys.ua-ws.map causes it: altgr keycode 3 =3D 157 To reproduce: ./configure CFLAGS=3D"-fsanitize=3Daddress -g" LDFLAGS=3D"-fsanitize=3Daddr= ess" make make check Here's the full asan error: =3D=3D19183=3D=3DERROR: AddressSanitizer: global-buffer-overflow on address= 0x0000006473d8 at pc 0x417ce5 bp 0x7ffc88302d70 sp 0x7ffc88302d60 READ of size 8 at 0x0000006473d8 thread T0 #0 0x417ce4 in codetoksym /mnt/ram/kbd/src/libkeymap/ksyms.c:203 #1 0x418e82 in convert_code /mnt/ram/kbd/src/libkeymap/ksyms.c:415 #2 0x40bc3f in yyparse /mnt/ram/kbd/src/libkeymap/parser.y:396 #3 0x40ce98 in lk_parse_keymap /mnt/ram/kbd/src/libkeymap/parser.y:421 #4 0x402167 in main /mnt/ram/kbd/tests/libkeymap-dumpkeys.c:32 #5 0x7f9a0f87b62f in __libc_start_main (/lib64/libc.so.6+0x2062f) #6 0x401db8 in _start (/mnt/ram/kbd/tests/libkeymap-dumpkeys+0x401db8) 0x0000006473d8 is located 24 bytes to the right of global variable 'koi8_sy= ms' from 'ksyms.c' (0x646bc0) of size 2048 0x0000006473d8 is located 40 bytes to the left of global variable 'latin1_s= yms' from 'ksyms.c' (0x647400) of size 1536 SUMMARY: AddressSanitizer: global-buffer-overflow /mnt/ram/kbd/src/libkeyma= p/ksyms.c:203 codetoksym Shadow bytes around the buggy address: 0x0000800c0e20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0000800c0e30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0000800c0e40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0000800c0e50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0000800c0e60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 =3D>0x0000800c0e70: 00 00 00 00 00 00 00 00 f9 f9 f9[f9]00 00 00 00 0x0000800c0e80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0000800c0e90: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0000800c0ea0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0000800c0eb0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0000800c0ec0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 Shadow byte legend (one shadow byte represents 8 application bytes): Addressable: 00 Partially addressable: 01 02 03 04 05 06 07=20 Heap left redzone: fa Heap right redzone: fb Freed heap region: fd Stack left redzone: f1 Stack mid redzone: f2 Stack right redzone: f3 Stack partial redzone: f4 Stack after return: f5 Stack use after scope: f8 Global redzone: f9 Global init order: f6 Poisoned by user: f7 Contiguous container OOB:fc ASan internal: fe =3D=3D19183=3D=3DABORTING --=20 Hanno B=C3=B6ck https://hboeck.de/ mail/jabber: hanno@hboeck.de GPG: BBB51E42 --=_zucker.schokokeks.org-9813-1458553303-0001-2 Content-Type: application/pgp-signature Content-Transfer-Encoding: 7bit Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCgAGBQJW78HgAAoJEKWIAHK7tR5C/LsP/1DWvC5WQymxlPtM9V6Smsz5 hF7h54CH9TN+ZOqEEFDdg6DQhUd57tpX6ITP1HhaQMWtN4TpnnWGs/kWOu+bH7/G HhJIsTtPGMoSPq9zy+EXidbJxBpyYws52N5xvcebSgBQZPcfNzTA8ZLhRnW0h0pp cuOhnwn4oZJtEAlV9juu2Jx+4k/omTclJFp80xEd6It0D0PVFRGMV/lGWnxEMlYH vsWFvH2BfDu5RULypeDBXZX/LUHdWuz6e10QQvUomXhuiXPdRLbcay2qqWWqhWVc Wq1ELUa5IY6cIlbIREBXxMDavFH3mA5TY7ZgsnShNR3aDFbiOfHOKOuykpli/u0n QR50WsEAi65SqkOH52T1usvKIa+1y+CtxHwKfWh9vtOnUo6dhyA3rs+JCxUiyMc1 uvByr7ZOS4jHSaS3HuCNTxMSy0h4iOJ607kNp9+NnZILjUaNcdl5mYtU92Hqm97b T9deNSmf/Ni9QRIjbfwVZIHGEkSHTeS7abi0NVk619Atx4+n+DWtXfelvRgQREPW k+nD0EWRnon0D8izuiCwAc1PbJT/OwFcjwxYzshy0wWiVmCG9QvQImKBSBpeuf2E r/HEPYL52MW1mqGnFdJRt6aCXAa3aUIvXJJOyfME5/g3l7MmPOlEYHVSlovoLDMX 5TjAqhWl3zmqQvp9M4Kb =Iifq -----END PGP SIGNATURE----- --=_zucker.schokokeks.org-9813-1458553303-0001-2--