20 Aug, 2013

2 commits

  • commit c319d50bfcf678c2857038276d9fab3c6646f3bf upstream.

    This is similar to the race Linus had reported, but in this case
    it's an older bug: nl80211_prepare_wdev_dump() uses the wiphy
    index in cb->args[0] as it is and thus parses the message over
    and over again instead of just once because 0 is the first valid
    wiphy index. Similar code in nl80211_testmode_dump() correctly
    offsets the wiphy_index by 1, do that here as well.

    Reported-by: Ben Hutchings
    Signed-off-by: Johannes Berg
    Signed-off-by: Greg Kroah-Hartman

    Johannes Berg
     
  • commit 74418edec915d0f446debebde08d170c7b8ba0ee upstream.

    When a P2P GO interface goes down, cfg80211 doesn't properly
    tear it down, leading to warnings later. Add the GO interface
    type to the enumeration to tear it down like AP interfaces.
    Otherwise, we leave it pending and mac80211's state can get
    very confused, leading to warnings later.

    Reported-by: Ilan Peer
    Tested-by: Ilan Peer
    Reviewed-by: Emmanuel Grumbach
    Signed-off-by: Johannes Berg
    Signed-off-by: Greg Kroah-Hartman

    Johannes Berg
     

12 Aug, 2013

1 commit

  • commit a0ec570f4f69c4cb700d743a915096c2c8f56a99 upstream.

    These two events were sent to the default network
    namespace.

    This caused AP mode in a non-default netns to not
    work correctly. Mgmt tx status was multicasted to
    a different (default) netns instead of the one the
    AP was in.

    Signed-off-by: Michal Kazior
    Signed-off-by: Johannes Berg
    Signed-off-by: Greg Kroah-Hartman

    Michal Kazior
     

20 Jun, 2013

1 commit

  • Since my commit 3713b4e364 ("nl80211: allow splitting wiphy
    information in dumps"), nl80211_dump_wiphy() uses the global
    nl80211_fam.attrbuf for parsing the incoming data. This wouldn't
    be a problem if it only did so on the first dump iteration which
    is locked against other commands in generic netlink, but due to
    space constraints in cb->args (the needed state doesn't fit) I
    decided to always parse the original message. That's racy though
    since nl80211_fam.attrbuf could be used by some other parsing in
    generic netlink concurrently.

    For now, fix this by allocating a separate parse buffer (it's a
    bit too big for the stack, currently 1448 bytes on 64-bit). For
    -next, I'll change the code to parse into the global buffer in
    the first round only and then allocate a smaller buffer to keep
    the data in cb->args.

    Reported-by: Linus Torvalds
    Acked-by: David S. Miller
    Acked-by: John W. Linville
    Signed-off-by: Johannes Berg

    Johannes Berg
     

24 May, 2013

2 commits


17 May, 2013

5 commits

  • The code sending the current WoWLAN TCP wakeup settings in
    nl80211_send_wowlan_tcp() is not closing the nested attribute,
    thus causing the parser to get confused on the receiver side
    in userspace (iw). Fix this.

    Cc: stable@vger.kernel.org [3.9]
    Reported-by: Deepak Arora
    Signed-off-by: Johannes Berg

    Johannes Berg
     
  • When the interface goes down, there's no need to call
    cfg80211_mlme_down() after __cfg80211_disconnect() as
    the latter will call the former (if appropriate.)

    Also, in __cfg80211_disconnect(), if the cfg80211 SME
    isn't used, __cfg80211_disconnected() may still need
    to be called (depending on the current state) so that
    the SME state gets cleared.

    Signed-off-by: Johannes Berg

    Johannes Berg
     
  • Adding the attributes fixes an issue with P2P Device not
    working properly for management frame TX.

    Signed-off-by: Ilan Peer
    Signed-off-by: Johannes Berg

    Ilan Peer
     
  • If the device reports a non-wireless wakeup reason, the
    tracing code crashes trying to dereference a NULL pointer.
    Fix this by checking the pointer on all accesses and also
    add a non_wireless tag to the event.

    Cc: stable@vger.kernel.org
    Signed-off-by: Johannes Berg

    Johannes Berg
     
  • If rfkill_register() fails in wiphy_register() the struct device
    is unregistered but everything else isn't (regulatory, debugfs)
    and we even leave the wiphy instance on all internal lists even
    though it will likely be freed soon, which is clearly a problem.
    Fix this by cleaning up properly.

    Cc: stable@vger.kernel.org
    Signed-off-by: Johannes Berg

    Johannes Berg
     

02 May, 2013

1 commit

  • Pull VFS updates from Al Viro,

    Misc cleanups all over the place, mainly wrt /proc interfaces (switch
    create_proc_entry to proc_create(), get rid of the deprecated
    create_proc_read_entry() in favor of using proc_create_data() and
    seq_file etc).

    7kloc removed.

    * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: (204 commits)
    don't bother with deferred freeing of fdtables
    proc: Move non-public stuff from linux/proc_fs.h to fs/proc/internal.h
    proc: Make the PROC_I() and PDE() macros internal to procfs
    proc: Supply a function to remove a proc entry by PDE
    take cgroup_open() and cpuset_open() to fs/proc/base.c
    ppc: Clean up scanlog
    ppc: Clean up rtas_flash driver somewhat
    hostap: proc: Use remove_proc_subtree()
    drm: proc: Use remove_proc_subtree()
    drm: proc: Use minor->index to label things, not PDE->name
    drm: Constify drm_proc_list[]
    zoran: Don't print proc_dir_entry data in debug
    reiserfs: Don't access the proc_dir_entry in r_open(), r_start() r_show()
    proc: Supply an accessor for getting the data from a PDE's parent
    airo: Use remove_proc_subtree()
    rtl8192u: Don't need to save device proc dir PDE
    rtl8187se: Use a dir under /proc/net/r8180/
    proc: Add proc_mkdir_data()
    proc: Move some bits from linux/proc_fs.h to linux/{of.h,signal.h,tty.h}
    proc: Move PDE_NET() to fs/proc/proc_net.c
    ...

    Linus Torvalds
     

30 Apr, 2013

1 commit

  • Don't use create_proc_read_entry() as that is deprecated, but rather use
    proc_create_data() and seq_file instead.

    Signed-off-by: David Howells
    Acked-by: Greg Kroah-Hartman
    cc: Jouni Malinen
    cc: John W. Linville
    cc: Johannes Berg
    cc: linux-wireless@vger.kernel.org
    cc: netdev@vger.kernel.org
    cc: devel@driverdev.osuosl.org
    Signed-off-by: Al Viro

    David Howells
     

24 Apr, 2013

1 commit


22 Apr, 2013

4 commits

  • Some protocols need a more reliable connection to complete
    successful in reasonable time. This patch adds a user-space
    API to indicate the wireless driver that a critical protocol
    is about to commence and when it is done, using nl80211 primitives
    NL80211_CMD_CRIT_PROTOCOL_START and NL80211_CRIT_PROTOCOL_STOP.

    There can be only on critical protocol session started per
    registered cfg80211 device.

    The driver can support this by implementing the cfg80211 callbacks
    .crit_proto_start() and .crit_proto_stop(). Examples of protocols
    that can benefit from this are DHCP, EAPOL, APIPA. Exactly how the
    link can/should be made more reliable is up to the driver. Things
    to consider are avoid scanning, no multi-channel operations, and
    alter coexistence schemes.

    Reviewed-by: Pieter-Paul Giesberts
    Reviewed-by: Franky (Zhenhui) Lin
    Signed-off-by: Arend van Spriel
    Signed-off-by: Johannes Berg

    Arend van Spriel
     
  • In cfg80211_can_use_iftype_chan(), check for P2P Device
    first, and then for netdevs. This doesn't really change
    anything but makes the code a bit easier to read since
    it may not be obvious for everyone at first that a P2P
    device has no netdev.

    Signed-off-by: Johannes Berg

    Johannes Berg
     
  • cfg80211_stop_p2p_device() requires the devlist_mtx to
    be held, but nl80211_stop_p2p_device() doesn't acquire
    it which is a locking error and causes a warning (when
    lockdep is enabled). Fix this.

    Signed-off-by: Johannes Berg

    Johannes Berg
     
  • Johannes Berg
     

19 Apr, 2013

1 commit

  • Most dump callbacks, including the scan results one, use
    the netdev to identify what to do, which is incorrect for
    the P2P_DEVICE support, it needs to be able to get the
    scan result from the wdev. Change all dumps to unify the
    code, but ones other than scan don't really support being
    executed on a wdev that has no netdev.

    Signed-off-by: Johannes Berg

    Johannes Berg
     

16 Apr, 2013

2 commits

  • This function converts a (global only!) operating
    class to an internal band identifier. This will
    be needed for extended channel switch support.

    Signed-off-by: Johannes Berg

    Johannes Berg
     
  • When a full scan 2.4 and 5 GHz scan is scheduled, but then the 2.4 GHz
    part of the scan disables a 5.2 GHz channel due to, e.g. receiving
    country or frequency information, that 5.2 GHz channel might already
    be in the list of channels to scan next. Then, when the driver checks
    if it should do a passive scan, that will return false and attempt an
    active scan. This is not only wrong but can also lead to the iwlwifi
    device firmware crashing since it checks regulatory as well.

    Fix this by not setting the channel flags to just disabled but rather
    OR'ing in the disabled flag. That way, even if the race happens, the
    channel will be scanned passively which is still (mostly) correct.

    Cc: stable@vger.kernel.org
    Signed-off-by: Johannes Berg

    Johannes Berg
     

10 Apr, 2013

2 commits


04 Apr, 2013

1 commit


02 Apr, 2013

1 commit


31 Mar, 2013

1 commit

  • Introduced in f9f475292dbb0e7035fb6661d1524761ea0888d9
    ("cfg80211: always check for scan end on P2P device")

    cfg80211_conn_scan() which requires sched_scan_mtx to be held can be called
    from cfg80211_conn_work(). Without this we are hitting multiple warnings like
    the following:

    WARNING: at net/wireless/sme.c:88 cfg80211_conn_scan+0x1dc/0x3a0 [cfg80211]()
    Hardware name: 0578A21
    Modules linked in: ...
    Pid: 620, comm: kworker/3:1 Not tainted 3.9.0-rc4-next-20130328+ #326
    Call Trace:
    [] warn_slowpath_common+0x72/0xa0
    [] warn_slowpath_null+0x22/0x30
    [] cfg80211_conn_scan+0x1dc/0x3a0 [cfg80211]
    [] cfg80211_conn_do_work+0x94/0x380 [cfg80211]
    [] cfg80211_conn_work+0xa2/0x130 [cfg80211]
    [] process_one_work+0x198/0x450

    Signed-off-by: Artem Savkov
    Signed-off-by: Johannes Berg

    Artem Savkov
     

30 Mar, 2013

1 commit


28 Mar, 2013

1 commit

  • Add a new constant ETH_P_802_3_MIN, the minimum ethernet type for
    an 802.3 frame. Frames with a lower value in the ethernet type field
    are Ethernet II.

    Also update all the users of this value that David Miller and
    I could find to use the new constant.

    Also correct a bug in util.c. The comparison with ETH_P_802_3_MIN
    should be >= not >.

    As suggested by Jesse Gross.

    Compile tested only.

    Cc: David Miller
    Cc: Jesse Gross
    Cc: Karsten Keil
    Cc: John W. Linville
    Cc: Johannes Berg
    Cc: Bart De Schuymer
    Cc: Stephen Hemminger
    Cc: Patrick McHardy
    Cc: Marcel Holtmann
    Cc: Gustavo Padovan
    Cc: Johan Hedberg
    Cc: linux-bluetooth@vger.kernel.org
    Cc: netfilter-devel@vger.kernel.org
    Cc: bridge@lists.linux-foundation.org
    Cc: linux-wireless@vger.kernel.org
    Cc: linux1394-devel@lists.sourceforge.net
    Cc: linux-media@vger.kernel.org
    Cc: netdev@vger.kernel.org
    Cc: dev@openvswitch.org
    Acked-by: Mauro Carvalho Chehab
    Acked-by: Stefan Richter
    Signed-off-by: Simon Horman
    Signed-off-by: David S. Miller

    Simon Horman
     

26 Mar, 2013

1 commit


24 Mar, 2013

1 commit

  • If a P2P device wdev is removed while it has a scan, then the
    scan completion might crash later as it is already freed by
    that time. To avoid the crash always check the scan completion
    when the P2P device is being removed for some reason. If the
    driver already canceled it, don't want and free it, otherwise
    warn and leak it to avoid later crashes.

    In order to do this, locking needs to be changed away from the
    rdev mutex (which can't always be guaranteed). For now, use
    the sched_scan_mtx instead, I'll rename it to just scan_mtx in
    a later patch.

    Signed-off-by: Johannes Berg

    Johannes Berg
     

21 Mar, 2013

1 commit

  • Arend reported a crash in tracing if the driver returns an
    ERR_PTR() value from the add_virtual_intf() callback. This
    is due to the tracing then still attempting to dereference
    the "pointer", fix this by using IS_ERR_OR_NULL().

    Reported-by: Arend van Spriel
    Tested-by: Arend van Spriel
    Signed-off-by: Johannes Berg

    Johannes Berg
     

20 Mar, 2013

2 commits


07 Mar, 2013

2 commits


06 Mar, 2013

5 commits