Commit graph

889,574 commits

Author SHA1 Message Date
Lorenzo Bianconi
a908f986dd openvswitch: take into account de-fragmentation/gso_size in execute_check_pkt_len
[ Upstream commit 17843655708e1941c0653af3cd61be6948e36f43 ]

ovs connection tracking module performs de-fragmentation on incoming
fragmented traffic. Take info account if traffic has been de-fragmented
in execute_check_pkt_len action otherwise we will perform the wrong
nested action considering the original packet size. This issue typically
occurs if ovs-vswitchd adds a rule in the pipeline that requires connection
tracking (e.g. OVN stateful ACLs) before execute_check_pkt_len action.
Moreover take into account GSO fragment size for GSO packet in
execute_check_pkt_len routine

Fixes: 4d5ec89fc8 ("net: openvswitch: Add a new action check_pkt_len")
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-06-30 15:36:45 -04:00
Jeremy Kerr
27b70214fc net: usb: ax88179_178a: fix packet alignment padding
[ Upstream commit e869e7a17798d85829fa7d4f9bbe1eebd4b2d3f6 ]

Using a AX88179 device (0b95:1790), I see two bytes of appended data on
every RX packet. For example, this 48-byte ping, using 0xff as a
payload byte:

  04:20:22.528472 IP 192.168.1.1 > 192.168.1.2: ICMP echo request, id 2447, seq 1, length 64
	0x0000:  000a cd35 ea50 000a cd35 ea4f 0800 4500
	0x0010:  0054 c116 4000 4001 f63e c0a8 0101 c0a8
	0x0020:  0102 0800 b633 098f 0001 87ea cd5e 0000
	0x0030:  0000 dcf2 0600 0000 0000 ffff ffff ffff
	0x0040:  ffff ffff ffff ffff ffff ffff ffff ffff
	0x0050:  ffff ffff ffff ffff ffff ffff ffff ffff
	0x0060:  ffff 961f

Those last two bytes - 96 1f - aren't part of the original packet.

In the ax88179 RX path, the usbnet rx_fixup function trims a 2-byte
'alignment pseudo header' from the start of the packet, and sets the
length from a per-packet field populated by hardware. It looks like that
length field *includes* the 2-byte header; the current driver assumes
that it's excluded.

This change trims the 2-byte alignment header after we've set the packet
length, so the resulting packet length is correct. While we're moving
the comment around, this also fixes the spelling of 'pseudo'.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-06-30 15:36:45 -04:00
Eric Dumazet
67571b1ab2 net: increment xmit_recursion level in dev_direct_xmit()
[ Upstream commit 0ad6f6e767ec2f613418cbc7ebe5ec4c35af540c ]

Back in commit f60e5990d9 ("ipv6: protect skb->sk accesses
from recursive dereference inside the stack") Hannes added code
so that IPv6 stack would not trust skb->sk for typical cases
where packet goes through 'standard' xmit path (__dev_queue_xmit())

Alas af_packet had a dev_direct_xmit() path that was not
dealing yet with xmit_recursion level.

Also change sk_mc_loop() to dump a stack once only.

Without this patch, syzbot was able to trigger :

[1]
[  153.567378] WARNING: CPU: 7 PID: 11273 at net/core/sock.c:721 sk_mc_loop+0x51/0x70
[  153.567378] Modules linked in: nfnetlink ip6table_raw ip6table_filter iptable_raw iptable_nat nf_nat nf_conntrack nf_defrag_ipv4 nf_defrag_ipv6 iptable_filter macsec macvtap tap macvlan 8021q hsr wireguard libblake2s blake2s_x86_64 libblake2s_generic udp_tunnel ip6_udp_tunnel libchacha20poly1305 poly1305_x86_64 chacha_x86_64 libchacha curve25519_x86_64 libcurve25519_generic netdevsim batman_adv dummy team bridge stp llc w1_therm wire i2c_mux_pca954x i2c_mux cdc_acm ehci_pci ehci_hcd mlx4_en mlx4_ib ib_uverbs ib_core mlx4_core
[  153.567386] CPU: 7 PID: 11273 Comm: b159172088 Not tainted 5.8.0-smp-DEV #273
[  153.567387] RIP: 0010:sk_mc_loop+0x51/0x70
[  153.567388] Code: 66 83 f8 0a 75 24 0f b6 4f 12 b8 01 00 00 00 31 d2 d3 e0 a9 bf ef ff ff 74 07 48 8b 97 f0 02 00 00 0f b6 42 3a 83 e0 01 5d c3 <0f> 0b b8 01 00 00 00 5d c3 0f b6 87 18 03 00 00 5d c0 e8 04 83 e0
[  153.567388] RSP: 0018:ffff95c69bb93990 EFLAGS: 00010212
[  153.567388] RAX: 0000000000000011 RBX: ffff95c6e0ee3e00 RCX: 0000000000000007
[  153.567389] RDX: ffff95c69ae50000 RSI: ffff95c6c30c3000 RDI: ffff95c6c30c3000
[  153.567389] RBP: ffff95c69bb93990 R08: ffff95c69a77f000 R09: 0000000000000008
[  153.567389] R10: 0000000000000040 R11: 00003e0e00026128 R12: ffff95c6c30c3000
[  153.567390] R13: ffff95c6cc4fd500 R14: ffff95c6f84500c0 R15: ffff95c69aa13c00
[  153.567390] FS:  00007fdc3a283700(0000) GS:ffff95c6ff9c0000(0000) knlGS:0000000000000000
[  153.567390] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[  153.567391] CR2: 00007ffee758e890 CR3: 0000001f9ba20003 CR4: 00000000001606e0
[  153.567391] Call Trace:
[  153.567391]  ip6_finish_output2+0x34e/0x550
[  153.567391]  __ip6_finish_output+0xe7/0x110
[  153.567391]  ip6_finish_output+0x2d/0xb0
[  153.567392]  ip6_output+0x77/0x120
[  153.567392]  ? __ip6_finish_output+0x110/0x110
[  153.567392]  ip6_local_out+0x3d/0x50
[  153.567392]  ipvlan_queue_xmit+0x56c/0x5e0
[  153.567393]  ? ksize+0x19/0x30
[  153.567393]  ipvlan_start_xmit+0x18/0x50
[  153.567393]  dev_direct_xmit+0xf3/0x1c0
[  153.567393]  packet_direct_xmit+0x69/0xa0
[  153.567394]  packet_sendmsg+0xbf0/0x19b0
[  153.567394]  ? plist_del+0x62/0xb0
[  153.567394]  sock_sendmsg+0x65/0x70
[  153.567394]  sock_write_iter+0x93/0xf0
[  153.567394]  new_sync_write+0x18e/0x1a0
[  153.567395]  __vfs_write+0x29/0x40
[  153.567395]  vfs_write+0xb9/0x1b0
[  153.567395]  ksys_write+0xb1/0xe0
[  153.567395]  __x64_sys_write+0x1a/0x20
[  153.567395]  do_syscall_64+0x43/0x70
[  153.567396]  entry_SYSCALL_64_after_hwframe+0x44/0xa9
[  153.567396] RIP: 0033:0x453549
[  153.567396] Code: Bad RIP value.
[  153.567396] RSP: 002b:00007fdc3a282cc8 EFLAGS: 00000246 ORIG_RAX: 0000000000000001
[  153.567397] RAX: ffffffffffffffda RBX: 00000000004d32d0 RCX: 0000000000453549
[  153.567397] RDX: 0000000000000020 RSI: 0000000020000300 RDI: 0000000000000003
[  153.567398] RBP: 00000000004d32d8 R08: 0000000000000000 R09: 0000000000000000
[  153.567398] R10: 0000000000000000 R11: 0000000000000246 R12: 00000000004d32dc
[  153.567398] R13: 00007ffee742260f R14: 00007fdc3a282dc0 R15: 00007fdc3a283700
[  153.567399] ---[ end trace c1d5ae2b1059ec62 ]---

f60e5990d9 ("ipv6: protect skb->sk accesses from recursive dereference inside the stack")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reported-by: syzbot <syzkaller@googlegroups.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-06-30 15:36:44 -04:00
guodeqing
97a1d2aa6c net: Fix the arp error in some cases
[ Upstream commit 5eea3a63ff4aba6a26002e657a6d21934b7e2b96 ]

ie.,
$ ifconfig eth0 6.6.6.6 netmask 255.255.255.0

$ ip rule add from 6.6.6.6 table 6666

$ ip route add 9.9.9.9 via 6.6.6.6

$ ping -I 6.6.6.6 9.9.9.9
PING 9.9.9.9 (9.9.9.9) from 6.6.6.6 : 56(84) bytes of data.

3 packets transmitted, 0 received, 100% packet loss, time 2079ms

$ arp
Address     HWtype  HWaddress           Flags Mask            Iface
6.6.6.6             (incomplete)                              eth0

The arp request address is error, this is because fib_table_lookup in
fib_check_nh lookup the destnation 9.9.9.9 nexthop, the scope of
the fib result is RT_SCOPE_LINK,the correct scope is RT_SCOPE_HOST.
Here I add a check of whether this is RT_TABLE_MAIN to solve this problem.

Fixes: 3bfd847203 ("net: Use passed in table for nexthop lookups")
Signed-off-by: guodeqing <geffrey.guo@huawei.com>
Reviewed-by: David Ahern <dsahern@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-06-30 15:36:44 -04:00
Yang Yingliang
742f2358b3 net: fix memleak in register_netdevice()
[ Upstream commit 814152a89ed52c722ab92e9fbabcac3cb8a39245 ]

I got a memleak report when doing some fuzz test:

unreferenced object 0xffff888112584000 (size 13599):
  comm "ip", pid 3048, jiffies 4294911734 (age 343.491s)
  hex dump (first 32 bytes):
    74 61 70 30 00 00 00 00 00 00 00 00 00 00 00 00  tap0............
    00 ee d9 19 81 88 ff ff 00 00 00 00 00 00 00 00  ................
  backtrace:
    [<000000002f60ba65>] __kmalloc_node+0x309/0x3a0
    [<0000000075b211ec>] kvmalloc_node+0x7f/0xc0
    [<00000000d3a97396>] alloc_netdev_mqs+0x76/0xfc0
    [<00000000609c3655>] __tun_chr_ioctl+0x1456/0x3d70
    [<000000001127ca24>] ksys_ioctl+0xe5/0x130
    [<00000000b7d5e66a>] __x64_sys_ioctl+0x6f/0xb0
    [<00000000e1023498>] do_syscall_64+0x56/0xa0
    [<000000009ec0eb12>] entry_SYSCALL_64_after_hwframe+0x44/0xa9
unreferenced object 0xffff888111845cc0 (size 8):
  comm "ip", pid 3048, jiffies 4294911734 (age 343.491s)
  hex dump (first 8 bytes):
    74 61 70 30 00 88 ff ff                          tap0....
  backtrace:
    [<000000004c159777>] kstrdup+0x35/0x70
    [<00000000d8b496ad>] kstrdup_const+0x3d/0x50
    [<00000000494e884a>] kvasprintf_const+0xf1/0x180
    [<0000000097880a2b>] kobject_set_name_vargs+0x56/0x140
    [<000000008fbdfc7b>] dev_set_name+0xab/0xe0
    [<000000005b99e3b4>] netdev_register_kobject+0xc0/0x390
    [<00000000602704fe>] register_netdevice+0xb61/0x1250
    [<000000002b7ca244>] __tun_chr_ioctl+0x1cd1/0x3d70
    [<000000001127ca24>] ksys_ioctl+0xe5/0x130
    [<00000000b7d5e66a>] __x64_sys_ioctl+0x6f/0xb0
    [<00000000e1023498>] do_syscall_64+0x56/0xa0
    [<000000009ec0eb12>] entry_SYSCALL_64_after_hwframe+0x44/0xa9
unreferenced object 0xffff88811886d800 (size 512):
  comm "ip", pid 3048, jiffies 4294911734 (age 343.491s)
  hex dump (first 32 bytes):
    00 00 00 00 ad 4e ad de ff ff ff ff 00 00 00 00  .....N..........
    ff ff ff ff ff ff ff ff c0 66 3d a3 ff ff ff ff  .........f=.....
  backtrace:
    [<0000000050315800>] device_add+0x61e/0x1950
    [<0000000021008dfb>] netdev_register_kobject+0x17e/0x390
    [<00000000602704fe>] register_netdevice+0xb61/0x1250
    [<000000002b7ca244>] __tun_chr_ioctl+0x1cd1/0x3d70
    [<000000001127ca24>] ksys_ioctl+0xe5/0x130
    [<00000000b7d5e66a>] __x64_sys_ioctl+0x6f/0xb0
    [<00000000e1023498>] do_syscall_64+0x56/0xa0
    [<000000009ec0eb12>] entry_SYSCALL_64_after_hwframe+0x44/0xa9

If call_netdevice_notifiers() failed, then rollback_registered()
calls netdev_unregister_kobject() which holds the kobject. The
reference cannot be put because the netdev won't be add to todo
list, so it will leads a memleak, we need put the reference to
avoid memleak.

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-06-30 15:36:44 -04:00
Tariq Toukan
9e693934cd net: Do not clear the sock TX queue in sk_set_socket()
[ Upstream commit 41b14fb8724d5a4b382a63cb4a1a61880347ccb8 ]

Clearing the sock TX queue in sk_set_socket() might cause unexpected
out-of-order transmit when called from sock_orphan(), as outstanding
packets can pick a different TX queue and bypass the ones already queued.

This is undesired in general. More specifically, it breaks the in-order
scheduling property guarantee for device-offloaded TLS sockets.

Remove the call to sk_tx_queue_clear() in sk_set_socket(), and add it
explicitly only where needed.

Fixes: e022f0b4a0 ("net: Introduce sk_tx_queue_mapping")
Signed-off-by: Tariq Toukan <tariqt@mellanox.com>
Reviewed-by: Boris Pismenny <borisp@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-06-30 15:36:44 -04:00
Taehee Yoo
9f217d6dd7 net: core: reduce recursion limit value
[ Upstream commit fb7861d14c8d7edac65b2fcb6e8031cb138457b2 ]

In the current code, ->ndo_start_xmit() can be executed recursively only
10 times because of stack memory.
But, in the case of the vxlan, 10 recursion limit value results in
a stack overflow.
In the current code, the nested interface is limited by 8 depth.
There is no critical reason that the recursion limitation value should
be 10.
So, it would be good to be the same value with the limitation value of
nesting interface depth.

Test commands:
    ip link add vxlan10 type vxlan vni 10 dstport 4789 srcport 4789 4789
    ip link set vxlan10 up
    ip a a 192.168.10.1/24 dev vxlan10
    ip n a 192.168.10.2 dev vxlan10 lladdr fc:22:33:44:55:66 nud permanent

    for i in {9..0}
    do
        let A=$i+1
	ip link add vxlan$i type vxlan vni $i dstport 4789 srcport 4789 4789
	ip link set vxlan$i up
	ip a a 192.168.$i.1/24 dev vxlan$i
	ip n a 192.168.$i.2 dev vxlan$i lladdr fc:22:33:44:55:66 nud permanent
	bridge fdb add fc:22:33:44:55:66 dev vxlan$A dst 192.168.$i.2 self
    done
    hping3 192.168.10.2 -2 -d 60000

Splat looks like:
[  103.814237][ T1127] =============================================================================
[  103.871955][ T1127] BUG kmalloc-2k (Tainted: G    B            ): Padding overwritten. 0x00000000897a2e4f-0x000
[  103.873187][ T1127] -----------------------------------------------------------------------------
[  103.873187][ T1127]
[  103.874252][ T1127] INFO: Slab 0x000000005cccc724 objects=5 used=5 fp=0x0000000000000000 flags=0x10000000001020
[  103.881323][ T1127] CPU: 3 PID: 1127 Comm: hping3 Tainted: G    B             5.7.0+ #575
[  103.882131][ T1127] Hardware name: innotek GmbH VirtualBox/VirtualBox, BIOS VirtualBox 12/01/2006
[  103.883006][ T1127] Call Trace:
[  103.883324][ T1127]  dump_stack+0x96/0xdb
[  103.883716][ T1127]  slab_err+0xad/0xd0
[  103.884106][ T1127]  ? _raw_spin_unlock+0x1f/0x30
[  103.884620][ T1127]  ? get_partial_node.isra.78+0x140/0x360
[  103.885214][ T1127]  slab_pad_check.part.53+0xf7/0x160
[  103.885769][ T1127]  ? pskb_expand_head+0x110/0xe10
[  103.886316][ T1127]  check_slab+0x97/0xb0
[  103.886763][ T1127]  alloc_debug_processing+0x84/0x1a0
[  103.887308][ T1127]  ___slab_alloc+0x5a5/0x630
[  103.887765][ T1127]  ? pskb_expand_head+0x110/0xe10
[  103.888265][ T1127]  ? lock_downgrade+0x730/0x730
[  103.888762][ T1127]  ? pskb_expand_head+0x110/0xe10
[  103.889244][ T1127]  ? __slab_alloc+0x3e/0x80
[  103.889675][ T1127]  __slab_alloc+0x3e/0x80
[  103.890108][ T1127]  __kmalloc_node_track_caller+0xc7/0x420
[ ... ]

Fixes: 11a766ce91 ("net: Increase xmit RECURSION_LIMIT to 10.")
Signed-off-by: Taehee Yoo <ap420073@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-06-30 15:36:44 -04:00
Thomas Martitz
f32325b100 net: bridge: enfore alignment for ethernet address
[ Upstream commit db7202dec92e6caa2706c21d6fc359af318bde2e ]

The eth_addr member is passed to ether_addr functions that require
2-byte alignment, therefore the member must be properly aligned
to avoid unaligned accesses.

The problem is in place since the initial merge of multicast to unicast:
commit 6db6f0eae6 bridge: multicast to unicast

Fixes: 6db6f0eae6 ("bridge: multicast to unicast")
Cc: Roopa Prabhu <roopa@cumulusnetworks.com>
Cc: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
Cc: David S. Miller <davem@davemloft.net>
Cc: Jakub Kicinski <kuba@kernel.org>
Cc: Felix Fietkau <nbd@nbd.name>
Cc: stable@vger.kernel.org
Signed-off-by: Thomas Martitz <t.martitz@avm.de>
Acked-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-06-30 15:36:44 -04:00
Sven Auhagen
57a976e676 mvpp2: ethtool rxtx stats fix
[ Upstream commit cc970925feb9a38c2f0d34305518e00a3084ce85 ]

The ethtool rx and tx queue statistics are reporting wrong values.
Fix reading out the correct ones.

Signed-off-by: Sven Auhagen <sven.auhagen@voleatech.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-06-30 15:36:44 -04:00
Wang Hai
fa0d7e09da mld: fix memory leak in ipv6_mc_destroy_dev()
[ Upstream commit ea2fce88d2fd678ed9d45354ff49b73f1d5615dd ]

Commit a84d016479 ("mld: fix memory leak in mld_del_delrec()") fixed
the memory leak of MLD, but missing the ipv6_mc_destroy_dev() path, in
which mca_sources are leaked after ma_put().

Using ip6_mc_clear_src() to take care of the missing free.

BUG: memory leak
unreferenced object 0xffff8881113d3180 (size 64):
  comm "syz-executor071", pid 389, jiffies 4294887985 (age 17.943s)
  hex dump (first 32 bytes):
    00 00 00 00 00 00 00 00 ff 02 00 00 00 00 00 00  ................
    00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 00  ................
  backtrace:
    [<000000002cbc483c>] kmalloc include/linux/slab.h:555 [inline]
    [<000000002cbc483c>] kzalloc include/linux/slab.h:669 [inline]
    [<000000002cbc483c>] ip6_mc_add1_src net/ipv6/mcast.c:2237 [inline]
    [<000000002cbc483c>] ip6_mc_add_src+0x7f5/0xbb0 net/ipv6/mcast.c:2357
    [<0000000058b8b1ff>] ip6_mc_source+0xe0c/0x1530 net/ipv6/mcast.c:449
    [<000000000bfc4fb5>] do_ipv6_setsockopt.isra.12+0x1b2c/0x3b30 net/ipv6/ipv6_sockglue.c:754
    [<00000000e4e7a722>] ipv6_setsockopt+0xda/0x150 net/ipv6/ipv6_sockglue.c:950
    [<0000000029260d9a>] rawv6_setsockopt+0x45/0x100 net/ipv6/raw.c:1081
    [<000000005c1b46f9>] __sys_setsockopt+0x131/0x210 net/socket.c:2132
    [<000000008491f7db>] __do_sys_setsockopt net/socket.c:2148 [inline]
    [<000000008491f7db>] __se_sys_setsockopt net/socket.c:2145 [inline]
    [<000000008491f7db>] __x64_sys_setsockopt+0xba/0x150 net/socket.c:2145
    [<00000000c7bc11c5>] do_syscall_64+0xa1/0x530 arch/x86/entry/common.c:295
    [<000000005fb7a3f3>] entry_SYSCALL_64_after_hwframe+0x49/0xb3

Fixes: 1666d49e1d ("mld: do not remove mld souce list info when set link down")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Wang Hai <wanghai38@huawei.com>
Acked-by: Hangbin Liu <liuhangbin@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-06-30 15:36:43 -04:00
Thomas Falcon
009b3e294a ibmveth: Fix max MTU limit
[ Upstream commit 5948378b26d89f8aa5eac37629dbd0616ce8d7a7 ]

The max MTU limit defined for ibmveth is not accounting for
virtual ethernet buffer overhead, which is twenty-two additional
bytes set aside for the ethernet header and eight additional bytes
of an opaque handle reserved for use by the hypervisor. Update the
max MTU to reflect this overhead.

Fixes: d894be57ca ("ethernet: use net core MTU range checking in more drivers")
Fixes: 110447f826 ("ethernet: fix min/max MTU typos")
Signed-off-by: Thomas Falcon <tlfalcon@linux.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-06-30 15:36:43 -04:00
Sabrina Dubroca
f060107ccc geneve: allow changing DF behavior after creation
[ Upstream commit 56c09de347e40804fc8dad155272fb9609e0a97b ]

Currently, trying to change the DF parameter of a geneve device does
nothing:

    # ip -d link show geneve1
    14: geneve1: <snip>
        link/ether <snip>
        geneve id 1 remote 10.0.0.1 ttl auto df set dstport 6081 <snip>
    # ip link set geneve1 type geneve id 1 df unset
    # ip -d link show geneve1
    14: geneve1: <snip>
        link/ether <snip>
        geneve id 1 remote 10.0.0.1 ttl auto df set dstport 6081 <snip>

We just need to update the value in geneve_changelink.

Fixes: a025fb5f49 ("geneve: Allow configuration of DF behaviour")
Signed-off-by: Sabrina Dubroca <sd@queasysnail.net>
Reviewed-by: Stefano Brivio <sbrivio@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-06-30 15:36:43 -04:00
Claudiu Manoil
ce06fcb6a6 enetc: Fix tx rings bitmap iteration range, irq handling
[ Upstream commit 0574e2000fc3103cbc69ba82ec1175ce171fdf5e ]

The rings bitmap of an interrupt vector encodes
which of the device's rings were assigned to that
interrupt vector.
Hence the iteration range of the tx rings bitmap
(for_each_set_bit()) should be the total number of
Tx rings of that netdevice instead of the number of
rings assigned to the interrupt vector.
Since there are 2 cores, and one interrupt vector for
each core, the number of rings asigned to an interrupt
vector is half the number of available rings.
The impact of this error is that the upper half of the
tx rings could still generate interrupts during napi
polling.

Fixes: d4fd0404c1 ("enetc: Introduce basic PF and VF ENETC ethernet drivers")
Signed-off-by: Claudiu Manoil <claudiu.manoil@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-06-30 15:36:43 -04:00
yu kuai
b90ca32531 block/bio-integrity: don't free 'buf' if bio_integrity_add_page() failed
commit a75ca9303175d36af93c0937dd9b1a6422908b8d upstream.

commit e7bf90e5af ("block/bio-integrity: fix a memory leak bug") added
a kfree() for 'buf' if bio_integrity_add_page() returns '0'. However,
the object will be freed in bio_integrity_free() since 'bio->bi_opf' and
'bio->bi_integrity' were set previousy in bio_integrity_alloc().

Fixes: commit e7bf90e5af ("block/bio-integrity: fix a memory leak bug")
Signed-off-by: yu kuai <yukuai3@huawei.com>
Reviewed-by: Ming Lei <ming.lei@redhat.com>
Reviewed-by: Bob Liu <bob.liu@oracle.com>
Acked-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Cc: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-06-30 15:36:43 -04:00
Mohammed Mirza Mandayappurath Manzoor
1cbe954d43 msm: kgsl: Update current frequency in devfreq status structure
Current frequency was defaulted to min frequency. Which in turn prevents
bus dcvs to place the ib vote, due to a mismatch in current frequency
and devfreq recommended frequency.

Change-Id: Icda3669f2423369eeebfb0193d04de41c1f10b57
Signed-off-by: Mohammed Mirza Mandayappurath Manzoor <mmandaya@codeaurora.org>
2020-06-30 11:37:28 -07:00
Charan Teja Reddy
0112a49388 mm, memory_hotplug: update pcp lists everytime onlining a memory block
When onlining a first memory block in a zone, pcp lists are not updated
thus pcp struct will have the default setting of ->high = 0,->batch = 1.
This means till the second memory block in a zone(if it have) is onlined
the pcp lists of this zone will not contain any pages because pcp's
->count is always greater than ->high thus free_pcppages_bulk() is
called to free batch size(=1) pages every time system wants to add a
page to the pcp list through free_unref_page(). To put this in a word,
system is not using benefits offered by the pcp lists when there is a
single onlineable memory block in a zone. Correct this by always
updating the pcp lists when memory block is onlined.

Change-Id: I5a0c5cc128481fdb48b9dc4e1fe2860f59e958e3
Signed-off-by: Charan Teja Reddy <charante@codeaurora.org>
[isaacm@codeaurora.org: resolved trivial merge conflicts]
Signed-off-by: Isaac J. Manjarres <isaacm@codeaurora.org>
2020-06-30 11:21:25 -07:00
Mayank Rana
b61b1b39a1 sound: usb: Fix check with usb_get_controller_id() for valid controller id
usb_get_controller_id() API shall returns non-negative number as valid id
related to USB controller if alias is found. Current code considers zero
as only valid controller id and doesn't update for secondary USB controller
(i.e. id as 1). This results into passing controller id as zero instead of
1 causing bus error when ADSP USB driver is trying to access primary USB
controller's register (it is supposed to access USB secondary controller's
register) when primary USB controller related clocks are voted off. Fix
this issue by updating check to consider all non-negative number as valid
number and updating same.

Change-Id: Id15edbdfd6c924000da18bbb82d0483d4d110d41
Signed-off-by: Mayank Rana <mrana@codeaurora.org>
2020-06-30 10:46:15 -07:00
Greg Kroah-Hartman
ad0c0ab1dc ANDROID: GKI: revert part of the ufshcd_* export removals
Turns out that not all UFS drivers are in the tree, so some vendors
still need these, so add them back for them to use.  Also remove
building in CONFIG_SCSI_UFS_QCOM as the in-kernel driver is quite out of
date.

Bug: 157965270
Reported-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: Id105edff00f77af43fec664a39e0c7b97779f92c
2020-06-30 18:42:20 +02:00
Greg Kroah-Hartman
91f19a26c8 ANDROID: GKI: update ABI definitions based on recent wifi backports
Leaf changes summary: 9 artifacts changed
Changed leaf types summary: 9 leaf types changed
Removed/Changed/Added functions summary: 0 Removed, 0 Changed, 0 Added function
Removed/Changed/Added variables summary: 0 Removed, 0 Changed, 0 Added variable

'enum nl80211_attrs at nl80211.h:2380:1' changed:
  type size hasn't changed
  7 enumerator insertions:
    'nl80211_attrs::NL80211_ATTR_VLAN_ID' value '282'
    'nl80211_attrs::NL80211_ATTR_HE_BSS_COLOR' value '283'
    'nl80211_attrs::NL80211_ATTR_IFTYPE_AKM_SUITES' value '284'
    'nl80211_attrs::NL80211_ATTR_TID_CONFIG' value '285'
    'nl80211_attrs::NL80211_ATTR_CONTROL_PORT_NO_PREAUTH' value '286'
    'nl80211_attrs::NL80211_ATTR_PMK_LIFETIME' value '287'
    'nl80211_attrs::NL80211_ATTR_PMK_REAUTH_THRESHOLD' value '288'
  3 enumerator changes:
    'nl80211_attrs::NL80211_ATTR_MAX' from value '281' to '288' at nl80211.h:2469:1
    'nl80211_attrs::NUM_NL80211_ATTR' from value '282' to '289' at nl80211.h:2469:1
    'nl80211_attrs::__NL80211_ATTR_AFTER_LAST' from value '282' to '289' at nl80211.h:2469:1
  2 impacted interfaces

'enum nl80211_commands at nl80211.h:1107:1' changed:
  type size hasn't changed
  1 enumerator insertion:
    'nl80211_commands::NL80211_CMD_SET_TID_CONFIG' value '137'
  2 enumerator changes:
    'nl80211_commands::NL80211_CMD_MAX' from value '136' to '137' at nl80211.h:1149:1
    'nl80211_commands::__NL80211_CMD_AFTER_LAST' from value '137' to '138' at nl80211.h:1149:1
  2 impacted interfaces
'struct cfg80211_ap_settings at cfg80211.h:992:1' changed:
  type size hasn't changed
  1 data member insertion:
    'cfg80211_he_bss_color cfg80211_ap_settings::he_bss_color', at offset 4120 (in bits) at cfg80211.h:1063:1
  one impacted interface

'struct cfg80211_cached_keys at core.h:272:1' changed (indirectly):
  type size changed from 1472 to 1728 (in bits)
  there are data member changes:
    'key_params cfg80211_cached_keys::params[4]' size changed from 1024 to 1280 (in bits) (by +256 bits)
    'u8 cfg80211_cached_keys::data[4][13]' offset changed from 1024 to 1280 (in bits) (by +256 bits)
    'int cfg80211_cached_keys::def' offset changed from 1440 to 1696 (in bits) (by +256 bits)
  55 impacted interfaces

'struct cfg80211_ops at cfg80211.h:3632:1' changed:
  type size changed from 6976 to 7168 (in bits)
  3 data member insertions:
    'int (wiphy*, net_device*, typedef u8)* cfg80211_ops::set_default_beacon_key', at offset 704 (in bits) at cfg80211.h:3730:1
    'int (wiphy*, net_device*, cfg80211_tid_config*)* cfg80211_ops::set_tid_config', at offset 7040 (in bits) at cfg80211.h:4020:1
    'int (wiphy*, net_device*, const u8*, typedef u8)* cfg80211_ops::reset_tid_config', at offset 7104 (in bits) at cfg80211.h:4022:1
  there are data member changes:
    'int (wiphy*, net_device*, cfg80211_ap_settings*)* cfg80211_ops::start_ap' offset changed from 704 to 768 (in bits) (by +64 bits)
    'int (wiphy*, net_device*, cfg80211_beacon_data*)* cfg80211_ops::change_beacon' offset changed from 768 to 832 (in bits) (by +64 bits)
    'int (wiphy*, net_device*)* cfg80211_ops::stop_ap' offset changed from 832 to 896 (in bits) (by +64 bits)
    'int (wiphy*, net_device*, const u8*, station_parameters*)* cfg80211_ops::add_station' offset changed from 896 to 960 (in bits) (by +64 bits)
    'int (wiphy*, net_device*, station_del_parameters*)* cfg80211_ops::del_station' offset changed from 960 to 1024 (in bits) (by +64 bits)
    'int (wiphy*, net_device*, const u8*, station_parameters*)* cfg80211_ops::change_station' offset changed from 1024 to 1088 (in bits) (by +64 bits)
    'int (wiphy*, net_device*, const u8*, station_info*)* cfg80211_ops::get_station' offset changed from 1088 to 1152 (in bits) (by +64 bits)
    'int (wiphy*, net_device*, int, u8*, station_info*)* cfg80211_ops::dump_station' offset changed from 1152 to 1216 (in bits) (by +64 bits)
    'int (wiphy*, net_device*, const u8*, const u8*)* cfg80211_ops::add_mpath' offset changed from 1216 to 1280 (in bits) (by +64 bits)
    'int (wiphy*, net_device*, const u8*)* cfg80211_ops::del_mpath' offset changed from 1280 to 1344 (in bits) (by +64 bits)
    'int (wiphy*, net_device*, const u8*, const u8*)* cfg80211_ops::change_mpath' offset changed from 1344 to 1408 (in bits) (by +64 bits)
    'int (wiphy*, net_device*, u8*, u8*, mpath_info*)* cfg80211_ops::get_mpath' offset changed from 1408 to 1472 (in bits) (by +64 bits)
    'int (wiphy*, net_device*, int, u8*, u8*, mpath_info*)* cfg80211_ops::dump_mpath' offset changed from 1472 to 1536 (in bits) (by +64 bits)
    'int (wiphy*, net_device*, u8*, u8*, mpath_info*)* cfg80211_ops::get_mpp' offset changed from 1536 to 1600 (in bits) (by +64 bits)
    'int (wiphy*, net_device*, int, u8*, u8*, mpath_info*)* cfg80211_ops::dump_mpp' offset changed from 1600 to 1664 (in bits) (by +64 bits)
    'int (wiphy*, net_device*, mesh_config*)* cfg80211_ops::get_mesh_config' offset changed from 1664 to 1728 (in bits) (by +64 bits)
    'int (wiphy*, net_device*, typedef u32, const mesh_config*)* cfg80211_ops::update_mesh_config' offset changed from 1728 to 1792 (in bits) (by +64 bits)
    'int (wiphy*, net_device*, const mesh_config*, const mesh_setup*)* cfg80211_ops::join_mesh' offset changed from 1792 to 1856 (in bits) (by +64 bits)
    'int (wiphy*, net_device*)* cfg80211_ops::leave_mesh' offset changed from 1856 to 1920 (in bits) (by +64 bits)
    'int (wiphy*, net_device*, ocb_setup*)* cfg80211_ops::join_ocb' offset changed from 1920 to 1984 (in bits) (by +64 bits)
    'int (wiphy*, net_device*)* cfg80211_ops::leave_ocb' offset changed from 1984 to 2048 (in bits) (by +64 bits)
    'int (wiphy*, net_device*, bss_parameters*)* cfg80211_ops::change_bss' offset changed from 2048 to 2112 (in bits) (by +64 bits)
    'int (wiphy*, net_device*, ieee80211_txq_params*)* cfg80211_ops::set_txq_params' offset changed from 2112 to 2176 (in bits) (by +64 bits)
    'int (wiphy*, net_device*, ieee80211_channel*)* cfg80211_ops::libertas_set_mesh_channel' offset changed from 2176 to 2240 (in bits) (by +64 bits)
    'int (wiphy*, cfg80211_chan_def*)* cfg80211_ops::set_monitor_channel' offset changed from 2240 to 2304 (in bits) (by +64 bits)
    'int (wiphy*, cfg80211_scan_request*)* cfg80211_ops::scan' offset changed from 2304 to 2368 (in bits) (by +64 bits)
    'void (wiphy*, wireless_dev*)* cfg80211_ops::abort_scan' offset changed from 2368 to 2432 (in bits) (by +64 bits)
    'int (wiphy*, net_device*, cfg80211_auth_request*)* cfg80211_ops::auth' offset changed from 2432 to 2496 (in bits) (by +64 bits)
    'int (wiphy*, net_device*, cfg80211_assoc_request*)* cfg80211_ops::assoc' offset changed from 2496 to 2560 (in bits) (by +64 bits)
    'int (wiphy*, net_device*, cfg80211_deauth_request*)* cfg80211_ops::deauth' offset changed from 2560 to 2624 (in bits) (by +64 bits)
    'int (wiphy*, net_device*, cfg80211_disassoc_request*)* cfg80211_ops::disassoc' offset changed from 2624 to 2688 (in bits) (by +64 bits)
    'int (wiphy*, net_device*, cfg80211_connect_params*)* cfg80211_ops::connect' offset changed from 2688 to 2752 (in bits) (by +64 bits)
    'int (wiphy*, net_device*, cfg80211_connect_params*, typedef u32)* cfg80211_ops::update_connect_params' offset changed from 2752 to 2816 (in bits) (by +64 bits)
    'int (wiphy*, net_device*, typedef u16)* cfg80211_ops::disconnect' offset changed from 2816 to 2880 (in bits) (by +64 bits)
    'int (wiphy*, net_device*, cfg80211_ibss_params*)* cfg80211_ops::join_ibss' offset changed from 2880 to 2944 (in bits) (by +64 bits)
    'int (wiphy*, net_device*)* cfg80211_ops::leave_ibss' offset changed from 2944 to 3008 (in bits) (by +64 bits)
    'int (wiphy*, net_device*, int*)* cfg80211_ops::set_mcast_rate' offset changed from 3008 to 3072 (in bits) (by +64 bits)
    'int (wiphy*, typedef u32)* cfg80211_ops::set_wiphy_params' offset changed from 3072 to 3136 (in bits) (by +64 bits)
    'int (wiphy*, wireless_dev*, enum nl80211_tx_power_setting, int)* cfg80211_ops::set_tx_power' offset changed from 3136 to 3200 (in bits) (by +64 bits)
    'int (wiphy*, wireless_dev*, int*)* cfg80211_ops::get_tx_power' offset changed from 3200 to 3264 (in bits) (by +64 bits)
    'int (wiphy*, net_device*, const u8*)* cfg80211_ops::set_wds_peer' offset changed from 3264 to 3328 (in bits) (by +64 bits)
    'void (wiphy*)* cfg80211_ops::rfkill_poll' offset changed from 3328 to 3392 (in bits) (by +64 bits)
    'int (wiphy*, net_device*, const u8*, const cfg80211_bitrate_mask*)* cfg80211_ops::set_bitrate_mask' offset changed from 3392 to 3456 (in bits) (by +64 bits)
    'int (wiphy*, net_device*, int, survey_info*)* cfg80211_ops::dump_survey' offset changed from 3456 to 3520 (in bits) (by +64 bits)
    'int (wiphy*, net_device*, cfg80211_pmksa*)* cfg80211_ops::set_pmksa' offset changed from 3520 to 3584 (in bits) (by +64 bits)
    'int (wiphy*, net_device*, cfg80211_pmksa*)* cfg80211_ops::del_pmksa' offset changed from 3584 to 3648 (in bits) (by +64 bits)
    'int (wiphy*, net_device*)* cfg80211_ops::flush_pmksa' offset changed from 3648 to 3712 (in bits) (by +64 bits)
    'int (wiphy*, wireless_dev*, ieee80211_channel*, unsigned int, u64*)* cfg80211_ops::remain_on_channel' offset changed from 3712 to 3776 (in bits) (by +64 bits)
    'int (wiphy*, wireless_dev*, typedef u64)* cfg80211_ops::cancel_remain_on_channel' offset changed from 3776 to 3840 (in bits) (by +64 bits)
    'int (wiphy*, wireless_dev*, cfg80211_mgmt_tx_params*, u64*)* cfg80211_ops::mgmt_tx' offset changed from 3840 to 3904 (in bits) (by +64 bits)
    'int (wiphy*, wireless_dev*, typedef u64)* cfg80211_ops::mgmt_tx_cancel_wait' offset changed from 3904 to 3968 (in bits) (by +64 bits)
    'int (wiphy*, net_device*, typedef bool, int)* cfg80211_ops::set_power_mgmt' offset changed from 3968 to 4032 (in bits) (by +64 bits)
    'int (wiphy*, net_device*, typedef s32, typedef u32)* cfg80211_ops::set_cqm_rssi_config' offset changed from 4032 to 4096 (in bits) (by +64 bits)
    'int (wiphy*, net_device*, typedef s32, typedef s32)* cfg80211_ops::set_cqm_rssi_range_config' offset changed from 4096 to 4160 (in bits) (by +64 bits)
    'int (wiphy*, net_device*, typedef u32, typedef u32, typedef u32)* cfg80211_ops::set_cqm_txe_config' offset changed from 4160 to 4224 (in bits) (by +64 bits)
    'void (wiphy*, wireless_dev*, typedef u16, typedef bool)* cfg80211_ops::mgmt_frame_register' offset changed from 4224 to 4288 (in bits) (by +64 bits)
    'int (wiphy*, typedef u32, typedef u32)* cfg80211_ops::set_antenna' offset changed from 4288 to 4352 (in bits) (by +64 bits)
    'int (wiphy*, u32*, u32*)* cfg80211_ops::get_antenna' offset changed from 4352 to 4416 (in bits) (by +64 bits)
    'int (wiphy*, net_device*, cfg80211_sched_scan_request*)* cfg80211_ops::sched_scan_start' offset changed from 4416 to 4480 (in bits) (by +64 bits)
    'int (wiphy*, net_device*, typedef u64)* cfg80211_ops::sched_scan_stop' offset changed from 4480 to 4544 (in bits) (by +64 bits)
    'int (wiphy*, net_device*, cfg80211_gtk_rekey_data*)* cfg80211_ops::set_rekey_data' offset changed from 4544 to 4608 (in bits) (by +64 bits)
    'int (wiphy*, net_device*, const u8*, typedef u8, typedef u8, typedef u16, typedef u32, typedef bool, const u8*, typedef size_t)* cfg80211_ops::tdls_mgmt' offset changed from 4608 to 4672 (in bits) (by +64 bits)
    'int (wiphy*, net_device*, const u8*, enum nl80211_tdls_operation)* cfg80211_ops::tdls_oper' offset changed from 4672 to 4736 (in bits) (by +64 bits)
    'int (wiphy*, net_device*, const u8*, u64*)* cfg80211_ops::probe_client' offset changed from 4736 to 4800 (in bits) (by +64 bits)
    'int (wiphy*, net_device*, typedef u16)* cfg80211_ops::set_noack_map' offset changed from 4800 to 4864 (in bits) (by +64 bits)
    'int (wiphy*, wireless_dev*, cfg80211_chan_def*)* cfg80211_ops::get_channel' offset changed from 4864 to 4928 (in bits) (by +64 bits)
    'int (wiphy*, wireless_dev*)* cfg80211_ops::start_p2p_device' offset changed from 4928 to 4992 (in bits) (by +64 bits)
    'void (wiphy*, wireless_dev*)* cfg80211_ops::stop_p2p_device' offset changed from 4992 to 5056 (in bits) (by +64 bits)
    'int (wiphy*, net_device*, const cfg80211_acl_data*)* cfg80211_ops::set_mac_acl' offset changed from 5056 to 5120 (in bits) (by +64 bits)
    'int (wiphy*, net_device*, cfg80211_chan_def*, typedef u32)* cfg80211_ops::start_radar_detection' offset changed from 5120 to 5184 (in bits) (by +64 bits)
    'void (wiphy*, net_device*)* cfg80211_ops::end_cac' offset changed from 5184 to 5248 (in bits) (by +64 bits)
    'int (wiphy*, net_device*, cfg80211_update_ft_ies_params*)* cfg80211_ops::update_ft_ies' offset changed from 5248 to 5312 (in bits) (by +64 bits)
    'int (wiphy*, wireless_dev*, enum nl80211_crit_proto_id, typedef u16)* cfg80211_ops::crit_proto_start' offset changed from 5312 to 5376 (in bits) (by +64 bits)
    'void (wiphy*, wireless_dev*)* cfg80211_ops::crit_proto_stop' offset changed from 5376 to 5440 (in bits) (by +64 bits)
    'int (wiphy*, cfg80211_coalesce*)* cfg80211_ops::set_coalesce' offset changed from 5440 to 5504 (in bits) (by +64 bits)
    'int (wiphy*, net_device*, cfg80211_csa_settings*)* cfg80211_ops::channel_switch' offset changed from 5504 to 5568 (in bits) (by +64 bits)
    'int (wiphy*, net_device*, cfg80211_qos_map*)* cfg80211_ops::set_qos_map' offset changed from 5568 to 5632 (in bits) (by +64 bits)
    'int (wiphy*, net_device*, cfg80211_chan_def*)* cfg80211_ops::set_ap_chanwidth' offset changed from 5632 to 5696 (in bits) (by +64 bits)
    'int (wiphy*, net_device*, typedef u8, const u8*, typedef u8, typedef u16)* cfg80211_ops::add_tx_ts' offset changed from 5696 to 5760 (in bits) (by +64 bits)
    'int (wiphy*, net_device*, typedef u8, const u8*)* cfg80211_ops::del_tx_ts' offset changed from 5760 to 5824 (in bits) (by +64 bits)
    'int (wiphy*, net_device*, const u8*, typedef u8, cfg80211_chan_def*)* cfg80211_ops::tdls_channel_switch' offset changed from 5824 to 5888 (in bits) (by +64 bits)
    'void (wiphy*, net_device*, const u8*)* cfg80211_ops::tdls_cancel_channel_switch' offset changed from 5888 to 5952 (in bits) (by +64 bits)
    'int (wiphy*, wireless_dev*, cfg80211_nan_conf*)* cfg80211_ops::start_nan' offset changed from 5952 to 6016 (in bits) (by +64 bits)
    'void (wiphy*, wireless_dev*)* cfg80211_ops::stop_nan' offset changed from 6016 to 6080 (in bits) (by +64 bits)
    'int (wiphy*, wireless_dev*, cfg80211_nan_func*)* cfg80211_ops::add_nan_func' offset changed from 6080 to 6144 (in bits) (by +64 bits)
    'void (wiphy*, wireless_dev*, typedef u64)* cfg80211_ops::del_nan_func' offset changed from 6144 to 6208 (in bits) (by +64 bits)
    'int (wiphy*, wireless_dev*, cfg80211_nan_conf*, typedef u32)* cfg80211_ops::nan_change_conf' offset changed from 6208 to 6272 (in bits) (by +64 bits)
    'int (wiphy*, net_device*, const bool)* cfg80211_ops::set_multicast_to_unicast' offset changed from 6272 to 6336 (in bits) (by +64 bits)
    'int (wiphy*, wireless_dev*, cfg80211_txq_stats*)* cfg80211_ops::get_txq_stats' offset changed from 6336 to 6400 (in bits) (by +64 bits)
    'int (wiphy*, net_device*, const cfg80211_pmk_conf*)* cfg80211_ops::set_pmk' offset changed from 6400 to 6464 (in bits) (by +64 bits)
    'int (wiphy*, net_device*, const u8*)* cfg80211_ops::del_pmk' offset changed from 6464 to 6528 (in bits) (by +64 bits)
    'int (wiphy*, net_device*, cfg80211_external_auth_params*)* cfg80211_ops::external_auth' offset changed from 6528 to 6592 (in bits) (by +64 bits)
    'int (wiphy*, net_device*, const u8*, typedef size_t, const u8*, const __be16, const bool)* cfg80211_ops::tx_control_port' offset changed from 6592 to 6656 (in bits) (by +64 bits)
    'int (wiphy*, net_device*, cfg80211_ftm_responder_stats*)* cfg80211_ops::get_ftm_responder_stats' offset changed from 6656 to 6720 (in bits) (by +64 bits)
    'int (wiphy*, wireless_dev*, cfg80211_pmsr_request*)* cfg80211_ops::start_pmsr' offset changed from 6720 to 6784 (in bits) (by +64 bits)
    'void (wiphy*, wireless_dev*, cfg80211_pmsr_request*)* cfg80211_ops::abort_pmsr' offset changed from 6784 to 6848 (in bits) (by +64 bits)
    'int (wiphy*, net_device*, cfg80211_update_owe_info*)* cfg80211_ops::update_owe_info' offset changed from 6848 to 6912 (in bits) (by +64 bits)
    'int (wiphy*, net_device*, const u8*, typedef size_t)* cfg80211_ops::probe_mesh_link' offset changed from 6912 to 6976 (in bits) (by +64 bits)
  one impacted interface

'struct cfg80211_pmksa at cfg80211.h:2624:1' changed:
  type size changed from 448 to 512 (in bits)
  2 data member insertions:
    'u32 cfg80211_pmksa::pmk_lifetime', at offset 448 (in bits) at cfg80211.h:2690:1
    'u8 cfg80211_pmksa::pmk_reauth_threshold', at offset 480 (in bits) at cfg80211.h:2691:1
  one impacted interface

'struct key_params at cfg80211.h:570:1' changed:
  type size changed from 256 to 320 (in bits)
  1 data member insertion:
    'u16 key_params::vlan_id', at offset 192 (in bits) at cfg80211.h:589:1
  there are data member changes:
    'u32 key_params::cipher' offset changed from 192 to 224 (in bits) (by +32 bits)
    'nl80211_key_mode key_params::mode' offset changed from 224 to 256 (in bits) (by +32 bits)
  55 impacted interfaces

'struct station_parameters at cfg80211.h:1155:1' changed:
  type size changed from 1152 to 1216 (in bits)
  1 data member insertion:
    'u16 station_parameters::vlan_id', at offset 272 (in bits) at cfg80211.h:1208:1
  there are data member changes:
    'u16 station_parameters::peer_aid' offset changed from 272 to 288 (in bits) (by +16 bits)
    'u8 station_parameters::supported_rates_len' offset changed from 288 to 304 (in bits) (by +16 bits)
    'u8 station_parameters::plink_action' offset changed from 296 to 312 (in bits) (by +16 bits)
    'u8 station_parameters::plink_state' offset changed from 304 to 320 (in bits) (by +16 bits)
    'const ieee80211_ht_cap* station_parameters::ht_capa' offset changed from 320 to 384 (in bits) (by +64 bits)
    'const ieee80211_vht_cap* station_parameters::vht_capa' offset changed from 384 to 448 (in bits) (by +64 bits)
    'u8 station_parameters::uapsd_queues' offset changed from 448 to 512 (in bits) (by +64 bits)
    'u8 station_parameters::max_sp' offset changed from 456 to 520 (in bits) (by +64 bits)
    'nl80211_mesh_power_mode station_parameters::local_pm' offset changed from 480 to 544 (in bits) (by +64 bits)
    'u16 station_parameters::capability' offset changed from 512 to 576 (in bits) (by +64 bits)
    'const u8* station_parameters::ext_capab' offset changed from 576 to 640 (in bits) (by +64 bits)
    'u8 station_parameters::ext_capab_len' offset changed from 640 to 704 (in bits) (by +64 bits)
    'const u8* station_parameters::supported_channels' offset changed from 704 to 768 (in bits) (by +64 bits)
    'u8 station_parameters::supported_channels_len' offset changed from 768 to 832 (in bits) (by +64 bits)
    'const u8* station_parameters::supported_oper_classes' offset changed from 832 to 896 (in bits) (by +64 bits)
    'u8 station_parameters::supported_oper_classes_len' offset changed from 896 to 960 (in bits) (by +64 bits)
    'u8 station_parameters::opmode_notif' offset changed from 904 to 968 (in bits) (by +64 bits)
    'bool station_parameters::opmode_notif_used' offset changed from 912 to 976 (in bits) (by +64 bits)
    'int station_parameters::support_p2p_ps' offset changed from 928 to 992 (in bits) (by +64 bits)
    'const ieee80211_he_cap_elem* station_parameters::he_capa' offset changed from 960 to 1024 (in bits) (by +64 bits)
    'u8 station_parameters::he_capa_len' offset changed from 1024 to 1088 (in bits) (by +64 bits)
    'u16 station_parameters::airtime_weight' offset changed from 1040 to 1104 (in bits) (by +64 bits)
    'sta_txpwr station_parameters::txpwr' offset changed from 1056 to 1120 (in bits) (by +64 bits)
  one impacted interface

'struct wiphy at cfg80211.h:4541:1' changed:
  type size changed from 10752 to 11008 (in bits)
  3 data member insertions:
    'const wiphy_iftype_akm_suites* wiphy::iftype_akm_suites', at offset 1088 (in bits) at cfg80211.h:4690:1
    'unsigned int wiphy::num_iftype_akm_suites', at offset 1152 (in bits) at cfg80211.h:4691:1
    'struct {u64 curr; u64 next;} wiphy::tid_config_support', at offset 10752 (in bits) at cfg80211.h:4792:1
  there are data member changes:
    type 'u8[5]' of 'wiphy::ext_features' changed:
      type name changed from 'u8[5]' to 'u8[6]'
      array type size changed from 40 to 48
      array type subrange 1 changed length from 5 to 6
    'u8 wiphy::retry_short' offset changed from 1088 to 1184 (in bits) (by +96 bits)
    'u8 wiphy::retry_long' offset changed from 1096 to 1192 (in bits) (by +96 bits)
    'u32 wiphy::frag_threshold' offset changed from 1120 to 1216 (in bits) (by +96 bits)
    'u32 wiphy::rts_threshold' offset changed from 1152 to 1248 (in bits) (by +96 bits)
    'u8 wiphy::coverage_class' offset changed from 1184 to 1280 (in bits) (by +96 bits)
    'char wiphy::fw_version[32]' offset changed from 1192 to 1288 (in bits) (by +96 bits)
    'u32 wiphy::hw_version' offset changed from 1472 to 1568 (in bits) (by +96 bits)
    'const wiphy_wowlan_support* wiphy::wowlan' offset changed from 1536 to 1600 (in bits) (by +64 bits)
    'cfg80211_wowlan* wiphy::wowlan_config' offset changed from 1600 to 1664 (in bits) (by +64 bits)
    'u16 wiphy::max_remain_on_channel_duration' offset changed from 1664 to 1728 (in bits) (by +64 bits)
    'u8 wiphy::max_num_pmkids' offset changed from 1680 to 1744 (in bits) (by +64 bits)
    'u32 wiphy::available_antennas_tx' offset changed from 1696 to 1760 (in bits) (by +64 bits)
    'u32 wiphy::available_antennas_rx' offset changed from 1728 to 1792 (in bits) (by +64 bits)
    'u32 wiphy::probe_resp_offload' offset changed from 1760 to 1824 (in bits) (by +64 bits)
    'const u8* wiphy::extended_capabilities' offset changed from 1792 to 1856 (in bits) (by +64 bits)
    'const u8* wiphy::extended_capabilities_mask' offset changed from 1856 to 1920 (in bits) (by +64 bits)
    'u8 wiphy::extended_capabilities_len' offset changed from 1920 to 1984 (in bits) (by +64 bits)
    'const wiphy_iftype_ext_capab* wiphy::iftype_ext_capab' offset changed from 1984 to 2048 (in bits) (by +64 bits)
    'unsigned int wiphy::num_iftype_ext_capab' offset changed from 2048 to 2112 (in bits) (by +64 bits)
    'void* wiphy::privid' offset changed from 2112 to 2176 (in bits) (by +64 bits)
    'ieee80211_supported_band* wiphy::bands[4]' offset changed from 2176 to 2240 (in bits) (by +64 bits)
    'void (wiphy*, regulatory_request*)* wiphy::reg_notifier' offset changed from 2432 to 2496 (in bits) (by +64 bits)
    'const ieee80211_regdomain* wiphy::regd' offset changed from 2496 to 2560 (in bits) (by +64 bits)
    'device wiphy::dev' offset changed from 2560 to 2624 (in bits) (by +64 bits)
    'bool wiphy::registered' offset changed from 9664 to 9728 (in bits) (by +64 bits)
    'dentry* wiphy::debugfsdir' offset changed from 9728 to 9792 (in bits) (by +64 bits)
    'const ieee80211_ht_cap* wiphy::ht_capa_mod_mask' offset changed from 9792 to 9856 (in bits) (by +64 bits)
    'const ieee80211_vht_cap* wiphy::vht_capa_mod_mask' offset changed from 9856 to 9920 (in bits) (by +64 bits)
    'list_head wiphy::wdev_list' offset changed from 9920 to 9984 (in bits) (by +64 bits)
    'possible_net_t wiphy::_net' offset changed from 10048 to 10112 (in bits) (by +64 bits)
    'const wiphy_coalesce_support* wiphy::coalesce' offset changed from 10112 to 10176 (in bits) (by +64 bits)
    'const wiphy_vendor_command* wiphy::vendor_commands' offset changed from 10176 to 10240 (in bits) (by +64 bits)
    'const nl80211_vendor_cmd_info* wiphy::vendor_events' offset changed from 10240 to 10304 (in bits) (by +64 bits)
    'int wiphy::n_vendor_commands' offset changed from 10304 to 10368 (in bits) (by +64 bits)
    'int wiphy::n_vendor_events' offset changed from 10336 to 10400 (in bits) (by +64 bits)
    'u16 wiphy::max_ap_assoc_sta' offset changed from 10368 to 10432 (in bits) (by +64 bits)
    'u8 wiphy::max_num_csa_counters' offset changed from 10384 to 10448 (in bits) (by +64 bits)
    'u8 wiphy::max_adj_channel_rssi_comp' offset changed from 10392 to 10456 (in bits) (by +64 bits)
    'u32 wiphy::bss_select_support' offset changed from 10400 to 10464 (in bits) (by +64 bits)
    'u8 wiphy::nan_supported_bands' offset changed from 10432 to 10496 (in bits) (by +64 bits)
    'u32 wiphy::txq_limit' offset changed from 10464 to 10528 (in bits) (by +64 bits)
    'u32 wiphy::txq_memory_limit' offset changed from 10496 to 10560 (in bits) (by +64 bits)
    'u32 wiphy::txq_quantum' offset changed from 10528 to 10592 (in bits) (by +64 bits)
    'const cfg80211_pmsr_capabilities* wiphy::pmsr_capa' offset changed from 10624 to 10688 (in bits) (by +64 bits)
    'char wiphy::priv[]' offset changed from 10752 to 11008 (in bits) (by +256 bits)
  55 impacted interfaces

Bug: 154782456
Cc: Vamsi Krishna <vamsin@codeaurora.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: Iedf3fbe613b23059d976c3f8048818c6a89bc141
2020-06-30 14:42:18 +02:00
Veerendranath Jakkam
e1f28e7d04 BACKPORT: cfg80211: Configure PMK lifetime and reauth threshold for PMKSA entries
Drivers that trigger roaming need to know the lifetime of the configured
PMKSA for deciding whether to trigger the full or PMKSA cache based
authentication. The configured PMKSA is invalid after the PMK lifetime
has expired and must not be used after that and the STA needs to
disassociate if the PMK expires. Hence the STA is expected to refresh
the PMK with a full authentication before this happens (e.g., when
reassociating to a new BSS the next time or by performing EAPOL
reauthentication depending on the AKM) to avoid unnecessary
disconnection.

The PMK reauthentication threshold is the percentage of the PMK lifetime
value and indicates to the driver to trigger a full authentication roam
(without PMKSA caching) after the reauthentication threshold time, but
before the PMK timer has expired. Authentication methods like SAE need
to be able to generate a new PMKSA entry without having to force a
disconnection after this threshold timeout. If no roaming occurs between
the reauthentication threshold time and PMK lifetime expiration,
disassociation is still forced.

The new attributes for providing these values correspond to the dot11
MIB variables dot11RSNAConfigPMKLifetime and
dot11RSNAConfigPMKReauthThreshold.

This type of functionality is already available in cases where user
space component is in control of roaming. This commit extends that same
capability into cases where parts or all of this functionality is
offloaded to the driver.

Bug: 154782456
Signed-off-by: Veerendranath Jakkam <vjakkam@codeaurora.org>
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
Link: https://lore.kernel.org/r/20200312235903.18462-1-jouni@codeaurora.org
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Change-Id: I899c14543653d3620e63dbf40f1dfde7b1b48512
(cherry picked from commit 7fc82af856d6bc26910902f8f42659b162864955)
Signed-off-by: Vamsi Krishna <vamsin@codeaurora.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2020-06-30 14:28:41 +02:00
Markus Theil
2d0e01ce46 BACKPORT: nl80211: add no pre-auth attribute and ext. feature flag for ctrl. port
If the nl80211 control port is used before this patch, pre-auth frames
(0x88c7) are send to userspace uncoditionally. While this enables userspace
to only use nl80211 on the station side, it is not always useful for APs.
Furthermore, pre-auth frames are ordinary data frames and not related to
the control port. Therefore it should for example be possible for pre-auth
frames to be bridged onto a wired network on AP side without touching
userspace.

For backwards compatibility to code already using pre-auth over nl80211,
this patch adds a feature flag to disable this behavior, while it remains
enabled by default. An additional ext. feature flag is added to detect this
from userspace.

Thanks to Jouni for pointing out, that pre-auth frames should be handled as
ordinary data frames.

Bug: 154782456
Signed-off-by: Markus Theil <markus.theil@tu-ilmenau.de>
Link: https://lore.kernel.org/r/20200312091055.54257-2-markus.theil@tu-ilmenau.de
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Change-Id: Ibb7e0a635d124881f9af9fafe5e5853a0c0a18a4
(cherry picked from commit 5631d96aa396d75b99bf522750a5a8378337aefc)
Signed-off-by: Vamsi Krishna <vamsin@codeaurora.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2020-06-30 14:28:41 +02:00
Johannes Berg
dc58762f12 BACKPORT: nl80211: modify TID-config API
Make some changes to the TID-config API:
 * use u16 in nl80211 (only, and restrict to using 8 bits for now),
   to avoid issues in the future if we ever want to use higher TIDs.
 * reject empty TIDs mask (via netlink policy)
 * change feature advertising to not use extended feature flags but
   have own mechanism for this, which simplifies the code
 * fix all variable names from 'tid' to 'tids' since it's a mask
 * change to cfg80211_ name prefixes, not ieee80211_
 * fix some minor docs/spelling things.

Bug: 154782456
Change-Id: Ia234d464b3f914cdeab82f540e018855be580dce
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
(cherry picked from commit 3710a8a6284f58a78ba4fe9c4b6672207636a223)
Signed-off-by: Vamsi Krishna <vamsin@codeaurora.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2020-06-30 14:28:41 +02:00
Tamizh chelvam
7a59f8cab6 BACKPORT: nl80211: Add NL command to support TID speicific configurations
Add the new NL80211_CMD_SET_TID_CONFIG command to support
data TID specific configuration. Per TID configuration is
passed in the nested NL80211_ATTR_TID_CONFIG attribute.

This patch adds support to configure per TID noack policy
through the NL80211_TID_CONFIG_ATTR_NOACK attribute.

Bug: 154782456
Signed-off-by: Tamizh chelvam <tamizhr@codeaurora.org>
Link: https://lore.kernel.org/r/1579506687-18296-2-git-send-email-tamizhr@codeaurora.org
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Change-Id: Ia2e2c125aaba64571453838baac052014e386cd6
(cherry picked from commit 77f576deaa393b54a0f2ca8ab1ab5b2d3c6b971b)
Signed-off-by: Vamsi Krishna <vamsin@codeaurora.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2020-06-30 14:28:41 +02:00
Jouni Malinen
02d9f7e316 BACKPORT: cfg80211: Support key configuration for Beacon protection (BIGTK)
IEEE P802.11-REVmd/D3.0 adds support for protecting Beacon frames using
a new set of keys (BIGTK; key index 6..7) similarly to the way
group-addressed Robust Management frames are protected (IGTK; key index
4..5). Extend cfg80211 and nl80211 to allow the new BIGTK to be
configured. Add an extended feature flag to indicate driver support for
the new key index values to avoid array overflows in driver
implementations and also to indicate to user space when this
functionality is available.

Bug: 154782456
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
Link: https://lore.kernel.org/r/20200222132548.20835-2-jouni@codeaurora.org
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Change-Id: I108164b597c46d0f94fc44cbb030cb8c5cd21773
(cherry picked from commit 56be393fa8b40db2d4f54f97614f645eb8d3c32e)
Signed-off-by: Vamsi Krishna <vamsin@codeaurora.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2020-06-30 14:28:41 +02:00
Jouni Malinen
c971963639 BACKPORT: cfg80211: More error messages for key addition failures
These were helpful while working with extensions to NL80211_CMD_NEW_KEY,
so add more explicit error reporting for additional cases that can fail
while that command is being processed.

Bug: 154782456
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
Link: https://lore.kernel.org/r/20200222132548.20835-1-jouni@codeaurora.org
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Change-Id: Ia23707c4e47a3bf8469046ac61cc3e59c20f5da9
(cherry picked from commit f8af764bf1cb86bed615baae84e3bbb6e4d3912d)
Signed-off-by: Vamsi Krishna <vamsin@codeaurora.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2020-06-30 14:28:41 +02:00
Veerendranath Jakkam
67a67ac328 BACKPORT: cfg80211: Enhance the AKM advertizement to support per interface.
Commit ab4dfa2053 ("cfg80211: Allow drivers to advertise supported AKM
suites") introduces the support to advertize supported AKMs to userspace.

This needs an enhancement to advertize the AKM support per interface type,
specifically for the cfg80211-based drivers that implement SME and use
different mechanisms to support the AKM's for each interface type (e.g.,
the support for SAE, OWE AKM's take different paths for such drivers on
STA/AP mode).

This commit aims the same and enhances the earlier mechanism of advertizing
the AKMs per wiphy. Add new nl80211 attributes and data structure to
provide supported AKMs per interface type to userspace.

the AKMs advertized in akm_suites are default capabilities if not
advertized for a specific interface type in iftype_akm_suites.

Bug: 154782456
Signed-off-by: Veerendranath Jakkam <vjakkam@codeaurora.org>
Link: https://lore.kernel.org/r/20200126203032.21934-1-vjakkam@codeaurora.org
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Change-Id: I928d355e6cfd85609261e0efbf2e9272da65ba2c
(cherry picked from commit d6039a3416f7af37c04f22c411f120ad46f51663)
Signed-off-by: Vamsi Krishna <vamsin@codeaurora.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2020-06-30 14:28:41 +02:00
John Crispin
92a63a3d99 BACKPORT: nl80211: add handling for BSS color
This patch adds the attributes, policy and parsing code to allow userland
to send the info about the BSS coloring settings to the kernel.

Bug: 154782456
Signed-off-by: John Crispin <john@phrozen.org>
Link: https://lore.kernel.org/r/20191217141921.8114-1-john@phrozen.org
[johannes: remove the strict policy parsing, that was a misunderstanding]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Change-Id: Ib24133d6825ef455819f697de6d9d67c856c315e
(cherry picked from commit 5c5e52d1bb962510fecdc1ebecdde89694d1b223)
Signed-off-by: Vamsi Krishna <vamsin@codeaurora.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2020-06-30 14:28:41 +02:00
Gurumoorthi Gnanasambandhan
50635d9eba BACKPORT: cfg80211: VLAN offload support for set_key and set_sta_vlan
This provides an alternative mechanism for AP VLAN support where a
single netdev is used with VLAN tagged frames instead of separate
netdevs for each VLAN without tagged frames from the WLAN driver.

By setting NL80211_EXT_FEATURE_VLAN_OFFLOAD flag the driver indicates
support for a single netdev with VLAN tagged frames. Separate
VLAN-specific netdevs can be added using RTM_NEWLINK/IFLA_VLAN_ID
similarly to Ethernet. NL80211_CMD_NEW_KEY (for group keys),
NL80211_CMD_NEW_STATION, and NL80211_CMD_SET_STATION will optionally
specify vlan_id using NL80211_ATTR_VLAN_ID.

Bug: 154782456
Signed-off-by: Gurumoorthi Gnanasambandhan <gguru@codeaurora.org>
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
Link: https://lore.kernel.org/r/20191031214640.5012-1-jouni@codeaurora.org
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Change-Id: I74c0d2664b1dbe5846a62a433754693a2ead9f2a
(cherry picked from commit 14f34e36b36ceede9877ca422a62fcac17b52023)
Signed-off-by: Vamsi Krishna <vamsin@codeaurora.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2020-06-30 14:28:41 +02:00
Gopala Krishna Nuthaki
fc1c120db7 drivers: thermal: Avoid multiple TSENS controller re-init simultaneously
If TSENS controller went to bad state while reading temperature of
a sensor, TSENS invokes controller re-init code for all controller
and then notifies the thermal framework to re-evaluate thermal for
each sensor. There is a possibility that while executing TSENS
re-init code, another sensor temperature read request can be
initiated and it could lead to another TSENS controller re-init
code execution.
Use an atomic variable to check above mentioned path and avoid
multiple TSENS re-init at same time.

Change-Id: Ied3c40356730fdf373be36b08f4af20b791afe8c
Signed-off-by: Gopala Krishna Nuthaki <gnuthaki@codeaurora.org>
2020-06-30 16:00:49 +05:30
Vipin Deep Kaur
c5d86f08db spi: spi-msm-geni: Propagate missing change from 4.19 to 5.4
Propagate following change from 4.19 to 5.4 for SPI driver.
'commit 67192635d468 ("spi: spi-geni-qcom: Check for zero length
transfer")'.

Change-Id: I27bdd8b544ba1bdaa0a868d2260c4f76c156c215
Signed-off-by: Vipin Deep Kaur <vkaur@codeaurora.org>
2020-06-30 14:46:44 +05:30
Vipin Deep Kaur
e71111a9fa spi: spi-msm-geni: Propagate missing change from 4.19 to 5.4
Propagate following change from 4.19 to 5.4 for SPI driver.
'commit 634968af3a1f ("spi: spi-geni-qcom: Allow flexible MISO
sampling rate for SPI HLOS")'.

Change-Id: I5061cec80875e5fad4d25b04977b8ce1281818fd
Signed-off-by: Vipin Deep Kaur <vkaur@codeaurora.org>
2020-06-30 14:32:42 +05:30
Vipin Deep Kaur
67ec5c3b8f spi: spi-msm-geni: Propagate missing change from 4.19 to 5.4
Propagate following change from 4.19 to 5.4 for SPI driver.
'commit 64485a92b029 ("spi: spi-geni-qcom: Check for Rx DMA channel
being null")'.

Change-Id: I0dc30e38d0cbbab21d26eeab17b40b14017d48ff
Signed-off-by: Vipin Deep Kaur <vkaur@codeaurora.org>
2020-06-30 14:25:17 +05:30
Meng Wang
b31980dee5 ASoC: pcm: add null check for be_substream
be_substream returns from snd_soc_dpcm_get_substream could be
NULL and add NULL check for be_substream.

Change-Id: I187bd6f22317cdbd6c6def3ee5b0afd3190fa810
Signed-off-by: Meng Wang <mengw@codeaurora.org>
2020-06-30 16:52:24 +08:00
Vipin Deep Kaur
ce64610d0e spi: spi-msm-geni: Propagate missing change from 4.19 to 5.4
Propagate following change from 4.19 to 5.4 for SPI driver.
'commit 185ecd35b11f ("spi: spi-geni-qcom: Reset the dma engine on
failure")'.

Change-Id: I3839d5bc773e7d7ea71ba6ff611f55f4869000f3
Signed-off-by: Vipin Deep Kaur <vkaur@codeaurora.org>
2020-06-30 14:20:12 +05:30
prernak
3f19888c6c defconfig: msm: Enable CONFIG_QTI_TZ_LOG on perf builds
Enable CONFIG_QTI_TZ_LOG as tz logs are required on perf builds.

Change-Id: I41db5d53a8eadc794edb0ba8c0abebafbb8f4594
Signed-off-by: prernak <prernak@codeaurora.org>
2020-06-30 13:46:21 +05:30
Arthur Shuai
86bf6f981f arm64: defconfig: configuration for UTS namespace
Add and enable UTS namespace.

Change-Id: I07fd4034d9371d3b47e93f73f2e94334bd31afdd
Signed-off-by: Arthur Shuai <shuaiq@codeaurora.org>
2020-06-30 00:39:05 -07:00
Vipin Deep Kaur
182605a377 spi: spi-msm-geni: Propagate missing change from 4.19 to 5.4
Propagate following change from 4.19 to 5.4 for SPI driver.
'commit f5bcbeb4a2a1 ("spi-geni-qcom: Add shared_ee dtsi property
for spi driver")'.

Change-Id: Ic64d6a6e358ba5fd1898eaacfb72586cdab9184a
Signed-off-by: Vipin Deep Kaur <vkaur@codeaurora.org>
2020-06-30 11:31:00 +05:30
Vipin Deep Kaur
196ed030ad spi: spi-msm-geni: Propagate missing change from 4.19 to 5.4
Propagate following change from 4.19 to 5.4 for SPI driver.
'commit 22cec88da571 ("i2c: i2c-qcom-geni: Add lock and unlock
tre support in I2C GSI mode")'.

Change-Id: I1b92829cd04b379e48c34b09b5ab5ef4440ac0a8
Signed-off-by: Vipin Deep Kaur <vkaur@codeaurora.org>
2020-06-30 10:56:16 +05:30
Haseeb Khan
6086680640 msm: cvp: Re-initialize the HFI queue headers after CDSP-SSR
The change is to fix hang issue after CDSP-SSR.

Change-Id: I7608b32b5c308c08902b19b1b2343a0fae6888ab
Signed-off-by: Haseeb Khan <hkhan@codeaurora.org>
2020-06-30 01:33:17 +05:30
Todd Kjos
6dfe047050 FROMGIT: binder: fix null deref of proc->context
The binder driver makes the assumption proc->context pointer is invariant after
initialization (as documented in the kerneldoc header for struct proc).
However, in commit f0fe2c0f050d ("binder: prevent UAF for binderfs devices II")
proc->context is set to NULL during binder_deferred_release().

Another proc was in the middle of setting up a transaction to the dying
process and crashed on a NULL pointer deref on "context" which is a local
set to &proc->context:

    new_ref->data.desc = (node == context->binder_context_mgr_node) ? 0 : 1;

Here's the stack:

[ 5237.855435] Call trace:
[ 5237.855441] binder_get_ref_for_node_olocked+0x100/0x2ec
[ 5237.855446] binder_inc_ref_for_node+0x140/0x280
[ 5237.855451] binder_translate_binder+0x1d0/0x388
[ 5237.855456] binder_transaction+0x2228/0x3730
[ 5237.855461] binder_thread_write+0x640/0x25bc
[ 5237.855466] binder_ioctl_write_read+0xb0/0x464
[ 5237.855471] binder_ioctl+0x30c/0x96c
[ 5237.855477] do_vfs_ioctl+0x3e0/0x700
[ 5237.855482] __arm64_sys_ioctl+0x78/0xa4
[ 5237.855488] el0_svc_common+0xb4/0x194
[ 5237.855493] el0_svc_handler+0x74/0x98
[ 5237.855497] el0_svc+0x8/0xc

The fix is to move the kfree of the binder_device to binder_free_proc()
so the binder_device is freed when we know there are no references
remaining on the binder_proc.

Fixes: f0fe2c0f050d ("binder: prevent UAF for binderfs devices II")
Signed-off-by: Todd Kjos <tkjos@google.com>
(cherry picked from commit d35d3660e065b69fdb8bf512f3d899f350afce52
     git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc.git char-misc-linus)
Bug: 158252621
Git-commit: bf0e4f96e4
Git-repo: https://android.googlesource.com/kernel/common/+/refs/heads/android-5.4-stable
Change-Id: Icb74dba032540a67854deb00e1e78e32326717b6
Signed-off-by: Raghavendra Rao Ananta <rananta@codeaurora.org>
2020-06-29 11:52:28 -07:00
Eric Biggers
9d21bcd489 Revert "ANDROID: fscrypt: add key removal notifier chain"
This reverts commit 98261f39e9
because it was only needed for sdcardfs, which has now been removed.

Bug: 157700134
Bug: 142275883
Change-Id: Iaf22521ef47d48ce9c9c0604a8b2412e3b8c1faa
Signed-off-by: Eric Biggers <ebiggers@google.com>
2020-06-29 18:26:35 +00:00
Ram Chandrasekar
6540ba7ec9 drivers: thermal: bcl: Update the threshold conversion
Ibat and vbat threshold registers were bit shifted in earlier BCL
peripheral and starting PMIC7, the bit shift is not there. So remove
the ADC to ibat/vbat and vice versa conversion to accommodate this.

Change-Id: I45c3b389925c9f6853d14cd8d7aaee3de5310bdf
Signed-off-by: Ram Chandrasekar <rkumbako@codeaurora.org>
2020-06-29 11:14:07 -07:00
Guru Das Srinagesh
c3111b531b soc: qcom: altmode-glink: Execute client callback in work
Execute the client's callback in a separate thread to avoid the
following deadlock situation:

- altmode_callback() calls the client's callback when a valid amclient
  is found and program execution waits for it to finish.
- The client's callback calls altmode_send_data() to send the PAN_ACK.
- altmode_send_data() eventually calls altmode_write(), which is waiting
  for the response_received to be "completed" in altmode_callback().
- For response_received to be "completed", altmode_callback() must
  finish executing in order to process the USBC_CMD_WRITE_REQ message
  received from the remote subsystem.
- altmode_callback() cannot finish executing until altmode_send_data()
  returns.
- altmode_send_data() times out and passes on the error to the client.

Also perform the following:
- Add a check to ensure that the payload received from the remote
  subsystem is at least 9 bytes long.
- Prevent out of bounds access for USBC_CMD_WRITE_REQ message (which is
  of a different format than struct usbc_notify_ind_msg) by moving the
  port_index reading to only the USBC_NOTIFY_IND message in
  altmode_callback().

CRs-Fixed: 2713590
Fixes: 6c0ffc67e5 ("soc: altmode: Detect when remote subsys fails to respond")
Change-Id: I0f2c6ce0f843c43c9e7e301be9ff3ad913310f62
Signed-off-by: Guru Das Srinagesh <gurus@codeaurora.org>
2020-06-29 11:11:55 -07:00
Ram Chandrasekar
e0214e2c7f drivers: thermal: pe_sensor: Add code to clear victim irq status
When master interrupt is triggered, the victim interrupt status register
will also be set indicating the victim that got mitigated. APSS has to
clear this register as well to clear the master interrupt.

Add support to clear this victim interrupt status register when a master
interrupt is triggered.

Change-Id: I66d1ed64f0e0c440cf52a1252486164b65834a81
Signed-off-by: Ram Chandrasekar <rkumbako@codeaurora.org>
2020-06-29 11:11:40 -07:00
Stanley Chu
ee48a99fff UPSTREAM: scsi: ufs: Fix imprecise load calculation in devfreq window
The UFS load calculation is based on "total_time" and "busy_time" in a
devfreq window.  However, the source of time is different for both
parameters: "busy_time" is assigned from "jiffies" thus has different
accuracy from "total_time" which is assigned from ktime_get().

In addition, the time of window boundary is not exactly the same as the
starting busy time in this window if UFS is actually busy in the beginning
of the window. A similar accuracy error may also happen for the end of busy
time in current window.

To guarantee the precision of load calculation, we need to

1. Align time accuracy of both devfreq_dev_status.total_time and
   devfreq_dev_status.busy_time. For example, use "ktime_get()" directly.

2. Align the following timelines:
   - The beginning time of devfreq windows
   - The beginning of busy time in a new window
   - The end of busy time in the current window

Link: https://lore.kernel.org/r/20200611101043.6379-1-stanley.chu@mediatek.com
Fixes: a3cd5ec55f ("scsi: ufs: add load based scaling of UFS gear")
Reviewed-by: Avri Altman <avri.altman@wdc.com>
Signed-off-by: Stanley Chu <stanley.chu@mediatek.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

Bug: 151050916
(cherry picked from commit b1bf66d1d5a8fcb54f0e584db5d196ef015b5172)
Change-Id: I9610fade4f426973b1c95a3621d0bd2b51543846
Signed-off-by: Stanley Chu <stanley.chu@mediatek.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2020-06-29 16:12:30 +02:00
Stanley Chu
03911e93a0 UPSTREAM: scsi: ufs: Add trace event for UIC commands
Use the ftrace infrastructure to conditionally trace UFS UIC command
events.

New trace event "ufshcd_uic_command" is created, which samples the
following UFS UIC command data:

 - Device name
 - Optional identification string
 - UIC command opcode
 - UIC command argument1
 - UIC command argument2
 - UIC command argement3

Usage:
	echo 1 > /sys/kernel/debug/tracing/events/ufs/enable
	cat /sys/kernel/debug/tracing/trace_pipe

Link: https://lore.kernel.org/r/20200615072235.23042-3-stanley.chu@mediatek.com
Acked-by: Avri Altman <avri.altman@wdc.com>
Signed-off-by: Stanley Chu <stanley.chu@mediatek.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

Bug: 151050916
(cherry picked from commit aa5c697988b4c7e1077de1e2eb2298114d531736)
Change-Id: I23652110c51d7cd04f9e9c565f67654325e11e9d
Signed-off-by: Stanley Chu <stanley.chu@mediatek.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2020-06-29 16:12:30 +02:00
Stanley Chu
95821c4676 UPSTREAM: scsi: ufs: Add DELAY_BEFORE_LPM quirk for Micron devices
It is confirmed that Micron device needs DELAY_BEFORE_LPM quirk to have a
delay before VCC is powered off. Sdd Micron vendor ID and this quirk for
Micron devices.

Link: https://lore.kernel.org/r/20200612012625.6615-2-stanley.chu@mediatek.com
Reviewed-by: Bean Huo <beanhuo@micron.com>
Reviewed-by: Alim Akhtar <alim.akhtar@samsung.com>
Signed-off-by: Stanley Chu <stanley.chu@mediatek.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

Bug: 151050916
(cherry picked from commit c0a18ee0ce78d7957ec1a53be35b1b3beba80668)
Change-Id: Ib69fd30291227daba77f6955955fc047b0ec27b8
Signed-off-by: Stanley Chu <stanley.chu@mediatek.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2020-06-29 16:12:30 +02:00
Stanley Chu
ec9cb276d9 UPSTREAM: scsi: ufs-mediatek: Allow unbound mphy
Allow unbound MPHY module since not every MediaTek UFS platform needs
specific MPHY control.

Link: https://lore.kernel.org/r/20200601104646.15436-6-stanley.chu@mediatek.com
Reviewed-by: Peter Wang <peter.wang@mediatek.com>
Signed-off-by: Stanley Chu <stanley.chu@mediatek.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

Bug: 151050916
(cherry picked from commit fc4983018fea1237e027a9fc6530a3e04850fbfa)
Change-Id: Ie79d90079976129e37ac99c6b7e2d9b172ebdc73
Signed-off-by: Stanley Chu <stanley.chu@mediatek.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2020-06-29 16:12:30 +02:00
Stanley Chu
332ca84ae3 UPSTREAM: scsi: ufs-mediatek: Fix unbalanced clock on/off
MediaTek UFS clocks are separated to two parts and controlled by different
modules: ufs-mediatek and phy-ufs-mediatek.

If both Auto-Hibern8 and clk-gating feature are enabled, mphy power control
is not balanced thus unbalanced control also happens to the clocks probed
by phy-ufs-mediatek module.

Fix this issue by:

 - Promise usage of phy_power_on/off balanced

 - Remove phy_power_on/off control in suspend/resume vops since both can be
   handled in setup_clock vops only

Link: https://lore.kernel.org/r/20200601104646.15436-5-stanley.chu@mediatek.com
Reviewed-by: Peter Wang <peter.wang@mediatek.com>
Signed-off-by: Stanley Chu <stanley.chu@mediatek.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

Bug: 151050916
(cherry picked from commit 561e3a8726b2dd94ce75cad6c9cab211551f368a)
Change-Id: I9d304e895a07c5e672a6b29e9c8d23edaeaf8a08
Signed-off-by: Stanley Chu <stanley.chu@mediatek.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2020-06-29 16:12:30 +02:00
Stanley Chu
e957d1ef81 UPSTREAM: scsi: ufs-mediatek: Introduce low-power mode for device power supply
Allow device power supply to enter low-power mode.

Link: https://lore.kernel.org/r/20200601104646.15436-4-stanley.chu@mediatek.com
Reviewed-by: Pengshun Zhao <pengshun.zhao@mediatek.com>
Signed-off-by: Stanley Chu <stanley.chu@mediatek.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

Bug: 151050916
(cherry picked from commit 488edafb1120f715bebd80b6fe4089f83fb082b2)
Change-Id: Ibe3cd1f11305656f7c597940b75e0c6d71c4a802
Signed-off-by: Stanley Chu <stanley.chu@mediatek.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2020-06-29 16:12:30 +02:00