1. 15 Feb, 2013 32 commits
  2. 14 Feb, 2013 2 commits
    • Peter Huewe's avatar
      staging/rtl8192u/ieee80211: Fix buffer overflow in ieee80211_softmac_wx.c · 67a88e63
      Peter Huewe authored
      Clang/scan-build complains about a possible buffer overflow in
      ieee80211_wx_get_name:
      
      .../staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c:499:3:
      warning: String copy function overflows destination buffer
      	strcat(wrqu->name," link..");
      
      .../staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c:497:3:
      warning: String copy function overflows destination buffer
      	strcat(wrqu->name," linked");
      
      The buffer wrqu->name is only IFNAMSIZ bytes big (currently 16),
      so if we have a "802.11b/g/n linked" device we overrun the buffer by 3
      bytes.
      
      -> Use strlcopy / strlcat to populate the name.
      This is done in a similar fashion in
      staging/rtl8187se/ieee80211/ieee80211_softmac_wx.c
      
      While at it cleaned some whitespace issues.
      Signed-off-by: default avatarPeter Huewe <peterhuewe@gmx.de>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      67a88e63
    • Peter Huewe's avatar
      staging/wlan-ng: Fix 'Branch condition evaluates to a garbage value' in p80211netdev.c · fae7e4d3
      Peter Huewe authored
      clang/scan-build complains that:
      p80211netdev.c:451:6: warning: Branch condition evaluates to a garbage
      value
              if ((p80211_wep.data) && (p80211_wep.data != skb->data))
      	            ^~~~~~~~~~~~~~~~~
      
      This can happen in p80211knetdev_hard_start_xmit if
      - if (wlandev->state != WLAN_DEVICE_OPEN) evaluates to true.
      the execution flow then continues at the 'failed' label where
      p80211_wep.data is used without being initialized first.
      
      -> Initialize the data field to NULL to fix this issue.
      Signed-off-by: default avatarPeter Huewe <peterhuewe@gmx.de>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      fae7e4d3
  3. 13 Feb, 2013 4 commits
  4. 11 Feb, 2013 2 commits
    • Dan Magenheimer's avatar
      staging/zcache: Fix/improve zcache writeback code, tie to a config option · 76426daf
      Dan Magenheimer authored
      It was observed by Andrea Arcangeli in 2011 that zcache can get "full"
      and there must be some way for compressed swap pages to be (uncompressed
      and then) sent through to the backing swap disk.  A prototype of this
      functionality, called "unuse", was added in 2012 as part of a major update
      to zcache (aka "zcache2"), but was left unfinished due to the unfortunate
      temporary fork of zcache.
      
      This earlier version of the code had an unresolved memory leak
      and was anyway dependent on not-yet-upstream frontswap and mm changes.
      The code was meanwhile adapted by Seth Jennings for similar
      functionality in zswap (which he calls "flush").  Seth also made some
      clever simplifications which are herein ported back to zcache.  As a
      result of those simplifications, the frontswap changes are no longer
      necessary, but a slightly different (and simpler) set of mm changes are
      still required [1].  The memory leak is also fixed.
      
      Due to feedback from akpm in a zswap thread, this functionality in zcache
      has now been renamed from "unuse" to "writeback".
      
      Although this zcache writeback code now works, there are open questions
      as how best to handle the policy that drives it.  As a result, this
      patch also ties writeback to a new config option.  And, since the
      code still depends on not-yet-upstreamed mm patches, to avoid build
      problems, the config option added by this patch temporarily depends
      on "BROKEN"; this config dependency can be removed in trees that
      contain the necessary mm patches.
      
      [1] https://lkml.org/lkml/2013/1/29/540/ https://lkml.org/lkml/2013/1/29/539/Signed-off-by: default avatarDan Magenheimer <dan.magenheimer@oracle.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      76426daf
    • Joe Perches's avatar
      staging: Remove unnecessary OOM messages · 78110bb8
      Joe Perches authored
      alloc failures already get standardized OOM
      messages and a dump_stack.
      
      For the affected mallocs around these OOM messages:
      
      Converted kzallocs with multiplies to kcalloc.
      Converted kmallocs with multiplies to kmalloc_array.
      Converted a kmalloc/strlen/strncpy to kstrdup.
      Moved a spin_lock below a removed OOM message and
      removed a now unnecessary spin_unlock.
      Neatened alignment and whitespace.
      Signed-off-by: default avatarJoe Perches <joe@perches.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      78110bb8