Skip to content

Commit

Permalink
drivers/video/via/ioctl.c: prevent reading uninitialized stack memory
Browse files Browse the repository at this point in the history
The VIAFB_GET_INFO device ioctl allows unprivileged users to read 246
bytes of uninitialized stack memory, because the "reserved" member of
the viafb_ioctl_info struct declared on the stack is not altered or
zeroed before being copied back to the user.  This patch takes care of
it.

Signed-off-by: Dan Rosenberg <dan.j.rosenberg@gmail.com>
Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
  • Loading branch information
Dan Rosenberg authored and Florian Tobias Schandinat committed Sep 15, 2010
1 parent f270983 commit b4aaa78
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/video/via/ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ int viafb_ioctl_get_viafb_info(u_long arg)
{
struct viafb_ioctl_info viainfo;

memset(&viainfo, 0, sizeof(struct viafb_ioctl_info));

viainfo.viafb_id = VIAID;
viainfo.vendor_id = PCI_VIA_VENDOR_ID;

Expand Down

0 comments on commit b4aaa78

Please sign in to comment.