Commit 44467187 authored by Dan Rosenberg's avatar Dan Rosenberg Committed by David S. Miller

drivers/net/eql.c: prevent reading uninitialized stack memory

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: default avatarDan Rosenberg <dan.j.rosenberg@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 7011e660
...@@ -555,6 +555,8 @@ static int eql_g_master_cfg(struct net_device *dev, master_config_t __user *mcp) ...@@ -555,6 +555,8 @@ static int eql_g_master_cfg(struct net_device *dev, master_config_t __user *mcp)
equalizer_t *eql; equalizer_t *eql;
master_config_t mc; master_config_t mc;
memset(&mc, 0, sizeof(master_config_t));
if (eql_is_master(dev)) { if (eql_is_master(dev)) {
eql = netdev_priv(dev); eql = netdev_priv(dev);
mc.max_slaves = eql->max_slaves; mc.max_slaves = eql->max_slaves;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment