Commit Graph

1106691 Commits

Author SHA1 Message Date
Eli Cohen
48a36966fc UPSTREAM: vdpa/mlx5: Update Control VQ callback information
The control VQ specific information is stored in the dedicated struct
mlx5_control_vq. When the callback is updated through
mlx5_vdpa_set_vq_cb(), make sure to update the control VQ struct.

Fixes: 5262912ef3 ("vdpa/mlx5: Add support for control VQ and MAC setting")
Signed-off-by: Eli Cohen <elic@nvidia.com>
Message-Id: <20220613075958.511064-1-elic@nvidia.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Jason Wang <jasowang@redhat.com)
(cherry picked from commit 40f2f3e941)
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I4ef42d0ff2f8b3e5156b54473ebc5ebb877c22d2
2022-07-01 20:24:03 +00:00
Jason Wang
3063325104 UPSTREAM: vdpa: make get_vq_group and set_group_asid optional
This patch makes get_vq_group and set_group_asid optional. This is
needed to unbreak the vDPA parent that doesn't support multiple
address spaces.

Cc: Gautam Dawar <gautam.dawar@xilinx.com>
Fixes: aaca8373c4 ("vhost-vdpa: support ASID based IOTLB API")
Signed-off-by: Jason Wang <jasowang@redhat.com>
Message-Id: <20220609041901.2029-1-jasowang@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
(cherry picked from commit 00d1f54647)
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I83cce7173bc7ec6dd00479932d5515bfacb50fe1
2022-07-01 20:24:03 +00:00
Bo Liu
b9e82f6f75 UPSTREAM: virtio: Fix all occurences of the "the the" typo
There are double "the" in message in file virtio_mmio.c
and virtio_pci_modern_dev.c, fix it.

Signed-off-by: Bo Liu <liubo03@inspur.com>
Message-Id: <20220609031106.2161-1-liubo03@inspur.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
(cherry picked from commit acb0055e18)
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I6fdd050cb1e41a7e1b396b3bfbbdcad011cae877
2022-07-01 20:24:03 +00:00
Xie Yongji
de5826385d UPSTREAM: vduse: Fix NULL pointer dereference on sysfs access
The control device has no drvdata. So we will get a
NULL pointer dereference when accessing control
device's msg_timeout attribute via sysfs:

[ 132.841881][ T3644] BUG: kernel NULL pointer dereference, address: 00000000000000f8
[ 132.850619][ T3644] RIP: 0010:msg_timeout_show (drivers/vdpa/vdpa_user/vduse_dev.c:1271)
[ 132.869447][ T3644] dev_attr_show (drivers/base/core.c:2094)
[ 132.870215][ T3644] sysfs_kf_seq_show (fs/sysfs/file.c:59)
[ 132.871164][ T3644] ? device_remove_bin_file (drivers/base/core.c:2088)
[ 132.872082][ T3644] kernfs_seq_show (fs/kernfs/file.c:164)
[ 132.872838][ T3644] seq_read_iter (fs/seq_file.c:230)
[ 132.873578][ T3644] ? __vmalloc_area_node (mm/vmalloc.c:3041)
[ 132.874532][ T3644] kernfs_fop_read_iter (fs/kernfs/file.c:238)
[ 132.875513][ T3644] __kernel_read (fs/read_write.c:440 (discriminator 1))
[ 132.876319][ T3644] kernel_read (fs/read_write.c:459)
[ 132.877129][ T3644] kernel_read_file (fs/kernel_read_file.c:94)
[ 132.877978][ T3644] kernel_read_file_from_fd (include/linux/file.h:45 fs/kernel_read_file.c:186)
[ 132.879019][ T3644] __do_sys_finit_module (kernel/module.c:4207)
[ 132.879930][ T3644] __ia32_sys_finit_module (kernel/module.c:4189)
[ 132.880930][ T3644] do_int80_syscall_32 (arch/x86/entry/common.c:112 arch/x86/entry/common.c:132)
[ 132.881847][ T3644] entry_INT80_compat (arch/x86/entry/entry_64_compat.S:419)

To fix it, don't create the unneeded attribute for
control device anymore.

Fixes: c8a6153b6c ("vduse: Introduce VDUSE - vDPA Device in Userspace")
Reported-by: kernel test robot <oliver.sang@intel.com>
Cc: stable@vger.kernel.org
Signed-off-by: Xie Yongji <xieyongji@bytedance.com>
Message-Id: <20220426073656.229-1-xieyongji@bytedance.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
(cherry picked from commit b27ee76c74)
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: Ib9abf1e60e0dad878ba20f2c2987c443476925e9
2022-07-01 20:24:03 +00:00
Xie Yongji
fa4bbdf264 UPSTREAM: vringh: Fix loop descriptors check in the indirect cases
We should use size of descriptor chain to test loop condition
in the indirect case. And another statistical count is also introduced
for indirect descriptors to avoid conflict with the statistical count
of direct descriptors.

Fixes: f87d0fbb57 ("vringh: host-side implementation of virtio rings.")
Signed-off-by: Xie Yongji <xieyongji@bytedance.com>
Signed-off-by: Fam Zheng <fam.zheng@bytedance.com>
Message-Id: <20220505100910.137-1-xieyongji@bytedance.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Jason Wang <jasowang@redhat.com>
(cherry picked from commit dbd29e0752)
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I989cc3d74401507f6b9c282971e60ecb21785895
2022-07-01 20:24:03 +00:00
Dan Carpenter
6e2a35571a UPSTREAM: vdpa/mlx5: clean up indenting in handle_ctrl_vlan()
These lines were supposed to be indented.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Message-Id: <Yp71IYMP+QfuCJ8t@kili>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Eli Cohen <elic@nvidia.com>
Acked-by: Si-Wei Liu <si-wei.liu@oracle.com>
(cherry picked from commit f38b3c6a78)
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I92310051004e413b6ffbf9f89e7e4ce939614fcf
2022-07-01 20:24:03 +00:00
Dan Carpenter
acdb4bfe37 UPSTREAM: vdpa/mlx5: fix error code for deleting vlan
Return success if we were able to delete a vlan.  The current code
always returns failure.

Fixes: baf2ad3f6a ("vdpa/mlx5: Add RX MAC VLAN filter support")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Message-Id: <Yp709f1g9NcMBCHg@kili>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Eli Cohen <elic@nvidia.com>
Acked-by: Si-Wei Liu <si-wei.liu@oracle.com>
(cherry picked from commit f766c409fc)
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: Ibaa57311cd2e123688f6261dc09bb547dd82c504
2022-07-01 20:24:03 +00:00
chengkaitao
2e977b72c0 UPSTREAM: virtio-mmio: fix missing put_device() when vm_cmdline_parent registration failed
The reference must be released when device_register(&vm_cmdline_parent)
failed. Add the corresponding 'put_device()' in the error handling path.

Signed-off-by: chengkaitao <pilgrimtao@gmail.com>
Message-Id: <20220602005542.16489-1-chengkaitao@didiglobal.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Jason Wang <jasowang@redhat.com>
(cherry picked from commit a58a7f97ba)
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I6ccf7cba3458dd3402ce0bb39d2b110a599ad7ee
2022-07-01 20:24:03 +00:00
Xiang wangx
5571a91668 UPSTREAM: vdpa/mlx5: Fix syntax errors in comments
Delete the redundant word 'is'.

Signed-off-by: Xiang wangx <wangxiang@cdjrlc.com>
Message-Id: <20220604143858.16073-1-wangxiang@cdjrlc.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Jason Wang <jasowang@redhat.com>
(cherry picked from commit 2f72b2262d)
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I3a2338d51fc8c4b6e710c454c5b788cdc94fdde5
2022-07-01 20:24:03 +00:00
Jason Wang
a93860cda4 UPSTREAM: virtio-rng: make device ready before making request
Current virtio-rng does a entropy request before DRIVER_OK, this
violates the spec:

virtio spec requires that all drivers set DRIVER_OK
before using devices.

Further, kernel will ignore the interrupt after commit
8b4ec69d7e ("virtio: harden vring IRQ").

Fixing this by making device ready before the request.

Cc: stable@vger.kernel.org
Fixes: 8b4ec69d7e ("virtio: harden vring IRQ")
Fixes: f7f510ec19 ("virtio: An entropy device, as suggested by hpa.")
Reported-and-tested-by: syzbot+5b59d6d459306a556f54@syzkaller.appspotmail.com
Signed-off-by: Jason Wang <jasowang@redhat.com>
Message-Id: <20220608061422.38437-1-jasowang@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Laurent Vivier <lvivier@redhat.com>
(cherry picked from commit 228432551b)
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I09cf4df29b345372b484efe098af670709d6e739
2022-07-01 20:24:03 +00:00
Vincent Whitchurch
fe925e7db4 UPSTREAM: um: virt-pci: set device ready in probe()
Call virtio_device_ready() to make this driver work after commit
b4ec69d7e09 ("virtio: harden vring IRQ"), since the driver uses the
virtqueues in the probe function.  (The virtio core sets the device
ready when probe returns.)

Fixes: 8b4ec69d7e ("virtio: harden vring IRQ")
Fixes: 68f5d3f3b6 ("um: add PCI over virtio emulation driver")
Signed-off-by: Vincent Whitchurch <vincent.whitchurch@axis.com>
Message-Id: <20220610151203.3492541-1-vincent.whitchurch@axis.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Tested-by: Johannes Berg <johannes@sipsolutions.net>
(cherry picked from commit eacea84459)
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: If175f1a6a10e3f53afa89b9ae3f98cd6e6f99823
2022-07-01 20:24:03 +00:00
Treehugger Robot
93b7970e26 Merge "Merge 6e5f6a8691 ("Merge tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost") into android-mainline" into android-mainline 2022-07-01 20:24:03 +00:00
Greg Kroah-Hartman
665530475d Merge 6e5f6a8691 ("Merge tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost") into android-mainline
Steps on the way to 5.19-rc1

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: Iacbded03d6aa9a6d729d5bcf6fa6eed7a96a1d09
2022-07-01 15:36:01 +02:00
Greg Kroah-Hartman
435497317d Merge be83f04d25 ("virtio: allow to unbreak virtqueue") into android-mainline
Steps on the way to 5.19-rc1

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: Icfc6cca8e0cb5f02deb28f60ea448f1133934bf4
2022-07-01 15:30:27 +02:00
Greg Kroah-Hartman
cb3b6474ab Merge 3a232277c1 ("virtio-ccw: implement synchronize_cbs()") into android-mainline
Steps on the way to 5.19-rc1

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I633944b3c3bc1ba0a58de16f575ebfadb72e9368
2022-07-01 11:40:35 +02:00
Greg Kroah-Hartman
118bfb38c8 Merge bda324fd03 ("vdpasim: control virtqueue support") into android-mainline
Steps on the way to 5.19-rc1

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I6572031ce09e545a8bc5058be67fc96ee6aafc5a
2022-07-01 11:18:03 +02:00
Greg Kroah-Hartman
547d254a9d Merge 6f6ebb9899 ("Merge tag 'sound-fix-5.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound") into android-mainline
Steps on the way to 5.19-rc1

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: Ibc7c8044476080b3a65d2cef9e3cb47f9a7588d6
2022-07-01 09:19:55 +02:00
Greg Kroah-Hartman
9b051650de Merge ab18b7b36a ("Merge tag 'drm-next-2022-06-03-1' of git://anongit.freedesktop.org/drm/drm") into android-mainline
Steps on the way to 5.19-rc1

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: Ie3b5aa18baf83505c953f59bb69070b4889a43c0
2022-07-01 09:19:45 +02:00
Greg Kroah-Hartman
6ecbbf3e5b Merge 50fd82b3a9 ("Merge tag 'docs-5.19-2' of git://git.lwn.net/linux") into android-mainline
Steps on the way to 5.19-rc1

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: Iaa2ffd8855335610547c83dcae56184d8f2c7429
2022-07-01 09:19:35 +02:00
Greg Kroah-Hartman
1ac03d8954 Merge baf86ac1c9 ("Merge tag 'asm-generic-fixes-5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/arnd/asm-generic") into android-mainline
Steps on the way to 5.19-rc1

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I4e0c08cd408e606c1616fc0fc200a137b0aab82b
2022-07-01 09:19:22 +02:00
Carlos Llamas
88b166cbf2 ANDROID: gki_defconfig: enable IPV6_MROUTE
Enable support for IPv6 multicast forwarding, required for devices with
border routing capabilities. Note this option will likely be unset after
making ipv6 a GKI module.

Bug: 233821827
Signed-off-by: Carlos Llamas <cmllamas@google.com>
Change-Id: I0ffabbe21373ac23bc353abda51862eba0135972
2022-06-30 13:45:46 +00:00
Guenter Roeck
d196788eda UPSTREAM: watchdog: gxp: Add missing MODULE_LICENSE
The build system says:

ERROR: modpost: missing MODULE_LICENSE() in drivers/watchdog/gxp-wdt.o

Add the missing MODULE_LICENSE.

Signed-off-by: Nick Hawkins <nick.hawkins@hpe.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Link: https://lore.kernel.org/all/20220603131419.2948578-1-linux@roeck-us.net/
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
(cherry picked from commit b6c8cd80ac)
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I517f21913374a6608e07462a319a0e07297b4e46
2022-06-29 20:18:55 +02:00
Greg Kroah-Hartman
df7fb96b9f Merge 09a018176b ("Merge tag 'arm-late-5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc") into android-mainline
Steps on the way to 5.19-rc1

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I4973ce3f484afda5c90d1339cd4a8d68a8a8e769
2022-06-29 20:18:45 +02:00
Greg Kroah-Hartman
5c4ea62dc8 Merge 96479c0980 ("Merge tag 'arm-multiplatform-5.19-2' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc") into android-mainline
Steps on the way to 5.19-rc1

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: Iad78a06b49ccde43bbb7becad2c0364502b48bb1
2022-06-29 20:12:12 +02:00
Greg Kroah-Hartman
606ba5ace0 Merge 58f9d52ff6 ("Merge tag 'net-5.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net") into android-mainline
Steps on the way to 5.19-rc1

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I2cd84319e175aa95ce9cff4402f6a67915afe321
2022-06-29 20:11:22 +02:00
Greg Kroah-Hartman
2f60073848 Merge c399c85d60 ("Merge tag 'pci-v5.19-fixes-1' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci") into android-mainline
Steps on the way to 5.19-rc1

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I607f68c16c324952bf04ead11244d03b7502f25a
2022-06-29 20:10:27 +02:00
Greg Kroah-Hartman
6de0a2769e ANDROID: add drivers/leds/rgb/leds-qcom-lpg.ko to db845c module list
Add the drivers/leds/rgb/leds-qcom-lpg.ko driver to the list of modules
that the db845c build needs as it is now upstream and actually builds.

Fixes: 24e2d05d1b ("leds: Add driver for Qualcomm LPG")
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I5bb6ffe688c5c9fe85313d1d7302d248789508ab
2022-06-29 20:08:57 +02:00
Greg Kroah-Hartman
93be1a4d85 Merge 2a5699b0de ("Merge tag 'leds-5.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/pavel/linux-leds") into android-mainline
Steps on the way to 5.19-rc1

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I3b0bc701c0ec7f1955eea15157753b6f377fc7a6
2022-06-29 20:01:26 +02:00
Greg Kroah-Hartman
78dcf9434c Merge f8a52af9d0 ("Merge tag 'i2c-for-5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux") into android-mainline
Steps on the way to 5.19-rc1

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I7a6f4006a216fc4828361ba7ec74e6a8e3849877
2022-06-29 20:00:36 +02:00
Greg Kroah-Hartman
f7eff2dfa2 Merge 3cc30140db ("Merge tag 'pci-v5.19-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci") into android-mainline
Steps on the way to 5.19-rc1

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I99872c1974ace8515cd56e274f7aff16f32cbfaa
2022-06-29 08:35:04 +02:00
Greg Kroah-Hartman
ddaec487a3 ANDROID: gki_defconfig: reorder some mm config options
Commit 0710d0122a ("mm: Kconfig: reorganize misplaced mm options")
reorginized the mm config options a bit, so the gki_defconfig options
also need to be reordered so that the build succeeds.

Fixes: 0710d0122a ("mm: Kconfig: reorganize misplaced mm options")
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: Ic4228bc9498258e0d184daeac482c79253843b83
2022-06-29 08:33:09 +02:00
Greg Kroah-Hartman
e2d2ecb4d6 Merge 8291eaafed ("Merge tag 'mm-stable-2022-05-27' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm") into android-mainline
Steps on the way to 5.19-rc1

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: Ibe6f82bf687972be4683e20f8df7bddce7cd8422
2022-06-29 08:29:52 +02:00
Greg Kroah-Hartman
8fd8d8e717 Merge 77fb622de1 ("Merge tag 'mm-hotfixes-stable-2022-05-27' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm") into android-mainline
Steps on the way to 5.19-rc1

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I18601ada1139de6e701d0ba9a34c45ad1d8c4f77
2022-06-28 15:33:45 +02:00
Greg Kroah-Hartman
ddb98226ac ANDROID: remove CONFIG_USELIB from x86 gki_defconfig
In commit 7374fa33dc ("init/Kconfig: remove USELIB syscall by
default") CONFIG_USELIB is disabled, so remove the "is not set" setting
in the x86 gki_defconfig file to resolve the build issue.

Fixes: 7374fa33dc ("init/Kconfig: remove USELIB syscall by default")
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: If7565bffb90b2efd913f08a8aeccbb11cc77ac17
2022-06-28 15:31:27 +02:00
Greg Kroah-Hartman
3b390fba1d Merge 6f664045c8 ("Merge tag 'mm-nonmm-stable-2022-05-26' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm") into android-mainline
Steps on the way to 5.19-rc1

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I477b976bc22189a1d052d6c3d2773966a1128eaa
2022-06-28 14:54:22 +02:00
Greg Kroah-Hartman
cc910b9eaa Merge 7e284070ab ("Merge tag 'for-5.19/dm-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm") into android-mainline
Steps on the way to 5.19-rc1

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I9981265de6b27657eaaf51bd1fa19ce0ce9f2cc6
2022-06-28 14:52:55 +02:00
Greg Kroah-Hartman
f5794dc184 Revert "Revert "Revert "Revert "ANDROID: GKI: Add module load time protected symbol lookup""""
This reverts commit 090a1da697.

It brings it back now that we have merged around the problem area.

Bug: 200082547
Bug: 214445388
Cc: Ramji Jiyani <ramjiyani@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: Iaa69221f341bf2face454ec0452efff2cbba9042
2022-06-28 12:55:56 +02:00
Greg Kroah-Hartman
8246e1a92f Merge ef98f9cfe2 ("Merge tag 'modules-5.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/linux") into android-mainline
Steps on the way to 5.19-rc1

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I83fd30737a60ed30a735742c2f6f17a13fea0bbe
2022-06-28 11:53:33 +02:00
Greg Kroah-Hartman
090a1da697 Revert "Revert "Revert "ANDROID: GKI: Add module load time protected symbol lookup"""
This reverts commit 5ffc4c2275.

It conflicts in bad ways with the module code changes in 5.19-rc1 so
revert it for now.  If it is still needed, it can be added back later.

Bug: 200082547
Bug: 214445388
Cc: Ramji Jiyani <ramjiyani@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: Ibf0b85c355cfc3e1a45c213a131a12c9e3061349
2022-06-28 11:52:40 +02:00
Greg Kroah-Hartman
40d350b483 Revert "ANDROID: GKI: Disable security lockdown for unsigned modules"
This reverts commit befc75e758.

It conflicts in bad ways with the module code changes in 5.19-rc1 so
revert it for now.  If it is still needed, it can be added back in
later.

Bug: 200082547
Bug: 214445388
Cc: Ramji Jiyani <ramjiyani@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: Ice884d241ae153a75facc1ca409ea5c59653cde3
2022-06-28 09:44:28 +02:00
Greg Kroah-Hartman
c0199c0154 Revert "ANDROID: module: Add vendor hook"
This reverts commit 5ebe162306.

It causes lots of conflicts in the 5.19-rc1 merge due to the rewrite and
movement of the module core code.  If this is still needed, it can be
added back later.

Bug: 181639260
Cc: Kuan-Ying Lee <Kuan-Ying.Lee@mediatek.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I742e7ef56c2dd7a9b6c9c296dc9f96bced84bc7c
2022-06-28 09:44:08 +02:00
Jing-Ting Wu
a024fc656b ANDROID: sched: add vendor hook to set_cpus_allowed
Add new vendor hook when set affinity to detect task status
for performance tuning.

Bug: 236775946
Change-Id: I407637c85e2ea93585877312f090981fee848979
Signed-off-by: Jing-Ting Wu <Jing-Ting.Wu@mediatek.com>
2022-06-24 12:13:17 +08:00
Nathan Chancellor
483887d651 ANDROID: Incremental fs: Use ERR_CAST in handle_mapped_file()
When building android-mainline with a version of clang that supports
CONFIG_RANDSTRUCT, there are errors about casts from randomized
structures to non-randomized structures:

  fs/incfs/data_mgmt.c:240:10: error: casting from randomized structure pointer type 'struct dentry *' to 'struct data_file *'
                  return (struct data_file *)index_file_dentry;
                         ^
  fs/incfs/data_mgmt.c:257:12: error: casting from randomized structure pointer type 'struct file *' to 'struct data_file *'
                  result = (struct data_file *)bf;
                           ^
  2 errors generated.

As suggested by Kees on aosp/1995750, these casts should actually be
using the ERR_CAST macro, which is a more proper way to pass error
pointers around.

Change-Id: Iab73ac7503235f1147154a01a22ab8608e3daf8b
Fixes: 3f4938108a ("ANDROID: Incremental fs: Create mapped file")
Link: https://github.com/ClangBuiltLinux/linux/issues/1652
Suggested-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
2022-06-23 12:54:22 -07:00
Riccardo Paolo Bestetti
0f0ddc32df UPSTREAM: ipv4: ping: fix bind address validity check
Commit 8ff978b8b2 ("ipv4/raw: support binding to nonlocal addresses")
introduced a helper function to fold duplicated validity checks of bind
addresses into inet_addr_valid_or_nonlocal(). However, this caused an
unintended regression in ping_check_bind_addr(), which previously would
reject binding to multicast and broadcast addresses, but now these are
both incorrectly allowed as reported in [1].

This patch restores the original check. A simple reordering is done to
improve readability and make it evident that multicast and broadcast
addresses should not be allowed. Also, add an early exit for INADDR_ANY
which replaces lost behavior added by commit 0ce779a9f5 ("net: Avoid
unnecessary inet_addr_type() call when addr is INADDR_ANY").

Furthermore, this patch introduces regression selftests to catch these
specific cases.

[1] https://lore.kernel.org/netdev/CANP3RGdkAcDyAZoT1h8Gtuu0saq+eOrrTiWbxnOs+5zn+cpyKg@mail.gmail.com/

Fixes: 8ff978b8b2 ("ipv4/raw: support binding to nonlocal addresses")
Cc: Miaohe Lin <linmiaohe@huawei.com>
Reported-by: Maciej Żenczykowski <maze@google.com>
Signed-off-by: Carlos Llamas <cmllamas@google.com>
Signed-off-by: Riccardo Paolo Bestetti <pbl@bestov.io>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit b4a028c4d0)

Bug: 235430656
Test: atest vts_kernel_net_tests
Signed-off-by: Carlos Llamas <cmllamas@google.com>
Change-Id: I8ac173422e2a1aec1f69d7bca8253b045c80371e
2022-06-23 16:16:33 +00:00
Greg Kroah-Hartman
593e016519 Merge 44d35720c9 ("Merge tag 'sysctl-5.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/linux") into android-mainline
Steps on the way to 5.19-rc1

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I18505aae180d7c54ac425efd2c60fefc47e0b1e4
2022-06-22 08:38:40 +02:00
Baolin Wang
7c7c59ca51 UPSTREAM: arm64/hugetlb: Fix building errors in huge_ptep_clear_flush()
Fix the arm64 build error which was caused by commit ae07562909 ("mm:
change huge_ptep_clear_flush() to return the original pte") interacting
with commit fb396bb459 ("arm64/hugetlb: Drop TLB flush from
get_clear_flush()"):

  arch/arm64/mm/hugetlbpage.c: In function ‘huge_ptep_clear_flush’:
  arch/arm64/mm/hugetlbpage.c:515:9: error: implicit declaration of function ‘get_clear_flush’; did you mean ‘ptep_clear_flush’? [-Werror=implicit-function-declaration]
    515 |  return get_clear_flush(vma->vm_mm, addr, ptep, pgsize, ncontig);
        |         ^~~~~~~~~~~~~~~
        |         ptep_clear_flush

Due to the new get_clear_contig() has dropped TLB flush, we should add
an explicit TLB flush in huge_ptep_clear_flush() to keep original
semantics when changing to use new get_clear_contig().

Fixes: fb396bb459 ("arm64/hugetlb: Drop TLB flush from get_clear_flush()").
Fixes: ae07562909 ("mm: change huge_ptep_clear_flush() to return the original pte")
Reported-and-tested-by: Linux Kernel Functional Testing <lkft@linaro.org>
Reported-by: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
Suggested-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Baolin Wang <baolin.wang@linux.alibaba.com>
Reviewed-by: Gavin Shan <gshan@redhat.com>
Reviewed-by: Anshuman Khandual <anshuman.khandual@arm.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Anshuman Khandual <anshuman.khandual@arm.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
(cherry picked from commit e68b823ab0)
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I31fbc8728fbd3b108343b71e29f281c6d408b7f9
2022-06-22 06:34:46 +00:00
Greg Kroah-Hartman
a0cfb5ab27 ANDROID: fix up gki_defconfig files due to Kconfig movements
Commit 006477f40d ("kconfig: move the "Executable file formats" menu
to fs/Kconfig.binfmt") moved the Kconfig order around a bit, which
messed with the checking of the gki_defconfig files by the build system.

Also the ZSMALLOC=m requirement went away with commit 6140ae41ef
("zram: fix Kconfig dependency warning") and it is still enabled.

Fix all of these up by reordering some of the config options.

Fixes: 006477f40d ("kconfig: move the "Executable file formats" menu to fs/Kconfig.binfmt")
Fixes: 6140ae41ef ("zram: fix Kconfig dependency warning")
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: Ibd807dae4cc50999838f4471f4f144e6cdb41db1
2022-06-22 06:34:46 +00:00
Greg Kroah-Hartman
8916d060d7 Merge "Merge 98931dd95f ("Merge tag 'mm-stable-2022-05-25' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm") into android-mainline" into android-mainline 2022-06-22 06:34:46 +00:00
Michal Kubecek
e0fa54c93d UPSTREAM: Revert "net: af_key: add check for pfkey_broadcast in function pfkey_process"
This reverts commit 4dc2a5a8f6.

A non-zero return value from pfkey_broadcast() does not necessarily mean
an error occurred as this function returns -ESRCH when no registered
listener received the message. In particular, a call with
BROADCAST_PROMISC_ONLY flag and null one_sk argument can never return
zero so that this commit in fact prevents processing any PF_KEY message.
One visible effect is that racoon daemon fails to find encryption
algorithms like aes and refuses to start.

Excluding -ESRCH return value would fix this but it's not obvious that
we really want to bail out here and most other callers of
pfkey_broadcast() also ignore the return value. Also, as pointed out by
Steffen Klassert, PF_KEY is kind of deprecated and newer userspace code
should use netlink instead so that we should only disturb the code for
really important fixes.

v2: add a comment explaining why is the return value ignored

Signed-off-by: Michal Kubecek <mkubecek@suse.cz>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
(cherry picked from commit 9c90c9b3e5)

Bug: 235430656
Test: TreeHugger, fixes failures in Android net-test wrt. pf_key.
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Signed-off-by: Carlos Llamas <cmllamas@google.com>
Change-Id: I173e37a840be187cb471a97b450b9fa06842497d
2022-06-21 20:46:18 +00:00
Greg Kroah-Hartman
1878ac5f64 Merge 98931dd95f ("Merge tag 'mm-stable-2022-05-25' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm") into android-mainline
Steps on the way to 5.19-rc1

Resolves merge conflict in:
	fs/proc/base.c
	mm/util.c

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I55d6d0cadb4dbd0f978a1e7d14444068bd050a7c
2022-06-21 18:17:43 +02:00