idx
int64
0
25.4k
project
stringclasses
707 values
project_url
stringclasses
735 values
filepath
stringlengths
4
100
commit_id
stringlengths
7
40
commit_message
stringlengths
0
18.3k
is_vulnerable
bool
2 classes
hash
stringlengths
32
32
func_name
stringlengths
3
112
func_body
stringlengths
23
235k
changed_lines
stringlengths
2
27.6k
changed_statements
stringlengths
2
161k
cve_list
listlengths
1
19
cwe_list
listlengths
1
6
fixed_func_idx
int64
1
25.4k
context
dict
0
linux
https://github.com/torvalds/linux
drivers/media/usb/dvb-usb-v2/dvb_usb_core.c
005145378c9ad7575a01b6ce1ba118fb427f583a
[media] dvb-usb-v2: avoid use-after-free I ran into a stack frame size warning because of the on-stack copy of the USB device structure: drivers/media/usb/dvb-usb-v2/dvb_usb_core.c: In function 'dvb_usbv2_disconnect': drivers/media/usb/dvb-usb-v2/dvb_usb_core.c:1029:1: error: the frame size of 1104 bytes is larger th...
true
5eed13a1f22c5a961ab0b4dcab91a1a7
dvb_usbv2_disconnect
void dvb_usbv2_disconnect(struct usb_interface *intf) { struct dvb_usb_device *d = usb_get_intfdata(intf); const char *name = d->name; struct device dev = d->udev->dev; dev_dbg(&d->udev->dev, "%s: bInterfaceNumber=%d\n", __func__, intf->cur_altsetting->desc.bInterfaceNumber); if (d->props->exit) d->props->e...
[[1015, "\tconst char *name = d->name;\n"], [1016, "\tstruct device dev = d->udev->dev;\n"], [1026, "\tdev_info(&dev, \"%s: '%s' successfully deinitialized and disconnected\\n\",\n"], [1027, "\t\t\tKBUILD_MODNAME, name);\n"]]
[[1015, "const char *name = d->name;"], [1016, "struct device dev = d->udev->dev;"], [1026, "dev_info(&dev, \"%s: '%s' successfully deinitialized and disconnected\\n\",\n\t\t\tKBUILD_MODNAME, name);"]]
[ "CVE-2017-8064" ]
[ "CWE-119" ]
1
{ "Execution Environment": [ "CONFIG_VMAP_STACK" ], "Explanation": null, "External Function": [ "usb_get_intfdata", "dev_info" ], "Function Argument": [ "intf" ], "Globals": [ "KBUILD_MODNAME" ], "Type Execution Declaration": [ "struct dvb_usb_device", "struct device" ]...
1
linux
https://github.com/torvalds/linux
drivers/media/usb/dvb-usb-v2/dvb_usb_core.c
005145378c9ad7575a01b6ce1ba118fb427f583a
[media] dvb-usb-v2: avoid use-after-free I ran into a stack frame size warning because of the on-stack copy of the USB device structure: drivers/media/usb/dvb-usb-v2/dvb_usb_core.c: In function 'dvb_usbv2_disconnect': drivers/media/usb/dvb-usb-v2/dvb_usb_core.c:1029:1: error: the frame size of 1104 bytes is larger th...
false
1adb6cd316c6ed00994b824a788e5c69
dvb_usbv2_disconnect
void dvb_usbv2_disconnect(struct usb_interface *intf) { struct dvb_usb_device *d = usb_get_intfdata(intf); const char *devname = kstrdup(dev_name(&d->udev->dev), GFP_KERNEL); const char *drvname = d->name; dev_dbg(&d->udev->dev, "%s: bInterfaceNumber=%d\n", __func__, intf->cur_altsetting->desc.bInterfaceNumber)...
[[1015, "\tconst char *devname = kstrdup(dev_name(&d->udev->dev), GFP_KERNEL);\n"], [1016, "\tconst char *drvname = d->name;\n"], [1026, "\tpr_info(\"%s: '%s:%s' successfully deinitialized and disconnected\\n\",\n"], [1027, "\t\tKBUILD_MODNAME, drvname, devname);\n"], [1028, "\tkfree(devname);\n"]]
[[1015, "const char *devname = kstrdup(dev_name(&d->udev->dev), GFP_KERNEL);"], [1016, "const char *drvname = d->name;"], [1026, "pr_info(\"%s: '%s:%s' successfully deinitialized and disconnected\\n\",\n\t\tKBUILD_MODNAME, drvname, devname);"], [1028, "kfree(devname);"]]
[ "CVE-2017-8064" ]
[ "CWE-119" ]
1
{ "Execution Environment": [ "CONFIG_VMAP_STACK" ], "Explanation": null, "External Function": [ "usb_get_intfdata", "dev_info" ], "Function Argument": [ "intf" ], "Globals": [ "KBUILD_MODNAME" ], "Type Execution Declaration": [ "struct dvb_usb_device", "struct device" ]...
2
linux
https://github.com/torvalds/linux
drivers/net/ethernet/netronome/nfp/nfpcore/nfp_cppcore.c
02e1a114fdb71e59ee6770294166c30d437bf86a
nfp: fix use-after-free in area_cache_get() area_cache_get() is used to distribute cache->area and set cache->id, and if cache->id is not 0 and cache->area->kref refcount is 0, it will release the cache->area by nfp_cpp_area_release(). area_cache_get() set cache->id before cpp->op->area_init() and nfp_cpp_area_acqu...
true
b09c47a4db6314a9ae2201fbee26ee43
area_cache_get
static struct nfp_cpp_area_cache * area_cache_get(struct nfp_cpp *cpp, u32 id, u64 addr, unsigned long *offset, size_t length) { struct nfp_cpp_area_cache *cache; int err; /* Early exit when length == 0, which prevents * the need for special case code below when * checking against available cache size. ...
[[877, "\tcache->id = id;\n"]]
[[877, "cache->id = id;"]]
[ "CVE-2022-3545" ]
[ "CWE-119" ]
3
{ "Execution Environment": [], "Explanation": null, "External Function": [ "nfp_cpp_area_release", "cpp->op->area_init", "nfp_cpp_area_acquire" ], "Function Argument": [], "Globals": [], "Type Execution Declaration": [] }
3
linux
https://github.com/torvalds/linux
drivers/net/ethernet/netronome/nfp/nfpcore/nfp_cppcore.c
02e1a114fdb71e59ee6770294166c30d437bf86a
nfp: fix use-after-free in area_cache_get() area_cache_get() is used to distribute cache->area and set cache->id, and if cache->id is not 0 and cache->area->kref refcount is 0, it will release the cache->area by nfp_cpp_area_release(). area_cache_get() set cache->id before cpp->op->area_init() and nfp_cpp_area_acqu...
false
6eb6e5761715e630d11c438f0e0f15e5
area_cache_get
static struct nfp_cpp_area_cache * area_cache_get(struct nfp_cpp *cpp, u32 id, u64 addr, unsigned long *offset, size_t length) { struct nfp_cpp_area_cache *cache; int err; /* Early exit when length == 0, which prevents * the need for special case code below when * checking against available cache size. ...
[[896, "\tcache->id = id;\n"], [897, "\n"]]
[[896, "cache->id = id;"], [897, "\n"]]
[ "CVE-2022-3545" ]
[ "CWE-119" ]
3
{ "Execution Environment": [], "Explanation": null, "External Function": [ "nfp_cpp_area_release", "cpp->op->area_init", "nfp_cpp_area_acquire" ], "Function Argument": [], "Globals": [], "Type Execution Declaration": [] }
4
linux
https://github.com/torvalds/linux
net/netfilter/ipvs/ip_vs_ctl.c
04bcef2a83f40c6db24222b27a52892cba39dffb
ipvs: Add boundary check on ioctl arguments The ipvs code has a nifty system for doing the size of ioctl command copies; it defines an array with values into which it indexes the cmd to find the right length. Unfortunately, the ipvs code forgot to check if the cmd was in the range that the array provides, allowing fo...
true
4142c8c9b956090ae535f2e0dfa2b660
do_ip_vs_get_ctl
static int do_ip_vs_get_ctl(struct sock *sk, int cmd, void __user *user, int *len) { unsigned char arg[128]; int ret = 0; if (!capable(CAP_NET_ADMIN)) return -EPERM; if (*len < get_arglen[GET_CMDID(cmd)]) { pr_err("get_ctl: len %u < %u\n", *len, get_arglen[GET_CMDID(cmd)]); return -EINVAL; } if ...
[[2365, "\tif (copy_from_user(arg, user, get_arglen[GET_CMDID(cmd)]) != 0)\n"]]
[[2365, "if (copy_from_user(arg, user, get_arglen[GET_CMDID(cmd)]) != 0)"]]
[ "CVE-2013-4588" ]
[ "CWE-119" ]
6
{ "Execution Environment": [], "Explanation": null, "External Function": [ "GET_CMDID" ], "Function Argument": [ "cmd" ], "Globals": [ "get_arglen" ], "Type Execution Declaration": [] }
5
linux
https://github.com/torvalds/linux
net/netfilter/ipvs/ip_vs_ctl.c
04bcef2a83f40c6db24222b27a52892cba39dffb
ipvs: Add boundary check on ioctl arguments The ipvs code has a nifty system for doing the size of ioctl command copies; it defines an array with values into which it indexes the cmd to find the right length. Unfortunately, the ipvs code forgot to check if the cmd was in the range that the array provides, allowing fo...
false
3952069a1f9b3d417354575f7e77abec
do_ip_vs_set_ctl
static int do_ip_vs_set_ctl(struct sock *sk, int cmd, void __user *user, unsigned int len) { int ret; unsigned char arg[MAX_ARG_LEN]; struct ip_vs_service_user *usvc_compat; struct ip_vs_service_user_kern usvc; struct ip_vs_service *svc; struct ip_vs_dest_user *udest_compat; struct ip_vs_dest_user_kern udest; ...
[[2080, "\tif (cmd < IP_VS_BASE_CTL || cmd > IP_VS_SO_SET_MAX)\n"], [2081, "\t\treturn -EINVAL;\n"], [2082, "\tif (len < 0 || len > MAX_ARG_LEN)\n"], [2083, "\t\treturn -EINVAL;\n"]]
[[2080, "if (cmd < IP_VS_BASE_CTL || cmd > IP_VS_SO_SET_MAX)"], [2081, "return -EINVAL;"], [2082, "if (len < 0 || len > MAX_ARG_LEN)"], [2083, "return -EINVAL;"]]
[ "CVE-2013-4588" ]
[ "CWE-119" ]
null
{ "Execution Environment": null, "Explanation": null, "External Function": null, "Function Argument": null, "Globals": null, "Type Execution Declaration": null }
6
linux
https://github.com/torvalds/linux
net/netfilter/ipvs/ip_vs_ctl.c
04bcef2a83f40c6db24222b27a52892cba39dffb
ipvs: Add boundary check on ioctl arguments The ipvs code has a nifty system for doing the size of ioctl command copies; it defines an array with values into which it indexes the cmd to find the right length. Unfortunately, the ipvs code forgot to check if the cmd was in the range that the array provides, allowing fo...
false
cb91c5bff7f5d1bc520dfb0a8a207efb
do_ip_vs_get_ctl
static int do_ip_vs_get_ctl(struct sock *sk, int cmd, void __user *user, int *len) { unsigned char arg[128]; int ret = 0; unsigned int copylen; if (!capable(CAP_NET_ADMIN)) return -EPERM; if (cmd < IP_VS_BASE_CTL || cmd > IP_VS_SO_GET_MAX) return -EINVAL; if (*len < get_arglen[GET_CMDID(cmd)]) { pr_err("...
[[2359, "\tunsigned int copylen;\n"], [2364, "\tif (cmd < IP_VS_BASE_CTL || cmd > IP_VS_SO_GET_MAX)\n"], [2365, "\t\treturn -EINVAL;\n"], [2366, "\n"], [2373, "\tcopylen = get_arglen[GET_CMDID(cmd)];\n"], [2374, "\tif (copylen > 128)\n"], [2375, "\t\treturn -EINVAL;\n"], [2376, "\n"], [2377, "\tif (copy_from_user(arg, ...
[[2359, "unsigned int copylen;"], [2364, "if (cmd < IP_VS_BASE_CTL || cmd > IP_VS_SO_GET_MAX)"], [2365, "return -EINVAL;"], [2366, "\n"], [2373, "copylen = get_arglen[GET_CMDID(cmd)];"], [2374, "if (copylen > 128)"], [2375, "return -EINVAL;"], [2376, "\n"], [2377, "if (copy_from_user(arg, user, copylen) != 0)"]]
[ "CVE-2013-4588" ]
[ "CWE-119" ]
6
{ "Execution Environment": [], "Explanation": null, "External Function": [ "GET_CMDID" ], "Function Argument": [ "cmd" ], "Globals": [ "get_arglen" ], "Type Execution Declaration": [] }
7
linux
https://github.com/torvalds/linux
drivers/vfio/pci/vfio_pci.c
05692d7005a364add85c6e25a6c4447ce08f913a
vfio/pci: Fix integer overflows, bitmask check The VFIO_DEVICE_SET_IRQS ioctl did not sufficiently sanitize user-supplied integers, potentially allowing memory corruption. This patch adds appropriate integer overflow checks, checks the range bounds for VFIO_IRQ_SET_DATA_NONE, and also verifies that only single element...
true
a049777f01d743bcf5935c70c207b35e
vfio_pci_ioctl
static long vfio_pci_ioctl(void *device_data, unsigned int cmd, unsigned long arg) { struct vfio_pci_device *vdev = device_data; unsigned long minsz; if (cmd == VFIO_DEVICE_GET_INFO) { struct vfio_device_info info; minsz = offsetofend(struct vfio_device_info, num_irqs); if (copy_from_user(&info, (void...
[[833, "\t\tint ret = 0;\n"], [845, "\t\tif (!(hdr.flags & VFIO_IRQ_SET_DATA_NONE)) {\n"], [846, "\t\t\tsize_t size;\n"], [847, "\t\t\tint max = vfio_pci_get_irq_count(vdev, hdr.index);\n"], [849, "\t\t\tif (hdr.flags & VFIO_IRQ_SET_DATA_BOOL)\n"], [850, "\t\t\t\tsize = sizeof(uint8_t);\n"], [851, "\t\t\telse if (hdr.f...
[[833, "int ret = 0;"], [845, "if (!(hdr.flags & VFIO_IRQ_SET_DATA_NONE))"], [846, "size_t size;"], [847, "int max = vfio_pci_get_irq_count(vdev, hdr.index);"], [849, "if (hdr.flags & VFIO_IRQ_SET_DATA_BOOL)"], [850, "size = sizeof(uint8_t);"], [851, "else if (hdr.flags & VFIO_IRQ_SET_DATA_EVENTFD)"], [852, "size = siz...
[ "CVE-2016-9083", "CVE-2016-9084" ]
[ "CWE-190", "CWE-119" ]
8
{ "Execution Environment": [], "Explanation": null, "External Function": [ "vfio_pci_get_irq_count" ], "Function Argument": [ "device_data", "cmd", "arg" ], "Globals": [ "VFIO_IRQ_SET_DATA_NONE", "VFIO_IRQ_SET_DATA_BOOL", "VFIO_IRQ_SET_DATA_EVENTFD", "VFIO_IRQ_SET_DATA_TYPE...
8
linux
https://github.com/torvalds/linux
drivers/vfio/pci/vfio_pci.c
05692d7005a364add85c6e25a6c4447ce08f913a
vfio/pci: Fix integer overflows, bitmask check The VFIO_DEVICE_SET_IRQS ioctl did not sufficiently sanitize user-supplied integers, potentially allowing memory corruption. This patch adds appropriate integer overflow checks, checks the range bounds for VFIO_IRQ_SET_DATA_NONE, and also verifies that only single element...
false
a868d284be988ce6b14e3074a510fdcf
vfio_pci_ioctl
static long vfio_pci_ioctl(void *device_data, unsigned int cmd, unsigned long arg) { struct vfio_pci_device *vdev = device_data; unsigned long minsz; if (cmd == VFIO_DEVICE_GET_INFO) { struct vfio_device_info info; minsz = offsetofend(struct vfio_device_info, num_irqs); if (copy_from_user(&info, (void...
[[832, "\t\tsize_t size;\n"], [834, "\t\tint max, ret = 0;\n"], [842, "\t\t hdr.count >= (U32_MAX - hdr.start) ||\n"], [847, "\t\tmax = vfio_pci_get_irq_count(vdev, hdr.index);\n"], [848, "\t\tif (hdr.start >= max || hdr.start + hdr.count > max)\n"], [849, "\t\t\treturn -EINVAL;\n"], [851, "\t\tswitch (hdr.flags & V...
[[832, "size_t size;"], [834, "int max, ret = 0;"], [841, "if (hdr.argsz < minsz || hdr.index >= VFIO_PCI_NUM_IRQS ||\n\t\t hdr.count >= (U32_MAX - hdr.start) ||\n\t\t hdr.flags & ~(VFIO_IRQ_SET_DATA_TYPE_MASK |\n\t\t\t\t VFIO_IRQ_SET_ACTION_TYPE_MASK))"], [847, "max = vfio_pci_get_irq_count(vdev, hdr.index);"],...
[ "CVE-2016-9083", "CVE-2016-9084" ]
[ "CWE-190", "CWE-119" ]
8
{ "Execution Environment": [], "Explanation": null, "External Function": [ "vfio_pci_get_irq_count" ], "Function Argument": [ "device_data", "cmd", "arg" ], "Globals": [ "VFIO_IRQ_SET_DATA_NONE", "VFIO_IRQ_SET_DATA_BOOL", "VFIO_IRQ_SET_DATA_EVENTFD", "VFIO_IRQ_SET_DATA_TYPE...
9
linux
https://github.com/torvalds/linux
drivers/vfio/pci/vfio_pci_intrs.c
05692d7005a364add85c6e25a6c4447ce08f913a
vfio/pci: Fix integer overflows, bitmask check The VFIO_DEVICE_SET_IRQS ioctl did not sufficiently sanitize user-supplied integers, potentially allowing memory corruption. This patch adds appropriate integer overflow checks, checks the range bounds for VFIO_IRQ_SET_DATA_NONE, and also verifies that only single element...
true
4e082208eaeda7cf04e95dca1377d293
vfio_msi_enable
static int vfio_msi_enable(struct vfio_pci_device *vdev, int nvec, bool msix) { struct pci_dev *pdev = vdev->pdev; unsigned int flag = msix ? PCI_IRQ_MSIX : PCI_IRQ_MSI; int ret; if (!is_irq_none(vdev)) return -EINVAL; vdev->ctx = kzalloc(nvec * sizeof(struct vfio_pci_irq_ctx), GFP_KERNEL); if (!vdev->ctx) ...
[[259, "\tvdev->ctx = kzalloc(nvec * sizeof(struct vfio_pci_irq_ctx), GFP_KERNEL);\n"]]
[[259, "vdev->ctx = kzalloc(nvec * sizeof(struct vfio_pci_irq_ctx), GFP_KERNEL);"]]
[ "CVE-2016-9083", "CVE-2016-9084" ]
[ "CWE-190", "CWE-119" ]
10
{ "Execution Environment": [], "Explanation": null, "External Function": [], "Function Argument": [ "nvec" ], "Globals": [], "Type Execution Declaration": [] }
10
linux
https://github.com/torvalds/linux
drivers/vfio/pci/vfio_pci_intrs.c
05692d7005a364add85c6e25a6c4447ce08f913a
vfio/pci: Fix integer overflows, bitmask check The VFIO_DEVICE_SET_IRQS ioctl did not sufficiently sanitize user-supplied integers, potentially allowing memory corruption. This patch adds appropriate integer overflow checks, checks the range bounds for VFIO_IRQ_SET_DATA_NONE, and also verifies that only single element...
false
7e49e89feb2e97fdd27fd1dc9883d202
vfio_msi_enable
static int vfio_msi_enable(struct vfio_pci_device *vdev, int nvec, bool msix) { struct pci_dev *pdev = vdev->pdev; unsigned int flag = msix ? PCI_IRQ_MSIX : PCI_IRQ_MSI; int ret; if (!is_irq_none(vdev)) return -EINVAL; vdev->ctx = kcalloc(nvec, sizeof(struct vfio_pci_irq_ctx), GFP_KERNEL); if (!vdev->ctx) r...
[[259, "\tvdev->ctx = kcalloc(nvec, sizeof(struct vfio_pci_irq_ctx), GFP_KERNEL);\n"]]
[[259, "vdev->ctx = kcalloc(nvec, sizeof(struct vfio_pci_irq_ctx), GFP_KERNEL);"]]
[ "CVE-2016-9083", "CVE-2016-9084" ]
[ "CWE-190", "CWE-119" ]
10
{ "Execution Environment": [], "Explanation": null, "External Function": [], "Function Argument": [ "nvec" ], "Globals": [], "Type Execution Declaration": [] }
11
linux
https://github.com/torvalds/linux
drivers/infiniband/hw/mlx5/qp.c
0625b4ba1a5d4703c7fb01c497bd6c156908af00
IB/mlx5: Fix leaking stack memory to userspace mlx5_ib_create_qp_resp was never initialized and only the first 4 bytes were written. Fixes: 41d902cb7c32 ("RDMA/mlx5: Fix definition of mlx5_ib_create_qp_resp") Cc: <stable@vger.kernel.org> Acked-by: Leon Romanovsky <leonro@mellanox.com> Signed-off-by: Jason Gunthorpe <...
true
4f14403d1b00e2825b924f7bae6f799d
create_qp_common
static int create_qp_common(struct mlx5_ib_dev *dev, struct ib_pd *pd, struct ib_qp_init_attr *init_attr, struct ib_udata *udata, struct mlx5_ib_qp *qp) { struct mlx5_ib_resources *devr = &dev->devr; int inlen = MLX5_ST_SZ_BYTES(create_qp_in); struct mlx5_core_dev *mdev = dev->mdev; struct mlx5_ib_cre...
[[1610, "\tstruct mlx5_ib_create_qp_resp resp;\n"]]
[[1610, "struct mlx5_ib_create_qp_resp resp;"]]
[ "CVE-2018-20855" ]
[ "CWE-119" ]
12
{ "Execution Environment": [], "Explanation": null, "External Function": [], "Function Argument": [], "Globals": [], "Type Execution Declaration": [ "struct mlx5_ib_create_qp_resp" ] }
12
linux
https://github.com/torvalds/linux
drivers/infiniband/hw/mlx5/qp.c
0625b4ba1a5d4703c7fb01c497bd6c156908af00
IB/mlx5: Fix leaking stack memory to userspace mlx5_ib_create_qp_resp was never initialized and only the first 4 bytes were written. Fixes: 41d902cb7c32 ("RDMA/mlx5: Fix definition of mlx5_ib_create_qp_resp") Cc: <stable@vger.kernel.org> Acked-by: Leon Romanovsky <leonro@mellanox.com> Signed-off-by: Jason Gunthorpe <...
false
0e311cfeb93cc5603699cbf680d9734f
create_qp_common
static int create_qp_common(struct mlx5_ib_dev *dev, struct ib_pd *pd, struct ib_qp_init_attr *init_attr, struct ib_udata *udata, struct mlx5_ib_qp *qp) { struct mlx5_ib_resources *devr = &dev->devr; int inlen = MLX5_ST_SZ_BYTES(create_qp_in); struct mlx5_core_dev *mdev = dev->mdev; struct mlx5_ib_cre...
[[1610, "\tstruct mlx5_ib_create_qp_resp resp = {};\n"]]
[[1610, "struct mlx5_ib_create_qp_resp resp = {};"]]
[ "CVE-2018-20855" ]
[ "CWE-119" ]
12
{ "Execution Environment": [], "Explanation": null, "External Function": [], "Function Argument": [], "Globals": [], "Type Execution Declaration": [ "struct mlx5_ib_create_qp_resp" ] }
13
linux
https://github.com/torvalds/linux
fs/cifs/smbencrypt.c
06deeec77a5a689cc94b21a8a91a76e42176685d
cifs: Fix smbencrypt() to stop pointing a scatterlist at the stack smbencrypt() points a scatterlist to the stack, which is breaks if CONFIG_VMAP_STACK=y. Fix it by switching to crypto_cipher_encrypt_one(). The new code should be considerably faster as an added benefit. This code is nearly identical to some code th...
true
a89228b9e70e6c1f4dc50bcf2932a2f1
smbhash
static int smbhash(unsigned char *out, const unsigned char *in, unsigned char *key) { int rc; unsigned char key2[8]; struct crypto_skcipher *tfm_des; struct scatterlist sgin, sgout; struct skcipher_request *req; str_to_key(key, key2); tfm_des = crypto_alloc_skcipher("ecb(des)", 0, CRYPTO_ALG_ASYNC); if (IS_ER...
[[72, "\tint rc;\n"], [74, "\tstruct crypto_skcipher *tfm_des;\n"], [75, "\tstruct scatterlist sgin, sgout;\n"], [76, "\tstruct skcipher_request *req;\n"], [80, "\ttfm_des = crypto_alloc_skcipher(\"ecb(des)\", 0, CRYPTO_ALG_ASYNC);\n"], [82, "\t\trc = PTR_ERR(tfm_des);\n"], [83, "\t\tcifs_dbg(VFS, \"could not allocate ...
[[72, "int rc;"], [74, "struct crypto_skcipher *tfm_des;"], [75, "struct scatterlist sgin, sgout;"], [76, "struct skcipher_request *req;"], [80, "tfm_des = crypto_alloc_skcipher(\"ecb(des)\", 0, CRYPTO_ALG_ASYNC);"], [82, "rc = PTR_ERR(tfm_des);"], [83, "cifs_dbg(VFS, \"could not allocate des crypto API\\n\");"], [84, ...
[ "CVE-2016-10154" ]
[ "CWE-119" ]
14
{ "Execution Environment": [ "CONFIG_VMAP_STACK" ], "Explanation": null, "External Function": [ "sg_init_one" ], "Function Argument": [], "Globals": [], "Type Execution Declaration": [] }
14
linux
https://github.com/torvalds/linux
fs/cifs/smbencrypt.c
06deeec77a5a689cc94b21a8a91a76e42176685d
cifs: Fix smbencrypt() to stop pointing a scatterlist at the stack smbencrypt() points a scatterlist to the stack, which is breaks if CONFIG_VMAP_STACK=y. Fix it by switching to crypto_cipher_encrypt_one(). The new code should be considerably faster as an added benefit. This code is nearly identical to some code th...
false
e8cc2fd6bec0fed306d2adce2c782f6f
smbhash
static int smbhash(unsigned char *out, const unsigned char *in, unsigned char *key) { unsigned char key2[8]; struct crypto_cipher *tfm_des; str_to_key(key, key2); tfm_des = crypto_alloc_cipher("des", 0, 0); if (IS_ERR(tfm_des)) { cifs_dbg(VFS, "could not allocate des crypto API\n"); return PTR_ERR(tfm_des); ...
[[73, "\tstruct crypto_cipher *tfm_des;\n"], [77, "\ttfm_des = crypto_alloc_cipher(\"des\", 0, 0);\n"], [80, "\t\treturn PTR_ERR(tfm_des);\n"], [83, "\tcrypto_cipher_setkey(tfm_des, key2, 8);\n"], [84, "\tcrypto_cipher_encrypt_one(tfm_des, out, in);\n"], [85, "\tcrypto_free_cipher(tfm_des);\n"], [87, "\treturn 0;\n"]]
[[73, "struct crypto_cipher *tfm_des;"], [77, "tfm_des = crypto_alloc_cipher(\"des\", 0, 0);"], [80, "return PTR_ERR(tfm_des);"], [83, "crypto_cipher_setkey(tfm_des, key2, 8);"], [84, "crypto_cipher_encrypt_one(tfm_des, out, in);"], [85, "crypto_free_cipher(tfm_des);"], [87, "return 0;"]]
[ "CVE-2016-10154" ]
[ "CWE-119" ]
14
{ "Execution Environment": [ "CONFIG_VMAP_STACK" ], "Explanation": null, "External Function": [ "sg_init_one" ], "Function Argument": [], "Globals": [], "Type Execution Declaration": [] }
15
linux
https://github.com/torvalds/linux
drivers/net/mlx4/port.c
0926f91083f34d047abc74f1ca4fa6a9c161f7db
mlx4_en: Fix out of bounds array access When searching for a free entry in either mlx4_register_vlan() or mlx4_register_mac(), and there is no free entry, the loop terminates without updating the local variable free thus causing out of array bounds access. Fix this by adding a proper check outside the loop. Signed-of...
true
0bb0fd17cb0d592e6c0241114adba3b5
mlx4_register_mac
int mlx4_register_mac(struct mlx4_dev *dev, u8 port, u64 mac, int *index) { struct mlx4_mac_table *table = &mlx4_priv(dev)->port[port].mac_table; int i, err = 0; int free = -1; mlx4_dbg(dev, "Registering MAC: 0x%llx\n", (unsigned long long) mac); mutex_lock(&table->mutex); for (i = 0; i < MLX4_MAX_MAC_NUM - 1; i...
[]
[]
[ "CVE-2010-5332" ]
[ "CWE-119" ]
17
{ "Execution Environment": [], "Explanation": null, "External Function": [ "mlx4_priv" ], "Function Argument": [ "dev", "port" ], "Globals": [ "MLX4_MAX_MAC_NUM" ], "Type Execution Declaration": [] }
16
linux
https://github.com/torvalds/linux
drivers/net/mlx4/port.c
0926f91083f34d047abc74f1ca4fa6a9c161f7db
mlx4_en: Fix out of bounds array access When searching for a free entry in either mlx4_register_vlan() or mlx4_register_mac(), and there is no free entry, the loop terminates without updating the local variable free thus causing out of array bounds access. Fix this by adding a proper check outside the loop. Signed-of...
true
b34d08283adbc51bc2a8ac9fef1d47d8
mlx4_register_vlan
int mlx4_register_vlan(struct mlx4_dev *dev, u8 port, u16 vlan, int *index) { struct mlx4_vlan_table *table = &mlx4_priv(dev)->port[port].vlan_table; int i, err = 0; int free = -1; mutex_lock(&table->mutex); for (i = MLX4_VLAN_REGULAR; i < MLX4_MAX_VLAN_NUM; i++) { if (free < 0 && (table->refs[i] == 0)) { fr...
[]
[]
[ "CVE-2010-5332" ]
[ "CWE-119" ]
18
{ "Execution Environment": [], "Explanation": null, "External Function": [ "mlx4_priv", "be32_to_cpu", "cpu_to_be32", "mlx4_set_port_vlan_table", "mlx4_warn" ], "Function Argument": [ "dev", "port", "vlan", "index" ], "Globals": [ "MLX4_VLAN_REGULAR", "MLX4_MAX_...
17
linux
https://github.com/torvalds/linux
drivers/net/mlx4/port.c
0926f91083f34d047abc74f1ca4fa6a9c161f7db
mlx4_en: Fix out of bounds array access When searching for a free entry in either mlx4_register_vlan() or mlx4_register_mac(), and there is no free entry, the loop terminates without updating the local variable free thus causing out of array bounds access. Fix this by adding a proper check outside the loop. Signed-of...
false
5e384db2b5bcf28504943915f4e0feff
mlx4_register_mac
int mlx4_register_mac(struct mlx4_dev *dev, u8 port, u64 mac, int *index) { struct mlx4_mac_table *table = &mlx4_priv(dev)->port[port].mac_table; int i, err = 0; int free = -1; mlx4_dbg(dev, "Registering MAC: 0x%llx\n", (unsigned long long) mac); mutex_lock(&table->mutex); for (i = 0; i < MLX4_MAX_MAC_NUM - 1; i...
[[114, "\n"], [115, "\tif (free < 0) {\n"], [116, "\t\terr = -ENOMEM;\n"], [117, "\t\tgoto out;\n"], [118, "\t}\n"], [119, "\n"]]
[[114, "\n"], [115, "if (free < 0)"], [116, "err = -ENOMEM;"], [117, "goto out;"], [118, "\t}\n"], [119, "\n"]]
[ "CVE-2010-5332" ]
[ "CWE-119" ]
17
{ "Execution Environment": [], "Explanation": null, "External Function": [ "mlx4_priv" ], "Function Argument": [ "dev", "port" ], "Globals": [ "MLX4_MAX_MAC_NUM" ], "Type Execution Declaration": [] }
18
linux
https://github.com/torvalds/linux
drivers/net/mlx4/port.c
0926f91083f34d047abc74f1ca4fa6a9c161f7db
mlx4_en: Fix out of bounds array access When searching for a free entry in either mlx4_register_vlan() or mlx4_register_mac(), and there is no free entry, the loop terminates without updating the local variable free thus causing out of array bounds access. Fix this by adding a proper check outside the loop. Signed-of...
false
d2d908a7f0431e5675baba44caaafa0c
mlx4_register_vlan
int mlx4_register_vlan(struct mlx4_dev *dev, u8 port, u16 vlan, int *index) { struct mlx4_vlan_table *table = &mlx4_priv(dev)->port[port].vlan_table; int i, err = 0; int free = -1; mutex_lock(&table->mutex); for (i = MLX4_VLAN_REGULAR; i < MLX4_MAX_VLAN_NUM; i++) { if (free < 0 && (table->refs[i] == 0)) { fr...
[[214, "\tif (free < 0) {\n"], [215, "\t\terr = -ENOMEM;\n"], [216, "\t\tgoto out;\n"], [217, "\t}\n"], [218, "\n"]]
[[214, "if (free < 0)"], [215, "err = -ENOMEM;"], [216, "goto out;"], [217, "\t}\n"], [218, "\n"]]
[ "CVE-2010-5332" ]
[ "CWE-119" ]
18
{ "Execution Environment": [], "Explanation": null, "External Function": [ "mlx4_priv", "be32_to_cpu", "cpu_to_be32", "mlx4_set_port_vlan_table", "mlx4_warn" ], "Function Argument": [ "dev", "port", "vlan", "index" ], "Globals": [ "MLX4_VLAN_REGULAR", "MLX4_MAX_...
19
linux
https://github.com/torvalds/linux
drivers/nvme/target/fc.c
0c319d3a144d4b8f1ea2047fd614d2149b68f889
nvmet-fc: ensure target queue id within range. When searching for queue id's ensure they are within the expected range. Signed-off-by: James Smart <james.smart@broadcom.com> Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Jens Axboe <axboe@kernel.dk>
true
c05ae774ee57b0ad442f8c36f38916df
nvmet_fc_find_target_queue
static struct nvmet_fc_tgt_queue * nvmet_fc_find_target_queue(struct nvmet_fc_tgtport *tgtport, u64 connection_id) { struct nvmet_fc_tgt_assoc *assoc; struct nvmet_fc_tgt_queue *queue; u64 association_id = nvmet_fc_getassociationid(connection_id); u16 qid = nvmet_fc_getqueueid(connection_id); unsigned long fla...
[]
[]
[ "CVE-2017-18379" ]
[ "CWE-119" ]
20
{ "Execution Environment": [], "Explanation": null, "External Function": [ "nvmet_fc_getqueueid" ], "Function Argument": [], "Globals": [ "NVMET_NR_QUEUES" ], "Type Execution Declaration": [ "struct nvmet_fc_tgt_assoc", "struct nvmet_fc_tgt_queue" ] }
20
linux
https://github.com/torvalds/linux
drivers/nvme/target/fc.c
0c319d3a144d4b8f1ea2047fd614d2149b68f889
nvmet-fc: ensure target queue id within range. When searching for queue id's ensure they are within the expected range. Signed-off-by: James Smart <james.smart@broadcom.com> Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Jens Axboe <axboe@kernel.dk>
false
ae5fb548fe28f4fb4cdb0151e82cf8e2
nvmet_fc_find_target_queue
static struct nvmet_fc_tgt_queue * nvmet_fc_find_target_queue(struct nvmet_fc_tgtport *tgtport, u64 connection_id) { struct nvmet_fc_tgt_assoc *assoc; struct nvmet_fc_tgt_queue *queue; u64 association_id = nvmet_fc_getassociationid(connection_id); u16 qid = nvmet_fc_getqueueid(connection_id); unsigned long fla...
[[786, "\tif (qid > NVMET_NR_QUEUES)\n"], [787, "\t\treturn NULL;\n"], [788, "\n"]]
[[786, "if (qid > NVMET_NR_QUEUES)"], [787, "return NULL;"], [788, "\n"]]
[ "CVE-2017-18379" ]
[ "CWE-119" ]
20
{ "Execution Environment": [], "Explanation": null, "External Function": [ "nvmet_fc_getqueueid" ], "Function Argument": [], "Globals": [ "NVMET_NR_QUEUES" ], "Type Execution Declaration": [ "struct nvmet_fc_tgt_assoc", "struct nvmet_fc_tgt_queue" ] }
21
linux
https://github.com/torvalds/linux
fs/ioctl.c
10eec60ce79187686e052092e5383c99b4420a20
vfs: ioctl: prevent double-fetch in dedupe ioctl This prevents a double-fetch from user space that can lead to to an undersized allocation and heap overflow. Fixes: 54dbc1517237 ("vfs: hoist the btrfs deduplication ioctl to the vfs") Signed-off-by: Scott Bauer <sbauer@plzdonthack.me> Signed-off-by: Linus Torvalds <to...
true
88ed0b07f2f93f508fcb10ea0454b747
ioctl_file_dedupe_range
static long ioctl_file_dedupe_range(struct file *file, void __user *arg) { struct file_dedupe_range __user *argp = arg; struct file_dedupe_range *same = NULL; int ret; unsigned long size; u16 count; if (get_user(count, &argp->dest_count)) { ret = -EFAULT; goto out; } size = offsetof(struct file_dedupe_ran...
[]
[]
[ "CVE-2016-6516" ]
[ "CWE-362", "CWE-119" ]
22
{ "Execution Environment": [], "Explanation": null, "External Function": [ "get_user", "memdup_user", "copy_to_user" ], "Function Argument": [ "arg" ], "Globals": [], "Type Execution Declaration": [ "struct file_dedupe_range __user", "struct file_dedupe_range" ] }
22
linux
https://github.com/torvalds/linux
fs/ioctl.c
10eec60ce79187686e052092e5383c99b4420a20
vfs: ioctl: prevent double-fetch in dedupe ioctl This prevents a double-fetch from user space that can lead to to an undersized allocation and heap overflow. Fixes: 54dbc1517237 ("vfs: hoist the btrfs deduplication ioctl to the vfs") Signed-off-by: Scott Bauer <sbauer@plzdonthack.me> Signed-off-by: Linus Torvalds <to...
false
ad737bed6069921506d9ce434712bad7
ioctl_file_dedupe_range
static long ioctl_file_dedupe_range(struct file *file, void __user *arg) { struct file_dedupe_range __user *argp = arg; struct file_dedupe_range *same = NULL; int ret; unsigned long size; u16 count; if (get_user(count, &argp->dest_count)) { ret = -EFAULT; goto out; } size = offsetof(struct file_dedupe_ran...
[[593, "\tsame->dest_count = count;\n"]]
[[593, "same->dest_count = count;"]]
[ "CVE-2016-6516" ]
[ "CWE-362", "CWE-119" ]
22
{ "Execution Environment": [], "Explanation": null, "External Function": [ "get_user", "memdup_user", "copy_to_user" ], "Function Argument": [ "arg" ], "Globals": [], "Type Execution Declaration": [ "struct file_dedupe_range __user", "struct file_dedupe_range" ] }
23
linux
https://github.com/torvalds/linux
drivers/net/ethernet/sunplus/spl2sw_driver.c
12aece8b01507a2d357a1861f470e83621fbb6f2
eth: sp7021: fix use after free bug in spl2sw_nvmem_get_mac_address This frees "mac" and tries to display its address as part of the error message on the next line. Swap the order. Fixes: fd3040b9394c ("net: ethernet: Add driver for Sunplus SP7021") Signed-off-by: Zheng Wang <zyytlz.wz@163.com> Signed-off-by: David ...
true
edf98bb67e48bc2765e89283212bb2a6
spl2sw_nvmem_get_mac_address
static int spl2sw_nvmem_get_mac_address(struct device *dev, struct device_node *np, void *addrbuf) { struct nvmem_cell *cell; ssize_t len; u8 *mac; /* Get nvmem cell of mac-address from dts. */ cell = of_nvmem_cell_get(np, "mac-address"); if (IS_ERR(cell)) return PTR_ERR(cell); /* Read mac address from ...
[[251, "\t\tkfree(mac);\n"]]
[[251, "kfree(mac);"]]
[ "CVE-2022-3541" ]
[ "CWE-119" ]
24
{ "Execution Environment": [], "Explanation": null, "External Function": [ "of_nvmem_cell_get", "nvmem_cell_read", "nvmem_cell_put", "is_valid_ether_addr", "dev_info" ], "Function Argument": [], "Globals": [], "Type Execution Declaration": [] }
24
linux
https://github.com/torvalds/linux
drivers/net/ethernet/sunplus/spl2sw_driver.c
12aece8b01507a2d357a1861f470e83621fbb6f2
eth: sp7021: fix use after free bug in spl2sw_nvmem_get_mac_address This frees "mac" and tries to display its address as part of the error message on the next line. Swap the order. Fixes: fd3040b9394c ("net: ethernet: Add driver for Sunplus SP7021") Signed-off-by: Zheng Wang <zyytlz.wz@163.com> Signed-off-by: David ...
false
b9422cbb5d31e8e69bf752bd7a6c6ed5
spl2sw_nvmem_get_mac_address
static int spl2sw_nvmem_get_mac_address(struct device *dev, struct device_node *np, void *addrbuf) { struct nvmem_cell *cell; ssize_t len; u8 *mac; /* Get nvmem cell of mac-address from dts. */ cell = of_nvmem_cell_get(np, "mac-address"); if (IS_ERR(cell)) return PTR_ERR(cell); /* Read mac address from ...
[[252, "\t\tkfree(mac);\n"]]
[[252, "kfree(mac);"]]
[ "CVE-2022-3541" ]
[ "CWE-119" ]
24
{ "Execution Environment": [], "Explanation": null, "External Function": [ "of_nvmem_cell_get", "nvmem_cell_read", "nvmem_cell_put", "is_valid_ether_addr", "dev_info" ], "Function Argument": [], "Globals": [], "Type Execution Declaration": [] }
25
linux
https://github.com/torvalds/linux
drivers/target/loopback/tcm_loop.c
12f09ccb4612734a53e47ed5302e0479c10a50f8
loopback: off by one in tcm_loop_make_naa_tpg() This is an off by one 'tgpt' check in tcm_loop_make_naa_tpg() that could result in memory corruption. Signed-off-by: Dan Carpenter <error27@gmail.com> Signed-off-by: Nicholas A. Bellinger <nab@linux-iscsi.org>
true
bb10218e4db9527815edd9343f459cff
tcm_loop_make_naa_tpg
struct se_portal_group *tcm_loop_make_naa_tpg( struct se_wwn *wwn, struct config_group *group, const char *name) { struct tcm_loop_hba *tl_hba = container_of(wwn, struct tcm_loop_hba, tl_hba_wwn); struct tcm_loop_tpg *tl_tpg; char *tpgt_str, *end_ptr; int ret; unsigned short int tpgt; tpgt_str = strstr(nam...
[[1208, "\tif (tpgt > TL_TPGS_PER_HBA) {\n"]]
[[1208, "if (tpgt > TL_TPGS_PER_HBA)"]]
[ "CVE-2011-5327" ]
[ "CWE-119" ]
26
{ "Execution Environment": [], "Explanation": null, "External Function": [], "Function Argument": [], "Globals": [ "TL_TPGS_PER_HBA" ], "Type Execution Declaration": [ "struct tcm_loop_hba", "struct tcm_loop_tpg" ] }
26
linux
https://github.com/torvalds/linux
drivers/target/loopback/tcm_loop.c
12f09ccb4612734a53e47ed5302e0479c10a50f8
loopback: off by one in tcm_loop_make_naa_tpg() This is an off by one 'tgpt' check in tcm_loop_make_naa_tpg() that could result in memory corruption. Signed-off-by: Dan Carpenter <error27@gmail.com> Signed-off-by: Nicholas A. Bellinger <nab@linux-iscsi.org>
false
ba9488c551927f9c924adb9bcb8fce29
tcm_loop_make_naa_tpg
struct se_portal_group *tcm_loop_make_naa_tpg( struct se_wwn *wwn, struct config_group *group, const char *name) { struct tcm_loop_hba *tl_hba = container_of(wwn, struct tcm_loop_hba, tl_hba_wwn); struct tcm_loop_tpg *tl_tpg; char *tpgt_str, *end_ptr; int ret; unsigned short int tpgt; tpgt_str = strstr(nam...
[[1208, "\tif (tpgt >= TL_TPGS_PER_HBA) {\n"]]
[[1208, "if (tpgt >= TL_TPGS_PER_HBA)"]]
[ "CVE-2011-5327" ]
[ "CWE-119" ]
26
{ "Execution Environment": [], "Explanation": null, "External Function": [], "Function Argument": [], "Globals": [ "TL_TPGS_PER_HBA" ], "Type Execution Declaration": [ "struct tcm_loop_hba", "struct tcm_loop_tpg" ] }
27
linux
https://github.com/torvalds/linux
fs/nfsd/nfsxdr.c
13bf9fbff0e5e099e2b6f003a0ab8ae145436309
nfsd: stricter decoding of write-like NFSv2/v3 ops The NFSv2/v3 code does not systematically check whether we decode past the end of the buffer. This generally appears to be harmless, but there are a few places where we do arithmetic on the pointers involved and don't account for the possibility that a length could b...
true
312254bef4649bf3181c0060b93bc490
nfssvc_decode_writeargs
int nfssvc_decode_writeargs(struct svc_rqst *rqstp, __be32 *p, struct nfsd_writeargs *args) { unsigned int len, hdr, dlen; struct kvec *head = rqstp->rq_arg.head; int v; p = decode_fh(p, &args->fh); if (!p) return 0; p++; /* beginoffset */ args->offset = ntohl(*p++); /* offset */ p++; /* totalcou...
[]
[]
[ "CVE-2017-7895" ]
[ "CWE-119" ]
28
{ "Execution Environment": [], "Explanation": null, "External Function": [ "decode_fh", "page_address" ], "Function Argument": [ "rqstp" ], "Globals": [ "NFSSVC_MAXBLKSIZE_V2", "PAGE_SIZE", "XDR_QUADLEN" ], "Type Execution Declaration": [] }
28
linux
https://github.com/torvalds/linux
fs/nfsd/nfsxdr.c
13bf9fbff0e5e099e2b6f003a0ab8ae145436309
nfsd: stricter decoding of write-like NFSv2/v3 ops The NFSv2/v3 code does not systematically check whether we decode past the end of the buffer. This generally appears to be harmless, but there are a few places where we do arithmetic on the pointers involved and don't account for the possibility that a length could b...
false
e0616d42a55dbbc6ea9361716131ed66
nfssvc_decode_writeargs
int nfssvc_decode_writeargs(struct svc_rqst *rqstp, __be32 *p, struct nfsd_writeargs *args) { unsigned int len, hdr, dlen; struct kvec *head = rqstp->rq_arg.head; int v; p = decode_fh(p, &args->fh); if (!p) return 0; p++; /* beginoffset */ args->offset = ntohl(*p++); /* offset */ p++; /* totalcou...
[[305, "\tif (hdr > head->iov_len)\n"], [306, "\t\treturn 0;\n"]]
[[305, "if (hdr > head->iov_len)"], [306, "return 0;"]]
[ "CVE-2017-7895" ]
[ "CWE-119" ]
28
{ "Execution Environment": [], "Explanation": null, "External Function": [ "decode_fh", "page_address" ], "Function Argument": [ "rqstp" ], "Globals": [ "NFSSVC_MAXBLKSIZE_V2", "PAGE_SIZE", "XDR_QUADLEN" ], "Type Execution Declaration": [] }
29
linux
https://github.com/torvalds/linux
fs/jbd2/transaction.c
15291164b22a357cb211b618adfef4fa82fc0de3
jbd2: clear BH_Delay & BH_Unwritten in journal_unmap_buffer journal_unmap_buffer()'s zap_buffer: code clears a lot of buffer head state ala discard_buffer(), but does not touch _Delay or _Unwritten as discard_buffer() does. This can be problematic in some areas of the ext4 code which assume that if they have found a ...
true
1708a3552db849780aa5aa7df12f8b7a
journal_unmap_buffer
static int journal_unmap_buffer(journal_t *journal, struct buffer_head *bh) { transaction_t *transaction; struct journal_head *jh; int may_free = 1; int ret; BUFFER_TRACE(bh, "entry"); /* * It is safe to proceed here without the j_list_lock because the * buffers cannot be stolen by try_to_free_buffers as lo...
[]
[]
[ "CVE-2011-4086" ]
[ "CWE-119" ]
30
{ "Execution Environment": [ "the ext4 filesystem must be mounted with a journal" ], "Explanation": null, "External Function": [], "Function Argument": [], "Globals": [], "Type Execution Declaration": [] }
30
linux
https://github.com/torvalds/linux
fs/jbd2/transaction.c
15291164b22a357cb211b618adfef4fa82fc0de3
jbd2: clear BH_Delay & BH_Unwritten in journal_unmap_buffer journal_unmap_buffer()'s zap_buffer: code clears a lot of buffer head state ala discard_buffer(), but does not touch _Delay or _Unwritten as discard_buffer() does. This can be problematic in some areas of the ext4 code which assume that if they have found a ...
false
e85e99d5d65ba40f87a83bf83e2677ee
journal_unmap_buffer
static int journal_unmap_buffer(journal_t *journal, struct buffer_head *bh) { transaction_t *transaction; struct journal_head *jh; int may_free = 1; int ret; BUFFER_TRACE(bh, "entry"); /* * It is safe to proceed here without the j_list_lock because the * buffers cannot be stolen by try_to_free_buffers as lo...
[[1952, "\tclear_buffer_delay(bh);\n"], [1953, "\tclear_buffer_unwritten(bh);\n"]]
[[1952, "clear_buffer_delay(bh);"], [1953, "clear_buffer_unwritten(bh);"]]
[ "CVE-2011-4086" ]
[ "CWE-119" ]
30
{ "Execution Environment": [ "the ext4 filesystem must be mounted with a journal" ], "Explanation": null, "External Function": [], "Function Argument": [], "Globals": [], "Type Execution Declaration": [] }
31
linux
https://github.com/torvalds/linux
mm/memory.c
16ce101db85db694a91380aa4c89b25530871d33
mm/memory.c: fix race when faulting a device private page Patch series "Fix several device private page reference counting issues", v2 This series aims to fix a number of page reference counting issues in drivers dealing with device private ZONE_DEVICE pages. These result in use-after-free type bugs, either from acc...
true
6c3324ccd98e2b9019df7554fdfc4e67
do_swap_page
vm_fault_t do_swap_page(struct vm_fault *vmf) { struct vm_area_struct *vma = vmf->vma; struct folio *swapcache, *folio = NULL; struct page *page; struct swap_info_struct *si = NULL; rmap_t rmap_flags = RMAP_NONE; bool exclusive = false; swp_entry_t entry; pte_t pte; int locked; vm_fault_t ret = 0; void *shad...
[[3753, "\t\t\tret = vmf->page->pgmap->ops->migrate_to_ram(vmf);\n"]]
[[3753, "ret = vmf->page->pgmap->ops->migrate_to_ram(vmf);"]]
[ "CVE-2022-3523" ]
[ "CWE-416", "CWE-119" ]
32
{ "Execution Environment": [], "Explanation": null, "External Function": [ "vmf->page->pgmap->ops->migrate_to_ram" ], "Function Argument": [], "Globals": [], "Type Execution Declaration": [ "struct vm_fault", "struct page", "struct dev_pagemap_ops" ] }
32
linux
https://github.com/torvalds/linux
mm/memory.c
16ce101db85db694a91380aa4c89b25530871d33
mm/memory.c: fix race when faulting a device private page Patch series "Fix several device private page reference counting issues", v2 This series aims to fix a number of page reference counting issues in drivers dealing with device private ZONE_DEVICE pages. These result in use-after-free type bugs, either from acc...
false
b2a6dcd0780f4ef35d80208cafe62d51
do_swap_page
vm_fault_t do_swap_page(struct vm_fault *vmf) { struct vm_area_struct *vma = vmf->vma; struct folio *swapcache, *folio = NULL; struct page *page; struct swap_info_struct *si = NULL; rmap_t rmap_flags = RMAP_NONE; bool exclusive = false; swp_entry_t entry; pte_t pte; int locked; vm_fault_t ret = 0; void *shad...
[[3753, "\t\t\tvmf->pte = pte_offset_map_lock(vma->vm_mm, vmf->pmd,\n"], [3754, "\t\t\t\t\tvmf->address, &vmf->ptl);\n"], [3755, "\t\t\tif (unlikely(!pte_same(*vmf->pte, vmf->orig_pte))) {\n"], [3756, "\t\t\t\tspin_unlock(vmf->ptl);\n"], [3757, "\t\t\t\tgoto out;\n"], [3758, "\t\t\t}\n"], [3759, "\n"], [3760, "\t\t\t/*...
[[3753, "vmf->pte = pte_offset_map_lock(vma->vm_mm, vmf->pmd,\n\t\t\t\t\tvmf->address, &vmf->ptl);"], [3755, "if (unlikely(!pte_same(*vmf->pte, vmf->orig_pte)))"], [3756, "spin_unlock(vmf->ptl);"], [3757, "goto out;"], [3758, "\t\t\t}\n"], [3759, "\n"], [3760, "/*\n\t\t\t * Get a page reference while we know the page c...
[ "CVE-2022-3523" ]
[ "CWE-416", "CWE-119" ]
32
{ "Execution Environment": [], "Explanation": null, "External Function": [ "vmf->page->pgmap->ops->migrate_to_ram" ], "Function Argument": [], "Globals": [], "Type Execution Declaration": [ "struct vm_fault", "struct page", "struct dev_pagemap_ops" ] }
33
linux
https://github.com/torvalds/linux
kernel/bpf/verifier.c
179d1c5602997fef5a940c6ddcf31212cbfebd14
bpf: don't prune branches when a scalar is replaced with a pointer This could be made safe by passing through a reference to env and checking for env->allow_ptr_leaks, but it would only work one way and is probably not worth the hassle - not doing it will not directly lead to program rejection. Fixes: f1174f77b50c ("...
true
efa1225f12ed754b1dcae072082ed9ca
regsafe
static bool regsafe(struct bpf_reg_state *rold, struct bpf_reg_state *rcur, struct idpair *idmap) { if (!(rold->live & REG_LIVE_READ)) /* explored state didn't use this */ return true; if (memcmp(rold, rcur, offsetof(struct bpf_reg_state, live)) == 0) return true; if (rold->type == NOT_INIT) /* explo...
[[3470, "\t\t\t/* if we knew anything about the old value, we're not\n"], [3471, "\t\t\t * equal, because we can't know anything about the\n"], [3472, "\t\t\t * scalar value of the pointer in the new value.\n"], [3474, "\t\t\treturn rold->umin_value == 0 &&\n"], [3475, "\t\t\t rold->umax_value == U64_MAX &&\n"], ...
[[3470, "/* if we knew anything about the old value, we're not\n\t\t\t * equal, because we can't know anything about the\n\t\t\t * scalar value of the pointer in the new value.\n\t\t\t */"], [3474, "return rold->umin_value == 0 &&\n\t\t\t rold->umax_value == U64_MAX &&\n\t\t\t rold->smin_value == S64_MIN &&...
[ "CVE-2017-17855" ]
[ "CWE-119" ]
34
{ "Execution Environment": [], "Explanation": null, "External Function": [ "tnum_is_unknown" ], "Function Argument": [], "Globals": [], "Type Execution Declaration": [ "U64_MAX", "S64_MIN" ] }
34
linux
https://github.com/torvalds/linux
kernel/bpf/verifier.c
179d1c5602997fef5a940c6ddcf31212cbfebd14
bpf: don't prune branches when a scalar is replaced with a pointer This could be made safe by passing through a reference to env and checking for env->allow_ptr_leaks, but it would only work one way and is probably not worth the hassle - not doing it will not directly lead to program rejection. Fixes: f1174f77b50c ("...
false
5f6d745208838c9654712c9620472a78
regsafe
static bool regsafe(struct bpf_reg_state *rold, struct bpf_reg_state *rcur, struct idpair *idmap) { if (!(rold->live & REG_LIVE_READ)) /* explored state didn't use this */ return true; if (memcmp(rold, rcur, offsetof(struct bpf_reg_state, live)) == 0) return true; if (rold->type == NOT_INIT) /* explo...
[[3470, "\t\t\t/* We're trying to use a pointer in place of a scalar.\n"], [3471, "\t\t\t * Even if the scalar was unbounded, this could lead to\n"], [3472, "\t\t\t * pointer leaks because scalars are allowed to leak\n"], [3473, "\t\t\t * while pointers are not. We could make this safe in\n"], [3474, "\t\t\t * special ...
[[3470, "/* We're trying to use a pointer in place of a scalar.\n\t\t\t * Even if the scalar was unbounded, this could lead to\n\t\t\t * pointer leaks because scalars are allowed to leak\n\t\t\t * while pointers are not. We could make this safe in\n\t\t\t * special cases if root is calling us, but it's\n\t\t\t * probab...
[ "CVE-2017-17855" ]
[ "CWE-119" ]
34
{ "Execution Environment": [], "Explanation": null, "External Function": [ "tnum_is_unknown" ], "Function Argument": [], "Globals": [], "Type Execution Declaration": [ "U64_MAX", "S64_MIN" ] }
35
linux
https://github.com/torvalds/linux
drivers/net/ethernet/mediatek/mtk_ppe.c
17a5f6a78dc7b8db385de346092d7d9f9dc24df6
net: ethernet: mtk_eth_soc: use after free in __mtk_ppe_check_skb() The __mtk_foe_entry_clear() function frees "entry" so we have to use the _safe() version of hlist_for_each_entry() to prevent a use after free. Fixes: 33fc42de3327 ("net: ethernet: mtk_eth_soc: support creating mac address based offload entries") Sig...
true
854ecd98b68ec4fcd7d7f1340b7fa1f0
__mtk_ppe_check_skb
void __mtk_ppe_check_skb(struct mtk_ppe *ppe, struct sk_buff *skb, u16 hash) { struct hlist_head *head = &ppe->foe_flow[hash / 2]; struct mtk_foe_entry *hwe = &ppe->foe_table[hash]; struct mtk_flow_entry *entry; struct mtk_foe_bridge key = {}; struct ethhdr *eh; bool found = false; u8 *tag; spin_lock_bh(&ppe_l...
[[612, "\thlist_for_each_entry(entry, head, list) {\n"]]
[[612, "\thlist_for_each_entry(entry, head, list) {\n"]]
[ "CVE-2022-3636" ]
[ "CWE-416", "CWE-119" ]
36
{ "Execution Environment": [], "Explanation": null, "External Function": [ "__mtk_foe_entry_clear" ], "Function Argument": [], "Globals": [], "Type Execution Declaration": [] }
36
linux
https://github.com/torvalds/linux
drivers/net/ethernet/mediatek/mtk_ppe.c
17a5f6a78dc7b8db385de346092d7d9f9dc24df6
net: ethernet: mtk_eth_soc: use after free in __mtk_ppe_check_skb() The __mtk_foe_entry_clear() function frees "entry" so we have to use the _safe() version of hlist_for_each_entry() to prevent a use after free. Fixes: 33fc42de3327 ("net: ethernet: mtk_eth_soc: support creating mac address based offload entries") Sig...
false
0eab16ac49e9ae77017812443475b94a
__mtk_ppe_check_skb
void __mtk_ppe_check_skb(struct mtk_ppe *ppe, struct sk_buff *skb, u16 hash) { struct hlist_head *head = &ppe->foe_flow[hash / 2]; struct mtk_foe_entry *hwe = &ppe->foe_table[hash]; struct mtk_flow_entry *entry; struct mtk_foe_bridge key = {}; struct hlist_node *n; struct ethhdr *eh; bool found = false; u8 *tag...
[[603, "\tstruct hlist_node *n;\n"], [613, "\thlist_for_each_entry_safe(entry, n, head, list) {\n"]]
[[603, "struct hlist_node *n;"], [613, "\thlist_for_each_entry_safe(entry, n, head, list) {\n"]]
[ "CVE-2022-3636" ]
[ "CWE-416", "CWE-119" ]
36
{ "Execution Environment": [], "Explanation": null, "External Function": [ "__mtk_foe_entry_clear" ], "Function Argument": [], "Globals": [], "Type Execution Declaration": [] }
37
linux
https://github.com/torvalds/linux
drivers/mtd/spi-nor/cadence-quadspi.c
193e87143c290ec16838f5368adc0e0bc94eb931
mtd: spi-nor: Off by one in cqspi_setup_flash() There are CQSPI_MAX_CHIPSELECT elements in the ->f_pdata array so the > should be >=. Fixes: 140623410536 ('mtd: spi-nor: Add driver for Cadence Quad SPI Flash Controller') Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Reviewed-by: Marek Vasut <marex@denx.de> ...
true
0b477c06c2026d64a183015547046464
cqspi_setup_flash
static int cqspi_setup_flash(struct cqspi_st *cqspi, struct device_node *np) { struct platform_device *pdev = cqspi->pdev; struct device *dev = &pdev->dev; struct cqspi_flash_pdata *f_pdata; struct spi_nor *nor; struct mtd_info *mtd; unsigned int cs; int i, ret; /* Get flash device data */ for_each_available_...
[[1085, "\t\tif (cs > CQSPI_MAX_CHIPSELECT) {\n"]]
[[1085, "if (cs > CQSPI_MAX_CHIPSELECT)"]]
[ "CVE-2016-10764" ]
[ "CWE-119" ]
38
{ "Execution Environment": [], "Explanation": null, "External Function": [], "Function Argument": [], "Globals": [ "CQSPI_MAX_CHIPSELECT" ], "Type Execution Declaration": [ "struct cqspi_st" ] }
38
linux
https://github.com/torvalds/linux
drivers/mtd/spi-nor/cadence-quadspi.c
193e87143c290ec16838f5368adc0e0bc94eb931
mtd: spi-nor: Off by one in cqspi_setup_flash() There are CQSPI_MAX_CHIPSELECT elements in the ->f_pdata array so the > should be >=. Fixes: 140623410536 ('mtd: spi-nor: Add driver for Cadence Quad SPI Flash Controller') Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Reviewed-by: Marek Vasut <marex@denx.de> ...
false
189ced77266d4818ff184322a3931409
cqspi_setup_flash
static int cqspi_setup_flash(struct cqspi_st *cqspi, struct device_node *np) { struct platform_device *pdev = cqspi->pdev; struct device *dev = &pdev->dev; struct cqspi_flash_pdata *f_pdata; struct spi_nor *nor; struct mtd_info *mtd; unsigned int cs; int i, ret; /* Get flash device data */ for_each_available_...
[[1085, "\t\tif (cs >= CQSPI_MAX_CHIPSELECT) {\n"]]
[[1085, "if (cs >= CQSPI_MAX_CHIPSELECT)"]]
[ "CVE-2016-10764" ]
[ "CWE-119" ]
38
{ "Execution Environment": [], "Explanation": null, "External Function": [], "Function Argument": [], "Globals": [ "CQSPI_MAX_CHIPSELECT" ], "Type Execution Declaration": [ "struct cqspi_st" ] }
39
linux
https://github.com/torvalds/linux
fs/udf/super.c
1df2ae31c724e57be9d7ac00d78db8a5dabdd050
udf: Fortify loading of sparing table Add sanity checks when loading sparing table from disk to avoid accessing unallocated memory or writing to it. Signed-off-by: Jan Kara <jack@suse.cz>
true
b247c8b050141105ac9dbfe5e55b7bfd
udf_load_logicalvol
static int udf_load_logicalvol(struct super_block *sb, sector_t block, struct kernel_lb_addr *fileset) { struct logicalVolDesc *lvd; int i, j, offset; uint8_t type; struct udf_sb_info *sbi = UDF_SB(sb); struct genericPartitionMap *gpm; uint16_t ident; struct buffer_head *bh; unsigned int table_len; i...
[[1222, "\tint i, j, offset;\n"], [1284, "\t\t\t\tuint32_t loc;\n"], [1285, "\t\t\t\tstruct sparingTable *st;\n"], [1286, "\t\t\t\tstruct sparablePartitionMap *spm =\n"], [1287, "\t\t\t\t\t(struct sparablePartitionMap *)gpm;\n"], [1288, "\n"], [1289, "\t\t\t\tmap->s_partition_type = UDF_SPARABLE_MAP15;\n"], [1290, "\t\...
[[1222, "int i, j, offset;"], [1284, "uint32_t loc;"], [1285, "struct sparingTable *st;"], [1286, "struct sparablePartitionMap *spm =\n\t\t\t\t\t(struct sparablePartitionMap *)gpm;"], [1288, "\n"], [1289, "map->s_partition_type = UDF_SPARABLE_MAP15;"], [1290, "map->s_type_specific.s_sparing.s_packet_len =\n\t\t\t\t\t\t...
[ "CVE-2012-3400" ]
[ "CWE-787" ]
40
{ "Execution Environment": [], "Explanation": null, "External Function": [ "udf_read_tagged" ], "Function Argument": [ "sb" ], "Globals": [], "Type Execution Declaration": [] }
40
linux
https://github.com/torvalds/linux
fs/udf/super.c
1df2ae31c724e57be9d7ac00d78db8a5dabdd050
udf: Fortify loading of sparing table Add sanity checks when loading sparing table from disk to avoid accessing unallocated memory or writing to it. Signed-off-by: Jan Kara <jack@suse.cz>
false
e02f163864e3bca32c2530599656b6e9
udf_load_logicalvol
static int udf_load_logicalvol(struct super_block *sb, sector_t block, struct kernel_lb_addr *fileset) { struct logicalVolDesc *lvd; int i, offset; uint8_t type; struct udf_sb_info *sbi = UDF_SB(sb); struct genericPartitionMap *gpm; uint16_t ident; struct buffer_head *bh; unsigned int table_len; int ...
[[1271, "\tint i, offset;\n"], [1333, "\t\t\t\tif (udf_load_sparable_map(sb, map,\n"], [1334, "\t\t\t\t (struct sparablePartitionMap *)gpm) < 0)\n"], [1335, "\t\t\t\t\tgoto out_bh;\n"]]
[[1271, "int i, offset;"], [1333, "if (udf_load_sparable_map(sb, map,\n\t\t\t\t (struct sparablePartitionMap *)gpm) < 0)"], [1335, "goto out_bh;"]]
[ "CVE-2012-3400" ]
[ "CWE-787" ]
40
{ "Execution Environment": [], "Explanation": null, "External Function": [ "udf_read_tagged" ], "Function Argument": [ "sb" ], "Globals": [], "Type Execution Declaration": [] }
41
linux
https://github.com/torvalds/linux
mm/hugetlb.c
1e3921471354244f70fe268586ff94a97a6dd4df
userfaultfd: hugetlbfs: prevent UFFDIO_COPY to fill beyond the end of i_size This oops: kernel BUG at fs/hugetlbfs/inode.c:484! RIP: remove_inode_hugepages+0x3d0/0x410 Call Trace: hugetlbfs_setattr+0xd9/0x130 notify_change+0x292/0x410 do_truncate+0x65/0xa0 do_sys_ftruncate.constprop.3+0x11a/0x18...
true
4cfc89b5450fdc127cd532d6296ec224
hugetlb_mcopy_atomic_pte
int hugetlb_mcopy_atomic_pte(struct mm_struct *dst_mm, pte_t *dst_pte, struct vm_area_struct *dst_vma, unsigned long dst_addr, unsigned long src_addr, struct page **pagep) { int vm_shared = dst_vma->vm_flags & VM_SHARED; struct hstate *h = hstate_vma(dst_vma); pte_t _dst_pte; spin...
[[4028, "\t\tstruct address_space *mapping = dst_vma->vm_file->f_mapping;\n"], [4029, "\t\tpgoff_t idx = vma_hugecache_offset(h, dst_vma, dst_addr);\n"]]
[[4028, "struct address_space *mapping = dst_vma->vm_file->f_mapping;"], [4029, "pgoff_t idx = vma_hugecache_offset(h, dst_vma, dst_addr);"]]
[ "CVE-2017-15128" ]
[ "CWE-119" ]
42
{ "Execution Environment": [], "Explanation": null, "External Function": [ "vma_hugecache_offset", "i_size_read", "huge_page_shift" ], "Function Argument": [], "Globals": [], "Type Execution Declaration": [] }
42
linux
https://github.com/torvalds/linux
mm/hugetlb.c
1e3921471354244f70fe268586ff94a97a6dd4df
userfaultfd: hugetlbfs: prevent UFFDIO_COPY to fill beyond the end of i_size This oops: kernel BUG at fs/hugetlbfs/inode.c:484! RIP: remove_inode_hugepages+0x3d0/0x410 Call Trace: hugetlbfs_setattr+0xd9/0x130 notify_change+0x292/0x410 do_truncate+0x65/0xa0 do_sys_ftruncate.constprop.3+0x11a/0x18...
false
0074ab9caf4d6acfdfd6c7aa2e999b42
hugetlb_mcopy_atomic_pte
int hugetlb_mcopy_atomic_pte(struct mm_struct *dst_mm, pte_t *dst_pte, struct vm_area_struct *dst_vma, unsigned long dst_addr, unsigned long src_addr, struct page **pagep) { struct address_space *mapping; pgoff_t idx; unsigned long size; int vm_shared = dst_vma->vm_flags & VM_SHAR...
[[3987, "\tstruct address_space *mapping;\n"], [3988, "\tpgoff_t idx;\n"], [3989, "\tunsigned long size;\n"], [4027, "\tmapping = dst_vma->vm_file->f_mapping;\n"], [4028, "\tidx = vma_hugecache_offset(h, dst_vma, dst_addr);\n"], [4029, "\n"], [4034, "\t\tsize = i_size_read(mapping->host) >> huge_page_shift(h);\n"], [40...
[[3987, "struct address_space *mapping;"], [3988, "pgoff_t idx;"], [3989, "unsigned long size;"], [4027, "mapping = dst_vma->vm_file->f_mapping;"], [4028, "idx = vma_hugecache_offset(h, dst_vma, dst_addr);"], [4029, "\n"], [4034, "size = i_size_read(mapping->host) >> huge_page_shift(h);"], [4035, "ret = -EFAULT;"], [40...
[ "CVE-2017-15128" ]
[ "CWE-119" ]
42
{ "Execution Environment": [], "Explanation": null, "External Function": [ "vma_hugecache_offset", "i_size_read", "huge_page_shift" ], "Function Argument": [], "Globals": [], "Type Execution Declaration": [] }
43
linux
https://github.com/torvalds/linux
arch/um/kernel/exitcode.c
201f99f170df14ba52ea4c52847779042b7a623b
uml: check length in exitcode_proc_write() We don't cap the size of buffer from the user so we could write past the end of the array here. Only root can write to this file. Reported-by: Nico Golde <nico@ngolde.de> Reported-by: Fabian Yamaguchi <fabs@goesec.de> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> ...
true
7328e354f5509ce7bd2b4b7485e9bd59
exitcode_proc_write
static ssize_t exitcode_proc_write(struct file *file, const char __user *buffer, size_t count, loff_t *pos) { char *end, buf[sizeof("nnnnn\0")]; int tmp; if (copy_from_user(buf, buffer, count)) return -EFAULT; tmp = simple_strtol(buf, &end, 0); if ((*end != '\0') && !isspace(*end)) return -EINVAL; uml_ex...
[[45, "\tif (copy_from_user(buf, buffer, count))\n"]]
[[45, "if (copy_from_user(buf, buffer, count))"]]
[ "CVE-2013-4512" ]
[ "CWE-119" ]
44
{ "Execution Environment": [], "Explanation": null, "External Function": [], "Function Argument": [], "Globals": [], "Type Execution Declaration": [] }
44
linux
https://github.com/torvalds/linux
arch/um/kernel/exitcode.c
201f99f170df14ba52ea4c52847779042b7a623b
uml: check length in exitcode_proc_write() We don't cap the size of buffer from the user so we could write past the end of the array here. Only root can write to this file. Reported-by: Nico Golde <nico@ngolde.de> Reported-by: Fabian Yamaguchi <fabs@goesec.de> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> ...
false
6638d3a83d07900c8f306ab882a3e827
exitcode_proc_write
static ssize_t exitcode_proc_write(struct file *file, const char __user *buffer, size_t count, loff_t *pos) { char *end, buf[sizeof("nnnnn\0")]; size_t size; int tmp; size = min(count, sizeof(buf)); if (copy_from_user(buf, buffer, size)) return -EFAULT; tmp = simple_strtol(buf, &end, 0); if ((*end != '\0')...
[[43, "\tsize_t size;\n"], [46, "\tsize = min(count, sizeof(buf));\n"], [47, "\tif (copy_from_user(buf, buffer, size))\n"]]
[[43, "size_t size;"], [46, "size = min(count, sizeof(buf));"], [47, "if (copy_from_user(buf, buffer, size))"]]
[ "CVE-2013-4512" ]
[ "CWE-119" ]
44
{ "Execution Environment": [], "Explanation": null, "External Function": [], "Function Argument": [], "Globals": [], "Type Execution Declaration": [] }
45
linux
https://github.com/torvalds/linux
kernel/bpf/verifier.c
22c7fa171a02d310e3a3f6ed46a698ca8a0060ed
bpf: Reject variable offset alu on PTR_TO_FLOW_KEYS For PTR_TO_FLOW_KEYS, check_flow_keys_access() only uses fixed off for validation. However, variable offset ptr alu is not prohibited for this ptr kind. So the variable offset is not checked. The following prog is accepted: func#0 @0 0: R1=ctx() R10=fp0 0: (b...
true
6baddb16d0d1405bbb7b352baeb779ce
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_s...
[]
[]
[ "CVE-2024-26589" ]
[ "CWE-119" ]
46
{ "Execution Environment": [], "Explanation": null, "External Function": [ "base_type", "check_flow_keys_access" ], "Function Argument": [], "Globals": [], "Type Execution Declaration": [ "PTR_TO_FLOW_KEYS" ] }
46
linux
https://github.com/torvalds/linux
kernel/bpf/verifier.c
22c7fa171a02d310e3a3f6ed46a698ca8a0060ed
bpf: Reject variable offset alu on PTR_TO_FLOW_KEYS For PTR_TO_FLOW_KEYS, check_flow_keys_access() only uses fixed off for validation. However, variable offset ptr alu is not prohibited for this ptr kind. So the variable offset is not checked. The following prog is accepted: func#0 @0 0: R1=ctx() R10=fp0 0: (b...
false
cfdd482284e53513277e2607d71373e7
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_s...
[[12829, "\tcase PTR_TO_FLOW_KEYS:\n"], [12830, "\t\tif (known)\n"], [12831, "\t\t\tbreak;\n"], [12832, "\t\tfallthrough;\n"]]
[[12829, "case PTR_TO_FLOW_KEYS:"], [12830, "if (known)"], [12831, "break;"], [12832, "fallthrough;"]]
[ "CVE-2024-26589" ]
[ "CWE-119" ]
46
{ "Execution Environment": [], "Explanation": null, "External Function": [ "base_type", "check_flow_keys_access" ], "Function Argument": [], "Globals": [], "Type Execution Declaration": [ "PTR_TO_FLOW_KEYS" ] }
47
linux
https://github.com/torvalds/linux
net/core/skbuff.c
23d05d563b7e7b0314e65c8e882bc27eac2da8e7
net: prevent mss overflow in skb_segment() Once again syzbot is able to crash the kernel in skb_segment() [1] GSO_BY_FRAGS is a forbidden value, but unfortunately the following computation in skb_segment() can reach it quite easily : mss = mss * partial_segs; 65535 = 3 * 5 * 17 * 257, so many initial values of mss...
true
f4a6beb6c8f04d99adc7754ff5a865bc
skb_segment
struct sk_buff *skb_segment(struct sk_buff *head_skb, netdev_features_t features) { struct sk_buff *segs = NULL; struct sk_buff *tail = NULL; struct sk_buff *list_skb = skb_shinfo(head_skb)->frag_list; unsigned int mss = skb_shinfo(head_skb)->gso_size; unsigned int doffset = head_skb->data - skb_mac_header(...
[[4526, "\t\tpartial_segs = len / mss;\n"]]
[[4526, "partial_segs = len / mss;"]]
[ "CVE-2023-52435" ]
[ "CWE-119" ]
48
{ "Execution Environment": [], "Explanation": null, "External Function": [], "Function Argument": [], "Globals": [ "GSO_BY_FRAGS" ], "Type Execution Declaration": [] }
48
linux
https://github.com/torvalds/linux
net/core/skbuff.c
23d05d563b7e7b0314e65c8e882bc27eac2da8e7
net: prevent mss overflow in skb_segment() Once again syzbot is able to crash the kernel in skb_segment() [1] GSO_BY_FRAGS is a forbidden value, but unfortunately the following computation in skb_segment() can reach it quite easily : mss = mss * partial_segs; 65535 = 3 * 5 * 17 * 257, so many initial values of mss...
false
70d5997a37d55526b7145ec1ac92a699
skb_segment
struct sk_buff *skb_segment(struct sk_buff *head_skb, netdev_features_t features) { struct sk_buff *segs = NULL; struct sk_buff *tail = NULL; struct sk_buff *list_skb = skb_shinfo(head_skb)->frag_list; unsigned int mss = skb_shinfo(head_skb)->gso_size; unsigned int doffset = head_skb->data - skb_mac_header(...
[[4525, "\t\t * Cap len to not accidentally hit GSO_BY_FRAGS.\n"], [4527, "\t\tpartial_segs = min(len, GSO_BY_FRAGS - 1) / mss;\n"]]
[[4522, "/* GSO partial only requires that we trim off any excess that\n\t\t * doesn't fit into an MSS sized block, so take care of that\n\t\t * now.\n\t\t * Cap len to not accidentally hit GSO_BY_FRAGS.\n\t\t */"], [4527, "partial_segs = min(len, GSO_BY_FRAGS - 1) / mss;"]]
[ "CVE-2023-52435" ]
[ "CWE-119" ]
48
{ "Execution Environment": [], "Explanation": null, "External Function": [], "Function Argument": [], "Globals": [ "GSO_BY_FRAGS" ], "Type Execution Declaration": [] }
49
linux
https://github.com/torvalds/linux
net/ipv6/ip6_output.c
2811ebac2521ceac84f2bdae402455baa6a7fb47
ipv6: udp packets following an UFO enqueued packet need also be handled by UFO In the following scenario the socket is corked: If the first UDP packet is larger then the mtu we try to append it to the write queue via ip6_ufo_append_data. A following packet, which is smaller than the mtu would be appended to the alread...
true
b3f215a3ecde0c9ee380b673673eb026
ip6_ufo_append_data
static inline int ip6_ufo_append_data(struct sock *sk, int getfrag(void *from, char *to, int offset, int len, int odd, struct sk_buff *skb), void *from, int length, int hh_len, int fragheaderlen, int transhdrlen, int mtu,unsigned int flags, struct rt6_info *rt) { struct sk_buff *skb; int err; /* The...
[[1039, "\t}\n"], [1040, "\n"], [1041, "\terr = skb_append_datato_frags(sk,skb, getfrag, from,\n"], [1042, "\t\t\t\t (length - transhdrlen));\n"], [1043, "\tif (!err) {\n"], [1044, "\t\tstruct frag_hdr fhdr;\n"], [1055, "\n"], [1056, "\t\treturn 0;\n"], [1058, "\t/* There is not enough support do UPD LSO,\n"], [10...
[[1039, "\t}\n"], [1040, "\n"], [1041, "err = skb_append_datato_frags(sk,skb, getfrag, from,\n\t\t\t\t (length - transhdrlen));"], [1043, "if (!err)"], [1044, "struct frag_hdr fhdr;"], [1055, "\n"], [1056, "return 0;"], [1058, "/* There is not enough support do UPD LSO,\n\t * so follow normal path\n\t */"], [1061,...
[ "CVE-2013-4387" ]
[ "CWE-119" ]
51
{ "Execution Environment": [], "Explanation": null, "External Function": [ "skb_peek_tail", "sock_alloc_send_skb", "skb_reserve", "skb_put", "skb_reset_network_header", "skb_append_datato_frags", "ipv6_select_ident" ], "Function Argument": [ "sk", "getfrag", "from", ...
50
linux
https://github.com/torvalds/linux
net/ipv6/ip6_output.c
2811ebac2521ceac84f2bdae402455baa6a7fb47
ipv6: udp packets following an UFO enqueued packet need also be handled by UFO In the following scenario the socket is corked: If the first UDP packet is larger then the mtu we try to append it to the write queue via ip6_ufo_append_data. A following packet, which is smaller than the mtu would be appended to the alread...
true
0d93ed0dca48b146b6caaa5774fe9256
ip6_append_data
int ip6_append_data(struct sock *sk, int getfrag(void *from, char *to, int offset, int len, int odd, struct sk_buff *skb), void *from, int length, int transhdrlen, int hlimit, int tclass, struct ipv6_txoptions *opt, struct flowi6 *fl6, struct rt6_info *rt, unsigned int flags, int dontfrag) { struct inet_sock *inet...
[[1230, "\tcork->length += length;\n"], [1231, "\tif (length > mtu) {\n"], [1232, "\t\tint proto = sk->sk_protocol;\n"], [1233, "\t\tif (dontfrag && (proto == IPPROTO_UDP || proto == IPPROTO_RAW)){\n"], [1234, "\t\t\tipv6_local_rxpmtu(sk, fl6, mtu-exthdrlen);\n"], [1235, "\t\t\treturn -EMSGSIZE;\n"], [1236, "\t\t}\n"],...
[[1230, "cork->length += length;"], [1231, "if (length > mtu)"], [1232, "int proto = sk->sk_protocol;"], [1233, "if (dontfrag && (proto == IPPROTO_UDP || proto == IPPROTO_RAW))"], [1234, "ipv6_local_rxpmtu(sk, fl6, mtu-exthdrlen);"], [1235, "return -EMSGSIZE;"], [1236, "\t\t}\n"], [1237, "\n"], [1238, "if (proto == IPP...
[ "CVE-2013-4387" ]
[ "CWE-119" ]
52
{ "Execution Environment": [], "Explanation": null, "External Function": [ "skb_is_gso", "ip6_ufo_append_data", "skb_peek_tail" ], "Function Argument": [ "struct sock *sk", "struct ipv6_txoptions *opt", "struct flowi6 *fl6", "struct rt6_info *rt", "int dontfrag" ], "Globals...
51
linux
https://github.com/torvalds/linux
net/ipv6/ip6_output.c
2811ebac2521ceac84f2bdae402455baa6a7fb47
ipv6: udp packets following an UFO enqueued packet need also be handled by UFO In the following scenario the socket is corked: If the first UDP packet is larger then the mtu we try to append it to the write queue via ip6_ufo_append_data. A following packet, which is smaller than the mtu would be appended to the alread...
false
ff07229fc5a6a24a8c1fd54c05d03321
ip6_ufo_append_data
static inline int ip6_ufo_append_data(struct sock *sk, int getfrag(void *from, char *to, int offset, int len, int odd, struct sk_buff *skb), void *from, int length, int hh_len, int fragheaderlen, int transhdrlen, int mtu,unsigned int flags, struct rt6_info *rt) { struct sk_buff *skb; int err; /* The...
[[1018, "\t\tstruct frag_hdr fhdr;\n"], [1019, "\n"], [1053, "\treturn skb_append_datato_frags(sk, skb, getfrag, from,\n"], [1054, "\t\t\t\t (length - transhdrlen));\n"]]
[[1018, "struct frag_hdr fhdr;"], [1019, "\n"], [1053, "return skb_append_datato_frags(sk, skb, getfrag, from,\n\t\t\t\t (length - transhdrlen));"]]
[ "CVE-2013-4387" ]
[ "CWE-119" ]
51
{ "Execution Environment": [], "Explanation": null, "External Function": [ "skb_peek_tail", "sock_alloc_send_skb", "skb_reserve", "skb_put", "skb_reset_network_header", "skb_append_datato_frags", "ipv6_select_ident" ], "Function Argument": [ "sk", "getfrag", "from", ...
52
linux
https://github.com/torvalds/linux
net/ipv6/ip6_output.c
2811ebac2521ceac84f2bdae402455baa6a7fb47
ipv6: udp packets following an UFO enqueued packet need also be handled by UFO In the following scenario the socket is corked: If the first UDP packet is larger then the mtu we try to append it to the write queue via ip6_ufo_append_data. A following packet, which is smaller than the mtu would be appended to the alread...
false
d8548966db5ac5d31cb35aca029bc88c
ip6_append_data
int ip6_append_data(struct sock *sk, int getfrag(void *from, char *to, int offset, int len, int odd, struct sk_buff *skb), void *from, int length, int transhdrlen, int hlimit, int tclass, struct ipv6_txoptions *opt, struct flowi6 *fl6, struct rt6_info *rt, unsigned int flags, int dontfrag) { struct inet_sock *inet...
[[1221, "\tif ((length > mtu) && dontfrag && (sk->sk_protocol == IPPROTO_UDP ||\n"], [1222, "\t\t\t\t\t sk->sk_protocol == IPPROTO_RAW)) {\n"], [1223, "\t\tipv6_local_rxpmtu(sk, fl6, mtu-exthdrlen);\n"], [1224, "\t\treturn -EMSGSIZE;\n"], [1225, "\t}\n"], [1227, "\tskb = skb_peek_tail(&sk->sk_write_queue);\n"], [1228...
[[1221, "if ((length > mtu) && dontfrag && (sk->sk_protocol == IPPROTO_UDP ||\n\t\t\t\t\t sk->sk_protocol == IPPROTO_RAW))"], [1223, "ipv6_local_rxpmtu(sk, fl6, mtu-exthdrlen);"], [1224, "return -EMSGSIZE;"], [1225, "\t}\n"], [1227, "skb = skb_peek_tail(&sk->sk_write_queue);"], [1228, "cork->length += length;"], [122...
[ "CVE-2013-4387" ]
[ "CWE-119" ]
52
{ "Execution Environment": [], "Explanation": null, "External Function": [ "skb_is_gso", "ip6_ufo_append_data", "skb_peek_tail" ], "Function Argument": [ "struct sock *sk", "struct ipv6_txoptions *opt", "struct flowi6 *fl6", "struct rt6_info *rt", "int dontfrag" ], "Globals...
53
linux
https://github.com/torvalds/linux
kernel/bpf/devmap.c
281d464a34f540de166cee74b723e97ac2515ec3
bpf: Fix DEVMAP_HASH overflow check on 32-bit arches The devmap code allocates a number hash buckets equal to the next power of two of the max_entries value provided when creating the map. When rounding up to the next power of two, the 32-bit variable storing the number of buckets can overflow, and the code checks for...
true
5ccca320aeb25f8c7892ddc54d010fe5
dev_map_init_map
static int dev_map_init_map(struct bpf_dtab *dtab, union bpf_attr *attr) { u32 valsize = attr->value_size; /* check sanity of attributes. 2 value sizes supported: * 4 bytes: ifindex * 8 bytes: ifindex + prog fd */ if (attr->max_entries == 0 || attr->key_size != 4 || (valsize != offsetofend(struct bpf_dev...
[[133, "\t\tdtab->n_buckets = roundup_pow_of_two(dtab->map.max_entries);\n"], [134, "\n"], [135, "\t\tif (!dtab->n_buckets) /* Overflow check */\n"], [137, "\t}\n"], [139, "\tif (attr->map_type == BPF_MAP_TYPE_DEVMAP_HASH) {\n"]]
[[133, "dtab->n_buckets = roundup_pow_of_two(dtab->map.max_entries);"], [134, "\n"], [135, "if (!dtab->n_buckets) /* Overflow check */"], [137, "\t}\n"], [139, "if (attr->map_type == BPF_MAP_TYPE_DEVMAP_HASH)"]]
[ "CVE-2024-26885" ]
[ "CWE-119" ]
54
{ "Execution Environment": [ "Size of unsigned long on the target architecture (32-bit vs 64-bit)" ], "Explanation": null, "External Function": [ "roundup_pow_of_two" ], "Function Argument": [], "Globals": [], "Type Execution Declaration": [] }
54
linux
https://github.com/torvalds/linux
kernel/bpf/devmap.c
281d464a34f540de166cee74b723e97ac2515ec3
bpf: Fix DEVMAP_HASH overflow check on 32-bit arches The devmap code allocates a number hash buckets equal to the next power of two of the max_entries value provided when creating the map. When rounding up to the next power of two, the 32-bit variable storing the number of buckets can overflow, and the code checks for...
false
e8f9ecae3cc00ea898e1a067d4768776
dev_map_init_map
static int dev_map_init_map(struct bpf_dtab *dtab, union bpf_attr *attr) { u32 valsize = attr->value_size; /* check sanity of attributes. 2 value sizes supported: * 4 bytes: ifindex * 8 bytes: ifindex + prog fd */ if (attr->max_entries == 0 || attr->key_size != 4 || (valsize != offsetofend(struct bpf_dev...
[[133, "\t\t/* hash table size must be power of 2; roundup_pow_of_two() can\n"], [134, "\t\t * overflow into UB on 32-bit arches, so check that first\n"], [135, "\t\t */\n"], [136, "\t\tif (dtab->map.max_entries > 1UL << 31)\n"], [139, "\t\tdtab->n_buckets = roundup_pow_of_two(dtab->map.max_entries);\n"], [140, "\n"]]
[[133, "/* hash table size must be power of 2; roundup_pow_of_two() can\n\t\t * overflow into UB on 32-bit arches, so check that first\n\t\t */"], [136, "if (dtab->map.max_entries > 1UL << 31)"], [139, "dtab->n_buckets = roundup_pow_of_two(dtab->map.max_entries);"], [140, "\n"]]
[ "CVE-2024-26885" ]
[ "CWE-119" ]
54
{ "Execution Environment": [ "Size of unsigned long on the target architecture (32-bit vs 64-bit)" ], "Explanation": null, "External Function": [ "roundup_pow_of_two" ], "Function Argument": [], "Globals": [], "Type Execution Declaration": [] }
55
linux
https://github.com/torvalds/linux
net/netlabel/netlabel_cipso_v4.c
2a2f11c227bdf292b3a2900ad04139d301b56ac4
NetLabel: correct CIPSO tag handling when adding new DOI definitions The current netlbl_cipsov4_add_common() function has two problems which are fixed with this patch. The first is an off-by-one bug where it is possibile to overflow the doi_def->tags[] array. The second is a bug where the same doi_def->tags[] array ...
true
4c9fd8131014712f7144f68bd5c6ddd7
netlbl_cipsov4_add_common
static int netlbl_cipsov4_add_common(struct genl_info *info, struct cipso_v4_doi *doi_def) { struct nlattr *nla; int nla_rem; u32 iter = 0; doi_def->doi = nla_get_u32(info->attrs[NLBL_CIPSOV4_A_DOI]); if (nla_validate_nested(info->attrs[NLBL_CIPSOV4_A_TAGLST], NLBL_CIPSOV4_A_MAX, netlbl_cipsov4_...
[[133, "\t\t\tif (iter > CIPSO_V4_TAG_MAXCNT)\n"], [137, "\tif (iter < CIPSO_V4_TAG_MAXCNT)\n"], [138, "\t\tdoi_def->tags[iter] = CIPSO_V4_TAG_INVALID;\n"]]
[[133, "if (iter > CIPSO_V4_TAG_MAXCNT)"], [137, "if (iter < CIPSO_V4_TAG_MAXCNT)"], [138, "doi_def->tags[iter] = CIPSO_V4_TAG_INVALID;"]]
[ "CVE-2007-6762" ]
[ "CWE-119" ]
56
{ "Execution Environment": [], "Explanation": null, "External Function": [], "Function Argument": [ "struct cipso_v4_doi *doi_def" ], "Globals": [ "CIPSO_V4_TAG_MAXCNT" ], "Type Execution Declaration": [ "struct cipso_v4_doi" ] }
56
linux
https://github.com/torvalds/linux
net/netlabel/netlabel_cipso_v4.c
2a2f11c227bdf292b3a2900ad04139d301b56ac4
NetLabel: correct CIPSO tag handling when adding new DOI definitions The current netlbl_cipsov4_add_common() function has two problems which are fixed with this patch. The first is an off-by-one bug where it is possibile to overflow the doi_def->tags[] array. The second is a bug where the same doi_def->tags[] array ...
false
d04467fa7dd237b22455c6cb93a5f448
netlbl_cipsov4_add_common
static int netlbl_cipsov4_add_common(struct genl_info *info, struct cipso_v4_doi *doi_def) { struct nlattr *nla; int nla_rem; u32 iter = 0; doi_def->doi = nla_get_u32(info->attrs[NLBL_CIPSOV4_A_DOI]); if (nla_validate_nested(info->attrs[NLBL_CIPSOV4_A_TAGLST], NLBL_CIPSOV4_A_MAX, netlbl_cipsov4_...
[[133, "\t\t\tif (iter >= CIPSO_V4_TAG_MAXCNT)\n"], [137, "\twhile (iter < CIPSO_V4_TAG_MAXCNT)\n"], [138, "\t\tdoi_def->tags[iter++] = CIPSO_V4_TAG_INVALID;\n"]]
[[133, "if (iter >= CIPSO_V4_TAG_MAXCNT)"], [137, "while (iter < CIPSO_V4_TAG_MAXCNT)"], [138, "doi_def->tags[iter++] = CIPSO_V4_TAG_INVALID;"]]
[ "CVE-2007-6762" ]
[ "CWE-119" ]
56
{ "Execution Environment": [], "Explanation": null, "External Function": [], "Function Argument": [ "struct cipso_v4_doi *doi_def" ], "Globals": [ "CIPSO_V4_TAG_MAXCNT" ], "Type Execution Declaration": [ "struct cipso_v4_doi" ] }
57
linux
https://github.com/torvalds/linux
net/packet/af_packet.c
2b6867c2ce76c596676bec7d2d525af525fdc6e2
net/packet: fix overflow in check for priv area size Subtracting tp_sizeof_priv from tp_block_size and casting to int to check whether one is less then the other doesn't always work (both of them are unsigned ints). Compare them as is instead. Also cast tp_sizeof_priv to u64 before using BLK_PLUS_PRIV, as it can ove...
true
444a6ab864c27b2bc29b69291705f480
packet_set_ring
static int packet_set_ring(struct sock *sk, union tpacket_req_u *req_u, int closing, int tx_ring) { struct pgv *pg_vec = NULL; struct packet_sock *po = pkt_sk(sk); int was_running, order = 0; struct packet_ring_buffer *rb; struct sk_buff_head *rb_queue; __be16 num; int err = -EINVAL; /* Added to avoid minimal...
[[4196, "\t\t (int)(req->tp_block_size -\n"], [4197, "\t\t\t BLK_PLUS_PRIV(req_u->req3.tp_sizeof_priv)) <= 0)\n"]]
[[4195, "if (po->tp_version >= TPACKET_V3 &&\n\t\t (int)(req->tp_block_size -\n\t\t\t BLK_PLUS_PRIV(req_u->req3.tp_sizeof_priv)) <= 0)"]]
[ "CVE-2017-7308" ]
[ "CWE-787" ]
58
{ "Execution Environment": [], "Explanation": null, "External Function": [ "BLK_PLUS_PRIV" ], "Function Argument": [ "req_u" ], "Globals": [], "Type Execution Declaration": [] }
58
linux
https://github.com/torvalds/linux
net/packet/af_packet.c
2b6867c2ce76c596676bec7d2d525af525fdc6e2
net/packet: fix overflow in check for priv area size Subtracting tp_sizeof_priv from tp_block_size and casting to int to check whether one is less then the other doesn't always work (both of them are unsigned ints). Compare them as is instead. Also cast tp_sizeof_priv to u64 before using BLK_PLUS_PRIV, as it can ove...
false
d6c8f0d1d148fbd942e8b6aa7987ec8f
packet_set_ring
static int packet_set_ring(struct sock *sk, union tpacket_req_u *req_u, int closing, int tx_ring) { struct pgv *pg_vec = NULL; struct packet_sock *po = pkt_sk(sk); int was_running, order = 0; struct packet_ring_buffer *rb; struct sk_buff_head *rb_queue; __be16 num; int err = -EINVAL; /* Added to avoid minimal...
[[4196, "\t\t req->tp_block_size <=\n"], [4197, "\t\t\t BLK_PLUS_PRIV((u64)req_u->req3.tp_sizeof_priv))\n"]]
[[4195, "if (po->tp_version >= TPACKET_V3 &&\n\t\t req->tp_block_size <=\n\t\t\t BLK_PLUS_PRIV((u64)req_u->req3.tp_sizeof_priv))"]]
[ "CVE-2017-7308" ]
[ "CWE-787" ]
58
{ "Execution Environment": [], "Explanation": null, "External Function": [ "BLK_PLUS_PRIV" ], "Function Argument": [ "req_u" ], "Globals": [], "Type Execution Declaration": [] }
59
linux
https://github.com/torvalds/linux
drivers/net/usb/catc.c
2d6a0e9de03ee658a9adc3bfb2f0ca55dff1e478
catc: Use heap buffer for memory size test Allocating USB buffers on the stack is not portable, and no longer works on x86_64 (with VMAP_STACK enabled as per default). Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Signed-off-by: Ben Hutchings <ben@decadent.org.uk> Signed-off-by: David S. Miller <davem@davemloft.net>
true
22f939f3ee45d3ab7a523cf5b27ed1f2
catc_probe
static int catc_probe(struct usb_interface *intf, const struct usb_device_id *id) { struct device *dev = &intf->dev; struct usb_device *usbdev = interface_to_usbdev(intf); struct net_device *netdev; struct catc *catc; u8 broadcast[ETH_ALEN]; int i, pktsz, ret; if (usb_set_interface(usbdev, intf->altsetting->...
[[779, "\tint i, pktsz, ret;\n"], [845, "\t\ti = 0x12345678;\n"], [846, "\t\tcatc_write_mem(catc, 0x7a80, &i, 4);\n"], [847, "\t\ti = 0x87654321;\t\n"], [848, "\t\tcatc_write_mem(catc, 0xfa80, &i, 4);\n"], [849, "\t\tcatc_read_mem(catc, 0x7a80, &i, 4);\n"], [851, "\t\tswitch (i) {\n"]]
[[779, "int i, pktsz, ret;"], [845, "i = 0x12345678;"], [846, "catc_write_mem(catc, 0x7a80, &i, 4);"], [847, "i = 0x87654321;"], [848, "catc_write_mem(catc, 0xfa80, &i, 4);"], [849, "catc_read_mem(catc, 0x7a80, &i, 4);"], [851, "switch (i) {"]]
[ "CVE-2017-8070" ]
[ "CWE-119" ]
60
{ "Execution Environment": [ "CONFIG_VMAP_STACK" ], "Explanation": null, "External Function": [ "catc_write_mem", "catc_read_mem" ], "Function Argument": [ "struct usb_interface *intf", "const struct usb_device_id *id" ], "Globals": [], "Type Execution Declaration": [] }
60
linux
https://github.com/torvalds/linux
drivers/net/usb/catc.c
2d6a0e9de03ee658a9adc3bfb2f0ca55dff1e478
catc: Use heap buffer for memory size test Allocating USB buffers on the stack is not portable, and no longer works on x86_64 (with VMAP_STACK enabled as per default). Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Signed-off-by: Ben Hutchings <ben@decadent.org.uk> Signed-off-by: David S. Miller <davem@davemloft.net>
false
f4d160e73f9201211d263585dd4f503c
catc_probe
static int catc_probe(struct usb_interface *intf, const struct usb_device_id *id) { struct device *dev = &intf->dev; struct usb_device *usbdev = interface_to_usbdev(intf); struct net_device *netdev; struct catc *catc; u8 broadcast[ETH_ALEN]; int pktsz, ret; if (usb_set_interface(usbdev, intf->altsetting->des...
[[779, "\tint pktsz, ret;\n"], [843, "\t\tu32 *buf;\n"], [844, "\t\tint i;\n"], [845, "\n"], [848, "\t\tbuf = kmalloc(4, GFP_KERNEL);\n"], [849, "\t\tif (!buf) {\n"], [850, "\t\t\tret = -ENOMEM;\n"], [851, "\t\t\tgoto fail_free;\n"], [852, "\t\t}\n"], [853, "\n"], [854, "\t\t*buf = 0x12345678;\n"], [855, "\t\tcatc_writ...
[[779, "int pktsz, ret;"], [843, "u32 *buf;"], [844, "int i;"], [845, "\n"], [848, "buf = kmalloc(4, GFP_KERNEL);"], [849, "if (!buf)"], [850, "ret = -ENOMEM;"], [851, "goto fail_free;"], [852, "\t\t}\n"], [853, "\n"], [854, "*buf = 0x12345678;"], [855, "catc_write_mem(catc, 0x7a80, buf, 4);"], [856, "*buf = 0x87654321...
[ "CVE-2017-8070" ]
[ "CWE-119" ]
60
{ "Execution Environment": [ "CONFIG_VMAP_STACK" ], "Explanation": null, "External Function": [ "catc_write_mem", "catc_read_mem" ], "Function Argument": [ "struct usb_interface *intf", "const struct usb_device_id *id" ], "Globals": [], "Type Execution Declaration": [] }
61
linux
https://github.com/torvalds/linux
drivers/net/wireless/iwlwifi/iwl-agn-sta.c
2da424b0773cea3db47e1e81db71eeebde8269d4
iwlwifi: Sanity check for sta_id On my testing, I saw some strange behavior [ 421.739708] iwlwifi 0000:01:00.0: ACTIVATE a non DRIVER active station id 148 addr 00:00:00:00:00:00 [ 421.739719] iwlwifi 0000:01:00.0: iwl_sta_ucode_activate Added STA id 148 addr 00:00:00:00:00:00 to uCode not sure how it happen, but ...
true
9ad2deb6b4d8a8bc03cf87ed9776a3b6
iwl_sta_ucode_activate
static void iwl_sta_ucode_activate(struct iwl_priv *priv, u8 sta_id) { if (!(priv->stations[sta_id].used & IWL_STA_DRIVER_ACTIVE)) IWL_ERR(priv, "ACTIVATE a non DRIVER active station id %u " "addr %pM\n", sta_id, priv->stations[sta_id].sta.sta.addr); if (priv->stations[sta_id].used & IWL_STA_UCODE_ACTIVE) {...
[[38, "static void iwl_sta_ucode_activate(struct iwl_priv *priv, u8 sta_id)\n"], [40, "\n"]]
[[38, "static void iwl_sta_ucode_activate(struct iwl_priv *priv, u8 sta_id)"], [40, "\n"]]
[ "CVE-2012-6712" ]
[ "CWE-119" ]
62
{ "Execution Environment": [], "Explanation": null, "External Function": [], "Function Argument": [], "Globals": [ "IWLAGN_STATION_COUNT" ], "Type Execution Declaration": [ "struct iwl_priv", "IWL_STA_DRIVER_ACTIVE", "IWL_STA_UCODE_ACTIVE" ] }
62
linux
https://github.com/torvalds/linux
drivers/net/wireless/iwlwifi/iwl-agn-sta.c
2da424b0773cea3db47e1e81db71eeebde8269d4
iwlwifi: Sanity check for sta_id On my testing, I saw some strange behavior [ 421.739708] iwlwifi 0000:01:00.0: ACTIVATE a non DRIVER active station id 148 addr 00:00:00:00:00:00 [ 421.739719] iwlwifi 0000:01:00.0: iwl_sta_ucode_activate Added STA id 148 addr 00:00:00:00:00:00 to uCode not sure how it happen, but ...
false
4fe4f98d31c4ee36521adc11f4aa90ea
iwl_sta_ucode_activate
static int iwl_sta_ucode_activate(struct iwl_priv *priv, u8 sta_id) { if (sta_id >= IWLAGN_STATION_COUNT) { IWL_ERR(priv, "invalid sta_id %u", sta_id); return -EINVAL; } if (!(priv->stations[sta_id].used & IWL_STA_DRIVER_ACTIVE)) IWL_ERR(priv, "ACTIVATE a non DRIVER active station id %u " "addr %pM\n", s...
[[38, "static int iwl_sta_ucode_activate(struct iwl_priv *priv, u8 sta_id)\n"], [40, "\tif (sta_id >= IWLAGN_STATION_COUNT) {\n"], [41, "\t\tIWL_ERR(priv, \"invalid sta_id %u\", sta_id);\n"], [42, "\t\treturn -EINVAL;\n"], [43, "\t}\n"], [59, "\treturn 0;\n"]]
[[38, "static int iwl_sta_ucode_activate(struct iwl_priv *priv, u8 sta_id)"], [40, "if (sta_id >= IWLAGN_STATION_COUNT)"], [41, "IWL_ERR(priv, \"invalid sta_id %u\", sta_id);"], [42, "return -EINVAL;"], [43, "\t}\n"], [59, "return 0;"]]
[ "CVE-2012-6712" ]
[ "CWE-119" ]
62
{ "Execution Environment": [], "Explanation": null, "External Function": [], "Function Argument": [], "Globals": [ "IWLAGN_STATION_COUNT" ], "Type Execution Declaration": [ "struct iwl_priv", "IWL_STA_DRIVER_ACTIVE", "IWL_STA_UCODE_ACTIVE" ] }
63
linux
https://github.com/torvalds/linux
drivers/usb/core/message.c
2e1c42391ff2556387b3cb6308b24f6f65619feb
USB: core: harden cdc_parse_cdc_header Andrey Konovalov reported a possible out-of-bounds problem for the cdc_parse_cdc_header function. He writes: It looks like cdc_parse_cdc_header() doesn't validate buflen before accessing buffer[1], buffer[2] and so on. The only check present is while (buflen > 0). So fix thi...
true
67cccb2edbdbcaa7b6d975bc930769e3
cdc_parse_cdc_header
int cdc_parse_cdc_header(struct usb_cdc_parsed_header *hdr, struct usb_interface *intf, u8 *buffer, int buflen) { /* duplicates are ignored */ struct usb_cdc_union_desc *union_header = NULL; /* duplicates are not tolerated */ struct usb_cdc_header_desc *header = NULL; struct usb_cdc_ether_desc *ether ...
[]
[]
[ "CVE-2017-16534" ]
[ "CWE-119" ]
64
{ "Execution Environment": [], "Explanation": null, "External Function": [], "Function Argument": [], "Globals": [ "USB_DT_CS_INTERFACE", "USB_CDC_UNION_TYPE", "USB_CDC_COUNTRY_TYPE", "USB_CDC_HEADER_TYPE", "USB_CDC_ACM_TYPE", "USB_CDC_ETHERNET_TYPE", "USB_CDC_CALL_MANAGEMENT_TYPE"...
64
linux
https://github.com/torvalds/linux
drivers/usb/core/message.c
2e1c42391ff2556387b3cb6308b24f6f65619feb
USB: core: harden cdc_parse_cdc_header Andrey Konovalov reported a possible out-of-bounds problem for the cdc_parse_cdc_header function. He writes: It looks like cdc_parse_cdc_header() doesn't validate buflen before accessing buffer[1], buffer[2] and so on. The only check present is while (buflen > 0). So fix thi...
false
b882c8014dc9c7f1f0b707ef47655e4f
cdc_parse_cdc_header
int cdc_parse_cdc_header(struct usb_cdc_parsed_header *hdr, struct usb_interface *intf, u8 *buffer, int buflen) { /* duplicates are ignored */ struct usb_cdc_union_desc *union_header = NULL; /* duplicates are not tolerated */ struct usb_cdc_header_desc *header = NULL; struct usb_cdc_ether_desc *ether ...
[[2072, "\t\tif ((buflen < elength) || (elength < 3)) {\n"], [2073, "\t\t\tdev_err(&intf->dev, \"invalid descriptor buffer length\\n\");\n"], [2074, "\t\t\tbreak;\n"], [2075, "\t\t}\n"]]
[[2072, "if ((buflen < elength) || (elength < 3))"], [2073, "dev_err(&intf->dev, \"invalid descriptor buffer length\\n\");"], [2074, "break;"], [2075, "\t\t}\n"]]
[ "CVE-2017-16534" ]
[ "CWE-119" ]
64
{ "Execution Environment": [], "Explanation": null, "External Function": [], "Function Argument": [], "Globals": [ "USB_DT_CS_INTERFACE", "USB_CDC_UNION_TYPE", "USB_CDC_COUNTRY_TYPE", "USB_CDC_HEADER_TYPE", "USB_CDC_ACM_TYPE", "USB_CDC_ETHERNET_TYPE", "USB_CDC_CALL_MANAGEMENT_TYPE"...
65
linux
https://github.com/torvalds/linux
security/apparmor/lsm.c
30a46a4647fd1df9cf52e43bf467f0d9265096ca
apparmor: fix oops, validate buffer size in apparmor_setprocattr() When proc_pid_attr_write() was changed to use memdup_user apparmor's (interface violating) assumption that the setprocattr buffer was always a single page was violated. The size test is not strictly speaking needed as proc_pid_attr_write() will reject...
true
2aa205d4471b524745a6ff7b07ec87e5
apparmor_setprocattr
static int apparmor_setprocattr(struct task_struct *task, char *name, void *value, size_t size) { struct common_audit_data sa; struct apparmor_audit_data aad = {0,}; char *command, *args = value; size_t arg_size; int error; if (size == 0) return -EINVAL; /* args points to a PAGE_SIZE buffer, AppArmor requ...
[[503, "\tchar *command, *args = value;\n"], [509, "\t/* args points to a PAGE_SIZE buffer, AppArmor requires that\n"], [510, "\t * the buffer must be null terminated or have size <= PAGE_SIZE -1\n"], [511, "\t * so that AppArmor can null terminate them\n"], [512, "\t */\n"], [513, "\tif (args[size - 1] != '\\0') {\n"]...
[[503, "char *command, *args = value;"], [509, "/* args points to a PAGE_SIZE buffer, AppArmor requires that\n\t * the buffer must be null terminated or have size <= PAGE_SIZE -1\n\t * so that AppArmor can null terminate them\n\t */"], [513, "if (args[size - 1] != '\\0')"], [514, "if (size == PAGE_SIZE)"], [515, "retur...
[ "CVE-2016-6187" ]
[ "CWE-119" ]
66
{ "Execution Environment": [], "Explanation": null, "External Function": [], "Function Argument": [ "value", "size" ], "Globals": [ "PAGE_SIZE" ], "Type Execution Declaration": [] }
66
linux
https://github.com/torvalds/linux
security/apparmor/lsm.c
30a46a4647fd1df9cf52e43bf467f0d9265096ca
apparmor: fix oops, validate buffer size in apparmor_setprocattr() When proc_pid_attr_write() was changed to use memdup_user apparmor's (interface violating) assumption that the setprocattr buffer was always a single page was violated. The size test is not strictly speaking needed as proc_pid_attr_write() will reject...
false
c9f7da81394639484c3d759435eb4307
apparmor_setprocattr
static int apparmor_setprocattr(struct task_struct *task, char *name, void *value, size_t size) { struct common_audit_data sa; struct apparmor_audit_data aad = {0,}; char *command, *largs = NULL, *args = value; size_t arg_size; int error; if (size == 0) return -EINVAL; /* task can only write its own attri...
[[503, "\tchar *command, *largs = NULL, *args = value;\n"], [513, "\t/* AppArmor requires that the buffer must be null terminated atm */\n"], [514, "\tif (args[size - 1] != '\\0') {\n"], [515, "\t\t/* null terminate */\n"], [516, "\t\tlargs = args = kmalloc(size + 1, GFP_KERNEL);\n"], [517, "\t\tif (!args)\n"], [518, "...
[[503, "char *command, *largs = NULL, *args = value;"], [513, "/* AppArmor requires that the buffer must be null terminated atm */"], [514, "if (args[size - 1] != '\\0')"], [515, "/* null terminate */"], [516, "largs = args = kmalloc(size + 1, GFP_KERNEL);"], [517, "if (!args)"], [518, "return -ENOMEM;"], [519, "memcpy...
[ "CVE-2016-6187" ]
[ "CWE-119" ]
66
{ "Execution Environment": [], "Explanation": null, "External Function": [], "Function Argument": [ "value", "size" ], "Globals": [ "PAGE_SIZE" ], "Type Execution Declaration": [] }
67
linux
https://github.com/torvalds/linux
arch/loongarch/net/bpf_jit.c
36a87385e31c9343af9a4756598e704741250a67
LoongArch: BPF: Prevent out-of-bounds memory access The test_tag test triggers an unhandled page fault: # ./test_tag [ 130.640218] CPU 0 Unable to handle kernel paging request at virtual address ffff80001b898004, era == 9000000003137f7c, ra == 9000000003139e70 [ 130.640501] Oops[#3]: [ 130.640553] CPU: 0 P...
true
719fda17f6dc069f936d58796841734c
build_insn
static int build_insn(const struct bpf_insn *insn, struct jit_ctx *ctx, bool extra_pass) { u8 tm = -1; u64 func_addr; bool func_addr_fixed, sign_extend; int i = insn - ctx->prog->insnsi; int ret, jmp_offset; const u8 code = insn->code; const u8 cond = BPF_OP(code); const u8 t1 = LOONGARCH_GPR_T1; const u8 t2 =...
[[473, "\tconst u64 imm64 = (u64)(insn + 1)->imm << 32 | (u32)insn->imm;\n"]]
[[473, "const u64 imm64 = (u64)(insn + 1)->imm << 32 | (u32)insn->imm;"]]
[ "CVE-2024-26588" ]
[ "CWE-125", "CWE-119" ]
68
{ "Execution Environment": [], "Explanation": null, "External Function": [], "Function Argument": [ "insn", "ctx" ], "Globals": [], "Type Execution Declaration": [] }
68
linux
https://github.com/torvalds/linux
arch/loongarch/net/bpf_jit.c
36a87385e31c9343af9a4756598e704741250a67
LoongArch: BPF: Prevent out-of-bounds memory access The test_tag test triggers an unhandled page fault: # ./test_tag [ 130.640218] CPU 0 Unable to handle kernel paging request at virtual address ffff80001b898004, era == 9000000003137f7c, ra == 9000000003139e70 [ 130.640501] Oops[#3]: [ 130.640553] CPU: 0 P...
false
d0de32374eb64f45e7c908076a8d3536
build_insn
static int build_insn(const struct bpf_insn *insn, struct jit_ctx *ctx, bool extra_pass) { u8 tm = -1; u64 func_addr; bool func_addr_fixed, sign_extend; int i = insn - ctx->prog->insnsi; int ret, jmp_offset; const u8 code = insn->code; const u8 cond = BPF_OP(code); const u8 t1 = LOONGARCH_GPR_T1; const u8 t2 =...
[[930, "\t{\n"], [931, "\t\tconst u64 imm64 = (u64)(insn + 1)->imm << 32 | (u32)insn->imm;\n"], [932, "\n"], [935, "\t}\n"]]
[[930, "\t{\n"], [931, "const u64 imm64 = (u64)(insn + 1)->imm << 32 | (u32)insn->imm;"], [932, "\n"], [935, "\t}\n"]]
[ "CVE-2024-26588" ]
[ "CWE-125", "CWE-119" ]
68
{ "Execution Environment": [], "Explanation": null, "External Function": [], "Function Argument": [ "insn", "ctx" ], "Globals": [], "Type Execution Declaration": [] }
69
linux
https://github.com/torvalds/linux
crypto/ccm.c
3b30460c5b0ed762be75a004e924ec3f8711e032
crypto: ccm - move cbcmac input off the stack Commit f15f05b0a5de ("crypto: ccm - switch to separate cbcmac driver") refactored the CCM driver to allow separate implementations of the underlying MAC to be provided by a platform. However, in doing so, it moved some data from the linear region to the stack, which violat...
true
8be0a748ac85cea79753205e3e8bda1f
crypto_ccm_auth
static int crypto_ccm_auth(struct aead_request *req, struct scatterlist *plain, unsigned int cryptlen) { struct crypto_ccm_req_priv_ctx *pctx = crypto_ccm_reqctx(req); struct crypto_aead *aead = crypto_aead_reqtfm(req); struct crypto_ccm_ctx *ctx = crypto_aead_ctx(aead); AHASH_REQUEST_ON_STACK(ahreq, ctx->mac...
[[186, "\tu8 odata[16];\n"], [187, "\tu8 idata[16];\n"]]
[[186, "u8 odata[16];"], [187, "u8 idata[16];"]]
[ "CVE-2017-8065" ]
[ "CWE-119" ]
70
{ "Execution Environment": [ "CONFIG_VMAP_STACK" ], "Explanation": null, "External Function": [ "crypto_ccm_reqctx" ], "Function Argument": [], "Globals": [], "Type Execution Declaration": [ "struct crypto_ccm_req_priv_ctx" ] }
70
linux
https://github.com/torvalds/linux
crypto/ccm.c
3b30460c5b0ed762be75a004e924ec3f8711e032
crypto: ccm - move cbcmac input off the stack Commit f15f05b0a5de ("crypto: ccm - switch to separate cbcmac driver") refactored the CCM driver to allow separate implementations of the underlying MAC to be provided by a platform. However, in doing so, it moved some data from the linear region to the stack, which violat...
false
fc74134563bc6b3f9a0492a49919c45c
crypto_ccm_auth
static int crypto_ccm_auth(struct aead_request *req, struct scatterlist *plain, unsigned int cryptlen) { struct crypto_ccm_req_priv_ctx *pctx = crypto_ccm_reqctx(req); struct crypto_aead *aead = crypto_aead_reqtfm(req); struct crypto_ccm_ctx *ctx = crypto_aead_ctx(aead); AHASH_REQUEST_ON_STACK(ahreq, ctx->mac...
[[187, "\tu8 *odata = pctx->odata;\n"], [188, "\tu8 *idata = pctx->idata;\n"]]
[[187, "u8 *odata = pctx->odata;"], [188, "u8 *idata = pctx->idata;"]]
[ "CVE-2017-8065" ]
[ "CWE-119" ]
70
{ "Execution Environment": [ "CONFIG_VMAP_STACK" ], "Explanation": null, "External Function": [ "crypto_ccm_reqctx" ], "Function Argument": [], "Globals": [], "Type Execution Declaration": [ "struct crypto_ccm_req_priv_ctx" ] }
71
linux
https://github.com/torvalds/linux
virt/kvm/iommu.c
3d32e4dbe71374a6780eaf51d719d76f9a9bf22f
kvm: fix excessive pages un-pinning in kvm_iommu_map error path. The third parameter of kvm_unpin_pages() when called from kvm_iommu_map_pages() is wrong, it should be the number of pages to un-pin and not the page size. This error was facilitated with an inconsistent API: kvm_pin_pages() takes a size, but kvn_unpin_...
true
025055e371ed3d112a45d2a56ee88c2a
kvm_pin_pages
static pfn_t kvm_pin_pages(struct kvm_memory_slot *slot, gfn_t gfn, unsigned long size) { gfn_t end_gfn; pfn_t pfn; pfn = gfn_to_pfn_memslot(slot, gfn); end_gfn = gfn + (size >> PAGE_SHIFT); gfn += 1; if (is_error_noslot_pfn(pfn)) return pfn; while (gfn < end_gfn) gfn_to_pfn_memslot(slot, gfn...
[[46, "\t\t\t unsigned long size)\n"], [52, "\tend_gfn = gfn + (size >> PAGE_SHIFT);\n"]]
[[45, "static pfn_t kvm_pin_pages(struct kvm_memory_slot *slot, gfn_t gfn,\n\t\t\t unsigned long size)"], [52, "end_gfn = gfn + (size >> PAGE_SHIFT);"]]
[ "CVE-2014-8369" ]
[ "CWE-119" ]
73
{ "Execution Environment": [], "Explanation": null, "External Function": [ "gfn_to_pfn_memslot", "is_error_noslot_pfn" ], "Function Argument": [], "Globals": [ "PAGE_SHIFT" ], "Type Execution Declaration": [ "gfn_t", "pfn_t" ] }
72
linux
https://github.com/torvalds/linux
virt/kvm/iommu.c
3d32e4dbe71374a6780eaf51d719d76f9a9bf22f
kvm: fix excessive pages un-pinning in kvm_iommu_map error path. The third parameter of kvm_unpin_pages() when called from kvm_iommu_map_pages() is wrong, it should be the number of pages to un-pin and not the page size. This error was facilitated with an inconsistent API: kvm_pin_pages() takes a size, but kvn_unpin_...
true
a0427e269f02ecb7a6151653d483872c
kvm_iommu_map_pages
int kvm_iommu_map_pages(struct kvm *kvm, struct kvm_memory_slot *slot) { gfn_t gfn, end_gfn; pfn_t pfn; int r = 0; struct iommu_domain *domain = kvm->arch.iommu_domain; int flags; /* check if iommu exists and in use */ if (!domain) return 0; gfn = slot->base_gfn; end_gfn = gfn + slot->npages; flags =...
[[122, "\t\tpfn = kvm_pin_pages(slot, gfn, page_size);\n"], [134, "\t\t\tkvm_unpin_pages(kvm, pfn, page_size);\n"]]
[[122, "pfn = kvm_pin_pages(slot, gfn, page_size);"], [134, "kvm_unpin_pages(kvm, pfn, page_size);"]]
[ "CVE-2014-8369" ]
[ "CWE-119" ]
74
{ "Execution Environment": [], "Explanation": null, "External Function": [ "kvm_pin_pages", "kvm_unpin_pages" ], "Function Argument": [], "Globals": [ "PAGE_SHIFT" ], "Type Execution Declaration": [] }
73
linux
https://github.com/torvalds/linux
virt/kvm/iommu.c
3d32e4dbe71374a6780eaf51d719d76f9a9bf22f
kvm: fix excessive pages un-pinning in kvm_iommu_map error path. The third parameter of kvm_unpin_pages() when called from kvm_iommu_map_pages() is wrong, it should be the number of pages to un-pin and not the page size. This error was facilitated with an inconsistent API: kvm_pin_pages() takes a size, but kvn_unpin_...
false
ba8be0d9d9f3ec211da15b296457e183
kvm_pin_pages
static pfn_t kvm_pin_pages(struct kvm_memory_slot *slot, gfn_t gfn, unsigned long npages) { gfn_t end_gfn; pfn_t pfn; pfn = gfn_to_pfn_memslot(slot, gfn); end_gfn = gfn + npages; gfn += 1; if (is_error_noslot_pfn(pfn)) return pfn; while (gfn < end_gfn) gfn_to_pfn_memslot(slot, gfn++); retur...
[[46, "\t\t\t unsigned long npages)\n"], [52, "\tend_gfn = gfn + npages;\n"]]
[[45, "static pfn_t kvm_pin_pages(struct kvm_memory_slot *slot, gfn_t gfn,\n\t\t\t unsigned long npages)"], [52, "end_gfn = gfn + npages;"]]
[ "CVE-2014-8369" ]
[ "CWE-119" ]
73
{ "Execution Environment": [], "Explanation": null, "External Function": [ "gfn_to_pfn_memslot", "is_error_noslot_pfn" ], "Function Argument": [], "Globals": [ "PAGE_SHIFT" ], "Type Execution Declaration": [ "gfn_t", "pfn_t" ] }
74
linux
https://github.com/torvalds/linux
virt/kvm/iommu.c
3d32e4dbe71374a6780eaf51d719d76f9a9bf22f
kvm: fix excessive pages un-pinning in kvm_iommu_map error path. The third parameter of kvm_unpin_pages() when called from kvm_iommu_map_pages() is wrong, it should be the number of pages to un-pin and not the page size. This error was facilitated with an inconsistent API: kvm_pin_pages() takes a size, but kvn_unpin_...
false
39fe2d1da52c0b34e9ae57deacceb7b5
kvm_iommu_map_pages
int kvm_iommu_map_pages(struct kvm *kvm, struct kvm_memory_slot *slot) { gfn_t gfn, end_gfn; pfn_t pfn; int r = 0; struct iommu_domain *domain = kvm->arch.iommu_domain; int flags; /* check if iommu exists and in use */ if (!domain) return 0; gfn = slot->base_gfn; end_gfn = gfn + slot->npages; flags =...
[[122, "\t\tpfn = kvm_pin_pages(slot, gfn, page_size >> PAGE_SHIFT);\n"], [134, "\t\t\tkvm_unpin_pages(kvm, pfn, page_size >> PAGE_SHIFT);\n"]]
[[122, "pfn = kvm_pin_pages(slot, gfn, page_size >> PAGE_SHIFT);"], [134, "kvm_unpin_pages(kvm, pfn, page_size >> PAGE_SHIFT);"]]
[ "CVE-2014-8369" ]
[ "CWE-119" ]
74
{ "Execution Environment": [], "Explanation": null, "External Function": [ "kvm_pin_pages", "kvm_unpin_pages" ], "Function Argument": [], "Globals": [ "PAGE_SHIFT" ], "Type Execution Declaration": [] }
75
linux
https://github.com/torvalds/linux
drivers/media/usb/dvb-usb/cxusb.c
3f190e3aec212fc8c61e202c51400afa7384d4bc
[media] cxusb: Use a dma capable buffer also for reading Commit 17ce039b4e54 ("[media] cxusb: don't do DMA on stack") added a kmalloc'ed bounce buffer for writes, but missed to do the same for reads. As the read only happens after the write is finished, we can reuse the same buffer. As dvb_usb_generic_rw handles a re...
true
77bd1536c3fe6c3a9de9751f3f548310
cxusb_ctrl_msg
static int cxusb_ctrl_msg(struct dvb_usb_device *d, u8 cmd, u8 *wbuf, int wlen, u8 *rbuf, int rlen) { struct cxusb_state *st = d->priv; int ret, wo; if (1 + wlen > MAX_XFER_SIZE) { warn("i2c wr: len=%d is too big!\n", wlen); return -EOPNOTSUPP; } wo = (rbuf == NULL || rlen == 0); /* write-only */ mute...
[[62, "\tint ret, wo;\n"], [69, "\two = (rbuf == NULL || rlen == 0); /* write-only */\n"], [74, "\tif (wo)\n"], [75, "\t\tret = dvb_usb_generic_write(d, st->data, 1 + wlen);\n"], [76, "\telse\n"], [77, "\t\tret = dvb_usb_generic_rw(d, st->data, 1 + wlen,\n"], [78, "\t\t\t\t\t rbuf, rlen, 0);\n"]]
[[62, "int ret, wo;"], [69, "\two = (rbuf == NULL || rlen == 0); /* write-only */\n"], [74, "if (wo)"], [75, "ret = dvb_usb_generic_write(d, st->data, 1 + wlen);"], [76, "else"], [77, "ret = dvb_usb_generic_rw(d, st->data, 1 + wlen,\n\t\t\t\t\t rbuf, rlen, 0);"]]
[ "CVE-2017-8063" ]
[ "CWE-119" ]
76
{ "Execution Environment": [ "CONFIG_VMAP_STACK" ], "Explanation": null, "External Function": [ "dvb_usb_generic_write", "dvb_usb_generic_rw" ], "Function Argument": [ "d" ], "Globals": [ "MAX_XFER_SIZE" ], "Type Execution Declaration": [ "struct dvb_usb_device", "struct ...
76
linux
https://github.com/torvalds/linux
drivers/media/usb/dvb-usb/cxusb.c
3f190e3aec212fc8c61e202c51400afa7384d4bc
[media] cxusb: Use a dma capable buffer also for reading Commit 17ce039b4e54 ("[media] cxusb: don't do DMA on stack") added a kmalloc'ed bounce buffer for writes, but missed to do the same for reads. As the read only happens after the write is finished, we can reuse the same buffer. As dvb_usb_generic_rw handles a re...
false
5e2dd1cfc640cb73671b7b85a6699623
cxusb_ctrl_msg
static int cxusb_ctrl_msg(struct dvb_usb_device *d, u8 cmd, u8 *wbuf, int wlen, u8 *rbuf, int rlen) { struct cxusb_state *st = d->priv; int ret; if (1 + wlen > MAX_XFER_SIZE) { warn("i2c wr: len=%d is too big!\n", wlen); return -EOPNOTSUPP; } if (rlen > MAX_XFER_SIZE) { warn("i2c rd: len=%d is too big...
[[62, "\tint ret;\n"], [69, "\tif (rlen > MAX_XFER_SIZE) {\n"], [70, "\t\twarn(\"i2c rd: len=%d is too big!\\n\", rlen);\n"], [71, "\t\treturn -EOPNOTSUPP;\n"], [72, "\t}\n"], [77, "\tret = dvb_usb_generic_rw(d, st->data, 1 + wlen, st->data, rlen, 0);\n"], [78, "\tif (!ret && rbuf && rlen)\n"], [79, "\t\tmemcpy(rbuf, s...
[[62, "int ret;"], [69, "if (rlen > MAX_XFER_SIZE)"], [70, "warn(\"i2c rd: len=%d is too big!\\n\", rlen);"], [71, "return -EOPNOTSUPP;"], [72, "\t}\n"], [77, "ret = dvb_usb_generic_rw(d, st->data, 1 + wlen, st->data, rlen, 0);"], [78, "if (!ret && rbuf && rlen)"], [79, "memcpy(rbuf, st->data, rlen);"]]
[ "CVE-2017-8063" ]
[ "CWE-119" ]
76
{ "Execution Environment": [ "CONFIG_VMAP_STACK" ], "Explanation": null, "External Function": [ "dvb_usb_generic_write", "dvb_usb_generic_rw" ], "Function Argument": [ "d" ], "Globals": [ "MAX_XFER_SIZE" ], "Type Execution Declaration": [ "struct dvb_usb_device", "struct ...
77
linux
https://github.com/torvalds/linux
drivers/net/ethernet/hisilicon/hns/hns_dsaf_gmac.c
412b65d15a7f8a93794653968308fc100f2aa87c
net: hns: fix ethtool_get_strings overflow in hns driver hns_get_sset_count() returns HNS_NET_STATS_CNT and the data space allocated is not enough for ethtool_get_strings(), which will cause random memory corruption. When SLAB and DEBUG_SLAB are both enabled, memory corruptions like the the following can be observed ...
true
81976ee8c5029d5374310f4f35fc5cf2
hns_gmac_get_sset_count
static int hns_gmac_get_sset_count(int stringset) { if (stringset == ETH_SS_STATS) return ARRAY_SIZE(g_gmac_stats_string); return 0; }
[[669, "\tif (stringset == ETH_SS_STATS)\n"]]
[[669, "if (stringset == ETH_SS_STATS)"]]
[ "CVE-2017-18222" ]
[ "CWE-119" ]
78
{ "Execution Environment": [], "Explanation": null, "External Function": [], "Function Argument": [], "Globals": [ "g_gmac_stats_string" ], "Type Execution Declaration": [ "ETH_SS_STATS", "ETH_SS_PRIV_FLAGS" ] }
78
linux
https://github.com/torvalds/linux
drivers/net/ethernet/hisilicon/hns/hns_dsaf_gmac.c
412b65d15a7f8a93794653968308fc100f2aa87c
net: hns: fix ethtool_get_strings overflow in hns driver hns_get_sset_count() returns HNS_NET_STATS_CNT and the data space allocated is not enough for ethtool_get_strings(), which will cause random memory corruption. When SLAB and DEBUG_SLAB are both enabled, memory corruptions like the the following can be observed ...
false
79daacf53ed59201efb9d51805defa72
hns_gmac_get_sset_count
static int hns_gmac_get_sset_count(int stringset) { if (stringset == ETH_SS_STATS || stringset == ETH_SS_PRIV_FLAGS) return ARRAY_SIZE(g_gmac_stats_string); return 0; }
[[669, "\tif (stringset == ETH_SS_STATS || stringset == ETH_SS_PRIV_FLAGS)\n"]]
[[669, "if (stringset == ETH_SS_STATS || stringset == ETH_SS_PRIV_FLAGS)"]]
[ "CVE-2017-18222" ]
[ "CWE-119" ]
78
{ "Execution Environment": [], "Explanation": null, "External Function": [], "Function Argument": [], "Globals": [ "g_gmac_stats_string" ], "Type Execution Declaration": [ "ETH_SS_STATS", "ETH_SS_PRIV_FLAGS" ] }
79
linux
https://github.com/torvalds/linux
drivers/net/ethernet/hisilicon/hns/hns_dsaf_ppe.c
412b65d15a7f8a93794653968308fc100f2aa87c
net: hns: fix ethtool_get_strings overflow in hns driver hns_get_sset_count() returns HNS_NET_STATS_CNT and the data space allocated is not enough for ethtool_get_strings(), which will cause random memory corruption. When SLAB and DEBUG_SLAB are both enabled, memory corruptions like the the following can be observed ...
true
b59067e2d17a1f9970488c10efed433f
hns_ppe_get_sset_count
int hns_ppe_get_sset_count(int stringset) { if (stringset == ETH_SS_STATS) return ETH_PPE_STATIC_NUM; return 0; }
[[425, "\tif (stringset == ETH_SS_STATS)\n"]]
[[425, "if (stringset == ETH_SS_STATS)"]]
[ "CVE-2017-18222" ]
[ "CWE-119" ]
80
{ "Execution Environment": [], "Explanation": null, "External Function": [], "Function Argument": [], "Globals": [ "ETH_SS_STATS", "ETH_PPE_STATIC_NUM", "ETH_SS_PRIV_FLAGS" ], "Type Execution Declaration": [] }
80
linux
https://github.com/torvalds/linux
drivers/net/ethernet/hisilicon/hns/hns_dsaf_ppe.c
412b65d15a7f8a93794653968308fc100f2aa87c
net: hns: fix ethtool_get_strings overflow in hns driver hns_get_sset_count() returns HNS_NET_STATS_CNT and the data space allocated is not enough for ethtool_get_strings(), which will cause random memory corruption. When SLAB and DEBUG_SLAB are both enabled, memory corruptions like the the following can be observed ...
false
9053b2b06696eb0116dd4c9dafae5f6d
hns_ppe_get_sset_count
int hns_ppe_get_sset_count(int stringset) { if (stringset == ETH_SS_STATS || stringset == ETH_SS_PRIV_FLAGS) return ETH_PPE_STATIC_NUM; return 0; }
[[425, "\tif (stringset == ETH_SS_STATS || stringset == ETH_SS_PRIV_FLAGS)\n"]]
[[425, "if (stringset == ETH_SS_STATS || stringset == ETH_SS_PRIV_FLAGS)"]]
[ "CVE-2017-18222" ]
[ "CWE-119" ]
80
{ "Execution Environment": [], "Explanation": null, "External Function": [], "Function Argument": [], "Globals": [ "ETH_SS_STATS", "ETH_PPE_STATIC_NUM", "ETH_SS_PRIV_FLAGS" ], "Type Execution Declaration": [] }
81
linux
https://github.com/torvalds/linux
drivers/net/ethernet/hisilicon/hns/hns_dsaf_rcb.c
412b65d15a7f8a93794653968308fc100f2aa87c
net: hns: fix ethtool_get_strings overflow in hns driver hns_get_sset_count() returns HNS_NET_STATS_CNT and the data space allocated is not enough for ethtool_get_strings(), which will cause random memory corruption. When SLAB and DEBUG_SLAB are both enabled, memory corruptions like the the following can be observed ...
true
35ff2b49ab41e4c4f4abee26d65269ca
hns_rcb_get_ring_sset_count
int hns_rcb_get_ring_sset_count(int stringset) { if (stringset == ETH_SS_STATS) return HNS_RING_STATIC_REG_NUM; return 0; }
[[879, "\tif (stringset == ETH_SS_STATS)\n"]]
[[879, "if (stringset == ETH_SS_STATS)"]]
[ "CVE-2017-18222" ]
[ "CWE-119" ]
82
{ "Execution Environment": [], "Explanation": null, "External Function": [], "Function Argument": [], "Globals": [ "ETH_SS_STATS", "HNS_RING_STATIC_REG_NUM", "ETH_SS_PRIV_FLAGS" ], "Type Execution Declaration": [] }
82
linux
https://github.com/torvalds/linux
drivers/net/ethernet/hisilicon/hns/hns_dsaf_rcb.c
412b65d15a7f8a93794653968308fc100f2aa87c
net: hns: fix ethtool_get_strings overflow in hns driver hns_get_sset_count() returns HNS_NET_STATS_CNT and the data space allocated is not enough for ethtool_get_strings(), which will cause random memory corruption. When SLAB and DEBUG_SLAB are both enabled, memory corruptions like the the following can be observed ...
false
f7b732abd3325dd0a1cc35264c521e37
hns_rcb_get_ring_sset_count
int hns_rcb_get_ring_sset_count(int stringset) { if (stringset == ETH_SS_STATS || stringset == ETH_SS_PRIV_FLAGS) return HNS_RING_STATIC_REG_NUM; return 0; }
[[879, "\tif (stringset == ETH_SS_STATS || stringset == ETH_SS_PRIV_FLAGS)\n"]]
[[879, "if (stringset == ETH_SS_STATS || stringset == ETH_SS_PRIV_FLAGS)"]]
[ "CVE-2017-18222" ]
[ "CWE-119" ]
82
{ "Execution Environment": [], "Explanation": null, "External Function": [], "Function Argument": [], "Globals": [ "ETH_SS_STATS", "HNS_RING_STATIC_REG_NUM", "ETH_SS_PRIV_FLAGS" ], "Type Execution Declaration": [] }
83
linux
https://github.com/torvalds/linux
drivers/net/ethernet/hisilicon/hns/hns_dsaf_xgmac.c
412b65d15a7f8a93794653968308fc100f2aa87c
net: hns: fix ethtool_get_strings overflow in hns driver hns_get_sset_count() returns HNS_NET_STATS_CNT and the data space allocated is not enough for ethtool_get_strings(), which will cause random memory corruption. When SLAB and DEBUG_SLAB are both enabled, memory corruptions like the the following can be observed ...
true
5db2f03c13fc70c46b700867894a85b8
hns_xgmac_get_sset_count
static int hns_xgmac_get_sset_count(int stringset) { if (stringset == ETH_SS_STATS) return ARRAY_SIZE(g_xgmac_stats_string); return 0; }
[[784, "\tif (stringset == ETH_SS_STATS)\n"]]
[[784, "if (stringset == ETH_SS_STATS)"]]
[ "CVE-2017-18222" ]
[ "CWE-119" ]
84
{ "Execution Environment": [], "Explanation": null, "External Function": [], "Function Argument": [], "Globals": [ "ETH_SS_STATS", "ETH_SS_PRIV_FLAGS" ], "Type Execution Declaration": [ "g_xgmac_stats_string" ] }
84
linux
https://github.com/torvalds/linux
drivers/net/ethernet/hisilicon/hns/hns_dsaf_xgmac.c
412b65d15a7f8a93794653968308fc100f2aa87c
net: hns: fix ethtool_get_strings overflow in hns driver hns_get_sset_count() returns HNS_NET_STATS_CNT and the data space allocated is not enough for ethtool_get_strings(), which will cause random memory corruption. When SLAB and DEBUG_SLAB are both enabled, memory corruptions like the the following can be observed ...
false
504fc68b1907b2c93c7bf4b86676bf57
hns_xgmac_get_sset_count
static int hns_xgmac_get_sset_count(int stringset) { if (stringset == ETH_SS_STATS || stringset == ETH_SS_PRIV_FLAGS) return ARRAY_SIZE(g_xgmac_stats_string); return 0; }
[[784, "\tif (stringset == ETH_SS_STATS || stringset == ETH_SS_PRIV_FLAGS)\n"]]
[[784, "if (stringset == ETH_SS_STATS || stringset == ETH_SS_PRIV_FLAGS)"]]
[ "CVE-2017-18222" ]
[ "CWE-119" ]
84
{ "Execution Environment": [], "Explanation": null, "External Function": [], "Function Argument": [], "Globals": [ "ETH_SS_STATS", "ETH_SS_PRIV_FLAGS" ], "Type Execution Declaration": [ "g_xgmac_stats_string" ] }
85
linux
https://github.com/torvalds/linux
kernel/bpf/verifier.c
4374f256ce8182019353c0c639bb8d0695b4c941
bpf/verifier: fix bounds calculation on BPF_RSH Incorrect signed bounds were being computed. If the old upper signed bound was positive and the old lower signed bound was negative, this could cause the new upper signed bound to be too low, leading to security issues. Fixes: b03c9f9fdc37 ("bpf/verifier: track signed a...
true
968bc8c291b749db2a3e05e97a26a40f
adjust_scalar_min_max_vals
static int adjust_scalar_min_max_vals(struct bpf_verifier_env *env, struct bpf_insn *insn, struct bpf_reg_state *dst_reg, struct bpf_reg_state src_reg) { struct bpf_reg_state *regs = cur_regs(env); u8 opcode = BPF_OP(insn->code); bool src_known, dst_known; s64 smin_val, smax_val; u64 ...
[[2193, "\t\t/* BPF_RSH is an unsigned shift, so make the appropriate casts */\n"], [2194, "\t\tif (dst_reg->smin_value < 0) {\n"], [2195, "\t\t\tif (umin_val) {\n"], [2196, "\t\t\t\t/* Sign bit will be cleared */\n"], [2197, "\t\t\t\tdst_reg->smin_value = 0;\n"], [2198, "\t\t\t} else {\n"], [2199, "\t\t\t\t/* Lost sig...
[[2193, "/* BPF_RSH is an unsigned shift, so make the appropriate casts */"], [2194, "if (dst_reg->smin_value < 0)"], [2195, "if (umin_val)"], [2196, "/* Sign bit will be cleared */"], [2197, "dst_reg->smin_value = 0;"], [2198, "else"], [2199, "/* Lost sign bit information */"], [2200, "dst_reg->smin_value = S64_MIN;"]...
[ "CVE-2017-17853" ]
[ "CWE-119" ]
86
{ "Execution Environment": [], "Explanation": null, "External Function": [ "cur_regs" ], "Function Argument": [], "Globals": [ "S64_MIN", "S64_MAX", "U64_MAX" ], "Type Execution Declaration": [ "struct bpf_reg_state", "struct bpf_verifier_env", "struct bpf_insn" ] }
86
linux
https://github.com/torvalds/linux
kernel/bpf/verifier.c
4374f256ce8182019353c0c639bb8d0695b4c941
bpf/verifier: fix bounds calculation on BPF_RSH Incorrect signed bounds were being computed. If the old upper signed bound was positive and the old lower signed bound was negative, this could cause the new upper signed bound to be too low, leading to security issues. Fixes: b03c9f9fdc37 ("bpf/verifier: track signed a...
false
e6c61340dd642843d207cbd96de86c35
adjust_scalar_min_max_vals
static int adjust_scalar_min_max_vals(struct bpf_verifier_env *env, struct bpf_insn *insn, struct bpf_reg_state *dst_reg, struct bpf_reg_state src_reg) { struct bpf_reg_state *regs = cur_regs(env); u8 opcode = BPF_OP(insn->code); bool src_known, dst_known; s64 smin_val, smax_val; u64 ...
[[2193, "\t\t/* BPF_RSH is an unsigned shift. If the value in dst_reg might\n"], [2194, "\t\t * be negative, then either:\n"], [2195, "\t\t * 1) src_reg might be zero, so the sign bit of the result is\n"], [2196, "\t\t * unknown, so we lose our signed bounds\n"], [2197, "\t\t * 2) it's known negative, thus the unsi...
[[2193, "/* BPF_RSH is an unsigned shift. If the value in dst_reg might\n\t\t * be negative, then either:\n\t\t * 1) src_reg might be zero, so the sign bit of the result is\n\t\t * unknown, so we lose our signed bounds\n\t\t * 2) it's known negative, thus the unsigned bounds capture the\n\t\t * signed bounds\n\t...
[ "CVE-2017-17853" ]
[ "CWE-119" ]
86
{ "Execution Environment": [], "Explanation": null, "External Function": [ "cur_regs" ], "Function Argument": [], "Globals": [ "S64_MIN", "S64_MAX", "U64_MAX" ], "Type Execution Declaration": [ "struct bpf_reg_state", "struct bpf_verifier_env", "struct bpf_insn" ] }
87
linux
https://github.com/torvalds/linux
kernel/bpf/verifier.c
468f6eafa6c44cb2c5d8aad35e12f06c240a812a
bpf: fix 32-bit ALU op verification 32-bit ALU ops operate on 32-bit values and have 32-bit outputs. Adjust the verifier accordingly. Fixes: f1174f77b50c ("bpf/verifier: rework value tracking") Signed-off-by: Jann Horn <jannh@google.com> Signed-off-by: Alexei Starovoitov <ast@kernel.org> Signed-off-by: Daniel Borkman...
true
ec2babadd00a8fdcf6292cc95449f524
adjust_scalar_min_max_vals
static int adjust_scalar_min_max_vals(struct bpf_verifier_env *env, struct bpf_insn *insn, struct bpf_reg_state *dst_reg, struct bpf_reg_state src_reg) { struct bpf_reg_state *regs = cur_regs(env); u8 opcode = BPF_OP(insn->code); bool src_known, dst_known; s64 smin_val, smax_val; u64 ...
[[2031, "\tif (BPF_CLASS(insn->code) != BPF_ALU64) {\n"], [2032, "\t\t/* 32-bit ALU ops are (32,32)->64 */\n"], [2033, "\t\tcoerce_reg_to_size(dst_reg, 4);\n"], [2034, "\t\tcoerce_reg_to_size(&src_reg, 4);\n"], [2035, "\t}\n"], [2171, "\t\tif (umax_val > 63) {\n"], [2172, "\t\t\t/* Shifts greater than 63 are undefined....
[[2031, "if (BPF_CLASS(insn->code) != BPF_ALU64)"], [2032, "/* 32-bit ALU ops are (32,32)->64 */"], [2033, "coerce_reg_to_size(dst_reg, 4);"], [2034, "coerce_reg_to_size(&src_reg, 4);"], [2035, "\t}\n"], [2171, "if (umax_val > 63)"], [2172, "/* Shifts greater than 63 are undefined. This includes\n\t\t\t * shifts by a ...
[ "CVE-2017-17852" ]
[ "CWE-119" ]
88
{ "Execution Environment": [], "Explanation": null, "External Function": [ "cur_regs", "BPF_CLASS", "BPF_OP", "coerce_reg_to_size", "signed_add_overflows", "signed_sub_overflows", "tnum_is_const", "tnum_add", "tnum_sub", "tnum_mul", "tnum_and", "tnum_or", "tnum_...
88
linux
https://github.com/torvalds/linux
kernel/bpf/verifier.c
468f6eafa6c44cb2c5d8aad35e12f06c240a812a
bpf: fix 32-bit ALU op verification 32-bit ALU ops operate on 32-bit values and have 32-bit outputs. Adjust the verifier accordingly. Fixes: f1174f77b50c ("bpf/verifier: rework value tracking") Signed-off-by: Jann Horn <jannh@google.com> Signed-off-by: Alexei Starovoitov <ast@kernel.org> Signed-off-by: Daniel Borkman...
false
e9b0ca2149ac8dcfaabfdeb364bddd26
adjust_scalar_min_max_vals
static int adjust_scalar_min_max_vals(struct bpf_verifier_env *env, struct bpf_insn *insn, struct bpf_reg_state *dst_reg, struct bpf_reg_state src_reg) { struct bpf_reg_state *regs = cur_regs(env); u8 opcode = BPF_OP(insn->code); bool src_known, dst_known; s64 smin_val, smax_val; u64 ...
[[2034, "\tu64 insn_bitness = (BPF_CLASS(insn->code) == BPF_ALU64) ? 64 : 32;\n"], [2171, "\t\tif (umax_val >= insn_bitness) {\n"], [2172, "\t\t\t/* Shifts greater than 31 or 63 are undefined.\n"], [2173, "\t\t\t * This includes shifts by a negative number.\n"], [2199, "\t\tif (umax_val >= insn_bitness) {\n"], [2200, "...
[[2034, "u64 insn_bitness = (BPF_CLASS(insn->code) == BPF_ALU64) ? 64 : 32;"], [2171, "if (umax_val >= insn_bitness)"], [2172, "/* Shifts greater than 31 or 63 are undefined.\n\t\t\t * This includes shifts by a negative number.\n\t\t\t */"], [2199, "if (umax_val >= insn_bitness)"], [2200, "/* Shifts greater than 31 or ...
[ "CVE-2017-17852" ]
[ "CWE-119" ]
88
{ "Execution Environment": [], "Explanation": null, "External Function": [ "cur_regs", "BPF_CLASS", "BPF_OP", "coerce_reg_to_size", "signed_add_overflows", "signed_sub_overflows", "tnum_is_const", "tnum_add", "tnum_sub", "tnum_mul", "tnum_and", "tnum_or", "tnum_...
89
linux
https://github.com/torvalds/linux
drivers/edac/thunderx_edac.c
475c58e1a471e9b873e3e39958c64a2d278275c8
EDAC/thunderx: Fix possible out-of-bounds string access Enabling -Wstringop-overflow globally exposes a warning for a common bug in the usage of strncat(): drivers/edac/thunderx_edac.c: In function 'thunderx_ocx_com_threaded_isr': drivers/edac/thunderx_edac.c:1136:17: error: 'strncat' specified bound 1024 equals ...
true
613329b4c8f761ef99c76a284ecf07de
thunderx_ocx_com_threaded_isr
static irqreturn_t thunderx_ocx_com_threaded_isr(int irq, void *irq_id) { struct msix_entry *msix = irq_id; struct thunderx_ocx *ocx = container_of(msix, struct thunderx_ocx, msix_ent[msix->entry]); irqreturn_t ret = IRQ_NONE; unsigned long tail; struct ocx_com_err_ctx *ctx; int lane; char *msg; char *o...
[[1136, "\t\tstrncat(msg, other, OCX_MESSAGE_SIZE);\n"], [1145, "\t\t\t\tstrncat(msg, other, OCX_MESSAGE_SIZE);\n"], [1150, "\t\t\t\tstrncat(msg, other, OCX_MESSAGE_SIZE);\n"]]
[[1136, "strncat(msg, other, OCX_MESSAGE_SIZE);"], [1145, "strncat(msg, other, OCX_MESSAGE_SIZE);"], [1150, "strncat(msg, other, OCX_MESSAGE_SIZE);"]]
[ "CVE-2023-52464" ]
[ "CWE-119" ]
90
{ "Execution Environment": [], "Explanation": null, "External Function": [ "decode_register" ], "Function Argument": [], "Globals": [], "Type Execution Declaration": [ "OCX_MESSAGE_SIZE", "OCX_OTHER_SIZE" ] }
90
linux
https://github.com/torvalds/linux
drivers/edac/thunderx_edac.c
475c58e1a471e9b873e3e39958c64a2d278275c8
EDAC/thunderx: Fix possible out-of-bounds string access Enabling -Wstringop-overflow globally exposes a warning for a common bug in the usage of strncat(): drivers/edac/thunderx_edac.c: In function 'thunderx_ocx_com_threaded_isr': drivers/edac/thunderx_edac.c:1136:17: error: 'strncat' specified bound 1024 equals ...
false
820b4c2c3b4ba8e47d2e7ae7274444c4
thunderx_ocx_com_threaded_isr
static irqreturn_t thunderx_ocx_com_threaded_isr(int irq, void *irq_id) { struct msix_entry *msix = irq_id; struct thunderx_ocx *ocx = container_of(msix, struct thunderx_ocx, msix_ent[msix->entry]); irqreturn_t ret = IRQ_NONE; unsigned long tail; struct ocx_com_err_ctx *ctx; int lane; char *msg; char *o...
[[1136, "\t\tstrlcat(msg, other, OCX_MESSAGE_SIZE);\n"], [1145, "\t\t\t\tstrlcat(msg, other, OCX_MESSAGE_SIZE);\n"], [1150, "\t\t\t\tstrlcat(msg, other, OCX_MESSAGE_SIZE);\n"]]
[[1136, "strlcat(msg, other, OCX_MESSAGE_SIZE);"], [1145, "strlcat(msg, other, OCX_MESSAGE_SIZE);"], [1150, "strlcat(msg, other, OCX_MESSAGE_SIZE);"]]
[ "CVE-2023-52464" ]
[ "CWE-119" ]
90
{ "Execution Environment": [], "Explanation": null, "External Function": [ "decode_register" ], "Function Argument": [], "Globals": [], "Type Execution Declaration": [ "OCX_MESSAGE_SIZE", "OCX_OTHER_SIZE" ] }
91
linux
https://github.com/torvalds/linux
drivers/net/virtio_net.c
48900cb6af4282fa0fb6ff4d72a81aa3dadb5c39
virtio-net: drop NETIF_F_FRAGLIST virtio declares support for NETIF_F_FRAGLIST, but assumes that there are at most MAX_SKB_FRAGS + 2 fragments which isn't always true with a fraglist. A longer fraglist in the skb will make the call to skb_to_sgvec overflow the sg array, leading to memory corruption. Drop NETIF_F_FRA...
true
4ee5395c83acadd472a234db87a1f0ca
virtnet_probe
static int virtnet_probe(struct virtio_device *vdev) { int i, err; struct net_device *dev; struct virtnet_info *vi; u16 max_queue_pairs; if (!vdev->config->get) { dev_err(&vdev->dev, "%s failure: config access disabled\n", __func__); return -EINVAL; } if (!virtnet_validate_features(vdev)) return -EINV...
[[1759, "\t\tdev->hw_features |= NETIF_F_HW_CSUM|NETIF_F_SG|NETIF_F_FRAGLIST;\n"], [1761, "\t\t\tdev->features |= NETIF_F_HW_CSUM|NETIF_F_SG|NETIF_F_FRAGLIST;\n"]]
[[1759, "dev->hw_features |= NETIF_F_HW_CSUM|NETIF_F_SG|NETIF_F_FRAGLIST;"], [1761, "dev->features |= NETIF_F_HW_CSUM|NETIF_F_SG|NETIF_F_FRAGLIST;"]]
[ "CVE-2015-5156" ]
[ "CWE-119" ]
92
{ "Execution Environment": [], "Explanation": null, "External Function": [], "Function Argument": [], "Globals": [ "NETIF_F_FRAGLIST", "MAX_SKB_FRAGS" ], "Type Execution Declaration": [] }
92
linux
https://github.com/torvalds/linux
drivers/net/virtio_net.c
48900cb6af4282fa0fb6ff4d72a81aa3dadb5c39
virtio-net: drop NETIF_F_FRAGLIST virtio declares support for NETIF_F_FRAGLIST, but assumes that there are at most MAX_SKB_FRAGS + 2 fragments which isn't always true with a fraglist. A longer fraglist in the skb will make the call to skb_to_sgvec overflow the sg array, leading to memory corruption. Drop NETIF_F_FRA...
false
39c937d46c5354959db4476bca14afc8
virtnet_probe
static int virtnet_probe(struct virtio_device *vdev) { int i, err; struct net_device *dev; struct virtnet_info *vi; u16 max_queue_pairs; if (!vdev->config->get) { dev_err(&vdev->dev, "%s failure: config access disabled\n", __func__); return -EINVAL; } if (!virtnet_validate_features(vdev)) return -EINV...
[[1759, "\t\tdev->hw_features |= NETIF_F_HW_CSUM | NETIF_F_SG;\n"], [1761, "\t\t\tdev->features |= NETIF_F_HW_CSUM | NETIF_F_SG;\n"]]
[[1759, "dev->hw_features |= NETIF_F_HW_CSUM | NETIF_F_SG;"], [1761, "dev->features |= NETIF_F_HW_CSUM | NETIF_F_SG;"]]
[ "CVE-2015-5156" ]
[ "CWE-119" ]
92
{ "Execution Environment": [], "Explanation": null, "External Function": [], "Function Argument": [], "Globals": [ "NETIF_F_FRAGLIST", "MAX_SKB_FRAGS" ], "Type Execution Declaration": [] }
93
linux
https://github.com/torvalds/linux
drivers/hid/hid-cherry.c
4ab25786c87eb20857bbb715c3ae34ec8fd6a214
HID: fix a couple of off-by-ones There are a few very theoretical off-by-one bugs in report descriptor size checking when performing a pre-parsing fixup. Fix those. Cc: stable@vger.kernel.org Reported-by: Ben Hawkes <hawkes@google.com> Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Jir...
true
7078cb37d711fc277f8f0139fea12d59
ch_report_fixup
static __u8 *ch_report_fixup(struct hid_device *hdev, __u8 *rdesc, unsigned int *rsize) { if (*rsize >= 17 && rdesc[11] == 0x3c && rdesc[12] == 0x02) { hid_info(hdev, "fixing up Cherry Cymotion report descriptor\n"); rdesc[11] = rdesc[16] = 0xff; rdesc[12] = rdesc[17] = 0x03; } return rdesc; }
[[31, "\tif (*rsize >= 17 && rdesc[11] == 0x3c && rdesc[12] == 0x02) {\n"]]
[[31, "if (*rsize >= 17 && rdesc[11] == 0x3c && rdesc[12] == 0x02)"]]
[ "CVE-2014-3184" ]
[ "CWE-119" ]
94
{ "Execution Environment": [], "Explanation": null, "External Function": [], "Function Argument": [ "rdesc", "rsize" ], "Globals": [], "Type Execution Declaration": [] }
94
linux
https://github.com/torvalds/linux
drivers/hid/hid-cherry.c
4ab25786c87eb20857bbb715c3ae34ec8fd6a214
HID: fix a couple of off-by-ones There are a few very theoretical off-by-one bugs in report descriptor size checking when performing a pre-parsing fixup. Fix those. Cc: stable@vger.kernel.org Reported-by: Ben Hawkes <hawkes@google.com> Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Jir...
false
dd46fe8afcfdd405f35ff039f320b512
ch_report_fixup
static __u8 *ch_report_fixup(struct hid_device *hdev, __u8 *rdesc, unsigned int *rsize) { if (*rsize >= 18 && rdesc[11] == 0x3c && rdesc[12] == 0x02) { hid_info(hdev, "fixing up Cherry Cymotion report descriptor\n"); rdesc[11] = rdesc[16] = 0xff; rdesc[12] = rdesc[17] = 0x03; } return rdesc; }
[[31, "\tif (*rsize >= 18 && rdesc[11] == 0x3c && rdesc[12] == 0x02) {\n"]]
[[31, "if (*rsize >= 18 && rdesc[11] == 0x3c && rdesc[12] == 0x02)"]]
[ "CVE-2014-3184" ]
[ "CWE-119" ]
94
{ "Execution Environment": [], "Explanation": null, "External Function": [], "Function Argument": [ "rdesc", "rsize" ], "Globals": [], "Type Execution Declaration": [] }
95
linux
https://github.com/torvalds/linux
drivers/hid/hid-kye.c
4ab25786c87eb20857bbb715c3ae34ec8fd6a214
HID: fix a couple of off-by-ones There are a few very theoretical off-by-one bugs in report descriptor size checking when performing a pre-parsing fixup. Fix those. Cc: stable@vger.kernel.org Reported-by: Ben Hawkes <hawkes@google.com> Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Jir...
true
d3d0680a256c71e6969ed7e2635dbb00
kye_report_fixup
static __u8 *kye_report_fixup(struct hid_device *hdev, __u8 *rdesc, unsigned int *rsize) { switch (hdev->product) { case USB_DEVICE_ID_KYE_ERGO_525V: /* the fixups that need to be done: * - change led usage page to button for extra buttons * - report size 8 count 1 must be size 1 count 8 for button *...
[[303, "\t\tif (*rsize >= 74 &&\n"]]
[[303, "if (*rsize >= 74 &&\n\t\t\trdesc[61] == 0x05 && rdesc[62] == 0x08 &&\n\t\t\trdesc[63] == 0x19 && rdesc[64] == 0x08 &&\n\t\t\trdesc[65] == 0x29 && rdesc[66] == 0x0f &&\n\t\t\trdesc[71] == 0x75 && rdesc[72] == 0x08 &&\n\t\t\trdesc[73] == 0x95 && rdesc[74] == 0x01)"]]
[ "CVE-2014-3184" ]
[ "CWE-119" ]
96
{ "Execution Environment": [], "Explanation": null, "External Function": [], "Function Argument": [ "hdev", "rdesc", "rsize" ], "Globals": [ "USB_DEVICE_ID_KYE_ERGO_525V", "USB_DEVICE_ID_KYE_EASYPEN_I405X", "EASYPEN_I405X_RDESC_ORIG_SIZE", "easypen_i405x_rdesc_fixed", "USB_DE...
96
linux
https://github.com/torvalds/linux
drivers/hid/hid-kye.c
4ab25786c87eb20857bbb715c3ae34ec8fd6a214
HID: fix a couple of off-by-ones There are a few very theoretical off-by-one bugs in report descriptor size checking when performing a pre-parsing fixup. Fix those. Cc: stable@vger.kernel.org Reported-by: Ben Hawkes <hawkes@google.com> Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Jir...
false
ed2f31685d1c495df1c0a4476a6ff055
kye_report_fixup
static __u8 *kye_report_fixup(struct hid_device *hdev, __u8 *rdesc, unsigned int *rsize) { switch (hdev->product) { case USB_DEVICE_ID_KYE_ERGO_525V: /* the fixups that need to be done: * - change led usage page to button for extra buttons * - report size 8 count 1 must be size 1 count 8 for button *...
[[303, "\t\tif (*rsize >= 75 &&\n"]]
[[303, "if (*rsize >= 75 &&\n\t\t\trdesc[61] == 0x05 && rdesc[62] == 0x08 &&\n\t\t\trdesc[63] == 0x19 && rdesc[64] == 0x08 &&\n\t\t\trdesc[65] == 0x29 && rdesc[66] == 0x0f &&\n\t\t\trdesc[71] == 0x75 && rdesc[72] == 0x08 &&\n\t\t\trdesc[73] == 0x95 && rdesc[74] == 0x01)"]]
[ "CVE-2014-3184" ]
[ "CWE-119" ]
96
{ "Execution Environment": [], "Explanation": null, "External Function": [], "Function Argument": [ "hdev", "rdesc", "rsize" ], "Globals": [ "USB_DEVICE_ID_KYE_ERGO_525V", "USB_DEVICE_ID_KYE_EASYPEN_I405X", "EASYPEN_I405X_RDESC_ORIG_SIZE", "easypen_i405x_rdesc_fixed", "USB_DE...
97
linux
https://github.com/torvalds/linux
drivers/hid/hid-lg.c
4ab25786c87eb20857bbb715c3ae34ec8fd6a214
HID: fix a couple of off-by-ones There are a few very theoretical off-by-one bugs in report descriptor size checking when performing a pre-parsing fixup. Fix those. Cc: stable@vger.kernel.org Reported-by: Ben Hawkes <hawkes@google.com> Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Jir...
true
d51dad61fb3100872f7f341d0ef36499
lg_report_fixup
static __u8 *lg_report_fixup(struct hid_device *hdev, __u8 *rdesc, unsigned int *rsize) { struct lg_drv_data *drv_data = hid_get_drvdata(hdev); struct usb_device_descriptor *udesc; __u16 bcdDevice, rev_maj, rev_min; if ((drv_data->quirks & LG_RDESC) && *rsize >= 90 && rdesc[83] == 0x26 && rdesc[84] == 0x8c &&...
[[348, "\tif ((drv_data->quirks & LG_RDESC) && *rsize >= 90 && rdesc[83] == 0x26 &&\n"], [355, "\tif ((drv_data->quirks & LG_RDESC_REL_ABS) && *rsize >= 50 &&\n"]]
[[348, "if ((drv_data->quirks & LG_RDESC) && *rsize >= 90 && rdesc[83] == 0x26 &&\n\t\t\trdesc[84] == 0x8c && rdesc[85] == 0x02)"], [355, "if ((drv_data->quirks & LG_RDESC_REL_ABS) && *rsize >= 50 &&\n\t\t\trdesc[32] == 0x81 && rdesc[33] == 0x06 &&\n\t\t\trdesc[49] == 0x81 && rdesc[50] == 0x06)"]]
[ "CVE-2014-3184" ]
[ "CWE-119" ]
98
{ "Execution Environment": [], "Explanation": null, "External Function": [ "hid_get_drvdata" ], "Function Argument": [ "hdev", "rdesc", "rsize" ], "Globals": [], "Type Execution Declaration": [ "struct lg_drv_data" ] }
98
linux
https://github.com/torvalds/linux
drivers/hid/hid-lg.c
4ab25786c87eb20857bbb715c3ae34ec8fd6a214
HID: fix a couple of off-by-ones There are a few very theoretical off-by-one bugs in report descriptor size checking when performing a pre-parsing fixup. Fix those. Cc: stable@vger.kernel.org Reported-by: Ben Hawkes <hawkes@google.com> Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Jir...
false
9791b14637d65a92a90693945cfc6a99
lg_report_fixup
static __u8 *lg_report_fixup(struct hid_device *hdev, __u8 *rdesc, unsigned int *rsize) { struct lg_drv_data *drv_data = hid_get_drvdata(hdev); struct usb_device_descriptor *udesc; __u16 bcdDevice, rev_maj, rev_min; if ((drv_data->quirks & LG_RDESC) && *rsize >= 91 && rdesc[83] == 0x26 && rdesc[84] == 0x8c &&...
[[348, "\tif ((drv_data->quirks & LG_RDESC) && *rsize >= 91 && rdesc[83] == 0x26 &&\n"], [355, "\tif ((drv_data->quirks & LG_RDESC_REL_ABS) && *rsize >= 51 &&\n"]]
[[348, "if ((drv_data->quirks & LG_RDESC) && *rsize >= 91 && rdesc[83] == 0x26 &&\n\t\t\trdesc[84] == 0x8c && rdesc[85] == 0x02)"], [355, "if ((drv_data->quirks & LG_RDESC_REL_ABS) && *rsize >= 51 &&\n\t\t\trdesc[32] == 0x81 && rdesc[33] == 0x06 &&\n\t\t\trdesc[49] == 0x81 && rdesc[50] == 0x06)"]]
[ "CVE-2014-3184" ]
[ "CWE-119" ]
98
{ "Execution Environment": [], "Explanation": null, "External Function": [ "hid_get_drvdata" ], "Function Argument": [ "hdev", "rdesc", "rsize" ], "Globals": [], "Type Execution Declaration": [ "struct lg_drv_data" ] }
99
linux
https://github.com/torvalds/linux
drivers/hid/hid-monterey.c
4ab25786c87eb20857bbb715c3ae34ec8fd6a214
HID: fix a couple of off-by-ones There are a few very theoretical off-by-one bugs in report descriptor size checking when performing a pre-parsing fixup. Fix those. Cc: stable@vger.kernel.org Reported-by: Ben Hawkes <hawkes@google.com> Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Jir...
true
26c10232845901f7ab1d88218fe046c4
mr_report_fixup
static __u8 *mr_report_fixup(struct hid_device *hdev, __u8 *rdesc, unsigned int *rsize) { if (*rsize >= 30 && rdesc[29] == 0x05 && rdesc[30] == 0x09) { hid_info(hdev, "fixing up button/consumer in HID report descriptor\n"); rdesc[30] = 0x0c; } return rdesc; }
[[27, "\tif (*rsize >= 30 && rdesc[29] == 0x05 && rdesc[30] == 0x09) {\n"]]
[[27, "if (*rsize >= 30 && rdesc[29] == 0x05 && rdesc[30] == 0x09)"]]
[ "CVE-2014-3184" ]
[ "CWE-119" ]
100
{ "Execution Environment": [ "HID device with user-controlled/bad report descriptor" ], "Explanation": null, "External Function": [], "Function Argument": [], "Globals": [], "Type Execution Declaration": [] }