Skip to content

Commit

Permalink
drivers/net/eql.c: prevent reading uninitialized stack memory
Browse files Browse the repository at this point in the history
Fixed formatting (tabs and line breaks).

The EQL_GETMASTRCFG device ioctl allows unprivileged users to read 16
bytes of uninitialized stack memory, because the "master_name" member of
the master_config_t struct declared on the stack in eql_g_master_cfg()
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: David S. Miller <davem@davemloft.net>
  • Loading branch information
Dan Rosenberg authored and David S. Miller committed Sep 17, 2010
1 parent 7011e66 commit 4446718
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/net/eql.c
Original file line number Diff line number Diff line change
Expand Up @@ -555,6 +555,8 @@ static int eql_g_master_cfg(struct net_device *dev, master_config_t __user *mcp)
equalizer_t *eql;
master_config_t mc;

memset(&mc, 0, sizeof(master_config_t));

if (eql_is_master(dev)) {
eql = netdev_priv(dev);
mc.max_slaves = eql->max_slaves;
Expand Down

0 comments on commit 4446718

Please sign in to comment.