21 May, 2016

23 commits

  • Pull tty and serial driver updates from Greg KH:
    "Here's the large TTY and Serial driver update for 4.7-rc1.

    A few new serial drivers are added here, and Peter has fixed a bunch
    of long-standing bugs in the tty layer and serial drivers as normal.
    Full details in the shortlog.

    All of these have been in linux-next for a while with no reported
    issues"

    * tag 'tty-4.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty: (88 commits)
    MAINTAINERS: 8250: remove website reference
    serial: core: Fix port mutex assert if lockdep disabled
    serial: 8250_dw: fix wrong logic in dw8250_check_lcr()
    tty: vt, finish looping on duplicate
    tty: vt, return error when con_startup fails
    QE-UART: add "fsl,t1040-ucc-uart" to of_device_id
    serial: mctrl_gpio: Drop support for out1-gpios and out2-gpios
    serial: 8250dw: Add device HID for future AMD UART controller
    Fix OpenSSH pty regression on close
    serial: mctrl_gpio: add IRQ locking
    serial: 8250: Integrate Fintek into 8250_base
    serial: mps2-uart: add support for early console
    serial: mps2-uart: add MPS2 UART driver
    dt-bindings: document the MPS2 UART bindings
    serial: sirf: Use generic uart-has-rtscts DT property
    serial: sirf: Introduce helper variable struct device_node *np
    serial: mxs-auart: Use generic uart-has-rtscts DT property
    serial: imx: Use generic uart-has-rtscts DT property
    doc: DT: Add Generic Serial Device Tree Bindings
    serial: 8250: of: Make tegra_serial_handle_break() static
    ...

    Linus Torvalds
     
  • Pull networking fixes and more updates from David Miller:

    1) Tunneling fixes from Tom Herbert and Alexander Duyck.

    2) AF_UNIX updates some struct sock bit fields with the socket lock,
    whereas setsockopt() sets overlapping ones with locking. Seperate
    out the synchronized vs. the AF_UNIX unsynchronized ones to avoid
    corruption. From Andrey Ryabinin.

    3) Mount BPF filesystem with mount_nodev rather than mount_ns, from
    Eric Biederman.

    4) A couple kmemdup conversions, from Muhammad Falak R Wani.

    5) BPF verifier fixes from Alexei Starovoitov.

    6) Don't let tunneled UDP packets get stuck in socket queues, if
    something goes wrong during the encapsulation just drop the packet
    rather than signalling an error up the call stack. From Hannes
    Frederic Sowa.

    7) SKB ref after free in batman-adv, from Florian Westphal.

    8) TCP iSCSI, ocfs2, rds, and tipc have to disable BH in it's TCP
    callbacks since the TCP stack runs pre-emptibly now. From Eric
    Dumazet.

    9) Fix crash in fixed_phy_add, from Rabin Vincent.

    10) Fix length checks in xen-netback, from Paul Durrant.

    11) Fix mixup in KEY vs KEYID macsec attributes, from Sabrina Dubroca.

    12) RDS connection spamming bug fixes from Sowmini Varadhan

    * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (152 commits)
    net: suppress warnings on dev_alloc_skb
    uapi glibc compat: fix compilation when !__USE_MISC in glibc
    udp: prevent skbs lingering in tunnel socket queues
    bpf: teach verifier to recognize imm += ptr pattern
    bpf: support decreasing order in direct packet access
    net: usb: ch9200: use kmemdup
    ps3_gelic: use kmemdup
    net:liquidio: use kmemdup
    bpf: Use mount_nodev not mount_ns to mount the bpf filesystem
    net: cdc_ncm: update datagram size after changing mtu
    tuntap: correctly wake up process during uninit
    intel: Add support for IPv6 IP-in-IP offload
    ip6_gre: Do not allow segmentation offloads GRE_CSUM is enabled with FOU/GUE
    RDS: TCP: Avoid rds connection churn from rogue SYNs
    RDS: TCP: rds_tcp_accept_worker() must exit gracefully when terminating rds-tcp
    net: sock: move ->sk_shutdown out of bitfields.
    ipv6: Don't reset inner headers in ip6_tnl_xmit
    ip4ip6: Support for GSO/GRO
    ip6ip6: Support for GSO/GRO
    ipv6: Set features for IPv6 tunnels
    ...

    Linus Torvalds
     
  • In case we find a socket with encapsulation enabled we should call
    the encap_recv function even if just a udp header without payload is
    available. The callbacks are responsible for correctly verifying and
    dropping the packets.

    Also, in case the header validation fails for geneve and vxlan we
    shouldn't put the skb back into the socket queue, no one will pick
    them up there. Instead we can simply discard them in the respective
    encap_recv functions.

    Signed-off-by: Hannes Frederic Sowa
    Signed-off-by: David S. Miller

    Hannes Frederic Sowa
     
  • This patch addresses the same issue we had for IPv4 where enabling GRE with
    an inner checksum cannot be supported with FOU/GUE due to the fact that
    they will jump past the GRE header at it is treated like a tunnel header.

    Signed-off-by: Alexander Duyck
    Signed-off-by: David S. Miller

    Alexander Duyck
     
  • When a rogue SYN is received after the connection arbitration
    algorithm has converged, the incoming SYN should not needlessly
    quiesce the transmit path, and it should not result in needless
    TCP connection resets due to re-execution of the connection
    arbitration logic.

    Signed-off-by: Sowmini Varadhan
    Acked-by: Santosh Shilimkar
    Signed-off-by: David S. Miller

    Sowmini Varadhan
     
  • There are two instances where we want to terminate RDS-TCP: when
    exiting the netns or during module unload. In either case, the
    termination sequence is to stop the listen socket, mark the
    rtn->rds_tcp_listen_sock as null, and flush any accept workqs.
    Thus any workqs that get flushed at this point will encounter a
    null rds_tcp_listen_sock, and must exit gracefully to allow
    the RDS-TCP termination to complete successfully.

    Signed-off-by: Sowmini Varadhan
    Acked-by: Santosh Shilimkar
    Signed-off-by: David S. Miller

    Sowmini Varadhan
     
  • Since iptunnel_handle_offloads() is called in all paths we can
    probably drop the block in ip6_tnl_xmit that was checking for
    skb->encapsulation and resetting the inner headers.

    Signed-off-by: Tom Herbert
    Signed-off-by: David S. Miller

    Tom Herbert
     
  • Signed-off-by: Tom Herbert
    Signed-off-by: David S. Miller

    Tom Herbert
     
  • Signed-off-by: Tom Herbert
    Signed-off-by: David S. Miller

    Tom Herbert
     
  • Need to set dev features, use same values that are used in GREv6.

    Signed-off-by: Tom Herbert
    Signed-off-by: David S. Miller

    Tom Herbert
     
  • Add netlink and setup for encapsulation

    Signed-off-by: Tom Herbert
    Signed-off-by: David S. Miller

    Tom Herbert
     
  • Add netlink and setup for encapsulation

    Signed-off-by: Tom Herbert
    Signed-off-by: David S. Miller

    Tom Herbert
     
  • This patch add a new fou6 module that provides encapsulation
    operations for IPv6.

    Signed-off-by: Tom Herbert
    Signed-off-by: David S. Miller

    Tom Herbert
     
  • Add encap_hlen and ip_tunnel_encap structure to ip6_tnl. Add functions
    for getting encap hlen, setting up encap on a tunnel, performing
    encapsulation operation.

    Signed-off-by: Tom Herbert
    Signed-off-by: David S. Miller

    Tom Herbert
     
  • This patch adds receive path support for IPv6 with fou.

    - Add address family to fou structure for open sockets. This supports
    AF_INET and AF_INET6. Lookups for fou ports are performed on both the
    port number and family.
    - In fou and gue receive adjust tot_len in IPv4 header or payload_len
    based on address family.
    - Allow AF_INET6 in FOU_ATTR_AF netlink attribute.

    Signed-off-by: Tom Herbert
    Signed-off-by: David S. Miller

    Tom Herbert
     
  • Create __fou_build_header and __gue_build_header. These implement the
    protocol generic parts of building the fou and gue header.
    fou_build_header and gue_build_header implement the IPv4 specific
    functions and call the __*_build_header functions.

    Signed-off-by: Tom Herbert
    Signed-off-by: David S. Miller

    Tom Herbert
     
  • Use helper function to set up UDP tunnel related information for a fou
    socket.

    Signed-off-by: Tom Herbert
    Signed-off-by: David S. Miller

    Tom Herbert
     
  • Consolidate all the ip_tunnel_encap definitions in one spot in the
    header file. Also, move ip_encap_hlen and ip_tunnel_encap from
    ip_tunnel.c to ip_tunnels.h so they call be called without a dependency
    on ip_tunnel module. Similarly, move iptun_encaps to ip_tunnel_core.c.

    Signed-off-by: Tom Herbert
    Signed-off-by: David S. Miller

    Tom Herbert
     
  • When performing foo-over-UDP, UDP packets are processed by the
    encapsulation handler which returns another protocol to process.
    This may result in processing two (or more) protocols in the
    loop that are marked as INET6_PROTO_FINAL. The actions taken
    for hitting a final protocol, in particular the skb_postpull_rcsum
    can only be performed once.

    This patch set adds a check of a final protocol has been seen. The
    rules are:
    - If the final protocol has not been seen any protocol is processed
    (final and non-final). In the case of a final protocol, the final
    actions are taken (like the skb_postpull_rcsum)
    - If a final protocol has been seen (e.g. an encapsulating UDP
    header) then no further non-final protocols are allowed
    (e.g. extension headers). For more final protocols the
    final actions are not taken (e.g. skb_postpull_rcsum).

    Signed-off-by: Tom Herbert
    Signed-off-by: David S. Miller

    Tom Herbert
     
  • In ip6_input_finish the nexthdr protocol is retrieved from the
    next header offset that is returned in the cb of the skb.
    This method does not work for UDP encapsulation that may not
    even have a concept of a nexthdr field (e.g. FOU).

    This patch checks for a final protocol (INET6_PROTO_FINAL) when a
    protocol handler returns > 0. If the protocol is not final then
    resubmission is performed on nhoff value. If the protocol is final
    then the nexthdr is taken to be the return value.

    Signed-off-by: Tom Herbert
    Signed-off-by: David S. Miller

    Tom Herbert
     
  • This patch defines two new GSO definitions SKB_GSO_IPXIP4 and
    SKB_GSO_IPXIP6 along with corresponding NETIF_F_GSO_IPXIP4 and
    NETIF_F_GSO_IPXIP6. These are used to described IP in IP
    tunnel and what the outer protocol is. The inner protocol
    can be deduced from other GSO types (e.g. SKB_GSO_TCPV4 and
    SKB_GSO_TCPV6). The GSO types of SKB_GSO_IPIP and SKB_GSO_SIT
    are removed (these are both instances of SKB_GSO_IPXIP4).
    SKB_GSO_IPXIP6 will be used when support for GSO with IP
    encapsulation over IPv6 is added.

    Signed-off-by: Tom Herbert
    Acked-by: Jeff Kirsher
    Signed-off-by: David S. Miller

    Tom Herbert
     
  • In several gso_segment functions there are checks of gso_type against
    a seemingly arbitrary list of SKB_GSO_* flags. This seems like an
    attempt to identify unsupported GSO types, but since the stack is
    the one that set these GSO types in the first place this seems
    unnecessary to do. If a combination isn't valid in the first
    place that stack should not allow setting it.

    This is a code simplication especially for add new GSO types.

    Signed-off-by: Tom Herbert
    Signed-off-by: David S. Miller

    Tom Herbert
     
  • Pull rdma updates from Doug Ledford:
    "Primary 4.7 merge window changes

    - Updates to the new Intel X722 iWARP driver
    - Updates to the hfi1 driver
    - Fixes for the iw_cxgb4 driver
    - Misc core fixes
    - Generic RDMA READ/WRITE API addition
    - SRP updates
    - Misc ipoib updates
    - Minor mlx5 updates"

    * tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dledford/rdma: (148 commits)
    IB/mlx5: Fire the CQ completion handler from tasklet
    net/mlx5_core: Use tasklet for user-space CQ completion events
    IB/core: Do not require CAP_NET_ADMIN for packet sniffing
    IB/mlx4: Fix unaligned access in send_reply_to_slave
    IB/mlx5: Report Scatter FCS device capability when supported
    IB/mlx5: Add Scatter FCS support for Raw Packet QP
    IB/core: Add Scatter FCS create flag
    IB/core: Add Raw Scatter FCS device capability
    IB/core: Add extended device capability flags
    i40iw: pass hw_stats by reference rather than by value
    i40iw: Remove unnecessary synchronize_irq() before free_irq()
    i40iw: constify i40iw_vf_cqp_ops structure
    IB/mlx5: Add UARs write-combining and non-cached mapping
    IB/mlx5: Allow mapping the free running counter on PROT_EXEC
    IB/mlx4: Use list_for_each_entry_safe
    IB/SA: Use correct free function
    IB/core: Fix a potential array overrun in CMA and SA agent
    IB/core: Remove unnecessary check in ibnl_rcv_msg
    IB/IWPM: Fix a potential skb leak
    RDMA/nes: replace custom print_hex_dump()
    ...

    Linus Torvalds
     

20 May, 2016

8 commits

  • Merge updates from Andrew Morton:

    - fsnotify fix

    - poll() timeout fix

    - a few scripts/ tweaks

    - debugobjects updates

    - the (small) ocfs2 queue

    - Minor fixes to kernel/padata.c

    - Maybe half of the MM queue

    * emailed patches from Andrew Morton : (117 commits)
    mm, page_alloc: restore the original nodemask if the fast path allocation failed
    mm, page_alloc: uninline the bad page part of check_new_page()
    mm, page_alloc: don't duplicate code in free_pcp_prepare
    mm, page_alloc: defer debugging checks of pages allocated from the PCP
    mm, page_alloc: defer debugging checks of freed pages until a PCP drain
    cpuset: use static key better and convert to new API
    mm, page_alloc: inline pageblock lookup in page free fast paths
    mm, page_alloc: remove unnecessary variable from free_pcppages_bulk
    mm, page_alloc: pull out side effects from free_pages_check
    mm, page_alloc: un-inline the bad part of free_pages_check
    mm, page_alloc: check multiple page fields with a single branch
    mm, page_alloc: remove field from alloc_context
    mm, page_alloc: avoid looking up the first zone in a zonelist twice
    mm, page_alloc: shortcut watermark checks for order-0 pages
    mm, page_alloc: reduce cost of fair zone allocation policy retry
    mm, page_alloc: shorten the page allocator fast path
    mm, page_alloc: check once if a zone has isolated pageblocks
    mm, page_alloc: move __GFP_HARDWALL modifications out of the fastpath
    mm, page_alloc: simplify last cpupid reset
    mm, page_alloc: remove unnecessary initialisation from __alloc_pages_nodemask()
    ...

    Linus Torvalds
     
  • page_reference manipulation functions are introduced to track down
    reference count change of the page. Use it instead of direct
    modification of _count.

    Signed-off-by: Joonsoo Kim
    Acked-by: Vlastimil Babka
    Cc: Hugh Dickins
    Cc: Johannes Berg
    Cc: "David S. Miller"
    Cc: Sunil Goutham
    Cc: Chris Metcalf
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Joonsoo Kim
     
  • struct timespec is not y2038 safe. Even though timespec might be
    sufficient to represent timeouts, use struct timespec64 here as the plan
    is to get rid of all timespec reference in the kernel.

    The patch transitions the common functions: poll_select_set_timeout()
    and select_estimate_accuracy() to use timespec64. And, all the syscalls
    that use these functions are transitioned in the same patch.

    The restart block parameters for poll uses monotonic time. Use
    timespec64 here as well to assign timeout value. This parameter in the
    restart block need not change because this only holds the monotonic
    timestamp at which timeout should occur. And, unsigned long data type
    should be big enough for this timestamp.

    The system call interfaces will be handled in a separate series.

    Compat interfaces need not change as timespec64 is an alias to struct
    timespec on a 64 bit system.

    Link: http://lkml.kernel.org/r/1461947989-21926-3-git-send-email-deepa.kernel@gmail.com
    Signed-off-by: Deepa Dinamani
    Acked-by: John Stultz
    Acked-by: David S. Miller
    Cc: Alexander Viro
    Cc: Arnd Bergmann
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Deepa Dinamani
     
  • Antonio Quartulli says:

    ====================
    During the Wireless Battle Mesh v9 in Porto (PT) at the beginning of
    May, we managed to uncover and fix some important bugs in our
    new B.A.T.M.A.N. V algorithm. These are the fixes we came up with
    together with others that I collected in the past weeks:
    - avoid potential crash due to NULL pointer dereference in
    B.A.T.M.A.N. V routine when a neigh_ifinfo object is not found, by
    Sven Eckelmann
    - avoid use-after-free of skb when counting outgoing bytes, by Florian
    Westphal
    - fix neigh_ifinfo object reference counting imbalance when using
    B.A.T.M.A.N. V, by Sven Eckelmann. Such imbalance may lead to the
    impossibility of releasing the related netdev object on shutdown
    - avoid invalid memory access in case of error while allocating
    bcast_own_sum when a new hard-interface is added, by Sven Eckelmann
    - ensure originator address is updated in OMG/ELP packet content upon
    primary interface address change, by Antonio Quartulli
    - fix integer overflow when computing TQ metric (B.A.T.M.A.N. IV), by
    Sven Eckelmann
    - avoid race condition while adding new neigh_node which would result
    in having two objects mapping to the same physical neighbour, by
    Linus Lüssing
    - ensure originator address is initialized in ELP packet content on
    secondary interfaces, by Marek Lindner
    ====================

    Signed-off-by: David S. Miller

    David S. Miller
     
  • TCP stack can now run from process context.

    Use read_lock_bh(&sk->sk_callback_lock) variant to restore previous
    assumption.

    Fixes: 5413d1babe8f ("net: do not block BH while processing socket backlog")
    Fixes: d41a69f1d390 ("tcp: make tcp_sendmsg() aware of socket backlog")
    Signed-off-by: Eric Dumazet
    Cc: Jon Maloy
    Cc: Ying Xue
    Signed-off-by: David S. Miller

    Eric Dumazet
     
  • TCP stack can now run from process context.

    Use read_lock_bh(&sk->sk_callback_lock) variant to restore previous
    assumption.

    Fixes: 5413d1babe8f ("net: do not block BH while processing socket backlog")
    Fixes: d41a69f1d390 ("tcp: make tcp_sendmsg() aware of socket backlog")
    Signed-off-by: Eric Dumazet
    Signed-off-by: David S. Miller

    Eric Dumazet
     
  • skb_splice_bits() returns int, kcm_splice_read() returns ssize_t,
    both are signed.

    We may need another patch to make them all ssize_t, but that
    deserves a separated patch.

    Fixes: 91687355b927 ("kcm: Splice support")
    Reported-by: David Binderman
    Cc: Tom Herbert
    Signed-off-by: Cong Wang
    Signed-off-by: David S. Miller

    WANG Cong
     
  • Pull security subsystem updates from James Morris:
    "Highlights:

    - A new LSM, "LoadPin", from Kees Cook is added, which allows forcing
    of modules and firmware to be loaded from a specific device (this
    is from ChromeOS, where the device as a whole is verified
    cryptographically via dm-verity).

    This is disabled by default but can be configured to be enabled by
    default (don't do this if you don't know what you're doing).

    - Keys: allow authentication data to be stored in an asymmetric key.
    Lots of general fixes and updates.

    - SELinux: add restrictions for loading of kernel modules via
    finit_module(). Distinguish non-init user namespace capability
    checks. Apply execstack check on thread stacks"

    * 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security: (48 commits)
    LSM: LoadPin: provide enablement CONFIG
    Yama: use atomic allocations when reporting
    seccomp: Fix comment typo
    ima: add support for creating files using the mknodat syscall
    ima: fix ima_inode_post_setattr
    vfs: forbid write access when reading a file into memory
    fs: fix over-zealous use of "const"
    selinux: apply execstack check on thread stacks
    selinux: distinguish non-init user namespace capability checks
    LSM: LoadPin for kernel file loading restrictions
    fs: define a string representation of the kernel_read_file_id enumeration
    Yama: consolidate error reporting
    string_helpers: add kstrdup_quotable_file
    string_helpers: add kstrdup_quotable_cmdline
    string_helpers: add kstrdup_quotable
    selinux: check ss_initialized before revalidating an inode label
    selinux: delay inode label lookup as long as possible
    selinux: don't revalidate an inode's label when explicitly setting it
    selinux: Change bool variable name to index.
    KEYS: Add KEYCTL_DH_COMPUTE command
    ...

    Linus Torvalds
     

18 May, 2016

9 commits

  • This fix prevents nodes to wrongly create a 00:00:00:00:00:00 originator
    which can potentially interfere with the rest of the neighbor statistics.

    Fixes: d6f94d91f766 ("batman-adv: ELP - adding basic infrastructure")
    Signed-off-by: Marek Lindner
    Signed-off-by: Antonio Quartulli

    Marek Lindner
     
  • Two parallel calls to batadv_neigh_node_new() might race for creating
    and adding the same neig_node. Fix this by including the check for any
    already existing, identical neigh_node within the spin-lock.

    This fixes splats like the following:

    [ 739.535069] ------------[ cut here ]------------
    [ 739.535079] WARNING: CPU: 0 PID: 0 at /usr/src/batman-adv/git/batman-adv/net/batman-adv/bat_iv_ogm.c:1004 batadv_iv_ogm_process_per_outif+0xe3f/0xe60 [batman_adv]()
    [ 739.535092] too many matching neigh_nodes
    [ 739.535094] Modules linked in: dm_mod tun ip6table_filter ip6table_mangle ip6table_nat nf_nat_ipv6 ip6_tables xt_nat iptable_nat nf_nat_ipv4 nf_nat xt_TCPMSS xt_mark iptable_mangle xt_tcpudp xt_conntrack iptable_filter ip_tables x_tables ip_gre ip_tunnel gre bridge stp llc thermal_sys kvm_intel kvm crct10dif_pclmul crc32_pclmul sha256_ssse3 sha256_generic hmac drbg ansi_cprng aesni_intel aes_x86_64 lrw gf128mul glue_helper ablk_helper cryptd evdev pcspkr ip6_gre ip6_tunnel tunnel6 batman_adv(O) libcrc32c nf_conntrack_ipv6 nf_defrag_ipv6 nf_conntrack_ipv4 nf_defrag_ipv4 nf_conntrack autofs4 ext4 crc16 mbcache jbd2 xen_netfront xen_blkfront crc32c_intel
    [ 739.535177] CPU: 0 PID: 0 Comm: swapper/0 Tainted: G W O 4.2.0-0.bpo.1-amd64 #1 Debian 4.2.6-3~bpo8+2
    [ 739.535186] 0000000000000000 ffffffffa013b050 ffffffff81554521 ffff88007d003c18
    [ 739.535201] ffffffff8106fa01 0000000000000000 ffff8800047a087a ffff880079c3a000
    [ 739.735602] ffff88007b82bf40 ffff88007bc2d1c0 ffffffff8106fa7a ffffffffa013aa8e
    [ 739.735624] Call Trace:
    [ 739.735639] [] ? dump_stack+0x40/0x50
    [ 739.735677] [] ? warn_slowpath_common+0x81/0xb0
    [ 739.735692] [] ? warn_slowpath_fmt+0x4a/0x50
    [ 739.735715] [] ? batadv_iv_ogm_process_per_outif+0xe3f/0xe60 [batman_adv]
    [ 739.735740] [] ? batadv_iv_ogm_receive+0x363/0x380 [batman_adv]
    [ 739.735762] [] ? batadv_iv_ogm_receive+0x363/0x380 [batman_adv]
    [ 739.735783] [] ? __raw_callee_save___pv_queued_spin_unlock+0x11/0x20
    [ 739.735804] [] ? batadv_batman_skb_recv+0xc9/0x110 [batman_adv]
    [ 739.735825] [] ? __netif_receive_skb_core+0x841/0x9a0
    [ 739.735838] [] ? __raw_callee_save___pv_queued_spin_unlock+0x11/0x20
    [ 739.735853] [] ? process_backlog+0xa1/0x140
    [ 739.735864] [] ? net_rx_action+0x20a/0x320
    [ 739.735878] [] ? __do_softirq+0x107/0x270
    [ 739.735891] [] ? irq_exit+0x92/0xa0
    [ 739.735905] [] ? xen_evtchn_do_upcall+0x31/0x40
    [ 739.735924] [] ? xen_do_hypervisor_callback+0x1e/0x40
    [ 739.735939] [] ? xen_hypercall_sched_op+0xa/0x20
    [ 739.735965] [] ? xen_hypercall_sched_op+0xa/0x20
    [ 739.735979] [] ? xen_safe_halt+0xc/0x20
    [ 739.735991] [] ? default_idle+0x1c/0xa0
    [ 739.736004] [] ? cpu_startup_entry+0x2eb/0x350
    [ 739.736019] [] ? start_kernel+0x480/0x48b
    [ 739.736032] [] ? xen_start_kernel+0x507/0x511
    [ 739.736048] ---[ end trace c106bb901244bc8c ]---

    Fixes: f987ed6ebd99 ("batman-adv: protect neighbor list with rcu locks")
    Reported-by: Martin Weinelt
    Signed-off-by: Linus Lüssing
    Signed-off-by: Marek Lindner
    Signed-off-by: Antonio Quartulli

    Linus Lüssing
     
  • The undefined behavior sanatizer detected an signed integer overflow in a
    setup with near perfect link quality

    UBSAN: Undefined behaviour in net/batman-adv/bat_iv_ogm.c:1246:25
    signed integer overflow:
    8713350 * 255 cannot be represented in type 'int'

    The problems happens because the calculation of mixed unsigned and signed
    integers resulted in an integer multiplication.

    batadv_ogm_packet::tq (u8 255)
    * tq_own (u8 255)
    * tq_asym_penalty (int 134; max 255)
    * tq_iface_penalty (int 255; max 255)

    The tq_iface_penalty, tq_asym_penalty and inv_asym_penalty can just be
    changed to unsigned int because they are not expected to become negative.

    Fixes: c039876892e3 ("batman-adv: add WiFi penalty")
    Signed-off-by: Sven Eckelmann
    Signed-off-by: Marek Lindner
    Signed-off-by: Antonio Quartulli

    Sven Eckelmann
     
  • When the MAC address of the primary interface is changed,
    update the originator address in the ELP and OGM skb buffers as
    well in order to reflect the change.

    Fixes: d6f94d91f766 ("batman-adv: ELP - adding basic infrastructure")
    Reported-by: Marek Lindner
    Signed-off-by: Antonio Quartulli

    Antonio Quartulli
     
  • The function batadv_iv_ogm_orig_add_if allocates new buffers for bcast_own
    and bcast_own_sum. It is expected that these buffers are unchanged in case
    either bcast_own or bcast_own_sum couldn't be resized.

    But the error handling of this function frees the already resized buffer
    for bcast_own when the allocation of the new bcast_own_sum buffer failed.
    This will lead to an invalid memory access when some code will try to
    access bcast_own.

    Instead the resized new bcast_own buffer has to be kept. This will not lead
    to problems because the size of the buffer was only increased and therefore
    no user of the buffer will try to access bytes outside of the new buffer.

    Fixes: d0015fdd3d2c ("batman-adv: provide orig_node routing API")
    Signed-off-by: Sven Eckelmann
    Signed-off-by: Marek Lindner
    Signed-off-by: Antonio Quartulli

    Sven Eckelmann
     
  • The functions batadv_neigh_ifinfo_get increase the reference counter of the
    batadv_neigh_ifinfo. These have to be reduced again when the reference is
    not used anymore to correctly free the objects.

    Fixes: 9786906022eb ("batman-adv: B.A.T.M.A.N. V - implement neighbor comparison API calls")
    Signed-off-by: Sven Eckelmann
    Signed-off-by: Marek Lindner
    Signed-off-by: Antonio Quartulli

    Sven Eckelmann
     
  • batadv_neigh_ifinfo_get can return NULL when it cannot find (even when only
    temporarily) anymore the neigh_ifinfo in the list neigh->ifinfo_list. This
    has to be checked to avoid kernel Oopses when the ifinfo is dereferenced.

    This a situation which isn't expected but is already handled by functions
    like batadv_v_neigh_cmp. The same kind of warning is therefore used before
    the function returns without dereferencing the pointers.

    Fixes: 9786906022eb ("batman-adv: B.A.T.M.A.N. V - implement neighbor comparison API calls")
    Signed-off-by: Sven Eckelmann
    Signed-off-by: Marek Lindner
    Signed-off-by: Antonio Quartulli

    Sven Eckelmann
     
  • batadv_send_skb_to_orig() calls dev_queue_xmit() so we can't use skb->len.

    Fixes: 953324776d6d ("batman-adv: network coding - buffer unicast packets before forward")
    Signed-off-by: Florian Westphal
    Reviewed-by: Sven Eckelmann
    Signed-off-by: Marek Lindner
    Signed-off-by: Antonio Quartulli

    Florian Westphal
     
  • Pull trivial tree updates from Jiri Kosina.

    * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial: (21 commits)
    gitignore: fix wording
    mfd: ab8500-debugfs: fix "between" in printk
    memstick: trivial fix of spelling mistake on management
    cpupowerutils: bench: fix "average"
    treewide: Fix typos in printk
    IB/mlx4: printk fix
    pinctrl: sirf/atlas7: fix printk spelling
    serial: mctrl_gpio: Grammar s/lines GPIOs/line GPIOs/, /sets/set/
    w1: comment spelling s/minmum/minimum/
    Blackfin: comment spelling s/divsor/divisor/
    metag: Fix misspellings in comments.
    ia64: Fix misspellings in comments.
    hexagon: Fix misspellings in comments.
    tools/perf: Fix misspellings in comments.
    cris: Fix misspellings in comments.
    c6x: Fix misspellings in comments.
    blackfin: Fix misspelling of 'register' in comment.
    avr32: Fix misspelling of 'definitions' in comment.
    treewide: Fix typos in printk
    Doc: treewide : Fix typos in DocBook/filesystem.xml
    ...

    Linus Torvalds