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
200
linux
https://github.com/torvalds/linux
drivers/pwm/core.c
a297d07b9a1e4fb8cda25a4a2363a507d294b7c9
pwm: Fix out-of-bounds access in of_pwm_single_xlate() With args->args_count == 2 args->args[2] is not defined. Actually the flags are contained in args->args[1]. Fixes: 3ab7b6ac5d82 ("pwm: Introduce single-PWM of_xlate function") Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/243908750d306e018a3d4bf2eb74...
true
9b557b297e70915143979a63656d8f46
of_pwm_single_xlate
struct pwm_device * of_pwm_single_xlate(struct pwm_chip *chip, const struct of_phandle_args *args) { struct pwm_device *pwm; if (chip->of_pwm_n_cells < 1) return ERR_PTR(-EINVAL); /* validate that one cell is specified, optionally with flags */ if (args->args_count != 1 && args->args_count != 2) return ERR_PT...
[[155, "\tif (args->args_count == 2 && args->args[2] & PWM_POLARITY_INVERTED)\n"]]
[[155, "if (args->args_count == 2 && args->args[2] & PWM_POLARITY_INVERTED)"]]
[ "CVE-2024-26599" ]
[ "CWE-119" ]
201
{ "Execution Environment": [], "Explanation": null, "External Function": [], "Function Argument": [ "args" ], "Globals": [], "Type Execution Declaration": [ "struct of_phandle_args" ] }
201
linux
https://github.com/torvalds/linux
drivers/pwm/core.c
a297d07b9a1e4fb8cda25a4a2363a507d294b7c9
pwm: Fix out-of-bounds access in of_pwm_single_xlate() With args->args_count == 2 args->args[2] is not defined. Actually the flags are contained in args->args[1]. Fixes: 3ab7b6ac5d82 ("pwm: Introduce single-PWM of_xlate function") Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/243908750d306e018a3d4bf2eb74...
false
9fba1458293135743905280c540efdde
of_pwm_single_xlate
struct pwm_device * of_pwm_single_xlate(struct pwm_chip *chip, const struct of_phandle_args *args) { struct pwm_device *pwm; if (chip->of_pwm_n_cells < 1) return ERR_PTR(-EINVAL); /* validate that one cell is specified, optionally with flags */ if (args->args_count != 1 && args->args_count != 2) return ERR_PT...
[[155, "\tif (args->args_count == 2 && args->args[1] & PWM_POLARITY_INVERTED)\n"]]
[[155, "if (args->args_count == 2 && args->args[1] & PWM_POLARITY_INVERTED)"]]
[ "CVE-2024-26599" ]
[ "CWE-119" ]
201
{ "Execution Environment": [], "Explanation": null, "External Function": [], "Function Argument": [ "args" ], "Globals": [], "Type Execution Declaration": [ "struct of_phandle_args" ] }
202
linux
https://github.com/torvalds/linux
net/key/af_key.c
a5cc68f3d63306d0d288f31edfc2ae6ef8ecd887
af_key: fix info leaks in notify messages key_notify_sa_flush() and key_notify_policy_flush() miss to initialize the sadb_msg_reserved member of the broadcasted message and thereby leak 2 bytes of heap memory to listeners. Fix that. Signed-off-by: Mathias Krause <minipli@googlemail.com> Cc: Steffen Klassert <steffen....
true
1ab4b52b3bb8f7d2aa5f19709f256083
key_notify_sa_flush
static int key_notify_sa_flush(const struct km_event *c) { struct sk_buff *skb; struct sadb_msg *hdr; skb = alloc_skb(sizeof(struct sadb_msg) + 16, GFP_ATOMIC); if (!skb) return -ENOBUFS; hdr = (struct sadb_msg *) skb_put(skb, sizeof(struct sadb_msg)); hdr->sadb_msg_satype = pfkey_proto2satype(c->data.proto); ...
[]
[]
[ "CVE-2013-2234" ]
[ "CWE-119" ]
203
{ "Execution Environment": [], "Explanation": null, "External Function": [], "Function Argument": [], "Globals": [], "Type Execution Declaration": [ "struct sadb_msg" ] }
203
linux
https://github.com/torvalds/linux
net/key/af_key.c
a5cc68f3d63306d0d288f31edfc2ae6ef8ecd887
af_key: fix info leaks in notify messages key_notify_sa_flush() and key_notify_policy_flush() miss to initialize the sadb_msg_reserved member of the broadcasted message and thereby leak 2 bytes of heap memory to listeners. Fix that. Signed-off-by: Mathias Krause <minipli@googlemail.com> Cc: Steffen Klassert <steffen....
false
5fbf8b07753635ad9eab921c031d9371
key_notify_sa_flush
static int key_notify_sa_flush(const struct km_event *c) { struct sk_buff *skb; struct sadb_msg *hdr; skb = alloc_skb(sizeof(struct sadb_msg) + 16, GFP_ATOMIC); if (!skb) return -ENOBUFS; hdr = (struct sadb_msg *) skb_put(skb, sizeof(struct sadb_msg)); hdr->sadb_msg_satype = pfkey_proto2satype(c->data.proto); ...
[[1713, "\thdr->sadb_msg_reserved = 0;\n"]]
[[1713, "hdr->sadb_msg_reserved = 0;"]]
[ "CVE-2013-2234" ]
[ "CWE-119" ]
203
{ "Execution Environment": [], "Explanation": null, "External Function": [], "Function Argument": [], "Globals": [], "Type Execution Declaration": [ "struct sadb_msg" ] }
204
linux
https://github.com/torvalds/linux
net/key/af_key.c
a5cc68f3d63306d0d288f31edfc2ae6ef8ecd887
af_key: fix info leaks in notify messages key_notify_sa_flush() and key_notify_policy_flush() miss to initialize the sadb_msg_reserved member of the broadcasted message and thereby leak 2 bytes of heap memory to listeners. Fix that. Signed-off-by: Mathias Krause <minipli@googlemail.com> Cc: Steffen Klassert <steffen....
false
6df009726a904ea9e42b5e54a16da382
key_notify_policy_flush
static int key_notify_policy_flush(const struct km_event *c) { struct sk_buff *skb_out; struct sadb_msg *hdr; skb_out = alloc_skb(sizeof(struct sadb_msg) + 16, GFP_ATOMIC); if (!skb_out) return -ENOBUFS; hdr = (struct sadb_msg *) skb_put(skb_out, sizeof(struct sadb_msg)); hdr->sadb_msg_type = SADB_X_SPDFLUSH; ...
[[2703, "\thdr->sadb_msg_reserved = 0;\n"]]
[[2703, "hdr->sadb_msg_reserved = 0;"]]
[ "CVE-2013-2234" ]
[ "CWE-119" ]
null
{ "Execution Environment": null, "Explanation": null, "External Function": null, "Function Argument": null, "Globals": null, "Type Execution Declaration": null }
205
linux
https://github.com/torvalds/linux
kernel/bpf/verifier.c
a5ec6ae161d72f01411169a938fa5f8baea16e8f
bpf: force strict alignment checks for stack pointers Force strict alignment checks for stack pointers because the tracking of stack spills relies on it; unaligned stack accesses can lead to corruption of spilled registers, which is exploitable. Fixes: f1174f77b50c ("bpf/verifier: rework value tracking") Signed-off-b...
true
d4f1e855bfb53d7472639c5a8ea1bafc
check_ptr_alignment
static int check_ptr_alignment(struct bpf_verifier_env *env, const struct bpf_reg_state *reg, int off, int size) { bool strict = env->strict_alignment; const char *pointer_desc = ""; switch (reg->type) { case PTR_TO_PACKET: case PTR_TO_PACKET_META: /* Special case, because of NET_IP_ALIGN. G...
[]
[]
[ "CVE-2017-17856" ]
[ "CWE-119" ]
206
{ "Execution Environment": [], "Explanation": null, "External Function": [ "check_pkt_ptr_alignment", "check_generic_ptr_alignment" ], "Function Argument": [], "Globals": [], "Type Execution Declaration": [] }
206
linux
https://github.com/torvalds/linux
kernel/bpf/verifier.c
a5ec6ae161d72f01411169a938fa5f8baea16e8f
bpf: force strict alignment checks for stack pointers Force strict alignment checks for stack pointers because the tracking of stack spills relies on it; unaligned stack accesses can lead to corruption of spilled registers, which is exploitable. Fixes: f1174f77b50c ("bpf/verifier: rework value tracking") Signed-off-b...
false
b7bdf66fb0bd8f6689c0c4d3508fa08d
check_ptr_alignment
static int check_ptr_alignment(struct bpf_verifier_env *env, const struct bpf_reg_state *reg, int off, int size) { bool strict = env->strict_alignment; const char *pointer_desc = ""; switch (reg->type) { case PTR_TO_PACKET: case PTR_TO_PACKET_META: /* Special case, because of NET_IP_ALIGN. G...
[[1062, "\t\t/* The stack spill tracking logic in check_stack_write()\n"], [1063, "\t\t * and check_stack_read() relies on stack accesses being\n"], [1064, "\t\t * aligned.\n"], [1065, "\t\t */\n"], [1066, "\t\tstrict = true;\n"]]
[[1062, "/* The stack spill tracking logic in check_stack_write()\n\t\t * and check_stack_read() relies on stack accesses being\n\t\t * aligned.\n\t\t */"], [1066, "strict = true;"]]
[ "CVE-2017-17856" ]
[ "CWE-119" ]
206
{ "Execution Environment": [], "Explanation": null, "External Function": [ "check_pkt_ptr_alignment", "check_generic_ptr_alignment" ], "Function Argument": [], "Globals": [], "Type Execution Declaration": [] }
207
linux
https://github.com/torvalds/linux
drivers/media/usb/airspy/airspy.c
aa93d1fee85c890a34f2510a310e55ee76a27848
media: fix airspy usb probe error path Fix a memory leak on probe error of the airspy usb device driver. The problem is triggered when more than 64 usb devices register with v4l2 of type VFL_TYPE_SDR or VFL_TYPE_SUBDEV. The memory leak is caused by the probe function of the airspy driver mishandeling errors and not ...
true
53884b7c886b1df78e6ba852d402cf25
airspy_probe
static int airspy_probe(struct usb_interface *intf, const struct usb_device_id *id) { struct airspy *s; int ret; u8 u8tmp, buf[BUF_SIZE]; s = kzalloc(sizeof(struct airspy), GFP_KERNEL); if (s == NULL) { dev_err(&intf->dev, "Could not allocate memory for state\n"); return -ENOMEM; } mutex_init(&s->v4l2_lo...
[[1075, "\t\tgoto err_unregister_v4l2_dev;\n"], [1084, "err_unregister_v4l2_dev:\n"]]
[[1075, "goto err_unregister_v4l2_dev;"], [1084, "err_unregister_v4l2_dev:"]]
[ "CVE-2016-5400" ]
[ "CWE-119" ]
208
{ "Execution Environment": [], "Explanation": null, "External Function": [], "Function Argument": [], "Globals": [ "formats", "bands", "bands_rf", "airspy_ctrl_ops", "airspy_template", "VFL_TYPE_SDR", "V4L2_BUF_TYPE_SDR_CAPTURE", "VB2_MMAP", "VB2_USERPTR", "VB2_READ", ...
208
linux
https://github.com/torvalds/linux
drivers/media/usb/airspy/airspy.c
aa93d1fee85c890a34f2510a310e55ee76a27848
media: fix airspy usb probe error path Fix a memory leak on probe error of the airspy usb device driver. The problem is triggered when more than 64 usb devices register with v4l2 of type VFL_TYPE_SDR or VFL_TYPE_SUBDEV. The memory leak is caused by the probe function of the airspy driver mishandeling errors and not ...
false
830c9a56deb9e0d2b817c65afb144e07
airspy_probe
static int airspy_probe(struct usb_interface *intf, const struct usb_device_id *id) { struct airspy *s; int ret; u8 u8tmp, buf[BUF_SIZE]; s = kzalloc(sizeof(struct airspy), GFP_KERNEL); if (s == NULL) { dev_err(&intf->dev, "Could not allocate memory for state\n"); return -ENOMEM; } mutex_init(&s->v4l2_lo...
[[1075, "\t\tgoto err_free_controls;\n"]]
[[1075, "goto err_free_controls;"]]
[ "CVE-2016-5400" ]
[ "CWE-119" ]
208
{ "Execution Environment": [], "Explanation": null, "External Function": [], "Function Argument": [], "Globals": [ "formats", "bands", "bands_rf", "airspy_ctrl_ops", "airspy_template", "VFL_TYPE_SDR", "V4L2_BUF_TYPE_SDR_CAPTURE", "VB2_MMAP", "VB2_USERPTR", "VB2_READ", ...
209
linux
https://github.com/torvalds/linux
drivers/hid/hid-logitech-dj.c
ad3e14d7c5268c2e24477c6ef54bbdf88add5d36
HID: logitech: perform bounds checking on device_id early enough device_index is a char type and the size of paired_dj_deivces is 7 elements, therefore proper bounds checking has to be applied to device_index before it is used. We are currently performing the bounds checking in logi_dj_recv_add_djhid_device(), which ...
true
bbf30c67d7486355afc9ee9e2632010b
logi_dj_recv_add_djhid_device
static void logi_dj_recv_add_djhid_device(struct dj_receiver_dev *djrcv_dev, struct dj_report *dj_report) { /* Called in delayed work context */ struct hid_device *djrcv_hdev = djrcv_dev->hdev; struct usb_interface *intf = to_usb_interface(djrcv_hdev->dev.parent); struct usb_device *usbdev = interface_to_usb...
[[241, "\tif ((dj_report->device_index < DJ_DEVICE_INDEX_MIN) ||\n"], [242, "\t (dj_report->device_index > DJ_DEVICE_INDEX_MAX)) {\n"], [243, "\t\tdev_err(&djrcv_hdev->dev, \"%s: invalid device index:%d\\n\",\n"], [244, "\t\t\t__func__, dj_report->device_index);\n"], [245, "\t\treturn;\n"], [246, "\t}\n"], [247, "\n...
[[241, "if ((dj_report->device_index < DJ_DEVICE_INDEX_MIN) ||\n\t (dj_report->device_index > DJ_DEVICE_INDEX_MAX))"], [243, "dev_err(&djrcv_hdev->dev, \"%s: invalid device index:%d\\n\",\n\t\t\t__func__, dj_report->device_index);"], [245, "return;"], [246, "\t}\n"], [247, "\n"]]
[ "CVE-2014-3182" ]
[ "CWE-119" ]
null
{ "Execution Environment": [], "Explanation": null, "External Function": [], "Function Argument": [ "djrcv_dev", "dj_report" ], "Globals": [ "DJ_DEVICE_INDEX_MIN", "DJ_DEVICE_INDEX_MAX" ], "Type Execution Declaration": [ "struct dj_receiver_dev", "struct dj_report" ] }
210
linux
https://github.com/torvalds/linux
drivers/hid/hid-logitech-dj.c
ad3e14d7c5268c2e24477c6ef54bbdf88add5d36
HID: logitech: perform bounds checking on device_id early enough device_index is a char type and the size of paired_dj_deivces is 7 elements, therefore proper bounds checking has to be applied to device_index before it is used. We are currently performing the bounds checking in logi_dj_recv_add_djhid_device(), which ...
false
a31af9d7d82485ba3058af009321760e
logi_dj_raw_event
static int logi_dj_raw_event(struct hid_device *hdev, struct hid_report *report, u8 *data, int size) { struct dj_receiver_dev *djrcv_dev = hid_get_drvdata(hdev); struct dj_report *dj_report = (struct dj_report *) data; unsigned long flags; bool report_processed = false; dbg_hid("%s, size:%d\n", __...
[[686, "\tif ((dj_report->device_index < DJ_DEVICE_INDEX_MIN) ||\n"], [687, "\t (dj_report->device_index > DJ_DEVICE_INDEX_MAX)) {\n"], [688, "\t\tdev_err(&hdev->dev, \"%s: invalid device index:%d\\n\",\n"], [689, "\t\t\t\t__func__, dj_report->device_index);\n"], [690, "\t\treturn false;\n"], [691, "\t}\n"]]
[[686, "if ((dj_report->device_index < DJ_DEVICE_INDEX_MIN) ||\n\t (dj_report->device_index > DJ_DEVICE_INDEX_MAX))"], [688, "dev_err(&hdev->dev, \"%s: invalid device index:%d\\n\",\n\t\t\t\t__func__, dj_report->device_index);"], [690, "return false;"], [691, "\t}\n"]]
[ "CVE-2014-3182" ]
[ "CWE-119" ]
null
{ "Execution Environment": null, "Explanation": null, "External Function": null, "Function Argument": null, "Globals": null, "Type Execution Declaration": null }
211
linux
https://github.com/torvalds/linux
fs/udf/super.c
adee11b2085bee90bd8f4f52123ffb07882d6256
udf: Avoid run away loop when partition table length is corrupted Check provided length of partition table so that (possibly maliciously) corrupted partition table cannot cause accessing data beyond current buffer. Signed-off-by: Jan Kara <jack@suse.cz>
true
443d87e2f32cc8e3c3f535f5ad131077
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; int ret = 0; bh = udf_re...
[[1241, "\t i < sbi->s_partitions && offset < le32_to_cpu(lvd->mapTableLength);\n"]]
[[1240, "for (i = 0, offset = 0;\n\t i < sbi->s_partitions && offset < le32_to_cpu(lvd->mapTableLength);\n\t i++, offset += gpm->partitionMapLength)"]]
[ "CVE-2012-3400" ]
[ "CWE-787" ]
null
{ "Execution Environment": [], "Explanation": null, "External Function": [ "udf_read_tagged", "UDF_SB", "le32_to_cpu" ], "Function Argument": [ "sb", "block" ], "Globals": [], "Type Execution Declaration": [ "struct logicalVolDesc", "struct udf_sb_info" ] }
212
linux
https://github.com/torvalds/linux
fs/smb/client/cached_dir.c
af1689a9b7701d9907dfc84d2a4b57c4bc907144
smb: client: fix potential OOBs in smb2_parse_contexts() Validate offsets and lengths before dereferencing create contexts in smb2_parse_contexts(). This fixes following oops when accessing invalid create contexts from server: BUG: unable to handle page fault for address: ffff8881178d8cc3 #PF: supervisor read ac...
true
e77de617f5a0d6300ab711edfbd8a6e1
open_cached_dir
int open_cached_dir(unsigned int xid, struct cifs_tcon *tcon, const char *path, struct cifs_sb_info *cifs_sb, bool lookup_only, struct cached_fid **ret_cfid) { struct cifs_ses *ses; struct TCP_Server_Info *server; struct cifs_open_parms oparms; struct smb2_create_rsp *o_rsp = NULL; struct smb2_qu...
[[294, "\trc = -EINVAL;\n"], [300, "\tsmb2_parse_contexts(server, o_rsp,\n"], [301, "\t\t\t &oparms.fid->epoch,\n"], [302, "\t\t\t oparms.fid->lease_key, &oplock,\n"], [303, "\t\t\t NULL, NULL);\n"]]
[[294, "rc = -EINVAL;"], [300, "smb2_parse_contexts(server, o_rsp,\n\t\t\t &oparms.fid->epoch,\n\t\t\t oparms.fid->lease_key, &oplock,\n\t\t\t NULL, NULL);"]]
[ "CVE-2023-52434" ]
[ "CWE-119" ]
213
{ "Execution Environment": [], "Explanation": null, "External Function": [ "smb2_parse_contexts" ], "Function Argument": [], "Globals": [], "Type Execution Declaration": [] }
213
linux
https://github.com/torvalds/linux
fs/smb/client/cached_dir.c
af1689a9b7701d9907dfc84d2a4b57c4bc907144
smb: client: fix potential OOBs in smb2_parse_contexts() Validate offsets and lengths before dereferencing create contexts in smb2_parse_contexts(). This fixes following oops when accessing invalid create contexts from server: BUG: unable to handle page fault for address: ffff8881178d8cc3 #PF: supervisor read ac...
false
ab9491f3ce298566ae72b4a422be00e3
open_cached_dir
int open_cached_dir(unsigned int xid, struct cifs_tcon *tcon, const char *path, struct cifs_sb_info *cifs_sb, bool lookup_only, struct cached_fid **ret_cfid) { struct cifs_ses *ses; struct TCP_Server_Info *server; struct cifs_open_parms oparms; struct smb2_create_rsp *o_rsp = NULL; struct smb2_qu...
[[294, "\n"], [296, "\t\tspin_unlock(&cfids->cfid_list_lock);\n"], [297, "\t\trc = -EINVAL;\n"], [298, "\t\tgoto oshr_free;\n"], [299, "\t}\n"], [300, "\n"], [301, "\trc = smb2_parse_contexts(server, rsp_iov,\n"], [302, "\t\t\t\t &oparms.fid->epoch,\n"], [303, "\t\t\t\t oparms.fid->lease_key,\n"], [304, "\t\t\t\t &oplo...
[[294, "\n"], [296, "spin_unlock(&cfids->cfid_list_lock);"], [297, "rc = -EINVAL;"], [298, "goto oshr_free;"], [299, "\t}\n"], [300, "\n"], [301, "rc = smb2_parse_contexts(server, rsp_iov,\n\t\t\t\t &oparms.fid->epoch,\n\t\t\t\t oparms.fid->lease_key,\n\t\t\t\t &oplock, NULL, NULL);"], [305, "if (rc)"], [310, "rc = -EI...
[ "CVE-2023-52434" ]
[ "CWE-119" ]
213
{ "Execution Environment": [], "Explanation": null, "External Function": [ "smb2_parse_contexts" ], "Function Argument": [], "Globals": [], "Type Execution Declaration": [] }
214
linux
https://github.com/torvalds/linux
fs/smb/client/smb2pdu.c
af1689a9b7701d9907dfc84d2a4b57c4bc907144
smb: client: fix potential OOBs in smb2_parse_contexts() Validate offsets and lengths before dereferencing create contexts in smb2_parse_contexts(). This fixes following oops when accessing invalid create contexts from server: BUG: unable to handle page fault for address: ffff8881178d8cc3 #PF: supervisor read ac...
true
86607b041f4ce37bb91040e96d6bdd40
smb2_parse_contexts
void smb2_parse_contexts(struct TCP_Server_Info *server, struct smb2_create_rsp *rsp, unsigned int *epoch, char *lease_key, __u8 *oplock, struct smb2_file_all_info *buf, struct create_posix_rsp *posix) { char *data_offset; struct create_context *cc; unsigned int next; unsigned int remaining;...
[[2239, "void\n"], [2240, "smb2_parse_contexts(struct TCP_Server_Info *server,\n"], [2241, "\t\t struct smb2_create_rsp *rsp,\n"], [2242, "\t\t unsigned int *epoch, char *lease_key, __u8 *oplock,\n"], [2243, "\t\t struct smb2_file_all_info *buf,\n"], [2244, "\t\t struct create_posix_rsp *posix)\n"], [2246, ...
[[2239, "void\nsmb2_parse_contexts(struct TCP_Server_Info *server,\n\t\t struct smb2_create_rsp *rsp,\n\t\t unsigned int *epoch, char *lease_key, __u8 *oplock,\n\t\t struct smb2_file_all_info *buf,\n\t\t struct create_posix_rsp *posix)"], [2246, "char *data_offset;"], [2248, "unsigned int next;"], [2249, "u...
[ "CVE-2023-52434" ]
[ "CWE-119" ]
216
{ "Execution Environment": [], "Explanation": null, "External Function": [], "Function Argument": [ "server", "rsp" ], "Globals": [], "Type Execution Declaration": [ "struct TCP_Server_Info", "struct smb2_create_rsp", "struct create_context" ] }
215
linux
https://github.com/torvalds/linux
fs/smb/client/smb2pdu.c
af1689a9b7701d9907dfc84d2a4b57c4bc907144
smb: client: fix potential OOBs in smb2_parse_contexts() Validate offsets and lengths before dereferencing create contexts in smb2_parse_contexts(). This fixes following oops when accessing invalid create contexts from server: BUG: unable to handle page fault for address: ffff8881178d8cc3 #PF: supervisor read ac...
true
81b8e03ac17eb9f5169e2521e76f57d7
SMB2_open
int SMB2_open(const unsigned int xid, struct cifs_open_parms *oparms, __le16 *path, __u8 *oplock, struct smb2_file_all_info *buf, struct create_posix_rsp *posix, struct kvec *err_iov, int *buftype) { struct smb_rqst rqst; struct smb2_create_rsp *rsp = NULL; struct cifs_tcon *tcon = oparms->tcon; struct cif...
[[3127, "\tsmb2_parse_contexts(server, rsp, &oparms->fid->epoch,\n"], [3128, "\t\t\t oparms->fid->lease_key, oplock, buf, posix);\n"]]
[[3127, "smb2_parse_contexts(server, rsp, &oparms->fid->epoch,\n\t\t\t oparms->fid->lease_key, oplock, buf, posix);"]]
[ "CVE-2023-52434" ]
[ "CWE-119" ]
217
{ "Execution Environment": [], "Explanation": null, "External Function": [ "smb2_parse_contexts" ], "Function Argument": [], "Globals": [], "Type Execution Declaration": [] }
216
linux
https://github.com/torvalds/linux
fs/smb/client/smb2pdu.c
af1689a9b7701d9907dfc84d2a4b57c4bc907144
smb: client: fix potential OOBs in smb2_parse_contexts() Validate offsets and lengths before dereferencing create contexts in smb2_parse_contexts(). This fixes following oops when accessing invalid create contexts from server: BUG: unable to handle page fault for address: ffff8881178d8cc3 #PF: supervisor read ac...
false
6982a29f511c776b7a561ea604f1ab39
smb2_parse_contexts
int smb2_parse_contexts(struct TCP_Server_Info *server, struct kvec *rsp_iov, unsigned int *epoch, char *lease_key, __u8 *oplock, struct smb2_file_all_info *buf, struct create_posix_rsp *posix) { struct smb2_create_rsp *rsp = rsp_iov->iov_base; struct create_context *cc; size_t rem, off, len; size_t ...
[[2239, "int smb2_parse_contexts(struct TCP_Server_Info *server,\n"], [2240, "\t\t\tstruct kvec *rsp_iov,\n"], [2241, "\t\t\tunsigned int *epoch,\n"], [2242, "\t\t\tchar *lease_key, __u8 *oplock,\n"], [2243, "\t\t\tstruct smb2_file_all_info *buf,\n"], [2244, "\t\t\tstruct create_posix_rsp *posix)\n"], [2246, "\tstruct ...
[[2239, "int smb2_parse_contexts(struct TCP_Server_Info *server,\n\t\t\tstruct kvec *rsp_iov,\n\t\t\tunsigned int *epoch,\n\t\t\tchar *lease_key, __u8 *oplock,\n\t\t\tstruct smb2_file_all_info *buf,\n\t\t\tstruct create_posix_rsp *posix)"], [2246, "struct smb2_create_rsp *rsp = rsp_iov->iov_base;"], [2248, "size_t rem,...
[ "CVE-2023-52434" ]
[ "CWE-119" ]
216
{ "Execution Environment": [], "Explanation": null, "External Function": [], "Function Argument": [ "server", "rsp" ], "Globals": [], "Type Execution Declaration": [ "struct TCP_Server_Info", "struct smb2_create_rsp", "struct create_context" ] }
217
linux
https://github.com/torvalds/linux
fs/smb/client/smb2pdu.c
af1689a9b7701d9907dfc84d2a4b57c4bc907144
smb: client: fix potential OOBs in smb2_parse_contexts() Validate offsets and lengths before dereferencing create contexts in smb2_parse_contexts(). This fixes following oops when accessing invalid create contexts from server: BUG: unable to handle page fault for address: ffff8881178d8cc3 #PF: supervisor read ac...
false
a6019b36718d19f8f98592755eef47b2
SMB2_open
int SMB2_open(const unsigned int xid, struct cifs_open_parms *oparms, __le16 *path, __u8 *oplock, struct smb2_file_all_info *buf, struct create_posix_rsp *posix, struct kvec *err_iov, int *buftype) { struct smb_rqst rqst; struct smb2_create_rsp *rsp = NULL; struct cifs_tcon *tcon = oparms->tcon; struct cif...
[[3146, "\trc = smb2_parse_contexts(server, &rsp_iov, &oparms->fid->epoch,\n"], [3147, "\t\t\t\t oparms->fid->lease_key, oplock, buf, posix);\n"]]
[[3146, "rc = smb2_parse_contexts(server, &rsp_iov, &oparms->fid->epoch,\n\t\t\t\t oparms->fid->lease_key, oplock, buf, posix);"]]
[ "CVE-2023-52434" ]
[ "CWE-119" ]
217
{ "Execution Environment": [], "Explanation": null, "External Function": [ "smb2_parse_contexts" ], "Function Argument": [], "Globals": [], "Type Execution Declaration": [] }
218
linux
https://github.com/torvalds/linux
drivers/hid/hid-core.c
b12fece4c64857e5fab4290bf01b2e0317a88456
HID: check empty report_list in hid_validate_values() Add a check for empty report_list in hid_validate_values(). The missing check causes a type confusion when issuing a list_entry() on an empty report_list. The problem is caused by the assumption that the device must have valid report_list. While this will be true f...
true
b292f7927b362dce49ac8d92a330b1c2
hid_validate_values
struct hid_report *hid_validate_values(struct hid_device *hid, enum hid_report_type type, unsigned int id, unsigned int field_index, unsigned int report_counts) { struct hid_report *report; if (type > HID_FEATURE_REPORT) { hid_err(hid, "invalid HID report type %u\n", type); retur...
[[996, "\t\treport = list_entry(\n"], [997, "\t\t\t\thid->report_enum[type].report_list.next,\n"]]
[[996, "report = list_entry(\n\t\t\t\thid->report_enum[type].report_list.next,\n\t\t\t\tstruct hid_report, list);"]]
[ "CVE-2023-1073" ]
[ "CWE-787", "CWE-119" ]
219
{ "Execution Environment": [], "Explanation": null, "External Function": [ "list_entry", "list_first_entry_or_null", "hid_err" ], "Function Argument": [], "Globals": [ "HID_FEATURE_REPORT", "HID_MAX_IDS" ], "Type Execution Declaration": [ "struct hid_device", "struct hid_repo...
219
linux
https://github.com/torvalds/linux
drivers/hid/hid-core.c
b12fece4c64857e5fab4290bf01b2e0317a88456
HID: check empty report_list in hid_validate_values() Add a check for empty report_list in hid_validate_values(). The missing check causes a type confusion when issuing a list_entry() on an empty report_list. The problem is caused by the assumption that the device must have valid report_list. While this will be true f...
false
2835d9556051775995f2cbb5b186746b
hid_validate_values
struct hid_report *hid_validate_values(struct hid_device *hid, enum hid_report_type type, unsigned int id, unsigned int field_index, unsigned int report_counts) { struct hid_report *report; if (type > HID_FEATURE_REPORT) { hid_err(hid, "invalid HID report type %u\n", type); retur...
[[996, "\t\treport = list_first_entry_or_null(\n"], [997, "\t\t\t\t&hid->report_enum[type].report_list,\n"]]
[[996, "report = list_first_entry_or_null(\n\t\t\t\t&hid->report_enum[type].report_list,\n\t\t\t\tstruct hid_report, list);"]]
[ "CVE-2023-1073" ]
[ "CWE-787", "CWE-119" ]
219
{ "Execution Environment": [], "Explanation": null, "External Function": [ "list_entry", "list_first_entry_or_null", "hid_err" ], "Function Argument": [], "Globals": [ "HID_FEATURE_REPORT", "HID_MAX_IDS" ], "Type Execution Declaration": [ "struct hid_device", "struct hid_repo...
220
linux
https://github.com/torvalds/linux
drivers/usb/usbip/usbip_common.c
b348d7dddb6c4fbfc810b7a0626e8ec9e29f7cbb
USB: usbip: fix potential out-of-bounds write Fix potential out-of-bounds write to urb->transfer_buffer usbip handles network communication directly in the kernel. When receiving a packet from its peer, usbip code parses headers according to protocol. As part of this parsing urb->actual_length is filled. Since the inp...
true
eb96182af7669f4c0a3a65047b2f5cf3
usbip_recv_xbuff
int usbip_recv_xbuff(struct usbip_device *ud, struct urb *urb) { int ret; int size; if (ud->side == USBIP_STUB) { /* the direction of urb must be OUT. */ if (usb_pipein(urb->pipe)) return 0; size = urb->transfer_buffer_length; } else { /* the direction of urb must be IN. */ if (usb_pipeout(urb->pipe)...
[]
[]
[ "CVE-2016-3955" ]
[ "CWE-119" ]
221
{ "Execution Environment": [], "Explanation": null, "External Function": [ "usbip_recv" ], "Function Argument": [], "Globals": [], "Type Execution Declaration": [] }
221
linux
https://github.com/torvalds/linux
drivers/usb/usbip/usbip_common.c
b348d7dddb6c4fbfc810b7a0626e8ec9e29f7cbb
USB: usbip: fix potential out-of-bounds write Fix potential out-of-bounds write to urb->transfer_buffer usbip handles network communication directly in the kernel. When receiving a packet from its peer, usbip code parses headers according to protocol. As part of this parsing urb->actual_length is filled. Since the inp...
false
77ec3bdcbcad036012f8b06a9a529f35
usbip_recv_xbuff
int usbip_recv_xbuff(struct usbip_device *ud, struct urb *urb) { int ret; int size; if (ud->side == USBIP_STUB) { /* the direction of urb must be OUT. */ if (usb_pipein(urb->pipe)) return 0; size = urb->transfer_buffer_length; } else { /* the direction of urb must be IN. */ if (usb_pipeout(urb->pipe)...
[[744, "\tif (size > urb->transfer_buffer_length) {\n"], [745, "\t\t/* should not happen, probably malicious packet */\n"], [746, "\t\tif (ud->side == USBIP_STUB) {\n"], [747, "\t\t\tusbip_event_add(ud, SDEV_EVENT_ERROR_TCP);\n"], [748, "\t\t\treturn 0;\n"], [749, "\t\t} else {\n"], [750, "\t\t\tusbip_event_add(ud, VDE...
[[744, "if (size > urb->transfer_buffer_length)"], [745, "/* should not happen, probably malicious packet */"], [746, "if (ud->side == USBIP_STUB)"], [747, "usbip_event_add(ud, SDEV_EVENT_ERROR_TCP);"], [748, "return 0;"], [749, "else"], [750, "usbip_event_add(ud, VDEV_EVENT_ERROR_TCP);"], [751, "return -EPIPE;"], [752...
[ "CVE-2016-3955" ]
[ "CWE-119" ]
221
{ "Execution Environment": [], "Explanation": null, "External Function": [ "usbip_recv" ], "Function Argument": [], "Globals": [], "Type Execution Declaration": [] }
222
linux
https://github.com/torvalds/linux
net/batman-adv/icmp_socket.c
b5a1eeef04cc7859f34dec9b72ea1b28e4aba07c
batman-adv: Only write requested number of byte to user buffer Don't write more than the requested number of bytes of an batman-adv icmp packet to the userspace buffer. Otherwise unrelated userspace memory might get overridden by the kernel. Signed-off-by: Sven Eckelmann <sven@narfation.org> Signed-off-by: Marek Lind...
true
95cf28f64370c040a82fdfc9e6360e37
bat_socket_read
static ssize_t bat_socket_read(struct file *file, char __user *buf, size_t count, loff_t *ppos) { struct socket_client *socket_client = file->private_data; struct socket_packet *socket_packet; size_t packet_len; int error; if ((file->f_flags & O_NONBLOCK) && (socket_client->queue_len == 0)) return -EA...
[[139, "\terror = copy_to_user(buf, &socket_packet->icmp_packet,\n"], [140, "\t\t\t socket_packet->icmp_len);\n"], [142, "\tpacket_len = socket_packet->icmp_len;\n"]]
[[139, "error = copy_to_user(buf, &socket_packet->icmp_packet,\n\t\t\t socket_packet->icmp_len);"], [142, "packet_len = socket_packet->icmp_len;"]]
[ "CVE-2011-4604" ]
[ "CWE-119" ]
223
{ "Execution Environment": [], "Explanation": null, "External Function": [], "Function Argument": [ "count" ], "Globals": [], "Type Execution Declaration": [ "struct socket_packet" ] }
223
linux
https://github.com/torvalds/linux
net/batman-adv/icmp_socket.c
b5a1eeef04cc7859f34dec9b72ea1b28e4aba07c
batman-adv: Only write requested number of byte to user buffer Don't write more than the requested number of bytes of an batman-adv icmp packet to the userspace buffer. Otherwise unrelated userspace memory might get overridden by the kernel. Signed-off-by: Sven Eckelmann <sven@narfation.org> Signed-off-by: Marek Lind...
false
7d8290302bcdc93ed7f4421adfa9194f
bat_socket_read
static ssize_t bat_socket_read(struct file *file, char __user *buf, size_t count, loff_t *ppos) { struct socket_client *socket_client = file->private_data; struct socket_packet *socket_packet; size_t packet_len; int error; if ((file->f_flags & O_NONBLOCK) && (socket_client->queue_len == 0)) return -EA...
[[139, "\tpacket_len = min(count, socket_packet->icmp_len);\n"], [140, "\terror = copy_to_user(buf, &socket_packet->icmp_packet, packet_len);\n"]]
[[139, "packet_len = min(count, socket_packet->icmp_len);"], [140, "error = copy_to_user(buf, &socket_packet->icmp_packet, packet_len);"]]
[ "CVE-2011-4604" ]
[ "CWE-119" ]
223
{ "Execution Environment": [], "Explanation": null, "External Function": [], "Function Argument": [ "count" ], "Globals": [], "Type Execution Declaration": [ "struct socket_packet" ] }
224
linux
https://github.com/torvalds/linux
drivers/staging/wlags49_h2/wl_priv.c
b5e2f339865fb443107e5b10603e53bbc92dc054
staging: wlags49_h2: buffer overflow setting station name We need to check the length parameter before doing the memcpy(). I've actually changed it to strlcpy() as well so that it's NUL terminated. You need CAP_NET_ADMIN to trigger these so it's not the end of the world. Reported-by: Nico Golde <nico@ngolde.de> Rep...
true
f7d36ffd78fc888e6f117d44ad71498a
wvlan_uil_put_info
int wvlan_uil_put_info(struct uilreq *urq, struct wl_private *lp) { int result = 0; ltv_t *pLtv; bool_t ltvAllocated = FALSE; ENCSTRCT sEncryption; // #ifdef USE_WDS hcf_16 hcfPort = HCF_PORT_0; #endif /* USE_WDS */ /*------...
[[689, "\t\t\t\t\tmemcpy((void *)lp->StationName, (void *)&pLtv->u.u8[2], (size_t)pLtv->u.u16[0]);\n"]]
[[689, "memcpy((void *)lp->StationName, (void *)&pLtv->u.u8[2], (size_t)pLtv->u.u16[0]);"]]
[ "CVE-2013-4514" ]
[ "CWE-119" ]
226
{ "Execution Environment": [], "Explanation": null, "External Function": [], "Function Argument": [], "Globals": [], "Type Execution Declaration": [ "struct uilreq", "struct wl_private", "ltv_t" ] }
225
linux
https://github.com/torvalds/linux
drivers/staging/wlags49_h2/wl_priv.c
b5e2f339865fb443107e5b10603e53bbc92dc054
staging: wlags49_h2: buffer overflow setting station name We need to check the length parameter before doing the memcpy(). I've actually changed it to strlcpy() as well so that it's NUL terminated. You need CAP_NET_ADMIN to trigger these so it's not the end of the world. Reported-by: Nico Golde <nico@ngolde.de> Rep...
true
2ab61c0f23eaad358d39c511eb6a23e4
wvlan_set_station_nickname
int wvlan_set_station_nickname(struct net_device *dev, struct iw_request_info *info, union iwreq_data *wrqu, char *extra) { struct wl_private *lp = wl_priv(dev); unsigned long flags; int ret = 0; /*------------------------------------------------------------------------*/ DBG_FUNC...
[[1796, "\n"], [1797, "\tmemcpy(lp->StationName, extra, wrqu->data.length);\n"]]
[[1796, "\n"], [1797, "memcpy(lp->StationName, extra, wrqu->data.length);"]]
[ "CVE-2013-4514" ]
[ "CWE-119" ]
227
{ "Execution Environment": [], "Explanation": null, "External Function": [ "wl_priv" ], "Function Argument": [ "dev", "wrqu", "extra" ], "Globals": [], "Type Execution Declaration": [ "struct wl_private" ] }
226
linux
https://github.com/torvalds/linux
drivers/staging/wlags49_h2/wl_priv.c
b5e2f339865fb443107e5b10603e53bbc92dc054
staging: wlags49_h2: buffer overflow setting station name We need to check the length parameter before doing the memcpy(). I've actually changed it to strlcpy() as well so that it's NUL terminated. You need CAP_NET_ADMIN to trigger these so it's not the end of the world. Reported-by: Nico Golde <nico@ngolde.de> Rep...
false
3406393fb7963f3506ac52d6f2d691aa
wvlan_uil_put_info
int wvlan_uil_put_info(struct uilreq *urq, struct wl_private *lp) { int result = 0; ltv_t *pLtv; bool_t ltvAllocated = FALSE; ENCSTRCT sEncryption; size_t len; // #ifdef USE_WDS hcf_16 hcfPort = HCF_PORT_0; #endif /* USE_W...
[[573, "\tsize_t\t\t\tlen;\n"], [690, "\t\t\t\t\tlen = min_t(size_t, pLtv->u.u16[0], sizeof(lp->StationName));\n"], [691, "\t\t\t\t\tstrlcpy(lp->StationName, &pLtv->u.u8[2], len);\n"]]
[[573, "size_t\t\t\tlen;"], [690, "len = min_t(size_t, pLtv->u.u16[0], sizeof(lp->StationName));"], [691, "strlcpy(lp->StationName, &pLtv->u.u8[2], len);"]]
[ "CVE-2013-4514" ]
[ "CWE-119" ]
226
{ "Execution Environment": [], "Explanation": null, "External Function": [], "Function Argument": [], "Globals": [], "Type Execution Declaration": [ "struct uilreq", "struct wl_private", "ltv_t" ] }
227
linux
https://github.com/torvalds/linux
drivers/staging/wlags49_h2/wl_priv.c
b5e2f339865fb443107e5b10603e53bbc92dc054
staging: wlags49_h2: buffer overflow setting station name We need to check the length parameter before doing the memcpy(). I've actually changed it to strlcpy() as well so that it's NUL terminated. You need CAP_NET_ADMIN to trigger these so it's not the end of the world. Reported-by: Nico Golde <nico@ngolde.de> Rep...
false
eb45543a428bf497eacf92c2002e57d7
wvlan_set_station_nickname
int wvlan_set_station_nickname(struct net_device *dev, struct iw_request_info *info, union iwreq_data *wrqu, char *extra) { struct wl_private *lp = wl_priv(dev); unsigned long flags; size_t len; int ret = 0; /*------------------------------------------------------------------------*...
[[1788, "\tsize_t len;\n"], [1799, "\tlen = min_t(size_t, wrqu->data.length, sizeof(lp->StationName));\n"], [1800, "\tstrlcpy(lp->StationName, extra, len);\n"]]
[[1788, "size_t len;"], [1799, "len = min_t(size_t, wrqu->data.length, sizeof(lp->StationName));"], [1800, "strlcpy(lp->StationName, extra, len);"]]
[ "CVE-2013-4514" ]
[ "CWE-119" ]
227
{ "Execution Environment": [], "Explanation": null, "External Function": [ "wl_priv" ], "Function Argument": [ "dev", "wrqu", "extra" ], "Globals": [], "Type Execution Declaration": [ "struct wl_private" ] }
228
linux
https://github.com/torvalds/linux
fs/cifs/sess.c
b854b4ee66437e6e1622fda90529c814978cb4ca
cifs: fix double-fault crash during ntlmssp The crash occurred because we were calling memzero_explicit() on an already freed sess_data::iov[1] (ntlmsspblob) in sess_free_buffer(). Fix this by not calling memzero_explicit() on sess_data::iov[1] as it's already by handled by callers. Fixes: a4e430c8c8ba ("cifs: repla...
true
86ccfff853ef388978cd775be88a6718
sess_free_buffer
static void sess_free_buffer(struct sess_data *sess_data) { int i; /* zero the session data before freeing, as it might contain sensitive info (keys, etc) */ for (i = 0; i < 3; i++) if (sess_data->iov[i].iov_base) memzero_explicit(sess_data->iov[i].iov_base, sess_data->iov[i].iov_len); free_rsp_buf(sess_data...
[[1211, "\tint i;\n"], [1213, "\t/* zero the session data before freeing, as it might contain sensitive info (keys, etc) */\n"], [1214, "\tfor (i = 0; i < 3; i++)\n"], [1215, "\t\tif (sess_data->iov[i].iov_base)\n"], [1216, "\t\t\tmemzero_explicit(sess_data->iov[i].iov_base, sess_data->iov[i].iov_len);\n"], [1218, "\tf...
[[1211, "int i;"], [1213, "/* zero the session data before freeing, as it might contain sensitive info (keys, etc) */"], [1214, "for (i = 0; i < 3; i++)"], [1215, "if (sess_data->iov[i].iov_base)"], [1216, "memzero_explicit(sess_data->iov[i].iov_base, sess_data->iov[i].iov_len);"], [1218, "free_rsp_buf(sess_data->buf0_...
[ "CVE-2022-3595" ]
[ "CWE-415", "CWE-119" ]
229
{ "Execution Environment": [], "Explanation": null, "External Function": [ "free_rsp_buf" ], "Function Argument": [], "Globals": [ "CIFS_NO_BUFFER" ], "Type Execution Declaration": [ "struct sess_data", "struct kvec" ] }
229
linux
https://github.com/torvalds/linux
fs/cifs/sess.c
b854b4ee66437e6e1622fda90529c814978cb4ca
cifs: fix double-fault crash during ntlmssp The crash occurred because we were calling memzero_explicit() on an already freed sess_data::iov[1] (ntlmsspblob) in sess_free_buffer(). Fix this by not calling memzero_explicit() on sess_data::iov[1] as it's already by handled by callers. Fixes: a4e430c8c8ba ("cifs: repla...
false
9fc8ba1584db24fe892ccffb5a95bcc0
sess_free_buffer
static void sess_free_buffer(struct sess_data *sess_data) { struct kvec *iov = sess_data->iov; /* * Zero the session data before freeing, as it might contain sensitive info (keys, etc). * Note that iov[1] is already freed by caller. */ if (sess_data->buf0_type != CIFS_NO_BUFFER && iov[0].iov_base) memzero_e...
[[1211, "\tstruct kvec *iov = sess_data->iov;\n"], [1213, "\t/*\n"], [1214, "\t * Zero the session data before freeing, as it might contain sensitive info (keys, etc).\n"], [1215, "\t * Note that iov[1] is already freed by caller.\n"], [1216, "\t */\n"], [1217, "\tif (sess_data->buf0_type != CIFS_NO_BUFFER && iov[0].io...
[[1211, "struct kvec *iov = sess_data->iov;"], [1213, "/*\n\t * Zero the session data before freeing, as it might contain sensitive info (keys, etc).\n\t * Note that iov[1] is already freed by caller.\n\t */"], [1217, "if (sess_data->buf0_type != CIFS_NO_BUFFER && iov[0].iov_base)"], [1218, "memzero_explicit(iov[0].iov...
[ "CVE-2022-3595" ]
[ "CWE-415", "CWE-119" ]
229
{ "Execution Environment": [], "Explanation": null, "External Function": [ "free_rsp_buf" ], "Function Argument": [], "Globals": [ "CIFS_NO_BUFFER" ], "Type Execution Declaration": [ "struct sess_data", "struct kvec" ] }
230
linux
https://github.com/torvalds/linux
net/core/sock.c
b98b0bc8c431e3ceb4b26b0dfc8db509518fb290
net: avoid signed overflows for SO_{SND|RCV}BUFFORCE CAP_NET_ADMIN users should not be allowed to set negative sk_sndbuf or sk_rcvbuf values, as it can lead to various memory corruptions, crashes, OOM... Note that before commit 82981930125a ("net: cleanups in sock_setsockopt()"), the bug was even more serious, since ...
true
1048343781017aeb3c425ec4b2c21096
sock_setsockopt
int sock_setsockopt(struct socket *sock, int level, int optname, char __user *optval, unsigned int optlen) { struct sock *sk = sock->sk; int val; int valbool; struct linger ling; int ret = 0; /* * Options without arguments */ if (optname == SO_BINDTODEVICE) return sock_setbindtodevice(sk, optval, o...
[[718, "\t\tsk->sk_sndbuf = max_t(u32, val * 2, SOCK_MIN_SNDBUF);\n"], [754, "\t\tsk->sk_rcvbuf = max_t(u32, val * 2, SOCK_MIN_RCVBUF);\n"]]
[[718, "sk->sk_sndbuf = max_t(u32, val * 2, SOCK_MIN_SNDBUF);"], [754, "sk->sk_rcvbuf = max_t(u32, val * 2, SOCK_MIN_RCVBUF);"]]
[ "CVE-2016-9793" ]
[ "CWE-119" ]
231
{ "Execution Environment": [], "Explanation": null, "External Function": [], "Function Argument": [], "Globals": [ "SOCK_MIN_SNDBUF", "SOCK_MIN_RCVBUF" ], "Type Execution Declaration": [ "max_t" ] }
231
linux
https://github.com/torvalds/linux
net/core/sock.c
b98b0bc8c431e3ceb4b26b0dfc8db509518fb290
net: avoid signed overflows for SO_{SND|RCV}BUFFORCE CAP_NET_ADMIN users should not be allowed to set negative sk_sndbuf or sk_rcvbuf values, as it can lead to various memory corruptions, crashes, OOM... Note that before commit 82981930125a ("net: cleanups in sock_setsockopt()"), the bug was even more serious, since ...
false
87415db8bda7604c629e03244b465a2c
sock_setsockopt
int sock_setsockopt(struct socket *sock, int level, int optname, char __user *optval, unsigned int optlen) { struct sock *sk = sock->sk; int val; int valbool; struct linger ling; int ret = 0; /* * Options without arguments */ if (optname == SO_BINDTODEVICE) return sock_setbindtodevice(sk, optval, o...
[[718, "\t\tsk->sk_sndbuf = max_t(int, val * 2, SOCK_MIN_SNDBUF);\n"], [754, "\t\tsk->sk_rcvbuf = max_t(int, val * 2, SOCK_MIN_RCVBUF);\n"]]
[[718, "sk->sk_sndbuf = max_t(int, val * 2, SOCK_MIN_SNDBUF);"], [754, "sk->sk_rcvbuf = max_t(int, val * 2, SOCK_MIN_RCVBUF);"]]
[ "CVE-2016-9793" ]
[ "CWE-119" ]
231
{ "Execution Environment": [], "Explanation": null, "External Function": [], "Function Argument": [], "Globals": [ "SOCK_MIN_SNDBUF", "SOCK_MIN_RCVBUF" ], "Type Execution Declaration": [ "max_t" ] }
232
linux
https://github.com/torvalds/linux
drivers/uwb/uwbd.c
bbf26183b7a6236ba602f4d6a2f7cade35bba043
uwb: properly check kthread_run return value uwbd_start() calls kthread_run() and checks that the return value is not NULL. But the return value is not NULL in case kthread_run() fails, it takes the form of ERR_PTR(-EINTR). Use IS_ERR() instead. Also add a check to uwbd_stop(). Signed-off-by: Andrey Konovalov <andr...
true
f21288a3cd2e13d43f080f83724ba65d
uwbd_start
void uwbd_start(struct uwb_rc *rc) { rc->uwbd.task = kthread_run(uwbd, rc, "uwbd"); if (rc->uwbd.task == NULL) printk(KERN_ERR "UWB: Cannot start management daemon; " "UWB won't work\n"); else rc->uwbd.pid = rc->uwbd.task->pid; }
[[305, "\trc->uwbd.task = kthread_run(uwbd, rc, \"uwbd\");\n"], [306, "\tif (rc->uwbd.task == NULL)\n"], [309, "\telse\n"]]
[[305, "rc->uwbd.task = kthread_run(uwbd, rc, \"uwbd\");"], [306, "if (rc->uwbd.task == NULL)"], [309, "else"]]
[ "CVE-2017-16526" ]
[ "CWE-119" ]
234
{ "Execution Environment": [], "Explanation": null, "External Function": [ "kthread_run" ], "Function Argument": [ "rc" ], "Globals": [], "Type Execution Declaration": [ "struct uwb_rc", "struct task_struct" ] }
233
linux
https://github.com/torvalds/linux
drivers/uwb/uwbd.c
bbf26183b7a6236ba602f4d6a2f7cade35bba043
uwb: properly check kthread_run return value uwbd_start() calls kthread_run() and checks that the return value is not NULL. But the return value is not NULL in case kthread_run() fails, it takes the form of ERR_PTR(-EINTR). Use IS_ERR() instead. Also add a check to uwbd_stop(). Signed-off-by: Andrey Konovalov <andr...
true
73e1ea02771cc0a342ce05995ca73d12
uwbd_stop
void uwbd_stop(struct uwb_rc *rc) { kthread_stop(rc->uwbd.task); uwbd_flush(rc); }
[[316, "\tkthread_stop(rc->uwbd.task);\n"]]
[[316, "kthread_stop(rc->uwbd.task);"]]
[ "CVE-2017-16526" ]
[ "CWE-119" ]
235
{ "Execution Environment": [], "Explanation": null, "External Function": [], "Function Argument": [ "rc" ], "Globals": [], "Type Execution Declaration": [] }
234
linux
https://github.com/torvalds/linux
drivers/uwb/uwbd.c
bbf26183b7a6236ba602f4d6a2f7cade35bba043
uwb: properly check kthread_run return value uwbd_start() calls kthread_run() and checks that the return value is not NULL. But the return value is not NULL in case kthread_run() fails, it takes the form of ERR_PTR(-EINTR). Use IS_ERR() instead. Also add a check to uwbd_stop(). Signed-off-by: Andrey Konovalov <andr...
false
b4587577b8bb91d8d177548160fe3084
uwbd_start
void uwbd_start(struct uwb_rc *rc) { struct task_struct *task = kthread_run(uwbd, rc, "uwbd"); if (IS_ERR(task)) { rc->uwbd.task = NULL; printk(KERN_ERR "UWB: Cannot start management daemon; " "UWB won't work\n"); } else { rc->uwbd.task = task; rc->uwbd.pid = rc->uwbd.task->pid; } }
[[305, "\tstruct task_struct *task = kthread_run(uwbd, rc, \"uwbd\");\n"], [306, "\tif (IS_ERR(task)) {\n"], [307, "\t\trc->uwbd.task = NULL;\n"], [310, "\t} else {\n"], [311, "\t\trc->uwbd.task = task;\n"], [313, "\t}\n"]]
[[305, "struct task_struct *task = kthread_run(uwbd, rc, \"uwbd\");"], [306, "if (IS_ERR(task))"], [307, "rc->uwbd.task = NULL;"], [310, "else"], [311, "rc->uwbd.task = task;"], [313, "\t}\n"]]
[ "CVE-2017-16526" ]
[ "CWE-119" ]
234
{ "Execution Environment": [], "Explanation": null, "External Function": [ "kthread_run" ], "Function Argument": [ "rc" ], "Globals": [], "Type Execution Declaration": [ "struct uwb_rc", "struct task_struct" ] }
235
linux
https://github.com/torvalds/linux
drivers/uwb/uwbd.c
bbf26183b7a6236ba602f4d6a2f7cade35bba043
uwb: properly check kthread_run return value uwbd_start() calls kthread_run() and checks that the return value is not NULL. But the return value is not NULL in case kthread_run() fails, it takes the form of ERR_PTR(-EINTR). Use IS_ERR() instead. Also add a check to uwbd_stop(). Signed-off-by: Andrey Konovalov <andr...
false
75c6b3210d1c653242a1f53580394dae
uwbd_stop
void uwbd_stop(struct uwb_rc *rc) { if (rc->uwbd.task) kthread_stop(rc->uwbd.task); uwbd_flush(rc); }
[[319, "\tif (rc->uwbd.task)\n"], [320, "\t\tkthread_stop(rc->uwbd.task);\n"]]
[[319, "if (rc->uwbd.task)"], [320, "kthread_stop(rc->uwbd.task);"]]
[ "CVE-2017-16526" ]
[ "CWE-119" ]
235
{ "Execution Environment": [], "Explanation": null, "External Function": [], "Function Argument": [ "rc" ], "Globals": [], "Type Execution Declaration": [] }
236
linux
https://github.com/torvalds/linux
drivers/usb/core/config.c
bd7a3fe770ebd8391d1c7d072ff88e9e76d063eb
USB: fix out-of-bounds in usb_set_configuration Andrey Konovalov reported a possible out-of-bounds problem for a USB interface association descriptor. He writes: It seems there's no proper size check of a USB_DT_INTERFACE_ASSOCIATION descriptor. It's only checked that the size is >= 2 in usb_parse_configuration(),...
true
b4bca6692e1370a373f3bca9c30aceed
usb_parse_configuration
static int usb_parse_configuration(struct usb_device *dev, int cfgidx, struct usb_host_config *config, unsigned char *buffer, int size) { struct device *ddev = &dev->dev; unsigned char *buffer0 = buffer; int cfgno; int nintf, nintf_orig; int i, j, n; struct usb_interface_cache *intfc; unsigned char *buffer2;...
[[652, "\t\t\t\tconfig->intf_assoc[iad_num] =\n"], [653, "\t\t\t\t\t(struct usb_interface_assoc_descriptor\n"], [654, "\t\t\t\t\t*)header;\n"]]
[[652, "config->intf_assoc[iad_num] =\n\t\t\t\t\t(struct usb_interface_assoc_descriptor\n\t\t\t\t\t*)header;"]]
[ "CVE-2017-16531" ]
[ "CWE-119" ]
237
{ "Execution Environment": [], "Explanation": null, "External Function": [ "dev_warn", "plural" ], "Function Argument": [ "dev", "config", "buffer", "size" ], "Globals": [ "USB_MAXIADS", "USB_DT_INTERFACE_ASSOCIATION", "USB_DT_INTERFACE_ASSOCIATION_SIZE" ], "Type Ex...
237
linux
https://github.com/torvalds/linux
drivers/usb/core/config.c
bd7a3fe770ebd8391d1c7d072ff88e9e76d063eb
USB: fix out-of-bounds in usb_set_configuration Andrey Konovalov reported a possible out-of-bounds problem for a USB interface association descriptor. He writes: It seems there's no proper size check of a USB_DT_INTERFACE_ASSOCIATION descriptor. It's only checked that the size is >= 2 in usb_parse_configuration(),...
false
1f9a067cea2f5473a787e945f0cbec20
usb_parse_configuration
static int usb_parse_configuration(struct usb_device *dev, int cfgidx, struct usb_host_config *config, unsigned char *buffer, int size) { struct device *ddev = &dev->dev; unsigned char *buffer0 = buffer; int cfgno; int nintf, nintf_orig; int i, j, n; struct usb_interface_cache *intfc; unsigned char *buffer2;...
[[646, "\t\t\tstruct usb_interface_assoc_descriptor *d;\n"], [647, "\n"], [648, "\t\t\td = (struct usb_interface_assoc_descriptor *)header;\n"], [649, "\t\t\tif (d->bLength < USB_DT_INTERFACE_ASSOCIATION_SIZE) {\n"], [650, "\t\t\t\tdev_warn(ddev,\n"], [651, "\t\t\t\t\t \"config %d has an invalid interface association d...
[[646, "struct usb_interface_assoc_descriptor *d;"], [647, "\n"], [648, "d = (struct usb_interface_assoc_descriptor *)header;"], [649, "if (d->bLength < USB_DT_INTERFACE_ASSOCIATION_SIZE)"], [650, "dev_warn(ddev,\n\t\t\t\t\t \"config %d has an invalid interface association descriptor of length %d, skipping\\n\",\n\t\t\...
[ "CVE-2017-16531" ]
[ "CWE-119" ]
237
{ "Execution Environment": [], "Explanation": null, "External Function": [ "dev_warn", "plural" ], "Function Argument": [ "dev", "config", "buffer", "size" ], "Globals": [ "USB_MAXIADS", "USB_DT_INTERFACE_ASSOCIATION", "USB_DT_INTERFACE_ASSOCIATION_SIZE" ], "Type Ex...
238
linux
https://github.com/torvalds/linux
drivers/scsi/sg.c
bf33f87dd04c371ea33feb821b60d63d754e3124
scsi: sg: check length passed to SG_NEXT_CMD_LEN The user can control the size of the next command passed along, but the value passed to the ioctl isn't checked against the usable max command size. Cc: <stable@vger.kernel.org> Signed-off-by: Peter Chang <dpf@google.com> Acked-by: Douglas Gilbert <dgilbert@interlog.co...
true
c613c586bd37e43d1606006ce124910e
sg_ioctl
static long sg_ioctl(struct file *filp, unsigned int cmd_in, unsigned long arg) { void __user *p = (void __user *)arg; int __user *ip = p; int result, val, read_only; Sg_device *sdp; Sg_fd *sfp; Sg_request *srp; unsigned long iflags; if ((!(sfp = (Sg_fd *) filp->private_data)) || (!(sdp = sfp->parentdp))) re...
[]
[]
[ "CVE-2017-7187" ]
[ "CWE-119" ]
239
{ "Execution Environment": [], "Explanation": null, "External Function": [], "Function Argument": [], "Globals": [ "SG_MAX_CDB_SIZE" ], "Type Execution Declaration": [] }
239
linux
https://github.com/torvalds/linux
drivers/scsi/sg.c
bf33f87dd04c371ea33feb821b60d63d754e3124
scsi: sg: check length passed to SG_NEXT_CMD_LEN The user can control the size of the next command passed along, but the value passed to the ioctl isn't checked against the usable max command size. Cc: <stable@vger.kernel.org> Signed-off-by: Peter Chang <dpf@google.com> Acked-by: Douglas Gilbert <dgilbert@interlog.co...
false
bec3dfc5cadb39109a42df4c790561e4
sg_ioctl
static long sg_ioctl(struct file *filp, unsigned int cmd_in, unsigned long arg) { void __user *p = (void __user *)arg; int __user *ip = p; int result, val, read_only; Sg_device *sdp; Sg_fd *sfp; Sg_request *srp; unsigned long iflags; if ((!(sfp = (Sg_fd *) filp->private_data)) || (!(sdp = sfp->parentdp))) re...
[[999, "\t\tif (val > SG_MAX_CDB_SIZE)\n"], [1000, "\t\t\treturn -ENOMEM;\n"]]
[[999, "if (val > SG_MAX_CDB_SIZE)"], [1000, "return -ENOMEM;"]]
[ "CVE-2017-7187" ]
[ "CWE-119" ]
239
{ "Execution Environment": [], "Explanation": null, "External Function": [], "Function Argument": [], "Globals": [ "SG_MAX_CDB_SIZE" ], "Type Execution Declaration": [] }
240
linux
https://github.com/torvalds/linux
drivers/usb/class/cdc-wdm.c
c0f5ecee4e741667b2493c742b60b6218d40b3aa
USB: cdc-wdm: fix buffer overflow The buffer for responses must not overflow. If this would happen, set a flag, drop the data and return an error after user space has read all remaining data. Signed-off-by: Oliver Neukum <oliver@neukum.org> CC: stable@kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundati...
true
27d6ce487bbf36a0eca25eaedcd2110a
wdm_in_callback
static void wdm_in_callback(struct urb *urb) { struct wdm_device *desc = urb->context; int status = urb->status; spin_lock(&desc->iuspin); clear_bit(WDM_RESPONDING, &desc->flags); if (status) { switch (status) { case -ENOENT: dev_dbg(&desc->intf->dev, "nonzero urb status received: -ENOENT"); goto s...
[[188, "\tdesc->reslength = urb->actual_length;\n"], [189, "\tmemmove(desc->ubuf + desc->length, desc->inbuf, desc->reslength);\n"], [190, "\tdesc->length += desc->reslength;\n"]]
[[188, "desc->reslength = urb->actual_length;"], [189, "memmove(desc->ubuf + desc->length, desc->inbuf, desc->reslength);"], [190, "desc->length += desc->reslength;"]]
[ "CVE-2013-1860" ]
[ "CWE-119" ]
241
{ "Execution Environment": [], "Explanation": null, "External Function": [], "Function Argument": [], "Globals": [], "Type Execution Declaration": [ "struct wdm_device" ] }
241
linux
https://github.com/torvalds/linux
drivers/usb/class/cdc-wdm.c
c0f5ecee4e741667b2493c742b60b6218d40b3aa
USB: cdc-wdm: fix buffer overflow The buffer for responses must not overflow. If this would happen, set a flag, drop the data and return an error after user space has read all remaining data. Signed-off-by: Oliver Neukum <oliver@neukum.org> CC: stable@kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundati...
false
21bc77043b1a3a107adb5b4dab280397
wdm_in_callback
static void wdm_in_callback(struct urb *urb) { struct wdm_device *desc = urb->context; int status = urb->status; int length = urb->actual_length; spin_lock(&desc->iuspin); clear_bit(WDM_RESPONDING, &desc->flags); if (status) { switch (status) { case -ENOENT: dev_dbg(&desc->intf->dev, "nonzero urb sta...
[[159, "\tint length = urb->actual_length;\n"], [190, "\tif (length + desc->length > desc->wMaxCommand) {\n"], [191, "\t\t/* The buffer would overflow */\n"], [192, "\t\tset_bit(WDM_OVERFLOW, &desc->flags);\n"], [193, "\t} else {\n"], [194, "\t\t/* we may already be in overflow */\n"], [195, "\t\tif (!test_bit(WDM_OVER...
[[159, "int length = urb->actual_length;"], [190, "if (length + desc->length > desc->wMaxCommand)"], [191, "/* The buffer would overflow */"], [192, "set_bit(WDM_OVERFLOW, &desc->flags);"], [193, "else"], [194, "/* we may already be in overflow */"], [195, "if (!test_bit(WDM_OVERFLOW, &desc->flags))"], [196, "memmove(d...
[ "CVE-2013-1860" ]
[ "CWE-119" ]
241
{ "Execution Environment": [], "Explanation": null, "External Function": [], "Function Argument": [], "Globals": [], "Type Execution Declaration": [ "struct wdm_device" ] }
242
linux
https://github.com/torvalds/linux
arch/powerpc/kernel/ptrace.c
c1fa0768a8713b135848f78fd43ffc208d8ded70
powerpc/tm: Flush TM only if CPU has TM feature Commit cd63f3c ("powerpc/tm: Fix saving of TM SPRs in core dump") added code to access TM SPRs in flush_tmregs_to_thread(). However flush_tmregs_to_thread() does not check if TM feature is available on CPU before trying to access TM SPRs in order to copy live state to th...
true
651e7c9c31f21a7ac56f02fcd80bbaba
flush_tmregs_to_thread
static void flush_tmregs_to_thread(struct task_struct *tsk) { /* * If task is not current, it will have been flushed already to * it's thread_struct during __switch_to(). * * A reclaim flushes ALL the state or if not in TM save TM SPRs * in the appropriate thread structures from live. */ if (tsk != curre...
[[134, "\tif (tsk != current)\n"]]
[[134, "if (tsk != current)"]]
[ "CVE-2018-1091" ]
[ "CWE-119" ]
243
{ "Execution Environment": [], "Explanation": null, "External Function": [ "cpu_has_feature", "mfmsr", "tm_reclaim_current", "tm_enable", "tm_save_sprs" ], "Function Argument": [], "Globals": [ "CPU_FTR_TM", "current" ], "Type Execution Declaration": [] }
243
linux
https://github.com/torvalds/linux
arch/powerpc/kernel/ptrace.c
c1fa0768a8713b135848f78fd43ffc208d8ded70
powerpc/tm: Flush TM only if CPU has TM feature Commit cd63f3c ("powerpc/tm: Fix saving of TM SPRs in core dump") added code to access TM SPRs in flush_tmregs_to_thread(). However flush_tmregs_to_thread() does not check if TM feature is available on CPU before trying to access TM SPRs in order to copy live state to th...
false
5fd0d92f7814f303bca3c6f95cf7f6fc
flush_tmregs_to_thread
static void flush_tmregs_to_thread(struct task_struct *tsk) { /* * If task is not current, it will have been flushed already to * it's thread_struct during __switch_to(). * * A reclaim flushes ALL the state or if not in TM save TM SPRs * in the appropriate thread structures from live. */ if ((!cpu_has_fe...
[[134, "\tif ((!cpu_has_feature(CPU_FTR_TM)) || (tsk != current))\n"]]
[[134, "if ((!cpu_has_feature(CPU_FTR_TM)) || (tsk != current))"]]
[ "CVE-2018-1091" ]
[ "CWE-119" ]
243
{ "Execution Environment": [], "Explanation": null, "External Function": [ "cpu_has_feature", "mfmsr", "tm_reclaim_current", "tm_enable", "tm_save_sprs" ], "Function Argument": [], "Globals": [ "CPU_FTR_TM", "current" ], "Type Execution Declaration": [] }
244
linux
https://github.com/torvalds/linux
drivers/staging/ozwpan/ozcdev.c
c2c65cd2e14ada6de44cb527e7f1990bede24e15
staging: ozwpan: prevent overflow in oz_cdev_write() We need to check "count" so we don't overflow the ei->data buffer. Reported-by: Nico Golde <nico@ngolde.de> Reported-by: Fabian Yamaguchi <fabs@goesec.de> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Cc: stable@kernel.org Signed-off-by: Linus Torvalds <t...
true
55c1ad193837b1d15bf0eb99d82c605c
oz_cdev_write
static ssize_t oz_cdev_write(struct file *filp, const char __user *buf, size_t count, loff_t *fpos) { struct oz_pd *pd; struct oz_elt_buf *eb; struct oz_elt_info *ei; struct oz_elt *elt; struct oz_app_hdr *app_hdr; struct oz_serial_ctx *ctx; spin_lock_bh(&g_cdev.lock); pd = g_cdev.active_pd; if (pd) oz_pd...
[]
[]
[ "CVE-2013-4513" ]
[ "CWE-119" ]
245
{ "Execution Environment": [], "Explanation": null, "External Function": [ "oz_elt_info_alloc" ], "Function Argument": [], "Globals": [], "Type Execution Declaration": [ "struct oz_elt_info" ] }
245
linux
https://github.com/torvalds/linux
drivers/staging/ozwpan/ozcdev.c
c2c65cd2e14ada6de44cb527e7f1990bede24e15
staging: ozwpan: prevent overflow in oz_cdev_write() We need to check "count" so we don't overflow the ei->data buffer. Reported-by: Nico Golde <nico@ngolde.de> Reported-by: Fabian Yamaguchi <fabs@goesec.de> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Cc: stable@kernel.org Signed-off-by: Linus Torvalds <t...
false
877dbf201aec4774795b1b555f6ffb88
oz_cdev_write
static ssize_t oz_cdev_write(struct file *filp, const char __user *buf, size_t count, loff_t *fpos) { struct oz_pd *pd; struct oz_elt_buf *eb; struct oz_elt_info *ei; struct oz_elt *elt; struct oz_app_hdr *app_hdr; struct oz_serial_ctx *ctx; if (count > sizeof(ei->data) - sizeof(*elt) - sizeof(*app_hdr)) re...
[[158, "\tif (count > sizeof(ei->data) - sizeof(*elt) - sizeof(*app_hdr))\n"], [159, "\t\treturn -EINVAL;\n"], [160, "\n"]]
[[158, "if (count > sizeof(ei->data) - sizeof(*elt) - sizeof(*app_hdr))"], [159, "return -EINVAL;"], [160, "\n"]]
[ "CVE-2013-4513" ]
[ "CWE-119" ]
245
{ "Execution Environment": [], "Explanation": null, "External Function": [ "oz_elt_info_alloc" ], "Function Argument": [], "Globals": [], "Type Execution Declaration": [ "struct oz_elt_info" ] }
246
linux
https://github.com/torvalds/linux
arch/x86/kvm/x86.c
c300aa64ddf57d9c5d9c898a64b36877345dd4a9
KVM: x86: fix for buffer overflow in handling of MSR_KVM_SYSTEM_TIME (CVE-2013-1796) If the guest sets the GPA of the time_page so that the request to update the time straddles a page then KVM will write onto an incorrect page. The write is done byusing kmap atomic to get a pointer to the page for the time structure ...
true
e3e249eaf850f4d5eff123980e4a9d8b
kvm_set_msr_common
int kvm_set_msr_common(struct kvm_vcpu *vcpu, struct msr_data *msr_info) { bool pr = false; u32 msr = msr_info->index; u64 data = msr_info->data; switch (msr) { case MSR_AMD64_NB_CFG: case MSR_IA32_UCODE_REV: case MSR_IA32_UCODE_WRITE: case MSR_VM_HSAVE_PA: case MSR_AMD64_PATCH_LOADER: case MSR_AMD64_BU_CFG2...
[]
[]
[ "CVE-2013-1796" ]
[ "CWE-119" ]
247
{ "Execution Environment": [], "Explanation": null, "External Function": [], "Function Argument": [ "vcpu", "msr_info" ], "Globals": [], "Type Execution Declaration": [ "struct kvm_vcpu", "struct pvclock_vcpu_time_info" ] }
247
linux
https://github.com/torvalds/linux
arch/x86/kvm/x86.c
c300aa64ddf57d9c5d9c898a64b36877345dd4a9
KVM: x86: fix for buffer overflow in handling of MSR_KVM_SYSTEM_TIME (CVE-2013-1796) If the guest sets the GPA of the time_page so that the request to update the time straddles a page then KVM will write onto an incorrect page. The write is done byusing kmap atomic to get a pointer to the page for the time structure ...
false
3152772315430af0f554aa096ca841c2
kvm_set_msr_common
int kvm_set_msr_common(struct kvm_vcpu *vcpu, struct msr_data *msr_info) { bool pr = false; u32 msr = msr_info->index; u64 data = msr_info->data; switch (msr) { case MSR_AMD64_NB_CFG: case MSR_IA32_UCODE_REV: case MSR_IA32_UCODE_WRITE: case MSR_VM_HSAVE_PA: case MSR_AMD64_PATCH_LOADER: case MSR_AMD64_BU_CFG2...
[[1962, "\t\t/* Check that the address is 32-byte aligned. */\n"], [1963, "\t\tif (vcpu->arch.time_offset &\n"], [1964, "\t\t\t\t(sizeof(struct pvclock_vcpu_time_info) - 1))\n"], [1965, "\t\t\tbreak;\n"], [1966, "\n"]]
[[1962, "/* Check that the address is 32-byte aligned. */"], [1963, "if (vcpu->arch.time_offset &\n\t\t\t\t(sizeof(struct pvclock_vcpu_time_info) - 1))"], [1965, "break;"], [1966, "\n"]]
[ "CVE-2013-1796" ]
[ "CWE-119" ]
247
{ "Execution Environment": [], "Explanation": null, "External Function": [], "Function Argument": [ "vcpu", "msr_info" ], "Globals": [], "Type Execution Declaration": [ "struct kvm_vcpu", "struct pvclock_vcpu_time_info" ] }
248
linux
https://github.com/torvalds/linux
drivers/hid/hid-magicmouse.c
c54def7bd64d7c0b6993336abcffb8444795bf38
HID: magicmouse: sanity check report size in raw_event() callback The report passed to us from transport driver could potentially be arbitrarily large, therefore we better sanity-check it so that magicmouse_emit_touch() gets only valid values of raw_id. Cc: stable@vger.kernel.org Reported-by: Steven Vittitoe <scvitti...
true
9955f502beb853acb724cccae0030cb2
magicmouse_raw_event
static int magicmouse_raw_event(struct hid_device *hdev, struct hid_report *report, u8 *data, int size) { struct magicmouse_sc *msc = hid_get_drvdata(hdev); struct input_dev *input = msc->input; int x = 0, y = 0, ii, clicks = 0, npoints; switch (data[0]) { case TRACKPAD_REPORT_ID: /* Expect four bytes of pref...
[]
[]
[ "CVE-2014-3181" ]
[ "CWE-119" ]
249
{ "Execution Environment": [], "Explanation": null, "External Function": [ "magicmouse_emit_touch" ], "Function Argument": [ "size", "data" ], "Globals": [ "TRACKPAD_REPORT_ID", "MOUSE_REPORT_ID" ], "Type Execution Declaration": [] }
249
linux
https://github.com/torvalds/linux
drivers/hid/hid-magicmouse.c
c54def7bd64d7c0b6993336abcffb8444795bf38
HID: magicmouse: sanity check report size in raw_event() callback The report passed to us from transport driver could potentially be arbitrarily large, therefore we better sanity-check it so that magicmouse_emit_touch() gets only valid values of raw_id. Cc: stable@vger.kernel.org Reported-by: Steven Vittitoe <scvitti...
false
9d22756f6d6f60e5aa216189af0fc312
magicmouse_raw_event
static int magicmouse_raw_event(struct hid_device *hdev, struct hid_report *report, u8 *data, int size) { struct magicmouse_sc *msc = hid_get_drvdata(hdev); struct input_dev *input = msc->input; int x = 0, y = 0, ii, clicks = 0, npoints; switch (data[0]) { case TRACKPAD_REPORT_ID: /* Expect four bytes of pref...
[[293, "\t\tif (npoints > 15) {\n"], [294, "\t\t\thid_warn(hdev, \"invalid size value (%d) for TRACKPAD_REPORT_ID\\n\",\n"], [295, "\t\t\t\t\tsize);\n"], [296, "\t\t\treturn 0;\n"], [297, "\t\t}\n"], [315, "\t\tif (npoints > 15) {\n"], [316, "\t\t\thid_warn(hdev, \"invalid size value (%d) for MOUSE_REPORT_ID\\n\",\n"],...
[[293, "if (npoints > 15)"], [294, "hid_warn(hdev, \"invalid size value (%d) for TRACKPAD_REPORT_ID\\n\",\n\t\t\t\t\tsize);"], [296, "return 0;"], [297, "\t\t}\n"], [315, "if (npoints > 15)"], [316, "hid_warn(hdev, \"invalid size value (%d) for MOUSE_REPORT_ID\\n\",\n\t\t\t\t\tsize);"], [318, "return 0;"], [319, "\t\t}...
[ "CVE-2014-3181" ]
[ "CWE-119" ]
249
{ "Execution Environment": [], "Explanation": null, "External Function": [ "magicmouse_emit_touch" ], "Function Argument": [ "size", "data" ], "Globals": [ "TRACKPAD_REPORT_ID", "MOUSE_REPORT_ID" ], "Type Execution Declaration": [] }
250
linux
https://github.com/torvalds/linux
drivers/usb/usbip/stub_rx.c
c6688ef9f29762e65bce325ef4acd6c675806366
usbip: fix stub_rx: harden CMD_SUBMIT path to handle malicious input Harden CMD_SUBMIT path to handle malicious input that could trigger large memory allocations. Add checks to validate transfer_buffer_length and number_of_packets to protect against bad input requesting for unbounded memory allocations. Validate early...
true
36c076b764cd92dee1fac590506565f3
get_pipe
static int get_pipe(struct stub_device *sdev, int epnum, int dir) { struct usb_device *udev = sdev->udev; struct usb_host_endpoint *ep; struct usb_endpoint_descriptor *epd = NULL; if (epnum < 0 || epnum > 15) goto err_ret; if (dir == USBIP_DIR_IN) ep = udev->ep_in[epnum & 0x7f]; else ep = udev->ep_out[epn...
[[325, "static int get_pipe(struct stub_device *sdev, int epnum, int dir)\n"], [372, "\tdev_err(&sdev->udev->dev, \"get pipe() invalid epnum %d\\n\", epnum);\n"]]
[[325, "static int get_pipe(struct stub_device *sdev, int epnum, int dir)"], [372, "dev_err(&sdev->udev->dev, \"get pipe() invalid epnum %d\\n\", epnum);"]]
[ "CVE-2017-16913" ]
[ "CWE-119" ]
252
{ "Execution Environment": [], "Explanation": null, "External Function": [], "Function Argument": [ "struct stub_device *sdev" ], "Globals": [], "Type Execution Declaration": [ "struct stub_device", "struct usb_device", "struct usb_host_endpoint", "struct usb_endpoint_descriptor" ] }
251
linux
https://github.com/torvalds/linux
drivers/usb/usbip/stub_rx.c
c6688ef9f29762e65bce325ef4acd6c675806366
usbip: fix stub_rx: harden CMD_SUBMIT path to handle malicious input Harden CMD_SUBMIT path to handle malicious input that could trigger large memory allocations. Add checks to validate transfer_buffer_length and number_of_packets to protect against bad input requesting for unbounded memory allocations. Validate early...
true
879cee16af86a3bd97020e2018797aed
stub_recv_cmd_submit
static void stub_recv_cmd_submit(struct stub_device *sdev, struct usbip_header *pdu) { int ret; struct stub_priv *priv; struct usbip_device *ud = &sdev->ud; struct usb_device *udev = sdev->udev; int pipe = get_pipe(sdev, pdu->base.ep, pdu->base.direction); if (pipe == -1) return; priv = stub_priv_alloc(...
[[437, "\tint pipe = get_pipe(sdev, pdu->base.ep, pdu->base.direction);\n"], [459, "\tif (pdu->u.cmd_submit.transfer_buffer_length > 0) {\n"]]
[[437, "int pipe = get_pipe(sdev, pdu->base.ep, pdu->base.direction);"], [459, "if (pdu->u.cmd_submit.transfer_buffer_length > 0)"]]
[ "CVE-2017-16913" ]
[ "CWE-119" ]
253
{ "Execution Environment": [], "Explanation": null, "External Function": [ "get_pipe" ], "Function Argument": [], "Globals": [], "Type Execution Declaration": [] }
252
linux
https://github.com/torvalds/linux
drivers/usb/usbip/stub_rx.c
c6688ef9f29762e65bce325ef4acd6c675806366
usbip: fix stub_rx: harden CMD_SUBMIT path to handle malicious input Harden CMD_SUBMIT path to handle malicious input that could trigger large memory allocations. Add checks to validate transfer_buffer_length and number_of_packets to protect against bad input requesting for unbounded memory allocations. Validate early...
false
e2adf2d74d4ecfe8dee35b01c279fd6f
get_pipe
static int get_pipe(struct stub_device *sdev, struct usbip_header *pdu) { struct usb_device *udev = sdev->udev; struct usb_host_endpoint *ep; struct usb_endpoint_descriptor *epd = NULL; int epnum = pdu->base.ep; int dir = pdu->base.direction; if (epnum < 0 || epnum > 15) goto err_ret; if (dir == USBIP_DIR_IN...
[[325, "static int get_pipe(struct stub_device *sdev, struct usbip_header *pdu)\n"], [330, "\tint epnum = pdu->base.ep;\n"], [331, "\tint dir = pdu->base.direction;\n"], [344, "\n"], [345, "\t/* validate transfer_buffer_length */\n"], [346, "\tif (pdu->u.cmd_submit.transfer_buffer_length > INT_MAX) {\n"], [347, "\t\tde...
[[325, "static int get_pipe(struct stub_device *sdev, struct usbip_header *pdu)"], [330, "int epnum = pdu->base.ep;"], [331, "int dir = pdu->base.direction;"], [344, "\n"], [345, "/* validate transfer_buffer_length */"], [346, "if (pdu->u.cmd_submit.transfer_buffer_length > INT_MAX)"], [347, "dev_err(&sdev->udev->dev,\...
[ "CVE-2017-16913" ]
[ "CWE-119" ]
252
{ "Execution Environment": [], "Explanation": null, "External Function": [], "Function Argument": [ "struct stub_device *sdev" ], "Globals": [], "Type Execution Declaration": [ "struct stub_device", "struct usb_device", "struct usb_host_endpoint", "struct usb_endpoint_descriptor" ] }
253
linux
https://github.com/torvalds/linux
drivers/usb/usbip/stub_rx.c
c6688ef9f29762e65bce325ef4acd6c675806366
usbip: fix stub_rx: harden CMD_SUBMIT path to handle malicious input Harden CMD_SUBMIT path to handle malicious input that could trigger large memory allocations. Add checks to validate transfer_buffer_length and number_of_packets to protect against bad input requesting for unbounded memory allocations. Validate early...
false
308bd453ce6d552be38caec78e357e41
stub_recv_cmd_submit
static void stub_recv_cmd_submit(struct stub_device *sdev, struct usbip_header *pdu) { int ret; struct stub_priv *priv; struct usbip_device *ud = &sdev->ud; struct usb_device *udev = sdev->udev; int pipe = get_pipe(sdev, pdu); if (pipe == -1) return; priv = stub_priv_alloc(sdev, pdu); if (!priv) retu...
[[463, "\tint pipe = get_pipe(sdev, pdu);\n"], [485, "\tif (pdu->u.cmd_submit.transfer_buffer_length > 0 &&\n"], [486, "\t pdu->u.cmd_submit.transfer_buffer_length <= INT_MAX) {\n"]]
[[463, "int pipe = get_pipe(sdev, pdu);"], [485, "if (pdu->u.cmd_submit.transfer_buffer_length > 0 &&\n\t pdu->u.cmd_submit.transfer_buffer_length <= INT_MAX)"]]
[ "CVE-2017-16913" ]
[ "CWE-119" ]
253
{ "Execution Environment": [], "Explanation": null, "External Function": [ "get_pipe" ], "Function Argument": [], "Globals": [], "Type Execution Declaration": [] }
254
linux
https://github.com/torvalds/linux
drivers/net/wireless/b43/dma.c
c85ce65ecac078ab1a1835c87c4a6319cf74660a
b43: allocate receive buffers big enough for max frame len + offset Otherwise, skb_put inside of dma_rx can fail... https://bugzilla.kernel.org/show_bug.cgi?id=32042 Signed-off-by: John W. Linville <linville@tuxdriver.com> Acked-by: Larry Finger <Larry.Finger@lwfinger.net> Cc: stable@kernel.org
true
f553042dc05f8b2d378098cf03e3205e
dma_rx
static void dma_rx(struct b43_dmaring *ring, int *slot) { const struct b43_dma_ops *ops = ring->ops; struct b43_dmadesc_generic *desc; struct b43_dmadesc_meta *meta; struct b43_rxhdr_fw4 *rxhdr; struct sk_buff *skb; u16 len; int err; dma_addr_t dmaaddr; desc = ops->idx2desc(ring, *slot, &meta); sync_descbuf...
[[1539, "\tif (unlikely(len > ring->rx_buffersize)) {\n"]]
[[1539, "if (unlikely(len > ring->rx_buffersize))"]]
[ "CVE-2011-3359" ]
[ "CWE-119" ]
255
{ "Execution Environment": [], "Explanation": null, "External Function": [], "Function Argument": [], "Globals": [], "Type Execution Declaration": [ "struct b43_dmaring" ] }
255
linux
https://github.com/torvalds/linux
drivers/net/wireless/b43/dma.c
c85ce65ecac078ab1a1835c87c4a6319cf74660a
b43: allocate receive buffers big enough for max frame len + offset Otherwise, skb_put inside of dma_rx can fail... https://bugzilla.kernel.org/show_bug.cgi?id=32042 Signed-off-by: John W. Linville <linville@tuxdriver.com> Acked-by: Larry Finger <Larry.Finger@lwfinger.net> Cc: stable@kernel.org
false
f7fa61535c128e52623f88931e384229
dma_rx
static void dma_rx(struct b43_dmaring *ring, int *slot) { const struct b43_dma_ops *ops = ring->ops; struct b43_dmadesc_generic *desc; struct b43_dmadesc_meta *meta; struct b43_rxhdr_fw4 *rxhdr; struct sk_buff *skb; u16 len; int err; dma_addr_t dmaaddr; desc = ops->idx2desc(ring, *slot, &meta); sync_descbuf...
[[1539, "\tif (unlikely(len + ring->frameoffset > ring->rx_buffersize)) {\n"]]
[[1539, "if (unlikely(len + ring->frameoffset > ring->rx_buffersize))"]]
[ "CVE-2011-3359" ]
[ "CWE-119" ]
255
{ "Execution Environment": [], "Explanation": null, "External Function": [], "Function Argument": [], "Globals": [], "Type Execution Declaration": [ "struct b43_dmaring" ] }
256
linux
https://github.com/torvalds/linux
net/ipv6/route.c
c88507fbad8055297c1d1e21e599f46960cbee39
ipv6: don't set DST_NOCOUNT for remotely added routes DST_NOCOUNT should only be used if an authorized user adds routes locally. In case of routes which are added on behalf of router advertisments this flag must not get used as it allows an unlimited number of routes getting added remotely. Signed-off-by: Sabrina Dub...
true
534f303ca7883afb167b89f8812f7561
ip6_route_add
int ip6_route_add(struct fib6_config *cfg) { int err; struct net *net = cfg->fc_nlinfo.nl_net; struct rt6_info *rt = NULL; struct net_device *dev = NULL; struct inet6_dev *idev = NULL; struct fib6_table *table; int addr_type; if (cfg->fc_dst_len > 128 || cfg->fc_src_len > 128) return -EINVAL; // #ifndef CONF...
[[1516, "\trt = ip6_dst_alloc(net, NULL, DST_NOCOUNT, table);\n"]]
[[1516, "rt = ip6_dst_alloc(net, NULL, DST_NOCOUNT, table);"]]
[ "CVE-2014-2309" ]
[ "CWE-119" ]
257
{ "Execution Environment": [], "Explanation": null, "External Function": [], "Function Argument": [], "Globals": [ "RTF_ADDRCONF", "DST_NOCOUNT" ], "Type Execution Declaration": [] }
257
linux
https://github.com/torvalds/linux
net/ipv6/route.c
c88507fbad8055297c1d1e21e599f46960cbee39
ipv6: don't set DST_NOCOUNT for remotely added routes DST_NOCOUNT should only be used if an authorized user adds routes locally. In case of routes which are added on behalf of router advertisments this flag must not get used as it allows an unlimited number of routes getting added remotely. Signed-off-by: Sabrina Dub...
false
8f02c2490fd7d78db2641e35899085a8
ip6_route_add
int ip6_route_add(struct fib6_config *cfg) { int err; struct net *net = cfg->fc_nlinfo.nl_net; struct rt6_info *rt = NULL; struct net_device *dev = NULL; struct inet6_dev *idev = NULL; struct fib6_table *table; int addr_type; if (cfg->fc_dst_len > 128 || cfg->fc_src_len > 128) return -EINVAL; // #ifndef CONF...
[[1516, "\trt = ip6_dst_alloc(net, NULL, (cfg->fc_flags & RTF_ADDRCONF) ? 0 : DST_NOCOUNT, table);\n"]]
[[1516, "rt = ip6_dst_alloc(net, NULL, (cfg->fc_flags & RTF_ADDRCONF) ? 0 : DST_NOCOUNT, table);"]]
[ "CVE-2014-2309" ]
[ "CWE-119" ]
257
{ "Execution Environment": [], "Explanation": null, "External Function": [], "Function Argument": [], "Globals": [ "RTF_ADDRCONF", "DST_NOCOUNT" ], "Type Execution Declaration": [] }
258
linux
https://github.com/torvalds/linux
drivers/net/can/usb/gs_usb.c
c919a3069c775c1c876bec55e00b2305d5125caa
can: gs_usb: Don't use stack memory for USB transfers Fixes: 05ca5270005c can: gs_usb: add ethtool set_phys_id callback to locate physical device The gs_usb driver is performing USB transfers using buffers allocated on the stack. This causes the driver to not function with vmapped stacks. Instead, allocate memory for...
true
94213c813f1156420a13194db8dfcaaf
gs_usb_probe
static int gs_usb_probe(struct usb_interface *intf, const struct usb_device_id *id) { struct gs_usb *dev; int rc = -ENOMEM; unsigned int icount, i; struct gs_host_config hconf = { .byte_order = 0x0000beef, }; struct gs_device_config dconf; /* send host config */ rc = usb_control_msg(interface_to_usbdev(in...
[[911, "\tstruct gs_host_config hconf = {\n"], [912, "\t\t.byte_order = 0x0000beef,\n"], [913, "\t};\n"], [914, "\tstruct gs_device_config dconf;\n"], [923, "\t\t\t &hconf,\n"], [924, "\t\t\t sizeof(hconf),\n"], [940, "\t\t\t &dconf,\n"], [941, "\t\t\t sizeof(dconf),\n"], [949, "\ticount = dconf.icount ...
[[911, "struct gs_host_config hconf = {\n\t\t.byte_order = 0x0000beef,\n\t};"], [914, "struct gs_device_config dconf;"], [917, "rc = usb_control_msg(interface_to_usbdev(intf),\n\t\t\t usb_sndctrlpipe(interface_to_usbdev(intf), 0),\n\t\t\t GS_USB_BREQ_HOST_FORMAT,\n\t\t\t USB_DIR_OUT|USB_TYPE_VENDOR|USB_RECI...
[ "CVE-2017-8066" ]
[ "CWE-119" ]
259
{ "Execution Environment": [ "CONFIG_VMAP_STACK" ], "Explanation": null, "External Function": [ "usb_control_msg", "interface_to_usbdev", "gs_make_candev" ], "Function Argument": [ "intf" ], "Globals": [ "GS_USB_BREQ_HOST_FORMAT", "GS_USB_BREQ_DEVICE_CONFIG", "USB_DIR_OUT...
259
linux
https://github.com/torvalds/linux
drivers/net/can/usb/gs_usb.c
c919a3069c775c1c876bec55e00b2305d5125caa
can: gs_usb: Don't use stack memory for USB transfers Fixes: 05ca5270005c can: gs_usb: add ethtool set_phys_id callback to locate physical device The gs_usb driver is performing USB transfers using buffers allocated on the stack. This causes the driver to not function with vmapped stacks. Instead, allocate memory for...
false
a0dedc1753c412eea93caee15c6e2efd
gs_usb_probe
static int gs_usb_probe(struct usb_interface *intf, const struct usb_device_id *id) { struct gs_usb *dev; int rc = -ENOMEM; unsigned int icount, i; struct gs_host_config *hconf; struct gs_device_config *dconf; hconf = kmalloc(sizeof(*hconf), GFP_KERNEL); if (!hconf) return -ENOMEM; hconf->byte_order = 0x...
[[911, "\tstruct gs_host_config *hconf;\n"], [912, "\tstruct gs_device_config *dconf;\n"], [913, "\n"], [914, "\thconf = kmalloc(sizeof(*hconf), GFP_KERNEL);\n"], [915, "\tif (!hconf)\n"], [916, "\t\treturn -ENOMEM;\n"], [917, "\n"], [918, "\thconf->byte_order = 0x0000beef;\n"], [927, "\t\t\t hconf,\n"], [928, "\t\...
[[911, "struct gs_host_config *hconf;"], [912, "struct gs_device_config *dconf;"], [913, "\n"], [914, "hconf = kmalloc(sizeof(*hconf), GFP_KERNEL);"], [915, "if (!hconf)"], [916, "return -ENOMEM;"], [917, "\n"], [918, "hconf->byte_order = 0x0000beef;"], [921, "rc = usb_control_msg(interface_to_usbdev(intf),\n\t\t\t ...
[ "CVE-2017-8066" ]
[ "CWE-119" ]
259
{ "Execution Environment": [ "CONFIG_VMAP_STACK" ], "Explanation": null, "External Function": [ "usb_control_msg", "interface_to_usbdev", "gs_make_candev" ], "Function Argument": [ "intf" ], "Globals": [ "GS_USB_BREQ_HOST_FORMAT", "GS_USB_BREQ_DEVICE_CONFIG", "USB_DIR_OUT...
260
linux
https://github.com/torvalds/linux
fs/partitions/ldm.c
cae13fe4cc3f24820ffb990c09110626837e85d4
Fix for buffer overflow in ldm_frag_add not sufficient As Ben Hutchings discovered [1], the patch for CVE-2011-1017 (buffer overflow in ldm_frag_add) is not sufficient. The original patch in commit c340b1d64000 ("fs/partitions/ldm.c: fix oops caused by corrupted partition table") does not consider that, for subsequen...
true
bc4610d2126eb07642b198a42c1135b5
ldm_frag_add
static bool ldm_frag_add (const u8 *data, int size, struct list_head *frags) { struct frag *f; struct list_head *item; int rec, num, group; BUG_ON (!data || !frags); if (size < 2 * VBLK_SIZE_HEAD) { ldm_error("Value of size is to small."); return false; } group = get_unaligned_be32(data + 0x08); rec = ...
[]
[]
[ "CVE-2011-2182" ]
[ "CWE-119" ]
261
{ "Execution Environment": [], "Explanation": null, "External Function": [ "list_for_each", "list_entry" ], "Function Argument": [], "Globals": [ "VBLK_SIZE_HEAD" ], "Type Execution Declaration": [ "struct frag" ] }
261
linux
https://github.com/torvalds/linux
fs/partitions/ldm.c
cae13fe4cc3f24820ffb990c09110626837e85d4
Fix for buffer overflow in ldm_frag_add not sufficient As Ben Hutchings discovered [1], the patch for CVE-2011-1017 (buffer overflow in ldm_frag_add) is not sufficient. The original patch in commit c340b1d64000 ("fs/partitions/ldm.c: fix oops caused by corrupted partition table") does not consider that, for subsequen...
false
4233a8e0e75adf61cdb1d973312d78d7
ldm_frag_add
static bool ldm_frag_add (const u8 *data, int size, struct list_head *frags) { struct frag *f; struct list_head *item; int rec, num, group; BUG_ON (!data || !frags); if (size < 2 * VBLK_SIZE_HEAD) { ldm_error("Value of size is to small."); return false; } group = get_unaligned_be32(data + 0x08); rec = ...
[[1338, "\tif (rec >= f->num) {\n"], [1339, "\t\tldm_error(\"REC value (%d) exceeds NUM value (%d)\", rec, f->num);\n"], [1340, "\t\treturn false;\n"], [1341, "\t}\n"], [1342, "\n"]]
[[1338, "if (rec >= f->num)"], [1339, "ldm_error(\"REC value (%d) exceeds NUM value (%d)\", rec, f->num);"], [1340, "return false;"], [1341, "\t}\n"], [1342, "\n"]]
[ "CVE-2011-2182" ]
[ "CWE-119" ]
261
{ "Execution Environment": [], "Explanation": null, "External Function": [ "list_for_each", "list_entry" ], "Function Argument": [], "Globals": [ "VBLK_SIZE_HEAD" ], "Type Execution Declaration": [ "struct frag" ] }
262
linux
https://github.com/torvalds/linux
drivers/target/iscsi/iscsi_target_parameters.c
cea4dcfdad926a27a18e188720efe0f2c9403456
iscsi-target: fix heap buffer overflow on error If a key was larger than 64 bytes, as checked by iscsi_check_key(), the error response packet, generated by iscsi_add_notunderstood_response(), would still attempt to copy the entire key into the packet, overflowing the structure on the heap. Remote preauthentication ke...
true
4642feb648b7ae9c561850abea6ee158
iscsi_add_notunderstood_response
static int iscsi_add_notunderstood_response( char *key, char *value, struct iscsi_param_list *param_list) { struct iscsi_extra_response *extra_response; if (strlen(value) > VALUE_MAXLEN) { pr_err("Value for notunderstood key \"%s\" exceeds %d," " protocol error.\n", key, VALUE_MAXLEN); return -1; } extr...
[[761, "\tstrncpy(extra_response->key, key, strlen(key) + 1);\n"], [762, "\tstrncpy(extra_response->value, NOTUNDERSTOOD,\n"], [763, "\t\t\tstrlen(NOTUNDERSTOOD) + 1);\n"]]
[[761, "strncpy(extra_response->key, key, strlen(key) + 1);"], [762, "strncpy(extra_response->value, NOTUNDERSTOOD,\n\t\t\tstrlen(NOTUNDERSTOOD) + 1);"]]
[ "CVE-2013-2850" ]
[ "CWE-119" ]
263
{ "Execution Environment": [], "Explanation": null, "External Function": [], "Function Argument": [], "Globals": [ "NOTUNDERSTOOD", "VALUE_MAXLEN" ], "Type Execution Declaration": [ "struct iscsi_extra_response" ] }
263
linux
https://github.com/torvalds/linux
drivers/target/iscsi/iscsi_target_parameters.c
cea4dcfdad926a27a18e188720efe0f2c9403456
iscsi-target: fix heap buffer overflow on error If a key was larger than 64 bytes, as checked by iscsi_check_key(), the error response packet, generated by iscsi_add_notunderstood_response(), would still attempt to copy the entire key into the packet, overflowing the structure on the heap. Remote preauthentication ke...
false
7f2ed0c2ead76b7c73cd7c6927442c8f
iscsi_add_notunderstood_response
static int iscsi_add_notunderstood_response( char *key, char *value, struct iscsi_param_list *param_list) { struct iscsi_extra_response *extra_response; if (strlen(value) > VALUE_MAXLEN) { pr_err("Value for notunderstood key \"%s\" exceeds %d," " protocol error.\n", key, VALUE_MAXLEN); return -1; } extr...
[[761, "\tstrlcpy(extra_response->key, key, sizeof(extra_response->key));\n"], [762, "\tstrlcpy(extra_response->value, NOTUNDERSTOOD,\n"], [763, "\t\tsizeof(extra_response->value));\n"]]
[[761, "strlcpy(extra_response->key, key, sizeof(extra_response->key));"], [762, "strlcpy(extra_response->value, NOTUNDERSTOOD,\n\t\tsizeof(extra_response->value));"]]
[ "CVE-2013-2850" ]
[ "CWE-119" ]
263
{ "Execution Environment": [], "Explanation": null, "External Function": [], "Function Argument": [], "Globals": [ "NOTUNDERSTOOD", "VALUE_MAXLEN" ], "Type Execution Declaration": [ "struct iscsi_extra_response" ] }
264
linux
https://github.com/torvalds/linux
drivers/staging/ozwpan/ozusbsvc1.c
d114b9fe78c8d6fc6e70808c2092aa307c36dc8e
ozwpan: Use proper check to prevent heap overflow Since elt->length is a u8, we can make this variable a u8. Then we can do proper bounds checking more easily. Without this, a potentially negative value is passed to the memcpy inside oz_hcd_get_desc_cnf, resulting in a remotely exploitable heap overflow with network s...
true
736a2567d1ed7efcc845706c26370127
oz_usb_rx
void oz_usb_rx(struct oz_pd *pd, struct oz_elt *elt) { struct oz_usb_hdr *usb_hdr = (struct oz_usb_hdr *)(elt + 1); struct oz_usb_ctx *usb_ctx; spin_lock_bh(&pd->app_lock[OZ_APPID_USB]); usb_ctx = (struct oz_usb_ctx *)pd->app_ctx[OZ_APPID_USB]; if (usb_ctx) oz_usb_get(usb_ctx); spin_unlock_bh(&pd->app_lock[OZ_...
[[393, "\t\t\tint data_len = elt->length -\n"], [394, "\t\t\t\t\tsizeof(struct oz_get_desc_rsp) + 1;\n"], [395, "\t\t\tu16 offs = le16_to_cpu(get_unaligned(&body->offset));\n"], [396, "\t\t\tu16 total_size =\n"]]
[[393, "int data_len = elt->length -\n\t\t\t\t\tsizeof(struct oz_get_desc_rsp) + 1;"], [395, "u16 offs = le16_to_cpu(get_unaligned(&body->offset));"], [396, "u16 total_size =\n\t\t\t\tle16_to_cpu(get_unaligned(&body->total_size));"]]
[ "CVE-2015-4002" ]
[ "CWE-119" ]
265
{ "Execution Environment": [], "Explanation": null, "External Function": [ "le16_to_cpu", "get_unaligned", "oz_hcd_get_desc_cnf" ], "Function Argument": [], "Globals": [ "OZ_GET_DESC_RSP", "OZ_SET_CONFIG_RSP", "OZ_SET_INTERFACE_RSP", "OZ_VENDOR_CLASS_RSP", "OZ_USB_ENDPOINT_DA...
265
linux
https://github.com/torvalds/linux
drivers/staging/ozwpan/ozusbsvc1.c
d114b9fe78c8d6fc6e70808c2092aa307c36dc8e
ozwpan: Use proper check to prevent heap overflow Since elt->length is a u8, we can make this variable a u8. Then we can do proper bounds checking more easily. Without this, a potentially negative value is passed to the memcpy inside oz_hcd_get_desc_cnf, resulting in a remotely exploitable heap overflow with network s...
false
9aacfb5918a1ecb278d0a9f97dffe76d
oz_usb_rx
void oz_usb_rx(struct oz_pd *pd, struct oz_elt *elt) { struct oz_usb_hdr *usb_hdr = (struct oz_usb_hdr *)(elt + 1); struct oz_usb_ctx *usb_ctx; spin_lock_bh(&pd->app_lock[OZ_APPID_USB]); usb_ctx = (struct oz_usb_ctx *)pd->app_ctx[OZ_APPID_USB]; if (usb_ctx) oz_usb_get(usb_ctx); spin_unlock_bh(&pd->app_lock[OZ_...
[[393, "\t\t\tu16 offs, total_size;\n"], [394, "\t\t\tu8 data_len;\n"], [395, "\n"], [396, "\t\t\tif (elt->length < sizeof(struct oz_get_desc_rsp) - 1)\n"], [397, "\t\t\t\tbreak;\n"], [398, "\t\t\tdata_len = elt->length -\n"], [399, "\t\t\t\t\t(sizeof(struct oz_get_desc_rsp) - 1);\n"], [400, "\t\t\toffs = le16_to_cpu(g...
[[393, "u16 offs, total_size;"], [394, "u8 data_len;"], [395, "\n"], [396, "if (elt->length < sizeof(struct oz_get_desc_rsp) - 1)"], [397, "break;"], [398, "data_len = elt->length -\n\t\t\t\t\t(sizeof(struct oz_get_desc_rsp) - 1);"], [400, "offs = le16_to_cpu(get_unaligned(&body->offset));"], [401, "total_size =\n\t\t\...
[ "CVE-2015-4002" ]
[ "CWE-119" ]
265
{ "Execution Environment": [], "Explanation": null, "External Function": [ "le16_to_cpu", "get_unaligned", "oz_hcd_get_desc_cnf" ], "Function Argument": [], "Globals": [ "OZ_GET_DESC_RSP", "OZ_SET_CONFIG_RSP", "OZ_SET_INTERFACE_RSP", "OZ_VENDOR_CLASS_RSP", "OZ_USB_ENDPOINT_DA...
266
linux
https://github.com/torvalds/linux
sound/core/seq/seq_clientmgr.c
d15d662e89fc667b90cd294b0eb45694e33144da
ALSA: seq: Fix racy pool initializations ALSA sequencer core initializes the event pool on demand by invoking snd_seq_pool_init() when the first write happens and the pool is empty. Meanwhile user can reset the pool size manually via ioctl concurrently, and this may lead to UAF or out-of-bound accesses since the func...
true
3195a996bc96da0163777f9be20b1ab2
snd_seq_write
static ssize_t snd_seq_write(struct file *file, const char __user *buf, size_t count, loff_t *offset) { struct snd_seq_client *client = file->private_data; int written = 0, len; int err = -EINVAL; struct snd_seq_event event; if (!(snd_seq_file_flags(file) & SNDRV_SEQ_LFLG_OUTPUT)) return -ENXIO; /* ch...
[[1006, "\tint err = -EINVAL;\n"], [1021, "\t\tif (snd_seq_pool_init(client->pool) < 0)\n"]]
[[1006, "int err = -EINVAL;"], [1021, "if (snd_seq_pool_init(client->pool) < 0)"]]
[ "CVE-2018-7566" ]
[ "CWE-362", "CWE-119" ]
267
{ "Execution Environment": [], "Explanation": null, "External Function": [ "snd_seq_pool_init", "snd_seq_write_pool_allocated" ], "Function Argument": [], "Globals": [], "Type Execution Declaration": [ "struct snd_seq_client", "struct snd_seq_client *client" ] }
267
linux
https://github.com/torvalds/linux
sound/core/seq/seq_clientmgr.c
d15d662e89fc667b90cd294b0eb45694e33144da
ALSA: seq: Fix racy pool initializations ALSA sequencer core initializes the event pool on demand by invoking snd_seq_pool_init() when the first write happens and the pool is empty. Meanwhile user can reset the pool size manually via ioctl concurrently, and this may lead to UAF or out-of-bound accesses since the func...
false
d07061570dfa7835cfe1e0198a57ba9c
snd_seq_write
static ssize_t snd_seq_write(struct file *file, const char __user *buf, size_t count, loff_t *offset) { struct snd_seq_client *client = file->private_data; int written = 0, len; int err; struct snd_seq_event event; if (!(snd_seq_file_flags(file) & SNDRV_SEQ_LFLG_OUTPUT)) return -ENXIO; /* check client...
[[1006, "\tint err;\n"], [1021, "\t\tmutex_lock(&client->ioctl_mutex);\n"], [1022, "\t\terr = snd_seq_pool_init(client->pool);\n"], [1023, "\t\tmutex_unlock(&client->ioctl_mutex);\n"], [1024, "\t\tif (err < 0)\n"], [1029, "\terr = -EINVAL;\n"]]
[[1006, "int err;"], [1021, "mutex_lock(&client->ioctl_mutex);"], [1022, "err = snd_seq_pool_init(client->pool);"], [1023, "mutex_unlock(&client->ioctl_mutex);"], [1024, "if (err < 0)"], [1029, "err = -EINVAL;"]]
[ "CVE-2018-7566" ]
[ "CWE-362", "CWE-119" ]
267
{ "Execution Environment": [], "Explanation": null, "External Function": [ "snd_seq_pool_init", "snd_seq_write_pool_allocated" ], "Function Argument": [], "Globals": [], "Type Execution Declaration": [ "struct snd_seq_client", "struct snd_seq_client *client" ] }
268
linux
https://github.com/torvalds/linux
fs/nilfs2/inode.c
d325dc6eb763c10f591c239550b8c7e5466a5d09
nilfs2: fix use-after-free bug of struct nilfs_root If the beginning of the inode bitmap area is corrupted on disk, an inode with the same inode number as the root inode can be allocated and fail soon after. In this case, the subsequent call to nilfs_clear_inode() on that bogus root inode will wrongly decrement the r...
true
564d7cee70b884c94011ad365eb1a45c
nilfs_new_inode
struct inode *nilfs_new_inode(struct inode *dir, umode_t mode) { struct super_block *sb = dir->i_sb; struct the_nilfs *nilfs = sb->s_fs_info; struct inode *inode; struct nilfs_inode_info *ii; struct nilfs_root *root; int err = -ENOMEM; ino_t ino; inode = new_inode(sb); if (unlikely(!inode)) goto failed; m...
[[346, "\terr = nilfs_ifile_create_inode(root->ifile, &ino, &ii->i_bh);\n"]]
[[346, "err = nilfs_ifile_create_inode(root->ifile, &ino, &ii->i_bh);"]]
[ "CVE-2022-3649" ]
[ "CWE-416", "CWE-119" ]
269
{ "Execution Environment": [], "Explanation": null, "External Function": [ "nilfs_ifile_create_inode" ], "Function Argument": [ "dir" ], "Globals": [ "NILFS_USER_INO" ], "Type Execution Declaration": [ "struct the_nilfs", "struct nilfs_inode_info", "struct nilfs_root", "str...
269
linux
https://github.com/torvalds/linux
fs/nilfs2/inode.c
d325dc6eb763c10f591c239550b8c7e5466a5d09
nilfs2: fix use-after-free bug of struct nilfs_root If the beginning of the inode bitmap area is corrupted on disk, an inode with the same inode number as the root inode can be allocated and fail soon after. In this case, the subsequent call to nilfs_clear_inode() on that bogus root inode will wrongly decrement the r...
false
3a881c5ea74ff8347e5e8535f43a0f27
nilfs_new_inode
struct inode *nilfs_new_inode(struct inode *dir, umode_t mode) { struct super_block *sb = dir->i_sb; struct the_nilfs *nilfs = sb->s_fs_info; struct inode *inode; struct nilfs_inode_info *ii; struct nilfs_root *root; struct buffer_head *bh; int err = -ENOMEM; ino_t ino; inode = new_inode(sb); if (unlikely(!i...
[[331, "\tstruct buffer_head *bh;\n"], [347, "\terr = nilfs_ifile_create_inode(root->ifile, &ino, &bh);\n"], [352, "\tif (unlikely(ino < NILFS_USER_INO)) {\n"], [353, "\t\tnilfs_warn(sb,\n"], [354, "\t\t\t \"inode bitmap is inconsistent for reserved inodes\");\n"], [355, "\t\tdo {\n"], [356, "\t\t\tbrelse(bh);\n"], [...
[[331, "struct buffer_head *bh;"], [347, "err = nilfs_ifile_create_inode(root->ifile, &ino, &bh);"], [352, "if (unlikely(ino < NILFS_USER_INO))"], [353, "nilfs_warn(sb,\n\t\t\t \"inode bitmap is inconsistent for reserved inodes\");"], [355, "do {"], [356, "brelse(bh);"], [357, "err = nilfs_ifile_create_inode(root->if...
[ "CVE-2022-3649" ]
[ "CWE-416", "CWE-119" ]
269
{ "Execution Environment": [], "Explanation": null, "External Function": [ "nilfs_ifile_create_inode" ], "Function Argument": [ "dir" ], "Globals": [ "NILFS_USER_INO" ], "Type Execution Declaration": [ "struct the_nilfs", "struct nilfs_inode_info", "struct nilfs_root", "str...
270
linux
https://github.com/torvalds/linux
net/irda/iriap.c
d370af0ef7951188daeb15bae75db7ba57c67846
irda: validate peer name and attribute lengths Length fields provided by a peer for names and attributes may be longer than the destination array sizes. Validate lengths to prevent stack buffer overflows. Signed-off-by: Dan Rosenberg <drosenberg@vsecurity.com> Cc: stable@kernel.org Signed-off-by: David S. Miller <da...
true
128f6f09adc04aa85dc8dcdd0d240e85
iriap_getvaluebyclass_indication
static void iriap_getvaluebyclass_indication(struct iriap_cb *self, struct sk_buff *skb) { struct ias_object *obj; struct ias_attrib *attrib; int name_len; int attr_len; char name[IAS_MAX_CLASSNAME + 1]; /* 60 bytes */ char attr[IAS_MAX_ATTRIBNAME + 1]; /* 60 bytes */ __u8 *fp; int n; IRDA_DEBUG(4, ...
[]
[]
[ "CVE-2011-1180" ]
[ "CWE-787" ]
271
{ "Execution Environment": [], "Explanation": null, "External Function": [], "Function Argument": [], "Globals": [], "Type Execution Declaration": [ "IAS_MAX_CLASSNAME", "IAS_MAX_ATTRIBNAME" ] }
271
linux
https://github.com/torvalds/linux
net/irda/iriap.c
d370af0ef7951188daeb15bae75db7ba57c67846
irda: validate peer name and attribute lengths Length fields provided by a peer for names and attributes may be longer than the destination array sizes. Validate lengths to prevent stack buffer overflows. Signed-off-by: Dan Rosenberg <drosenberg@vsecurity.com> Cc: stable@kernel.org Signed-off-by: David S. Miller <da...
false
ac55d8e46e48d0f54a71ae06f76750af
iriap_getvaluebyclass_indication
static void iriap_getvaluebyclass_indication(struct iriap_cb *self, struct sk_buff *skb) { struct ias_object *obj; struct ias_attrib *attrib; int name_len; int attr_len; char name[IAS_MAX_CLASSNAME + 1]; /* 60 bytes */ char attr[IAS_MAX_ATTRIBNAME + 1]; /* 60 bytes */ __u8 *fp; int n; IRDA_DEBUG(4, ...
[[659, "\n"], [660, "\tIRDA_ASSERT(name_len < IAS_MAX_CLASSNAME + 1, return;);\n"], [661, "\n"], [666, "\n"], [667, "\tIRDA_ASSERT(attr_len < IAS_MAX_ATTRIBNAME + 1, return;);\n"], [668, "\n"]]
[[659, "\n"], [660, "IRDA_ASSERT(name_len < IAS_MAX_CLASSNAME + 1, return;);"], [661, "\n"], [666, "\n"], [667, "IRDA_ASSERT(attr_len < IAS_MAX_ATTRIBNAME + 1, return;);"], [668, "\n"]]
[ "CVE-2011-1180" ]
[ "CWE-787" ]
271
{ "Execution Environment": [], "Explanation": null, "External Function": [], "Function Argument": [], "Globals": [], "Type Execution Declaration": [ "IAS_MAX_CLASSNAME", "IAS_MAX_ATTRIBNAME" ] }
272
linux
https://github.com/torvalds/linux
sound/usb/mixer.c
daac07156b330b18eb5071aec4b3ddca1c377f2c
ALSA: usb-audio: Fix an OOB bug in parse_audio_mixer_unit The `uac_mixer_unit_descriptor` shown as below is read from the device side. In `parse_audio_mixer_unit`, `baSourceID` field is accessed from index 0 to `bNrInPins` - 1, the current implementation assumes that descriptor is always valid (the length of descript...
true
8cb248595588db5199ba3908c4afda23
uac_mixer_unit_get_channels
static int uac_mixer_unit_get_channels(struct mixer_build *state, struct uac_mixer_unit_descriptor *desc) { int mu_channels; void *c; if (desc->bLength < sizeof(*desc)) return -EINVAL; if (!desc->bNrInPins) return -EINVAL; switch (state->mixer->protocol) { case UAC_VERSION_1: case UAC_VERSION_2:...
[]
[]
[ "CVE-2019-15117" ]
[ "CWE-119" ]
273
{ "Execution Environment": [], "Explanation": null, "External Function": [ "uac_mixer_unit_bNrChannels", "get_cluster_channels_v3", "uac3_mixer_unit_wClusterDescrID", "uac_mixer_unit_bmControls" ], "Function Argument": [ "state", "desc" ], "Globals": [], "Type Execution Declarati...
273
linux
https://github.com/torvalds/linux
sound/usb/mixer.c
daac07156b330b18eb5071aec4b3ddca1c377f2c
ALSA: usb-audio: Fix an OOB bug in parse_audio_mixer_unit The `uac_mixer_unit_descriptor` shown as below is read from the device side. In `parse_audio_mixer_unit`, `baSourceID` field is accessed from index 0 to `bNrInPins` - 1, the current implementation assumes that descriptor is always valid (the length of descript...
false
e7382f6ce448cda02ad4eeef7f23863e
uac_mixer_unit_get_channels
static int uac_mixer_unit_get_channels(struct mixer_build *state, struct uac_mixer_unit_descriptor *desc) { int mu_channels; void *c; if (desc->bLength < sizeof(*desc)) return -EINVAL; if (!desc->bNrInPins) return -EINVAL; if (desc->bLength < sizeof(*desc) + desc->bNrInPins) return -EINVAL; swi...
[[747, "\tif (desc->bLength < sizeof(*desc) + desc->bNrInPins)\n"], [748, "\t\treturn -EINVAL;\n"]]
[[747, "if (desc->bLength < sizeof(*desc) + desc->bNrInPins)"], [748, "return -EINVAL;"]]
[ "CVE-2019-15117" ]
[ "CWE-119" ]
273
{ "Execution Environment": [], "Explanation": null, "External Function": [ "uac_mixer_unit_bNrChannels", "get_cluster_channels_v3", "uac3_mixer_unit_wClusterDescrID", "uac_mixer_unit_bmControls" ], "Function Argument": [ "state", "desc" ], "Globals": [], "Type Execution Declarati...
274
linux
https://github.com/torvalds/linux
fs/f2fs/extent_cache.c
dad48e73127ba10279ea33e6dbc8d3905c4d31c0
f2fs: fix a bug caused by NULL extent tree Thread A: Thread B: -f2fs_remount -sbi->mount_opt.opt = 0; <--- -f2fs_iget -do_read_inode -f2fs_init_extent_tree -F2FS_I(inode)->extent_tree is NULL -default_options && parse_options -remount return ...
true
71521b5c0617487ad9a6ccf53f3d5a66
f2fs_init_extent_tree
bool f2fs_init_extent_tree(struct inode *inode, struct f2fs_extent *i_ext) { struct f2fs_sb_info *sbi = F2FS_I_SB(inode); struct extent_tree *et; struct extent_node *en; struct extent_info ei; if (!f2fs_may_extent_tree(inode)) { /* drop largest extent */ if (i_ext && i_ext->len) { i_ext->len = 0; return...
[[323, "bool f2fs_init_extent_tree(struct inode *inode, struct f2fs_extent *i_ext)\n"]]
[[323, "bool f2fs_init_extent_tree(struct inode *inode, struct f2fs_extent *i_ext)"]]
[ "CVE-2017-18193" ]
[ "CWE-119" ]
275
{ "Execution Environment": [], "Explanation": null, "External Function": [ "F2FS_I_SB", "f2fs_may_extent_tree", "__grab_extent_tree", "get_extent_info", "__init_extent_tree" ], "Function Argument": [], "Globals": [], "Type Execution Declaration": [ "struct inode", "struct f2fs_...
275
linux
https://github.com/torvalds/linux
fs/f2fs/extent_cache.c
dad48e73127ba10279ea33e6dbc8d3905c4d31c0
f2fs: fix a bug caused by NULL extent tree Thread A: Thread B: -f2fs_remount -sbi->mount_opt.opt = 0; <--- -f2fs_iget -do_read_inode -f2fs_init_extent_tree -F2FS_I(inode)->extent_tree is NULL -default_options && parse_options -remount return ...
false
db5a36a9d1a70b6f8f750de101fbae27
f2fs_init_extent_tree
bool f2fs_init_extent_tree(struct inode *inode, struct f2fs_extent *i_ext) { bool ret = __f2fs_init_extent_tree(inode, i_ext); if (!F2FS_I(inode)->extent_tree) set_inode_flag(inode, FI_NO_EXTENT); return ret; }
[[361, "bool f2fs_init_extent_tree(struct inode *inode, struct f2fs_extent *i_ext)\n"], [362, "{\n"], [363, "\tbool ret = __f2fs_init_extent_tree(inode, i_ext);\n"], [364, "\n"], [365, "\tif (!F2FS_I(inode)->extent_tree)\n"], [366, "\t\tset_inode_flag(inode, FI_NO_EXTENT);\n"], [367, "\n"], [368, "\treturn ret;\n"], [...
[[361, "bool f2fs_init_extent_tree(struct inode *inode, struct f2fs_extent *i_ext)"], [362, "{\n"], [363, "bool ret = __f2fs_init_extent_tree(inode, i_ext);"], [364, "\n"], [365, "if (!F2FS_I(inode)->extent_tree)"], [366, "set_inode_flag(inode, FI_NO_EXTENT);"], [367, "\n"], [368, "return ret;"], [369, "}\n"]]
[ "CVE-2017-18193" ]
[ "CWE-119" ]
275
{ "Execution Environment": [], "Explanation": null, "External Function": [ "F2FS_I_SB", "f2fs_may_extent_tree", "__grab_extent_tree", "get_extent_info", "__init_extent_tree" ], "Function Argument": [], "Globals": [], "Type Execution Declaration": [ "struct inode", "struct f2fs_...
276
linux
https://github.com/torvalds/linux
drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
ded89912156b1a47d940a0c954c43afbabd0c42c
brcmfmac: avoid potential stack overflow in brcmf_cfg80211_start_ap() User-space can choose to omit NL80211_ATTR_SSID and only provide raw IE TLV data. When doing so it can provide SSID IE with length exceeding the allowed size. The driver further processes this IE copying it into a local variable without checking the...
true
0fa6c5342d173fa660210419d72b47fa
brcmf_cfg80211_start_ap
static s32 brcmf_cfg80211_start_ap(struct wiphy *wiphy, struct net_device *ndev, struct cfg80211_ap_settings *settings) { s32 ie_offset; struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy); struct brcmf_if *ifp = netdev_priv(ndev); const struct brcmf_tlv *ssid_ie; const struct brcmf_tlv *country_ie; struct b...
[[4530, "\t\tif (!ssid_ie)\n"]]
[[4530, "if (!ssid_ie)"]]
[ "CVE-2016-8658" ]
[ "CWE-119" ]
277
{ "Execution Environment": [], "Explanation": null, "External Function": [ "brcmf_parse_tlvs" ], "Function Argument": [], "Globals": [ "IEEE80211_MAX_SSID_LEN" ], "Type Execution Declaration": [] }
277
linux
https://github.com/torvalds/linux
drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
ded89912156b1a47d940a0c954c43afbabd0c42c
brcmfmac: avoid potential stack overflow in brcmf_cfg80211_start_ap() User-space can choose to omit NL80211_ATTR_SSID and only provide raw IE TLV data. When doing so it can provide SSID IE with length exceeding the allowed size. The driver further processes this IE copying it into a local variable without checking the...
false
a599ab6e61bc231ee33e3121065ee53a
brcmf_cfg80211_start_ap
static s32 brcmf_cfg80211_start_ap(struct wiphy *wiphy, struct net_device *ndev, struct cfg80211_ap_settings *settings) { s32 ie_offset; struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy); struct brcmf_if *ifp = netdev_priv(ndev); const struct brcmf_tlv *ssid_ie; const struct brcmf_tlv *country_ie; struct b...
[[4530, "\t\tif (!ssid_ie || ssid_ie->len > IEEE80211_MAX_SSID_LEN)\n"]]
[[4530, "if (!ssid_ie || ssid_ie->len > IEEE80211_MAX_SSID_LEN)"]]
[ "CVE-2016-8658" ]
[ "CWE-119" ]
277
{ "Execution Environment": [], "Explanation": null, "External Function": [ "brcmf_parse_tlvs" ], "Function Argument": [], "Globals": [ "IEEE80211_MAX_SSID_LEN" ], "Type Execution Declaration": [] }
278
linux
https://github.com/torvalds/linux
drivers/firmware/arm_scmi/reset.c
e9076ffbcaed5da6c182b144ef9f6e24554af268
firmware: arm_scmi: Harden accesses to the reset domains Accessing reset domains descriptors by the index upon the SCMI drivers requests through the SCMI reset operations interface can potentially lead to out-of-bound violations if the SCMI driver misbehave. Add an internal consistency check before any such domains d...
true
8268367e635c30d276c9252f3b56324a
scmi_domain_reset
static int scmi_domain_reset(const struct scmi_protocol_handle *ph, u32 domain, u32 flags, u32 state) { int ret; struct scmi_xfer *t; struct scmi_msg_reset_domain_reset *dom; struct scmi_reset_info *pi = ph->get_priv(ph); struct reset_dom_info *rdom = pi->dom_info + domain; if (rdom->async_reset) flags...
[[169, "\tstruct reset_dom_info *rdom = pi->dom_info + domain;\n"]]
[[169, "struct reset_dom_info *rdom = pi->dom_info + domain;"]]
[ "CVE-2022-48655" ]
[ "CWE-125", "CWE-119" ]
279
{ "Execution Environment": [], "Explanation": null, "External Function": [ "ph->get_priv" ], "Function Argument": [ "ph", "domain" ], "Globals": [], "Type Execution Declaration": [] }
279
linux
https://github.com/torvalds/linux
drivers/firmware/arm_scmi/reset.c
e9076ffbcaed5da6c182b144ef9f6e24554af268
firmware: arm_scmi: Harden accesses to the reset domains Accessing reset domains descriptors by the index upon the SCMI drivers requests through the SCMI reset operations interface can potentially lead to out-of-bound violations if the SCMI driver misbehave. Add an internal consistency check before any such domains d...
false
453e1dc5a4c4fac8584327ad092784e6
scmi_domain_reset
static int scmi_domain_reset(const struct scmi_protocol_handle *ph, u32 domain, u32 flags, u32 state) { int ret; struct scmi_xfer *t; struct scmi_msg_reset_domain_reset *dom; struct scmi_reset_info *pi = ph->get_priv(ph); struct reset_dom_info *rdom; if (domain >= pi->num_domains) return -EINVAL; rdo...
[[169, "\tstruct reset_dom_info *rdom;\n"], [171, "\tif (domain >= pi->num_domains)\n"], [172, "\t\treturn -EINVAL;\n"], [173, "\n"], [174, "\trdom = pi->dom_info + domain;\n"]]
[[169, "struct reset_dom_info *rdom;"], [171, "if (domain >= pi->num_domains)"], [172, "return -EINVAL;"], [173, "\n"], [174, "rdom = pi->dom_info + domain;"]]
[ "CVE-2022-48655" ]
[ "CWE-125", "CWE-119" ]
279
{ "Execution Environment": [], "Explanation": null, "External Function": [ "ph->get_priv" ], "Function Argument": [ "ph", "domain" ], "Globals": [], "Type Execution Declaration": [] }
280
linux
https://github.com/torvalds/linux
kernel/bpf/verifier.c
ea25f914dc164c8d56b36147ecc86bc65f83c469
bpf: fix missing error return in check_stack_boundary() Prevent indirect stack accesses at non-constant addresses, which would permit reading and corrupting spilled pointers. Fixes: f1174f77b50c ("bpf/verifier: rework value tracking") Signed-off-by: Jann Horn <jannh@google.com> Signed-off-by: Alexei Starovoitov <ast@...
true
d2c8363ea72d3e2b1e0bbcadb6fafd6f
check_stack_boundary
static int check_stack_boundary(struct bpf_verifier_env *env, int regno, int access_size, bool zero_size_allowed, struct bpf_call_arg_meta *meta) { struct bpf_verifier_state *state = env->cur_state; struct bpf_reg_state *regs = state->regs; int off, i, slot, spi; if (regs[regno].type != PTR_TO_STACK) { /...
[]
[]
[ "CVE-2017-17857" ]
[ "CWE-119" ]
281
{ "Execution Environment": [], "Explanation": null, "External Function": [], "Function Argument": [], "Globals": [ "MAX_BPF_STACK", "BPF_REG_SIZE", "STACK_MISC" ], "Type Execution Declaration": [ "tnum_is_const" ] }
281
linux
https://github.com/torvalds/linux
kernel/bpf/verifier.c
ea25f914dc164c8d56b36147ecc86bc65f83c469
bpf: fix missing error return in check_stack_boundary() Prevent indirect stack accesses at non-constant addresses, which would permit reading and corrupting spilled pointers. Fixes: f1174f77b50c ("bpf/verifier: rework value tracking") Signed-off-by: Jann Horn <jannh@google.com> Signed-off-by: Alexei Starovoitov <ast@...
false
f9b89f429be2bedd9cae4c372c03d51d
check_stack_boundary
static int check_stack_boundary(struct bpf_verifier_env *env, int regno, int access_size, bool zero_size_allowed, struct bpf_call_arg_meta *meta) { struct bpf_verifier_state *state = env->cur_state; struct bpf_reg_state *regs = state->regs; int off, i, slot, spi; if (regs[regno].type != PTR_TO_STACK) { /...
[[1306, "\t\treturn -EACCES;\n"]]
[[1306, "return -EACCES;"]]
[ "CVE-2017-17857" ]
[ "CWE-119" ]
281
{ "Execution Environment": [], "Explanation": null, "External Function": [], "Function Argument": [], "Globals": [ "MAX_BPF_STACK", "BPF_REG_SIZE", "STACK_MISC" ], "Type Execution Declaration": [ "tnum_is_const" ] }
282
linux
https://github.com/torvalds/linux
net/packet/af_packet.c
edbd58be15a957f6a760c4a514cd475217eb97fd
packet: Don't write vnet header beyond end of buffer ... which may happen with certain values of tp_reserve and maclen. Fixes: 58d19b19cd99 ("packet: vnet_hdr support for tpacket_rcv") Signed-off-by: Benjamin Poirier <bpoirier@suse.com> Cc: Willem de Bruijn <willemb@google.com> Acked-by: Willem de Bruijn <willemb@goo...
true
6bfca3c7e2cc37d40126962e05a85677
tpacket_rcv
static int tpacket_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt, struct net_device *orig_dev) { struct sock *sk; struct packet_sock *po; struct sockaddr_ll *sll; union tpacket_uhdr h; u8 *skb_head = skb->data; int skb_len = skb->len; unsigned int snaplen, res; unsigned long s...
[[2244, "\t\tif (po->has_vnet_hdr)\n"], [2262, "\t\t\tif ((int)snaplen < 0)\n"], [2301, "\tif (po->has_vnet_hdr) {\n"]]
[[2244, "if (po->has_vnet_hdr)"], [2262, "if ((int)snaplen < 0)"], [2301, "if (po->has_vnet_hdr)"]]
[ "CVE-2017-14497" ]
[ "CWE-119" ]
283
{ "Execution Environment": [], "Explanation": null, "External Function": [ "GET_PBDQC_FROM_RB" ], "Function Argument": [], "Globals": [], "Type Execution Declaration": [] }
283
linux
https://github.com/torvalds/linux
net/packet/af_packet.c
edbd58be15a957f6a760c4a514cd475217eb97fd
packet: Don't write vnet header beyond end of buffer ... which may happen with certain values of tp_reserve and maclen. Fixes: 58d19b19cd99 ("packet: vnet_hdr support for tpacket_rcv") Signed-off-by: Benjamin Poirier <bpoirier@suse.com> Cc: Willem de Bruijn <willemb@google.com> Acked-by: Willem de Bruijn <willemb@goo...
false
1ced63ed3952f80896b4ef341ed6861d
tpacket_rcv
static int tpacket_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt, struct net_device *orig_dev) { struct sock *sk; struct packet_sock *po; struct sockaddr_ll *sll; union tpacket_uhdr h; u8 *skb_head = skb->data; int skb_len = skb->len; unsigned int snaplen, res; unsigned long s...
[[2194, "\tbool do_vnet = false;\n"], [2245, "\t\tif (po->has_vnet_hdr) {\n"], [2247, "\t\t\tdo_vnet = true;\n"], [2248, "\t\t}\n"], [2265, "\t\t\tif ((int)snaplen < 0) {\n"], [2267, "\t\t\t\tdo_vnet = false;\n"], [2268, "\t\t\t}\n"], [2281, "\t\t\tdo_vnet = false;\n"], [2307, "\tif (do_vnet) {\n"]]
[[2194, "bool do_vnet = false;"], [2245, "if (po->has_vnet_hdr)"], [2247, "do_vnet = true;"], [2248, "\t\t}\n"], [2265, "if ((int)snaplen < 0)"], [2267, "do_vnet = false;"], [2268, "\t\t\t}\n"], [2281, "do_vnet = false;"], [2307, "if (do_vnet)"]]
[ "CVE-2017-14497" ]
[ "CWE-119" ]
283
{ "Execution Environment": [], "Explanation": null, "External Function": [ "GET_PBDQC_FROM_RB" ], "Function Argument": [], "Globals": [], "Type Execution Declaration": [] }
284
linux
https://github.com/torvalds/linux
arch/x86/kvm/i8254.c
ee73f656a604d5aa9df86a97102e4e462dd79924
KVM: PIT: control word is write-only PIT control word (address 0x43) is write-only, reads are undefined. Cc: stable@kernel.org Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
true
53b792883056135abdb0ed885459bab7
pit_ioport_read
static int pit_ioport_read(struct kvm_io_device *this, gpa_t addr, int len, void *data) { struct kvm_pit *pit = dev_to_pit(this); struct kvm_kpit_state *pit_state = &pit->pit_state; struct kvm *kvm = pit->kvm; int ret, count; struct kvm_kpit_channel_state *s; if (!pit_in_range(addr)) return -EOPNOTSUPP; ...
[]
[]
[ "CVE-2015-3214" ]
[ "CWE-119" ]
285
{ "Execution Environment": [], "Explanation": null, "External Function": [ "pit_in_range", "dev_to_pit", "pit_get_count" ], "Function Argument": [ "addr" ], "Globals": [ "KVM_PIT_CHANNEL_MASK" ], "Type Execution Declaration": [ "struct kvm_io_device", "struct kvm_pit", ...
285
linux
https://github.com/torvalds/linux
arch/x86/kvm/i8254.c
ee73f656a604d5aa9df86a97102e4e462dd79924
KVM: PIT: control word is write-only PIT control word (address 0x43) is write-only, reads are undefined. Cc: stable@kernel.org Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
false
54e80d302c611b6957dd31df346c55ab
pit_ioport_read
static int pit_ioport_read(struct kvm_io_device *this, gpa_t addr, int len, void *data) { struct kvm_pit *pit = dev_to_pit(this); struct kvm_kpit_state *pit_state = &pit->pit_state; struct kvm *kvm = pit->kvm; int ret, count; struct kvm_kpit_channel_state *s; if (!pit_in_range(addr)) return -EOPNOTSUPP; ...
[[470, "\tif (addr == 3)\n"], [471, "\t\treturn 0;\n"], [472, "\n"]]
[[470, "if (addr == 3)"], [471, "return 0;"], [472, "\n"]]
[ "CVE-2015-3214" ]
[ "CWE-119" ]
285
{ "Execution Environment": [], "Explanation": null, "External Function": [ "pit_in_range", "dev_to_pit", "pit_get_count" ], "Function Argument": [ "addr" ], "Globals": [ "KVM_PIT_CHANNEL_MASK" ], "Type Execution Declaration": [ "struct kvm_io_device", "struct kvm_pit", ...
286
linux
https://github.com/torvalds/linux
drivers/media/usb/ttusb-dec/ttusbdecfe.c
f2e323ec96077642d397bb1c355def536d489d16
[media] ttusb-dec: buffer overflow in ioctl We need to add a limit check here so we don't overflow the buffer. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
true
a1a750b6efcc04a55e1b271e6f87bdb3
ttusbdecfe_dvbs_diseqc_send_master_cmd
static int ttusbdecfe_dvbs_diseqc_send_master_cmd(struct dvb_frontend* fe, struct dvb_diseqc_master_cmd *cmd) { struct ttusbdecfe_state* state = (struct ttusbdecfe_state*) fe->demodulator_priv; u8 b[] = { 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; memcpy(&b[4], cmd->msg, cmd->msg_len); ...
[]
[]
[ "CVE-2014-8884" ]
[ "CWE-119" ]
287
{ "Execution Environment": [], "Explanation": null, "External Function": [], "Function Argument": [ "cmd" ], "Globals": [], "Type Execution Declaration": [] }
287
linux
https://github.com/torvalds/linux
drivers/media/usb/ttusb-dec/ttusbdecfe.c
f2e323ec96077642d397bb1c355def536d489d16
[media] ttusb-dec: buffer overflow in ioctl We need to add a limit check here so we don't overflow the buffer. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
false
21adca1dc739dde9e05ebfd346920d49
ttusbdecfe_dvbs_diseqc_send_master_cmd
static int ttusbdecfe_dvbs_diseqc_send_master_cmd(struct dvb_frontend* fe, struct dvb_diseqc_master_cmd *cmd) { struct ttusbdecfe_state* state = (struct ttusbdecfe_state*) fe->demodulator_priv; u8 b[] = { 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; if (cmd->msg_len > sizeof(b) - 4) ret...
[[159, "\tif (cmd->msg_len > sizeof(b) - 4)\n"], [160, "\t\treturn -EINVAL;\n"], [161, "\n"]]
[[159, "if (cmd->msg_len > sizeof(b) - 4)"], [160, "return -EINVAL;"], [161, "\n"]]
[ "CVE-2014-8884" ]
[ "CWE-119" ]
287
{ "Execution Environment": [], "Explanation": null, "External Function": [], "Function Argument": [ "cmd" ], "Globals": [], "Type Execution Declaration": [] }
288
linux
https://github.com/torvalds/linux
fs/ecryptfs/kthread.c
f5364c150aa645b3d7daa21b5c0b9feaa1c9cd6d
Merge branch 'stacking-fixes' (vfs stacking fixes from Jann) Merge filesystem stacking fixes from Jann Horn. * emailed patches from Jann Horn <jannh@google.com>: sched: panic on corrupted stack end ecryptfs: forbid opening files without mmap handler proc: prevent stacking filesystems on top
true
e8223d6665aab6cf577a26401e01f906
ecryptfs_privileged_open
int ecryptfs_privileged_open(struct file **lower_file, struct dentry *lower_dentry, struct vfsmount *lower_mnt, const struct cred *cred) { struct ecryptfs_open_req req; int flags = O_LARGEFILE; int rc = 0; init_completion(&req.done); req.lower_file = lower_file; req.path.dentry = lower_de...
[[150, "\t\tgoto out;\n"], [168, "\tif (IS_ERR(*lower_file))\n"]]
[[150, "goto out;"], [168, "if (IS_ERR(*lower_file))"]]
[ "CVE-2016-1583" ]
[ "CWE-119" ]
289
{ "Execution Environment": [], "Explanation": null, "External Function": [ "dentry_open" ], "Function Argument": [], "Globals": [ "ecryptfs_kthread_ctl" ], "Type Execution Declaration": [] }
289
linux
https://github.com/torvalds/linux
fs/ecryptfs/kthread.c
f5364c150aa645b3d7daa21b5c0b9feaa1c9cd6d
Merge branch 'stacking-fixes' (vfs stacking fixes from Jann) Merge filesystem stacking fixes from Jann Horn. * emailed patches from Jann Horn <jannh@google.com>: sched: panic on corrupted stack end ecryptfs: forbid opening files without mmap handler proc: prevent stacking filesystems on top
false
291dac9b00cbf8f17d06f58817cdf480
ecryptfs_privileged_open
int ecryptfs_privileged_open(struct file **lower_file, struct dentry *lower_dentry, struct vfsmount *lower_mnt, const struct cred *cred) { struct ecryptfs_open_req req; int flags = O_LARGEFILE; int rc = 0; init_completion(&req.done); req.lower_file = lower_file; req.path.dentry = lower_de...
[[151, "\t\tgoto have_file;\n"], [169, "\tif (IS_ERR(*lower_file)) {\n"], [171, "\t\tgoto out;\n"], [172, "\t}\n"], [173, "have_file:\n"], [174, "\tif ((*lower_file)->f_op->mmap == NULL) {\n"], [175, "\t\tfput(*lower_file);\n"], [176, "\t\t*lower_file = NULL;\n"], [177, "\t\trc = -EMEDIUMTYPE;\n"], [178, "\t}\n"]]
[[151, "goto have_file;"], [169, "if (IS_ERR(*lower_file))"], [171, "goto out;"], [172, "\t}\n"], [173, "have_file:"], [174, "if ((*lower_file)->f_op->mmap == NULL)"], [175, "fput(*lower_file);"], [176, "*lower_file = NULL;"], [177, "rc = -EMEDIUMTYPE;"], [178, "\t}\n"]]
[ "CVE-2016-1583" ]
[ "CWE-119" ]
289
{ "Execution Environment": [], "Explanation": null, "External Function": [ "dentry_open" ], "Function Argument": [], "Globals": [ "ecryptfs_kthread_ctl" ], "Type Execution Declaration": [] }
290
linux
https://github.com/torvalds/linux
fs/proc/root.c
f5364c150aa645b3d7daa21b5c0b9feaa1c9cd6d
Merge branch 'stacking-fixes' (vfs stacking fixes from Jann) Merge filesystem stacking fixes from Jann Horn. * emailed patches from Jann Horn <jannh@google.com>: sched: panic on corrupted stack end ecryptfs: forbid opening files without mmap handler proc: prevent stacking filesystems on top
true
e3f2ebbfd8becd4d42db7db9c2095d26
proc_mount
static struct dentry *proc_mount(struct file_system_type *fs_type, int flags, const char *dev_name, void *data) { int err; struct super_block *sb; struct pid_namespace *ns; char *options; if (flags & MS_KERNMOUNT) { ns = (struct pid_namespace *)data; options = NULL; } else { ns = task_active_pid_ns(curren...
[]
[]
[ "CVE-2016-1583" ]
[ "CWE-119" ]
291
{ "Execution Environment": [], "Explanation": null, "External Function": [], "Function Argument": [ "flags" ], "Globals": [ "MS_KERNMOUNT", "FILESYSTEM_MAX_STACK_DEPTH" ], "Type Execution Declaration": [] }
291
linux
https://github.com/torvalds/linux
fs/proc/root.c
f5364c150aa645b3d7daa21b5c0b9feaa1c9cd6d
Merge branch 'stacking-fixes' (vfs stacking fixes from Jann) Merge filesystem stacking fixes from Jann Horn. * emailed patches from Jann Horn <jannh@google.com>: sched: panic on corrupted stack end ecryptfs: forbid opening files without mmap handler proc: prevent stacking filesystems on top
false
c362503008527f8499a5b98829eacf73
proc_mount
static struct dentry *proc_mount(struct file_system_type *fs_type, int flags, const char *dev_name, void *data) { int err; struct super_block *sb; struct pid_namespace *ns; char *options; if (flags & MS_KERNMOUNT) { ns = (struct pid_namespace *)data; options = NULL; } else { ns = task_active_pid_ns(curren...
[[124, "\t/*\n"], [125, "\t * procfs isn't actually a stacking filesystem; however, there is\n"], [126, "\t * too much magic going on inside it to permit stacking things on\n"], [127, "\t * top of it\n"], [128, "\t */\n"], [129, "\tsb->s_stack_depth = FILESYSTEM_MAX_STACK_DEPTH;\n"], [130, "\n"]]
[[124, "/*\n\t * procfs isn't actually a stacking filesystem; however, there is\n\t * too much magic going on inside it to permit stacking things on\n\t * top of it\n\t */"], [129, "sb->s_stack_depth = FILESYSTEM_MAX_STACK_DEPTH;"], [130, "\n"]]
[ "CVE-2016-1583" ]
[ "CWE-119" ]
291
{ "Execution Environment": [], "Explanation": null, "External Function": [], "Function Argument": [ "flags" ], "Globals": [ "MS_KERNMOUNT", "FILESYSTEM_MAX_STACK_DEPTH" ], "Type Execution Declaration": [] }
292
linux
https://github.com/torvalds/linux
kernel/sched/core.c
f5364c150aa645b3d7daa21b5c0b9feaa1c9cd6d
Merge branch 'stacking-fixes' (vfs stacking fixes from Jann) Merge filesystem stacking fixes from Jann Horn. * emailed patches from Jann Horn <jannh@google.com>: sched: panic on corrupted stack end ecryptfs: forbid opening files without mmap handler proc: prevent stacking filesystems on top
true
f5c1fb7050c089b6f27e3ed8ad492bce
schedule_debug
static inline void schedule_debug(struct task_struct *prev) { // #ifdef CONFIG_SCHED_STACK_END_CHECK BUG_ON(task_stack_end_corrupted(prev)); #endif if (unlikely(in_atomic_preempt_off())) { __schedule_bug(prev); preempt_count_set(PREEMPT_DISABLED); } rcu_sleep_check(); profile_hit(SCHED_PROFILING, __builtin_r...
[[3173, "\tBUG_ON(task_stack_end_corrupted(prev));\n"]]
[[3173, "BUG_ON(task_stack_end_corrupted(prev));"]]
[ "CVE-2016-1583" ]
[ "CWE-119" ]
293
{ "Execution Environment": [], "Explanation": null, "External Function": [ "task_stack_end_corrupted" ], "Function Argument": [], "Globals": [], "Type Execution Declaration": [] }
293
linux
https://github.com/torvalds/linux
kernel/sched/core.c
f5364c150aa645b3d7daa21b5c0b9feaa1c9cd6d
Merge branch 'stacking-fixes' (vfs stacking fixes from Jann) Merge filesystem stacking fixes from Jann Horn. * emailed patches from Jann Horn <jannh@google.com>: sched: panic on corrupted stack end ecryptfs: forbid opening files without mmap handler proc: prevent stacking filesystems on top
false
b45767fdb14f8f5739f4288380caeca5
schedule_debug
static inline void schedule_debug(struct task_struct *prev) { // #ifdef CONFIG_SCHED_STACK_END_CHECK if (task_stack_end_corrupted(prev)) panic("corrupted stack end detected inside scheduler\n"); #endif if (unlikely(in_atomic_preempt_off())) { __schedule_bug(prev); preempt_count_set(PREEMPT_DISABLED); } rcu_s...
[[3173, "\tif (task_stack_end_corrupted(prev))\n"], [3174, "\t\tpanic(\"corrupted stack end detected inside scheduler\\n\");\n"]]
[[3173, "if (task_stack_end_corrupted(prev))"], [3174, "panic(\"corrupted stack end detected inside scheduler\\n\");"]]
[ "CVE-2016-1583" ]
[ "CWE-119" ]
293
{ "Execution Environment": [], "Explanation": null, "External Function": [ "task_stack_end_corrupted" ], "Function Argument": [], "Globals": [], "Type Execution Declaration": [] }
294
linux
https://github.com/torvalds/linux
net/wireless/radiotap.c
f5563318ff1bde15b10e736e97ffce13be08bc1a
wireless: radiotap: fix parsing buffer overrun When parsing an invalid radiotap header, the parser can overrun the buffer that is passed in because it doesn't correctly check 1) the minimum radiotap header size 2) the space for extended bitmaps The first issue doesn't affect any in-kernel user as they all check the...
true
77e0bc2d5926d898e60f925261c93971
ieee80211_radiotap_iterator_init
int ieee80211_radiotap_iterator_init( struct ieee80211_radiotap_iterator *iterator, struct ieee80211_radiotap_header *radiotap_header, int max_length, const struct ieee80211_radiotap_vendor_namespaces *vns) { /* Linux only supports version 0 radiotap format */ if (radiotap_header->it_version) return -EINVAL; /...
[[134, "\t\t\t (unsigned long)iterator->_rtheader >\n"]]
[[133, "if ((unsigned long)iterator->_arg -\n\t\t\t (unsigned long)iterator->_rtheader >\n\t\t\t (unsigned long)iterator->_max_length)"]]
[ "CVE-2013-7027" ]
[ "CWE-119" ]
295
{ "Execution Environment": [], "Explanation": null, "External Function": [ "get_unaligned_le16", "get_unaligned_le32" ], "Function Argument": [ "max_length", "radiotap_header" ], "Globals": [ "IEEE80211_RADIOTAP_EXT" ], "Type Execution Declaration": [ "struct ieee80211_radiotap...
295
linux
https://github.com/torvalds/linux
net/wireless/radiotap.c
f5563318ff1bde15b10e736e97ffce13be08bc1a
wireless: radiotap: fix parsing buffer overrun When parsing an invalid radiotap header, the parser can overrun the buffer that is passed in because it doesn't correctly check 1) the minimum radiotap header size 2) the space for extended bitmaps The first issue doesn't affect any in-kernel user as they all check the...
false
b6ba15988cf9720bf26164f9577bd007
ieee80211_radiotap_iterator_init
int ieee80211_radiotap_iterator_init( struct ieee80211_radiotap_iterator *iterator, struct ieee80211_radiotap_header *radiotap_header, int max_length, const struct ieee80211_radiotap_vendor_namespaces *vns) { /* check the radiotap header can actually be present */ if (max_length < sizeof(struct ieee80211_radiotap_...
[[100, "\t/* check the radiotap header can actually be present */\n"], [101, "\tif (max_length < sizeof(struct ieee80211_radiotap_header))\n"], [102, "\t\treturn -EINVAL;\n"], [103, "\n"], [138, "\t\t\t (unsigned long)iterator->_rtheader +\n"], [139, "\t\t\t sizeof(uint32_t) >\n"]]
[[100, "/* check the radiotap header can actually be present */"], [101, "if (max_length < sizeof(struct ieee80211_radiotap_header))"], [102, "return -EINVAL;"], [103, "\n"], [137, "if ((unsigned long)iterator->_arg -\n\t\t\t (unsigned long)iterator->_rtheader +\n\t\t\t sizeof(uint32_t) >\n\t\t\t (unsigned lon...
[ "CVE-2013-7027" ]
[ "CWE-119" ]
295
{ "Execution Environment": [], "Explanation": null, "External Function": [ "get_unaligned_le16", "get_unaligned_le32" ], "Function Argument": [ "max_length", "radiotap_header" ], "Globals": [ "IEEE80211_RADIOTAP_EXT" ], "Type Execution Declaration": [ "struct ieee80211_radiotap...
296
linux
https://github.com/torvalds/linux
arch/x86/kernel/cpu/microcode/intel_early.c
f84598bd7c851f8b0bf8cd0d7c3be0d73c432ff4
x86/microcode/intel: Guard against stack overflow in the loader mc_saved_tmp is a static array allocated on the stack, we need to make sure mc_saved_count stays within its bounds, otherwise we're overflowing the stack in _save_mc(). A specially crafted microcode header could lead to a kernel crash or potentially kerne...
true
79cf489cf89a1a44bdf08beb2b904c4e
get_matching_model_microcode
static enum ucode_state __init get_matching_model_microcode(int cpu, unsigned long start, void *data, size_t size, struct mc_saved_data *mc_saved_data, unsigned long *mc_saved_in_initrd, struct ucode_cpu_info *uci) { u8 *ucode_ptr = data; unsigned int leftover = size; enum ucode_state...
[[324, "\twhile (leftover) {\n"]]
[[324, "while (leftover) {"]]
[ "CVE-2015-2666" ]
[ "CWE-119" ]
297
{ "Execution Environment": [], "Explanation": null, "External Function": [ "_save_mc" ], "Function Argument": [], "Globals": [ "MAX_UCODE_COUNT", "ARRAY_SIZE" ], "Type Execution Declaration": [] }
297
linux
https://github.com/torvalds/linux
arch/x86/kernel/cpu/microcode/intel_early.c
f84598bd7c851f8b0bf8cd0d7c3be0d73c432ff4
x86/microcode/intel: Guard against stack overflow in the loader mc_saved_tmp is a static array allocated on the stack, we need to make sure mc_saved_count stays within its bounds, otherwise we're overflowing the stack in _save_mc(). A specially crafted microcode header could lead to a kernel crash or potentially kerne...
false
1d738c3470b80f4308d4c6c7135dd43d
get_matching_model_microcode
static enum ucode_state __init get_matching_model_microcode(int cpu, unsigned long start, void *data, size_t size, struct mc_saved_data *mc_saved_data, unsigned long *mc_saved_in_initrd, struct ucode_cpu_info *uci) { u8 *ucode_ptr = data; unsigned int leftover = size; enum ucode_state...
[[324, "\twhile (leftover && mc_saved_count < ARRAY_SIZE(mc_saved_tmp)) {\n"]]
[[324, "while (leftover && mc_saved_count < ARRAY_SIZE(mc_saved_tmp)) {"]]
[ "CVE-2015-2666" ]
[ "CWE-119" ]
297
{ "Execution Environment": [], "Explanation": null, "External Function": [ "_save_mc" ], "Function Argument": [], "Globals": [ "MAX_UCODE_COUNT", "ARRAY_SIZE" ], "Type Execution Declaration": [] }
298
linux
https://github.com/torvalds/linux
fs/ksmbd/oplock.c
02f76c401d17e409ed45bf7887148fcc22c93c85
ksmbd: fix global-out-of-bounds in smb2_find_context_vals Add tag_len argument in smb2_find_context_vals() to avoid out-of-bound read when create_context's name_len is larger than tag length. [ 7.995411] ================================================================== [ 7.995866] BUG: KASAN: global-out-of-bou...
true
1fca1cb502437de877e5e5d7cdbad4d7
smb2_find_context_vals
struct create_context *smb2_find_context_vals(void *open_req, const char *tag) { struct create_context *cc; unsigned int next = 0; char *name; struct smb2_create_req *req = (struct smb2_create_req *)open_req; unsigned int remain_len, name_off, name_len, value_off, value_len, cc_len; /* * CreateContextsO...
[[1456, "struct create_context *smb2_find_context_vals(void *open_req, const char *tag)\n"], [1495, "\t\tif (memcmp(name, tag, name_len) == 0)\n"]]
[[1456, "struct create_context *smb2_find_context_vals(void *open_req, const char *tag)"], [1495, "if (memcmp(name, tag, name_len) == 0)"]]
[ "CVE-2023-38426" ]
[ "CWE-125" ]
299
{ "Execution Environment": [], "Explanation": null, "External Function": [], "Function Argument": [], "Globals": [], "Type Execution Declaration": [ "struct create_context", "struct smb2_create_req" ] }
299
linux
https://github.com/torvalds/linux
fs/ksmbd/oplock.c
02f76c401d17e409ed45bf7887148fcc22c93c85
ksmbd: fix global-out-of-bounds in smb2_find_context_vals Add tag_len argument in smb2_find_context_vals() to avoid out-of-bound read when create_context's name_len is larger than tag length. [ 7.995411] ================================================================== [ 7.995866] BUG: KASAN: global-out-of-bou...
false
dfa9c419999c25aff4a51035db289f89
smb2_find_context_vals
struct create_context *smb2_find_context_vals(void *open_req, const char *tag, int tag_len) { struct create_context *cc; unsigned int next = 0; char *name; struct smb2_create_req *req = (struct smb2_create_req *)open_req; unsigned int remain_len, name_off, name_len, value_off, value_len, cc_len; /* * Cr...
[[1457, "struct create_context *smb2_find_context_vals(void *open_req, const char *tag, int tag_len)\n"], [1496, "\t\tif (name_len == tag_len && !memcmp(name, tag, name_len))\n"]]
[[1457, "struct create_context *smb2_find_context_vals(void *open_req, const char *tag, int tag_len)"], [1496, "if (name_len == tag_len && !memcmp(name, tag, name_len))"]]
[ "CVE-2023-38426" ]
[ "CWE-125" ]
299
{ "Execution Environment": [], "Explanation": null, "External Function": [], "Function Argument": [], "Globals": [], "Type Execution Declaration": [ "struct create_context", "struct smb2_create_req" ] }