func string | target int64 | cwe list | project string | commit_id string | hash float64 | size int64 | message string |
|---|---|---|---|---|---|---|---|
static Node *check_file(struct linux_binprm *bprm)
{
char *p = strrchr(bprm->interp, '.');
struct list_head *l;
list_for_each(l, &entries) {
Node *e = list_entry(l, Node, list);
char *s;
int j;
if (!test_bit(Enabled, &e->flags))
continue;
if (!test_bit(Magic, &e->flags)) {
if (p && !strcmp(e->magi... | 0 | [
"CWE-200"
] | linux-2.6 | b66c5984017533316fd1951770302649baf1aa33 | 11,635,903,113,388,049,000,000,000,000,000,000,000 | 34 | exec: do not leave bprm->interp on stack
If a series of scripts are executed, each triggering module loading via
unprintable bytes in the script header, kernel stack contents can leak
into the command line.
Normally execution of binfmt_script and binfmt_misc happens recursively.
However, when modules are enabled, and... |
static void test_sshort_bug()
{
MYSQL_STMT *stmt;
MYSQL_BIND my_bind[4];
short short_value;
int32 long_value;
ulong s_length, l_length, ll_length, t_length;
ulonglong longlong_value;
int rc;
uchar tiny_value;
char llbuf[22];
myheader("test_sshort_bug");
rc= mysq... | 0 | [
"CWE-416"
] | server | eef21014898d61e77890359d6546d4985d829ef6 | 301,321,867,980,486,180,000,000,000,000,000,000,000 | 83 | MDEV-11933 Wrong usage of linked list in mysql_prune_stmt_list
mysql_prune_stmt_list() was walking the list following
element->next pointers, but inside the loop it was invoking
list_add(element) that modified element->next. So, mysql_prune_stmt_list()
failed to visit and reset all elements, and some of them were left... |
lexer_init_line_info (parser_context_t *context_p) /**< context */
{
context_p->line = 1;
context_p->column = 1;
const jerry_parse_options_t *options_p = context_p->options_p;
if (options_p != NULL && (options_p->options & JERRY_PARSE_HAS_START))
{
context_p->line = (options_p->start_line > 0) ? options... | 0 | [
"CWE-416"
] | jerryscript | 3bcd48f72d4af01d1304b754ef19fe1a02c96049 | 62,299,565,527,801,440,000,000,000,000,000,000,000 | 13 | Improve parse_identifier (#4691)
Ascii string length is no longer computed during string allocation.
JerryScript-DCO-1.0-Signed-off-by: Daniel Batiz batizjob@gmail.com |
static void encode_create_session(struct xdr_stream *xdr,
const struct nfs41_create_session_args *args,
struct compound_hdr *hdr)
{
__be32 *p;
struct nfs_client *clp = args->client;
struct rpc_clnt *clnt = clp->cl_rpcclient;
struct nfs_net *nn = net_generic(clp->cl_net, nfs_net_id);
u32 max_resp_sz_cac... | 0 | [
"CWE-787"
] | linux | b4487b93545214a9db8cbf32e86411677b0cca21 | 271,164,664,246,807,800,000,000,000,000,000,000,000 | 52 | nfs: Fix getxattr kernel panic and memory overflow
Move the buffer size check to decode_attr_security_label() before memcpy()
Only call memcpy() if the buffer is large enough
Fixes: aa9c2669626c ("NFS: Client implementation of Labeled-NFS")
Signed-off-by: Jeffrey Mitchell <jeffrey.mitchell@starlab.io>
[Trond: clean u... |
static void xml_parser_dtor(zend_rsrc_list_entry *rsrc TSRMLS_DC)
{
xml_parser *parser = (xml_parser *)rsrc->ptr;
if (parser->parser) {
XML_ParserFree(parser->parser);
}
if (parser->ltags) {
int inx;
for (inx = 0; ((inx < parser->level) && (inx < XML_MAXLEVEL)); inx++)
efree(parser->ltags[ inx ]);
efre... | 1 | [
"CWE-119"
] | php-src | 1248079be837808da4c97364fb3b4c96c8015fbf | 28,152,552,019,607,096,000,000,000,000,000,000,000 | 55 | Fix bug #72099: xml_parse_into_struct segmentation fault |
static void lsr_read_extension(GF_LASeRCodec *lsr, const char *name)
{
u32 len = lsr_read_vluimsbf5(lsr, name);
#if 0
*out_data = gf_malloc(sizeof(char)*len);
gf_bs_read_data(lsr->bs, *out_data, len);
*out_len = len;
#else
while (len && gf_bs_available(lsr->bs) ) {
gf_bs_read_int(lsr->bs, 8);
len--;
}
if (le... | 0 | [
"CWE-190"
] | gpac | faa75edde3dfeba1e2cf6ffa48e45a50f1042096 | 316,403,538,767,503,400,000,000,000,000,000,000,000 | 15 | fixed #2213 |
static void png_write_data(png_structp png_ptr, png_bytep data,
png_size_t length)
{
VncState *vs = png_get_io_ptr(png_ptr);
buffer_reserve(&vs->tight->png, vs->tight->png.offset + length);
memcpy(vs->tight->png.buffer + vs->tight->png.offset, data, length);
vs->tight->png.o... | 0 | [
"CWE-401"
] | qemu | 6bf21f3d83e95bcc4ba35a7a07cc6655e8b010b0 | 49,751,934,576,404,010,000,000,000,000,000,000,000 | 10 | vnc: fix memory leak when vnc disconnect
Currently when qemu receives a vnc connect, it creates a 'VncState' to
represent this connection. In 'vnc_worker_thread_loop' it creates a
local 'VncState'. The connection 'VcnState' and local 'VncState' exchange
data in 'vnc_async_encoding_start' and 'vnc_async_encoding_end'.
... |
void perf_event_disable_local(struct perf_event *event)
{
event_function_local(event, __perf_event_disable, NULL);
} | 0 | [
"CWE-362",
"CWE-125"
] | linux | 321027c1fe77f892f4ea07846aeae08cefbbb290 | 47,184,121,463,285,230,000,000,000,000,000,000,000 | 4 | perf/core: Fix concurrent sys_perf_event_open() vs. 'move_group' race
Di Shen reported a race between two concurrent sys_perf_event_open()
calls where both try and move the same pre-existing software group
into a hardware context.
The problem is exactly that described in commit:
f63a8daa5812 ("perf: Fix event->ctx... |
static int kvm_create_vm_debugfs(struct kvm *kvm, int fd)
{
char dir_name[ITOA_MAX_LEN * 2];
struct kvm_stat_data *stat_data;
struct kvm_stats_debugfs_item *p;
if (!debugfs_initialized())
return 0;
snprintf(dir_name, sizeof(dir_name), "%d-%d", task_pid_nr(current), fd);
kvm->debugfs_dentry = debugfs_create_di... | 0 | [
"CWE-416"
] | linux | 0774a964ef561b7170d8d1b1bfe6f88002b6d219 | 168,864,784,915,568,520,000,000,000,000,000,000,000 | 32 | KVM: Fix out of range accesses to memslots
Reset the LRU slot if it becomes invalid when deleting a memslot to fix
an out-of-bounds/use-after-free access when searching through memslots.
Explicitly check for there being no used slots in search_memslots(), and
in the caller of s390's approximation variant.
Fixes: 369... |
njs_generate_property_accessor(njs_vm_t *vm, njs_generator_t *generator,
njs_parser_node_t *node)
{
njs_int_t ret;
njs_generator_next(generator, njs_generate, node->left->left);
ret = njs_generator_after(vm, generator,
njs_queue_first(&generator->stack), node,
... | 0 | [
"CWE-703",
"CWE-754"
] | njs | 404553896792b8f5f429dc8852d15784a59d8d3e | 44,845,762,873,689,730,000,000,000,000,000,000,000 | 25 | Fixed break instruction in a try-catch block.
Previously, JUMP offset for a break instruction inside a try-catch
block was not set to a correct offset during code generation
when a return instruction was present in inner try-catch block.
The fix is to update the JUMP offset appropriately.
This closes #553 issue on G... |
static inline void vring_used_idx_set(VirtQueue *vq, uint16_t val)
{
hwaddr pa;
pa = vq->vring.used + offsetof(VRingUsed, idx);
stw_phys(pa, val);
} | 0 | [
"CWE-269"
] | qemu | 5f5a1318653c08e435cfa52f60b6a712815b659d | 268,761,019,094,067,420,000,000,000,000,000,000,000 | 6 | virtio: properly validate address before accessing config
There are several several issues in the current checking:
- The check was based on the minus of unsigned values which can overflow
- It was done after .{set|get}_config() which can lead crash when config_len
is zero since vdev->config is NULL
Fix this by:
... |
static int task_switch_16(struct x86_emulate_ctxt *ctxt,
u16 tss_selector, u16 old_tss_sel,
ulong old_tss_base, struct desc_struct *new_desc)
{
struct x86_emulate_ops *ops = ctxt->ops;
struct tss_segment_16 tss_seg;
int ret;
u32 new_tss_base = get_desc_base(new_desc);
ret = ops->read_std(ctxt, old_tss_b... | 0 | [] | kvm | e28ba7bb020f07193bc000453c8775e9d2c0dda7 | 319,634,855,747,324,000,000,000,000,000,000,000,000 | 43 | KVM: x86: fix missing checks in syscall emulation
On hosts without this patch, 32bit guests will crash (and 64bit guests
may behave in a wrong way) for example by simply executing following
nasm-demo-application:
[bits 32]
global _start
SECTION .text
_start: syscall
(I tested it with winxp and linux ... |
ncp_get_known_namespace(struct ncp_server *server, __u8 volume)
{
#if defined(CONFIG_NCPFS_OS2_NS) || defined(CONFIG_NCPFS_NFS_NS)
int result;
__u8 *namespace;
__u16 no_namespaces;
ncp_init_request(server);
ncp_add_byte(server, 24); /* Subfunction: Get Name Spaces Loaded */
ncp_add_word(server, 0);
ncp_add_byte... | 0 | [
"CWE-119"
] | staging | 4c41aa24baa4ed338241d05494f2c595c885af8f | 7,951,381,138,047,922,000,000,000,000,000,000,000 | 46 | staging: ncpfs: memory corruption in ncp_read_kernel()
If the server is malicious then *bytes_read could be larger than the
size of the "target" buffer. It would lead to memory corruption when we
do the memcpy().
Reported-by: Dr Silvio Cesare of InfoSect <Silvio Cesare <silvio.cesare@gmail.com>
Signed-off-by: Dan Ca... |
InstanceKlass* InstanceKlass::implementor() const {
InstanceKlass* volatile* ik = adr_implementor();
if (ik == NULL) {
return NULL;
} else {
// This load races with inserts, and therefore needs acquire.
InstanceKlass* ikls = Atomic::load_acquire(ik);
if (ikls != NULL && !ikls->is_loader_alive()) {... | 0 | [] | jdk17u | f8eb9abe034f7c6bea4da05a9ea42017b3f80730 | 119,178,485,686,609,770,000,000,000,000,000,000,000 | 14 | 8270386: Better verification of scan methods
Reviewed-by: coleenp
Backport-of: ac329cef45979bd0159ecd1347e36f7129bb2ce4 |
void Magick::Image::compressType(const CompressionType compressType_)
{
modifyImage();
image()->compression=compressType_;
options()->compressType(compressType_);
} | 0 | [
"CWE-416"
] | ImageMagick | 8c35502217c1879cb8257c617007282eee3fe1cc | 215,430,928,854,513,750,000,000,000,000,000,000,000 | 6 | Added missing return to avoid use after free. |
JVM_SupportsCX8(void)
{
Trc_SC_SupportsCX8();
return JNI_TRUE;
} | 0 | [
"CWE-119"
] | openj9 | 0971f22d88f42cf7332364ad7430e9bd8681c970 | 14,939,437,469,915,144,000,000,000,000,000,000,000 | 6 | Clean up jio_snprintf and jio_vfprintf
Fixes https://bugs.eclipse.org/bugs/show_bug.cgi?id=543659
Signed-off-by: Peter Bain <peter_bain@ca.ibm.com> |
int insert_inode_locked(struct inode *inode)
{
struct super_block *sb = inode->i_sb;
ino_t ino = inode->i_ino;
struct hlist_head *head = inode_hashtable + hash(sb, ino);
while (1) {
struct inode *old = NULL;
spin_lock(&inode_hash_lock);
hlist_for_each_entry(old, head, i_hash) {
if (old->i_ino != ino)
... | 0 | [
"CWE-269"
] | linux | 0fa3ecd87848c9c93c2c828ef4c3a8ca36ce46c7 | 333,538,645,112,492,100,000,000,000,000,000,000,000 | 40 | Fix up non-directory creation in SGID directories
sgid directories have special semantics, making newly created files in
the directory belong to the group of the directory, and newly created
subdirectories will also become sgid. This is historically used for
group-shared directories.
But group directories writable b... |
static MagickBooleanType RiemersmaDither(Image *image,CacheView *image_view,
CubeInfo *cube_info,const unsigned int direction,ExceptionInfo *exception)
{
#define DitherImageTag "Dither/Image"
DoublePixelPacket
color,
pixel;
MagickBooleanType
proceed;
register CubeInfo
*p;
size_t
index... | 0 | [
"CWE-125"
] | ImageMagick | 5294966898532a6bd54699fbf04edf18902513ac | 37,779,584,692,541,610,000,000,000,000,000,000,000 | 118 | https://github.com/ImageMagick/ImageMagick/issues/1156 |
char* XMLRPC_REQUEST_ToXML(XMLRPC_REQUEST request, int* buf_len) {
char* pRet = NULL;
if (request) {
xml_element *root_elem = NULL;
if (request->output.version == xmlrpc_version_simple) {
root_elem = DANDARPC_REQUEST_to_xml_element (request);
}
else if (request->output.version == xmlrpc_version_1_0 ||... | 0 | [
"CWE-119"
] | php-src | 88412772d295ebf7dd34409534507dc9bcac726e | 329,121,849,780,061,800,000,000,000,000,000,000,000 | 25 | Fix bug #68027 - fix date parsing in XMLRPC lib |
static int proc_task_readdir(struct file * filp, void * dirent, filldir_t filldir)
{
struct dentry *dentry = filp->f_path.dentry;
struct inode *inode = dentry->d_inode;
struct task_struct *leader = NULL;
struct task_struct *task;
int retval = -ENOENT;
ino_t ino;
int tid;
struct pid_namespace *ns;
task = get_p... | 0 | [] | linux | 0499680a42141d86417a8fbaa8c8db806bea1201 | 255,358,269,517,276,570,000,000,000,000,000,000,000 | 63 | procfs: add hidepid= and gid= mount options
Add support for mount options to restrict access to /proc/PID/
directories. The default backward-compatible "relaxed" behaviour is left
untouched.
The first mount option is called "hidepid" and its value defines how much
info about processes we want to be available for non... |
bool JOIN_TAB::preread_init()
{
TABLE_LIST *derived= table->pos_in_table_list;
DBUG_ENTER("JOIN_TAB::preread_init");
if (!derived || !derived->is_materialized_derived())
{
preread_init_done= TRUE;
DBUG_RETURN(FALSE);
}
/* Materialize derived table/view. */
if ((!derived->get_unit()->executed ||... | 0 | [
"CWE-89"
] | server | 5ba77222e9fe7af8ff403816b5338b18b342053c | 276,285,130,477,157,270,000,000,000,000,000,000,000 | 35 | MDEV-21028 Server crashes in Query_arena::set_query_arena upon SELECT from view
if the view has algorithm=temptable it is not updatable,
so DEFAULT() for its fields is meaningless,
and thus it's NULL or 0/'' for NOT NULL columns. |
free_auth_mem(void)
{
symkey * sk;
symkey_alloc * alloc;
symkey_alloc * next_alloc;
while (NULL != (sk = HEAD_DLIST(key_listhead, llink))) {
freesymkey(sk, &key_hash[KEYHASH(sk->keyid)]);
}
free(key_hash);
key_hash = NULL;
cache_keyid = 0;
cache_flags = 0;
for (alloc = authallocs; alloc != NULL; alloc = ne... | 1 | [
"CWE-287"
] | ntp | 71a962710bfe066f76da9679cf4cfdeffe34e95e | 96,771,753,280,598,490,000,000,000,000,000,000,000 | 20 | [Sec 2936] Skeleton Key: Any trusted key system can serve time. HStenn. |
handler::ha_change_partitions(HA_CREATE_INFO *create_info,
const char *path,
ulonglong * const copied,
ulonglong * const deleted,
const uchar *pack_frm_data,
size_t pack_... | 0 | [
"CWE-416"
] | server | af810407f78b7f792a9bb8c47c8c532eb3b3a758 | 217,492,603,059,870,900,000,000,000,000,000,000,000 | 19 | MDEV-28098 incorrect key in "dup value" error after long unique
reset errkey after using it, so that it wouldn't affect
the next error message in the next statement |
existing_file_removed_callback (GFile *file,
GError *error,
gpointer callback_data)
{
DeleteExistingFileData *data = callback_data;
CommonJob *job;
GFile *source;
GFileType file_type;
char *primary;
char *secondary;
char *... | 0 | [
"CWE-20"
] | nautilus | 1630f53481f445ada0a455e9979236d31a8d3bb0 | 33,787,851,515,692,000,000,000,000,000,000,000,000 | 68 | mime-actions: use file metadata for trusting desktop files
Currently we only trust desktop files that have the executable bit
set, and don't replace the displayed icon or the displayed name until
it's trusted, which prevents for running random programs by a malicious
desktop file.
However, the executable permission i... |
PJ_DEF(pj_status_t) pj_stun_msg_add_errcode_attr(pj_pool_t *pool,
pj_stun_msg *msg,
int err_code,
const pj_str_t *err_reason)
{
pj_stun_errcode_attr *err_attr = NULL;
pj_status_t status;
status = pj_stun_errcode_attr_create(pool, err_code, err_reason,
&err_attr);
if (status !... | 0 | [
"CWE-191"
] | pjproject | 15663e3f37091069b8c98a7fce680dc04bc8e865 | 279,770,863,342,974,670,000,000,000,000,000,000,000 | 15 | Merge pull request from GHSA-2qpg-f6wf-w984 |
cancel_mount_for_file (NautilusDirectory *directory,
NautilusFile *file)
{
if (directory->details->mount_state != NULL &&
directory->details->mount_state->file == file) {
mount_cancel (directory);
}
} | 0 | [] | nautilus | 7632a3e13874a2c5e8988428ca913620a25df983 | 58,056,953,948,306,520,000,000,000,000,000,000,000 | 8 | Check for trusted desktop file launchers.
2009-02-24 Alexander Larsson <alexl@redhat.com>
* libnautilus-private/nautilus-directory-async.c:
Check for trusted desktop file launchers.
* libnautilus-private/nautilus-file-private.h:
* libnautilus-private/nautilus-file.c:
* libnautilus-... |
static int encode_setclientid_confirm(struct xdr_stream *xdr, const struct nfs_client *client_state)
{
__be32 *p;
RESERVE_SPACE(12 + NFS4_VERIFIER_SIZE);
WRITE32(OP_SETCLIENTID_CONFIRM);
WRITE64(client_state->cl_clientid);
WRITEMEM(client_state->cl_confirm.data, NFS4_VERIFIER_SI... | 0 | [
"CWE-703"
] | linux | dc0b027dfadfcb8a5504f7d8052754bf8d501ab9 | 62,426,766,692,138,240,000,000,000,000,000,000,000 | 11 | NFSv4: Convert the open and close ops to use fmode
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com> |
static CURLcode pop3_easy_statemach(struct connectdata *conn)
{
struct pop3_conn *pop3c = &conn->proto.pop3c;
struct pingpong *pp = &pop3c->pp;
CURLcode result = CURLE_OK;
while(pop3c->state != POP3_STOP) {
result = Curl_pp_easy_statemach(pp);
if(result)
break;
}
return result;
} | 0 | [
"CWE-89"
] | curl | 75ca568fa1c19de4c5358fed246686de8467c238 | 83,552,258,410,065,030,000,000,000,000,000,000,000 | 14 | URL sanitize: reject URLs containing bad data
Protocols (IMAP, POP3 and SMTP) that use the path part of a URL in a
decoded manner now use the new Curl_urldecode() function to reject URLs
with embedded control codes (anything that is or decodes to a byte value
less than 32).
URLs containing such codes could easily oth... |
map_id_up_max(unsigned extents, struct uid_gid_map *map, u32 id)
{
struct idmap_key key;
key.map_up = true;
key.count = 1;
key.id = id;
return bsearch(&key, map->reverse, extents,
sizeof(struct uid_gid_extent), cmp_map_id);
} | 0 | [
"CWE-20",
"CWE-862",
"CWE-863"
] | linux | d2f007dbe7e4c9583eea6eb04d60001e85c6f1bd | 265,591,303,035,250,100,000,000,000,000,000,000,000 | 11 | userns: also map extents in the reverse map to kernel IDs
The current logic first clones the extent array and sorts both copies, then
maps the lower IDs of the forward mapping into the lower namespace, but
doesn't map the lower IDs of the reverse mapping.
This means that code in a nested user namespace with >5 extent... |
static int apparmor_setprocattr(struct task_struct *task, char *name,
void *value, size_t size)
{
struct common_audit_data sa;
struct apparmor_audit_data aad = {0,};
char *command, *largs = NULL, *args = value;
size_t arg_size;
int error;
if (size == 0)
return -EINVAL;
/* task can only write its own attri... | 0 | [
"CWE-119",
"CWE-264",
"CWE-369"
] | linux | 30a46a4647fd1df9cf52e43bf467f0d9265096ca | 312,339,502,113,612,900,000,000,000,000,000,000,000 | 76 | apparmor: fix oops, validate buffer size in apparmor_setprocattr()
When proc_pid_attr_write() was changed to use memdup_user apparmor's
(interface violating) assumption that the setprocattr buffer was always
a single page was violated.
The size test is not strictly speaking needed as proc_pid_attr_write()
will reject... |
SPL_ME(SplObjectStorage, offsetGet, arginfo_offsetGet, 0)
{NULL, NULL, NULL} | 0 | [] | php-src | a374dfab567ff7f0ab0dc150f14cc891b0340b47 | 329,753,402,846,392,240,000,000,000,000,000,000,000 | 2 | Fix bug #67492: unserialize() SPL ArrayObject / SPLObjectStorage Type Confusion |
dissect_DEVMODE_CTR(tvbuff_t *tvb, int offset, packet_info *pinfo,
proto_tree *tree, dcerpc_info *di, guint8 *drep)
{
proto_tree *subtree;
guint32 size;
subtree = proto_tree_add_subtree(
tree, tvb, offset, 0, ett_DEVMODE_CTR, NULL, "Devicemode container");
offset = dissect_ndr_uint32(tvb, offset, pinf... | 0 | [
"CWE-399"
] | wireshark | b4d16b4495b732888e12baf5b8a7e9bf2665e22b | 44,902,176,744,385,200,000,000,000,000,000,000,000 | 18 | SPOOLSS: Try to avoid an infinite loop.
Use tvb_reported_length_remaining in dissect_spoolss_uint16uni. Make
sure our offset always increments in dissect_spoolss_keybuffer.
Change-Id: I7017c9685bb2fa27161d80a03b8fca4ef630e793
Reviewed-on: https://code.wireshark.org/review/14687
Reviewed-by: Gerald Combs <gerald@wires... |
SERVER* dup_serve(SERVER *s) {
SERVER *serve = NULL;
serve=g_new0(SERVER, 1);
if(serve == NULL)
return NULL;
if(s->exportname)
serve->exportname = g_strdup(s->exportname);
serve->expected_size = s->expected_size;
if(s->listenaddr)
serve->listenaddr = g_strdup(s->listenaddr);
serve->port = s->port;
i... | 0 | [
"CWE-119",
"CWE-787"
] | nbd | 3ef52043861ab16352d49af89e048ba6339d6df8 | 40,313,810,399,329,815,000,000,000,000,000,000,000 | 38 | Fix buffer size checking
Yes, this means we've re-introduced CVE-2005-3534. Sigh. |
static inline uint16_t ok_inflater_can_write(const ok_inflater *inflater) {
if (inflater->buffer_start_pos == 0) {
return -inflater->buffer_end_pos - 1;
} else if (inflater->buffer_start_pos > inflater->buffer_end_pos) {
return inflater->buffer_start_pos - inflater->buffer_end_pos - 1;
} els... | 0 | [
"CWE-787"
] | ok-file-formats | e49cdfb84fb5eca2a6261f3c51a3c793fab9f62e | 81,132,412,051,685,250,000,000,000,000,000,000,000 | 9 | ok_png: Disallow multiple IHDR chunks (#15) |
bsg_map_hdr(struct bsg_device *bd, struct sg_io_v4 *hdr, fmode_t has_write_perm,
u8 *sense)
{
struct request_queue *q = bd->queue;
struct request *rq, *next_rq = NULL;
int ret, rw;
unsigned int dxfer_len;
void __user *dxferp = NULL;
struct bsg_class_device *bcd = &q->bsg_dev;
/* if the LLD has been removed... | 0 | [
"CWE-416",
"CWE-787"
] | linux | 128394eff343fc6d2f32172f03e24829539c5835 | 157,503,929,557,838,450,000,000,000,000,000,000,000 | 89 | sg_write()/bsg_write() is not fit to be called under KERNEL_DS
Both damn things interpret userland pointers embedded into the payload;
worse, they are actually traversing those. Leaving aside the bad
API design, this is very much _not_ safe to call with KERNEL_DS.
Bail out early if that happens.
Cc: stable@vger.kern... |
onig_reg_init(regex_t* reg, OnigOptionType option, OnigCaseFoldType case_fold_flag,
OnigEncoding enc, OnigSyntaxType* syntax)
{
int r;
xmemset(reg, 0, sizeof(*reg));
if (onig_inited == 0) {
#if 0
return ONIGERR_LIBRARY_IS_NOT_INITIALIZED;
#else
r = onig_initialize(&enc, 1);
if (r != 0)... | 0 | [
"CWE-476"
] | oniguruma | 410f5916429e7d2920e1d4867388514f605413b8 | 131,971,911,348,881,620,000,000,000,000,000,000,000 | 54 | fix #87: Read unknown address in onig_error_code_to_str() |
static MemTxResult subpage_write(void *opaque, hwaddr addr,
uint64_t value, unsigned len, MemTxAttrs attrs)
{
subpage_t *subpage = opaque;
uint8_t buf[8];
#if defined(DEBUG_SUBPAGE)
printf("%s: subpage %p len %u addr " TARGET_FMT_plx
" value %"PRIx64"\n",
... | 0 | [] | qemu | e4a511f8cc6f4a46d409fb5c9f72c38ba45f8d83 | 109,374,051,377,478,100,000,000,000,000,000,000,000 | 30 | exec: clamp accesses against the MemoryRegionSection
Because the clamping was done against the MemoryRegion,
address_space_rw was effectively broken if a write spanned
multiple sections that are not linear in underlying memory
(with the memory not being under an IOMMU).
This is visible with the MIPS rc4030 IOMMU, whi... |
copy_printer_attrs(
cupsd_client_t *con, /* I - Client connection */
cupsd_printer_t *printer, /* I - Printer */
cups_array_t *ra) /* I - Requested attributes array */
{
char printer_uri[HTTP_MAX_URI];
/* Printer URI */
char printer_icons[HTTP_MAX_URI];
/* Printer icons */
time_t ... | 0 | [
"CWE-20"
] | cups | 49fa4983f25b64ec29d548ffa3b9782426007df3 | 245,819,374,716,036,000,000,000,000,000,000,000,000 | 211 | DBUS notifications could crash the scheduler (Issue #5143)
- scheduler/ipp.c: Make sure requesting-user-name string is valid UTF-8. |
proto_read_ulong_buffer (p11_rpc_message *msg,
CK_ULONG_PTR *buffer,
CK_ULONG *n_buffer)
{
uint32_t length;
assert (msg != NULL);
assert (buffer != NULL);
assert (n_buffer != NULL);
assert (msg->input != NULL);
/* Check that we're supposed to be reading this at ... | 1 | [
"CWE-190"
] | p11-kit | 5307a1d21a50cacd06f471a873a018d23ba4b963 | 154,326,619,283,631,920,000,000,000,000,000,000,000 | 31 | Check for arithmetic overflows before allocating |
virDomainAbortJob(virDomainPtr domain)
{
virConnectPtr conn;
VIR_DOMAIN_DEBUG(domain);
virResetLastError();
virCheckDomainReturn(domain, -1);
conn = domain->conn;
virCheckReadOnlyGoto(conn->flags, error);
if (conn->driver->domainAbortJob) {
int ret;
ret = conn->driver->d... | 0 | [
"CWE-254"
] | libvirt | 506e9d6c2d4baaf580d489fff0690c0ff2ff588f | 197,975,279,239,212,700,000,000,000,000,000,000,000 | 27 | virDomainGetTime: Deny on RO connections
We have a policy that if API may end up talking to a guest agent
it should require RW connection. We don't obey the rule in
virDomainGetTime().
Signed-off-by: Michal Privoznik <mprivozn@redhat.com> |
explicit CTCLossOpGPU(OpKernelConstruction* ctx) : OpKernel(ctx) {
bool preprocess_collapse_repeated;
bool ctc_merge_repeated;
bool ignore_longer_outputs_than_inputs;
OP_REQUIRES_OK(ctx, ctx->GetAttr("preprocess_collapse_repeated",
&preprocess_collapse_repeated));
... | 0 | [
"CWE-665"
] | tensorflow | 14607c0707040d775e06b6817325640cb4b5864c | 159,392,016,855,221,600,000,000,000,000,000,000,000 | 24 | Fix nullptr deref in `tf.raw_ops.CTCLoss`.
PiperOrigin-RevId: 372266334
Change-Id: Ic52c3e9f13a38f54482d670907eda1688450862b |
virtual unsigned int MaxPrestreamHeaderSize() const {return 0;}
| 0 | [
"CWE-190",
"CWE-125"
] | cryptopp | 07dbcc3d9644b18e05c1776db2a57fe04d780965 | 226,134,702,281,746,200,000,000,000,000,000,000,000 | 1 | Add Inflator::BadDistanceErr exception (Issue 414)
The improved validation and excpetion clears the Address Sanitizer and Undefined Behavior Sanitizer findings |
static inline JsonNode* json_mkstream(const std::stringstream& stream)
{
// hold on to string on stack!
std::string str(stream.str());
return json_mkstring(str.c_str());
} | 0 | [
"CWE-125"
] | libsass | 8f40dc03e5ab5a8b2ebeb72b31f8d1adbb2fd6ae | 151,340,459,744,845,000,000,000,000,000,000,000,000 | 6 | Optimize line_begin/end search in `handle_error`
There is no need to advance by UTF-8 code points when searching for an
ASCII character, because UTF-8 is a prefix-free encoding. |
static char *EscapeParenthesis(const char *source)
{
char
*destination;
register char
*q;
register const char
*p;
size_t
length;
assert(source != (const char *) NULL);
length=0;
for (p=source; *p != '\0'; p++)
{
if ((*p == '\\') || (*p == '(') || (*p == ')'))
{
if (... | 0 | [
"CWE-617"
] | ImageMagick | 2001aabeab8a921a4fa0b1932f565aef6ae69f84 | 22,931,243,919,262,320,000,000,000,000,000,000,000 | 43 | https://github.com/ImageMagick/ImageMagick/issues/674 |
static int x25_wait_for_data(struct sock *sk, long timeout)
{
DECLARE_WAITQUEUE(wait, current);
int rc = 0;
add_wait_queue_exclusive(sk_sleep(sk), &wait);
for (;;) {
__set_current_state(TASK_INTERRUPTIBLE);
if (sk->sk_shutdown & RCV_SHUTDOWN)
break;
rc = -ERESTARTSYS;
if (signal_pending(current))
bre... | 0 | [] | net | 7781607938c8371d4c2b243527430241c62e39c2 | 214,190,402,191,886,230,000,000,000,000,000,000,000 | 28 | net/x25: Fix null-ptr-deref caused by x25_disconnect
When the link layer is terminating, x25->neighbour will be set to NULL
in x25_disconnect(). As a result, it could cause null-ptr-deref bugs in
x25_sendmsg(),x25_recvmsg() and x25_connect(). One of the bugs is
shown below.
(Thread 1) | (Thread 2... |
static bool is_connected(struct input_device *idev)
{
if (idev->uhid)
return (idev->intr_io != NULL && idev->ctrl_io != NULL);
else
return ioctl_is_connected(idev);
} | 0 | [] | bluez | 3cccdbab2324086588df4ccf5f892fb3ce1f1787 | 230,204,040,862,421,650,000,000,000,000,000,000,000 | 7 | HID accepts bonded device connections only.
This change adds a configuration for platforms to choose a more secure
posture for the HID profile. While some older mice are known to not
support pairing or encryption, some platform may choose a more secure
posture by requiring the device to be bonded and require the
con... |
TRIO_PRIVATE int TrioParseQualifiers TRIO_ARGS4((type, format, offset, parameter), int type,
TRIO_CONST char* format, int offset,
trio_parameter_t* parameter)
{
char ch;
int dots = 0; /* Count number of dots in modifier pa... | 0 | [
"CWE-190",
"CWE-125"
] | FreeRDP | 05cd9ea2290d23931f615c1b004d4b2e69074e27 | 157,509,878,691,158,550,000,000,000,000,000,000,000 | 289 | Fixed TrioParse and trio_length limts.
CVE-2020-4030 thanks to @antonio-morales for finding this. |
int intel_guc_to_host_process_recv_msg(struct intel_guc *guc,
const u32 *payload, u32 len)
{
u32 msg;
if (unlikely(!len))
return -EPROTO;
/* Make sure to handle only enabled messages */
msg = payload[0] & guc->msg_enabled_mask;
if (msg & (INTEL_GUC_RECV_MSG_FLUSH_LOG_BUFFER |
INTEL_GUC_RECV_MS... | 0 | [
"CWE-20",
"CWE-190"
] | linux | c784e5249e773689e38d2bc1749f08b986621a26 | 111,059,307,940,378,470,000,000,000,000,000,000,000 | 17 | drm/i915/guc: Update to use firmware v49.0.1
The latest GuC firmware includes a number of interface changes that
require driver updates to match.
* Starting from Gen11, the ID to be provided to GuC needs to contain
the engine class in bits [0..2] and the instance in bits [3..6].
NOTE: this patch breaks pointer d... |
void rdp_reset(rdpRdp* rdp)
{
rdpContext* context;
rdpSettings* settings;
context = rdp->context;
settings = rdp->settings;
bulk_reset(rdp->bulk);
if (rdp->rc4_decrypt_key)
{
winpr_RC4_Free(rdp->rc4_decrypt_key);
rdp->rc4_decrypt_key = NULL;
}
if (rdp->rc4_encrypt_key)
{
winpr_RC4_Free(rdp->rc4_encryp... | 0 | [
"CWE-125"
] | FreeRDP | 9301bfe730c66180263248b74353daa99f5a969b | 337,426,115,114,662,300,000,000,000,000,000,000,000 | 66 | Fixed #6007: Boundary checks in rdp_read_flow_control_pdu |
virDomainObjGetMetadata(virDomainObjPtr vm,
int type,
const char *uri,
unsigned int flags)
{
virDomainDefPtr def;
char *ret = NULL;
virCheckFlags(VIR_DOMAIN_AFFECT_LIVE |
VIR_DOMAIN_AFFECT_CONFIG, NULL);
if (type... | 0 | [
"CWE-212"
] | libvirt | a5b064bf4b17a9884d7d361733737fb614ad8979 | 2,236,784,280,255,721,300,000,000,000,000,000,000 | 48 | conf: Don't format http cookies unless VIR_DOMAIN_DEF_FORMAT_SECURE is used
Starting with 3b076391befc3fe72deb0c244ac6c2b4c100b410
(v6.1.0-122-g3b076391be) we support http cookies. Since they may contain
somewhat sensitive information we should not format them into the XML
unless VIR_DOMAIN_DEF_FORMAT_SECURE is assert... |
acl_fetch_shdr_cnt(struct proxy *px, struct session *l4, void *l7, int dir,
struct acl_expr *expr, struct acl_test *test)
{
struct http_txn *txn = l7;
if (!txn)
return 0;
if (txn->rsp.msg_state < HTTP_MSG_BODY)
return 0;
return acl_fetch_hdr_cnt(px, l4, txn, txn->rsp.sol, expr, test);
} | 0 | [] | haproxy-1.4 | dc80672211e085c211f1fc47e15cfe57ab587d38 | 41,265,301,932,072,170,000,000,000,000,000,000,000 | 13 | BUG/CRITICAL: using HTTP information in tcp-request content may crash the process
During normal HTTP request processing, request buffers are realigned if
there are less than global.maxrewrite bytes available after them, in
order to leave enough room for rewriting headers after the request. This
is done in http_wait_fo... |
thesarurs_add_words_in_line(
char_u *fname,
char_u **buf_arg,
int dir,
char_u *skip_word)
{
int status = OK;
char_u *ptr;
char_u *wstart;
// Add the other matches on the line
ptr = *buf_arg;
while (!got_int)
{
// Find start of the next word. Skip white
// space and punctuation.
ptr... | 0 | [
"CWE-125"
] | vim | f12129f1714f7d2301935bb21d896609bdac221c | 170,595,382,049,391,720,000,000,000,000,000,000,000 | 50 | patch 9.0.0020: with some completion reading past end of string
Problem: With some completion reading past end of string.
Solution: Check the length of the string. |
static void patch_min_use(JournalStorage *storage) {
assert(storage);
/* Let's bump the min_use limit to the current usage on disk. We do
* this when starting up and first opening the journal files. This way
* sudden spikes in disk usage will not cause journald to vacuum files
... | 0 | [
"CWE-770"
] | systemd | 084eeb865ca63887098e0945fb4e93c852b91b0f | 120,123,653,428,753,900,000,000,000,000,000,000,000 | 11 | journald: do not store the iovec entry for process commandline on stack
This fixes a crash where we would read the commandline, whose length is under
control of the sending program, and then crash when trying to create a stack
allocation for it.
CVE-2018-16864
https://bugzilla.redhat.com/show_bug.cgi?id=1653855
The ... |
void hci_event_packet(struct hci_dev *hdev, struct sk_buff *skb)
{
struct hci_event_hdr *hdr = (void *) skb->data;
hci_req_complete_t req_complete = NULL;
hci_req_complete_skb_t req_complete_skb = NULL;
struct sk_buff *orig_skb = NULL;
u8 status = 0, event = hdr->evt, req_evt = 0;
u16 opcode = HCI_OP_NOP;
if (!... | 0 | [
"CWE-290"
] | linux | 3ca44c16b0dcc764b641ee4ac226909f5c421aa3 | 324,677,493,386,654,100,000,000,000,000,000,000,000 | 234 | Bluetooth: Consolidate encryption handling in hci_encrypt_cfm
This makes hci_encrypt_cfm calls hci_connect_cfm in case the connection
state is BT_CONFIG so callers don't have to check the state.
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org> |
server_unresponsive(struct TCP_Server_Info *server)
{
/*
* We need to wait 2 echo intervals to make sure we handle such
* situations right:
* 1s client sends a normal SMB request
* 2s client gets a response
* 30s echo workqueue job pops, and decides we got a response recently
* and don't need to send... | 0 | [
"CWE-703",
"CWE-189"
] | linux | 1fc29bacedeabb278080e31bb9c1ecb49f143c3b | 96,121,258,286,951,570,000,000,000,000,000,000,000 | 24 | cifs: fix off-by-one bug in build_unc_path_to_root
commit 839db3d10a (cifs: fix up handling of prefixpath= option) changed
the code such that the vol->prepath no longer contained a leading
delimiter and then fixed up the places that accessed that field to
account for that change.
One spot in build_unc_path_to_root wa... |
static int caldav_acl(struct transaction_t *txn, xmlNodePtr priv, int *rights)
{
if (!xmlStrcmp(priv->ns->href, BAD_CAST XML_NS_CALDAV)) {
/* CalDAV privileges */
switch (txn->req_tgt.flags) {
case TGT_SCHED_INBOX:
if (!xmlStrcmp(priv->name, BAD_CAST "schedule-deliver"))
*rights |= DACL_SCHED;
else i... | 0 | [
"CWE-787"
] | cyrus-imapd | a5779db8163b99463e25e7c476f9cbba438b65f3 | 33,025,335,582,464,400,000,000,000,000,000,000,000 | 80 | HTTP: don't overrun buffer when parsing strings with sscanf() |
static void shadow_var_struct_members(RAnalVar *var) {
Sdb *TDB = var->fcn->anal->sdb_types;
const char *type_kind = sdb_const_get (TDB, var->type, 0);
if (type_kind && r_str_startswith (type_kind, "struct")) {
char *field;
int field_n;
char *type_key = r_str_newf ("%s.%s", type_kind, var->type);
for (field_... | 0 | [
"CWE-416"
] | radare2 | a7ce29647fcb38386d7439696375e16e093d6acb | 153,374,194,150,495,650,000,000,000,000,000,000,000 | 26 | Fix UAF in aaaa on arm/thumb switching ##crash
* Reported by @peacock-doris via huntr.dev
* Reproducer tests_65185
* This is a logic fix, but not the fully safe as changes in the code
can result on UAF again, to properly protect r2 from crashing we
need to break the ABI and add refcounting to RRegItem, which can't... |
cardos_lifecycle_set(sc_card_t *card, int *mode)
{
sc_apdu_t apdu;
int r;
int current;
int target;
SC_FUNC_CALLED(card->ctx, SC_LOG_DEBUG_VERBOSE);
target = *mode;
r = cardos_lifecycle_get(card, ¤t);
if (r != SC_SUCCESS)
return r;
if (current == target || current == SC_CARDCTRL_LIFECYCLE_OTHER)... | 0 | [] | OpenSC | 1252aca9f10771ef5ba8405e73cf2da50827958f | 146,465,645,650,993,960,000,000,000,000,000,000,000 | 34 | cardos: Correctly calculate the left bytes to avoid buffer overrun
Thanks oss-fuzz
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=29912 |
static int read_uint64(BlockDriverState *bs, int64_t offset, uint64_t *result)
{
uint64_t buffer;
int ret;
ret = bdrv_pread(bs->file, offset, &buffer, 8);
if (ret < 0) {
return ret;
}
*result = be64_to_cpu(buffer);
return 0;
} | 0 | [
"CWE-119"
] | qemu | f0dce23475b5af5da6b17b97c1765271307734b6 | 250,982,070,590,625,200,000,000,000,000,000,000,000 | 13 | dmg: prevent chunk buffer overflow (CVE-2014-0145)
Both compressed and uncompressed I/O is buffered. dmg_open() calculates
the maximum buffer size needed from the metadata in the image file.
There is currently a buffer overflow since ->lengths[] is accounted
against the maximum compressed buffer size but actually us... |
GF_Err elst_box_dump(GF_Box *a, FILE * trace)
{
GF_EditListBox *p;
u32 i;
GF_EdtsEntry *t;
p = (GF_EditListBox *)a;
gf_isom_box_dump_start(a, "EditListBox", trace);
gf_fprintf(trace, "EntryCount=\"%d\">\n", gf_list_count(p->entryList));
i=0;
while ((t = (GF_EdtsEntry *)gf_list_enum(p->entryList, &i))) {
u32... | 0 | [
"CWE-787"
] | gpac | ea1eca00fd92fa17f0e25ac25652622924a9a6a0 | 82,589,996,133,787,920,000,000,000,000,000,000,000 | 25 | fixed #2138 |
START_TEST (test_send_sonmp)
{
int n;
/* Packet we should build:
IEEE 802.3 Ethernet
Destination: Bay-Networks-(Synoptics)-autodiscovery (01:00:81:00:01:00)
Source: 5e:10:8e:e7:84:ad (5e:10:8e:e7:84:ad)
Length: 19
Logical-Link Control
DSAP: SNAP (0xaa)
IG Bit: Individual
SSAP: SNAP (0xaa)
... | 0 | [] | lldpd | 73d42680fce8598324364dbb31b9bc3b8320adf7 | 27,593,639,786,449,520,000,000,000,000,000,000,000 | 101 | sonmp: fix heap overflow when reading SONMP packets
By sending short SONMP packets, an attacker can make the decoder crash
by reading too much data on the heap. SONMP packets are fixed in size,
just ensure we get the enough bytes to contain a SONMP packet.
CVE-2021-43612 |
void ClientHandler::setup_upstream_io_callback() {
if (conn_.tls.ssl) {
conn_.prepare_server_handshake();
read_ = write_ = &ClientHandler::tls_handshake;
on_read_ = &ClientHandler::upstream_noop;
on_write_ = &ClientHandler::upstream_write;
} else {
// For non-TLS version, first create HttpsUpstr... | 0 | [] | nghttp2 | 95efb3e19d174354ca50c65d5d7227d92bcd60e1 | 239,318,767,240,780,970,000,000,000,000,000,000,000 | 18 | Don't read too greedily |
TEST(QueryProjectionTest, AssignmentToDottedPathRequiresFirstComponent) {
auto proj = createProjection("{}", "{_id: 0, 'a.b': {$add: [5, 3]}}");
ASSERT_FALSE(proj.isSimple());
ASSERT_FALSE(proj.requiresDocument());
const auto& fields = proj.getRequiredFields();
ASSERT_EQ(fields.size(), 1);
ASSE... | 0 | [
"CWE-732"
] | mongo | cd583b6c4d8aa2364f255992708b9bb54e110cf4 | 124,803,732,208,931,900,000,000,000,000,000,000,000 | 9 | SERVER-53929 Add stricter parser checks around positional projection |
MagickExport QuantizeInfo *AcquireQuantizeInfo(const ImageInfo *image_info)
{
QuantizeInfo
*quantize_info;
quantize_info=(QuantizeInfo *) AcquireCriticalMemory(sizeof(*quantize_info));
GetQuantizeInfo(quantize_info);
if (image_info != (ImageInfo *) NULL)
{
const char
*option;
quant... | 0 | [
"CWE-125"
] | ImageMagick | 5294966898532a6bd54699fbf04edf18902513ac | 801,390,444,233,105,800,000,000,000,000,000,000 | 22 | https://github.com/ImageMagick/ImageMagick/issues/1156 |
time_t XMLRPC_GetValueDateTime(XMLRPC_VALUE value) {
return (time_t)((value && value->type == xmlrpc_datetime) ? value->i : 0);
} | 0 | [
"CWE-119"
] | php-src | 88412772d295ebf7dd34409534507dc9bcac726e | 118,931,975,860,653,160,000,000,000,000,000,000,000 | 3 | Fix bug #68027 - fix date parsing in XMLRPC lib |
static int on_message_complete(http_parser* self_)
{
HTTPParser* self = static_cast<HTTPParser*>(self_);
self->message_complete = true;
self->process_message();
return 0;
} | 0 | [
"CWE-416"
] | Crow | fba01dc76d6ea940ad7c8392e8f39f9647241d8e | 338,601,858,709,528,000,000,000,000,000,000,000,000 | 8 | Prevent HTTP pipelining which Crow doesn't support. |
ldns_pkt_tsig_sign(ldns_pkt *pkt, const char *key_name, const char *key_data,
uint16_t fudge, const char *algorithm_name, const ldns_rdf *query_mac)
{
return ldns_pkt_tsig_sign_next(pkt, key_name, key_data, fudge, algorithm_name, query_mac, 0);
} | 0 | [] | ldns | f9073d9fc313b19f51a5aa160584f2bdccda637a | 90,542,838,919,358,240,000,000,000,000,000,000,000 | 5 | * Detect fixed time memory compare for openssl 0.9.8. |
hns_ppe_common_get_ioaddr(struct ppe_common_cb *ppe_common)
{
return ppe_common->dsaf_dev->ppe_base + PPE_COMMON_REG_OFFSET;
} | 0 | [
"CWE-119",
"CWE-703"
] | linux | 412b65d15a7f8a93794653968308fc100f2aa87c | 189,414,104,548,625,480,000,000,000,000,000,000,000 | 4 | net: hns: fix ethtool_get_strings overflow in hns driver
hns_get_sset_count() returns HNS_NET_STATS_CNT and the data space allocated
is not enough for ethtool_get_strings(), which will cause random memory
corruption.
When SLAB and DEBUG_SLAB are both enabled, memory corruptions like the
the following can be observed ... |
static int send_request(struct avdtp *session, gboolean priority,
struct avdtp_stream *stream, uint8_t signal_id,
void *buffer, size_t size)
{
struct pending_req *req;
if (stream && stream->abort_int && signal_id != AVDTP_ABORT) {
DBG("Unable to send requests while aborting");
return -EINVAL;
}
req = g_... | 0 | [
"CWE-703"
] | bluez | 7a80d2096f1b7125085e21448112aa02f49f5e9a | 330,732,041,155,602,580,000,000,000,000,000,000,000 | 20 | avdtp: Fix accepting invalid/malformed capabilities
Check if capabilities are valid before attempting to copy them. |
static __init int vmx_disabled_by_bios(void)
{
u64 msr;
rdmsrl(MSR_IA32_FEATURE_CONTROL, msr);
if (msr & FEATURE_CONTROL_LOCKED) {
if (!(msr & FEATURE_CONTROL_VMXON_ENABLED_INSIDE_SMX)
&& tboot_enabled())
return 1;
if (!(msr & FEATURE_CONTROL_VMXON_ENABLED_OUTSIDE_SMX)
&& !tboot_enabled())
return 1;... | 0 | [
"CWE-400"
] | linux-2.6 | 9581d442b9058d3699b4be568b6e5eae38a41493 | 95,192,075,315,527,710,000,000,000,000,000,000,000 | 17 | KVM: Fix fs/gs reload oops with invalid ldt
kvm reloads the host's fs and gs blindly, however the underlying segment
descriptors may be invalid due to the user modifying the ldt after loading
them.
Fix by using the safe accessors (loadsegment() and load_gs_index()) instead
of home grown unsafe versions.
This is CVE-... |
static void coalesce_file_region(struct resv_map *resv, struct file_region *rg)
{
struct file_region *nrg = NULL, *prg = NULL;
prg = list_prev_entry(rg, link);
if (&prg->link != &resv->regions && prg->to == rg->from &&
has_same_uncharge_info(prg, rg)) {
prg->to = rg->to;
list_del(&rg->link);
put_uncharg... | 0 | [] | linux | a4a118f2eead1d6c49e00765de89878288d4b890 | 110,343,271,702,371,800,000,000,000,000,000,000,000 | 26 | hugetlbfs: flush TLBs correctly after huge_pmd_unshare
When __unmap_hugepage_range() calls to huge_pmd_unshare() succeed, a TLB
flush is missing. This TLB flush must be performed before releasing the
i_mmap_rwsem, in order to prevent an unshared PMDs page from being
released and reused before the TLB flush took place... |
config_mdnstries(
config_tree *ptree
)
{
#ifdef HAVE_DNSREGISTRATION
extern int mdnstries;
mdnstries = ptree->mdnstries;
#endif /* HAVE_DNSREGISTRATION */
} | 0 | [
"CWE-19"
] | ntp | fe46889f7baa75fc8e6c0fcde87706d396ce1461 | 324,957,624,768,726,200,000,000,000,000,000,000,000 | 9 | [Sec 2942]: Off-path DoS attack on auth broadcast mode. HStenn. |
struct clock_source *dce110_clock_source_create(
struct dc_context *ctx,
struct dc_bios *bios,
enum clock_source_id id,
const struct dce110_clk_src_regs *regs,
bool dp_clk_src)
{
struct dce110_clk_src *clk_src =
kzalloc(sizeof(struct dce110_clk_src), GFP_KERNEL);
if (!clk_src)
return NULL;
if (dce110_clk_... | 1 | [
"CWE-400",
"CWE-703",
"CWE-401"
] | linux | 055e547478a11a6360c7ce05e2afc3e366968a12 | 31,654,476,780,755,590,000,000,000,000,000,000,000 | 22 | drm/amd/display: memory leak
In dcn*_clock_source_create when dcn20_clk_src_construct fails allocated
clk_src needs release.
Signed-off-by: Navid Emamdoost <navid.emamdoost@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com> |
unsigned int ldb_msg_find_attr_as_uint(const struct ldb_message *msg,
const char *attr_name,
unsigned int default_value)
{
const struct ldb_val *v = ldb_msg_find_ldb_val(msg, attr_name);
char buf[sizeof("-2147483648")];
char *end = NULL;
unsigned int ret;
if (!v || !v->data) {
return defau... | 0 | [
"CWE-200"
] | samba | 7efe8182c165fbf17d2f88c173527a7a554e214b | 97,634,985,153,126,040,000,000,000,000,000,000,000 | 33 | CVE-2022-32746 ldb: Add flag to mark message element values as shared
When making a shallow copy of an ldb message, mark the message elements
of the copy as sharing their values with the message elements in the
original message.
This flag value will be heeded in the next commit.
BUG: https://bugzilla.samba.org/show_... |
CacheManager::PasswdGet(Mgr::ActionPasswordList * a, const char *action)
{
while (a) {
for (auto &w : a->actions) {
if (w.cmp(action) == 0)
return a->passwd;
static const SBuf allAction("all");
if (w == allAction)
return a->passwd;
... | 0 | [
"CWE-401"
] | squid | 26e65059bc06ebce508737b5cd0866478691566a | 142,838,645,570,129,210,000,000,000,000,000,000,000 | 17 | Bug 5106: Broken cache manager URL parsing (#788)
Use already parsed request-target URL in cache manager and
update CacheManager to Tokanizer based URL parse
Removing use of sscan() and regex string processing which have
proven to be problematic on many levels. Most particularly with
regards to tolerance of normally ... |
CURLcode Curl_ntlm_core_mk_nt_hash(struct Curl_easy *data,
const char *password,
unsigned char *ntbuffer /* 21 bytes */)
{
size_t len = strlen(password);
unsigned char *pw = len ? malloc(len * 2) : strdup("");
CURLcode result;
if(!pw)
ret... | 1 | [
"CWE-190"
] | curl | 57d299a499155d4b327e341c6024e293b0418243 | 35,538,574,004,022,170,000,000,000,000,000,000,000 | 72 | Curl_ntlm_core_mk_nt_hash: return error on too long password
... since it would cause an integer overflow if longer than (max size_t
/ 2).
This is CVE-2018-14618
Bug: https://curl.haxx.se/docs/CVE-2018-14618.html
Closes #2756
Reported-by: Zhaoyang Wu |
gx_default_composite_clist_read_update(gs_composite_t *pxcte, gx_device * cdev,
gx_device * tdev, gs_gstate * pgs, gs_memory_t * mem)
{
return 0; /* Do nothing */
} | 0 | [] | ghostpdl | c9b362ba908ca4b1d7c72663a33229588012d7d9 | 176,151,595,268,757,660,000,000,000,000,000,000,000 | 5 | Bug 699670: disallow copying of the epo device
The erasepage optimisation (epo) subclass device shouldn't be allowed to be
copied because the subclass private data, child and parent pointers end up
being shared between the original device and the copy.
Add an epo_finish_copydevice which NULLs the three offending poin... |
isStandaloneDebug(void *ctx ATTRIBUTE_UNUSED)
{
callbacks++;
if (noout)
return(0);
fprintf(stdout, "SAX.isStandalone()\n");
return(0);
} | 0 | [
"CWE-416"
] | libxml2 | 1358d157d0bd83be1dfe356a69213df9fac0b539 | 226,056,552,696,966,700,000,000,000,000,000,000,000 | 8 | Fix use-after-free with `xmllint --html --push`
Call htmlCtxtUseOptions to make sure that names aren't stored in
dictionaries.
Note that this issue only affects xmllint using the HTML push parser.
Fixes #230. |
static ssize_t cqspi_read(struct spi_nor *nor, loff_t from,
size_t len, u_char *buf)
{
int ret;
ret = cqspi_set_protocol(nor, 1);
if (ret)
return ret;
ret = cqspi_indirect_read_setup(nor, from);
if (ret)
return ret;
ret = cqspi_indirect_read_execute(nor, buf, len);
if (ret)
return ret;
return (re... | 0 | [
"CWE-119",
"CWE-787"
] | linux | 193e87143c290ec16838f5368adc0e0bc94eb931 | 190,649,258,624,297,760,000,000,000,000,000,000,000 | 19 | mtd: spi-nor: Off by one in cqspi_setup_flash()
There are CQSPI_MAX_CHIPSELECT elements in the ->f_pdata array so the >
should be >=.
Fixes: 140623410536 ('mtd: spi-nor: Add driver for Cadence Quad SPI Flash Controller')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Marek Vasut <marex@denx.de>
... |
void inet_frags_init_net(struct netns_frags *nf)
{
nf->nqueues = 0;
init_frag_mem_limit(nf);
INIT_LIST_HEAD(&nf->lru_list);
spin_lock_init(&nf->lru_lock);
} | 0 | [] | linux | 3ef0eb0db4bf92c6d2510fe5c4dc51852746f206 | 134,860,180,798,183,550,000,000,000,000,000,000,000 | 7 | net: frag, move LRU list maintenance outside of rwlock
Updating the fragmentation queues LRU (Least-Recently-Used) list,
required taking the hash writer lock. However, the LRU list isn't
tied to the hash at all, so we can use a separate lock for it.
Original-idea-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Je... |
static int fsmMkdirs(rpmfiles files, rpmfs fs, rpmPlugins plugins)
{
DNLI_t dnli = dnlInitIterator(files, fs, 0);
struct stat sb;
const char *dpath;
int rc = 0;
int i;
size_t ldnlen = 0;
const char * ldn = NULL;
while ((dpath = dnlNextIterator(dnli)) != NULL) {
size_t dnlen = strlen(dp... | 0 | [] | rpm | 96ec957e281220f8e137a2d5eb23b83a6377d556 | 136,062,667,058,519,470,000,000,000,000,000,000,000 | 80 | Validate intermediate symlinks during installation, CVE-2021-35939
Whenever directory changes during unpacking, walk the entire tree from
starting from / and validate any symlinks crossed, fail the install
on invalid links.
This is the first of step of many towards securing our file operations
against local tamperers... |
posix_acl_from_xattr(struct user_namespace *user_ns,
const void *value, size_t size)
{
const struct posix_acl_xattr_header *header = value;
const struct posix_acl_xattr_entry *entry = (const void *)(header + 1), *end;
int count;
struct posix_acl *acl;
struct posix_acl_entry *acl_e;
if (!value)
return NU... | 0 | [
"CWE-284",
"CWE-285"
] | linux | 497de07d89c1410d76a15bec2bb41f24a2a89f31 | 186,340,804,272,230,620,000,000,000,000,000,000,000 | 63 | tmpfs: clear S_ISGID when setting posix ACLs
This change was missed the tmpfs modification in In CVE-2016-7097
commit 073931017b49 ("posix_acl: Clear SGID bit when setting
file permissions")
It can test by xfstest generic/375, which failed to clear
setgid bit in the following test case on tmpfs:
touch $testfile
c... |
SpoolssRFFPCNEX_r(tvbuff_t *tvb, int offset,
packet_info *pinfo, proto_tree *tree,
dcerpc_info *di, guint8 *drep _U_)
{
/* Parse packet */
offset = dissect_doserror(
tvb, offset, pinfo, tree, di, drep, hf_rc, NULL);
return offset;
} | 0 | [
"CWE-399"
] | wireshark | b4d16b4495b732888e12baf5b8a7e9bf2665e22b | 74,637,867,313,206,690,000,000,000,000,000,000,000 | 11 | SPOOLSS: Try to avoid an infinite loop.
Use tvb_reported_length_remaining in dissect_spoolss_uint16uni. Make
sure our offset always increments in dissect_spoolss_keybuffer.
Change-Id: I7017c9685bb2fa27161d80a03b8fca4ef630e793
Reviewed-on: https://code.wireshark.org/review/14687
Reviewed-by: Gerald Combs <gerald@wires... |
net_evhttp_bind(struct evhttp *evhttp, short unsigned port, const char *log_service_name)
{
const char *bind_address;
bool v6_enabled;
int ret;
bind_address = cfg_getstr(cfg_getsec(cfg, "general"), "bind_address");
if (bind_address)
evhttp_bind_socket(evhttp, bind_address, port);
// For Linux, we coul... | 0 | [
"CWE-416"
] | owntone-server | 246d8ae0cef27377e5dfe9ee3ad87e864d6b6266 | 283,225,606,082,170,800,000,000,000,000,000,000,000 | 37 | [misc] Fix use-after-free in net_bind()
Thanks to Ba Jinsheng for reporting this bug |
void rtw_indicate_wx_assoc_event(struct adapter *padapter)
{
union iwreq_data wrqu;
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
memset(&wrqu, 0, sizeof(union iwreq_data));
wrqu.ap_addr.sa_family = ARPHRD_ETHER;
memcpy(wrqu.ap_addr.sa_data, pmlmepriv->cur_network.network.MacAddress, ETH_ALEN);
DBG_88E_L... | 0 | [
"CWE-787"
] | linux | 74b6b20df8cfe90ada777d621b54c32e69e27cd7 | 287,149,318,449,578,400,000,000,000,000,000,000,000 | 14 | staging: rtl8188eu: prevent ->ssid overflow in rtw_wx_set_scan()
This code has a check to prevent read overflow but it needs another
check to prevent writing beyond the end of the ->ssid[] array.
Fixes: a2c60d42d97c ("staging: r8188eu: Add files for new driver - part 16")
Signed-off-by: Dan Carpenter <dan.carpenter@o... |
MagickExport MagickBooleanType CopyImagePixels(Image *image,
const Image *source_image,const RectangleInfo *geometry,
const OffsetInfo *offset,ExceptionInfo *exception)
{
#define CopyImageTag "Copy/Image"
CacheView
*image_view,
*source_view;
MagickBooleanType
status;
MagickOffsetType
progr... | 0 | [
"CWE-665"
] | ImageMagick6 | 27b1c74979ac473a430e266ff6c4b645664bc805 | 276,282,131,329,778,650,000,000,000,000,000,000,000 | 101 | https://github.com/ImageMagick/ImageMagick/issues/1522 |
ShutdownWrap* LibuvStreamWrap::CreateShutdownWrap(Local<Object> object) {
return new LibuvShutdownWrap(this, object);
} | 0 | [
"CWE-416"
] | node | 7f178663ebffc82c9f8a5a1b6bf2da0c263a30ed | 226,313,029,005,183,600,000,000,000,000,000,000,000 | 3 | src: use unique_ptr for WriteWrap
This commit attempts to avoid a use-after-free error by using unqiue_ptr
and passing a reference to it.
CVE-ID: CVE-2020-8265
Fixes: https://github.com/nodejs-private/node-private/issues/227
PR-URL: https://github.com/nodejs-private/node-private/pull/238
Reviewed-By: Michael Dawson <... |
mp_sint32 PlayerGeneric::adjustBufferSize(mp_uint32 numBeats)
{
return setBufferSize(beatPacketsToBufferSize(numBeats));
} | 0 | [
"CWE-416"
] | MilkyTracker | 7afd55c42ad80d01a339197a2d8b5461d214edaf | 270,184,931,957,842,830,000,000,000,000,000,000,000 | 4 | Fix use-after-free in PlayerGeneric destructor |
follow_huge_pgd(struct mm_struct *mm, unsigned long address, pgd_t *pgd, int flags)
{
if (flags & FOLL_GET)
return NULL;
return pte_page(*(pte_t *)pgd) + ((address & ~PGDIR_MASK) >> PAGE_SHIFT);
} | 0 | [
"CWE-703"
] | linux | 5af10dfd0afc559bb4b0f7e3e8227a1578333995 | 72,987,231,344,863,410,000,000,000,000,000,000,000 | 7 | userfaultfd: hugetlbfs: remove superfluous page unlock in VM_SHARED case
huge_add_to_page_cache->add_to_page_cache implicitly unlocks the page
before returning in case of errors.
The error returned was -EEXIST by running UFFDIO_COPY on a non-hole
offset of a VM_SHARED hugetlbfs mapping. It was an userland bug that
t... |
static ALWAYS_INLINE char jslNextCh() {
return (char)(lex->it.ptr ? READ_FLASH_UINT8(&lex->it.ptr[lex->it.charIdx]) : 0);
} | 0 | [
"CWE-787"
] | Espruino | bed844f109b6c222816740555068de2e101e8018 | 15,250,674,647,901,554,000,000,000,000,000,000,000 | 3 | remove strncpy usage as it's effectively useless, replace with an assertion since fn is only used internally (fix #1426) |
queryfree (struct dns_transmit *d)
{
mergefree (d);
if (!d->query)
return;
alloc_free (d->query);
d->query = 0;
} | 0 | [
"CWE-362"
] | ndjbdns | 177b5522e9b3d25778001c8cebfddd4d2973fcfd | 156,667,957,817,419,560,000,000,000,000,000,000,000 | 8 | Merge identical outgoing requests - patch 2.
This patch fixes dnscache to combine *same* client queries into one
single outgoing request, thus securing the server from possible cache
poisoning attacks. The merges operation takes place in the
dns_transmit layer, rather than between query and dns_transmit layers,
as don... |
HTTPSession::closeWhenIdle() {
// If drain() already called, this is a noop
drain();
// Generate the second GOAWAY now. No-op if second GOAWAY already sent.
if (codec_->generateGoaway(writeBuf_,
codec_->getLastIncomingStreamID(),
ErrorCode::NO_ERROR)) {
... | 0 | [
"CWE-20"
] | proxygen | 0600ebe59c3e82cd012def77ca9ca1918da74a71 | 75,535,984,318,006,750,000,000,000,000,000,000,000 | 14 | Check that a secondary auth manager is set before dereferencing.
Summary: CVE-2018-6343
Reviewed By: mingtaoy
Differential Revision: D12994423
fbshipit-source-id: 9229ec11da8085f1fa153595e8e5353e19d06fb7 |
CairoImage::~CairoImage () {
if (image)
cairo_surface_destroy (image);
} | 0 | [] | poppler | abf167af8b15e5f3b510275ce619e6fdb42edd40 | 174,447,952,840,955,720,000,000,000,000,000,000,000 | 4 | Implement tiling/patterns in SplashOutputDev
Fixes bug 13518 |
static int ssl_parse_certificate_verify( mbedtls_ssl_context *ssl )
{
const mbedtls_ssl_ciphersuite_t *ciphersuite_info =
ssl->handshake->ciphersuite_info;
MBEDTLS_SSL_DEBUG_MSG( 2, ( "=> parse certificate verify" ) );
if( !mbedtls_ssl_ciphersuite_cert_req_allowed( ciphersuite_info ) )
{
... | 0 | [
"CWE-787"
] | mbedtls | f333dfab4a6c2d8a604a61558a8f783145161de4 | 27,167,504,562,641,280,000,000,000,000,000,000,000 | 17 | More SSL debug messages for ClientHello parsing
In particular, be verbose when checking the ClientHello cookie in a possible
DTLS reconnection.
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com> |
static inline mm_segment_t snd_enter_user(void)
{
mm_segment_t fs = get_fs();
set_fs(get_ds());
return fs;
} | 0 | [
"CWE-703"
] | linux | 030e2c78d3a91dd0d27fef37e91950dde333eba1 | 62,531,765,072,526,830,000,000,000,000,000,000,000 | 6 | ALSA: seq: Fix missing NULL check at remove_events ioctl
snd_seq_ioctl_remove_events() calls snd_seq_fifo_clear()
unconditionally even if there is no FIFO assigned, and this leads to
an Oops due to NULL dereference. The fix is just to add a proper NULL
check.
Reported-by: Dmitry Vyukov <dvyukov@google.com>
Tested-by... |
static struct clk ** __init sunxi_divs_clk_setup(struct device_node *node,
const struct divs_data *data)
{
struct clk_onecell_data *clk_data;
const char *parent;
const char *clk_name;
struct clk **clks, *pclk;
struct clk_hw *gate_hw, *rate_hw;
const struct clk_ops *rate_ops;
struct clk_gate *gate = NULL;
... | 1 | [
"CWE-476"
] | linux | fcdf445ff42f036d22178b49cf64e92d527c1330 | 216,719,677,384,219,000,000,000,000,000,000,000,000 | 164 | clk-sunxi: fix a missing-check bug in sunxi_divs_clk_setup()
In sunxi_divs_clk_setup(), 'derived_name' is allocated by kstrndup().
It returns NULL when fails. 'derived_name' should be checked.
Signed-off-by: Gen Zhang <blackgod016574@gmail.com>
Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com> |
static int sr9700_get_eeprom_len(struct net_device *netdev)
{
return SR_EEPROM_LEN;
} | 0 | [] | linux | e9da0b56fe27206b49f39805f7dcda8a89379062 | 117,617,516,829,996,140,000,000,000,000,000,000,000 | 4 | sr9700: sanity check for packet length
A malicious device can leak heap data to user space
providing bogus frame lengths. Introduce a sanity check.
Signed-off-by: Oliver Neukum <oneukum@suse.com>
Reviewed-by: Grant Grundler <grundler@chromium.org>
Signed-off-by: David S. Miller <davem@davemloft.net> |
searchAnchor(AnchorList *al, char *str)
{
int i;
Anchor *a;
if (al == NULL)
return NULL;
for (i = 0; i < al->nanchor; i++) {
a = &al->anchors[i];
if (a->hseq < 0)
continue;
if (!strcmp(a->url, str))
return a;
}
return NULL;
} | 0 | [
"CWE-119"
] | w3m | 4e464819dd360ffd3d58fa2a89216fe413cfcc74 | 184,175,265,996,366,580,000,000,000,000,000,000,000 | 15 | Prevent segfault due to buffer overflows in addMultirowsForm
Bug-Debian: https://github.com/tats/w3m/issues/21
Bug-Debian: https://github.com/tats/w3m/issues/26 |
static ssize_t show_compression(struct device *cd,
struct device_attribute *attr, char *buf)
{
struct video_device *vdev =
container_of(cd, struct video_device, dev);
struct usb_usbvision *usbvision = video_get_drvdata(vdev);
return sprintf(buf, "%s\n",
YES_NO(usbvision->isoc_mode == ISOC_MODE_COMPRES... | 0 | [
"CWE-17"
] | media_tree | fa52bd506f274b7619955917abfde355e3d19ffe | 199,019,805,302,405,060,000,000,000,000,000,000,000 | 9 | [media] usbvision: fix crash on detecting device with invalid configuration
The usbvision driver crashes when a specially crafted usb device with invalid
number of interfaces or endpoints is detected. This fix adds checks that the
device has proper configuration expected by the driver.
Reported-by: Ralf Spenneberg <r... |
static void tcp_urg(struct sock *sk, struct sk_buff *skb, const struct tcphdr *th)
{
struct tcp_sock *tp = tcp_sk(sk);
/* Check if we get a new urgent pointer - normally not. */
if (th->urg)
tcp_check_urg(sk, th);
/* Do we wait for any urgent data? - normally not... */
if (tp->urg_data == TCP_URG_NOTYET) {
u... | 0 | [
"CWE-703",
"CWE-189"
] | linux | 8b8a321ff72c785ed5e8b4cf6eda20b35d427390 | 247,044,875,240,414,930,000,000,000,000,000,000,000 | 24 | tcp: fix zero cwnd in tcp_cwnd_reduction
Patch 3759824da87b ("tcp: PRR uses CRB mode by default and SS mode
conditionally") introduced a bug that cwnd may become 0 when both
inflight and sndcnt are 0 (cwnd = inflight + sndcnt). This may lead
to a div-by-zero if the connection starts another cwnd reduction
phase by set... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.