Re: [PATCH v2 02/28] video: fbcon: Fix warnings by using pr_debug() in fbcon

2020-11-30 Thread Peilin Ye
On Mon, Nov 30, 2020 at 08:56:45AM +0100, Sam Ravnborg wrote: > Please just keep up the good work cleaning up fbcon and related stuff. > This is an area that needs some love and care and there is work for many > long nights yet to do. Thanks! I will see what I can do,

Re: [PATCH v2 02/28] video: fbcon: Fix warnings by using pr_debug() in fbcon

2020-11-29 Thread Peilin Ye
tries, but if > they should be dropped then I expect Peilin Ye to do so as he is the > only one doing active maintenance of fbcon lately. Sure, I will take another look at them. Also sorry for the delay in that printk() -> dev_*() patch you suggested, overwhelmed by some other things this we

Re: [PATCH v3 0/5] console: Miscellaneous clean-ups, do not use FNTCHARCNT() in fbcon.c

2020-11-20 Thread Peilin Ye
On Thu, Nov 19, 2020 at 04:10:57PM +0100, Daniel Vetter wrote: > On Thu, Nov 19, 2020 at 9:33 AM Peilin Ye wrote: > > setfont seems to work fine, I tried Georgian-Fixed16 (256 chars) and > > Uni2-VGA16 (512 chars) under /usr/share/consolefonts/ in my Ubuntu box, > > including

Re: [PATCH v3 0/5] console: Miscellaneous clean-ups, do not use FNTCHARCNT() in fbcon.c

2020-11-19 Thread Peilin Ye
while. However based on the other tests above I believe vc->vc_font.charcount is set properly. Thanks, Peilin Ye ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel

Re: [PATCH v3 0/5] console: Miscellaneous clean-ups, do not use FNTCHARCNT() in fbcon.c

2020-11-16 Thread Peilin Ye
On Mon, Nov 16, 2020 at 11:09:49AM +0100, Daniel Vetter wrote: > On Sat, Nov 14, 2020 at 07:47:16AM -0500, Peilin Ye wrote: > > On Sat, Nov 14, 2020 at 01:22:22PM +0100, Greg Kroah-Hartman wrote: > > > On Sat, Nov 14, 2020 at 01:18:06PM +0100, Greg Kroah-Hartman wrote: > >

Re: [PATCH v3 0/5] console: Miscellaneous clean-ups, do not use FNTCHARCNT() in fbcon.c

2020-11-14 Thread Peilin Ye
On Sat, Nov 14, 2020 at 01:22:22PM +0100, Greg Kroah-Hartman wrote: > On Sat, Nov 14, 2020 at 01:18:06PM +0100, Greg Kroah-Hartman wrote: > > On Sat, Nov 14, 2020 at 03:10:21AM -0500, Peilin Ye wrote: > > > Thanks for reviewing! Questions about the last patch [5/5] though, it &g

Re: [PATCH v3 0/5] console: Miscellaneous clean-ups, do not use FNTCHARCNT() in fbcon.c

2020-11-14 Thread Peilin Ye
> On Fri, Nov 13, 2020 at 10:16:33PM +0100, Daniel Vetter wrote: > > On Thu, Nov 12, 2020 at 07:02:21AM -0500, Peilin Ye wrote: > > > Peilin Ye (5): > > > console: Delete unused con_font_copy() callback implementations > > > console: Delete dummy con_font_s

[PATCH v3 RFC 5/5] fbcon: Avoid using FNTCHARCNT() and hard-coded built-in font charcount

2020-11-12 Thread Peilin Ye
egative-indexing macros and hard-coded values. Do not include in fbcon_rotate.c and tileblit.c, since they no longer need it. Depends on patch "Fonts: Add charcount field to font_desc". Suggested-by: Daniel Vetter Signed-off-by: Peilin Ye --- v2: https://lore.kernel.org/lkml/2020102

[PATCH v3 4/5] parisc/sticore: Avoid hard-coding built-in font charcount

2020-11-12 Thread Peilin Ye
harcount field to font_desc". Signed-off-by: Peilin Ye Reviewed-by: Daniel Vetter --- v2: https://lore.kernel.org/lkml/c38042bbf5c9777c84900d56c09f3c156b32af48.1603788512.git.yepeilin...@gmail.com/ Changes since v1: - Slightly improved commit message. - Rebased onto linux-next.

[PATCH v3 3/5] Fonts: Add charcount field to font_desc

2020-11-12 Thread Peilin Ye
Subsystems are hard-coding the number of characters of our built-in fonts as 256. Include that information in our kernel font descriptor, `struct font_desc`. Signed-off-by: Peilin Ye Reviewed-by: Daniel Vetter --- v2: https://lore.kernel.org/lkml/20201028060533.1206307-1-yepeilin...@gmail.com

[PATCH v3 2/5] console: Delete dummy con_font_set() and con_font_default() callback implementations

2020-11-12 Thread Peilin Ye
Vetter Signed-off-by: Peilin Ye Reviewed-by: Greg Kroah-Hartman --- v2: https://lore.kernel.org/lkml/c5563eeea36aae7bd72ea2e985bc610d585ece40.1604306433.git.yepeilin...@gmail.com/ Strictly speaking this is different from v2 (see changelog), but it really shouldn't matter, so I'm keep

[PATCH 1/5] console: Delete unused con_font_copy() callback implementations

2020-11-12 Thread Peilin Ye
for PPPIOCDETACH in commit af8d3c7c001a ("ppp: remove the PPPIOCDETACH ioctl"). Signed-off-by: Peilin Ye --- drivers/usb/misc/sisusbvga/sisusb_con.c | 6 -- drivers/video/console/dummycon.c| 6 -- drivers/video/fbdev/core/fbcon.c| 11 --- include/linux/

[PATCH v3 0/5] console: Miscellaneous clean-ups, do not use FNTCHARCNT() in fbcon.c

2020-11-12 Thread Peilin Ye
rnel.org/lkml/c38042bbf5c9777c84900d56c09f3c156b32af48.1603788512.git.yepeilin...@gmail.com/ 5/5: https://lore.kernel.org/lkml/20201028155139.1220549-1-yepeilin...@gmail.com/ Peilin Ye (5): console: Delete unused con_font_copy() callback implementations console: Delete dummy con_font_set() and con_font_default() callback implementa

Re: [PATCH 1/2] console: Remove dummy con_font_op() callback implementations

2020-11-10 Thread Peilin Ye
On Tue, Nov 10, 2020 at 02:46:20PM +0100, Daniel Vetter wrote: > On Tue, Nov 10, 2020 at 2:24 PM Peilin Ye wrote: > > Oh, are we doing an -rc3 backmerge soon? At the moment I can base these > > patches on neither drm-misc (due to the font_copy removal), nor mainline > > (

Re: [PATCH 1/2] console: Remove dummy con_font_op() callback implementations

2020-11-10 Thread Peilin Ye
ing (including the font_copy garbage-collecting) in a v3 series after the backmerge. Thanks, Peilin Ye ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel

Re: [PATCH v2 2/2] tty/vt: Avoid passing struct console_font_op to con_font_copy()

2020-11-02 Thread Peilin Ye
On Mon, Nov 02, 2020 at 11:10:44AM +0100, Daniel Vetter wrote: > I'm not sure switching from int to unsigned just here makes much sense. > All the console code is still using int con to index all the various > arrays (I just checked fbcon.c code), and using int to index arrays is > pretty standard.

Re: [PATCH v2 1/2] console: Remove dummy con_font_op() callback implementations

2020-11-02 Thread Peilin Ye
On Mon, Nov 02, 2020 at 11:13:47AM +0100, Daniel Vetter wrote: > On Mon, Nov 02, 2020 at 10:47:55AM +0100, Jiri Slaby wrote: > > On 02. 11. 20, 10:36, Peilin Ye wrote: > > > `struct console_font` is a UAPI structure, thus ideally should not be > > > used for kernel i

[PATCH v2 2/2] tty/vt: Avoid passing struct console_font_op to con_font_copy()

2020-11-02 Thread Peilin Ye
uot;. Suggested-by: Daniel Vetter Signed-off-by: Peilin Ye --- con_font_set(), con_font_get() and con_font_default() also pass an entire `console_font_op`. con_font_get() and con_font_default() actually update the structure (later copied to userspace), so let them be. con_font_set() does not update th

[PATCH v2 1/2] console: Remove dummy con_font_op() callback implementations

2020-11-02 Thread Peilin Ye
`struct console_font` is a UAPI structure, thus ideally should not be used for kernel internal abstraction. Remove some dummy .con_font_set, .con_font_default and .con_font_copy `struct consw` callback implementations, to make it cleaner. Suggested-by: Daniel Vetter Signed-off-by: Peilin Ye

Re: [PATCH] fbcon: Replace printk() with pr_*()

2020-11-01 Thread Peilin Ye
On Sun, Nov 01, 2020 at 04:41:13PM +0100, Greg Kroah-Hartman wrote: > On Sun, Nov 01, 2020 at 09:49:04AM -0500, Peilin Ye wrote: > > Replace printk() with pr_err(), pr_warn() and pr_info(). Do not split long > > strings, for easier grepping. Use `__func__` when

[PATCH] fbcon: Replace printk() with pr_*()

2020-11-01 Thread Peilin Ye
Sam Ravnborg Signed-off-by: Peilin Ye --- drivers/video/fbdev/core/fbcon.c | 42 +--- 1 file changed, 17 insertions(+), 25 deletions(-) diff --git a/drivers/video/fbdev/core/fbcon.c b/drivers/video/fbdev/core/fbcon.c index cef437817b0d..a3e87ab0e523 100644 --- a/driv

Re: [PATCH] video/fbdev/core: Mark debug-only variable as __maybe_unused

2020-11-01 Thread Peilin Ye
Hi Sam, On Sun, Nov 01, 2020 at 10:47:18AM +0100, Sam Ravnborg wrote: > Hi Thomas. > > On Wed, Oct 21, 2020 at 02:15:12PM +0200, Thomas Zimmermann wrote: > > Compiling fbcon.c gives > > > > ../drivers/video/fbdev/core/fbcon.c: In function 'fbcon_exit': > > ../drivers/video/fbdev/core/fbcon.c:335

[PATCH 2/2] fbcon: Prevent global-out-of-bounds read in fbcon_copy_font()

2020-10-31 Thread Peilin Ye
r.kernel.org Signed-off-by: Peilin Ye --- drivers/tty/vt/vt.c | 6 +++--- drivers/video/fbdev/core/fbcon.c | 8 ++-- include/linux/console.h | 2 +- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/drivers/tty/vt/vt.c b/drivers/tty/vt/vt.c index 9506a76f3ab6..

[PATCH 1/2] console: Remove dummy con_font_op() callback implementations

2020-10-31 Thread Peilin Ye
ad in fbcon_copy_font()" depends on this patch, so Cc: stable. Cc: sta...@vger.kernel.org Suggested-by: Daniel Vetter Signed-off-by: Peilin Ye --- Context: https://lore.kernel.org/lkml/CAKMK7uFY2zv0adjKJ_ORVFT7Zzwn075MaU0rEU7_FuqENLR=u...@mail.gmail.com/ drivers/usb/misc/sisusbvga/sisusb_

[PATCH RFC v2 4/5] fbdev: Avoid using FNTCHARCNT() and hard-coded font charcount

2020-10-28 Thread Peilin Ye
FNTCHARCNT() and 256. This patch depends on patch "Fonts: Add charcount field to font_desc". Signed-off-by: Peilin Ye --- FNTCHARCNT() now disappeared from drivers/video/fbdev/core/. There is one more in drivers/video/console/newport_con.c, but I think that file needs to be handled sepa

[PATCH v2 2/5] Fonts: Make font size unsigned in font_desc

2020-10-28 Thread Peilin Ye
`width` and `height` are defined as unsigned in our UAPI font descriptor `struct console_font`. Make them unsigned in our kernel font descriptor `struct font_desc`, too. Also, change the corresponding printk() format identifiers from `%d` to `%u`, in sti_select_fbfont(). Signed-off-by: Peilin Ye

Re: [PATCH 2/5] Fonts: Make font size unsigned in font_desc

2020-10-28 Thread Peilin Ye
On Wed, Oct 28, 2020 at 09:18:44AM +0100, Daniel Vetter wrote: > On Wed, Oct 28, 2020 at 01:43:07AM -0400, Peilin Ye wrote: > > On Tue, Oct 27, 2020 at 07:50:58PM +0100, Daniel Vetter wrote: > > > On Tue, Oct 27, 2020 at 12:33:05PM -0400, Peilin Ye wrote: > > > > I

Re: [PATCH 3/5] Fonts: Add charcount field to font_desc

2020-10-27 Thread Peilin Ye
On Tue, Oct 27, 2020 at 07:59:35PM +0100, Daniel Vetter wrote: > On Tue, Oct 27, 2020 at 12:34:26PM -0400, Peilin Ye wrote: > > Subsystems are assuming the number of characters of our built-in fonts. > > Include that information in our kernel font descriptor, `struc

[PATCH 3/5 v2] Fonts: Add charcount field to font_desc

2020-10-27 Thread Peilin Ye
Subsystems are assuming the number of characters of our built-in fonts. Include that information in our kernel font descriptor, `struct font_desc`. Signed-off-by: Peilin Ye Reviewed-by: Daniel Vetter --- Change in v2: - Rebase onto 5.10-rc1. include/linux/font.h | 1 + lib/fonts

Re: [PATCH 2/5] Fonts: Make font size unsigned in font_desc

2020-10-27 Thread Peilin Ye
On Tue, Oct 27, 2020 at 07:50:58PM +0100, Daniel Vetter wrote: > On Tue, Oct 27, 2020 at 12:33:05PM -0400, Peilin Ye wrote: > > It is improper to define `width` and `height` as signed in `struct > > font_desc`. Make them unsigned. Also, change the corresponding printk() > > fo

Re: Following up

2020-10-27 Thread Peilin Ye
On Tue, Oct 27, 2020 at 07:36:54PM +0100, Daniel Vetter wrote: > On Tue, Oct 27, 2020 at 5:50 PM Peilin Ye wrote: > > ...you mentioned code search, where & what should we look at, in order > > to confirm it's safe to remove them? > > Way back there was g

Re: [PATCH 4/5] fbcon: Avoid hard-coding built-in font charcount

2020-10-27 Thread Peilin Ye
On Tue, Oct 27, 2020 at 08:13:53PM +0100, Daniel Vetter wrote: > On Tue, Oct 27, 2020 at 12:37:29PM -0400, Peilin Ye wrote: > > fbcon_startup() and fbcon_init() are hard-coding the number of characters > > of our built-in fonts as 256. Recently, we included that information in >

Following up

2020-10-27 Thread Peilin Ye
conclusion, I think it's all about a few hard problems in fbcon.c. I'll keep trying and see how it goes. Thank you, Peilin Ye ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel

[PATCH 5/5] parisc/sticore: Avoid hard-coding built-in font charcount

2020-10-27 Thread Peilin Ye
nts: Add charcount field to font_desc". Signed-off-by: Peilin Ye --- $ # Build-tested (Ubuntu 20.04) $ sudo apt-get install binutils-hppa64-linux-gnu gcc-7-hppa64-linux-gnu $ cp arch/parisc/configs/generic-64bit_defconfig .config $ make -j`nproc` ARCH=parisc CROSS_COMPILE=hppa64-linux-gnu-

[PATCH 4/5] fbcon: Avoid hard-coding built-in font charcount

2020-10-27 Thread Peilin Ye
nts: Add charcount field to font_desc". Signed-off-by: Peilin Ye --- drivers/video/fbdev/core/fbcon.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/video/fbdev/core/fbcon.c b/drivers/video/fbdev/core/fbcon.c index cef437817b0d..e563847991b7 100644 --- a/drivers/vid

[PATCH 3/5] Fonts: Add charcount field to font_desc

2020-10-27 Thread Peilin Ye
Subsystems are assuming the number of characters of our built-in fonts. Include that information in our kernel font descriptor, `struct font_desc`. Signed-off-by: Peilin Ye --- include/linux/font.h | 1 + lib/fonts/font_10x18.c | 1 + lib/fonts/font_6x10.c | 1 + lib/fonts

[PATCH 2/5] Fonts: Make font size unsigned in font_desc

2020-10-27 Thread Peilin Ye
It is improper to define `width` and `height` as signed in `struct font_desc`. Make them unsigned. Also, change the corresponding printk() format identifiers from `%d` to `%u`, in sti_select_fbfont(). Signed-off-by: Peilin Ye --- Build-tested. drivers/video/console/sticore.c | 2 +- include

[PATCH 1/5] fbdev/atafb: Remove unused extern variables

2020-10-27 Thread Peilin Ye
Remove 6 unused extern variables to reduce confusion. It is worth mentioning that lib/fonts/font_8x8.c and lib/fonts/font_8x16.c also declare `fontdata_8x8` and `fontdata_8x16` respectively, and this file has nothing to do with them. Signed-off-by: Peilin Ye --- $ # Build-tested (Ubuntu 20.04

[PATCH 0/5] Preparation work for using font_desc in vc_data

2020-10-27 Thread Peilin Ye
Hi Daniel, Hi Greg, Hi all, We are planning to use `font_desc` instead of `console_font` in `vc_data`, and this is just some prep work for it. It doesn't do much, but at least it removes two "FIXME"s in fbcon.c :) Peilin Ye (5): [1/5] fbdev/atafb: Remove unused extern variables

Re: [PATCH 1/2] Fonts: Support FONT_EXTRA_WORDS macros for font_6x8

2020-10-19 Thread Peilin Ye
On Sun, Oct 18, 2020 at 11:51:19PM +0200, Daniel Vetter wrote: > On Sun, Oct 18, 2020 at 10:45 PM Peilin Ye wrote: > > I'm confused, I see it on LKML in the link above. Sure I'll resend soon. > > My brain didn't work, sorry about the confusion. > > I'

[PATCH 2/2 RESEND] docs: fb: Add font_6x8 to available built-in fonts

2020-10-18 Thread Peilin Ye
Recently we added a new 6x8 font in commit e2028c8e6bf9 ("lib/fonts: add font 6x8 for OLED display"). Add its name to the "compiled-in fonts" list. Signed-off-by: Peilin Ye --- Resending +Cc: dri-devel, sorry if I spammed. Documentation/fb/fbcon.rst | 2 +- 1 file change

Re: [PATCH 1/2] Fonts: Support FONT_EXTRA_WORDS macros for font_6x8

2020-10-18 Thread Peilin Ye
On Sun, Oct 18, 2020 at 10:33:11PM +0200, Daniel Vetter wrote: > On Sun, Oct 18, 2020 at 10:18 PM Peilin Ye wrote: > > 2/2 is just updating the fb documentation: > > > > [PATCH 2/2] docs: fb: Add font_6x8 to available built-in fonts > > h

Re: [PATCH 1/2] Fonts: Support FONT_EXTRA_WORDS macros for font_6x8

2020-10-18 Thread Peilin Ye
On Sun, Oct 18, 2020 at 10:09:06PM +0200, Daniel Vetter wrote: > Adding dri-devel too, not sure anyone is still listening on linux-fbdev. I see, thanks! > On Sun, Oct 18, 2020 at 8:13 PM Peilin Ye wrote: > > > > Recently, in commit 6735b4632def ("Fonts: Support FONT_EXT

Re: [git pull] drm next pull for 5.10-rc1

2020-10-15 Thread Peilin Ye
On Thu, Oct 15, 2020 at 10:53:28AM -0400, Alex Deucher wrote: > On Thu, Oct 15, 2020 at 9:59 AM Peilin Ye wrote: > > It has been applied to linux-next twice, for unknown reasons. Thank you! > > The patch was already in drm-next, but since it was a bug fix it was > applied it t

Re: [git pull] drm next pull for 5.10-rc1

2020-10-15 Thread Peilin Ye
Hi all, On Thu, Oct 15, 2020 at 11:33:08AM +1000, Dave Airlie wrote: > Peilin Ye (1): > drm/amdgpu: Prevent kernel-infoleak in amdgpu_info_ioctl() This patch is already in mainline: commit 543e8669ed9bfb30545fd52bc0e047ca4df7fb31 Author: Peilin Ye Date: Tue Jul 28 15:29:24 2020

Re: [PATCH 0/3] Prevent out-of-bounds access for built-in font data buffers

2020-10-01 Thread Peilin Ye
On Wed, Sep 30, 2020 at 01:52:11PM +0200, Greg Kroah-Hartman wrote: > On Wed, Sep 30, 2020 at 01:25:14PM +0200, Daniel Vetter wrote: > > On Wed, Sep 30, 2020 at 12:56 PM Peilin Ye wrote: > > > Yes, and built-in fonts don't use refcount. Or maybe we can let > > >

Re: [PATCH 0/3] Prevent out-of-bounds access for built-in font data buffers

2020-10-01 Thread Peilin Ye
On Wed, Sep 30, 2020 at 11:53:17AM +0200, Daniel Vetter wrote: > On Wed, Sep 30, 2020 at 03:11:51AM -0400, Peilin Ye wrote: > > On Tue, Sep 29, 2020 at 04:38:49PM +0200, Daniel Vetter wrote: > > > On Tue, Sep 29, 2020 at 2:34 PM Peilin Ye wrote: > > > > Ah, and s

Re: [PATCH 0/3] Prevent out-of-bounds access for built-in font data buffers

2020-09-30 Thread Peilin Ye
f, aside from > Greg's inbox :-) Ah, I've been checking lore.kernel.org/dri-devel/ once a while. Sure! I'll subscribe right now :) Peilin Ye ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel

Re: [PATCH 0/3] Prevent out-of-bounds access for built-in font data buffers

2020-09-30 Thread Peilin Ye
On Tue, Sep 29, 2020 at 04:38:49PM +0200, Daniel Vetter wrote: > On Tue, Sep 29, 2020 at 2:34 PM Peilin Ye wrote: > > It seems that users don't use `console_font` directly, they use > > `console_font_op`. Then, in TTY: > > Wow, this is a maze :-/ > > > (drive

Re: [PATCH 0/3] Prevent out-of-bounds access for built-in font data buffers

2020-09-30 Thread Peilin Ye
to support new bulit-in fonts that have more than 256 characters. This seems really nice, so I'd like to spend some time working on it. However before I start working on real patches, do you have suggestions about which console driver I should start with, or how should I split up the wor

Re: [PATCH 0/3] Prevent out-of-bounds access for built-in font data buffers

2020-09-30 Thread Peilin Ye
On Wed, Sep 30, 2020 at 07:26:52AM +0200, Jiri Slaby wrote: > On 29. 09. 20, 14:34, Peilin Ye wrote: > > the work in general? I couldn't think of how do we clean up subsystems > > one by one, while keeping a `console_font` in `struct vc_data`. > > Hi, > > feel

Re: KASAN: use-after-free Read in bit_putcs

2020-09-28 Thread Peilin Ye
=== > [ 227.084729] BUG: KASAN: slab-out-of-bounds in soft_cursor+0x34e/0x4a0 > [ 227.084748] Read of size 9 at addr 8880c98d5930 by task a.out/1662 Very interesting, I remember seeing this on the syzbot dashboard... Yes, I gue

Re: KASAN: use-after-free Read in bit_putcs

2020-09-28 Thread Peilin Ye
est way is to add a range check in bit_putcs(), or bit_putcs_aligned(). ...but yeah, that `VT_RESIZEX` ioctl looks really buggy, and is already causing more issues: KASAN: global-out-of-bounds Read in fbcon_get_font Link: https://syzkaller.appspot.com/bug?id=08b8be45afea11888776f897895aef9ad1c3ecfd This was also caused by `VT_RESIZEX`... Thank you, Peilin Ye ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel

Re: [PATCH 0/3] Prevent out-of-bounds access for built-in font data buffers

2020-09-28 Thread Peilin Ye
do this! I'm just a beginner, but I will try to do what I can do. Thank you, Peilin Ye ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel

Re: [PATCH 0/3] Prevent out-of-bounds access for built-in font data buffers

2020-09-28 Thread Peilin Ye
er fonts and built-in fonts, so I wanted a single solution for both of them. I think we can't really introduce `kernel_console_font` while keeping these macros, that would make the error handling logics etc. very messy. I'm not very sure what to do now. Should I give it another try cleaning up all the macros? And thank you for reviewing this! Peilin Ye ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel

[PATCH 3/3] fbcon: Fix global-out-of-bounds read in fbcon_get_font()

2020-09-25 Thread Peilin Ye
d-and-tested-by: syzbot+29d4ed7f3bdedf2aa...@syzkaller.appspotmail.com Link: https://syzkaller.appspot.com/bug?id=08b8be45afea11888776f897895aef9ad1c3ecfd Signed-off-by: Peilin Ye --- drivers/video/fbdev/core/fbcon.c | 12 1 file changed, 12 insertions(+) diff --git a/drivers/video/fbdev/core/

Re: [PATCH 0/3] Prevent out-of-bounds access for built-in font data buffers

2020-09-25 Thread Peilin Ye
On Thu, Sep 24, 2020 at 04:09:37PM +0200, Greg Kroah-Hartman wrote: > On Thu, Sep 24, 2020 at 09:38:22AM -0400, Peilin Ye wrote: > > Peilin Ye (3): > > fbdev, newport_con: Move FONT_EXTRA_WORDS macros into linux/font.h > > Fonts: Support FONT_EXTRA_WORDS macros for built

[PATCH 0/3] Prevent out-of-bounds access for built-in font data buffers

2020-09-25 Thread Peilin Ye
he fourth word in newport_set_font() properly. Many thanks to Greg Kroah-Hartman , who reviewed and improved this series! [1]: KASAN: global-out-of-bounds Read in fbcon_get_font https://syzkaller.appspot.com/bug?id=08b8be45afea11888776f897895aef9ad1c3ecfd Peilin Ye (3): fbdev, newport_con: M

Re: [PATCH 0/3] Prevent out-of-bounds access for built-in font data buffers

2020-09-25 Thread Peilin Ye
drivers/tty/vt/vt.c| con_init | (struct > console_font)->height | 0 > drivers/tty/vt/vt.c| con_font_set | (struct > console_font)->height | 1-32 > drivers/tty/vt/vt.c| con_font_default

[PATCH 1/3] fbdev, newport_con: Move FONT_EXTRA_WORDS macros into linux/font.h

2020-09-25 Thread Peilin Ye
Signed-off-by: Peilin Ye --- drivers/video/console/newport_con.c | 7 +-- drivers/video/fbdev/core/fbcon.h| 7 --- drivers/video/fbdev/core/fbcon_rotate.c | 1 + drivers/video/fbdev/core/tileblit.c | 1 + include/linux/font.h| 8 5 files changed

Re: [PATCH 0/3] Prevent out-of-bounds access for built-in font data buffers

2020-09-25 Thread Peilin Ye
Hi! On Thu, Sep 24, 2020 at 02:42:18PM +, David Laight wrote: > > On Thu, Sep 24, 2020 at 09:38:22AM -0400, Peilin Ye wrote: > > > Hi all, > > > > > > syzbot has reported [1] a global out-of-bounds read issue in > > > fbcon_get_font(). A malicious u

[PATCH 2/3] Fonts: Support FONT_EXTRA_WORDS macros for built-in fonts

2020-09-25 Thread Peilin Ye
l.org Link: https://syzkaller.appspot.com/bug?id=08b8be45afea11888776f897895aef9ad1c3ecfd Signed-off-by: Peilin Ye --- include/linux/font.h | 5 + lib/fonts/font_10x18.c | 9 - lib/fonts/font_6x10.c | 9 + lib/fonts/font_6x11.c | 9 - lib/fonts/f

[Linux-kernel-mentees] [PATCH] drm/amdgpu: Prevent kernel-infoleak in amdgpu_info_ioctl()

2020-07-28 Thread Peilin Ye
. Fix it by using memset() instead. Cc: sta...@vger.kernel.org Fixes: c193fa91b918 ("drm/amdgpu: information leak in amdgpu_info_ioctl()") Fixes: d38ceaf99ed0 ("drm/amdgpu: add core driver (v4)") Suggested-by: Dan Carpenter Signed-off-by: Peilin Ye --- $ pahole -C "drm_am

Re: [Linux-kernel-mentees] [PATCH v2] drm/bufs: Prevent kernel-infoleak in copy_one_buf()

2020-07-28 Thread Peilin Ye
On Tue, Jul 28, 2020 at 12:35:17PM +, David Laight wrote: > From: Peilin Ye > > Sent: 28 July 2020 12:52 > > Currently `struct drm_buf_desc` is defined as follows: > > > > struct drm_buf_desc { > > int count; > > int size; > > int

Re: [Linux-kernel-mentees] [PATCH] drm/bufs: Prevent kernel-infoleak in copy_one_buf()

2020-07-28 Thread Peilin Ye
On Tue, Jul 28, 2020 at 10:11:09AM +0200, Arnd Bergmann wrote: > On Tue, Jul 28, 2020 at 3:45 AM Peilin Ye wrote: > > > > copy_one_buf() is copying uninitialized stack memory to userspace due to > > the compiler not initializing holes in statically allocated structures. >

[Linux-kernel-mentees] [PATCH v2] drm/bufs: Prevent kernel-infoleak in copy_one_buf()

2020-07-28 Thread Peilin Ye
rt` fields) in this statically allocated structure. Prevent it by initializing `v` with memset(). Cc: sta...@vger.kernel.org Fixes: 5c7640ab6258 ("switch compat_drm_infobufs() to drm_ioctl_kernel()") Suggested-by: Dan Carpenter Acked-by: Arnd Bergmann Signed-off-by: Peilin

[Linux-kernel-mentees] [PATCH] drm/bufs: Prevent kernel-infoleak in copy_one_buf()

2020-07-28 Thread Peilin Ye
ernel()") Suggested-by: Dan Carpenter Signed-off-by: Peilin Ye --- drivers/gpu/drm/drm_bufs.c | 12 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/drm_bufs.c b/drivers/gpu/drm/drm_bufs.c index a0735fbc144b..f99cd4a3f951 100644 --- a/drivers/gpu/drm/drm_bu