mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-07 04:12:04 -04:00
Compare commits
1879 changed files with 59332 additions and 278841 deletions
|
|
@ -1,26 +0,0 @@
|
|||
What: /sys/fs/selinux/disable
|
||||
Date: April 2005 (predates git)
|
||||
KernelVersion: 2.6.12-rc2 (predates git)
|
||||
Contact: selinux@vger.kernel.org
|
||||
Description:
|
||||
|
||||
The selinuxfs "disable" node allows SELinux to be disabled at runtime
|
||||
prior to a policy being loaded into the kernel. If disabled via this
|
||||
mechanism, SELinux will remain disabled until the system is rebooted.
|
||||
|
||||
The preferred method of disabling SELinux is via the "selinux=0" boot
|
||||
parameter, but the selinuxfs "disable" node was created to make it
|
||||
easier for systems with primitive bootloaders that did not allow for
|
||||
easy modification of the kernel command line. Unfortunately, allowing
|
||||
for SELinux to be disabled at runtime makes it difficult to secure the
|
||||
kernel's LSM hooks using the "__ro_after_init" feature.
|
||||
|
||||
Thankfully, the need for the SELinux runtime disable appears to be
|
||||
gone, the default Kconfig configuration disables this selinuxfs node,
|
||||
and only one of the major distributions, Fedora, supports disabling
|
||||
SELinux at runtime. Fedora is in the process of removing the
|
||||
selinuxfs "disable" node and once that is complete we will start the
|
||||
slow process of removing this code from the kernel.
|
||||
|
||||
More information on /sys/fs/selinux/disable can be found under the
|
||||
CONFIG_SECURITY_SELINUX_DISABLE Kconfig option.
|
||||
|
|
@ -265,71 +265,6 @@ Description: Specific uncompressed frame descriptors
|
|||
bmCapabilities - still image support, fixed frame-rate
|
||||
support
|
||||
|
||||
What: /config/usb-gadget/gadget/functions/uvc.name/streaming/framebased
|
||||
Date: Oct 2025
|
||||
KernelVersion: 5.4
|
||||
Description: Framebased format descriptors
|
||||
|
||||
What: /config/usb-gadget/gadget/functions/uvc.name/streaming/framebased/name
|
||||
Date: Oct 2025
|
||||
KernelVersion: 5.4
|
||||
Description: Specific framebased format descriptors
|
||||
|
||||
================== =======================================
|
||||
bFormatIndex unique id for this format descriptor;
|
||||
only defined after parent header is
|
||||
linked into the streaming class;
|
||||
read-only
|
||||
bmaControls this format's data for bmaControls in
|
||||
the streaming header
|
||||
bmInterlaceFlags specifies interlace information,
|
||||
read-only
|
||||
bAspectRatioY the X dimension of the picture aspect
|
||||
ratio, read-only
|
||||
bAspectRatioX the Y dimension of the picture aspect
|
||||
ratio, read-only
|
||||
bDefaultFrameIndex optimum frame index for this stream
|
||||
bBitsPerPixel number of bits per pixel used to
|
||||
specify color in the decoded video
|
||||
frame
|
||||
guidFormat globally unique id used to identify
|
||||
stream-encoding format
|
||||
================== =======================================
|
||||
|
||||
What: /config/usb-gadget/gadget/functions/uvc.name/streaming/framebased/name/name
|
||||
Date: Sept 2024
|
||||
KernelVersion: 5.15
|
||||
Description: Specific framebased frame descriptors
|
||||
|
||||
========================= =====================================
|
||||
bFrameIndex unique id for this framedescriptor;
|
||||
only defined after parent format is
|
||||
linked into the streaming header;
|
||||
read-only
|
||||
dwFrameInterval indicates how frame interval can be
|
||||
programmed; a number of values
|
||||
separated by newline can be specified
|
||||
dwDefaultFrameInterval the frame interval the device would
|
||||
like to use as default
|
||||
dwBytesPerLine Specifies the number of bytes per line
|
||||
|
||||
of video for packed fixed frame size
|
||||
formats, allowing the receiver to
|
||||
perform stride alignment of the video.
|
||||
If the bVariableSize value (above) is
|
||||
TRUE (1), or if the format does not
|
||||
permit such alignment, this value shall
|
||||
be set to zero (0).
|
||||
dwMaxBitRate the maximum bit rate at the shortest
|
||||
frame interval in bps
|
||||
dwMinBitRate the minimum bit rate at the longest
|
||||
frame interval in bps
|
||||
wHeight height of decoded bitmap frame in px
|
||||
wWidth width of decoded bitmam frame in px
|
||||
bmCapabilities still image support, fixed frame-rate
|
||||
support
|
||||
========================= =====================================
|
||||
|
||||
What: /config/usb-gadget/gadget/functions/uvc.name/streaming/header
|
||||
Date: Dec 2014
|
||||
KernelVersion: 4.0
|
||||
|
|
|
|||
|
|
@ -1,19 +0,0 @@
|
|||
What: /sys/fs/fuse/features/fuse_bpf
|
||||
Date: December 2022
|
||||
Contact: Paul Lawrence <paullawrence@google.com>
|
||||
Description:
|
||||
Read-only file that contains the word 'supported' if fuse-bpf is
|
||||
supported, does not exist otherwise
|
||||
|
||||
What: /sys/fs/fuse/bpf_prog_type_fuse
|
||||
Date: December 2022
|
||||
Contact: Paul Lawrence <paullawrence@google.com>
|
||||
Description:
|
||||
bpf_prog_type_fuse defines the program type of bpf programs that
|
||||
may be passed to fuse-bpf. For upstream bpf program types, this
|
||||
is a constant defined in a contiguous array of constants.
|
||||
bpf_prog_type_fuse is appended to the end of the list, so it may
|
||||
change and therefore its value must be read from this file.
|
||||
|
||||
Contents is ASCII decimal representation of bpf_prog_type_fuse
|
||||
|
||||
|
|
@ -186,17 +186,6 @@ cgroup v2 currently supports the following mount options.
|
|||
modified through remount from the init namespace. The mount
|
||||
option is ignored on non-init namespace mounts.
|
||||
|
||||
memory_recursiveprot
|
||||
|
||||
Recursively apply memory.min and memory.low protection to
|
||||
entire subtrees, without requiring explicit downward
|
||||
propagation into leaf cgroups. This allows protecting entire
|
||||
subtrees from one another, while retaining free competition
|
||||
within those subtrees. This should have been the default
|
||||
behavior but is a mount-option to avoid regressing setups
|
||||
relying on the original semantics (e.g. specifying bogusly
|
||||
high 'bypass' protection values at higher tree levels).
|
||||
|
||||
|
||||
Organizing Processes and Threads
|
||||
--------------------------------
|
||||
|
|
|
|||
|
|
@ -526,7 +526,7 @@
|
|||
1 -- check protection requested by application.
|
||||
Default value is set via a kernel config option.
|
||||
Value can be changed at runtime via
|
||||
/sys/fs/selinux/checkreqprot.
|
||||
/selinux/checkreqprot.
|
||||
|
||||
cio_ignore= [S390]
|
||||
See Documentation/s390/common_io.rst for details.
|
||||
|
|
@ -1251,8 +1251,7 @@
|
|||
0 -- permissive (log only, no denials).
|
||||
1 -- enforcing (deny and log).
|
||||
Default value is 0.
|
||||
Value can be changed at runtime via
|
||||
/sys/fs/selinux/enforce.
|
||||
Value can be changed at runtime via /selinux/enforce.
|
||||
|
||||
erst_disable [ACPI]
|
||||
Disable Error Record Serialization Table (ERST)
|
||||
|
|
@ -3187,21 +3186,6 @@
|
|||
in certain environments such as networked servers or
|
||||
real-time systems.
|
||||
|
||||
no_hash_pointers
|
||||
Force pointers printed to the console or buffers to be
|
||||
unhashed. By default, when a pointer is printed via %p
|
||||
format string, that pointer is "hashed", i.e. obscured
|
||||
by hashing the pointer value. This is a security feature
|
||||
that hides actual kernel addresses from unprivileged
|
||||
users, but it also makes debugging the kernel more
|
||||
difficult since unequal pointers can no longer be
|
||||
compared. However, if this command-line option is
|
||||
specified, then all normal pointers will have their true
|
||||
value printed. Pointers printed via %pK may still be
|
||||
hashed. This option should only be specified when
|
||||
debugging the kernel. Please do not use on production
|
||||
kernels.
|
||||
|
||||
nohibernate [HIBERNATION] Disable hibernation and resume.
|
||||
|
||||
nohz= [KNL] Boottime enable/disable dynamic ticks
|
||||
|
|
@ -4296,13 +4280,6 @@
|
|||
only normal grace-period primitives. No effect
|
||||
on CONFIG_TINY_RCU kernels.
|
||||
|
||||
rcupdate.rcu_task_ipi_delay= [KNL]
|
||||
Set time in jiffies during which RCU tasks will
|
||||
avoid sending IPIs, starting with the beginning
|
||||
of a given grace period. Setting a large
|
||||
number avoids disturbing real-time workloads,
|
||||
but lengthens grace periods.
|
||||
|
||||
rcupdate.rcu_task_stall_timeout= [KNL]
|
||||
Set timeout in jiffies for RCU task stall warning
|
||||
messages. Disable with a value less than or equal
|
||||
|
|
@ -4447,9 +4424,6 @@
|
|||
|
||||
rootflags= [KNL] Set root filesystem mount option string
|
||||
|
||||
initramfs_options= [KNL]
|
||||
Specify mount options for for the initramfs mount.
|
||||
|
||||
rootfstype= [KNL] Set root filesystem type
|
||||
|
||||
rootwait [KNL] Wait (indefinitely) for root device to show up.
|
||||
|
|
@ -4502,7 +4476,9 @@
|
|||
See security/selinux/Kconfig help text.
|
||||
0 -- disable.
|
||||
1 -- enable.
|
||||
Default value is 1.
|
||||
Default value is set via kernel config option.
|
||||
If enabled at boot time, /selinux/disable can be used
|
||||
later to disable prior to initial policy load.
|
||||
|
||||
apparmor= [APPARMOR] Disable or enable AppArmor at boot time
|
||||
Format: { "0" | "1" }
|
||||
|
|
|
|||
|
|
@ -134,8 +134,6 @@ stable kernels.
|
|||
+----------------+-----------------+-----------------+-----------------------------+
|
||||
| ARM | Neoverse-V3 | #3312417 | ARM64_ERRATUM_3194386 |
|
||||
+----------------+-----------------+-----------------+-----------------------------+
|
||||
| ARM | Neoverse-V3AE | #3312417 | ARM64_ERRATUM_3194386 |
|
||||
+----------------+-----------------+-----------------+-----------------------------+
|
||||
| ARM | MMU-500 | #841119,826419 | N/A |
|
||||
+----------------+-----------------+-----------------+-----------------------------+
|
||||
+----------------+-----------------+-----------------+-----------------------------+
|
||||
|
|
|
|||
|
|
@ -142,6 +142,3 @@ BPF flow dissector doesn't support exporting all the metadata that in-kernel
|
|||
C-based implementation can export. Notable example is single VLAN (802.1Q)
|
||||
and double VLAN (802.1AD) tags. Please refer to the ``struct bpf_flow_keys``
|
||||
for a set of information that's currently can be exported from the BPF context.
|
||||
|
||||
When BPF flow dissector is attached to the root network namespace (machine-wide
|
||||
policy), users can't override it in their child network namespaces.
|
||||
|
|
|
|||
|
|
@ -110,20 +110,6 @@ used when printing stack backtraces. The specifier takes into
|
|||
consideration the effect of compiler optimisations which may occur
|
||||
when tail-calls are used and marked with the noreturn GCC attribute.
|
||||
|
||||
Probed Pointers from BPF / tracing
|
||||
----------------------------------
|
||||
|
||||
::
|
||||
|
||||
%pks kernel string
|
||||
%pus user string
|
||||
|
||||
The ``k`` and ``u`` specifiers are used for printing prior probed memory from
|
||||
either kernel memory (k) or user memory (u). The subsequent ``s`` specifier
|
||||
results in printing a string. For direct use in regular vsnprintf() the (k)
|
||||
and (u) annotation is ignored, however, when used out of BPF's bpf_trace_printk(),
|
||||
for example, it reads the memory it is pointing to without faulting.
|
||||
|
||||
Kernel Pointers
|
||||
---------------
|
||||
|
||||
|
|
|
|||
|
|
@ -21,7 +21,6 @@ whole; patches welcome!
|
|||
kasan
|
||||
ubsan
|
||||
kmemleak
|
||||
kfence
|
||||
gdb-kernel-debugging
|
||||
kgdb
|
||||
kselftest
|
||||
|
|
|
|||
|
|
@ -1,298 +0,0 @@
|
|||
.. SPDX-License-Identifier: GPL-2.0
|
||||
.. Copyright (C) 2020, Google LLC.
|
||||
|
||||
Kernel Electric-Fence (KFENCE)
|
||||
==============================
|
||||
|
||||
Kernel Electric-Fence (KFENCE) is a low-overhead sampling-based memory safety
|
||||
error detector. KFENCE detects heap out-of-bounds access, use-after-free, and
|
||||
invalid-free errors.
|
||||
|
||||
KFENCE is designed to be enabled in production kernels, and has near zero
|
||||
performance overhead. Compared to KASAN, KFENCE trades performance for
|
||||
precision. The main motivation behind KFENCE's design, is that with enough
|
||||
total uptime KFENCE will detect bugs in code paths not typically exercised by
|
||||
non-production test workloads. One way to quickly achieve a large enough total
|
||||
uptime is when the tool is deployed across a large fleet of machines.
|
||||
|
||||
Usage
|
||||
-----
|
||||
|
||||
To enable KFENCE, configure the kernel with::
|
||||
|
||||
CONFIG_KFENCE=y
|
||||
|
||||
To build a kernel with KFENCE support, but disabled by default (to enable, set
|
||||
``kfence.sample_interval`` to non-zero value), configure the kernel with::
|
||||
|
||||
CONFIG_KFENCE=y
|
||||
CONFIG_KFENCE_SAMPLE_INTERVAL=0
|
||||
|
||||
KFENCE provides several other configuration options to customize behaviour (see
|
||||
the respective help text in ``lib/Kconfig.kfence`` for more info).
|
||||
|
||||
Tuning performance
|
||||
~~~~~~~~~~~~~~~~~~
|
||||
|
||||
The most important parameter is KFENCE's sample interval, which can be set via
|
||||
the kernel boot parameter ``kfence.sample_interval`` in milliseconds. The
|
||||
sample interval determines the frequency with which heap allocations will be
|
||||
guarded by KFENCE. The default is configurable via the Kconfig option
|
||||
``CONFIG_KFENCE_SAMPLE_INTERVAL``. Setting ``kfence.sample_interval=0``
|
||||
disables KFENCE.
|
||||
|
||||
The KFENCE memory pool is of fixed size, and if the pool is exhausted, no
|
||||
further KFENCE allocations occur. With ``CONFIG_KFENCE_NUM_OBJECTS`` (default
|
||||
255), the number of available guarded objects can be controlled. Each object
|
||||
requires 2 pages, one for the object itself and the other one used as a guard
|
||||
page; object pages are interleaved with guard pages, and every object page is
|
||||
therefore surrounded by two guard pages.
|
||||
|
||||
The total memory dedicated to the KFENCE memory pool can be computed as::
|
||||
|
||||
( #objects + 1 ) * 2 * PAGE_SIZE
|
||||
|
||||
Using the default config, and assuming a page size of 4 KiB, results in
|
||||
dedicating 2 MiB to the KFENCE memory pool.
|
||||
|
||||
Note: On architectures that support huge pages, KFENCE will ensure that the
|
||||
pool is using pages of size ``PAGE_SIZE``. This will result in additional page
|
||||
tables being allocated.
|
||||
|
||||
Error reports
|
||||
~~~~~~~~~~~~~
|
||||
|
||||
A typical out-of-bounds access looks like this::
|
||||
|
||||
==================================================================
|
||||
BUG: KFENCE: out-of-bounds read in test_out_of_bounds_read+0xa3/0x22b
|
||||
|
||||
Out-of-bounds read at 0xffffffffb672efff (1B left of kfence-#17):
|
||||
test_out_of_bounds_read+0xa3/0x22b
|
||||
kunit_try_run_case+0x51/0x85
|
||||
kunit_generic_run_threadfn_adapter+0x16/0x30
|
||||
kthread+0x137/0x160
|
||||
ret_from_fork+0x22/0x30
|
||||
|
||||
kfence-#17 [0xffffffffb672f000-0xffffffffb672f01f, size=32, cache=kmalloc-32] allocated by task 507:
|
||||
test_alloc+0xf3/0x25b
|
||||
test_out_of_bounds_read+0x98/0x22b
|
||||
kunit_try_run_case+0x51/0x85
|
||||
kunit_generic_run_threadfn_adapter+0x16/0x30
|
||||
kthread+0x137/0x160
|
||||
ret_from_fork+0x22/0x30
|
||||
|
||||
CPU: 4 PID: 107 Comm: kunit_try_catch Not tainted 5.8.0-rc6+ #7
|
||||
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.13.0-1 04/01/2014
|
||||
==================================================================
|
||||
|
||||
The header of the report provides a short summary of the function involved in
|
||||
the access. It is followed by more detailed information about the access and
|
||||
its origin. Note that, real kernel addresses are only shown when using the
|
||||
kernel command line option ``no_hash_pointers``.
|
||||
|
||||
Use-after-free accesses are reported as::
|
||||
|
||||
==================================================================
|
||||
BUG: KFENCE: use-after-free read in test_use_after_free_read+0xb3/0x143
|
||||
|
||||
Use-after-free read at 0xffffffffb673dfe0 (in kfence-#24):
|
||||
test_use_after_free_read+0xb3/0x143
|
||||
kunit_try_run_case+0x51/0x85
|
||||
kunit_generic_run_threadfn_adapter+0x16/0x30
|
||||
kthread+0x137/0x160
|
||||
ret_from_fork+0x22/0x30
|
||||
|
||||
kfence-#24 [0xffffffffb673dfe0-0xffffffffb673dfff, size=32, cache=kmalloc-32] allocated by task 507:
|
||||
test_alloc+0xf3/0x25b
|
||||
test_use_after_free_read+0x76/0x143
|
||||
kunit_try_run_case+0x51/0x85
|
||||
kunit_generic_run_threadfn_adapter+0x16/0x30
|
||||
kthread+0x137/0x160
|
||||
ret_from_fork+0x22/0x30
|
||||
|
||||
freed by task 507:
|
||||
test_use_after_free_read+0xa8/0x143
|
||||
kunit_try_run_case+0x51/0x85
|
||||
kunit_generic_run_threadfn_adapter+0x16/0x30
|
||||
kthread+0x137/0x160
|
||||
ret_from_fork+0x22/0x30
|
||||
|
||||
CPU: 4 PID: 109 Comm: kunit_try_catch Tainted: G W 5.8.0-rc6+ #7
|
||||
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.13.0-1 04/01/2014
|
||||
==================================================================
|
||||
|
||||
KFENCE also reports on invalid frees, such as double-frees::
|
||||
|
||||
==================================================================
|
||||
BUG: KFENCE: invalid free in test_double_free+0xdc/0x171
|
||||
|
||||
Invalid free of 0xffffffffb6741000:
|
||||
test_double_free+0xdc/0x171
|
||||
kunit_try_run_case+0x51/0x85
|
||||
kunit_generic_run_threadfn_adapter+0x16/0x30
|
||||
kthread+0x137/0x160
|
||||
ret_from_fork+0x22/0x30
|
||||
|
||||
kfence-#26 [0xffffffffb6741000-0xffffffffb674101f, size=32, cache=kmalloc-32] allocated by task 507:
|
||||
test_alloc+0xf3/0x25b
|
||||
test_double_free+0x76/0x171
|
||||
kunit_try_run_case+0x51/0x85
|
||||
kunit_generic_run_threadfn_adapter+0x16/0x30
|
||||
kthread+0x137/0x160
|
||||
ret_from_fork+0x22/0x30
|
||||
|
||||
freed by task 507:
|
||||
test_double_free+0xa8/0x171
|
||||
kunit_try_run_case+0x51/0x85
|
||||
kunit_generic_run_threadfn_adapter+0x16/0x30
|
||||
kthread+0x137/0x160
|
||||
ret_from_fork+0x22/0x30
|
||||
|
||||
CPU: 4 PID: 111 Comm: kunit_try_catch Tainted: G W 5.8.0-rc6+ #7
|
||||
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.13.0-1 04/01/2014
|
||||
==================================================================
|
||||
|
||||
KFENCE also uses pattern-based redzones on the other side of an object's guard
|
||||
page, to detect out-of-bounds writes on the unprotected side of the object.
|
||||
These are reported on frees::
|
||||
|
||||
==================================================================
|
||||
BUG: KFENCE: memory corruption in test_kmalloc_aligned_oob_write+0xef/0x184
|
||||
|
||||
Corrupted memory at 0xffffffffb6797ff9 [ 0xac . . . . . . ] (in kfence-#69):
|
||||
test_kmalloc_aligned_oob_write+0xef/0x184
|
||||
kunit_try_run_case+0x51/0x85
|
||||
kunit_generic_run_threadfn_adapter+0x16/0x30
|
||||
kthread+0x137/0x160
|
||||
ret_from_fork+0x22/0x30
|
||||
|
||||
kfence-#69 [0xffffffffb6797fb0-0xffffffffb6797ff8, size=73, cache=kmalloc-96] allocated by task 507:
|
||||
test_alloc+0xf3/0x25b
|
||||
test_kmalloc_aligned_oob_write+0x57/0x184
|
||||
kunit_try_run_case+0x51/0x85
|
||||
kunit_generic_run_threadfn_adapter+0x16/0x30
|
||||
kthread+0x137/0x160
|
||||
ret_from_fork+0x22/0x30
|
||||
|
||||
CPU: 4 PID: 120 Comm: kunit_try_catch Tainted: G W 5.8.0-rc6+ #7
|
||||
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.13.0-1 04/01/2014
|
||||
==================================================================
|
||||
|
||||
For such errors, the address where the corruption occurred as well as the
|
||||
invalidly written bytes (offset from the address) are shown; in this
|
||||
representation, '.' denote untouched bytes. In the example above ``0xac`` is
|
||||
the value written to the invalid address at offset 0, and the remaining '.'
|
||||
denote that no following bytes have been touched. Note that, real values are
|
||||
only shown if the kernel was booted with ``no_hash_pointers``; to avoid
|
||||
information disclosure otherwise, '!' is used instead to denote invalidly
|
||||
written bytes.
|
||||
|
||||
And finally, KFENCE may also report on invalid accesses to any protected page
|
||||
where it was not possible to determine an associated object, e.g. if adjacent
|
||||
object pages had not yet been allocated::
|
||||
|
||||
==================================================================
|
||||
BUG: KFENCE: invalid read in test_invalid_access+0x26/0xe0
|
||||
|
||||
Invalid read at 0xffffffffb670b00a:
|
||||
test_invalid_access+0x26/0xe0
|
||||
kunit_try_run_case+0x51/0x85
|
||||
kunit_generic_run_threadfn_adapter+0x16/0x30
|
||||
kthread+0x137/0x160
|
||||
ret_from_fork+0x22/0x30
|
||||
|
||||
CPU: 4 PID: 124 Comm: kunit_try_catch Tainted: G W 5.8.0-rc6+ #7
|
||||
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.13.0-1 04/01/2014
|
||||
==================================================================
|
||||
|
||||
DebugFS interface
|
||||
~~~~~~~~~~~~~~~~~
|
||||
|
||||
Some debugging information is exposed via debugfs:
|
||||
|
||||
* The file ``/sys/kernel/debug/kfence/stats`` provides runtime statistics.
|
||||
|
||||
* The file ``/sys/kernel/debug/kfence/objects`` provides a list of objects
|
||||
allocated via KFENCE, including those already freed but protected.
|
||||
|
||||
Implementation Details
|
||||
----------------------
|
||||
|
||||
Guarded allocations are set up based on the sample interval. After expiration
|
||||
of the sample interval, the next allocation through the main allocator (SLAB or
|
||||
SLUB) returns a guarded allocation from the KFENCE object pool (allocation
|
||||
sizes up to PAGE_SIZE are supported). At this point, the timer is reset, and
|
||||
the next allocation is set up after the expiration of the interval. To "gate" a
|
||||
KFENCE allocation through the main allocator's fast-path without overhead,
|
||||
KFENCE relies on static branches via the static keys infrastructure. The static
|
||||
branch is toggled to redirect the allocation to KFENCE.
|
||||
|
||||
KFENCE objects each reside on a dedicated page, at either the left or right
|
||||
page boundaries selected at random. The pages to the left and right of the
|
||||
object page are "guard pages", whose attributes are changed to a protected
|
||||
state, and cause page faults on any attempted access. Such page faults are then
|
||||
intercepted by KFENCE, which handles the fault gracefully by reporting an
|
||||
out-of-bounds access, and marking the page as accessible so that the faulting
|
||||
code can (wrongly) continue executing (set ``panic_on_warn`` to panic instead).
|
||||
|
||||
To detect out-of-bounds writes to memory within the object's page itself,
|
||||
KFENCE also uses pattern-based redzones. For each object page, a redzone is set
|
||||
up for all non-object memory. For typical alignments, the redzone is only
|
||||
required on the unguarded side of an object. Because KFENCE must honor the
|
||||
cache's requested alignment, special alignments may result in unprotected gaps
|
||||
on either side of an object, all of which are redzoned.
|
||||
|
||||
The following figure illustrates the page layout::
|
||||
|
||||
---+-----------+-----------+-----------+-----------+-----------+---
|
||||
| xxxxxxxxx | O : | xxxxxxxxx | : O | xxxxxxxxx |
|
||||
| xxxxxxxxx | B : | xxxxxxxxx | : B | xxxxxxxxx |
|
||||
| x GUARD x | J : RED- | x GUARD x | RED- : J | x GUARD x |
|
||||
| xxxxxxxxx | E : ZONE | xxxxxxxxx | ZONE : E | xxxxxxxxx |
|
||||
| xxxxxxxxx | C : | xxxxxxxxx | : C | xxxxxxxxx |
|
||||
| xxxxxxxxx | T : | xxxxxxxxx | : T | xxxxxxxxx |
|
||||
---+-----------+-----------+-----------+-----------+-----------+---
|
||||
|
||||
Upon deallocation of a KFENCE object, the object's page is again protected and
|
||||
the object is marked as freed. Any further access to the object causes a fault
|
||||
and KFENCE reports a use-after-free access. Freed objects are inserted at the
|
||||
tail of KFENCE's freelist, so that the least recently freed objects are reused
|
||||
first, and the chances of detecting use-after-frees of recently freed objects
|
||||
is increased.
|
||||
|
||||
Interface
|
||||
---------
|
||||
|
||||
The following describes the functions which are used by allocators as well as
|
||||
page handling code to set up and deal with KFENCE allocations.
|
||||
|
||||
.. kernel-doc:: include/linux/kfence.h
|
||||
:functions: is_kfence_address
|
||||
kfence_shutdown_cache
|
||||
kfence_alloc kfence_free __kfence_free
|
||||
kfence_ksize kfence_object_start
|
||||
kfence_handle_page_fault
|
||||
|
||||
Related Tools
|
||||
-------------
|
||||
|
||||
In userspace, a similar approach is taken by `GWP-ASan
|
||||
<http://llvm.org/docs/GwpAsan.html>`_. GWP-ASan also relies on guard pages and
|
||||
a sampling strategy to detect memory unsafety bugs at scale. KFENCE's design is
|
||||
directly influenced by GWP-ASan, and can be seen as its kernel sibling. Another
|
||||
similar but non-sampling approach, that also inspired the name "KFENCE", can be
|
||||
found in the userspace `Electric Fence Malloc Debugger
|
||||
<https://linux.die.net/man/3/efence>`_.
|
||||
|
||||
In the kernel, several tools exist to debug memory access errors, and in
|
||||
particular KASAN can detect all bug classes that KFENCE can detect. While KASAN
|
||||
is more precise, relying on compiler instrumentation, this comes at a
|
||||
performance cost.
|
||||
|
||||
It is worth highlighting that KASAN and KFENCE are complementary, with
|
||||
different target environments. For instance, KASAN is the better debugging-aid,
|
||||
where test cases or reproducers exists: due to the lower chance to detect the
|
||||
error, it would require more effort using KFENCE to debug. Deployments at scale
|
||||
that cannot afford to enable KASAN, however, would benefit from using KFENCE to
|
||||
discover bugs due to code paths not exercised by test cases or fuzzers.
|
||||
|
|
@ -46,8 +46,10 @@ non-privileged mounts. This opens up new possibilities for the use of
|
|||
filesystems. A good example is sshfs: a secure network filesystem
|
||||
using the sftp protocol.
|
||||
|
||||
The userspace library and utilities are available from the
|
||||
`FUSE homepage: <https://github.com/libfuse/>`_
|
||||
The userspace library and utilities are available from the FUSE
|
||||
homepage:
|
||||
|
||||
http://fuse.sourceforge.net/
|
||||
|
||||
Filesystem type
|
||||
~~~~~~~~~~~~~~~
|
||||
|
|
|
|||
|
|
@ -1823,20 +1823,18 @@ if precise results are needed.
|
|||
3.8 /proc/<pid>/fdinfo/<fd> - Information about opened file
|
||||
---------------------------------------------------------------
|
||||
This file provides information associated with an opened file. The regular
|
||||
files have at least four fields -- 'pos', 'flags', 'mnt_id' and 'ino'.
|
||||
The 'pos' represents the current offset of the opened file in decimal
|
||||
form [see lseek(2) for details], 'flags' denotes the octal O_xxx mask the
|
||||
file has been created with [see open(2) for details] and 'mnt_id' represents
|
||||
mount ID of the file system containing the opened file [see 3.5
|
||||
/proc/<pid>/mountinfo for details]. 'ino' represents the inode number of
|
||||
the file.
|
||||
files have at least three fields -- 'pos', 'flags' and mnt_id. The 'pos'
|
||||
represents the current offset of the opened file in decimal form [see lseek(2)
|
||||
for details], 'flags' denotes the octal O_xxx mask the file has been
|
||||
created with [see open(2) for details] and 'mnt_id' represents mount ID of
|
||||
the file system containing the opened file [see 3.5 /proc/<pid>/mountinfo
|
||||
for details].
|
||||
|
||||
A typical output is
|
||||
|
||||
pos: 0
|
||||
flags: 0100002
|
||||
mnt_id: 19
|
||||
ino: 63107
|
||||
|
||||
All locks associated with a file descriptor are shown in its fdinfo too.
|
||||
|
||||
|
|
@ -1850,7 +1848,6 @@ pair provide additional information particular to the objects they represent.
|
|||
pos: 0
|
||||
flags: 04002
|
||||
mnt_id: 9
|
||||
ino: 63107
|
||||
eventfd-count: 5a
|
||||
|
||||
where 'eventfd-count' is hex value of a counter.
|
||||
|
|
@ -1860,7 +1857,6 @@ pair provide additional information particular to the objects they represent.
|
|||
pos: 0
|
||||
flags: 04002
|
||||
mnt_id: 9
|
||||
ino: 63107
|
||||
sigmask: 0000000000000200
|
||||
|
||||
where 'sigmask' is hex value of the signal mask associated
|
||||
|
|
@ -1871,7 +1867,6 @@ pair provide additional information particular to the objects they represent.
|
|||
pos: 0
|
||||
flags: 02
|
||||
mnt_id: 9
|
||||
ino: 63107
|
||||
tfd: 5 events: 1d data: ffffffffffffffff pos:0 ino:61af sdev:7
|
||||
|
||||
where 'tfd' is a target file descriptor number in decimal form,
|
||||
|
|
@ -1888,8 +1883,6 @@ pair provide additional information particular to the objects they represent.
|
|||
|
||||
pos: 0
|
||||
flags: 02000000
|
||||
mnt_id: 9
|
||||
ino: 63107
|
||||
inotify wd:3 ino:9e7e sdev:800013 mask:800afce ignored_mask:0 fhandle-bytes:8 fhandle-type:1 f_handle:7e9e0000640d1b6d
|
||||
|
||||
where 'wd' is a watch descriptor in decimal form, ie a target file
|
||||
|
|
@ -1912,7 +1905,6 @@ pair provide additional information particular to the objects they represent.
|
|||
pos: 0
|
||||
flags: 02
|
||||
mnt_id: 9
|
||||
ino: 63107
|
||||
fanotify flags:10 event-flags:0
|
||||
fanotify mnt_id:12 mflags:40 mask:38 ignored_mask:40000003
|
||||
fanotify ino:4f969 sdev:800013 mflags:0 mask:3b ignored_mask:40000000 fhandle-bytes:8 fhandle-type:1 f_handle:69f90400c275b5b4
|
||||
|
|
@ -1935,7 +1927,6 @@ pair provide additional information particular to the objects they represent.
|
|||
pos: 0
|
||||
flags: 02
|
||||
mnt_id: 9
|
||||
ino: 63107
|
||||
clockid: 0
|
||||
ticks: 0
|
||||
settime flags: 01
|
||||
|
|
@ -1950,22 +1941,6 @@ pair provide additional information particular to the objects they represent.
|
|||
with TIMER_ABSTIME option which will be shown in 'settime flags', but 'it_value'
|
||||
still exhibits timer's remaining time.
|
||||
|
||||
DMA Buffer files
|
||||
~~~~~~~~~~~~~~~~
|
||||
|
||||
::
|
||||
|
||||
pos: 0
|
||||
flags: 04002
|
||||
mnt_id: 9
|
||||
ino: 63107
|
||||
size: 32768
|
||||
count: 2
|
||||
exp_name: system-heap
|
||||
|
||||
where 'size' is the size of the DMA buffer in bytes. 'count' is the file count of
|
||||
the DMA buffer file. 'exp_name' is the name of the DMA buffer exporter.
|
||||
|
||||
3.9 /proc/<pid>/map_files - Information about memory mapped files
|
||||
---------------------------------------------------------------------
|
||||
This directory contains symbolic links which represent memory mapped files
|
||||
|
|
|
|||
|
|
@ -1660,14 +1660,6 @@ accept_ra_min_hop_limit - INTEGER
|
|||
|
||||
Default: 1
|
||||
|
||||
accept_ra_min_lft - INTEGER
|
||||
Minimum acceptable lifetime value in Router Advertisement.
|
||||
|
||||
RA sections with a lifetime less than this value shall be
|
||||
ignored. Zero lifetimes stay unaffected.
|
||||
|
||||
Default: 0
|
||||
|
||||
accept_ra_pinfo - BOOLEAN
|
||||
Learn Prefix Information in Router Advertisement.
|
||||
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ SipHash - a short input PRF
|
|||
SipHash is a cryptographically secure PRF -- a keyed hash function -- that
|
||||
performs very well for short inputs, hence the name. It was designed by
|
||||
cryptographers Daniel J. Bernstein and Jean-Philippe Aumasson. It is intended
|
||||
as a replacement for some uses of: `jhash`, `md5_transform`, `sha1_transform`,
|
||||
as a replacement for some uses of: `jhash`, `md5_transform`, `sha_transform`,
|
||||
and so forth.
|
||||
|
||||
SipHash takes a secret key filled with randomly generated numbers and either
|
||||
|
|
|
|||
|
|
@ -170,14 +170,6 @@ FTRACE_OPS_FL_RCU
|
|||
a callback may be executed and RCU synchronization will not protect
|
||||
it.
|
||||
|
||||
FTRACE_OPS_FL_PERMANENT
|
||||
If this is set on any ftrace ops, then the tracing cannot disabled by
|
||||
writing 0 to the proc sysctl ftrace_enabled. Equally, a callback with
|
||||
the flag set cannot be registered if ftrace_enabled is 0.
|
||||
|
||||
Livepatch uses it not to lose the function redirection, so the system
|
||||
stays protected.
|
||||
|
||||
|
||||
Filtering which functions to trace
|
||||
==================================
|
||||
|
|
|
|||
|
|
@ -2976,9 +2976,7 @@ Note, the proc sysctl ftrace_enable is a big on/off switch for the
|
|||
function tracer. By default it is enabled (when function tracing is
|
||||
enabled in the kernel). If it is disabled, all function tracing is
|
||||
disabled. This includes not only the function tracers for ftrace, but
|
||||
also for any other uses (perf, kprobes, stack tracing, profiling, etc). It
|
||||
cannot be disabled if there is a callback with FTRACE_OPS_FL_PERMANENT set
|
||||
registered.
|
||||
also for any other uses (perf, kprobes, stack tracing, profiling, etc).
|
||||
|
||||
Please disable this with care.
|
||||
|
||||
|
|
|
|||
|
|
@ -3054,7 +3054,6 @@ R: Martin KaFai Lau <kafai@fb.com>
|
|||
R: Song Liu <songliubraving@fb.com>
|
||||
R: Yonghong Song <yhs@fb.com>
|
||||
R: Andrii Nakryiko <andriin@fb.com>
|
||||
R: KP Singh <kpsingh@chromium.org>
|
||||
L: netdev@vger.kernel.org
|
||||
L: bpf@vger.kernel.org
|
||||
T: git git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf.git
|
||||
|
|
@ -6742,8 +6741,7 @@ F: drivers/platform/x86/fujitsu-tablet.c
|
|||
FUSE: FILESYSTEM IN USERSPACE
|
||||
M: Miklos Szeredi <miklos@szeredi.hu>
|
||||
L: linux-fsdevel@vger.kernel.org
|
||||
S: Maintained
|
||||
W: https://github.com/libfuse/
|
||||
W: http://fuse.sourceforge.net/
|
||||
T: git git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/fuse.git
|
||||
S: Maintained
|
||||
F: fs/fuse/
|
||||
|
|
@ -9141,7 +9139,6 @@ F: include/linux/skmsg.h
|
|||
F: net/core/skmsg.c
|
||||
F: net/core/sock_map.c
|
||||
F: net/ipv4/tcp_bpf.c
|
||||
F: net/ipv4/udp_bpf.c
|
||||
|
||||
LANTIQ / INTEL Ethernet drivers
|
||||
M: Hauke Mehrtens <hauke@hauke-m.de>
|
||||
|
|
@ -12851,7 +12848,6 @@ S: Maintained
|
|||
T: git git://git.kernel.org/pub/scm/linux/kernel/git/brauner/linux.git
|
||||
F: samples/pidfd/
|
||||
F: tools/testing/selftests/pidfd/
|
||||
F: tools/testing/selftests/clone3/
|
||||
K: (?i)pidfd
|
||||
K: (?i)clone3
|
||||
K: \b(clone_args|kernel_clone_args)\b
|
||||
|
|
@ -14626,7 +14622,6 @@ F: include/uapi/linux/selinux_netlink.h
|
|||
F: security/selinux/
|
||||
F: scripts/selinux/
|
||||
F: Documentation/admin-guide/LSM/SELinux.rst
|
||||
F: Documentation/ABI/obsolete/sysfs-selinux-disable
|
||||
|
||||
SENSABLE PHANTOM
|
||||
M: Jiri Slaby <jirislaby@gmail.com>
|
||||
|
|
|
|||
28
Makefile
28
Makefile
|
|
@ -1,7 +1,7 @@
|
|||
# SPDX-License-Identifier: GPL-2.0
|
||||
VERSION = 5
|
||||
PATCHLEVEL = 4
|
||||
SUBLEVEL = 302
|
||||
SUBLEVEL = 300
|
||||
EXTRAVERSION =
|
||||
NAME = Kleptomaniac Octopus
|
||||
|
||||
|
|
@ -447,7 +447,6 @@ OBJSIZE = $(CROSS_COMPILE)size
|
|||
STRIP = $(CROSS_COMPILE)strip
|
||||
endif
|
||||
PAHOLE = pahole
|
||||
RESOLVE_BTFIDS = $(objtree)/tools/bpf/resolve_btfids/resolve_btfids
|
||||
LEX = flex
|
||||
YACC = bison
|
||||
AWK = awk
|
||||
|
|
@ -510,7 +509,7 @@ GCC_PLUGINS_CFLAGS :=
|
|||
CLANG_FLAGS :=
|
||||
|
||||
export ARCH SRCARCH CONFIG_SHELL BASH HOSTCC KBUILD_HOSTCFLAGS CROSS_COMPILE LD CC
|
||||
export CPP AR NM STRIP OBJCOPY OBJDUMP OBJSIZE READELF PAHOLE RESOLVE_BTFIDS LEX YACC AWK INSTALLKERNEL
|
||||
export CPP AR NM STRIP OBJCOPY OBJDUMP OBJSIZE READELF PAHOLE LEX YACC AWK INSTALLKERNEL
|
||||
export PERL PYTHON PYTHON3 CHECK CHECKFLAGS MAKE UTS_MACHINE HOSTCXX
|
||||
export KGZIP KBZIP2 KLZOP LZMA LZ4 XZ
|
||||
export KBUILD_HOSTCXXFLAGS KBUILD_HOSTLDFLAGS KBUILD_HOSTLDLIBS LDFLAGS_MODULE
|
||||
|
|
@ -596,11 +595,9 @@ CLANG_FLAGS += --target=$(notdir $(CROSS_COMPILE:%-=%))
|
|||
endif # CROSS_COMPILE
|
||||
|
||||
ifeq ($(LLVM_IAS),0)
|
||||
CLANG_FLAGS += -fno-integrated-as
|
||||
CLANG_FLAGS += -no-integrated-as
|
||||
GCC_TOOLCHAIN_DIR := $(dir $(shell which $(CROSS_COMPILE)elfedit))
|
||||
CLANG_FLAGS += --prefix=$(GCC_TOOLCHAIN_DIR)$(notdir $(CROSS_COMPILE))
|
||||
else
|
||||
CLANG_FLAGS += -fintegrated-as
|
||||
endif
|
||||
CLANG_FLAGS += -Werror=unknown-warning-option
|
||||
KBUILD_CPPFLAGS += $(CLANG_FLAGS)
|
||||
|
|
@ -873,8 +870,7 @@ DEBUG_CFLAGS += -gsplit-dwarf
|
|||
else
|
||||
DEBUG_CFLAGS += -g
|
||||
endif
|
||||
|
||||
ifdef CONFIG_AS_IS_LLVM
|
||||
ifeq ($(LLVM_IAS),1)
|
||||
KBUILD_AFLAGS += -g
|
||||
else
|
||||
KBUILD_AFLAGS += -Wa,-gdwarf-2
|
||||
|
|
@ -947,6 +943,7 @@ endif
|
|||
ifdef CONFIG_LTO_CLANG
|
||||
ifdef CONFIG_THINLTO
|
||||
CC_FLAGS_LTO_CLANG := -flto=thin $(call cc-option, -fsplit-lto-unit)
|
||||
KBUILD_LDFLAGS += --thinlto-cache-dir=.thinlto-cache
|
||||
else
|
||||
CC_FLAGS_LTO_CLANG := -flto
|
||||
endif
|
||||
|
|
@ -963,8 +960,7 @@ endif
|
|||
|
||||
ifdef CONFIG_LTO
|
||||
CC_FLAGS_LTO := $(CC_FLAGS_LTO_CLANG)
|
||||
KBUILD_CFLAGS += -fno-lto $(CC_FLAGS_LTO)
|
||||
KBUILD_AFLAGS += -fno-lto
|
||||
KBUILD_CFLAGS += $(CC_FLAGS_LTO)
|
||||
export CC_FLAGS_LTO
|
||||
endif
|
||||
|
||||
|
|
@ -1017,6 +1013,15 @@ KBUILD_CFLAGS += $(call cc-disable-warning, maybe-uninitialized)
|
|||
# disable invalid "can't wrap" optimizations for signed / pointers
|
||||
KBUILD_CFLAGS += $(call cc-option,-fno-strict-overflow)
|
||||
|
||||
# clang sets -fmerge-all-constants by default as optimization, but this
|
||||
# is non-conforming behavior for C and in fact breaks the kernel, so we
|
||||
# need to disable it here generally.
|
||||
KBUILD_CFLAGS += $(call cc-option,-fno-merge-all-constants)
|
||||
|
||||
# for gcc -fno-merge-all-constants disables everything, but it is fine
|
||||
# to have actual conforming behavior enabled.
|
||||
KBUILD_CFLAGS += $(call cc-option,-fmerge-constants)
|
||||
|
||||
# Make sure -fstack-check isn't enabled (like gentoo apparently did)
|
||||
KBUILD_CFLAGS += $(call cc-option,-fno-stack-check,)
|
||||
|
||||
|
|
@ -1058,8 +1063,7 @@ LDFLAGS_vmlinux += $(call ld-option, -X,)
|
|||
endif
|
||||
|
||||
ifeq ($(CONFIG_RELR),y)
|
||||
# ld.lld before 15 did not support -z pack-relative-relocs.
|
||||
LDFLAGS_vmlinux += $(call ld-option,--pack-dyn-relocs=relr,-z pack-relative-relocs)
|
||||
LDFLAGS_vmlinux += --pack-dyn-relocs=relr --use-android-relr-tags
|
||||
endif
|
||||
|
||||
# userspace programs are linked via the compiler, use the correct linker
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
LTS_5.4.302_91d385eb2a41
|
||||
LTS_5.4.281_d62984adb112
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -124,8 +124,6 @@
|
|||
|
||||
#define SO_DETACH_REUSEPORT_BPF 68
|
||||
|
||||
#define SO_NETNS_COOKIE 71
|
||||
|
||||
#if !defined(__KERNEL__)
|
||||
|
||||
#if __BITS_PER_LONG == 64
|
||||
|
|
|
|||
|
|
@ -475,9 +475,8 @@
|
|||
543 common fspick sys_fspick
|
||||
544 common pidfd_open sys_pidfd_open
|
||||
# 545 reserved for clone3
|
||||
546 common close_range sys_close_range
|
||||
# 546 reserved for close_range
|
||||
# 547 reserved for openat2
|
||||
# 548 reserved for pidfd_getfd
|
||||
# 549 reserved for faccessat2
|
||||
550 common process_madvise sys_process_madvise
|
||||
551 common epoll_pwait2 sys_epoll_pwait2
|
||||
|
|
|
|||
|
|
@ -371,8 +371,6 @@ static inline __attribute__ ((const)) int fls(unsigned long x)
|
|||
*/
|
||||
static inline __attribute__ ((const)) int __fls(unsigned long x)
|
||||
{
|
||||
if (__builtin_constant_p(x))
|
||||
return x ? BITS_PER_LONG - 1 - __builtin_clzl(x) : 0;
|
||||
/* FLS insn has exactly same semantics as the API */
|
||||
return __builtin_arc_fls(x);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,7 +16,6 @@ config ARM
|
|||
select ARCH_HAS_KEEPINITRD
|
||||
select ARCH_HAS_KCOV
|
||||
select ARCH_HAS_MEMBARRIER_SYNC_CORE
|
||||
select ARCH_HAS_NON_OVERLAPPING_ADDRESS_SPACE
|
||||
select ARCH_HAS_PTE_SPECIAL if ARM_LPAE
|
||||
select ARCH_HAS_PHYS_TO_DMA
|
||||
select ARCH_HAS_SETUP_DMA_OPS
|
||||
|
|
|
|||
6
arch/arm/configs/vendor/sdxlemur.config
vendored
6
arch/arm/configs/vendor/sdxlemur.config
vendored
|
|
@ -51,10 +51,6 @@ CONFIG_CNSS_ASYNC=y
|
|||
CONFIG_CNSS_QCA6490=y
|
||||
CONFIG_CNSS_UTILS=y
|
||||
# CONFIG_CNSS_GENL is not set
|
||||
CONFIG_CNSS=m
|
||||
CONFIG_CNSS_CRYPTO=y
|
||||
CONFIG_CNSS_PCI=y
|
||||
CONFIG_CNSS_LOGGER=m
|
||||
CONFIG_QCOM_MEMORY_DUMP_V2=y
|
||||
CONFIG_PACKET=y
|
||||
CONFIG_UNIX=y
|
||||
|
|
@ -254,7 +250,7 @@ CONFIG_USB_CONFIGFS_F_UAC2=y
|
|||
CONFIG_USB_CONFIGFS_F_CCID=y
|
||||
CONFIG_USB_G_QTI=y
|
||||
CONFIG_USB_BAM=y
|
||||
CONFIG_USB_R8152_RTL=m
|
||||
CONFIG_USB_RTL8152=y
|
||||
CONFIG_USB_NET_SMSC75XX=y
|
||||
CONFIG_USB_NET_SMSC95XX=y
|
||||
CONFIG_ARM_PSCI=y
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ generic-y += mmiowb.h
|
|||
generic-y += msi.h
|
||||
generic-y += parport.h
|
||||
generic-y += preempt.h
|
||||
generic-y += seccomp.h
|
||||
generic-y += serial.h
|
||||
generic-y += trace_clock.h
|
||||
|
||||
|
|
|
|||
|
|
@ -1,11 +0,0 @@
|
|||
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||
#ifndef _ASM_SECCOMP_H
|
||||
#define _ASM_SECCOMP_H
|
||||
|
||||
#include <asm-generic/seccomp.h>
|
||||
|
||||
#define SECCOMP_ARCH_NATIVE AUDIT_ARCH_ARM
|
||||
#define SECCOMP_ARCH_NATIVE_NR NR_syscalls
|
||||
#define SECCOMP_ARCH_NATIVE_NAME "arm"
|
||||
|
||||
#endif /* _ASM_SECCOMP_H */
|
||||
|
|
@ -91,8 +91,7 @@ static int ftrace_modify_code(unsigned long pc, unsigned long old,
|
|||
}
|
||||
|
||||
if (validate) {
|
||||
if (copy_from_kernel_nofault(&replaced, (void *)pc,
|
||||
MCOUNT_INSN_SIZE))
|
||||
if (probe_kernel_read(&replaced, (void *)pc, MCOUNT_INSN_SIZE))
|
||||
return -EFAULT;
|
||||
|
||||
if (replaced != old)
|
||||
|
|
|
|||
|
|
@ -256,7 +256,7 @@ int kgdb_arch_set_breakpoint(struct kgdb_bkpt *bpt)
|
|||
/* patch_text() only supports int-sized breakpoints */
|
||||
BUILD_BUG_ON(sizeof(int) != BREAK_INSTR_SIZE);
|
||||
|
||||
err = copy_from_kernel_nofault(bpt->saved_instr, (char *)bpt->bpt_addr,
|
||||
err = probe_kernel_read(bpt->saved_instr, (char *)bpt->bpt_addr,
|
||||
BREAK_INSTR_SIZE);
|
||||
if (err)
|
||||
return err;
|
||||
|
|
|
|||
|
|
@ -391,7 +391,7 @@ int is_valid_bugaddr(unsigned long pc)
|
|||
u32 insn = __opcode_to_mem_arm(BUG_INSTR_VALUE);
|
||||
#endif
|
||||
|
||||
if (get_kernel_nofault(bkpt, (unsigned *)pc))
|
||||
if (probe_kernel_address((unsigned *)pc, bkpt))
|
||||
return 0;
|
||||
|
||||
return bkpt == insn;
|
||||
|
|
|
|||
|
|
@ -774,7 +774,7 @@ static int alignment_get_arm(struct pt_regs *regs, u32 *ip, u32 *inst)
|
|||
if (user_mode(regs))
|
||||
fault = get_user(instr, ip);
|
||||
else
|
||||
fault = get_kernel_nofault(instr, ip);
|
||||
fault = probe_kernel_address(ip, instr);
|
||||
|
||||
*inst = __mem_to_opcode_arm(instr);
|
||||
|
||||
|
|
@ -789,7 +789,7 @@ static int alignment_get_thumb(struct pt_regs *regs, u16 *ip, u16 *inst)
|
|||
if (user_mode(regs))
|
||||
fault = get_user(instr, ip);
|
||||
else
|
||||
fault = get_kernel_nofault(instr, ip);
|
||||
fault = probe_kernel_address(ip, instr);
|
||||
|
||||
*inst = __mem_to_opcode_thumb16(instr);
|
||||
|
||||
|
|
|
|||
|
|
@ -449,9 +449,8 @@
|
|||
433 common fspick sys_fspick
|
||||
434 common pidfd_open sys_pidfd_open
|
||||
435 common clone3 sys_clone3
|
||||
436 common close_range sys_close_range
|
||||
# 436 reserved for close_range
|
||||
# 437 reserved for openat2
|
||||
# 438 reserved for pidfd_getfd
|
||||
# 439 reserved for faccessat2
|
||||
440 common process_madvise sys_process_madvise
|
||||
441 common epoll_pwait2 sys_epoll_pwait2
|
||||
|
|
|
|||
|
|
@ -22,7 +22,6 @@ config ARM64
|
|||
select ARCH_HAS_KCOV
|
||||
select ARCH_HAS_KEEPINITRD
|
||||
select ARCH_HAS_MEMBARRIER_SYNC_CORE
|
||||
select ARCH_HAS_NON_OVERLAPPING_ADDRESS_SPACE
|
||||
select ARCH_HAS_PTE_DEVMAP
|
||||
select ARCH_HAS_PTE_SPECIAL
|
||||
select ARCH_HAS_SETUP_DMA_OPS
|
||||
|
|
@ -74,7 +73,6 @@ config ARM64
|
|||
select ARCH_SUPPORTS_INT128 if GCC_VERSION >= 50000 || CC_IS_CLANG
|
||||
select ARCH_SUPPORTS_NUMA_BALANCING
|
||||
select ARCH_WANT_COMPAT_IPC_PARSE_VERSION if COMPAT
|
||||
select ARCH_WANT_DEFAULT_BPF_JIT
|
||||
select ARCH_WANT_DEFAULT_TOPDOWN_MMAP_LAYOUT
|
||||
select ARCH_WANT_FRAME_POINTERS
|
||||
select ARCH_WANT_HUGE_PMD_SHARE if ARM64_4K_PAGES || (ARM64_16K_PAGES && !ARM64_VA_BITS_36)
|
||||
|
|
@ -129,7 +127,6 @@ config ARM64
|
|||
select HAVE_ARCH_JUMP_LABEL_RELATIVE
|
||||
select HAVE_ARCH_KASAN if !(ARM64_16K_PAGES && ARM64_VA_BITS_48)
|
||||
select HAVE_ARCH_KASAN_SW_TAGS if HAVE_ARCH_KASAN
|
||||
select HAVE_ARCH_KFENCE
|
||||
select HAVE_ARCH_KGDB
|
||||
select HAVE_ARCH_MMAP_RND_BITS
|
||||
select HAVE_ARCH_MMAP_RND_COMPAT_BITS if COMPAT
|
||||
|
|
@ -646,7 +643,6 @@ config ARM64_ERRATUM_3194386
|
|||
* ARM Neoverse-V1 erratum 3324341
|
||||
* ARM Neoverse V2 erratum 3324336
|
||||
* ARM Neoverse-V3 erratum 3312417
|
||||
* ARM Neoverse-V3AE erratum 3312417
|
||||
|
||||
On affected cores "MSR SSBS, #0" instructions may not affect
|
||||
subsequent speculative instructions, which may permit unexepected
|
||||
|
|
|
|||
|
|
@ -1599,8 +1599,6 @@
|
|||
hexagon_smp2p_in: slave-kernel {
|
||||
qcom,entry-name = "slave-kernel";
|
||||
|
||||
resets = <&gcc GCC_MDSS_BCR>;
|
||||
|
||||
interrupt-controller;
|
||||
#interrupt-cells = <2>;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -187,7 +187,7 @@
|
|||
label = "google_key";
|
||||
gpios = <&tlmm 11 GPIO_ACTIVE_LOW>;
|
||||
linux,input-type = <1>;
|
||||
linux,code = <KEY_ASSISTANT>;
|
||||
linux,code = <KEY_SEARCH>;
|
||||
gpio-key,wakeup;
|
||||
debounce-interval = <15>;
|
||||
linux,can-disable;
|
||||
|
|
|
|||
|
|
@ -628,7 +628,7 @@
|
|||
label = "google_key";
|
||||
gpios = <&tlmm 60 GPIO_ACTIVE_LOW>;
|
||||
linux,input-type = <1>;
|
||||
linux,code = <KEY_ASSISTANT>;
|
||||
linux,code = <KEY_SEARCH>;
|
||||
gpio-key,wakeup;
|
||||
debounce-interval = <15>;
|
||||
linux,can-disable;
|
||||
|
|
|
|||
|
|
@ -152,7 +152,7 @@
|
|||
label = "google_key";
|
||||
gpios = <&tlmm 11 GPIO_ACTIVE_LOW>;
|
||||
linux,input-type = <1>;
|
||||
linux,code = <KEY_ASSISTANT>;
|
||||
linux,code = <KEY_SEARCH>;
|
||||
gpio-key,wakeup;
|
||||
debounce-interval = <15>;
|
||||
linux,can-disable;
|
||||
|
|
|
|||
|
|
@ -340,7 +340,7 @@
|
|||
label = "google_key";
|
||||
gpios = <&tlmm 11 GPIO_ACTIVE_LOW>;
|
||||
linux,input-type = <1>;
|
||||
linux,code = <KEY_ASSISTANT>;
|
||||
linux,code = <KEY_SEARCH>;
|
||||
gpio-key,wakeup;
|
||||
debounce-interval = <15>;
|
||||
linux,can-disable;
|
||||
|
|
|
|||
|
|
@ -135,7 +135,7 @@
|
|||
label = "google_key";
|
||||
gpios = <&tlmm 11 GPIO_ACTIVE_LOW>;
|
||||
linux,input-type = <1>;
|
||||
linux,code = <KEY_ASSISTANT>;
|
||||
linux,code = <KEY_SEARCH>;
|
||||
gpio-key,wakeup;
|
||||
debounce-interval = <15>;
|
||||
linux,can-disable;
|
||||
|
|
|
|||
|
|
@ -209,27 +209,14 @@ CONFIG_L2TP=y
|
|||
CONFIG_BRIDGE=y
|
||||
CONFIG_NET_SCHED=y
|
||||
CONFIG_NET_SCH_HTB=y
|
||||
CONFIG_NET_SCH_PRIO=y
|
||||
CONFIG_NET_SCH_MULTIQ=y
|
||||
CONFIG_NET_SCH_TBF=y
|
||||
CONFIG_NET_SCH_NETEM=y
|
||||
CONFIG_NET_SCH_INGRESS=y
|
||||
CONFIG_NET_CLS_U32=y
|
||||
CONFIG_CLS_U32_MARK=y
|
||||
CONFIG_NET_CLS_FLOW=y
|
||||
CONFIG_NET_CLS_BPF=y
|
||||
CONFIG_NET_CLS_MATCHALL=y
|
||||
CONFIG_NET_EMATCH=y
|
||||
CONFIG_NET_EMATCH_CMP=y
|
||||
CONFIG_NET_EMATCH_NBYTE=y
|
||||
CONFIG_NET_EMATCH_U32=y
|
||||
CONFIG_NET_EMATCH_META=y
|
||||
CONFIG_NET_EMATCH_TEXT=y
|
||||
CONFIG_NET_CLS_ACT=y
|
||||
CONFIG_NET_ACT_POLICE=y
|
||||
CONFIG_NET_ACT_GACT=y
|
||||
CONFIG_NET_ACT_MIRRED=y
|
||||
CONFIG_NET_ACT_SKBEDIT=y
|
||||
CONFIG_NET_ACT_BPF=y
|
||||
CONFIG_BPF_JIT=y
|
||||
CONFIG_BT=y
|
||||
|
|
@ -326,8 +313,6 @@ CONFIG_KEYBOARD_GPIO=y
|
|||
# CONFIG_INPUT_MOUSE is not set
|
||||
CONFIG_INPUT_JOYSTICK=y
|
||||
CONFIG_JOYSTICK_XPAD=y
|
||||
CONFIG_JOYSTICK_XPAD_FF=y
|
||||
CONFIG_JOYSTICK_XPAD_LEDS=y
|
||||
CONFIG_INPUT_TOUCHSCREEN=y
|
||||
CONFIG_INPUT_MISC=y
|
||||
CONFIG_INPUT_UINPUT=y
|
||||
|
|
@ -408,7 +393,6 @@ CONFIG_HID_BATTERY_STRENGTH=y
|
|||
CONFIG_HIDRAW=y
|
||||
CONFIG_UHID=y
|
||||
CONFIG_HID_APPLE=y
|
||||
CONFIG_HID_BETOP_FF=y
|
||||
CONFIG_HID_PRODIKEYS=y
|
||||
CONFIG_HID_ELECOM=y
|
||||
CONFIG_HID_UCLOGIC=y
|
||||
|
|
@ -513,7 +497,6 @@ CONFIG_FS_VERITY_BUILTIN_SIGNATURES=y
|
|||
CONFIG_QUOTA=y
|
||||
CONFIG_QFMT_V2=y
|
||||
CONFIG_FUSE_FS=y
|
||||
CONFIG_FUSE_BPF=y
|
||||
CONFIG_OVERLAY_FS=y
|
||||
CONFIG_MSDOS_FS=y
|
||||
CONFIG_VFAT_FS=y
|
||||
|
|
@ -603,9 +586,6 @@ CONFIG_DEBUG_INFO_DWARF4=y
|
|||
CONFIG_MAGIC_SYSRQ=y
|
||||
CONFIG_DEBUG_STACK_USAGE=y
|
||||
CONFIG_DEBUG_MEMORY_INIT=y
|
||||
CONFIG_KFENCE=y
|
||||
CONFIG_KFENCE_SAMPLE_INTERVAL=500
|
||||
CONFIG_KFENCE_NUM_OBJECTS=63
|
||||
CONFIG_SOFTLOCKUP_DETECTOR=y
|
||||
# CONFIG_DETECT_HUNG_TASK is not set
|
||||
CONFIG_PANIC_ON_OOPS=y
|
||||
|
|
|
|||
|
|
@ -21,7 +21,6 @@ CONFIG_CAM_SENSOR_PROBE_RETRY=y
|
|||
|
||||
# Charger
|
||||
CONFIG_QG_LEGACY=y
|
||||
CONFIG_USE_MMI_CHARGER=y
|
||||
|
||||
# UFS
|
||||
# CONFIG_MICRON_UFSHID is not set
|
||||
|
|
|
|||
|
|
@ -17,49 +17,9 @@ CONFIG_IBIZA_DTB=y
|
|||
|
||||
# Camera
|
||||
CONFIG_CAM_SENSOR_PROBE_RETRY=y
|
||||
CONFIG_CAMERA_CCI_INTF=m
|
||||
# CONFIG_CAMERA_CCI_MASTER_CHANGE is not set
|
||||
CONFIG_REGULATOR_WL2864C=m
|
||||
|
||||
# Charger
|
||||
CONFIG_MMI_SMBCHARGER_IIO=m
|
||||
CONFIG_QG_LEGACY=y
|
||||
CONFIG_QPNP_ADAPTIVE_CHARGE=m
|
||||
|
||||
# Fingerprint
|
||||
CONFIG_INPUT_CHIPONE_FPS_MMI=m
|
||||
CONFIG_INPUT_MISC_FPC1020=m
|
||||
CONFIG_INPUT_MISC_FPC1020_SAVE_TO_CLASS_DEVICE=y
|
||||
|
||||
# MMI
|
||||
CONFIG_MMI_ANNOTATE=m
|
||||
CONFIG_MMI_INFO=m
|
||||
CONFIG_MMI_RELAY=m
|
||||
CONFIG_MMI_SYS_TEMP=m
|
||||
CONFIG_MOTO_UTAGS=m
|
||||
CONFIG_SENSORS_CLASS=m
|
||||
|
||||
# NFC
|
||||
CONFIG_NFC_QTI_I2C=m
|
||||
|
||||
# SAR
|
||||
CONFIG_SARSENSOR_SX937X=m
|
||||
|
||||
# Touchscreen
|
||||
CONFIG_TOUCHSCREEN_NT36xxx_HOSTDL_SPI_MMI=m
|
||||
CONFIG_TOUCHSCREEN_NOVA_0FLASH_MMI_ENABLE_DOUBLE_TAP=y
|
||||
CONFIG_TOUCHSCREEN_NOVA_0FLASH_MMI_NOTIFY_TOUCH_STATE=y
|
||||
CONFIG_TOUCHSCREEN_NOVA_0FLASH_MMI_LAST_TIME=y
|
||||
CONFIG_TOUCHSCREEN_NOVA_0FLASH_MMI_STOWED_MODE_EN=y
|
||||
CONFIG_TOUCHSCREEN_NOVA_0FLASH_MMI_CHIP_VER_1=y
|
||||
CONFIG_TOUCHSCREEN_NOVA_0FLASH_MMI_WAKEUP_GESTURE_CTRL=y
|
||||
CONFIG_TOUCHSCREEN_NOVA_0FLASH_MMI_STYLUS_PALM=y
|
||||
CONFIG_TOUCHSCREEN_NOVA_0FLASH_MMI_STYLUS_PALM_RANGE=y
|
||||
CONFIG_TOUCHSCREEN_NOVA_0FLASH_MMI_DDA_STYLUS=y
|
||||
CONFIG_TOUCHSCREEN_NOVA_0FLASH_MMI_PEN_NOTIFIER=y
|
||||
CONFIG_TOUCHSCREEN_CHIPONE_TDDI=m
|
||||
CONFIG_TOUCHSCREEN_CHIPONE_TDDI_ESD=y
|
||||
CONFIG_BOARD_USES_DOUBLE_TAP_CTRL=y
|
||||
|
||||
# UFS
|
||||
# CONFIG_UFSFEATURE is not set
|
||||
|
|
|
|||
|
|
@ -39,7 +39,6 @@ CONFIG_BQ2597X_MMI_IIO=m
|
|||
CONFIG_CW2217B_FG_MMI=m
|
||||
CONFIG_RT9426A_FG_MMI=m
|
||||
CONFIG_SD77426_FG_MMI=m
|
||||
CONFIG_USE_MMI_CHARGER=y
|
||||
|
||||
# Display
|
||||
# CONFIG_REGULATOR_QPNP_LCDB is not set
|
||||
|
|
|
|||
|
|
@ -36,7 +36,6 @@ CONFIG_TCPC_CLASS=m
|
|||
CONFIG_TCPC_RT1711H=m
|
||||
CONFIG_TCPC_SGM7220=m
|
||||
CONFIG_TYPEC_ADAPTER_CLASS=m
|
||||
CONFIG_USE_MMI_CHARGER=y
|
||||
|
||||
# Display
|
||||
# CONFIG_REGULATOR_QPNP_LCDB is not set
|
||||
|
|
|
|||
|
|
@ -38,7 +38,6 @@ CONFIG_TCPC_CLASS=m
|
|||
CONFIG_TCPC_RT1711H=m
|
||||
CONFIG_TCPC_SGM7220=m
|
||||
CONFIG_TYPEC_ADAPTER_CLASS=m
|
||||
CONFIG_USE_MMI_CHARGER=y
|
||||
|
||||
# Display
|
||||
# CONFIG_REGULATOR_QPNP_LCDB is not set
|
||||
|
|
|
|||
|
|
@ -24,8 +24,5 @@ CONFIG_AW882XX_MAPSIZE_16K=y
|
|||
CONFIG_AF_NOISE_ELIMINATION=y
|
||||
CONFIG_CAM_SENSOR_PROBE_RETRY=y
|
||||
|
||||
# Charger
|
||||
CONFIG_USE_MMI_CHARGER=y
|
||||
|
||||
# Display
|
||||
# CONFIG_REGULATOR_QPNP_LCDB is not set
|
||||
|
|
|
|||
|
|
@ -24,9 +24,6 @@ CONFIG_AW882XX_MAPSIZE_16K=y
|
|||
CONFIG_AF_NOISE_ELIMINATION=y
|
||||
CONFIG_CAM_SENSOR_PROBE_RETRY=y
|
||||
|
||||
# Charger
|
||||
CONFIG_USE_MMI_CHARGER=y
|
||||
|
||||
# Display
|
||||
# CONFIG_REGULATOR_QPNP_LCDB is not set
|
||||
|
||||
|
|
|
|||
|
|
@ -43,7 +43,6 @@ CONFIG_BQ2589X_CHARGER=m
|
|||
CONFIG_BQ2597X_MMI_IIO=m
|
||||
CONFIG_CW2217B_FG_MMI=m
|
||||
CONFIG_MMI_QC3P_TURBO_CHARGER=y
|
||||
CONFIG_USE_MMI_CHARGER=y
|
||||
|
||||
# Display
|
||||
# CONFIG_REGULATOR_QPNP_LCDB is not set
|
||||
|
|
|
|||
19
arch/arm64/configs/vendor/holi-qgki_defconfig
vendored
19
arch/arm64/configs/vendor/holi-qgki_defconfig
vendored
|
|
@ -239,27 +239,15 @@ CONFIG_BRIDGE=y
|
|||
CONFIG_NET_SCHED=y
|
||||
CONFIG_NET_SCH_HTB=y
|
||||
CONFIG_NET_SCH_PRIO=y
|
||||
CONFIG_NET_SCH_MULTIQ=y
|
||||
CONFIG_NET_SCH_TBF=y
|
||||
CONFIG_NET_SCH_NETEM=y
|
||||
CONFIG_NET_SCH_INGRESS=y
|
||||
CONFIG_NET_CLS_FW=y
|
||||
CONFIG_NET_CLS_U32=y
|
||||
CONFIG_CLS_U32_MARK=y
|
||||
CONFIG_NET_CLS_FLOW=y
|
||||
CONFIG_NET_CLS_BPF=y
|
||||
CONFIG_NET_CLS_MATCHALL=y
|
||||
CONFIG_NET_EMATCH=y
|
||||
CONFIG_NET_EMATCH_CMP=y
|
||||
CONFIG_NET_EMATCH_NBYTE=y
|
||||
CONFIG_NET_EMATCH_U32=y
|
||||
CONFIG_NET_EMATCH_META=y
|
||||
CONFIG_NET_EMATCH_TEXT=y
|
||||
CONFIG_NET_CLS_ACT=y
|
||||
CONFIG_NET_ACT_POLICE=y
|
||||
CONFIG_NET_ACT_GACT=y
|
||||
CONFIG_NET_ACT_MIRRED=y
|
||||
CONFIG_NET_ACT_SKBEDIT=y
|
||||
CONFIG_NET_ACT_BPF=y
|
||||
CONFIG_QRTR=y
|
||||
CONFIG_QRTR_SMD=y
|
||||
|
|
@ -380,8 +368,6 @@ CONFIG_KEYBOARD_GPIO=y
|
|||
# CONFIG_INPUT_MOUSE is not set
|
||||
CONFIG_INPUT_JOYSTICK=y
|
||||
CONFIG_JOYSTICK_XPAD=y
|
||||
CONFIG_JOYSTICK_XPAD_FF=y
|
||||
CONFIG_JOYSTICK_XPAD_LEDS=y
|
||||
CONFIG_INPUT_TOUCHSCREEN=y
|
||||
CONFIG_TOUCHSCREEN_USB_COMPOSITE=y
|
||||
CONFIG_TOUCHSCREEN_FTS=y
|
||||
|
|
@ -524,7 +510,6 @@ CONFIG_HID_BATTERY_STRENGTH=y
|
|||
CONFIG_HIDRAW=y
|
||||
CONFIG_UHID=y
|
||||
CONFIG_HID_APPLE=y
|
||||
CONFIG_HID_BETOP_FF=y
|
||||
CONFIG_HID_PRODIKEYS=y
|
||||
CONFIG_HID_ELECOM=y
|
||||
CONFIG_HID_UCLOGIC=y
|
||||
|
|
@ -782,7 +767,6 @@ CONFIG_FS_VERITY_BUILTIN_SIGNATURES=y
|
|||
CONFIG_QUOTA=y
|
||||
CONFIG_QFMT_V2=y
|
||||
CONFIG_FUSE_FS=y
|
||||
CONFIG_FUSE_BPF=y
|
||||
CONFIG_OVERLAY_FS=y
|
||||
CONFIG_INCREMENTAL_FS=y
|
||||
CONFIG_MSDOS_FS=y
|
||||
|
|
@ -878,9 +862,6 @@ CONFIG_HEADERS_INSTALL=y
|
|||
CONFIG_MAGIC_SYSRQ=y
|
||||
CONFIG_DEBUG_STACK_USAGE=y
|
||||
CONFIG_DEBUG_MEMORY_INIT=y
|
||||
CONFIG_KFENCE=y
|
||||
CONFIG_KFENCE_SAMPLE_INTERVAL=500
|
||||
CONFIG_KFENCE_NUM_OBJECTS=63
|
||||
CONFIG_SOFTLOCKUP_DETECTOR=y
|
||||
# CONFIG_DETECT_HUNG_TASK is not set
|
||||
CONFIG_PANIC_ON_OOPS=y
|
||||
|
|
|
|||
|
|
@ -88,7 +88,6 @@
|
|||
#define ARM_CPU_PART_NEOVERSE_V2 0xD4F
|
||||
#define ARM_CPU_PART_CORTEX_A720 0xD81
|
||||
#define ARM_CPU_PART_CORTEX_X4 0xD82
|
||||
#define ARM_CPU_PART_NEOVERSE_V3AE 0xD83
|
||||
#define ARM_CPU_PART_NEOVERSE_V3 0xD84
|
||||
#define ARM_CPU_PART_CORTEX_X925 0xD85
|
||||
#define ARM_CPU_PART_CORTEX_A725 0xD87
|
||||
|
|
@ -142,7 +141,6 @@
|
|||
#define MIDR_NEOVERSE_V2 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_NEOVERSE_V2)
|
||||
#define MIDR_CORTEX_A720 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_CORTEX_A720)
|
||||
#define MIDR_CORTEX_X4 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_CORTEX_X4)
|
||||
#define MIDR_NEOVERSE_V3AE MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_NEOVERSE_V3AE)
|
||||
#define MIDR_NEOVERSE_V3 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_NEOVERSE_V3)
|
||||
#define MIDR_CORTEX_X925 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_CORTEX_X925)
|
||||
#define MIDR_CORTEX_A725 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_CORTEX_A725)
|
||||
|
|
|
|||
|
|
@ -1,22 +0,0 @@
|
|||
/* SPDX-License-Identifier: GPL-2.0 */
|
||||
/*
|
||||
* arm64 KFENCE support.
|
||||
*
|
||||
* Copyright (C) 2020, Google LLC.
|
||||
*/
|
||||
|
||||
#ifndef __ASM_KFENCE_H
|
||||
#define __ASM_KFENCE_H
|
||||
|
||||
#include <asm/cacheflush.h>
|
||||
|
||||
static inline bool arch_kfence_init_pool(void) { return true; }
|
||||
|
||||
static inline bool kfence_protect_page(unsigned long addr, bool protect)
|
||||
{
|
||||
set_memory_valid(addr, 1, !protect);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
#endif /* __ASM_KFENCE_H */
|
||||
|
|
@ -145,8 +145,7 @@ static inline pte_t set_pte_bit(pte_t pte, pgprot_t prot)
|
|||
static inline pte_t pte_mkwrite(pte_t pte)
|
||||
{
|
||||
pte = set_pte_bit(pte, __pgprot(PTE_WRITE));
|
||||
if (pte_sw_dirty(pte))
|
||||
pte = clear_pte_bit(pte, __pgprot(PTE_RDONLY));
|
||||
pte = clear_pte_bit(pte, __pgprot(PTE_RDONLY));
|
||||
return pte;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -19,13 +19,4 @@
|
|||
|
||||
#include <asm-generic/seccomp.h>
|
||||
|
||||
#define SECCOMP_ARCH_NATIVE AUDIT_ARCH_AARCH64
|
||||
#define SECCOMP_ARCH_NATIVE_NR NR_syscalls
|
||||
#define SECCOMP_ARCH_NATIVE_NAME "aarch64"
|
||||
#ifdef CONFIG_COMPAT
|
||||
# define SECCOMP_ARCH_COMPAT AUDIT_ARCH_ARM
|
||||
# define SECCOMP_ARCH_COMPAT_NR __NR_compat_syscalls
|
||||
# define SECCOMP_ARCH_COMPAT_NAME "arm"
|
||||
#endif
|
||||
|
||||
#endif /* _ASM_SECCOMP_H */
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@
|
|||
#define __ARM_NR_compat_set_tls (__ARM_NR_COMPAT_BASE + 5)
|
||||
#define __ARM_NR_COMPAT_END (__ARM_NR_COMPAT_BASE + 0x800)
|
||||
|
||||
#define __NR_compat_syscalls 442
|
||||
#define __NR_compat_syscalls 441
|
||||
#endif
|
||||
|
||||
#define __ARCH_WANT_SYS_CLONE
|
||||
|
|
|
|||
|
|
@ -879,12 +879,8 @@ __SYSCALL(__NR_fspick, sys_fspick)
|
|||
__SYSCALL(__NR_pidfd_open, sys_pidfd_open)
|
||||
#define __NR_clone3 435
|
||||
__SYSCALL(__NR_clone3, sys_clone3)
|
||||
#define __NR_close_range 436
|
||||
__SYSCALL(__NR_close_range, sys_close_range)
|
||||
#define __NR_process_madvise 440
|
||||
__SYSCALL(__NR_process_madvise, sys_process_madvise)
|
||||
#define __NR_epoll_pwait2 441
|
||||
__SYSCALL(__NR_epoll_pwait2, compat_sys_epoll_pwait2)
|
||||
|
||||
/*
|
||||
* Please add new compat syscalls above this comment and update
|
||||
|
|
|
|||
|
|
@ -204,7 +204,7 @@ static void __init register_insn_emulation(struct insn_emulation_ops *ops)
|
|||
}
|
||||
|
||||
static int emulation_proc_handler(struct ctl_table *table, int write,
|
||||
void *buffer, size_t *lenp,
|
||||
void __user *buffer, size_t *lenp,
|
||||
loff_t *ppos)
|
||||
{
|
||||
int ret = 0;
|
||||
|
|
|
|||
|
|
@ -863,7 +863,6 @@ static const struct midr_range erratum_spec_ssbs_list[] = {
|
|||
MIDR_ALL_VERSIONS(MIDR_NEOVERSE_V1),
|
||||
MIDR_ALL_VERSIONS(MIDR_NEOVERSE_V2),
|
||||
MIDR_ALL_VERSIONS(MIDR_NEOVERSE_V3),
|
||||
MIDR_ALL_VERSIONS(MIDR_NEOVERSE_V3AE),
|
||||
{}
|
||||
};
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -341,7 +341,8 @@ static unsigned int find_supported_vector_length(unsigned int vl)
|
|||
#if defined(CONFIG_ARM64_SVE) && defined(CONFIG_SYSCTL)
|
||||
|
||||
static int sve_proc_do_default_vl(struct ctl_table *table, int write,
|
||||
void *buffer, size_t *lenp, loff_t *ppos)
|
||||
void __user *buffer, size_t *lenp,
|
||||
loff_t *ppos)
|
||||
{
|
||||
int ret;
|
||||
int vl = sve_default_vl;
|
||||
|
|
|
|||
|
|
@ -123,7 +123,7 @@ int __kprobes aarch64_insn_read(void *addr, u32 *insnp)
|
|||
int ret;
|
||||
__le32 val;
|
||||
|
||||
ret = copy_from_kernel_nofault(&val, addr, AARCH64_INSN_SIZE);
|
||||
ret = probe_kernel_read(&val, addr, AARCH64_INSN_SIZE);
|
||||
if (!ret)
|
||||
*insnp = le32_to_cpu(val);
|
||||
|
||||
|
|
@ -139,7 +139,7 @@ static int __kprobes __aarch64_insn_write(void *addr, __le32 insn)
|
|||
raw_spin_lock_irqsave(&patch_lock, flags);
|
||||
waddr = patch_map(addr, FIX_TEXT_POKE0);
|
||||
|
||||
ret = copy_to_kernel_nofault(waddr, &insn, AARCH64_INSN_SIZE);
|
||||
ret = probe_kernel_write(waddr, &insn, AARCH64_INSN_SIZE);
|
||||
|
||||
patch_unmap(FIX_TEXT_POKE0);
|
||||
raw_spin_unlock_irqrestore(&patch_lock, flags);
|
||||
|
|
|
|||
|
|
@ -311,7 +311,7 @@ static int call_undef_hook(struct pt_regs *regs)
|
|||
|
||||
if (!user_mode(regs)) {
|
||||
__le32 instr_le;
|
||||
if (get_kernel_nofault(instr_le, (__force __le32 *)pc))
|
||||
if (probe_kernel_address((__force __le32 *)pc, instr_le))
|
||||
goto exit;
|
||||
instr = le32_to_cpu(instr_le);
|
||||
} else if (compat_thumb_mode(regs)) {
|
||||
|
|
|
|||
|
|
@ -10,7 +10,6 @@
|
|||
#include <linux/acpi.h>
|
||||
#include <linux/bitfield.h>
|
||||
#include <linux/extable.h>
|
||||
#include <linux/kfence.h>
|
||||
#include <linux/signal.h>
|
||||
#include <linux/mm.h>
|
||||
#include <linux/hardirq.h>
|
||||
|
|
@ -328,9 +327,6 @@ static void __do_kernel_fault(unsigned long addr, unsigned int esr,
|
|||
} else if (addr < PAGE_SIZE) {
|
||||
msg = "NULL pointer dereference";
|
||||
} else {
|
||||
if (kfence_handle_page_fault(addr, esr & ESR_ELx_WNR, regs))
|
||||
return;
|
||||
|
||||
msg = "paging request";
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -471,8 +471,7 @@ static void __init map_mem(pgd_t *pgdp)
|
|||
struct memblock_region *reg;
|
||||
int flags = 0;
|
||||
|
||||
if (rodata_full || debug_pagealloc_enabled() ||
|
||||
IS_ENABLED(CONFIG_KFENCE))
|
||||
if (rodata_full || debug_pagealloc_enabled())
|
||||
flags = NO_BLOCK_MAPPINGS | NO_CONT_MAPPINGS;
|
||||
|
||||
/*
|
||||
|
|
@ -1471,12 +1470,7 @@ int arch_add_memory(int nid, u64 start, u64 size,
|
|||
return -1;
|
||||
}
|
||||
|
||||
/*
|
||||
* KFENCE requires linear map to be mapped at page granularity, so that
|
||||
* it is possible to protect/unprotect single pages in the KFENCE pool.
|
||||
*/
|
||||
if (rodata_full || debug_pagealloc_enabled() ||
|
||||
IS_ENABLED(CONFIG_KFENCE))
|
||||
if (rodata_full || debug_pagealloc_enabled())
|
||||
flags = NO_BLOCK_MAPPINGS | NO_CONT_MAPPINGS;
|
||||
|
||||
__create_pgd_mapping(swapper_pg_dir, start, __phys_to_virt(start),
|
||||
|
|
|
|||
|
|
@ -1,11 +0,0 @@
|
|||
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||
#ifndef _ASM_SECCOMP_H
|
||||
#define _ASM_SECCOMP_H
|
||||
|
||||
#include <asm-generic/seccomp.h>
|
||||
|
||||
#define SECCOMP_ARCH_NATIVE AUDIT_ARCH_CSKY
|
||||
#define SECCOMP_ARCH_NATIVE_NR NR_syscalls
|
||||
#define SECCOMP_ARCH_NATIVE_NAME "csky"
|
||||
|
||||
#endif /* _ASM_SECCOMP_H */
|
||||
|
|
@ -71,8 +71,7 @@ static int ftrace_check_current_nop(unsigned long hook)
|
|||
uint16_t olds[7];
|
||||
unsigned long hook_pos = hook - 2;
|
||||
|
||||
if (copy_from_kernel_nofault((void *)olds, (void *)hook_pos,
|
||||
sizeof(nops)))
|
||||
if (probe_kernel_read((void *)olds, (void *)hook_pos, sizeof(nops)))
|
||||
return -EFAULT;
|
||||
|
||||
if (memcmp((void *)nops, (void *)olds, sizeof(nops))) {
|
||||
|
|
@ -97,7 +96,7 @@ static int ftrace_modify_code(unsigned long hook, unsigned long target,
|
|||
|
||||
make_jbsr(target, hook, call, nolr);
|
||||
|
||||
ret = copy_to_kernel_nofault((void *)hook_pos, enable ? call : nops,
|
||||
ret = probe_kernel_write((void *)hook_pos, enable ? call : nops,
|
||||
sizeof(nops));
|
||||
if (ret)
|
||||
return -EPERM;
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ static inline void *dereference_function_descriptor(void *ptr)
|
|||
struct fdesc *desc = ptr;
|
||||
void *p;
|
||||
|
||||
if (!get_kernel_nofault(p, &desc->ip))
|
||||
if (!probe_kernel_address(&desc->ip, p))
|
||||
ptr = p;
|
||||
return ptr;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -108,7 +108,7 @@ ftrace_modify_code(unsigned long ip, unsigned char *old_code,
|
|||
goto skip_check;
|
||||
|
||||
/* read the text we want to modify */
|
||||
if (copy_from_kernel_nofault(replaced, (void *)ip, MCOUNT_INSN_SIZE))
|
||||
if (probe_kernel_read(replaced, (void *)ip, MCOUNT_INSN_SIZE))
|
||||
return -EFAULT;
|
||||
|
||||
/* Make sure it is what we expect it to be */
|
||||
|
|
@ -117,7 +117,7 @@ ftrace_modify_code(unsigned long ip, unsigned char *old_code,
|
|||
|
||||
skip_check:
|
||||
/* replace the text with the new text */
|
||||
if (copy_to_kernel_nofault(((void *)ip), new_code, MCOUNT_INSN_SIZE))
|
||||
if (probe_kernel_write(((void *)ip), new_code, MCOUNT_INSN_SIZE))
|
||||
return -EPERM;
|
||||
flush_icache_range(ip, ip + MCOUNT_INSN_SIZE);
|
||||
|
||||
|
|
@ -129,7 +129,7 @@ static int ftrace_make_nop_check(struct dyn_ftrace *rec, unsigned long addr)
|
|||
unsigned char __attribute__((aligned(8))) replaced[MCOUNT_INSN_SIZE];
|
||||
unsigned long ip = rec->ip;
|
||||
|
||||
if (copy_from_kernel_nofault(replaced, (void *)ip, MCOUNT_INSN_SIZE))
|
||||
if (probe_kernel_read(replaced, (void *)ip, MCOUNT_INSN_SIZE))
|
||||
return -EFAULT;
|
||||
if (rec->flags & FTRACE_FL_CONVERTED) {
|
||||
struct ftrace_call_insn *call_insn, *tmp_call;
|
||||
|
|
|
|||
|
|
@ -356,9 +356,8 @@
|
|||
433 common fspick sys_fspick
|
||||
434 common pidfd_open sys_pidfd_open
|
||||
# 435 reserved for clone3
|
||||
436 common close_range sys_close_range
|
||||
# 436 reserved for close_range
|
||||
# 437 reserved for openat2
|
||||
# 438 reserved for pidfd_getfd
|
||||
# 439 reserved for faccessat2
|
||||
440 common process_madvise sys_process_madvise
|
||||
441 common epoll_pwait2 sys_epoll_pwait2
|
||||
|
|
|
|||
|
|
@ -314,12 +314,12 @@ static inline int bfchg_mem_test_and_change_bit(int nr,
|
|||
#include <asm-generic/bitops/ffz.h>
|
||||
#else
|
||||
|
||||
static inline unsigned long find_first_zero_bit(const unsigned long *vaddr,
|
||||
unsigned long size)
|
||||
static inline int find_first_zero_bit(const unsigned long *vaddr,
|
||||
unsigned size)
|
||||
{
|
||||
const unsigned long *p = vaddr;
|
||||
unsigned long res = 32;
|
||||
unsigned long words;
|
||||
int res = 32;
|
||||
unsigned int words;
|
||||
unsigned long num;
|
||||
|
||||
if (!size)
|
||||
|
|
@ -340,9 +340,8 @@ out:
|
|||
}
|
||||
#define find_first_zero_bit find_first_zero_bit
|
||||
|
||||
static inline unsigned long find_next_zero_bit(const unsigned long *vaddr,
|
||||
unsigned long size,
|
||||
unsigned long offset)
|
||||
static inline int find_next_zero_bit(const unsigned long *vaddr, int size,
|
||||
int offset)
|
||||
{
|
||||
const unsigned long *p = vaddr + (offset >> 5);
|
||||
int bit = offset & 31UL, res;
|
||||
|
|
@ -371,12 +370,11 @@ static inline unsigned long find_next_zero_bit(const unsigned long *vaddr,
|
|||
}
|
||||
#define find_next_zero_bit find_next_zero_bit
|
||||
|
||||
static inline unsigned long find_first_bit(const unsigned long *vaddr,
|
||||
unsigned long size)
|
||||
static inline int find_first_bit(const unsigned long *vaddr, unsigned size)
|
||||
{
|
||||
const unsigned long *p = vaddr;
|
||||
unsigned long res = 32;
|
||||
unsigned long words;
|
||||
int res = 32;
|
||||
unsigned int words;
|
||||
unsigned long num;
|
||||
|
||||
if (!size)
|
||||
|
|
@ -397,9 +395,8 @@ out:
|
|||
}
|
||||
#define find_first_bit find_first_bit
|
||||
|
||||
static inline unsigned long find_next_bit(const unsigned long *vaddr,
|
||||
unsigned long size,
|
||||
unsigned long offset)
|
||||
static inline int find_next_bit(const unsigned long *vaddr, int size,
|
||||
int offset)
|
||||
{
|
||||
const unsigned long *p = vaddr + (offset >> 5);
|
||||
int bit = offset & 31UL, res;
|
||||
|
|
|
|||
|
|
@ -435,9 +435,8 @@
|
|||
433 common fspick sys_fspick
|
||||
434 common pidfd_open sys_pidfd_open
|
||||
# 435 reserved for clone3
|
||||
436 common close_range sys_close_range
|
||||
# 436 reserved for close_range
|
||||
# 437 reserved for openat2
|
||||
# 438 reserved for pidfd_getfd
|
||||
# 439 reserved for faccessat2
|
||||
440 common process_madvise sys_process_madvise
|
||||
441 common epoll_pwait2 sys_epoll_pwait2
|
||||
|
|
|
|||
|
|
@ -441,9 +441,8 @@
|
|||
433 common fspick sys_fspick
|
||||
434 common pidfd_open sys_pidfd_open
|
||||
435 common clone3 sys_clone3
|
||||
436 common close_range sys_close_range
|
||||
# 436 reserved for close_range
|
||||
# 437 reserved for openat2
|
||||
# 438 reserved for pidfd_getfd
|
||||
# 439 reserved for faccessat2
|
||||
440 common process_madvise sys_process_madvise
|
||||
441 common epoll_pwait2 sys_epoll_pwait2
|
||||
|
|
|
|||
|
|
@ -5,12 +5,8 @@
|
|||
compatible = "lantiq,xway", "lantiq,danube";
|
||||
|
||||
cpus {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
|
||||
cpu@0 {
|
||||
compatible = "mips,mips24Kc";
|
||||
reg = <0>;
|
||||
};
|
||||
};
|
||||
|
||||
|
|
@ -105,8 +101,6 @@
|
|||
0x1000000 0 0x00000000 0xae00000 0 0x200000>; /* io space */
|
||||
reg = <0x7000000 0x8000 /* config space */
|
||||
0xe105400 0x400>; /* pci bridge */
|
||||
|
||||
device_type = "pci";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
|
|||
|
|
@ -398,8 +398,6 @@ static inline pte_t pte_mkspecial(pte_t pte)
|
|||
return pte;
|
||||
}
|
||||
|
||||
#define pte_sw_mkyoung pte_mkyoung
|
||||
|
||||
#ifdef CONFIG_MIPS_HUGE_TLB_SUPPORT
|
||||
static inline int pte_huge(pte_t pte) { return pte_val(pte) & _PAGE_HUGE; }
|
||||
|
||||
|
|
|
|||
|
|
@ -9,12 +9,12 @@ static inline const int *get_compat_mode1_syscalls(void)
|
|||
static const int syscalls_O32[] = {
|
||||
__NR_O32_Linux + 3, __NR_O32_Linux + 4,
|
||||
__NR_O32_Linux + 1, __NR_O32_Linux + 193,
|
||||
-1, /* negative terminated */
|
||||
0, /* null terminated */
|
||||
};
|
||||
static const int syscalls_N32[] = {
|
||||
__NR_N32_Linux + 0, __NR_N32_Linux + 1,
|
||||
__NR_N32_Linux + 58, __NR_N32_Linux + 211,
|
||||
-1, /* negative terminated */
|
||||
0, /* null terminated */
|
||||
};
|
||||
|
||||
if (IS_ENABLED(CONFIG_MIPS32_O32) && test_thread_flag(TIF_32BIT_REGS))
|
||||
|
|
|
|||
|
|
@ -135,8 +135,6 @@
|
|||
|
||||
#define SO_DETACH_REUSEPORT_BPF 68
|
||||
|
||||
#define SO_NETNS_COOKIE 71
|
||||
|
||||
#if !defined(__KERNEL__)
|
||||
|
||||
#if __BITS_PER_LONG == 64
|
||||
|
|
|
|||
|
|
@ -86,9 +86,9 @@ int __kprobes arch_prepare_kprobe(struct kprobe *p)
|
|||
goto out;
|
||||
}
|
||||
|
||||
if (copy_from_kernel_nofault(&prev_insn, p->addr - 1,
|
||||
sizeof(mips_instruction)) == 0 &&
|
||||
insn_has_delayslot(prev_insn)) {
|
||||
if ((probe_kernel_read(&prev_insn, p->addr - 1,
|
||||
sizeof(mips_instruction)) == 0) &&
|
||||
insn_has_delayslot(prev_insn)) {
|
||||
pr_notice("Kprobes for branch delayslot are not supported\n");
|
||||
ret = -EINVAL;
|
||||
goto out;
|
||||
|
|
|
|||
|
|
@ -374,9 +374,8 @@
|
|||
433 n32 fspick sys_fspick
|
||||
434 n32 pidfd_open sys_pidfd_open
|
||||
435 n32 clone3 __sys_clone3
|
||||
436 n32 close_range sys_close_range
|
||||
# 436 reserved for close_range
|
||||
# 437 reserved for openat2
|
||||
# 438 reserved for pidfd_getfd
|
||||
# 439 reserved for faccessat2
|
||||
440 n32 process_madvise sys_process_madvise
|
||||
441 n32 epoll_pwait2 compat_sys_epoll_pwait2
|
||||
|
|
|
|||
|
|
@ -350,9 +350,8 @@
|
|||
433 n64 fspick sys_fspick
|
||||
434 n64 pidfd_open sys_pidfd_open
|
||||
435 n64 clone3 __sys_clone3
|
||||
436 n64 close_range sys_close_range
|
||||
# 436 reserved for close_range
|
||||
# 437 reserved for openat2
|
||||
# 438 reserved for pidfd_getfd
|
||||
# 439 reserved for faccessat2
|
||||
440 n64 process_madvise sys_process_madvise
|
||||
441 n64 epoll_pwait2 sys_epoll_pwait2
|
||||
|
|
|
|||
|
|
@ -423,5 +423,3 @@
|
|||
433 o32 fspick sys_fspick
|
||||
434 o32 pidfd_open sys_pidfd_open
|
||||
435 o32 clone3 __sys_clone3
|
||||
436 o32 close_range sys_close_range
|
||||
441 o32 epoll_pwait2 sys_epoll_pwait2 compat_sys_epoll_pwait2
|
||||
|
|
|
|||
|
|
@ -459,7 +459,7 @@ void __init ltq_soc_init(void)
|
|||
/* add our generic xway clocks */
|
||||
clkdev_add_pmu("10000000.fpi", NULL, 0, 0, PMU_FPI);
|
||||
clkdev_add_pmu("1e100a00.gptu", NULL, 1, 0, PMU_GPT);
|
||||
clkdev_add_pmu("1e100bb0.gpio", NULL, 1, 0, PMU_STP);
|
||||
clkdev_add_pmu("1e100bb0.stp", NULL, 1, 0, PMU_STP);
|
||||
clkdev_add_pmu("1e100c00.serial", NULL, 0, 0, PMU_ASC1);
|
||||
clkdev_add_pmu("1e104100.dma", NULL, 1, 0, PMU_DMA);
|
||||
clkdev_add_pmu("1e100800.spi", NULL, 1, 0, PMU_SPI);
|
||||
|
|
|
|||
|
|
@ -95,15 +95,16 @@ int proc_lasat_ip(struct ctl_table *table, int write,
|
|||
len = 0;
|
||||
p = buffer;
|
||||
while (len < *lenp) {
|
||||
c = *p;
|
||||
p++;
|
||||
if (get_user(c, p++))
|
||||
return -EFAULT;
|
||||
if (c == 0 || c == '\n')
|
||||
break;
|
||||
len++;
|
||||
}
|
||||
if (len >= sizeof(ipbuf)-1)
|
||||
len = sizeof(ipbuf) - 1;
|
||||
memcpy(ipbuf, buffer, len);
|
||||
if (copy_from_user(ipbuf, buffer, len))
|
||||
return -EFAULT;
|
||||
ipbuf[len] = 0;
|
||||
*ppos += *lenp;
|
||||
/* Now see if we can convert it to a valid IP */
|
||||
|
|
@ -121,9 +122,11 @@ int proc_lasat_ip(struct ctl_table *table, int write,
|
|||
if (len > *lenp)
|
||||
len = *lenp;
|
||||
if (len)
|
||||
memcpy(buffer, ipbuf, len);
|
||||
if (copy_to_user(buffer, ipbuf, len))
|
||||
return -EFAULT;
|
||||
if (len < *lenp) {
|
||||
*((char *)buffer + len) = '\n';
|
||||
if (put_user('\n', ((char *) buffer) + len))
|
||||
return -EFAULT;
|
||||
len++;
|
||||
}
|
||||
*lenp = len;
|
||||
|
|
|
|||
|
|
@ -242,22 +242,16 @@ mips_pci_controller:
|
|||
#endif
|
||||
|
||||
/*
|
||||
* Set up memory mapping in host bridge for PCI DMA masters,
|
||||
* in transparent addressing mode. For EVA use the Malta
|
||||
* maximum of 2 GiB memory in the alias space at 0x80000000
|
||||
* as per PHYS_OFFSET. Otherwise use 256 MiB of memory in
|
||||
* the regular space, avoiding mapping the PCI MMIO window
|
||||
* for DMA as it seems to confuse the system controller's
|
||||
* logic, causing PCI MMIO to stop working.
|
||||
* Setup the Malta max (2GB) memory for PCI DMA in host bridge
|
||||
* in transparent addressing mode.
|
||||
*/
|
||||
mask = PHYS_OFFSET ? PHYS_OFFSET : 0xf0000000;
|
||||
MSC_WRITE(MSC01_PCI_BAR0,
|
||||
mask | PCI_BASE_ADDRESS_MEM_PREFETCH);
|
||||
MSC_WRITE(MSC01_PCI_HEAD4,
|
||||
PHYS_OFFSET | PCI_BASE_ADDRESS_MEM_PREFETCH);
|
||||
mask = PHYS_OFFSET | PCI_BASE_ADDRESS_MEM_PREFETCH;
|
||||
MSC_WRITE(MSC01_PCI_BAR0, mask);
|
||||
MSC_WRITE(MSC01_PCI_HEAD4, mask);
|
||||
|
||||
mask &= MSC01_PCI_BAR0_SIZE_MSK;
|
||||
MSC_WRITE(MSC01_PCI_P2SCMSKL, mask);
|
||||
MSC_WRITE(MSC01_PCI_P2SCMAPL, PHYS_OFFSET);
|
||||
MSC_WRITE(MSC01_PCI_P2SCMAPL, mask);
|
||||
|
||||
/* Don't handle target retries indefinitely. */
|
||||
if ((data & MSC01_PCI_CFG_MAXRTRY_MSK) ==
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ static struct resource standard_io_resources[] = {
|
|||
.name = "keyboard",
|
||||
.start = 0x60,
|
||||
.end = 0x6f,
|
||||
.flags = IORESOURCE_IO
|
||||
.flags = IORESOURCE_IO | IORESOURCE_BUSY
|
||||
},
|
||||
{
|
||||
.name = "dma page reg",
|
||||
|
|
|
|||
|
|
@ -143,14 +143,13 @@ static int __ftrace_modify_code(unsigned long pc, unsigned long *old_insn,
|
|||
unsigned long orig_insn[3];
|
||||
|
||||
if (validate) {
|
||||
if (copy_from_kernel_nofault(orig_insn, (void *)pc,
|
||||
MCOUNT_INSN_SIZE))
|
||||
if (probe_kernel_read(orig_insn, (void *)pc, MCOUNT_INSN_SIZE))
|
||||
return -EFAULT;
|
||||
if (memcmp(orig_insn, old_insn, MCOUNT_INSN_SIZE))
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (copy_to_kernel_nofault((void *)pc, new_insn, MCOUNT_INSN_SIZE))
|
||||
if (probe_kernel_write((void *)pc, new_insn, MCOUNT_INSN_SIZE))
|
||||
return -EPERM;
|
||||
|
||||
return 0;
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@ generic-y += mm-arch-hooks.h
|
|||
generic-y += mmiowb.h
|
||||
generic-y += percpu.h
|
||||
generic-y += preempt.h
|
||||
generic-y += seccomp.h
|
||||
generic-y += trace_clock.h
|
||||
generic-y += user.h
|
||||
generic-y += vga.h
|
||||
|
|
|
|||
|
|
@ -1,22 +0,0 @@
|
|||
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||
#ifndef _ASM_SECCOMP_H
|
||||
#define _ASM_SECCOMP_H
|
||||
|
||||
#include <asm-generic/seccomp.h>
|
||||
|
||||
#ifdef CONFIG_64BIT
|
||||
# define SECCOMP_ARCH_NATIVE AUDIT_ARCH_PARISC64
|
||||
# define SECCOMP_ARCH_NATIVE_NR NR_syscalls
|
||||
# define SECCOMP_ARCH_NATIVE_NAME "parisc64"
|
||||
# ifdef CONFIG_COMPAT
|
||||
# define SECCOMP_ARCH_COMPAT AUDIT_ARCH_PARISC
|
||||
# define SECCOMP_ARCH_COMPAT_NR NR_syscalls
|
||||
# define SECCOMP_ARCH_COMPAT_NAME "parisc"
|
||||
# endif
|
||||
#else /* !CONFIG_64BIT */
|
||||
# define SECCOMP_ARCH_NATIVE AUDIT_ARCH_PARISC
|
||||
# define SECCOMP_ARCH_NATIVE_NR NR_syscalls
|
||||
# define SECCOMP_ARCH_NATIVE_NAME "parisc"
|
||||
#endif
|
||||
|
||||
#endif /* _ASM_SECCOMP_H */
|
||||
|
|
@ -10,10 +10,10 @@
|
|||
#define TCSETS _IOW('T', 17, struct termios) /* TCSETATTR */
|
||||
#define TCSETSW _IOW('T', 18, struct termios) /* TCSETATTRD */
|
||||
#define TCSETSF _IOW('T', 19, struct termios) /* TCSETATTRF */
|
||||
#define TCGETA 0x40125401
|
||||
#define TCSETA 0x80125402
|
||||
#define TCSETAW 0x80125403
|
||||
#define TCSETAF 0x80125404
|
||||
#define TCGETA _IOR('T', 1, struct termio)
|
||||
#define TCSETA _IOW('T', 2, struct termio)
|
||||
#define TCSETAW _IOW('T', 3, struct termio)
|
||||
#define TCSETAF _IOW('T', 4, struct termio)
|
||||
#define TCSBRK _IO('T', 5)
|
||||
#define TCXONC _IO('T', 6)
|
||||
#define TCFLSH _IO('T', 7)
|
||||
|
|
|
|||
|
|
@ -116,8 +116,6 @@
|
|||
|
||||
#define SO_DETACH_REUSEPORT_BPF 0x4042
|
||||
|
||||
#define SO_NETNS_COOKIE 0x4045
|
||||
|
||||
#if !defined(__KERNEL__)
|
||||
|
||||
#if __BITS_PER_LONG == 64
|
||||
|
|
|
|||
|
|
@ -172,7 +172,7 @@ int ftrace_make_call(struct dyn_ftrace *rec, unsigned long addr)
|
|||
|
||||
ip = (void *)(rec->ip + 4 - size);
|
||||
|
||||
ret = copy_from_kernel_nofault(insn, ip, size);
|
||||
ret = probe_kernel_read(insn, ip, size);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
|
|
|
|||
|
|
@ -154,8 +154,8 @@ void kgdb_arch_set_pc(struct pt_regs *regs, unsigned long ip)
|
|||
|
||||
int kgdb_arch_set_breakpoint(struct kgdb_bkpt *bpt)
|
||||
{
|
||||
int ret = copy_from_kernel_nofault(bpt->saved_instr,
|
||||
(char *)bpt->bpt_addr, BREAK_INSTR_SIZE);
|
||||
int ret = probe_kernel_read(bpt->saved_instr, (char *)bpt->bpt_addr,
|
||||
BREAK_INSTR_SIZE);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
|
|
|
|||
|
|
@ -298,7 +298,7 @@ void *dereference_function_descriptor(void *ptr)
|
|||
Elf64_Fdesc *desc = ptr;
|
||||
void *p;
|
||||
|
||||
if (!get_kernel_nofault(p, &desc->addr))
|
||||
if (!probe_kernel_address(&desc->addr, p))
|
||||
ptr = p;
|
||||
return ptr;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -433,9 +433,8 @@
|
|||
433 common fspick sys_fspick
|
||||
434 common pidfd_open sys_pidfd_open
|
||||
435 common clone3 sys_clone3_wrapper
|
||||
436 common close_range sys_close_range
|
||||
# 436 reserved for close_range
|
||||
# 437 reserved for openat2
|
||||
# 438 reserved for pidfd_getfd
|
||||
# 439 reserved for faccessat2
|
||||
440 common process_madvise sys_process_madvise
|
||||
441 common epoll_pwait2 sys_epoll_pwait2 compat_sys_epoll_pwait2
|
||||
|
|
|
|||
|
|
@ -57,10 +57,14 @@ void * memcpy(void * dst,const void *src, size_t count)
|
|||
EXPORT_SYMBOL(raw_copy_in_user);
|
||||
EXPORT_SYMBOL(memcpy);
|
||||
|
||||
bool copy_from_kernel_nofault_allowed(const void *unsafe_src, size_t size)
|
||||
long probe_kernel_read(void *dst, const void *src, size_t size)
|
||||
{
|
||||
if ((unsigned long)unsafe_src < PAGE_SIZE)
|
||||
return false;
|
||||
unsigned long addr = (unsigned long)src;
|
||||
|
||||
if (addr < PAGE_SIZE)
|
||||
return -EFAULT;
|
||||
|
||||
/* check for I/O space F_EXTEND(0xfff00000) access as well? */
|
||||
return true;
|
||||
|
||||
return __probe_kernel_read(dst, src, size);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,27 +8,4 @@
|
|||
|
||||
#include <asm-generic/seccomp.h>
|
||||
|
||||
#ifdef __LITTLE_ENDIAN__
|
||||
#define __SECCOMP_ARCH_LE __AUDIT_ARCH_LE
|
||||
#define __SECCOMP_ARCH_LE_NAME "le"
|
||||
#else
|
||||
#define __SECCOMP_ARCH_LE 0
|
||||
#define __SECCOMP_ARCH_LE_NAME
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_PPC64
|
||||
# define SECCOMP_ARCH_NATIVE (AUDIT_ARCH_PPC64 | __SECCOMP_ARCH_LE)
|
||||
# define SECCOMP_ARCH_NATIVE_NR NR_syscalls
|
||||
# define SECCOMP_ARCH_NATIVE_NAME "ppc64" __SECCOMP_ARCH_LE_NAME
|
||||
# ifdef CONFIG_COMPAT
|
||||
# define SECCOMP_ARCH_COMPAT (AUDIT_ARCH_PPC | __SECCOMP_ARCH_LE)
|
||||
# define SECCOMP_ARCH_COMPAT_NR NR_syscalls
|
||||
# define SECCOMP_ARCH_COMPAT_NAME "ppc" __SECCOMP_ARCH_LE_NAME
|
||||
# endif
|
||||
#else /* !CONFIG_PPC64 */
|
||||
# define SECCOMP_ARCH_NATIVE (AUDIT_ARCH_PPC | __SECCOMP_ARCH_LE)
|
||||
# define SECCOMP_ARCH_NATIVE_NR NR_syscalls
|
||||
# define SECCOMP_ARCH_NATIVE_NAME "ppc" __SECCOMP_ARCH_LE_NAME
|
||||
#endif
|
||||
|
||||
#endif /* _ASM_POWERPC_SECCOMP_H */
|
||||
|
|
|
|||
|
|
@ -85,7 +85,7 @@ static inline void *dereference_function_descriptor(void *ptr)
|
|||
struct ppc64_opd_entry *desc = ptr;
|
||||
void *p;
|
||||
|
||||
if (!get_kernel_nofault(p, &desc->funcaddr))
|
||||
if (!probe_kernel_address(&desc->funcaddr, p))
|
||||
ptr = p;
|
||||
return ptr;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -351,7 +351,7 @@ static enum pci_ers_result eeh_report_error(struct eeh_dev *edev,
|
|||
rc = driver->err_handler->error_detected(pdev, pci_channel_io_frozen);
|
||||
|
||||
edev->in_error = true;
|
||||
pci_uevent_ers(pdev, rc);
|
||||
pci_uevent_ers(pdev, PCI_ERS_RESULT_NONE);
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -420,7 +420,7 @@ int kgdb_arch_set_breakpoint(struct kgdb_bkpt *bpt)
|
|||
unsigned int instr;
|
||||
unsigned int *addr = (unsigned int *)bpt->bpt_addr;
|
||||
|
||||
err = get_kernel_nofault(instr, addr);
|
||||
err = probe_kernel_address(addr, instr);
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
|
|
|
|||
|
|
@ -159,7 +159,7 @@ int module_trampoline_target(struct module *mod, unsigned long addr,
|
|||
|
||||
stub = (struct ppc64_stub_entry *)addr;
|
||||
|
||||
if (copy_from_kernel_nofault(&magic, &stub->magic, sizeof(magic))) {
|
||||
if (probe_kernel_read(&magic, &stub->magic, sizeof(magic))) {
|
||||
pr_err("%s: fault reading magic for stub %lx for %s\n", __func__, addr, mod->name);
|
||||
return -EFAULT;
|
||||
}
|
||||
|
|
@ -169,7 +169,7 @@ int module_trampoline_target(struct module *mod, unsigned long addr,
|
|||
return -EFAULT;
|
||||
}
|
||||
|
||||
if (copy_from_kernel_nofault(&funcdata, &stub->funcdata, sizeof(funcdata))) {
|
||||
if (probe_kernel_read(&funcdata, &stub->funcdata, sizeof(funcdata))) {
|
||||
pr_err("%s: fault reading funcdata for stub %lx for %s\n", __func__, addr, mod->name);
|
||||
return -EFAULT;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1239,7 +1239,7 @@ static void show_instructions(struct pt_regs *regs)
|
|||
pr_cont("\n");
|
||||
|
||||
if (!__kernel_text_address(pc) ||
|
||||
get_kernel_nofault(instr, (const void *)pc)) {
|
||||
probe_kernel_address((const void *)pc, instr)) {
|
||||
pr_cont("XXXXXXXX ");
|
||||
} else {
|
||||
if (nip == pc)
|
||||
|
|
@ -1263,6 +1263,16 @@ void show_user_instructions(struct pt_regs *regs)
|
|||
|
||||
pc = regs->nip - (NR_INSN_TO_PRINT * 3 / 4 * sizeof(int));
|
||||
|
||||
/*
|
||||
* Make sure the NIP points at userspace, not kernel text/data or
|
||||
* elsewhere.
|
||||
*/
|
||||
if (!__access_ok(pc, NR_INSN_TO_PRINT * sizeof(int), USER_DS)) {
|
||||
pr_info("%s[%d]: Bad NIP, not dumping instructions.\n",
|
||||
current->comm, current->pid);
|
||||
return;
|
||||
}
|
||||
|
||||
seq_buf_init(&s, buf, sizeof(buf));
|
||||
|
||||
while (n) {
|
||||
|
|
@ -1273,8 +1283,7 @@ void show_user_instructions(struct pt_regs *regs)
|
|||
for (i = 0; i < 8 && n; i++, n--, pc += sizeof(int)) {
|
||||
int instr;
|
||||
|
||||
if (copy_from_user_nofault(&instr, (void __user *)pc,
|
||||
sizeof(instr))) {
|
||||
if (probe_kernel_address((const void *)pc, instr)) {
|
||||
seq_buf_printf(&s, "XXXXXXXX ");
|
||||
continue;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -517,9 +517,8 @@
|
|||
433 common fspick sys_fspick
|
||||
434 common pidfd_open sys_pidfd_open
|
||||
435 nospu clone3 ppc_clone3
|
||||
436 common close_range sys_close_range
|
||||
# 436 reserved for close_range
|
||||
# 437 reserved for openat2
|
||||
# 438 reserved for pidfd_getfd
|
||||
# 439 reserved for faccessat2
|
||||
440 common process_madvise sys_process_madvise
|
||||
441 common epoll_pwait2 sys_epoll_pwait2 compat_sys_epoll_pwait2
|
||||
|
|
|
|||
|
|
@ -67,7 +67,7 @@ ftrace_modify_code(unsigned long ip, unsigned int old, unsigned int new)
|
|||
*/
|
||||
|
||||
/* read the text we want to modify */
|
||||
if (copy_from_kernel_nofault(&replaced, (void *)ip, MCOUNT_INSN_SIZE))
|
||||
if (probe_kernel_read(&replaced, (void *)ip, MCOUNT_INSN_SIZE))
|
||||
return -EFAULT;
|
||||
|
||||
/* Make sure it is what we expect it to be */
|
||||
|
|
@ -128,7 +128,7 @@ __ftrace_make_nop(struct module *mod,
|
|||
unsigned int op, pop;
|
||||
|
||||
/* read where this goes */
|
||||
if (copy_from_kernel_nofault(&op, (void *)ip, sizeof(int))) {
|
||||
if (probe_kernel_read(&op, (void *)ip, sizeof(int))) {
|
||||
pr_err("Fetching opcode failed.\n");
|
||||
return -EFAULT;
|
||||
}
|
||||
|
|
@ -162,7 +162,7 @@ __ftrace_make_nop(struct module *mod,
|
|||
/* When using -mkernel_profile there is no load to jump over */
|
||||
pop = PPC_INST_NOP;
|
||||
|
||||
if (copy_from_kernel_nofault(&op, (void *)(ip - 4), 4)) {
|
||||
if (probe_kernel_read(&op, (void *)(ip - 4), 4)) {
|
||||
pr_err("Fetching instruction at %lx failed.\n", ip - 4);
|
||||
return -EFAULT;
|
||||
}
|
||||
|
|
@ -193,7 +193,7 @@ __ftrace_make_nop(struct module *mod,
|
|||
* Check what is in the next instruction. We can see ld r2,40(r1), but
|
||||
* on first pass after boot we will see mflr r0.
|
||||
*/
|
||||
if (copy_from_kernel_nofault(&op, (void *)(ip+4), MCOUNT_INSN_SIZE)) {
|
||||
if (probe_kernel_read(&op, (void *)(ip+4), MCOUNT_INSN_SIZE)) {
|
||||
pr_err("Fetching op failed.\n");
|
||||
return -EFAULT;
|
||||
}
|
||||
|
|
@ -222,7 +222,7 @@ __ftrace_make_nop(struct module *mod,
|
|||
unsigned long ip = rec->ip;
|
||||
unsigned long tramp;
|
||||
|
||||
if (copy_from_kernel_nofault(&op, (void *)ip, MCOUNT_INSN_SIZE))
|
||||
if (probe_kernel_read(&op, (void *)ip, MCOUNT_INSN_SIZE))
|
||||
return -EFAULT;
|
||||
|
||||
/* Make sure that that this is still a 24bit jump */
|
||||
|
|
@ -245,7 +245,7 @@ __ftrace_make_nop(struct module *mod,
|
|||
pr_devel("ip:%lx jumps to %lx", ip, tramp);
|
||||
|
||||
/* Find where the trampoline jumps to */
|
||||
if (copy_from_kernel_nofault(jmp, (void *)tramp, sizeof(jmp))) {
|
||||
if (probe_kernel_read(jmp, (void *)tramp, sizeof(jmp))) {
|
||||
pr_err("Failed to read %lx\n", tramp);
|
||||
return -EFAULT;
|
||||
}
|
||||
|
|
@ -339,7 +339,7 @@ static int setup_mcount_compiler_tramp(unsigned long tramp)
|
|||
return -1;
|
||||
|
||||
/* New trampoline -- read where this goes */
|
||||
if (copy_from_kernel_nofault(&op, (void *)tramp, sizeof(int))) {
|
||||
if (probe_kernel_read(&op, (void *)tramp, sizeof(int))) {
|
||||
pr_debug("Fetching opcode failed.\n");
|
||||
return -1;
|
||||
}
|
||||
|
|
@ -389,7 +389,7 @@ static int __ftrace_make_nop_kernel(struct dyn_ftrace *rec, unsigned long addr)
|
|||
unsigned int op;
|
||||
|
||||
/* Read where this goes */
|
||||
if (copy_from_kernel_nofault(&op, (void *)ip, sizeof(int))) {
|
||||
if (probe_kernel_read(&op, (void *)ip, sizeof(int))) {
|
||||
pr_err("Fetching opcode failed.\n");
|
||||
return -EFAULT;
|
||||
}
|
||||
|
|
@ -514,7 +514,7 @@ __ftrace_make_call(struct dyn_ftrace *rec, unsigned long addr)
|
|||
struct module *mod = rec->arch.mod;
|
||||
|
||||
/* read where this goes */
|
||||
if (copy_from_kernel_nofault(op, ip, sizeof(op)))
|
||||
if (probe_kernel_read(op, ip, sizeof(op)))
|
||||
return -EFAULT;
|
||||
|
||||
if (!expected_nop_sequence(ip, op[0], op[1])) {
|
||||
|
|
@ -576,7 +576,7 @@ __ftrace_make_call(struct dyn_ftrace *rec, unsigned long addr)
|
|||
unsigned long ip = rec->ip;
|
||||
|
||||
/* read where this goes */
|
||||
if (copy_from_kernel_nofault(&op, (void *)ip, MCOUNT_INSN_SIZE))
|
||||
if (probe_kernel_read(&op, (void *)ip, MCOUNT_INSN_SIZE))
|
||||
return -EFAULT;
|
||||
|
||||
/* It should be pointing to a nop */
|
||||
|
|
@ -632,7 +632,7 @@ static int __ftrace_make_call_kernel(struct dyn_ftrace *rec, unsigned long addr)
|
|||
}
|
||||
|
||||
/* Make sure we have a nop */
|
||||
if (copy_from_kernel_nofault(&op, ip, sizeof(op))) {
|
||||
if (probe_kernel_read(&op, ip, sizeof(op))) {
|
||||
pr_err("Unable to read ftrace location %p\n", ip);
|
||||
return -EFAULT;
|
||||
}
|
||||
|
|
@ -710,7 +710,7 @@ __ftrace_modify_call(struct dyn_ftrace *rec, unsigned long old_addr,
|
|||
}
|
||||
|
||||
/* read where this goes */
|
||||
if (copy_from_kernel_nofault(&op, (void *)ip, sizeof(int))) {
|
||||
if (probe_kernel_read(&op, (void *)ip, sizeof(int))) {
|
||||
pr_err("Fetching opcode failed.\n");
|
||||
return -EFAULT;
|
||||
}
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue