Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp815148imd; Sat, 3 Nov 2018 10:49:17 -0700 (PDT) X-Google-Smtp-Source: AJdET5e02nQlZNEuxQ+q+yYyGjaF0R8chH+lrfz93wfSUJA2V8vypd48Dip7RljlWkKbfTjMCWLa X-Received: by 2002:a63:3d03:: with SMTP id k3mr9287565pga.191.1541267357792; Sat, 03 Nov 2018 10:49:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1541267357; cv=none; d=google.com; s=arc-20160816; b=0oDQupyK+RlzSEH18awiv1KKyPRNgzfJSl//aZBMQqmK562RoYs9YcYSHw9RgH9nuw TUkVKJGvqm06YlxvXJH6QEuZ4lp6+oC67NPKY2nvh7MXz/Iw9/A2y79upZVt0VPBkSLN mJxDpjjtibSLmDAsZ4SbdzDcteX2CTYjH1jZgZoDF6Kq+3JS4D8BvFeDRtu3MsPa7ixO mlEtlojfguENsPVdjYUupqohZvpS0JAu6XQndNUfQEejjX5z1DztO2KkMGUYOCKylQ9l 52A9tudSdQNIoZ9xdE0PycyLK7Yc9kxrSsibUj2eySERCduS82atmbl9+13UkOgV2pvg ZFSA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:dkim-signature; bh=ffWZP/NcpTDES4g6V2GUUEJfX+JXRzFSdfpwoUZ8s2M=; b=p47G8En6Tpiszb87FjzZNgaRAPYVVHyxo6BtqxZ2H2QmtUWn6sflfX5HukS/TBC/Pg 26ClMekcJd88il381XSyepej5Hm53WH25KboQbGgzwhVtJols6G1qVbeq4j1EQx05TYZ lchynm+VMlWOpYEFfJj7BTi80z+gbSyFNTvXzl/zHSAC/wHOYZeEiKD3I3ybKGNsICJG z2HlPJdPyeU8teSO1T3Xt2vCN9Sggdv/w4eMew6+CeUenhs+Tu+Ii4vsVqcVLYI3Liv/ sxQH89eAb3fzSHIQxqy9q/0filaPrGdhgJDodl5KSgseLL/UbTRwhpwWQm0Fu17AtUR6 GVrQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sholland.org header.s=fm1 header.b=A8pKSbx0; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=xNml2iEj; 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 g20-v6si28112151pgg.575.2018.11.03.10.49.02; Sat, 03 Nov 2018 10:49:17 -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; dkim=pass header.i=@sholland.org header.s=fm1 header.b=A8pKSbx0; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=xNml2iEj; 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 S1728755AbeKDDAb (ORCPT + 99 others); Sat, 3 Nov 2018 23:00:31 -0400 Received: from out3-smtp.messagingengine.com ([66.111.4.27]:50845 "EHLO out3-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727508AbeKDDAa (ORCPT ); Sat, 3 Nov 2018 23:00:30 -0400 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id AAE2A21CDD; Sat, 3 Nov 2018 13:48:33 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Sat, 03 Nov 2018 13:48:33 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sholland.org; h= from:to:cc:subject:date:message-id; s=fm1; bh=ffWZP/NcpTDES4g6V2 GUUEJfX+JXRzFSdfpwoUZ8s2M=; b=A8pKSbx0/hQbbEONdP7ZODqO0P16LMoz+t Qj+geJaWrM6rKV3aLbklvKgyF/Cb1Z1ugeaEFSTCYQ7NBLEe7lN93DUX0qaos+Tk MzGFw7BnY4VffVteLCa5LSvQXbVwHBd6n9rKHdidxtVajLCzgrIVinNZmNcUgVUM TfhT8dyO6YXyM+u1r4QV+Nl9ysCph1yzd4KgRUMaHbu8F5Iaa00hb+0SkLxJIksn rZ9vH08bn0Mu+P49L7SNFLmQBDfqb6uRLwEuRIk1QF0PFZp8MTHu0oP1wFamSARS vk3gA6DlaIqsiWcC6evDYwRrdankrIGNTbweL1bEwIY4SHWSh1eA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:date:from:message-id:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; bh=ffWZP/NcpTDES4g6V2GUUEJfX+JXRzFSdfpwoUZ8s2M=; b=xNml2iEj c3S/Pd9J0NcypcOSwzZT4YEiSDbXHZLRm2NkyH5VRhWiM2oNcpSr5Hc1aU+Qp49c wrc06yx085b+XKiXD+qWNKLY9GkW9n3rI2TzLqP3DTmUoO6er+TJmiEw7UkzYGe9 uV3zeTYBvuDUMsmYRZiMG/x9TSkuNUVyRsLpXCYShDC1DdGlVZ/+9Gk1MmmagVii XMNE1u4xl+7uqaaJRVs4oAnNy4wMrb3eGexQa2SxcInFEwqYb+4jWHvVTkz9galx 5OGD1aSyLBLFgVgyx056+/aYqFmkOzKmwn5hoxOZfwcyfTYYdWmX0Fae4l72xZIV OvW7zl91/ofULg== X-ME-Sender: X-ME-Proxy: Received: from titanium.stl.sholland.net (70-135-148-151.lightspeed.stlsmo.sbcglobal.net [70.135.148.151]) by mail.messagingengine.com (Postfix) with ESMTPA id 9A462E4408; Sat, 3 Nov 2018 13:48:32 -0400 (EDT) From: Samuel Holland To: Greg Kroah-Hartman , Jiri Slaby , Nicolas Pitre Cc: Adam Borowski , Samuel Holland , Mike Frysinger , Alexander Potapenko , linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: [PATCH] vt: Fix screen updates after CSI K sequences Date: Sat, 3 Nov 2018 12:48:31 -0500 Message-Id: <20181103174831.1666-1-samuel@sholland.org> X-Mailer: git-send-email 2.18.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In d8ae72427187, start was changed to point to the character under the cursor, instead of the beginning of the cleared area. The offset was correctly applied when clearing the backing buffer, but not when updating the framebuffer region. Fix this by having start point once again to the beginning of the cleared area. Cc: stable@vger.kernel.org Fixes: d8ae72427187 ("vt: preserve unicode values corresponding to screen characters") Signed-off-by: Samuel Holland --- drivers/tty/vt/vt.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/tty/vt/vt.c b/drivers/tty/vt/vt.c index 5f1183b0b89d..be7bc83d6c41 100644 --- a/drivers/tty/vt/vt.c +++ b/drivers/tty/vt/vt.c @@ -1528,7 +1528,7 @@ static void csi_J(struct vc_data *vc, int vpar) static void csi_K(struct vc_data *vc, int vpar) { unsigned int count; - unsigned short *start = (unsigned short *)vc->vc_pos; + unsigned short *start; int offset; switch (vpar) { @@ -1548,7 +1548,8 @@ static void csi_K(struct vc_data *vc, int vpar) return; } vc_uniscr_clear_line(vc, vc->vc_x + offset, count); - scr_memsetw(start + offset, vc->vc_video_erase_char, 2 * count); + start = (unsigned short *)vc->vc_pos + offset; + scr_memsetw(start, vc->vc_video_erase_char, 2 * count); vc->vc_need_wrap = 0; if (con_should_update(vc)) do_update_region(vc, (unsigned long) start, count); -- 2.18.1