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]
Date:	Mon, 08 Sep 2008 19:25:18 -0700
From:	q-newsgroup@...ea.com
To:	linux-kernel@...r.kernel.org
Subject: [PATCH] Re: fbcon: replace mono_col macro with static inline


Commit 22af89aa0c0b4012a7431114a340efd3665a7617 changed the order of
operations for computing monochrome color values. This generates
0xffff000f instead of 0x0000000f for a 4 bit monochrome color, leading
to image corruption if it is passed to cfb_imageblit or other similar
functions.
Here's a quick patch to fix it up.
David Winn

PS: Please CC me with any replies. Thanks

diff --git a/drivers/video/console/fbcon.h
b/drivers/video/console/fbcon.h
index a6e38e9..89a3468 100644
--- a/drivers/video/console/fbcon.h
+++ b/drivers/video/console/fbcon.h
@@ -110,7 +110,7 @@ static inline int mono_col(const struct fb_info
*info)
        __u32 max_len;
        max_len = max(info->var.green.length, info->var.red.length);
        max_len = max(info->var.blue.length, max_len);
-       return ~(0xfff << (max_len & 0xff));
+       return (~(0xfff << max_len)) & 0xff;
 }

 static inline int attr_col_ec(int shift, struct vc_data *vc,

--
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