/linux/kernel/ |
H A D | cred.c | 175 struct cred *new; in cred_alloc_blank() local 177 new = kmem_cache_zalloc(cred_jar, GFP_KERNEL); in cred_alloc_blank() 178 if (!new) in cred_alloc_blank() 181 atomic_long_set(&new->usage, 1); in cred_alloc_blank() 182 if (security_cred_alloc_blank(new, GFP_KERNEL_ACCOUNT) < 0) in cred_alloc_blank() 185 return new; in cred_alloc_blank() 188 abort_creds(new); in cred_alloc_blank() 193 * prepare_creds - Prepare a new set of credentials for modification 195 * Prepare a new set of task credentials for modification. A task's creds 197 * prepare a new cop 210 struct cred *new; prepare_creds() local 259 struct cred *new; prepare_exec_creds() local 292 struct cred *new; copy_creds() local 392 commit_creds(struct cred * new) commit_creds() argument 469 abort_creds(struct cred * new) abort_creds() argument 486 override_creds(const struct cred * new) override_creds() argument 583 set_cred_ucounts(struct cred * new) set_cred_ucounts() argument 632 struct cred *new; prepare_kernel_cred() local 688 set_security_override(struct cred * new,u32 secid) set_security_override() argument 704 set_security_override_from_ctx(struct cred * new,const char * secctx) set_security_override_from_ctx() argument 726 set_create_files_as(struct cred * new,struct inode * inode) set_create_files_as() argument [all...] |
/linux/security/ |
H A D | commoncap.c | 243 int cap_capset(struct cred *new, in cap_capset() argument 270 new->cap_effective = *effective; in cap_capset() 271 new->cap_inheritable = *inheritable; in cap_capset() 272 new->cap_permitted = *permitted; in cap_capset() 278 new->cap_ambient = cap_intersect(new->cap_ambient, in cap_capset() 281 if (WARN_ON(!cap_ambient_invariant_ok(new))) in cap_capset() 592 struct cred *new = bprm->cred; in bprm_caps_from_vfs_caps() local 605 new->cap_permitted.val = in bprm_caps_from_vfs_caps() 606 (new->cap_bset.val & caps->permitted.val) | in bprm_caps_from_vfs_caps() 607 (new->cap_inheritable.val & caps->inheritable.val); in bprm_caps_from_vfs_caps() [all …]
|
/linux/fs/nfsd/ |
H A D | auth.c | 25 struct cred *new; in nfsd_setuser() local 31 new = prepare_creds(); in nfsd_setuser() 32 if (!new) in nfsd_setuser() 35 new->fsuid = cred->cr_uid; in nfsd_setuser() 36 new->fsgid = cred->cr_gid; in nfsd_setuser() 41 new->fsuid = exp->ex_anon_uid; in nfsd_setuser() 42 new->fsgid = exp->ex_anon_gid; in nfsd_setuser() 47 if (uid_eq(new->fsuid, GLOBAL_ROOT_UID)) in nfsd_setuser() 48 new->fsuid = exp->ex_anon_uid; in nfsd_setuser() 49 if (gid_eq(new->fsgid, GLOBAL_ROOT_GID)) in nfsd_setuser() [all …]
|
/linux/arch/arm64/kvm/hyp/ |
H A D | exception.c | 94 unsigned long sctlr, vbar, old, new, mode; in enter_exception64() local 127 new = 0; in enter_exception64() 129 new |= (old & PSR_N_BIT); in enter_exception64() 130 new |= (old & PSR_Z_BIT); in enter_exception64() 131 new |= (old & PSR_C_BIT); in enter_exception64() 132 new |= (old & PSR_V_BIT); in enter_exception64() 135 new |= PSR_TCO_BIT; in enter_exception64() 137 new |= (old & PSR_DIT_BIT); in enter_exception64() 145 new |= (old & PSR_PAN_BIT); in enter_exception64() 147 new |= PSR_PAN_BIT; in enter_exception64() [all …]
|
/linux/security/ipe/ |
H A D | policy.c | 93 struct ipe_policy *old, *ap, *new = NULL; in ipe_update_policy() local 100 new = ipe_new_policy(text, textlen, pkcs7, pkcs7len); in ipe_update_policy() 101 if (IS_ERR(new)) in ipe_update_policy() 102 return PTR_ERR(new); in ipe_update_policy() 104 if (strcmp(new->parsed->name, old->parsed->name)) { in ipe_update_policy() 109 if (ver_to_u64(old) >= ver_to_u64(new)) { in ipe_update_policy() 114 root->i_private = new; in ipe_update_policy() 115 swap(new->policyfs, old->policyfs); in ipe_update_policy() 116 ipe_audit_policy_load(new); in ipe_update_policy() 122 rcu_assign_pointer(ipe_active_policy, new); in ipe_update_policy() [all …]
|
/linux/arch/powerpc/include/asm/ |
H A D | cmpxchg.h | 42 u32 __cmpxchg_##type##sfx(volatile void *p, u32 old, u32 new) \ 50 new <<= bitoff; \ 67 : "r" (p), "r" (old), "r" (new), "r" (prev_mask) \ 283 __cmpxchg_u8(volatile unsigned char *p, unsigned long old, unsigned long new) in __cmpxchg_u8() argument 298 : "r" (p), "r" (old), "r" (new) in __cmpxchg_u8() 306 unsigned long new) in __cmpxchg_u8_local() argument 318 : "r" (p), "r" (old), "r" (new) in __cmpxchg_u8_local() 325 __cmpxchg_u8_relaxed(u8 *p, unsigned long old, unsigned long new) in __cmpxchg_u8_relaxed() argument 337 : "r" (p), "r" (old), "r" (new) in __cmpxchg_u8_relaxed() 344 __cmpxchg_u8_acquire(u8 *p, unsigned long old, unsigned long new) in __cmpxchg_u8_acquire() argument [all …]
|
/linux/arch/x86/include/asm/ |
H A D | cmpxchg.h | 85 #define __raw_cmpxchg(ptr, old, new, size, lock) \ argument 89 __typeof__(*(ptr)) __new = (new); \ 133 #define __cmpxchg(ptr, old, new, size) \ argument 134 __raw_cmpxchg((ptr), (old), (new), (size), LOCK_PREFIX) 136 #define __sync_cmpxchg(ptr, old, new, size) \ argument 137 __raw_cmpxchg((ptr), (old), (new), (size), "lock; ") 139 #define __cmpxchg_local(ptr, old, new, size) \ argument 140 __raw_cmpxchg((ptr), (old), (new), (size), "") 148 #define arch_cmpxchg(ptr, old, new) \ argument 149 __cmpxchg(ptr, old, new, sizeof(*(ptr))) [all …]
|
/linux/arch/sparc/kernel/ |
H A D | ftrace.c | 26 static int ftrace_modify_code(unsigned long ip, u32 old, u32 new) in ftrace_modify_code() argument 47 : [new] "0" (new), [old] "r" (old), [ip] "r" (ip) in ftrace_modify_code() 50 if (replaced != old && replaced != new) in ftrace_modify_code() 59 u32 old, new; in ftrace_make_nop() local 62 new = ftrace_nop; in ftrace_make_nop() 63 return ftrace_modify_code(ip, old, new); in ftrace_make_nop() 69 u32 old, new; in ftrace_make_call() local 72 new = ftrace_call_replace(ip, addr); in ftrace_make_call() 73 return ftrace_modify_code(ip, old, new); in ftrace_make_call() 79 u32 old, new; in ftrace_update_ftrace_func() local [all …]
|
/linux/security/keys/ |
H A D | process_keys.c | 221 int install_thread_keyring_to_cred(struct cred *new) in install_thread_keyring_to_cred() argument 225 if (new->thread_keyring) in install_thread_keyring_to_cred() 228 keyring = keyring_alloc("_tid", new->uid, new->gid, new, in install_thread_keyring_to_cred() 235 new->thread_keyring = keyring; in install_thread_keyring_to_cred() 246 struct cred *new; in install_thread_keyring() local 249 new = prepare_creds(); in install_thread_keyring() 250 if (!new) in install_thread_keyring() 253 ret = install_thread_keyring_to_cred(new); in install_thread_keyring() 255 abort_creds(new); in install_thread_keyring() 259 return commit_creds(new); in install_thread_keyring() [all …]
|
/linux/tools/testing/selftests/rtc/ |
H A D | setdate.c | 24 struct rtc_time new, current; in main() local 47 sscanf(date, "%d-%d-%d", &new.tm_mday, &new.tm_mon, &new.tm_year); in main() 48 new.tm_mon -= 1; in main() 49 new.tm_year -= 1900; in main() 50 sscanf(time, "%d:%d:%d", &new.tm_hour, &new.tm_min, &new.tm_sec); in main() 53 new.tm_mday, new.tm_mon + 1, new.tm_year + 1900, in main() 54 new.tm_hour, new.tm_min, new.tm_sec); in main() 57 retval = ioctl(fd, RTC_SET_TIME, &new); in main()
|
/linux/fs/nfs/blocklayout/ |
H A D | extent_tree.c | 137 struct pnfs_block_extent *new, bool merge_ok) in __ext_tree_insert() argument 146 if (new->be_f_offset < be->be_f_offset) { in __ext_tree_insert() 147 if (merge_ok && ext_can_merge(new, be)) { in __ext_tree_insert() 148 be->be_f_offset = new->be_f_offset; in __ext_tree_insert() 150 be->be_v_offset = new->be_v_offset; in __ext_tree_insert() 151 be->be_length += new->be_length; in __ext_tree_insert() 156 } else if (new->be_f_offset >= ext_f_end(be)) { in __ext_tree_insert() 157 if (merge_ok && ext_can_merge(be, new)) { in __ext_tree_insert() 158 be->be_length += new->be_length; in __ext_tree_insert() 168 rb_link_node(&new->be_node, parent, p); in __ext_tree_insert() [all …]
|
/linux/fs/ |
H A D | signalfd.c | 73 struct signalfd_siginfo new; in signalfd_copyinfo() local 80 memset(&new, 0, sizeof(new)); in signalfd_copyinfo() 86 new.ssi_signo = kinfo->si_signo; in signalfd_copyinfo() 87 new.ssi_errno = kinfo->si_errno; in signalfd_copyinfo() 88 new.ssi_code = kinfo->si_code; in signalfd_copyinfo() 91 new.ssi_pid = kinfo->si_pid; in signalfd_copyinfo() 92 new.ssi_uid = kinfo->si_uid; in signalfd_copyinfo() 95 new.ssi_tid = kinfo->si_tid; in signalfd_copyinfo() 96 new.ssi_overrun = kinfo->si_overrun; in signalfd_copyinfo() 97 new.ssi_ptr = (long) kinfo->si_ptr; in signalfd_copyinfo() [all …]
|
/linux/drivers/mtd/ |
H A D | mtd_blkdevs.c | 276 int add_mtd_blktrans_dev(struct mtd_blktrans_dev *new) in add_mtd_blktrans_dev() argument 278 struct mtd_blktrans_ops *tr = new->tr; in add_mtd_blktrans_dev() 288 if (new->devnum == -1) { in add_mtd_blktrans_dev() 292 new->devnum = last_devnum+1; in add_mtd_blktrans_dev() 293 list_add_tail(&new->list, &d->list); in add_mtd_blktrans_dev() 296 } else if (d->devnum == new->devnum) { in add_mtd_blktrans_dev() 299 } else if (d->devnum > new->devnum) { in add_mtd_blktrans_dev() 301 list_add_tail(&new->list, &d->list); in add_mtd_blktrans_dev() 308 if (new->devnum == -1) in add_mtd_blktrans_dev() 309 new->devnum = last_devnum+1; in add_mtd_blktrans_dev() [all …]
|
/linux/security/apparmor/ |
H A D | label.c | 62 struct aa_proxy *new; in aa_alloc_proxy() local 64 new = kzalloc(sizeof(struct aa_proxy), gfp); in aa_alloc_proxy() 65 if (new) { in aa_alloc_proxy() 66 kref_init(&new->count); in aa_alloc_proxy() 67 rcu_assign_pointer(new->label, aa_get_label(label)); in aa_alloc_proxy() 69 return new; in aa_alloc_proxy() 73 void __aa_proxy_redirect(struct aa_label *orig, struct aa_label *new) in __aa_proxy_redirect() argument 78 AA_BUG(!new); in __aa_proxy_redirect() 83 rcu_assign_pointer(orig->proxy->label, aa_get_label(new)); in __aa_proxy_redirect() 88 static void __proxy_share(struct aa_label *old, struct aa_label *new) in __proxy_share() argument 392 label_free_or_put_new(struct aa_label * label,struct aa_label * new) label_free_or_put_new() argument 428 struct aa_label *new; aa_label_alloc() local 595 __label_remove(struct aa_label * label,struct aa_label * new) __label_remove() argument 631 __label_replace(struct aa_label * old,struct aa_label * new) __label_replace() argument 670 struct rb_node **new, *parent = NULL; __label_insert() local 797 aa_label_replace(struct aa_label * old,struct aa_label * new) aa_label_replace() argument 863 struct aa_label *new; vec_create_and_insert_label() local 1051 label_merge_insert(struct aa_label * new,struct aa_label * a,struct aa_label * b) label_merge_insert() argument 1238 struct aa_label *new; aa_label_merge() local 2054 struct aa_label *new, *tmp; __label_update() local [all...] |
H A D | domain.c | 38 * to trace the new domain 456 * The new match isn't more specific in find_attach() 569 struct aa_label *new = NULL; in x_to_label() 584 new = x_table_lookup(profile, xindex, lookupname); in x_to_label() 592 new = find_attach(bprm, ns, &profile->base.profiles, in x_to_label() 596 new = find_attach(bprm, ns, &ns->base.profiles, in x_to_label() 602 if (!new) { in x_to_label() 609 new = aa_get_newest_label(&profile->label); in x_to_label() 611 new = aa_get_newest_label(ns_unconfined(profile->ns)); in x_to_label() 616 if (new in x_to_label() 570 struct aa_label *new = NULL; x_to_label() local 639 struct aa_label *new = NULL; profile_transition() local 817 struct aa_label *new; handle_onexec() local 876 struct aa_label *label, *new = NULL; apparmor_bprm_creds_for_exec() local 1066 struct aa_label *new; change_hat() local 1181 struct aa_label *label, *previous, *new = NULL, *target = NULL; aa_change_hat() local 1331 struct aa_label *label, *new = NULL, *target = NULL; aa_change_profile() local [all...] |
H A D | task.c | 50 struct cred *new; in aa_replace_current_label() local 60 new = prepare_creds(); in aa_replace_current_label() 61 if (!new) in aa_replace_current_label() 84 aa_put_label(cred_label(new)); in aa_replace_current_label() 85 set_cred_label(new, label); in aa_replace_current_label() 87 commit_creds(new); in aa_replace_current_label() 120 struct cred *new; in aa_set_current_hat() local 122 new = prepare_creds(); in aa_set_current_hat() 123 if (!new) in aa_set_current_hat() 129 ctx->previous = cred_label(new); in aa_set_current_hat() [all …]
|
/linux/lib/ |
H A D | errseq.c | 79 errseq_t new; in errseq_set() local 82 new = (old & ~(MAX_ERRNO|ERRSEQ_SEEN)) | -err; in errseq_set() 86 new += ERRSEQ_CTR_INC; in errseq_set() 89 if (new == old) { in errseq_set() 90 cur = new; in errseq_set() 95 cur = cmpxchg(eseq, old, new); in errseq_set() 101 if (likely(cur == old || cur == new)) in errseq_set() 178 errseq_t old, new; in errseq_check_and_advance() local 199 new = old | ERRSEQ_SEEN; in errseq_check_and_advance() 200 if (new != old) in errseq_check_and_advance() [all …]
|
/linux/arch/sparc/include/asm/ |
H A D | cmpxchg_64.h | 11 __cmpxchg_u32(volatile int *m, int old, int new) in __cmpxchg_u32() argument 14 : "=&r" (new) in __cmpxchg_u32() 15 : "0" (new), "r" (m), "r" (old) in __cmpxchg_u32() 18 return new; in __cmpxchg_u32() 115 __cmpxchg_u64(volatile long *m, unsigned long old, unsigned long new) in __cmpxchg_u64() argument 118 : "=&r" (new) in __cmpxchg_u64() 119 : "0" (new), "r" (m), "r" (old) in __cmpxchg_u64() 122 return new; in __cmpxchg_u64() 131 __cmpxchg_u8(volatile unsigned char *m, unsigned char old, unsigned char new) in __cmpxchg_u8() argument 141 new32 = (load32 & ~mask) | (new << bit_shift); in __cmpxchg_u8() [all …]
|
/linux/mm/ |
H A D | page_counter.c | 56 long new; in page_counter_cancel() local 58 new = atomic_long_sub_return(nr_pages, &counter->usage); in page_counter_cancel() 60 if (WARN_ONCE(new < 0, "page_counter underflow: %ld nr_pages=%lu\n", in page_counter_cancel() 61 new, nr_pages)) { in page_counter_cancel() 62 new = 0; in page_counter_cancel() 63 atomic_long_set(&counter->usage, new); in page_counter_cancel() 66 propagate_protected_usage(counter, new); in page_counter_cancel() 82 long new; in page_counter_charge() local 84 new = atomic_long_add_return(nr_pages, &c->usage); in page_counter_charge() 86 propagate_protected_usage(c, new); in page_counter_charge() [all …]
|
/linux/fs/cachefiles/ |
H A D | security.c | 18 struct cred *new; in cachefiles_get_security_ID() local 23 new = prepare_kernel_cred(current); in cachefiles_get_security_ID() 24 if (!new) { in cachefiles_get_security_ID() 30 ret = set_security_override_from_ctx(new, cache->secctx); in cachefiles_get_security_ID() 32 put_cred(new); in cachefiles_get_security_ID() 39 cache->cache_cred = new; in cachefiles_get_security_ID() 79 struct cred *new; in cachefiles_determine_cache_security() local 86 new = prepare_creds(); in cachefiles_determine_cache_security() 87 if (!new) in cachefiles_determine_cache_security() 94 ret = set_create_files_as(new, d_backing_inode(root)); in cachefiles_determine_cache_security() [all …]
|
/linux/drivers/net/phy/ |
H A D | qt2025.rs | 45 let hw_rev = dev.read(C45::new(Mmd::PMAPMD, 0xd001))?; in probe() 51 dev.write(C45::new(Mmd::PMAPMD, 0xc300), 0x0000)?; in probe() 53 dev.write(C45::new(Mmd::PMAPMD, 0xc302), 0x0004)?; in probe() 55 dev.write(C45::new(Mmd::PMAPMD, 0xc319), 0x0038)?; in probe() 57 dev.write(C45::new(Mmd::PMAPMD, 0xc31a), 0x0098)?; in probe() 61 dev.write(C45::new(Mmd::PCS, 0x0026), 0x0e00)?; in probe() 62 dev.write(C45::new(Mmd::PCS, 0x0027), 0x0893)?; in probe() 63 dev.write(C45::new(Mmd::PCS, 0x0028), 0xa528)?; in probe() 64 dev.write(C45::new(Mmd::PCS, 0x0029), 0x0003)?; in probe() 66 dev.write(C45::new(Mmd::PMAPMD, 0xa30a), 0x06e1)?; in probe() [all …]
|
/linux/arch/csky/include/asm/ |
H A D | cmpxchg.h | 11 #define __xchg_relaxed(new, ptr, size) \ argument 14 __typeof__(new) __new = (new); \ 57 #define __cmpxchg_relaxed(ptr, old, new, size) \ argument 60 __typeof__(new) __new = (new); \ 61 __typeof__(new) __tmp; \ 90 #define __cmpxchg_acquire(ptr, old, new, size) \ argument 93 __typeof__(new) __new = (new); \ 94 __typeof__(new) __tmp; \ 124 #define __cmpxchg(ptr, old, new, size) \ argument 127 __typeof__(new) __new = (new); \ [all …]
|
/linux/kernel/printk/ |
H A D | nbcon.c | 128 static inline void nbcon_state_set(struct console *con, struct nbcon_state *new) in nbcon_state_set() argument 130 atomic_set(&ACCESS_PRIVATE(con, nbcon_state), new->atom); in nbcon_state_set() 152 struct nbcon_state *new) in nbcon_state_try_cmpxchg() argument 154 return atomic_try_cmpxchg(&ACCESS_PRIVATE(con, nbcon_state), &cur->atom, new->atom); in nbcon_state_try_cmpxchg() 242 struct nbcon_state new; in nbcon_context_try_acquire_direct() local 267 new.atom = cur->atom; in nbcon_context_try_acquire_direct() 268 new.prio = ctxt->prio; in nbcon_context_try_acquire_direct() 269 new.req_prio = NBCON_PRIO_NONE; in nbcon_context_try_acquire_direct() 270 new.unsafe = cur->unsafe_takeover; in nbcon_context_try_acquire_direct() 271 new.cpu = cpu; in nbcon_context_try_acquire_direct() [all …]
|
/linux/tools/testing/selftests/bpf/progs/ |
H A D | setget_sockopt.c | 26 int new; member 39 { .opt = SO_SNDBUF, .new = 8123, .expected = 8123 * 2, }, 40 { .opt = SO_RCVBUF, .new = 8123, .expected = 8123 * 2, }, 42 { .opt = SO_PRIORITY, .new = 0xeb9f, .expected = 0xeb9f, }, 44 { .opt = SO_RCVLOWAT, .new = 8123, .expected = 8123, }, 45 { .opt = SO_MARK, .new = 0xeb9f, .expected = 0xeb9f, }, 46 { .opt = SO_MAX_PACING_RATE, .new = 0xeb9f, .expected = 0xeb9f, }, 53 { .opt = TCP_KEEPIDLE, .new = 123, .expected = 123, .restore = 321, }, 54 { .opt = TCP_KEEPINTVL, .new = 123, .expected = 123, .restore = 321, }, 55 { .opt = TCP_KEEPCNT, .new = 123, .expected = 123, .restore = 124, }, [all …]
|
/linux/tools/include/linux/ |
H A D | refcount.h | 78 unsigned int old, new, val = atomic_read(&r->refs); in refcount_inc_not_zero() local 81 new = val + 1; in refcount_inc_not_zero() 86 if (unlikely(!new)) in refcount_inc_not_zero() 89 old = atomic_cmpxchg_relaxed(&r->refs, val, new); in refcount_inc_not_zero() 96 REFCOUNT_WARN(new == UINT_MAX, "refcount_t: saturated; leaking memory.\n"); in refcount_inc_not_zero() 123 unsigned int old, new, val = atomic_read(&r->refs); in refcount_sub_and_test() local 129 new = val - i; in refcount_sub_and_test() 130 if (new > val) { in refcount_sub_and_test() 131 REFCOUNT_WARN(new > val, "refcount_t: underflow; use-after-free.\n"); in refcount_sub_and_test() 135 old = atomic_cmpxchg_release(&r->refs, val, new); in refcount_sub_and_test() [all …]
|