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>] [day] [month] [year] [list]
Message-ID: <20060821223203.GD5383@bouh.residence.ens-lyon.fr>
Date:	Tue, 22 Aug 2006 00:32:03 +0200
From:	Samuel Thibault <samuel.thibault@...-lyon.org>
To:	linux-kernel@...r.kernel.org, torvalds@...l.org, akpm@...l.org
Cc:	dave@...lke.cc
Subject: [PATCH] vcsa attribute bits -> ioctl(VT_GETHIFONTMASK)

Hi,

When reading /dev/vcsa while a font with more than 256 characters is
loaded, one of the attribute bits records the 9th bit of the character.
But depending on the console driver (vgacon or fbcon for instance),
that's bit 3 or bit 0.  And there is no way for userland to know that,
thus no way for userland to safely grab the screen content.  So here is
a (tested) patch.  I know 2.6.18 is very close now, but since this is a
quite trivial patch, maybe it could find its way in as soon as now?


  Add a VT_GETHIFONTMASK ioctl for knowing which bit is the 9th bit for
  VC text (vc_hi_font_mask field of the vc_data structure).

Signed-off-by: Samuel Thibault <samuel.thibault@...-lyon.org>

--- linux-2.6.17-orig/drivers/char/vt_ioctl.c	2006-03-20 06:53:29.000000000 +0100
+++ linux/drivers/char/vt_ioctl.c	2006-08-21 22:34:52.000000000 +0200
@@ -1012,6 +1012,8 @@
 		   return -EPERM;
 		vt_dont_switch = 0;
 		return 0;
+	case VT_GETHIFONTMASK:
+		return put_user(vc->vc_hi_font_mask, (unsigned short __user *)arg);
 	default:
 		return -ENOIOCTLCMD;
 	}
--- linux-2.6.17-orig/include/linux/vt.h	2006-03-20 06:53:29.000000000 +0100
+++ linux/include/linux/vt.h	2006-08-21 22:35:49.000000000 +0200
@@ -50,5 +50,6 @@
 #define VT_RESIZEX      0x560A  /* set kernel's idea of screensize + more */
 #define VT_LOCKSWITCH   0x560B  /* disallow vt switching */
 #define VT_UNLOCKSWITCH 0x560C  /* allow vt switching */
+#define VT_GETHIFONTMASK 0x560D  /* return hi font mask */
 
 #endif /* _LINUX_VT_H */
--- linux-2.6.17-orig/include/linux/compat_ioctl.h	2006-06-18 19:22:39.000000000 +0200
+++ linux/include/linux/compat_ioctl.h	2006-08-21 22:34:17.000000000 +0200
@@ -216,6 +216,7 @@
 COMPATIBLE_IOCTL(VT_RESIZEX)
 COMPATIBLE_IOCTL(VT_LOCKSWITCH)
 COMPATIBLE_IOCTL(VT_UNLOCKSWITCH)
+COMPATIBLE_IOCTL(VT_GETHIFONTMASK)
 /* Little p (/dev/rtc, /dev/envctrl, etc.) */
 COMPATIBLE_IOCTL(RTC_AIE_ON)
 COMPATIBLE_IOCTL(RTC_AIE_OFF)
-
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