From: "chenjun (AM)" <chenjun102@huawei.com>
To: Greg KH <gregkh@linuxfoundation.org>
Cc: "stable@vger.kernel.org" <stable@vger.kernel.org>,
"deller@gmx.de" <deller@gmx.de>,
"geert@linux-m68k.org" <geert@linux-m68k.org>,
"b.zolnierkie@samsung.com" <b.zolnierkie@samsung.com>,
"xuqiang (M)" <xuqiang36@huawei.com>,
Xiujianfeng <xiujianfeng@huawei.com>
Subject: Re: [PATCH stable 4.19 4.14 0/2] add fix patch for CVE-2021-3365
Date: Mon, 1 Aug 2022 02:56:30 +0000 [thread overview]
Message-ID: <263b30ce605b4dbbb3d7018188511f50@huawei.com> (raw)
In-Reply-To: YuZ3WAOVRqmcyvHQ@kroah.com
在 2022/7/31 20:37, Greg KH 写道:
> On Fri, Jul 29, 2022 at 03:11:38AM +0000, Chen Jun wrote:
>> refer to https://lore.kernel.org/all/20220706150253.2186-1-deller@gmx.de/
>> 3 patches are provided to fix CVE-2021-3365 (When sending malicous data
>> to kernel by ioctl cmd FBIOPUT_VSCREENINFO,kernel will write memory out
>> of bounds. https://nvd.nist.gov/vuln/detail/CVE-2021-33655) in mainline.
>>
>> But only
>> commit 65a01e601dbb ("fbcon: Disallow setting font bigger than screen size")
>> was backported to stable (4.19,4.14).
>>
>> without other two commit
>> commit e64242caef18 ("fbcon: Prevent that screen size is smaller than font size")
>> commit 6c11df58fd1a ("fbmem: Check virtual screen sizes in fb_set_var()")
>> The problem still exists.
>>
>> static long do_fb_ioctl(struct fb_info *info, unsigned int cmd, unsigned long arg)
>> fb_set_var(info, &var);
>> fb_notifier_call_chain(evnt, &event); // evnt = FB_EVENT_MODE_CHANGE
>>
>> static int fbcon_event_notify(struct notifier_block *self,
>> unsigned long action, void *data)
>> fbcon_modechanged(info);
>> updatescrollmode(p, info, vc);
>> ...
>> p->vrows = vyres/fh;
>> if (yres > (fh * (vc->vc_rows + 1)))
>> p->vrows -= (yres - (fh * vc->vc_rows)) / fh;
>> if ((yres % fh) && (vyres % fh < yres % fh))
>> p->vrows--; [1]
>> [1]: p->vrows could be -1, like what CVE-2021-3365 described.
>>
>> I think, the two commits should be backported to 4.19 and 4.14.
>>
>> Helge Deller (2):
>> fbcon: Prevent that screen size is smaller than font size
>> fbmem: Check virtual screen sizes in fb_set_var()
>>
>> drivers/video/fbdev/core/fbcon.c | 28 ++++++++++++++++++++++++++++
>> drivers/video/fbdev/core/fbmem.c | 20 +++++++++++++++++---
>> include/linux/fbcon.h | 4 ++++
>> 3 files changed, 49 insertions(+), 3 deletions(-)
>>
>> --
>> 2.17.1
>>
>
> This breaks the build on 4.14.y, did you test it there?
>
> The error is:
> ERROR: "is_console_locked" [drivers/video/fbdev/core/fb.ko] undefined!
>
if CONFIG_FRAMEBUFFER_CONSOLE = M,
"d48de54a9dab printk: Export is_console_locked" is needed, which merged
in 4.19.
I will sent the patch.
> Can you please fix this up and also do a 4.9.y version?
>
ok, I will do it.
> thanks,
>
> greg k-h
>
--
Regards
Chen Jun
prev parent reply other threads:[~2022-08-01 2:56 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-29 3:11 [PATCH stable 4.19 4.14 0/2] add fix patch for CVE-2021-3365 Chen Jun
2022-07-29 3:11 ` [PATCH stable 4.19 4.14 1/2] fbcon: Prevent that screen size is smaller than font size Chen Jun
2022-07-29 3:11 ` [PATCH stable 4.19 4.14 2/2] fbmem: Check virtual screen sizes in fb_set_var() Chen Jun
2022-07-31 12:36 ` [PATCH stable 4.19 4.14 0/2] add fix patch for CVE-2021-3365 Greg KH
2022-08-01 2:56 ` chenjun (AM) [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=263b30ce605b4dbbb3d7018188511f50@huawei.com \
--to=chenjun102@huawei.com \
--cc=b.zolnierkie@samsung.com \
--cc=deller@gmx.de \
--cc=geert@linux-m68k.org \
--cc=gregkh@linuxfoundation.org \
--cc=stable@vger.kernel.org \
--cc=xiujianfeng@huawei.com \
--cc=xuqiang36@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox