Commit Graph

1061627 Commits

Author SHA1 Message Date
Lee Jones
01566e583b ANDROID: usb: gadget: f_accessory: Mitgate handling of non-existent USB request
Prevents mishandling USB requests that are no longer present.

Bug: 161010552
Fixes: 483cb5629e ("ANDROID: usb: gadget: f_accessory: Add Android Accessory function")
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Change-Id: I8ff24d6d49214c3bd10a1b5d5e72814ec2a91c61
2021-11-25 11:57:31 +00:00
Greg Kroah-Hartman
637babf71a Merge 5f53fa508d ("Merge tag 'for-5.16/parisc-5' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux") into android-mainline
Steps on the way to 5.16-rc3

Resolves conflicts in:
	drivers/hid/hid-nintendo.c
due to the android tree sticking with the old version of this driver.

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I0a4f24f71ee4eb095a5b24a547de33931ecb3922
2021-11-25 08:34:32 +01:00
Linus Torvalds
5f53fa508d Merge tag 'for-5.16/parisc-5' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux
Pull parisc fixes from Helge Deller:
 "Increase the FRAME_WARN value to avoid some new warnings which showed
  up in the Linux kernel test project, revert a patch which moved the
  _stext symbol and thus tiggered errors in the hardened usercopy
  checks, and introduce an extru_safe() assembler macro to overcome
  possible unsafe usage of the extru asm statement on 64-bit PA2.0
  machines"

* tag 'for-5.16/parisc-5' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux:
  Revert "parisc: Fix backtrace to always include init funtion names"
  parisc: Convert PTE lookup to use extru_safe() macro
  parisc: Fix extraction of hash lock bits in syscall.S
  parisc: Provide an extru_safe() macro to extract unsigned bits
  parisc: Increase FRAME_WARN to 2048 bytes on parisc
2021-11-24 09:55:24 -08:00
Linus Torvalds
29889216be Merge tag 'trace-v5.16-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace
Pull tracing fix from Steven Rostedt:
 "Fix wrong uprobe variable in iterator

  uprobe_perf_open() processes a list of probes, but due to a missing
  setting of the uprobe to be processed, the loop processes the head
  probe instead of the added probes"

* tag 'trace-v5.16-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace:
  tracing/uprobe: Fix uprobe_perf_open probes iteration
2021-11-24 09:51:22 -08:00
Linus Torvalds
740bebf421 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/hid/hid
Pull HID fixes from Jiri Kosina:

 - fix for Intel-ISH driver to make sure it gets aoutoloaded only on
   matching devices and not universally (Thomas Weißschuh)

 - fix for Wacom driver reporting invalid contact under certain
   circumstances (Jason Gerecke)

 - probing fix for ft260 dirver (Michael Zaidman)

 - fix for generic keycode remapping (Thomas Weißschuh)

 - fix for division by zero in hid-magicmouse (Claudia Pellegrino)

 - other tiny assorted fixes and new device IDs

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/hid/hid:
  HID: multitouch: Fix Iiyama ProLite T1931SAW (0eef:0001 again!)
  HID: nintendo: eliminate dead datastructures in !CONFIG_NINTENDO_FF case
  HID: magicmouse: prevent division by 0 on scroll
  HID: thrustmaster: fix sparse warnings
  HID: Ignore battery for Elan touchscreen on HP Envy X360 15-eu0xxx
  HID: input: set usage type to key on keycode remap
  HID: input: Fix parsing of HID_CP_CONSUMER_CONTROL fields
  HID: ft260: fix i2c probing for hwmon devices
  Revert "HID: hid-asus.c: Maps key 0x35 (display off) to KEY_SCREENLOCK"
  HID: intel-ish-hid: fix module device-id handling
  mod_devicetable: fix kdocs for ishtp_device_id
  HID: wacom: Use "Confidence" flag to prevent reporting invalid contacts
  HID: nintendo: unlock on error in joycon_leds_create()
  platform/x86: isthp_eclite: only load for matching devices
  platform/chrome: chros_ec_ishtp: only load for matching devices
  HID: intel-ish-hid: hid-client: only load for matching devices
  HID: intel-ish-hid: fw-loader: only load for matching devices
  HID: intel-ish-hid: use constants for modaliases
  HID: intel-ish-hid: add support for MODULE_DEVICE_TABLE()
2021-11-24 09:44:13 -08:00
Greg Kroah-Hartman
036d1f1a3a Merge 5d9f4cf367 ("Merge tag 'selinux-pr-20211123' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/selinux") into android-mainline
Steps on the way to 5.16-rc3

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I25b2cd43afa4a1cc577c304f3addb50e59a34616
2021-11-24 09:41:51 +01:00
Jiri Olsa
1880ed71ce tracing/uprobe: Fix uprobe_perf_open probes iteration
Add missing 'tu' variable initialization in the probes loop,
otherwise the head 'tu' is used instead of added probes.

Link: https://lkml.kernel.org/r/20211123142801.182530-1-jolsa@kernel.org

Cc: stable@vger.kernel.org
Fixes: 99c9a923e9 ("tracing/uprobe: Fix double perf_event linking on multiprobe uprobe")
Acked-by: Masami Hiramatsu <mhiramat@kernel.org>
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
2021-11-23 20:52:01 -05:00
Linus Torvalds
5d9f4cf367 Merge tag 'selinux-pr-20211123' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/selinux
Pull SELinux fix from Paul Moore:
 "A fix to make sure things are handled correctly when an allocation
  fails"

* tag 'selinux-pr-20211123' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/selinux:
  selinux: fix NULL-pointer dereference when hashtab allocation fails
2021-11-23 13:59:54 -08:00
Greg Kroah-Hartman
405c35985e Merge tag 'v5.16-rc2' into android-mainline
Linux 5.16-rc2

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I4b24ca873f1734a69765a30d09317e62a459e39f
2021-11-23 19:21:22 +01:00
Linus Torvalds
b735936289 Merge tag 'sound-5.16-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound
Pull sound fixes from Takashi Iwai:
 "A lot of small changes at this time.

  There are many ASoC fixes, and the majority of them are new machine
  quirks for Intel platforms, as well as the device-specific fixes for
  Mediatek and Qualcomm.

  In addition, a regression fix for USB-audio and a few more HD- and
  USB-audio quirks are found here"

* tag 'sound-5.16-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (41 commits)
  ALSA: intel-dsp-config: add quirk for JSL devices based on ES8336 codec
  ALSA: usb-audio: Don't start stream for capture at prepare
  ALSA: usb-audio: Switch back to non-latency mode at a later point
  ALSA: ctxfi: Fix out-of-range access
  ALSA: hda/realtek: Fix LED on HP ProBook 435 G7
  ASoC: stm32: i2s: fix 32 bits channel length without mclk
  ASoC: codecs: lpass-rx-macro: fix HPHR setting CLSH mask
  ASoC: codecs: wcd934x: return error code correctly from hw_params
  ASoC: codecs: wcd938x: fix volatile register range
  ASoC: topology: Add missing rwsem around snd_ctl_remove() calls
  ASoC: qdsp6: q6routing: validate port id before setting up route
  ASoC: qdsp6: q6adm: improve error reporting
  ASoC: qdsp6: q6asm: fix q6asm_dai_prepare error handling
  ASoC: qdsp6: q6routing: Conditionally reset FrontEnd Mixer
  ASoC: qdsp6: qdsp6: q6prm: handle clk disable correctly
  ASoC: wm_adsp: wm_adsp_control_add() error: uninitialized symbol 'ret'
  ALSA: cmipci: Drop stale variable assignment
  ALSA: hda/realtek: Add quirk for ASRock NUC Box 1100
  ASoC: rsnd: fixup DMAEngine API
  ASoC: SOF: build compression interface into snd_sof.ko
  ...
2021-11-23 09:10:08 -08:00
Greg Kroah-Hartman
b015997e09 Merge tag 'v5.16-rc1' into android-mainline
Linux 5.16-rc1

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: If7e029e7a7b36540080ec5e13be27168b532d78b
2021-11-23 15:11:20 +01:00
Greg Kroah-Hartman
540b9a8745 Merge ce49bfc8d0 ("Merge tag 'xfs-5.16-merge-5' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux") into android-mainline
Steps on the way to 5.16-rc1

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I03bc7862ca1ffe8544cecc558e041c195587519e
2021-11-23 13:13:31 +01:00
Greg Kroah-Hartman
552f552b62 Merge 6ea45c57dc ("Merge tag 'for-linus' of git://git.armlinux.org.uk/~rmk/linux-arm") into android-mainline
Steps on the way to 5.16-rc1

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I262e86e93047183d4e7a5ee7918b4670af46683d
2021-11-23 13:09:33 +01:00
Greg Kroah-Hartman
fcd6252179 Revert "ANDROID: GKI: update Kconfig options for CONFIG_PREEMPT"
This reverts commit 3d1f7b2753 as it is no
longer needed because the config options got renamed back (thankfully)
in commit a8b76910e4 ("preempt: Restore preemption model selection
configs")

Fixes: a8b76910e4 ("preempt: Restore preemption model selection configs")
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: Id51a4f54483cb39f99fb0e8242277c1e9c67a9e5
2021-11-23 12:47:31 +01:00
Greg Kroah-Hartman
50eb2817ff Merge fc661f2dcb ("Merge tag 'sched_urgent_for_v5.16_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip") into android-mainline
Steps on the way to 5.16-rc1

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I461d3530d3247c802a812bd117adb36f8cb8befa
2021-11-23 12:43:24 +01:00
Greg Kroah-Hartman
4634b7316f Merge f7018be292 ("Merge tag 'perf_urgent_for_v5.16_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip") into android-mainline
Steps on the way to 5.16-rc1

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: Ib09a014ec17915bf0b5559198639bdfbc321f696
2021-11-23 11:48:16 +01:00
Greg Kroah-Hartman
b258009529 ANDROID: Incremental fs: fix build due to zstd api changes
Commit cf30f6a5f0 ("lib: zstd: Add kernel-specific API") changed the
zstd api.  Given that the incfs code is not in the kernel tree, it was
not also converted so do that here to keep the build working properly.

Fixes: cf30f6a5f0 ("lib: zstd: Add kernel-specific API")
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I2e786a5e032adf104c0f3778bfb516a58c134047
2021-11-23 11:46:06 +01:00
Greg Kroah-Hartman
eb9fb76591 Merge c8c109546a ("Merge tag 'zstd-for-linus-v5.16' of git://github.com/terrelln/linux") into android-mainline
Steps on the way to 5.16-rc1

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: Id349473a6fd2fc6814b6fd7f6e72a2fb252b2a2c
2021-11-23 08:31:43 +01:00
Greg Kroah-Hartman
35aabe752a Merge ccfff0a2bd ("Merge tag 'virtio-mem-for-5.16' of git://github.com/davidhildenbrand/linux") into android-mainline
Steps on the way to 5.16-rc1

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I4b799e0446bd05dc0bdbf470cc27264bbf242f07
2021-11-23 08:29:09 +01:00
Linus Torvalds
c7756f3a32 Merge tag 'media/v5.16-2' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media
Pull media fixes from Mauro Carvalho Chehab:

 - fix VIDIOC_DQEVENT ioctl handling for 32-bit userspace with a 64-bit
   kernel

 - regression fix for videobuf2 core

 - fix for CEC core when handling non-block transmit

 - hi846: fix a clang warning

* tag 'media/v5.16-2' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media:
  media: hi846: remove the of_match_ptr macro
  media: hi846: include property.h instead of of_graph.h
  media: cec: copy sequence field for the reply
  media: videobuf2-dma-sg: Fix buf->vb NULL pointer dereference
  media: v4l2-core: fix VIDIOC_DQEVENT handling on non-x86
2021-11-22 14:58:57 -08:00
Nadav Amit
13e4ad2ce8 hugetlbfs: flush before unlock on move_hugetlb_page_tables()
We must flush the TLB before releasing i_mmap_rwsem to avoid the
potential reuse of an unshared PMDs page.  This is not true in the case
of move_hugetlb_page_tables().  The last reference on the page table can
therefore be dropped before the TLB flush took place.

Prevent it by reordering the operations and flushing the TLB before
releasing i_mmap_rwsem.

Fixes: 550a7d60bd ("mm, hugepages: add mremap() support for hugepage backed vma")
Signed-off-by: Nadav Amit <namit@vmware.com>
Reviewed-by: Mike Kravetz <mike.kravetz@oracle.com>
Cc: Mina Almasry <almasrymina@google.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2021-11-22 11:36:46 -08:00
Nadav Amit
a4a118f2ee hugetlbfs: flush TLBs correctly after huge_pmd_unshare
When __unmap_hugepage_range() calls to huge_pmd_unshare() succeed, a TLB
flush is missing.  This TLB flush must be performed before releasing the
i_mmap_rwsem, in order to prevent an unshared PMDs page from being
released and reused before the TLB flush took place.

Arguably, a comprehensive solution would use mmu_gather interface to
batch the TLB flushes and the PMDs page release, however it is not an
easy solution: (1) try_to_unmap_one() and try_to_migrate_one() also call
huge_pmd_unshare() and they cannot use the mmu_gather interface; and (2)
deferring the release of the page reference for the PMDs page until
after i_mmap_rwsem is dropeed can confuse huge_pmd_unshare() into
thinking PMDs are shared when they are not.

Fix __unmap_hugepage_range() by adding the missing TLB flush, and
forcing a flush when unshare is successful.

Fixes: 24669e5847 ("hugetlb: use mmu_gather instead of a temporary linked list for accumulating pages)" # 3.6
Signed-off-by: Nadav Amit <namit@vmware.com>
Reviewed-by: Mike Kravetz <mike.kravetz@oracle.com>
Cc: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2021-11-22 11:36:46 -08:00
Greg Kroah-Hartman
db58b6aabb Merge 0ecca62beb ("Merge tag 'ceph-for-5.16-rc1' of git://github.com/ceph/ceph-client") into android-mainline
Steps on the way to 5.16-rc1

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I5e3593fdc24a02373dbce7cdbc4125075af0c2ad
2021-11-22 19:34:26 +01:00
Greg Kroah-Hartman
dd71af6430 Revert "scsi: ufs: core: Add a compile-time structure size check"
This reverts commit 9a868c8ad3.

Currently breaks the build due to the modified Android UFS/Crypto
code, so revert this until it is worked out...

Cc: Eric Biggers <ebiggers@google.com>
Cc: Bart Van Assche <bvanassche@google.com>
Fixes: 9a868c8ad3 ("scsi: ufs: core: Add a compile-time structure size check")
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I8ad94a4c50d9d28fb21ce691dd6cb34090668b03
2021-11-22 19:25:38 +01:00
Greg Kroah-Hartman
c75b1d6ae3 Merge 6cbcc7ab21 ("Merge tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi") into android-mainline
Steps on the way to 5.16-rc1

Resolves conflicts in:
	drivers/scsi/ufs/ufshcd.c
	drivers/scsi/ufs/ufshcd.h

Will not build due to a static_assert() in the ufs code that will be
reverted in a later commit.

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I244662dad7bb84192c0762af96b53111375fa6c4
2021-11-22 19:22:06 +01:00
Greg Kroah-Hartman
34a7d77f09 Merge 030c28a021 ("Merge tag 'pwm/for-5.16-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/thierry.reding/linux-pwm") into android-mainline
Steps on the way to 5.16-rc1

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I01406692eb62722009e790aa79ed1ad029987441
2021-11-22 19:17:48 +01:00
Greg Kroah-Hartman
1a51d129e9 Merge 304ac8032d ("Merge tag 'drm-next-2021-11-12' of git://anongit.freedesktop.org/drm/drm") into android-mainline
Steps on the way to 5.16-rc1

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I3f8000defd61a1b1a67d578aa9ec9c0b0b9af39d
2021-11-22 19:13:30 +01:00
Greg Kroah-Hartman
bd12cf5f2c Revert "Revert "drm/virtio: implement context init: advertise feature to userspace""
This reverts commit 172272a5e9.

Should not be needed to be reverted anymore.

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I76fb807a7cd7bd8aad0f55f3d9394d2a2c5b2f7a
2021-11-22 19:12:47 +01:00
Greg Kroah-Hartman
d4fa9223d3 Revert "Revert "drm/virtio: implement context init: add virtio_gpu_fence_event""
This reverts commit e8a7240707.

Should not need to be reverted anymore.

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I02a86e831986a5e0a8e85f54df6443e66920996e
2021-11-22 19:12:17 +01:00
Greg Kroah-Hartman
64d2f9bc97 Merge f78e9de80f ("Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input") into android-mainline
Steps on the way to 5.16-rc1

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I78a89c32422b0b415dff9682ec10f464846c2c66
2021-11-22 19:06:45 +01:00
Greg Kroah-Hartman
3ba5988e21 Merge d422555f32 ("Merge tag 'pm-5.16-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm") into android-mainline
Steps on the way to 5.16-rc1

Resolves conflicts in:
	drivers/base/power/main.c

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I2608b73108fff680b947c585bf06799fe3f18d1d
2021-11-22 16:24:31 +01:00
Greg Kroah-Hartman
849a5c87b3 Merge 285fc3db0a ("Merge tag 'acpi-5.16-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm") into android-mainline
Steps on the way to 5.16-rc1

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I9401525496caaa7108710a2ad6c6610a0ace16ee
2021-11-22 16:23:32 +01:00
Greg Kroah-Hartman
6abcf9e5c2 Merge c183e1707a ("Merge tag 'for-5.16/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.16-rc1

Resolves merge conflicts in:
	drivers/md/Kconfig

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I12d7a103b2db90569873d721a5a07fbc54c1a35b
2021-11-22 16:22:26 +01:00
Greg Kroah-Hartman
3bb45b860a Merge 1bdd629e5a ("Merge tag 'ovl-update-5.16' of git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/vfs") into android-mainline
Steps on the way to 5.16-rc1

Resolves conflicts in:
    fs/overlayfs/file.c

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I78b4136a37129bcbd964bebc95243a51831bb7e6
2021-11-22 16:21:36 +01:00
Greg Kroah-Hartman
205b00fd30 Merge d20f7a09e5 ("Merge tag 'gpio-updates-for-v5.16' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux") into android-mainline
Steps on the way to 5.16-rc1

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: If2a3e7d45adbcb4ea0c3d52127d315638591b3d5
2021-11-22 16:19:43 +01:00
Greg Kroah-Hartman
baabe599de ANDROID: GKI: remove CONFIG_HARDENED_USERCOPY_FALLBACK from gki defconfig
Commit 53944f171a ("mm: remove HARDENED_USERCOPY_FALLBACK") removed
the config option from the kernel, so it also needs to be removed from
the gki_defconfig files in order for the build to work properly.

Fixes: 53944f171a ("mm: remove HARDENED_USERCOPY_FALLBACK")
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I96185cd7bf64da0287f72e00dafa2cb13bbda7f5
2021-11-22 15:07:35 +01:00
Greg Kroah-Hartman
53f805b2f1 Merge 512b7931ad ("Merge branch 'akpm' (patches from Andrew)") into android-mainline
Steps on the way to 5.16-rc1

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I2acdf0e0145176aefd72674293e33bdf88c20beb
2021-11-22 15:03:17 +01:00
Greg Kroah-Hartman
d3ba98f27f Revert "slab: add __alloc_size attributes for better bounds checking"
This reverts commit c37495d625 which
is part of a series of patches that causes cuttlefish to crash.

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: Ie90f9d34180103cc05a3fe77d2446c10ed59d006
2021-11-22 11:09:39 +01:00
Greg Kroah-Hartman
0487d3ee4d Revert "mm/kvmalloc: add __alloc_size attributes for better bounds checking"
This reverts commit 56bcf40f91 which
is part of a series of patches that causes cuttlefish to crash.

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I768a93d9a714dfe651a191a51dc3f8c243f5aef6
2021-11-22 11:09:38 +01:00
Greg Kroah-Hartman
f67265080c Revert "mm/vmalloc: add __alloc_size attributes for better bounds checking"
This reverts commit 894f24bb56 which
is part of a series of patches that causes cuttlefish to crash.

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I70b1f906e111b7286afbd3c28f4743fa2e66c944
2021-11-22 11:09:38 +01:00
Greg Kroah-Hartman
814f0e007f Revert "mm/page_alloc: add __alloc_size attributes for better bounds checking"
This reverts commit abd58f38df which
is part of a series of patches that causes cuttlefish to crash.

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: Ia06014d446c59d87b8fb642e4ed74e08a2ef0f2f
2021-11-22 11:09:37 +01:00
Greg Kroah-Hartman
ead24efb34 Revert "percpu: add __alloc_size attributes for better bounds checking"
This reverts commit 17197dd460 which
is part of a series of patches that causes cuttlefish to crash.

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: Id09ab4af153c29fcb6373acb96463dea6ffda9ee
2021-11-22 11:09:36 +01:00
Greg Kroah-Hartman
f76bbbae63 Merge 0eb68437a7 ("vmalloc: choose a better start address in vm_area_register_early()") into android-mainline
Steps on the way to 5.16-rc1

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: Ia521da34dd6bf9f4c3e3927228f34230a986d901
2021-11-22 11:07:00 +01:00
Greg Kroah-Hartman
5de420c339 Merge 72d67229f5 ("slab: clean up function prototypes") into android-mainline
Steps on the way to 5.16-rc1

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I35a42ade391a838ff0bf537e0d8c4bc8889e1759
2021-11-22 08:14:07 +01:00
Greg Kroah-Hartman
bf47e141b4 Merge 86cffecdea ("Compiler Attributes: add __alloc_size() for better bounds checking") into android-mainline
Steps on the way to 5.16-rc1

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I1833139d9c0db842ec3b7c7225c0455f5c29a8de
2021-11-22 08:13:54 +01:00
Helge Deller
98400ad75e Revert "parisc: Fix backtrace to always include init funtion names"
This reverts commit 279917e27e.

With the CONFIG_HARDENED_USERCOPY option enabled, this patch triggers
kernel bugs at runtime:

  usercopy: Kernel memory overwrite attempt detected to kernel text (offset 2084839, size 6)!
  kernel BUG at mm/usercopy.c:99!
 Backtrace:
  IAOQ[0]: usercopy_abort+0xc4/0xe8
  [<00000000406ed1c8>] __check_object_size+0x174/0x238
  [<00000000407086d4>] copy_strings.isra.0+0x3e8/0x708
  [<0000000040709a20>] do_execveat_common.isra.0+0x1bc/0x328
  [<000000004070b760>] compat_sys_execve+0x7c/0xb8
  [<0000000040303eb8>] syscall_exit+0x0/0x14

The problem is, that we have an init section of at least 2MB size which
starts at _stext and is freed after bootup.

If then later some kernel data is (temporarily) stored in this free
memory, check_kernel_text_object() will trigger a bug since the data
appears to be inside the kernel text (>=_stext) area:
        if (overlaps(ptr, len, _stext, _etext))
                usercopy_abort("kernel text");

Signed-off-by: Helge Deller <deller@gmx.de>
Cc: stable@kernel.org # 5.4+
2021-11-22 07:37:31 +01:00
Helge Deller
3fbdc121bd parisc: Convert PTE lookup to use extru_safe() macro
Convert the PTE lookup functions to use the safer extru_safe macro.

Signed-off-by: Helge Deller <deller@gmx.de>
2021-11-22 07:37:31 +01:00
John David Anglin
df2ffeda63 parisc: Fix extraction of hash lock bits in syscall.S
The extru instruction leaves the most significant 32 bits of the target
register in an undefined state on PA 2.0 systems. If any of these bits
are nonzero, this will break the calculation of the lock pointer.

Fix by using extrd,u instruction via extru_safe macro on 64-bit kernels.

Signed-off-by: John David Anglin <dave.anglin@bell.net>
Signed-off-by: Helge Deller <deller@gmx.de>
2021-11-22 07:37:31 +01:00
Helge Deller
169d1a4a2a parisc: Provide an extru_safe() macro to extract unsigned bits
The extru instruction leaves the most significant 32 bits of the
target register in an undefined state on PA 2.0 systems.
Provide a macro to safely use extru on 32- and 64-bit machines.

Suggested-by: John David Anglin <dave.anglin@bell.net>
Signed-off-by: Helge Deller <deller@gmx.de>
2021-11-22 07:37:31 +01:00
Helge Deller
8d192bec53 parisc: Increase FRAME_WARN to 2048 bytes on parisc
PA-RISC uses a much bigger frame size for functions than other
architectures. So increase it to 2048 for 32- and 64-bit kernels.
This fixes e.g. a warning in lib/xxhash.c.

Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Helge Deller <deller@gmx.de>
2021-11-22 07:37:31 +01:00