/linux/tools/testing/selftests/exec/ |
H A D | binfmt_script.py | 2 # SPDX-License-Identifier: GPL-2.0 4 # Test that truncation of bprm->buf doesn't cause unexpected execs paths, along 33 # test - produce a binfmt_script hashbang line for testing 35 # @size: bytes for bprm->buf line, including hashbang but not newline 54 remaining = size - len(hashbang) - len(leading) - len(root) - len(target) - len(arg) 57 middle += fill * (NAME_MAX - 1) 59 remaining -= NAME_MAX 64 if len(target): 70 if len(newline) > 0: 73 script = "binfmt_script-%s" % (name) [all …]
|
/linux/drivers/net/ethernet/netronome/nfp/flower/ |
H A D | action.c | 1 // SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) 2 /* Copyright (C) 2017-2018 Netronome Systems, Inc. */ 39 push_mpls->head.jump_id = NFP_FL_ACTION_OPCODE_PUSH_MPLS; in nfp_fl_push_mpls() 40 push_mpls->head.len_lw = act_size >> NFP_FL_LW_SIZ; in nfp_fl_push_mpls() 43 if (act->mpls_push.bos != ACT_MPLS_BOS_NOT_SET) { in nfp_fl_push_mpls() 44 mpls_lse |= act->mpls_push.bos << MPLS_LS_S_SHIFT; in nfp_fl_push_mpls() 47 return -EOPNOTSUPP; in nfp_fl_push_mpls() 51 if (act->mpls_push.tc != ACT_MPLS_TC_NOT_SET) in nfp_fl_push_mpls() 52 mpls_lse |= act->mpls_push.tc << MPLS_LS_TC_SHIFT; in nfp_fl_push_mpls() 55 mpls_lse |= act->mpls_push.label << MPLS_LS_LABEL_SHIFT; in nfp_fl_push_mpls() [all …]
|
/linux/drivers/net/wireguard/ |
H A D | allowedips.c | 1 // SPDX-License-Identifier: GPL-2.0 3 * Copyright (C) 2015-2019 Jason A. Donenfeld <Jason@zx2c4.com>. All Rights Reserved. 26 node->cidr = cidr; in copy_and_assign_cidr() 27 node->bit_at_a = cidr / 8U; in copy_and_assign_cidr() 29 node->bit_at_a ^= (bits / 8U - 1U) % 8U; in copy_and_assign_cidr() 31 node->bit_at_b = 7U - (cidr % 8U); in copy_and_assign_cidr() 32 node->bitlen = bits; in copy_and_assign_cidr() 33 memcpy(node->bits, src, bits / 8U); in copy_and_assign_cidr() 38 return (key[node->bit_at_a] >> node->bit_at_b) & 1; in choose() 42 struct allowedips_node __rcu *p, unsigned int *len) in push_rcu() argument [all …]
|
/linux/crypto/ |
H A D | api.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 45 return try_module_get(alg->cra_module) ? crypto_alg_get(alg) : NULL; in crypto_mod_get() 51 struct module *module = alg->cra_module; in crypto_mod_put() 62 int best = -2; in __crypto_alg_lookup() 65 int exact, fuzzy; in __crypto_alg_lookup() local 70 if ((q->cra_flags ^ type) & mask) in __crypto_alg_lookup() 73 exact = !strcmp(q->cra_driver_name, name); in __crypto_alg_lookup() 74 fuzzy = !strcmp(q->cra_name, name); in __crypto_alg_lookup() 75 if (!exact && !(fuzzy && q->cra_priority > best)) in __crypto_alg_lookup() 81 best = q->cra_priority; in __crypto_alg_lookup() [all …]
|
H A D | crypto_user.c | 1 // SPDX-License-Identifier: GPL-2.0-only 35 static struct crypto_alg *crypto_alg_match(struct crypto_user_alg *p, int exact) in crypto_alg_match() argument 47 if ((q->cra_flags ^ p->cru_type) & p->cru_mask) in crypto_alg_match() 50 if (strlen(p->cru_driver_name)) in crypto_alg_match() 51 match = !strcmp(q->cra_driver_name, in crypto_alg_match() 52 p->cru_driver_name); in crypto_alg_match() 53 else if (!exact) in crypto_alg_match() 54 match = !strcmp(q->cra_name, p->cru_name); in crypto_alg_match() 79 rcipher.blocksize = alg->cra_blocksize; in crypto_report_cipher() 80 rcipher.min_keysize = alg->cra_cipher.cia_min_keysize; in crypto_report_cipher() [all …]
|
/linux/arch/arm64/kernel/ |
H A D | hw_breakpoint.c | 1 // SPDX-License-Identifier: GPL-2.0-only 3 * HW_breakpoint: a unified kernel/user-space hardware breakpoint facility, 10 #define pr_fmt(fmt) "hw-breakpoint: " fmt 23 #include <asm/debug-monitors.h> 36 /* Currently stepping a per-CPU kernel breakpoint. */ 150 return -EINVAL; in debug_exception_level() 163 struct task_struct *tsk = bp->hw.target; in is_compat_bp() 166 * tsk can be NULL for per-cpu (non-ptrace) breakpoints. in is_compat_bp() 176 * hw_breakpoint_slot_setup - Find and setup a perf slot according to 186 * -ENOSPC if no slot is available/matches [all …]
|
/linux/Documentation/netlink/ |
H A D | genetlink.yaml | 1 # SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause) 3 --- 4 $id: http://kernel.org/schemas/netlink/genetlink-legacy.yaml# 5 $schema: https://json-schema.org/draft-07/schema 12 len-or-define: 14 pattern: ^[0-9A-Za-z_-]+( - 1)?$ 16 len-or-limit: 17 # literal int or limit based on fixed-width type e.g. u8-min, u16-max, etc. 19 pattern: ^[su](8|16|32|64)-(min|max)$ 26 required: [ name, doc, attribute-sets, operations ] [all …]
|
/linux/fs/ubifs/ |
H A D | tnc.c | 1 // SPDX-License-Identifier: GPL-2.0-only 5 * Copyright (C) 2006-2008 Nokia Corporation. 13 * the UBIFS B-tree. 53 p = &c->old_idx.rb_node; in do_insert_old_idx() 57 if (old_idx->lnum < o->lnum) in do_insert_old_idx() 58 p = &(*p)->rb_left; in do_insert_old_idx() 59 else if (old_idx->lnum > o->lnum) in do_insert_old_idx() 60 p = &(*p)->rb_right; in do_insert_old_idx() 61 else if (old_idx->offs < o->offs) in do_insert_old_idx() 62 p = &(*p)->rb_left; in do_insert_old_idx() [all …]
|
H A D | tnc_misc.c | 1 // SPDX-License-Identifier: GPL-2.0-only 5 * Copyright (C) 2006-2008 Nokia Corporation. 12 * This file contains miscelanious TNC-related functions shared betweend 14 * sub-system. The file was created because there is a lot of TNC code and 21 * ubifs_tnc_levelorder_next - next TNC tree element in levelorder traversal. 22 * @c: UBIFS file-system description object 42 if (znode->level == 0) in ubifs_tnc_levelorder_next() 47 level = znode->level; in ubifs_tnc_levelorder_next() 49 iip = znode->iip; in ubifs_tnc_levelorder_next() 51 ubifs_assert(c, znode->level <= zr->level); in ubifs_tnc_levelorder_next() [all …]
|
/linux/fs/xfs/libxfs/ |
H A D | xfs_rmap.c | 1 // SPDX-License-Identifier: GPL-2.0 34 * Lookup the first record less than or equal to [bno, len, owner, offset] 50 cur->bc_rec.r.rm_startblock = bno; in xfs_rmap_lookup_le() 51 cur->bc_rec.r.rm_blockcount = 0; in xfs_rmap_lookup_le() 52 cur->bc_rec.r.rm_owner = owner; in xfs_rmap_lookup_le() 53 cur->bc_rec.r.rm_offset = offset; in xfs_rmap_lookup_le() 54 cur->bc_rec.r.rm_flags = flags; in xfs_rmap_lookup_le() 65 return -EFSCORRUPTED; in xfs_rmap_lookup_le() 72 * Lookup the record exactly matching [bno, len, owner, offset] 79 xfs_extlen_t len, in xfs_rmap_lookup_eq() argument [all …]
|
/linux/arch/x86/lib/ |
H A D | csum-partial_64.c | 1 // SPDX-License-Identifier: GPL-2.0 3 * arch/x86_64/lib/csum-partial.c 6 * in an architecture-specific manner due to speed. 12 #include <asm/word-at-a-time.h> 42 * it's best to have buff aligned on a 64-bit boundary 44 __wsum csum_partial(const void *buff, int len, __wsum sum) in csum_partial() argument 48 /* Do two 40-byte chunks in parallel to get better ILP */ in csum_partial() 49 if (likely(len >= 80)) { in csum_partial() 55 len -= 80; in csum_partial() 56 } while (len >= 80); in csum_partial() [all …]
|
/linux/include/linux/ |
H A D | bch.h | 1 /* SPDX-License-Identifier: GPL-2.0-only */ 12 * Bose-Chaudhuri-Hocquenghem (BCH) codes. 20 * struct bch_control - BCH control structure 22 * @n: maximum codeword size in bits (= 2^m-1) 24 * @ecc_bits: ecc exact size in bits, i.e. generator polynomial degree (<=m*t) 33 * @cache: log-based polynomial representation buffer 64 unsigned int len, uint8_t *ecc); 66 int bch_decode(struct bch_control *bch, const uint8_t *data, unsigned int len,
|
/linux/arch/s390/include/uapi/asm/ |
H A D | pkey.h | 1 /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ 97 __u32 len; /* bytes actually stored in protkey[] */ member 113 __u16 len; /* total length in bytes (including this header) */ member 116 __u16 bitlen; /* clear key bit len, 0 for unknown */ 244 * All apqns in the list need to be exact apqns, 0xFFFF as ANY card or domain 249 * (return -1 with errno ENODEV). You may use the PKEY_APQNS4KT ioctl to 278 * All apqns in the list need to be exact apqns, 0xFFFF as ANY card or domain 283 * (return -1 with errno ENODEV). You may use the PKEY_APQNS4KT ioctl to 331 * apqn does not match or there is no such apqn found, -1 with errno 349 * All apqns in the list need to be exact apqns, 0xFFFF as ANY card or domain [all …]
|
/linux/arch/arm/kernel/ |
H A D | hw_breakpoint.c | 1 // SPDX-License-Identifier: GPL-2.0-only 10 * HW_breakpoint: a unified kernel/user-space hardware breakpoint facility, 13 #define pr_fmt(fmt) "hw-breakpoint: " fmt 151 /* We don't support the memory-mapped interface. */ in debug_arch_supported() 216 return core_has_mismatch_brps() ? brps - 1 : brps; in get_num_brps() 257 return -ENODEV; in enable_monitor_mode() 265 return -EPERM; in enable_monitor_mode() 293 * Check if 8-bit byte-address select is available. 306 ctrl.len = ARM_BREAKPOINT_LEN_8; in get_max_wp_len() 333 addr = info->address; in arch_install_hw_breakpoint() [all …]
|
/linux/drivers/media/rc/img-ir/ |
H A D | img-ir-sony.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 5 * Copyright 2012-2014 Imagination Technologies Ltd. 8 #include "img-ir-hw.h" 11 static int img_ir_sony_scancode(int len, u64 raw, u64 enabled_protocols, in img_ir_sony_scancode() argument 16 switch (len) { in img_ir_sony_scancode() 19 return -EINVAL; in img_ir_sony_scancode() 24 request->protocol = RC_PROTO_SONY12; in img_ir_sony_scancode() 28 return -EINVAL; in img_ir_sony_scancode() 33 request->protocol = RC_PROTO_SONY15; in img_ir_sony_scancode() 37 return -EINVAL; in img_ir_sony_scancode() [all …]
|
H A D | img-ir-nec.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 5 * Copyright 2010-2014 Imagination Technologies Ltd. 8 #include "img-ir-hw.h" 13 static int img_ir_nec_scancode(int len, u64 raw, u64 enabled_protocols, in img_ir_nec_scancode() argument 18 if (!len) in img_ir_nec_scancode() 20 if (len != 32) in img_ir_nec_scancode() 21 return -EINVAL; in img_ir_nec_scancode() 28 /* 32-bit NEC (used by Apple and TiVo remotes) */ in img_ir_nec_scancode() 30 request->scancode = bitrev8(addr) << 24 | in img_ir_nec_scancode() 34 request->protocol = RC_PROTO_NEC32; in img_ir_nec_scancode() [all …]
|
/linux/arch/loongarch/include/asm/ |
H A D | hw_breakpoint.h | 1 /* SPDX-License-Identifier: GPL-2.0 */ 3 * Copyright (C) 2022-2023 Loongson Technology Corporation Limited 21 len : 2, member 73 /* Exact number */ 89 return (ctrl.len << 10) | (ctrl.type << 8); in encode_ctrl_reg() 95 ctrl->type = reg & MWPnCFG3_Type_mask; in decode_ctrl_reg() 97 ctrl->len in decode_ctrl_reg() [all...] |
/linux/Documentation/trace/ |
H A D | ftrace-uses.rst | 48 .. code-block:: c 71 register_ftrace_function() is called and before it returns. The exact time 74 must begin at an exact moment. 87 .. code-block:: c 119 .. code-block:: c 129 .. code-block:: c 152 .. code-block:: c 202 kernel patches uses. Without this flag the pt_regs->ip can not be 234 .. code-block:: c 237 int len, int reset); [all …]
|
/linux/drivers/macintosh/ |
H A D | windfarm_mpu.h | 1 /* SPDX-License-Identifier: GPL-2.0-only */ 22 u8 signature; /* 0x00 - EEPROM sig. */ 23 u8 bytes_used; /* 0x01 - Bytes used in eeprom (160 ?) */ 24 u8 size; /* 0x02 - EEPROM size (256 ?) */ 25 u8 version; /* 0x03 - EEPROM version */ 26 u32 data_revision; /* 0x04 - Dataset revision */ 27 u8 processor_bin_code[3]; /* 0x08 - Processor BIN code */ 28 u8 bin_code_expansion; /* 0x0b - ??? (padding ?) */ 29 u8 processor_num; /* 0x0c - Number of CPUs on this MPU */ 30 u8 input_mul_bus_div; /* 0x0d - Clock input multiplier/bus divider */ [all …]
|
/linux/drivers/net/ethernet/chelsio/cxgb4vf/ |
H A D | t4vf_hw.c | 2 * This file is part of the Chelsio T4 PCI-E SR-IOV Virtual Function Ethernet 5 * Copyright (c) 2009-2010 Chelsio Communications, Inc. All rights reserved. 17 * - Redistributions of source code must retain the above 21 * - Redistributions in binary form must reproduce the above 66 return -EIO; in t4vf_wait_dev_ready() 70 * Get the reply to a mailbox command and store it in @rpl in big-endian order 71 * (since the firmware data structures are specified in a big-endian layout). 76 for ( ; size; size -= 8, mbox_data += 8) in get_mbox_rpl() 81 * t4vf_record_mbox - record a Firmware Mailbox Command/Reply in the log 91 struct mbox_cmd_log *log = adapter->mbox_log; in t4vf_record_mbox() [all …]
|
/linux/lib/ |
H A D | bitmap-str.c | 1 // SPDX-License-Identifier: GPL-2.0-only 16 * bitmap_parse_user - convert an ASCII hex string in a user buffer into a bitmap 43 * bitmap_print_to_pagebuf - convert bitmap to list or hex format ASCII string 49 * Output format is a comma-separated list of decimal numbers and 50 * ranges if list is specified or hex digits grouped into comma-separated 53 * It is assumed that @buf is a pointer into a PAGE_SIZE, page-aligned 61 ptrdiff_t len = PAGE_SIZE - offset_in_page(buf); in bitmap_print_to_pagebuf() local 63 return list ? scnprintf(buf, len, "%*pbl\n", nmaskbits, maskp) : in bitmap_print_to_pagebuf() 64 scnprintf(buf, len, "%*pb\n", nmaskbits, maskp); in bitmap_print_to_pagebuf() 69 * bitmap_print_to_buf - convert bitmap to list or hex format ASCII string [all …]
|
H A D | ts_bm.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 3 * lib/ts_bm.c Boyer-Moore text search implementation 9 * Implements Boyer-Moore string matching algorithm: 13 * 20(10), 1977, pp. 762-772. 16 * [2] Handbook of Exact String Matching Algorithms, Thierry Lecroq, 2004 17 * http://www-igm.univ-mlv.fr/~lecroq/string/string.pdf 19 * Note: Since Boyer-Moore (BM) performs searches for matchings from right 24 * Knuth-Pratt-Morris (KMP) implementation instead. In conclusion, choose 64 u8 t = *(text-i); in matchpat() 69 if (t != *(pattern-i)) in matchpat() [all …]
|
/linux/Documentation/netlink/specs/ |
H A D | ovs_flow.yaml | 1 # SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause) 5 protocol: genetlink-legacy 6 uapi-header: linux/openvswitch.h 12 - 13 name: ovs-header 18 - 19 name: dp-ifindex 24 - 25 name: ovs-flow-stats 28 - [all …]
|
/linux/arch/m68k/fpsp040/ |
H A D | bindec.S | 12 | value in memory; d0 contains the k-factor sign-extended 13 | to 32-bits. The input may be either normalized, 18 | Saves and Modifies: D2-D7,A2,FP2 23 | The k-factor is saved for use in d7. Clear the 43 | A6. Calculate LEN. 44 | LEN is the number of digits to be displayed. The 45 | k-factor can dictate either the total number of digits, 49 | If LEN is computed to be greater than 17, set OPERR in 50 | USER_FPSR. LEN is stored in d4. 54 | of decimal places needed to insure LEN integer digits [all …]
|
/linux/tools/testing/selftests/proc/ |
H A D | proc-pid-vm.c | 59 if (unshare(CLONE_NEWNS) == -1) { in make_private_tmp() 65 if (mount(NULL, "/", NULL, MS_PRIVATE|MS_REC, NULL) == -1) { in make_private_tmp() 68 if (mount(NULL, "/tmp", "tmpfs", 0, NULL) == -1) { in make_private_tmp() 73 static pid_t pid = -1; 132 mov_rsi((1ULL << 47) - 4096 - VADDR - 4096), 151 static int make_exe(const uint8_t *payload, size_t len) in make_exe() argument 159 {(void *)payload, len}, in make_exe() 193 ph.p_filesz = sizeof(struct elf64_hdr) + sizeof(struct elf64_phdr) + len; in make_exe() 194 ph.p_memsz = sizeof(struct elf64_hdr) + sizeof(struct elf64_phdr) + len; in make_exe() 198 if (fd == -1) { in make_exe() [all …]
|