From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.5 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_PASS,USER_AGENT_MUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 37CCAC10F13 for ; Tue, 16 Apr 2019 13:24:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 077B620870 for ; Tue, 16 Apr 2019 13:24:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1555421066; bh=N5pTPuQhGKO1ptxclY1dIMtN5PGmDbIdk+hRh9AZ/zk=; h=Date:From:To:Cc:Subject:References:In-Reply-To:List-ID:From; b=os8MaYp1TQsnS2lt92mNLXMRe0YvgJ+gZAnFtSA1mjO59ULF2HFOeD1T2CmaoL4FF scG0gwa59msZx62tyalJUlYhpo0zXh1RWUFswXm1pPMKpewZgVBy/UhaFK5jTM8GmX SOOv/XF92kCtanOiT2sxTLQKsOKQEQ3We3Aybh5Y= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725981AbfDPNYZ (ORCPT ); Tue, 16 Apr 2019 09:24:25 -0400 Received: from mail.kernel.org ([198.145.29.99]:37384 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725861AbfDPNYZ (ORCPT ); Tue, 16 Apr 2019 09:24:25 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 417B120643; Tue, 16 Apr 2019 13:24:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1555421063; bh=N5pTPuQhGKO1ptxclY1dIMtN5PGmDbIdk+hRh9AZ/zk=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=yGBB0DV+zdIX3C6GVVLOuF2H+/57kxSgzoOZuZIV8y+XIrOUu9DG0jluZzfdh5I7x tY02W2uhuHZSCutVgOw7nWw4qxVn7Uq1MKrFv0LIoiUJkjIWKeBx46nMAFRnGDeFZe UXaRTN9o9x3kVR66htNnrZOjHsQPTCJ84jWIlND4= Date: Tue, 16 Apr 2019 15:23:31 +0200 From: Greg Kroah-Hartman To: Mikulas Patocka Cc: Nicolas Pitre , Matthew Whitehead , stable@vger.kernel.org Subject: Re: the patch "vt: perform safe console erase" introduces a bug Message-ID: <20190416132331.GA2888@kroah.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.11.4 (2019-03-13) Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org On Sun, Mar 31, 2019 at 04:18:01PM -0400, Mikulas Patocka wrote: > > > On Sat, 30 Mar 2019, Mikulas Patocka wrote: > > > Hi > > > > The patch a6dbe442755999960ca54a9b8ecfd9606be0ea75 ("vt: perform safe > > console erase in the right order") introduces a bug. > > > > --- > > drivers/tty/vt/vt.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > Index: linux-5.0.5/drivers/tty/vt/vt.c > > =================================================================== > > --- linux-5.0.5.orig/drivers/tty/vt/vt.c 2019-03-30 19:29:26.000000000 +0100 > > +++ linux-5.0.5/drivers/tty/vt/vt.c 2019-03-30 19:30:50.000000000 +0100 > > @@ -1518,7 +1518,7 @@ static void csi_J(struct vc_data *vc, in > > return; > > } > > scr_memsetw(start, vc->vc_video_erase_char, 2 * count); > > - update_region(vc, (unsigned long) start, count); > > + do_update_region(vc, (unsigned long) start, count); > ^^^^ this is wrong too - it will clear the screen if \e[2J is printed on > inactive console. We need to use con_should_update(vc), just like it was > before: > > > The patch a6dbe442755999960ca54a9b8ecfd9606be0ea75 ("vt: perform safe > console erase in the right order") introduces a bug. > > In order to reproduce the bug > - use framebuffer console with the AMDGPU driver > - type "links" to start the console www browser > - press 'q' and space to exit links > > --- now, the cursor line will be permanently visible in the center of the > screen. It will stay there until something overwrites it. > > Before the patch, there was a call to do_update_region, the patch changes > it to update_region - and this seems to cause the bug with the cursor. > > The bug goes away if we change update_region back to do_update_region. > > Signed-off-by: Mikulas Patocka > Cc: stable@vger.kernel.org > Fixes: a6dbe4427559 ("vt: perform safe console erase in the right order") > > --- > drivers/tty/vt/vt.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > Index: linux-5.0.5/drivers/tty/vt/vt.c > =================================================================== > --- linux-5.0.5.orig/drivers/tty/vt/vt.c 2019-03-30 19:29:26.000000000 +0100 > +++ linux-5.0.5/drivers/tty/vt/vt.c 2019-03-31 13:06:24.000000000 +0200 > @@ -1518,7 +1518,8 @@ static void csi_J(struct vc_data *vc, in > return; > } > scr_memsetw(start, vc->vc_video_erase_char, 2 * count); > - update_region(vc, (unsigned long) start, count); > + if (con_should_update(vc)) > + do_update_region(vc, (unsigned long) start, count); > vc->vc_need_wrap = 0; > } > Can you resend this, with the ack, in a format that I can apply it in? thanks, greg k-h