Commit graph

7523 commits

Author SHA1 Message Date
Greg Kroah-Hartman
967f18878a ANDROID: fix up change to pti_clone_pgtable()
Due to changes in dad75cf2c313 ("x86/mm: Fix PTI for i386 some more"),
the out-of-tree Android call to pti_clone_pgtable() needs to be fixed up
to work/build properly, so do so.

Fixes: dad75cf2c313 ("x86/mm: Fix PTI for i386 some more")
Change-Id: I64c97f6a24366cd912c7552ddaf04b888702eb26
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2025-01-19 00:09:58 +01:00
Stephen Hemminger
b59ccd9e2f BACKPORT: netem: fix return value if duplicate enqueue fails
[ Upstream commit c07ff8592d57ed258afee5a5e04991a48dbaf382 ]

There is a bug in netem_enqueue() introduced by
commit 5845f706388a ("net: netem: fix skb length BUG_ON in __skb_to_sgvec")
that can lead to a use-after-free.

This commit made netem_enqueue() always return NET_XMIT_SUCCESS
when a packet is duplicated, which can cause the parent qdisc's q.qlen
to be mistakenly incremented. When this happens qlen_notify() may be
skipped on the parent during destruction, leaving a dangling pointer
for some classful qdiscs like DRR.

There are two ways for the bug happen:

- If the duplicated packet is dropped by rootq->enqueue() and then
  the original packet is also dropped.
- If rootq->enqueue() sends the duplicated packet to a different qdisc
  and the original packet is dropped.

In both cases NET_XMIT_SUCCESS is returned even though no packets
are enqueued at the netem qdisc.

The fix is to defer the enqueue of the duplicate packet until after
the original packet has been guaranteed to return NET_XMIT_SUCCESS.

Bug: 362391455
Fixes: 5845f706388a ("net: netem: fix skb length BUG_ON in __skb_to_sgvec")
Reported-by: Budimir Markovic <markovicbudimir@gmail.com>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://patch.msgid.link/20240819175753.5151-1-stephen@networkplumber.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
(cherry picked from commit 0486d31dd8198e22b63a4730244b38fffce6d469)
Signed-off-by: Lee Jones <joneslee@google.com>
Change-Id: I390f02549c726e961f57daace468d5cd48468722
2025-01-19 00:09:58 +01:00
Gabriel Krisman Bertazi
161cbfabfa UPSTREAM: unicode: Don't special case ignorable code points
We don't need to handle them separately. Instead, just let them
decompose/casefold to themselves.

Change-Id: I01c3f2c98ae4d84269586cec09f18239cbee0abb
Signed-off-by: Gabriel Krisman Bertazi <krisman@suse.de>
(cherry picked from commit 5c26d2f1d3f5e4be3e196526bead29ecb139cf91)
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2025-01-19 00:09:58 +01:00
T.J. Mercier
9b399ee577 UPSTREAM: dma-buf: heaps: Fix off-by-one in CMA heap fault handler
commit ea5ff5d351b520524019f7ff7f9ce418de2dad87 upstream.

Until VM_DONTEXPAND was added in commit 1c1914d6e8c6 ("dma-buf: heaps:
Don't track CMA dma-buf pages under RssFile") it was possible to obtain
a mapping larger than the buffer size via mremap and bypass the overflow
check in dma_buf_mmap_internal. When using such a mapping to attempt to
fault past the end of the buffer, the CMA heap fault handler also checks
the fault offset against the buffer size, but gets the boundary wrong by
1. Fix the boundary check so that we don't read off the end of the pages
array and insert an arbitrary page in the mapping.

Bug: 363259128
Reported-by: Xingyu Jin <xingyuj@google.com>
Fixes: a5d2d29e24be ("dma-buf: heaps: Move heap-helper logic into the cma_heap implementation")
Cc: stable@vger.kernel.org # Applicable >= 5.10. Needs adjustments only for 5.10.
Signed-off-by: T.J. Mercier <tjmercier@google.com>
Acked-by: John Stultz <jstultz@google.com>
Signed-off-by: Sumit Semwal <sumit.semwal@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20240830192627.2546033-1-tjmercier@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 79cce5e81d20fa9ad553be439d665ac3302d3c95)
Signed-off-by: Lee Jones <joneslee@google.com>
Change-Id: Ifc9c940e0a3cd721d29c783753b0dfd13a8aafc6
2025-01-19 00:09:58 +01:00
Justin Chen
cc26f5e9ee BACKPORT: firmware: arm_scmi: Queue in scmi layer for mailbox implementation
send_message() does not block in the MBOX implementation. This is
because the mailbox layer has its own queue. However, this confuses
the per xfer timeouts as they all start their timeout ticks in
parallel.

Consider a case where the xfer timeout is 30ms and a SCMI transaction
takes 25ms:

  | 0ms: Message #0 is queued in mailbox layer and sent out, then sits
  |      at scmi_wait_for_message_response() with a timeout of 30ms
  | 1ms: Message #1 is queued in mailbox layer but not sent out yet.
  |      Since send_message() doesn't block, it also sits at
  |      scmi_wait_for_message_response() with a timeout of 30ms
  |  ...
  | 25ms: Message #0 is completed, txdone is called and message #1 is sent
  | 31ms: Message #1 times out since the count started at 1ms. Even though
  |       it has only been inflight for 6ms.

Bug: 374939101
Fixes: 5c8a47a5a91d ("firmware: arm_scmi: Make scmi core independent of the transport type")
Change-Id: I0ab132221c28d4594f0bbc161f431ceb49830824
Signed-off-by: Justin Chen <justin.chen@broadcom.com>
Message-Id: <20241014160717.1678953-1-justin.chen@broadcom.com>
Reviewed-by: Cristian Marussi <cristian.marussi@arm.com>
Tested-by: Cristian Marussi <cristian.marussi@arm.com>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
(cherry picked from commit da1642bc97c4ef67f347edcd493bd0a52f88777b)
Signed-off-by: Danesh Petigara <danesh.petigara@broadcom.com>
Signed-off-by: Pierre Couillaud <pierre@broadcom.com>
(cherry picked from commit e02772c76d6fa54bd75b3961bb08c3a01122dbc9)
2025-01-19 00:09:58 +01:00
Willem de Bruijn
e1d2f5465e BACKPORT: gso: fix udp gso fraglist segmentation after pull from frag_list
Detect gso fraglist skbs with corrupted geometry (see below) and
pass these to skb_segment instead of skb_segment_list, as the first
can segment them correctly.

Valid SKB_GSO_FRAGLIST skbs
- consist of two or more segments
- the head_skb holds the protocol headers plus first gso_size
- one or more frag_list skbs hold exactly one segment
- all but the last must be gso_size

Optional datapath hooks such as NAT and BPF (bpf_skb_pull_data) can
modify these skbs, breaking these invariants.

In extreme cases they pull all data into skb linear. For UDP, this
causes a NULL ptr deref in __udpv4_gso_segment_list_csum at
udp_hdr(seg->next)->dest.

Detect invalid geometry due to pull, by checking head_skb size.
Don't just drop, as this may blackhole a destination. Convert to be
able to pass to regular skb_segment.

Link: https://lore.kernel.org/netdev/20240428142913.18666-1-shiming.cheng@mediatek.com/
Fixes: 9fd1ff5d2ac7 ("udp: Support UDP fraglist GRO/GSO.")
Signed-off-by: Willem de Bruijn <willemb@google.com>
Cc: stable@vger.kernel.org
Link: https://patch.msgid.link/20241001171752.107580-1-willemdebruijn.kernel@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

Bug: 373245346
Bug: 333849117
Change-Id: I5a317e002f149cf9d399dce9bf87cd649a24da19
(cherry picked from commit a1e40ac5b5e9077fe1f7ae0eb88034db0f9ae1ab)
Signed-off-by: Lena Wang <lena.wang@mediatek.corp-partner.google.com>
(cherry picked from commit 42c2d1ea7c1bf984372f0ca1711d91165cbb87a6)
(cherry picked from commit 7376b8e51c4ddaa8e36b2b33d6ac3392135183b1)
2025-01-19 00:09:57 +01:00
Ksawlii
33a4759f21 defconfigs: Regenerate with regen.sh 2025-01-18 22:53:46 +01:00
Ksawlii
c4cc681b0b build.sh: Fix applying susfs4ksu 2025-01-18 22:53:16 +01:00
Ksawlii
4d79b3410c Revert "battery: nuke sm5451_charger driver from a53x"
This reverts commit cb6a5e60da.
2025-01-18 22:11:40 +01:00
Ksawlii
193cce5a06 Revert "battery: import sm5451_charger driver from F926B"
This reverts commit 7fb3935edb.
2025-01-18 22:11:40 +01:00
Ksawlii
bfc9dbe311 Revert "battery: sm5451_charger: fix build on 5.10"
This reverts commit 27515e820a.
2025-01-18 22:11:40 +01:00
Ksawlii
daf8bac97c Revert "vboot_dlkm: drop duplicate sm5451 module"
This reverts commit a13ddad5af.
2025-01-18 22:10:18 +01:00
Ksawlii
23460311db Revert "kernel_build: modules.load: Nuke mfd_s2mu106.ko hl7132_charger.ko"
This reverts commit 1831693e5e.
2025-01-18 22:10:12 +01:00
Ksawlii
6d15718b54 build.sh: KernelSU > KernelSU-Next 2025-01-18 22:02:10 +01:00
Ksawlii
959c3fa87b .gitignore: Ignore KernelSU-Next folder 2025-01-18 22:01:24 +01:00
Ksawlii
c726a8ee0d KernelSU-Next,patches,build.sh: Automaticly apply susfs4ksu 2025-01-18 22:00:11 +01:00
Ksawlii
1dd5acfeba Import susfs4ksu 2025-01-18 21:48:58 +01:00
Ksawlii
5b1dc0edf0 Revert "net: tcp: bbrplus for 5.10"
This reverts commit 5049015630.
2025-01-17 22:17:46 +01:00
Ksawlii
08f01a7c9a Revert "include: net: Adapt for bbrplus 5.10"
This reverts commit 9d4b1ab85e.
2025-01-17 21:54:13 +01:00
Ksawlii
cfd879d102 Ignore kernel_build/FireAsf/* 2025-01-17 21:27:53 +01:00
Ksawlii
1d70d90901 kernel_build: build-ksu.sh: Make HOUR variable show hour.minutes 2025-01-17 21:25:37 +01:00
Ksawlii
79785752bf kernel_build: build-ksu.sh: Fix defconfig name 2025-01-17 21:15:31 +01:00
Ksawlii
da4998c695 kernel_build: build*.sh: Fix dates 2025-01-17 21:13:52 +01:00
Ksawlii
9d4b1ab85e include: net: Adapt for bbrplus 5.10 2025-01-17 21:00:27 +01:00
Ksawlii
f248210560 kernel_build: build*.sh: Add date variables, change kernel zip/tar path, modify kernel zip/tar name 2025-01-17 20:55:06 +01:00
Ksawlii
51a5eaa30b kernel_build: build*.sh: Delete word dir after
Looks better
2025-01-17 20:26:27 +01:00
Ksawlii
a87ec2f156 kernel_build: build*.sh: Make the next echo more readable 2025-01-17 20:23:49 +01:00
Ksawlii
5dd06b67b6 kernel_build: build*.sh: Nuke echo duplicate 2025-01-17 20:22:11 +01:00
blankaf
a10d2d996b exec: Extend task_is_booster check to cover newer perf HALs
These are used in devices with newer CAF baselines, hence cover them too.

Signed-off-by: Fiqri Ardyansyah <fiqri15072019@gmail.com>
Signed-off-by: rezaadi0105 <rezaadipangestu5@gmail.com>
2025-01-17 20:18:51 +01:00
Panchajanya1999
c46896b509 exec: Add power@2.0 and IOP to tampering blacklist
Signed-off-by: Panchajanya1999 <panchajanya@azure-dev.live>
Signed-off-by: UtsavBalar1231 <utsavbalar1231@gmail.com>
Signed-off-by: Yaroslav Furman <yaro330@gmail.com>
Signed-off-by: Fiqri Ardyansyah <fiqri15072019@gmail.com>
Signed-off-by: rezaadi0105 <rezaadipangestu5@gmail.com>
2025-01-17 20:18:47 +01:00
Adam W. Willis
1d1f16ce99 exec: Extend task_is_booster check to cover OxygenOS userspace HALs
Subsequent to 2e20671 ("exec: Add node tampering blacklist function")

This device utilizes vendor.qti.hardware.perf@2.0-service, and
android.hardware.power@1.2-service respectively.

Signed-off-by: Adam W. Willis <return.of.octobot@gmail.com>
Signed-off-by: Julian Liu <wlootlxt123@gmail.com>
Signed-off-by: Fiqri Ardyansyah <fiqri15072019@gmail.com>
Signed-off-by: rezaadi0105 <rezaadipangestu5@gmail.com>
2025-01-17 20:18:43 +01:00
Danny Lin
00c4a222bb exec: Add node tampering blacklist function
We'll be adding checks to block writes from processes which tamper with
values that we control from within the kernel, especially ones that
userspace writes to for boosting. Add a central function to perform the
process check to reduce code duplication.

This blacklists the following processes which are known to tamper with
such values:
  - init
  - libperfmgr (power@1.3-servi and NodeLooperThrea)
  - perfd (perf@1.0-servic)
  - init.qcom.post_boot.sh (init.qcom.post_)

Signed-off-by: Danny Lin <danny@kdrag0n.dev>
Signed-off-by: Julian Liu <wlootlxt123@gmail.com>
Signed-off-by: Fiqri Ardyansyah <fiqri15072019@gmail.com>
Signed-off-by: rezaadi0105 <rezaadipangestu5@gmail.com>
2025-01-17 20:18:34 +01:00
Ksawlii
1aaa0360e8 kernel_build: build*.sh: Tweak echo commands 2025-01-17 19:24:28 +01:00
Ksawlii
b419a4cf57 build.sh: Add an option to clean build dirs 2025-01-17 16:37:35 +01:00
Ksawlii
ca7685d6b1 build.sh: Exit after building 2025-01-17 00:06:58 +01:00
Ksawlii
46ef9e7f51 defconfigs: Regenerate with regen.sh 2025-01-17 00:03:07 +01:00
Ksawlii
642aac6c75 kernel_build: regen.sh Set CONFIG_KSU to =n after regeneration 2025-01-17 00:01:05 +01:00
Ksawlii
046f1b47c2 defconfigs: Regenerate with regen.sh 2025-01-16 23:53:44 +01:00
Ksawlii
f0a38abfb0 Ignore *.zip *.tar *.img.lz4 in kernel_build directory 2025-01-16 23:35:34 +01:00
Ksawlii
cbbab54bac Add a script to regenerate defconfigs 2025-01-16 23:32:03 +01:00
Tim Zimmermann
bdd9818338 net: wireless: scsc: Add support for NL80211_WPA_VERSION_3
* Required after V QPR1 wpa_supplicant updates

Change-Id: I0f09cc03ef11260e56c882c12f4f11be1bf2547e
2025-01-16 23:19:27 +01:00
Ksawlii
f697483a60 Makefile,kernel_build: Set PLATFORM_VERSION to 15.0 2025-01-16 23:19:19 +01:00
Nathan Chancellor
d57c773f75 UPSTREAM: Makefile: Only specify '--prefix=' when building with clang + GNU as
When building with LLVM_IAS=1, there is no point to specifying
'--prefix=' because that flag is only used to find GNU cross tools,
which will not be used indirectly when using the integrated assembler.
All of the tools are invoked directly from PATH or a full path specified
via the command line, which does not depend on the value of '--prefix='.

Sharing commands to reproduce issues becomes a little bit easier without
a '--prefix=' value because that '--prefix=' value is specific to a
user's machine due to it being an absolute path.

Some further notes from Fangrui Song:

  clang can spawn GNU as (if -f?no-integrated-as is specified) and GNU
  objcopy (-f?no-integrated-as and -gsplit-dwarf and -g[123]).
  objcopy is only used for GNU as assembled object files.
  With integrated assembler, the object file streamer creates .o and
  .dwo simultaneously.
  With GNU as, two objcopy commands are needed to extract .debug*.dwo to
  .dwo files && another command to remove .debug*.dwo sections.

A small consequence of this change (to keep things simple) is that
'--prefix=' will always be specified now, even with a native build, when
it was not before. This should not be an issue due to the way that the
Makefile searches for the prefix (based on elfedit's location). This
ends up improving the experience for host builds because PATH is better
respected and matches GCC's behavior more closely. See the below thread
for more details:

https://lore.kernel.org/r/20210205213651.GA16907@Ryzen-5-4500U.localdomain/

Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
(cherry picked from commit eec08090bcc113643522d4272dc0b945045aba74)
Bug: 209655537
Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
Change-Id: I90f232a1551afb9118176a61ac5de38384a171fd
2025-01-16 23:17:02 +01:00
Nathan Chancellor
8e358dd764 UPSTREAM: Makefile: Remove '--gcc-toolchain' flag
This flag was originally added to allow clang to find the GNU cross
tools in commit 785f11aa595b ("kbuild: Add better clang cross build
support"). This flag was not enough to find the tools at times so
'--prefix' was added to the list in commit ef8c4ed9db80 ("kbuild: allow
to use GCC toolchain not in Clang search path") and improved upon in
commit ca9b31f6bb9c ("Makefile: Fix GCC_TOOLCHAIN_DIR prefix for Clang
cross compilation"). Now that '--prefix' specifies a full path and
prefix, '--gcc-toolchain' serves no purpose because the kernel builds
with '-nostdinc' and '-nostdlib'.

This has been verified with self compiled LLVM 10.0.1 and LLVM 13.0.0 as
well as a distribution version of LLVM 11.1.0 without binutils in the
LLVM toolchain locations.

Link: https://reviews.llvm.org/D97902
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Reviewed-by: Fangrui Song <maskray@google.com>
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
Tested-by: Nick Desaulniers <ndesaulniers@google.com>
Tested-by: Sedat Dilek <sedat.dilek@gmail.com>
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
(cherry picked from commit c91d4e47e10ee4d3163838b1b727fe1d0664115b)
Bug: 209655537
Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
Change-Id: Ie1f64ed8562964ceba21e402a3d97850f6471508
2025-01-16 23:16:57 +01:00
Masahiro Yamada
d52b4aa77b UPSTREAM: kbuild: remove ld-version macro
There is no direct user of ld-version; you can use CONFIG_LD_VERSION
if needed.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Reviewed-by: Nathan Chancellor <nathan@kernel.org>
Bug: 209655537
(cherry picked from commit 05f6bbf2d714309607d5533f0265a95d037610b4)
Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
Change-Id: If7f82474beea2822340ee8503de5087336766223
2025-01-16 23:16:51 +01:00
LuK1337
4a42267412 Android: Add empty Android.mk file
* This prevents inclusion of drivers/staging/greybus/tools/Android.mk
  which will conflict in case we have more than 1 kernel tree in AOSP
  source dir.

Change-Id: I335bca7b6d6463b1ffc673ab5367603347516e13
2025-01-16 23:15:38 +01:00
Tim Zimmermann
6b53dc899e drivers: misc: samsung: scsc: fix build without CONFIG_SCSC_WLBTD
Change-Id: I13cba302b47e5353656bab86b725e128bdd5e628
2025-01-16 23:15:33 +01:00
Tim Zimmermann
39efa81db3 misc: samsung: scsc_bt: Always set transport unit size to 16
* Our firmware wants this to be 16 (PCM) instead of 0x00 (HCI)
* Removes the need for patching userspace

Change-Id: Ie88a682b5acc6ef73db5d35dbd336544ab0a1a2a
2025-01-16 23:15:22 +01:00
Tim Zimmermann
ac4a6294be battery: sm5714_fuelgauge: Use CHARGE_FULL capacity for CHARGE_COUNTER
Change-Id: Id43d7f233e9492d609eaf2510e85dee8f962c192
2025-01-16 23:09:28 +01:00
Tim Zimmermann
8ef191ee08 battery: sm5714_fuelgauge: Support CAPACITY_AGEDCELL
Change-Id: If9b68c2c931e3003edbbd4ac8a187fdeb5da76b0
2025-01-16 23:08:52 +01:00