Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1200936imm; Wed, 11 Jul 2018 20:00:26 -0700 (PDT) X-Google-Smtp-Source: AAOMgpetpF+ckaxjsA+HewO+a0x/1z7veIYbdqJPyJRmVpevTQfWDvz/SjGHl+hTkWNh9Wt/ihQM X-Received: by 2002:a63:3444:: with SMTP id b65-v6mr424442pga.396.1531364426279; Wed, 11 Jul 2018 20:00:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531364426; cv=none; d=google.com; s=arc-20160816; b=GC0Dk1WIRT9Awa5zVFj09AOChcvlpOwkrKfMy7gRVBDhQFI1L86yoYey+uUhEtZdBp +Xbe99rwuYGL3787wdBpRXMezcPJUE1a3hPxD9Lnh0Ry4aVngWkqVifTUvBXet0Cp41P uWz2ksToLnvU5pATE5etOuhJIfyUT86kBOEiO1l8RxIOqHOy56VG+suZuKIpThcWm5Gf QU3N7ifhZU7k0IuLNlA8gIOmEbxgGI9wAywtfCi8iqHIkluVTdYhQAV6CCCyunhCnITX 43uAx5u8/p2ZCNZSkoDOvpCSpd9hxxB4lnnPJqNX6qUx3g6u32VGrVyl7mukWRk914Mi hVnQ== 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=L9+VAw8ze15DE+6YCMB5qOR9nlvUOkp1eS40Wl/9Yts=; b=ftSbjwDcFAvgbwsgp5iDDb/lyJX+AxHpTUllGPHvV7DvjorInYVmy+ye/VZfp6HcKq aEyuqK1jmmeQWqZnG1Y1Y0BtxJRrrOGYi3gVaOR4F5cGhTLs9ikEMf9VvXAioawXSRJa /kP9V6H2+vSfQDSAZ1zibP/PCe+LZiKqgdQSXqowjG/d3YW/n19OhXe1nWOpvAv6YdHc MWp0w9ijRlb454R3t87esD/J+FyxtMtfMossoAipC8svzsgduKtNTh6a3mwbBaSWJGTw /i/WeyWnLAB2aFUetmYPDtdLT9O+dZzVLe+HkjduiYrUycnGg+7u6+X6N0noKgvgtNGJ zMdQ== 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 p12-v6si21292540pll.142.2018.07.11.20.00.10; Wed, 11 Jul 2018 20:00:26 -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 S2389467AbeGKVfd (ORCPT + 99 others); Wed, 11 Jul 2018 17:35:33 -0400 Received: from tartarus.angband.pl ([89.206.35.136]:44982 "EHLO tartarus.angband.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388831AbeGKVfd (ORCPT ); Wed, 11 Jul 2018 17:35:33 -0400 Received: from kilobyte by tartarus.angband.pl with local (Exim 4.89) (envelope-from ) id 1fdMfY-0003Zq-Is; Wed, 11 Jul 2018 23:29:04 +0200 Date: Wed, 11 Jul 2018 23:29:04 +0200 From: Adam Borowski To: Kees Cook Cc: Greg Kroah-Hartman , Nicolas Pitre , Dave Mielke , Samuel Thibault , Alan Cox , LKML , linux-console@vger.kernel.org Subject: Re: [PATCH v3 1/3] vt: preserve unicode values corresponding to screen characters Message-ID: <20180711212904.pvvgedidavvwfaca@angband.pl> References: <20180627035642.8561-1-nicolas.pitre@linaro.org> <20180627035642.8561-2-nicolas.pitre@linaro.org> <20180711091848.GA2889@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Junkbait: aaron@angband.pl, zzyx@angband.pl User-Agent: NeoMutt/20170113 (1.7.2) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: kilobyte@angband.pl X-SA-Exim-Scanned: No (on tartarus.angband.pl); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jul 11, 2018 at 01:39:56PM -0700, Kees Cook wrote: > On Wed, Jul 11, 2018 at 2:18 AM, Greg Kroah-Hartman > wrote: > > 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: > >> > +++ 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. :) > > > Yup, that's fine. (It's how I noticed it: linux-next VLA build tests.) > I'm just hoping it can get solved before the merge window opens. :) This one is actually nasty: max console height is 32767, if you resize it that big then issue a large scroll request, boom it goes. > There are still a bunch of VLAs I'm chipping away at, but this was a > newly added one, so I was hoping Nicolas (when he's back from > vacation) will have ideas on how to best avoid it. Nicolas: what about just moving line pointers one at a time? Rotating an array slice in-place isn't that slow -- and optimizing that much when reasonable sizes don't exceed 100ish (depending on how good your eyes are) is quite ridiculous. Thanks to your change, we don't need to move actual contents, just line pointers -- that's fast enough. Meow! -- // If you believe in so-called "intellectual property", please immediately // cease using counterfeit alphabets. Instead, contact the nearest temple // of Amon, whose priests will provide you with scribal services for all // your writing needs, for Reasonable And Non-Discriminatory prices.