Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp284306imm; Wed, 11 Jul 2018 02:20:28 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfIkyaZ0j/I3TEtWTENsRVbC4/TnwETTKXgPuduLl2qgOWA8b1LM77TBeNavQReVgRUjBBe X-Received: by 2002:a65:538e:: with SMTP id x14-v6mr19647621pgq.388.1531300828341; Wed, 11 Jul 2018 02:20:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531300828; cv=none; d=google.com; s=arc-20160816; b=R8nIUdSgTm75DPSypfCj+0itL9GLGR+c6EwXC3A/oeImjrf0iFObcWyoqfA81UyX0R njyKbsBehHdaz+RGa3NoWd/Kr46Uya9Uy99xVpKBpeGeBz5L94SFYSSQ3vFVz7CR+hx4 p8gVpPGHJKJQpR6vy2FxmlKe5ePFyYFpjwrYpBk5/5eigtm7tx3WS/YnHQxrbQ3e/oZR iymT1mjPuPedTnNayoJdYvhYPcnbDYV+etjGkLM9AnMzbw0zxCj4MLh5dAWKl33dEIy3 62wfharQkN0eSC0KwC20PxuivEqPNp2Ky5jEbzLo83Jlvwf1WHcbO/regf4ye1G0zqBS MZkw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=+CaBoJatQxt/Ao1bpO6/X4xvDtWl6N1GYnCUUG7oUU8=; b=BHEQGVbpo4fYVHJ3Oyj26fur7N3mU744mteTJBfNRB8GOUBePH8LPIyWnq41yz0uZ5 +q3hGLi77ozOyHft6C/JEpJp4kTJ6QCayIXUPOJwhMfrHzOJVZi8SqiAr5JeCqGGGh5d +TFfB6FmNxMS4mHJLYicAutUoU9NvcoJIsJ6/2ErI4pkfILF0ZJMYiZS+mkwYynAsDVW zRVah4lfgbHuegqzEl2cLYj9ysENfVfyxtPNe5ClwQrDFBSCTJ1TLnInbk3rhh3HImQ+ CqgicGF8Rh4CoQ43IA2/J5wo/zNQUdNYTSIUmuQ7ljLrKgaE1J4tyJ9Co1DThrgRjnAn IhhA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n72-v6si9690474pfk.14.2018.07.11.02.20.12; Wed, 11 Jul 2018 02:20:28 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732507AbeGKJWN (ORCPT + 99 others); Wed, 11 Jul 2018 05:22:13 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:54730 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726398AbeGKJWM (ORCPT ); Wed, 11 Jul 2018 05:22:12 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 21C97CCC; Wed, 11 Jul 2018 09:18:50 +0000 (UTC) Date: Wed, 11 Jul 2018 11:18:48 +0200 From: Greg Kroah-Hartman To: Kees Cook Cc: Nicolas Pitre , Dave Mielke , Samuel Thibault , Adam Borowski , Alan Cox , LKML , linux-console@vger.kernel.org Subject: Re: [PATCH v3 1/3] vt: preserve unicode values corresponding to screen characters Message-ID: <20180711091848.GA2889@kroah.com> References: <20180627035642.8561-1-nicolas.pitre@linaro.org> <20180627035642.8561-2-nicolas.pitre@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.0 (2018-05-17) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jul 10, 2018 at 05:52:01PM -0700, Kees Cook wrote: > On Tue, Jun 26, 2018 at 8:56 PM, Nicolas Pitre wrote: > > The vt code translates UTF-8 strings into glyph index values and stores > > those glyph values directly in the screen buffer. Because there can only > > be at most 512 glyphs, it is impossible to represent most unicode > > characters, in which case a default glyph (often '?') is displayed > > instead. The original unicode value is then lost. > > > > This patch implements the basic screen buffer handling to preserve unicode > > values alongside corresponding display glyphs. It is not activated by > > default, meaning that people not relying on that functionality won't get > > the implied overhead. > > > > Signed-off-by: Nicolas Pitre > > Tested-by: Dave Mielke > > Acked-by: Adam Borowski > > --- > > drivers/tty/vt/vt.c | 220 +++++++++++++++++++++++++++++++-- > > include/linux/console_struct.h | 2 + > > 2 files changed, 211 insertions(+), 11 deletions(-) > > > > diff --git a/drivers/tty/vt/vt.c b/drivers/tty/vt/vt.c > > index 1eb1a376a0..7b636638b3 100644 > > --- a/drivers/tty/vt/vt.c > > +++ b/drivers/tty/vt/vt.c > > [...] > > +static void vc_uniscr_scroll(struct vc_data *vc, unsigned int t, unsigned int b, > > + enum con_scroll dir, unsigned int nr) > > +{ > > + struct uni_screen *uniscr = get_vc_uniscr(vc); > > + > > + if (uniscr) { > > + unsigned int s, d, rescue, clear; > > + char32_t *save[nr]; > > Can you adjust this to avoid the VLA here? I've almost gotten all VLAs > removed from the kernel[1], and this is introducing a new one. :) This is already in my tree, sorry :( greg k-h