Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp816117ybl; Wed, 11 Dec 2019 07:57:54 -0800 (PST) X-Google-Smtp-Source: APXvYqz6n1CHsxorlaYjv5xFs/Yu3D+1QQB3xTLAhvrR4tbsEYcKdHHNuMT9jv6WS1ZSKx58lwkr X-Received: by 2002:a9d:7:: with SMTP id 7mr2606047ota.26.1576079874113; Wed, 11 Dec 2019 07:57:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576079874; cv=none; d=google.com; s=arc-20160816; b=d++CdehTcI6n8wVe3zrl0uLOiJdhzsEy1iv+I5Ok1upKvc/XBVhh4IsNG2n5EXzVjV SYupuhCBA2P07TpMizit91UqT7IsO8TscVGAUfU1lDB3TVMiEPZ1ZnDHZYonKqM13QDQ sZbwndUAwR+Dmvlly+iPZgFhvUyHaUZmWrnTXtySdvHTfuFYsTS5Jw5UaFNcjgZDTPXe XcDqPILUqQstvgH8e/9g0Wq+ttG/NPvjB4iF/sDnKeVargOOukbfsPqHXu2vELZdCuho ZJEgN79InjQj1T0tEh8ZiChtDzs/LTWm31fwRbM8NTyBMtno/+OGNg2d9PnfIt2FmVq/ H+ig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=j3bZRQIaRISmvhJl1isIFhSpPvyV+zYAKnzSz85fhbg=; b=NezkYeizlBFT2aKjZXvjjPQkG2XNhJ+j2iBYZgcVFE7pghZeiM53kNly12DUOAXvhw eJ2ObD4Qo+06KVjiMsl9NmT9JSkcT+ixkvUrzluSs1P3rUIyy6Ry3PwcF2Q887Zlh/8u eahpjpB2vJFdekYgsVd7gcikC6AETBawca6q94neXDzoPKSzO6LLVfZNAR5pZpQsqmgl pzrFYPKjMZ7bkgR9v6mKZOU+dMdsGGr+JxFdQ9VlCFEYqZE5EkpNm+kdN7jlWWTAknJ8 IjETv9c1+nSUzxJfSjGZjIBzP9EsSBPFXKieoPrtEX/qVAXCjwHfrbe6Ev6Oh3HqNXMC 5aGw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=aoSz32+o; 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 x5si1412092otj.165.2019.12.11.07.57.42; Wed, 11 Dec 2019 07:57:54 -0800 (PST) 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=@kernel.org header.s=default header.b=aoSz32+o; 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 S1732295AbfLKP4j (ORCPT + 99 others); Wed, 11 Dec 2019 10:56:39 -0500 Received: from mail.kernel.org ([198.145.29.99]:41518 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730487AbfLKPPY (ORCPT ); Wed, 11 Dec 2019 10:15:24 -0500 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 6BD122465C; Wed, 11 Dec 2019 15:15:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1576077323; bh=MMmOfzQAQPd+qex/oNeLOW3iayXwmQcSaN9IFAFG1IU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=aoSz32+oRPqhXmmvDwxjlwxRAZchD+WAoTUQGkCBYL5Fr1QI47KM+iM+IZ36t4dG5 l8rY+LxTAFsozugaRWThiZpnBrl+nCceVguhQ63Fd0O/9J+cbtn2SXH70R+ks6nhPI vUZ7O4Yf4hhnE0X6eSW50/6UXTd9QAjDhEqX5qvk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Or Cohen , Nicolas Pitre , Jiri Slaby Subject: [PATCH 5.3 102/105] vcs: prevent write access to vcsu devices Date: Wed, 11 Dec 2019 16:06:31 +0100 Message-Id: <20191211150304.160317023@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20191211150221.153659747@linuxfoundation.org> References: <20191211150221.153659747@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Nicolas Pitre commit 0c9acb1af77a3cb8707e43f45b72c95266903cee upstream. Commit d21b0be246bf ("vt: introduce unicode mode for /dev/vcs") guarded against using devices containing attributes as this is not yet implemented. It however failed to guard against writes to any devices as this is also unimplemented. Reported-by: Or Cohen Signed-off-by: Nicolas Pitre Cc: # v4.19+ Cc: Jiri Slaby Fixes: d21b0be246bf ("vt: introduce unicode mode for /dev/vcs") Link: https://lore.kernel.org/r/nycvar.YSQ.7.76.1911051030580.30289@knanqh.ubzr Signed-off-by: Greg Kroah-Hartman --- drivers/tty/vt/vc_screen.c | 3 +++ 1 file changed, 3 insertions(+) --- a/drivers/tty/vt/vc_screen.c +++ b/drivers/tty/vt/vc_screen.c @@ -456,6 +456,9 @@ vcs_write(struct file *file, const char size_t ret; char *con_buf; + if (use_unicode(inode)) + return -EOPNOTSUPP; + con_buf = (char *) __get_free_page(GFP_KERNEL); if (!con_buf) return -ENOMEM;