lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <m17irivkhy.fsf@ebiederm.dsl.xmission.com>
Date:	Tue, 08 May 2007 19:44:25 -0600
From:	ebiederm@...ssion.com (Eric W. Biederman)
To:	"H. Peter Anvin" <hpa@...or.com>
Cc:	yhlu <yhlu.kernel@...il.com>,
	Jeremy Fitzhardinge <jeremy@...p.org>, vgoyal@...ibm.com,
	Gerd Hoffmann <kraxel@...hat.com>,
	Jeff Garzik <jeff@...zik.org>, patches@...-64.org,
	linux-kernel@...r.kernel.org,
	virtualization <virtualization@...ts.linux-foundation.org>,
	Rusty Russell <rusty@...tcorp.com.au>, Andi Kleen <ak@...e.de>,
	Ingo Molnar <mingo@...e.hu>
Subject: Re: [patches] [PATCH] [21/22] x86_64: Extend bzImage protocol for relocatable bzImage

"H. Peter Anvin" <hpa@...or.com> writes:

> yhlu wrote:
>> On 5/8/07, H. Peter Anvin <hpa@...or.com> wrote:
>>> Jeremy Fitzhardinge wrote:
>>> Specifically boot_params.screen_info isn't being properly set up by the
>>> caller.
>> 
>> will setup real_mode_data in kexec path?
>
> -ENOPARSE

I believe YH is asking how we setup real_mode_data in /sbin/kexec.
The setup is:
>         real_mode->orig_x = 0;
>         real_mode->orig_y = 0;
>         real_mode->orig_video_page = 0;
>         real_mode->orig_video_mode = 0;
>         real_mode->orig_video_cols = 80;
>         real_mode->orig_video_lines = 25;
>         real_mode->orig_video_ega_bx = 0;
>         real_mode->orig_video_isVGA = 1;
>         real_mode->orig_video_points = 16;

Silly but generally safe.

More relevant because the code is in kernel we have:

arch/arm/kernel/setup.c:
> struct screen_info screen_info = {
>  .orig_video_lines	= 30,
>  .orig_video_cols	= 80,
>  .orig_video_mode	= 0,
>  .orig_video_ega_bx	= 0,
>  .orig_video_isVGA	= 1,
>  .orig_video_points	= 8
> };


arch/alpha/kernel/sys_sio.c:
> 	/* The AlphaBook1 has LCD video fixed at 800x600,
> 	   37 rows and 100 cols. */
> 	screen_info.orig_y = 37;
> 	screen_info.orig_video_cols = 100;
> 	screen_info.orig_video_lines = 37;


I expect I can find a few more examples where we specify
video_cols and video_lines but we use video_mode == 0.

Going farther mode 0x00 is a BIOS 40x25 mode.  So the patch below is
not always safe even if we boot the bzImage.  It is just highly
unlikely anyone would start the kernel in 40x25 text mode. 

Therefore I expect the test should test several additional
fields, in particular video lines and columns before we
decide that we have an uninitialized screen_info and give up.


> commit f82af20e1a028e16b9bb11da081fa1148d40fa6a
> Author: Gerd Hoffmann <kraxel@...e.de>
> Date:   Wed May 2 19:27:19 2007 +0200
> 
>     [PATCH] x86-64: ignore vgacon if hardware not present
>     
>     Avoid trying to set up vgacon if there's no vga hardware present.
>     
>     Signed-off-by: Jeremy Fitzhardinge <jeremy@...source.com>
>     Signed-off-by: Rusty Russell <rusty@...tcorp.com.au>
>     Signed-off-by: Andi Kleen <ak@...e.de>
>     Cc: Alan <alan@...rguk.ukuu.org.uk>
>     Acked-by: Ingo Molnar <mingo@...e.hu>
> 
> diff --git a/drivers/video/console/vgacon.c b/drivers/video/console/vgacon.c
> index 91a2078..3e67c34 100644
> --- a/drivers/video/console/vgacon.c
> +++ b/drivers/video/console/vgacon.c
> @@ -371,7 +371,8 @@ static const char *vgacon_startup(void)
>         }
>  
>         /* VGA16 modes are not handled by VGACON */
> -       if ((ORIG_VIDEO_MODE == 0x0D) ||        /* 320x200/4 */
> +       if ((ORIG_VIDEO_MODE == 0x00) ||        /* SCREEN_INFO not initialized */
> +           (ORIG_VIDEO_MODE == 0x0D) ||        /* 320x200/4 */
>             (ORIG_VIDEO_MODE == 0x0E) ||        /* 640x200/4 */
>             (ORIG_VIDEO_MODE == 0x10) ||        /* 640x350/4 */
>             (ORIG_VIDEO_MODE == 0x12) ||        /* 640x480/4 */

Eric
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ