From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51801) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gNEnW-0002mc-H3 for qemu-devel@nongnu.org; Thu, 15 Nov 2018 05:22:55 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gNEnV-0004vX-He for qemu-devel@nongnu.org; Thu, 15 Nov 2018 05:22:54 -0500 Received: from mail-io1-xd32.google.com ([2607:f8b0:4864:20::d32]:43604) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gNEnV-0004v9-BF for qemu-devel@nongnu.org; Thu, 15 Nov 2018 05:22:53 -0500 Received: by mail-io1-xd32.google.com with SMTP id t81-v6so14041634iod.10 for ; Thu, 15 Nov 2018 02:22:53 -0800 (PST) MIME-Version: 1.0 References: <1542272663-6619-1-git-send-email-liq3ea@gmail.com> <20181115101513.r4vz4p5gwduhwp4n@sirius.home.kraxel.org> In-Reply-To: <20181115101513.r4vz4p5gwduhwp4n@sirius.home.kraxel.org> From: Li Qiang Date: Thu, 15 Nov 2018 18:22:15 +0800 Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH] keymaps: detect recursive keyboard layout file List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Gerd Hoffmann Cc: Qemu Developers Gerd Hoffmann =E4=BA=8E2018=E5=B9=B411=E6=9C=8815=E6=97= =A5=E5=91=A8=E5=9B=9B =E4=B8=8B=E5=8D=886:15=E5=86=99=E9=81=93=EF=BC=9A > On Thu, Nov 15, 2018 at 01:04:23AM -0800, Li Qiang wrote: > > When the parse_keyboard_layout() find a "include " line > > in the keyboard layout file, it will call parse_keyboard_layout() > > to perform a recursive parse. If the keyboard layout is malformed > > by adding a line include itself, this can cause an infinite parse. > > Thus cause qemu a segv. This patch avoid this. > > Hmm. Most keymap files are generated by qemu-keymap these days and do > not use includes in the first place. Three are left over: nl-be, sl, > sv. > > Looking at them it seems like nl-be is not functional, it just includes > "common" and doesn't define any mappings. For sl and sv I have no clue > what keymap they represent. > > So I'd suggest to just remove support for "include", drop the nl-be map, > fix the sl and sv maps that they don't need "include" any more. Either > just replace the "include" statement with the content of the "common" > file. Or, if someone has a clue what keyboard layout these keymaps are > for, add rules to the Makefile and update them using then using > qemu-keymap. > Hello Gerd, Thanks for your advice. Here my consideration is for the '-k' option can specific any file. Though it seems too radical, I consider every input can't be trusted. Anyway, it's ok you ingore this patch. Thanks, Li Qiang > > cheers, > Gerd > >