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.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no 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 7478EC2D0A8 for ; Tue, 29 Sep 2020 01:12:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4AC4221734 for ; Tue, 29 Sep 2020 01:12:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727256AbgI2BM6 (ORCPT ); Mon, 28 Sep 2020 21:12:58 -0400 Received: from www262.sakura.ne.jp ([202.181.97.72]:58403 "EHLO www262.sakura.ne.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726944AbgI2BM5 (ORCPT ); Mon, 28 Sep 2020 21:12:57 -0400 Received: from fsav105.sakura.ne.jp (fsav105.sakura.ne.jp [27.133.134.232]) by www262.sakura.ne.jp (8.15.2/8.15.2) with ESMTP id 08T1CtiK060830; Tue, 29 Sep 2020 10:12:55 +0900 (JST) (envelope-from penguin-kernel@i-love.sakura.ne.jp) Received: from www262.sakura.ne.jp (202.181.97.72) by fsav105.sakura.ne.jp (F-Secure/fsigk_smtp/550/fsav105.sakura.ne.jp); Tue, 29 Sep 2020 10:12:55 +0900 (JST) X-Virus-Status: clean(F-Secure/fsigk_smtp/550/fsav105.sakura.ne.jp) Received: from [192.168.1.9] (M106072142033.v4.enabler.ne.jp [106.72.142.33]) (authenticated bits=0) by www262.sakura.ne.jp (8.15.2/8.15.2) with ESMTPSA id 08T1CrW1060732 (version=TLSv1.2 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 29 Sep 2020 10:12:55 +0900 (JST) (envelope-from penguin-kernel@i-love.sakura.ne.jp) Subject: Re: [PATCH] vt_ioctl: make VT_RESIZEX behave like VT_RESIZE To: Martin Hostettler Cc: gregkh@linuxfoundation.org, jirislaby@kernel.org, Peilin Ye , syzbot , b.zolnierkie@samsung.com, daniel.vetter@ffwll.ch, deller@gmx.de, syzkaller-bugs@googlegroups.com, Linus Torvalds , dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org, linux-kernel@vger.kernel.org, George Kennedy References: <000000000000226d3f05b02dd607@google.com> <47907f77-b14b-b433-45c6-a315193f0c1a@i-love.sakura.ne.jp> <494395bc-a7dd-fdb1-8196-a236a266ef54@i-love.sakura.ne.jp> <20200927092701.GA1037755@PWN> <4933b81b-9b1a-355b-df0e-9b31e8280ab9@i-love.sakura.ne.jp> <20200928175956.GF24673@neutronstar.dyndns.org> From: Tetsuo Handa Message-ID: <100dfd3f-3415-80ae-a6cf-30d15f7ca49f@i-love.sakura.ne.jp> Date: Tue, 29 Sep 2020 10:12:46 +0900 User-Agent: Mozilla/5.0 (Windows NT 6.3; Win64; x64; rv:68.0) Gecko/20100101 Thunderbird/68.12.0 MIME-Version: 1.0 In-Reply-To: <20200928175956.GF24673@neutronstar.dyndns.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2020/09/29 2:59, Martin Hostettler wrote: > On Sun, Sep 27, 2020 at 08:46:30PM +0900, Tetsuo Handa wrote: >> VT_RESIZEX was introduced in Linux 1.3.3, but it is unclear that what >> comes to the "+ more" part, and I couldn't find a user of VT_RESIZEX. >> > > It seems this is/was used by "svgatextmode" which seems to be at > http://www.ibiblio.org/pub/Linux/utils/console/ > > Not sure if that kind of software still has a chance to work nowadays. > Thanks for the information. It seems that v.v_vlin = curr_textmode->VDisplay / (MOFLG_ISSET(curr_textmode, ATTR_DOUBLESCAN) ? 2 : 1) and v.v_clin = curr_textmode->FontHeight . Thus, v.v_clin is font's height and seems to be non-zero. But according to https://bugs.gentoo.org/19485 , people are using kernel framebuffer instead. ---------- SVGATextMode-1.10/SVGATextMode.c ---------- /* * Resize the screen. Still needs LOTS more error checking to avoid dropping out in the middle, leaving * the user with a garbled screen. * * sresize will be TRUE when resizing tty's should be forced (due to the 2nd attempt do_VT_RESIZE will do * when not enough memory is free). * */ /* * ALWAYS do a VT_RESIZE, even if we already did a VT_RESIZEX on a 1.3.3 or higher kernel, * until those kernel programmers make this unambiguous */ if (do_VT_RESIZE(curr_textmode->cols, curr_textmode->rows, resize1x1)) sresize=TRUE; if (check_kernel_version(1,3,3, "VT_RESIZEX")) { /* * VDisplay must de divided by 2 for DoubleScan modes, * or VT_RESIZEX will fail -- until someone fixes the kernel * so it understands about doublescan modes. */ if (do_VT_RESIZEX(curr_textmode->cols, curr_textmode->rows, curr_textmode->VDisplay / (MOFLG_ISSET(curr_textmode, ATTR_DOUBLESCAN) ? 2 : 1), curr_textmode->FontHeight, curr_textmode->HDisplay/8*curr_textmode->FontWidth, curr_textmode->FontWidth, resize1x1)) sresize=TRUE; } ---------- SVGATextMode-1.10/ttyresize.c ---------- /* * if VT_RESIZEX not supported (i.e. when compiling on < 1.3.3 kernels), define it. * this is just te keep the compiler happy */ #ifndef VT_RESIZEX # define VT_RESIZEX 0x560A typedef struct vt_consize { ushort v_rows; ushort v_cols; ushort v_vlin; ushort v_clin; ushort v_vcol; ushort v_ccol; } vt_consize; #endif int do_VT_RESIZEX(int cols, int rows, int vlin, int clin, int vcol, int ccol, int allow1x1) { struct vt_consize my_vt_size; /* passes the new screen size on to the kernel */ struct vt_consize dummy_vt_size = { 1 , 1 , 1 , 1 , 1 , 1 }; int ram_needed = cols * rows * 2 * MAX_NR_CONSOLES; my_vt_size.v_rows = rows; my_vt_size.v_cols = cols; my_vt_size.v_vlin = vlin; my_vt_size.v_clin = clin; my_vt_size.v_vcol = vcol; my_vt_size.v_ccol = ccol; PDEBUG(("VT_RESIZEX(cols=%d,rows=%d,vlin=%d,clin=%d,vcol=%d,ccol=%d)\n",cols, rows, vlin, clin, vcol, ccol)); return(generic_VT_RESIZE(&my_vt_size, &dummy_vt_size, allow1x1, ram_needed, VT_RESIZEX, "VT_RESIZEX")); } From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tetsuo Handa Date: Tue, 29 Sep 2020 01:12:46 +0000 Subject: Re: [PATCH] vt_ioctl: make VT_RESIZEX behave like VT_RESIZE Message-Id: <100dfd3f-3415-80ae-a6cf-30d15f7ca49f@i-love.sakura.ne.jp> List-Id: References: <000000000000226d3f05b02dd607@google.com> <47907f77-b14b-b433-45c6-a315193f0c1a@i-love.sakura.ne.jp> <494395bc-a7dd-fdb1-8196-a236a266ef54@i-love.sakura.ne.jp> <20200927092701.GA1037755@PWN> <4933b81b-9b1a-355b-df0e-9b31e8280ab9@i-love.sakura.ne.jp> <20200928175956.GF24673@neutronstar.dyndns.org> In-Reply-To: <20200928175956.GF24673@neutronstar.dyndns.org> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Martin Hostettler Cc: syzbot , linux-fbdev@vger.kernel.org, George Kennedy , b.zolnierkie@samsung.com, daniel.vetter@ffwll.ch, deller@gmx.de, syzkaller-bugs@googlegroups.com, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Linus Torvalds , gregkh@linuxfoundation.org, jirislaby@kernel.org, Peilin Ye On 2020/09/29 2:59, Martin Hostettler wrote: > On Sun, Sep 27, 2020 at 08:46:30PM +0900, Tetsuo Handa wrote: >> VT_RESIZEX was introduced in Linux 1.3.3, but it is unclear that what >> comes to the "+ more" part, and I couldn't find a user of VT_RESIZEX. >> > > It seems this is/was used by "svgatextmode" which seems to be at > http://www.ibiblio.org/pub/Linux/utils/console/ > > Not sure if that kind of software still has a chance to work nowadays. > Thanks for the information. It seems that v.v_vlin = curr_textmode->VDisplay / (MOFLG_ISSET(curr_textmode, ATTR_DOUBLESCAN) ? 2 : 1) and v.v_clin = curr_textmode->FontHeight . Thus, v.v_clin is font's height and seems to be non-zero. But according to https://bugs.gentoo.org/19485 , people are using kernel framebuffer instead. ---------- SVGATextMode-1.10/SVGATextMode.c ---------- /* * Resize the screen. Still needs LOTS more error checking to avoid dropping out in the middle, leaving * the user with a garbled screen. * * sresize will be TRUE when resizing tty's should be forced (due to the 2nd attempt do_VT_RESIZE will do * when not enough memory is free). * */ /* * ALWAYS do a VT_RESIZE, even if we already did a VT_RESIZEX on a 1.3.3 or higher kernel, * until those kernel programmers make this unambiguous */ if (do_VT_RESIZE(curr_textmode->cols, curr_textmode->rows, resize1x1)) sresize=TRUE; if (check_kernel_version(1,3,3, "VT_RESIZEX")) { /* * VDisplay must de divided by 2 for DoubleScan modes, * or VT_RESIZEX will fail -- until someone fixes the kernel * so it understands about doublescan modes. */ if (do_VT_RESIZEX(curr_textmode->cols, curr_textmode->rows, curr_textmode->VDisplay / (MOFLG_ISSET(curr_textmode, ATTR_DOUBLESCAN) ? 2 : 1), curr_textmode->FontHeight, curr_textmode->HDisplay/8*curr_textmode->FontWidth, curr_textmode->FontWidth, resize1x1)) sresize=TRUE; } ---------- SVGATextMode-1.10/ttyresize.c ---------- /* * if VT_RESIZEX not supported (i.e. when compiling on < 1.3.3 kernels), define it. * this is just te keep the compiler happy */ #ifndef VT_RESIZEX # define VT_RESIZEX 0x560A typedef struct vt_consize { ushort v_rows; ushort v_cols; ushort v_vlin; ushort v_clin; ushort v_vcol; ushort v_ccol; } vt_consize; #endif int do_VT_RESIZEX(int cols, int rows, int vlin, int clin, int vcol, int ccol, int allow1x1) { struct vt_consize my_vt_size; /* passes the new screen size on to the kernel */ struct vt_consize dummy_vt_size = { 1 , 1 , 1 , 1 , 1 , 1 }; int ram_needed = cols * rows * 2 * MAX_NR_CONSOLES; my_vt_size.v_rows = rows; my_vt_size.v_cols = cols; my_vt_size.v_vlin = vlin; my_vt_size.v_clin = clin; my_vt_size.v_vcol = vcol; my_vt_size.v_ccol = ccol; PDEBUG(("VT_RESIZEX(cols=%d,rows=%d,vlin=%d,clin=%d,vcol=%d,ccol=%d)\n",cols, rows, vlin, clin, vcol, ccol)); return(generic_VT_RESIZE(&my_vt_size, &dummy_vt_size, allow1x1, ram_needed, VT_RESIZEX, "VT_RESIZEX")); } 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.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no 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 8D42CC4727F for ; Tue, 29 Sep 2020 07:14:27 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 28D26207C4 for ; Tue, 29 Sep 2020 07:14:27 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 28D26207C4 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=i-love.sakura.ne.jp Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 3826C89BB3; Tue, 29 Sep 2020 07:14:26 +0000 (UTC) Received: from www262.sakura.ne.jp (www262.sakura.ne.jp [202.181.97.72]) by gabe.freedesktop.org (Postfix) with ESMTPS id 3130589F03 for ; Tue, 29 Sep 2020 01:13:11 +0000 (UTC) Received: from fsav105.sakura.ne.jp (fsav105.sakura.ne.jp [27.133.134.232]) by www262.sakura.ne.jp (8.15.2/8.15.2) with ESMTP id 08T1CtiK060830; Tue, 29 Sep 2020 10:12:55 +0900 (JST) (envelope-from penguin-kernel@i-love.sakura.ne.jp) Received: from www262.sakura.ne.jp (202.181.97.72) by fsav105.sakura.ne.jp (F-Secure/fsigk_smtp/550/fsav105.sakura.ne.jp); Tue, 29 Sep 2020 10:12:55 +0900 (JST) X-Virus-Status: clean(F-Secure/fsigk_smtp/550/fsav105.sakura.ne.jp) Received: from [192.168.1.9] (M106072142033.v4.enabler.ne.jp [106.72.142.33]) (authenticated bits=0) by www262.sakura.ne.jp (8.15.2/8.15.2) with ESMTPSA id 08T1CrW1060732 (version=TLSv1.2 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 29 Sep 2020 10:12:55 +0900 (JST) (envelope-from penguin-kernel@i-love.sakura.ne.jp) Subject: Re: [PATCH] vt_ioctl: make VT_RESIZEX behave like VT_RESIZE To: Martin Hostettler References: <000000000000226d3f05b02dd607@google.com> <47907f77-b14b-b433-45c6-a315193f0c1a@i-love.sakura.ne.jp> <494395bc-a7dd-fdb1-8196-a236a266ef54@i-love.sakura.ne.jp> <20200927092701.GA1037755@PWN> <4933b81b-9b1a-355b-df0e-9b31e8280ab9@i-love.sakura.ne.jp> <20200928175956.GF24673@neutronstar.dyndns.org> From: Tetsuo Handa Message-ID: <100dfd3f-3415-80ae-a6cf-30d15f7ca49f@i-love.sakura.ne.jp> Date: Tue, 29 Sep 2020 10:12:46 +0900 User-Agent: Mozilla/5.0 (Windows NT 6.3; Win64; x64; rv:68.0) Gecko/20100101 Thunderbird/68.12.0 MIME-Version: 1.0 In-Reply-To: <20200928175956.GF24673@neutronstar.dyndns.org> Content-Language: en-US X-Mailman-Approved-At: Tue, 29 Sep 2020 07:12:58 +0000 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: syzbot , linux-fbdev@vger.kernel.org, George Kennedy , b.zolnierkie@samsung.com, daniel.vetter@ffwll.ch, deller@gmx.de, syzkaller-bugs@googlegroups.com, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Linus Torvalds , gregkh@linuxfoundation.org, jirislaby@kernel.org, Peilin Ye Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" On 2020/09/29 2:59, Martin Hostettler wrote: > On Sun, Sep 27, 2020 at 08:46:30PM +0900, Tetsuo Handa wrote: >> VT_RESIZEX was introduced in Linux 1.3.3, but it is unclear that what >> comes to the "+ more" part, and I couldn't find a user of VT_RESIZEX. >> > > It seems this is/was used by "svgatextmode" which seems to be at > http://www.ibiblio.org/pub/Linux/utils/console/ > > Not sure if that kind of software still has a chance to work nowadays. > Thanks for the information. It seems that v.v_vlin = curr_textmode->VDisplay / (MOFLG_ISSET(curr_textmode, ATTR_DOUBLESCAN) ? 2 : 1) and v.v_clin = curr_textmode->FontHeight . Thus, v.v_clin is font's height and seems to be non-zero. But according to https://bugs.gentoo.org/19485 , people are using kernel framebuffer instead. ---------- SVGATextMode-1.10/SVGATextMode.c ---------- /* * Resize the screen. Still needs LOTS more error checking to avoid dropping out in the middle, leaving * the user with a garbled screen. * * sresize will be TRUE when resizing tty's should be forced (due to the 2nd attempt do_VT_RESIZE will do * when not enough memory is free). * */ /* * ALWAYS do a VT_RESIZE, even if we already did a VT_RESIZEX on a 1.3.3 or higher kernel, * until those kernel programmers make this unambiguous */ if (do_VT_RESIZE(curr_textmode->cols, curr_textmode->rows, resize1x1)) sresize=TRUE; if (check_kernel_version(1,3,3, "VT_RESIZEX")) { /* * VDisplay must de divided by 2 for DoubleScan modes, * or VT_RESIZEX will fail -- until someone fixes the kernel * so it understands about doublescan modes. */ if (do_VT_RESIZEX(curr_textmode->cols, curr_textmode->rows, curr_textmode->VDisplay / (MOFLG_ISSET(curr_textmode, ATTR_DOUBLESCAN) ? 2 : 1), curr_textmode->FontHeight, curr_textmode->HDisplay/8*curr_textmode->FontWidth, curr_textmode->FontWidth, resize1x1)) sresize=TRUE; } ---------- SVGATextMode-1.10/ttyresize.c ---------- /* * if VT_RESIZEX not supported (i.e. when compiling on < 1.3.3 kernels), define it. * this is just te keep the compiler happy */ #ifndef VT_RESIZEX # define VT_RESIZEX 0x560A typedef struct vt_consize { ushort v_rows; ushort v_cols; ushort v_vlin; ushort v_clin; ushort v_vcol; ushort v_ccol; } vt_consize; #endif int do_VT_RESIZEX(int cols, int rows, int vlin, int clin, int vcol, int ccol, int allow1x1) { struct vt_consize my_vt_size; /* passes the new screen size on to the kernel */ struct vt_consize dummy_vt_size = { 1 , 1 , 1 , 1 , 1 , 1 }; int ram_needed = cols * rows * 2 * MAX_NR_CONSOLES; my_vt_size.v_rows = rows; my_vt_size.v_cols = cols; my_vt_size.v_vlin = vlin; my_vt_size.v_clin = clin; my_vt_size.v_vcol = vcol; my_vt_size.v_ccol = ccol; PDEBUG(("VT_RESIZEX(cols=%d,rows=%d,vlin=%d,clin=%d,vcol=%d,ccol=%d)\n",cols, rows, vlin, clin, vcol, ccol)); return(generic_VT_RESIZE(&my_vt_size, &dummy_vt_size, allow1x1, ram_needed, VT_RESIZEX, "VT_RESIZEX")); } _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel