Commit graph

887,304 commits

Author SHA1 Message Date
Greg Kroah-Hartman
a513cda5e1 This is the 5.4.100 stable release
-----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEEZH8oZUiU471FcZm+ONu9yGCSaT4FAmA1C0IACgkQONu9yGCS
 aT4RYxAAyfmYnpeUM96GDx86zamHX7Zq52YAYP1Noyv2WK6ii7emP//WcNtMMMUX
 73k5BIybvtUgHZi8EG0fb25k3duPQ8JJaA98Z8bKq1vogyCpHgcn9eQIZhe9g25K
 UYn64LPgv38mjnCr/mODNWfa7rLPwWZEqMFcTf/Gz8TOiNtDMgRA5DhXyljbyZVB
 z/OIjJBOb0oQRemM+HHHpgschh6JJV3VfyZWSise9mTYkTkPENRUFwYE2g567TD+
 Sn9jAsIWS+4y52IWC4BLFGeDkfOuVwzXwR9uJdHa5xdOuvHrM2s8bknn8gcfKo8u
 Fh8KC/n+ZPiNi0IoRMwL5PZJV+wHHHiBby/o8fPlL9c9B7qglXGWoLMi+YvnCU9q
 4tI5Aor8D3ASyqKemCSTogITw12Z36NQEAoTUjmK0zX+gNXUFW9FNf0ATY6axaE5
 PTi4bE6RmvJYNZobAmzgm3jDKCHB8Y82jxdTmoGGnghx9jACLfxw7s+0+TqrG8HA
 gfGMTblc41Do/8RCwVWMaepBDXTFt78yLpB0RzdOk9rxl+lk9eKLWGmlfbWCbRbT
 wTcs9kgRA6c1zV/G6o1KCSsf0IcpX3IKYae9+k615XARtYSV7ZAJ4hLJCJI3QOHy
 XqNtPSeAjjCuSzqUnjojlUry4vRmLjgpN3/YSUfx9oLviDfTZlM=
 =rp48
 -----END PGP SIGNATURE-----

Merge 5.4.100 into android11-5.4-lts

Changes in 5.4.100
	KVM: SEV: fix double locking due to incorrect backport
	net: qrtr: Fix port ID for control messages
	net: bridge: Fix a warning when del bridge sysfs
	Xen/x86: don't bail early from clear_foreign_p2m_mapping()
	Xen/x86: also check kernel mapping in set_foreign_p2m_mapping()
	Xen/gntdev: correct dev_bus_addr handling in gntdev_map_grant_pages()
	Xen/gntdev: correct error checking in gntdev_map_grant_pages()
	xen/arm: don't ignore return errors from set_phys_to_machine
	xen-blkback: don't "handle" error by BUG()
	xen-netback: don't "handle" error by BUG()
	xen-scsiback: don't "handle" error by BUG()
	xen-blkback: fix error handling in xen_blkbk_map()
	media: pwc: Use correct device for DMA
	btrfs: fix backport of 2175bf57dc952 in 5.4.95
	Linux 5.4.100

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I9189f8a6e2d7515697c9e13fbde836f5b8acbe5b
2021-02-23 15:45:57 +01:00
Greg Kroah-Hartman
fc944ddc0b Linux 5.4.100
Tested-by: Florian Fainelli <f.fainelli@gmail.com>
Tested-by: Guenter Roeck <linux@roeck-us.net>
Tested-by: Igor Matheus Andrade Torrente <igormtorrente@gmail.com>
Tested-by: Jason Self <jason@bluehome.net>
Tested-by: Linux Kernel Functional Testing <lkft@linaro.org>
Link: https://lore.kernel.org/r/20210222121013.583922436@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-02-23 15:02:26 +01:00
David Sterba
38d777aaf2 btrfs: fix backport of 2175bf57dc952 in 5.4.95
There's a mistake in backport of upstream commit 2175bf57dc95 ("btrfs:
fix possible free space tree corruption with online conversion") as
5.4.95 commit e1ae9aab80.

The enum value BTRFS_FS_FREE_SPACE_TREE_UNTRUSTED has been added to the
wrong enum set, colliding with value of BTRFS_FS_QUOTA_ENABLE. This
could cause problems during the tree conversion, where the quotas
wouldn't be set up properly but the related code executed anyway due to
the bit set.

Link: https://lore.kernel.org/linux-btrfs/20210219111741.95DD.409509F4@e16-tech.com
Reported-by: Wang Yugui <wangyugui@e16-tech.com>
CC: stable@vger.kernel.org # 5.4.95+
Signed-off-by: David Sterba <dsterba@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-02-23 15:02:26 +01:00
Matwey V. Kornilov
c6dd8545fe media: pwc: Use correct device for DMA
commit 69c9e825e812ec6d663e64ebf14bd3bc7f37e2c7 upstream.

This fixes the following newly introduced warning:

[   15.518253] ------------[ cut here ]------------
[   15.518941] WARNING: CPU: 0 PID: 246 at kernel/dma/mapping.c:149 dma_map_page_attrs+0x1a8/0x1d0
[   15.520634] Modules linked in: pwc videobuf2_vmalloc videobuf2_memops videobuf2_v4l2 videobuf2_common videodev mc efivarfs
[   15.522335] CPU: 0 PID: 246 Comm: v4l2-test Not tainted 5.11.0-rc1+ #1
[   15.523281] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 0.0.0 02/06/2015
[   15.524438] RIP: 0010:dma_map_page_attrs+0x1a8/0x1d0
[   15.525135] Code: 10 5b 5d 41 5c 41 5d c3 4d 89 d0 eb d7 4d 89 c8 89 e9 48 89 da e8 68 29 00 00 eb d1 48 89 f2 48 2b 50 18 48 89 d0 eb 83 0f 0b <0f> 0b 48 c7 c0 ff ff ff ff eb b8 48 89 d9 48 8b 40 40 e8 61 69 d2
[   15.527938] RSP: 0018:ffffa2694047bca8 EFLAGS: 00010246
[   15.528716] RAX: 0000000000000000 RBX: 0000000000002580 RCX: 0000000000000000
[   15.529782] RDX: 0000000000000000 RSI: ffffcdce000ecc00 RDI: ffffa0b4bdb888a0
[   15.530849] RBP: 0000000000000002 R08: 0000000000000002 R09: 0000000000000000
[   15.531881] R10: 0000000000000004 R11: 000000000002d8c0 R12: 0000000000000000
[   15.532911] R13: ffffa0b4bdb88800 R14: ffffa0b483820000 R15: ffffa0b4bdb888a0
[   15.533942] FS:  00007fc5fbb5e4c0(0000) GS:ffffa0b4fc000000(0000) knlGS:0000000000000000
[   15.535141] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[   15.535988] CR2: 00007fc5fb6ea138 CR3: 0000000003812000 CR4: 00000000001506f0
[   15.537025] Call Trace:
[   15.537425]  start_streaming+0x2e9/0x4b0 [pwc]
[   15.538143]  vb2_start_streaming+0x5e/0x110 [videobuf2_common]
[   15.538989]  vb2_core_streamon+0x107/0x140 [videobuf2_common]
[   15.539831]  __video_do_ioctl+0x18f/0x4a0 [videodev]
[   15.540670]  video_usercopy+0x13a/0x5b0 [videodev]
[   15.541349]  ? video_put_user+0x230/0x230 [videodev]
[   15.542096]  ? selinux_file_ioctl+0x143/0x200
[   15.542752]  v4l2_ioctl+0x40/0x50 [videodev]
[   15.543360]  __x64_sys_ioctl+0x89/0xc0
[   15.543930]  do_syscall_64+0x33/0x40
[   15.544448]  entry_SYSCALL_64_after_hwframe+0x44/0xa9
[   15.545236] RIP: 0033:0x7fc5fb671587
[   15.545780] Code: b3 66 90 48 8b 05 11 49 2c 00 64 c7 00 26 00 00 00 48 c7 c0 ff ff ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 b8 10 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d e1 48 2c 00 f7 d8 64 89 01 48
[   15.548486] RSP: 002b:00007fff0f71f038 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
[   15.549578] RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 00007fc5fb671587
[   15.550664] RDX: 00007fff0f71f060 RSI: 0000000040045612 RDI: 0000000000000003
[   15.551706] RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000
[   15.552738] R10: 0000000000000000 R11: 0000000000000246 R12: 00007fff0f71f060
[   15.553817] R13: 00007fff0f71f1d0 R14: 0000000000de1270 R15: 0000000000000000
[   15.554914] ---[ end trace 7be03122966c2486 ]---

Fixes: 1161db6776 ("media: usb: pwc: Don't use coherent DMA buffers for ISO transfer")
Signed-off-by: Matwey V. Kornilov <matwey@sai.msu.ru>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-02-23 15:02:26 +01:00
Jan Beulich
524a77aa5d xen-blkback: fix error handling in xen_blkbk_map()
commit 871997bc9e423f05c7da7c9178e62dde5df2a7f8 upstream.

The function uses a goto-based loop, which may lead to an earlier error
getting discarded by a later iteration. Exit this ad-hoc loop when an
error was encountered.

The out-of-memory error path additionally fails to fill a structure
field looked at by xen_blkbk_unmap_prepare() before inspecting the
handle which does get properly set (to BLKBACK_INVALID_HANDLE).

Since the earlier exiting from the ad-hoc loop requires the same field
filling (invalidation) as that on the out-of-memory path, fold both
paths. While doing so, drop the pr_alert(), as extra log messages aren't
going to help the situation (the kernel will log oom conditions already
anyway).

This is XSA-365.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Julien Grall <julien@xen.org>
Signed-off-by: Juergen Gross <jgross@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-02-23 15:02:26 +01:00
Jan Beulich
be05138a9c xen-scsiback: don't "handle" error by BUG()
commit 7c77474b2d22176d2bfb592ec74e0f2cb71352c9 upstream.

In particular -ENOMEM may come back here, from set_foreign_p2m_mapping().
Don't make problems worse, the more that handling elsewhere (together
with map's status fields now indicating whether a mapping wasn't even
attempted, and hence has to be considered failed) doesn't require this
odd way of dealing with errors.

This is part of XSA-362.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Cc: stable@vger.kernel.org
Reviewed-by: Juergen Gross <jgross@suse.com>
Signed-off-by: Juergen Gross <jgross@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-02-23 15:02:26 +01:00
Jan Beulich
52e8f43af5 xen-netback: don't "handle" error by BUG()
commit 3194a1746e8aabe86075fd3c5e7cf1f4632d7f16 upstream.

In particular -ENOMEM may come back here, from set_foreign_p2m_mapping().
Don't make problems worse, the more that handling elsewhere (together
with map's status fields now indicating whether a mapping wasn't even
attempted, and hence has to be considered failed) doesn't require this
odd way of dealing with errors.

This is part of XSA-362.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Cc: stable@vger.kernel.org
Reviewed-by: Juergen Gross <jgross@suse.com>
Signed-off-by: Juergen Gross <jgross@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-02-23 15:02:26 +01:00
Jan Beulich
7109f61d25 xen-blkback: don't "handle" error by BUG()
commit 5a264285ed1cd32e26d9de4f3c8c6855e467fd63 upstream.

In particular -ENOMEM may come back here, from set_foreign_p2m_mapping().
Don't make problems worse, the more that handling elsewhere (together
with map's status fields now indicating whether a mapping wasn't even
attempted, and hence has to be considered failed) doesn't require this
odd way of dealing with errors.

This is part of XSA-362.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Cc: stable@vger.kernel.org
Reviewed-by: Juergen Gross <jgross@suse.com>
Signed-off-by: Juergen Gross <jgross@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-02-23 15:02:26 +01:00
Stefano Stabellini
55ccf71c09 xen/arm: don't ignore return errors from set_phys_to_machine
commit 36bf1dfb8b266e089afa9b7b984217f17027bf35 upstream.

set_phys_to_machine can fail due to lack of memory, see the kzalloc call
in arch/arm/xen/p2m.c:__set_phys_to_machine_multi.

Don't ignore the potential return error in set_foreign_p2m_mapping,
returning it to the caller instead.

This is part of XSA-361.

Signed-off-by: Stefano Stabellini <stefano.stabellini@xilinx.com>
Cc: stable@vger.kernel.org
Reviewed-by: Julien Grall <jgrall@amazon.com>
Signed-off-by: Juergen Gross <jgross@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-02-23 15:02:26 +01:00
Jan Beulich
feda880969 Xen/gntdev: correct error checking in gntdev_map_grant_pages()
commit ebee0eab08594b2bd5db716288a4f1ae5936e9bc upstream.

Failure of the kernel part of the mapping operation should also be
indicated as an error to the caller, or else it may assume the
respective kernel VA is okay to access.

Furthermore gnttab_map_refs() failing still requires recording
successfully mapped handles, so they can be unmapped subsequently. This
in turn requires there to be a way to tell full hypercall failure from
partial success - preset map_op status fields such that they won't
"happen" to look as if the operation succeeded.

Also again use GNTST_okay instead of implying its value (zero).

This is part of XSA-361.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Cc: stable@vger.kernel.org
Reviewed-by: Juergen Gross <jgross@suse.com>
Signed-off-by: Juergen Gross <jgross@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-02-23 15:02:26 +01:00
Jan Beulich
0e382682dd Xen/gntdev: correct dev_bus_addr handling in gntdev_map_grant_pages()
commit dbe5283605b3bc12ca45def09cc721a0a5c853a2 upstream.

We may not skip setting the field in the unmap structure when
GNTMAP_device_map is in use - such an unmap would fail to release the
respective resources (a page ref in the hypervisor). Otoh the field
doesn't need setting at all when GNTMAP_device_map is not in use.

To record the value for unmapping, we also better don't use our local
p2m: In particular after a subsequent change it may not have got updated
for all the batch elements. Instead it can simply be taken from the
respective map's results.

We can additionally avoid playing this game altogether for the kernel
part of the mappings in (x86) PV mode.

This is part of XSA-361.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Cc: stable@vger.kernel.org
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
Signed-off-by: Juergen Gross <jgross@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-02-23 15:02:26 +01:00
Jan Beulich
da92e41f01 Xen/x86: also check kernel mapping in set_foreign_p2m_mapping()
commit b512e1b077e5ccdbd6e225b15d934ab12453b70a upstream.

We should not set up further state if either mapping failed; paying
attention to just the user mapping's status isn't enough.

Also use GNTST_okay instead of implying its value (zero).

This is part of XSA-361.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Cc: stable@vger.kernel.org
Reviewed-by: Juergen Gross <jgross@suse.com>
Signed-off-by: Juergen Gross <jgross@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-02-23 15:02:26 +01:00
Jan Beulich
104eef9523 Xen/x86: don't bail early from clear_foreign_p2m_mapping()
commit a35f2ef3b7376bfd0a57f7844bd7454389aae1fc upstream.

Its sibling (set_foreign_p2m_mapping()) as well as the sibling of its
only caller (gnttab_map_refs()) don't clean up after themselves in case
of error. Higher level callers are expected to do so. However, in order
for that to really clean up any partially set up state, the operation
should not terminate upon encountering an entry in unexpected state. It
is particularly relevant to notice here that set_foreign_p2m_mapping()
would skip setting up a p2m entry if its grant mapping failed, but it
would continue to set up further p2m entries as long as their mappings
succeeded.

Arguably down the road set_foreign_p2m_mapping() may want its page state
related WARN_ON() also converted to an error return.

This is part of XSA-361.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Cc: stable@vger.kernel.org
Reviewed-by: Juergen Gross <jgross@suse.com>
Signed-off-by: Juergen Gross <jgross@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-02-23 15:02:25 +01:00
Wang Hai
49de0a17e6 net: bridge: Fix a warning when del bridge sysfs
[ Upstream commit 989a1db06eb18ff605377eec87e18d795e0ec74b ]

I got a warining report:

br_sysfs_addbr: can't create group bridge4/bridge
------------[ cut here ]------------
sysfs group 'bridge' not found for kobject 'bridge4'
WARNING: CPU: 2 PID: 9004 at fs/sysfs/group.c:279 sysfs_remove_group fs/sysfs/group.c:279 [inline]
WARNING: CPU: 2 PID: 9004 at fs/sysfs/group.c:279 sysfs_remove_group+0x153/0x1b0 fs/sysfs/group.c:270
Modules linked in: iptable_nat
...
Call Trace:
  br_dev_delete+0x112/0x190 net/bridge/br_if.c:384
  br_dev_newlink net/bridge/br_netlink.c:1381 [inline]
  br_dev_newlink+0xdb/0x100 net/bridge/br_netlink.c:1362
  __rtnl_newlink+0xe11/0x13f0 net/core/rtnetlink.c:3441
  rtnl_newlink+0x64/0xa0 net/core/rtnetlink.c:3500
  rtnetlink_rcv_msg+0x385/0x980 net/core/rtnetlink.c:5562
  netlink_rcv_skb+0x134/0x3d0 net/netlink/af_netlink.c:2494
  netlink_unicast_kernel net/netlink/af_netlink.c:1304 [inline]
  netlink_unicast+0x4a0/0x6a0 net/netlink/af_netlink.c:1330
  netlink_sendmsg+0x793/0xc80 net/netlink/af_netlink.c:1919
  sock_sendmsg_nosec net/socket.c:651 [inline]
  sock_sendmsg+0x139/0x170 net/socket.c:671
  ____sys_sendmsg+0x658/0x7d0 net/socket.c:2353
  ___sys_sendmsg+0xf8/0x170 net/socket.c:2407
  __sys_sendmsg+0xd3/0x190 net/socket.c:2440
  do_syscall_64+0x33/0x40 arch/x86/entry/common.c:46
  entry_SYSCALL_64_after_hwframe+0x44/0xa9

In br_device_event(), if the bridge sysfs fails to be added,
br_device_event() should return error. This can prevent warining
when removing bridge sysfs that do not exist.

Fixes: bb900b27a2 ("bridge: allow creating bridge devices with netlink")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Wang Hai <wanghai38@huawei.com>
Tested-by: Nikolay Aleksandrov <nikolay@nvidia.com>
Acked-by: Nikolay Aleksandrov <nikolay@nvidia.com>
Link: https://lore.kernel.org/r/20201211122921.40386-1-wanghai38@huawei.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2021-02-23 15:02:25 +01:00
Loic Poulain
c35ce3d38c net: qrtr: Fix port ID for control messages
[ Upstream commit ae068f561baa003d260475c3e441ca454b186726 ]

The port ID for control messages was uncorrectly set with broadcast
node ID value, causing message to be dropped on remote side since
not passing packet filtering (cb->dst_port != QRTR_PORT_CTRL).

Fixes: d27e77a3de ("net: qrtr: Reset the node and port ID of broadcast messages")
Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2021-02-23 15:02:25 +01:00
Paolo Bonzini
f49731dfdb KVM: SEV: fix double locking due to incorrect backport
Fix an incorrect line in the 5.4.y and 4.19.y backports of commit
19a23da53932bc ("Fix unsynchronized access to sev members through
svm_register_enc_region"), first applied to 5.4.98 and 4.19.176.

Fixes: 1e80fdc09d ("KVM: SVM: Pin guest memory when SEV is active")
Reported-by: Dov Murik <dovmurik@linux.vnet.ibm.com>
Cc: stable@vger.kernel.org # 5.4.x
Cc: stable@vger.kernel.org # 4.19.x
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2021-02-23 15:02:25 +01:00
Greg Kroah-Hartman
16f6caf91a ANDROID: GKI: Fix up .xml file after merge with android11-5.4
Because the .xml file can not handle being "merged" we had to pick one
side or the other in commit 276d190124 ("Merge branch 'android11-5.4'
into 'android11-5.4-lts'").

As the main android11-5.4 branch had added new symbols to be tracked, we
need to properly track them here as well to ensure there is no abi
breakage over time with the LTS releases.  So regenerate the .xml file
to properly handle them.

Leaf changes summary: 35 artifacts changed
Changed leaf types summary: 0 leaf type changed
Removed/Changed/Added functions summary: 0 Removed, 0 Changed, 35 Added functions
Removed/Changed/Added variables summary: 0 Removed, 0 Changed, 0 Added variable

35 Added functions:

  [A] 'function void __ieee80211_schedule_txq(ieee80211_hw*, ieee80211_txq*, bool)'
  [A] 'function int dev_pm_genpd_set_performance_state(device*, unsigned int)'
  [A] 'function void* device_get_mac_address(device*, char*, int)'
  [A] 'function thermal_cooling_device* devm_thermal_of_cooling_device_register(device*, device_node*, char*, void*, const thermal_cooling_device_ops*)'
  [A] 'function sk_buff* ieee80211_beacon_get_template(ieee80211_hw*, ieee80211_vif*, ieee80211_mutable_offsets*)'
  [A] 'function void ieee80211_beacon_loss(ieee80211_vif*)'
  [A] 'function u8 ieee80211_csa_update_counter(ieee80211_vif*)'
  [A] 'function ieee80211_sta* ieee80211_find_sta_by_ifaddr(ieee80211_hw*, const u8*, const u8*)'
  [A] 'function void ieee80211_iter_chan_contexts_atomic(ieee80211_hw*, void (ieee80211_hw*, ieee80211_chanctx_conf*, void*)*, void*)'
  [A] 'function void ieee80211_iterate_stations_atomic(ieee80211_hw*, void (void*, ieee80211_sta*)*, void*)'
  [A] 'function void ieee80211_manage_rx_ba_offl(ieee80211_vif*, const u8*, unsigned int)'
  [A] 'function ieee80211_txq* ieee80211_next_txq(ieee80211_hw*, u8)'
  [A] 'function void ieee80211_sta_register_airtime(ieee80211_sta*, unsigned char, unsigned int, unsigned int)'
  [A] 'function void ieee80211_tdls_oper_request(ieee80211_vif*, const u8*, nl80211_tdls_operation, u16, gfp_t)'
  [A] 'function sk_buff* ieee80211_tx_dequeue(ieee80211_hw*, ieee80211_txq*)'
  [A] 'function void ieee80211_tx_rate_update(ieee80211_hw*, ieee80211_sta*, ieee80211_tx_info*)'
  [A] 'function void ieee80211_txq_get_depth(ieee80211_txq*, unsigned long int*, unsigned long int*)'
  [A] 'function bool ieee80211_txq_may_transmit(ieee80211_hw*, ieee80211_txq*)'
  [A] 'function void ieee80211_txq_schedule_start(ieee80211_hw*, u8)'
  [A] 'function void led_set_brightness_nosleep(led_classdev*, led_brightness)'
  [A] 'function int pcie_capability_write_word(pci_dev*, int, u16)'
  [A] 'function const char* reg_initiator_name(nl80211_reg_initiator)'
  [A] 'function int rproc_add(rproc*)'
  [A] 'function void rproc_add_subdev(rproc*, rproc_subdev*)'
  [A] 'function rproc* rproc_alloc(device*, const char*, const rproc_ops*, const char*, int)'
  [A] 'function int rproc_coredump_add_custom_segment(rproc*, dma_addr_t, size_t, void (rproc*, rproc_dump_segment*, void*)*, void*)'
  [A] 'function int rproc_coredump_add_segment(rproc*, dma_addr_t, size_t)'
  [A] 'function int rproc_del(rproc*)'
  [A] 'function u32 rproc_elf_get_boot_addr(rproc*, const firmware*)'
  [A] 'function void rproc_free(rproc*)'
  [A] 'function rproc* rproc_get_by_child(device*)'
  [A] 'function void rproc_remove_subdev(rproc*, rproc_subdev*)'
  [A] 'function void rproc_report_crash(rproc*, rproc_crash_type)'
  [A] 'function thermal_cooling_device* thermal_cooling_device_register(const char*, void*, const thermal_cooling_device_ops*)'
  [A] 'function void wiphy_read_of_freq_limits(wiphy*)'

Fixes: 276d190124 ("Merge branch 'android11-5.4' into 'android11-5.4-lts'")
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I3fb7d0c3171fa064c620dbbd9a089ab2eccbcaf3
2021-02-23 08:46:13 +01:00
Greg Kroah-Hartman
276d190124 Merge branch 'android11-5.4' into 'android11-5.4-lts'
Sync up with android11-5.4 for the following commits:

29b2beadc6 ANDROID: GKI: update Sony KMI symbol list
c382bf8373 ANDROID: ABI updates for db845c (enabling wifi)
2ae7c28a04 ANDROID: db845c_gki.fragment: Enable wifi on db845c w/ android-5.4
8f96c722f5 UPSTREAM: arm64: dts: qcom: sdm845: Add APSS watchdog node
1d2d51a301 UPSTREAM: arm64: dts: qcom: db845c: Move remoteproc firmware to sdm845
a09a63360b UPSTREAM: ath10k: qmi: Sleep for a while before assigning MSA memory
2d00c82d25 UPSTREAM: soc: qcom: qmi: Return EPROBE_DEFER if no address family
240e180bd8 ANDROID: ABI: Update allowed list for QCOM

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: Id6775586a5097a7276f9c6c0cb507cabde071e1c
2021-02-23 08:34:45 +01:00
Masaya Takahashi
29b2beadc6 ANDROID: GKI: update Sony KMI symbol list
Update the Sony abi list for ledtrig_transient.ko

Leaf changes summary: 1 artifact changed
Changed leaf types summary: 0 leaf type changed
Removed/Changed/Added functions summary: 0 Removed, 0 Changed, 1 Added function
Removed/Changed/Added variables summary: 0 Removed, 0 Changed, 0 Added variable

1 Added function:

  [A] 'function void led_set_brightness_nosleep(led_classdev*, led_brightness)'

Bug: 180692386
Signed-off-by: Masaya Takahashi <masaya.a.takahashi@sony.com>
Change-Id: I097a124fda2b5b48a2d7ad7d92d033eaa571bc21
2021-02-19 20:59:46 +09:00
John Stultz
c382bf8373 ANDROID: ABI updates for db845c (enabling wifi)
Update the db845c abi list after enabling wifi

Generated with:
  BUILD_CONFIG=common/build.config.db845c build/build_abi.sh -u
  build/build_abi.sh -u

Leaf changes summary: 34 artifacts changed
Changed leaf types summary: 0 leaf type changed
Removed/Changed/Added functions summary: 0 Removed, 0 Changed, 34 Added functions
Removed/Changed/Added variables summary: 0 Removed, 0 Changed, 0 Added variable

34 Added functions:

  [A] 'function void __ieee80211_schedule_txq(ieee80211_hw*, ieee80211_txq*, bool)'
  [A] 'function int dev_pm_genpd_set_performance_state(device*, unsigned int)'
  [A] 'function void* device_get_mac_address(device*, char*, int)'
  [A] 'function thermal_cooling_device* devm_thermal_of_cooling_device_register(device*, device_node*, char*, void*, const thermal_cooling_device_ops*)'
  [A] 'function sk_buff* ieee80211_beacon_get_template(ieee80211_hw*, ieee80211_vif*, ieee80211_mutable_offsets*)'
  [A] 'function void ieee80211_beacon_loss(ieee80211_vif*)'
  [A] 'function u8 ieee80211_csa_update_counter(ieee80211_vif*)'
  [A] 'function ieee80211_sta* ieee80211_find_sta_by_ifaddr(ieee80211_hw*, const u8*, const u8*)'
  [A] 'function void ieee80211_iter_chan_contexts_atomic(ieee80211_hw*, void (ieee80211_hw*, ieee80211_chanctx_conf*, void*)*, void*)'
  [A] 'function void ieee80211_iterate_stations_atomic(ieee80211_hw*, void (void*, ieee80211_sta*)*, void*)'
  [A] 'function void ieee80211_manage_rx_ba_offl(ieee80211_vif*, const u8*, unsigned int)'
  [A] 'function ieee80211_txq* ieee80211_next_txq(ieee80211_hw*, u8)'
  [A] 'function void ieee80211_sta_register_airtime(ieee80211_sta*, unsigned char, unsigned int, unsigned int)'
  [A] 'function void ieee80211_tdls_oper_request(ieee80211_vif*, const u8*, nl80211_tdls_operation, u16, gfp_t)'
  [A] 'function sk_buff* ieee80211_tx_dequeue(ieee80211_hw*, ieee80211_txq*)'
  [A] 'function void ieee80211_tx_rate_update(ieee80211_hw*, ieee80211_sta*, ieee80211_tx_info*)'
  [A] 'function void ieee80211_txq_get_depth(ieee80211_txq*, unsigned long int*, unsigned long int*)'
  [A] 'function bool ieee80211_txq_may_transmit(ieee80211_hw*, ieee80211_txq*)'
  [A] 'function void ieee80211_txq_schedule_start(ieee80211_hw*, u8)'
  [A] 'function int pcie_capability_write_word(pci_dev*, int, u16)'
  [A] 'function const char* reg_initiator_name(nl80211_reg_initiator)'
  [A] 'function int rproc_add(rproc*)'
  [A] 'function void rproc_add_subdev(rproc*, rproc_subdev*)'
  [A] 'function rproc* rproc_alloc(device*, const char*, const rproc_ops*, const char*, int)'
  [A] 'function int rproc_coredump_add_custom_segment(rproc*, dma_addr_t, size_t, void (rproc*, rproc_dump_segment*, void*)*, void*)'
  [A] 'function int rproc_coredump_add_segment(rproc*, dma_addr_t, size_t)'
  [A] 'function int rproc_del(rproc*)'
  [A] 'function u32 rproc_elf_get_boot_addr(rproc*, const firmware*)'
  [A] 'function void rproc_free(rproc*)'
  [A] 'function rproc* rproc_get_by_child(device*)'
  [A] 'function void rproc_remove_subdev(rproc*, rproc_subdev*)'
  [A] 'function void rproc_report_crash(rproc*, rproc_crash_type)'
  [A] 'function thermal_cooling_device* thermal_cooling_device_register(const char*, void*, const thermal_cooling_device_ops*)'
  [A] 'function void wiphy_read_of_freq_limits(wiphy*)'

Bug: 146449535
Signed-off-by: John Stultz <john.stultz@linaro.org>
Change-Id: I6e3c8a52a394b7f151065f4792d22a5a94c7e8fa
2021-02-18 16:34:56 -08:00
John Stultz
2ae7c28a04 ANDROID: db845c_gki.fragment: Enable wifi on db845c w/ android-5.4
Add config settings to enable wifi via modules on db845c

Bug: 146449535
Change-Id: I81892c4cc48db7839fe99aa5fb0b0a0782cab321
Signed-off-by: John Stultz <john.stultz@linaro.org>
2021-02-18 16:25:02 -08:00
Bjorn Andersson
8f96c722f5 UPSTREAM: arm64: dts: qcom: sdm845: Add APSS watchdog node
commit ef8576789e869b7584684ae81126a465eb1deeb6 upstream.

Add a node describing the watchdog found in the application subsystem.

Reviewed-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
(cherry picked from commit ef8576789e869b7584684ae81126a465eb1deeb6)
Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
Signed-off-by: John Stultz <john.stultz@linaro.org>
Change-Id: I835d512c13c392e356c5190e865c0617e97041c2
2021-02-18 16:24:28 -08:00
Bjorn Andersson
1d2d51a301 UPSTREAM: arm64: dts: qcom: db845c: Move remoteproc firmware to sdm845
The redistributable firmware should work on any engineering device, so
lets push this to qcom/sdm845, rather than qcom/db845c. Also specify the
path for the modem firmware.

Reviewed-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Link: https://lore.kernel.org/r/20191113203951.3704428-1-bjorn.andersson@linaro.org
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
(cherry picked from commit 82b1cc447a2c7c5121ce34f15f9840110ee3499f)
Signed-off-by: John Stultz <john.stultz@linaro.org>
Change-Id: Ica785dd7faee17dce933379dbb6ada32a3697bdb
2021-02-18 16:23:58 -08:00
Bjorn Andersson
a09a63360b UPSTREAM: ath10k: qmi: Sleep for a while before assigning MSA memory
commit b70b3a36ec33a2c8d3292f3b33fe2047a8f57b9a upstream.

Unless we sleep for a while before transitioning the MSA memory to WLAN
the MPSS.AT.4.0.c2-01184-SDM845_GEN_PACK-1 firmware triggers a security
violation fairly reliably. Unforutnately recovering from this failure
always results in the entire system freezing.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
(cherry picked from commit b70b3a36ec33a2c8d3292f3b33fe2047a8f57b9a)
Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
Signed-off-by: John Stultz <john.stultz@linaro.org>
Change-Id: Ie44e86d404f1897b7cc349a03972178374fef89c
2021-02-18 16:23:20 -08:00
Jeffrey Hugo
2d00c82d25 UPSTREAM: soc: qcom: qmi: Return EPROBE_DEFER if no address family
If a client comes up early in the boot process (perhaps was a built-in
driver), qmi_handle_init() will likely fail with a EAFNOSUPPORT since the
underlying ipc router hasn't init'd and registered the address family.
This should not be a fatal error since chances are, the router will come
up later, so recode the error to EPROBE_DEFER so that clients will retry
later.

Signed-off-by: Jeffrey Hugo <jeffrey.l.hugo@gmail.com>
Link: https://lore.kernel.org/r/20191106230511.1290-1-jeffrey.l.hugo@gmail.com
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
(cherry picked from commit 52af26e33e700158e6549f1465fcf9da099fabfa)
Signed-off-by: John Stultz <john.stultz@linaro.org>
Change-Id: I26a0dabe9b1f3b8e9cc793f7f52ee8f658ecdce3
2021-02-18 16:22:46 -08:00
Greg Kroah-Hartman
fb782267e1 ANDROID: GKI: Fix up .xml file after merge with android11-5.4
Because the .xml file can not handle being "merged" we had to pick one
side or the other in commit 60fd71bc10 ("Merge branch 'android11-5.4'
into 'android11-5.4-lts'")

As the main android11-5.4 branch had added new symbols to be tracked, we
need to properly track them here as well to ensure there is no abi
breakage over time with the LTS releases.  So regenerate the .xml file
to properly handle them.

Leaf changes summary: 60 artifacts changed
Changed leaf types summary: 0 leaf type changed
Removed/Changed/Added functions summary: 0 Removed, 0 Changed, 60 Added functions
Removed/Changed/Added variables summary: 0 Removed, 0 Changed, 0 Added variable

60 Added functions:

  [A] 'function void __bforget(buffer_head*)'
  [A] 'function void __filemap_set_wb_err(address_space*, int)'
  [A] 'function void __pagevec_release(pagevec*)'
  [A] 'function void __sb_end_write(super_block*, int)'
  [A] 'function int __sb_start_write(super_block*, int, bool)'
  [A] 'function int __test_set_page_writeback(page*, bool)'
  [A] 'function int add_to_page_cache_locked(page*, address_space*, unsigned long int, gfp_t)'
  [A] 'function void balance_dirty_pages_ratelimited(address_space*)'
  [A] 'function int blkdev_issue_discard(block_device*, long long unsigned int, long long unsigned int, unsigned int, unsigned long int)'
  [A] 'function void block_invalidatepage(page*, unsigned int, unsigned int)'
  [A] 'function bool capable_wrt_inode_uidgid(const inode*, int)'
  [A] 'function int clear_page_dirty_for_io(page*)'
  [A] 'function int current_umask()'
  [A] 'function dentry* d_splice_alias(inode*, dentry*)'
  [A] 'function void end_page_writeback(page*)'
  [A] 'function int fiemap_check_flags(fiemap_extent_info*, u32)'
  [A] 'function int fiemap_fill_next_extent(fiemap_extent_info*, u64, u64, u64, u32)'
  [A] 'function int file_remove_privs(file*)'
  [A] 'function int file_update_time(file*)'
  [A] 'function int file_write_and_wait_range(file*, loff_t, loff_t)'
  [A] 'function int filemap_fdatawrite(address_space*)'
  [A] 'function int filemap_flush(address_space*)'
  [A] 'function int filemap_write_and_wait(address_space*)'
  [A] 'function int filemap_write_and_wait_range(address_space*, loff_t, loff_t)'
  [A] 'function ssize_t generic_file_direct_write(kiocb*, iov_iter*)'
  [A] 'function ssize_t generic_perform_write(file*, iov_iter*, loff_t)'
  [A] 'function ssize_t generic_write_checks(kiocb*, iov_iter*)'
  [A] 'function page* grab_cache_page_write_begin(address_space*, unsigned long int, unsigned int)'
  [A] 'function inode* igrab(inode*)'
  [A] 'function inode* ilookup5(super_block*, unsigned long int, int (inode*, void*)*, void*)'
  [A] 'function void inode_dio_wait(inode*)'
  [A] 'function int inode_newsize_ok(const inode*, long long int)'
  [A] 'function void inode_set_flags(inode*, unsigned int, unsigned int)'
  [A] 'function void iov_iter_advance(iov_iter*, unsigned long int)'
  [A] 'function unsigned long int iov_iter_alignment(const iov_iter*)'
  [A] 'function long int iov_iter_get_pages(iov_iter*, page**, unsigned long int, unsigned int, unsigned long int*)'
  [A] 'function ssize_t iter_file_splice_write(pipe_inode_info*, file*, loff_t*, size_t, unsigned int)'
  [A] 'function kmem_cache* kmem_cache_create_usercopy(const char*, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, void (void*)*)'
  [A] 'function void ktime_get_coarse_real_ts64(timespec64*)'
  [A] 'function void ll_rw_block(int, int, int, buffer_head**)'
  [A] 'function void lru_cache_add_file(page*)'
  [A] 'function void mark_buffer_write_io_error(buffer_head*)'
  [A] 'function void mnt_drop_write_file(file*)'
  [A] 'function unsigned long int page_cache_next_miss(address_space*, unsigned long int, unsigned long int)'
  [A] 'function unsigned long int page_cache_prev_miss(address_space*, unsigned long int, unsigned long int)'
  [A] 'function unsigned int pagevec_lookup_range_tag(pagevec*, address_space*, unsigned long int*, unsigned long int, unsigned int)'
  [A] 'function int param_set_byte(const char*, const kernel_param*)'
  [A] 'function void put_pages_list(list_head*)'
  [A] 'function int redirty_page_for_writepage(writeback_control*, page*)'
  [A] 'function void set_nlink(inode*, unsigned int)'
  [A] 'function int setattr_prepare(dentry*, iattr*)'
  [A] 'function long long unsigned int simple_strtoull(const char*, char**, unsigned int)'
  [A] 'function int sync_inode_metadata(inode*, int)'
  [A] 'function void sync_inodes_sb(super_block*)'
  [A] 'function void tag_pages_for_writeback(address_space*, unsigned long int, unsigned long int)'
  [A] 'function void truncate_setsize(inode*, loff_t)'
  [A] 'function void try_to_writeback_inodes_sb(super_block*, wb_reason)'
  [A] 'function int vfs_fsync_range(file*, long long int, long long int, int)'
  [A] 'function void wait_on_page_bit(page*, int)'
  [A] 'function void writeback_inodes_sb(super_block*, wb_reason)'

Fixes: 60fd71bc10 ("Merge branch 'android11-5.4' into 'android11-5.4-lts'")
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I2af9754f03d7ce81d0bb42690dbc2f0908673623
2021-02-18 15:33:28 +01:00
Tony Truong
240e180bd8 ANDROID: ABI: Update allowed list for QCOM
Add the following symbols to QCOM allowed-list:
-- pcie_bus_configure_settings

Bug: 180475310
Change-Id: I49ed1ada673a9199370344cf2b89d7369f92d3f2
Signed-off-by: Tony Truong <truong@codeaurora.org>
2021-02-18 14:25:28 +00:00
Greg Kroah-Hartman
60fd71bc10 Merge branch 'android11-5.4' into 'android11-5.4-lts'
Sync up with android11-5.4 for the following commits:

224ea2cd2c ANDROID: GKI: update Sony symbol list for texfat

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I445c062f76e9ca7e0345b5663fc9b17c5e3609ba
2021-02-18 15:22:27 +01:00
Greg Kroah-Hartman
dbd20c588d ANDROID: GKI: fix up .xml file after big merge with android11-5.4
Because the .xml file can not handle being "merged" we had to pick one
side or the other in commit 56f4fac695 ("Merge branch 'android11-5.4'
into 'android11-5.4-lts'").

As the main android11-5.4 branch had added new symbols to be tracked, we
need to properly track them here as well to ensure there is no abi
breakage over time with the LTS releases.  So regenerate the .xml file
to properly handle them.

Leaf changes summary: 13 artifacts changed
Changed leaf types summary: 0 leaf type changed
Removed/Changed/Added functions summary: 0 Removed, 0 Changed, 13 Added functions
Removed/Changed/Added variables summary: 0 Removed, 0 Changed, 0 Added variable

13 Added functions:

  [A] 'function int clk_notifier_unregister(clk*, notifier_block*)'
  [A] 'function int drm_atomic_set_crtc_for_plane(drm_plane_state*, drm_crtc*)'
  [A] 'function void drm_atomic_set_fb_for_plane(drm_plane_state*, drm_framebuffer*)'
  [A] 'function void drm_connector_list_update(drm_connector*)'
  [A] 'function int drm_dp_mst_atomic_check(drm_atomic_state*)'
  [A] 'function void drm_dp_mst_dump_topology(seq_file*, drm_dp_mst_topology_mgr*)'
  [A] 'function bool drm_is_current_master(drm_file*)'
  [A] 'function drm_master* drm_master_get(drm_master*)'
  [A] 'function void drm_master_put(drm_master**)'
  [A] 'function void drm_mode_prune_invalid(drm_device*, list_head*, bool)'
  [A] 'function void drm_mode_sort(list_head*)'
  [A] 'function void drm_rect_rotate(drm_rect*, int, int, unsigned int)'
  [A] 'function int idr_alloc_u32(idr*, void*, unsigned int*, unsigned long int, unsigned int)'

Fixes: 56f4fac695 ("Merge branch 'android11-5.4' into 'android11-5.4-lts'")
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I5f91a8798c94b7bc42b68929072070c2dbb00c97
2021-02-18 13:01:23 +01:00
Masaya Takahashi
224ea2cd2c ANDROID: GKI: update Sony symbol list for texfat
Leaf changes summary: 60 artifacts changed
Changed leaf types summary: 0 leaf type changed
Removed/Changed/Added functions summary: 0 Removed, 0 Changed, 60 Added functions
Removed/Changed/Added variables summary: 0 Removed, 0 Changed, 0 Added variable

60 Added functions:

  [A] 'function void __bforget(buffer_head*)'
  [A] 'function void __filemap_set_wb_err(address_space*, int)'
  [A] 'function void __pagevec_release(pagevec*)'
  [A] 'function void __sb_end_write(super_block*, int)'
  [A] 'function int __sb_start_write(super_block*, int, bool)'
  [A] 'function int __test_set_page_writeback(page*, bool)'
  [A] 'function int add_to_page_cache_locked(page*, address_space*, unsigned long int, gfp_t)'
  [A] 'function void balance_dirty_pages_ratelimited(address_space*)'
  [A] 'function int blkdev_issue_discard(block_device*, long long unsigned int, long long unsigned int, unsigned int, unsigned long int)'
  [A] 'function void block_invalidatepage(page*, unsigned int, unsigned int)'
  [A] 'function bool capable_wrt_inode_uidgid(const inode*, int)'
  [A] 'function int clear_page_dirty_for_io(page*)'
  [A] 'function int current_umask()'
  [A] 'function dentry* d_splice_alias(inode*, dentry*)'
  [A] 'function void end_page_writeback(page*)'
  [A] 'function int fiemap_check_flags(fiemap_extent_info*, u32)'
  [A] 'function int fiemap_fill_next_extent(fiemap_extent_info*, u64, u64, u64, u32)'
  [A] 'function int file_remove_privs(file*)'
  [A] 'function int file_update_time(file*)'
  [A] 'function int file_write_and_wait_range(file*, loff_t, loff_t)'
  [A] 'function int filemap_fdatawrite(address_space*)'
  [A] 'function int filemap_flush(address_space*)'
  [A] 'function int filemap_write_and_wait(address_space*)'
  [A] 'function int filemap_write_and_wait_range(address_space*, loff_t, loff_t)'
  [A] 'function ssize_t generic_file_direct_write(kiocb*, iov_iter*)'
  [A] 'function ssize_t generic_perform_write(file*, iov_iter*, loff_t)'
  [A] 'function ssize_t generic_write_checks(kiocb*, iov_iter*)'
  [A] 'function page* grab_cache_page_write_begin(address_space*, unsigned long int, unsigned int)'
  [A] 'function inode* igrab(inode*)'
  [A] 'function inode* ilookup5(super_block*, unsigned long int, int (inode*, void*)*, void*)'
  [A] 'function void inode_dio_wait(inode*)'
  [A] 'function int inode_newsize_ok(const inode*, long long int)'
  [A] 'function void inode_set_flags(inode*, unsigned int, unsigned int)'
  [A] 'function void iov_iter_advance(iov_iter*, unsigned long int)'
  [A] 'function unsigned long int iov_iter_alignment(const iov_iter*)'
  [A] 'function long int iov_iter_get_pages(iov_iter*, page**, unsigned long int, unsigned int, unsigned long int*)'
  [A] 'function ssize_t iter_file_splice_write(pipe_inode_info*, file*, loff_t*, size_t, unsigned int)'
  [A] 'function kmem_cache* kmem_cache_create_usercopy(const char*, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, void (void*)*)'
  [A] 'function void ktime_get_coarse_real_ts64(timespec64*)'
  [A] 'function void ll_rw_block(int, int, int, buffer_head**)'
  [A] 'function void lru_cache_add_file(page*)'
  [A] 'function void mark_buffer_write_io_error(buffer_head*)'
  [A] 'function void mnt_drop_write_file(file*)'
  [A] 'function unsigned long int page_cache_next_miss(address_space*, unsigned long int, unsigned long int)'
  [A] 'function unsigned long int page_cache_prev_miss(address_space*, unsigned long int, unsigned long int)'
  [A] 'function unsigned int pagevec_lookup_range_tag(pagevec*, address_space*, unsigned long int*, unsigned long int, unsigned int)'
  [A] 'function int param_set_byte(const char*, const kernel_param*)'
  [A] 'function void put_pages_list(list_head*)'
  [A] 'function int redirty_page_for_writepage(writeback_control*, page*)'
  [A] 'function void set_nlink(inode*, unsigned int)'
  [A] 'function int setattr_prepare(dentry*, iattr*)'
  [A] 'function long long unsigned int simple_strtoull(const char*, char**, unsigned int)'
  [A] 'function int sync_inode_metadata(inode*, int)'
  [A] 'function void sync_inodes_sb(super_block*)'
  [A] 'function void tag_pages_for_writeback(address_space*, unsigned long int, unsigned long int)'
  [A] 'function void truncate_setsize(inode*, loff_t)'
  [A] 'function void try_to_writeback_inodes_sb(super_block*, wb_reason)'
  [A] 'function int vfs_fsync_range(file*, long long int, long long int, int)'
  [A] 'function void wait_on_page_bit(page*, int)'
  [A] 'function void writeback_inodes_sb(super_block*, wb_reason)'

Bug: 178455529
Signed-off-by: Masaya Takahashi <masaya.a.takahashi@sony.com>
Change-Id: I39c6be26264b1eba59e3fc0ba2a086dc4f9e1baa
2021-02-18 18:43:30 +09:00
Greg Kroah-Hartman
56f4fac695 Merge branch 'android11-5.4' into 'android11-5.4-lts'
Sync up with android11-5.4 for the following commits:

19c89b6bbf ANDROID: GKI: update KMI for db845c with idr_alloc_u32 added
9394e52285 Merge tag 'android11-5.4.86_r00' from 'android11-5.4-lts' into 'android11-5.4'
d3c11f4ae4 ANDROID: ABI: Update allowed list for QCOM
6b4f6cd53f ANDROID: ABI: update allowed list for QCOM
1d9c43fa3b ANDROID: ABI: Update allowed list for QCOM
f682b4505d ANDROID: build_config: drop CONFIG_KASAN_PANIC_ON_WARN

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I3461f062469261b3074c4e46f04aea4023400aee
2021-02-18 10:24:06 +01:00
Yongqin Liu
19c89b6bbf ANDROID: GKI: update KMI for db845c with idr_alloc_u32 added
to resolve the idr_alloc_u32 symbol not found problem,
like reported as the following:
    [    9.718675] init: Loading module /lib/modules/qrtr.ko with args ""
    [    9.724987] qcom-pcie 1c08000.pci: 1c08000.pci supply vddpe-3v3 not found, using dummy regulator
    [    9.733909] qcom-pcie 1c08000.pci: host bridge /soc@0/pci@1c08000 ranges:
    [    9.741378] qrtr: Unknown symbol idr_alloc_u32 (err -2)
    [    9.746741] qcom-pcie 1c08000.pci:    IO 0x40200000..0x402fffff -> 0x40200000
    [    9.753958] qcom-pcie 1c08000.pci:   MEM 0x40300000..0x5fffffff -> 0x40300000
    [    9.784507] init: Failed to insmod '/lib/modules/qrtr.ko' with args ''
    [    9.791151] init: LoadWithAliases was unable to load /lib/modules/qrtr.ko
    [    9.798037] init: LoadWithAliases was unable to load qrtr_tun
    [    9.804055] init: Failed to load kernel modules

Add this symbol to the .xml file:

Leaf changes summary: 1 artifact changed (80 filtered out)
Changed leaf types summary: 0 (80 filtered out) leaf types changed
Removed/Changed/Added functions summary: 0 Removed, 0 Changed, 1 Added function
Removed/Changed/Added variables summary: 0 Removed, 0 Changed, 0 Added variable

1 Added function:

  [A] 'function int idr_alloc_u32(idr*, void*, unsigned int*, unsigned long int, unsigned int)'

Test: boot tested with db845c android11 build
Fixes: 4ef63e3654 ("net: qrtr: fix usage of idr in port assignment to socket")
Signed-off-by: Yongqin Liu <yongqin.liu@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I62bf3ac2cccbc2fe7ca70986939ba4f593ca86a2
2021-02-17 19:18:53 +01:00
Greg Kroah-Hartman
9394e52285 Merge tag 'android11-5.4.86_r00' from 'android11-5.4-lts' into 'android11-5.4'
This merges the 5.4.86 upstream LTS release into the android11-5.4
branch so that all devices can get the needed important security and
other bugfixes that are in here.  All devices must upgrade to remain
properly secure from known issues.

Bug: 180469075
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I1041e0d08d55a3eb2e0f49b7d2384960f48d9b11
2021-02-17 16:57:46 +01:00
Manaf Meethalavalappu Pallikunhi
d3c11f4ae4 ANDROID: ABI: Update allowed list for QCOM
Leaf changes summary: 1 artifact changed
Changed leaf types summary: 0 leaf type changed
Removed/Changed/Added functions summary: 0 Removed, 0 Changed, 1 Added function
Removed/Changed/Added variables summary: 0 Removed, 0 Changed, 0 Added variable

1 Added function:

  [A] 'function int clk_notifier_unregister(clk*, notifier_block*)'

Bug: 180475184
Change-Id: Ifbbdfbb67dd5582144e345d0a2fa45065d0215ba
Signed-off-by: Manaf Meethalavalappu Pallikunhi <manafm@codeaurora.org>
2021-02-17 15:27:50 +00:00
Greg Kroah-Hartman
7834d8fef1 This is the 5.4.99 stable release
-----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEEZH8oZUiU471FcZm+ONu9yGCSaT4FAmAs43QACgkQONu9yGCS
 aT4omw/+JPBAZB5ClIOSDuf3/yJkbigVRFNVmQJy4/cluG32cxlcpudoau7AXq3N
 0Sn/rfSdldl5eI98OTA+Y0yPIsVnQJdei228A5gmULkkc+rEFugorSJKRmmA7tH0
 VdZ1C4NlhhmjoIT/W8mMNzv14dtyGQvRbT+zzfxqwqL6tF9+alcdBYTP/Z691K6x
 8Csfe05MZ8VkvBizStaTXC+dtMhU917Ikd5i5v4ZzaesZJcUTLS7J82FhtKeoz7q
 tDoA/Bl+pN1KjyIIE61/zJ8DKzBtOeuo1PWJFpO+EBVhKVosr3oWJfTAiM7Fsnu5
 dbKHYPsbe3mB79JdQibr7TpU7vSjDr5a/HTuYtp7WM1R5IssiFeVOdpXTGim/s/E
 Flao5LYSUcj0X/Io6TyUnxQWw8sJz3PGKYiLUn8/9DBpzNFzynQ+vuapXCoGxJzh
 W108q32PIx2ZTJsD5RUUqZbytG/zKzI1+SxXo2uOhs9/k5qT+35Yp9epsE2Cp8v1
 Oiw3P/ZUDNk6zPj0dsHcTsqTofRK07l71HnM8iIbCWSPw834IoGBuB8c3H7HaHn4
 v5M4tMTDAaKi/e09K92fR6SZDgZz8D0N+sLLneA4NEASXIJanCUwcgVCUbja+BO1
 H1hiYTTZQa7kOkSxBa/wGsWkdfvOpOvCSFr+c6LPmB9sHMe4K8o=
 =3BI0
 -----END PGP SIGNATURE-----

Merge 5.4.99 into android11-5.4-lts

Changes in 5.4.99
	gpio: ep93xx: fix BUG_ON port F usage
	gpio: ep93xx: Fix single irqchip with multi gpiochips
	tracing: Do not count ftrace events in top level enable output
	tracing: Check length before giving out the filter buffer
	arm/xen: Don't probe xenbus as part of an early initcall
	cgroup: fix psi monitor for root cgroup
	arm64: dts: rockchip: Fix PCIe DT properties on rk3399
	arm64: dts: qcom: sdm845: Reserve LPASS clocks in gcc
	ARM: OMAP2+: Fix suspcious RCU usage splats for omap_enter_idle_coupled
	platform/x86: hp-wmi: Disable tablet-mode reporting by default
	ovl: perform vfs_getxattr() with mounter creds
	cap: fix conversions on getxattr
	ovl: skip getxattr of security labels
	nvme-pci: ignore the subsysem NQN on Phison E16
	drm/amd/display: Add more Clock Sources to DCN2.1
	drm/amd/display: Fix dc_sink kref count in emulated_link_detect
	drm/amd/display: Free atomic state after drm_atomic_commit
	drm/amd/display: Decrement refcount of dc_sink before reassignment
	riscv: virt_addr_valid must check the address belongs to linear mapping
	bfq-iosched: Revert "bfq: Fix computation of shallow depth"
	ARM: dts: lpc32xx: Revert set default clock rate of HCLK PLL
	ARM: ensure the signal page contains defined contents
	ARM: kexec: fix oops after TLB are invalidated
	vmlinux.lds.h: Create section for protection against instrumentation
	lkdtm: don't move ctors to .rodata
	mt76: dma: fix a possible memory leak in mt76_add_fragment()
	drm/vc4: hvs: Fix buffer overflow with the dlist handling
	bpf: Check for integer overflow when using roundup_pow_of_two()
	netfilter: xt_recent: Fix attempt to update deleted entry
	netfilter: nftables: fix possible UAF over chains from packet path in netns
	netfilter: flowtable: fix tcp and udp header checksum update
	xen/netback: avoid race in xenvif_rx_ring_slots_available()
	net: enetc: initialize the RFS and RSS memories
	selftests: txtimestamp: fix compilation issue
	net: stmmac: set TxQ mode back to DCB after disabling CBS
	ibmvnic: Clear failover_pending if unable to schedule
	netfilter: conntrack: skip identical origin tuple in same zone only
	x86/build: Disable CET instrumentation in the kernel for 32-bit too
	net: hns3: add a check for queue_id in hclge_reset_vf_queue()
	firmware_loader: align .builtin_fw to 8
	drm/sun4i: tcon: set sync polarity for tcon1 channel
	drm/sun4i: Fix H6 HDMI PHY configuration
	drm/sun4i: dw-hdmi: Fix max. frequency for H6
	clk: sunxi-ng: mp: fix parent rate change flag check
	i2c: stm32f7: fix configuration of the digital filter
	h8300: fix PREEMPTION build, TI_PRE_COUNT undefined
	usb: dwc3: ulpi: fix checkpatch warning
	usb: dwc3: ulpi: Replace CPU-based busyloop with Protocol-based one
	rxrpc: Fix clearance of Tx/Rx ring when releasing a call
	udp: fix skb_copy_and_csum_datagram with odd segment sizes
	net: dsa: call teardown method on probe failure
	net: gro: do not keep too many GRO packets in napi->rx_list
	net: fix iteration for sctp transport seq_files
	net/vmw_vsock: improve locking in vsock_connect_timeout()
	net: watchdog: hold device global xmit lock during tx disable
	vsock/virtio: update credit only if socket is not closed
	vsock: fix locking in vsock_shutdown()
	net/rds: restrict iovecs length for RDS_CMSG_RDMA_ARGS
	net/qrtr: restrict user-controlled length in qrtr_tun_write_iter()
	ovl: expand warning in ovl_d_real()
	Linux 5.4.99

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I28713d7ddd79d24b3007872877e51063df21a01e
2021-02-17 11:45:30 +01:00
Greg Kroah-Hartman
850e6a95de Linux 5.4.99
Tested-by: Jason Self <jason@bluehome.net>
Tested-by: Linux Kernel Functional Testing <lkft@linaro.org>
Tested-by: Guenter Roeck <linux@roeck-us.net>
Tested-by: Shuah Khan <skhan@linuxfoundation.org>
Tested-by: Ross Schmidt <ross.schm.dev@gmail.com>
Link: https://lore.kernel.org/r/20210215152715.401453874@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-02-17 10:35:20 +01:00
Miklos Szeredi
e8ffaca0fe ovl: expand warning in ovl_d_real()
commit cef4cbff06fbc3be54d6d79ee139edecc2ee8598 upstream.

There was a syzbot report with this warning but insufficient information...

Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-02-17 10:35:19 +01:00
Sabyrzhan Tasbolatov
b55528a18e net/qrtr: restrict user-controlled length in qrtr_tun_write_iter()
commit 2a80c15812372e554474b1dba0b1d8e467af295d upstream.

syzbot found WARNING in qrtr_tun_write_iter [1] when write_iter length
exceeds KMALLOC_MAX_SIZE causing order >= MAX_ORDER condition.

Additionally, there is no check for 0 length write.

[1]
WARNING: mm/page_alloc.c:5011
[..]
Call Trace:
 alloc_pages_current+0x18c/0x2a0 mm/mempolicy.c:2267
 alloc_pages include/linux/gfp.h:547 [inline]
 kmalloc_order+0x2e/0xb0 mm/slab_common.c:837
 kmalloc_order_trace+0x14/0x120 mm/slab_common.c:853
 kmalloc include/linux/slab.h:557 [inline]
 kzalloc include/linux/slab.h:682 [inline]
 qrtr_tun_write_iter+0x8a/0x180 net/qrtr/tun.c:83
 call_write_iter include/linux/fs.h:1901 [inline]

Reported-by: syzbot+c2a7e5c5211605a90865@syzkaller.appspotmail.com
Signed-off-by: Sabyrzhan Tasbolatov <snovitoll@gmail.com>
Link: https://lore.kernel.org/r/20210202092059.1361381-1-snovitoll@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-02-17 10:35:19 +01:00
Sabyrzhan Tasbolatov
99996cd558 net/rds: restrict iovecs length for RDS_CMSG_RDMA_ARGS
commit a11148e6fcce2ae53f47f0a442d098d860b4f7db upstream.

syzbot found WARNING in rds_rdma_extra_size [1] when RDS_CMSG_RDMA_ARGS
control message is passed with user-controlled
0x40001 bytes of args->nr_local, causing order >= MAX_ORDER condition.

The exact value 0x40001 can be checked with UIO_MAXIOV which is 0x400.
So for kcalloc() 0x400 iovecs with sizeof(struct rds_iovec) = 0x10
is the closest limit, with 0x10 leftover.

Same condition is currently done in rds_cmsg_rdma_args().

[1] WARNING: mm/page_alloc.c:5011
[..]
Call Trace:
 alloc_pages_current+0x18c/0x2a0 mm/mempolicy.c:2267
 alloc_pages include/linux/gfp.h:547 [inline]
 kmalloc_order+0x2e/0xb0 mm/slab_common.c:837
 kmalloc_order_trace+0x14/0x120 mm/slab_common.c:853
 kmalloc_array include/linux/slab.h:592 [inline]
 kcalloc include/linux/slab.h:621 [inline]
 rds_rdma_extra_size+0xb2/0x3b0 net/rds/rdma.c:568
 rds_rm_size net/rds/send.c:928 [inline]

Reported-by: syzbot+1bd2b07f93745fa38425@syzkaller.appspotmail.com
Signed-off-by: Sabyrzhan Tasbolatov <snovitoll@gmail.com>
Acked-by: Santosh Shilimkar <santosh.shilimkar@oracle.com>
Link: https://lore.kernel.org/r/20210201203233.1324704-1-snovitoll@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-02-17 10:35:19 +01:00
Stefano Garzarella
ac79b1d94a vsock: fix locking in vsock_shutdown()
commit 1c5fae9c9a092574398a17facc31c533791ef232 upstream.

In vsock_shutdown() we touched some socket fields without holding the
socket lock, such as 'state' and 'sk_flags'.

Also, after the introduction of multi-transport, we are accessing
'vsk->transport' in vsock_send_shutdown() without holding the lock
and this call can be made while the connection is in progress, so
the transport can change in the meantime.

To avoid issues, we hold the socket lock when we enter in
vsock_shutdown() and release it when we leave.

Among the transports that implement the 'shutdown' callback, only
hyperv_transport acquired the lock. Since the caller now holds it,
we no longer take it.

Fixes: d021c34405 ("VSOCK: Introduce VM Sockets")
Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-02-17 10:35:19 +01:00
Stefano Garzarella
c025081b57 vsock/virtio: update credit only if socket is not closed
commit ce7536bc7398e2ae552d2fabb7e0e371a9f1fe46 upstream.

If the socket is closed or is being released, some resources used by
virtio_transport_space_update() such as 'vsk->trans' may be released.

To avoid a use after free bug we should only update the available credit
when we are sure the socket is still open and we have the lock held.

Fixes: 06a8fc7836 ("VSOCK: Introduce virtio_vsock_common.ko")
Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Link: https://lore.kernel.org/r/20210208144454.84438-1-sgarzare@redhat.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-02-17 10:35:19 +01:00
Edwin Peer
2545c5bd83 net: watchdog: hold device global xmit lock during tx disable
commit 3aa6bce9af0e25b735c9c1263739a5639a336ae8 upstream.

Prevent netif_tx_disable() running concurrently with dev_watchdog() by
taking the device global xmit lock. Otherwise, the recommended:

	netif_carrier_off(dev);
	netif_tx_disable(dev);

driver shutdown sequence can happen after the watchdog has already
checked carrier, resulting in possible false alarms. This is because
netif_tx_lock() only sets the frozen bit without maintaining the locks
on the individual queues.

Fixes: c3f26a269c ("netdev: Fix lockdep warnings in multiqueue configurations.")
Signed-off-by: Edwin Peer <edwin.peer@broadcom.com>
Reviewed-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-02-17 10:35:19 +01:00
Norbert Slusarek
a5f0b6f7b1 net/vmw_vsock: improve locking in vsock_connect_timeout()
commit 3d0bc44d39bca615b72637e340317b7899b7f911 upstream.

A possible locking issue in vsock_connect_timeout() was recognized by
Eric Dumazet which might cause a null pointer dereference in
vsock_transport_cancel_pkt(). This patch assures that
vsock_transport_cancel_pkt() will be called within the lock, so a race
condition won't occur which could result in vsk->transport to be set to NULL.

Fixes: 380feae0de ("vsock: cancel packets when failing to connect")
Reported-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: Norbert Slusarek <nslusarek@gmx.net>
Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
Link: https://lore.kernel.org/r/trinity-f8e0937a-cf0e-4d80-a76e-d9a958ba3ef1-1612535522360@3c-app-gmx-bap12
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-02-17 10:35:19 +01:00
NeilBrown
611d93fbea net: fix iteration for sctp transport seq_files
commit af8085f3a4712c57d0dd415ad543bac85780375c upstream.

The sctp transport seq_file iterators take a reference to the transport
in the ->start and ->next functions and releases the reference in the
->show function.  The preferred handling for such resources is to
release them in the subsequent ->next or ->stop function call.

Since Commit 1f4aace60b ("fs/seq_file.c: simplify seq_file iteration
code and interface") there is no guarantee that ->show will be called
after ->next, so this function can now leak references.

So move the sctp_transport_put() call to ->next and ->stop.

Fixes: 1f4aace60b ("fs/seq_file.c: simplify seq_file iteration code and interface")
Reported-by: Xin Long <lucien.xin@gmail.com>
Signed-off-by: NeilBrown <neilb@suse.de>
Acked-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-02-17 10:35:19 +01:00
Eric Dumazet
2085d88663 net: gro: do not keep too many GRO packets in napi->rx_list
commit 8dc1c444df193701910f5e80b5d4caaf705a8fb0 upstream.

Commit c80794323e82 ("net: Fix packet reordering caused by GRO and
listified RX cooperation") had the unfortunate effect of adding
latencies in common workloads.

Before the patch, GRO packets were immediately passed to
upper stacks.

After the patch, we can accumulate quite a lot of GRO
packets (depdending on NAPI budget).

My fix is counting in napi->rx_count number of segments
instead of number of logical packets.

Fixes: c80794323e82 ("net: Fix packet reordering caused by GRO and listified RX cooperation")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Bisected-by: John Sperbeck <jsperbeck@google.com>
Tested-by: Jian Yang <jianyang@google.com>
Cc: Maxim Mikityanskiy <maximmi@mellanox.com>
Reviewed-by: Saeed Mahameed <saeedm@nvidia.com>
Reviewed-by: Edward Cree <ecree.xilinx@gmail.com>
Reviewed-by: Alexander Lobakin <alobakin@pm.me>
Link: https://lore.kernel.org/r/20210204213146.4192368-1-eric.dumazet@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-02-17 10:35:19 +01:00
Vladimir Oltean
5c53956a8d net: dsa: call teardown method on probe failure
commit 8fd54a73b7cda11548154451bdb4bde6d8ff74c7 upstream.

Since teardown is supposed to undo the effects of the setup method, it
should be called in the error path for dsa_switch_setup, not just in
dsa_switch_teardown.

Fixes: 5e3f847a02 ("net: dsa: Add teardown callback for drivers")
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Link: https://lore.kernel.org/r/20210204163351.2929670-1-vladimir.oltean@nxp.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-02-17 10:35:19 +01:00
Willem de Bruijn
0b42ab0783 udp: fix skb_copy_and_csum_datagram with odd segment sizes
commit 52cbd23a119c6ebf40a527e53f3402d2ea38eccb upstream.

When iteratively computing a checksum with csum_block_add, track the
offset "pos" to correctly rotate in csum_block_add when offset is odd.

The open coded implementation of skb_copy_and_csum_datagram did this.
With the switch to __skb_datagram_iter calling csum_and_copy_to_iter,
pos was reinitialized to 0 on each call.

Bring back the pos by passing it along with the csum to the callback.

Changes v1->v2
  - pass csum value, instead of csump pointer (Alexander Duyck)

Link: https://lore.kernel.org/netdev/20210128152353.GB27281@optiplex/
Fixes: 950fcaecd5 ("datagram: consolidate datagram copy to iter helpers")
Reported-by: Oliver Graute <oliver.graute@gmail.com>
Signed-off-by: Willem de Bruijn <willemb@google.com>
Reviewed-by: Alexander Duyck <alexanderduyck@fb.com>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Link: https://lore.kernel.org/r/20210203192952.1849843-1-willemdebruijn.kernel@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-02-17 10:35:19 +01:00
David Howells
73bc75fda6 rxrpc: Fix clearance of Tx/Rx ring when releasing a call
commit 7b5eab57cac45e270a0ad624ba157c5b30b3d44d upstream.

At the end of rxrpc_release_call(), rxrpc_cleanup_ring() is called to clear
the Rx/Tx skbuff ring, but this doesn't lock the ring whilst it's accessing
it.  Unfortunately, rxrpc_resend() might be trying to retransmit a packet
concurrently with this - and whilst it does lock the ring, this isn't
protection against rxrpc_cleanup_call().

Fix this by removing the call to rxrpc_cleanup_ring() from
rxrpc_release_call().  rxrpc_cleanup_ring() will be called again anyway
from rxrpc_cleanup_call().  The earlier call is just an optimisation to
recycle skbuffs more quickly.

Alternative solutions include rxrpc_release_call() could try to cancel the
work item or wait for it to complete or rxrpc_cleanup_ring() could lock
when accessing the ring (which would require a bh lock).

This can produce a report like the following:

  BUG: KASAN: use-after-free in rxrpc_send_data_packet+0x19b4/0x1e70 net/rxrpc/output.c:372
  Read of size 4 at addr ffff888011606e04 by task kworker/0:0/5
  ...
  Workqueue: krxrpcd rxrpc_process_call
  Call Trace:
   ...
   kasan_report.cold+0x79/0xd5 mm/kasan/report.c:413
   rxrpc_send_data_packet+0x19b4/0x1e70 net/rxrpc/output.c:372
   rxrpc_resend net/rxrpc/call_event.c:266 [inline]
   rxrpc_process_call+0x1634/0x1f60 net/rxrpc/call_event.c:412
   process_one_work+0x98d/0x15f0 kernel/workqueue.c:2275
   ...

  Allocated by task 2318:
   ...
   sock_alloc_send_pskb+0x793/0x920 net/core/sock.c:2348
   rxrpc_send_data+0xb51/0x2bf0 net/rxrpc/sendmsg.c:358
   rxrpc_do_sendmsg+0xc03/0x1350 net/rxrpc/sendmsg.c:744
   rxrpc_sendmsg+0x420/0x630 net/rxrpc/af_rxrpc.c:560
   ...

  Freed by task 2318:
   ...
   kfree_skb+0x140/0x3f0 net/core/skbuff.c:704
   rxrpc_free_skb+0x11d/0x150 net/rxrpc/skbuff.c:78
   rxrpc_cleanup_ring net/rxrpc/call_object.c:485 [inline]
   rxrpc_release_call+0x5dd/0x860 net/rxrpc/call_object.c:552
   rxrpc_release_calls_on_socket+0x21c/0x300 net/rxrpc/call_object.c:579
   rxrpc_release_sock net/rxrpc/af_rxrpc.c:885 [inline]
   rxrpc_release+0x263/0x5a0 net/rxrpc/af_rxrpc.c:916
   __sock_release+0xcd/0x280 net/socket.c:597
   ...

  The buggy address belongs to the object at ffff888011606dc0
   which belongs to the cache skbuff_head_cache of size 232

Fixes: 248f219cb8 ("rxrpc: Rewrite the data and ack handling code")
Reported-by: syzbot+174de899852504e4a74a@syzkaller.appspotmail.com
Reported-by: syzbot+3d1c772efafd3c38d007@syzkaller.appspotmail.com
Signed-off-by: David Howells <dhowells@redhat.com>
cc: Hillf Danton <hdanton@sina.com>
Link: https://lore.kernel.org/r/161234207610.653119.5287360098400436976.stgit@warthog.procyon.org.uk
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-02-17 10:35:18 +01:00
Serge Semin
b90e8d5d28 usb: dwc3: ulpi: Replace CPU-based busyloop with Protocol-based one
commit fca3f138105727c3a22edda32d02f91ce1bf11c9 upstream

Originally the procedure of the ULPI transaction finish detection has been
developed as a simple busy-loop with just decrementing counter and no
delays. It's wrong since on different systems the loop will take a
different time to complete. So if the system bus and CPU are fast enough
to overtake the ULPI bus and the companion PHY reaction, then we'll get to
take a false timeout error. Fix this by converting the busy-loop procedure
to take the standard bus speed, address value and the registers access
mode into account for the busy-loop delay calculation.

Here is the way the fix works. It's known that the ULPI bus is clocked
with 60MHz signal. In accordance with [1] the ULPI bus protocol is created
so to spend 5 and 6 clock periods for immediate register write and read
operations respectively, and 6 and 7 clock periods - for the extended
register writes and reads. Based on that we can easily pre-calculate the
time which will be needed for the controller to perform a requested IO
operation. Note we'll still preserve the attempts counter in case if the
DWC USB3 controller has got some internals delays.

[1] UTMI+ Low Pin Interface (ULPI) Specification, Revision 1.1,
    October 20, 2004, pp. 30 - 36.

Fixes: 88bc9d194f ("usb: dwc3: add ULPI interface support")
Acked-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: Serge Semin <Sergey.Semin@baikalelectronics.ru>
Link: https://lore.kernel.org/r/20201210085008.13264-3-Sergey.Semin@baikalelectronics.ru
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-02-17 10:35:18 +01:00
Felipe Balbi
35834bf0b2 usb: dwc3: ulpi: fix checkpatch warning
commit 2a499b45295206e7f3dc76edadde891c06cc4447 upstream

no functional changes.

Signed-off-by: Felipe Balbi <balbi@kernel.org>
Signed-off-by: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-02-17 10:35:18 +01:00