• Brian Norris's avatar
    mwifiex: debugfs: Fix (sometimes) off-by-1 SSID print · 80ffaf9e
    Brian Norris authored
    commit 6183468a upstream.
    
    Similar to commit fcd2042e ("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: 5e6e3a92 ("wireless: mwifiex: initial commit for Marvell mwifiex driver")
    Signed-off-by: default avatarBrian Norris <briannorris@chromium.org>
    Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
    [bwh: Backported to 3.2: adjust filename]g
    Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
    80ffaf9e
debugfs.c 21.1 KB