From: Wenjia Zhao <driverfuzzing@gmail.com>
To: unlisted-recipients:; (no To-header on input)
Cc: driverfuzzing@gmail.com,
Florian Tobias Schandinat <FlorianSchandinat@gmx.de>,
Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>,
linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org,
linux-kernel@vger.kernel.org
Subject: [PATCH 3/3] video: fbdev: fix the out-of-bounds access cr_data->bak
Date: Mon, 1 Feb 2021 09:56:34 -0600 [thread overview]
Message-ID: <1612194994-50994-1-git-send-email-driverfuzzing@gmail.com> (raw)
The size of cr_data->bak is CURSOR_SIZE/4, however the access size in
the is
CURSOR_SIZE in the loop. It causes the out-of-bounds access.
Signed-off-by: Wenjia Zhao <driverfuzzing@gmail.com>
---
drivers/video/fbdev/via/viafbdev.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/video/fbdev/via/viafbdev.c b/drivers/video/fbdev/via/viafbdev.c
index 22deb34..ef217cc 100644
--- a/drivers/video/fbdev/via/viafbdev.c
+++ b/drivers/video/fbdev/via/viafbdev.c
@@ -839,7 +839,7 @@ static int viafb_cursor(struct fb_info *info, struct fb_cursor *cursor)
if (cursor->set & FB_CUR_SETSHAPE) {
struct {
u8 data[CURSOR_SIZE];
- u32 bak[CURSOR_SIZE / 4];
+ u32 bak[CURSOR_SIZE];
} *cr_data = kzalloc(sizeof(*cr_data), GFP_ATOMIC);
int size = ((cursor->image.width + 7) >> 3) *
cursor->image.height;
--
2.7.4
reply other threads:[~2021-02-01 15:57 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=1612194994-50994-1-git-send-email-driverfuzzing@gmail.com \
--to=driverfuzzing@gmail.com \
--cc=FlorianSchandinat@gmx.de \
--cc=b.zolnierkie@samsung.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=linux-fbdev@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).