Skip to content
OpenAdvisories

Weakness (CWE)

CWE-476: NULL Pointer Dereference

Base

The product dereferences a pointer that it expects to be valid but is NULL.

How to prevent it (5 mitigations)
  1. Implementation

    For any pointers that could have been modified or provided from a function that can return NULL, check the pointer for NULL before use. When working with a multithreaded or otherwise asynchronous environment, ensure that proper locking APIs are used to lock before the check, and unlock when it has finished [REF-1484].

  2. Requirements

    Select a programming language that is not susceptible to these issues.

  3. Implementation

    Check the results of all functions that return a value and verify that the value is non-null before acting upon it.

  4. Architecture and Design

    Identify all variables and data stores that receive information from external sources, and apply input validation to make sure that they are only initialized to expected values.

  5. Implementation

    Explicitly initialize all variables and other data stores, either during declaration or just before the first usage.

Source: MITRE CWE-476

2,669 results · Feed

  • Medium 5.5

    net/mlx5: DR, prevent potential error pointer dereference

    In the Linux kernel, the following vulnerability has been resolved: net/mlx5: DR, prevent potential error pointer dereference The dr_domain_add_vport_cap() function generally returns NULL on error but sometimes we want it to return ERR_PTR(-EBUSY) so the call…

  • Medium 5.5

    net: enetc: Do not configure preemptible TCs if SIs do not support

    In the Linux kernel, the following vulnerability has been resolved: net: enetc: Do not configure preemptible TCs if SIs do not support Both ENETC PF and VF drivers share enetc_setup_tc_mqprio() to configure MQPRIO. And enetc_setup_tc_mqprio() calls enetc_chan…

  • Medium 5.5

    ipv6: avoid possible NULL deref in modify_prefix_route()

    In the Linux kernel, the following vulnerability has been resolved: ipv6: avoid possible NULL deref in modify_prefix_route() syzbot found a NULL deref [1] in modify_prefix_route(), caused by one fib6_info without a fib6_table pointer set. This can happen for …

  • Medium 5.5

    gpio: grgpio: Add NULL check in grgpio_probe

    In the Linux kernel, the following vulnerability has been resolved: gpio: grgpio: Add NULL check in grgpio_probe devm_kasprintf() can return a NULL pointer on failure,but this returned value in grgpio_probe is not checked. Add NULL check in grgpio_probe, to h…

  • Medium 5.5

    HID: wacom: fix when get product name maybe null pointer

    In the Linux kernel, the following vulnerability has been resolved: HID: wacom: fix when get product name maybe null pointer Due to incorrect dev->product reporting by certain devices, null pointer dereferences occur when dev->product is empty, leading to pot…

  • Medium 5.5

    cacheinfo: Allocate memory during CPU hotplug if not done from the primary CPU

    In the Linux kernel, the following vulnerability has been resolved: cacheinfo: Allocate memory during CPU hotplug if not done from the primary CPU Commit 5944ce092b97 ("arch_topology: Build cacheinfo from primary CPU") adds functionality that architectures ca…

  • Medium 5.5

    mm/gup: handle NULL pages in unpin_user_pages()

    In the Linux kernel, the following vulnerability has been resolved: mm/gup: handle NULL pages in unpin_user_pages() The recent addition of "pofs" (pages or folios) handling to gup has a flaw: it assumes that unpin_user_pages() handles NULL pages in the pages*…

  • Medium 5.5

    mm/mempolicy: fix migrate_to_node() assuming there is at least one VMA in a MM

    In the Linux kernel, the following vulnerability has been resolved: mm/mempolicy: fix migrate_to_node() assuming there is at least one VMA in a MM We currently assume that there is at least one VMA in a MM, which isn't true. So we might end up having find_vma…

  • Medium 5.5

    wifi: brcmfmac: Fix oops due to NULL pointer dereference in brcmf_sdiod_sglist_rw()

    In the Linux kernel, the following vulnerability has been resolved: wifi: brcmfmac: Fix oops due to NULL pointer dereference in brcmf_sdiod_sglist_rw() This patch fixes a NULL pointer dereference bug in brcmfmac that occurs when a high 'sd_sgentry_align' valu…

  • Medium 5.5

    leds: class: Protect brightness_show() with led_cdev->led_access mutex

    In the Linux kernel, the following vulnerability has been resolved: leds: class: Protect brightness_show() with led_cdev->led_access mutex There is NULL pointer issue observed if from Process A where hid device being added which results in adding a led_cdev a…

  • Medium 5.5

    media: qcom: camss: fix error path on configuration of power domains

    In the Linux kernel, the following vulnerability has been resolved: media: qcom: camss: fix error path on configuration of power domains There is a chance to meet runtime issues during configuration of CAMSS power domains, because on the error path dev_pm_dom…

  • Medium 5.5

    media: amphion: Set video drvdata before register video device

    In the Linux kernel, the following vulnerability has been resolved: media: amphion: Set video drvdata before register video device The video drvdata should be set before the video device is registered, otherwise video_drvdata() may return NULL in the open() f…

  • Medium 5.5

    media: imx-jpeg: Set video drvdata before register video device

    In the Linux kernel, the following vulnerability has been resolved: media: imx-jpeg: Set video drvdata before register video device The video drvdata should be set before the video device is registered, otherwise video_drvdata() may return NULL in the open() …

  • Medium 5.5

    media: mtk-jpeg: Fix null-ptr-deref during unload module

    In the Linux kernel, the following vulnerability has been resolved: media: mtk-jpeg: Fix null-ptr-deref during unload module The workqueue should be destroyed in mtk_jpeg_core.c since commit 09aea13ecf6f ("media: mtk-jpeg: refactor some variables"), otherwise…

  • Medium 5.5

    media: ts2020: fix null-ptr-deref in ts2020_probe()

    In the Linux kernel, the following vulnerability has been resolved: media: ts2020: fix null-ptr-deref in ts2020_probe() KASAN reported a null-ptr-deref issue when executing the following command: # echo ts2020 0x20 > /sys/bus/i2c/devices/i2c-0/new_device KASA…

  • Medium 5.5

    media: imx-jpeg: Ensure power suppliers be suspended before detach them

    In the Linux kernel, the following vulnerability has been resolved: media: imx-jpeg: Ensure power suppliers be suspended before detach them The power suppliers are always requested to suspend asynchronously, dev_pm_domain_detach() requires the caller to ensur…

  • Medium 5.5

    ftrace: Fix regression with module command in stack_trace_filter

    In the Linux kernel, the following vulnerability has been resolved: ftrace: Fix regression with module command in stack_trace_filter When executing the following command: # echo "write*:mod:ext3" > /sys/kernel/tracing/stack_trace_filter The current mod comman…

  • Medium 4.7

    iommu/arm-smmu: Defer probe of clients after smmu device bound

    In the Linux kernel, the following vulnerability has been resolved: iommu/arm-smmu: Defer probe of clients after smmu device bound Null pointer dereference occurs due to a race between smmu driver probe and client driver probe, when of_dma_configure() for cli…

  • Medium 5.5

    udmabuf: change folios array from kmalloc to kvmalloc

    In the Linux kernel, the following vulnerability has been resolved: udmabuf: change folios array from kmalloc to kvmalloc When PAGE_SIZE 4096, MAX_PAGE_ORDER 10, 64bit machine, page_alloc only support 4MB. If above this, trigger this warn and return NULL. udm…

  • High 7.8

    accel/ivpu: Prevent recovery invocation during probe and resume

    In the Linux kernel, the following vulnerability has been resolved: accel/ivpu: Prevent recovery invocation during probe and resume Refactor IPC send and receive functions to allow correct handling of operations that should not trigger a recovery process. Exp…

  • Medium 5.5

    drm: xlnx: zynqmp_disp: layer may be null while releasing

    In the Linux kernel, the following vulnerability has been resolved: drm: xlnx: zynqmp_disp: layer may be null while releasing layer->info can be null if we have an error on the first layer in zynqmp_disp_create_layers

  • Medium 5.5

    wifi: cw1200: Fix potential NULL dereference

    In the Linux kernel, the following vulnerability has been resolved: wifi: cw1200: Fix potential NULL dereference A recent refactoring was identified by static analysis to cause a potential NULL dereference, fix this!

  • Medium 5.5

    wifi: rtw89: coex: check NULL return of kmalloc in btc_fw_set_monreg()

    In the Linux kernel, the following vulnerability has been resolved: wifi: rtw89: coex: check NULL return of kmalloc in btc_fw_set_monreg() kmalloc may fail, return value might be NULL and will cause NULL pointer dereference. Add check NULL return of kmalloc i…

  • Medium 5.5

    Bluetooth: btmtk: adjust the position to init iso data anchor

    In the Linux kernel, the following vulnerability has been resolved: Bluetooth: btmtk: adjust the position to init iso data anchor MediaTek iso data anchor init should be moved to where MediaTek claims iso data interface. If there is an unexpected BT usb disco…

  • Medium 5.5

    erofs: fix file-backed mounts over FUSE

    In the Linux kernel, the following vulnerability has been resolved: erofs: fix file-backed mounts over FUSE syzbot reported a null-ptr-deref in fuse_read_args_fill: fuse_read_folio+0xb0/0x100 fs/fuse/file.c:905 filemap_read_folio+0xc6/0x2a0 mm/filemap.c:2367 …

  • Medium 5.5

    unicode: Fix utf8_load() error path

    In the Linux kernel, the following vulnerability has been resolved: unicode: Fix utf8_load() error path utf8_load() requests the symbol "utf8_data_table" and then checks if the requested UTF-8 version is supported. If it's unsupported, it tries to put the dat…

  • Medium 5.5

    cpufreq: CPPC: Fix possible null-ptr-deref for cpufreq_cpu_get_raw()

    In the Linux kernel, the following vulnerability has been resolved: cpufreq: CPPC: Fix possible null-ptr-deref for cpufreq_cpu_get_raw() cpufreq_cpu_get_raw() may return NULL if the cpu is not in policy->cpus cpu mask and it will cause null pointer dereferenc…

  • Medium 5.5

    cpufreq: CPPC: Fix possible null-ptr-deref for cppc_get_cpu_cost()

    In the Linux kernel, the following vulnerability has been resolved: cpufreq: CPPC: Fix possible null-ptr-deref for cppc_get_cpu_cost() cpufreq_cpu_get_raw() may return NULL if the cpu is not in policy->cpus cpu mask and it will cause null pointer dereference,…

  • High 7.5

    RDMA/hns: Fix NULL pointer derefernce in hns_roce_map_mr_sg()

    In the Linux kernel, the following vulnerability has been resolved: RDMA/hns: Fix NULL pointer derefernce in hns_roce_map_mr_sg() ib_map_mr_sg() allows ULPs to specify NULL as the sg_offset argument. The driver needs to check whether it is a NULL pointer befo…

  • High 8.8

    RDMA/mlx5: Move events notifier registration to be after device registration

    In the Linux kernel, the following vulnerability has been resolved: RDMA/mlx5: Move events notifier registration to be after device registration Move pkey change work initialization and cleanup from device resources stage to notifier stage, since this is the …

  • High 7.5

    NFSD: Prevent NULL dereference in nfsd4_process_cb_update()

    In the Linux kernel, the following vulnerability has been resolved: NFSD: Prevent NULL dereference in nfsd4_process_cb_update() @ses is initialized to NULL. If __nfsd4_find_backchannel() finds no available backchannel session, setup_callback_client() will try…

  • Medium 5.5

    drm/amd/display: Fix null check for pipe_ctx->plane_state in hwss_setup_dpp

    In the Linux kernel, the following vulnerability has been resolved: drm/amd/display: Fix null check for pipe_ctx->plane_state in hwss_setup_dpp This commit addresses a null pointer dereference issue in hwss_setup_dpp(). The issue could occur when pipe_ctx->pl…

  • Medium 5.5

    drm/amd/display: Fix null check for pipe_ctx->plane_state in dcn20_program_pipe

    In the Linux kernel, the following vulnerability has been resolved: drm/amd/display: Fix null check for pipe_ctx->plane_state in dcn20_program_pipe This commit addresses a null pointer dereference issue in dcn20_program_pipe(). Previously, commit 8e4ed3cf1642…

  • Medium 5.5

    ASoC: imx-audmix: Add NULL check in imx_audmix_probe

    In the Linux kernel, the following vulnerability has been resolved: ASoC: imx-audmix: Add NULL check in imx_audmix_probe devm_kasprintf() can return a NULL pointer on failure,but this returned value in imx_audmix_probe() is not checked. Add NULL check in imx_…

  • High 7.8

    wifi: ath12k: fix crash when unbinding

    In the Linux kernel, the following vulnerability has been resolved: wifi: ath12k: fix crash when unbinding If there is an error during some initialization related to firmware, the function ath12k_dp_cc_cleanup is called to release resources. However this is r…

  • Medium 5.5

    ALSA: pcm: Add sanity NULL check for the default mmap fault handler

    In the Linux kernel, the following vulnerability has been resolved: ALSA: pcm: Add sanity NULL check for the default mmap fault handler A driver might allow the mmap access before initializing its runtime->dma_area properly. Add a proper NULL check before pas…

  • Medium 5.3

    There is a NULL pointer dereference vulnerability in some Huawei products. An attacker may send specially crafted POST …

  • Low 2.9

    OpenFHE through 1.2.3 has a NULL pointer dereference in BinFHEContext::EvalFloor in lib/binfhe-base-scheme.cpp.

  • Medium 5.5

    firmware: arm_scpi: Check the DVFS OPP count returned by the firmware

    In the Linux kernel, the following vulnerability has been resolved: firmware: arm_scpi: Check the DVFS OPP count returned by the firmware Fix a kernel crash with the below call trace when the SCPI firmware returns OPP count of zero. dvfs_info.opp_count may be…

  • Medium 5.5

    clk: clk-apple-nco: Add NULL check in applnco_probe

    In the Linux kernel, the following vulnerability has been resolved: clk: clk-apple-nco: Add NULL check in applnco_probe Add NULL check in applnco_probe, to handle kernel NULL pointer dereference error.