cve_id stringlengths 13 16 | repo stringclasses 12
values | repo_url stringclasses 10
values | file_path stringlengths 7 62 | function_name stringlengths 4 52 | pa stringlengths 50 341k | pb stringlengths 33 341k | px stringlengths 50 338k | py stringlengths 33 338k | pa_sliced stringlengths 31 44.3k | pb_sliced stringlengths 31 44.6k | px_sliced stringlengths 51 45.8k | py_sliced stringlengths 33 46.9k | patch_sliced stringlengths 0 46.8k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
CVE-2022-21499 | linux | https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux | kernel/debug/debug_core.c | kgdb_cpu_enter | static int kgdb_cpu_enter(struct kgdb_state *ks, struct pt_regs *regs, int exception_state) {
unsigned long flags;
int sstep_tries = 100;
int error;
int cpu;
int trace_on = 0;
int online_cpus = num_online_cpus();
u64 time_left;
kgdb_info[ks->cpu].enter_kgdb++;
kgdb_info[ks->cpu].exce... | static int kgdb_cpu_enter(struct kgdb_state *ks, struct pt_regs *regs, int exception_state) {
unsigned long flags;
int sstep_tries = 100;
int error;
int cpu;
int trace_on = 0;
int online_cpus = num_online_cpus();
u64 time_left;
kgdb_info[ks->cpu].enter_kgdb++;
kgdb_info[ks->cpu].exce... | static int kgdb_cpu_enter(struct kgdb_state *ks, struct pt_regs *regs, int exception_state) {
unsigned long flags;
int sstep_tries = 100;
int error;
int cpu;
int trace_on = 0;
int online_cpus = num_online_cpus();
u64 time_left;
kgdb_info[ks->cpu].enter_kgdb++;
kgdb_info[ks->cpu].exce... | static int kgdb_cpu_enter(struct kgdb_state *ks, struct pt_regs *regs, int exception_state) {
unsigned long flags;
int sstep_tries = 100;
int error;
int cpu;
int trace_on = 0;
int online_cpus = num_online_cpus();
u64 time_left;
kgdb_info[ks->cpu].enter_kgdb++;
kgdb_info[ks->cpu].exce... | static int kgdb_cpu_enter(struct kgdb_state *ks, struct pt_regs *regs, int exception_state) {
while (1) {
cpu_master_loop:
if (dbg_kdb_mode) {
kgdb_connected = 1;
error = kdb_stub(ks);
if (error == -1) {
continue;
}
kgdb_connected =... | static int kgdb_cpu_enter(struct kgdb_state *ks, struct pt_regs *regs, int exception_state) {
while (1) {
cpu_master_loop:
if (dbg_kdb_mode) {
kgdb_connected = 1;
error = kdb_stub(ks);
if (error == -1) {
continue;
}
kgdb_connected =... | static int kgdb_cpu_enter(struct kgdb_state *ks, struct pt_regs *regs, int exception_state) {
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
while (1) {
cpu_loop:
if (kgdb_info[cpu].exception_state & DCPU_NEXT_MASTER) {
kgdb_info[cpu].exception_state &= ~DCPU_NEXT_MASTER;
goto cpu... | static int kgdb_cpu_enter(struct kgdb_state *ks, struct pt_regs *regs, int exception_state) {
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
while (1) {
cpu_loop:
if (kgdb_info[cpu].exception_state & DCPU_NEXT_MASTER) {
kgdb_info[cpu].exception_state &= ~DCPU_NEXT_MASTER;
goto cpu... | static int kgdb_cpu_enter(struct kgdb_state *ks, struct pt_regs *regs, int exception_state) {
while (1) {
cpu_master_loop:
if (dbg_kdb_mode) {
kgdb_connected = 1;
error = kdb_stub(ks);
if (error == -1) {
continue;
}
kgdb_c... |
CVE-2022-21499 | linux | https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux | kernel/debug/kdb/kdb_main.c | kdb_check_flags | static inline bool kdb_check_flags(kdb_cmdflags_t flags, int permissions, bool no_args) {
permissions &= KDB_ENABLE_MASK;
permissions |= KDB_ENABLE_ALWAYS_SAFE;
if (no_args) {
permissions |= permissions << KDB_ENABLE_NO_ARGS_SHIFT;
}
flags |= KDB_ENABLE_ALL;
return permissions & flags;
} | static bool kdb_check_flags(kdb_cmdflags_t flags, int permissions, bool no_args) {
permissions &= KDB_ENABLE_MASK;
permissions |= KDB_ENABLE_ALWAYS_SAFE;
if (no_args) {
permissions |= permissions << KDB_ENABLE_NO_ARGS_SHIFT;
}
flags |= KDB_ENABLE_ALL;
return permissions & flags;
} | static inline bool kdb_check_flags(kdb_cmdflags_t flags, int permissions, bool no_args) {
permissions &= KDB_ENABLE_MASK;
permissions |= KDB_ENABLE_ALWAYS_SAFE;
if (no_args) {
permissions |= permissions << KDB_ENABLE_NO_ARGS_SHIFT;
}
flags |= KDB_ENABLE_ALL;
return permissions & flags;
} | static bool kdb_check_flags(kdb_cmdflags_t flags, int permissions, bool no_args) {
permissions &= KDB_ENABLE_MASK;
permissions |= KDB_ENABLE_ALWAYS_SAFE;
if (no_args) {
permissions |= permissions << KDB_ENABLE_NO_ARGS_SHIFT;
}
flags |= KDB_ENABLE_ALL;
return permissions & flags;
} | static inline bool kdb_check_flags(kdb_cmdflags_t flags, int permissions, bool no_args) {
permissions &= KDB_ENABLE_MASK;
permissions |= KDB_ENABLE_ALWAYS_SAFE;
if (no_args) {
permissions |= permissions << KDB_ENABLE_NO_ARGS_SHIFT;
}
flags |= KDB_ENABLE_ALL;
return permissions & flags;
}... | static bool kdb_check_flags(kdb_cmdflags_t flags, int permissions, bool no_args) {
permissions &= KDB_ENABLE_MASK;
permissions |= KDB_ENABLE_ALWAYS_SAFE;
if (no_args) {
permissions |= permissions << KDB_ENABLE_NO_ARGS_SHIFT;
}
flags |= KDB_ENABLE_ALL;
return permissions & flags;
}
| static inline bool kdb_check_flags(kdb_cmdflags_t flags, int permissions, bool no_args) {
permissions &= KDB_ENABLE_MASK;
permissions |= KDB_ENABLE_ALWAYS_SAFE;
if (no_args) {
permissions |= permissions << KDB_ENABLE_NO_ARGS_SHIFT;
}
flags |= KDB_ENABLE_ALL;
return permissions & flags;
}... | static bool kdb_check_flags(kdb_cmdflags_t flags, int permissions, bool no_args) {
permissions &= KDB_ENABLE_MASK;
permissions |= KDB_ENABLE_ALWAYS_SAFE;
if (no_args) {
permissions |= permissions << KDB_ENABLE_NO_ARGS_SHIFT;
}
flags |= KDB_ENABLE_ALL;
return permissions & flags;
} | -static inline bool kdb_check_flags(kdb_cmdflags_t flags, int permissions, bool no_args) {
+static bool kdb_check_flags(kdb_cmdflags_t flags, int permissions, bool no_args) {
permissions &= KDB_ENABLE_MASK;
permissions |= KDB_ENABLE_ALWAYS_SAFE;
if (no_args) {
permissions |= permissions << KDB_E... |
CVE-2022-21499 | linux | https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux | kernel/debug/kdb/kdb_main.c | kdb_local | static int kdb_local(kdb_reason_t reason, int error, struct pt_regs *regs, kdb_dbtrap_t db_result) {
char *cmdbuf;
int diag;
struct task_struct *kdb_current = kdb_curr_task(raw_smp_processor_id());
KDB_DEBUG_STATE("kdb_local 1", reason);
kdb_go_count = 0;
if (reason == KDB_REASON_DEBUG) {
} ... | static int kdb_local(kdb_reason_t reason, int error, struct pt_regs *regs, kdb_dbtrap_t db_result) {
char *cmdbuf;
int diag;
struct task_struct *kdb_current = kdb_curr_task(raw_smp_processor_id());
KDB_DEBUG_STATE("kdb_local 1", reason);
kdb_check_for_lockdown();
kdb_go_count = 0;
if (reason... | static int kdb_local(kdb_reason_t reason, int error, struct pt_regs *regs, kdb_dbtrap_t db_result) {
char *cmdbuf;
int diag;
struct task_struct *kdb_current = kdb_curr_task(raw_smp_processor_id());
KDB_DEBUG_STATE("kdb_local 1", reason);
kdb_go_count = 0;
if (reason == KDB_REASON_DEBUG) {
} ... | static int kdb_local(kdb_reason_t reason, int error, struct pt_regs *regs, kdb_dbtrap_t db_result) {
char *cmdbuf;
int diag;
struct task_struct *kdb_current = kdb_curr_task(raw_smp_processor_id());
KDB_DEBUG_STATE("kdb_local 1", reason);
kdb_check_for_lockdown();
kdb_go_count = 0;
if (reason... | static int kdb_local(kdb_reason_t reason, int error, struct pt_regs *regs, kdb_dbtrap_t db_result) {
KDB_DEBUG_STATE("kdb_local 1", reason);
kdb_go_count = 0;
}
| static int kdb_local(kdb_reason_t reason, int error, struct pt_regs *regs, kdb_dbtrap_t db_result) {
KDB_DEBUG_STATE("kdb_local 1", reason);
kdb_check_for_lockdown();
kdb_go_count = 0;
}
| static int kdb_local(kdb_reason_t reason, int error, struct pt_regs *regs, kdb_dbtrap_t db_result) {
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
KDB_DEBUG_STATE("kdb_local 1", reason);
kdb_go_count = 0;
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
}
| static int kdb_local(kdb_reason_t reason, int error, struct pt_regs *regs, kdb_dbtrap_t db_result) {
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
KDB_DEBUG_STATE("kdb_local 1", reason);
kdb_check_for_lockdown();
kdb_go_count = 0;
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
} | static int kdb_local(kdb_reason_t reason, int error, struct pt_regs *regs, kdb_dbtrap_t db_result) {
KDB_DEBUG_STATE("kdb_local 1", reason);
+ kdb_check_for_lockdown();
kdb_go_count = 0;
} |
CVE-2022-21505 | linux | https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux | security/integrity/ima/ima_policy.c | ima_appraise_signature | bool ima_appraise_signature(enum kernel_read_file_id id) {
struct ima_rule_entry *entry;
bool found = false;
enum ima_hooks func;
if (id >= READG_MAX_ID) {
return false;
}
func = read_idmap[id] ?: FILE_CHECK;
rcu_read_lock();
list_for_each_entry_rcu(entry, ima_rules, list) {
... | bool ima_appraise_signature(enum kernel_read_file_id id) {
struct ima_rule_entry *entry;
bool found = false;
enum ima_hooks func;
if (id >= READG_MAX_ID) {
return false;
}
if (id == READG_KEXEC_IMAGE && !(ima_appraise & IMA_APPRAISE_ENFORCE) && security_locked_down(LOCKDOWN_KEXEC)) {
... | bool ima_appraise_signature(enum kernel_read_file_id id) {
struct ima_rule_entry *entry;
bool found = false;
enum ima_hooks func;
struct list_head *ima_rules_tmp;
if (id >= READG_MAX_ID) {
return false;
}
func = read_idmap[id] ?: FILE_CHECK;
rcu_read_lock();
ima_rules_tmp = r... | bool ima_appraise_signature(enum kernel_read_file_id id) {
struct ima_rule_entry *entry;
bool found = false;
enum ima_hooks func;
struct list_head *ima_rules_tmp;
if (id >= READG_MAX_ID) {
return false;
}
if (id == READG_KEXEC_IMAGE && !(ima_appraise & IMA_APPRAISE_ENFORCE) && securi... | bool ima_appraise_signature(enum kernel_read_file_id id) {
if (id >= READG_MAX_ID) {
return false;
}
func = read_idmap[id] ?: FILE_CHECK;
}
| bool ima_appraise_signature(enum kernel_read_file_id id) {
if (id >= READG_MAX_ID) {
return false;
}
if (id == READG_KEXEC_IMAGE && !(ima_appraise & IMA_APPRAISE_ENFORCE) && security_locked_down(LOCKDOWN_KEXEC)) {
return false;
}
func = read_idmap[id] ?: FILE_CHECK;
}
| bool ima_appraise_signature(enum kernel_read_file_id id) {
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
if (id >= READG_MAX_ID) {
return false;
}
func = read_idmap[id] ?: FILE_CHECK;
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
}
| bool ima_appraise_signature(enum kernel_read_file_id id) {
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
if (id >= READG_MAX_ID) {
return false;
}
if (id == READG_KEXEC_IMAGE && !(ima_appraise & IMA_APPRAISE_ENFORCE) && security_locked_down(LOCKDOWN_KEXEC)) {
return false;
}
func... | bool ima_appraise_signature(enum kernel_read_file_id id) {
if (id >= READG_MAX_ID) {
return false;
}
+ if (id == READG_KEXEC_IMAGE && !(ima_appraise & IMA_APPRAISE_ENFORCE) && security_locked_down(LOCKDOWN_KEXEC)) {
+ return false;
+ }
func = read_idmap[id] ?: FILE_CHECK;
} |
CVE-2022-2153 | linux | https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux | arch/x86/kvm/lapic.c | kvm_irq_delivery_to_apic_fast | bool kvm_irq_delivery_to_apic_fast(struct kvm *kvm, struct kvm_lapic *src, struct kvm_lapic_irq *irq, int *r, struct dest_map *dest_map) {
struct kvm_apic_map *map;
unsigned long bitmap;
struct kvm_lapic **dst = NULL;
int i;
bool ret;
*r = -1;
if (irq->shorthand == APIC_DEST_SELF) {
... | bool kvm_irq_delivery_to_apic_fast(struct kvm *kvm, struct kvm_lapic *src, struct kvm_lapic_irq *irq, int *r, struct dest_map *dest_map) {
struct kvm_apic_map *map;
unsigned long bitmap;
struct kvm_lapic **dst = NULL;
int i;
bool ret;
*r = -1;
if (irq->shorthand == APIC_DEST_SELF) {
... | bool kvm_irq_delivery_to_apic_fast(struct kvm *kvm, struct kvm_lapic *src, struct kvm_lapic_irq *irq, int *r, struct dest_map *dest_map) {
struct kvm_apic_map *map;
unsigned long bitmap;
struct kvm_lapic **dst = NULL;
int i;
bool ret;
*r = -1;
if (irq->shorthand == APIC_DEST_SELF) {
... | bool kvm_irq_delivery_to_apic_fast(struct kvm *kvm, struct kvm_lapic *src, struct kvm_lapic_irq *irq, int *r, struct dest_map *dest_map) {
struct kvm_apic_map *map;
unsigned long bitmap;
struct kvm_lapic **dst = NULL;
int i;
bool ret;
*r = -1;
if (irq->shorthand == APIC_DEST_SELF) {
... | bool kvm_irq_delivery_to_apic_fast(struct kvm *kvm, struct kvm_lapic *src, struct kvm_lapic_irq *irq, int *r, struct dest_map *dest_map) {
if (irq->shorthand == APIC_DEST_SELF) {
*r = kvm_apic_set_irq(src->vcpu, irq, dest_map);
return true;
}
}
| bool kvm_irq_delivery_to_apic_fast(struct kvm *kvm, struct kvm_lapic *src, struct kvm_lapic_irq *irq, int *r, struct dest_map *dest_map) {
if (irq->shorthand == APIC_DEST_SELF) {
if (KVM_BUG_ON(!src, kvm)) {
*r = 0;
return true;
}
*r = kvm_apic_set_irq(src->vcpu, irq,... | bool kvm_irq_delivery_to_apic_fast(struct kvm *kvm, struct kvm_lapic *src, struct kvm_lapic_irq *irq, int *r, struct dest_map *dest_map) {
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
if (irq->shorthand == APIC_DEST_SELF) {
*r = kvm_apic_set_irq(src->vcpu, irq, dest_map);
return true;
}
... | bool kvm_irq_delivery_to_apic_fast(struct kvm *kvm, struct kvm_lapic *src, struct kvm_lapic_irq *irq, int *r, struct dest_map *dest_map) {
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
if (irq->shorthand == APIC_DEST_SELF) {
if (KVM_BUG_ON(!src, kvm)) {
*r = 0;
return true;
... | bool kvm_irq_delivery_to_apic_fast(struct kvm *kvm, struct kvm_lapic *src, struct kvm_lapic_irq *irq, int *r, struct dest_map *dest_map) {
if (irq->shorthand == APIC_DEST_SELF) {
+ if (KVM_BUG_ON(!src, kvm)) {
+ *r = 0;
+ return true;
+ }
*r = kvm_apic_set_irq(src->vcp... |
CVE-2022-2196 | linux | https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux | arch/x86/kvm/vmx/nested.c | nested_vmx_vmexit | void nested_vmx_vmexit(struct kvm_vcpu *vcpu, u32 vm_exit_reason, u32 exit_intr_info, unsigned long exit_qualification) {
struct vcpu_vmx *vmx = to_vmx(vcpu);
struct vmcs12 *vmcs12 = get_vmcs12(vcpu);
vmx->nested.mtf_pending = false;
WARN_ON_ONCE(vmx->nested.nested_run_pending);
if (kvm_check_reques... | void nested_vmx_vmexit(struct kvm_vcpu *vcpu, u32 vm_exit_reason, u32 exit_intr_info, unsigned long exit_qualification) {
struct vcpu_vmx *vmx = to_vmx(vcpu);
struct vmcs12 *vmcs12 = get_vmcs12(vcpu);
vmx->nested.mtf_pending = false;
WARN_ON_ONCE(vmx->nested.nested_run_pending);
if (kvm_check_reques... | void nested_vmx_vmexit(struct kvm_vcpu *vcpu, u32 vm_exit_reason, u32 exit_intr_info, unsigned long exit_qualification) {
struct vcpu_vmx *vmx = to_vmx(vcpu);
struct vmcs12 *vmcs12 = get_vmcs12(vcpu);
WARN_ON_ONCE(vmx->nested.nested_run_pending);
if (kvm_check_request(KVM_REQ_GET_NESTED_STATE_PAGES, vcp... | void nested_vmx_vmexit(struct kvm_vcpu *vcpu, u32 vm_exit_reason, u32 exit_intr_info, unsigned long exit_qualification) {
struct vcpu_vmx *vmx = to_vmx(vcpu);
struct vmcs12 *vmcs12 = get_vmcs12(vcpu);
WARN_ON_ONCE(vmx->nested.nested_run_pending);
if (kvm_check_request(KVM_REQ_GET_NESTED_STATE_PAGES, vcp... | void nested_vmx_vmexit(struct kvm_vcpu *vcpu, u32 vm_exit_reason, u32 exit_intr_info, unsigned long exit_qualification) {
struct vcpu_vmx *vmx = to_vmx(vcpu);
struct vmcs12 *vmcs12 = get_vmcs12(vcpu);
if (kvm_check_request(KVM_REQ_GET_NESTED_STATE_PAGES, vcpu)) {
(void)nested_get_evmcs_page(vcpu);
... | void nested_vmx_vmexit(struct kvm_vcpu *vcpu, u32 vm_exit_reason, u32 exit_intr_info, unsigned long exit_qualification) {
struct vcpu_vmx *vmx = to_vmx(vcpu);
struct vmcs12 *vmcs12 = get_vmcs12(vcpu);
if (kvm_check_request(KVM_REQ_GET_NESTED_STATE_PAGES, vcpu)) {
(void)nested_get_evmcs_page(vcpu);
... | void nested_vmx_vmexit(struct kvm_vcpu *vcpu, u32 vm_exit_reason, u32 exit_intr_info, unsigned long exit_qualification) {
struct vcpu_vmx *vmx = to_vmx(vcpu);
struct vmcs12 *vmcs12 = get_vmcs12(vcpu);
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
if (kvm_check_request(KVM_REQ_GET_NESTED_STATE_PAGES, vcp... | void nested_vmx_vmexit(struct kvm_vcpu *vcpu, u32 vm_exit_reason, u32 exit_intr_info, unsigned long exit_qualification) {
struct vcpu_vmx *vmx = to_vmx(vcpu);
struct vmcs12 *vmcs12 = get_vmcs12(vcpu);
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
if (kvm_check_request(KVM_REQ_GET_NESTED_STATE_PAGES, vcp... | void nested_vmx_vmexit(struct kvm_vcpu *vcpu, u32 vm_exit_reason, u32 exit_intr_info, unsigned long exit_qualification) {
struct vcpu_vmx *vmx = to_vmx(vcpu);
struct vmcs12 *vmcs12 = get_vmcs12(vcpu);
if (kvm_check_request(KVM_REQ_GET_NESTED_STATE_PAGES, vcpu)) {
(void)nested_get_evmcs_page(vcp... |
CVE-2022-23036 | linux | https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux | drivers/xen/grant-table.c | gnttab_end_foreign_access | void gnttab_end_foreign_access(grant_ref_t ref, int readonly, unsigned long page) {
if (gnttab_end_foreign_access_ref(ref, readonly)) {
put_free_entry(ref);
if (page != 0) {
put_page(virt_to_page(page));
}
} else {
gnttab_add_deferred(ref, readonly, page ? virt_to_pag... | void gnttab_end_foreign_access(grant_ref_t ref, int readonly, unsigned long page) {
if (gnttab_try_end_foreign_access(ref)) {
if (page != 0) {
put_page(virt_to_page(page));
}
} else {
gnttab_add_deferred(ref, readonly, page ? virt_to_page(page) : NULL);
}
} | void gnttab_end_foreign_access(grant_ref_t ref, int readonly, unsigned long page) {
if (gnttab_end_foreign_access_ref(ref, readonly)) {
put_free_entry(ref);
if (page != 0) {
put_page(virt_to_page(page));
}
} else {
gnttab_add_deferred(ref, readonly, page ? virt_to_pag... | void gnttab_end_foreign_access(grant_ref_t ref, int readonly, unsigned long page) {
if (gnttab_try_end_foreign_access(ref)) {
if (page != 0) {
put_page(virt_to_page(page));
}
} else {
gnttab_add_deferred(ref, readonly, page ? virt_to_page(page) : NULL);
}
} | void gnttab_end_foreign_access(grant_ref_t ref, int readonly, unsigned long page) {
if (gnttab_end_foreign_access_ref(ref, readonly)) {
put_free_entry(ref);
if (page != 0) {
put_page(virt_to_page(page));
}
} else {
gnttab_add_deferred(ref, readonly, page ? virt_to_pag... | void gnttab_end_foreign_access(grant_ref_t ref, int readonly, unsigned long page) {
if (gnttab_try_end_foreign_access(ref)) {
if (page != 0) {
put_page(virt_to_page(page));
}
} else {
gnttab_add_deferred(ref, readonly, page ? virt_to_page(page) : NULL);
}
}
| void gnttab_end_foreign_access(grant_ref_t ref, int readonly, unsigned long page) {
if (gnttab_end_foreign_access_ref(ref, readonly)) {
put_free_entry(ref);
if (page != 0) {
put_page(virt_to_page(page));
}
} else {
gnttab_add_deferred(ref, readonly, page ? virt_to_pag... | void gnttab_end_foreign_access(grant_ref_t ref, int readonly, unsigned long page) {
if (gnttab_try_end_foreign_access(ref)) {
if (page != 0) {
put_page(virt_to_page(page));
}
} else {
gnttab_add_deferred(ref, readonly, page ? virt_to_page(page) : NULL);
}
} | void gnttab_end_foreign_access(grant_ref_t ref, int readonly, unsigned long page) {
- if (gnttab_end_foreign_access_ref(ref, readonly)) {
- put_free_entry(ref);
+ if (gnttab_try_end_foreign_access(ref)) {
if (page != 0) {
put_page(virt_to_page(page));
}
} else {
... |
CVE-2022-23037 | linux | https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux | drivers/net/xen-netfront.c | xennet_tx_buf_gc | static bool xennet_tx_buf_gc(struct netfront_queue *queue) {
RG_IDX cons, prod;
unsigned short id;
struct sk_buff *skb;
bool more_to_do;
bool work_done = false;
const struct device *dev = &queue->info->netdev->dev;
BUG_ON(!netif_carrier_ok(queue->info->netdev));
do {
prod = queue... | static bool xennet_tx_buf_gc(struct netfront_queue *queue) {
RG_IDX cons, prod;
unsigned short id;
struct sk_buff *skb;
bool more_to_do;
bool work_done = false;
const struct device *dev = &queue->info->netdev->dev;
BUG_ON(!netif_carrier_ok(queue->info->netdev));
do {
prod = queue... | static bool xennet_tx_buf_gc(struct netfront_queue *queue) {
RG_IDX cons, prod;
unsigned short id;
struct sk_buff *skb;
bool more_to_do;
bool work_done = false;
const struct device *dev = &queue->info->netdev->dev;
BUG_ON(!netif_carrier_ok(queue->info->netdev));
do {
prod = queue... | static bool xennet_tx_buf_gc(struct netfront_queue *queue) {
RG_IDX cons, prod;
unsigned short id;
struct sk_buff *skb;
bool more_to_do;
bool work_done = false;
const struct device *dev = &queue->info->netdev->dev;
BUG_ON(!netif_carrier_ok(queue->info->netdev));
do {
prod = queue... | static bool xennet_tx_buf_gc(struct netfront_queue *queue) {
do {
prod = queue->tx.sring->rsp_prod;
if (RG_RESPONSE_PROD_OVERFLOW(&queue->tx, prod)) {
dev_alert(dev, "Illegal number of responses %u\n", prod - queue->tx.rsp_cons);
goto err;
}
rmb();
for... | static bool xennet_tx_buf_gc(struct netfront_queue *queue) {
do {
prod = queue->tx.sring->rsp_prod;
if (RG_RESPONSE_PROD_OVERFLOW(&queue->tx, prod)) {
dev_alert(dev, "Illegal number of responses %u\n", prod - queue->tx.rsp_cons);
goto err;
}
rmb();
for... | static bool xennet_tx_buf_gc(struct netfront_queue *queue) {
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
do {
prod = queue->tx.sring->rsp_prod;
if (RG_RESPONSE_PROD_OVERFLOW(&queue->tx, prod)) {
dev_alert(dev, "Illegal number of responses %u\n", prod - queue->tx.rsp_cons);
... | static bool xennet_tx_buf_gc(struct netfront_queue *queue) {
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
do {
prod = queue->tx.sring->rsp_prod;
if (RG_RESPONSE_PROD_OVERFLOW(&queue->tx, prod)) {
dev_alert(dev, "Illegal number of responses %u\n", prod - queue->tx.rsp_cons);
... | static bool xennet_tx_buf_gc(struct netfront_queue *queue) {
do {
prod = queue->tx.sring->rsp_prod;
if (RG_RESPONSE_PROD_OVERFLOW(&queue->tx, prod)) {
dev_alert(dev, "Illegal number of responses %u\n", prod - queue->tx.rsp_cons);
goto err;
}
rmb();
... |
CVE-2022-23038 | linux | https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux | drivers/xen/grant-table.c | gnttab_end_foreign_access | void gnttab_end_foreign_access(grant_ref_t ref, int readonly, unsigned long page) {
if (gnttab_end_foreign_access_ref(ref, readonly)) {
put_free_entry(ref);
if (page != 0) {
put_page(virt_to_page(page));
}
} else {
gnttab_add_deferred(ref, readonly, page ? virt_to_pag... | void gnttab_end_foreign_access(grant_ref_t ref, int readonly, unsigned long page) {
if (gnttab_try_end_foreign_access(ref)) {
if (page != 0) {
put_page(virt_to_page(page));
}
} else {
gnttab_add_deferred(ref, readonly, page ? virt_to_page(page) : NULL);
}
} | void gnttab_end_foreign_access(grant_ref_t ref, int readonly, unsigned long page) {
if (gnttab_end_foreign_access_ref(ref, readonly)) {
put_free_entry(ref);
if (page != 0) {
put_page(virt_to_page(page));
}
} else {
gnttab_add_deferred(ref, readonly, page ? virt_to_pag... | void gnttab_end_foreign_access(grant_ref_t ref, int readonly, unsigned long page) {
if (gnttab_try_end_foreign_access(ref)) {
if (page != 0) {
put_page(virt_to_page(page));
}
} else {
gnttab_add_deferred(ref, readonly, page ? virt_to_page(page) : NULL);
}
} | void gnttab_end_foreign_access(grant_ref_t ref, int readonly, unsigned long page) {
if (gnttab_end_foreign_access_ref(ref, readonly)) {
put_free_entry(ref);
if (page != 0) {
put_page(virt_to_page(page));
}
} else {
gnttab_add_deferred(ref, readonly, page ? virt_to_pag... | void gnttab_end_foreign_access(grant_ref_t ref, int readonly, unsigned long page) {
if (gnttab_try_end_foreign_access(ref)) {
if (page != 0) {
put_page(virt_to_page(page));
}
} else {
gnttab_add_deferred(ref, readonly, page ? virt_to_page(page) : NULL);
}
}
| void gnttab_end_foreign_access(grant_ref_t ref, int readonly, unsigned long page) {
if (gnttab_end_foreign_access_ref(ref, readonly)) {
put_free_entry(ref);
if (page != 0) {
put_page(virt_to_page(page));
}
} else {
gnttab_add_deferred(ref, readonly, page ? virt_to_pag... | void gnttab_end_foreign_access(grant_ref_t ref, int readonly, unsigned long page) {
if (gnttab_try_end_foreign_access(ref)) {
if (page != 0) {
put_page(virt_to_page(page));
}
} else {
gnttab_add_deferred(ref, readonly, page ? virt_to_page(page) : NULL);
}
} | void gnttab_end_foreign_access(grant_ref_t ref, int readonly, unsigned long page) {
- if (gnttab_end_foreign_access_ref(ref, readonly)) {
- put_free_entry(ref);
+ if (gnttab_try_end_foreign_access(ref)) {
if (page != 0) {
put_page(virt_to_page(page));
}
} else {
... |
CVE-2022-23039 | linux | https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux | drivers/xen/gntalloc.c | __del_gref | static void __del_gref(struct gntalloc_gref *gref) {
if (gref->notify.flags & UNMAP_NOTIFY_CLEAR_BYTE) {
uint8_t *tmp = kmap(gref->page);
tmp[gref->notify.pgoff] = 0;
kunmap(gref->page);
}
if (gref->notify.flags & UNMAP_NOTIFY_SEND_EVENT) {
notify_remote_via_evtchn(gref->noti... | static void __del_gref(struct gntalloc_gref *gref) {
unsigned long addr;
if (gref->notify.flags & UNMAP_NOTIFY_CLEAR_BYTE) {
uint8_t *tmp = kmap(gref->page);
tmp[gref->notify.pgoff] = 0;
kunmap(gref->page);
}
if (gref->notify.flags & UNMAP_NOTIFY_SEND_EVENT) {
notify_remo... | static void __del_gref(struct gntalloc_gref *gref) {
if (gref->notify.flags & UNMAP_NOTIFY_CLEAR_BYTE) {
uint8_t *tmp = kmap(gref->page);
tmp[gref->notify.pgoff] = 0;
kunmap(gref->page);
}
if (gref->notify.flags & UNMAP_NOTIFY_SEND_EVENT) {
notify_remote_via_evtchn(gref->noti... | static void __del_gref(struct gntalloc_gref *gref) {
unsigned long addr;
if (gref->notify.flags & UNMAP_NOTIFY_CLEAR_BYTE) {
uint8_t *tmp = kmap(gref->page);
tmp[gref->notify.pgoff] = 0;
kunmap(gref->page);
}
if (gref->notify.flags & UNMAP_NOTIFY_SEND_EVENT) {
notify_remo... | static void __del_gref(struct gntalloc_gref *gref) {
if (gref->notify.flags & UNMAP_NOTIFY_CLEAR_BYTE) {
uint8_t *tmp = kmap(gref->page);
kunmap(gref->page);
}
if (gref->gref_id) {
if (gnttab_query_foreign_access(gref->gref_id)) {
return;
}
if (!gnttab_end... | static void __del_gref(struct gntalloc_gref *gref) {
unsigned long addr;
if (gref->notify.flags & UNMAP_NOTIFY_CLEAR_BYTE) {
uint8_t *tmp = kmap(gref->page);
kunmap(gref->page);
}
if (gref->gref_id) {
if (gref->page) {
addr = (unsigned long)page_to_virt(gref->page);
... | static void __del_gref(struct gntalloc_gref *gref) {
if (gref->notify.flags & UNMAP_NOTIFY_CLEAR_BYTE) {
uint8_t *tmp = kmap(gref->page);
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
kunmap(gref->page);
}
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
if (gref->gref_id) {
if ... | static void __del_gref(struct gntalloc_gref *gref) {
unsigned long addr;
if (gref->notify.flags & UNMAP_NOTIFY_CLEAR_BYTE) {
uint8_t *tmp = kmap(gref->page);
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
kunmap(gref->page);
}
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
if (gref... | static void __del_gref(struct gntalloc_gref *gref) {
+ unsigned long addr;
if (gref->notify.flags & UNMAP_NOTIFY_CLEAR_BYTE) {
uint8_t *tmp = kmap(gref->page);
kunmap(gref->page);
}
if (gref->gref_id) {
- if (gnttab_query_foreign_access(gref->gref_id)) {
- return;
... |
CVE-2022-23039 | linux | https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux | drivers/xen/gntalloc.c | add_grefs | static int add_grefs(struct ioctl_gntalloc_alloc_gref *op, uint32_t *gref_ids, struct gntalloc_file_private_data *priv) {
int i, rc, readonly;
LIST_HEAD(queue_gref);
LIST_HEAD(queue_file);
struct gntalloc_gref *gref, *next;
readonly = !(op->flags & GNTALLOC_FLAG_WRITABLE);
rc = -ENOMEM;
for ... | static int add_grefs(struct ioctl_gntalloc_alloc_gref *op, uint32_t *gref_ids, struct gntalloc_file_private_data *priv) {
int i, rc, readonly;
LIST_HEAD(queue_gref);
LIST_HEAD(queue_file);
struct gntalloc_gref *gref, *next;
readonly = !(op->flags & GNTALLOC_FLAG_WRITABLE);
rc = -ENOMEM;
for ... | static int add_grefs(struct ioctl_gntalloc_alloc_gref *op, uint32_t *gref_ids, struct gntalloc_file_private_data *priv) {
int i, rc, readonly;
LIST_HEAD(queue_gref);
LIST_HEAD(queue_file);
struct gntalloc_gref *gref, *next;
readonly = !(op->flags & GNTALLOC_FLAG_WRITABLE);
for (i = 0; i < op->co... | static int add_grefs(struct ioctl_gntalloc_alloc_gref *op, uint32_t *gref_ids, struct gntalloc_file_private_data *priv) {
int i, rc, readonly;
LIST_HEAD(queue_gref);
LIST_HEAD(queue_file);
struct gntalloc_gref *gref, *next;
readonly = !(op->flags & GNTALLOC_FLAG_WRITABLE);
for (i = 0; i < op->co... | static int add_grefs(struct ioctl_gntalloc_alloc_gref *op, uint32_t *gref_ids, struct gntalloc_file_private_data *priv) {
LIST_HEAD(queue_gref);
list_for_each_entry_safe(gref, next, &queue_file, next_file) {
__del_gref(gref);
}
if (unlikely(!list_empty(&queue_gref))) {
list_splice_tail(&... | static int add_grefs(struct ioctl_gntalloc_alloc_gref *op, uint32_t *gref_ids, struct gntalloc_file_private_data *priv) {
LIST_HEAD(queue_gref);
list_for_each_entry_safe(gref, next, &queue_file, next_file) {
__del_gref(gref);
}
mutex_unlock(&gref_mutex);
}
| static int add_grefs(struct ioctl_gntalloc_alloc_gref *op, uint32_t *gref_ids, struct gntalloc_file_private_data *priv) {
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
LIST_HEAD(queue_gref);
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
list_for_each_entry_safe(gref, next, &queue_file, next_file) {
... | static int add_grefs(struct ioctl_gntalloc_alloc_gref *op, uint32_t *gref_ids, struct gntalloc_file_private_data *priv) {
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
LIST_HEAD(queue_gref);
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
list_for_each_entry_safe(gref, next, &queue_file, next_file) {
... | static int add_grefs(struct ioctl_gntalloc_alloc_gref *op, uint32_t *gref_ids, struct gntalloc_file_private_data *priv) {
LIST_HEAD(queue_gref);
list_for_each_entry_safe(gref, next, &queue_file, next_file) {
__del_gref(gref);
}
- if (unlikely(!list_empty(&queue_gref))) {
- list_splice... |
CVE-2022-23040 | linux | https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux | drivers/xen/xenbus/xenbus_client.c | xenbus_grant_ring | int xenbus_grant_ring(struct xenbus_device *dev, void *vaddr, unsigned int nr_pages, grant_ref_t *grefs) {
int err;
int i, j;
for (i = 0; i < nr_pages; i++) {
unsigned long gfn;
if (is_vmalloc_addr(vaddr)) {
gfn = pfn_to_gfn(vmalloc_to_pfn(vaddr));
} else {
gf... | int xenbus_grant_ring(struct xenbus_device *dev, void *vaddr, unsigned int nr_pages, grant_ref_t *grefs) {
int err;
unsigned int i;
grant_ref_t gref_head;
err = gnttab_alloc_grant_references(nr_pages, &gref_head);
if (err) {
xenbus_dev_fatal(dev, err, "granting access to ring page");
... | int xenbus_grant_ring(struct xenbus_device *dev, void *vaddr, unsigned int nr_pages, grant_ref_t *grefs) {
int err;
int i, j;
for (i = 0; i < nr_pages; i++) {
unsigned long gfn;
if (is_vmalloc_addr(vaddr)) {
gfn = pfn_to_gfn(vmalloc_to_pfn(vaddr));
} else {
gf... | int xenbus_grant_ring(struct xenbus_device *dev, void *vaddr, unsigned int nr_pages, grant_ref_t *grefs) {
int err;
unsigned int i;
grant_ref_t gref_head;
err = gnttab_alloc_grant_references(nr_pages, &gref_head);
if (err) {
xenbus_dev_fatal(dev, err, "granting access to ring page");
... | int xenbus_grant_ring(struct xenbus_device *dev, void *vaddr, unsigned int nr_pages, grant_ref_t *grefs) {
int err;
int i, j;
for (i = 0; i < nr_pages; i++) {
if (is_vmalloc_addr(vaddr)) {
gfn = pfn_to_gfn(vmalloc_to_pfn(vaddr));
} else {
gfn = virt_to_gfn(vaddr);
... | int xenbus_grant_ring(struct xenbus_device *dev, void *vaddr, unsigned int nr_pages, grant_ref_t *grefs) {
int err;
unsigned int i;
grant_ref_t gref_head;
err = gnttab_alloc_grant_references(nr_pages, &gref_head);
if (err) {
xenbus_dev_fatal(dev, err, "granting access to ring page");
... | int xenbus_grant_ring(struct xenbus_device *dev, void *vaddr, unsigned int nr_pages, grant_ref_t *grefs) {
int err;
int i, j;
for (i = 0; i < nr_pages; i++) {
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
if (is_vmalloc_addr(vaddr)) {
gfn = pfn_to_gfn(vmalloc_to_pfn(vaddr));
... | int xenbus_grant_ring(struct xenbus_device *dev, void *vaddr, unsigned int nr_pages, grant_ref_t *grefs) {
int err;
unsigned int i;
grant_ref_t gref_head;
err = gnttab_alloc_grant_references(nr_pages, &gref_head);
if (err) {
xenbus_dev_fatal(dev, err, "granting access to ring page");
... | int xenbus_grant_ring(struct xenbus_device *dev, void *vaddr, unsigned int nr_pages, grant_ref_t *grefs) {
int err;
- int i, j;
+ unsigned int i;
+ grant_ref_t gref_head;
+ err = gnttab_alloc_grant_references(nr_pages, &gref_head);
+ if (err) {
+ xenbus_dev_fatal(dev, err, "granting access t... |
CVE-2022-23041 | linux | https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux | net/9p/trans_xen.c | xen_9pfs_front_alloc_dataring | static int xen_9pfs_front_alloc_dataring(struct xenbus_device *dev, struct xen_9pfs_dataring *ring) {
int i = 0;
int ret = -ENOMEM;
void *bytes = NULL;
init_waitqueue_head(&ring->wq);
spin_lock_init(&ring->lock);
IT_WORK(&ring->work, p9_xen_response);
ring->intf = (struct xen_9pfs_data_intf ... | static int xen_9pfs_front_alloc_dataring(struct xenbus_device *dev, struct xen_9pfs_dataring *ring) {
int i = 0;
int ret = -ENOMEM;
void *bytes = NULL;
init_waitqueue_head(&ring->wq);
spin_lock_init(&ring->lock);
IT_WORK(&ring->work, p9_xen_response);
ring->intf = (struct xen_9pfs_data_intf ... | static int xen_9pfs_front_alloc_dataring(struct xenbus_device *dev, struct xen_9pfs_dataring *ring, unsigned int order) {
int i = 0;
int ret = -ENOMEM;
void *bytes = NULL;
init_waitqueue_head(&ring->wq);
spin_lock_init(&ring->lock);
IT_WORK(&ring->work, p9_xen_response);
ring->intf = (struct... | static int xen_9pfs_front_alloc_dataring(struct xenbus_device *dev, struct xen_9pfs_dataring *ring, unsigned int order) {
int i = 0;
int ret = -ENOMEM;
void *bytes = NULL;
init_waitqueue_head(&ring->wq);
spin_lock_init(&ring->lock);
IT_WORK(&ring->work, p9_xen_response);
ring->intf = (struct... | static int xen_9pfs_front_alloc_dataring(struct xenbus_device *dev, struct xen_9pfs_dataring *ring) {
int i = 0;
void *bytes = NULL;
ring->intf = (struct xen_9pfs_data_intf *)get_zeroed_page(GFP_KERNEL);
if (!ring->intf) {
return ret;
}
ret = gnttab_grant_foreign_access(dev->otherend_id,... | static int xen_9pfs_front_alloc_dataring(struct xenbus_device *dev, struct xen_9pfs_dataring *ring) {
int i = 0;
void *bytes = NULL;
ring->intf = (struct xen_9pfs_data_intf *)get_zeroed_page(GFP_KERNEL);
if (!ring->intf) {
return ret;
}
ret = gnttab_grant_foreign_access(dev->otherend_id,... | static int xen_9pfs_front_alloc_dataring(struct xenbus_device *dev, struct xen_9pfs_dataring *ring, unsigned int order) {
int i = 0;
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
void *bytes = NULL;
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
ring->intf = (struct xen_9pfs_data_intf *)get_zeroed_pa... | static int xen_9pfs_front_alloc_dataring(struct xenbus_device *dev, struct xen_9pfs_dataring *ring, unsigned int order) {
int i = 0;
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
void *bytes = NULL;
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
ring->intf = (struct xen_9pfs_data_intf *)get_zeroed_pa... | static int xen_9pfs_front_alloc_dataring(struct xenbus_device *dev, struct xen_9pfs_dataring *ring) {
int i = 0;
void *bytes = NULL;
ring->intf = (struct xen_9pfs_data_intf *)get_zeroed_page(GFP_KERNEL);
if (!ring->intf) {
return ret;
}
ret = gnttab_grant_foreign_access(dev->othe... |
CVE-2022-23041 | linux | https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux | net/9p/trans_xen.c | xen_9pfs_front_free | static void xen_9pfs_front_free(struct xen_9pfs_front_priv *priv) {
int i, j;
write_lock(&xen_9pfs_lock);
list_del(&priv->list);
write_unlock(&xen_9pfs_lock);
for (i = 0; i < priv->num_rings; i++) {
if (!priv->rings[i].intf) {
break;
}
if (priv->rings[i].irq > 0) ... | static void xen_9pfs_front_free(struct xen_9pfs_front_priv *priv) {
int i, j;
write_lock(&xen_9pfs_lock);
list_del(&priv->list);
write_unlock(&xen_9pfs_lock);
for (i = 0; i < priv->num_rings; i++) {
if (!priv->rings[i].intf) {
break;
}
if (priv->rings[i].irq > 0) ... | static void xen_9pfs_front_free(struct xen_9pfs_front_priv *priv) {
int i, j;
write_lock(&xen_9pfs_lock);
list_del(&priv->list);
write_unlock(&xen_9pfs_lock);
for (i = 0; i < priv->num_rings; i++) {
if (!priv->rings[i].intf) {
break;
}
if (priv->rings[i].irq > 0) ... | static void xen_9pfs_front_free(struct xen_9pfs_front_priv *priv) {
int i, j;
write_lock(&xen_9pfs_lock);
list_del(&priv->list);
write_unlock(&xen_9pfs_lock);
for (i = 0; i < priv->num_rings; i++) {
if (!priv->rings[i].intf) {
break;
}
if (priv->rings[i].irq > 0) ... | static void xen_9pfs_front_free(struct xen_9pfs_front_priv *priv) {
for (i = 0; i < priv->num_rings; i++) {
if (priv->rings[i].data.in) {
for (j = 0; j < (1 << XEN_9PFS_RG_ORDER); j++) {
}
free_pages((unsigned long)priv->rings[i].data.in, XEN_9PFS_RG_ORDER - (PAGE_SHIFT -... | static void xen_9pfs_front_free(struct xen_9pfs_front_priv *priv) {
for (i = 0; i < priv->num_rings; i++) {
if (priv->rings[i].data.in) {
for (j = 0; j < (1 << XEN_9PFS_RG_ORDER); j++) {
}
free_pages_exact(priv->rings[i].data.in, 1UL << (XEN_9PFS_RG_ORDER + XEN_PAGE_SHIFT... | static void xen_9pfs_front_free(struct xen_9pfs_front_priv *priv) {
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
for (i = 0; i < priv->num_rings; i++) {
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
if (priv->rings[i].data.in) {
for (j = 0;
j < (1 << priv->rings[i].i... | static void xen_9pfs_front_free(struct xen_9pfs_front_priv *priv) {
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
for (i = 0; i < priv->num_rings; i++) {
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
if (priv->rings[i].data.in) {
for (j = 0;
j < (1 << priv->rings[i].i... | static void xen_9pfs_front_free(struct xen_9pfs_front_priv *priv) {
for (i = 0; i < priv->num_rings; i++) {
if (priv->rings[i].data.in) {
for (j = 0; j < (1 << XEN_9PFS_RG_ORDER); j++) {
}
- free_pages((unsigned long)priv->rings[i].data.in, XEN_9PFS_RG_ORDER - (PAGE_S... |
CVE-2022-23042 | linux | https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux | drivers/net/xen-netfront.c | setup_netfront | static int setup_netfront(struct xenbus_device *dev, struct netfront_queue *queue, unsigned int feature_split_evtchn) {
struct xen_netif_tx_sring *txs;
struct xen_netif_rx_sring *rxs;
grant_ref_t gref;
int err;
queue->tx_ring_ref = GRANT_VALID_REF;
queue->rx_ring_ref = GRANT_VALID_REF;
queue... | static int setup_netfront(struct xenbus_device *dev, struct netfront_queue *queue, unsigned int feature_split_evtchn) {
struct xen_netif_tx_sring *txs;
struct xen_netif_rx_sring *rxs = NULL;
grant_ref_t gref;
int err;
queue->tx_ring_ref = GRANT_VALID_REF;
queue->rx_ring_ref = GRANT_VALID_REF;
... | static int setup_netfront(struct xenbus_device *dev, struct netfront_queue *queue, unsigned int feature_split_evtchn) {
struct xen_netif_tx_sring *txs;
struct xen_netif_rx_sring *rxs;
grant_ref_t gref;
int err;
queue->tx_ring_ref = GRANT_VALID_REF;
queue->rx_ring_ref = GRANT_VALID_REF;
queue... | static int setup_netfront(struct xenbus_device *dev, struct netfront_queue *queue, unsigned int feature_split_evtchn) {
struct xen_netif_tx_sring *txs;
struct xen_netif_rx_sring *rxs = NULL;
grant_ref_t gref;
int err;
queue->tx_ring_ref = GRANT_VALID_REF;
queue->rx_ring_ref = GRANT_VALID_REF;
... | static int setup_netfront(struct xenbus_device *dev, struct netfront_queue *queue, unsigned int feature_split_evtchn) {
struct xen_netif_tx_sring *txs;
struct xen_netif_rx_sring *rxs;
grant_ref_t gref;
queue->tx_ring_ref = GRANT_VALID_REF;
queue->rx_ring_ref = GRANT_VALID_REF;
txs = (struct xen_... | static int setup_netfront(struct xenbus_device *dev, struct netfront_queue *queue, unsigned int feature_split_evtchn) {
struct xen_netif_tx_sring *txs;
struct xen_netif_rx_sring *rxs = NULL;
grant_ref_t gref;
queue->tx_ring_ref = GRANT_VALID_REF;
queue->rx_ring_ref = GRANT_VALID_REF;
txs = (stru... | static int setup_netfront(struct xenbus_device *dev, struct netfront_queue *queue, unsigned int feature_split_evtchn) {
struct xen_netif_tx_sring *txs;
struct xen_netif_rx_sring *rxs;
grant_ref_t gref;
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
queue->tx_ring_ref = GRANT_VALID_REF;
queue->rx_... | static int setup_netfront(struct xenbus_device *dev, struct netfront_queue *queue, unsigned int feature_split_evtchn) {
struct xen_netif_tx_sring *txs;
struct xen_netif_rx_sring *rxs = NULL;
grant_ref_t gref;
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
queue->tx_ring_ref = GRANT_VALID_REF;
que... | static int setup_netfront(struct xenbus_device *dev, struct netfront_queue *queue, unsigned int feature_split_evtchn) {
struct xen_netif_tx_sring *txs;
- struct xen_netif_rx_sring *rxs;
+ struct xen_netif_rx_sring *rxs = NULL;
grant_ref_t gref;
queue->tx_ring_ref = GRANT_VALID_REF;
queue->rx_... |
CVE-2022-23042 | linux | https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux | drivers/net/xen-netfront.c | xennet_get_responses | static int xennet_get_responses(struct netfront_queue *queue, struct netfront_rx_info *rinfo, RG_IDX rp, struct sk_buff_head *list) {
struct xen_netif_rx_response *rx = &rinfo->rx, rx_local;
struct xen_netif_extra_info *extras = rinfo->extras;
struct device *dev = &queue->info->netdev->dev;
RG_IDX cons ... | static int xennet_get_responses(struct netfront_queue *queue, struct netfront_rx_info *rinfo, RG_IDX rp, struct sk_buff_head *list) {
struct xen_netif_rx_response *rx = &rinfo->rx, rx_local;
struct xen_netif_extra_info *extras = rinfo->extras;
struct device *dev = &queue->info->netdev->dev;
RG_IDX cons ... | static int xennet_get_responses(struct netfront_queue *queue, struct netfront_rx_info *rinfo, RG_IDX rp, struct sk_buff_head *list, bool *need_xdp_flush) {
struct xen_netif_rx_response *rx = &rinfo->rx, rx_local;
int max = XEN_NETIF_NR_SLOTS_M + (rx->status <= RX_COPY_THRESHOLD);
RG_IDX cons = queue->rx.rsp... | static int xennet_get_responses(struct netfront_queue *queue, struct netfront_rx_info *rinfo, RG_IDX rp, struct sk_buff_head *list, bool *need_xdp_flush) {
struct xen_netif_rx_response *rx = &rinfo->rx, rx_local;
int max = XEN_NETIF_NR_SLOTS_M + (rx->status <= RX_COPY_THRESHOLD);
RG_IDX cons = queue->rx.rsp... | static int xennet_get_responses(struct netfront_queue *queue, struct netfront_rx_info *rinfo, RG_IDX rp, struct sk_buff_head *list) {
struct xen_netif_rx_response *rx = &rinfo->rx, rx_local;
struct device *dev = &queue->info->netdev->dev;
RG_IDX cons = queue->rx.rsp_cons;
struct sk_buff *skb = xennet_ge... | static int xennet_get_responses(struct netfront_queue *queue, struct netfront_rx_info *rinfo, RG_IDX rp, struct sk_buff_head *list) {
struct xen_netif_rx_response *rx = &rinfo->rx, rx_local;
struct device *dev = &queue->info->netdev->dev;
RG_IDX cons = queue->rx.rsp_cons;
struct sk_buff *skb = xennet_ge... | static int xennet_get_responses(struct netfront_queue *queue, struct netfront_rx_info *rinfo, RG_IDX rp, struct sk_buff_head *list, bool *need_xdp_flush) {
struct xen_netif_rx_response *rx = &rinfo->rx, rx_local;
int max = XEN_NETIF_NR_SLOTS_M + (rx->status <= RX_COPY_THRESHOLD);
RG_IDX cons = queue->rx.rsp... | static int xennet_get_responses(struct netfront_queue *queue, struct netfront_rx_info *rinfo, RG_IDX rp, struct sk_buff_head *list, bool *need_xdp_flush) {
struct xen_netif_rx_response *rx = &rinfo->rx, rx_local;
int max = XEN_NETIF_NR_SLOTS_M + (rx->status <= RX_COPY_THRESHOLD);
RG_IDX cons = queue->rx.rsp... | static int xennet_get_responses(struct netfront_queue *queue, struct netfront_rx_info *rinfo, RG_IDX rp, struct sk_buff_head *list) {
struct xen_netif_rx_response *rx = &rinfo->rx, rx_local;
struct device *dev = &queue->info->netdev->dev;
RG_IDX cons = queue->rx.rsp_cons;
struct sk_buff *skb = xenn... |
CVE-2022-23042 | linux | https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux | drivers/net/xen-netfront.c | xennet_poll | static int xennet_poll(struct napi_struct *napi, int budget) {
struct netfront_queue *queue = container_of(napi, struct netfront_queue, napi);
struct net_device *dev = queue->info->netdev;
struct sk_buff *skb;
struct netfront_rx_info rinfo;
struct xen_netif_rx_response *rx = &rinfo.rx;
struct xe... | static int xennet_poll(struct napi_struct *napi, int budget) {
struct netfront_queue *queue = container_of(napi, struct netfront_queue, napi);
struct net_device *dev = queue->info->netdev;
struct sk_buff *skb;
struct netfront_rx_info rinfo;
struct xen_netif_rx_response *rx = &rinfo.rx;
struct xe... | static int xennet_poll(struct napi_struct *napi, int budget) {
struct netfront_queue *queue = container_of(napi, struct netfront_queue, napi);
struct net_device *dev = queue->info->netdev;
struct sk_buff *skb;
struct netfront_rx_info rinfo;
struct xen_netif_rx_response *rx = &rinfo.rx;
struct xe... | static int xennet_poll(struct napi_struct *napi, int budget) {
struct netfront_queue *queue = container_of(napi, struct netfront_queue, napi);
struct net_device *dev = queue->info->netdev;
struct sk_buff *skb;
struct netfront_rx_info rinfo;
struct xen_netif_rx_response *rx = &rinfo.rx;
struct xe... | static int xennet_poll(struct napi_struct *napi, int budget) {
rp = queue->rx.sring->rsp_prod;
if (RG_RESPONSE_PROD_OVERFLOW(&queue->rx, rp)) {
return 0;
}
i = queue->rx.rsp_cons;
work_done = 0;
while ((i != rp) && (work_done < budget)) {
RG_COPY_RESPONSE(&queue->rx, i, rx);
... | static int xennet_poll(struct napi_struct *napi, int budget) {
rp = queue->rx.sring->rsp_prod;
if (RG_RESPONSE_PROD_OVERFLOW(&queue->rx, rp)) {
return 0;
}
i = queue->rx.rsp_cons;
work_done = 0;
while ((i != rp) && (work_done < budget)) {
RG_COPY_RESPONSE(&queue->rx, i, rx);
... | static int xennet_poll(struct napi_struct *napi, int budget) {
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
rp = queue->rx.sring->rsp_prod;
if (RG_RESPONSE_PROD_OVERFLOW(&queue->rx, rp)) {
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
return 0;
}
/* PLACEHOLDER: DO NOT DELETE THIS COMME... | static int xennet_poll(struct napi_struct *napi, int budget) {
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
rp = queue->rx.sring->rsp_prod;
if (RG_RESPONSE_PROD_OVERFLOW(&queue->rx, rp)) {
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
return 0;
}
/* PLACEHOLDER: DO NOT DELETE THIS COMME... | static int xennet_poll(struct napi_struct *napi, int budget) {
rp = queue->rx.sring->rsp_prod;
if (RG_RESPONSE_PROD_OVERFLOW(&queue->rx, rp)) {
return 0;
}
i = queue->rx.rsp_cons;
work_done = 0;
while ((i != rp) && (work_done < budget)) {
RG_COPY_RESPONSE(&queue->rx, i, ... |
CVE-2022-2308 | linux | https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux | drivers/vdpa/vdpa_user/vduse_dev.c | vduse_vdpa_get_config | static void vduse_vdpa_get_config(struct vdpa_device *vdpa, unsigned int offset, void *buf, unsigned int len) {
struct vduse_dev *dev = vdpa_to_vduse(vdpa);
if (offset > dev->config_size || len > dev->config_size - offset) {
return;
}
memcpy(buf, dev->config + offset, len);
} | static void vduse_vdpa_get_config(struct vdpa_device *vdpa, unsigned int offset, void *buf, unsigned int len) {
struct vduse_dev *dev = vdpa_to_vduse(vdpa);
memset(buf, 0, len);
if (offset > dev->config_size) {
return;
}
if (len > dev->config_size - offset) {
len = dev->config_size -... | static void vduse_vdpa_get_config(struct vdpa_device *vdpa, unsigned int offset, void *buf, unsigned int len) {
struct vduse_dev *dev = vdpa_to_vduse(vdpa);
if (offset > dev->config_size || len > dev->config_size - offset) {
return;
}
memcpy(buf, dev->config + offset, len);
} | static void vduse_vdpa_get_config(struct vdpa_device *vdpa, unsigned int offset, void *buf, unsigned int len) {
struct vduse_dev *dev = vdpa_to_vduse(vdpa);
memset(buf, 0, len);
if (offset > dev->config_size) {
return;
}
if (len > dev->config_size - offset) {
len = dev->config_size -... | static void vduse_vdpa_get_config(struct vdpa_device *vdpa, unsigned int offset, void *buf, unsigned int len) {
struct vduse_dev *dev = vdpa_to_vduse(vdpa);
if (offset > dev->config_size || len > dev->config_size - offset) {
return;
}
memcpy(buf, dev->config + offset, len);
}
| static void vduse_vdpa_get_config(struct vdpa_device *vdpa, unsigned int offset, void *buf, unsigned int len) {
struct vduse_dev *dev = vdpa_to_vduse(vdpa);
memset(buf, 0, len);
if (offset > dev->config_size) {
return;
}
if (len > dev->config_size - offset) {
len = dev->config_size -... | static void vduse_vdpa_get_config(struct vdpa_device *vdpa, unsigned int offset, void *buf, unsigned int len) {
struct vduse_dev *dev = vdpa_to_vduse(vdpa);
if (offset > dev->config_size || len > dev->config_size - offset) {
return;
}
memcpy(buf, dev->config + offset, len);
}
| static void vduse_vdpa_get_config(struct vdpa_device *vdpa, unsigned int offset, void *buf, unsigned int len) {
struct vduse_dev *dev = vdpa_to_vduse(vdpa);
memset(buf, 0, len);
if (offset > dev->config_size) {
return;
}
if (len > dev->config_size - offset) {
len = dev->config_size -... | static void vduse_vdpa_get_config(struct vdpa_device *vdpa, unsigned int offset, void *buf, unsigned int len) {
struct vduse_dev *dev = vdpa_to_vduse(vdpa);
- if (offset > dev->config_size || len > dev->config_size - offset) {
+ memset(buf, 0, len);
+ if (offset > dev->config_size) {
return;
+ ... |
CVE-2022-2318 | linux | https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux | net/rose/rose_timer.c | rose_heartbeat_expiry | static void rose_heartbeat_expiry(unsigned long param) {
struct sock *sk = (struct sock *)param;
struct rose_sock *rose = rose_sk(sk);
bh_lock_sock(sk);
switch (rose->state) {
case ROSE_STATE_0:
if (sock_flag(sk, SOCK_DESTROY) || (sk->sk_state == TCP_LISTEN && sock_flag(sk, SOCK_DEAD))) {
... | static void rose_heartbeat_expiry(unsigned long param) {
struct sock *sk = (struct sock *)param;
struct rose_sock *rose = rose_sk(sk);
bh_lock_sock(sk);
switch (rose->state) {
case ROSE_STATE_0:
if (sock_flag(sk, SOCK_DESTROY) || (sk->sk_state == TCP_LISTEN && sock_flag(sk, SOCK_DEAD))) {
... | static void rose_heartbeat_expiry(struct timer_list *t) {
struct sock *sk = from_timer(sk, t, sk_timer);
struct rose_sock *rose = rose_sk(sk);
bh_lock_sock(sk);
switch (rose->state) {
case ROSE_STATE_0:
if (sock_flag(sk, SOCK_DESTROY) || (sk->sk_state == TCP_LISTEN && sock_flag(sk, SOCK_DEAD... | static void rose_heartbeat_expiry(struct timer_list *t) {
struct sock *sk = from_timer(sk, t, sk_timer);
struct rose_sock *rose = rose_sk(sk);
bh_lock_sock(sk);
switch (rose->state) {
case ROSE_STATE_0:
if (sock_flag(sk, SOCK_DESTROY) || (sk->sk_state == TCP_LISTEN && sock_flag(sk, SOCK_DEAD... | static void rose_heartbeat_expiry(unsigned long param) {
struct sock *sk = (struct sock *)param;
struct rose_sock *rose = rose_sk(sk);
bh_lock_sock(sk);
switch (rose->state) {
case ROSE_STATE_0:
if (sock_flag(sk, SOCK_DESTROY) || (sk->sk_state == TCP_LISTEN && sock_flag(sk, SOCK_DEAD))) {
... | static void rose_heartbeat_expiry(unsigned long param) {
struct sock *sk = (struct sock *)param;
struct rose_sock *rose = rose_sk(sk);
bh_lock_sock(sk);
switch (rose->state) {
case ROSE_STATE_0:
if (sock_flag(sk, SOCK_DESTROY) || (sk->sk_state == TCP_LISTEN && sock_flag(sk, SOCK_DEAD))) {
... | static void rose_heartbeat_expiry(struct timer_list *t) {
struct sock *sk = from_timer(sk, t, sk_timer);
struct rose_sock *rose = rose_sk(sk);
bh_lock_sock(sk);
switch (rose->state) {
case ROSE_STATE_0:
if (sock_flag(sk, SOCK_DESTROY) || (sk->sk_state == TCP_LISTEN && sock_flag(sk, SOCK_DEAD... | static void rose_heartbeat_expiry(struct timer_list *t) {
struct sock *sk = from_timer(sk, t, sk_timer);
struct rose_sock *rose = rose_sk(sk);
bh_lock_sock(sk);
switch (rose->state) {
case ROSE_STATE_0:
if (sock_flag(sk, SOCK_DESTROY) || (sk->sk_state == TCP_LISTEN && sock_flag(sk, SOCK_DEAD... | static void rose_heartbeat_expiry(unsigned long param) {
struct sock *sk = (struct sock *)param;
struct rose_sock *rose = rose_sk(sk);
bh_lock_sock(sk);
switch (rose->state) {
case ROSE_STATE_0:
if (sock_flag(sk, SOCK_DESTROY) || (sk->sk_state == TCP_LISTEN && sock_flag(sk, SOCK_DEAD)... |
CVE-2022-2318 | linux | https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux | net/rose/rose_timer.c | rose_idletimer_expiry | static void rose_idletimer_expiry(unsigned long param) {
struct sock *sk = (struct sock *)param;
bh_lock_sock(sk);
rose_clear_queues(sk);
rose_write_internal(sk, ROSE_CLEAR_REQUEST);
rose_sk(sk)->state = ROSE_STATE_2;
rose_start_t3timer(sk);
sk->sk_state = TCP_CLOSE;
sk->sk_err = 0;
... | static void rose_idletimer_expiry(unsigned long param) {
struct sock *sk = (struct sock *)param;
bh_lock_sock(sk);
rose_clear_queues(sk);
rose_write_internal(sk, ROSE_CLEAR_REQUEST);
rose_sk(sk)->state = ROSE_STATE_2;
rose_start_t3timer(sk);
sk->sk_state = TCP_CLOSE;
sk->sk_err = 0;
... | static void rose_idletimer_expiry(struct timer_list *t) {
struct rose_sock *rose = from_timer(rose, t, idletimer);
struct sock *sk = &rose->sock;
bh_lock_sock(sk);
rose_clear_queues(sk);
rose_write_internal(sk, ROSE_CLEAR_REQUEST);
rose_sk(sk)->state = ROSE_STATE_2;
rose_start_t3timer(sk);
... | static void rose_idletimer_expiry(struct timer_list *t) {
struct rose_sock *rose = from_timer(rose, t, idletimer);
struct sock *sk = &rose->sock;
bh_lock_sock(sk);
rose_clear_queues(sk);
rose_write_internal(sk, ROSE_CLEAR_REQUEST);
rose_sk(sk)->state = ROSE_STATE_2;
rose_start_t3timer(sk);
... | static void rose_idletimer_expiry(unsigned long param) {
struct sock *sk = (struct sock *)param;
bh_lock_sock(sk);
rose_clear_queues(sk);
rose_write_internal(sk, ROSE_CLEAR_REQUEST);
rose_sk(sk)->state = ROSE_STATE_2;
rose_start_t3timer(sk);
sk->sk_state = TCP_CLOSE;
if (!sock_flag(sk, S... | static void rose_idletimer_expiry(unsigned long param) {
struct sock *sk = (struct sock *)param;
bh_lock_sock(sk);
rose_clear_queues(sk);
rose_write_internal(sk, ROSE_CLEAR_REQUEST);
rose_sk(sk)->state = ROSE_STATE_2;
rose_start_t3timer(sk);
sk->sk_state = TCP_CLOSE;
if (!sock_flag(sk, S... | static void rose_idletimer_expiry(struct timer_list *t) {
struct rose_sock *rose = from_timer(rose, t, idletimer);
struct sock *sk = &rose->sock;
bh_lock_sock(sk);
rose_clear_queues(sk);
rose_write_internal(sk, ROSE_CLEAR_REQUEST);
rose_sk(sk)->state = ROSE_STATE_2;
rose_start_t3timer(sk);
... | static void rose_idletimer_expiry(struct timer_list *t) {
struct rose_sock *rose = from_timer(rose, t, idletimer);
struct sock *sk = &rose->sock;
bh_lock_sock(sk);
rose_clear_queues(sk);
rose_write_internal(sk, ROSE_CLEAR_REQUEST);
rose_sk(sk)->state = ROSE_STATE_2;
rose_start_t3timer(sk);
... | static void rose_idletimer_expiry(unsigned long param) {
struct sock *sk = (struct sock *)param;
bh_lock_sock(sk);
rose_clear_queues(sk);
rose_write_internal(sk, ROSE_CLEAR_REQUEST);
rose_sk(sk)->state = ROSE_STATE_2;
rose_start_t3timer(sk);
sk->sk_state = TCP_CLOSE;
if (!sock_f... |
CVE-2022-2318 | linux | https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux | net/rose/rose_timer.c | rose_start_hbtimer | void rose_start_hbtimer(struct sock *sk) {
struct rose_sock *rose = rose_sk(sk);
del_timer(&rose->timer);
rose->timer.data = (unsigned long)sk;
rose->timer.function = &rose_timer_expiry;
rose->timer.expires = jiffies + rose->hb;
add_timer(&rose->timer);
} | void rose_start_hbtimer(struct sock *sk) {
struct rose_sock *rose = rose_sk(sk);
sk_stop_timer(sk, &rose->timer);
rose->timer.data = (unsigned long)sk;
rose->timer.function = &rose_timer_expiry;
rose->timer.expires = jiffies + rose->hb;
sk_reset_timer(sk, &rose->timer, rose->timer.expires);
} | void rose_start_hbtimer(struct sock *sk) {
struct rose_sock *rose = rose_sk(sk);
del_timer(&rose->timer);
rose->timer.function = rose_timer_expiry;
rose->timer.expires = jiffies + rose->hb;
add_timer(&rose->timer);
} | void rose_start_hbtimer(struct sock *sk) {
struct rose_sock *rose = rose_sk(sk);
sk_stop_timer(sk, &rose->timer);
rose->timer.function = rose_timer_expiry;
rose->timer.expires = jiffies + rose->hb;
sk_reset_timer(sk, &rose->timer, rose->timer.expires);
} | void rose_start_hbtimer(struct sock *sk) {
struct rose_sock *rose = rose_sk(sk);
del_timer(&rose->timer);
rose->timer.data = (unsigned long)sk;
rose->timer.function = &rose_timer_expiry;
rose->timer.expires = jiffies + rose->hb;
add_timer(&rose->timer);
}
| void rose_start_hbtimer(struct sock *sk) {
struct rose_sock *rose = rose_sk(sk);
sk_stop_timer(sk, &rose->timer);
rose->timer.data = (unsigned long)sk;
rose->timer.function = &rose_timer_expiry;
rose->timer.expires = jiffies + rose->hb;
sk_reset_timer(sk, &rose->timer, rose->timer.expires);
}
| void rose_start_hbtimer(struct sock *sk) {
struct rose_sock *rose = rose_sk(sk);
del_timer(&rose->timer);
rose->timer.function = rose_timer_expiry;
rose->timer.expires = jiffies + rose->hb;
add_timer(&rose->timer);
}
| void rose_start_hbtimer(struct sock *sk) {
struct rose_sock *rose = rose_sk(sk);
sk_stop_timer(sk, &rose->timer);
rose->timer.function = rose_timer_expiry;
rose->timer.expires = jiffies + rose->hb;
sk_reset_timer(sk, &rose->timer, rose->timer.expires);
} | void rose_start_hbtimer(struct sock *sk) {
struct rose_sock *rose = rose_sk(sk);
- del_timer(&rose->timer);
+ sk_stop_timer(sk, &rose->timer);
rose->timer.data = (unsigned long)sk;
rose->timer.function = &rose_timer_expiry;
rose->timer.expires = jiffies + rose->hb;
- add_timer(&rose->timer... |
CVE-2022-2318 | linux | https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux | net/rose/rose_timer.c | rose_start_heartbeat | void rose_start_heartbeat(struct sock *sk) {
del_timer(&sk->sk_timer);
sk->sk_timer.data = (unsigned long)sk;
sk->sk_timer.function = &rose_heartbeat_expiry;
sk->sk_timer.expires = jiffies + 5 * HZ;
add_timer(&sk->sk_timer);
} | void rose_start_heartbeat(struct sock *sk) {
sk_stop_timer(sk, &sk->sk_timer);
sk->sk_timer.data = (unsigned long)sk;
sk->sk_timer.function = &rose_heartbeat_expiry;
sk->sk_timer.expires = jiffies + 5 * HZ;
sk_reset_timer(sk, &sk->sk_timer, sk->sk_timer.expires);
} | void rose_start_heartbeat(struct sock *sk) {
del_timer(&sk->sk_timer);
sk->sk_timer.function = rose_heartbeat_expiry;
sk->sk_timer.expires = jiffies + 5 * HZ;
add_timer(&sk->sk_timer);
} | void rose_start_heartbeat(struct sock *sk) {
sk_stop_timer(sk, &sk->sk_timer);
sk->sk_timer.function = rose_heartbeat_expiry;
sk->sk_timer.expires = jiffies + 5 * HZ;
sk_reset_timer(sk, &sk->sk_timer, sk->sk_timer.expires);
} | void rose_start_heartbeat(struct sock *sk) {
del_timer(&sk->sk_timer);
sk->sk_timer.data = (unsigned long)sk;
sk->sk_timer.function = &rose_heartbeat_expiry;
sk->sk_timer.expires = jiffies + 5 * HZ;
add_timer(&sk->sk_timer);
}
| void rose_start_heartbeat(struct sock *sk) {
sk_stop_timer(sk, &sk->sk_timer);
sk->sk_timer.data = (unsigned long)sk;
sk->sk_timer.function = &rose_heartbeat_expiry;
sk->sk_timer.expires = jiffies + 5 * HZ;
sk_reset_timer(sk, &sk->sk_timer, sk->sk_timer.expires);
}
| void rose_start_heartbeat(struct sock *sk) {
del_timer(&sk->sk_timer);
sk->sk_timer.function = rose_heartbeat_expiry;
sk->sk_timer.expires = jiffies + 5 * HZ;
add_timer(&sk->sk_timer);
}
| void rose_start_heartbeat(struct sock *sk) {
sk_stop_timer(sk, &sk->sk_timer);
sk->sk_timer.function = rose_heartbeat_expiry;
sk->sk_timer.expires = jiffies + 5 * HZ;
sk_reset_timer(sk, &sk->sk_timer, sk->sk_timer.expires);
} | void rose_start_heartbeat(struct sock *sk) {
- del_timer(&sk->sk_timer);
+ sk_stop_timer(sk, &sk->sk_timer);
sk->sk_timer.data = (unsigned long)sk;
sk->sk_timer.function = &rose_heartbeat_expiry;
sk->sk_timer.expires = jiffies + 5 * HZ;
- add_timer(&sk->sk_timer);
+ sk_reset_timer(sk, &sk->s... |
CVE-2022-2318 | linux | https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux | net/rose/rose_timer.c | rose_start_idletimer | void rose_start_idletimer(struct sock *sk) {
struct rose_sock *rose = rose_sk(sk);
del_timer(&rose->idletimer);
if (rose->idle > 0) {
rose->idletimer.data = (unsigned long)sk;
rose->idletimer.function = &rose_idletimer_expiry;
rose->idletimer.expires = jiffies + rose->idle;
a... | void rose_start_idletimer(struct sock *sk) {
struct rose_sock *rose = rose_sk(sk);
sk_stop_timer(sk, &rose->timer);
if (rose->idle > 0) {
rose->idletimer.data = (unsigned long)sk;
rose->idletimer.function = &rose_idletimer_expiry;
rose->idletimer.expires = jiffies + rose->idle;
... | void rose_start_idletimer(struct sock *sk) {
struct rose_sock *rose = rose_sk(sk);
del_timer(&rose->idletimer);
if (rose->idle > 0) {
rose->idletimer.function = rose_idletimer_expiry;
rose->idletimer.expires = jiffies + rose->idle;
add_timer(&rose->idletimer);
}
} | void rose_start_idletimer(struct sock *sk) {
struct rose_sock *rose = rose_sk(sk);
sk_stop_timer(sk, &rose->idletimer);
if (rose->idle > 0) {
rose->idletimer.function = rose_idletimer_expiry;
rose->idletimer.expires = jiffies + rose->idle;
sk_reset_timer(sk, &rose->idletimer, rose->i... | void rose_start_idletimer(struct sock *sk) {
struct rose_sock *rose = rose_sk(sk);
del_timer(&rose->idletimer);
if (rose->idle > 0) {
rose->idletimer.data = (unsigned long)sk;
rose->idletimer.expires = jiffies + rose->idle;
add_timer(&rose->idletimer);
}
}
| void rose_start_idletimer(struct sock *sk) {
struct rose_sock *rose = rose_sk(sk);
sk_stop_timer(sk, &rose->timer);
if (rose->idle > 0) {
rose->idletimer.data = (unsigned long)sk;
rose->idletimer.expires = jiffies + rose->idle;
sk_reset_timer(sk, &rose->idletimer, rose->idletimer.exp... | void rose_start_idletimer(struct sock *sk) {
struct rose_sock *rose = rose_sk(sk);
del_timer(&rose->idletimer);
if (rose->idle > 0) {
rose->idletimer.function = rose_idletimer_expiry;
rose->idletimer.expires = jiffies + rose->idle;
add_timer(&rose->idletimer);
}
}
| void rose_start_idletimer(struct sock *sk) {
struct rose_sock *rose = rose_sk(sk);
sk_stop_timer(sk, &rose->idletimer);
if (rose->idle > 0) {
rose->idletimer.function = rose_idletimer_expiry;
rose->idletimer.expires = jiffies + rose->idle;
sk_reset_timer(sk, &rose->idletimer, rose->i... | void rose_start_idletimer(struct sock *sk) {
struct rose_sock *rose = rose_sk(sk);
- del_timer(&rose->idletimer);
+ sk_stop_timer(sk, &rose->timer);
if (rose->idle > 0) {
rose->idletimer.data = (unsigned long)sk;
rose->idletimer.expires = jiffies + rose->idle;
- add_timer(&rose... |
CVE-2022-2318 | linux | https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux | net/rose/rose_timer.c | rose_start_t1timer | void rose_start_t1timer(struct sock *sk) {
struct rose_sock *rose = rose_sk(sk);
del_timer(&rose->timer);
rose->timer.data = (unsigned long)sk;
rose->timer.function = &rose_timer_expiry;
rose->timer.expires = jiffies + rose->t1;
add_timer(&rose->timer);
} | void rose_start_t1timer(struct sock *sk) {
struct rose_sock *rose = rose_sk(sk);
sk_stop_timer(sk, &rose->timer);
rose->timer.data = (unsigned long)sk;
rose->timer.function = &rose_timer_expiry;
rose->timer.expires = jiffies + rose->t1;
sk_reset_timer(sk, &rose->timer, rose->timer.expires);
} | void rose_start_t1timer(struct sock *sk) {
struct rose_sock *rose = rose_sk(sk);
del_timer(&rose->timer);
rose->timer.function = rose_timer_expiry;
rose->timer.expires = jiffies + rose->t1;
add_timer(&rose->timer);
} | void rose_start_t1timer(struct sock *sk) {
struct rose_sock *rose = rose_sk(sk);
sk_stop_timer(sk, &rose->timer);
rose->timer.function = rose_timer_expiry;
rose->timer.expires = jiffies + rose->t1;
sk_reset_timer(sk, &rose->timer, rose->timer.expires);
} | void rose_start_t1timer(struct sock *sk) {
struct rose_sock *rose = rose_sk(sk);
del_timer(&rose->timer);
rose->timer.data = (unsigned long)sk;
rose->timer.function = &rose_timer_expiry;
rose->timer.expires = jiffies + rose->t1;
add_timer(&rose->timer);
}
| void rose_start_t1timer(struct sock *sk) {
struct rose_sock *rose = rose_sk(sk);
sk_stop_timer(sk, &rose->timer);
rose->timer.data = (unsigned long)sk;
rose->timer.function = &rose_timer_expiry;
rose->timer.expires = jiffies + rose->t1;
sk_reset_timer(sk, &rose->timer, rose->timer.expires);
}
| void rose_start_t1timer(struct sock *sk) {
struct rose_sock *rose = rose_sk(sk);
del_timer(&rose->timer);
rose->timer.function = rose_timer_expiry;
rose->timer.expires = jiffies + rose->t1;
add_timer(&rose->timer);
}
| void rose_start_t1timer(struct sock *sk) {
struct rose_sock *rose = rose_sk(sk);
sk_stop_timer(sk, &rose->timer);
rose->timer.function = rose_timer_expiry;
rose->timer.expires = jiffies + rose->t1;
sk_reset_timer(sk, &rose->timer, rose->timer.expires);
} | void rose_start_t1timer(struct sock *sk) {
struct rose_sock *rose = rose_sk(sk);
- del_timer(&rose->timer);
+ sk_stop_timer(sk, &rose->timer);
rose->timer.data = (unsigned long)sk;
rose->timer.function = &rose_timer_expiry;
rose->timer.expires = jiffies + rose->t1;
- add_timer(&rose->timer... |
CVE-2022-2318 | linux | https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux | net/rose/rose_timer.c | rose_start_t2timer | void rose_start_t2timer(struct sock *sk) {
struct rose_sock *rose = rose_sk(sk);
del_timer(&rose->timer);
rose->timer.data = (unsigned long)sk;
rose->timer.function = &rose_timer_expiry;
rose->timer.expires = jiffies + rose->t2;
add_timer(&rose->timer);
} | void rose_start_t2timer(struct sock *sk) {
struct rose_sock *rose = rose_sk(sk);
sk_stop_timer(sk, &rose->timer);
rose->timer.data = (unsigned long)sk;
rose->timer.function = &rose_timer_expiry;
rose->timer.expires = jiffies + rose->t2;
sk_reset_timer(sk, &rose->timer, rose->timer.expires);
} | void rose_start_t2timer(struct sock *sk) {
struct rose_sock *rose = rose_sk(sk);
del_timer(&rose->timer);
rose->timer.function = rose_timer_expiry;
rose->timer.expires = jiffies + rose->t2;
add_timer(&rose->timer);
} | void rose_start_t2timer(struct sock *sk) {
struct rose_sock *rose = rose_sk(sk);
sk_stop_timer(sk, &rose->timer);
rose->timer.function = rose_timer_expiry;
rose->timer.expires = jiffies + rose->t2;
sk_reset_timer(sk, &rose->timer, rose->timer.expires);
} | void rose_start_t2timer(struct sock *sk) {
struct rose_sock *rose = rose_sk(sk);
del_timer(&rose->timer);
rose->timer.data = (unsigned long)sk;
rose->timer.function = &rose_timer_expiry;
rose->timer.expires = jiffies + rose->t2;
add_timer(&rose->timer);
}
| void rose_start_t2timer(struct sock *sk) {
struct rose_sock *rose = rose_sk(sk);
sk_stop_timer(sk, &rose->timer);
rose->timer.data = (unsigned long)sk;
rose->timer.function = &rose_timer_expiry;
rose->timer.expires = jiffies + rose->t2;
sk_reset_timer(sk, &rose->timer, rose->timer.expires);
}
| void rose_start_t2timer(struct sock *sk) {
struct rose_sock *rose = rose_sk(sk);
del_timer(&rose->timer);
rose->timer.function = rose_timer_expiry;
rose->timer.expires = jiffies + rose->t2;
add_timer(&rose->timer);
}
| void rose_start_t2timer(struct sock *sk) {
struct rose_sock *rose = rose_sk(sk);
sk_stop_timer(sk, &rose->timer);
rose->timer.function = rose_timer_expiry;
rose->timer.expires = jiffies + rose->t2;
sk_reset_timer(sk, &rose->timer, rose->timer.expires);
} | void rose_start_t2timer(struct sock *sk) {
struct rose_sock *rose = rose_sk(sk);
- del_timer(&rose->timer);
+ sk_stop_timer(sk, &rose->timer);
rose->timer.data = (unsigned long)sk;
rose->timer.function = &rose_timer_expiry;
rose->timer.expires = jiffies + rose->t2;
- add_timer(&rose->timer... |
CVE-2022-2318 | linux | https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux | net/rose/rose_timer.c | rose_start_t3timer | void rose_start_t3timer(struct sock *sk) {
struct rose_sock *rose = rose_sk(sk);
del_timer(&rose->timer);
rose->timer.data = (unsigned long)sk;
rose->timer.function = &rose_timer_expiry;
rose->timer.expires = jiffies + rose->t3;
add_timer(&rose->timer);
} | void rose_start_t3timer(struct sock *sk) {
struct rose_sock *rose = rose_sk(sk);
sk_stop_timer(sk, &rose->timer);
rose->timer.data = (unsigned long)sk;
rose->timer.function = &rose_timer_expiry;
rose->timer.expires = jiffies + rose->t3;
sk_reset_timer(sk, &rose->timer, rose->timer.expires);
} | void rose_start_t3timer(struct sock *sk) {
struct rose_sock *rose = rose_sk(sk);
del_timer(&rose->timer);
rose->timer.function = rose_timer_expiry;
rose->timer.expires = jiffies + rose->t3;
add_timer(&rose->timer);
} | void rose_start_t3timer(struct sock *sk) {
struct rose_sock *rose = rose_sk(sk);
sk_stop_timer(sk, &rose->timer);
rose->timer.function = rose_timer_expiry;
rose->timer.expires = jiffies + rose->t3;
sk_reset_timer(sk, &rose->timer, rose->timer.expires);
} | void rose_start_t3timer(struct sock *sk) {
struct rose_sock *rose = rose_sk(sk);
del_timer(&rose->timer);
rose->timer.data = (unsigned long)sk;
rose->timer.function = &rose_timer_expiry;
rose->timer.expires = jiffies + rose->t3;
add_timer(&rose->timer);
}
| void rose_start_t3timer(struct sock *sk) {
struct rose_sock *rose = rose_sk(sk);
sk_stop_timer(sk, &rose->timer);
rose->timer.data = (unsigned long)sk;
rose->timer.function = &rose_timer_expiry;
rose->timer.expires = jiffies + rose->t3;
sk_reset_timer(sk, &rose->timer, rose->timer.expires);
}
| void rose_start_t3timer(struct sock *sk) {
struct rose_sock *rose = rose_sk(sk);
del_timer(&rose->timer);
rose->timer.function = rose_timer_expiry;
rose->timer.expires = jiffies + rose->t3;
add_timer(&rose->timer);
}
| void rose_start_t3timer(struct sock *sk) {
struct rose_sock *rose = rose_sk(sk);
sk_stop_timer(sk, &rose->timer);
rose->timer.function = rose_timer_expiry;
rose->timer.expires = jiffies + rose->t3;
sk_reset_timer(sk, &rose->timer, rose->timer.expires);
} | void rose_start_t3timer(struct sock *sk) {
struct rose_sock *rose = rose_sk(sk);
- del_timer(&rose->timer);
+ sk_stop_timer(sk, &rose->timer);
rose->timer.data = (unsigned long)sk;
rose->timer.function = &rose_timer_expiry;
rose->timer.expires = jiffies + rose->t3;
- add_timer(&rose->timer... |
CVE-2022-2318 | linux | https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux | net/rose/rose_timer.c | rose_stop_heartbeat | void rose_stop_heartbeat(struct sock *sk) {
del_timer(&sk->sk_timer);
} | void rose_stop_heartbeat(struct sock *sk) {
sk_stop_timer(sk, &sk->sk_timer);
} | void rose_stop_heartbeat(struct sock *sk) {
del_timer(&sk->sk_timer);
} | void rose_stop_heartbeat(struct sock *sk) {
sk_stop_timer(sk, &sk->sk_timer);
} | void rose_stop_heartbeat(struct sock *sk) {
del_timer(&sk->sk_timer);
}
| void rose_stop_heartbeat(struct sock *sk) {
sk_stop_timer(sk, &sk->sk_timer);
}
| void rose_stop_heartbeat(struct sock *sk) {
del_timer(&sk->sk_timer);
}
| void rose_stop_heartbeat(struct sock *sk) {
sk_stop_timer(sk, &sk->sk_timer);
} | void rose_stop_heartbeat(struct sock *sk) {
- del_timer(&sk->sk_timer);
+ sk_stop_timer(sk, &sk->sk_timer);
} |
CVE-2022-2318 | linux | https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux | net/rose/rose_timer.c | rose_stop_idletimer | void rose_stop_idletimer(struct sock *sk) {
del_timer(&rose_sk(sk)->idletimer);
} | void rose_stop_idletimer(struct sock *sk) {
sk_stop_timer(sk, &rose_sk(sk)->idletimer);
} | void rose_stop_idletimer(struct sock *sk) {
del_timer(&rose_sk(sk)->idletimer);
} | void rose_stop_idletimer(struct sock *sk) {
sk_stop_timer(sk, &rose_sk(sk)->idletimer);
} | void rose_stop_idletimer(struct sock *sk) {
del_timer(&rose_sk(sk)->idletimer);
}
| void rose_stop_idletimer(struct sock *sk) {
sk_stop_timer(sk, &rose_sk(sk)->idletimer);
}
| void rose_stop_idletimer(struct sock *sk) {
del_timer(&rose_sk(sk)->idletimer);
}
| void rose_stop_idletimer(struct sock *sk) {
sk_stop_timer(sk, &rose_sk(sk)->idletimer);
} | void rose_stop_idletimer(struct sock *sk) {
- del_timer(&rose_sk(sk)->idletimer);
+ sk_stop_timer(sk, &rose_sk(sk)->idletimer);
} |
CVE-2022-2318 | linux | https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux | net/rose/rose_timer.c | rose_stop_timer | void rose_stop_timer(struct sock *sk) {
del_timer(&rose_sk(sk)->timer);
} | void rose_stop_timer(struct sock *sk) {
sk_stop_timer(sk, &rose_sk(sk)->timer);
} | void rose_stop_timer(struct sock *sk) {
del_timer(&rose_sk(sk)->timer);
} | void rose_stop_timer(struct sock *sk) {
sk_stop_timer(sk, &rose_sk(sk)->timer);
} | void rose_stop_timer(struct sock *sk) {
del_timer(&rose_sk(sk)->timer);
}
| void rose_stop_timer(struct sock *sk) {
sk_stop_timer(sk, &rose_sk(sk)->timer);
}
| void rose_stop_timer(struct sock *sk) {
del_timer(&rose_sk(sk)->timer);
}
| void rose_stop_timer(struct sock *sk) {
sk_stop_timer(sk, &rose_sk(sk)->timer);
} | void rose_stop_timer(struct sock *sk) {
- del_timer(&rose_sk(sk)->timer);
+ sk_stop_timer(sk, &rose_sk(sk)->timer);
} |
CVE-2022-2318 | linux | https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux | net/rose/rose_timer.c | rose_timer_expiry | static void rose_timer_expiry(unsigned long param) {
struct sock *sk = (struct sock *)param;
struct rose_sock *rose = rose_sk(sk);
bh_lock_sock(sk);
switch (rose->state) {
case ROSE_STATE_1:
case ROSE_STATE_4:
rose_write_internal(sk, ROSE_CLEAR_REQUEST);
rose->state = ROSE_STATE_... | static void rose_timer_expiry(unsigned long param) {
struct sock *sk = (struct sock *)param;
struct rose_sock *rose = rose_sk(sk);
bh_lock_sock(sk);
switch (rose->state) {
case ROSE_STATE_1:
case ROSE_STATE_4:
rose_write_internal(sk, ROSE_CLEAR_REQUEST);
rose->state = ROSE_STATE_... | static void rose_timer_expiry(struct timer_list *t) {
struct rose_sock *rose = from_timer(rose, t, timer);
struct sock *sk = &rose->sock;
bh_lock_sock(sk);
switch (rose->state) {
case ROSE_STATE_1:
case ROSE_STATE_4:
rose_write_internal(sk, ROSE_CLEAR_REQUEST);
rose->state = ROSE... | static void rose_timer_expiry(struct timer_list *t) {
struct rose_sock *rose = from_timer(rose, t, timer);
struct sock *sk = &rose->sock;
bh_lock_sock(sk);
switch (rose->state) {
case ROSE_STATE_1:
case ROSE_STATE_4:
rose_write_internal(sk, ROSE_CLEAR_REQUEST);
rose->state = ROSE... | static void rose_timer_expiry(unsigned long param) {
struct sock *sk = (struct sock *)param;
struct rose_sock *rose = rose_sk(sk);
bh_lock_sock(sk);
switch (rose->state) {
case ROSE_STATE_4:
rose_write_internal(sk, ROSE_CLEAR_REQUEST);
rose_start_t3timer(sk);
break;
case ... | static void rose_timer_expiry(unsigned long param) {
struct sock *sk = (struct sock *)param;
struct rose_sock *rose = rose_sk(sk);
bh_lock_sock(sk);
switch (rose->state) {
case ROSE_STATE_4:
rose_write_internal(sk, ROSE_CLEAR_REQUEST);
rose_start_t3timer(sk);
break;
case ... | static void rose_timer_expiry(struct timer_list *t) {
struct rose_sock *rose = from_timer(rose, t, timer);
struct sock *sk = &rose->sock;
bh_lock_sock(sk);
switch (rose->state) {
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
case ROSE_STATE_4:
rose_write_internal(sk, ROSE_CLEAR_REQUEST);... | static void rose_timer_expiry(struct timer_list *t) {
struct rose_sock *rose = from_timer(rose, t, timer);
struct sock *sk = &rose->sock;
bh_lock_sock(sk);
switch (rose->state) {
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
case ROSE_STATE_4:
rose_write_internal(sk, ROSE_CLEAR_REQUEST);... | static void rose_timer_expiry(unsigned long param) {
struct sock *sk = (struct sock *)param;
struct rose_sock *rose = rose_sk(sk);
bh_lock_sock(sk);
switch (rose->state) {
case ROSE_STATE_4:
rose_write_internal(sk, ROSE_CLEAR_REQUEST);
rose_start_t3timer(sk);
break;
... |
CVE-2022-23222 | linux | https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux | kernel/bpf/btf.c | btf_ctx_access | bool btf_ctx_access(int off, int size, enum bpf_access_type type, const struct bpf_prog *prog, struct bpf_insn_access_aux *info) {
const struct btf_type *t = prog->aux->attach_func_proto;
struct bpf_prog *tgt_prog = prog->aux->dst_prog;
struct btf *btf = bpf_prog_get_target_btf(prog);
const char *tname ... | bool btf_ctx_access(int off, int size, enum bpf_access_type type, const struct bpf_prog *prog, struct bpf_insn_access_aux *info) {
const struct btf_type *t = prog->aux->attach_func_proto;
struct bpf_prog *tgt_prog = prog->aux->dst_prog;
struct btf *btf = bpf_prog_get_target_btf(prog);
const char *tname ... | bool btf_ctx_access(int off, int size, enum bpf_access_type type, const struct bpf_prog *prog, struct bpf_insn_access_aux *info) {
const struct btf_type *t = prog->aux->attach_func_proto;
struct bpf_prog *tgt_prog = prog->aux->dst_prog;
struct btf *btf = bpf_prog_get_target_btf(prog);
const char *tname ... | bool btf_ctx_access(int off, int size, enum bpf_access_type type, const struct bpf_prog *prog, struct bpf_insn_access_aux *info) {
const struct btf_type *t = prog->aux->attach_func_proto;
struct bpf_prog *tgt_prog = prog->aux->dst_prog;
struct btf *btf = bpf_prog_get_target_btf(prog);
const char *tname ... | bool btf_ctx_access(int off, int size, enum bpf_access_type type, const struct bpf_prog *prog, struct bpf_insn_access_aux *info) {
if (off % 8) {
return false;
}
arg = off / 8;
for (i = 0; i < prog->aux->ctx_arg_info_size; i++) {
const struct bpf_ctx_arg_aux *ctx_arg_info = &prog->aux->c... | bool btf_ctx_access(int off, int size, enum bpf_access_type type, const struct bpf_prog *prog, struct bpf_insn_access_aux *info) {
if (off % 8) {
return false;
}
arg = off / 8;
for (i = 0; i < prog->aux->ctx_arg_info_size; i++) {
const struct bpf_ctx_arg_aux *ctx_arg_info = &prog->aux->c... | bool btf_ctx_access(int off, int size, enum bpf_access_type type, const struct bpf_prog *prog, struct bpf_insn_access_aux *info) {
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
if (off % 8) {
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
return false;
}
arg = off / 8;
/* PLACEHOLDER: DO ... | bool btf_ctx_access(int off, int size, enum bpf_access_type type, const struct bpf_prog *prog, struct bpf_insn_access_aux *info) {
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
if (off % 8) {
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
return false;
}
arg = off / 8;
/* PLACEHOLDER: DO ... | bool btf_ctx_access(int off, int size, enum bpf_access_type type, const struct bpf_prog *prog, struct bpf_insn_access_aux *info) {
if (off % 8) {
return false;
}
arg = off / 8;
for (i = 0; i < prog->aux->ctx_arg_info_size; i++) {
const struct bpf_ctx_arg_aux *ctx_arg_info = &prog-... |
CVE-2022-23222 | linux | https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux | kernel/bpf/verifier.c | adjust_ptr_min_max_vals | static int adjust_ptr_min_max_vals(struct bpf_verifier_env *env, struct bpf_insn *insn, const struct bpf_reg_state *ptr_reg, const struct bpf_reg_state *off_reg) {
struct bpf_verifier_state *vstate = env->cur_state;
struct bpf_func_state *state = vstate->frame[vstate->curframe];
struct bpf_reg_state *regs =... | static int adjust_ptr_min_max_vals(struct bpf_verifier_env *env, struct bpf_insn *insn, const struct bpf_reg_state *ptr_reg, const struct bpf_reg_state *off_reg) {
struct bpf_verifier_state *vstate = env->cur_state;
struct bpf_func_state *state = vstate->frame[vstate->curframe];
struct bpf_reg_state *regs =... | static int adjust_ptr_min_max_vals(struct bpf_verifier_env *env, struct bpf_insn *insn, const struct bpf_reg_state *ptr_reg, const struct bpf_reg_state *off_reg) {
struct bpf_verifier_state *vstate = env->cur_state;
struct bpf_func_state *state = vstate->frame[vstate->curframe];
struct bpf_reg_state *regs =... | static int adjust_ptr_min_max_vals(struct bpf_verifier_env *env, struct bpf_insn *insn, const struct bpf_reg_state *ptr_reg, const struct bpf_reg_state *off_reg) {
struct bpf_verifier_state *vstate = env->cur_state;
struct bpf_func_state *state = vstate->frame[vstate->curframe];
struct bpf_reg_state *regs =... | static int adjust_ptr_min_max_vals(struct bpf_verifier_env *env, struct bpf_insn *insn, const struct bpf_reg_state *ptr_reg, const struct bpf_reg_state *off_reg) {
u32 dst = insn->dst_reg;
if (BPF_CLASS(insn->code) != BPF_ALU64) {
if (opcode == BPF_SUB && env->allow_ptr_leaks) {
return 0;
... | static int adjust_ptr_min_max_vals(struct bpf_verifier_env *env, struct bpf_insn *insn, const struct bpf_reg_state *ptr_reg, const struct bpf_reg_state *off_reg) {
u32 dst = insn->dst_reg;
if (BPF_CLASS(insn->code) != BPF_ALU64) {
if (opcode == BPF_SUB && env->allow_ptr_leaks) {
return 0;
... | static int adjust_ptr_min_max_vals(struct bpf_verifier_env *env, struct bpf_insn *insn, const struct bpf_reg_state *ptr_reg, const struct bpf_reg_state *off_reg) {
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
u32 dst = insn->dst_reg;
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
if (BPF_CLASS(insn->cod... | static int adjust_ptr_min_max_vals(struct bpf_verifier_env *env, struct bpf_insn *insn, const struct bpf_reg_state *ptr_reg, const struct bpf_reg_state *off_reg) {
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
u32 dst = insn->dst_reg;
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
if (BPF_CLASS(insn->cod... | static int adjust_ptr_min_max_vals(struct bpf_verifier_env *env, struct bpf_insn *insn, const struct bpf_reg_state *ptr_reg, const struct bpf_reg_state *off_reg) {
u32 dst = insn->dst_reg;
if (BPF_CLASS(insn->code) != BPF_ALU64) {
if (opcode == BPF_SUB && env->allow_ptr_leaks) {
return ... |
CVE-2022-23222 | linux | https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux | kernel/bpf/verifier.c | check_atomic | static int check_atomic(struct bpf_verifier_env *env, int insn_idx, struct bpf_insn *insn) {
int load_reg;
int err;
switch (insn->imm) {
case BPF_ADD:
case BPF_ADD | BPF_FETCH:
case BPF_AND:
case BPF_AND | BPF_FETCH:
case BPF_OR:
case BPF_OR | BPF_FETCH:
case BPF_XOR:
case BP... | static int check_atomic(struct bpf_verifier_env *env, int insn_idx, struct bpf_insn *insn) {
int load_reg;
int err;
switch (insn->imm) {
case BPF_ADD:
case BPF_ADD | BPF_FETCH:
case BPF_AND:
case BPF_AND | BPF_FETCH:
case BPF_OR:
case BPF_OR | BPF_FETCH:
case BPF_XOR:
case BP... | static int check_atomic(struct bpf_verifier_env *env, int insn_idx, struct bpf_insn *insn) {
int load_reg;
int err;
switch (insn->imm) {
case BPF_ADD:
case BPF_ADD | BPF_FETCH:
case BPF_AND:
case BPF_AND | BPF_FETCH:
case BPF_OR:
case BPF_OR | BPF_FETCH:
case BPF_XOR:
case BP... | static int check_atomic(struct bpf_verifier_env *env, int insn_idx, struct bpf_insn *insn) {
int load_reg;
int err;
switch (insn->imm) {
case BPF_ADD:
case BPF_ADD | BPF_FETCH:
case BPF_AND:
case BPF_AND | BPF_FETCH:
case BPF_OR:
case BPF_OR | BPF_FETCH:
case BPF_XOR:
case BP... | static int check_atomic(struct bpf_verifier_env *env, int insn_idx, struct bpf_insn *insn) {
err = check_reg_arg(env, insn->src_reg, SRC_OP);
err = check_reg_arg(env, insn->dst_reg, SRC_OP);
if (insn->imm == BPF_CMPXCHG) {
const u32 aux_reg = BPF_REG_0;
err = check_reg_arg(env, aux_reg, SRC_... | static int check_atomic(struct bpf_verifier_env *env, int insn_idx, struct bpf_insn *insn) {
err = check_reg_arg(env, insn->src_reg, SRC_OP);
err = check_reg_arg(env, insn->dst_reg, SRC_OP);
if (insn->imm == BPF_CMPXCHG) {
const u32 aux_reg = BPF_REG_0;
err = check_reg_arg(env, aux_reg, SRC_... | static int check_atomic(struct bpf_verifier_env *env, int insn_idx, struct bpf_insn *insn) {
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
err = check_reg_arg(env, insn->src_reg, SRC_OP);
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
err = check_reg_arg(env, insn->dst_reg, SRC_OP);
/* PLACEHOLDER: D... | static int check_atomic(struct bpf_verifier_env *env, int insn_idx, struct bpf_insn *insn) {
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
err = check_reg_arg(env, insn->src_reg, SRC_OP);
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
err = check_reg_arg(env, insn->dst_reg, SRC_OP);
/* PLACEHOLDER: D... | static int check_atomic(struct bpf_verifier_env *env, int insn_idx, struct bpf_insn *insn) {
err = check_reg_arg(env, insn->src_reg, SRC_OP);
err = check_reg_arg(env, insn->dst_reg, SRC_OP);
if (insn->imm == BPF_CMPXCHG) {
const u32 aux_reg = BPF_REG_0;
err = check_reg_arg(env, aux_reg... |
CVE-2022-23222 | linux | https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux | kernel/bpf/verifier.c | check_cond_jmp_op | static int check_cond_jmp_op(struct bpf_verifier_env *env, struct bpf_insn *insn, int *insn_idx) {
struct bpf_verifier_state *this_branch = env->cur_state;
struct bpf_verifier_state *other_branch;
struct bpf_reg_state *regs = this_branch->frame[this_branch->curframe]->regs;
struct bpf_reg_state *dst_reg... | static int check_cond_jmp_op(struct bpf_verifier_env *env, struct bpf_insn *insn, int *insn_idx) {
struct bpf_verifier_state *this_branch = env->cur_state;
struct bpf_verifier_state *other_branch;
struct bpf_reg_state *regs = this_branch->frame[this_branch->curframe]->regs;
struct bpf_reg_state *dst_reg... | static int check_cond_jmp_op(struct bpf_verifier_env *env, struct bpf_insn *insn, int *insn_idx) {
struct bpf_verifier_state *this_branch = env->cur_state;
struct bpf_verifier_state *other_branch;
struct bpf_reg_state *regs = this_branch->frame[this_branch->curframe]->regs;
struct bpf_reg_state *dst_reg... | static int check_cond_jmp_op(struct bpf_verifier_env *env, struct bpf_insn *insn, int *insn_idx) {
struct bpf_verifier_state *this_branch = env->cur_state;
struct bpf_verifier_state *other_branch;
struct bpf_reg_state *regs = this_branch->frame[this_branch->curframe]->regs;
struct bpf_reg_state *dst_reg... | static int check_cond_jmp_op(struct bpf_verifier_env *env, struct bpf_insn *insn, int *insn_idx) {
struct bpf_verifier_state *this_branch = env->cur_state;
struct bpf_reg_state *regs = this_branch->frame[this_branch->curframe]->regs;
struct bpf_reg_state *dst_reg, *other_branch_regs, *src_reg = NULL;
u8... | static int check_cond_jmp_op(struct bpf_verifier_env *env, struct bpf_insn *insn, int *insn_idx) {
struct bpf_verifier_state *this_branch = env->cur_state;
struct bpf_reg_state *regs = this_branch->frame[this_branch->curframe]->regs;
struct bpf_reg_state *dst_reg, *other_branch_regs, *src_reg = NULL;
u8... | static int check_cond_jmp_op(struct bpf_verifier_env *env, struct bpf_insn *insn, int *insn_idx) {
struct bpf_verifier_state *this_branch = env->cur_state;
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
struct bpf_reg_state *regs = this_branch->frame[this_branch->curframe]->regs;
struct bpf_reg_state *ds... | static int check_cond_jmp_op(struct bpf_verifier_env *env, struct bpf_insn *insn, int *insn_idx) {
struct bpf_verifier_state *this_branch = env->cur_state;
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
struct bpf_reg_state *regs = this_branch->frame[this_branch->curframe]->regs;
struct bpf_reg_state *ds... | static int check_cond_jmp_op(struct bpf_verifier_env *env, struct bpf_insn *insn, int *insn_idx) {
struct bpf_verifier_state *this_branch = env->cur_state;
struct bpf_reg_state *regs = this_branch->frame[this_branch->curframe]->regs;
struct bpf_reg_state *dst_reg, *other_branch_regs, *src_reg = NULL;
... |
CVE-2022-23222 | linux | https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux | kernel/bpf/verifier.c | check_ctx_access | static int check_ctx_access(struct bpf_verifier_env *env, int insn_idx, int off, int size, enum bpf_access_type t, enum bpf_reg_type *reg_type, struct btf **btf, u32 *btf_id) {
struct bpf_insn_access_aux info = {
.reg_type = *reg_type, .log = &env->log,
};
if (env->ops->is_valid_access && env->ops->... | static int check_ctx_access(struct bpf_verifier_env *env, int insn_idx, int off, int size, enum bpf_access_type t, enum bpf_reg_type *reg_type, struct btf **btf, u32 *btf_id) {
struct bpf_insn_access_aux info = {
.reg_type = *reg_type, .log = &env->log,
};
if (env->ops->is_valid_access && env->ops->... | static int check_ctx_access(struct bpf_verifier_env *env, int insn_idx, int off, int size, enum bpf_access_type t, enum bpf_reg_type *reg_type, struct btf **btf, u32 *btf_id) {
struct bpf_insn_access_aux info = {
.reg_type = *reg_type, .log = &env->log,
};
if (env->ops->is_valid_access && env->ops->... | static int check_ctx_access(struct bpf_verifier_env *env, int insn_idx, int off, int size, enum bpf_access_type t, enum bpf_reg_type *reg_type, struct btf **btf, u32 *btf_id) {
struct bpf_insn_access_aux info = {
.reg_type = *reg_type, .log = &env->log,
};
if (env->ops->is_valid_access && env->ops->... | static int check_ctx_access(struct bpf_verifier_env *env, int insn_idx, int off, int size, enum bpf_access_type t, enum bpf_reg_type *reg_type, struct btf **btf, u32 *btf_id) {
struct bpf_insn_access_aux info = {
.reg_type = *reg_type, .log = &env->log,
};
if (env->ops->is_valid_access && env->ops->... | static int check_ctx_access(struct bpf_verifier_env *env, int insn_idx, int off, int size, enum bpf_access_type t, enum bpf_reg_type *reg_type, struct btf **btf, u32 *btf_id) {
struct bpf_insn_access_aux info = {
.reg_type = *reg_type, .log = &env->log,
};
if (env->ops->is_valid_access && env->ops->... | static int check_ctx_access(struct bpf_verifier_env *env, int insn_idx, int off, int size, enum bpf_access_type t, enum bpf_reg_type *reg_type, struct btf **btf, u32 *btf_id) {
struct bpf_insn_access_aux info = {
.reg_type = *reg_type, .log = &env->log,
};
if (env->ops->is_valid_access && env->ops->... | static int check_ctx_access(struct bpf_verifier_env *env, int insn_idx, int off, int size, enum bpf_access_type t, enum bpf_reg_type *reg_type, struct btf **btf, u32 *btf_id) {
struct bpf_insn_access_aux info = {
.reg_type = *reg_type, .log = &env->log,
};
if (env->ops->is_valid_access && env->ops->... | static int check_ctx_access(struct bpf_verifier_env *env, int insn_idx, int off, int size, enum bpf_access_type t, enum bpf_reg_type *reg_type, struct btf **btf, u32 *btf_id) {
struct bpf_insn_access_aux info = {
.reg_type = *reg_type, .log = &env->log,
};
if (env->ops->is_valid_access && env->... |
CVE-2022-23222 | linux | https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux | kernel/bpf/verifier.c | check_helper_call | static int check_helper_call(struct bpf_verifier_env *env, struct bpf_insn *insn, int *insn_idx_p) {
const struct bpf_func_proto *fn = NULL;
enum bpf_return_type ret_type;
struct bpf_reg_state *regs;
struct bpf_call_arg_meta meta;
int insn_idx = *insn_idx_p;
bool changes_data;
int i, err, fu... | static int check_helper_call(struct bpf_verifier_env *env, struct bpf_insn *insn, int *insn_idx_p) {
const struct bpf_func_proto *fn = NULL;
enum bpf_return_type ret_type;
enum bpf_type_flag ret_flag;
struct bpf_reg_state *regs;
struct bpf_call_arg_meta meta;
int insn_idx = *insn_idx_p;
bool... | static int check_helper_call(struct bpf_verifier_env *env, struct bpf_insn *insn, int *insn_idx_p) {
const struct bpf_func_proto *fn = NULL;
enum bpf_return_type ret_type;
struct bpf_reg_state *regs;
struct bpf_call_arg_meta meta;
int insn_idx = *insn_idx_p;
bool changes_data;
int i, err, fu... | static int check_helper_call(struct bpf_verifier_env *env, struct bpf_insn *insn, int *insn_idx_p) {
const struct bpf_func_proto *fn = NULL;
enum bpf_return_type ret_type;
enum bpf_type_flag ret_flag;
struct bpf_reg_state *regs;
struct bpf_call_arg_meta meta;
int insn_idx = *insn_idx_p;
bool... | static int check_helper_call(struct bpf_verifier_env *env, struct bpf_insn *insn, int *insn_idx_p) {
const struct bpf_func_proto *fn = NULL;
enum bpf_return_type ret_type;
struct bpf_reg_state *regs;
func_id = insn->imm;
if (func_id < 0 || func_id >= __BPF_FUNC_MAX_ID) {
return -EVAL;
}
... | static int check_helper_call(struct bpf_verifier_env *env, struct bpf_insn *insn, int *insn_idx_p) {
const struct bpf_func_proto *fn = NULL;
enum bpf_return_type ret_type;
enum bpf_type_flag ret_flag;
struct bpf_reg_state *regs;
func_id = insn->imm;
if (func_id < 0 || func_id >= __BPF_FUNC_MAX_I... | static int check_helper_call(struct bpf_verifier_env *env, struct bpf_insn *insn, int *insn_idx_p) {
const struct bpf_func_proto *fn = NULL;
enum bpf_return_type ret_type;
struct bpf_reg_state *regs;
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
func_id = insn->imm;
if (func_id < 0 || func_id >=... | static int check_helper_call(struct bpf_verifier_env *env, struct bpf_insn *insn, int *insn_idx_p) {
const struct bpf_func_proto *fn = NULL;
enum bpf_return_type ret_type;
enum bpf_type_flag ret_flag;
struct bpf_reg_state *regs;
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
func_id = insn->imm;
... | static int check_helper_call(struct bpf_verifier_env *env, struct bpf_insn *insn, int *insn_idx_p) {
const struct bpf_func_proto *fn = NULL;
enum bpf_return_type ret_type;
+ enum bpf_type_flag ret_flag;
struct bpf_reg_state *regs;
func_id = insn->imm;
if (func_id < 0 || func_id >= __BPF_FUN... |
CVE-2022-23222 | linux | https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux | kernel/bpf/verifier.c | check_helper_mem_access | static int check_helper_mem_access(struct bpf_verifier_env *env, int regno, int access_size, bool zero_size_allowed, struct bpf_call_arg_meta *meta) {
struct bpf_reg_state *regs = cur_regs(env), *reg = ®s[regno];
switch (reg->type) {
case PTR_TO_PACKET:
case PTR_TO_PACKET_META:
return check_p... | static int check_helper_mem_access(struct bpf_verifier_env *env, int regno, int access_size, bool zero_size_allowed, struct bpf_call_arg_meta *meta) {
struct bpf_reg_state *regs = cur_regs(env), *reg = ®s[regno];
switch (reg->type) {
case PTR_TO_PACKET:
case PTR_TO_PACKET_META:
return check_p... | static int check_helper_mem_access(struct bpf_verifier_env *env, int regno, int access_size, bool zero_size_allowed, struct bpf_call_arg_meta *meta) {
struct bpf_reg_state *regs = cur_regs(env), *reg = ®s[regno];
switch (reg->type) {
case PTR_TO_PACKET:
case PTR_TO_PACKET_META:
return check_p... | static int check_helper_mem_access(struct bpf_verifier_env *env, int regno, int access_size, bool zero_size_allowed, struct bpf_call_arg_meta *meta) {
struct bpf_reg_state *regs = cur_regs(env), *reg = ®s[regno];
switch (reg->type) {
case PTR_TO_PACKET:
case PTR_TO_PACKET_META:
return check_p... | static int check_helper_mem_access(struct bpf_verifier_env *env, int regno, int access_size, bool zero_size_allowed, struct bpf_call_arg_meta *meta) {
struct bpf_reg_state *regs = cur_regs(env), *reg = ®s[regno];
switch (reg->type) {
default:
if (zero_size_allowed && access_size == 0 && register_... | static int check_helper_mem_access(struct bpf_verifier_env *env, int regno, int access_size, bool zero_size_allowed, struct bpf_call_arg_meta *meta) {
struct bpf_reg_state *regs = cur_regs(env), *reg = ®s[regno];
switch (reg->type) {
default:
if (zero_size_allowed && access_size == 0 && register_... | static int check_helper_mem_access(struct bpf_verifier_env *env, int regno, int access_size, bool zero_size_allowed, struct bpf_call_arg_meta *meta) {
struct bpf_reg_state *regs = cur_regs(env), *reg = ®s[regno];
switch (reg->type) {
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
default:
if (... | static int check_helper_mem_access(struct bpf_verifier_env *env, int regno, int access_size, bool zero_size_allowed, struct bpf_call_arg_meta *meta) {
struct bpf_reg_state *regs = cur_regs(env), *reg = ®s[regno];
switch (reg->type) {
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
default:
if (... | static int check_helper_mem_access(struct bpf_verifier_env *env, int regno, int access_size, bool zero_size_allowed, struct bpf_call_arg_meta *meta) {
struct bpf_reg_state *regs = cur_regs(env), *reg = ®s[regno];
switch (reg->type) {
default:
if (zero_size_allowed && access_size == 0 && regi... |
CVE-2022-23222 | linux | https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux | kernel/bpf/verifier.c | check_mem_access | static int check_mem_access(struct bpf_verifier_env *env, int insn_idx, u32 regno, int off, int bpf_size, enum bpf_access_type t, int value_regno, bool strict_alignment_once) {
struct bpf_reg_state *regs = cur_regs(env);
struct bpf_reg_state *reg = regs + regno;
struct bpf_func_state *state;
int size, e... | static int check_mem_access(struct bpf_verifier_env *env, int insn_idx, u32 regno, int off, int bpf_size, enum bpf_access_type t, int value_regno, bool strict_alignment_once) {
struct bpf_reg_state *regs = cur_regs(env);
struct bpf_reg_state *reg = regs + regno;
struct bpf_func_state *state;
int size, e... | static int check_mem_access(struct bpf_verifier_env *env, int insn_idx, u32 regno, int off, int bpf_size, enum bpf_access_type t, int value_regno, bool strict_alignment_once) {
struct bpf_reg_state *regs = cur_regs(env);
struct bpf_reg_state *reg = regs + regno;
struct bpf_func_state *state;
int size, e... | static int check_mem_access(struct bpf_verifier_env *env, int insn_idx, u32 regno, int off, int bpf_size, enum bpf_access_type t, int value_regno, bool strict_alignment_once) {
struct bpf_reg_state *regs = cur_regs(env);
struct bpf_reg_state *reg = regs + regno;
struct bpf_func_state *state;
int size, e... | static int check_mem_access(struct bpf_verifier_env *env, int insn_idx, u32 regno, int off, int bpf_size, enum bpf_access_type t, int value_regno, bool strict_alignment_once) {
struct bpf_reg_state *regs = cur_regs(env);
struct bpf_reg_state *reg = regs + regno;
size = bpf_size_to_bytes(bpf_size);
if (s... | static int check_mem_access(struct bpf_verifier_env *env, int insn_idx, u32 regno, int off, int bpf_size, enum bpf_access_type t, int value_regno, bool strict_alignment_once) {
struct bpf_reg_state *regs = cur_regs(env);
struct bpf_reg_state *reg = regs + regno;
size = bpf_size_to_bytes(bpf_size);
if (s... | static int check_mem_access(struct bpf_verifier_env *env, int insn_idx, u32 regno, int off, int bpf_size, enum bpf_access_type t, int value_regno, bool strict_alignment_once) {
struct bpf_reg_state *regs = cur_regs(env);
struct bpf_reg_state *reg = regs + regno;
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */... | static int check_mem_access(struct bpf_verifier_env *env, int insn_idx, u32 regno, int off, int bpf_size, enum bpf_access_type t, int value_regno, bool strict_alignment_once) {
struct bpf_reg_state *regs = cur_regs(env);
struct bpf_reg_state *reg = regs + regno;
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */... | static int check_mem_access(struct bpf_verifier_env *env, int insn_idx, u32 regno, int off, int bpf_size, enum bpf_access_type t, int value_regno, bool strict_alignment_once) {
struct bpf_reg_state *regs = cur_regs(env);
struct bpf_reg_state *reg = regs + regno;
size = bpf_size_to_bytes(bpf_size);
... |
CVE-2022-23222 | linux | https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux | kernel/bpf/verifier.c | check_mem_reg | int check_mem_reg(struct bpf_verifier_env *env, struct bpf_reg_state *reg, u32 regno, u32 mem_size) {
if (register_is_null(reg)) {
return 0;
}
if (reg_type_may_be_null(reg->type)) {
const struct bpf_reg_state saved_reg = *reg;
int rv;
mark_ptr_not_null_reg(reg);
rv = ... | int check_mem_reg(struct bpf_verifier_env *env, struct bpf_reg_state *reg, u32 regno, u32 mem_size) {
if (register_is_null(reg)) {
return 0;
}
if (type_may_be_null(reg->type)) {
const struct bpf_reg_state saved_reg = *reg;
int rv;
mark_ptr_not_null_reg(reg);
rv = chec... | int check_mem_reg(struct bpf_verifier_env *env, struct bpf_reg_state *reg, u32 regno, u32 mem_size) {
if (register_is_null(reg)) {
return 0;
}
if (reg_type_may_be_null(reg->type)) {
const struct bpf_reg_state saved_reg = *reg;
int rv;
mark_ptr_not_null_reg(reg);
rv = ... | int check_mem_reg(struct bpf_verifier_env *env, struct bpf_reg_state *reg, u32 regno, u32 mem_size) {
if (register_is_null(reg)) {
return 0;
}
if (type_may_be_null(reg->type)) {
const struct bpf_reg_state saved_reg = *reg;
int rv;
mark_ptr_not_null_reg(reg);
rv = chec... | int check_mem_reg(struct bpf_verifier_env *env, struct bpf_reg_state *reg, u32 regno, u32 mem_size) {
if (register_is_null(reg)) {
return 0;
}
if (reg_type_may_be_null(reg->type)) {
const struct bpf_reg_state saved_reg = *reg;
mark_ptr_not_null_reg(reg);
return rv;
}
... | int check_mem_reg(struct bpf_verifier_env *env, struct bpf_reg_state *reg, u32 regno, u32 mem_size) {
if (register_is_null(reg)) {
return 0;
}
if (type_may_be_null(reg->type)) {
const struct bpf_reg_state saved_reg = *reg;
mark_ptr_not_null_reg(reg);
return rv;
}
retu... | int check_mem_reg(struct bpf_verifier_env *env, struct bpf_reg_state *reg, u32 regno, u32 mem_size) {
if (register_is_null(reg)) {
return 0;
}
if (reg_type_may_be_null(reg->type)) {
const struct bpf_reg_state saved_reg = *reg;
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
mark_pt... | int check_mem_reg(struct bpf_verifier_env *env, struct bpf_reg_state *reg, u32 regno, u32 mem_size) {
if (register_is_null(reg)) {
return 0;
}
if (type_may_be_null(reg->type)) {
const struct bpf_reg_state saved_reg = *reg;
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
mark_ptr_no... | int check_mem_reg(struct bpf_verifier_env *env, struct bpf_reg_state *reg, u32 regno, u32 mem_size) {
if (register_is_null(reg)) {
return 0;
}
- if (reg_type_may_be_null(reg->type)) {
+ if (type_may_be_null(reg->type)) {
const struct bpf_reg_state saved_reg = *reg;
mark_ptr_n... |
CVE-2022-23222 | linux | https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux | kernel/bpf/verifier.c | check_reg_sane_offset | static bool check_reg_sane_offset(struct bpf_verifier_env *env, const struct bpf_reg_state *reg, enum bpf_reg_type type) {
bool known = tnum_is_const(reg->var_off);
s64 val = reg->var_off.value;
s64 smin = reg->smin_value;
if (known && (val >= BPF_MAX_VAR_OFF || val <= -BPF_MAX_VAR_OFF)) {
verbo... | static bool check_reg_sane_offset(struct bpf_verifier_env *env, const struct bpf_reg_state *reg, enum bpf_reg_type type) {
bool known = tnum_is_const(reg->var_off);
s64 val = reg->var_off.value;
s64 smin = reg->smin_value;
if (known && (val >= BPF_MAX_VAR_OFF || val <= -BPF_MAX_VAR_OFF)) {
verbo... | static bool check_reg_sane_offset(struct bpf_verifier_env *env, const struct bpf_reg_state *reg, enum bpf_reg_type type) {
bool known = tnum_is_const(reg->var_off);
s64 val = reg->var_off.value;
s64 smin = reg->smin_value;
if (known && (val >= BPF_MAX_VAR_OFF || val <= -BPF_MAX_VAR_OFF)) {
verbo... | static bool check_reg_sane_offset(struct bpf_verifier_env *env, const struct bpf_reg_state *reg, enum bpf_reg_type type) {
bool known = tnum_is_const(reg->var_off);
s64 val = reg->var_off.value;
s64 smin = reg->smin_value;
if (known && (val >= BPF_MAX_VAR_OFF || val <= -BPF_MAX_VAR_OFF)) {
verbo... | static bool check_reg_sane_offset(struct bpf_verifier_env *env, const struct bpf_reg_state *reg, enum bpf_reg_type type) {
bool known = tnum_is_const(reg->var_off);
s64 val = reg->var_off.value;
s64 smin = reg->smin_value;
if (known && (val >= BPF_MAX_VAR_OFF || val <= -BPF_MAX_VAR_OFF)) {
verbo... | static bool check_reg_sane_offset(struct bpf_verifier_env *env, const struct bpf_reg_state *reg, enum bpf_reg_type type) {
bool known = tnum_is_const(reg->var_off);
s64 val = reg->var_off.value;
s64 smin = reg->smin_value;
if (known && (val >= BPF_MAX_VAR_OFF || val <= -BPF_MAX_VAR_OFF)) {
verbo... | static bool check_reg_sane_offset(struct bpf_verifier_env *env, const struct bpf_reg_state *reg, enum bpf_reg_type type) {
bool known = tnum_is_const(reg->var_off);
s64 val = reg->var_off.value;
s64 smin = reg->smin_value;
if (known && (val >= BPF_MAX_VAR_OFF || val <= -BPF_MAX_VAR_OFF)) {
verbo... | static bool check_reg_sane_offset(struct bpf_verifier_env *env, const struct bpf_reg_state *reg, enum bpf_reg_type type) {
bool known = tnum_is_const(reg->var_off);
s64 val = reg->var_off.value;
s64 smin = reg->smin_value;
if (known && (val >= BPF_MAX_VAR_OFF || val <= -BPF_MAX_VAR_OFF)) {
verbo... | static bool check_reg_sane_offset(struct bpf_verifier_env *env, const struct bpf_reg_state *reg, enum bpf_reg_type type) {
bool known = tnum_is_const(reg->var_off);
s64 val = reg->var_off.value;
s64 smin = reg->smin_value;
if (known && (val >= BPF_MAX_VAR_OFF || val <= -BPF_MAX_VAR_OFF)) {
- ... |
CVE-2022-23222 | linux | https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux | kernel/bpf/verifier.c | check_reg_type | static int check_reg_type(struct bpf_verifier_env *env, u32 regno, enum bpf_arg_type arg_type, const u32 *arg_btf_id) {
struct bpf_reg_state *regs = cur_regs(env), *reg = ®s[regno];
enum bpf_reg_type expected, type = reg->type;
const struct bpf_reg_types *compatible;
int i, j;
compatible = compat... | static int check_reg_type(struct bpf_verifier_env *env, u32 regno, enum bpf_arg_type arg_type, const u32 *arg_btf_id) {
struct bpf_reg_state *regs = cur_regs(env), *reg = ®s[regno];
enum bpf_reg_type expected, type = reg->type;
const struct bpf_reg_types *compatible;
int i, j;
compatible = compat... | static int check_reg_type(struct bpf_verifier_env *env, u32 regno, enum bpf_arg_type arg_type, const u32 *arg_btf_id) {
struct bpf_reg_state *regs = cur_regs(env), *reg = ®s[regno];
enum bpf_reg_type expected, type = reg->type;
const struct bpf_reg_types *compatible;
int i, j;
compatible = compat... | static int check_reg_type(struct bpf_verifier_env *env, u32 regno, enum bpf_arg_type arg_type, const u32 *arg_btf_id) {
struct bpf_reg_state *regs = cur_regs(env), *reg = ®s[regno];
enum bpf_reg_type expected, type = reg->type;
const struct bpf_reg_types *compatible;
int i, j;
compatible = compat... | static int check_reg_type(struct bpf_verifier_env *env, u32 regno, enum bpf_arg_type arg_type, const u32 *arg_btf_id) {
struct bpf_reg_state *regs = cur_regs(env), *reg = ®s[regno];
enum bpf_reg_type expected, type = reg->type;
for (i = 0; i < ARRAY_SIZE(compatible->types); i++) {
expected = comp... | static int check_reg_type(struct bpf_verifier_env *env, u32 regno, enum bpf_arg_type arg_type, const u32 *arg_btf_id) {
struct bpf_reg_state *regs = cur_regs(env), *reg = ®s[regno];
enum bpf_reg_type expected, type = reg->type;
for (i = 0; i < ARRAY_SIZE(compatible->types); i++) {
expected = comp... | static int check_reg_type(struct bpf_verifier_env *env, u32 regno, enum bpf_arg_type arg_type, const u32 *arg_btf_id) {
struct bpf_reg_state *regs = cur_regs(env), *reg = ®s[regno];
enum bpf_reg_type expected, type = reg->type;
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
for (i = 0; i < ARRAY_SIZE(... | static int check_reg_type(struct bpf_verifier_env *env, u32 regno, enum bpf_arg_type arg_type, const u32 *arg_btf_id) {
struct bpf_reg_state *regs = cur_regs(env), *reg = ®s[regno];
enum bpf_reg_type expected, type = reg->type;
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
for (i = 0; i < ARRAY_SIZE(... | static int check_reg_type(struct bpf_verifier_env *env, u32 regno, enum bpf_arg_type arg_type, const u32 *arg_btf_id) {
struct bpf_reg_state *regs = cur_regs(env), *reg = ®s[regno];
enum bpf_reg_type expected, type = reg->type;
for (i = 0; i < ARRAY_SIZE(compatible->types); i++) {
expected =... |
CVE-2022-23222 | linux | https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux | kernel/bpf/verifier.c | check_return_code | static int check_return_code(struct bpf_verifier_env *env) {
struct tnum enforce_attach_type_range = tnum_unknown;
const struct bpf_prog *prog = env->prog;
struct bpf_reg_state *reg;
struct tnum range = tnum_range(0, 1);
enum bpf_prog_type prog_type = resolve_prog_type(env->prog);
int err;
s... | static int check_return_code(struct bpf_verifier_env *env) {
struct tnum enforce_attach_type_range = tnum_unknown;
const struct bpf_prog *prog = env->prog;
struct bpf_reg_state *reg;
struct tnum range = tnum_range(0, 1);
enum bpf_prog_type prog_type = resolve_prog_type(env->prog);
int err;
s... | static int check_return_code(struct bpf_verifier_env *env) {
struct tnum enforce_attach_type_range = tnum_unknown;
const struct bpf_prog *prog = env->prog;
struct bpf_reg_state *reg;
struct tnum range = tnum_range(0, 1);
enum bpf_prog_type prog_type = resolve_prog_type(env->prog);
int err;
s... | static int check_return_code(struct bpf_verifier_env *env) {
struct tnum enforce_attach_type_range = tnum_unknown;
const struct bpf_prog *prog = env->prog;
struct bpf_reg_state *reg;
struct tnum range = tnum_range(0, 1);
enum bpf_prog_type prog_type = resolve_prog_type(env->prog);
int err;
s... | static int check_return_code(struct bpf_verifier_env *env) {
err = check_reg_arg(env, BPF_REG_0, SRC_OP);
if (is_pointer_value(env, BPF_REG_0)) {
return -EACCES;
}
reg = cur_regs(env) + BPF_REG_0;
if (frame->in_async_callback_fn) {
if (reg->type != SCALAR_VALUE) {
verbose... | static int check_return_code(struct bpf_verifier_env *env) {
err = check_reg_arg(env, BPF_REG_0, SRC_OP);
if (is_pointer_value(env, BPF_REG_0)) {
return -EACCES;
}
reg = cur_regs(env) + BPF_REG_0;
if (frame->in_async_callback_fn) {
if (reg->type != SCALAR_VALUE) {
verbose... | static int check_return_code(struct bpf_verifier_env *env) {
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
err = check_reg_arg(env, BPF_REG_0, SRC_OP);
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
if (is_pointer_value(env, BPF_REG_0)) {
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
return -... | static int check_return_code(struct bpf_verifier_env *env) {
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
err = check_reg_arg(env, BPF_REG_0, SRC_OP);
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
if (is_pointer_value(env, BPF_REG_0)) {
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
return -... | static int check_return_code(struct bpf_verifier_env *env) {
err = check_reg_arg(env, BPF_REG_0, SRC_OP);
if (is_pointer_value(env, BPF_REG_0)) {
return -EACCES;
}
reg = cur_regs(env) + BPF_REG_0;
if (frame->in_async_callback_fn) {
if (reg->type != SCALAR_VALUE) {
- ... |
CVE-2022-23222 | linux | https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux | kernel/bpf/verifier.c | check_sock_access | static int check_sock_access(struct bpf_verifier_env *env, int insn_idx, u32 regno, int off, int size, enum bpf_access_type t) {
struct bpf_reg_state *regs = cur_regs(env);
struct bpf_reg_state *reg = ®s[regno];
struct bpf_insn_access_aux info = {};
bool valid;
if (reg->smin_value < 0) {
... | static int check_sock_access(struct bpf_verifier_env *env, int insn_idx, u32 regno, int off, int size, enum bpf_access_type t) {
struct bpf_reg_state *regs = cur_regs(env);
struct bpf_reg_state *reg = ®s[regno];
struct bpf_insn_access_aux info = {};
bool valid;
if (reg->smin_value < 0) {
... | static int check_sock_access(struct bpf_verifier_env *env, int insn_idx, u32 regno, int off, int size, enum bpf_access_type t) {
struct bpf_reg_state *regs = cur_regs(env);
struct bpf_reg_state *reg = ®s[regno];
struct bpf_insn_access_aux info = {};
bool valid;
if (reg->smin_value < 0) {
... | static int check_sock_access(struct bpf_verifier_env *env, int insn_idx, u32 regno, int off, int size, enum bpf_access_type t) {
struct bpf_reg_state *regs = cur_regs(env);
struct bpf_reg_state *reg = ®s[regno];
struct bpf_insn_access_aux info = {};
bool valid;
if (reg->smin_value < 0) {
... | static int check_sock_access(struct bpf_verifier_env *env, int insn_idx, u32 regno, int off, int size, enum bpf_access_type t) {
struct bpf_reg_state *regs = cur_regs(env);
struct bpf_reg_state *reg = ®s[regno];
struct bpf_insn_access_aux info = {};
switch (reg->type) {
case PTR_TO_SOCK_COMMON:
... | static int check_sock_access(struct bpf_verifier_env *env, int insn_idx, u32 regno, int off, int size, enum bpf_access_type t) {
struct bpf_reg_state *regs = cur_regs(env);
struct bpf_reg_state *reg = ®s[regno];
struct bpf_insn_access_aux info = {};
switch (reg->type) {
case PTR_TO_SOCK_COMMON:
... | static int check_sock_access(struct bpf_verifier_env *env, int insn_idx, u32 regno, int off, int size, enum bpf_access_type t) {
struct bpf_reg_state *regs = cur_regs(env);
struct bpf_reg_state *reg = ®s[regno];
struct bpf_insn_access_aux info = {};
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
s... | static int check_sock_access(struct bpf_verifier_env *env, int insn_idx, u32 regno, int off, int size, enum bpf_access_type t) {
struct bpf_reg_state *regs = cur_regs(env);
struct bpf_reg_state *reg = ®s[regno];
struct bpf_insn_access_aux info = {};
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
s... | static int check_sock_access(struct bpf_verifier_env *env, int insn_idx, u32 regno, int off, int size, enum bpf_access_type t) {
struct bpf_reg_state *regs = cur_regs(env);
struct bpf_reg_state *reg = ®s[regno];
struct bpf_insn_access_aux info = {};
switch (reg->type) {
case PTR_TO_SOCK_COM... |
CVE-2022-23222 | linux | https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux | kernel/bpf/verifier.c | do_check | static int do_check(struct bpf_verifier_env *env) {
bool pop_log = !(env->log.level & BPF_LOG_LEVEL2);
struct bpf_verifier_state *state = env->cur_state;
struct bpf_insn *insns = env->prog->insnsi;
struct bpf_reg_state *regs;
int insn_cnt = env->prog->len;
bool do_print_state = false;
int pr... | static int do_check(struct bpf_verifier_env *env) {
bool pop_log = !(env->log.level & BPF_LOG_LEVEL2);
struct bpf_verifier_state *state = env->cur_state;
struct bpf_insn *insns = env->prog->insnsi;
struct bpf_reg_state *regs;
int insn_cnt = env->prog->len;
bool do_print_state = false;
int pr... | static int do_check(struct bpf_verifier_env *env) {
bool pop_log = !(env->log.level & BPF_LOG_LEVEL2);
struct bpf_verifier_state *state = env->cur_state;
struct bpf_insn *insns = env->prog->insnsi;
struct bpf_reg_state *regs;
int insn_cnt = env->prog->len;
bool do_print_state = false;
int pr... | static int do_check(struct bpf_verifier_env *env) {
bool pop_log = !(env->log.level & BPF_LOG_LEVEL2);
struct bpf_verifier_state *state = env->cur_state;
struct bpf_insn *insns = env->prog->insnsi;
struct bpf_reg_state *regs;
int insn_cnt = env->prog->len;
bool do_print_state = false;
int pr... | static int do_check(struct bpf_verifier_env *env) {
}
| static int do_check(struct bpf_verifier_env *env) {
}
| static int do_check(struct bpf_verifier_env *env) {
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
}
| static int do_check(struct bpf_verifier_env *env) {
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
} | |
CVE-2022-23222 | linux | https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux | kernel/bpf/verifier.c | is_spillable_regtype | static bool is_spillable_regtype(enum bpf_reg_type type) {
switch (type) {
case PTR_TO_MAP_VALUE:
case PTR_TO_MAP_VALUE_OR_NULL:
case PTR_TO_STACK:
case PTR_TO_CTX:
case PTR_TO_PACKET:
case PTR_TO_PACKET_META:
case PTR_TO_PACKET_END:
case PTR_TO_FLOW_KEYS:
case CONST_PTR_TO_MAP:
... | static bool is_spillable_regtype(enum bpf_reg_type type) {
switch (base_type(type)) {
case PTR_TO_MAP_VALUE:
case PTR_TO_STACK:
case PTR_TO_CTX:
case PTR_TO_PACKET:
case PTR_TO_PACKET_META:
case PTR_TO_PACKET_END:
case PTR_TO_FLOW_KEYS:
case CONST_PTR_TO_MAP:
case PTR_TO_SOCKET:
... | static bool is_spillable_regtype(enum bpf_reg_type type) {
switch (type) {
case PTR_TO_MAP_VALUE:
case PTR_TO_MAP_VALUE_OR_NULL:
case PTR_TO_STACK:
case PTR_TO_CTX:
case PTR_TO_PACKET:
case PTR_TO_PACKET_META:
case PTR_TO_PACKET_END:
case PTR_TO_FLOW_KEYS:
case CONST_PTR_TO_MAP:
... | static bool is_spillable_regtype(enum bpf_reg_type type) {
switch (base_type(type)) {
case PTR_TO_MAP_VALUE:
case PTR_TO_STACK:
case PTR_TO_CTX:
case PTR_TO_PACKET:
case PTR_TO_PACKET_META:
case PTR_TO_PACKET_END:
case PTR_TO_FLOW_KEYS:
case CONST_PTR_TO_MAP:
case PTR_TO_SOCKET:
... | static bool is_spillable_regtype(enum bpf_reg_type type) {
switch (type) {
case PTR_TO_MAP_VALUE_OR_NULL:
case PTR_TO_SOCKET_OR_NULL:
case PTR_TO_SOCK_COMMON_OR_NULL:
case PTR_TO_TCP_SOCK_OR_NULL:
case PTR_TO_BTF_ID_OR_NULL:
case PTR_TO_RDONLY_BUF_OR_NULL:
case PTR_TO_RDWR_BUF_OR_NULL:
... | static bool is_spillable_regtype(enum bpf_reg_type type) {
switch (base_type(type)) {
case PTR_TO_MAP_KEY:
return true;
default:
return false;
}
}
| static bool is_spillable_regtype(enum bpf_reg_type type) {
switch (type) {
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
case PTR_TO_MAP_VALUE_OR_NULL:
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
case PTR_TO_SOCKET_OR_NULL:
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
case PTR_TO_SOCK_COM... | static bool is_spillable_regtype(enum bpf_reg_type type) {
switch (base_type(type)) {
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
/* PLACEHOLDER: DO NOT DEL... | static bool is_spillable_regtype(enum bpf_reg_type type) {
- switch (type) {
- case PTR_TO_MAP_VALUE_OR_NULL:
- case PTR_TO_SOCKET_OR_NULL:
- case PTR_TO_SOCK_COMMON_OR_NULL:
- case PTR_TO_TCP_SOCK_OR_NULL:
- case PTR_TO_BTF_ID_OR_NULL:
- case PTR_TO_RDONLY_BUF_OR_NULL:
- case PTR_TO_RDWR_BUF_O... |
CVE-2022-23222 | linux | https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux | kernel/bpf/verifier.c | mark_ptr_not_null_reg | static void mark_ptr_not_null_reg(struct bpf_reg_state *reg) {
switch (reg->type) {
case PTR_TO_MAP_VALUE_OR_NULL: {
const struct bpf_map *map = reg->map_ptr;
if (map->inner_map_meta) {
reg->type = CONST_PTR_TO_MAP;
reg->map_ptr = map->inner_map_meta;
if (map_... | static void mark_ptr_not_null_reg(struct bpf_reg_state *reg) {
if (base_type(reg->type) == PTR_TO_MAP_VALUE) {
const struct bpf_map *map = reg->map_ptr;
if (map->inner_map_meta) {
reg->type = CONST_PTR_TO_MAP;
reg->map_ptr = map->inner_map_meta;
if (map_value_has_... | static void mark_ptr_not_null_reg(struct bpf_reg_state *reg) {
switch (reg->type) {
case PTR_TO_MAP_VALUE_OR_NULL: {
const struct bpf_map *map = reg->map_ptr;
if (map->inner_map_meta) {
reg->type = CONST_PTR_TO_MAP;
reg->map_ptr = map->inner_map_meta;
if (map_... | static void mark_ptr_not_null_reg(struct bpf_reg_state *reg) {
if (base_type(reg->type) == PTR_TO_MAP_VALUE) {
const struct bpf_map *map = reg->map_ptr;
if (map->inner_map_meta) {
reg->type = CONST_PTR_TO_MAP;
reg->map_ptr = map->inner_map_meta;
if (map_value_has_... | static void mark_ptr_not_null_reg(struct bpf_reg_state *reg) {
switch (reg->type) {
case PTR_TO_MAP_VALUE_OR_NULL: {
const struct bpf_map *map = reg->map_ptr;
if (map->inner_map_meta) {
if (map_value_has_timer(map->inner_map_meta)) {
reg->map_uid = reg->id;
... | static void mark_ptr_not_null_reg(struct bpf_reg_state *reg) {
if (base_type(reg->type) == PTR_TO_MAP_VALUE) {
const struct bpf_map *map = reg->map_ptr;
if (map->inner_map_meta) {
if (map_value_has_timer(map->inner_map_meta)) {
reg->map_uid = reg->id;
}
... | static void mark_ptr_not_null_reg(struct bpf_reg_state *reg) {
switch (reg->type) {
case PTR_TO_MAP_VALUE_OR_NULL: {
const struct bpf_map *map = reg->map_ptr;
if (map->inner_map_meta) {
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
if (map_value_has_timer(map->inner_map_meta)) {
... | static void mark_ptr_not_null_reg(struct bpf_reg_state *reg) {
if (base_type(reg->type) == PTR_TO_MAP_VALUE) {
const struct bpf_map *map = reg->map_ptr;
if (map->inner_map_meta) {
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
if (map_value_has_timer(map->inner_map_meta)) {
... | static void mark_ptr_not_null_reg(struct bpf_reg_state *reg) {
- switch (reg->type) {
- case PTR_TO_MAP_VALUE_OR_NULL: {
+ if (base_type(reg->type) == PTR_TO_MAP_VALUE) {
const struct bpf_map *map = reg->map_ptr;
if (map->inner_map_meta) {
if (map_value_has_timer(map->inner_map_... |
CVE-2022-23222 | linux | https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux | kernel/bpf/verifier.c | mark_ptr_or_null_reg | static void mark_ptr_or_null_reg(struct bpf_func_state *state, struct bpf_reg_state *reg, u32 id, bool is_null) {
if (reg_type_may_be_null(reg->type) && reg->id == id && !WARN_ON_ONCE(!reg->id)) {
if (WARN_ON_ONCE(reg->smin_value || reg->smax_value || !tnum_equals_const(reg->var_off, 0) || reg->off)) {
... | static void mark_ptr_or_null_reg(struct bpf_func_state *state, struct bpf_reg_state *reg, u32 id, bool is_null) {
if (type_may_be_null(reg->type) && reg->id == id && !WARN_ON_ONCE(!reg->id)) {
if (WARN_ON_ONCE(reg->smin_value || reg->smax_value || !tnum_equals_const(reg->var_off, 0) || reg->off)) {
... | static void mark_ptr_or_null_reg(struct bpf_func_state *state, struct bpf_reg_state *reg, u32 id, bool is_null) {
if (reg_type_may_be_null(reg->type) && reg->id == id && !WARN_ON_ONCE(!reg->id)) {
if (WARN_ON_ONCE(reg->smin_value || reg->smax_value || !tnum_equals_const(reg->var_off, 0) || reg->off)) {
... | static void mark_ptr_or_null_reg(struct bpf_func_state *state, struct bpf_reg_state *reg, u32 id, bool is_null) {
if (type_may_be_null(reg->type) && reg->id == id && !WARN_ON_ONCE(!reg->id)) {
if (WARN_ON_ONCE(reg->smin_value || reg->smax_value || !tnum_equals_const(reg->var_off, 0) || reg->off)) {
... | static void mark_ptr_or_null_reg(struct bpf_func_state *state, struct bpf_reg_state *reg, u32 id, bool is_null) {
if (reg_type_may_be_null(reg->type) && reg->id == id && !WARN_ON_ONCE(!reg->id)) {
if (WARN_ON_ONCE(reg->smin_value || reg->smax_value || !tnum_equals_const(reg->var_off, 0) || reg->off)) {
... | static void mark_ptr_or_null_reg(struct bpf_func_state *state, struct bpf_reg_state *reg, u32 id, bool is_null) {
if (type_may_be_null(reg->type) && reg->id == id && !WARN_ON_ONCE(!reg->id)) {
if (WARN_ON_ONCE(reg->smin_value || reg->smax_value || !tnum_equals_const(reg->var_off, 0) || reg->off)) {
... | static void mark_ptr_or_null_reg(struct bpf_func_state *state, struct bpf_reg_state *reg, u32 id, bool is_null) {
if (reg_type_may_be_null(reg->type) && reg->id == id && !WARN_ON_ONCE(!reg->id)) {
if (WARN_ON_ONCE(reg->smin_value || reg->smax_value || !tnum_equals_const(reg->var_off, 0) || reg->off)) {
... | static void mark_ptr_or_null_reg(struct bpf_func_state *state, struct bpf_reg_state *reg, u32 id, bool is_null) {
if (type_may_be_null(reg->type) && reg->id == id && !WARN_ON_ONCE(!reg->id)) {
if (WARN_ON_ONCE(reg->smin_value || reg->smax_value || !tnum_equals_const(reg->var_off, 0) || reg->off)) {
... | static void mark_ptr_or_null_reg(struct bpf_func_state *state, struct bpf_reg_state *reg, u32 id, bool is_null) {
- if (reg_type_may_be_null(reg->type) && reg->id == id && !WARN_ON_ONCE(!reg->id)) {
+ if (type_may_be_null(reg->type) && reg->id == id && !WARN_ON_ONCE(!reg->id)) {
if (WARN_ON_ONCE(reg->sm... |
CVE-2022-23222 | linux | https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux | kernel/bpf/verifier.c | mark_reg_read | static int mark_reg_read(struct bpf_verifier_env *env, const struct bpf_reg_state *state, struct bpf_reg_state *parent, u8 flag) {
bool writes = parent == state->parent;
int cnt = 0;
while (parent) {
if (writes && state->live & REG_LIVE_WRITTEN) {
break;
}
if (parent->liv... | static int mark_reg_read(struct bpf_verifier_env *env, const struct bpf_reg_state *state, struct bpf_reg_state *parent, u8 flag) {
bool writes = parent == state->parent;
int cnt = 0;
while (parent) {
if (writes && state->live & REG_LIVE_WRITTEN) {
break;
}
if (parent->liv... | static int mark_reg_read(struct bpf_verifier_env *env, const struct bpf_reg_state *state, struct bpf_reg_state *parent, u8 flag) {
bool writes = parent == state->parent;
int cnt = 0;
while (parent) {
if (writes && state->live & REG_LIVE_WRITTEN) {
break;
}
if (parent->liv... | static int mark_reg_read(struct bpf_verifier_env *env, const struct bpf_reg_state *state, struct bpf_reg_state *parent, u8 flag) {
bool writes = parent == state->parent;
int cnt = 0;
while (parent) {
if (writes && state->live & REG_LIVE_WRITTEN) {
break;
}
if (parent->liv... | static int mark_reg_read(struct bpf_verifier_env *env, const struct bpf_reg_state *state, struct bpf_reg_state *parent, u8 flag) {
bool writes = parent == state->parent;
while (parent) {
if (writes && state->live & REG_LIVE_WRITTEN) {
break;
}
if (parent->live & REG_LIVE_DONE... | static int mark_reg_read(struct bpf_verifier_env *env, const struct bpf_reg_state *state, struct bpf_reg_state *parent, u8 flag) {
bool writes = parent == state->parent;
while (parent) {
if (writes && state->live & REG_LIVE_WRITTEN) {
break;
}
if (parent->live & REG_LIVE_DONE... | static int mark_reg_read(struct bpf_verifier_env *env, const struct bpf_reg_state *state, struct bpf_reg_state *parent, u8 flag) {
bool writes = parent == state->parent;
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
while (parent) {
if (writes && state->live & REG_LIVE_WRITTEN) {
break;
... | static int mark_reg_read(struct bpf_verifier_env *env, const struct bpf_reg_state *state, struct bpf_reg_state *parent, u8 flag) {
bool writes = parent == state->parent;
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
while (parent) {
if (writes && state->live & REG_LIVE_WRITTEN) {
break;
... | static int mark_reg_read(struct bpf_verifier_env *env, const struct bpf_reg_state *state, struct bpf_reg_state *parent, u8 flag) {
bool writes = parent == state->parent;
while (parent) {
if (writes && state->live & REG_LIVE_WRITTEN) {
break;
}
if (parent->live & REG_LI... |
CVE-2022-23222 | linux | https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux | kernel/bpf/verifier.c | print_verifier_state | static void print_verifier_state(struct bpf_verifier_env *env, const struct bpf_func_state *state) {
const struct bpf_reg_state *reg;
enum bpf_reg_type t;
int i;
if (state->frameno) {
verbose(env, " frame%d:", state->frameno);
}
for (i = 0; i < MAX_BPF_REG; i++) {
reg = &state->r... | static void print_verifier_state(struct bpf_verifier_env *env, const struct bpf_func_state *state) {
const struct bpf_reg_state *reg;
enum bpf_reg_type t;
int i;
if (state->frameno) {
verbose(env, " frame%d:", state->frameno);
}
for (i = 0; i < MAX_BPF_REG; i++) {
reg = &state->r... | static void print_verifier_state(struct bpf_verifier_env *env, const struct bpf_func_state *state) {
const struct bpf_reg_state *reg;
enum bpf_reg_type t;
int i;
if (state->frameno) {
verbose(env, " frame%d:", state->frameno);
}
for (i = 0; i < MAX_BPF_REG; i++) {
reg = &state->r... | static void print_verifier_state(struct bpf_verifier_env *env, const struct bpf_func_state *state) {
const struct bpf_reg_state *reg;
enum bpf_reg_type t;
int i;
if (state->frameno) {
verbose(env, " frame%d:", state->frameno);
}
for (i = 0; i < MAX_BPF_REG; i++) {
reg = &state->r... | static void print_verifier_state(struct bpf_verifier_env *env, const struct bpf_func_state *state) {
if (state->frameno) {
verbose(env, " frame%d:", state->frameno);
}
for (i = 0; i < MAX_BPF_REG; i++) {
reg = &state->regs[i];
t = reg->type;
verbose(env, " R%d", i);
p... | static void print_verifier_state(struct bpf_verifier_env *env, const struct bpf_func_state *state) {
if (state->frameno) {
verbose(env, " frame%d:", state->frameno);
}
for (i = 0; i < MAX_BPF_REG; i++) {
reg = &state->regs[i];
t = reg->type;
verbose(env, " R%d", i);
p... | static void print_verifier_state(struct bpf_verifier_env *env, const struct bpf_func_state *state) {
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
if (state->frameno) {
verbose(env, " frame%d:", state->frameno);
}
for (i = 0; i < MAX_BPF_REG; i++) {
reg = &state->regs[i];
t = reg... | static void print_verifier_state(struct bpf_verifier_env *env, const struct bpf_func_state *state) {
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
if (state->frameno) {
verbose(env, " frame%d:", state->frameno);
}
for (i = 0; i < MAX_BPF_REG; i++) {
reg = &state->regs[i];
t = reg... | static void print_verifier_state(struct bpf_verifier_env *env, const struct bpf_func_state *state) {
if (state->frameno) {
verbose(env, " frame%d:", state->frameno);
}
for (i = 0; i < MAX_BPF_REG; i++) {
reg = &state->regs[i];
t = reg->type;
verbose(env, " R%d", i);
... |
CVE-2022-23222 | linux | https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux | kernel/bpf/verifier.c | reg_type_may_be_refcounted_or_null | static bool reg_type_may_be_refcounted_or_null(enum bpf_reg_type type) {
return type == PTR_TO_SOCKET || type == PTR_TO_SOCKET_OR_NULL || type == PTR_TO_TCP_SOCK || type == PTR_TO_TCP_SOCK_OR_NULL || type == PTR_TO_MEM || type == PTR_TO_MEM_OR_NULL;
} | static bool reg_type_may_be_refcounted_or_null(enum bpf_reg_type type) {
return base_type(type) == PTR_TO_SOCKET || base_type(type) == PTR_TO_TCP_SOCK || base_type(type) == PTR_TO_MEM;
} | static bool reg_type_may_be_refcounted_or_null(enum bpf_reg_type type) {
return type == PTR_TO_SOCKET || type == PTR_TO_SOCKET_OR_NULL || type == PTR_TO_TCP_SOCK || type == PTR_TO_TCP_SOCK_OR_NULL || type == PTR_TO_MEM || type == PTR_TO_MEM_OR_NULL;
} | static bool reg_type_may_be_refcounted_or_null(enum bpf_reg_type type) {
return base_type(type) == PTR_TO_SOCKET || base_type(type) == PTR_TO_TCP_SOCK || base_type(type) == PTR_TO_MEM;
} | static bool reg_type_may_be_refcounted_or_null(enum bpf_reg_type type) {
return type == PTR_TO_SOCKET || type == PTR_TO_SOCKET_OR_NULL || type == PTR_TO_TCP_SOCK || type == PTR_TO_TCP_SOCK_OR_NULL || type == PTR_TO_MEM || type == PTR_TO_MEM_OR_NULL;
}
| static bool reg_type_may_be_refcounted_or_null(enum bpf_reg_type type) {
return base_type(type) == PTR_TO_SOCKET || base_type(type) == PTR_TO_TCP_SOCK || base_type(type) == PTR_TO_MEM;
}
| static bool reg_type_may_be_refcounted_or_null(enum bpf_reg_type type) {
return type == PTR_TO_SOCKET || type == PTR_TO_SOCKET_OR_NULL || type == PTR_TO_TCP_SOCK || type == PTR_TO_TCP_SOCK_OR_NULL || type == PTR_TO_MEM || type == PTR_TO_MEM_OR_NULL;
}
| static bool reg_type_may_be_refcounted_or_null(enum bpf_reg_type type) {
return base_type(type) == PTR_TO_SOCKET || base_type(type) == PTR_TO_TCP_SOCK || base_type(type) == PTR_TO_MEM;
} | static bool reg_type_may_be_refcounted_or_null(enum bpf_reg_type type) {
- return type == PTR_TO_SOCKET || type == PTR_TO_SOCKET_OR_NULL || type == PTR_TO_TCP_SOCK || type == PTR_TO_TCP_SOCK_OR_NULL || type == PTR_TO_MEM || type == PTR_TO_MEM_OR_NULL;
+ return base_type(type) == PTR_TO_SOCKET || base_type(type) ... |
CVE-2022-23222 | linux | https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux | kernel/bpf/verifier.c | reg_type_mismatch_ok | static bool reg_type_mismatch_ok(enum bpf_reg_type type) {
switch (type) {
case PTR_TO_CTX:
case PTR_TO_SOCKET:
case PTR_TO_SOCKET_OR_NULL:
case PTR_TO_SOCK_COMMON:
case PTR_TO_SOCK_COMMON_OR_NULL:
case PTR_TO_TCP_SOCK:
case PTR_TO_TCP_SOCK_OR_NULL:
case PTR_TO_XDP_SOCK:
case PTR... | static bool reg_type_mismatch_ok(enum bpf_reg_type type) {
switch (base_type(type)) {
case PTR_TO_CTX:
case PTR_TO_SOCKET:
case PTR_TO_SOCK_COMMON:
case PTR_TO_TCP_SOCK:
case PTR_TO_XDP_SOCK:
case PTR_TO_BTF_ID:
return false;
default:
return true;
}
} | static bool reg_type_mismatch_ok(enum bpf_reg_type type) {
switch (type) {
case PTR_TO_CTX:
case PTR_TO_SOCKET:
case PTR_TO_SOCKET_OR_NULL:
case PTR_TO_SOCK_COMMON:
case PTR_TO_SOCK_COMMON_OR_NULL:
case PTR_TO_TCP_SOCK:
case PTR_TO_TCP_SOCK_OR_NULL:
case PTR_TO_XDP_SOCK:
case PTR... | static bool reg_type_mismatch_ok(enum bpf_reg_type type) {
switch (base_type(type)) {
case PTR_TO_CTX:
case PTR_TO_SOCKET:
case PTR_TO_SOCK_COMMON:
case PTR_TO_TCP_SOCK:
case PTR_TO_XDP_SOCK:
case PTR_TO_BTF_ID:
return false;
default:
return true;
}
} | static bool reg_type_mismatch_ok(enum bpf_reg_type type) {
switch (type) {
case PTR_TO_SOCKET_OR_NULL:
case PTR_TO_SOCK_COMMON_OR_NULL:
case PTR_TO_TCP_SOCK_OR_NULL:
case PTR_TO_BTF_ID:
case PTR_TO_BTF_ID_OR_NULL:
return false;
default:
return true;
}
}
| static bool reg_type_mismatch_ok(enum bpf_reg_type type) {
switch (base_type(type)) {
case PTR_TO_BTF_ID:
return false;
default:
return true;
}
}
| static bool reg_type_mismatch_ok(enum bpf_reg_type type) {
switch (type) {
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
case PTR_TO_SOCKET_OR_NULL:
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
case PTR_TO_SOCK_COMMON_OR_NULL:
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
case PTR_TO_TCP_SO... | static bool reg_type_mismatch_ok(enum bpf_reg_type type) {
switch (base_type(type)) {
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
case PTR_TO_BTF_ID:
... | static bool reg_type_mismatch_ok(enum bpf_reg_type type) {
- switch (type) {
- case PTR_TO_SOCKET_OR_NULL:
- case PTR_TO_SOCK_COMMON_OR_NULL:
- case PTR_TO_TCP_SOCK_OR_NULL:
+ switch (base_type(type)) {
case PTR_TO_BTF_ID:
- case PTR_TO_BTF_ID_OR_NULL:
return false;
default:
... |
CVE-2022-23222 | linux | https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux | kernel/bpf/verifier.c | regsafe | static bool regsafe(struct bpf_verifier_env *env, struct bpf_reg_state *rold, struct bpf_reg_state *rcur, struct bpf_id_pair *idmap) {
bool equal;
if (!(rold->live & REG_LIVE_READ)) {
return true;
}
equal = memcmp(rold, rcur, offsetof(struct bpf_reg_state, parent)) == 0;
if (rold->type == PT... | static bool regsafe(struct bpf_verifier_env *env, struct bpf_reg_state *rold, struct bpf_reg_state *rcur, struct bpf_id_pair *idmap) {
bool equal;
if (!(rold->live & REG_LIVE_READ)) {
return true;
}
equal = memcmp(rold, rcur, offsetof(struct bpf_reg_state, parent)) == 0;
if (rold->type == PT... | static bool regsafe(struct bpf_verifier_env *env, struct bpf_reg_state *rold, struct bpf_reg_state *rcur, struct bpf_id_pair *idmap) {
bool equal;
if (!(rold->live & REG_LIVE_READ)) {
return true;
}
equal = memcmp(rold, rcur, offsetof(struct bpf_reg_state, parent)) == 0;
if (rold->type == PT... | static bool regsafe(struct bpf_verifier_env *env, struct bpf_reg_state *rold, struct bpf_reg_state *rcur, struct bpf_id_pair *idmap) {
bool equal;
if (!(rold->live & REG_LIVE_READ)) {
return true;
}
equal = memcmp(rold, rcur, offsetof(struct bpf_reg_state, parent)) == 0;
if (rold->type == PT... | static bool regsafe(struct bpf_verifier_env *env, struct bpf_reg_state *rold, struct bpf_reg_state *rcur, struct bpf_id_pair *idmap) {
if (rold->type == PTR_TO_STACK) {
return equal && rold->frameno == rcur->frameno;
}
if (rold->type == NOT_IT) {
return true;
}
if (rcur->type == NOT_... | static bool regsafe(struct bpf_verifier_env *env, struct bpf_reg_state *rold, struct bpf_reg_state *rcur, struct bpf_id_pair *idmap) {
if (rold->type == PTR_TO_STACK) {
return equal && rold->frameno == rcur->frameno;
}
if (rold->type == NOT_IT) {
return true;
}
if (rcur->type == NOT_... | static bool regsafe(struct bpf_verifier_env *env, struct bpf_reg_state *rold, struct bpf_reg_state *rcur, struct bpf_id_pair *idmap) {
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
if (rold->type == PTR_TO_STACK) {
return equal && rold->frameno == rcur->frameno;
}
/* PLACEHOLDER: DO NOT DELETE T... | static bool regsafe(struct bpf_verifier_env *env, struct bpf_reg_state *rold, struct bpf_reg_state *rcur, struct bpf_id_pair *idmap) {
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
if (rold->type == PTR_TO_STACK) {
return equal && rold->frameno == rcur->frameno;
}
/* PLACEHOLDER: DO NOT DELETE T... | static bool regsafe(struct bpf_verifier_env *env, struct bpf_reg_state *rold, struct bpf_reg_state *rcur, struct bpf_id_pair *idmap) {
if (rold->type == PTR_TO_STACK) {
return equal && rold->frameno == rcur->frameno;
}
if (rold->type == NOT_IT) {
return true;
}
if (rcur->type... |
CVE-2022-2380 | linux | https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux | drivers/video/fbdev/sm712fb.c | smtcfb_read | static ssize_t smtcfb_read(struct fb_info *info, char *buf, size_t count, loff_t *ppos) {
unsigned long p = *ppos;
u32 *buffer, *dst;
u32 __iomem *src;
int c, i, cnt = 0, err = 0;
unsigned long total_size;
if (!info || !info->screen_base) {
return -ENODEV;
}
if (info->state != FB... | static ssize_t smtcfb_read(struct fb_info *info, char *buf, size_t count, loff_t *ppos) {
unsigned long p = *ppos;
u32 *buffer, *dst;
u32 __iomem *src;
int c, i, cnt = 0, err = 0;
unsigned long total_size;
if (!info || !info->screen_base) {
return -ENODEV;
}
if (info->state != FB... | static ssize_t smtcfb_read(struct fb_info *info, char *buf, size_t count, loff_t *ppos) {
unsigned long p = *ppos;
u32 *buffer, *dst;
u32 __iomem *src;
int c, i, cnt = 0, err = 0;
unsigned long total_size;
if (!info || !info->screen_base) {
return -ENODEV;
}
if (info->state != FB... | static ssize_t smtcfb_read(struct fb_info *info, char *buf, size_t count, loff_t *ppos) {
unsigned long p = *ppos;
u32 *buffer, *dst;
u32 __iomem *src;
int c, i, cnt = 0, err = 0;
unsigned long total_size;
if (!info || !info->screen_base) {
return -ENODEV;
}
if (info->state != FB... | static ssize_t smtcfb_read(struct fb_info *info, char *buf, size_t count, loff_t *ppos) {
unsigned long p = *ppos;
if (!info || !info->screen_base) {
return -ENODEV;
}
total_size = info->screen_size;
if (total_size == 0) {
total_size = info->fix.smem_len;
}
if (p >= total_siz... | static ssize_t smtcfb_read(struct fb_info *info, char *buf, size_t count, loff_t *ppos) {
unsigned long p = *ppos;
if (!info || !info->screen_base) {
return -ENODEV;
}
total_size = info->screen_size;
if (total_size == 0) {
total_size = info->fix.smem_len;
}
if (p >= total_siz... | static ssize_t smtcfb_read(struct fb_info *info, char *buf, size_t count, loff_t *ppos) {
unsigned long p = *ppos;
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
if (!info || !info->screen_base) {
return -ENODEV;
}
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
total_size = info->screen_si... | static ssize_t smtcfb_read(struct fb_info *info, char *buf, size_t count, loff_t *ppos) {
unsigned long p = *ppos;
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
if (!info || !info->screen_base) {
return -ENODEV;
}
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
total_size = info->screen_si... | static ssize_t smtcfb_read(struct fb_info *info, char *buf, size_t count, loff_t *ppos) {
unsigned long p = *ppos;
if (!info || !info->screen_base) {
return -ENODEV;
}
total_size = info->screen_size;
if (total_size == 0) {
total_size = info->fix.smem_len;
}
if (p >=... |
CVE-2022-23816 | linux | https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux | arch/x86/kvm/x86.c | kvm_arch_has_assigned_device | bool kvm_arch_has_assigned_device(struct kvm *kvm) {
return atomic_read(&kvm->arch.assigned_device_count);
} | bool noinstr kvm_arch_has_assigned_device(struct kvm *kvm) {
return arch_atomic_read(&kvm->arch.assigned_device_count);
} | bool kvm_arch_has_assigned_device(struct kvm *kvm) {
return atomic_read(&kvm->arch.assigned_device_count);
} | bool noinstr kvm_arch_has_assigned_device(struct kvm *kvm) {
return arch_atomic_read(&kvm->arch.assigned_device_count);
} | bool kvm_arch_has_assigned_device(struct kvm *kvm) {
return atomic_read(&kvm->arch.assigned_device_count);
}
| bool noinstr kvm_arch_has_assigned_device(struct kvm *kvm) {
return arch_atomic_read(&kvm->arch.assigned_device_count);
}
| bool kvm_arch_has_assigned_device(struct kvm *kvm) {
return atomic_read(&kvm->arch.assigned_device_count);
}
| bool noinstr kvm_arch_has_assigned_device(struct kvm *kvm) {
return arch_atomic_read(&kvm->arch.assigned_device_count);
} | -bool kvm_arch_has_assigned_device(struct kvm *kvm) {
- return atomic_read(&kvm->arch.assigned_device_count);
+bool noinstr kvm_arch_has_assigned_device(struct kvm *kvm) {
+ return arch_atomic_read(&kvm->arch.assigned_device_count);
} |
CVE-2022-23960 | linux | https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux | arch/arm/mm/proc-v7-bugs.c | cpu_v7_bugs_init | void cpu_v7_bugs_init(void) {
cpu_v7_spectre_init();
} | void cpu_v7_bugs_init(void) {
cpu_v7_spectre_v2_init();
} | void cpu_v7_bugs_init(void) {
cpu_v7_spectre_init();
} | void cpu_v7_bugs_init(void) {
cpu_v7_spectre_v2_init();
} | void cpu_v7_bugs_init(void) {
cpu_v7_spectre_init();
}
| void cpu_v7_bugs_init(void) {
cpu_v7_spectre_v2_init();
}
| void cpu_v7_bugs_init(void) {
cpu_v7_spectre_init();
}
| void cpu_v7_bugs_init(void) {
cpu_v7_spectre_v2_init();
} | void cpu_v7_bugs_init(void) {
- cpu_v7_spectre_init();
+ cpu_v7_spectre_v2_init();
} |
CVE-2022-23960 | linux | https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux | arch/arm/mm/proc-v7-bugs.c | cpu_v7_ca15_ibe | void cpu_v7_ca15_ibe(void) {
if (check_spectre_auxcr(this_cpu_ptr(&spectre_warned), BIT(0))) {
cpu_v7_spectre_init();
}
} | void cpu_v7_ca15_ibe(void) {
if (check_spectre_auxcr(this_cpu_ptr(&spectre_warned), BIT(0))) {
cpu_v7_spectre_v2_init();
}
} | void cpu_v7_ca15_ibe(void) {
if (check_spectre_auxcr(this_cpu_ptr(&spectre_warned), BIT(0))) {
cpu_v7_spectre_init();
}
} | void cpu_v7_ca15_ibe(void) {
if (check_spectre_auxcr(this_cpu_ptr(&spectre_warned), BIT(0))) {
cpu_v7_spectre_v2_init();
}
} | void cpu_v7_ca15_ibe(void) {
if (check_spectre_auxcr(this_cpu_ptr(&spectre_warned), BIT(0))) {
cpu_v7_spectre_init();
}
}
| void cpu_v7_ca15_ibe(void) {
if (check_spectre_auxcr(this_cpu_ptr(&spectre_warned), BIT(0))) {
cpu_v7_spectre_v2_init();
}
}
| void cpu_v7_ca15_ibe(void) {
if (check_spectre_auxcr(this_cpu_ptr(&spectre_warned), BIT(0))) {
cpu_v7_spectre_init();
}
}
| void cpu_v7_ca15_ibe(void) {
if (check_spectre_auxcr(this_cpu_ptr(&spectre_warned), BIT(0))) {
cpu_v7_spectre_v2_init();
}
} | void cpu_v7_ca15_ibe(void) {
if (check_spectre_auxcr(this_cpu_ptr(&spectre_warned), BIT(0))) {
- cpu_v7_spectre_init();
+ cpu_v7_spectre_v2_init();
}
} |
CVE-2022-23960 | linux | https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux | arch/arm/mm/proc-v7-bugs.c | cpu_v7_ca8_ibe | void cpu_v7_ca8_ibe(void) {
if (check_spectre_auxcr(this_cpu_ptr(&spectre_warned), BIT(6))) {
cpu_v7_spectre_init();
}
} | void cpu_v7_ca8_ibe(void) {
if (check_spectre_auxcr(this_cpu_ptr(&spectre_warned), BIT(6))) {
cpu_v7_spectre_v2_init();
}
} | void cpu_v7_ca8_ibe(void) {
if (check_spectre_auxcr(this_cpu_ptr(&spectre_warned), BIT(6))) {
cpu_v7_spectre_init();
}
} | void cpu_v7_ca8_ibe(void) {
if (check_spectre_auxcr(this_cpu_ptr(&spectre_warned), BIT(6))) {
cpu_v7_spectre_v2_init();
}
} | void cpu_v7_ca8_ibe(void) {
if (check_spectre_auxcr(this_cpu_ptr(&spectre_warned), BIT(6))) {
cpu_v7_spectre_init();
}
}
| void cpu_v7_ca8_ibe(void) {
if (check_spectre_auxcr(this_cpu_ptr(&spectre_warned), BIT(6))) {
cpu_v7_spectre_v2_init();
}
}
| void cpu_v7_ca8_ibe(void) {
if (check_spectre_auxcr(this_cpu_ptr(&spectre_warned), BIT(6))) {
cpu_v7_spectre_init();
}
}
| void cpu_v7_ca8_ibe(void) {
if (check_spectre_auxcr(this_cpu_ptr(&spectre_warned), BIT(6))) {
cpu_v7_spectre_v2_init();
}
} | void cpu_v7_ca8_ibe(void) {
if (check_spectre_auxcr(this_cpu_ptr(&spectre_warned), BIT(6))) {
- cpu_v7_spectre_init();
+ cpu_v7_spectre_v2_init();
}
} |
CVE-2022-24448 | linux | https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux | fs/nfs/dir.c | nfs_atomic_open | int nfs_atomic_open(struct inode *dir, struct dentry *dentry, struct file *file, unsigned open_flags, umode_t mode) {
DECLARE_WAIT_QUEUE_HEAD_ONSTACK(wq);
struct nfs_open_context *ctx;
struct dentry *res;
struct iattr attr = { .ia_valid = ATTR_OPEN };
struct inode *inode;
unsigned int lookup_fla... | int nfs_atomic_open(struct inode *dir, struct dentry *dentry, struct file *file, unsigned open_flags, umode_t mode) {
DECLARE_WAIT_QUEUE_HEAD_ONSTACK(wq);
struct nfs_open_context *ctx;
struct dentry *res;
struct iattr attr = { .ia_valid = ATTR_OPEN };
struct inode *inode;
unsigned int lookup_fla... | int nfs_atomic_open(struct inode *dir, struct dentry *dentry, struct file *file, unsigned open_flags, umode_t mode) {
DECLARE_WAIT_QUEUE_HEAD_ONSTACK(wq);
struct nfs_open_context *ctx;
struct dentry *res;
struct iattr attr = { .ia_valid = ATTR_OPEN };
struct inode *inode;
unsigned int lookup_fla... | int nfs_atomic_open(struct inode *dir, struct dentry *dentry, struct file *file, unsigned open_flags, umode_t mode) {
DECLARE_WAIT_QUEUE_HEAD_ONSTACK(wq);
struct nfs_open_context *ctx;
struct dentry *res;
struct iattr attr = { .ia_valid = ATTR_OPEN };
struct inode *inode;
unsigned int lookup_fla... | int nfs_atomic_open(struct inode *dir, struct dentry *dentry, struct file *file, unsigned open_flags, umode_t mode) {
DECLARE_WAIT_QUEUE_HEAD_ONSTACK(wq);
struct iattr attr = { .ia_valid = ATTR_OPEN };
unsigned int lookup_flags = 0;
int created = 0;
BUG_ON(d_inode(dentry));
dfprintk(VFS, "NFS: a... | int nfs_atomic_open(struct inode *dir, struct dentry *dentry, struct file *file, unsigned open_flags, umode_t mode) {
DECLARE_WAIT_QUEUE_HEAD_ONSTACK(wq);
struct iattr attr = { .ia_valid = ATTR_OPEN };
unsigned int lookup_flags = 0;
int created = 0;
BUG_ON(d_inode(dentry));
dfprintk(VFS, "NFS: a... | int nfs_atomic_open(struct inode *dir, struct dentry *dentry, struct file *file, unsigned open_flags, umode_t mode) {
DECLARE_WAIT_QUEUE_HEAD_ONSTACK(wq);
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
struct iattr attr = { .ia_valid = ATTR_OPEN };
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
unsign... | int nfs_atomic_open(struct inode *dir, struct dentry *dentry, struct file *file, unsigned open_flags, umode_t mode) {
DECLARE_WAIT_QUEUE_HEAD_ONSTACK(wq);
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
struct iattr attr = { .ia_valid = ATTR_OPEN };
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
unsign... | int nfs_atomic_open(struct inode *dir, struct dentry *dentry, struct file *file, unsigned open_flags, umode_t mode) {
DECLARE_WAIT_QUEUE_HEAD_ONSTACK(wq);
struct iattr attr = { .ia_valid = ATTR_OPEN };
unsigned int lookup_flags = 0;
int created = 0;
BUG_ON(d_inode(dentry));
dfprintk(VFS, ... |
CVE-2022-24958 | linux | https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux | drivers/usb/gadget/legacy/inode.c | dev_config | static ssize_t dev_config (struct file *fd, const char *buf, size_t len, loff_t *ptr) {
struct dev_data *dev = fd->private_data;
ssize_t value, length = len;
unsigned total;
u32 tag;
char *kbuf;
spin_lock_irq(&dev->lock);
if (dev->state > STATE_DEV_OPENED) {
value = ep0_write(fd, buf... | static ssize_t dev_config (struct file *fd, const char *buf, size_t len, loff_t *ptr) {
struct dev_data *dev = fd->private_data;
ssize_t value, length = len;
unsigned total;
u32 tag;
char *kbuf;
spin_lock_irq(&dev->lock);
if (dev->state > STATE_DEV_OPENED) {
value = ep0_write(fd, buf... | static ssize_t dev_config (struct file *fd, const char *buf, size_t len, loff_t *ptr) {
struct dev_data *dev = fd->private_data;
ssize_t value, length = len;
unsigned total;
u32 tag;
char *kbuf;
spin_lock_irq(&dev->lock);
if (dev->state > STATE_DEV_OPENED) {
value = ep0_write(fd, buf... | static ssize_t dev_config (struct file *fd, const char *buf, size_t len, loff_t *ptr) {
struct dev_data *dev = fd->private_data;
ssize_t value, length = len;
unsigned total;
u32 tag;
char *kbuf;
spin_lock_irq(&dev->lock);
if (dev->state > STATE_DEV_OPENED) {
value = ep0_write(fd, buf... | static ssize_t dev_config (struct file *fd, const char *buf, size_t len, loff_t *ptr) {
struct dev_data *dev = fd->private_data;
value = -EVAL;
if (dev->buf) {
kfree(kbuf);
goto fail;
}
fail:
spin_unlock_irq (&dev->lock);
}
| static ssize_t dev_config (struct file *fd, const char *buf, size_t len, loff_t *ptr) {
struct dev_data *dev = fd->private_data;
value = -EVAL;
if (dev->buf) {
spin_unlock_irq(&dev->lock);
kfree(kbuf);
return value;
}
fail:
spin_unlock_irq (&dev->lock);
}
| static ssize_t dev_config (struct file *fd, const char *buf, size_t len, loff_t *ptr) {
struct dev_data *dev = fd->private_data;
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
value = -EVAL;
if (dev->buf) {
kfree(kbuf);
goto fail;
}
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
fa... | static ssize_t dev_config (struct file *fd, const char *buf, size_t len, loff_t *ptr) {
struct dev_data *dev = fd->private_data;
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
value = -EVAL;
if (dev->buf) {
spin_unlock_irq(&dev->lock);
kfree(kbuf);
return value;
}
/* PLACE... | static ssize_t dev_config (struct file *fd, const char *buf, size_t len, loff_t *ptr) {
struct dev_data *dev = fd->private_data;
value = -EVAL;
if (dev->buf) {
+ spin_unlock_irq(&dev->lock);
kfree(kbuf);
- goto fail;
+ return value;
}
fail:
spin_unlock_irq (&dev-... |
CVE-2022-24959 | linux | https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux | drivers/net/hamradio/yam.c | yam_ioctl | static int yam_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) {
struct yam_port *yp = netdev_priv(dev);
struct yamdrv_ioctl_cfg yi;
struct yamdrv_ioctl_mcs *ym;
int ioctl_cmd;
if (copy_from_user(&ioctl_cmd, ifr->ifr_data, sizeof(int))) {
return -EFAULT;
}
if (yp->magic != ... | static int yam_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) {
struct yam_port *yp = netdev_priv(dev);
struct yamdrv_ioctl_cfg yi;
struct yamdrv_ioctl_mcs *ym;
int ioctl_cmd;
if (copy_from_user(&ioctl_cmd, ifr->ifr_data, sizeof(int))) {
return -EFAULT;
}
if (yp->magic != ... | static int yam_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) {
struct yam_port *yp = netdev_priv(dev);
struct yamdrv_ioctl_cfg yi;
struct yamdrv_ioctl_mcs *ym;
int ioctl_cmd;
if (copy_from_user(&ioctl_cmd, ifr->ifr_data, sizeof(int))) {
return -EFAULT;
}
if (yp->magic != ... | static int yam_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) {
struct yam_port *yp = netdev_priv(dev);
struct yamdrv_ioctl_cfg yi;
struct yamdrv_ioctl_mcs *ym;
int ioctl_cmd;
if (copy_from_user(&ioctl_cmd, ifr->ifr_data, sizeof(int))) {
return -EFAULT;
}
if (yp->magic != ... | static int yam_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) {
if (copy_from_user(&ioctl_cmd, ifr->ifr_data, sizeof(int))) {
return -EFAULT;
}
switch (ioctl_cmd) {
case SIOCYAMSMCS:
ym = memdup_user(ifr->ifr_data, sizeof(struct yamdrv_ioctl_mcs));
if (IS_ERR(ym)) {
... | static int yam_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) {
if (copy_from_user(&ioctl_cmd, ifr->ifr_data, sizeof(int))) {
return -EFAULT;
}
switch (ioctl_cmd) {
case SIOCYAMSMCS:
ym = memdup_user(ifr->ifr_data, sizeof(struct yamdrv_ioctl_mcs));
if (IS_ERR(ym)) {
... | static int yam_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) {
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
if (copy_from_user(&ioctl_cmd, ifr->ifr_data, sizeof(int))) {
return -EFAULT;
}
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
switch (ioctl_cmd) {
/* PLACEHOLDER: DO N... | static int yam_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) {
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
if (copy_from_user(&ioctl_cmd, ifr->ifr_data, sizeof(int))) {
return -EFAULT;
}
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
switch (ioctl_cmd) {
/* PLACEHOLDER: DO N... | static int yam_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) {
if (copy_from_user(&ioctl_cmd, ifr->ifr_data, sizeof(int))) {
return -EFAULT;
}
switch (ioctl_cmd) {
case SIOCYAMSMCS:
ym = memdup_user(ifr->ifr_data, sizeof(struct yamdrv_ioctl_mcs));
if (IS_ERR(y... |
CVE-2022-25258 | linux | https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux | drivers/usb/gadget/composite.c | composite_setup | int composite_setup(struct usb_gadget *gadget, const struct usb_ctrlrequest *ctrl) {
struct usb_composite_dev *cdev = get_gadget_data(gadget);
struct usb_request *req = cdev->req;
int value = -EOPNOTSUPP;
int status = 0;
u16 w_index = le16_to_cpu(ctrl->wIndex);
u8 intf = w_index & 0xFF;
u16 ... | int composite_setup(struct usb_gadget *gadget, const struct usb_ctrlrequest *ctrl) {
struct usb_composite_dev *cdev = get_gadget_data(gadget);
struct usb_request *req = cdev->req;
int value = -EOPNOTSUPP;
int status = 0;
u16 w_index = le16_to_cpu(ctrl->wIndex);
u8 intf = w_index & 0xFF;
u16 ... | int composite_setup(struct usb_gadget *gadget, const struct usb_ctrlrequest *ctrl) {
struct usb_composite_dev *cdev = get_gadget_data(gadget);
struct usb_request *req = cdev->req;
int value = -EOPNOTSUPP;
int status = 0;
u16 w_index = le16_to_cpu(ctrl->wIndex);
u8 intf = w_index & 0xFF;
u16 ... | int composite_setup(struct usb_gadget *gadget, const struct usb_ctrlrequest *ctrl) {
struct usb_composite_dev *cdev = get_gadget_data(gadget);
struct usb_request *req = cdev->req;
int value = -EOPNOTSUPP;
int status = 0;
u16 w_index = le16_to_cpu(ctrl->wIndex);
u8 intf = w_index & 0xFF;
u16 ... | int composite_setup(struct usb_gadget *gadget, const struct usb_ctrlrequest *ctrl) {
struct usb_composite_dev *cdev = get_gadget_data(gadget);
u16 w_index = le16_to_cpu(ctrl->wIndex);
u8 intf = w_index & 0xFF;
u16 w_value = le16_to_cpu(ctrl->wValue);
switch (ctrl->bRequest) {
case USB_REQ_GET_ST... | int composite_setup(struct usb_gadget *gadget, const struct usb_ctrlrequest *ctrl) {
struct usb_composite_dev *cdev = get_gadget_data(gadget);
u16 w_index = le16_to_cpu(ctrl->wIndex);
u8 intf = w_index & 0xFF;
u16 w_value = le16_to_cpu(ctrl->wValue);
switch (ctrl->bRequest) {
case USB_REQ_GET_ST... | int composite_setup(struct usb_gadget *gadget, const struct usb_ctrlrequest *ctrl) {
struct usb_composite_dev *cdev = get_gadget_data(gadget);
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
u16 w_index = le16_to_cpu(ctrl->wIndex);
u8 intf = w_index & 0xFF;
u16 w_value = le16_to_cpu(ctrl->wValue);
... | int composite_setup(struct usb_gadget *gadget, const struct usb_ctrlrequest *ctrl) {
struct usb_composite_dev *cdev = get_gadget_data(gadget);
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
u16 w_index = le16_to_cpu(ctrl->wIndex);
u8 intf = w_index & 0xFF;
u16 w_value = le16_to_cpu(ctrl->wValue);
... | int composite_setup(struct usb_gadget *gadget, const struct usb_ctrlrequest *ctrl) {
struct usb_composite_dev *cdev = get_gadget_data(gadget);
u16 w_index = le16_to_cpu(ctrl->wIndex);
u8 intf = w_index & 0xFF;
u16 w_value = le16_to_cpu(ctrl->wValue);
switch (ctrl->bRequest) {
case USB_REQ... |
CVE-2022-25375 | linux | https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux | drivers/usb/gadget/function/rndis.c | rndis_set_response | static int rndis_set_response(struct rndis_params *params, rndis_set_msg_type *buf) {
u32 BufLength, BufOffset;
rndis_set_cmplt_type *resp;
rndis_resp_t *r;
r = rndis_add_response(params, sizeof(rndis_set_cmplt_type));
if (!r) {
return -ENOMEM;
}
resp = (rndis_set_cmplt_type *)r->buf... | static int rndis_set_response(struct rndis_params *params, rndis_set_msg_type *buf) {
u32 BufLength, BufOffset;
rndis_set_cmplt_type *resp;
rndis_resp_t *r;
BufLength = le32_to_cpu(buf->InformationBufferLength);
BufOffset = le32_to_cpu(buf->InformationBufferOffset);
if ((BufLength > RNDIS_MAX_TO... | static int rndis_set_response(struct rndis_params *params, rndis_set_msg_type *buf) {
u32 BufLength, BufOffset;
rndis_set_cmplt_type *resp;
rndis_resp_t *r;
r = rndis_add_response(params, sizeof(rndis_set_cmplt_type));
if (!r) {
return -ENOMEM;
}
resp = (rndis_set_cmplt_type *)r->buf... | static int rndis_set_response(struct rndis_params *params, rndis_set_msg_type *buf) {
u32 BufLength, BufOffset;
rndis_set_cmplt_type *resp;
rndis_resp_t *r;
BufLength = le32_to_cpu(buf->InformationBufferLength);
BufOffset = le32_to_cpu(buf->InformationBufferOffset);
if ((BufLength > RNDIS_MAX_TO... | static int rndis_set_response(struct rndis_params *params, rndis_set_msg_type *buf) {
rndis_resp_t *r;
r = rndis_add_response(params, sizeof(rndis_set_cmplt_type));
resp = (rndis_set_cmplt_type *)r->buf;
BufLength = le32_to_cpu(buf->InformationBufferLength);
BufOffset = le32_to_cpu(buf->InformationB... | static int rndis_set_response(struct rndis_params *params, rndis_set_msg_type *buf) {
rndis_resp_t *r;
BufLength = le32_to_cpu(buf->InformationBufferLength);
BufOffset = le32_to_cpu(buf->InformationBufferOffset);
if ((BufLength > RNDIS_MAX_TOTAL_SIZE) || (BufOffset + 8 >= RNDIS_MAX_TOTAL_SIZE)) {
... | static int rndis_set_response(struct rndis_params *params, rndis_set_msg_type *buf) {
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
rndis_resp_t *r;
r = rndis_add_response(params, sizeof(rndis_set_cmplt_type));
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
resp = (rndis_set_cmplt_type *)r->buf;
... | static int rndis_set_response(struct rndis_params *params, rndis_set_msg_type *buf) {
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
rndis_resp_t *r;
BufLength = le32_to_cpu(buf->InformationBufferLength);
BufOffset = le32_to_cpu(buf->InformationBufferOffset);
if ((BufLength > RNDIS_MAX_TOTAL_SIZE) ||... | static int rndis_set_response(struct rndis_params *params, rndis_set_msg_type *buf) {
rndis_resp_t *r;
+ BufLength = le32_to_cpu(buf->InformationBufferLength);
+ BufOffset = le32_to_cpu(buf->InformationBufferOffset);
+ if ((BufLength > RNDIS_MAX_TOTAL_SIZE) || (BufOffset + 8 >= RNDIS_MAX_TOTAL_SIZE)) {
+... |
CVE-2022-25636 | linux | https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux | net/netfilter/nf_tables_offload.c | nft_flow_rule_create | struct nft_flow_rule *nft_flow_rule_create(struct net *net, const struct nft_rule *rule) {
struct nft_offload_ctx *ctx;
struct nft_flow_rule *flow;
int num_actions = 0, err;
struct nft_expr *expr;
expr = nft_expr_first(rule);
while (nft_expr_more(rule, expr)) {
if (expr->ops->offload_fla... | struct nft_flow_rule *nft_flow_rule_create(struct net *net, const struct nft_rule *rule) {
struct nft_offload_ctx *ctx;
struct nft_flow_rule *flow;
int num_actions = 0, err;
struct nft_expr *expr;
expr = nft_expr_first(rule);
while (nft_expr_more(rule, expr)) {
if (expr->ops->offload_act... | struct nft_flow_rule *nft_flow_rule_create(struct net *net, const struct nft_rule *rule) {
struct nft_offload_ctx *ctx;
struct nft_flow_rule *flow;
int num_actions = 0, err;
struct nft_expr *expr;
expr = nft_expr_first(rule);
while (nft_expr_more(rule, expr)) {
if (expr->ops->offload_fla... | struct nft_flow_rule *nft_flow_rule_create(struct net *net, const struct nft_rule *rule) {
struct nft_offload_ctx *ctx;
struct nft_flow_rule *flow;
int num_actions = 0, err;
struct nft_expr *expr;
expr = nft_expr_first(rule);
while (nft_expr_more(rule, expr)) {
if (expr->ops->offload_act... | struct nft_flow_rule *nft_flow_rule_create(struct net *net, const struct nft_rule *rule) {
expr = nft_expr_first(rule);
while (nft_expr_more(rule, expr)) {
if (expr->ops->offload_flags & NFT_OFFLOAD_F_ACTION) {
num_actions++;
}
expr = nft_expr_next(expr);
}
}
| struct nft_flow_rule *nft_flow_rule_create(struct net *net, const struct nft_rule *rule) {
expr = nft_expr_first(rule);
while (nft_expr_more(rule, expr)) {
if (expr->ops->offload_action && expr->ops->offload_action(expr)) {
num_actions++;
}
expr = nft_expr_next(expr);
}
}... | struct nft_flow_rule *nft_flow_rule_create(struct net *net, const struct nft_rule *rule) {
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
expr = nft_expr_first(rule);
while (nft_expr_more(rule, expr)) {
if (expr->ops->offload_flags & NFT_OFFLOAD_F_ACTION) {
num_actions++;
}
... | struct nft_flow_rule *nft_flow_rule_create(struct net *net, const struct nft_rule *rule) {
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
expr = nft_expr_first(rule);
while (nft_expr_more(rule, expr)) {
if (expr->ops->offload_action && expr->ops->offload_action(expr)) {
num_actions++;
... | struct nft_flow_rule *nft_flow_rule_create(struct net *net, const struct nft_rule *rule) {
expr = nft_expr_first(rule);
while (nft_expr_more(rule, expr)) {
- if (expr->ops->offload_flags & NFT_OFFLOAD_F_ACTION) {
+ if (expr->ops->offload_action && expr->ops->offload_action(expr)) {
... |
CVE-2022-2585 | linux | https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux | fs/exec.c | begin_new_exec | int begin_new_exec(struct linux_binprm * bprm) {
struct task_struct *me = current;
int retval;
retval = bprm_creds_from_file(bprm);
if (retval) {
return retval;
}
bprm->point_of_no_return = true;
retval = de_thread(me);
if (retval) {
goto out;
}
io_uring_task_canc... | int begin_new_exec(struct linux_binprm * bprm) {
struct task_struct *me = current;
int retval;
retval = bprm_creds_from_file(bprm);
if (retval) {
return retval;
}
bprm->point_of_no_return = true;
retval = de_thread(me);
if (retval) {
goto out;
}
io_uring_task_canc... | int begin_new_exec(struct linux_binprm * bprm) {
struct task_struct *me = current;
int retval;
retval = bprm_creds_from_file(bprm);
if (retval) {
return retval;
}
bprm->point_of_no_return = true;
retval = de_thread(me);
if (retval) {
goto out;
}
set_mm_exe_file(bp... | int begin_new_exec(struct linux_binprm * bprm) {
struct task_struct *me = current;
int retval;
retval = bprm_creds_from_file(bprm);
if (retval) {
return retval;
}
bprm->point_of_no_return = true;
retval = de_thread(me);
if (retval) {
goto out;
}
set_mm_exe_file(bp... | int begin_new_exec(struct linux_binprm * bprm) {
struct task_struct *me = current;
retval = de_thread(me);
bprm->mm = NULL;
exit_itimers(me);
retval = unshare_sighand(me);
me->flags &= ~(PF_RANDOMIZE | PF_FORKNOEXEC | PF_KTHREAD | PF_NOFREEZE | PF_NO_SETAFFITY);
me->personality &= ~bprm->per... | int begin_new_exec(struct linux_binprm * bprm) {
struct task_struct *me = current;
retval = de_thread(me);
bprm->mm = NULL;
spin_lock_irq(&me->sighand->siglock);
posix_cpu_timers_exit(me);
spin_unlock_irq(&me->sighand->siglock);
exit_itimers(me);
retval = unshare_sighand(me);
me->fla... | int begin_new_exec(struct linux_binprm * bprm) {
struct task_struct *me = current;
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
retval = de_thread(me);
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
bprm->mm = NULL;
exit_itimers(me);
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
retval =... | int begin_new_exec(struct linux_binprm * bprm) {
struct task_struct *me = current;
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
retval = de_thread(me);
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
bprm->mm = NULL;
spin_lock_irq(&me->sighand->siglock);
posix_cpu_timers_exit(me);
spin_un... | int begin_new_exec(struct linux_binprm * bprm) {
struct task_struct *me = current;
retval = de_thread(me);
bprm->mm = NULL;
+ spin_lock_irq(&me->sighand->siglock);
+ posix_cpu_timers_exit(me);
+ spin_unlock_irq(&me->sighand->siglock);
exit_itimers(me);
retval = unshare_sighand(me);
... |
CVE-2022-2588 | linux | https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux | net/sched/cls_route.c | route4_change | static int route4_change(struct net *net, struct sk_buff *in_skb, struct tcf_proto *tp, unsigned long base, u32 handle, struct nlattr **tca, void **arg, u32 flags, struct netlink_ext_ack *extack) {
struct route4_head *head = rtnl_dereference(tp->root);
struct route4_filter __rcu **fp;
struct route4_filter *... | static int route4_change(struct net *net, struct sk_buff *in_skb, struct tcf_proto *tp, unsigned long base, u32 handle, struct nlattr **tca, void **arg, u32 flags, struct netlink_ext_ack *extack) {
struct route4_head *head = rtnl_dereference(tp->root);
struct route4_filter __rcu **fp;
struct route4_filter *... | static int route4_change(struct net *net, struct sk_buff *in_skb, struct tcf_proto *tp, unsigned long base, u32 handle, struct nlattr **tca, void **arg, bool ovr, bool rtnl_held,
struct netlink_ext_ack *extack) {
struct route4_head *head = rtnl_dereference(tp->root);
struct route4_filte... | static int route4_change(struct net *net, struct sk_buff *in_skb, struct tcf_proto *tp, unsigned long base, u32 handle, struct nlattr **tca, void **arg, bool ovr, bool rtnl_held,
struct netlink_ext_ack *extack) {
struct route4_head *head = rtnl_dereference(tp->root);
struct route4_filte... | static int route4_change(struct net *net, struct sk_buff *in_skb, struct tcf_proto *tp, unsigned long base, u32 handle, struct nlattr **tca, void **arg, u32 flags, struct netlink_ext_ack *extack) {
struct route4_head *head = rtnl_dereference(tp->root);
struct nlattr *opt = tca[TCA_OPTIONS];
bool new = true;... | static int route4_change(struct net *net, struct sk_buff *in_skb, struct tcf_proto *tp, unsigned long base, u32 handle, struct nlattr **tca, void **arg, u32 flags, struct netlink_ext_ack *extack) {
struct route4_head *head = rtnl_dereference(tp->root);
struct nlattr *opt = tca[TCA_OPTIONS];
bool new = true;... | static int route4_change(struct net *net, struct sk_buff *in_skb, struct tcf_proto *tp, unsigned long base, u32 handle, struct nlattr **tca, void **arg, bool ovr, bool rtnl_held,
struct netlink_ext_ack *extack) {
struct route4_head *head = rtnl_dereference(tp->root);
/* PLACEHOLDER: DO ... | static int route4_change(struct net *net, struct sk_buff *in_skb, struct tcf_proto *tp, unsigned long base, u32 handle, struct nlattr **tca, void **arg, bool ovr, bool rtnl_held,
struct netlink_ext_ack *extack) {
struct route4_head *head = rtnl_dereference(tp->root);
/* PLACEHOLDER: DO ... | static int route4_change(struct net *net, struct sk_buff *in_skb, struct tcf_proto *tp, unsigned long base, u32 handle, struct nlattr **tca, void **arg, u32 flags, struct netlink_ext_ack *extack) {
struct route4_head *head = rtnl_dereference(tp->root);
struct nlattr *opt = tca[TCA_OPTIONS];
bool new = t... |
CVE-2022-26365 | linux | https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux | drivers/block/xen-blkfront.c | blkfront_setup_indirect | static int blkfront_setup_indirect(struct blkfront_ring_info *rinfo) {
unsigned int psegs, grants;
int err, i;
struct blkfront_info *info = rinfo->dev_info;
if (info->max_indirect_segments == 0) {
if (!HAS_EXTRA_REQ) {
grants = BLKIF_MAX_SEGMENTS_PER_REQUEST;
} else {
... | static int blkfront_setup_indirect(struct blkfront_ring_info *rinfo) {
unsigned int psegs, grants;
int err, i;
struct blkfront_info *info = rinfo->dev_info;
if (info->max_indirect_segments == 0) {
if (!HAS_EXTRA_REQ) {
grants = BLKIF_MAX_SEGMENTS_PER_REQUEST;
} else {
... | static int blkfront_setup_indirect(struct blkfront_ring_info *rinfo) {
unsigned int psegs, grants, memflags;
int err, i;
struct blkfront_info *info = rinfo->dev_info;
memflags = memalloc_noio_save();
if (info->max_indirect_segments == 0) {
if (!HAS_EXTRA_REQ) {
grants = BLKIF_MAX... | static int blkfront_setup_indirect(struct blkfront_ring_info *rinfo) {
unsigned int psegs, grants, memflags;
int err, i;
struct blkfront_info *info = rinfo->dev_info;
memflags = memalloc_noio_save();
if (info->max_indirect_segments == 0) {
if (!HAS_EXTRA_REQ) {
grants = BLKIF_MAX... | static int blkfront_setup_indirect(struct blkfront_ring_info *rinfo) {
if (!info->feature_persistent && info->max_indirect_segments) {
for (i = 0; i < num; i++) {
struct page *indirect_page = alloc_page(GFP_NOIO);
if (!indirect_page) {
goto out_of_memory;
... | static int blkfront_setup_indirect(struct blkfront_ring_info *rinfo) {
if (!info->feature_persistent && info->max_indirect_segments) {
for (i = 0; i < num; i++) {
struct page *indirect_page = alloc_page(GFP_NOIO | __GFP_ZERO);
if (!indirect_page) {
goto out_of_memory;... | static int blkfront_setup_indirect(struct blkfront_ring_info *rinfo) {
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
if (!info->feature_persistent && info->max_indirect_segments) {
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
for (i = 0; i < num; i++) {
struct page *indirect_page = allo... | static int blkfront_setup_indirect(struct blkfront_ring_info *rinfo) {
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
if (!info->feature_persistent && info->max_indirect_segments) {
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
for (i = 0; i < num; i++) {
struct page *indirect_page = allo... | static int blkfront_setup_indirect(struct blkfront_ring_info *rinfo) {
if (!info->feature_persistent && info->max_indirect_segments) {
for (i = 0; i < num; i++) {
- struct page *indirect_page = alloc_page(GFP_NOIO);
+ struct page *indirect_page = alloc_page(GFP_NOIO | __GFP_ZERO);
... |
CVE-2022-26365 | linux | https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux | drivers/block/xen-blkfront.c | fill_grant_buffer | static int fill_grant_buffer(struct blkfront_ring_info *rinfo, int num) {
struct blkfront_info *info = rinfo->dev_info;
struct page *granted_page;
struct grant *gnt_list_entry, *n;
int i = 0;
while (i < num) {
gnt_list_entry = kzalloc(sizeof(struct grant), GFP_NOIO);
if (!gnt_list_en... | static int fill_grant_buffer(struct blkfront_ring_info *rinfo, int num) {
struct blkfront_info *info = rinfo->dev_info;
struct page *granted_page;
struct grant *gnt_list_entry, *n;
int i = 0;
while (i < num) {
gnt_list_entry = kzalloc(sizeof(struct grant), GFP_NOIO);
if (!gnt_list_en... | static int fill_grant_buffer(struct blkfront_ring_info *rinfo, int num) {
struct blkfront_info *info = rinfo->dev_info;
struct page *granted_page;
struct grant *gnt_list_entry, *n;
int i = 0;
while (i < num) {
gnt_list_entry = kzalloc(sizeof(struct grant), GFP_NOIO);
if (!gnt_list_en... | static int fill_grant_buffer(struct blkfront_ring_info *rinfo, int num) {
struct blkfront_info *info = rinfo->dev_info;
struct page *granted_page;
struct grant *gnt_list_entry, *n;
int i = 0;
while (i < num) {
gnt_list_entry = kzalloc(sizeof(struct grant), GFP_NOIO);
if (!gnt_list_en... | static int fill_grant_buffer(struct blkfront_ring_info *rinfo, int num) {
while (i < num) {
gnt_list_entry = kzalloc(sizeof(struct grant), GFP_NOIO);
if (!gnt_list_entry) {
goto out_of_memory;
}
if (info->feature_persistent) {
granted_page = alloc_page(GFP_NOI... | static int fill_grant_buffer(struct blkfront_ring_info *rinfo, int num) {
while (i < num) {
gnt_list_entry = kzalloc(sizeof(struct grant), GFP_NOIO);
if (!gnt_list_entry) {
goto out_of_memory;
}
if (info->feature_persistent) {
granted_page = alloc_page(GFP_NOI... | static int fill_grant_buffer(struct blkfront_ring_info *rinfo, int num) {
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
while (i < num) {
gnt_list_entry = kzalloc(sizeof(struct grant), GFP_NOIO);
if (!gnt_list_entry) {
goto out_of_memory;
}
if (info->feature_persisten... | static int fill_grant_buffer(struct blkfront_ring_info *rinfo, int num) {
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
while (i < num) {
gnt_list_entry = kzalloc(sizeof(struct grant), GFP_NOIO);
if (!gnt_list_entry) {
goto out_of_memory;
}
if (info->feature_persisten... | static int fill_grant_buffer(struct blkfront_ring_info *rinfo, int num) {
while (i < num) {
gnt_list_entry = kzalloc(sizeof(struct grant), GFP_NOIO);
if (!gnt_list_entry) {
goto out_of_memory;
}
if (info->feature_persistent) {
- granted_page = alloc_page... |
CVE-2022-26365 | linux | https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux | drivers/block/xen-blkfront.c | setup_blkring | static int setup_blkring(struct xenbus_device *dev, struct blkfront_ring_info *rinfo) {
struct blkif_sring *sring;
int err, i;
struct blkfront_info *info = rinfo->dev_info;
unsigned long ring_size = info->nr_ring_pages * XEN_PAGE_SIZE;
grant_ref_t gref[XENBUS_MAX_RG_GRANTS];
for (i = 0; i < info... | static int setup_blkring(struct xenbus_device *dev, struct blkfront_ring_info *rinfo) {
struct blkif_sring *sring;
int err, i;
struct blkfront_info *info = rinfo->dev_info;
unsigned long ring_size = info->nr_ring_pages * XEN_PAGE_SIZE;
grant_ref_t gref[XENBUS_MAX_RG_GRANTS];
for (i = 0; i < info... | static int setup_blkring(struct xenbus_device *dev, struct blkfront_ring_info *rinfo) {
struct blkif_sring *sring;
int err, i;
struct blkfront_info *info = rinfo->dev_info;
unsigned long ring_size = info->nr_ring_pages * XEN_PAGE_SIZE;
grant_ref_t gref[XENBUS_MAX_RG_GRANTS];
for (i = 0; i < info... | static int setup_blkring(struct xenbus_device *dev, struct blkfront_ring_info *rinfo) {
struct blkif_sring *sring;
int err, i;
struct blkfront_info *info = rinfo->dev_info;
unsigned long ring_size = info->nr_ring_pages * XEN_PAGE_SIZE;
grant_ref_t gref[XENBUS_MAX_RG_GRANTS];
for (i = 0; i < info... | static int setup_blkring(struct xenbus_device *dev, struct blkfront_ring_info *rinfo) {
struct blkfront_info *info = rinfo->dev_info;
unsigned long ring_size = info->nr_ring_pages * XEN_PAGE_SIZE;
for (i = 0; i < info->nr_ring_pages; i++)
rinfo->ring_ref[i] = GRANT_VALID_REF;
sring = alloc_pages... | static int setup_blkring(struct xenbus_device *dev, struct blkfront_ring_info *rinfo) {
struct blkfront_info *info = rinfo->dev_info;
unsigned long ring_size = info->nr_ring_pages * XEN_PAGE_SIZE;
for (i = 0; i < info->nr_ring_pages; i++)
rinfo->ring_ref[i] = GRANT_VALID_REF;
sring = alloc_pages... | static int setup_blkring(struct xenbus_device *dev, struct blkfront_ring_info *rinfo) {
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
struct blkfront_info *info = rinfo->dev_info;
unsigned long ring_size = info->nr_ring_pages * XEN_PAGE_SIZE;
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
for (i = 0;... | static int setup_blkring(struct xenbus_device *dev, struct blkfront_ring_info *rinfo) {
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
struct blkfront_info *info = rinfo->dev_info;
unsigned long ring_size = info->nr_ring_pages * XEN_PAGE_SIZE;
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
for (i = 0;... | static int setup_blkring(struct xenbus_device *dev, struct blkfront_ring_info *rinfo) {
struct blkfront_info *info = rinfo->dev_info;
unsigned long ring_size = info->nr_ring_pages * XEN_PAGE_SIZE;
for (i = 0; i < info->nr_ring_pages; i++)
rinfo->ring_ref[i] = GRANT_VALID_REF;
- sring = alloc... |
CVE-2022-26373 | linux | https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux | arch/x86/kernel/cpu/bugs.c | spectre_v2_show_state | static ssize_t spectre_v2_show_state(char *buf) {
if (spectre_v2_enabled == SPECTRE_V2_LFENCE) {
return sprintf(buf, "Vulnerable: LFENCE\n");
}
if (spectre_v2_enabled == SPECTRE_V2_EIBRS && unprivileged_ebpf_enabled()) {
return sprintf(buf, "Vulnerable: eIBRS with unprivileged eBPF\n");
... | static ssize_t spectre_v2_show_state(char *buf) {
if (spectre_v2_enabled == SPECTRE_V2_LFENCE) {
return sprintf(buf, "Vulnerable: LFENCE\n");
}
if (spectre_v2_enabled == SPECTRE_V2_EIBRS && unprivileged_ebpf_enabled()) {
return sprintf(buf, "Vulnerable: eIBRS with unprivileged eBPF\n");
... | static ssize_t spectre_v2_show_state(char *buf) {
if (spectre_v2_enabled == SPECTRE_V2_LFENCE) {
return sprintf(buf, "Vulnerable: LFENCE\n");
}
if (spectre_v2_enabled == SPECTRE_V2_EIBRS && unprivileged_ebpf_enabled()) {
return sprintf(buf, "Vulnerable: eIBRS with unprivileged eBPF\n");
... | static ssize_t spectre_v2_show_state(char *buf) {
if (spectre_v2_enabled == SPECTRE_V2_LFENCE) {
return sprintf(buf, "Vulnerable: LFENCE\n");
}
if (spectre_v2_enabled == SPECTRE_V2_EIBRS && unprivileged_ebpf_enabled()) {
return sprintf(buf, "Vulnerable: eIBRS with unprivileged eBPF\n");
... | static ssize_t spectre_v2_show_state(char *buf) {
if (sched_smt_active() && unprivileged_ebpf_enabled() && spectre_v2_enabled == SPECTRE_V2_EIBRS_LFENCE) {
return sprintf(buf, "Vulnerable: eIBRS+LFENCE with unprivileged eBPF and SMT\n");
}
return sprintf(buf, "%s%s%s%s%s%s\n", spectre_v2_strings[spe... | static ssize_t spectre_v2_show_state(char *buf) {
if (sched_smt_active() && unprivileged_ebpf_enabled() && spectre_v2_enabled == SPECTRE_V2_EIBRS_LFENCE) {
return sprintf(buf, "Vulnerable: eIBRS+LFENCE with unprivileged eBPF and SMT\n");
}
return sprintf(buf, "%s%s%s%s%s%s%s\n", spectre_v2_strings[s... | static ssize_t spectre_v2_show_state(char *buf) {
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
if (sched_smt_active() && unprivileged_ebpf_enabled() && spectre_v2_enabled == SPECTRE_V2_EIBRS_LFENCE) {
return sprintf(buf, "Vulnerable: eIBRS+LFENCE with unprivileged eBPF and SMT\n");
}
return spr... | static ssize_t spectre_v2_show_state(char *buf) {
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
if (sched_smt_active() && unprivileged_ebpf_enabled() && spectre_v2_enabled == SPECTRE_V2_EIBRS_LFENCE) {
return sprintf(buf, "Vulnerable: eIBRS+LFENCE with unprivileged eBPF and SMT\n");
}
return spr... | static ssize_t spectre_v2_show_state(char *buf) {
if (sched_smt_active() && unprivileged_ebpf_enabled() && spectre_v2_enabled == SPECTRE_V2_EIBRS_LFENCE) {
return sprintf(buf, "Vulnerable: eIBRS+LFENCE with unprivileged eBPF and SMT\n");
}
- return sprintf(buf, "%s%s%s%s%s%s\n", spectre_v2_string... |
CVE-2022-26373 | linux | https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux | arch/x86/kernel/cpu/common.c | cpu_set_bug_bits | static void cpu_set_bug_bits(struct cpuinfo_x86 *c) {
u64 ia32_cap = x86_read_arch_cap_msr();
if (!cpu_matches(cpu_vuln_whitelist, NO_ITLB_MULTIHIT) && !(ia32_cap & ARCH_CAP_PSCHANGE_MC_NO)) {
setup_force_cpu_bug(X86_BUG_ITLB_MULTIHIT);
}
if (cpu_matches(cpu_vuln_whitelist, NO_SPECULATION)) {
... | static void cpu_set_bug_bits(struct cpuinfo_x86 *c) {
u64 ia32_cap = x86_read_arch_cap_msr();
if (!cpu_matches(cpu_vuln_whitelist, NO_ITLB_MULTIHIT) && !(ia32_cap & ARCH_CAP_PSCHANGE_MC_NO)) {
setup_force_cpu_bug(X86_BUG_ITLB_MULTIHIT);
}
if (cpu_matches(cpu_vuln_whitelist, NO_SPECULATION)) {
... | static void cpu_set_bug_bits(struct cpuinfo_x86 *c) {
u64 ia32_cap = x86_read_arch_cap_msr();
if (!cpu_matches(cpu_vuln_whitelist, NO_ITLB_MULTIHIT) && !(ia32_cap & ARCH_CAP_PSCHANGE_MC_NO)) {
setup_force_cpu_bug(X86_BUG_ITLB_MULTIHIT);
}
if (cpu_matches(cpu_vuln_whitelist, NO_SPECULATION)) {
... | static void cpu_set_bug_bits(struct cpuinfo_x86 *c) {
u64 ia32_cap = x86_read_arch_cap_msr();
if (!cpu_matches(cpu_vuln_whitelist, NO_ITLB_MULTIHIT) && !(ia32_cap & ARCH_CAP_PSCHANGE_MC_NO)) {
setup_force_cpu_bug(X86_BUG_ITLB_MULTIHIT);
}
if (cpu_matches(cpu_vuln_whitelist, NO_SPECULATION)) {
... | static void cpu_set_bug_bits(struct cpuinfo_x86 *c) {
u64 ia32_cap = x86_read_arch_cap_msr();
if (cpu_matches(cpu_vuln_whitelist, NO_SPECULATION)) {
return;
}
if (ia32_cap & ARCH_CAP_IBRS_ALL) {
setup_force_cpu_cap(X86_FEATURE_IBRS_ENHANCED);
}
if (!cpu_matches(cpu_vuln_whitelist... | static void cpu_set_bug_bits(struct cpuinfo_x86 *c) {
u64 ia32_cap = x86_read_arch_cap_msr();
if (cpu_matches(cpu_vuln_whitelist, NO_SPECULATION)) {
return;
}
if (ia32_cap & ARCH_CAP_IBRS_ALL) {
setup_force_cpu_cap(X86_FEATURE_IBRS_ENHANCED);
}
if (!cpu_matches(cpu_vuln_whitelist... | static void cpu_set_bug_bits(struct cpuinfo_x86 *c) {
u64 ia32_cap = x86_read_arch_cap_msr();
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
if (cpu_matches(cpu_vuln_whitelist, NO_SPECULATION)) {
return;
}
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
if (ia32_cap & ARCH_CAP_IBRS_ALL) {
... | static void cpu_set_bug_bits(struct cpuinfo_x86 *c) {
u64 ia32_cap = x86_read_arch_cap_msr();
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
if (cpu_matches(cpu_vuln_whitelist, NO_SPECULATION)) {
return;
}
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
if (ia32_cap & ARCH_CAP_IBRS_ALL) {
... | static void cpu_set_bug_bits(struct cpuinfo_x86 *c) {
u64 ia32_cap = x86_read_arch_cap_msr();
if (cpu_matches(cpu_vuln_whitelist, NO_SPECULATION)) {
return;
}
if (ia32_cap & ARCH_CAP_IBRS_ALL) {
setup_force_cpu_cap(X86_FEATURE_IBRS_ENHANCED);
}
if (!cpu_matches(cpu_vuln_... |
CVE-2022-2639 | linux | https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux | net/openvswitch/flow_netlink.c | reserve_sfa_size | static struct nlattr *reserve_sfa_size(struct sw_flow_actions **sfa, int attr_len, bool log) {
struct sw_flow_actions *acts;
int new_acts_size;
size_t req_size = NLA_ALIGN(attr_len);
int next_offset = offsetof(struct sw_flow_actions, actions) + (*sfa)->actions_len;
if (req_size <= (ksize(*sfa) - nex... | static struct nlattr *reserve_sfa_size(struct sw_flow_actions **sfa, int attr_len, bool log) {
struct sw_flow_actions *acts;
int new_acts_size;
size_t req_size = NLA_ALIGN(attr_len);
int next_offset = offsetof(struct sw_flow_actions, actions) + (*sfa)->actions_len;
if (req_size <= (ksize(*sfa) - nex... | static struct nlattr *reserve_sfa_size(struct sw_flow_actions **sfa, int attr_len, bool log) {
struct sw_flow_actions *acts;
int new_acts_size;
size_t req_size = NLA_ALIGN(attr_len);
int next_offset = offsetof(struct sw_flow_actions, actions) + (*sfa)->actions_len;
if (req_size <= (ksize(*sfa) - nex... | static struct nlattr *reserve_sfa_size(struct sw_flow_actions **sfa, int attr_len, bool log) {
struct sw_flow_actions *acts;
int new_acts_size;
size_t req_size = NLA_ALIGN(attr_len);
int next_offset = offsetof(struct sw_flow_actions, actions) + (*sfa)->actions_len;
if (req_size <= (ksize(*sfa) - nex... | static struct nlattr *reserve_sfa_size(struct sw_flow_actions **sfa, int attr_len, bool log) {
size_t req_size = NLA_ALIGN(attr_len);
if (req_size <= (ksize(*sfa) - next_offset)) {
goto out;
}
new_acts_size = max(next_offset + req_size, ksize(*sfa) * 2);
if (new_acts_size > MAX_ACTIONS_BUFSI... | static struct nlattr *reserve_sfa_size(struct sw_flow_actions **sfa, int attr_len, bool log) {
size_t req_size = NLA_ALIGN(attr_len);
if (req_size <= (ksize(*sfa) - next_offset)) {
goto out;
}
new_acts_size = max(next_offset + req_size, ksize(*sfa) * 2);
if (new_acts_size > MAX_ACTIONS_BUFSI... | static struct nlattr *reserve_sfa_size(struct sw_flow_actions **sfa, int attr_len, bool log) {
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
size_t req_size = NLA_ALIGN(attr_len);
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
if (req_size <= (ksize(*sfa) - next_offset)) {
goto out;
}
new... | static struct nlattr *reserve_sfa_size(struct sw_flow_actions **sfa, int attr_len, bool log) {
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
size_t req_size = NLA_ALIGN(attr_len);
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
if (req_size <= (ksize(*sfa) - next_offset)) {
goto out;
}
new... | static struct nlattr *reserve_sfa_size(struct sw_flow_actions **sfa, int attr_len, bool log) {
size_t req_size = NLA_ALIGN(attr_len);
if (req_size <= (ksize(*sfa) - next_offset)) {
goto out;
}
new_acts_size = max(next_offset + req_size, ksize(*sfa) * 2);
if (new_acts_size > MAX_ACTION... |
CVE-2022-26490 | linux | https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux | drivers/nfc/st21nfca/se.c | st21nfca_connectivity_event_received | int st21nfca_connectivity_event_received(struct nfc_hci_dev *hdev, u8 host, u8 event, struct sk_buff *skb) {
int r = 0;
struct device *dev = &hdev->ndev->dev;
struct nfc_evt_transaction *transaction;
pr_debug("connectivity gate event: %x\n", event);
switch (event) {
case ST21NFCA_EVT_CONNECTIVIT... | int st21nfca_connectivity_event_received(struct nfc_hci_dev *hdev, u8 host, u8 event, struct sk_buff *skb) {
int r = 0;
struct device *dev = &hdev->ndev->dev;
struct nfc_evt_transaction *transaction;
pr_debug("connectivity gate event: %x\n", event);
switch (event) {
case ST21NFCA_EVT_CONNECTIVIT... | int st21nfca_connectivity_event_received(struct nfc_hci_dev *hdev, u8 host, u8 event, struct sk_buff *skb) {
int r = 0;
struct device *dev = &hdev->ndev->dev;
struct nfc_evt_transaction *transaction;
pr_debug("connectivity gate event: %x\n", event);
switch (event) {
case ST21NFCA_EVT_CONNECTIVIT... | int st21nfca_connectivity_event_received(struct nfc_hci_dev *hdev, u8 host, u8 event, struct sk_buff *skb) {
int r = 0;
struct device *dev = &hdev->ndev->dev;
struct nfc_evt_transaction *transaction;
pr_debug("connectivity gate event: %x\n", event);
switch (event) {
case ST21NFCA_EVT_CONNECTIVIT... | int st21nfca_connectivity_event_received(struct nfc_hci_dev *hdev, u8 host, u8 event, struct sk_buff *skb) {
struct device *dev = &hdev->ndev->dev;
switch (event) {
case ST21NFCA_EVT_TRANSACTION:
if (skb->len < NFC_M_AID_LENGTH + 2 && skb->data[0] != NFC_EVT_TRANSACTION_AID_TAG) {
return... | int st21nfca_connectivity_event_received(struct nfc_hci_dev *hdev, u8 host, u8 event, struct sk_buff *skb) {
struct device *dev = &hdev->ndev->dev;
switch (event) {
case ST21NFCA_EVT_TRANSACTION:
if (skb->len < NFC_M_AID_LENGTH + 2 && skb->data[0] != NFC_EVT_TRANSACTION_AID_TAG) {
return... | int st21nfca_connectivity_event_received(struct nfc_hci_dev *hdev, u8 host, u8 event, struct sk_buff *skb) {
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
struct device *dev = &hdev->ndev->dev;
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
switch (event) {
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT ... | int st21nfca_connectivity_event_received(struct nfc_hci_dev *hdev, u8 host, u8 event, struct sk_buff *skb) {
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
struct device *dev = &hdev->ndev->dev;
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
switch (event) {
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT ... | int st21nfca_connectivity_event_received(struct nfc_hci_dev *hdev, u8 host, u8 event, struct sk_buff *skb) {
struct device *dev = &hdev->ndev->dev;
switch (event) {
case ST21NFCA_EVT_TRANSACTION:
if (skb->len < NFC_M_AID_LENGTH + 2 && skb->data[0] != NFC_EVT_TRANSACTION_AID_TAG) {
... |
CVE-2022-2663 | linux | https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux | net/netfilter/nf_conntrack_irc.c | help | static int help(struct sk_buff *skb, unsigned int protoff, struct nf_conn *ct, enum ip_conntrack_info ctinfo) {
unsigned int dataoff;
const struct iphdr *iph;
const struct tcphdr *th;
struct tcphdr _tcph;
const char *data_limit;
char *data, *ib_ptr;
int dir = CTFO2DIR(ctinfo);
struct nf_... | static int help(struct sk_buff *skb, unsigned int protoff, struct nf_conn *ct, enum ip_conntrack_info ctinfo) {
unsigned int dataoff;
const struct iphdr *iph;
const struct tcphdr *th;
struct tcphdr _tcph;
const char *data_limit;
char *data, *ib_ptr;
int dir = CTFO2DIR(ctinfo);
struct nf_... | static int help(struct sk_buff *skb, unsigned int protoff, struct nf_conn *ct, enum ip_conntrack_info ctinfo) {
unsigned int dataoff;
const struct iphdr *iph;
const struct tcphdr *th;
struct tcphdr _tcph;
const char *data_limit;
char *data, *ib_ptr;
int dir = CTFO2DIR(ctinfo);
struct nf_... | static int help(struct sk_buff *skb, unsigned int protoff, struct nf_conn *ct, enum ip_conntrack_info ctinfo) {
unsigned int dataoff;
const struct iphdr *iph;
const struct tcphdr *th;
struct tcphdr _tcph;
const char *data_limit;
char *data, *ib_ptr;
int dir = CTFO2DIR(ctinfo);
struct nf_... | static int help(struct sk_buff *skb, unsigned int protoff, struct nf_conn *ct, enum ip_conntrack_info ctinfo) {
int dir = CTFO2DIR(ctinfo);
if (dir == IP_CT_DIR_REPLY) {
return NF_ACCEPT;
}
while (data < data_limit - (19 + MMATCHLEN)) {
if (memcmp(data, "\1DCC ", 5)) {
data++... | static int help(struct sk_buff *skb, unsigned int protoff, struct nf_conn *ct, enum ip_conntrack_info ctinfo) {
int dir = CTFO2DIR(ctinfo);
if (dir == IP_CT_DIR_REPLY) {
return NF_ACCEPT;
}
while (data < data_limit - (19 + MMATCHLEN)) {
if (memcmp(data, "\1DCC ", 5)) {
data++... | static int help(struct sk_buff *skb, unsigned int protoff, struct nf_conn *ct, enum ip_conntrack_info ctinfo) {
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
int dir = CTFO2DIR(ctinfo);
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
if (dir == IP_CT_DIR_REPLY) {
return NF_ACCEPT;
}
/* PLA... | static int help(struct sk_buff *skb, unsigned int protoff, struct nf_conn *ct, enum ip_conntrack_info ctinfo) {
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
int dir = CTFO2DIR(ctinfo);
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
if (dir == IP_CT_DIR_REPLY) {
return NF_ACCEPT;
}
/* PLA... | static int help(struct sk_buff *skb, unsigned int protoff, struct nf_conn *ct, enum ip_conntrack_info ctinfo) {
int dir = CTFO2DIR(ctinfo);
if (dir == IP_CT_DIR_REPLY) {
return NF_ACCEPT;
}
while (data < data_limit - (19 + MMATCHLEN)) {
if (memcmp(data, "\1DCC ", 5)) {
... |
CVE-2022-26966 | linux | https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux | drivers/net/usb/sr9700.c | sr9700_rx_fixup | static int sr9700_rx_fixup(struct usbnet *dev, struct sk_buff *skb) {
struct sk_buff *sr_skb;
int len;
if (unlikely(skb->len < SR_RX_OVERHEAD)) {
netdev_err(dev->net, "unexpected tiny rx frame\n");
return 0;
}
while (skb->len > SR_RX_OVERHEAD) {
if (skb->data[0] != 0x40) {
... | static int sr9700_rx_fixup(struct usbnet *dev, struct sk_buff *skb) {
struct sk_buff *sr_skb;
int len;
if (unlikely(skb->len < SR_RX_OVERHEAD)) {
netdev_err(dev->net, "unexpected tiny rx frame\n");
return 0;
}
while (skb->len > SR_RX_OVERHEAD) {
if (skb->data[0] != 0x40) {
... | static int sr9700_rx_fixup(struct usbnet *dev, struct sk_buff *skb) {
struct sk_buff *sr_skb;
int len;
if (unlikely(skb->len < SR_RX_OVERHEAD)) {
netdev_err(dev->net, "unexpected tiny rx frame\n");
return 0;
}
while (skb->len > SR_RX_OVERHEAD) {
if (skb->data[0] != 0x40) {
... | static int sr9700_rx_fixup(struct usbnet *dev, struct sk_buff *skb) {
struct sk_buff *sr_skb;
int len;
if (unlikely(skb->len < SR_RX_OVERHEAD)) {
netdev_err(dev->net, "unexpected tiny rx frame\n");
return 0;
}
while (skb->len > SR_RX_OVERHEAD) {
if (skb->data[0] != 0x40) {
... | static int sr9700_rx_fixup(struct usbnet *dev, struct sk_buff *skb) {
if (unlikely(skb->len < SR_RX_OVERHEAD)) {
return 0;
}
while (skb->len > SR_RX_OVERHEAD) {
if (skb->data[0] != 0x40) {
return 0;
}
len = (skb->data[1] | (skb->data[2] << 8)) - 4;
if (len... | static int sr9700_rx_fixup(struct usbnet *dev, struct sk_buff *skb) {
if (unlikely(skb->len < SR_RX_OVERHEAD)) {
return 0;
}
while (skb->len > SR_RX_OVERHEAD) {
if (skb->data[0] != 0x40) {
return 0;
}
len = (skb->data[1] | (skb->data[2] << 8)) - 4;
if (len... | static int sr9700_rx_fixup(struct usbnet *dev, struct sk_buff *skb) {
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
if (unlikely(skb->len < SR_RX_OVERHEAD)) {
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
return 0;
}
while (skb->len > SR_RX_OVERHEAD) {
if (skb->data[0] != 0x40) {
... | static int sr9700_rx_fixup(struct usbnet *dev, struct sk_buff *skb) {
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
if (unlikely(skb->len < SR_RX_OVERHEAD)) {
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
}
while (skb->len > SR_RX_OVERHEAD) {
... | static int sr9700_rx_fixup(struct usbnet *dev, struct sk_buff *skb) {
if (unlikely(skb->len < SR_RX_OVERHEAD)) {
return 0;
}
while (skb->len > SR_RX_OVERHEAD) {
if (skb->data[0] != 0x40) {
return 0;
}
len = (skb->data[1] | (skb->data[2] << 8)) - 4;
- ... |
CVE-2022-27223 | linux | https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux | drivers/usb/gadget/udc/udc-xilinx.c | xudc_getstatus | static void xudc_getstatus(struct xusb_udc *udc) {
struct xusb_ep *ep0 = &udc->ep[0];
struct xusb_req *req = udc->req;
struct xusb_ep *target_ep;
u16 status = 0;
u32 epcfgreg;
int epnum;
u32 halt;
int ret;
switch (udc->setup.bRequestType & USB_RECIP_MASK) {
case USB_RECIP_DEVICE:... | static void xudc_getstatus(struct xusb_udc *udc) {
struct xusb_ep *ep0 = &udc->ep[0];
struct xusb_req *req = udc->req;
struct xusb_ep *target_ep;
u16 status = 0;
u32 epcfgreg;
int epnum;
u32 halt;
int ret;
switch (udc->setup.bRequestType & USB_RECIP_MASK) {
case USB_RECIP_DEVICE:... | static void xudc_getstatus(struct xusb_udc *udc) {
struct xusb_ep *ep0 = &udc->ep[0];
struct xusb_req *req = udc->req;
struct xusb_ep *target_ep;
u16 status = 0;
u32 epcfgreg;
int epnum;
u32 halt;
int ret;
switch (udc->setup.bRequestType & USB_RECIP_MASK) {
case USB_RECIP_DEVICE:... | static void xudc_getstatus(struct xusb_udc *udc) {
struct xusb_ep *ep0 = &udc->ep[0];
struct xusb_req *req = udc->req;
struct xusb_ep *target_ep;
u16 status = 0;
u32 epcfgreg;
int epnum;
u32 halt;
int ret;
switch (udc->setup.bRequestType & USB_RECIP_MASK) {
case USB_RECIP_DEVICE:... | static void xudc_getstatus(struct xusb_udc *udc) {
switch (udc->setup.bRequestType & USB_RECIP_MASK) {
case USB_RECIP_ENDPOT:
epnum = udc->setup.wIndex & USB_ENDPOT_NUMBER_MASK;
target_ep = &udc->ep[epnum];
break;
}
stall:
dev_err(udc->dev, "Can't respond to getstatus request\n")... | static void xudc_getstatus(struct xusb_udc *udc) {
switch (udc->setup.bRequestType & USB_RECIP_MASK) {
case USB_RECIP_ENDPOT:
epnum = udc->setup.wIndex & USB_ENDPOT_NUMBER_MASK;
if (epnum >= XUSB_MAX_ENDPOTS) {
goto stall;
}
target_ep = &udc->ep[epnum];
break;... | static void xudc_getstatus(struct xusb_udc *udc) {
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
switch (udc->setup.bRequestType & USB_RECIP_MASK) {
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
case USB_RECIP_ENDPOT:
epnum = udc->setup.wIndex & USB_ENDPOT_NUMBER_MASK;
target_ep = &udc->... | static void xudc_getstatus(struct xusb_udc *udc) {
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
switch (udc->setup.bRequestType & USB_RECIP_MASK) {
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
case USB_RECIP_ENDPOT:
epnum = udc->setup.wIndex & USB_ENDPOT_NUMBER_MASK;
if (epnum >= XUSB_... | static void xudc_getstatus(struct xusb_udc *udc) {
switch (udc->setup.bRequestType & USB_RECIP_MASK) {
case USB_RECIP_ENDPOT:
epnum = udc->setup.wIndex & USB_ENDPOT_NUMBER_MASK;
+ if (epnum >= XUSB_MAX_ENDPOTS) {
+ goto stall;
+ }
target_ep = &udc->ep[epnum];
... |
CVE-2022-27223 | linux | https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux | drivers/usb/gadget/udc/udc-xilinx.c | xudc_set_clear_feature | static void xudc_set_clear_feature(struct xusb_udc *udc) {
struct xusb_ep *ep0 = &udc->ep[0];
struct xusb_req *req = udc->req;
struct xusb_ep *target_ep;
u8 endpoint;
u8 outinbit;
u32 epcfgreg;
int flag = (udc->setup.bRequest == USB_REQ_SET_FEATURE ? 1 : 0);
int ret;
switch (udc->set... | static void xudc_set_clear_feature(struct xusb_udc *udc) {
struct xusb_ep *ep0 = &udc->ep[0];
struct xusb_req *req = udc->req;
struct xusb_ep *target_ep;
u8 endpoint;
u8 outinbit;
u32 epcfgreg;
int flag = (udc->setup.bRequest == USB_REQ_SET_FEATURE ? 1 : 0);
int ret;
switch (udc->set... | static void xudc_set_clear_feature(struct xusb_udc *udc) {
struct xusb_ep *ep0 = &udc->ep[0];
struct xusb_req *req = udc->req;
struct xusb_ep *target_ep;
u8 endpoint;
u8 outinbit;
u32 epcfgreg;
int flag = (udc->setup.bRequest == USB_REQ_SET_FEATURE ? 1 : 0);
int ret;
switch (udc->set... | static void xudc_set_clear_feature(struct xusb_udc *udc) {
struct xusb_ep *ep0 = &udc->ep[0];
struct xusb_req *req = udc->req;
struct xusb_ep *target_ep;
u8 endpoint;
u8 outinbit;
u32 epcfgreg;
int flag = (udc->setup.bRequest == USB_REQ_SET_FEATURE ? 1 : 0);
int ret;
switch (udc->set... | static void xudc_set_clear_feature(struct xusb_udc *udc) {
switch (udc->setup.bRequestType) {
case USB_RECIP_ENDPOT:
if (!udc->setup.wValue) {
endpoint = udc->setup.wIndex & USB_ENDPOT_NUMBER_MASK;
target_ep = &udc->ep[endpoint];
if (!endpoint) {
} else {
... | static void xudc_set_clear_feature(struct xusb_udc *udc) {
switch (udc->setup.bRequestType) {
case USB_RECIP_ENDPOT:
if (!udc->setup.wValue) {
endpoint = udc->setup.wIndex & USB_ENDPOT_NUMBER_MASK;
if (endpoint >= XUSB_MAX_ENDPOTS) {
xudc_ep0_stall(udc);
... | static void xudc_set_clear_feature(struct xusb_udc *udc) {
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
switch (udc->setup.bRequestType) {
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
case USB_RECIP_ENDPOT:
if (!udc->setup.wValue) {
endpoint = udc->setup.wIndex & USB_ENDPOT_NUMBER_... | static void xudc_set_clear_feature(struct xusb_udc *udc) {
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
switch (udc->setup.bRequestType) {
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
case USB_RECIP_ENDPOT:
if (!udc->setup.wValue) {
endpoint = udc->setup.wIndex & USB_ENDPOT_NUMBER_... | static void xudc_set_clear_feature(struct xusb_udc *udc) {
switch (udc->setup.bRequestType) {
case USB_RECIP_ENDPOT:
if (!udc->setup.wValue) {
endpoint = udc->setup.wIndex & USB_ENDPOT_NUMBER_MASK;
+ if (endpoint >= XUSB_MAX_ENDPOTS) {
+ xudc_ep0_stall(udc);
+ ... |
CVE-2022-27666 | linux | https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux | net/ipv4/esp4.c | esp_output_head | int esp_output_head(struct xfrm_state *x, struct sk_buff *skb, struct esp_info *esp) {
u8 *tail;
int nfrags;
int esph_offset;
struct page *page;
struct sk_buff *trailer;
int tailen = esp->tailen;
if (x->encap) {
int err = esp_output_encap(x, skb, esp);
if (err < 0) {
... | int esp_output_head(struct xfrm_state *x, struct sk_buff *skb, struct esp_info *esp) {
u8 *tail;
int nfrags;
int esph_offset;
struct page *page;
struct sk_buff *trailer;
int tailen = esp->tailen;
unsigned int allocsz;
if (x->encap) {
int err = esp_output_encap(x, skb, esp);
... | int esp_output_head(struct xfrm_state *x, struct sk_buff *skb, struct esp_info *esp) {
u8 *tail;
int nfrags;
int esph_offset;
struct page *page;
struct sk_buff *trailer;
int tailen = esp->tailen;
if (x->encap) {
int err = esp_output_udp_encap(x, skb, esp);
if (err < 0) {
... | int esp_output_head(struct xfrm_state *x, struct sk_buff *skb, struct esp_info *esp) {
u8 *tail;
int nfrags;
int esph_offset;
struct page *page;
struct sk_buff *trailer;
int tailen = esp->tailen;
unsigned int allocsz;
if (x->encap) {
int err = esp_output_udp_encap(x, skb, esp);
... | int esp_output_head(struct xfrm_state *x, struct sk_buff *skb, struct esp_info *esp) {
int tailen = esp->tailen;
if (x->encap) {
int err = esp_output_encap(x, skb, esp);
if (err < 0) {
return err;
}
}
if (!skb_cloned(skb)) {
if (tailen <= skb_tailroom(skb)) {
... | int esp_output_head(struct xfrm_state *x, struct sk_buff *skb, struct esp_info *esp) {
int tailen = esp->tailen;
unsigned int allocsz;
if (x->encap) {
int err = esp_output_encap(x, skb, esp);
if (err < 0) {
return err;
}
}
allocsz = ALIGN(skb->data_len + tailen, L... | int esp_output_head(struct xfrm_state *x, struct sk_buff *skb, struct esp_info *esp) {
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
int tailen = esp->tailen;
if (x->encap) {
int err = esp_output_udp_encap(x, skb, esp);
if (err < 0) {
return err;
}
}
if (!skb_clon... | int esp_output_head(struct xfrm_state *x, struct sk_buff *skb, struct esp_info *esp) {
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
int tailen = esp->tailen;
unsigned int allocsz;
if (x->encap) {
int err = esp_output_udp_encap(x, skb, esp);
if (err < 0) {
return err;
... | int esp_output_head(struct xfrm_state *x, struct sk_buff *skb, struct esp_info *esp) {
int tailen = esp->tailen;
+ unsigned int allocsz;
if (x->encap) {
int err = esp_output_encap(x, skb, esp);
if (err < 0) {
return err;
}
+ }
+ allocsz = ALIGN(skb->data_len +... |
CVE-2022-27666 | linux | https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux | net/ipv6/esp6.c | esp6_output_head | int esp6_output_head(struct xfrm_state *x, struct sk_buff *skb, struct esp_info *esp) {
u8 *tail;
int nfrags;
int esph_offset;
struct page *page;
struct sk_buff *trailer;
int tailen = esp->tailen;
if (x->encap) {
int err = esp6_output_encap(x, skb, esp);
if (err < 0) {
... | int esp6_output_head(struct xfrm_state *x, struct sk_buff *skb, struct esp_info *esp) {
u8 *tail;
int nfrags;
int esph_offset;
struct page *page;
struct sk_buff *trailer;
int tailen = esp->tailen;
unsigned int allocsz;
if (x->encap) {
int err = esp6_output_encap(x, skb, esp);
... | int esp6_output_head(struct xfrm_state *x, struct sk_buff *skb, struct esp_info *esp) {
u8 *tail;
int nfrags;
struct page *page;
struct sk_buff *trailer;
int tailen = esp->tailen;
if (!skb_cloned(skb)) {
if (tailen <= skb_tailroom(skb)) {
nfrags = 1;
trailer = skb... | int esp6_output_head(struct xfrm_state *x, struct sk_buff *skb, struct esp_info *esp) {
u8 *tail;
int nfrags;
struct page *page;
struct sk_buff *trailer;
int tailen = esp->tailen;
unsigned int allocsz;
allocsz = ALIGN(skb->data_len + tailen, L1_CACHE_BYTES);
if (allocsz > ESP_SKB_FRAG_MA... | int esp6_output_head(struct xfrm_state *x, struct sk_buff *skb, struct esp_info *esp) {
int tailen = esp->tailen;
if (x->encap) {
int err = esp6_output_encap(x, skb, esp);
if (err < 0) {
return err;
}
}
if (!skb_cloned(skb)) {
if (tailen <= skb_tailroom(skb)) ... | int esp6_output_head(struct xfrm_state *x, struct sk_buff *skb, struct esp_info *esp) {
int tailen = esp->tailen;
unsigned int allocsz;
if (x->encap) {
int err = esp6_output_encap(x, skb, esp);
if (err < 0) {
return err;
}
}
allocsz = ALIGN(skb->data_len + tailen,... | int esp6_output_head(struct xfrm_state *x, struct sk_buff *skb, struct esp_info *esp) {
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
int tailen = esp->tailen;
if (!skb_cloned(skb)) {
if (tailen <= skb_tailroom(skb)) {
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
goto skip_cow;
... | int esp6_output_head(struct xfrm_state *x, struct sk_buff *skb, struct esp_info *esp) {
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
int tailen = esp->tailen;
unsigned int allocsz;
allocsz = ALIGN(skb->data_len + tailen, L1_CACHE_BYTES);
if (allocsz > ESP_SKB_FRAG_MAXSIZE) {
goto cow;
}... | int esp6_output_head(struct xfrm_state *x, struct sk_buff *skb, struct esp_info *esp) {
int tailen = esp->tailen;
+ unsigned int allocsz;
if (x->encap) {
int err = esp6_output_encap(x, skb, esp);
if (err < 0) {
return err;
}
+ }
+ allocsz = ALIGN(skb->data_len... |
CVE-2022-27672 | xen | https://github.com/xen-project/xen | arch/x86/kernel/cpu/common.c | cpu_set_bug_bits | static void cpu_set_bug_bits(struct cpuinfo_x86 *c) {
u64 ia32_cap = x86_read_arch_cap_msr();
if (!cpu_matches(cpu_vuln_whitelist, NO_ITLB_MULTIHIT) && !(ia32_cap & ARCH_CAP_PSCHANGE_MC_NO)) {
setup_force_cpu_bug(X86_BUG_ITLB_MULTIHIT);
}
if (cpu_matches(cpu_vuln_whitelist, NO_SPECULATION)) {
... | static void cpu_set_bug_bits(struct cpuinfo_x86 *c) {
u64 ia32_cap = x86_read_arch_cap_msr();
if (!cpu_matches(cpu_vuln_whitelist, NO_ITLB_MULTIHIT) && !(ia32_cap & ARCH_CAP_PSCHANGE_MC_NO)) {
setup_force_cpu_bug(X86_BUG_ITLB_MULTIHIT);
}
if (cpu_matches(cpu_vuln_whitelist, NO_SPECULATION)) {
... | static void cpu_set_bug_bits(struct cpuinfo_x86 *c) {
u64 ia32_cap = x86_read_arch_cap_msr();
if (!cpu_matches(cpu_vuln_whitelist, NO_ITLB_MULTIHIT) && !(ia32_cap & ARCH_CAP_PSCHANGE_MC_NO)) {
setup_force_cpu_bug(X86_BUG_ITLB_MULTIHIT);
}
if (cpu_matches(cpu_vuln_whitelist, NO_SPECULATION)) {
... | static void cpu_set_bug_bits(struct cpuinfo_x86 *c) {
u64 ia32_cap = x86_read_arch_cap_msr();
if (!cpu_matches(cpu_vuln_whitelist, NO_ITLB_MULTIHIT) && !(ia32_cap & ARCH_CAP_PSCHANGE_MC_NO)) {
setup_force_cpu_bug(X86_BUG_ITLB_MULTIHIT);
}
if (cpu_matches(cpu_vuln_whitelist, NO_SPECULATION)) {
... | static void cpu_set_bug_bits(struct cpuinfo_x86 *c) {
u64 ia32_cap = x86_read_arch_cap_msr();
if (cpu_matches(cpu_vuln_whitelist, NO_SPECULATION)) {
return;
}
if (!arch_cap_mmio_immune(ia32_cap)) {
if (cpu_matches(cpu_vuln_blacklist, MMIO)) {
} else if (!cpu_matches(cpu_vuln_whit... | static void cpu_set_bug_bits(struct cpuinfo_x86 *c) {
u64 ia32_cap = x86_read_arch_cap_msr();
if (cpu_matches(cpu_vuln_whitelist, NO_SPECULATION)) {
return;
}
if (!arch_cap_mmio_immune(ia32_cap)) {
if (cpu_matches(cpu_vuln_blacklist, MMIO)) {
} else if (!cpu_matches(cpu_vuln_whit... | static void cpu_set_bug_bits(struct cpuinfo_x86 *c) {
u64 ia32_cap = x86_read_arch_cap_msr();
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
if (cpu_matches(cpu_vuln_whitelist, NO_SPECULATION)) {
return;
}
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
if (!arch_cap_mmio_immune(ia32_cap)) ... | static void cpu_set_bug_bits(struct cpuinfo_x86 *c) {
u64 ia32_cap = x86_read_arch_cap_msr();
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
if (cpu_matches(cpu_vuln_whitelist, NO_SPECULATION)) {
return;
}
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
if (!arch_cap_mmio_immune(ia32_cap)) ... | static void cpu_set_bug_bits(struct cpuinfo_x86 *c) {
u64 ia32_cap = x86_read_arch_cap_msr();
if (cpu_matches(cpu_vuln_whitelist, NO_SPECULATION)) {
return;
}
if (!arch_cap_mmio_immune(ia32_cap)) {
if (cpu_matches(cpu_vuln_blacklist, MMIO)) {
} else if (!cpu_matches(cpu_v... |
CVE-2022-27950 | linux | https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux | drivers/hid/hid-elo.c | elo_probe | static int elo_probe(struct hid_device *hdev, const struct hid_device_id *id) {
struct elo_priv *priv;
int ret;
struct usb_device *udev;
if (!hid_is_usb(hdev)) {
return -EVAL;
}
priv = kzalloc(sizeof(*priv), GFP_KERNEL);
if (!priv) {
return -ENOMEM;
}
IT_DELAYED_WORK(... | static int elo_probe(struct hid_device *hdev, const struct hid_device_id *id) {
struct elo_priv *priv;
int ret;
struct usb_device *udev;
if (!hid_is_usb(hdev)) {
return -EVAL;
}
priv = kzalloc(sizeof(*priv), GFP_KERNEL);
if (!priv) {
return -ENOMEM;
}
IT_DELAYED_WORK(... | static int elo_probe(struct hid_device *hdev, const struct hid_device_id *id) {
struct elo_priv *priv;
int ret;
struct usb_device *udev;
if (!hid_is_usb(hdev)) {
return -EVAL;
}
priv = kzalloc(sizeof(*priv), GFP_KERNEL);
if (!priv) {
return -ENOMEM;
}
IT_DELAYED_WORK(... | static int elo_probe(struct hid_device *hdev, const struct hid_device_id *id) {
struct elo_priv *priv;
int ret;
struct usb_device *udev;
if (!hid_is_usb(hdev)) {
return -EVAL;
}
priv = kzalloc(sizeof(*priv), GFP_KERNEL);
if (!priv) {
return -ENOMEM;
}
IT_DELAYED_WORK(... | static int elo_probe(struct hid_device *hdev, const struct hid_device_id *id) {
udev = interface_to_usbdev(to_usb_interface(hdev->dev.parent));
priv->usbdev = usb_get_dev(udev);
if (ret) {
hid_err(hdev, "parse failed\n");
goto err_free;
}
if (ret) {
hid_err(hdev, "hw start fa... | static int elo_probe(struct hid_device *hdev, const struct hid_device_id *id) {
udev = interface_to_usbdev(to_usb_interface(hdev->dev.parent));
priv->usbdev = usb_get_dev(udev);
if (ret) {
hid_err(hdev, "parse failed\n");
goto err_free;
}
if (ret) {
hid_err(hdev, "hw start fa... | static int elo_probe(struct hid_device *hdev, const struct hid_device_id *id) {
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
udev = interface_to_usbdev(to_usb_interface(hdev->dev.parent));
priv->usbdev = usb_get_dev(udev);
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
if (ret) {
hid_err(hde... | static int elo_probe(struct hid_device *hdev, const struct hid_device_id *id) {
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
udev = interface_to_usbdev(to_usb_interface(hdev->dev.parent));
priv->usbdev = usb_get_dev(udev);
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
if (ret) {
hid_err(hde... | static int elo_probe(struct hid_device *hdev, const struct hid_device_id *id) {
udev = interface_to_usbdev(to_usb_interface(hdev->dev.parent));
priv->usbdev = usb_get_dev(udev);
if (ret) {
hid_err(hdev, "parse failed\n");
goto err_free;
}
if (ret) {
hid_err(hdev, "hw... |
CVE-2022-28356 | linux | https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux | net/llc/af_llc.c | llc_ui_autobind | static int llc_ui_autobind(struct socket *sock, struct sockaddr_llc *addr) {
struct sock *sk = sock->sk;
struct llc_sock *llc = llc_sk(sk);
struct llc_sap *sap;
int rc = -EVAL;
if (!sock_flag(sk, SOCK_ZAPPED)) {
goto out;
}
if (!addr->sllc_arphrd) {
addr->sllc_arphrd = ARPHRD... | static int llc_ui_autobind(struct socket *sock, struct sockaddr_llc *addr) {
struct sock *sk = sock->sk;
struct llc_sock *llc = llc_sk(sk);
struct llc_sap *sap;
int rc = -EVAL;
if (!sock_flag(sk, SOCK_ZAPPED)) {
goto out;
}
if (!addr->sllc_arphrd) {
addr->sllc_arphrd = ARPHRD... | static int llc_ui_autobind(struct socket *sock, struct sockaddr_llc *addr) {
struct sock *sk = sock->sk;
struct llc_sock *llc = llc_sk(sk);
struct llc_sap *sap;
int rc = -EVAL;
if (!sock_flag(sk, SOCK_ZAPPED)) {
goto out;
}
if (!addr->sllc_arphrd) {
addr->sllc_arphrd = ARPHRD... | static int llc_ui_autobind(struct socket *sock, struct sockaddr_llc *addr) {
struct sock *sk = sock->sk;
struct llc_sock *llc = llc_sk(sk);
struct llc_sap *sap;
int rc = -EVAL;
if (!sock_flag(sk, SOCK_ZAPPED)) {
goto out;
}
if (!addr->sllc_arphrd) {
addr->sllc_arphrd = ARPHRD... | static int llc_ui_autobind(struct socket *sock, struct sockaddr_llc *addr) {
struct sock *sk = sock->sk;
struct llc_sock *llc = llc_sk(sk);
if (!sock_flag(sk, SOCK_ZAPPED)) {
goto out;
}
if (!addr->sllc_arphrd) {
addr->sllc_arphrd = ARPHRD_ETHER;
}
if (addr->sllc_arphrd != AR... | static int llc_ui_autobind(struct socket *sock, struct sockaddr_llc *addr) {
struct sock *sk = sock->sk;
struct llc_sock *llc = llc_sk(sk);
if (!sock_flag(sk, SOCK_ZAPPED)) {
goto out;
}
if (!addr->sllc_arphrd) {
addr->sllc_arphrd = ARPHRD_ETHER;
}
if (addr->sllc_arphrd != AR... | static int llc_ui_autobind(struct socket *sock, struct sockaddr_llc *addr) {
struct sock *sk = sock->sk;
struct llc_sock *llc = llc_sk(sk);
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
if (!sock_flag(sk, SOCK_ZAPPED)) {
goto out;
}
if (!addr->sllc_arphrd) {
addr->sllc_arphrd = A... | static int llc_ui_autobind(struct socket *sock, struct sockaddr_llc *addr) {
struct sock *sk = sock->sk;
struct llc_sock *llc = llc_sk(sk);
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
if (!sock_flag(sk, SOCK_ZAPPED)) {
goto out;
}
if (!addr->sllc_arphrd) {
addr->sllc_arphrd = A... | static int llc_ui_autobind(struct socket *sock, struct sockaddr_llc *addr) {
struct sock *sk = sock->sk;
struct llc_sock *llc = llc_sk(sk);
if (!sock_flag(sk, SOCK_ZAPPED)) {
goto out;
}
if (!addr->sllc_arphrd) {
addr->sllc_arphrd = ARPHRD_ETHER;
}
if (addr->sllc_ar... |
CVE-2022-28356 | linux | https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux | net/llc/af_llc.c | llc_ui_bind | static int llc_ui_bind(struct socket *sock, struct sockaddr *uaddr, int addrlen) {
struct sockaddr_llc *addr = (struct sockaddr_llc *)uaddr;
struct sock *sk = sock->sk;
struct llc_sock *llc = llc_sk(sk);
struct llc_sap *sap;
int rc = -EVAL;
dprintk("%s: binding %02X\n", __func__, addr->sllc_sap)... | static int llc_ui_bind(struct socket *sock, struct sockaddr *uaddr, int addrlen) {
struct sockaddr_llc *addr = (struct sockaddr_llc *)uaddr;
struct sock *sk = sock->sk;
struct llc_sock *llc = llc_sk(sk);
struct llc_sap *sap;
int rc = -EVAL;
dprintk("%s: binding %02X\n", __func__, addr->sllc_sap)... | static int llc_ui_bind(struct socket *sock, struct sockaddr *uaddr, int addrlen) {
struct sockaddr_llc *addr = (struct sockaddr_llc *)uaddr;
struct sock *sk = sock->sk;
struct llc_sock *llc = llc_sk(sk);
struct llc_sap *sap;
int rc = -EVAL;
lock_sock(sk);
if (unlikely(!sock_flag(sk, SOCK_ZAP... | static int llc_ui_bind(struct socket *sock, struct sockaddr *uaddr, int addrlen) {
struct sockaddr_llc *addr = (struct sockaddr_llc *)uaddr;
struct sock *sk = sock->sk;
struct llc_sock *llc = llc_sk(sk);
struct llc_sap *sap;
int rc = -EVAL;
lock_sock(sk);
if (unlikely(!sock_flag(sk, SOCK_ZAP... | static int llc_ui_bind(struct socket *sock, struct sockaddr *uaddr, int addrlen) {
struct sockaddr_llc *addr = (struct sockaddr_llc *)uaddr;
struct sock *sk = sock->sk;
struct llc_sock *llc = llc_sk(sk);
dprintk("%s: binding %02X\n", __func__, addr->sllc_sap);
lock_sock(sk);
if (unlikely(!sock_f... | static int llc_ui_bind(struct socket *sock, struct sockaddr *uaddr, int addrlen) {
struct sockaddr_llc *addr = (struct sockaddr_llc *)uaddr;
struct sock *sk = sock->sk;
struct llc_sock *llc = llc_sk(sk);
dprintk("%s: binding %02X\n", __func__, addr->sllc_sap);
lock_sock(sk);
if (unlikely(!sock_f... | static int llc_ui_bind(struct socket *sock, struct sockaddr *uaddr, int addrlen) {
struct sockaddr_llc *addr = (struct sockaddr_llc *)uaddr;
struct sock *sk = sock->sk;
struct llc_sock *llc = llc_sk(sk);
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
lock_sock(sk);
if (unlikely(!sock_flag(sk, SOC... | static int llc_ui_bind(struct socket *sock, struct sockaddr *uaddr, int addrlen) {
struct sockaddr_llc *addr = (struct sockaddr_llc *)uaddr;
struct sock *sk = sock->sk;
struct llc_sock *llc = llc_sk(sk);
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
lock_sock(sk);
if (unlikely(!sock_flag(sk, SOC... | static int llc_ui_bind(struct socket *sock, struct sockaddr *uaddr, int addrlen) {
struct sockaddr_llc *addr = (struct sockaddr_llc *)uaddr;
struct sock *sk = sock->sk;
struct llc_sock *llc = llc_sk(sk);
dprintk("%s: binding %02X\n", __func__, addr->sllc_sap);
lock_sock(sk);
if (unlikely(... |
CVE-2022-28388 | linux | https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux | drivers/net/can/usb/usb_8dev.c | usb_8dev_start_xmit | static netdev_tx_t usb_8dev_start_xmit(struct sk_buff *skb, struct net_device *netdev) {
struct usb_8dev_priv *priv = netdev_priv(netdev);
struct net_device_stats *stats = &netdev->stats;
struct can_frame *cf = (struct can_frame *) skb->data;
struct usb_8dev_tx_msg *msg;
struct urb *urb;
struct ... | static netdev_tx_t usb_8dev_start_xmit(struct sk_buff *skb, struct net_device *netdev) {
struct usb_8dev_priv *priv = netdev_priv(netdev);
struct net_device_stats *stats = &netdev->stats;
struct can_frame *cf = (struct can_frame *) skb->data;
struct usb_8dev_tx_msg *msg;
struct urb *urb;
struct ... | static netdev_tx_t usb_8dev_start_xmit(struct sk_buff *skb, struct net_device *netdev) {
struct usb_8dev_priv *priv = netdev_priv(netdev);
struct net_device_stats *stats = &netdev->stats;
struct can_frame *cf = (struct can_frame *) skb->data;
struct usb_8dev_tx_msg *msg;
struct urb *urb;
struct ... | static netdev_tx_t usb_8dev_start_xmit(struct sk_buff *skb, struct net_device *netdev) {
struct usb_8dev_priv *priv = netdev_priv(netdev);
struct net_device_stats *stats = &netdev->stats;
struct can_frame *cf = (struct can_frame *) skb->data;
struct usb_8dev_tx_msg *msg;
struct urb *urb;
struct ... | static netdev_tx_t usb_8dev_start_xmit(struct sk_buff *skb, struct net_device *netdev) {
struct usb_8dev_priv *priv = netdev_priv(netdev);
struct net_device_stats *stats = &netdev->stats;
struct usb_8dev_tx_urb_context *context = NULL;
size_t size = sizeof(struct usb_8dev_tx_msg);
if (can_dropped_in... | static netdev_tx_t usb_8dev_start_xmit(struct sk_buff *skb, struct net_device *netdev) {
struct usb_8dev_priv *priv = netdev_priv(netdev);
struct net_device_stats *stats = &netdev->stats;
struct usb_8dev_tx_urb_context *context = NULL;
size_t size = sizeof(struct usb_8dev_tx_msg);
if (can_dropped_in... | static netdev_tx_t usb_8dev_start_xmit(struct sk_buff *skb, struct net_device *netdev) {
struct usb_8dev_priv *priv = netdev_priv(netdev);
struct net_device_stats *stats = &netdev->stats;
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
struct usb_8dev_tx_urb_context *context = NULL;
/* PLACEHOLDER: DO... | static netdev_tx_t usb_8dev_start_xmit(struct sk_buff *skb, struct net_device *netdev) {
struct usb_8dev_priv *priv = netdev_priv(netdev);
struct net_device_stats *stats = &netdev->stats;
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
struct usb_8dev_tx_urb_context *context = NULL;
/* PLACEHOLDER: DO... | static netdev_tx_t usb_8dev_start_xmit(struct sk_buff *skb, struct net_device *netdev) {
struct usb_8dev_priv *priv = netdev_priv(netdev);
struct net_device_stats *stats = &netdev->stats;
struct usb_8dev_tx_urb_context *context = NULL;
size_t size = sizeof(struct usb_8dev_tx_msg);
if (can_drop... |
CVE-2022-28389 | linux | https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux | drivers/net/can/usb/mcba_usb.c | mcba_usb_start_xmit | static netdev_tx_t mcba_usb_start_xmit(struct sk_buff *skb, struct net_device *netdev) {
struct mcba_priv *priv = netdev_priv(netdev);
struct can_frame *cf = (struct can_frame *)skb->data;
struct mcba_usb_ctx *ctx = NULL;
struct net_device_stats *stats = &priv->netdev->stats;
u16 sid;
int err;
... | static netdev_tx_t mcba_usb_start_xmit(struct sk_buff *skb, struct net_device *netdev) {
struct mcba_priv *priv = netdev_priv(netdev);
struct can_frame *cf = (struct can_frame *)skb->data;
struct mcba_usb_ctx *ctx = NULL;
struct net_device_stats *stats = &priv->netdev->stats;
u16 sid;
int err;
... | static netdev_tx_t mcba_usb_start_xmit(struct sk_buff *skb, struct net_device *netdev) {
struct mcba_priv *priv = netdev_priv(netdev);
struct can_frame *cf = (struct can_frame *)skb->data;
struct mcba_usb_ctx *ctx = NULL;
struct net_device_stats *stats = &priv->netdev->stats;
u16 sid;
int err;
... | static netdev_tx_t mcba_usb_start_xmit(struct sk_buff *skb, struct net_device *netdev) {
struct mcba_priv *priv = netdev_priv(netdev);
struct can_frame *cf = (struct can_frame *)skb->data;
struct mcba_usb_ctx *ctx = NULL;
struct net_device_stats *stats = &priv->netdev->stats;
u16 sid;
int err;
... | static netdev_tx_t mcba_usb_start_xmit(struct sk_buff *skb, struct net_device *netdev) {
struct mcba_priv *priv = netdev_priv(netdev);
struct can_frame *cf = (struct can_frame *)skb->data;
if (can_dropped_invalid_skb(netdev, skb)) {
return NETDEV_TX_OK;
}
ctx = mcba_usb_get_free_ctx(priv, cf... | static netdev_tx_t mcba_usb_start_xmit(struct sk_buff *skb, struct net_device *netdev) {
struct mcba_priv *priv = netdev_priv(netdev);
struct can_frame *cf = (struct can_frame *)skb->data;
if (can_dropped_invalid_skb(netdev, skb)) {
return NETDEV_TX_OK;
}
ctx = mcba_usb_get_free_ctx(priv, cf... | static netdev_tx_t mcba_usb_start_xmit(struct sk_buff *skb, struct net_device *netdev) {
struct mcba_priv *priv = netdev_priv(netdev);
struct can_frame *cf = (struct can_frame *)skb->data;
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
if (can_dropped_invalid_skb(netdev, skb)) {
return NETDEV_TX_... | static netdev_tx_t mcba_usb_start_xmit(struct sk_buff *skb, struct net_device *netdev) {
struct mcba_priv *priv = netdev_priv(netdev);
struct can_frame *cf = (struct can_frame *)skb->data;
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
if (can_dropped_invalid_skb(netdev, skb)) {
return NETDEV_TX_... | static netdev_tx_t mcba_usb_start_xmit(struct sk_buff *skb, struct net_device *netdev) {
struct mcba_priv *priv = netdev_priv(netdev);
struct can_frame *cf = (struct can_frame *)skb->data;
if (can_dropped_invalid_skb(netdev, skb)) {
return NETDEV_TX_OK;
}
ctx = mcba_usb_get_free_ctx(p... |
CVE-2022-28390 | linux | https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux | drivers/net/can/usb/ems_usb.c | ems_usb_start_xmit | static netdev_tx_t ems_usb_start_xmit(struct sk_buff *skb, struct net_device *netdev) {
struct ems_usb *dev = netdev_priv(netdev);
struct ems_tx_urb_context *context = NULL;
struct net_device_stats *stats = &netdev->stats;
struct can_frame *cf = (struct can_frame *)skb->data;
struct ems_cpc_msg *msg... | static netdev_tx_t ems_usb_start_xmit(struct sk_buff *skb, struct net_device *netdev) {
struct ems_usb *dev = netdev_priv(netdev);
struct ems_tx_urb_context *context = NULL;
struct net_device_stats *stats = &netdev->stats;
struct can_frame *cf = (struct can_frame *)skb->data;
struct ems_cpc_msg *msg... | static netdev_tx_t ems_usb_start_xmit(struct sk_buff *skb, struct net_device *netdev) {
struct ems_usb *dev = netdev_priv(netdev);
struct ems_tx_urb_context *context = NULL;
struct net_device_stats *stats = &netdev->stats;
struct can_frame *cf = (struct can_frame *)skb->data;
struct ems_cpc_msg *msg... | static netdev_tx_t ems_usb_start_xmit(struct sk_buff *skb, struct net_device *netdev) {
struct ems_usb *dev = netdev_priv(netdev);
struct ems_tx_urb_context *context = NULL;
struct net_device_stats *stats = &netdev->stats;
struct can_frame *cf = (struct can_frame *)skb->data;
struct ems_cpc_msg *msg... | static netdev_tx_t ems_usb_start_xmit(struct sk_buff *skb, struct net_device *netdev) {
struct ems_usb *dev = netdev_priv(netdev);
struct ems_tx_urb_context *context = NULL;
size_t size = CPC_HEADER_SIZE + CPC_MSG_HEADER_LEN + sizeof(struct cpc_can_msg);
if (can_dropped_invalid_skb(netdev, skb)) {
... | static netdev_tx_t ems_usb_start_xmit(struct sk_buff *skb, struct net_device *netdev) {
struct ems_usb *dev = netdev_priv(netdev);
struct ems_tx_urb_context *context = NULL;
size_t size = CPC_HEADER_SIZE + CPC_MSG_HEADER_LEN + sizeof(struct cpc_can_msg);
if (can_dropped_invalid_skb(netdev, skb)) {
... | static netdev_tx_t ems_usb_start_xmit(struct sk_buff *skb, struct net_device *netdev) {
struct ems_usb *dev = netdev_priv(netdev);
struct ems_tx_urb_context *context = NULL;
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
size_t size = CPC_HEADER_SIZE + CPC_MSG_HEADER_LEN + sizeof(struct cpc_can_msg);
... | static netdev_tx_t ems_usb_start_xmit(struct sk_buff *skb, struct net_device *netdev) {
struct ems_usb *dev = netdev_priv(netdev);
struct ems_tx_urb_context *context = NULL;
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
size_t size = CPC_HEADER_SIZE + CPC_MSG_HEADER_LEN + sizeof(struct cpc_can_msg);
... | static netdev_tx_t ems_usb_start_xmit(struct sk_buff *skb, struct net_device *netdev) {
struct ems_usb *dev = netdev_priv(netdev);
struct ems_tx_urb_context *context = NULL;
size_t size = CPC_HEADER_SIZE + CPC_MSG_HEADER_LEN + sizeof(struct cpc_can_msg);
if (can_dropped_invalid_skb(netdev, skb)) {
... |
CVE-2022-2873 | linux | https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux | drivers/i2c/busses/i2c-ismt.c | ismt_access | static int ismt_access(struct i2c_adapter *adap, u16 addr, unsigned short flags, char read_write, u8 command, int size, union i2c_smbus_data *data) {
int ret;
unsigned long time_left;
dma_addr_t dma_addr = 0;
u8 dma_size = 0;
enum dma_data_direction dma_direction = 0;
struct ismt_desc *desc;
... | static int ismt_access(struct i2c_adapter *adap, u16 addr, unsigned short flags, char read_write, u8 command, int size, union i2c_smbus_data *data) {
int ret;
unsigned long time_left;
dma_addr_t dma_addr = 0;
u8 dma_size = 0;
enum dma_data_direction dma_direction = 0;
struct ismt_desc *desc;
... | static int ismt_access(struct i2c_adapter *adap, u16 addr, unsigned short flags, char read_write, u8 command, int size, union i2c_smbus_data *data) {
int ret;
unsigned long time_left;
dma_addr_t dma_addr = 0;
u8 dma_size = 0;
enum dma_data_direction dma_direction = 0;
struct ismt_desc *desc;
... | static int ismt_access(struct i2c_adapter *adap, u16 addr, unsigned short flags, char read_write, u8 command, int size, union i2c_smbus_data *data) {
int ret;
unsigned long time_left;
dma_addr_t dma_addr = 0;
u8 dma_size = 0;
enum dma_data_direction dma_direction = 0;
struct ismt_desc *desc;
... | static int ismt_access(struct i2c_adapter *adap, u16 addr, unsigned short flags, char read_write, u8 command, int size, union i2c_smbus_data *data) {
switch (size) {
case I2C_SMBUS_BLOCK_PROC_CALL:
dev_dbg(dev, "I2C_SMBUS_BLOCK_PROC_CALL\n");
dma_size = I2C_SMBUS_BLOCK_MAX;
desc->wr_len_... | static int ismt_access(struct i2c_adapter *adap, u16 addr, unsigned short flags, char read_write, u8 command, int size, union i2c_smbus_data *data) {
switch (size) {
case I2C_SMBUS_BLOCK_PROC_CALL:
dev_dbg(dev, "I2C_SMBUS_BLOCK_PROC_CALL\n");
if (data->block[0] > I2C_SMBUS_BLOCK_MAX) {
... | static int ismt_access(struct i2c_adapter *adap, u16 addr, unsigned short flags, char read_write, u8 command, int size, union i2c_smbus_data *data) {
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
switch (size) {
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
case I2C_SMBUS_BLOCK_PROC_CALL:
dev_db... | static int ismt_access(struct i2c_adapter *adap, u16 addr, unsigned short flags, char read_write, u8 command, int size, union i2c_smbus_data *data) {
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
switch (size) {
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
case I2C_SMBUS_BLOCK_PROC_CALL:
dev_db... | static int ismt_access(struct i2c_adapter *adap, u16 addr, unsigned short flags, char read_write, u8 command, int size, union i2c_smbus_data *data) {
switch (size) {
case I2C_SMBUS_BLOCK_PROC_CALL:
dev_dbg(dev, "I2C_SMBUS_BLOCK_PROC_CALL\n");
+ if (data->block[0] > I2C_SMBUS_BLOCK_MAX) {
+ ... |
CVE-2022-28893 | linux | https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux | net/sunrpc/xprt.c | xprt_connect | void xprt_connect(struct rpc_task *task) {
struct rpc_xprt *xprt = task->tk_rqstp->rq_xprt;
trace_xprt_connect(xprt);
if (!xprt_bound(xprt)) {
task->tk_status = -EAGA;
return;
}
if (!xprt_lock_write(xprt, task)) {
return;
}
if (test_and_clear_bit(XPRT_CLOSE_WAIT, &xpr... | void xprt_connect(struct rpc_task *task) {
struct rpc_xprt *xprt = task->tk_rqstp->rq_xprt;
trace_xprt_connect(xprt);
if (!xprt_bound(xprt)) {
task->tk_status = -EAGA;
return;
}
if (!xprt_lock_write(xprt, task)) {
return;
}
if (!xprt_connected(xprt) && !test_bit(XPRT_... | void xprt_connect(struct rpc_task *task) {
struct rpc_xprt *xprt = task->tk_rqstp->rq_xprt;
dprintk("RPC: %5u xprt_connect xprt %p %s connected\n", task->tk_pid, xprt, (xprt_connected(xprt) ? "is" : "is not"));
if (!xprt_bound(xprt)) {
task->tk_status = -EAGA;
return;
}
if (!xprt_loc... | void xprt_connect(struct rpc_task *task) {
struct rpc_xprt *xprt = task->tk_rqstp->rq_xprt;
dprintk("RPC: %5u xprt_connect xprt %p %s connected\n", task->tk_pid, xprt, (xprt_connected(xprt) ? "is" : "is not"));
if (!xprt_bound(xprt)) {
task->tk_status = -EAGA;
return;
}
if (!xprt_loc... | void xprt_connect(struct rpc_task *task) {
struct rpc_xprt *xprt = task->tk_rqstp->rq_xprt;
trace_xprt_connect(xprt);
if (!xprt_bound(xprt)) {
return;
}
if (!xprt_lock_write(xprt, task)) {
return;
}
if (test_and_clear_bit(XPRT_CLOSE_WAIT, &xprt->state)) {
trace_xprt_d... | void xprt_connect(struct rpc_task *task) {
struct rpc_xprt *xprt = task->tk_rqstp->rq_xprt;
trace_xprt_connect(xprt);
if (!xprt_bound(xprt)) {
return;
}
if (!xprt_lock_write(xprt, task)) {
return;
}
if (!xprt_connected(xprt) && !test_bit(XPRT_CLOSE_WAIT, &xprt->state)) {
... | void xprt_connect(struct rpc_task *task) {
struct rpc_xprt *xprt = task->tk_rqstp->rq_xprt;
dprintk("RPC: %5u xprt_connect xprt %p %s connected\n", task->tk_pid, xprt, (xprt_connected(xprt) ? "is" : "is not"));
if (!xprt_bound(xprt)) {
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
return;
}
... | void xprt_connect(struct rpc_task *task) {
struct rpc_xprt *xprt = task->tk_rqstp->rq_xprt;
dprintk("RPC: %5u xprt_connect xprt %p %s connected\n", task->tk_pid, xprt, (xprt_connected(xprt) ? "is" : "is not"));
if (!xprt_bound(xprt)) {
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
return;
}
... | void xprt_connect(struct rpc_task *task) {
struct rpc_xprt *xprt = task->tk_rqstp->rq_xprt;
trace_xprt_connect(xprt);
if (!xprt_bound(xprt)) {
return;
}
if (!xprt_lock_write(xprt, task)) {
return;
}
- if (test_and_clear_bit(XPRT_CLOSE_WAIT, &xprt->state)) {
- t... |
CVE-2022-28893 | linux | https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux | net/sunrpc/xprtsock.c | xs_local_send_request | static int xs_local_send_request(struct rpc_rqst *req) {
struct rpc_xprt *xprt = req->rq_xprt;
struct sock_xprt *transport = container_of(xprt, struct sock_xprt, xprt);
struct xdr_buf *xdr = &req->rq_snd_buf;
rpc_fraghdr rm = xs_stream_record_marker(xdr);
unsigned int msglen = rm ? req->rq_slen + si... | static int xs_local_send_request(struct rpc_rqst *req) {
struct rpc_xprt *xprt = req->rq_xprt;
struct sock_xprt *transport = container_of(xprt, struct sock_xprt, xprt);
struct xdr_buf *xdr = &req->rq_snd_buf;
rpc_fraghdr rm = xs_stream_record_marker(xdr);
unsigned int msglen = rm ? req->rq_slen + si... | static int xs_local_send_request(struct rpc_rqst *req) {
struct rpc_xprt *xprt = req->rq_xprt;
struct sock_xprt *transport = container_of(xprt, struct sock_xprt, xprt);
struct xdr_buf *xdr = &req->rq_snd_buf;
rpc_fraghdr rm = xs_stream_record_marker(xdr);
unsigned int msglen = rm ? req->rq_slen + si... | static int xs_local_send_request(struct rpc_rqst *req) {
struct rpc_xprt *xprt = req->rq_xprt;
struct sock_xprt *transport = container_of(xprt, struct sock_xprt, xprt);
struct xdr_buf *xdr = &req->rq_snd_buf;
rpc_fraghdr rm = xs_stream_record_marker(xdr);
unsigned int msglen = rm ? req->rq_slen + si... | static int xs_local_send_request(struct rpc_rqst *req) {
struct rpc_xprt *xprt = req->rq_xprt;
if (xs_send_request_was_aborted(transport, req)) {
xs_close(xprt);
return -ENOTCONN;
}
switch (status) {
case -EPIPE:
xs_close(xprt);
status = -ENOTCONN;
}
}
| static int xs_local_send_request(struct rpc_rqst *req) {
struct rpc_xprt *xprt = req->rq_xprt;
if (xs_send_request_was_aborted(transport, req)) {
xprt_force_disconnect(xprt);
return -ENOTCONN;
}
switch (status) {
case -EPIPE:
xprt_force_disconnect(xprt);
status = -ENO... | static int xs_local_send_request(struct rpc_rqst *req) {
struct rpc_xprt *xprt = req->rq_xprt;
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
if (xs_send_request_was_aborted(transport, req)) {
xs_close(xprt);
return -ENOTCONN;
}
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
switch... | static int xs_local_send_request(struct rpc_rqst *req) {
struct rpc_xprt *xprt = req->rq_xprt;
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
if (xs_send_request_was_aborted(transport, req)) {
xprt_force_disconnect(xprt);
return -ENOTCONN;
}
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT ... | static int xs_local_send_request(struct rpc_rqst *req) {
struct rpc_xprt *xprt = req->rq_xprt;
if (xs_send_request_was_aborted(transport, req)) {
- xs_close(xprt);
+ xprt_force_disconnect(xprt);
return -ENOTCONN;
}
switch (status) {
case -EPIPE:
- xs_close(xprt);
... |
CVE-2022-28893 | linux | https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux | net/sunrpc/xprtsock.c | xs_reset_transport | static void xs_reset_transport(struct sock_xprt *transport) {
struct socket *sock = transport->sock;
struct sock *sk = transport->inet;
struct rpc_xprt *xprt = &transport->xprt;
struct file *filp = transport->file;
if (sk == NULL) {
return;
}
if (atomic_read(&transport->xprt.swapper)... | static void xs_reset_transport(struct sock_xprt *transport) {
struct socket *sock = transport->sock;
struct sock *sk = transport->inet;
struct rpc_xprt *xprt = &transport->xprt;
struct file *filp = transport->file;
if (sk == NULL) {
return;
}
if (!(current->flags & PF_WQ_WORKER)) {
... | static void xs_reset_transport(struct sock_xprt *transport) {
struct socket *sock = transport->sock;
struct sock *sk = transport->inet;
struct rpc_xprt *xprt = &transport->xprt;
struct file *filp = transport->file;
if (sk == NULL) {
return;
}
if (atomic_read(&transport->xprt.swapper)... | static void xs_reset_transport(struct sock_xprt *transport) {
struct socket *sock = transport->sock;
struct sock *sk = transport->inet;
struct rpc_xprt *xprt = &transport->xprt;
struct file *filp = transport->file;
if (sk == NULL) {
return;
}
if (!(current->flags & PF_WQ_WORKER)) {
... | static void xs_reset_transport(struct sock_xprt *transport) {
struct rpc_xprt *xprt = &transport->xprt;
struct file *filp = transport->file;
if (sk == NULL) {
return;
}
trace_rpc_socket_close(xprt, sock);
fput(filp);
xprt_disconnect_done(xprt);
}
| static void xs_reset_transport(struct sock_xprt *transport) {
struct rpc_xprt *xprt = &transport->xprt;
struct file *filp = transport->file;
if (sk == NULL) {
return;
}
if (!(current->flags & PF_WQ_WORKER)) {
WARN_ON_ONCE(1);
set_bit(XPRT_CLOSE_WAIT, &xprt->state);
re... | static void xs_reset_transport(struct sock_xprt *transport) {
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
struct rpc_xprt *xprt = &transport->xprt;
struct file *filp = transport->file;
if (sk == NULL) {
return;
}
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
trace_rpc_socket_close(... | static void xs_reset_transport(struct sock_xprt *transport) {
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
struct rpc_xprt *xprt = &transport->xprt;
struct file *filp = transport->file;
if (sk == NULL) {
return;
}
if (!(current->flags & PF_WQ_WORKER)) {
WARN_ON_ONCE(1);
... | static void xs_reset_transport(struct sock_xprt *transport) {
struct rpc_xprt *xprt = &transport->xprt;
struct file *filp = transport->file;
if (sk == NULL) {
return;
}
+ if (!(current->flags & PF_WQ_WORKER)) {
+ WARN_ON_ONCE(1);
+ set_bit(XPRT_CLOSE_WAIT, &xprt->state);
+... |
CVE-2022-2905 | linux | https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux | kernel/bpf/verifier.c | record_func_key | static int record_func_key(struct bpf_verifier_env *env, struct bpf_call_arg_meta *meta, int func_id, int insn_idx) {
struct bpf_insn_aux_data *aux = &env->insn_aux_data[insn_idx];
struct bpf_reg_state *regs = cur_regs(env), *reg;
struct bpf_map *map = meta->map_ptr;
struct tnum range;
u64 val;
... | static int record_func_key(struct bpf_verifier_env *env, struct bpf_call_arg_meta *meta, int func_id, int insn_idx) {
struct bpf_insn_aux_data *aux = &env->insn_aux_data[insn_idx];
struct bpf_reg_state *regs = cur_regs(env), *reg;
struct bpf_map *map = meta->map_ptr;
u64 val, max;
int err;
if (f... | static int record_func_key(struct bpf_verifier_env *env, struct bpf_call_arg_meta *meta, int func_id, int insn_idx) {
struct bpf_insn_aux_data *aux = &env->insn_aux_data[insn_idx];
struct bpf_reg_state *regs = cur_regs(env), *reg;
struct bpf_map *map = meta->map_ptr;
struct tnum range;
u64 val;
... | static int record_func_key(struct bpf_verifier_env *env, struct bpf_call_arg_meta *meta, int func_id, int insn_idx) {
struct bpf_insn_aux_data *aux = &env->insn_aux_data[insn_idx];
struct bpf_reg_state *regs = cur_regs(env), *reg;
struct bpf_map *map = meta->map_ptr;
u64 val, max;
int err;
if (f... | static int record_func_key(struct bpf_verifier_env *env, struct bpf_call_arg_meta *meta, int func_id, int insn_idx) {
struct bpf_reg_state *regs = cur_regs(env), *reg;
struct bpf_map *map = meta->map_ptr;
struct tnum range;
u64 val;
int err;
if (!map || map->map_type != BPF_MAP_TYPE_PROG_ARRAY) ... | static int record_func_key(struct bpf_verifier_env *env, struct bpf_call_arg_meta *meta, int func_id, int insn_idx) {
struct bpf_reg_state *regs = cur_regs(env), *reg;
struct bpf_map *map = meta->map_ptr;
u64 val, max;
int err;
if (!map || map->map_type != BPF_MAP_TYPE_PROG_ARRAY) {
return -... | static int record_func_key(struct bpf_verifier_env *env, struct bpf_call_arg_meta *meta, int func_id, int insn_idx) {
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
struct bpf_reg_state *regs = cur_regs(env), *reg;
struct bpf_map *map = meta->map_ptr;
struct tnum range;
u64 val;
int err;
/* P... | static int record_func_key(struct bpf_verifier_env *env, struct bpf_call_arg_meta *meta, int func_id, int insn_idx) {
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
struct bpf_reg_state *regs = cur_regs(env), *reg;
struct bpf_map *map = meta->map_ptr;
u64 val, max;
int err;
/* PLACEHOLDER: DO NOT... | static int record_func_key(struct bpf_verifier_env *env, struct bpf_call_arg_meta *meta, int func_id, int insn_idx) {
struct bpf_reg_state *regs = cur_regs(env), *reg;
struct bpf_map *map = meta->map_ptr;
- struct tnum range;
- u64 val;
+ u64 val, max;
int err;
if (!map || map->map_type !=... |
CVE-2022-29156 | linux | https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux | drivers/infiniband/ulp/rtrs/rtrs-clt.c | alloc_clt | static struct rtrs_clt *alloc_clt(const char *sessname, size_t paths_num, u16 port, size_t pdu_sz, void *priv, void (*link_ev)(void *priv, enum rtrs_clt_link_ev ev), unsigned int reconnect_delay_sec,
unsigned int max_reconnect_attempts) {
struct rtrs_clt *clt;
int err;
if (... | static struct rtrs_clt *alloc_clt(const char *sessname, size_t paths_num, u16 port, size_t pdu_sz, void *priv, void (*link_ev)(void *priv, enum rtrs_clt_link_ev ev), unsigned int reconnect_delay_sec,
unsigned int max_reconnect_attempts) {
struct rtrs_clt *clt;
int err;
if (... | static struct rtrs_clt *alloc_clt(const char *sessname, size_t paths_num, u16 port, size_t pdu_sz, void *priv, void (*link_ev)(void *priv, enum rtrs_clt_link_ev ev), unsigned int reconnect_delay_sec,
unsigned int max_reconnect_attempts) {
struct rtrs_clt *clt;
int err;
if (... | static struct rtrs_clt *alloc_clt(const char *sessname, size_t paths_num, u16 port, size_t pdu_sz, void *priv, void (*link_ev)(void *priv, enum rtrs_clt_link_ev ev), unsigned int reconnect_delay_sec,
unsigned int max_reconnect_attempts) {
struct rtrs_clt *clt;
int err;
if (... | static struct rtrs_clt *alloc_clt(const char *sessname, size_t paths_num, u16 port, size_t pdu_sz, void *priv, void (*link_ev)(void *priv, enum rtrs_clt_link_ev ev), unsigned int reconnect_delay_sec,
unsigned int max_reconnect_attempts) {
clt = kzalloc(sizeof(*clt), GFP_KERNEL);
... | static struct rtrs_clt *alloc_clt(const char *sessname, size_t paths_num, u16 port, size_t pdu_sz, void *priv, void (*link_ev)(void *priv, enum rtrs_clt_link_ev ev), unsigned int reconnect_delay_sec,
unsigned int max_reconnect_attempts) {
clt = kzalloc(sizeof(*clt), GFP_KERNEL);
... | static struct rtrs_clt *alloc_clt(const char *sessname, size_t paths_num, u16 port, size_t pdu_sz, void *priv, void (*link_ev)(void *priv, enum rtrs_clt_link_ev ev), unsigned int reconnect_delay_sec,
unsigned int max_reconnect_attempts) {
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT ... | static struct rtrs_clt *alloc_clt(const char *sessname, size_t paths_num, u16 port, size_t pdu_sz, void *priv, void (*link_ev)(void *priv, enum rtrs_clt_link_ev ev), unsigned int reconnect_delay_sec,
unsigned int max_reconnect_attempts) {
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT ... | static struct rtrs_clt *alloc_clt(const char *sessname, size_t paths_num, u16 port, size_t pdu_sz, void *priv, void (*link_ev)(void *priv, enum rtrs_clt_link_ev ev), unsigned int reconnect_delay_sec,
unsigned int max_reconnect_attempts) {
clt = kzalloc(sizeof(*clt), GFP_KERNEL);... |
CVE-2022-29156 | linux | https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux | drivers/infiniband/ulp/rtrs/rtrs-clt.c | free_clt | static void free_clt(struct rtrs_clt *clt) {
free_permits(clt);
free_percpu(clt->pcpu_path);
mutex_destroy(&clt->paths_ev_mutex);
mutex_destroy(&clt->paths_mutex);
device_unregister(&clt->dev);
} | static void free_clt(struct rtrs_clt *clt) {
free_permits(clt);
free_percpu(clt->pcpu_path);
device_unregister(&clt->dev);
} | static void free_clt(struct rtrs_clt *clt) {
free_permits(clt);
free_percpu(clt->pcpu_path);
mutex_destroy(&clt->paths_ev_mutex);
mutex_destroy(&clt->paths_mutex);
device_unregister(&clt->dev);
} | static void free_clt(struct rtrs_clt *clt) {
free_permits(clt);
free_percpu(clt->pcpu_path);
device_unregister(&clt->dev);
} | static void free_clt(struct rtrs_clt *clt) {
free_permits(clt);
free_percpu(clt->pcpu_path);
mutex_destroy(&clt->paths_ev_mutex);
mutex_destroy(&clt->paths_mutex);
device_unregister(&clt->dev);
}
| static void free_clt(struct rtrs_clt *clt) {
free_permits(clt);
free_percpu(clt->pcpu_path);
device_unregister(&clt->dev);
}
| static void free_clt(struct rtrs_clt *clt) {
free_permits(clt);
free_percpu(clt->pcpu_path);
mutex_destroy(&clt->paths_ev_mutex);
mutex_destroy(&clt->paths_mutex);
device_unregister(&clt->dev);
}
| static void free_clt(struct rtrs_clt *clt) {
free_permits(clt);
free_percpu(clt->pcpu_path);
device_unregister(&clt->dev);
} | static void free_clt(struct rtrs_clt *clt) {
free_permits(clt);
free_percpu(clt->pcpu_path);
- mutex_destroy(&clt->paths_ev_mutex);
- mutex_destroy(&clt->paths_mutex);
device_unregister(&clt->dev);
} |
CVE-2022-29156 | linux | https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux | drivers/infiniband/ulp/rtrs/rtrs-clt.c | rtrs_clt_dev_release | static void rtrs_clt_dev_release(struct device *dev) {
struct rtrs_clt *clt = container_of(dev, struct rtrs_clt, dev);
kfree(clt);
} | static void rtrs_clt_dev_release(struct device *dev) {
struct rtrs_clt *clt = container_of(dev, struct rtrs_clt, dev);
mutex_destroy(&clt->paths_ev_mutex);
mutex_destroy(&clt->paths_mutex);
kfree(clt);
} | static void rtrs_clt_dev_release(struct device *dev) {
struct rtrs_clt *clt = container_of(dev, struct rtrs_clt, dev);
kfree(clt);
} | static void rtrs_clt_dev_release(struct device *dev) {
struct rtrs_clt *clt = container_of(dev, struct rtrs_clt, dev);
mutex_destroy(&clt->paths_ev_mutex);
mutex_destroy(&clt->paths_mutex);
kfree(clt);
} | static void rtrs_clt_dev_release(struct device *dev) {
struct rtrs_clt *clt = container_of(dev, struct rtrs_clt, dev);
kfree(clt);
}
| static void rtrs_clt_dev_release(struct device *dev) {
struct rtrs_clt *clt = container_of(dev, struct rtrs_clt, dev);
mutex_destroy(&clt->paths_ev_mutex);
mutex_destroy(&clt->paths_mutex);
kfree(clt);
}
| static void rtrs_clt_dev_release(struct device *dev) {
struct rtrs_clt *clt = container_of(dev, struct rtrs_clt, dev);
kfree(clt);
}
| static void rtrs_clt_dev_release(struct device *dev) {
struct rtrs_clt *clt = container_of(dev, struct rtrs_clt, dev);
mutex_destroy(&clt->paths_ev_mutex);
mutex_destroy(&clt->paths_mutex);
kfree(clt);
} | static void rtrs_clt_dev_release(struct device *dev) {
struct rtrs_clt *clt = container_of(dev, struct rtrs_clt, dev);
+ mutex_destroy(&clt->paths_ev_mutex);
+ mutex_destroy(&clt->paths_mutex);
kfree(clt);
} |
CVE-2022-29581 | linux | https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux | net/sched/cls_u32.c | u32_change | static int u32_change(struct net *net, struct sk_buff *in_skb, struct tcf_proto *tp, unsigned long base, u32 handle, struct nlattr **tca, void **arg, bool ovr, bool rtnl_held,
struct netlink_ext_ack *extack) {
struct tc_u_common *tp_c = tp->data;
struct tc_u_hnode *ht;
struct tc_u_knod... | static int u32_change(struct net *net, struct sk_buff *in_skb, struct tcf_proto *tp, unsigned long base, u32 handle, struct nlattr **tca, void **arg, bool ovr, bool rtnl_held,
struct netlink_ext_ack *extack) {
struct tc_u_common *tp_c = tp->data;
struct tc_u_hnode *ht;
struct tc_u_knod... | static int u32_change(struct net *net, struct sk_buff *in_skb, struct tcf_proto *tp, unsigned long base, u32 handle, struct nlattr **tca, void **arg, bool ovr) {
struct tc_u_common *tp_c = tp->data;
struct tc_u_hnode *ht;
struct tc_u_knode *n;
struct tc_u32_sel *s;
struct nlattr *opt = tca[TCA_OPTIO... | static int u32_change(struct net *net, struct sk_buff *in_skb, struct tcf_proto *tp, unsigned long base, u32 handle, struct nlattr **tca, void **arg, bool ovr) {
struct tc_u_common *tp_c = tp->data;
struct tc_u_hnode *ht;
struct tc_u_knode *n;
struct tc_u32_sel *s;
struct nlattr *opt = tca[TCA_OPTIO... | static int u32_change(struct net *net, struct sk_buff *in_skb, struct tcf_proto *tp, unsigned long base, u32 handle, struct nlattr **tca, void **arg, bool ovr, bool rtnl_held,
struct netlink_ext_ack *extack) {
struct nlattr *opt = tca[TCA_OPTIONS];
u32 htid, flags = 0;
err = nla_parse_... | static int u32_change(struct net *net, struct sk_buff *in_skb, struct tcf_proto *tp, unsigned long base, u32 handle, struct nlattr **tca, void **arg, bool ovr, bool rtnl_held,
struct netlink_ext_ack *extack) {
struct nlattr *opt = tca[TCA_OPTIONS];
u32 htid, flags = 0;
err = nla_parse_... | static int u32_change(struct net *net, struct sk_buff *in_skb, struct tcf_proto *tp, unsigned long base, u32 handle, struct nlattr **tca, void **arg, bool ovr) {
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
struct nlattr *opt = tca[TCA_OPTIONS];
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
u32 htid, f... | static int u32_change(struct net *net, struct sk_buff *in_skb, struct tcf_proto *tp, unsigned long base, u32 handle, struct nlattr **tca, void **arg, bool ovr) {
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
struct nlattr *opt = tca[TCA_OPTIONS];
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
u32 htid, f... | static int u32_change(struct net *net, struct sk_buff *in_skb, struct tcf_proto *tp, unsigned long base, u32 handle, struct nlattr **tca, void **arg, bool ovr, bool rtnl_held,
struct netlink_ext_ack *extack) {
struct nlattr *opt = tca[TCA_OPTIONS];
u32 htid, flags = 0;
err = nla_p... |
CVE-2022-29581 | linux | https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux | net/sched/cls_u32.c | u32_destroy_key | static int u32_destroy_key(struct tc_u_knode *n, bool free_pf) {
struct tc_u_hnode *ht = rtnl_dereference(n->ht_down);
tcf_exts_destroy(&n->exts);
tcf_exts_put_net(&n->exts);
if (ht && --ht->refcnt == 0) {
kfree(ht);
}
if (free_pf) {
free_percpu(n->pf);
}
if (free_pf) {
... | static void u32_destroy_key(struct tc_u_knode *n, bool free_pf) {
tcf_exts_put_net(&n->exts);
if (free_pf) {
free_percpu(n->pf);
}
if (free_pf) {
free_percpu(n->pcpu_success);
}
__u32_destroy_key(n);
} | static int u32_destroy_key(struct tcf_proto *tp, struct tc_u_knode *n, bool free_pf) {
struct tc_u_hnode *ht = rtnl_dereference(n->ht_down);
tcf_exts_destroy(&n->exts);
tcf_exts_put_net(&n->exts);
if (ht && --ht->refcnt == 0) {
kfree(ht);
}
if (free_pf) {
free_percpu(n->pf);
... | static void u32_destroy_key(struct tcf_proto *tp, struct tc_u_knode *n, bool free_pf) {
tcf_exts_put_net(&n->exts);
if (free_pf) {
free_percpu(n->pf);
}
if (free_pf) {
free_percpu(n->pcpu_success);
}
__u32_destroy_key(n);
} | static int u32_destroy_key(struct tc_u_knode *n, bool free_pf) {
struct tc_u_hnode *ht = rtnl_dereference(n->ht_down);
tcf_exts_destroy(&n->exts);
tcf_exts_put_net(&n->exts);
if (ht && --ht->refcnt == 0) {
kfree(ht);
}
kfree(n);
return 0;
}
| static void u32_destroy_key(struct tc_u_knode *n, bool free_pf) {
tcf_exts_put_net(&n->exts);
__u32_destroy_key(n);
}
| static int u32_destroy_key(struct tcf_proto *tp, struct tc_u_knode *n, bool free_pf) {
struct tc_u_hnode *ht = rtnl_dereference(n->ht_down);
tcf_exts_destroy(&n->exts);
tcf_exts_put_net(&n->exts);
if (ht && --ht->refcnt == 0) {
kfree(ht);
}
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
... | static void u32_destroy_key(struct tcf_proto *tp, struct tc_u_knode *n, bool free_pf) {
tcf_exts_put_net(&n->exts);
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
__u32_destroy_key(n);
} | -static int u32_destroy_key(struct tc_u_knode *n, bool free_pf) {
- struct tc_u_hnode *ht = rtnl_dereference(n->ht_down);
- tcf_exts_destroy(&n->exts);
+static void u32_destroy_key(struct tc_u_knode *n, bool free_pf) {
tcf_exts_put_net(&n->exts);
- if (ht && --ht->refcnt == 0) {
- kfree(ht);
- }... |
CVE-2022-2959 | linux | https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux | fs/pipe.c | pipe_resize_ring | int pipe_resize_ring(struct pipe_inode_info *pipe, unsigned int nr_slots) {
struct pipe_buffer *bufs;
unsigned int head, tail, mask, n;
mask = pipe->ring_size - 1;
head = pipe->head;
tail = pipe->tail;
n = pipe_occupancy(pipe->head, pipe->tail);
if (nr_slots < n) {
return -EBUSY;
... | int pipe_resize_ring(struct pipe_inode_info *pipe, unsigned int nr_slots) {
struct pipe_buffer *bufs;
unsigned int head, tail, mask, n;
bufs = kcalloc(nr_slots, sizeof(*bufs), GFP_KERNEL_ACCOUNT | __GFP_NOWARN);
if (unlikely(!bufs)) {
return -ENOMEM;
}
spin_lock_irq(&pipe->rd_wait.lock);... | int pipe_resize_ring(struct pipe_inode_info *pipe, unsigned int nr_slots) {
struct pipe_buffer *bufs;
unsigned int head, tail, mask, n;
mask = pipe->ring_size - 1;
head = pipe->head;
tail = pipe->tail;
n = pipe_occupancy(pipe->head, pipe->tail);
if (nr_slots < n) {
return -EBUSY;
... | int pipe_resize_ring(struct pipe_inode_info *pipe, unsigned int nr_slots) {
struct pipe_buffer *bufs;
unsigned int head, tail, mask, n;
bufs = kcalloc(nr_slots, sizeof(*bufs), GFP_KERNEL_ACCOUNT | __GFP_NOWARN);
if (unlikely(!bufs)) {
return -ENOMEM;
}
spin_lock_irq(&pipe->rd_wait.lock);... | int pipe_resize_ring(struct pipe_inode_info *pipe, unsigned int nr_slots) {
unsigned int head, tail, mask, n;
mask = pipe->ring_size - 1;
head = pipe->head;
tail = pipe->tail;
n = pipe_occupancy(pipe->head, pipe->tail);
if (nr_slots < n) {
return -EBUSY;
}
bufs = kcalloc(nr_slots... | int pipe_resize_ring(struct pipe_inode_info *pipe, unsigned int nr_slots) {
unsigned int head, tail, mask, n;
bufs = kcalloc(nr_slots, sizeof(*bufs), GFP_KERNEL_ACCOUNT | __GFP_NOWARN);
if (unlikely(!bufs)) {
return -ENOMEM;
}
spin_lock_irq(&pipe->rd_wait.lock);
mask = pipe->ring_size - ... | int pipe_resize_ring(struct pipe_inode_info *pipe, unsigned int nr_slots) {
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
unsigned int head, tail, mask, n;
mask = pipe->ring_size - 1;
head = pipe->head;
tail = pipe->tail;
n = pipe_occupancy(pipe->head, pipe->tail);
if (nr_slots < n) {
... | int pipe_resize_ring(struct pipe_inode_info *pipe, unsigned int nr_slots) {
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
unsigned int head, tail, mask, n;
bufs = kcalloc(nr_slots, sizeof(*bufs), GFP_KERNEL_ACCOUNT | __GFP_NOWARN);
if (unlikely(!bufs)) {
return -ENOMEM;
}
spin_lock_irq(&... | int pipe_resize_ring(struct pipe_inode_info *pipe, unsigned int nr_slots) {
unsigned int head, tail, mask, n;
+ bufs = kcalloc(nr_slots, sizeof(*bufs), GFP_KERNEL_ACCOUNT | __GFP_NOWARN);
+ if (unlikely(!bufs)) {
+ return -ENOMEM;
+ }
+ spin_lock_irq(&pipe->rd_wait.lock);
mask = pipe->ring... |
CVE-2022-2964 | linux | https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux | drivers/net/usb/ax88179_178a.c | ax88179_rx_fixup | static int ax88179_rx_fixup(struct usbnet *dev, struct sk_buff *skb) {
struct sk_buff *ax_skb;
int pkt_cnt;
u32 rx_hdr;
u16 hdr_off;
u32 *pkt_hdr;
if (skb->len < dev->net->hard_header_len) {
return 0;
}
skb_trim(skb, skb->len - 4);
rx_hdr = get_unaligned_le32(skb_tail_pointer... | static int ax88179_rx_fixup(struct usbnet *dev, struct sk_buff *skb) {
struct sk_buff *ax_skb;
int pkt_cnt;
u32 rx_hdr;
u16 hdr_off;
u32 *pkt_hdr;
if (skb->len < 4) {
return 0;
}
skb_trim(skb, skb->len - 4);
rx_hdr = get_unaligned_le32(skb_tail_pointer(skb));
pkt_cnt = (u... | static int ax88179_rx_fixup(struct usbnet *dev, struct sk_buff *skb) {
struct sk_buff *ax_skb;
int pkt_cnt;
u32 rx_hdr;
u16 hdr_off;
u32 *pkt_hdr;
if (skb->len < dev->net->hard_header_len) {
return 0;
}
skb_trim(skb, skb->len - 4);
memcpy(&rx_hdr, skb_tail_pointer(skb), 4);
... | static int ax88179_rx_fixup(struct usbnet *dev, struct sk_buff *skb) {
struct sk_buff *ax_skb;
int pkt_cnt;
u32 rx_hdr;
u16 hdr_off;
u32 *pkt_hdr;
if (skb->len < 4) {
return 0;
}
skb_trim(skb, skb->len - 4);
memcpy(&rx_hdr, skb_tail_pointer(skb), 4);
le32_to_cpus(&rx_hdr)... | static int ax88179_rx_fixup(struct usbnet *dev, struct sk_buff *skb) {
u32 *pkt_hdr;
if (skb->len < dev->net->hard_header_len) {
return 0;
}
skb_trim(skb, skb->len - 4);
rx_hdr = get_unaligned_le32(skb_tail_pointer(skb));
pkt_cnt = (u16)rx_hdr;
hdr_off = (u16)(rx_hdr >> 16);
pkt_... | static int ax88179_rx_fixup(struct usbnet *dev, struct sk_buff *skb) {
u32 *pkt_hdr;
if (skb->len < 4) {
return 0;
}
skb_trim(skb, skb->len - 4);
rx_hdr = get_unaligned_le32(skb_tail_pointer(skb));
pkt_cnt = (u16)rx_hdr;
hdr_off = (u16)(rx_hdr >> 16);
if (pkt_cnt == 0) {
... | static int ax88179_rx_fixup(struct usbnet *dev, struct sk_buff *skb) {
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
u32 *pkt_hdr;
if (skb->len < dev->net->hard_header_len) {
return 0;
}
skb_trim(skb, skb->len - 4);
memcpy(&rx_hdr, skb_tail_pointer(skb), 4);
le32_to_cpus(&rx_hdr);
... | static int ax88179_rx_fixup(struct usbnet *dev, struct sk_buff *skb) {
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
u32 *pkt_hdr;
if (skb->len < 4) {
return 0;
}
skb_trim(skb, skb->len - 4);
memcpy(&rx_hdr, skb_tail_pointer(skb), 4);
le32_to_cpus(&rx_hdr);
pkt_cnt = (u16)rx_hdr;... | static int ax88179_rx_fixup(struct usbnet *dev, struct sk_buff *skb) {
u32 *pkt_hdr;
- if (skb->len < dev->net->hard_header_len) {
+ if (skb->len < 4) {
return 0;
}
skb_trim(skb, skb->len - 4);
rx_hdr = get_unaligned_le32(skb_tail_pointer(skb));
pkt_cnt = (u16)rx_hdr;
hdr_o... |
CVE-2022-2977 | linux | https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux | drivers/char/tpm/tpm-chip.c | tpm_add_char_device | static int tpm_add_char_device(struct tpm_chip *chip) {
int rc;
rc = cdev_device_add(&chip->cdev, &chip->dev);
if (rc) {
dev_err(&chip->dev, "unable to cdev_device_add() %s, major %d, minor %d, err=%d\n", dev_name(&chip->dev), MAJOR(chip->dev.devt), MOR(chip->dev.devt), rc);
return rc;
}... | static int tpm_add_char_device(struct tpm_chip *chip) {
int rc;
rc = cdev_device_add(&chip->cdev, &chip->dev);
if (rc) {
dev_err(&chip->dev, "unable to cdev_device_add() %s, major %d, minor %d, err=%d\n", dev_name(&chip->dev), MAJOR(chip->dev.devt), MOR(chip->dev.devt), rc);
return rc;
}... | static int tpm_add_char_device(struct tpm_chip *chip) {
int rc;
rc = cdev_device_add(&chip->cdev, &chip->dev);
if (rc) {
dev_err(&chip->dev, "unable to cdev_device_add() %s, major %d, minor %d, err=%d\n", dev_name(&chip->dev), MAJOR(chip->dev.devt), MOR(chip->dev.devt), rc);
return rc;
}... | static int tpm_add_char_device(struct tpm_chip *chip) {
int rc;
rc = cdev_device_add(&chip->cdev, &chip->dev);
if (rc) {
dev_err(&chip->dev, "unable to cdev_device_add() %s, major %d, minor %d, err=%d\n", dev_name(&chip->dev), MAJOR(chip->dev.devt), MOR(chip->dev.devt), rc);
return rc;
}... | static int tpm_add_char_device(struct tpm_chip *chip) {
if (chip->flags & TPM_CHIP_FLAG_TPM2 && !tpm_is_firmware_upgrade(chip)) {
rc = cdev_device_add(&chip->cdevs, &chip->devs);
if (rc) {
dev_err(&chip->devs, "unable to cdev_device_add() %s, major %d, minor %d, err=%d\n", dev_name(&chip... | static int tpm_add_char_device(struct tpm_chip *chip) {
if (chip->flags & TPM_CHIP_FLAG_TPM2 && !tpm_is_firmware_upgrade(chip)) {
rc = tpm_devs_add(chip);
if (rc) {
goto err_del_cdev;
}
}
idr_replace(&dev_nums_idr, chip, chip->dev_num);
mutex_unlock(&idr_lock);
re... | static int tpm_add_char_device(struct tpm_chip *chip) {
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
if (chip->flags & TPM_CHIP_FLAG_TPM2) {
rc = cdev_device_add(&chip->cdevs, &chip->devs);
if (rc) {
dev_err(&chip->devs, "unable to cdev_device_add() %s, major %d, minor %d, err=%d\n"... | static int tpm_add_char_device(struct tpm_chip *chip) {
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
if (chip->flags & TPM_CHIP_FLAG_TPM2) {
rc = tpm_devs_add(chip);
if (rc) {
goto err_del_cdev;
}
}
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
idr_replace(&dev_n... | static int tpm_add_char_device(struct tpm_chip *chip) {
if (chip->flags & TPM_CHIP_FLAG_TPM2 && !tpm_is_firmware_upgrade(chip)) {
- rc = cdev_device_add(&chip->cdevs, &chip->devs);
+ rc = tpm_devs_add(chip);
if (rc) {
- dev_err(&chip->devs, "unable to cdev_device_add() %s, major ... |
CVE-2022-2977 | linux | https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux | drivers/char/tpm/tpm-chip.c | tpm_chip_alloc | struct tpm_chip *tpm_chip_alloc(struct device *pdev, const struct tpm_class_ops *ops) {
struct tpm_chip *chip;
int rc;
chip = kzalloc(sizeof(*chip), GFP_KERNEL);
if (chip == NULL) {
return ERR_PTR(-ENOMEM);
}
mutex_init(&chip->tpm_mutex);
init_rwsem(&chip->ops_sem);
chip->ops = o... | struct tpm_chip *tpm_chip_alloc(struct device *pdev, const struct tpm_class_ops *ops) {
struct tpm_chip *chip;
int rc;
chip = kzalloc(sizeof(*chip), GFP_KERNEL);
if (chip == NULL) {
return ERR_PTR(-ENOMEM);
}
mutex_init(&chip->tpm_mutex);
init_rwsem(&chip->ops_sem);
chip->ops = o... | struct tpm_chip *tpm_chip_alloc(struct device *pdev, const struct tpm_class_ops *ops) {
struct tpm_chip *chip;
int rc;
chip = kzalloc(sizeof(*chip), GFP_KERNEL);
if (chip == NULL) {
return ERR_PTR(-ENOMEM);
}
mutex_init(&chip->tpm_mutex);
init_rwsem(&chip->ops_sem);
chip->ops = o... | struct tpm_chip *tpm_chip_alloc(struct device *pdev, const struct tpm_class_ops *ops) {
struct tpm_chip *chip;
int rc;
chip = kzalloc(sizeof(*chip), GFP_KERNEL);
if (chip == NULL) {
return ERR_PTR(-ENOMEM);
}
mutex_init(&chip->tpm_mutex);
init_rwsem(&chip->ops_sem);
chip->ops = o... | struct tpm_chip *tpm_chip_alloc(struct device *pdev, const struct tpm_class_ops *ops) {
chip = kzalloc(sizeof(*chip), GFP_KERNEL);
if (chip == NULL) {
return ERR_PTR(-ENOMEM);
}
rc = idr_alloc(&dev_nums_idr, NULL, 0, TPM_NUM_DEVICES, GFP_KERNEL);
if (rc < 0) {
return ERR_PTR(rc);
... | struct tpm_chip *tpm_chip_alloc(struct device *pdev, const struct tpm_class_ops *ops) {
chip = kzalloc(sizeof(*chip), GFP_KERNEL);
if (chip == NULL) {
return ERR_PTR(-ENOMEM);
}
rc = idr_alloc(&dev_nums_idr, NULL, 0, TPM_NUM_DEVICES, GFP_KERNEL);
if (rc < 0) {
return ERR_PTR(rc);
... | struct tpm_chip *tpm_chip_alloc(struct device *pdev, const struct tpm_class_ops *ops) {
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
chip = kzalloc(sizeof(*chip), GFP_KERNEL);
if (chip == NULL) {
return ERR_PTR(-ENOMEM);
}
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
rc = idr_alloc(&de... | struct tpm_chip *tpm_chip_alloc(struct device *pdev, const struct tpm_class_ops *ops) {
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
chip = kzalloc(sizeof(*chip), GFP_KERNEL);
if (chip == NULL) {
return ERR_PTR(-ENOMEM);
}
/* PLACEHOLDER: DO NOT DELETE THIS COMMENT */
rc = idr_alloc(&de... | struct tpm_chip *tpm_chip_alloc(struct device *pdev, const struct tpm_class_ops *ops) {
chip = kzalloc(sizeof(*chip), GFP_KERNEL);
if (chip == NULL) {
return ERR_PTR(-ENOMEM);
}
rc = idr_alloc(&dev_nums_idr, NULL, 0, TPM_NUM_DEVICES, GFP_KERNEL);
if (rc < 0) {
return ERR_PTR(... |
CVE-2022-2977 | linux | https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux | drivers/char/tpm/tpm-chip.c | tpm_chip_unregister | void tpm_chip_unregister(struct tpm_chip *chip) {
tpm_del_legacy_sysfs(chip);
if (IS_ENABLED(CONFIG_HW_RANDOM_TPM) && !tpm_is_firmware_upgrade(chip)) {
hwrng_unregister(&chip->hwrng);
}
tpm_bios_log_teardown(chip);
if (chip->flags & TPM_CHIP_FLAG_TPM2 && !tpm_is_firmware_upgrade(chip)) {
... | void tpm_chip_unregister(struct tpm_chip *chip) {
tpm_del_legacy_sysfs(chip);
if (IS_ENABLED(CONFIG_HW_RANDOM_TPM) && !tpm_is_firmware_upgrade(chip)) {
hwrng_unregister(&chip->hwrng);
}
tpm_bios_log_teardown(chip);
if (chip->flags & TPM_CHIP_FLAG_TPM2 && !tpm_is_firmware_upgrade(chip)) {
... | void tpm_chip_unregister(struct tpm_chip *chip) {
tpm_del_legacy_sysfs(chip);
tpm_bios_log_teardown(chip);
if (chip->flags & TPM_CHIP_FLAG_TPM2) {
cdev_device_del(&chip->cdevs, &chip->devs);
}
tpm_del_char_device(chip);
} | void tpm_chip_unregister(struct tpm_chip *chip) {
tpm_del_legacy_sysfs(chip);
tpm_bios_log_teardown(chip);
if (chip->flags & TPM_CHIP_FLAG_TPM2) {
tpm_devs_remove(chip);
}
tpm_del_char_device(chip);
} | void tpm_chip_unregister(struct tpm_chip *chip) {
tpm_del_legacy_sysfs(chip);
tpm_bios_log_teardown(chip);
if (chip->flags & TPM_CHIP_FLAG_TPM2 && !tpm_is_firmware_upgrade(chip)) {
cdev_device_del(&chip->cdevs, &chip->devs);
}
tpm_del_char_device(chip);
}
| void tpm_chip_unregister(struct tpm_chip *chip) {
tpm_del_legacy_sysfs(chip);
tpm_bios_log_teardown(chip);
if (chip->flags & TPM_CHIP_FLAG_TPM2 && !tpm_is_firmware_upgrade(chip)) {
tpm_devs_remove(chip);
}
tpm_del_char_device(chip);
}
| void tpm_chip_unregister(struct tpm_chip *chip) {
tpm_del_legacy_sysfs(chip);
tpm_bios_log_teardown(chip);
if (chip->flags & TPM_CHIP_FLAG_TPM2) {
cdev_device_del(&chip->cdevs, &chip->devs);
}
tpm_del_char_device(chip);
}
| void tpm_chip_unregister(struct tpm_chip *chip) {
tpm_del_legacy_sysfs(chip);
tpm_bios_log_teardown(chip);
if (chip->flags & TPM_CHIP_FLAG_TPM2) {
tpm_devs_remove(chip);
}
tpm_del_char_device(chip);
} | void tpm_chip_unregister(struct tpm_chip *chip) {
tpm_del_legacy_sysfs(chip);
tpm_bios_log_teardown(chip);
if (chip->flags & TPM_CHIP_FLAG_TPM2 && !tpm_is_firmware_upgrade(chip)) {
- cdev_device_del(&chip->cdevs, &chip->devs);
+ tpm_devs_remove(chip);
}
tpm_del_char_device(chip);... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.