Home
last modified time | relevance | path

Searched +full:non +full:- +full:safety (Results 1 – 25 of 224) sorted by relevance

123456789

/openbmc/linux/rust/kernel/
H A Dallocator.rs1 // SPDX-License-Identifier: GPL-2.0
14 /// # Safety
16 /// - `ptr` can be either null or a pointer which has been allocated by this allocator.
17 /// - `new_layout` must have a non-zero size.
18 unsafe fn krealloc_aligned(ptr: *mut u8, new_layout: Layout, flags: bindings::gfp_t) -> *mut u8 { in krealloc_aligned()
26 // to use the "power-of-two" size/alignment guarantee (see comments in `kmalloc()` for in krealloc_aligned()
34 // SAFETY: in krealloc_aligned()
35 // - `ptr` is either null or a pointer returned from a previous `k{re}alloc()` by the in krealloc_aligned()
36 // function safety requirement. in krealloc_aligned()
37 // - `size` is greater than 0 since it's either a `layout.size()` (which cannot be zero in krealloc_aligned()
[all …]
H A Dstr.rs1 // SPDX-License-Identifier: GPL-2.0
15 /// Byte string without UTF-8 validity guarantee.
22 /// `b_str!` converts the supplied string literal to byte string, so non-ASCII
53 fn from(_: CStrConvertError) -> Error { in from()
68 pub const fn len(&self) -> usize { in len()
69 self.len_with_nul() - 1 in len()
74 pub const fn len_with_nul(&self) -> usize { in len_with_nul()
75 // SAFETY: This is one of the invariant of `CStr`. in len_with_nul()
77 // the value returned from this function is non-zero. in len_with_nul()
86 pub const fn is_empty(&self) -> bool { in is_empty()
[all …]
H A Dkunit.rs1 // SPDX-License-Identifier: GPL-2.0
3 //! KUnit-based macros for Rust unit tests.
7 //! Reference: <https://docs.kernel.org/dev-tools/kunit/index.html>
11 /// Prints a KUnit error-level message.
16 // SAFETY: The format string is null-terminated and the `%pA` specifier matches the argument we in err()
27 /// Prints a KUnit info-level message.
32 // SAFETY: The format string is null-terminated and the `%pA` specifier matches the argument we in info()
60 static LINE: i32 = core::line!() as i32 - $diff;
63 // SAFETY: FFI call without safety requirements.
69 // `scripts/rustdoc_test_gen.rs`) or if some non-test code calls this macro by
[all …]
H A Dtask.rs1 // SPDX-License-Identifier: GPL-2.0
14 // SAFETY: Deref + addr-of below create a temporary `TaskRef` that cannot outlive the
26 /// Instances of this type are always ref-counted, that is, a call to `get_task_struct` ensures
56 /// fn new() -> Self {
67 // SAFETY: By design, the only way to access a `Task` is via the `current` function or via an
73 // SAFETY: It's OK to access `Task` through shared references from other threads because we're
87 /// # Safety
90 pub unsafe fn current() -> impl Deref<Target = Task> { in current()
99 fn deref(&self) -> &Self::Target { in current()
104 // SAFETY: Just an FFI call with no additional safety requirements. in current()
[all …]
H A Dtypes.rs1 // SPDX-License-Identifier: GPL-2.0
15 /// Used to transfer ownership to and from foreign (non-Rust) languages.
27 /// Converts a Rust-owned object to a foreign-owned one.
30 fn into_foreign(self) -> *const core::ffi::c_void; in into_foreign()
32 /// Borrows a foreign-owned object.
34 /// # Safety
38 unsafe fn borrow<'a>(ptr: *const core::ffi::c_void) -> Self::Borrowed<'a>; in borrow()
40 /// Converts a foreign-owned object back to a Rust-owned one.
42 /// # Safety
48 unsafe fn from_foreign(ptr: *const core::ffi::c_void) -> Self; in from_foreign()
[all …]
H A Derror.rs1 // SPDX-License-Identifier: GPL-2.0
5 //! C header: [`include/uapi/asm-generic/errno-base.h`](../../../include/uapi/asm-generic/errno-bas…
19 /// Contains the C-compatible error codes.
27 pub const $err: super::Error = super::Error(-(crate::bindings::$err as i32));
48 declare_err!(EXDEV, "Cross-device link.");
60 declare_err!(EROFS, "Read-only file system.");
93 /// The value is a valid `errno` (i.e. `>= -MAX_ERRNO && < 0`).
100 /// It is a bug to pass an out-of-range `errno`. `EINVAL` would
102 pub(crate) fn from_errno(errno: core::ffi::c_int) -> Error { in from_errno()
103 if errno < -(bindings::MAX_ERRNO as i32) || errno >= 0 { in from_errno()
[all …]
H A Dprint.rs1 // SPDX-License-Identifier: GPL-2.0
7 //! Reference: <https://www.kernel.org/doc/html/latest/core-api/printk-basics.html>
25 ) -> *mut c_char { in rust_fmt_argument()
27 // SAFETY: The C contract guarantees that `buf` is valid if it's less than `end`. in rust_fmt_argument()
52 const fn generate(is_cont: bool, prefix: &[u8; 3]) -> [u8; LENGTH] { in generate()
62 let suffix: &[u8; LENGTH - LENGTH_PREFIX] = if is_cont {
74 // Generate the format strings at compile-time.
95 /// # Safety
98 /// the module name must be null-terminated.
129 // SAFETY: The format string is fixed. in call_printk_cont()
[all …]
/openbmc/linux/rust/kernel/sync/
H A Darc.rs1 // SPDX-License-Identifier: GPL-2.0
3 //! A reference-counted pointer.
5 //! This module implements a way for users to create reference-counted objects and pointers to
16 //! [`Arc`]: https://doc.rust-lang.org/std/sync/struct.Arc.html
39 /// A reference-counted pointer to an instance of `T`.
46 /// The reference count on an instance of [`Arc`] is always non-zero.
59 /// // Create a ref-counted instance of `Example`.
144 // dynamically-sized type (DST) `U`.
150 // SAFETY: It is safe to send `Arc<T>` to another thread when the underlying `T` is `Sync` because
156 // SAFETY: It is safe to send `&Arc<T>` to another thread when the underlying `T` is `Sync`
[all …]
/openbmc/linux/rust/alloc/
H A Dalloc.rs1 // SPDX-License-Identifier: Apache-2.0 OR MIT
26 …// The rustc fork of LLVM 14 and earlier also special-cases these function names to be able to opt…
30 fn __rust_alloc(size: usize, align: usize) -> *mut u8; in __rust_alloc()
36 fn __rust_realloc(ptr: *mut u8, old_size: usize, align: usize, new_size: usize) -> *mut u8; in __rust_realloc()
39 fn __rust_alloc_zeroed(size: usize, align: usize) -> *mut u8; in __rust_alloc_zeroed()
69 /// # Safety
94 pub unsafe fn alloc(layout: Layout) -> *mut u8 { in alloc()
113 /// # Safety
131 /// # Safety
137 pub unsafe fn realloc(ptr: *mut u8, layout: Layout, new_size: usize) -> *mut u8 { in realloc()
[all …]
H A Dslice.rs1 // SPDX-License-Identifier: Apache-2.0 OR MIT
91 // `core::slice::SliceExt` - we need to supply these functions for the
102 pub fn into_vec<T, A: Allocator>(b: Box<[T], A>) -> Vec<T, A> { in into_vec()
112 pub fn to_vec<T: ConvertVec, A: Allocator>(s: &[T], alloc: A) -> Vec<T, A> { in to_vec()
118 fn to_vec<A: Allocator>(s: &[Self], alloc: A) -> Vec<Self, A> in to_vec()
126 default fn to_vec<A: Allocator>(s: &[Self], alloc: A) -> Vec<Self, A> { in to_vec()
134 // SAFETY: in to_vec()
151 // SAFETY: in to_vec()
163 fn to_vec<A: Allocator>(s: &[Self], alloc: A) -> Vec<Self, A> { in to_vec()
165 // SAFETY: in to_vec()
[all …]
/openbmc/linux/arch/arm/mm/
H A Dproc-sa110.S1 /* SPDX-License-Identifier: GPL-2.0-only */
3 * linux/arch/arm/mm/proc-sa110.S
5 * Copyright (C) 1997-2002 Russell King
6 * hacked for non-paged-MM by Hyok S. Choi, 2003.
11 * functions on the StrongARM-110.
17 #include <asm/asm-offsets.h>
20 #include <asm/pgtable-hwdef.h>
23 #include "proc-macros.S"
95 mov r0, r0 @ safety
96 mov r0, r0 @ safety
[all …]
/openbmc/linux/rust/alloc/vec/
H A Dinto_iter.rs1 // SPDX-License-Identifier: Apache-2.0 OR MIT
48 // for both ZST and non-ZST.
53 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { in fmt()
71 pub fn as_slice(&self) -> &[T] { in as_slice()
89 pub fn as_mut_slice(&mut self) -> &mut [T] { in as_mut_slice()
96 pub fn allocator(&self) -> &A { in allocator()
100 fn as_raw_mut_slice(&mut self) -> *mut [T] { in as_raw_mut_slice()
117 /// This method is used by in-place iteration, refer to the vec::in_place_collect
147 pub(crate) fn into_vecdeque(self) -> VecDeque<T, A> { in into_vecdeque()
151 // SAFETY: This allocation originally came from a `Vec`, so it passes in into_vecdeque()
[all …]
/openbmc/qemu/include/qapi/
H A Dopts-visitor.h9 * See the COPYING.LIB file in the top-level directory.
18 /* Inclusive upper bound on the size of any flattened range. This is a safety
19 * (= anti-annoyance) measure; wrong ranges should not cause long startup
26 /* Contrarily to qemu-option.c::parse_option_number(), OptsVisitor's "int"
28 * - string representations of negative numbers yield negative values,
29 * - values below INT64_MIN or LLONG_MIN are rejected,
30 * - values above INT64_MAX or LLONG_MAX are rejected.
34 * QTypes. It also requires a non-null list argument to
/openbmc/linux/lib/
H A DKconfig.kasan1 # SPDX-License-Identifier: GPL-2.0-only
23 def_bool $(cc-option, -fsanitize=kernel-address)
26 def_bool $(cc-option, -fsanitize=kernel-hwaddress)
35 bool "KASAN: dynamic memory safety error detector"
43 Enables KASAN (Kernel Address Sanitizer) - a dynamic memory safety
44 error detector designed to find out-of-bounds and use-after-free bugs.
46 See Documentation/dev-tools/kasan.rst for details.
53 …def_bool (CC_IS_CLANG && $(cc-option,-fsanitize=kernel-address -mllvm -asan-kernel-mem-intrinsic-p…
54 (CC_IS_GCC && $(cc-option,-fsanitize=kernel-address --param asan-kernel-mem-intrinsic-prefix=1))
69 2. Software Tag-Based KASAN (arm64 only, based on software memory
[all …]
H A DKconfig.kfence1 # SPDX-License-Identifier: GPL-2.0-only
7 bool "KFENCE: low-overhead sampling-based memory safety error detector"
12 KFENCE is a low-overhead sampling-based detector of heap out-of-bounds
13 access, use-after-free, and invalid-free errors. KFENCE is designed
17 See <file:Documentation/dev-tools/kfence.rst> for more details.
37 setting "kfence.sample_interval" to a non-zero value enables KFENCE.
52 CPU wake-ups if the system is idle, at the risk of a less predictable
55 Warning: The KUnit test suite fails with this option enabled - due to
68 Using static keys comes with trade-offs that need to be carefully
80 pages, resulting in spurious use-after-frees. The main purpose of
H A Ddecompress_unzstd.c1 // SPDX-License-Identifier: GPL-2.0
4 * Important notes about in-place decompression
8 * most of the compressed data. There must be enough safety margin to
11 * The safety margin for ZSTD with a 128 KB block size is calculated below.
14 * The worst case for in-place decompression is that the beginning of
16 * uncompressible. Thus, we must look for worst-case expansion when the
42 * Now we have enough information to calculate the safety margin. We need
43 * - 22 bytes for the .zst file format headers;
44 * - 3 bytes per every 128 KiB of uncompressed size (one block header per
46 * - 128 KiB (biggest possible zstd block size) to make sure that the
[all …]
/openbmc/linux/Documentation/devicetree/bindings/pci/
H A Dsnps,dw-pcie-ep.yaml1 # SPDX-License-Identifier: GPL-2.0
3 ---
4 $id: http://devicetree.org/schemas/pci/snps,dw-pcie-ep.yaml#
5 $schema: http://devicetree.org/meta-schemas/core.yaml#
10 - Jingoo Han <jingoohan1@gmail.com>
11 - Gustavo Pimentel <gustavo.pimentel@synopsys.com>
16 # Please create a separate DT-schema for your DWC PCIe Endpoint controller
17 # and make sure it's assigned with the vendor-specific compatible string.
21 const: snps,dw-pcie-ep
23 - compatible
[all …]
H A Dsnps,dw-pcie.yaml1 # SPDX-License-Identifier: GPL-2.0
3 ---
4 $id: http://devicetree.org/schemas/pci/snps,dw-pcie.yaml#
5 $schema: http://devicetree.org/meta-schemas/core.yaml#
10 - Jingoo Han <jingoohan1@gmail.com>
11 - Gustavo Pimentel <gustavo.pimentel@synopsys.com>
16 # Please create a separate DT-schema for your DWC PCIe Root Port controller
17 # and make sure it's assigned with the vendor-specific compatible string.
21 const: snps,dw-pcie
23 - compatible
[all …]
/openbmc/linux/Documentation/admin-guide/hw-vuln/
H A Dsrso.rst1 .. SPDX-License-Identifier: GPL-2.0
8 known scenario of poisoning CPU functional units - the Branch Target
9 Buffer (BTB) and Return Address Predictor (RAP) in this case - and then
14 Return Address Stack/Return Stack Buffer). In some cases, a non-architectural
20 but the concern is that an attacker can mis-train the CPU BTB to predict
21 non-architectural CALL instructions in kernel space and use this to
23 leading to information disclosure via a speculative side-channel.
25 The issue is tracked under CVE-2023-20569.
28 -------------------
30 AMD Zen, generations 1-4. That is, all families 0x17 and 0x19. Older
[all …]
/openbmc/linux/Documentation/trace/
H A Dkprobes.rst29 collect debugging and performance information non-disruptively. You
41 In the typical case, Kprobes-based instrumentation is packaged as
56 Kprobes -- e.g., the difference between a pre_handler and
62 -----------------------
74 Next, Kprobes single-steps its copy of the probed instruction.
75 (It would be simpler to single-step the actual instruction in place,
80 After the instruction is single-stepped, Kprobes executes the
85 -----------------------
105 -------------
114 is an arbitrary piece of code -- typically just a nop instruction.
[all …]
/openbmc/qemu/include/hw/xen/interface/hvm/
H A Dparams.h1 /* SPDX-License-Identifier: MIT */
34 * How should CPU0 event-channel notifications be delivered?
36 * If val == 0 then CPU0 event-channel notifications are not delivered.
62 * val[15:8] is interrupt flag of the PPI used by event-channel:
65 * val[7:0] is a PPI number used by event-channel.
74 * These are not used by Xen. They are here for convenience of HVM-guest
89 …* (See http://download.microsoft.com/download/A/B/4/AB43A34E-BDD0-4FA6-BDEF-79EEF16E880B/Hyperviso…
99 * - Hypercall MSRs (HV_X64_MSR_GUEST_OS_ID and HV_X64_MSR_HYPERCALL)
100 * - APIC access MSRs (HV_X64_MSR_EOI, HV_X64_MSR_ICR and HV_X64_MSR_TPR)
101 * - Virtual Processor index MSR (HV_X64_MSR_VP_INDEX)
[all …]
/openbmc/linux/arch/arm64/lib/
H A Dmemset.S1 /* SPDX-License-Identifier: GPL-2.0-only */
9 * http://bazaar.launchpad.net/~linaro-toolchain-dev/cortex-strings/trunk/
21 * x0 - buf
22 * x1 - c
23 * x2 - n
25 * x0 - buf
54 /*All store maybe are non-aligned..*/
79 stp A_l, A_l, [dst] /*non-aligned store..*/
103 * It will lead some bytes written twice and the access is non-aligned.
109 stp A_l, A_l, [dst, #-16] /* Repeat some/all of last store. */
[all …]
/openbmc/linux/Documentation/devicetree/bindings/remoteproc/
H A Dxlnx,zynqmp-r5fss.yaml1 # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
3 ---
4 $id: http://devicetree.org/schemas/remoteproc/xlnx,zynqmp-r5fss.yaml#
5 $schema: http://devicetree.org/meta-schemas/core.yaml#
10 - Ben Levinsky <ben.levinsky@amd.com>
11 - Tanmay Shah <tanmay.shah@amd.com>
14 The Xilinx platforms include a pair of Cortex-R5F processors (RPU) for
15 real-time processing based on the Cortex-R5F processor core from ARM.
16 The Cortex-R5F processor implements the Arm v7-R architecture and includes a
17 floating-point unit that implements the Arm VFPv3 instruction set.
[all …]
/openbmc/linux/drivers/mtd/maps/
H A Dsun_uflash.c1 // SPDX-License-Identifier: GPL-2.0-only
2 /* sun_uflash.c - Driver for user-programmable flash on
5 * This driver does NOT provide access to the OBP-flash for
6 * safety reasons-- use <linux>/drivers/sbus/char/flash.c instead.
31 #define UFLASH_BUSWIDTH 1 /* EBus is 8-bit */
34 MODULE_DESCRIPTION("User-programmable flash device on Sun Microsystems boardsets");
45 .name = "SUNW,???-????",
54 if (op->resource[1].flags) { in uflash_devinit()
55 /* Non-CFI userflash device-- once I find one we in uflash_devinit()
59 dp, (unsigned long long)op->resource[0].start); in uflash_devinit()
[all …]
/openbmc/linux/arch/x86/realmode/rm/
H A Dtrampoline_64.S1 /* SPDX-License-Identifier: GPL-2.0 */
15 * with 16-bit addressing and 16-bit data. CS has some value
24 * --full-contents --reloc to make sure there are no relocation
33 #include <asm/processor-flags.h>
78 * GDT tables in non default location kernel can be beyond 16MB and
102 /* SEV-ES supports non-zero IP for entry points - no alignment needed */
133 * Check for memory encryption support. This is a safety net in
194 * paging and complete the switch to legacy 32-bit mode.
214 * APs start here on a direct transfer from 64-bit BIOS with identity
216 * 32-bit mode (to handle 4-level vs. 5-level paging), and to (re)load
[all …]

123456789