]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commit
mwifiex: debugfs: Fix (sometimes) off-by-1 SSID print
authorBrian Norris <briannorris@chromium.org>
Mon, 9 Jan 2017 23:33:50 +0000 (15:33 -0800)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Tue, 20 Jun 2017 10:16:27 +0000 (12:16 +0200)
commit48109f0c37bfae15dee02876fa6fbe8f560ddfcb
tree38575a620abefaa3e9bbec09fa78ce113a32da7f
parentbffa0d7dc30827bffd009c3e9aa37a411efbff96
mwifiex: debugfs: Fix (sometimes) off-by-1 SSID print

BugLink: http://bugs.launchpad.net/bugs/1691418
commit 6183468a23fc6b6903f8597982017ad2c7fdefcf upstream.

Similar to commit fcd2042e8d36 ("mwifiex: printk() overflow with 32-byte
SSIDs"), we failed to account for the existence of 32-char SSIDs in our
debugfs code. Unlike in that case though, we zeroed out the containing
struct first, and I'm pretty sure we're guaranteed to have some padding
after the 'ssid.ssid' and 'ssid.ssid_len' fields (the struct is 33 bytes
long).

So, this is the difference between:

  # cat /sys/kernel/debug/mwifiex/mlan0/info
  ...
  essid="0123456789abcdef0123456789abcdef "
  ...

and the correct output:

  # cat /sys/kernel/debug/mwifiex/mlan0/info
  ...
  essid="0123456789abcdef0123456789abcdef"
  ...

Fixes: 5e6e3a92b9a4 ("wireless: mwifiex: initial commit for Marvell mwifiex driver")
Signed-off-by: Brian Norris <briannorris@chromium.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
drivers/net/wireless/mwifiex/debugfs.c