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
null
null
null
https://github.com/chromium/chromium/commit/c4363d1ca65494cb7b271625e1ff6541a9f593c9
c4363d1ca65494cb7b271625e1ff6541a9f593c9
ozone: evdev: Add a couple more trace events Add trace event inside each read notification for evdev. BUG=none TEST=chrome://tracing in link_freon Review URL: https://codereview.chromium.org/1110693003 Cr-Commit-Position: refs/heads/master@{#327110}
void TouchEventConverterEvdev::UpdateTrackingId(int slot, int tracking_id) { InProgressTouchEvdev* event = &events_[slot]; if (event->tracking_id == tracking_id) return; event->tracking_id = tracking_id; event->touching = (tracking_id >= 0); event->altered = true; if (tracking_id >= 0) event->cancelled = false; }
void TouchEventConverterEvdev::UpdateTrackingId(int slot, int tracking_id) { InProgressTouchEvdev* event = &events_[slot]; if (event->tracking_id == tracking_id) return; event->tracking_id = tracking_id; event->touching = (tracking_id >= 0); event->altered = true; if (tracking_id >= 0) event->cancelled = false; }
C
Chrome
0
CVE-2017-11144
https://www.cvedetails.com/cve/CVE-2017-11144/
CWE-754
https://git.php.net/?p=php-src.git;a=commit;h=73cabfedf519298e1a11192699f44d53c529315e
73cabfedf519298e1a11192699f44d53c529315e
null
PHP_FUNCTION(openssl_x509_export) { X509 * cert; zval * zcert, *zout; zend_bool notext = 1; BIO * bio_out; zend_resource *certresource; if (zend_parse_parameters(ZEND_NUM_ARGS(), "zz/|b", &zcert, &zout, &notext) == FAILURE) { return; } RETVAL_FALSE; cert = php_openssl_x509_from_zval(zcert, 0, &certresource); if (cert == NULL) { php_error_docref(NULL, E_WARNING, "cannot get cert from parameter 1"); return; } bio_out = BIO_new(BIO_s_mem()); if (!notext) { X509_print(bio_out, cert); } if (PEM_write_bio_X509(bio_out, cert)) { BUF_MEM *bio_buf; zval_dtor(zout); BIO_get_mem_ptr(bio_out, &bio_buf); ZVAL_STRINGL(zout, bio_buf->data, bio_buf->length); RETVAL_TRUE; } if (certresource == NULL && cert) { X509_free(cert); } BIO_free(bio_out); }
PHP_FUNCTION(openssl_x509_export) { X509 * cert; zval * zcert, *zout; zend_bool notext = 1; BIO * bio_out; zend_resource *certresource; if (zend_parse_parameters(ZEND_NUM_ARGS(), "zz/|b", &zcert, &zout, &notext) == FAILURE) { return; } RETVAL_FALSE; cert = php_openssl_x509_from_zval(zcert, 0, &certresource); if (cert == NULL) { php_error_docref(NULL, E_WARNING, "cannot get cert from parameter 1"); return; } bio_out = BIO_new(BIO_s_mem()); if (!notext) { X509_print(bio_out, cert); } if (PEM_write_bio_X509(bio_out, cert)) { BUF_MEM *bio_buf; zval_dtor(zout); BIO_get_mem_ptr(bio_out, &bio_buf); ZVAL_STRINGL(zout, bio_buf->data, bio_buf->length); RETVAL_TRUE; } if (certresource == NULL && cert) { X509_free(cert); } BIO_free(bio_out); }
C
php
0
CVE-2016-5096
https://www.cvedetails.com/cve/CVE-2016-5096/
CWE-190
https://github.com/php/php-src/commit/abd159cce48f3e34f08e4751c568e09677d5ec9c?w=1
abd159cce48f3e34f08e4751c568e09677d5ec9c?w=1
Fix bug #72114 - int/size_t confusion in fread
PHP_FUNCTION(realpath) { char *filename; int filename_len; char resolved_path_buff[MAXPATHLEN]; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p", &filename, &filename_len) == FAILURE) { return; } if (VCWD_REALPATH(filename, resolved_path_buff)) { if (php_check_open_basedir(resolved_path_buff TSRMLS_CC)) { RETURN_FALSE; } #ifdef ZTS if (VCWD_ACCESS(resolved_path_buff, F_OK)) { RETURN_FALSE; } #endif RETURN_STRING(resolved_path_buff, 1); } else { RETURN_FALSE; } }
PHP_FUNCTION(realpath) { char *filename; int filename_len; char resolved_path_buff[MAXPATHLEN]; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p", &filename, &filename_len) == FAILURE) { return; } if (VCWD_REALPATH(filename, resolved_path_buff)) { if (php_check_open_basedir(resolved_path_buff TSRMLS_CC)) { RETURN_FALSE; } #ifdef ZTS if (VCWD_ACCESS(resolved_path_buff, F_OK)) { RETURN_FALSE; } #endif RETURN_STRING(resolved_path_buff, 1); } else { RETURN_FALSE; } }
C
php-src
0
CVE-2013-2871
https://www.cvedetails.com/cve/CVE-2013-2871/
CWE-20
https://github.com/chromium/chromium/commit/bb9cfb0aba25f4b13e57bdd4a9fac80ba071e7b9
bb9cfb0aba25f4b13e57bdd4a9fac80ba071e7b9
Setting input.x-webkit-speech should not cause focus change In r150866, we introduced element()->focus() in destroyShadowSubtree() to retain focus on <input> when its type attribute gets changed. But when x-webkit-speech attribute is changed, the element is detached before calling destroyShadowSubtree() and element()->focus() failed This patch moves detach() after destroyShadowSubtree() to fix the problem. BUG=243818 TEST=fast/forms/input-type-change-focusout.html NOTRY=true Review URL: https://chromiumcodereview.appspot.com/16084005 git-svn-id: svn://svn.chromium.org/blink/trunk@151444 bbb929c8-8fbe-4397-9dbb-9b2b20218538
const String& HTMLInputElement::suggestedValue() const { return m_suggestedValue; }
const String& HTMLInputElement::suggestedValue() const { return m_suggestedValue; }
C
Chrome
0
CVE-2014-5139
https://www.cvedetails.com/cve/CVE-2014-5139/
null
https://git.openssl.org/gitweb/?p=openssl.git;a=commit;h=80bd7b41b30af6ee96f519e629463583318de3b0
80bd7b41b30af6ee96f519e629463583318de3b0
null
void ssl_set_client_disabled(SSL *s) { CERT *c = s->cert; c->mask_a = 0; c->mask_k = 0; /* Don't allow TLS 1.2 only ciphers if we don't suppport them */ if (!SSL_CLIENT_USE_TLS1_2_CIPHERS(s)) c->mask_ssl = SSL_TLSV1_2; else c->mask_ssl = 0; ssl_set_sig_mask(&c->mask_a, s, SSL_SECOP_SIGALG_MASK); /* Disable static DH if we don't include any appropriate * signature algorithms. */ if (c->mask_a & SSL_aRSA) c->mask_k |= SSL_kDHr|SSL_kECDHr; if (c->mask_a & SSL_aDSS) c->mask_k |= SSL_kDHd; if (c->mask_a & SSL_aECDSA) c->mask_k |= SSL_kECDHe; #ifndef OPENSSL_NO_KRB5 if (!kssl_tgt_is_available(s->kssl_ctx)) { c->mask_a |= SSL_aKRB5; c->mask_k |= SSL_kKRB5; } #endif #ifndef OPENSSL_NO_PSK /* with PSK there must be client callback set */ if (!s->psk_client_callback) { c->mask_a |= SSL_aPSK; c->mask_k |= SSL_kPSK; } #endif /* OPENSSL_NO_PSK */ #ifndef OPENSSL_NO_SRP if (!(s->srp_ctx.srp_Mask & SSL_kSRP)) { c->mask_a |= SSL_aSRP; c->mask_k |= SSL_kSRP; } #endif c->valid = 1; }
void ssl_set_client_disabled(SSL *s) { CERT *c = s->cert; c->mask_a = 0; c->mask_k = 0; /* Don't allow TLS 1.2 only ciphers if we don't suppport them */ if (!SSL_CLIENT_USE_TLS1_2_CIPHERS(s)) c->mask_ssl = SSL_TLSV1_2; else c->mask_ssl = 0; ssl_set_sig_mask(&c->mask_a, s, SSL_SECOP_SIGALG_MASK); /* Disable static DH if we don't include any appropriate * signature algorithms. */ if (c->mask_a & SSL_aRSA) c->mask_k |= SSL_kDHr|SSL_kECDHr; if (c->mask_a & SSL_aDSS) c->mask_k |= SSL_kDHd; if (c->mask_a & SSL_aECDSA) c->mask_k |= SSL_kECDHe; #ifndef OPENSSL_NO_KRB5 if (!kssl_tgt_is_available(s->kssl_ctx)) { c->mask_a |= SSL_aKRB5; c->mask_k |= SSL_kKRB5; } #endif #ifndef OPENSSL_NO_PSK /* with PSK there must be client callback set */ if (!s->psk_client_callback) { c->mask_a |= SSL_aPSK; c->mask_k |= SSL_kPSK; } #endif /* OPENSSL_NO_PSK */ c->valid = 1; }
C
openssl
1
CVE-2018-16425
https://www.cvedetails.com/cve/CVE-2018-16425/
CWE-415
https://github.com/OpenSC/OpenSC/commit/360e95d45ac4123255a4c796db96337f332160ad#diff-d643a0fa169471dbf2912f4866dc49c5
360e95d45ac4123255a4c796db96337f332160ad#diff-d643a0fa169471dbf2912f4866dc49c5
fixed out of bounds writes Thanks to Eric Sesterhenn from X41 D-SEC GmbH for reporting the problems.
const char * util_acl_to_str(const sc_acl_entry_t *e) { static char line[80], buf[20]; unsigned int acl; if (e == NULL) return "N/A"; line[0] = 0; while (e != NULL) { acl = e->method; switch (acl) { case SC_AC_UNKNOWN: return "N/A"; case SC_AC_NEVER: return "NEVR"; case SC_AC_NONE: return "NONE"; case SC_AC_CHV: strcpy(buf, "CHV"); if (e->key_ref != SC_AC_KEY_REF_NONE) sprintf(buf + 3, "%d", e->key_ref); break; case SC_AC_TERM: strcpy(buf, "TERM"); break; case SC_AC_PRO: strcpy(buf, "PROT"); break; case SC_AC_AUT: strcpy(buf, "AUTH"); if (e->key_ref != SC_AC_KEY_REF_NONE) sprintf(buf + 4, "%d", e->key_ref); break; case SC_AC_SEN: strcpy(buf, "Sec.Env. "); if (e->key_ref != SC_AC_KEY_REF_NONE) sprintf(buf + 3, "#%d", e->key_ref); break; case SC_AC_SCB: strcpy(buf, "Sec.ControlByte "); if (e->key_ref != SC_AC_KEY_REF_NONE) sprintf(buf + 3, "Ox%X", e->key_ref); break; case SC_AC_IDA: strcpy(buf, "PKCS#15 AuthID "); if (e->key_ref != SC_AC_KEY_REF_NONE) sprintf(buf + 3, "#%d", e->key_ref); break; default: strcpy(buf, "????"); break; } strncat(line, buf, sizeof line); strncat(line, " ", sizeof line); e = e->next; } line[(sizeof line)-1] = '\0'; /* make sure it's NUL terminated */ line[strlen(line)-1] = 0; /* get rid of trailing space */ return line; }
const char * util_acl_to_str(const sc_acl_entry_t *e) { static char line[80], buf[20]; unsigned int acl; if (e == NULL) return "N/A"; line[0] = 0; while (e != NULL) { acl = e->method; switch (acl) { case SC_AC_UNKNOWN: return "N/A"; case SC_AC_NEVER: return "NEVR"; case SC_AC_NONE: return "NONE"; case SC_AC_CHV: strcpy(buf, "CHV"); if (e->key_ref != SC_AC_KEY_REF_NONE) sprintf(buf + 3, "%d", e->key_ref); break; case SC_AC_TERM: strcpy(buf, "TERM"); break; case SC_AC_PRO: strcpy(buf, "PROT"); break; case SC_AC_AUT: strcpy(buf, "AUTH"); if (e->key_ref != SC_AC_KEY_REF_NONE) sprintf(buf + 4, "%d", e->key_ref); break; case SC_AC_SEN: strcpy(buf, "Sec.Env. "); if (e->key_ref != SC_AC_KEY_REF_NONE) sprintf(buf + 3, "#%d", e->key_ref); break; case SC_AC_SCB: strcpy(buf, "Sec.ControlByte "); if (e->key_ref != SC_AC_KEY_REF_NONE) sprintf(buf + 3, "Ox%X", e->key_ref); break; case SC_AC_IDA: strcpy(buf, "PKCS#15 AuthID "); if (e->key_ref != SC_AC_KEY_REF_NONE) sprintf(buf + 3, "#%d", e->key_ref); break; default: strcpy(buf, "????"); break; } strcat(line, buf); strcat(line, " "); e = e->next; } line[strlen(line)-1] = 0; /* get rid of trailing space */ return line; }
C
OpenSC
1
CVE-2009-3605
https://www.cvedetails.com/cve/CVE-2009-3605/
CWE-189
https://cgit.freedesktop.org/poppler/poppler/commit/?id=7b2d314a61fd0e12f47c62996cb49ec0d1ba747a
7b2d314a61fd0e12f47c62996cb49ec0d1ba747a
null
GfxDeviceGrayColorSpace::GfxDeviceGrayColorSpace() { }
GfxDeviceGrayColorSpace::GfxDeviceGrayColorSpace() { }
CPP
poppler
0
CVE-2018-18839
https://www.cvedetails.com/cve/CVE-2018-18839/
CWE-200
https://github.com/netdata/netdata/commit/92327c9ec211bd1616315abcb255861b130b97ca
92327c9ec211bd1616315abcb255861b130b97ca
fixed vulnerabilities identified by red4sec.com (#4521)
inline int web_client_api_request_v1(RRDHOST *host, struct web_client *w, char *url) { static int initialized = 0; int i; if(unlikely(initialized == 0)) { initialized = 1; for(i = 0; api_commands[i].command ; i++) api_commands[i].hash = simple_hash(api_commands[i].command); } char *tok = mystrsep(&url, "/?&"); if(tok && *tok) { debug(D_WEB_CLIENT, "%llu: Searching for API v1 command '%s'.", w->id, tok); uint32_t hash = simple_hash(tok); for(i = 0; api_commands[i].command ;i++) { if(unlikely(hash == api_commands[i].hash && !strcmp(tok, api_commands[i].command))) { if(unlikely(api_commands[i].acl != WEB_CLIENT_ACL_NOCHECK) && !(w->acl & api_commands[i].acl)) return web_client_permission_denied(w); return api_commands[i].callback(host, w, url); } } buffer_flush(w->response.data); buffer_strcat(w->response.data, "Unsupported v1 API command: "); buffer_strcat_htmlescape(w->response.data, tok); return 404; } else { buffer_flush(w->response.data); buffer_sprintf(w->response.data, "Which API v1 command?"); return 400; } }
inline int web_client_api_request_v1(RRDHOST *host, struct web_client *w, char *url) { static int initialized = 0; int i; if(unlikely(initialized == 0)) { initialized = 1; for(i = 0; api_commands[i].command ; i++) api_commands[i].hash = simple_hash(api_commands[i].command); } char *tok = mystrsep(&url, "/?&"); if(tok && *tok) { debug(D_WEB_CLIENT, "%llu: Searching for API v1 command '%s'.", w->id, tok); uint32_t hash = simple_hash(tok); for(i = 0; api_commands[i].command ;i++) { if(unlikely(hash == api_commands[i].hash && !strcmp(tok, api_commands[i].command))) { if(unlikely(api_commands[i].acl != WEB_CLIENT_ACL_NOCHECK) && !(w->acl & api_commands[i].acl)) return web_client_permission_denied(w); return api_commands[i].callback(host, w, url); } } buffer_flush(w->response.data); buffer_strcat(w->response.data, "Unsupported v1 API command: "); buffer_strcat_htmlescape(w->response.data, tok); return 404; } else { buffer_flush(w->response.data); buffer_sprintf(w->response.data, "Which API v1 command?"); return 400; } }
C
netdata
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 <[email protected]> Reviewed-by: Xiyuan Xia <[email protected]> Auto-Submit: Manu Cornet <[email protected]> Cr-Commit-Position: refs/heads/master@{#631752}
void ShelfWidget::Initialize() { OnSessionStateChanged(Shell::Get()->session_controller()->GetSessionState()); }
void ShelfWidget::Initialize() { OnSessionStateChanged(Shell::Get()->session_controller()->GetSessionState()); }
C
Chrome
0
CVE-2016-1640
https://www.cvedetails.com/cve/CVE-2016-1640/
CWE-17
https://github.com/chromium/chromium/commit/0a1c15fecb1240ab909e1431b6127410c3b380e0
0a1c15fecb1240ab909e1431b6127410c3b380e0
Make the webstore inline install dialog be tab-modal Also clean up a few minor lint errors while I'm in here. BUG=550047 Review URL: https://codereview.chromium.org/1496033003 Cr-Commit-Position: refs/heads/master@{#363925}
void ExpandableContainerView::DetailsView::AddDetail( const base::string16& detail) { layout_->StartRowWithPadding(0, 0, 0, views::kRelatedControlSmallVerticalSpacing); views::Label* detail_label = new views::Label(PrepareForDisplay(detail, false)); detail_label->SetMultiLine(true); detail_label->SetHorizontalAlignment(gfx::ALIGN_LEFT); layout_->AddView(detail_label); }
void ExpandableContainerView::DetailsView::AddDetail( const base::string16& detail) { layout_->StartRowWithPadding(0, 0, 0, views::kRelatedControlSmallVerticalSpacing); views::Label* detail_label = new views::Label(PrepareForDisplay(detail, false)); detail_label->SetMultiLine(true); detail_label->SetHorizontalAlignment(gfx::ALIGN_LEFT); layout_->AddView(detail_label); }
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
BookmarkEventRouter::~BookmarkEventRouter() { if (model_) { model_->RemoveObserver(this); } }
BookmarkEventRouter::~BookmarkEventRouter() { if (model_) { model_->RemoveObserver(this); } }
C
Chrome
0
CVE-2009-3605
https://www.cvedetails.com/cve/CVE-2009-3605/
CWE-189
https://cgit.freedesktop.org/poppler/poppler/commit/?id=7b2d314a61fd0e12f47c62996cb49ec0d1ba747a
7b2d314a61fd0e12f47c62996cb49ec0d1ba747a
null
GooString *JBIG2Stream::getPSFilter(int psLevel, char *indent) { return NULL; }
GooString *JBIG2Stream::getPSFilter(int psLevel, char *indent) { return NULL; }
CPP
poppler
0
CVE-2019-5837
https://www.cvedetails.com/cve/CVE-2019-5837/
CWE-200
https://github.com/chromium/chromium/commit/04aaacb936a08d70862d6d9d7e8354721ae46be8
04aaacb936a08d70862d6d9d7e8354721ae46be8
Reland "AppCache: Add padding to cross-origin responses." This is a reland of 85b389caa7d725cdd31f59e9a2b79ff54804b7b7 Initialized CacheRecord::padding_size to 0. Original change's description: > AppCache: Add padding to cross-origin responses. > > Bug: 918293 > Change-Id: I4f16640f06feac009d6bbbb624951da6d2669f6c > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1488059 > Commit-Queue: Staphany Park <[email protected]> > Reviewed-by: Victor Costan <[email protected]> > Reviewed-by: Marijn Kruisselbrink <[email protected]> > Cr-Commit-Position: refs/heads/master@{#644624} Bug: 918293 Change-Id: Ie1d3f99c7e8a854d33255a4d66243da2ce16441c Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1539906 Reviewed-by: Victor Costan <[email protected]> Commit-Queue: Staphany Park <[email protected]> Cr-Commit-Position: refs/heads/master@{#644719}
bool AppCacheDatabase::DeleteNamespacesForCache(int64_t cache_id) { if (!LazyOpen(kDontCreate)) return false; static const char kSql[] = "DELETE FROM Namespaces WHERE cache_id = ?"; sql::Statement statement(db_->GetCachedStatement(SQL_FROM_HERE, kSql)); statement.BindInt64(0, cache_id); return statement.Run(); }
bool AppCacheDatabase::DeleteNamespacesForCache(int64_t cache_id) { if (!LazyOpen(kDontCreate)) return false; static const char kSql[] = "DELETE FROM Namespaces WHERE cache_id = ?"; sql::Statement statement(db_->GetCachedStatement(SQL_FROM_HERE, kSql)); statement.BindInt64(0, cache_id); return statement.Run(); }
C
Chrome
0
CVE-2014-8172
https://www.cvedetails.com/cve/CVE-2014-8172/
CWE-17
https://github.com/torvalds/linux/commit/eee5cc2702929fd41cce28058dc6d6717f723f87
eee5cc2702929fd41cce28058dc6d6717f723f87
get rid of s_files and files_lock The only thing we need it for is alt-sysrq-r (emergency remount r/o) and these days we can do just as well without going through the list of files. Signed-off-by: Al Viro <[email protected]>
SYSCALL_DEFINE3(chown, const char __user *, filename, uid_t, user, gid_t, group) { return sys_fchownat(AT_FDCWD, filename, user, group, 0); }
SYSCALL_DEFINE3(chown, const char __user *, filename, uid_t, user, gid_t, group) { return sys_fchownat(AT_FDCWD, filename, user, group, 0); }
C
linux
0
null
null
null
https://github.com/chromium/chromium/commit/b7e899141194fa27d55a990e38ae8bdcc5183a90
b7e899141194fa27d55a990e38ae8bdcc5183a90
C++ readability change for cindylau. BUG=none TEST=none Review URL: http://codereview.chromium.org/2090008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@48733 0039d316-1c4b-4281-b951-d872f2087c98
void AppendMatchingCookiesToList( net::CookieStore* cookie_store, const std::string& store_id, const GURL& url, const DictionaryValue* details, const Extension* extension, ListValue* match_list) { net::CookieMonster::CookieList all_cookies = GetCookieListFromStore( cookie_store, url); net::CookieMonster::CookieList::const_iterator it; for (it = all_cookies.begin(); it != all_cookies.end(); ++it) { GURL cookie_domain_url = GetURLFromCookiePair(*it); if (!extension->HasHostPermission(cookie_domain_url)) continue; extension_cookies_helpers::MatchFilter filter(details); if (filter.MatchesCookie(*it)) match_list->Append(CreateCookieValue(*it, store_id)); } }
void AppendMatchingCookiesToList( net::CookieStore* cookie_store, const std::string& store_id, const GURL& url, const DictionaryValue* details, const Extension* extension, ListValue* match_list) { net::CookieMonster::CookieList all_cookies = GetCookieListFromStore( cookie_store, url); net::CookieMonster::CookieList::const_iterator it; for (it = all_cookies.begin(); it != all_cookies.end(); ++it) { GURL cookie_domain_url = GetURLFromCookiePair(*it); if (!extension->HasHostPermission(cookie_domain_url)) continue; extension_cookies_helpers::MatchFilter filter(details); if (filter.MatchesCookie(*it)) match_list->Append(CreateCookieValue(*it, store_id)); } }
C
Chrome
0
CVE-2018-8785
https://www.cvedetails.com/cve/CVE-2018-8785/
CWE-119
https://github.com/FreeRDP/FreeRDP/commit/602f4a2e14b41703b5f431de3154cd46a5750a2d
602f4a2e14b41703b5f431de3154cd46a5750a2d
Fixed CVE-2018-8785 Thanks to Eyal Itkin from Check Point Software Technologies.
static void zgfx_history_buffer_ring_write(ZGFX_CONTEXT* zgfx, const BYTE* src, size_t count) { UINT32 front; if (count <= 0) return; if (count > zgfx->HistoryBufferSize) { const size_t residue = count - zgfx->HistoryBufferSize; count = zgfx->HistoryBufferSize; src += residue; zgfx->HistoryIndex = (zgfx->HistoryIndex + residue) % zgfx->HistoryBufferSize; } if (zgfx->HistoryIndex + count <= zgfx->HistoryBufferSize) { CopyMemory(&(zgfx->HistoryBuffer[zgfx->HistoryIndex]), src, count); if ((zgfx->HistoryIndex += count) == zgfx->HistoryBufferSize) zgfx->HistoryIndex = 0; } else { front = zgfx->HistoryBufferSize - zgfx->HistoryIndex; CopyMemory(&(zgfx->HistoryBuffer[zgfx->HistoryIndex]), src, front); CopyMemory(zgfx->HistoryBuffer, &src[front], count - front); zgfx->HistoryIndex = count - front; } }
static void zgfx_history_buffer_ring_write(ZGFX_CONTEXT* zgfx, const BYTE* src, size_t count) { UINT32 front; if (count <= 0) return; if (count > zgfx->HistoryBufferSize) { const size_t residue = count - zgfx->HistoryBufferSize; count = zgfx->HistoryBufferSize; src += residue; zgfx->HistoryIndex = (zgfx->HistoryIndex + residue) % zgfx->HistoryBufferSize; } if (zgfx->HistoryIndex + count <= zgfx->HistoryBufferSize) { CopyMemory(&(zgfx->HistoryBuffer[zgfx->HistoryIndex]), src, count); if ((zgfx->HistoryIndex += count) == zgfx->HistoryBufferSize) zgfx->HistoryIndex = 0; } else { front = zgfx->HistoryBufferSize - zgfx->HistoryIndex; CopyMemory(&(zgfx->HistoryBuffer[zgfx->HistoryIndex]), src, front); CopyMemory(zgfx->HistoryBuffer, &src[front], count - front); zgfx->HistoryIndex = count - front; } }
C
FreeRDP
0
CVE-2017-5061
https://www.cvedetails.com/cve/CVE-2017-5061/
CWE-362
https://github.com/chromium/chromium/commit/5d78b84d39bd34bc9fce9d01c0dcd5a22a330d34
5d78b84d39bd34bc9fce9d01c0dcd5a22a330d34
(Reland) Discard compositor frames from unloaded web content This is a reland of https://codereview.chromium.org/2707243005/ with a small change to fix an uninitialized memory error that fails on MSAN bots. BUG=672847 [email protected], [email protected] CQ_INCLUDE_TRYBOTS=master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_site_isolation Review-Url: https://codereview.chromium.org/2731283003 Cr-Commit-Position: refs/heads/master@{#454954}
void LayerTreeHostImpl::ActivateSyncTree() { if (pending_tree_) { TRACE_EVENT_ASYNC_END0("cc", "PendingTree:waiting", pending_tree_.get()); DCHECK(pending_tree_duration_timer_); pending_tree_duration_timer_.reset(); pending_tree_->ProcessUIResourceRequestQueue(); if (pending_tree_->needs_full_tree_sync()) { TreeSynchronizer::SynchronizeTrees(pending_tree_.get(), active_tree_.get()); } if (active_tree_->property_trees()->changed) { if (pending_tree_->property_trees()->sequence_number == active_tree_->property_trees()->sequence_number) active_tree_->property_trees()->PushChangeTrackingTo( pending_tree_->property_trees()); else active_tree_->MoveChangeTrackingToLayers(); } active_tree_->property_trees()->PushOpacityIfNeeded( pending_tree_->property_trees()); TreeSynchronizer::PushLayerProperties(pending_tree(), active_tree()); pending_tree_->PushPropertiesTo(active_tree_.get()); if (!pending_tree_->LayerListIsEmpty()) pending_tree_->property_trees()->ResetAllChangeTracking(); DCHECK(!recycle_tree_); pending_tree_.swap(recycle_tree_); ActivateAnimations(); Mutate(CurrentBeginFrameArgs().frame_time); } else { active_tree_->ProcessUIResourceRequestQueue(); } UpdateViewportContainerSizes(); active_tree_->DidBecomeActive(); client_->RenewTreePriority(); if (!active_tree_->picture_layers().empty()) DidModifyTilePriorities(); tile_manager_.DidActivateSyncTree(); client_->OnCanDrawStateChanged(CanDraw()); client_->DidActivateSyncTree(); if (!tree_activation_callback_.is_null()) tree_activation_callback_.Run(); std::unique_ptr<PendingPageScaleAnimation> pending_page_scale_animation = active_tree_->TakePendingPageScaleAnimation(); if (pending_page_scale_animation) { StartPageScaleAnimation(pending_page_scale_animation->target_offset, pending_page_scale_animation->use_anchor, pending_page_scale_animation->scale, pending_page_scale_animation->duration); } UpdateRootLayerStateForSynchronousInputHandler(); }
void LayerTreeHostImpl::ActivateSyncTree() { if (pending_tree_) { TRACE_EVENT_ASYNC_END0("cc", "PendingTree:waiting", pending_tree_.get()); DCHECK(pending_tree_duration_timer_); pending_tree_duration_timer_.reset(); pending_tree_->ProcessUIResourceRequestQueue(); if (pending_tree_->needs_full_tree_sync()) { TreeSynchronizer::SynchronizeTrees(pending_tree_.get(), active_tree_.get()); } if (active_tree_->property_trees()->changed) { if (pending_tree_->property_trees()->sequence_number == active_tree_->property_trees()->sequence_number) active_tree_->property_trees()->PushChangeTrackingTo( pending_tree_->property_trees()); else active_tree_->MoveChangeTrackingToLayers(); } active_tree_->property_trees()->PushOpacityIfNeeded( pending_tree_->property_trees()); TreeSynchronizer::PushLayerProperties(pending_tree(), active_tree()); pending_tree_->PushPropertiesTo(active_tree_.get()); if (!pending_tree_->LayerListIsEmpty()) pending_tree_->property_trees()->ResetAllChangeTracking(); DCHECK(!recycle_tree_); pending_tree_.swap(recycle_tree_); ActivateAnimations(); Mutate(CurrentBeginFrameArgs().frame_time); } else { active_tree_->ProcessUIResourceRequestQueue(); } UpdateViewportContainerSizes(); active_tree_->DidBecomeActive(); client_->RenewTreePriority(); if (!active_tree_->picture_layers().empty()) DidModifyTilePriorities(); tile_manager_.DidActivateSyncTree(); client_->OnCanDrawStateChanged(CanDraw()); client_->DidActivateSyncTree(); if (!tree_activation_callback_.is_null()) tree_activation_callback_.Run(); std::unique_ptr<PendingPageScaleAnimation> pending_page_scale_animation = active_tree_->TakePendingPageScaleAnimation(); if (pending_page_scale_animation) { StartPageScaleAnimation(pending_page_scale_animation->target_offset, pending_page_scale_animation->use_anchor, pending_page_scale_animation->scale, pending_page_scale_animation->duration); } UpdateRootLayerStateForSynchronousInputHandler(); }
C
Chrome
0
CVE-2019-12981
https://www.cvedetails.com/cve/CVE-2019-12981/
CWE-119
https://github.com/libming/libming/pull/179/commits/3dc0338e4a36a3092720ebaa5b908ba3dca467d9
3dc0338e4a36a3092720ebaa5b908ba3dca467d9
SWFShape_setLeftFillStyle: prevent fill overflow
SWFShape_hideLine(SWFShape shape) { ShapeRecord record; if ( shape->isEnded ) return; if ( shape->isMorph ) return; record = addStyleRecord(shape); record.record.stateChange->line = 0; record.record.stateChange->flags |= SWF_SHAPE_LINESTYLEFLAG; }
SWFShape_hideLine(SWFShape shape) { ShapeRecord record; if ( shape->isEnded ) return; if ( shape->isMorph ) return; record = addStyleRecord(shape); record.record.stateChange->line = 0; record.record.stateChange->flags |= SWF_SHAPE_LINESTYLEFLAG; }
C
libming
0
CVE-2018-8099
https://www.cvedetails.com/cve/CVE-2018-8099/
CWE-415
https://github.com/libgit2/libgit2/commit/58a6fe94cb851f71214dbefac3f9bffee437d6fe
58a6fe94cb851f71214dbefac3f9bffee437d6fe
index: convert `read_entry` to return entry size via an out-param The function `read_entry` does not conform to our usual coding style of returning stuff via the out parameter and to use the return value for reporting errors. Due to most of our code conforming to that pattern, it has become quite natural for us to actually return `-1` in case there is any error, which has also slipped in with commit 5625d86b9 (index: support index v4, 2016-05-17). As the function returns an `size_t` only, though, the return value is wrapped around, causing the caller of `read_tree` to continue with an invalid index entry. Ultimately, this can lead to a double-free. Improve code and fix the bug by converting the function to return the index entry size via an out parameter and only using the return value to indicate errors. Reported-by: Krishna Ram Prakash R <[email protected]> Reported-by: Vivek Parikh <[email protected]>
GIT_INLINE(bool) is_file_or_link(const int filemode) { return (filemode == GIT_FILEMODE_BLOB || filemode == GIT_FILEMODE_BLOB_EXECUTABLE || filemode == GIT_FILEMODE_LINK); }
GIT_INLINE(bool) is_file_or_link(const int filemode) { return (filemode == GIT_FILEMODE_BLOB || filemode == GIT_FILEMODE_BLOB_EXECUTABLE || filemode == GIT_FILEMODE_LINK); }
C
libgit2
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 <[email protected]> Reviewed-by: François Doray <[email protected]> Cr-Commit-Position: refs/heads/master@{#572871}
void TabLifecycleUnitSource::TabLifecycleUnit::UpdateLifecycleState( mojom::LifecycleState state) { switch (state) { case mojom::LifecycleState::kFrozen: { if (GetState() == LifecycleUnitState::PENDING_DISCARD) { freeze_timeout_timer_->Stop(); FinishDiscard(discard_reason_); } else { SetState(LifecycleUnitState::FROZEN, StateChangeReason::RENDERER_INITIATED); } break; } case mojom::LifecycleState::kRunning: { SetState(LifecycleUnitState::ACTIVE, StateChangeReason::RENDERER_INITIATED); break; } default: { NOTREACHED(); break; } } }
void TabLifecycleUnitSource::TabLifecycleUnit::UpdateLifecycleState( mojom::LifecycleState state) { switch (state) { case mojom::LifecycleState::kFrozen: { if (GetState() == LifecycleUnitState::PENDING_DISCARD) { freeze_timeout_timer_->Stop(); FinishDiscard(discard_reason_); } else { SetState(LifecycleUnitState::FROZEN, StateChangeReason::RENDERER_INITIATED); } break; } case mojom::LifecycleState::kRunning: { SetState(LifecycleUnitState::ACTIVE, StateChangeReason::RENDERER_INITIATED); break; } default: { NOTREACHED(); break; } } }
C
Chrome
0
CVE-2013-1798
https://www.cvedetails.com/cve/CVE-2013-1798/
CWE-20
https://github.com/torvalds/linux/commit/a2c118bfab8bc6b8bb213abfc35201e441693d55
a2c118bfab8bc6b8bb213abfc35201e441693d55
KVM: Fix bounds checking in ioapic indirect register reads (CVE-2013-1798) If the guest specifies a IOAPIC_REG_SELECT with an invalid value and follows that with a read of the IOAPIC_REG_WINDOW KVM does not properly validate that request. ioapic_read_indirect contains an ASSERT(redir_index < IOAPIC_NUM_PINS), but the ASSERT has no effect in non-debug builds. In recent kernels this allows a guest to cause a kernel oops by reading invalid memory. In older kernels (pre-3.3) this allows a guest to read from large ranges of host memory. Tested: tested against apic unit tests. Signed-off-by: Andrew Honig <[email protected]> Signed-off-by: Marcelo Tosatti <[email protected]>
void kvm_ioapic_clear_all(struct kvm_ioapic *ioapic, int irq_source_id) { int i; spin_lock(&ioapic->lock); for (i = 0; i < KVM_IOAPIC_NUM_PINS; i++) __clear_bit(irq_source_id, &ioapic->irq_states[i]); spin_unlock(&ioapic->lock); }
void kvm_ioapic_clear_all(struct kvm_ioapic *ioapic, int irq_source_id) { int i; spin_lock(&ioapic->lock); for (i = 0; i < KVM_IOAPIC_NUM_PINS; i++) __clear_bit(irq_source_id, &ioapic->irq_states[i]); spin_unlock(&ioapic->lock); }
C
linux
0
CVE-2018-9491
https://www.cvedetails.com/cve/CVE-2018-9491/
CWE-190
https://android.googlesource.com/platform/frameworks/av/+/2b4667baa5a2badbdfec1794156ee17d4afef37c
2b4667baa5a2badbdfec1794156ee17d4afef37c
Check for overflow of crypto size Bug: 111603051 Test: CTS Change-Id: Ib5b1802b9b35769a25c16e2b977308cf7a810606 (cherry picked from commit d1fd02761236b35a336434367131f71bef7405c9)
AMediaCodec* AMediaCodec_createDecoderByType(const char *mime_type) { return createAMediaCodec(mime_type, true, false); }
AMediaCodec* AMediaCodec_createDecoderByType(const char *mime_type) { return createAMediaCodec(mime_type, true, false); }
C
Android
0
CVE-2012-0028
https://www.cvedetails.com/cve/CVE-2012-0028/
CWE-264
https://github.com/torvalds/linux/commit/8141c7f3e7aee618312fa1c15109e1219de784a7
8141c7f3e7aee618312fa1c15109e1219de784a7
Move "exit_robust_list" into mm_release() We don't want to get rid of the futexes just at exit() time, we want to drop them when doing an execve() too, since that gets rid of the previous VM image too. Doing it at mm_release() time means that we automatically always do it when we disassociate a VM map from the task. Reported-by: [email protected] Cc: Andrew Morton <[email protected]> Cc: Nick Piggin <[email protected]> Cc: Hugh Dickins <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Thomas Gleixner <[email protected]> Cc: Brad Spengler <[email protected]> Cc: Alex Efros <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Oleg Nesterov <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
noinline struct pt_regs * __cpuinit __attribute__((weak)) idle_regs(struct pt_regs *regs) { memset(regs, 0, sizeof(struct pt_regs)); return regs; }
noinline struct pt_regs * __cpuinit __attribute__((weak)) idle_regs(struct pt_regs *regs) { memset(regs, 0, sizeof(struct pt_regs)); return regs; }
C
linux
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 <[email protected]> Commit-Queue: Yuki Shiino <[email protected]> Cr-Commit-Position: refs/heads/master@{#718676}
void V8TestObject::HighEntropyConstantConstantGetterCallback(v8::Local<v8::Name>, const v8::PropertyCallbackInfo<v8::Value>& info) { RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_highEntropyConstant_ConstantGetter"); ExecutionContext* execution_context_for_measurement = CurrentExecutionContext(info.GetIsolate()); UseCounter::Count(execution_context_for_measurement, WebFeature::kTestFeatureHighEntropyConstant); Dactyloscoper::Record(execution_context_for_measurement, WebFeature::kTestFeatureHighEntropyConstant); V8SetReturnValueString(info, "1"); }
void V8TestObject::HighEntropyConstantConstantGetterCallback(v8::Local<v8::Name>, const v8::PropertyCallbackInfo<v8::Value>& info) { RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_highEntropyConstant_ConstantGetter"); ExecutionContext* execution_context_for_measurement = CurrentExecutionContext(info.GetIsolate()); UseCounter::Count(execution_context_for_measurement, WebFeature::kTestFeatureHighEntropyConstant); Dactyloscoper::Record(execution_context_for_measurement, WebFeature::kTestFeatureHighEntropyConstant); V8SetReturnValueString(info, "1"); }
C
Chrome
0
CVE-2014-9644
https://www.cvedetails.com/cve/CVE-2014-9644/
CWE-264
https://github.com/torvalds/linux/commit/4943ba16bbc2db05115707b3ff7b4874e9e3c560
4943ba16bbc2db05115707b3ff7b4874e9e3c560
crypto: include crypto- module prefix in template This adds the module loading prefix "crypto-" to the template lookup as well. For example, attempting to load 'vfat(blowfish)' via AF_ALG now correctly includes the "crypto-" prefix at every level, correctly rejecting "vfat": net-pf-38 algif-hash crypto-vfat(blowfish) crypto-vfat(blowfish)-all crypto-vfat Reported-by: Mathias Krause <[email protected]> Signed-off-by: Kees Cook <[email protected]> Acked-by: Mathias Krause <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
void crypto_drop_spawn(struct crypto_spawn *spawn) { if (!spawn->alg) return; down_write(&crypto_alg_sem); list_del(&spawn->list); up_write(&crypto_alg_sem); }
void crypto_drop_spawn(struct crypto_spawn *spawn) { if (!spawn->alg) return; down_write(&crypto_alg_sem); list_del(&spawn->list); up_write(&crypto_alg_sem); }
C
linux
0
CVE-2013-4130
https://www.cvedetails.com/cve/CVE-2013-4130/
CWE-399
https://cgit.freedesktop.org/spice/spice/commit/?id=53488f0275d6c8a121af49f7ac817d09ce68090d
53488f0275d6c8a121af49f7ac817d09ce68090d
null
int red_channel_waits_for_migrate_data(RedChannel *channel) { RedChannelClient *rcc; if (!red_channel_is_connected(channel)) { return FALSE; } if (channel->clients_num > 1) { return FALSE; } spice_assert(channel->clients_num == 1); rcc = SPICE_CONTAINEROF(ring_get_head(&channel->clients), RedChannelClient, channel_link); return red_channel_client_waits_for_migrate_data(rcc); }
int red_channel_waits_for_migrate_data(RedChannel *channel) { RedChannelClient *rcc; if (!red_channel_is_connected(channel)) { return FALSE; } if (channel->clients_num > 1) { return FALSE; } spice_assert(channel->clients_num == 1); rcc = SPICE_CONTAINEROF(ring_get_head(&channel->clients), RedChannelClient, channel_link); return red_channel_client_waits_for_migrate_data(rcc); }
C
spice
0
CVE-2016-5153
https://www.cvedetails.com/cve/CVE-2016-5153/
CWE-19
https://github.com/chromium/chromium/commit/20a9e39a925dd0fb183acb61bb7b87f29abea83f
20a9e39a925dd0fb183acb61bb7b87f29abea83f
Tracing: Connect to service on startup Temporary workaround for flaky tests introduced by https://chromium-review.googlesource.com/c/chromium/src/+/1439082 [email protected] Bug: 928410, 928363 Change-Id: I0dcf20cbdf91a7beea167a220ba9ef7e0604c1ab Reviewed-on: https://chromium-review.googlesource.com/c/1452767 Reviewed-by: oysteine <[email protected]> Reviewed-by: Eric Seckler <[email protected]> Reviewed-by: Aaron Gable <[email protected]> Commit-Queue: oysteine <[email protected]> Cr-Commit-Position: refs/heads/master@{#631052}
void TracingControllerImpl::DisconnectFromService() { coordinator_ = nullptr; }
void TracingControllerImpl::DisconnectFromService() { coordinator_ = nullptr; }
C
Chrome
0
CVE-2018-18339
https://www.cvedetails.com/cve/CVE-2018-18339/
CWE-119
https://github.com/chromium/chromium/commit/e34e01b1b0987e418bc22e3ef1cf2e4ecaead264
e34e01b1b0987e418bc22e3ef1cf2e4ecaead264
[scheduler] Remove implicit fallthrough in switch Bail out early when a condition in the switch is fulfilled. This does not change behaviour due to RemoveTaskObserver being no-op when the task observer is not present in the list. [email protected] Bug: 177475 Change-Id: Ibc7772c79f8a8c8a1d63a997dabe1efda5d3a7bd Reviewed-on: https://chromium-review.googlesource.com/891187 Reviewed-by: Nico Weber <[email protected]> Commit-Queue: Alexander Timin <[email protected]> Cr-Commit-Position: refs/heads/master@{#532649}
void RendererSchedulerImpl::OnIdlePeriodStarted() { base::AutoLock lock(any_thread_lock_); any_thread().in_idle_period = true; UpdatePolicyLocked(UpdateType::kMayEarlyOutIfPolicyUnchanged); }
void RendererSchedulerImpl::OnIdlePeriodStarted() { base::AutoLock lock(any_thread_lock_); any_thread().in_idle_period = true; UpdatePolicyLocked(UpdateType::kMayEarlyOutIfPolicyUnchanged); }
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 <[email protected]> CC: Karsten Keil <[email protected]> CC: "David S. Miller" <[email protected]> CC: Jay Vosburgh <[email protected]> CC: Andy Gospodarek <[email protected]> CC: Patrick McHardy <[email protected]> CC: Krzysztof Halasa <[email protected]> CC: "John W. Linville" <[email protected]> CC: Greg Kroah-Hartman <[email protected]> CC: Marcel Holtmann <[email protected]> CC: Johannes Berg <[email protected]> Signed-off-by: David S. Miller <[email protected]>
static u32 tun_get_msglevel(struct net_device *dev) { #ifdef TUN_DEBUG struct tun_struct *tun = netdev_priv(dev); return tun->debug; #else return -EOPNOTSUPP; #endif }
static u32 tun_get_msglevel(struct net_device *dev) { #ifdef TUN_DEBUG struct tun_struct *tun = netdev_priv(dev); return tun->debug; #else return -EOPNOTSUPP; #endif }
C
linux
0
CVE-2014-9425
https://www.cvedetails.com/cve/CVE-2014-9425/
null
https://git.php.net/?p=php-src.git;a=commit;h=2bcf69d073190e4f032d883f3416dea1b027a39e
2bcf69d073190e4f032d883f3416dea1b027a39e
null
ZEND_API zval *zend_ts_hash_str_find(TsHashTable *ht, const char *key, size_t len) { zval *retval; begin_read(ht); retval = zend_hash_str_find(TS_HASH(ht), key, len); end_read(ht); return retval; }
ZEND_API zval *zend_ts_hash_str_find(TsHashTable *ht, const char *key, size_t len) { zval *retval; begin_read(ht); retval = zend_hash_str_find(TS_HASH(ht), key, len); end_read(ht); return retval; }
C
php
0
CVE-2014-3690
https://www.cvedetails.com/cve/CVE-2014-3690/
CWE-399
https://github.com/torvalds/linux/commit/d974baa398f34393db76be45f7d4d04fbdbb4a0a
d974baa398f34393db76be45f7d4d04fbdbb4a0a
x86,kvm,vmx: Preserve CR4 across VM entry CR4 isn't constant; at least the TSD and PCE bits can vary. TBH, treating CR0 and CR3 as constant scares me a bit, too, but it looks like it's correct. This adds a branch and a read from cr4 to each vm entry. Because it is extremely likely that consecutive entries into the same vcpu will have the same host cr4 value, this fixes up the vmcs instead of restoring cr4 after the fact. A subsequent patch will add a kernel-wide cr4 shadow, reducing the overhead in the common case to just two memory reads and a branch. Signed-off-by: Andy Lutomirski <[email protected]> Acked-by: Paolo Bonzini <[email protected]> Cc: [email protected] Cc: Petr Matousek <[email protected]> Cc: Gleb Natapov <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
static inline bool cpu_has_vmx_ept_ad_bits(void) { return vmx_capability.ept & VMX_EPT_AD_BIT; }
static inline bool cpu_has_vmx_ept_ad_bits(void) { return vmx_capability.ept & VMX_EPT_AD_BIT; }
C
linux
0
CVE-2018-19044
https://www.cvedetails.com/cve/CVE-2018-19044/
CWE-59
https://github.com/acassen/keepalived/commit/04f2d32871bb3b11d7dc024039952f2fe2750306
04f2d32871bb3b11d7dc024039952f2fe2750306
When opening files for write, ensure they aren't symbolic links Issue #1048 identified that if, for example, a non privileged user created a symbolic link from /etc/keepalvied.data to /etc/passwd, writing to /etc/keepalived.data (which could be invoked via DBus) would cause /etc/passwd to be overwritten. This commit stops keepalived writing to pathnames where the ultimate component is a symbolic link, by setting O_NOFOLLOW whenever opening a file for writing. This might break some setups, where, for example, /etc/keepalived.data was a symbolic link to /home/fred/keepalived.data. If this was the case, instead create a symbolic link from /home/fred/keepalived.data to /tmp/keepalived.data, so that the file is still accessible via /home/fred/keepalived.data. There doesn't appear to be a way around this backward incompatibility, since even checking if the pathname is a symbolic link prior to opening for writing would create a race condition. Signed-off-by: Quentin Armitage <[email protected]>
system_call_script(thread_master_t *m, int (*func) (thread_t *), void * arg, unsigned long timer, notify_script_t* script) { pid_t pid; /* Daemonization to not degrade our scheduling timer */ if (log_file_name) flush_log_file(); pid = local_fork(); if (pid < 0) { /* fork error */ log_message(LOG_INFO, "Failed fork process"); return -1; } if (pid) { /* parent process */ thread_add_child(m, func, arg, pid, timer); return 0; } /* Child process */ #ifdef _MEM_CHECK_ skip_mem_dump(); #endif system_call(script); exit(0); /* Script errors aren't server errors */ }
system_call_script(thread_master_t *m, int (*func) (thread_t *), void * arg, unsigned long timer, notify_script_t* script) { pid_t pid; /* Daemonization to not degrade our scheduling timer */ if (log_file_name) flush_log_file(); pid = local_fork(); if (pid < 0) { /* fork error */ log_message(LOG_INFO, "Failed fork process"); return -1; } if (pid) { /* parent process */ thread_add_child(m, func, arg, pid, timer); return 0; } /* Child process */ #ifdef _MEM_CHECK_ skip_mem_dump(); #endif system_call(script); exit(0); /* Script errors aren't server errors */ }
C
keepalived
0
CVE-2018-1000039
https://www.cvedetails.com/cve/CVE-2018-1000039/
CWE-416
http://git.ghostscript.com/?p=mupdf.git;a=commitdiff;h=71ceebcf56e682504da22c4035b39a2d451e8ffd;hp=7f82c01523505052615492f8e220f4348ba46995
71ceebcf56e682504da22c4035b39a2d451e8ffd
null
add_range(fz_context *ctx, pdf_cmap *cmap, unsigned int low, unsigned int high, unsigned int out, int check_for_overlap, int many) { int current; cmap_splay *tree; if (low > high) { fz_warn(ctx, "range limits out of range in cmap %s", cmap->cmap_name); return; } tree = cmap->tree; if (cmap->tlen) { unsigned int move = cmap->ttop; unsigned int gt = EMPTY; unsigned int lt = EMPTY; if (check_for_overlap) { /* Check for collision with the current node */ do { current = move; /* Cases we might meet: * tree[i]: <-----> * case 0: <-> * case 1: <-------> * case 2: <-------------> * case 3: <-> * case 4: <-------> * case 5: <-> */ if (low <= tree[current].low && tree[current].low <= high) { /* case 1, reduces to case 0 */ /* or case 2, deleting the node */ tree[current].out += high + 1 - tree[current].low; tree[current].low = high + 1; if (tree[current].low > tree[current].high) { move = delete_node(cmap, current); current = EMPTY; continue; } } else if (low <= tree[current].high && tree[current].high <= high) { /* case 4, reduces to case 5 */ tree[current].high = low - 1; assert(tree[current].low <= tree[current].high); } else if (tree[current].low < low && high < tree[current].high) { /* case 3, reduces to case 5 */ int new_high = tree[current].high; tree[current].high = low-1; add_range(ctx, cmap, high+1, new_high, tree[current].out + high + 1 - tree[current].low, 0, tree[current].many); } /* Now look for where to move to next (left for case 0, right for case 5) */ if (tree[current].low > high) { move = tree[current].left; gt = current; } else { move = tree[current].right; lt = current; } } while (move != EMPTY); } else { do { current = move; if (tree[current].low > high) { move = tree[current].left; gt = current; } else { move = tree[current].right; lt = current; } } while (move != EMPTY); } /* current is now the node to which we would be adding the new node */ /* lt is the last node we traversed which is lt the new node. */ /* gt is the last node we traversed which is gt the new node. */ if (!many) { /* Check for the 'merge' cases. */ if (lt != EMPTY && !tree[lt].many && tree[lt].high == low-1 && tree[lt].out - tree[lt].low == out - low) { tree[lt].high = high; if (gt != EMPTY && !tree[gt].many && tree[gt].low == high+1 && tree[gt].out - tree[gt].low == out - low) { tree[lt].high = tree[gt].high; delete_node(cmap, gt); } goto exit; } if (gt != EMPTY && !tree[gt].many && tree[gt].low == high+1 && tree[gt].out - tree[gt].low == out - low) { tree[gt].low = low; tree[gt].out = out; goto exit; } } } else current = EMPTY; if (cmap->tlen == cmap->tcap) { int new_cap = cmap->tcap ? cmap->tcap * 2 : 256; tree = cmap->tree = fz_resize_array(ctx, cmap->tree, new_cap, sizeof *cmap->tree); cmap->tcap = new_cap; } tree[cmap->tlen].low = low; tree[cmap->tlen].high = high; tree[cmap->tlen].out = out; tree[cmap->tlen].parent = current; tree[cmap->tlen].left = EMPTY; tree[cmap->tlen].right = EMPTY; tree[cmap->tlen].many = many; cmap->tlen++; if (current == EMPTY) cmap->ttop = 0; else if (tree[current].low > high) tree[current].left = cmap->tlen-1; else { assert(tree[current].high < low); tree[current].right = cmap->tlen-1; } move_to_root(tree, cmap->tlen-1); cmap->ttop = cmap->tlen-1; exit: {} #ifdef CHECK_SPLAY check_splay(cmap->tree, cmap->ttop, 0); #endif #ifdef DUMP_SPLAY dump_splay(cmap->tree, cmap->ttop, 0, ""); #endif }
add_range(fz_context *ctx, pdf_cmap *cmap, unsigned int low, unsigned int high, unsigned int out, int check_for_overlap, int many) { int current; cmap_splay *tree; if (low > high) { fz_warn(ctx, "range limits out of range in cmap %s", cmap->cmap_name); return; } tree = cmap->tree; if (cmap->tlen) { unsigned int move = cmap->ttop; unsigned int gt = EMPTY; unsigned int lt = EMPTY; if (check_for_overlap) { /* Check for collision with the current node */ do { current = move; /* Cases we might meet: * tree[i]: <-----> * case 0: <-> * case 1: <-------> * case 2: <-------------> * case 3: <-> * case 4: <-------> * case 5: <-> */ if (low <= tree[current].low && tree[current].low <= high) { /* case 1, reduces to case 0 */ /* or case 2, deleting the node */ tree[current].out += high + 1 - tree[current].low; tree[current].low = high + 1; if (tree[current].low > tree[current].high) { move = delete_node(cmap, current); current = EMPTY; continue; } } else if (low <= tree[current].high && tree[current].high <= high) { /* case 4, reduces to case 5 */ tree[current].high = low - 1; assert(tree[current].low <= tree[current].high); } else if (tree[current].low < low && high < tree[current].high) { /* case 3, reduces to case 5 */ int new_high = tree[current].high; tree[current].high = low-1; add_range(ctx, cmap, high+1, new_high, tree[current].out + high + 1 - tree[current].low, 0, many); } /* Now look for where to move to next (left for case 0, right for case 5) */ if (tree[current].low > high) { move = tree[current].left; gt = current; } else { move = tree[current].right; lt = current; } } while (move != EMPTY); } else { do { current = move; if (tree[current].low > high) { move = tree[current].left; gt = current; } else { move = tree[current].right; lt = current; } } while (move != EMPTY); } /* current is now the node to which we would be adding the new node */ /* lt is the last node we traversed which is lt the new node. */ /* gt is the last node we traversed which is gt the new node. */ if (!many) { /* Check for the 'merge' cases. */ if (lt != EMPTY && !tree[lt].many && tree[lt].high == low-1 && tree[lt].out - tree[lt].low == out - low) { tree[lt].high = high; if (gt != EMPTY && !tree[gt].many && tree[gt].low == high+1 && tree[gt].out - tree[gt].low == out - low) { tree[lt].high = tree[gt].high; delete_node(cmap, gt); } goto exit; } if (gt != EMPTY && !tree[gt].many && tree[gt].low == high+1 && tree[gt].out - tree[gt].low == out - low) { tree[gt].low = low; tree[gt].out = out; goto exit; } } } else current = EMPTY; if (cmap->tlen == cmap->tcap) { int new_cap = cmap->tcap ? cmap->tcap * 2 : 256; tree = cmap->tree = fz_resize_array(ctx, cmap->tree, new_cap, sizeof *cmap->tree); cmap->tcap = new_cap; } tree[cmap->tlen].low = low; tree[cmap->tlen].high = high; tree[cmap->tlen].out = out; tree[cmap->tlen].parent = current; tree[cmap->tlen].left = EMPTY; tree[cmap->tlen].right = EMPTY; tree[cmap->tlen].many = many; cmap->tlen++; if (current == EMPTY) cmap->ttop = 0; else if (tree[current].low > high) tree[current].left = cmap->tlen-1; else { assert(tree[current].high < low); tree[current].right = cmap->tlen-1; } move_to_root(tree, cmap->tlen-1); cmap->ttop = cmap->tlen-1; exit: {} #ifdef CHECK_SPLAY check_splay(cmap->tree, cmap->ttop, 0); #endif #ifdef DUMP_SPLAY dump_splay(cmap->tree, cmap->ttop, 0, ""); #endif }
C
ghostscript
1
CVE-2011-2859
https://www.cvedetails.com/cve/CVE-2011-2859/
CWE-264
https://github.com/chromium/chromium/commit/454434f6100cb6a529652a25b5fc181caa7c7f32
454434f6100cb6a529652a25b5fc181caa7c7f32
Limit extent of webstore app to just chrome.google.com/webstore. BUG=93497 TEST=Try installing extensions and apps from the webstore, starting both being initially logged in, and not. Review URL: http://codereview.chromium.org/7719003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@97986 0039d316-1c4b-4281-b951-d872f2087c98
void ExtensionService::ProcessExtensionSyncData( const ExtensionSyncData& extension_sync_data, SyncBundle& bundle) { const std::string& id = extension_sync_data.id(); if (extension_sync_data.uninstalled()) { std::string error; if (!UninstallExtensionHelper(this, id)) { LOG(WARNING) << "Could not uninstall extension " << id << " for sync"; } return; } if (extension_sync_data.enabled()) { EnableExtension(id); } else { DisableExtension(id); } SetIsIncognitoEnabled(id, extension_sync_data.incognito_enabled()); const Extension* extension = GetInstalledExtension(id); if (extension) { int result = extension->version()->CompareTo(extension_sync_data.version()); if (result < 0) { bundle.pending_sync_data[extension_sync_data.id()] = extension_sync_data; CheckForUpdatesSoon(); } } else { const bool kInstallSilently = true; if (!pending_extension_manager()->AddFromSync( id, extension_sync_data.update_url(), bundle.filter, kInstallSilently)) { LOG(WARNING) << "Could not add pending extension for " << id; } bundle.pending_sync_data[extension_sync_data.id()] = extension_sync_data; CheckForUpdatesSoon(); } }
void ExtensionService::ProcessExtensionSyncData( const ExtensionSyncData& extension_sync_data, SyncBundle& bundle) { const std::string& id = extension_sync_data.id(); if (extension_sync_data.uninstalled()) { std::string error; if (!UninstallExtensionHelper(this, id)) { LOG(WARNING) << "Could not uninstall extension " << id << " for sync"; } return; } if (extension_sync_data.enabled()) { EnableExtension(id); } else { DisableExtension(id); } SetIsIncognitoEnabled(id, extension_sync_data.incognito_enabled()); const Extension* extension = GetInstalledExtension(id); if (extension) { int result = extension->version()->CompareTo(extension_sync_data.version()); if (result < 0) { bundle.pending_sync_data[extension_sync_data.id()] = extension_sync_data; CheckForUpdatesSoon(); } } else { const bool kInstallSilently = true; if (!pending_extension_manager()->AddFromSync( id, extension_sync_data.update_url(), bundle.filter, kInstallSilently)) { LOG(WARNING) << "Could not add pending extension for " << id; } bundle.pending_sync_data[extension_sync_data.id()] = extension_sync_data; CheckForUpdatesSoon(); } }
C
Chrome
0
CVE-2014-7283
https://www.cvedetails.com/cve/CVE-2014-7283/
CWE-399
https://github.com/torvalds/linux/commit/c88547a8119e3b581318ab65e9b72f27f23e641d
c88547a8119e3b581318ab65e9b72f27f23e641d
xfs: fix directory hash ordering bug Commit f5ea1100 ("xfs: add CRCs to dir2/da node blocks") introduced in 3.10 incorrectly converted the btree hash index array pointer in xfs_da3_fixhashpath(). It resulted in the the current hash always being compared against the first entry in the btree rather than the current block index into the btree block's hash entry array. As a result, it was comparing the wrong hashes, and so could misorder the entries in the btree. For most cases, this doesn't cause any problems as it requires hash collisions to expose the ordering problem. However, when there are hash collisions within a directory there is a very good probability that the entries will be ordered incorrectly and that actually matters when duplicate hashes are placed into or removed from the btree block hash entry array. This bug results in an on-disk directory corruption and that results in directory verifier functions throwing corruption warnings into the logs. While no data or directory entries are lost, access to them may be compromised, and attempts to remove entries from a directory that has suffered from this corruption may result in a filesystem shutdown. xfs_repair will fix the directory hash ordering without data loss occuring. [dchinner: wrote useful a commit message] cc: <[email protected]> Reported-by: Hannes Frederic Sowa <[email protected]> Signed-off-by: Mark Tinguely <[email protected]> Reviewed-by: Ben Myers <[email protected]> Signed-off-by: Dave Chinner <[email protected]>
xfs_da3_root_split( struct xfs_da_state *state, struct xfs_da_state_blk *blk1, struct xfs_da_state_blk *blk2) { struct xfs_da_intnode *node; struct xfs_da_intnode *oldroot; struct xfs_da_node_entry *btree; struct xfs_da3_icnode_hdr nodehdr; struct xfs_da_args *args; struct xfs_buf *bp; struct xfs_inode *dp; struct xfs_trans *tp; struct xfs_mount *mp; struct xfs_dir2_leaf *leaf; xfs_dablk_t blkno; int level; int error; int size; trace_xfs_da_root_split(state->args); /* * Copy the existing (incorrect) block from the root node position * to a free space somewhere. */ args = state->args; error = xfs_da_grow_inode(args, &blkno); if (error) return error; dp = args->dp; tp = args->trans; mp = state->mp; error = xfs_da_get_buf(tp, dp, blkno, -1, &bp, args->whichfork); if (error) return error; node = bp->b_addr; oldroot = blk1->bp->b_addr; if (oldroot->hdr.info.magic == cpu_to_be16(XFS_DA_NODE_MAGIC) || oldroot->hdr.info.magic == cpu_to_be16(XFS_DA3_NODE_MAGIC)) { struct xfs_da3_icnode_hdr nodehdr; dp->d_ops->node_hdr_from_disk(&nodehdr, oldroot); btree = dp->d_ops->node_tree_p(oldroot); size = (int)((char *)&btree[nodehdr.count] - (char *)oldroot); level = nodehdr.level; /* * we are about to copy oldroot to bp, so set up the type * of bp while we know exactly what it will be. */ xfs_trans_buf_set_type(tp, bp, XFS_BLFT_DA_NODE_BUF); } else { struct xfs_dir3_icleaf_hdr leafhdr; struct xfs_dir2_leaf_entry *ents; leaf = (xfs_dir2_leaf_t *)oldroot; dp->d_ops->leaf_hdr_from_disk(&leafhdr, leaf); ents = dp->d_ops->leaf_ents_p(leaf); ASSERT(leafhdr.magic == XFS_DIR2_LEAFN_MAGIC || leafhdr.magic == XFS_DIR3_LEAFN_MAGIC); size = (int)((char *)&ents[leafhdr.count] - (char *)leaf); level = 0; /* * we are about to copy oldroot to bp, so set up the type * of bp while we know exactly what it will be. */ xfs_trans_buf_set_type(tp, bp, XFS_BLFT_DIR_LEAFN_BUF); } /* * we can copy most of the information in the node from one block to * another, but for CRC enabled headers we have to make sure that the * block specific identifiers are kept intact. We update the buffer * directly for this. */ memcpy(node, oldroot, size); if (oldroot->hdr.info.magic == cpu_to_be16(XFS_DA3_NODE_MAGIC) || oldroot->hdr.info.magic == cpu_to_be16(XFS_DIR3_LEAFN_MAGIC)) { struct xfs_da3_intnode *node3 = (struct xfs_da3_intnode *)node; node3->hdr.info.blkno = cpu_to_be64(bp->b_bn); } xfs_trans_log_buf(tp, bp, 0, size - 1); bp->b_ops = blk1->bp->b_ops; xfs_trans_buf_copy_type(bp, blk1->bp); blk1->bp = bp; blk1->blkno = blkno; /* * Set up the new root node. */ error = xfs_da3_node_create(args, (args->whichfork == XFS_DATA_FORK) ? mp->m_dirleafblk : 0, level + 1, &bp, args->whichfork); if (error) return error; node = bp->b_addr; dp->d_ops->node_hdr_from_disk(&nodehdr, node); btree = dp->d_ops->node_tree_p(node); btree[0].hashval = cpu_to_be32(blk1->hashval); btree[0].before = cpu_to_be32(blk1->blkno); btree[1].hashval = cpu_to_be32(blk2->hashval); btree[1].before = cpu_to_be32(blk2->blkno); nodehdr.count = 2; dp->d_ops->node_hdr_to_disk(node, &nodehdr); #ifdef DEBUG if (oldroot->hdr.info.magic == cpu_to_be16(XFS_DIR2_LEAFN_MAGIC) || oldroot->hdr.info.magic == cpu_to_be16(XFS_DIR3_LEAFN_MAGIC)) { ASSERT(blk1->blkno >= mp->m_dirleafblk && blk1->blkno < mp->m_dirfreeblk); ASSERT(blk2->blkno >= mp->m_dirleafblk && blk2->blkno < mp->m_dirfreeblk); } #endif /* Header is already logged by xfs_da_node_create */ xfs_trans_log_buf(tp, bp, XFS_DA_LOGRANGE(node, btree, sizeof(xfs_da_node_entry_t) * 2)); return 0; }
xfs_da3_root_split( struct xfs_da_state *state, struct xfs_da_state_blk *blk1, struct xfs_da_state_blk *blk2) { struct xfs_da_intnode *node; struct xfs_da_intnode *oldroot; struct xfs_da_node_entry *btree; struct xfs_da3_icnode_hdr nodehdr; struct xfs_da_args *args; struct xfs_buf *bp; struct xfs_inode *dp; struct xfs_trans *tp; struct xfs_mount *mp; struct xfs_dir2_leaf *leaf; xfs_dablk_t blkno; int level; int error; int size; trace_xfs_da_root_split(state->args); /* * Copy the existing (incorrect) block from the root node position * to a free space somewhere. */ args = state->args; error = xfs_da_grow_inode(args, &blkno); if (error) return error; dp = args->dp; tp = args->trans; mp = state->mp; error = xfs_da_get_buf(tp, dp, blkno, -1, &bp, args->whichfork); if (error) return error; node = bp->b_addr; oldroot = blk1->bp->b_addr; if (oldroot->hdr.info.magic == cpu_to_be16(XFS_DA_NODE_MAGIC) || oldroot->hdr.info.magic == cpu_to_be16(XFS_DA3_NODE_MAGIC)) { struct xfs_da3_icnode_hdr nodehdr; dp->d_ops->node_hdr_from_disk(&nodehdr, oldroot); btree = dp->d_ops->node_tree_p(oldroot); size = (int)((char *)&btree[nodehdr.count] - (char *)oldroot); level = nodehdr.level; /* * we are about to copy oldroot to bp, so set up the type * of bp while we know exactly what it will be. */ xfs_trans_buf_set_type(tp, bp, XFS_BLFT_DA_NODE_BUF); } else { struct xfs_dir3_icleaf_hdr leafhdr; struct xfs_dir2_leaf_entry *ents; leaf = (xfs_dir2_leaf_t *)oldroot; dp->d_ops->leaf_hdr_from_disk(&leafhdr, leaf); ents = dp->d_ops->leaf_ents_p(leaf); ASSERT(leafhdr.magic == XFS_DIR2_LEAFN_MAGIC || leafhdr.magic == XFS_DIR3_LEAFN_MAGIC); size = (int)((char *)&ents[leafhdr.count] - (char *)leaf); level = 0; /* * we are about to copy oldroot to bp, so set up the type * of bp while we know exactly what it will be. */ xfs_trans_buf_set_type(tp, bp, XFS_BLFT_DIR_LEAFN_BUF); } /* * we can copy most of the information in the node from one block to * another, but for CRC enabled headers we have to make sure that the * block specific identifiers are kept intact. We update the buffer * directly for this. */ memcpy(node, oldroot, size); if (oldroot->hdr.info.magic == cpu_to_be16(XFS_DA3_NODE_MAGIC) || oldroot->hdr.info.magic == cpu_to_be16(XFS_DIR3_LEAFN_MAGIC)) { struct xfs_da3_intnode *node3 = (struct xfs_da3_intnode *)node; node3->hdr.info.blkno = cpu_to_be64(bp->b_bn); } xfs_trans_log_buf(tp, bp, 0, size - 1); bp->b_ops = blk1->bp->b_ops; xfs_trans_buf_copy_type(bp, blk1->bp); blk1->bp = bp; blk1->blkno = blkno; /* * Set up the new root node. */ error = xfs_da3_node_create(args, (args->whichfork == XFS_DATA_FORK) ? mp->m_dirleafblk : 0, level + 1, &bp, args->whichfork); if (error) return error; node = bp->b_addr; dp->d_ops->node_hdr_from_disk(&nodehdr, node); btree = dp->d_ops->node_tree_p(node); btree[0].hashval = cpu_to_be32(blk1->hashval); btree[0].before = cpu_to_be32(blk1->blkno); btree[1].hashval = cpu_to_be32(blk2->hashval); btree[1].before = cpu_to_be32(blk2->blkno); nodehdr.count = 2; dp->d_ops->node_hdr_to_disk(node, &nodehdr); #ifdef DEBUG if (oldroot->hdr.info.magic == cpu_to_be16(XFS_DIR2_LEAFN_MAGIC) || oldroot->hdr.info.magic == cpu_to_be16(XFS_DIR3_LEAFN_MAGIC)) { ASSERT(blk1->blkno >= mp->m_dirleafblk && blk1->blkno < mp->m_dirfreeblk); ASSERT(blk2->blkno >= mp->m_dirleafblk && blk2->blkno < mp->m_dirfreeblk); } #endif /* Header is already logged by xfs_da_node_create */ xfs_trans_log_buf(tp, bp, XFS_DA_LOGRANGE(node, btree, sizeof(xfs_da_node_entry_t) * 2)); return 0; }
C
linux
0
CVE-2015-1805
https://www.cvedetails.com/cve/CVE-2015-1805/
CWE-17
https://github.com/torvalds/linux/commit/f0d1bec9d58d4c038d0ac958c9af82be6eb18045
f0d1bec9d58d4c038d0ac958c9af82be6eb18045
new helper: copy_page_from_iter() parallel to copy_page_to_iter(). pipe_write() switched to it (and became ->write_iter()). Signed-off-by: Al Viro <[email protected]>
static void iov_fault_in_pages_read(struct iovec *iov, unsigned long len)
static void iov_fault_in_pages_read(struct iovec *iov, unsigned long len) { while (!iov->iov_len) iov++; while (len > 0) { unsigned long this_len; this_len = min_t(unsigned long, len, iov->iov_len); fault_in_pages_readable(iov->iov_base, this_len); len -= this_len; iov++; } }
C
linux
1
CVE-2016-5199
https://www.cvedetails.com/cve/CVE-2016-5199/
CWE-119
https://github.com/chromium/chromium/commit/c995d4fe5e96f4d6d4a88b7867279b08e72d2579
c995d4fe5e96f4d6d4a88b7867279b08e72d2579
Move IsDataSaverEnabledByUser to be a static method and use it This method now officially becomes the source of truth that everything in the code base eventually calls into to determine whether or not DataSaver is enabled. Bug: 934399 Change-Id: Iae837b710ace8cc3101188f79d02cbc2d4f0fd93 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1537242 Reviewed-by: Joshua Pawlicki <[email protected]> Reviewed-by: Tarun Bansal <[email protected]> Commit-Queue: Robert Ogden <[email protected]> Cr-Commit-Position: refs/heads/master@{#643948}
bool ChromeContentBrowserClient::AllowGpuLaunchRetryOnIOThread() { #if defined(OS_ANDROID) const base::android::ApplicationState app_state = base::android::ApplicationStatusListener::GetState(); return base::android::APPLICATION_STATE_UNKNOWN == app_state || base::android::APPLICATION_STATE_HAS_RUNNING_ACTIVITIES == app_state || base::android::APPLICATION_STATE_HAS_PAUSED_ACTIVITIES == app_state; #else return true; #endif }
bool ChromeContentBrowserClient::AllowGpuLaunchRetryOnIOThread() { #if defined(OS_ANDROID) const base::android::ApplicationState app_state = base::android::ApplicationStatusListener::GetState(); return base::android::APPLICATION_STATE_UNKNOWN == app_state || base::android::APPLICATION_STATE_HAS_RUNNING_ACTIVITIES == app_state || base::android::APPLICATION_STATE_HAS_PAUSED_ACTIVITIES == app_state; #else return true; #endif }
C
Chrome
0
CVE-2017-9059
https://www.cvedetails.com/cve/CVE-2017-9059/
CWE-404
https://github.com/torvalds/linux/commit/c70422f760c120480fee4de6c38804c72aa26bc1
c70422f760c120480fee4de6c38804c72aa26bc1
Merge tag 'nfsd-4.12' of git://linux-nfs.org/~bfields/linux Pull nfsd updates from Bruce Fields: "Another RDMA update from Chuck Lever, and a bunch of miscellaneous bugfixes" * tag 'nfsd-4.12' of git://linux-nfs.org/~bfields/linux: (26 commits) nfsd: Fix up the "supattr_exclcreat" attributes nfsd: encoders mustn't use unitialized values in error cases nfsd: fix undefined behavior in nfsd4_layout_verify lockd: fix lockd shutdown race NFSv4: Fix callback server shutdown SUNRPC: Refactor svc_set_num_threads() NFSv4.x/callback: Create the callback service through svc_create_pooled lockd: remove redundant check on block svcrdma: Clean out old XDR encoders svcrdma: Remove the req_map cache svcrdma: Remove unused RDMA Write completion handler svcrdma: Reduce size of sge array in struct svc_rdma_op_ctxt svcrdma: Clean up RPC-over-RDMA backchannel reply processing svcrdma: Report Write/Reply chunk overruns svcrdma: Clean up RDMA_ERROR path svcrdma: Use rdma_rw API in RPC reply path svcrdma: Introduce local rdma_rw API helpers svcrdma: Clean up svc_rdma_get_inv_rkey() svcrdma: Add helper to save pages under I/O svcrdma: Eliminate RPCRDMA_SQ_DEPTH_MULT ...
static int wait_for_concurrent_writes(struct file *file) { struct inode *inode = file_inode(file); static ino_t last_ino; static dev_t last_dev; int err = 0; if (atomic_read(&inode->i_writecount) > 1 || (last_ino == inode->i_ino && last_dev == inode->i_sb->s_dev)) { dprintk("nfsd: write defer %d\n", task_pid_nr(current)); msleep(10); dprintk("nfsd: write resume %d\n", task_pid_nr(current)); } if (inode->i_state & I_DIRTY) { dprintk("nfsd: write sync %d\n", task_pid_nr(current)); err = vfs_fsync(file, 0); } last_ino = inode->i_ino; last_dev = inode->i_sb->s_dev; return err; }
static int wait_for_concurrent_writes(struct file *file) { struct inode *inode = file_inode(file); static ino_t last_ino; static dev_t last_dev; int err = 0; if (atomic_read(&inode->i_writecount) > 1 || (last_ino == inode->i_ino && last_dev == inode->i_sb->s_dev)) { dprintk("nfsd: write defer %d\n", task_pid_nr(current)); msleep(10); dprintk("nfsd: write resume %d\n", task_pid_nr(current)); } if (inode->i_state & I_DIRTY) { dprintk("nfsd: write sync %d\n", task_pid_nr(current)); err = vfs_fsync(file, 0); } last_ino = inode->i_ino; last_dev = inode->i_sb->s_dev; return err; }
C
linux
0
CVE-2018-6942
https://www.cvedetails.com/cve/CVE-2018-6942/
CWE-476
https://git.savannah.gnu.org/cgit/freetype/freetype2.git/commit/?id=29c759284e305ec428703c9a5831d0b1fc3497ef
29c759284e305ec428703c9a5831d0b1fc3497ef
null
Round_Super( TT_ExecContext exc, FT_F26Dot6 distance, FT_F26Dot6 compensation ) { FT_F26Dot6 val; if ( distance >= 0 ) { val = ADD_LONG( distance, exc->threshold - exc->phase + compensation ) & -exc->period; val += exc->phase; if ( val < 0 ) val = exc->phase; } else { val = NEG_LONG( SUB_LONG( exc->threshold - exc->phase + compensation, distance ) & -exc->period ); val -= exc->phase; if ( val > 0 ) val = -exc->phase; } return val; }
Round_Super( TT_ExecContext exc, FT_F26Dot6 distance, FT_F26Dot6 compensation ) { FT_F26Dot6 val; if ( distance >= 0 ) { val = ADD_LONG( distance, exc->threshold - exc->phase + compensation ) & -exc->period; val += exc->phase; if ( val < 0 ) val = exc->phase; } else { val = NEG_LONG( SUB_LONG( exc->threshold - exc->phase + compensation, distance ) & -exc->period ); val -= exc->phase; if ( val > 0 ) val = -exc->phase; } return val; }
C
savannah
0
null
null
null
https://github.com/chromium/chromium/commit/c58d6ae09d0c916b6003238de09e34f14cce758f
c58d6ae09d0c916b6003238de09e34f14cce758f
Introduce a method to build the tree from a CompactHTMLToken https://bugs.webkit.org/show_bug.cgi?id=107082 Reviewed by Adam Barth. No new tests because covered by existing fast/parser tests. * html/parser/HTMLDocumentParser.cpp: (WebCore): (WebCore::HTMLDocumentParser::constructTreeFromCompactHTMLToken): * html/parser/HTMLDocumentParser.h: * html/parser/HTMLToken.h: (AtomicHTMLToken): (WebCore::AtomicHTMLToken::create): (WebCore::AtomicHTMLToken::AtomicHTMLToken): * xml/parser/MarkupTokenBase.h: (WebCore::AtomicMarkupTokenBase::AtomicMarkupTokenBase): (AtomicMarkupTokenBase): git-svn-id: svn://svn.chromium.org/blink/trunk@139953 bbb929c8-8fbe-4397-9dbb-9b2b20218538
void HTMLDocumentParser::endIfDelayed() { if (isDetached()) return; if (!m_endWasDelayed || shouldDelayEnd()) return; m_endWasDelayed = false; prepareToStopParsing(); }
void HTMLDocumentParser::endIfDelayed() { if (isDetached()) return; if (!m_endWasDelayed || shouldDelayEnd()) return; m_endWasDelayed = false; prepareToStopParsing(); }
C
Chrome
0
CVE-2017-5087
https://www.cvedetails.com/cve/CVE-2017-5087/
CWE-416
https://github.com/chromium/chromium/commit/11601c08e92732d2883af2057c41c17cba890844
11601c08e92732d2883af2057c41c17cba890844
[IndexedDB] Fixed transaction use-after-free vuln Bug: 725032 Change-Id: I689ded6c74d5563403587b149c3f3e02e807e4aa Reviewed-on: https://chromium-review.googlesource.com/518483 Reviewed-by: Joshua Bell <[email protected]> Commit-Queue: Daniel Murphy <[email protected]> Cr-Commit-Position: refs/heads/master@{#475952}
void DatabaseImpl::IDBThreadHelper::Clear( int64_t transaction_id, int64_t object_store_id, scoped_refptr<IndexedDBCallbacks> callbacks) { DCHECK(idb_thread_checker_.CalledOnValidThread()); if (!connection_->IsConnected()) return; IndexedDBTransaction* transaction = connection_->GetTransaction(transaction_id); if (!transaction) return; connection_->database()->Clear(transaction, object_store_id, callbacks); }
void DatabaseImpl::IDBThreadHelper::Clear( int64_t transaction_id, int64_t object_store_id, scoped_refptr<IndexedDBCallbacks> callbacks) { DCHECK(idb_thread_checker_.CalledOnValidThread()); if (!connection_->IsConnected()) return; IndexedDBTransaction* transaction = connection_->GetTransaction(transaction_id); if (!transaction) return; connection_->database()->Clear(transaction, object_store_id, callbacks); }
C
Chrome
0
CVE-2014-7815
https://www.cvedetails.com/cve/CVE-2014-7815/
CWE-264
https://git.qemu.org/?p=qemu.git;a=commit;h=e6908bfe8e07f2b452e78e677da1b45b1c0f6829
e6908bfe8e07f2b452e78e677da1b45b1c0f6829
null
void vnc_framebuffer_update(VncState *vs, int x, int y, int w, int h, int32_t encoding) { vnc_write_u16(vs, x); vnc_write_u16(vs, y); vnc_write_u16(vs, w); vnc_write_u16(vs, h); vnc_write_s32(vs, encoding); }
void vnc_framebuffer_update(VncState *vs, int x, int y, int w, int h, int32_t encoding) { vnc_write_u16(vs, x); vnc_write_u16(vs, y); vnc_write_u16(vs, w); vnc_write_u16(vs, h); vnc_write_s32(vs, encoding); }
C
qemu
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 [email protected] Review URL: https://chromiumcodereview.appspot.com/11194042 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@171569 0039d316-1c4b-4281-b951-d872f2087c98
bool RenderWidgetHostViewAndroid::HasValidFrame() const { return texture_id_in_layer_ != 0 && content_view_core_ && !texture_size_in_layer_.IsEmpty() && texture_size_in_layer_ == content_view_core_->GetBounds().size(); }
bool RenderWidgetHostViewAndroid::HasValidFrame() const { return texture_id_in_layer_ != 0 && content_view_core_ && !texture_size_in_layer_.IsEmpty() && texture_size_in_layer_ == content_view_core_->GetBounds().size(); }
C
Chrome
0
CVE-2016-5220
https://www.cvedetails.com/cve/CVE-2016-5220/
CWE-200
https://github.com/chromium/chromium/commit/c6f0d22d508a551a40fc8bd7418941b77435aac3
c6f0d22d508a551a40fc8bd7418941b77435aac3
omnibox: experiment with restoring placeholder when caret shows Shows the "Search Google or type a URL" omnibox placeholder even when the caret (text edit cursor) is showing / when focused. views::Textfield works this way, as does <input placeholder="">. Omnibox and the NTP's "fakebox" are exceptions in this regard and this experiment makes this more consistent. [email protected] BUG=955585 Change-Id: I23c299c0973f2feb43f7a2be3bd3425a80b06c2d Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1582315 Commit-Queue: Dan Beam <[email protected]> Reviewed-by: Tommy Li <[email protected]> Cr-Commit-Position: refs/heads/master@{#654279}
void OmniboxViewViews::EmphasizeURLComponents() { if (!location_bar_view_) return; if (path_fade_animation_) path_fade_animation_->Stop(); bool text_is_url = model()->CurrentTextIsURL(); GetRenderText()->SetDirectionalityMode( text_is_url ? gfx::DIRECTIONALITY_AS_URL : gfx::DIRECTIONALITY_FROM_TEXT); SetStyle(gfx::TEXT_STYLE_STRIKE, false); base::string16 text = GetText(); bool path_eligible_for_fading = UpdateTextStyle( text, text_is_url, model()->client()->GetSchemeClassifier()); if (path_fade_animation_ && path_eligible_for_fading && !HasFocus() && !model()->user_input_in_progress()) { url::Component scheme, host; AutocompleteInput::ParseForEmphasizeComponents( text, model()->client()->GetSchemeClassifier(), &scheme, &host); gfx::Range path_bounds(host.end(), text.size()); path_fade_animation_->Start(path_bounds); } }
void OmniboxViewViews::EmphasizeURLComponents() { if (!location_bar_view_) return; if (path_fade_animation_) path_fade_animation_->Stop(); bool text_is_url = model()->CurrentTextIsURL(); GetRenderText()->SetDirectionalityMode( text_is_url ? gfx::DIRECTIONALITY_AS_URL : gfx::DIRECTIONALITY_FROM_TEXT); SetStyle(gfx::TEXT_STYLE_STRIKE, false); base::string16 text = GetText(); bool path_eligible_for_fading = UpdateTextStyle( text, text_is_url, model()->client()->GetSchemeClassifier()); if (path_fade_animation_ && path_eligible_for_fading && !HasFocus() && !model()->user_input_in_progress()) { url::Component scheme, host; AutocompleteInput::ParseForEmphasizeComponents( text, model()->client()->GetSchemeClassifier(), &scheme, &host); gfx::Range path_bounds(host.end(), text.size()); path_fade_animation_->Start(path_bounds); } }
C
Chrome
0
CVE-2018-1000879
https://www.cvedetails.com/cve/CVE-2018-1000879/
CWE-476
https://github.com/libarchive/libarchive/pull/1105/commits/15bf44fd2c1ad0e3fd87048b3fcc90c4dcff1175
15bf44fd2c1ad0e3fd87048b3fcc90c4dcff1175
Skip 0-length ACL fields Currently, it is possible to create an archive that crashes bsdtar with a malformed ACL: Program received signal SIGSEGV, Segmentation fault. archive_acl_from_text_l (acl=<optimised out>, text=0x7e2e92 "", want_type=<optimised out>, sc=<optimised out>) at libarchive/archive_acl.c:1726 1726 switch (*s) { (gdb) p n $1 = 1 (gdb) p field[n] $2 = {start = 0x0, end = 0x0} Stop this by checking that the length is not zero before beginning the switch statement. I am pretty sure this is the bug mentioned in the qsym paper [1], and I was able to replicate it with a qsym + AFL + afl-rb setup. [1] https://www.usenix.org/conference/usenixsecurity18/presentation/yun
is_nfs4_flags(const char *start, const char *end, int *permset) { const char *p = start; while (p < end) { switch(*p++) { case 'f': *permset |= ARCHIVE_ENTRY_ACL_ENTRY_FILE_INHERIT; break; case 'd': *permset |= ARCHIVE_ENTRY_ACL_ENTRY_DIRECTORY_INHERIT; break; case 'i': *permset |= ARCHIVE_ENTRY_ACL_ENTRY_INHERIT_ONLY; break; case 'n': *permset |= ARCHIVE_ENTRY_ACL_ENTRY_NO_PROPAGATE_INHERIT; break; case 'S': *permset |= ARCHIVE_ENTRY_ACL_ENTRY_SUCCESSFUL_ACCESS; break; case 'F': *permset |= ARCHIVE_ENTRY_ACL_ENTRY_FAILED_ACCESS; break; case 'I': *permset |= ARCHIVE_ENTRY_ACL_ENTRY_INHERITED; break; case '-': break; default: return (0); } } return (1); }
is_nfs4_flags(const char *start, const char *end, int *permset) { const char *p = start; while (p < end) { switch(*p++) { case 'f': *permset |= ARCHIVE_ENTRY_ACL_ENTRY_FILE_INHERIT; break; case 'd': *permset |= ARCHIVE_ENTRY_ACL_ENTRY_DIRECTORY_INHERIT; break; case 'i': *permset |= ARCHIVE_ENTRY_ACL_ENTRY_INHERIT_ONLY; break; case 'n': *permset |= ARCHIVE_ENTRY_ACL_ENTRY_NO_PROPAGATE_INHERIT; break; case 'S': *permset |= ARCHIVE_ENTRY_ACL_ENTRY_SUCCESSFUL_ACCESS; break; case 'F': *permset |= ARCHIVE_ENTRY_ACL_ENTRY_FAILED_ACCESS; break; case 'I': *permset |= ARCHIVE_ENTRY_ACL_ENTRY_INHERITED; break; case '-': break; default: return (0); } } return (1); }
C
libarchive
0
null
null
null
https://github.com/chromium/chromium/commit/a03d4448faf2c40f4ef444a88cb9aace5b98e8c4
a03d4448faf2c40f4ef444a88cb9aace5b98e8c4
Introduce background.scripts feature for extension manifests. This optimizes for the common use case where background pages just include a reference to one or more script files and no additional HTML. BUG=107791 Review URL: http://codereview.chromium.org/9150008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@117110 0039d316-1c4b-4281-b951-d872f2087c98
void TestingAutomationProvider::WebkitMouseButtonDown( DictionaryValue* args, IPC::Message* reply_message) { if (SendErrorIfModalDialogActive(this, reply_message)) return; RenderViewHost* view; std::string error; if (!GetRenderViewFromJSONArgs(args, profile(), &view, &error)) { AutomationJSONReply(this, reply_message).SendError(error); return; } WebKit::WebMouseEvent mouse_event; if (!args->GetInteger("x", &mouse_event.x) || !args->GetInteger("y", &mouse_event.y)) { AutomationJSONReply(this, reply_message) .SendError("(X,Y) coordinates missing or invalid"); return; } mouse_event.type = WebKit::WebInputEvent::MouseDown; mouse_event.button = WebKit::WebMouseEvent::ButtonLeft; mouse_event.clickCount = 1; new InputEventAckNotificationObserver(this, reply_message, mouse_event.type, 1); view->ForwardMouseEvent(mouse_event); }
void TestingAutomationProvider::WebkitMouseButtonDown( DictionaryValue* args, IPC::Message* reply_message) { if (SendErrorIfModalDialogActive(this, reply_message)) return; RenderViewHost* view; std::string error; if (!GetRenderViewFromJSONArgs(args, profile(), &view, &error)) { AutomationJSONReply(this, reply_message).SendError(error); return; } WebKit::WebMouseEvent mouse_event; if (!args->GetInteger("x", &mouse_event.x) || !args->GetInteger("y", &mouse_event.y)) { AutomationJSONReply(this, reply_message) .SendError("(X,Y) coordinates missing or invalid"); return; } mouse_event.type = WebKit::WebInputEvent::MouseDown; mouse_event.button = WebKit::WebMouseEvent::ButtonLeft; mouse_event.clickCount = 1; new InputEventAckNotificationObserver(this, reply_message, mouse_event.type, 1); view->ForwardMouseEvent(mouse_event); }
C
Chrome
0
CVE-2011-1799
https://www.cvedetails.com/cve/CVE-2011-1799/
CWE-20
https://github.com/chromium/chromium/commit/5fd35e5359c6345b8709695cd71fba307318e6aa
5fd35e5359c6345b8709695cd71fba307318e6aa
Source/WebCore: Fix for bug 64046 - Wrong image height in absolutely positioned div in relatively positioned parent with bottom padding. https://bugs.webkit.org/show_bug.cgi?id=64046 Patch by Kulanthaivel Palanichamy <[email protected]> on 2011-07-21 Reviewed by David Hyatt. Test: fast/css/absolute-child-with-percent-height-inside-relative-parent.html * rendering/RenderBox.cpp: (WebCore::RenderBox::availableLogicalHeightUsing): LayoutTests: Test to cover absolutely positioned child with percentage height in relatively positioned parent with bottom padding. https://bugs.webkit.org/show_bug.cgi?id=64046 Patch by Kulanthaivel Palanichamy <[email protected]> on 2011-07-21 Reviewed by David Hyatt. * fast/css/absolute-child-with-percent-height-inside-relative-parent-expected.txt: Added. * fast/css/absolute-child-with-percent-height-inside-relative-parent.html: Added. git-svn-id: svn://svn.chromium.org/blink/trunk@91533 bbb929c8-8fbe-4397-9dbb-9b2b20218538
BackgroundBleedAvoidance RenderBox::determineBackgroundBleedAvoidance(GraphicsContext* context) const { if (context->paintingDisabled()) return BackgroundBleedNone; const RenderStyle* style = this->style(); if (!style->hasBackground() || !style->hasBorder() || !style->hasBorderRadius() || borderImageIsLoadedAndCanBeRendered()) return BackgroundBleedNone; AffineTransform ctm = context->getCTM(); FloatSize contextScaling(static_cast<float>(ctm.xScale()), static_cast<float>(ctm.yScale())); if (borderObscuresBackgroundEdge(contextScaling)) return BackgroundBleedShrinkBackground; return BackgroundBleedUseTransparencyLayer; }
BackgroundBleedAvoidance RenderBox::determineBackgroundBleedAvoidance(GraphicsContext* context) const { if (context->paintingDisabled()) return BackgroundBleedNone; const RenderStyle* style = this->style(); if (!style->hasBackground() || !style->hasBorder() || !style->hasBorderRadius() || borderImageIsLoadedAndCanBeRendered()) return BackgroundBleedNone; AffineTransform ctm = context->getCTM(); FloatSize contextScaling(static_cast<float>(ctm.xScale()), static_cast<float>(ctm.yScale())); if (borderObscuresBackgroundEdge(contextScaling)) return BackgroundBleedShrinkBackground; return BackgroundBleedUseTransparencyLayer; }
C
Chrome
0
CVE-2014-3173
https://www.cvedetails.com/cve/CVE-2014-3173/
CWE-119
https://github.com/chromium/chromium/commit/ee7579229ff7e9e5ae28bf53aea069251499d7da
ee7579229ff7e9e5ae28bf53aea069251499d7da
Framebuffer clear() needs to consider the situation some draw buffers are disabled. This is when we expose DrawBuffers extension. BUG=376951 TEST=the attached test case, webgl conformance [email protected],[email protected] Review URL: https://codereview.chromium.org/315283002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@275338 0039d316-1c4b-4281-b951-d872f2087c98
bool GLES2DecoderImpl::IsDrawValid( const char* function_name, GLuint max_vertex_accessed, GLsizei primcount) { if (!state_.current_program.get()) { LOCAL_RENDER_WARNING("Drawing with no current shader program."); return false; } return state_.vertex_attrib_manager ->ValidateBindings(function_name, this, feature_info_.get(), state_.current_program.get(), max_vertex_accessed, primcount); }
bool GLES2DecoderImpl::IsDrawValid( const char* function_name, GLuint max_vertex_accessed, GLsizei primcount) { if (!state_.current_program.get()) { LOCAL_RENDER_WARNING("Drawing with no current shader program."); return false; } return state_.vertex_attrib_manager ->ValidateBindings(function_name, this, feature_info_.get(), state_.current_program.get(), max_vertex_accessed, primcount); }
C
Chrome
0
CVE-2015-6761
https://www.cvedetails.com/cve/CVE-2015-6761/
CWE-362
https://github.com/chromium/chromium/commit/fd506b0ac6c7846ae45b5034044fe85c28ee68ac
fd506b0ac6c7846ae45b5034044fe85c28ee68ac
Fix detach with open()ed document leaving parent loading indefinitely Change-Id: I26c2a054b9f1e5eb076acd677e1223058825f6d6 Bug: 803416 Test: fast/loader/document-open-iframe-then-detach.html Change-Id: I26c2a054b9f1e5eb076acd677e1223058825f6d6 Reviewed-on: https://chromium-review.googlesource.com/887298 Reviewed-by: Mike West <[email protected]> Commit-Queue: Nate Chapin <[email protected]> Cr-Commit-Position: refs/heads/master@{#532967}
void DocumentLoader::ReplaceDocumentWhileExecutingJavaScriptURL( const KURL& url, Document* owner_document, WebGlobalObjectReusePolicy global_object_reuse_policy, const String& source) { InstallNewDocument(url, owner_document, global_object_reuse_policy, MimeType(), response_.TextEncodingName(), InstallNewDocumentReason::kJavascriptURL, kForceSynchronousParsing, NullURL()); if (!source.IsNull()) { frame_->GetDocument()->SetCompatibilityMode(Document::kNoQuirksMode); parser_->Append(source); } if (parser_) parser_->Finish(); }
void DocumentLoader::ReplaceDocumentWhileExecutingJavaScriptURL( const KURL& url, Document* owner_document, WebGlobalObjectReusePolicy global_object_reuse_policy, const String& source) { InstallNewDocument(url, owner_document, global_object_reuse_policy, MimeType(), response_.TextEncodingName(), InstallNewDocumentReason::kJavascriptURL, kForceSynchronousParsing, NullURL()); if (!source.IsNull()) { frame_->GetDocument()->SetCompatibilityMode(Document::kNoQuirksMode); parser_->Append(source); } if (parser_) parser_->Finish(); }
C
Chrome
0
CVE-2014-1743
https://www.cvedetails.com/cve/CVE-2014-1743/
CWE-399
https://github.com/chromium/chromium/commit/6d9425ec7badda912555d46ea7abcfab81fdd9b9
6d9425ec7badda912555d46ea7abcfab81fdd9b9
sync compositor: pass simple gfx types by const ref See bug for reasoning BUG=159273 Review URL: https://codereview.chromium.org/1417893006 Cr-Commit-Position: refs/heads/master@{#356653}
void AwContents::InvokeGeolocationCallback(JNIEnv* env, jobject obj, jboolean value, jstring origin) { DCHECK_CURRENTLY_ON(BrowserThread::UI); if (pending_geolocation_prompts_.empty()) return; GURL callback_origin(base::android::ConvertJavaStringToUTF16(env, origin)); if (callback_origin.GetOrigin() == pending_geolocation_prompts_.front().first) { pending_geolocation_prompts_.front().second.Run(value); pending_geolocation_prompts_.pop_front(); if (!pending_geolocation_prompts_.empty()) { ShowGeolocationPromptHelper(java_ref_, pending_geolocation_prompts_.front().first); } } }
void AwContents::InvokeGeolocationCallback(JNIEnv* env, jobject obj, jboolean value, jstring origin) { DCHECK_CURRENTLY_ON(BrowserThread::UI); if (pending_geolocation_prompts_.empty()) return; GURL callback_origin(base::android::ConvertJavaStringToUTF16(env, origin)); if (callback_origin.GetOrigin() == pending_geolocation_prompts_.front().first) { pending_geolocation_prompts_.front().second.Run(value); pending_geolocation_prompts_.pop_front(); if (!pending_geolocation_prompts_.empty()) { ShowGeolocationPromptHelper(java_ref_, pending_geolocation_prompts_.front().first); } } }
C
Chrome
0
CVE-2013-2884
https://www.cvedetails.com/cve/CVE-2013-2884/
CWE-399
https://github.com/chromium/chromium/commit/4ac8bc08e3306f38a5ab3e551aef6ad43753579c
4ac8bc08e3306f38a5ab3e551aef6ad43753579c
Set Attr.ownerDocument in Element#setAttributeNode() Attr objects can move across documents by setAttributeNode(). So It needs to reset ownerDocument through TreeScopeAdoptr::adoptIfNeeded(). BUG=248950 TEST=set-attribute-node-from-iframe.html Review URL: https://chromiumcodereview.appspot.com/17583003 git-svn-id: svn://svn.chromium.org/blink/trunk@152938 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Element::~Element() { #ifndef NDEBUG if (document() && document()->renderer()) { ASSERT(!inNamedFlow()); } #endif if (hasRareData()) { ElementRareData* data = elementRareData(); data->setPseudoElement(BEFORE, 0); data->setPseudoElement(AFTER, 0); data->clearShadow(); } if (isCustomElement() && document() && document()->registry()) { document()->registry()->customElementWasDestroyed(this); } if (hasSyntheticAttrChildNodes()) detachAllAttrNodesFromElement(); if (hasPendingResources()) { document()->accessSVGExtensions()->removeElementFromPendingResources(this); ASSERT(!hasPendingResources()); } }
Element::~Element() { #ifndef NDEBUG if (document() && document()->renderer()) { ASSERT(!inNamedFlow()); } #endif if (hasRareData()) { ElementRareData* data = elementRareData(); data->setPseudoElement(BEFORE, 0); data->setPseudoElement(AFTER, 0); data->clearShadow(); } if (isCustomElement() && document() && document()->registry()) { document()->registry()->customElementWasDestroyed(this); } if (hasSyntheticAttrChildNodes()) detachAllAttrNodesFromElement(); if (hasPendingResources()) { document()->accessSVGExtensions()->removeElementFromPendingResources(this); ASSERT(!hasPendingResources()); } }
C
Chrome
0
CVE-2017-14170
https://www.cvedetails.com/cve/CVE-2017-14170/
CWE-834
https://github.com/FFmpeg/FFmpeg/commit/900f39692ca0337a98a7cf047e4e2611071810c2
900f39692ca0337a98a7cf047e4e2611071810c2
avformat/mxfdec: Fix DoS issues in mxf_read_index_entry_array() Fixes: 20170829A.mxf Co-Author: 张洪亮(望初)" <[email protected]> Found-by: Xiaohei and Wangchu from Alibaba Security Team Signed-off-by: Michael Niedermayer <[email protected]>
static int64_t mxf_set_current_edit_unit(MXFContext *mxf, int64_t current_offset) { int64_t last_ofs = -1, next_ofs = -1; MXFIndexTable *t = &mxf->index_tables[0]; /* this is called from the OP1a demuxing logic, which means there * may be no index tables */ if (mxf->nb_index_tables <= 0) return -1; /* find mxf->current_edit_unit so that the next edit unit starts ahead of current_offset */ while (mxf->current_edit_unit >= 0) { if (mxf_edit_unit_absolute_offset(mxf, t, mxf->current_edit_unit + 1, NULL, &next_ofs, 0) < 0) return -1; if (next_ofs <= last_ofs) { /* large next_ofs didn't change or current_edit_unit wrapped * around this fixes the infinite loop on zzuf3.mxf */ av_log(mxf->fc, AV_LOG_ERROR, "next_ofs didn't change. not deriving packet timestamps\n"); return -1; } if (next_ofs > current_offset) break; last_ofs = next_ofs; mxf->current_edit_unit++; } /* not checking mxf->current_edit_unit >= t->nb_ptses here since CBR files may lack IndexEntryArrays */ if (mxf->current_edit_unit < 0) return -1; return next_ofs; }
static int64_t mxf_set_current_edit_unit(MXFContext *mxf, int64_t current_offset) { int64_t last_ofs = -1, next_ofs = -1; MXFIndexTable *t = &mxf->index_tables[0]; /* this is called from the OP1a demuxing logic, which means there * may be no index tables */ if (mxf->nb_index_tables <= 0) return -1; /* find mxf->current_edit_unit so that the next edit unit starts ahead of current_offset */ while (mxf->current_edit_unit >= 0) { if (mxf_edit_unit_absolute_offset(mxf, t, mxf->current_edit_unit + 1, NULL, &next_ofs, 0) < 0) return -1; if (next_ofs <= last_ofs) { /* large next_ofs didn't change or current_edit_unit wrapped * around this fixes the infinite loop on zzuf3.mxf */ av_log(mxf->fc, AV_LOG_ERROR, "next_ofs didn't change. not deriving packet timestamps\n"); return -1; } if (next_ofs > current_offset) break; last_ofs = next_ofs; mxf->current_edit_unit++; } /* not checking mxf->current_edit_unit >= t->nb_ptses here since CBR files may lack IndexEntryArrays */ if (mxf->current_edit_unit < 0) return -1; return next_ofs; }
C
FFmpeg
0
CVE-2015-1265
https://www.cvedetails.com/cve/CVE-2015-1265/
null
https://github.com/chromium/chromium/commit/8ea5693d5cf304e56174bb6b65412f04209904db
8ea5693d5cf304e56174bb6b65412f04209904db
Move Editor::Transpose() out of Editor class This patch moves |Editor::Transpose()| out of |Editor| class as preparation of expanding it into |ExecutTranspose()| in "EditorCommand.cpp" to make |Editor| class simpler for improving code health. Following patch will expand |Transpose()| into |ExecutTranspose()|. Bug: 672405 Change-Id: Icde253623f31813d2b4517c4da7d4798bd5fadf6 Reviewed-on: https://chromium-review.googlesource.com/583880 Reviewed-by: Xiaocheng Hu <[email protected]> Commit-Queue: Yoshifumi Inoue <[email protected]> Cr-Commit-Position: refs/heads/master@{#489518}
static bool ExecuteIndent(LocalFrame& frame, Event*, EditorCommandSource, const String&) { DCHECK(frame.GetDocument()); return IndentOutdentCommand::Create(*frame.GetDocument(), IndentOutdentCommand::kIndent) ->Apply(); }
static bool ExecuteIndent(LocalFrame& frame, Event*, EditorCommandSource, const String&) { DCHECK(frame.GetDocument()); return IndentOutdentCommand::Create(*frame.GetDocument(), IndentOutdentCommand::kIndent) ->Apply(); }
C
Chrome
0
CVE-2016-3156
https://www.cvedetails.com/cve/CVE-2016-3156/
CWE-399
https://github.com/torvalds/linux/commit/fbd40ea0180a2d328c5adc61414dc8bab9335ce2
fbd40ea0180a2d328c5adc61414dc8bab9335ce2
ipv4: Don't do expensive useless work during inetdev destroy. When an inetdev is destroyed, every address assigned to the interface is removed. And in this scenerio we do two pointless things which can be very expensive if the number of assigned interfaces is large: 1) Address promotion. We are deleting all addresses, so there is no point in doing this. 2) A full nf conntrack table purge for every address. We only need to do this once, as is already caught by the existing masq_dev_notifier so masq_inet_event() can skip this. Reported-by: Solar Designer <[email protected]> Signed-off-by: David S. Miller <[email protected]> Tested-by: Cyrill Gorcunov <[email protected]>
static void fib_flush(struct net *net) { int flushed = 0; unsigned int h; for (h = 0; h < FIB_TABLE_HASHSZ; h++) { struct hlist_head *head = &net->ipv4.fib_table_hash[h]; struct hlist_node *tmp; struct fib_table *tb; hlist_for_each_entry_safe(tb, tmp, head, tb_hlist) flushed += fib_table_flush(tb); } if (flushed) rt_cache_flush(net); }
static void fib_flush(struct net *net) { int flushed = 0; unsigned int h; for (h = 0; h < FIB_TABLE_HASHSZ; h++) { struct hlist_head *head = &net->ipv4.fib_table_hash[h]; struct hlist_node *tmp; struct fib_table *tb; hlist_for_each_entry_safe(tb, tmp, head, tb_hlist) flushed += fib_table_flush(tb); } if (flushed) rt_cache_flush(net); }
C
linux
0
CVE-2018-5344
https://www.cvedetails.com/cve/CVE-2018-5344/
CWE-416
https://github.com/torvalds/linux/commit/ae6650163c66a7eff1acd6eb8b0f752dcfa8eba5
ae6650163c66a7eff1acd6eb8b0f752dcfa8eba5
loop: fix concurrent lo_open/lo_release 范龙飞 reports that KASAN can report a use-after-free in __lock_acquire. The reason is due to insufficient serialization in lo_release(), which will continue to use the loop device even after it has decremented the lo_refcnt to zero. In the meantime, another process can come in, open the loop device again as it is being shut down. Confusion ensues. Reported-by: 范龙飞 <[email protected]> Signed-off-by: Linus Torvalds <[email protected]> Signed-off-by: Jens Axboe <[email protected]>
static void loop_reread_partitions(struct loop_device *lo, struct block_device *bdev) { int rc; /* * bd_mutex has been held already in release path, so don't * acquire it if this function is called in such case. * * If the reread partition isn't from release path, lo_refcnt * must be at least one and it can only become zero when the * current holder is released. */ if (!atomic_read(&lo->lo_refcnt)) rc = __blkdev_reread_part(bdev); else rc = blkdev_reread_part(bdev); if (rc) pr_warn("%s: partition scan of loop%d (%s) failed (rc=%d)\n", __func__, lo->lo_number, lo->lo_file_name, rc); }
static void loop_reread_partitions(struct loop_device *lo, struct block_device *bdev) { int rc; /* * bd_mutex has been held already in release path, so don't * acquire it if this function is called in such case. * * If the reread partition isn't from release path, lo_refcnt * must be at least one and it can only become zero when the * current holder is released. */ if (!atomic_read(&lo->lo_refcnt)) rc = __blkdev_reread_part(bdev); else rc = blkdev_reread_part(bdev); if (rc) pr_warn("%s: partition scan of loop%d (%s) failed (rc=%d)\n", __func__, lo->lo_number, lo->lo_file_name, rc); }
C
linux
0
CVE-2016-1583
https://www.cvedetails.com/cve/CVE-2016-1583/
CWE-119
https://github.com/torvalds/linux/commit/f5364c150aa645b3d7daa21b5c0b9feaa1c9cd6d
f5364c150aa645b3d7daa21b5c0b9feaa1c9cd6d
Merge branch 'stacking-fixes' (vfs stacking fixes from Jann) Merge filesystem stacking fixes from Jann Horn. * emailed patches from Jann Horn <[email protected]>: sched: panic on corrupted stack end ecryptfs: forbid opening files without mmap handler proc: prevent stacking filesystems on top
static void free_rootdomain(struct rcu_head *rcu) { struct root_domain *rd = container_of(rcu, struct root_domain, rcu); cpupri_cleanup(&rd->cpupri); cpudl_cleanup(&rd->cpudl); free_cpumask_var(rd->dlo_mask); free_cpumask_var(rd->rto_mask); free_cpumask_var(rd->online); free_cpumask_var(rd->span); kfree(rd); }
static void free_rootdomain(struct rcu_head *rcu) { struct root_domain *rd = container_of(rcu, struct root_domain, rcu); cpupri_cleanup(&rd->cpupri); cpudl_cleanup(&rd->cpudl); free_cpumask_var(rd->dlo_mask); free_cpumask_var(rd->rto_mask); free_cpumask_var(rd->online); free_cpumask_var(rd->span); kfree(rd); }
C
linux
0
CVE-2016-3134
https://www.cvedetails.com/cve/CVE-2016-3134/
CWE-119
https://github.com/torvalds/linux/commit/54d83fc74aa9ec72794373cb47432c5f7fb1a309
54d83fc74aa9ec72794373cb47432c5f7fb1a309
netfilter: x_tables: fix unconditional helper Ben Hawkes says: In the mark_source_chains function (net/ipv4/netfilter/ip_tables.c) it is possible for a user-supplied ipt_entry structure to have a large next_offset field. This field is not bounds checked prior to writing a counter value at the supplied offset. Problem is that mark_source_chains should not have been called -- the rule doesn't have a next entry, so its supposed to return an absolute verdict of either ACCEPT or DROP. However, the function conditional() doesn't work as the name implies. It only checks that the rule is using wildcard address matching. However, an unconditional rule must also not be using any matches (no -m args). The underflow validator only checked the addresses, therefore passing the 'unconditional absolute verdict' test, while mark_source_chains also tested for presence of matches, and thus proceeeded to the next (not-existent) rule. Unify this so that all the callers have same idea of 'unconditional rule'. Reported-by: Ben Hawkes <[email protected]> Signed-off-by: Florian Westphal <[email protected]> Signed-off-by: Pablo Neira Ayuso <[email protected]>
static bool check_underflow(const struct ip6t_entry *e) { const struct xt_entry_target *t; unsigned int verdict; if (!unconditional(e)) return false; t = ip6t_get_target_c(e); if (strcmp(t->u.user.name, XT_STANDARD_TARGET) != 0) return false; verdict = ((struct xt_standard_target *)t)->verdict; verdict = -verdict - 1; return verdict == NF_DROP || verdict == NF_ACCEPT; }
static bool check_underflow(const struct ip6t_entry *e) { const struct xt_entry_target *t; unsigned int verdict; if (!unconditional(&e->ipv6)) return false; t = ip6t_get_target_c(e); if (strcmp(t->u.user.name, XT_STANDARD_TARGET) != 0) return false; verdict = ((struct xt_standard_target *)t)->verdict; verdict = -verdict - 1; return verdict == NF_DROP || verdict == NF_ACCEPT; }
C
linux
1
CVE-2015-8215
https://www.cvedetails.com/cve/CVE-2015-8215/
CWE-20
https://github.com/torvalds/linux/commit/77751427a1ff25b27d47a4c36b12c3c8667855ac
77751427a1ff25b27d47a4c36b12c3c8667855ac
ipv6: addrconf: validate new MTU before applying it Currently we don't check if the new MTU is valid or not and this allows one to configure a smaller than minimum allowed by RFCs or even bigger than interface own MTU, which is a problem as it may lead to packet drops. If you have a daemon like NetworkManager running, this may be exploited by remote attackers by forging RA packets with an invalid MTU, possibly leading to a DoS. (NetworkManager currently only validates for values too small, but not for too big ones.) The fix is just to make sure the new value is valid. That is, between IPV6_MIN_MTU and interface's MTU. Note that similar check is already performed at ndisc_router_discovery(), for when kernel itself parses the RA. Signed-off-by: Marcelo Ricardo Leitner <[email protected]> Signed-off-by: Sabrina Dubroca <[email protected]> Signed-off-by: David S. Miller <[email protected]>
int addrconf_add_ifaddr(struct net *net, void __user *arg) { struct in6_ifreq ireq; int err; if (!ns_capable(net->user_ns, CAP_NET_ADMIN)) return -EPERM; if (copy_from_user(&ireq, arg, sizeof(struct in6_ifreq))) return -EFAULT; rtnl_lock(); err = inet6_addr_add(net, ireq.ifr6_ifindex, &ireq.ifr6_addr, NULL, ireq.ifr6_prefixlen, IFA_F_PERMANENT, INFINITY_LIFE_TIME, INFINITY_LIFE_TIME); rtnl_unlock(); return err; }
int addrconf_add_ifaddr(struct net *net, void __user *arg) { struct in6_ifreq ireq; int err; if (!ns_capable(net->user_ns, CAP_NET_ADMIN)) return -EPERM; if (copy_from_user(&ireq, arg, sizeof(struct in6_ifreq))) return -EFAULT; rtnl_lock(); err = inet6_addr_add(net, ireq.ifr6_ifindex, &ireq.ifr6_addr, NULL, ireq.ifr6_prefixlen, IFA_F_PERMANENT, INFINITY_LIFE_TIME, INFINITY_LIFE_TIME); rtnl_unlock(); return err; }
C
linux
0
CVE-2016-10172
https://www.cvedetails.com/cve/CVE-2016-10172/
CWE-125
https://github.com/dbry/WavPack/commit/4bc05fc490b66ef2d45b1de26abf1455b486b0dc
4bc05fc490b66ef2d45b1de26abf1455b486b0dc
fixes for 4 fuzz failures posted to SourceForge mailing list
static int init_wv_bitstream (WavpackStream *wps, WavpackMetadata *wpmd) { if (!wpmd->byte_length || (wpmd->byte_length & 1)) return FALSE; bs_open_read (&wps->wvbits, wpmd->data, (unsigned char *) wpmd->data + wpmd->byte_length); return TRUE; }
static int init_wv_bitstream (WavpackStream *wps, WavpackMetadata *wpmd) { if (!wpmd->byte_length || (wpmd->byte_length & 1)) return FALSE; bs_open_read (&wps->wvbits, wpmd->data, (unsigned char *) wpmd->data + wpmd->byte_length); return TRUE; }
C
WavPack
0
CVE-2018-18358
https://www.cvedetails.com/cve/CVE-2018-18358/
CWE-20
https://github.com/chromium/chromium/commit/da790f920bbc169a6805a4fb83b4c2ab09532d91
da790f920bbc169a6805a4fb83b4c2ab09532d91
Implicitly bypass localhost when proxying requests. This aligns Chrome's behavior with the Windows and macOS proxy resolvers (but not Firefox). Concretely: * localhost names (as determined by net::IsLocalhost) now implicitly bypass the proxy * link-local IP addresses implicitly bypass the proxy The implicit rules are handled by ProxyBypassRules, and it is possible to override them when manually configuring proxy settings (but not when using PAC or auto-detect). This change also adds support for the "<-loopback>" proxy bypass rule, with similar semantics as it has on Windows (removes the implicit bypass rules for localhost and link-local). The compatibility risk of this change should be low as proxying through localhost was not universally supported. It is however an idiom used in testing (a number of our own tests had such a dependency). Impacted users can use the "<-loopback>" bypass rule as a workaround. Bug: 413511, 899126, 901896 Change-Id: I263ca21ef9f12d4759a20cb4751dc3261bda6ac0 Reviewed-on: https://chromium-review.googlesource.com/c/1303626 Commit-Queue: Eric Roman <[email protected]> Reviewed-by: Dominick Ng <[email protected]> Reviewed-by: Tarun Bansal <[email protected]> Reviewed-by: Matt Menke <[email protected]> Reviewed-by: Sami Kyöstilä <[email protected]> Cr-Commit-Position: refs/heads/master@{#606112}
bool DataReductionProxyConfig::IsFetchInFlight() const { DCHECK(thread_checker_.CalledOnValidThread()); return warmup_url_fetcher_->IsFetchInFlight(); }
bool DataReductionProxyConfig::IsFetchInFlight() const { DCHECK(thread_checker_.CalledOnValidThread()); return warmup_url_fetcher_->IsFetchInFlight(); }
C
Chrome
0
CVE-2016-2107
https://www.cvedetails.com/cve/CVE-2016-2107/
CWE-310
https://git.openssl.org/?p=openssl.git;a=commit;h=68595c0c2886e7942a14f98c17a55a88afb6c292
68595c0c2886e7942a14f98c17a55a88afb6c292
null
const EVP_CIPHER *EVP_aes_256_cbc_hmac_sha256(void) { return ((OPENSSL_ia32cap_P[1] & AESNI_CAPABLE) && aesni_cbc_sha256_enc(NULL, NULL, 0, NULL, NULL, NULL, NULL) ? &aesni_256_cbc_hmac_sha256_cipher : NULL); }
const EVP_CIPHER *EVP_aes_256_cbc_hmac_sha256(void) { return ((OPENSSL_ia32cap_P[1] & AESNI_CAPABLE) && aesni_cbc_sha256_enc(NULL, NULL, 0, NULL, NULL, NULL, NULL) ? &aesni_256_cbc_hmac_sha256_cipher : NULL); }
C
openssl
0
CVE-2014-3610
https://www.cvedetails.com/cve/CVE-2014-3610/
CWE-264
https://github.com/torvalds/linux/commit/854e8bb1aa06c578c2c9145fa6bfe3680ef63b23
854e8bb1aa06c578c2c9145fa6bfe3680ef63b23
KVM: x86: Check non-canonical addresses upon WRMSR Upon WRMSR, the CPU should inject #GP if a non-canonical value (address) is written to certain MSRs. The behavior is "almost" identical for AMD and Intel (ignoring MSRs that are not implemented in either architecture since they would anyhow #GP). However, IA32_SYSENTER_ESP and IA32_SYSENTER_EIP cause #GP if non-canonical address is written on Intel but not on AMD (which ignores the top 32-bits). Accordingly, this patch injects a #GP on the MSRs which behave identically on Intel and AMD. To eliminate the differences between the architecutres, the value which is written to IA32_SYSENTER_ESP and IA32_SYSENTER_EIP is turned to canonical value before writing instead of injecting a #GP. Some references from Intel and AMD manuals: According to Intel SDM description of WRMSR instruction #GP is expected on WRMSR "If the source register contains a non-canonical address and ECX specifies one of the following MSRs: IA32_DS_AREA, IA32_FS_BASE, IA32_GS_BASE, IA32_KERNEL_GS_BASE, IA32_LSTAR, IA32_SYSENTER_EIP, IA32_SYSENTER_ESP." According to AMD manual instruction manual: LSTAR/CSTAR (SYSCALL): "The WRMSR instruction loads the target RIP into the LSTAR and CSTAR registers. If an RIP written by WRMSR is not in canonical form, a general-protection exception (#GP) occurs." IA32_GS_BASE and IA32_FS_BASE (WRFSBASE/WRGSBASE): "The address written to the base field must be in canonical form or a #GP fault will occur." IA32_KERNEL_GS_BASE (SWAPGS): "The address stored in the KernelGSbase MSR must be in canonical form." This patch fixes CVE-2014-3610. Cc: [email protected] Signed-off-by: Nadav Amit <[email protected]> Signed-off-by: Paolo Bonzini <[email protected]>
static void svm_set_gdt(struct kvm_vcpu *vcpu, struct desc_ptr *dt) { struct vcpu_svm *svm = to_svm(vcpu); svm->vmcb->save.gdtr.limit = dt->size; svm->vmcb->save.gdtr.base = dt->address ; mark_dirty(svm->vmcb, VMCB_DT); }
static void svm_set_gdt(struct kvm_vcpu *vcpu, struct desc_ptr *dt) { struct vcpu_svm *svm = to_svm(vcpu); svm->vmcb->save.gdtr.limit = dt->size; svm->vmcb->save.gdtr.base = dt->address ; mark_dirty(svm->vmcb, VMCB_DT); }
C
linux
0
CVE-2013-2884
https://www.cvedetails.com/cve/CVE-2013-2884/
CWE-399
https://github.com/chromium/chromium/commit/4ac8bc08e3306f38a5ab3e551aef6ad43753579c
4ac8bc08e3306f38a5ab3e551aef6ad43753579c
Set Attr.ownerDocument in Element#setAttributeNode() Attr objects can move across documents by setAttributeNode(). So It needs to reset ownerDocument through TreeScopeAdoptr::adoptIfNeeded(). BUG=248950 TEST=set-attribute-node-from-iframe.html Review URL: https://chromiumcodereview.appspot.com/17583003 git-svn-id: svn://svn.chromium.org/blink/trunk@152938 bbb929c8-8fbe-4397-9dbb-9b2b20218538
ElementData::ElementData(unsigned arraySize) : m_isUnique(false) , m_arraySize(arraySize) , m_presentationAttributeStyleIsDirty(false) , m_styleAttributeIsDirty(false) , m_animatedSVGAttributesAreDirty(false) { }
ElementData::ElementData(unsigned arraySize) : m_isUnique(false) , m_arraySize(arraySize) , m_presentationAttributeStyleIsDirty(false) , m_styleAttributeIsDirty(false) , m_animatedSVGAttributesAreDirty(false) { }
C
Chrome
0
CVE-2017-5009
https://www.cvedetails.com/cve/CVE-2017-5009/
CWE-119
https://github.com/chromium/chromium/commit/1c40f9042ae2d6ee7483d72998aabb5e73b2ff60
1c40f9042ae2d6ee7483d72998aabb5e73b2ff60
DevTools: send proper resource type in Network.RequestWillBeSent This patch plumbs resoure type into the DispatchWillSendRequest instrumenation. This allows us to report accurate type in Network.RequestWillBeSent event, instead of "Other", that we report today. BUG=765501 R=dgozman Change-Id: I0134c08b841e8dd247fdc8ff208bfd51e462709c Reviewed-on: https://chromium-review.googlesource.com/667504 Reviewed-by: Pavel Feldman <[email protected]> Reviewed-by: Dmitry Gozman <[email protected]> Commit-Queue: Andrey Lushnikov <[email protected]> Cr-Commit-Position: refs/heads/master@{#507936}
bool InspectorNetworkAgent::FetchResourceContent(Document* document, const KURL& url, String* content, bool* base64_encoded) { DCHECK(document); DCHECK(IsMainThread()); Resource* cached_resource = document->Fetcher()->CachedResource(url); if (!cached_resource) { cached_resource = GetMemoryCache()->ResourceForURL( url, document->Fetcher()->GetCacheIdentifier()); } if (cached_resource && InspectorPageAgent::CachedResourceContent( cached_resource, content, base64_encoded)) return true; for (auto& resource : resources_data_->Resources()) { if (resource->RequestedURL() == url) { *content = resource->Content(); *base64_encoded = resource->Base64Encoded(); return true; } } return false; }
bool InspectorNetworkAgent::FetchResourceContent(Document* document, const KURL& url, String* content, bool* base64_encoded) { DCHECK(document); DCHECK(IsMainThread()); Resource* cached_resource = document->Fetcher()->CachedResource(url); if (!cached_resource) { cached_resource = GetMemoryCache()->ResourceForURL( url, document->Fetcher()->GetCacheIdentifier()); } if (cached_resource && InspectorPageAgent::CachedResourceContent( cached_resource, content, base64_encoded)) return true; for (auto& resource : resources_data_->Resources()) { if (resource->RequestedURL() == url) { *content = resource->Content(); *base64_encoded = resource->Base64Encoded(); return true; } } return false; }
C
Chrome
0
CVE-2016-0838
https://www.cvedetails.com/cve/CVE-2016-0838/
CWE-119
https://android.googlesource.com/platform/external/sonivox/+/3ac044334c3ff6a61cb4238ff3ddaf17c7efcf49
3ac044334c3ff6a61cb4238ff3ddaf17c7efcf49
Sonivox: sanity check numSamples. Bug: 26366256 Change-Id: I066888c25035ea4c60c88f316db4508dc4dab6bc
static EAS_RESULT WT_Initialize (S_VOICE_MGR *pVoiceMgr) { EAS_INT i; for (i = 0; i < NUM_WT_VOICES; i++) { pVoiceMgr->wtVoices[i].artIndex = DEFAULT_ARTICULATION_INDEX; pVoiceMgr->wtVoices[i].eg1State = DEFAULT_EG1_STATE; pVoiceMgr->wtVoices[i].eg1Value = DEFAULT_EG1_VALUE; pVoiceMgr->wtVoices[i].eg1Increment = DEFAULT_EG1_INCREMENT; pVoiceMgr->wtVoices[i].eg2State = DEFAULT_EG2_STATE; pVoiceMgr->wtVoices[i].eg2Value = DEFAULT_EG2_VALUE; pVoiceMgr->wtVoices[i].eg2Increment = DEFAULT_EG2_INCREMENT; /* left and right gain values are needed only if stereo output */ #if (NUM_OUTPUT_CHANNELS == 2) pVoiceMgr->wtVoices[i].gainLeft = DEFAULT_VOICE_GAIN; pVoiceMgr->wtVoices[i].gainRight = DEFAULT_VOICE_GAIN; #endif pVoiceMgr->wtVoices[i].phaseFrac = DEFAULT_PHASE_FRAC; pVoiceMgr->wtVoices[i].phaseAccum = DEFAULT_PHASE_INT; #ifdef _FILTER_ENABLED pVoiceMgr->wtVoices[i].filter.z1 = DEFAULT_FILTER_ZERO; pVoiceMgr->wtVoices[i].filter.z2 = DEFAULT_FILTER_ZERO; #endif } return EAS_TRUE; }
static EAS_RESULT WT_Initialize (S_VOICE_MGR *pVoiceMgr) { EAS_INT i; for (i = 0; i < NUM_WT_VOICES; i++) { pVoiceMgr->wtVoices[i].artIndex = DEFAULT_ARTICULATION_INDEX; pVoiceMgr->wtVoices[i].eg1State = DEFAULT_EG1_STATE; pVoiceMgr->wtVoices[i].eg1Value = DEFAULT_EG1_VALUE; pVoiceMgr->wtVoices[i].eg1Increment = DEFAULT_EG1_INCREMENT; pVoiceMgr->wtVoices[i].eg2State = DEFAULT_EG2_STATE; pVoiceMgr->wtVoices[i].eg2Value = DEFAULT_EG2_VALUE; pVoiceMgr->wtVoices[i].eg2Increment = DEFAULT_EG2_INCREMENT; /* left and right gain values are needed only if stereo output */ #if (NUM_OUTPUT_CHANNELS == 2) pVoiceMgr->wtVoices[i].gainLeft = DEFAULT_VOICE_GAIN; pVoiceMgr->wtVoices[i].gainRight = DEFAULT_VOICE_GAIN; #endif pVoiceMgr->wtVoices[i].phaseFrac = DEFAULT_PHASE_FRAC; pVoiceMgr->wtVoices[i].phaseAccum = DEFAULT_PHASE_INT; #ifdef _FILTER_ENABLED pVoiceMgr->wtVoices[i].filter.z1 = DEFAULT_FILTER_ZERO; pVoiceMgr->wtVoices[i].filter.z2 = DEFAULT_FILTER_ZERO; #endif } return EAS_TRUE; }
C
Android
0
CVE-2017-7539
https://www.cvedetails.com/cve/CVE-2017-7539/
CWE-20
https://git.qemu.org/?p=qemu.git;a=commitdiff;h=2b0bbc4f8809c972bad134bc1a2570dbb01dea0b
2b0bbc4f8809c972bad134bc1a2570dbb01dea0b
null
static int nbd_negotiate_read(QIOChannel *ioc, void *buffer, size_t size)
static int nbd_negotiate_read(QIOChannel *ioc, void *buffer, size_t size) { ssize_t ret; guint watch; assert(qemu_in_coroutine()); /* Negotiation are always in main loop. */ watch = qio_channel_add_watch(ioc, G_IO_IN, nbd_negotiate_continue, qemu_coroutine_self(), NULL); ret = nbd_read(ioc, buffer, size, NULL); g_source_remove(watch); return ret; }
C
qemu
1
CVE-2014-1713
https://www.cvedetails.com/cve/CVE-2014-1713/
CWE-399
https://github.com/chromium/chromium/commit/f85a87ec670ad0fce9d98d90c9a705b72a288154
f85a87ec670ad0fce9d98d90c9a705b72a288154
document.location bindings fix BUG=352374 [email protected] Review URL: https://codereview.chromium.org/196343011 git-svn-id: svn://svn.chromium.org/blink/trunk@169176 bbb929c8-8fbe-4397-9dbb-9b2b20218538
static void callWithScriptStateLongMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) { TestObjectPython* imp = V8TestObjectPython::toNative(info.Holder()); ScriptState* currentState = ScriptState::current(); if (!currentState) return; ScriptState& state = *currentState; int result = imp->callWithScriptStateLongMethod(&state); if (state.hadException()) { v8::Local<v8::Value> exception = state.exception(); state.clearException(); throwError(exception, info.GetIsolate()); return; } v8SetReturnValueInt(info, result); }
static void callWithScriptStateLongMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) { TestObjectPython* imp = V8TestObjectPython::toNative(info.Holder()); ScriptState* currentState = ScriptState::current(); if (!currentState) return; ScriptState& state = *currentState; int result = imp->callWithScriptStateLongMethod(&state); if (state.hadException()) { v8::Local<v8::Value> exception = state.exception(); state.clearException(); throwError(exception, info.GetIsolate()); return; } v8SetReturnValueInt(info, result); }
C
Chrome
0
CVE-2018-6038
https://www.cvedetails.com/cve/CVE-2018-6038/
CWE-125
https://github.com/chromium/chromium/commit/9b99a43fc119a2533a87e2357cad8f603779a7b9
9b99a43fc119a2533a87e2357cad8f603779a7b9
Implement 2D texture uploading from client array with FLIP_Y or PREMULTIPLY_ALPHA. BUG=774174 TEST=https://github.com/KhronosGroup/WebGL/pull/2555 [email protected] Cq-Include-Trybots: master.tryserver.chromium.android:android_optional_gpu_tests_rel;master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2;master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel Change-Id: I4f4e7636314502451104730501a5048a5d7b9f3f Reviewed-on: https://chromium-review.googlesource.com/808665 Commit-Queue: Zhenyao Mo <[email protected]> Reviewed-by: Kenneth Russell <[email protected]> Cr-Commit-Position: refs/heads/master@{#522003}
void Pack<WebGLImageConversion::kDataFormatRGBA4444, WebGLImageConversion::kAlphaDoPremultiply, uint8_t, uint16_t>(const uint8_t* source, uint16_t* destination, unsigned pixels_per_row) { for (unsigned i = 0; i < pixels_per_row; ++i) { float scale_factor = source[3] / 255.0f; uint8_t source_r = static_cast<uint8_t>(static_cast<float>(source[0]) * scale_factor); uint8_t source_g = static_cast<uint8_t>(static_cast<float>(source[1]) * scale_factor); uint8_t source_b = static_cast<uint8_t>(static_cast<float>(source[2]) * scale_factor); *destination = (((source_r & 0xF0) << 8) | ((source_g & 0xF0) << 4) | (source_b & 0xF0) | (source[3] >> 4)); source += 4; destination += 1; } }
void Pack<WebGLImageConversion::kDataFormatRGBA4444, WebGLImageConversion::kAlphaDoPremultiply, uint8_t, uint16_t>(const uint8_t* source, uint16_t* destination, unsigned pixels_per_row) { for (unsigned i = 0; i < pixels_per_row; ++i) { float scale_factor = source[3] / 255.0f; uint8_t source_r = static_cast<uint8_t>(static_cast<float>(source[0]) * scale_factor); uint8_t source_g = static_cast<uint8_t>(static_cast<float>(source[1]) * scale_factor); uint8_t source_b = static_cast<uint8_t>(static_cast<float>(source[2]) * scale_factor); *destination = (((source_r & 0xF0) << 8) | ((source_g & 0xF0) << 4) | (source_b & 0xF0) | (source[3] >> 4)); source += 4; destination += 1; } }
C
Chrome
0
CVE-2018-20784
https://www.cvedetails.com/cve/CVE-2018-20784/
CWE-400
https://github.com/torvalds/linux/commit/c40f7d74c741a907cfaeb73a7697081881c497d0
c40f7d74c741a907cfaeb73a7697081881c497d0
sched/fair: Fix infinite loop in update_blocked_averages() by reverting a9e7f6544b9c Zhipeng Xie, Xie XiuQi and Sargun Dhillon reported lockups in the scheduler under high loads, starting at around the v4.18 time frame, and Zhipeng Xie tracked it down to bugs in the rq->leaf_cfs_rq_list manipulation. Do a (manual) revert of: a9e7f6544b9c ("sched/fair: Fix O(nr_cgroups) in load balance path") It turns out that the list_del_leaf_cfs_rq() introduced by this commit is a surprising property that was not considered in followup commits such as: 9c2791f936ef ("sched/fair: Fix hierarchical order in rq->leaf_cfs_rq_list") As Vincent Guittot explains: "I think that there is a bigger problem with commit a9e7f6544b9c and cfs_rq throttling: Let take the example of the following topology TG2 --> TG1 --> root: 1) The 1st time a task is enqueued, we will add TG2 cfs_rq then TG1 cfs_rq to leaf_cfs_rq_list and we are sure to do the whole branch in one path because it has never been used and can't be throttled so tmp_alone_branch will point to leaf_cfs_rq_list at the end. 2) Then TG1 is throttled 3) and we add TG3 as a new child of TG1. 4) The 1st enqueue of a task on TG3 will add TG3 cfs_rq just before TG1 cfs_rq and tmp_alone_branch will stay on rq->leaf_cfs_rq_list. With commit a9e7f6544b9c, we can del a cfs_rq from rq->leaf_cfs_rq_list. So if the load of TG1 cfs_rq becomes NULL before step 2) above, TG1 cfs_rq is removed from the list. Then at step 4), TG3 cfs_rq is added at the beginning of rq->leaf_cfs_rq_list but tmp_alone_branch still points to TG3 cfs_rq because its throttled parent can't be enqueued when the lock is released. tmp_alone_branch doesn't point to rq->leaf_cfs_rq_list whereas it should. So if TG3 cfs_rq is removed or destroyed before tmp_alone_branch points on another TG cfs_rq, the next TG cfs_rq that will be added, will be linked outside rq->leaf_cfs_rq_list - which is bad. In addition, we can break the ordering of the cfs_rq in rq->leaf_cfs_rq_list but this ordering is used to update and propagate the update from leaf down to root." Instead of trying to work through all these cases and trying to reproduce the very high loads that produced the lockup to begin with, simplify the code temporarily by reverting a9e7f6544b9c - which change was clearly not thought through completely. This (hopefully) gives us a kernel that doesn't lock up so people can continue to enjoy their holidays without worrying about regressions. ;-) [ mingo: Wrote changelog, fixed weird spelling in code comment while at it. ] Analyzed-by: Xie XiuQi <[email protected]> Analyzed-by: Vincent Guittot <[email protected]> Reported-by: Zhipeng Xie <[email protected]> Reported-by: Sargun Dhillon <[email protected]> Reported-by: Xie XiuQi <[email protected]> Tested-by: Zhipeng Xie <[email protected]> Tested-by: Sargun Dhillon <[email protected]> Signed-off-by: Linus Torvalds <[email protected]> Acked-by: Vincent Guittot <[email protected]> Cc: <[email protected]> # v4.13+ Cc: Bin Li <[email protected]> Cc: Mike Galbraith <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Tejun Heo <[email protected]> Cc: Thomas Gleixner <[email protected]> Fixes: a9e7f6544b9c ("sched/fair: Fix O(nr_cgroups) in load balance path") Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Ingo Molnar <[email protected]>
enqueue_entity(struct cfs_rq *cfs_rq, struct sched_entity *se, int flags) { bool renorm = !(flags & ENQUEUE_WAKEUP) || (flags & ENQUEUE_MIGRATED); bool curr = cfs_rq->curr == se; /* * If we're the current task, we must renormalise before calling * update_curr(). */ if (renorm && curr) se->vruntime += cfs_rq->min_vruntime; update_curr(cfs_rq); /* * Otherwise, renormalise after, such that we're placed at the current * moment in time, instead of some random moment in the past. Being * placed in the past could significantly boost this task to the * fairness detriment of existing tasks. */ if (renorm && !curr) se->vruntime += cfs_rq->min_vruntime; /* * When enqueuing a sched_entity, we must: * - Update loads to have both entity and cfs_rq synced with now. * - Add its load to cfs_rq->runnable_avg * - For group_entity, update its weight to reflect the new share of * its group cfs_rq * - Add its new weight to cfs_rq->load.weight */ update_load_avg(cfs_rq, se, UPDATE_TG | DO_ATTACH); update_cfs_group(se); enqueue_runnable_load_avg(cfs_rq, se); account_entity_enqueue(cfs_rq, se); if (flags & ENQUEUE_WAKEUP) place_entity(cfs_rq, se, 0); check_schedstat_required(); update_stats_enqueue(cfs_rq, se, flags); check_spread(cfs_rq, se); if (!curr) __enqueue_entity(cfs_rq, se); se->on_rq = 1; if (cfs_rq->nr_running == 1) { list_add_leaf_cfs_rq(cfs_rq); check_enqueue_throttle(cfs_rq); } }
enqueue_entity(struct cfs_rq *cfs_rq, struct sched_entity *se, int flags) { bool renorm = !(flags & ENQUEUE_WAKEUP) || (flags & ENQUEUE_MIGRATED); bool curr = cfs_rq->curr == se; /* * If we're the current task, we must renormalise before calling * update_curr(). */ if (renorm && curr) se->vruntime += cfs_rq->min_vruntime; update_curr(cfs_rq); /* * Otherwise, renormalise after, such that we're placed at the current * moment in time, instead of some random moment in the past. Being * placed in the past could significantly boost this task to the * fairness detriment of existing tasks. */ if (renorm && !curr) se->vruntime += cfs_rq->min_vruntime; /* * When enqueuing a sched_entity, we must: * - Update loads to have both entity and cfs_rq synced with now. * - Add its load to cfs_rq->runnable_avg * - For group_entity, update its weight to reflect the new share of * its group cfs_rq * - Add its new weight to cfs_rq->load.weight */ update_load_avg(cfs_rq, se, UPDATE_TG | DO_ATTACH); update_cfs_group(se); enqueue_runnable_load_avg(cfs_rq, se); account_entity_enqueue(cfs_rq, se); if (flags & ENQUEUE_WAKEUP) place_entity(cfs_rq, se, 0); check_schedstat_required(); update_stats_enqueue(cfs_rq, se, flags); check_spread(cfs_rq, se); if (!curr) __enqueue_entity(cfs_rq, se); se->on_rq = 1; if (cfs_rq->nr_running == 1) { list_add_leaf_cfs_rq(cfs_rq); check_enqueue_throttle(cfs_rq); } }
C
linux
0
CVE-2011-5327
https://www.cvedetails.com/cve/CVE-2011-5327/
CWE-119
https://github.com/torvalds/linux/commit/12f09ccb4612734a53e47ed5302e0479c10a50f8
12f09ccb4612734a53e47ed5302e0479c10a50f8
loopback: off by one in tcm_loop_make_naa_tpg() This is an off by one 'tgpt' check in tcm_loop_make_naa_tpg() that could result in memory corruption. Signed-off-by: Dan Carpenter <[email protected]> Signed-off-by: Nicholas A. Bellinger <[email protected]>
static u32 tcm_loop_get_pr_transport_id_len( struct se_portal_group *se_tpg, struct se_node_acl *se_nacl, struct t10_pr_registration *pr_reg, int *format_code) { struct tcm_loop_tpg *tl_tpg = (struct tcm_loop_tpg *)se_tpg->se_tpg_fabric_ptr; struct tcm_loop_hba *tl_hba = tl_tpg->tl_hba; switch (tl_hba->tl_proto_id) { case SCSI_PROTOCOL_SAS: return sas_get_pr_transport_id_len(se_tpg, se_nacl, pr_reg, format_code); case SCSI_PROTOCOL_FCP: return fc_get_pr_transport_id_len(se_tpg, se_nacl, pr_reg, format_code); case SCSI_PROTOCOL_ISCSI: return iscsi_get_pr_transport_id_len(se_tpg, se_nacl, pr_reg, format_code); default: printk(KERN_ERR "Unknown tl_proto_id: 0x%02x, using" " SAS emulation\n", tl_hba->tl_proto_id); break; } return sas_get_pr_transport_id_len(se_tpg, se_nacl, pr_reg, format_code); }
static u32 tcm_loop_get_pr_transport_id_len( struct se_portal_group *se_tpg, struct se_node_acl *se_nacl, struct t10_pr_registration *pr_reg, int *format_code) { struct tcm_loop_tpg *tl_tpg = (struct tcm_loop_tpg *)se_tpg->se_tpg_fabric_ptr; struct tcm_loop_hba *tl_hba = tl_tpg->tl_hba; switch (tl_hba->tl_proto_id) { case SCSI_PROTOCOL_SAS: return sas_get_pr_transport_id_len(se_tpg, se_nacl, pr_reg, format_code); case SCSI_PROTOCOL_FCP: return fc_get_pr_transport_id_len(se_tpg, se_nacl, pr_reg, format_code); case SCSI_PROTOCOL_ISCSI: return iscsi_get_pr_transport_id_len(se_tpg, se_nacl, pr_reg, format_code); default: printk(KERN_ERR "Unknown tl_proto_id: 0x%02x, using" " SAS emulation\n", tl_hba->tl_proto_id); break; } return sas_get_pr_transport_id_len(se_tpg, se_nacl, pr_reg, format_code); }
C
linux
0
CVE-2017-9994
https://www.cvedetails.com/cve/CVE-2017-9994/
CWE-119
https://github.com/FFmpeg/FFmpeg/commit/6b5d3fb26fb4be48e4966e4b1d97c2165538d4ef
6b5d3fb26fb4be48e4966e4b1d97c2165538d4ef
avcodec/webp: Always set pix_fmt Fixes: out of array access Fixes: 1434/clusterfuzz-testcase-minimized-6314998085189632 Fixes: 1435/clusterfuzz-testcase-minimized-6483783723253760 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg Reviewed-by: "Ronald S. Bultje" <[email protected]> Signed-off-by: Michael Niedermayer <[email protected]>
static av_always_inline int webp_get_vlc(GetBitContext *gb, VLC_TYPE (*table)[2]) { int n, nb_bits; unsigned int index; int code; OPEN_READER(re, gb); UPDATE_CACHE(re, gb); index = SHOW_UBITS(re, gb, 8); index = ff_reverse[index]; code = table[index][0]; n = table[index][1]; if (n < 0) { LAST_SKIP_BITS(re, gb, 8); UPDATE_CACHE(re, gb); nb_bits = -n; index = SHOW_UBITS(re, gb, nb_bits); index = (ff_reverse[index] >> (8 - nb_bits)) + code; code = table[index][0]; n = table[index][1]; } SKIP_BITS(re, gb, n); CLOSE_READER(re, gb); return code; }
static av_always_inline int webp_get_vlc(GetBitContext *gb, VLC_TYPE (*table)[2]) { int n, nb_bits; unsigned int index; int code; OPEN_READER(re, gb); UPDATE_CACHE(re, gb); index = SHOW_UBITS(re, gb, 8); index = ff_reverse[index]; code = table[index][0]; n = table[index][1]; if (n < 0) { LAST_SKIP_BITS(re, gb, 8); UPDATE_CACHE(re, gb); nb_bits = -n; index = SHOW_UBITS(re, gb, nb_bits); index = (ff_reverse[index] >> (8 - nb_bits)) + code; code = table[index][0]; n = table[index][1]; } SKIP_BITS(re, gb, n); CLOSE_READER(re, gb); return code; }
C
FFmpeg
0
CVE-2016-9120
https://www.cvedetails.com/cve/CVE-2016-9120/
CWE-416
https://github.com/torvalds/linux/commit/9590232bb4f4cc824f3425a6e1349afbe6d6d2b7
9590232bb4f4cc824f3425a6e1349afbe6d6d2b7
staging/android/ion : fix a race condition in the ion driver There is a use-after-free problem in the ion driver. This is caused by a race condition in the ion_ioctl() function. A handle has ref count of 1 and two tasks on different cpus calls ION_IOC_FREE simultaneously. cpu 0 cpu 1 ------------------------------------------------------- ion_handle_get_by_id() (ref == 2) ion_handle_get_by_id() (ref == 3) ion_free() (ref == 2) ion_handle_put() (ref == 1) ion_free() (ref == 0 so ion_handle_destroy() is called and the handle is freed.) ion_handle_put() is called and it decreases the slub's next free pointer The problem is detected as an unaligned access in the spin lock functions since it uses load exclusive instruction. In some cases it corrupts the slub's free pointer which causes a mis-aligned access to the next free pointer.(kmalloc returns a pointer like ffffc0745b4580aa). And it causes lots of other hard-to-debug problems. This symptom is caused since the first member in the ion_handle structure is the reference count and the ion driver decrements the reference after it has been freed. To fix this problem client->lock mutex is extended to protect all the codes that uses the handle. Signed-off-by: Eun Taik Lee <[email protected]> Reviewed-by: Laura Abbott <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
static int ion_release(struct inode *inode, struct file *file) { struct ion_client *client = file->private_data; pr_debug("%s: %d\n", __func__, __LINE__); ion_client_destroy(client); return 0; }
static int ion_release(struct inode *inode, struct file *file) { struct ion_client *client = file->private_data; pr_debug("%s: %d\n", __func__, __LINE__); ion_client_destroy(client); return 0; }
C
linux
0
CVE-2011-5327
https://www.cvedetails.com/cve/CVE-2011-5327/
CWE-119
https://github.com/torvalds/linux/commit/12f09ccb4612734a53e47ed5302e0479c10a50f8
12f09ccb4612734a53e47ed5302e0479c10a50f8
loopback: off by one in tcm_loop_make_naa_tpg() This is an off by one 'tgpt' check in tcm_loop_make_naa_tpg() that could result in memory corruption. Signed-off-by: Dan Carpenter <[email protected]> Signed-off-by: Nicholas A. Bellinger <[email protected]>
static int tcm_loop_write_pending_status(struct se_cmd *se_cmd) { return 0; }
static int tcm_loop_write_pending_status(struct se_cmd *se_cmd) { return 0; }
C
linux
0
CVE-2012-6712
https://www.cvedetails.com/cve/CVE-2012-6712/
CWE-119
https://github.com/torvalds/linux/commit/2da424b0773cea3db47e1e81db71eeebde8269d4
2da424b0773cea3db47e1e81db71eeebde8269d4
iwlwifi: Sanity check for sta_id On my testing, I saw some strange behavior [ 421.739708] iwlwifi 0000:01:00.0: ACTIVATE a non DRIVER active station id 148 addr 00:00:00:00:00:00 [ 421.739719] iwlwifi 0000:01:00.0: iwl_sta_ucode_activate Added STA id 148 addr 00:00:00:00:00:00 to uCode not sure how it happen, but adding the sanity check to prevent memory corruption Signed-off-by: Wey-Yi Guy <[email protected]> Signed-off-by: John W. Linville <[email protected]>
int iwl_remove_default_wep_key(struct iwl_priv *priv, struct iwl_rxon_context *ctx, struct ieee80211_key_conf *keyconf) { int ret; lockdep_assert_held(&priv->shrd->mutex); IWL_DEBUG_WEP(priv, "Removing default WEP key: idx=%d\n", keyconf->keyidx); memset(&ctx->wep_keys[keyconf->keyidx], 0, sizeof(ctx->wep_keys[0])); if (iwl_is_rfkill(priv->shrd)) { IWL_DEBUG_WEP(priv, "Not sending REPLY_WEPKEY command due to RFKILL.\n"); /* but keys in device are clear anyway so return success */ return 0; } ret = iwl_send_static_wepkey_cmd(priv, ctx, 1); IWL_DEBUG_WEP(priv, "Remove default WEP key: idx=%d ret=%d\n", keyconf->keyidx, ret); return ret; }
int iwl_remove_default_wep_key(struct iwl_priv *priv, struct iwl_rxon_context *ctx, struct ieee80211_key_conf *keyconf) { int ret; lockdep_assert_held(&priv->shrd->mutex); IWL_DEBUG_WEP(priv, "Removing default WEP key: idx=%d\n", keyconf->keyidx); memset(&ctx->wep_keys[keyconf->keyidx], 0, sizeof(ctx->wep_keys[0])); if (iwl_is_rfkill(priv->shrd)) { IWL_DEBUG_WEP(priv, "Not sending REPLY_WEPKEY command due to RFKILL.\n"); /* but keys in device are clear anyway so return success */ return 0; } ret = iwl_send_static_wepkey_cmd(priv, ctx, 1); IWL_DEBUG_WEP(priv, "Remove default WEP key: idx=%d ret=%d\n", keyconf->keyidx, ret); return ret; }
C
linux
0
CVE-2016-1641
https://www.cvedetails.com/cve/CVE-2016-1641/
null
https://github.com/chromium/chromium/commit/75ca8ffd7bd7c58ace1144df05e1307d8d707662
75ca8ffd7bd7c58ace1144df05e1307d8d707662
Don't call WebContents::DownloadImage() callback if the WebContents were deleted BUG=583718 Review URL: https://codereview.chromium.org/1685343004 Cr-Commit-Position: refs/heads/master@{#375700}
void WebContentsImpl::RemoveAccessibilityMode(AccessibilityMode mode) { SetAccessibilityMode(RemoveAccessibilityModeFrom(accessibility_mode_, mode)); }
void WebContentsImpl::RemoveAccessibilityMode(AccessibilityMode mode) { SetAccessibilityMode(RemoveAccessibilityModeFrom(accessibility_mode_, mode)); }
C
Chrome
0
CVE-2017-15128
https://www.cvedetails.com/cve/CVE-2017-15128/
CWE-119
https://github.com/torvalds/linux/commit/1e3921471354244f70fe268586ff94a97a6dd4df
1e3921471354244f70fe268586ff94a97a6dd4df
userfaultfd: hugetlbfs: prevent UFFDIO_COPY to fill beyond the end of i_size This oops: kernel BUG at fs/hugetlbfs/inode.c:484! RIP: remove_inode_hugepages+0x3d0/0x410 Call Trace: hugetlbfs_setattr+0xd9/0x130 notify_change+0x292/0x410 do_truncate+0x65/0xa0 do_sys_ftruncate.constprop.3+0x11a/0x180 SyS_ftruncate+0xe/0x10 tracesys+0xd9/0xde was caused by the lack of i_size check in hugetlb_mcopy_atomic_pte. mmap() can still succeed beyond the end of the i_size after vmtruncate zapped vmas in those ranges, but the faults must not succeed, and that includes UFFDIO_COPY. We could differentiate the retval to userland to represent a SIGBUS like a page fault would do (vs SIGSEGV), but it doesn't seem very useful and we'd need to pick a random retval as there's no meaningful syscall retval that would differentiate from SIGSEGV and SIGBUS, there's just -EFAULT. Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Andrea Arcangeli <[email protected]> Reviewed-by: Mike Kravetz <[email protected]> Cc: Mike Rapoport <[email protected]> Cc: "Dr. David Alan Gilbert" <[email protected]> Cc: <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
int dissolve_free_huge_page(struct page *page) { int rc = 0; spin_lock(&hugetlb_lock); if (PageHuge(page) && !page_count(page)) { struct page *head = compound_head(page); struct hstate *h = page_hstate(head); int nid = page_to_nid(head); if (h->free_huge_pages - h->resv_huge_pages == 0) { rc = -EBUSY; goto out; } /* * Move PageHWPoison flag from head page to the raw error page, * which makes any subpages rather than the error page reusable. */ if (PageHWPoison(head) && page != head) { SetPageHWPoison(page); ClearPageHWPoison(head); } list_del(&head->lru); h->free_huge_pages--; h->free_huge_pages_node[nid]--; h->max_huge_pages--; update_and_free_page(h, head); } out: spin_unlock(&hugetlb_lock); return rc; }
int dissolve_free_huge_page(struct page *page) { int rc = 0; spin_lock(&hugetlb_lock); if (PageHuge(page) && !page_count(page)) { struct page *head = compound_head(page); struct hstate *h = page_hstate(head); int nid = page_to_nid(head); if (h->free_huge_pages - h->resv_huge_pages == 0) { rc = -EBUSY; goto out; } /* * Move PageHWPoison flag from head page to the raw error page, * which makes any subpages rather than the error page reusable. */ if (PageHWPoison(head) && page != head) { SetPageHWPoison(page); ClearPageHWPoison(head); } list_del(&head->lru); h->free_huge_pages--; h->free_huge_pages_node[nid]--; h->max_huge_pages--; update_and_free_page(h, head); } out: spin_unlock(&hugetlb_lock); return rc; }
C
linux
0
CVE-2018-6033
https://www.cvedetails.com/cve/CVE-2018-6033/
CWE-20
https://github.com/chromium/chromium/commit/a8d6ae61d266d8bc44c3dd2d08bda32db701e359
a8d6ae61d266d8bc44c3dd2d08bda32db701e359
Downloads : Fixed an issue of opening incorrect download file When one download overwrites another completed download, calling download.open in the old download causes the new download to open, which could be dangerous and undesirable. In this CL, we are trying to avoid this by blocking the opening of the old download. Bug: 793620 Change-Id: Ic948175756700ad7c08489c3cc347330daedb6f8 Reviewed-on: https://chromium-review.googlesource.com/826477 Reviewed-by: David Trainor <[email protected]> Reviewed-by: Xing Liu <[email protected]> Reviewed-by: John Abd-El-Malek <[email protected]> Commit-Queue: Shakti Sahu <[email protected]> Cr-Commit-Position: refs/heads/master@{#525810}
base::FilePath GetTemporaryDownloadDirectory() { std::unique_ptr<base::Environment> env(base::Environment::Create()); return base::nix::GetXDGDirectory(env.get(), "XDG_DATA_HOME", ".local/share"); }
base::FilePath GetTemporaryDownloadDirectory() { std::unique_ptr<base::Environment> env(base::Environment::Create()); return base::nix::GetXDGDirectory(env.get(), "XDG_DATA_HOME", ".local/share"); }
C
Chrome
0
CVE-2017-9059
https://www.cvedetails.com/cve/CVE-2017-9059/
CWE-404
https://github.com/torvalds/linux/commit/c70422f760c120480fee4de6c38804c72aa26bc1
c70422f760c120480fee4de6c38804c72aa26bc1
Merge tag 'nfsd-4.12' of git://linux-nfs.org/~bfields/linux Pull nfsd updates from Bruce Fields: "Another RDMA update from Chuck Lever, and a bunch of miscellaneous bugfixes" * tag 'nfsd-4.12' of git://linux-nfs.org/~bfields/linux: (26 commits) nfsd: Fix up the "supattr_exclcreat" attributes nfsd: encoders mustn't use unitialized values in error cases nfsd: fix undefined behavior in nfsd4_layout_verify lockd: fix lockd shutdown race NFSv4: Fix callback server shutdown SUNRPC: Refactor svc_set_num_threads() NFSv4.x/callback: Create the callback service through svc_create_pooled lockd: remove redundant check on block svcrdma: Clean out old XDR encoders svcrdma: Remove the req_map cache svcrdma: Remove unused RDMA Write completion handler svcrdma: Reduce size of sge array in struct svc_rdma_op_ctxt svcrdma: Clean up RPC-over-RDMA backchannel reply processing svcrdma: Report Write/Reply chunk overruns svcrdma: Clean up RDMA_ERROR path svcrdma: Use rdma_rw API in RPC reply path svcrdma: Introduce local rdma_rw API helpers svcrdma: Clean up svc_rdma_get_inv_rkey() svcrdma: Add helper to save pages under I/O svcrdma: Eliminate RPCRDMA_SQ_DEPTH_MULT ...
void svc_rdma_put_context(struct svc_rdma_op_ctxt *ctxt, int free_pages) { struct svcxprt_rdma *xprt = ctxt->xprt; int i; if (free_pages) for (i = 0; i < ctxt->count; i++) put_page(ctxt->pages[i]); spin_lock(&xprt->sc_ctxt_lock); xprt->sc_ctxt_used--; list_add(&ctxt->list, &xprt->sc_ctxts); spin_unlock(&xprt->sc_ctxt_lock); }
void svc_rdma_put_context(struct svc_rdma_op_ctxt *ctxt, int free_pages) { struct svcxprt_rdma *xprt = ctxt->xprt; int i; if (free_pages) for (i = 0; i < ctxt->count; i++) put_page(ctxt->pages[i]); spin_lock(&xprt->sc_ctxt_lock); xprt->sc_ctxt_used--; list_add(&ctxt->list, &xprt->sc_ctxts); spin_unlock(&xprt->sc_ctxt_lock); }
C
linux
0
CVE-2015-8844
https://www.cvedetails.com/cve/CVE-2015-8844/
CWE-20
https://github.com/torvalds/linux/commit/d2b9d2a5ad5ef04ff978c9923d19730cb05efd55
d2b9d2a5ad5ef04ff978c9923d19730cb05efd55
powerpc/tm: Block signal return setting invalid MSR state Currently we allow both the MSR T and S bits to be set by userspace on a signal return. Unfortunately this is a reserved configuration and will cause a TM Bad Thing exception if attempted (via rfid). This patch checks for this case in both the 32 and 64 bit signals code. If both T and S are set, we mark the context as invalid. Found using a syscall fuzzer. Fixes: 2b0a576d15e0 ("powerpc: Add new transactional memory state to the signal context") Cc: [email protected] # v3.9+ Signed-off-by: Michael Neuling <[email protected]> Signed-off-by: Michael Ellerman <[email protected]>
static long restore_user_regs(struct pt_regs *regs, struct mcontext __user *sr, int sig) { long err; unsigned int save_r2 = 0; unsigned long msr; #ifdef CONFIG_VSX int i; #endif /* * restore general registers but not including MSR or SOFTE. Also * take care of keeping r2 (TLS) intact if not a signal */ if (!sig) save_r2 = (unsigned int)regs->gpr[2]; err = restore_general_regs(regs, sr); regs->trap = 0; err |= __get_user(msr, &sr->mc_gregs[PT_MSR]); if (!sig) regs->gpr[2] = (unsigned long) save_r2; if (err) return 1; /* if doing signal return, restore the previous little-endian mode */ if (sig) regs->msr = (regs->msr & ~MSR_LE) | (msr & MSR_LE); /* * Do this before updating the thread state in * current->thread.fpr/vr/evr. That way, if we get preempted * and another task grabs the FPU/Altivec/SPE, it won't be * tempted to save the current CPU state into the thread_struct * and corrupt what we are writing there. */ discard_lazy_cpu_state(); #ifdef CONFIG_ALTIVEC /* * Force the process to reload the altivec registers from * current->thread when it next does altivec instructions */ regs->msr &= ~MSR_VEC; if (msr & MSR_VEC) { /* restore altivec registers from the stack */ if (__copy_from_user(&current->thread.vr_state, &sr->mc_vregs, sizeof(sr->mc_vregs))) return 1; } else if (current->thread.used_vr) memset(&current->thread.vr_state, 0, ELF_NVRREG * sizeof(vector128)); /* Always get VRSAVE back */ if (__get_user(current->thread.vrsave, (u32 __user *)&sr->mc_vregs[32])) return 1; if (cpu_has_feature(CPU_FTR_ALTIVEC)) mtspr(SPRN_VRSAVE, current->thread.vrsave); #endif /* CONFIG_ALTIVEC */ if (copy_fpr_from_user(current, &sr->mc_fregs)) return 1; #ifdef CONFIG_VSX /* * Force the process to reload the VSX registers from * current->thread when it next does VSX instruction. */ regs->msr &= ~MSR_VSX; if (msr & MSR_VSX) { /* * Restore altivec registers from the stack to a local * buffer, then write this out to the thread_struct */ if (copy_vsx_from_user(current, &sr->mc_vsregs)) return 1; } else if (current->thread.used_vsr) for (i = 0; i < 32 ; i++) current->thread.fp_state.fpr[i][TS_VSRLOWOFFSET] = 0; #endif /* CONFIG_VSX */ /* * force the process to reload the FP registers from * current->thread when it next does FP instructions */ regs->msr &= ~(MSR_FP | MSR_FE0 | MSR_FE1); #ifdef CONFIG_SPE /* force the process to reload the spe registers from current->thread when it next does spe instructions */ regs->msr &= ~MSR_SPE; if (msr & MSR_SPE) { /* restore spe registers from the stack */ if (__copy_from_user(current->thread.evr, &sr->mc_vregs, ELF_NEVRREG * sizeof(u32))) return 1; } else if (current->thread.used_spe) memset(current->thread.evr, 0, ELF_NEVRREG * sizeof(u32)); /* Always get SPEFSCR back */ if (__get_user(current->thread.spefscr, (u32 __user *)&sr->mc_vregs + ELF_NEVRREG)) return 1; #endif /* CONFIG_SPE */ return 0; }
static long restore_user_regs(struct pt_regs *regs, struct mcontext __user *sr, int sig) { long err; unsigned int save_r2 = 0; unsigned long msr; #ifdef CONFIG_VSX int i; #endif /* * restore general registers but not including MSR or SOFTE. Also * take care of keeping r2 (TLS) intact if not a signal */ if (!sig) save_r2 = (unsigned int)regs->gpr[2]; err = restore_general_regs(regs, sr); regs->trap = 0; err |= __get_user(msr, &sr->mc_gregs[PT_MSR]); if (!sig) regs->gpr[2] = (unsigned long) save_r2; if (err) return 1; /* if doing signal return, restore the previous little-endian mode */ if (sig) regs->msr = (regs->msr & ~MSR_LE) | (msr & MSR_LE); /* * Do this before updating the thread state in * current->thread.fpr/vr/evr. That way, if we get preempted * and another task grabs the FPU/Altivec/SPE, it won't be * tempted to save the current CPU state into the thread_struct * and corrupt what we are writing there. */ discard_lazy_cpu_state(); #ifdef CONFIG_ALTIVEC /* * Force the process to reload the altivec registers from * current->thread when it next does altivec instructions */ regs->msr &= ~MSR_VEC; if (msr & MSR_VEC) { /* restore altivec registers from the stack */ if (__copy_from_user(&current->thread.vr_state, &sr->mc_vregs, sizeof(sr->mc_vregs))) return 1; } else if (current->thread.used_vr) memset(&current->thread.vr_state, 0, ELF_NVRREG * sizeof(vector128)); /* Always get VRSAVE back */ if (__get_user(current->thread.vrsave, (u32 __user *)&sr->mc_vregs[32])) return 1; if (cpu_has_feature(CPU_FTR_ALTIVEC)) mtspr(SPRN_VRSAVE, current->thread.vrsave); #endif /* CONFIG_ALTIVEC */ if (copy_fpr_from_user(current, &sr->mc_fregs)) return 1; #ifdef CONFIG_VSX /* * Force the process to reload the VSX registers from * current->thread when it next does VSX instruction. */ regs->msr &= ~MSR_VSX; if (msr & MSR_VSX) { /* * Restore altivec registers from the stack to a local * buffer, then write this out to the thread_struct */ if (copy_vsx_from_user(current, &sr->mc_vsregs)) return 1; } else if (current->thread.used_vsr) for (i = 0; i < 32 ; i++) current->thread.fp_state.fpr[i][TS_VSRLOWOFFSET] = 0; #endif /* CONFIG_VSX */ /* * force the process to reload the FP registers from * current->thread when it next does FP instructions */ regs->msr &= ~(MSR_FP | MSR_FE0 | MSR_FE1); #ifdef CONFIG_SPE /* force the process to reload the spe registers from current->thread when it next does spe instructions */ regs->msr &= ~MSR_SPE; if (msr & MSR_SPE) { /* restore spe registers from the stack */ if (__copy_from_user(current->thread.evr, &sr->mc_vregs, ELF_NEVRREG * sizeof(u32))) return 1; } else if (current->thread.used_spe) memset(current->thread.evr, 0, ELF_NEVRREG * sizeof(u32)); /* Always get SPEFSCR back */ if (__get_user(current->thread.spefscr, (u32 __user *)&sr->mc_vregs + ELF_NEVRREG)) return 1; #endif /* CONFIG_SPE */ return 0; }
C
linux
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 <[email protected]> Reviewed-by: Kentaro Hara <[email protected]> Reviewed-by: Geoff Lang <[email protected]> Reviewed-by: Kenneth Russell <[email protected]> Cr-Commit-Position: refs/heads/master@{#657568}
bool WebGLRenderingContextBase::ValidateDrawArrays(const char* function_name) { if (isContextLost()) return false; if (!ValidateRenderingState(function_name)) { return false; } const char* reason = "framebuffer incomplete"; if (framebuffer_binding_ && framebuffer_binding_->CheckDepthStencilStatus( &reason) != GL_FRAMEBUFFER_COMPLETE) { SynthesizeGLError(GL_INVALID_FRAMEBUFFER_OPERATION, function_name, reason); return false; } return true; }
bool WebGLRenderingContextBase::ValidateDrawArrays(const char* function_name) { if (isContextLost()) return false; if (!ValidateRenderingState(function_name)) { return false; } const char* reason = "framebuffer incomplete"; if (framebuffer_binding_ && framebuffer_binding_->CheckDepthStencilStatus( &reason) != GL_FRAMEBUFFER_COMPLETE) { SynthesizeGLError(GL_INVALID_FRAMEBUFFER_OPERATION, function_name, reason); return false; } return true; }
C
Chrome
0
CVE-2017-16931
https://www.cvedetails.com/cve/CVE-2017-16931/
CWE-119
https://github.com/GNOME/libxml2/commit/e26630548e7d138d2c560844c43820b6767251e3
e26630548e7d138d2c560844c43820b6767251e3
Fix handling of parameter-entity references There were two bugs where parameter-entity references could lead to an unexpected change of the input buffer in xmlParseNameComplex and xmlDictLookup being called with an invalid pointer. Percent sign in DTD Names ========================= The NEXTL macro used to call xmlParserHandlePEReference. When parsing "complex" names inside the DTD, this could result in entity expansion which created a new input buffer. The fix is to simply remove the call to xmlParserHandlePEReference from the NEXTL macro. This is safe because no users of the macro require expansion of parameter entities. - xmlParseNameComplex - xmlParseNCNameComplex - xmlParseNmtoken The percent sign is not allowed in names, which are grammatical tokens. - xmlParseEntityValue Parameter-entity references in entity values are expanded but this happens in a separate step in this function. - xmlParseSystemLiteral Parameter-entity references are ignored in the system literal. - xmlParseAttValueComplex - xmlParseCharDataComplex - xmlParseCommentComplex - xmlParsePI - xmlParseCDSect Parameter-entity references are ignored outside the DTD. - xmlLoadEntityContent This function is only called from xmlStringLenDecodeEntities and entities are replaced in a separate step immediately after the function call. This bug could also be triggered with an internal subset and double entity expansion. This fixes bug 766956 initially reported by Wei Lei and independently by Chromium's ClusterFuzz, Hanno Böck, and Marco Grassi. Thanks to everyone involved. xmlParseNameComplex with XML_PARSE_OLD10 ======================================== When parsing Names inside an expanded parameter entity with the XML_PARSE_OLD10 option, xmlParseNameComplex would call xmlGROW via the GROW macro if the input buffer was exhausted. At the end of the parameter entity's replacement text, this function would then call xmlPopInput which invalidated the input buffer. There should be no need to invoke GROW in this situation because the buffer is grown periodically every XML_PARSER_CHUNK_SIZE characters and, at least for UTF-8, in xmlCurrentChar. This also matches the code path executed when XML_PARSE_OLD10 is not set. This fixes bugs 781205 (CVE-2017-9049) and 781361 (CVE-2017-9050). Thanks to Marcel Böhme and Thuan Pham for the report. Additional hardening ==================== A separate check was added in xmlParseNameComplex to validate the buffer size.
parse_list(xmlChar *str) { xmlChar **buffer; xmlChar **out = NULL; int buffer_size = 0; int len; if(str == NULL) { return(NULL); } len = xmlStrlen(str); if((str[0] == '\'') && (str[len - 1] == '\'')) { str[len - 1] = '\0'; str++; } /* * allocate an translation buffer. */ buffer_size = 1000; buffer = (xmlChar **) xmlMalloc(buffer_size * sizeof(xmlChar*)); if (buffer == NULL) { perror("malloc failed"); return(NULL); } out = buffer; while(*str != '\0') { if (out - buffer > buffer_size - 10) { int indx = out - buffer; xxx_growBufferReentrant(); out = &buffer[indx]; } (*out++) = str; while(*str != ',' && *str != '\0') ++str; if(*str == ',') *(str++) = '\0'; } (*out) = NULL; return buffer; }
parse_list(xmlChar *str) { xmlChar **buffer; xmlChar **out = NULL; int buffer_size = 0; int len; if(str == NULL) { return(NULL); } len = xmlStrlen(str); if((str[0] == '\'') && (str[len - 1] == '\'')) { str[len - 1] = '\0'; str++; } /* * allocate an translation buffer. */ buffer_size = 1000; buffer = (xmlChar **) xmlMalloc(buffer_size * sizeof(xmlChar*)); if (buffer == NULL) { perror("malloc failed"); return(NULL); } out = buffer; while(*str != '\0') { if (out - buffer > buffer_size - 10) { int indx = out - buffer; xxx_growBufferReentrant(); out = &buffer[indx]; } (*out++) = str; while(*str != ',' && *str != '\0') ++str; if(*str == ',') *(str++) = '\0'; } (*out) = NULL; return buffer; }
C
libxml2
0
CVE-2015-5352
https://www.cvedetails.com/cve/CVE-2015-5352/
CWE-264
https://anongit.mindrot.org/openssh.git/commit/?h=V_6_9&id=1bf477d3cdf1a864646d59820878783d42357a1d
1bf477d3cdf1a864646d59820878783d42357a1d
null
channel_free(Channel *c) { char *s; u_int i, n; struct channel_confirm *cc; for (n = 0, i = 0; i < channels_alloc; i++) if (channels[i]) n++; debug("channel %d: free: %s, nchannels %u", c->self, c->remote_name ? c->remote_name : "???", n); s = channel_open_message(); debug3("channel %d: status: %s", c->self, s); free(s); if (c->sock != -1) shutdown(c->sock, SHUT_RDWR); channel_close_fds(c); buffer_free(&c->input); buffer_free(&c->output); buffer_free(&c->extended); free(c->remote_name); c->remote_name = NULL; free(c->path); c->path = NULL; free(c->listening_addr); c->listening_addr = NULL; while ((cc = TAILQ_FIRST(&c->status_confirms)) != NULL) { if (cc->abandon_cb != NULL) cc->abandon_cb(c, cc->ctx); TAILQ_REMOVE(&c->status_confirms, cc, entry); explicit_bzero(cc, sizeof(*cc)); free(cc); } if (c->filter_cleanup != NULL && c->filter_ctx != NULL) c->filter_cleanup(c->self, c->filter_ctx); channels[c->self] = NULL; free(c); }
channel_free(Channel *c) { char *s; u_int i, n; struct channel_confirm *cc; for (n = 0, i = 0; i < channels_alloc; i++) if (channels[i]) n++; debug("channel %d: free: %s, nchannels %u", c->self, c->remote_name ? c->remote_name : "???", n); s = channel_open_message(); debug3("channel %d: status: %s", c->self, s); free(s); if (c->sock != -1) shutdown(c->sock, SHUT_RDWR); channel_close_fds(c); buffer_free(&c->input); buffer_free(&c->output); buffer_free(&c->extended); free(c->remote_name); c->remote_name = NULL; free(c->path); c->path = NULL; free(c->listening_addr); c->listening_addr = NULL; while ((cc = TAILQ_FIRST(&c->status_confirms)) != NULL) { if (cc->abandon_cb != NULL) cc->abandon_cb(c, cc->ctx); TAILQ_REMOVE(&c->status_confirms, cc, entry); explicit_bzero(cc, sizeof(*cc)); free(cc); } if (c->filter_cleanup != NULL && c->filter_ctx != NULL) c->filter_cleanup(c->self, c->filter_ctx); channels[c->self] = NULL; free(c); }
C
mindrot
0
CVE-2018-11376
https://www.cvedetails.com/cve/CVE-2018-11376/
CWE-125
https://github.com/radare/radare2/commit/1f37c04f2a762500222dda2459e6a04646feeedf
1f37c04f2a762500222dda2459e6a04646feeedf
Fix #9904 - crash in r2_hoobr_r_read_le32 (over 9000 entrypoints) and read_le oobread (#9923)
static int bin_libs(RCore *r, int mode) { RList *libs; RListIter *iter; char* lib; int i = 0; if (!(libs = r_bin_get_libs (r->bin))) { return false; } if (IS_MODE_JSON (mode)) { r_cons_print ("["); } else if (IS_MODE_NORMAL (mode)) { r_cons_println ("[Linked libraries]"); } r_list_foreach (libs, iter, lib) { if (IS_MODE_SET (mode)) { } else if (IS_MODE_RAD (mode)) { r_cons_printf ("CCa entry0 %s\n", lib); } else if (IS_MODE_JSON (mode)) { r_cons_printf ("%s\"%s\"", iter->p ? "," : "", lib); } else { r_cons_println (lib); } i++; } if (IS_MODE_JSON (mode)) { r_cons_print ("]"); } else if (IS_MODE_NORMAL (mode)) { if (i == 1) { r_cons_printf ("\n%i library\n", i); } else { r_cons_printf ("\n%i libraries\n", i); } } return true; }
static int bin_libs(RCore *r, int mode) { RList *libs; RListIter *iter; char* lib; int i = 0; if (!(libs = r_bin_get_libs (r->bin))) { return false; } if (IS_MODE_JSON (mode)) { r_cons_print ("["); } else if (IS_MODE_NORMAL (mode)) { r_cons_println ("[Linked libraries]"); } r_list_foreach (libs, iter, lib) { if (IS_MODE_SET (mode)) { } else if (IS_MODE_RAD (mode)) { r_cons_printf ("CCa entry0 %s\n", lib); } else if (IS_MODE_JSON (mode)) { r_cons_printf ("%s\"%s\"", iter->p ? "," : "", lib); } else { r_cons_println (lib); } i++; } if (IS_MODE_JSON (mode)) { r_cons_print ("]"); } else if (IS_MODE_NORMAL (mode)) { if (i == 1) { r_cons_printf ("\n%i library\n", i); } else { r_cons_printf ("\n%i libraries\n", i); } } return true; }
C
radare2
0
CVE-2014-3645
https://www.cvedetails.com/cve/CVE-2014-3645/
CWE-20
https://github.com/torvalds/linux/commit/bfd0a56b90005f8c8a004baf407ad90045c2b11e
bfd0a56b90005f8c8a004baf407ad90045c2b11e
nEPT: Nested INVEPT If we let L1 use EPT, we should probably also support the INVEPT instruction. In our current nested EPT implementation, when L1 changes its EPT table for L2 (i.e., EPT12), L0 modifies the shadow EPT table (EPT02), and in the course of this modification already calls INVEPT. But if last level of shadow page is unsync not all L1's changes to EPT12 are intercepted, which means roots need to be synced when L1 calls INVEPT. Global INVEPT should not be different since roots are synced by kvm_mmu_load() each time EPTP02 changes. Reviewed-by: Xiao Guangrong <[email protected]> Signed-off-by: Nadav Har'El <[email protected]> Signed-off-by: Jun Nakajima <[email protected]> Signed-off-by: Xinhao Xu <[email protected]> Signed-off-by: Yang Zhang <[email protected]> Signed-off-by: Gleb Natapov <[email protected]> Signed-off-by: Paolo Bonzini <[email protected]>
static int handle_ept_misconfig(struct kvm_vcpu *vcpu) { u64 sptes[4]; int nr_sptes, i, ret; gpa_t gpa; gpa = vmcs_read64(GUEST_PHYSICAL_ADDRESS); ret = handle_mmio_page_fault_common(vcpu, gpa, true); if (likely(ret == RET_MMIO_PF_EMULATE)) return x86_emulate_instruction(vcpu, gpa, 0, NULL, 0) == EMULATE_DONE; if (unlikely(ret == RET_MMIO_PF_INVALID)) return kvm_mmu_page_fault(vcpu, gpa, 0, NULL, 0); if (unlikely(ret == RET_MMIO_PF_RETRY)) return 1; /* It is the real ept misconfig */ printk(KERN_ERR "EPT: Misconfiguration.\n"); printk(KERN_ERR "EPT: GPA: 0x%llx\n", gpa); nr_sptes = kvm_mmu_get_spte_hierarchy(vcpu, gpa, sptes); for (i = PT64_ROOT_LEVEL; i > PT64_ROOT_LEVEL - nr_sptes; --i) ept_misconfig_inspect_spte(vcpu, sptes[i-1], i); vcpu->run->exit_reason = KVM_EXIT_UNKNOWN; vcpu->run->hw.hardware_exit_reason = EXIT_REASON_EPT_MISCONFIG; return 0; }
static int handle_ept_misconfig(struct kvm_vcpu *vcpu) { u64 sptes[4]; int nr_sptes, i, ret; gpa_t gpa; gpa = vmcs_read64(GUEST_PHYSICAL_ADDRESS); ret = handle_mmio_page_fault_common(vcpu, gpa, true); if (likely(ret == RET_MMIO_PF_EMULATE)) return x86_emulate_instruction(vcpu, gpa, 0, NULL, 0) == EMULATE_DONE; if (unlikely(ret == RET_MMIO_PF_INVALID)) return kvm_mmu_page_fault(vcpu, gpa, 0, NULL, 0); if (unlikely(ret == RET_MMIO_PF_RETRY)) return 1; /* It is the real ept misconfig */ printk(KERN_ERR "EPT: Misconfiguration.\n"); printk(KERN_ERR "EPT: GPA: 0x%llx\n", gpa); nr_sptes = kvm_mmu_get_spte_hierarchy(vcpu, gpa, sptes); for (i = PT64_ROOT_LEVEL; i > PT64_ROOT_LEVEL - nr_sptes; --i) ept_misconfig_inspect_spte(vcpu, sptes[i-1], i); vcpu->run->exit_reason = KVM_EXIT_UNKNOWN; vcpu->run->hw.hardware_exit_reason = EXIT_REASON_EPT_MISCONFIG; return 0; }
C
linux
0
CVE-2014-0038
https://www.cvedetails.com/cve/CVE-2014-0038/
CWE-20
https://github.com/torvalds/linux/commit/2def2ef2ae5f3990aabdbe8a755911902707d268
2def2ef2ae5f3990aabdbe8a755911902707d268
x86, x32: Correct invalid use of user timespec in the kernel The x32 case for the recvmsg() timout handling is broken: asmlinkage long compat_sys_recvmmsg(int fd, struct compat_mmsghdr __user *mmsg, unsigned int vlen, unsigned int flags, struct compat_timespec __user *timeout) { int datagrams; struct timespec ktspec; if (flags & MSG_CMSG_COMPAT) return -EINVAL; if (COMPAT_USE_64BIT_TIME) return __sys_recvmmsg(fd, (struct mmsghdr __user *)mmsg, vlen, flags | MSG_CMSG_COMPAT, (struct timespec *) timeout); ... The timeout pointer parameter is provided by userland (hence the __user annotation) but for x32 syscalls it's simply cast to a kernel pointer and is passed to __sys_recvmmsg which will eventually directly dereference it for both reading and writing. Other callers to __sys_recvmmsg properly copy from userland to the kernel first. The bug was introduced by commit ee4fa23c4bfc ("compat: Use COMPAT_USE_64BIT_TIME in net/compat.c") and should affect all kernels since 3.4 (and perhaps vendor kernels if they backported x32 support along with this code). Note that CONFIG_X86_X32_ABI gets enabled at build time and only if CONFIG_X86_X32 is enabled and ld can build x32 executables. Other uses of COMPAT_USE_64BIT_TIME seem fine. This addresses CVE-2014-0038. Signed-off-by: PaX Team <[email protected]> Signed-off-by: H. Peter Anvin <[email protected]> Cc: <[email protected]> # v3.4+ Signed-off-by: Linus Torvalds <[email protected]>
static int compat_sock_setsockopt(struct socket *sock, int level, int optname, char __user *optval, unsigned int optlen) { if (optname == SO_ATTACH_FILTER) return do_set_attach_filter(sock, level, optname, optval, optlen); if (optname == SO_RCVTIMEO || optname == SO_SNDTIMEO) return do_set_sock_timeout(sock, level, optname, optval, optlen); return sock_setsockopt(sock, level, optname, optval, optlen); }
static int compat_sock_setsockopt(struct socket *sock, int level, int optname, char __user *optval, unsigned int optlen) { if (optname == SO_ATTACH_FILTER) return do_set_attach_filter(sock, level, optname, optval, optlen); if (optname == SO_RCVTIMEO || optname == SO_SNDTIMEO) return do_set_sock_timeout(sock, level, optname, optval, optlen); return sock_setsockopt(sock, level, optname, optval, optlen); }
C
linux
0
CVE-2017-6903
https://www.cvedetails.com/cve/CVE-2017-6903/
CWE-269
https://github.com/iortcw/iortcw/commit/11a83410153756ae350a82ed41b08d128ff7f998
11a83410153756ae350a82ed41b08d128ff7f998
All: Merge some file writing extension checks
int Com_Milliseconds( void ) { sysEvent_t ev; do { ev = Com_GetRealEvent(); if ( ev.evType != SE_NONE ) { Com_PushEvent( &ev ); } } while ( ev.evType != SE_NONE ); return ev.evTime; }
int Com_Milliseconds( void ) { sysEvent_t ev; do { ev = Com_GetRealEvent(); if ( ev.evType != SE_NONE ) { Com_PushEvent( &ev ); } } while ( ev.evType != SE_NONE ); return ev.evTime; }
C
OpenJK
0
CVE-2018-6060
https://www.cvedetails.com/cve/CVE-2018-6060/
CWE-416
https://github.com/chromium/chromium/commit/fd6a5115103b3e6a52ce15858c5ad4956df29300
fd6a5115103b3e6a52ce15858c5ad4956df29300
Revert "Keep AudioHandlers alive until they can be safely deleted." This reverts commit 071df33edf2c8b4375fa432a83953359f93ea9e4. Reason for revert: This CL seems to cause an AudioNode leak on the Linux leak bot. The log is: https://ci.chromium.org/buildbot/chromium.webkit/WebKit%20Linux%20Trusty%20Leak/14252 * webaudio/AudioNode/audionode-connect-method-chaining.html * webaudio/Panner/pannernode-basic.html * webaudio/dom-exceptions.html Original change's description: > Keep AudioHandlers alive until they can be safely deleted. > > When an AudioNode is disposed, the handler is also disposed. But add > the handler to the orphan list so that the handler stays alive until > the context can safely delete it. If we don't do this, the handler > may get deleted while the audio thread is processing the handler (due > to, say, channel count changes and such). > > For an realtime context, always save the handler just in case the > audio thread is running after the context is marked as closed (because > the audio thread doesn't instantly stop when requested). > > For an offline context, only need to do this when the context is > running because the context is guaranteed to be stopped if we're not > in the running state. Hence, there's no possibility of deleting the > handler while the graph is running. > > This is a revert of > https://chromium-review.googlesource.com/c/chromium/src/+/860779, with > a fix for the leak. > > Bug: 780919 > Change-Id: Ifb6b5fcf3fbc373f5779256688731245771da33c > Reviewed-on: https://chromium-review.googlesource.com/862723 > Reviewed-by: Hongchan Choi <[email protected]> > Commit-Queue: Raymond Toy <[email protected]> > Cr-Commit-Position: refs/heads/master@{#528829} [email protected],[email protected] Change-Id: Ibf406bf6ed34ea1f03e86a64a1e5ba6de0970c6f No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: 780919 Reviewed-on: https://chromium-review.googlesource.com/863402 Reviewed-by: Taiju Tsuiki <[email protected]> Commit-Queue: Taiju Tsuiki <[email protected]> Cr-Commit-Position: refs/heads/master@{#528888}
void AudioNode::Dispose() { DCHECK(IsMainThread()); #if DEBUG_AUDIONODE_REFERENCES fprintf(stderr, "[%16p]: %16p: %2d: AudioNode::dispose %16p\n", context(), this, Handler().GetNodeType(), handler_.get()); #endif BaseAudioContext::GraphAutoLocker locker(context()); Handler().Dispose(); if (context()->ContextState() == BaseAudioContext::kRunning) { context()->GetDeferredTaskHandler().AddRenderingOrphanHandler( std::move(handler_)); } }
void AudioNode::Dispose() { DCHECK(IsMainThread()); #if DEBUG_AUDIONODE_REFERENCES fprintf(stderr, "[%16p]: %16p: %2d: AudioNode::dispose %16p\n", context(), this, Handler().GetNodeType(), handler_.get()); #endif BaseAudioContext::GraphAutoLocker locker(context()); Handler().Dispose(); if (context()->HasRealtimeConstraint()) { context()->GetDeferredTaskHandler().AddRenderingOrphanHandler( std::move(handler_)); } else { if (context()->ContextState() == BaseAudioContext::kRunning) { context()->GetDeferredTaskHandler().AddRenderingOrphanHandler( std::move(handler_)); } } }
C
Chrome
1
CVE-2014-1703
https://www.cvedetails.com/cve/CVE-2014-1703/
CWE-399
https://github.com/chromium/chromium/commit/0ebe983f1cfdd383a4954127f564b83a4fe4992f
0ebe983f1cfdd383a4954127f564b83a4fe4992f
Remove fallback when requesting a single USB interface. This reverts commit 2d475d0ed37bf8f19385537ad31e361f1b21624b. The permission broker now supports opening devices that are partially claimed through the OpenPath method and RequestPathAccess will always fail for these devices so the fallback path from RequestPathAccess to OpenPath is always taken. BUG=500057 Review URL: https://codereview.chromium.org/1227313003 Cr-Commit-Position: refs/heads/master@{#338354}
UsbListInterfacesFunction::UsbListInterfacesFunction() { }
UsbListInterfacesFunction::UsbListInterfacesFunction() { }
C
Chrome
0
CVE-2017-9202
https://www.cvedetails.com/cve/CVE-2017-9202/
CWE-369
https://github.com/jsummers/imageworsener/commit/dc49c807926b96e503bd7c0dec35119eecd6c6fe
dc49c807926b96e503bd7c0dec35119eecd6c6fe
Double-check that the input image's density is valid Fixes a bug that could result in division by zero, at least for a JPEG source image. Fixes issues #19, #20
IW_IMPL(int) iw_get_version_int(void) { return IW_VERSION_INT; }
IW_IMPL(int) iw_get_version_int(void) { return IW_VERSION_INT; }
C
imageworsener
0
CVE-2016-7913
https://www.cvedetails.com/cve/CVE-2016-7913/
CWE-416
https://github.com/torvalds/linux/commit/8dfbcc4351a0b6d2f2d77f367552f48ffefafe18
8dfbcc4351a0b6d2f2d77f367552f48ffefafe18
[media] xc2028: avoid use after free If struct xc2028_config is passed without a firmware name, the following trouble may happen: [11009.907205] xc2028 5-0061: type set to XCeive xc2028/xc3028 tuner [11009.907491] ================================================================== [11009.907750] BUG: KASAN: use-after-free in strcmp+0x96/0xb0 at addr ffff8803bd78ab40 [11009.907992] Read of size 1 by task modprobe/28992 [11009.907994] ============================================================================= [11009.907997] BUG kmalloc-16 (Tainted: G W ): kasan: bad access detected [11009.907999] ----------------------------------------------------------------------------- [11009.908008] INFO: Allocated in xhci_urb_enqueue+0x214/0x14c0 [xhci_hcd] age=0 cpu=3 pid=28992 [11009.908012] ___slab_alloc+0x581/0x5b0 [11009.908014] __slab_alloc+0x51/0x90 [11009.908017] __kmalloc+0x27b/0x350 [11009.908022] xhci_urb_enqueue+0x214/0x14c0 [xhci_hcd] [11009.908026] usb_hcd_submit_urb+0x1e8/0x1c60 [11009.908029] usb_submit_urb+0xb0e/0x1200 [11009.908032] usb_serial_generic_write_start+0xb6/0x4c0 [11009.908035] usb_serial_generic_write+0x92/0xc0 [11009.908039] usb_console_write+0x38a/0x560 [11009.908045] call_console_drivers.constprop.14+0x1ee/0x2c0 [11009.908051] console_unlock+0x40d/0x900 [11009.908056] vprintk_emit+0x4b4/0x830 [11009.908061] vprintk_default+0x1f/0x30 [11009.908064] printk+0x99/0xb5 [11009.908067] kasan_report_error+0x10a/0x550 [11009.908070] __asan_report_load1_noabort+0x43/0x50 [11009.908074] INFO: Freed in xc2028_set_config+0x90/0x630 [tuner_xc2028] age=1 cpu=3 pid=28992 [11009.908077] __slab_free+0x2ec/0x460 [11009.908080] kfree+0x266/0x280 [11009.908083] xc2028_set_config+0x90/0x630 [tuner_xc2028] [11009.908086] xc2028_attach+0x310/0x8a0 [tuner_xc2028] [11009.908090] em28xx_attach_xc3028.constprop.7+0x1f9/0x30d [em28xx_dvb] [11009.908094] em28xx_dvb_init.part.3+0x8e4/0x5cf4 [em28xx_dvb] [11009.908098] em28xx_dvb_init+0x81/0x8a [em28xx_dvb] [11009.908101] em28xx_register_extension+0xd9/0x190 [em28xx] [11009.908105] em28xx_dvb_register+0x10/0x1000 [em28xx_dvb] [11009.908108] do_one_initcall+0x141/0x300 [11009.908111] do_init_module+0x1d0/0x5ad [11009.908114] load_module+0x6666/0x9ba0 [11009.908117] SyS_finit_module+0x108/0x130 [11009.908120] entry_SYSCALL_64_fastpath+0x16/0x76 [11009.908123] INFO: Slab 0xffffea000ef5e280 objects=25 used=25 fp=0x (null) flags=0x2ffff8000004080 [11009.908126] INFO: Object 0xffff8803bd78ab40 @offset=2880 fp=0x0000000000000001 [11009.908130] Bytes b4 ffff8803bd78ab30: 01 00 00 00 2a 07 00 00 9d 28 00 00 01 00 00 00 ....*....(...... [11009.908133] Object ffff8803bd78ab40: 01 00 00 00 00 00 00 00 b0 1d c3 6a 00 88 ff ff ...........j.... [11009.908137] CPU: 3 PID: 28992 Comm: modprobe Tainted: G B W 4.5.0-rc1+ #43 [11009.908140] Hardware name: /NUC5i7RYB, BIOS RYBDWi35.86A.0350.2015.0812.1722 08/12/2015 [11009.908142] ffff8803bd78a000 ffff8802c273f1b8 ffffffff81932007 ffff8803c6407a80 [11009.908148] ffff8802c273f1e8 ffffffff81556759 ffff8803c6407a80 ffffea000ef5e280 [11009.908153] ffff8803bd78ab40 dffffc0000000000 ffff8802c273f210 ffffffff8155ccb4 [11009.908158] Call Trace: [11009.908162] [<ffffffff81932007>] dump_stack+0x4b/0x64 [11009.908165] [<ffffffff81556759>] print_trailer+0xf9/0x150 [11009.908168] [<ffffffff8155ccb4>] object_err+0x34/0x40 [11009.908171] [<ffffffff8155f260>] kasan_report_error+0x230/0x550 [11009.908175] [<ffffffff81237d71>] ? trace_hardirqs_off_caller+0x21/0x290 [11009.908179] [<ffffffff8155e926>] ? kasan_unpoison_shadow+0x36/0x50 [11009.908182] [<ffffffff8155f5c3>] __asan_report_load1_noabort+0x43/0x50 [11009.908185] [<ffffffff8155ea00>] ? __asan_register_globals+0x50/0xa0 [11009.908189] [<ffffffff8194cea6>] ? strcmp+0x96/0xb0 [11009.908192] [<ffffffff8194cea6>] strcmp+0x96/0xb0 [11009.908196] [<ffffffffa13ba4ac>] xc2028_set_config+0x15c/0x630 [tuner_xc2028] [11009.908200] [<ffffffffa13bac90>] xc2028_attach+0x310/0x8a0 [tuner_xc2028] [11009.908203] [<ffffffff8155ea78>] ? memset+0x28/0x30 [11009.908206] [<ffffffffa13ba980>] ? xc2028_set_config+0x630/0x630 [tuner_xc2028] [11009.908211] [<ffffffffa157a59a>] em28xx_attach_xc3028.constprop.7+0x1f9/0x30d [em28xx_dvb] [11009.908215] [<ffffffffa157aa2a>] ? em28xx_dvb_init.part.3+0x37c/0x5cf4 [em28xx_dvb] [11009.908219] [<ffffffffa157a3a1>] ? hauppauge_hvr930c_init+0x487/0x487 [em28xx_dvb] [11009.908222] [<ffffffffa01795ac>] ? lgdt330x_attach+0x1cc/0x370 [lgdt330x] [11009.908226] [<ffffffffa01793e0>] ? i2c_read_demod_bytes.isra.2+0x210/0x210 [lgdt330x] [11009.908230] [<ffffffff812e87d0>] ? ref_module.part.15+0x10/0x10 [11009.908233] [<ffffffff812e56e0>] ? module_assert_mutex_or_preempt+0x80/0x80 [11009.908238] [<ffffffffa157af92>] em28xx_dvb_init.part.3+0x8e4/0x5cf4 [em28xx_dvb] [11009.908242] [<ffffffffa157a6ae>] ? em28xx_attach_xc3028.constprop.7+0x30d/0x30d [em28xx_dvb] [11009.908245] [<ffffffff8195222d>] ? string+0x14d/0x1f0 [11009.908249] [<ffffffff8195381f>] ? symbol_string+0xff/0x1a0 [11009.908253] [<ffffffff81953720>] ? uuid_string+0x6f0/0x6f0 [11009.908257] [<ffffffff811a775e>] ? __kernel_text_address+0x7e/0xa0 [11009.908260] [<ffffffff8104b02f>] ? print_context_stack+0x7f/0xf0 [11009.908264] [<ffffffff812e9846>] ? __module_address+0xb6/0x360 [11009.908268] [<ffffffff8137fdc9>] ? is_ftrace_trampoline+0x99/0xe0 [11009.908271] [<ffffffff811a775e>] ? __kernel_text_address+0x7e/0xa0 [11009.908275] [<ffffffff81240a70>] ? debug_check_no_locks_freed+0x290/0x290 [11009.908278] [<ffffffff8104a24b>] ? dump_trace+0x11b/0x300 [11009.908282] [<ffffffffa13e8143>] ? em28xx_register_extension+0x23/0x190 [em28xx] [11009.908285] [<ffffffff81237d71>] ? trace_hardirqs_off_caller+0x21/0x290 [11009.908289] [<ffffffff8123ff56>] ? trace_hardirqs_on_caller+0x16/0x590 [11009.908292] [<ffffffff812404dd>] ? trace_hardirqs_on+0xd/0x10 [11009.908296] [<ffffffffa13e8143>] ? em28xx_register_extension+0x23/0x190 [em28xx] [11009.908299] [<ffffffff822dcbb0>] ? mutex_trylock+0x400/0x400 [11009.908302] [<ffffffff810021a1>] ? do_one_initcall+0x131/0x300 [11009.908306] [<ffffffff81296dc7>] ? call_rcu_sched+0x17/0x20 [11009.908309] [<ffffffff8159e708>] ? put_object+0x48/0x70 [11009.908314] [<ffffffffa1579f11>] em28xx_dvb_init+0x81/0x8a [em28xx_dvb] [11009.908317] [<ffffffffa13e81f9>] em28xx_register_extension+0xd9/0x190 [em28xx] [11009.908320] [<ffffffffa0150000>] ? 0xffffffffa0150000 [11009.908324] [<ffffffffa0150010>] em28xx_dvb_register+0x10/0x1000 [em28xx_dvb] [11009.908327] [<ffffffff810021b1>] do_one_initcall+0x141/0x300 [11009.908330] [<ffffffff81002070>] ? try_to_run_init_process+0x40/0x40 [11009.908333] [<ffffffff8123ff56>] ? trace_hardirqs_on_caller+0x16/0x590 [11009.908337] [<ffffffff8155e926>] ? kasan_unpoison_shadow+0x36/0x50 [11009.908340] [<ffffffff8155e926>] ? kasan_unpoison_shadow+0x36/0x50 [11009.908343] [<ffffffff8155e926>] ? kasan_unpoison_shadow+0x36/0x50 [11009.908346] [<ffffffff8155ea37>] ? __asan_register_globals+0x87/0xa0 [11009.908350] [<ffffffff8144da7b>] do_init_module+0x1d0/0x5ad [11009.908353] [<ffffffff812f2626>] load_module+0x6666/0x9ba0 [11009.908356] [<ffffffff812e9c90>] ? symbol_put_addr+0x50/0x50 [11009.908361] [<ffffffffa1580037>] ? em28xx_dvb_init.part.3+0x5989/0x5cf4 [em28xx_dvb] [11009.908366] [<ffffffff812ebfc0>] ? module_frob_arch_sections+0x20/0x20 [11009.908369] [<ffffffff815bc940>] ? open_exec+0x50/0x50 [11009.908374] [<ffffffff811671bb>] ? ns_capable+0x5b/0xd0 [11009.908377] [<ffffffff812f5e58>] SyS_finit_module+0x108/0x130 [11009.908379] [<ffffffff812f5d50>] ? SyS_init_module+0x1f0/0x1f0 [11009.908383] [<ffffffff81004044>] ? lockdep_sys_exit_thunk+0x12/0x14 [11009.908394] [<ffffffff822e6936>] entry_SYSCALL_64_fastpath+0x16/0x76 [11009.908396] Memory state around the buggy address: [11009.908398] ffff8803bd78aa00: 00 00 fc fc fc fc fc fc fc fc fc fc fc fc fc fc [11009.908401] ffff8803bd78aa80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [11009.908403] >ffff8803bd78ab00: fc fc fc fc fc fc fc fc 00 00 fc fc fc fc fc fc [11009.908405] ^ [11009.908407] ffff8803bd78ab80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [11009.908409] ffff8803bd78ac00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [11009.908411] ================================================================== In order to avoid it, let's set the cached value of the firmware name to NULL after freeing it. While here, return an error if the memory allocation fails. Signed-off-by: Mauro Carvalho Chehab <[email protected]>
static int seek_firmware(struct dvb_frontend *fe, unsigned int type, v4l2_std_id *id) { struct xc2028_data *priv = fe->tuner_priv; int i, best_i = -1, best_nr_matches = 0; unsigned int type_mask = 0; tuner_dbg("%s called, want type=", __func__); if (debug) { dump_firm_type(type); printk("(%x), id %016llx.\n", type, (unsigned long long)*id); } if (!priv->firm) { tuner_err("Error! firmware not loaded\n"); return -EINVAL; } if (((type & ~SCODE) == 0) && (*id == 0)) *id = V4L2_STD_PAL; if (type & BASE) type_mask = BASE_TYPES; else if (type & SCODE) { type &= SCODE_TYPES; type_mask = SCODE_TYPES & ~HAS_IF; } else if (type & DTV_TYPES) type_mask = DTV_TYPES; else if (type & STD_SPECIFIC_TYPES) type_mask = STD_SPECIFIC_TYPES; type &= type_mask; if (!(type & SCODE)) type_mask = ~0; /* Seek for exact match */ for (i = 0; i < priv->firm_size; i++) { if ((type == (priv->firm[i].type & type_mask)) && (*id == priv->firm[i].id)) goto found; } /* Seek for generic video standard match */ for (i = 0; i < priv->firm_size; i++) { v4l2_std_id match_mask; int nr_matches; if (type != (priv->firm[i].type & type_mask)) continue; match_mask = *id & priv->firm[i].id; if (!match_mask) continue; if ((*id & match_mask) == *id) goto found; /* Supports all the requested standards */ nr_matches = hweight64(match_mask); if (nr_matches > best_nr_matches) { best_nr_matches = nr_matches; best_i = i; } } if (best_nr_matches > 0) { tuner_dbg("Selecting best matching firmware (%d bits) for " "type=", best_nr_matches); dump_firm_type(type); printk("(%x), id %016llx:\n", type, (unsigned long long)*id); i = best_i; goto found; } /*FIXME: Would make sense to seek for type "hint" match ? */ i = -ENOENT; goto ret; found: *id = priv->firm[i].id; ret: tuner_dbg("%s firmware for type=", (i < 0) ? "Can't find" : "Found"); if (debug) { dump_firm_type(type); printk("(%x), id %016llx.\n", type, (unsigned long long)*id); } return i; }
static int seek_firmware(struct dvb_frontend *fe, unsigned int type, v4l2_std_id *id) { struct xc2028_data *priv = fe->tuner_priv; int i, best_i = -1, best_nr_matches = 0; unsigned int type_mask = 0; tuner_dbg("%s called, want type=", __func__); if (debug) { dump_firm_type(type); printk("(%x), id %016llx.\n", type, (unsigned long long)*id); } if (!priv->firm) { tuner_err("Error! firmware not loaded\n"); return -EINVAL; } if (((type & ~SCODE) == 0) && (*id == 0)) *id = V4L2_STD_PAL; if (type & BASE) type_mask = BASE_TYPES; else if (type & SCODE) { type &= SCODE_TYPES; type_mask = SCODE_TYPES & ~HAS_IF; } else if (type & DTV_TYPES) type_mask = DTV_TYPES; else if (type & STD_SPECIFIC_TYPES) type_mask = STD_SPECIFIC_TYPES; type &= type_mask; if (!(type & SCODE)) type_mask = ~0; /* Seek for exact match */ for (i = 0; i < priv->firm_size; i++) { if ((type == (priv->firm[i].type & type_mask)) && (*id == priv->firm[i].id)) goto found; } /* Seek for generic video standard match */ for (i = 0; i < priv->firm_size; i++) { v4l2_std_id match_mask; int nr_matches; if (type != (priv->firm[i].type & type_mask)) continue; match_mask = *id & priv->firm[i].id; if (!match_mask) continue; if ((*id & match_mask) == *id) goto found; /* Supports all the requested standards */ nr_matches = hweight64(match_mask); if (nr_matches > best_nr_matches) { best_nr_matches = nr_matches; best_i = i; } } if (best_nr_matches > 0) { tuner_dbg("Selecting best matching firmware (%d bits) for " "type=", best_nr_matches); dump_firm_type(type); printk("(%x), id %016llx:\n", type, (unsigned long long)*id); i = best_i; goto found; } /*FIXME: Would make sense to seek for type "hint" match ? */ i = -ENOENT; goto ret; found: *id = priv->firm[i].id; ret: tuner_dbg("%s firmware for type=", (i < 0) ? "Can't find" : "Found"); if (debug) { dump_firm_type(type); printk("(%x), id %016llx.\n", type, (unsigned long long)*id); } return i; }
C
linux
0
CVE-2019-13225
https://www.cvedetails.com/cve/CVE-2019-13225/
CWE-476
https://github.com/kkos/oniguruma/commit/c509265c5f6ae7264f7b8a8aae1cfa5fc59d108c
c509265c5f6ae7264f7b8a8aae1cfa5fc59d108c
Fix CVE-2019-13225: problem in converting if-then-else pattern to bytecode.
concat_left_node_opt_info(OnigEncoding enc, OptNode* to, OptNode* add) { int sb_reach, sm_reach; OptAnc tanc; concat_opt_anc_info(&tanc, &to->anc, &add->anc, to->len.max, add->len.max); copy_opt_anc_info(&to->anc, &tanc); if (add->sb.len > 0 && to->len.max == 0) { concat_opt_anc_info(&tanc, &to->anc, &add->sb.anc, to->len.max, add->len.max); copy_opt_anc_info(&add->sb.anc, &tanc); } if (add->map.value > 0 && to->len.max == 0) { if (add->map.mmd.max == 0) add->map.anc.left |= to->anc.left; } sb_reach = to->sb.reach_end; sm_reach = to->sm.reach_end; if (add->len.max != 0) to->sb.reach_end = to->sm.reach_end = 0; if (add->sb.len > 0) { if (sb_reach) { concat_opt_exact(&to->sb, &add->sb, enc); clear_opt_exact(&add->sb); } else if (sm_reach) { concat_opt_exact(&to->sm, &add->sb, enc); clear_opt_exact(&add->sb); } } select_opt_exact(enc, &to->sm, &add->sb); select_opt_exact(enc, &to->sm, &add->sm); if (to->spr.len > 0) { if (add->len.max > 0) { if (to->spr.len > (int )add->len.max) to->spr.len = add->len.max; if (to->spr.mmd.max == 0) select_opt_exact(enc, &to->sb, &to->spr); else select_opt_exact(enc, &to->sm, &to->spr); } } else if (add->spr.len > 0) { copy_opt_exact(&to->spr, &add->spr); } select_opt_map(&to->map, &add->map); add_mml(&to->len, &add->len); }
concat_left_node_opt_info(OnigEncoding enc, OptNode* to, OptNode* add) { int sb_reach, sm_reach; OptAnc tanc; concat_opt_anc_info(&tanc, &to->anc, &add->anc, to->len.max, add->len.max); copy_opt_anc_info(&to->anc, &tanc); if (add->sb.len > 0 && to->len.max == 0) { concat_opt_anc_info(&tanc, &to->anc, &add->sb.anc, to->len.max, add->len.max); copy_opt_anc_info(&add->sb.anc, &tanc); } if (add->map.value > 0 && to->len.max == 0) { if (add->map.mmd.max == 0) add->map.anc.left |= to->anc.left; } sb_reach = to->sb.reach_end; sm_reach = to->sm.reach_end; if (add->len.max != 0) to->sb.reach_end = to->sm.reach_end = 0; if (add->sb.len > 0) { if (sb_reach) { concat_opt_exact(&to->sb, &add->sb, enc); clear_opt_exact(&add->sb); } else if (sm_reach) { concat_opt_exact(&to->sm, &add->sb, enc); clear_opt_exact(&add->sb); } } select_opt_exact(enc, &to->sm, &add->sb); select_opt_exact(enc, &to->sm, &add->sm); if (to->spr.len > 0) { if (add->len.max > 0) { if (to->spr.len > (int )add->len.max) to->spr.len = add->len.max; if (to->spr.mmd.max == 0) select_opt_exact(enc, &to->sb, &to->spr); else select_opt_exact(enc, &to->sm, &to->spr); } } else if (add->spr.len > 0) { copy_opt_exact(&to->spr, &add->spr); } select_opt_map(&to->map, &add->map); add_mml(&to->len, &add->len); }
C
oniguruma
0
CVE-2014-1713
https://www.cvedetails.com/cve/CVE-2014-1713/
CWE-399
https://github.com/chromium/chromium/commit/f85a87ec670ad0fce9d98d90c9a705b72a288154
f85a87ec670ad0fce9d98d90c9a705b72a288154
document.location bindings fix BUG=352374 [email protected] Review URL: https://codereview.chromium.org/196343011 git-svn-id: svn://svn.chromium.org/blink/trunk@169176 bbb929c8-8fbe-4397-9dbb-9b2b20218538
static void uint8ArrayAttributeAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) { TestObjectPython* imp = V8TestObjectPython::toNative(info.Holder()); V8TRYCATCH_VOID(Uint8Array*, cppValue, jsValue->IsUint8Array() ? V8Uint8Array::toNative(v8::Handle<v8::Uint8Array>::Cast(jsValue)) : 0); imp->setUint8ArrayAttribute(WTF::getPtr(cppValue)); }
static void uint8ArrayAttributeAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) { TestObjectPython* imp = V8TestObjectPython::toNative(info.Holder()); V8TRYCATCH_VOID(Uint8Array*, cppValue, jsValue->IsUint8Array() ? V8Uint8Array::toNative(v8::Handle<v8::Uint8Array>::Cast(jsValue)) : 0); imp->setUint8ArrayAttribute(WTF::getPtr(cppValue)); }
C
Chrome
0
CVE-2013-2237
https://www.cvedetails.com/cve/CVE-2013-2237/
CWE-119
https://github.com/torvalds/linux/commit/85dfb745ee40232876663ae206cba35f24ab2a40
85dfb745ee40232876663ae206cba35f24ab2a40
af_key: initialize satype in key_notify_policy_flush() This field was left uninitialized. Some user daemons perform check against this field. Signed-off-by: Nicolas Dichtel <[email protected]> Signed-off-by: Steffen Klassert <[email protected]>
static inline int pfkey_init_proc(struct net *net) { return 0; }
static inline int pfkey_init_proc(struct net *net) { return 0; }
C
linux
0
CVE-2017-9375
https://www.cvedetails.com/cve/CVE-2017-9375/
CWE-835
https://git.qemu.org/?p=qemu.git;a=commit;h=96d87bdda3919bb16f754b3d3fd1227e1f38f13c
96d87bdda3919bb16f754b3d3fd1227e1f38f13c
null
static void xhci_mfwrap_update(XHCIState *xhci) { const uint32_t bits = USBCMD_RS | USBCMD_EWE; uint32_t mfindex, left; int64_t now; if ((xhci->usbcmd & bits) == bits) { now = qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL); mfindex = ((now - xhci->mfindex_start) / 125000) & 0x3fff; left = 0x4000 - mfindex; timer_mod(xhci->mfwrap_timer, now + left * 125000); } else { timer_del(xhci->mfwrap_timer); } }
static void xhci_mfwrap_update(XHCIState *xhci) { const uint32_t bits = USBCMD_RS | USBCMD_EWE; uint32_t mfindex, left; int64_t now; if ((xhci->usbcmd & bits) == bits) { now = qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL); mfindex = ((now - xhci->mfindex_start) / 125000) & 0x3fff; left = 0x4000 - mfindex; timer_mod(xhci->mfwrap_timer, now + left * 125000); } else { timer_del(xhci->mfwrap_timer); } }
C
qemu
0
CVE-2014-1747
https://www.cvedetails.com/cve/CVE-2014-1747/
CWE-79
https://github.com/chromium/chromium/commit/1924f747637265f563892b8f56a64391f6208194
1924f747637265f563892b8f56a64391f6208194
Allow the cast tray to function as expected when the installed extension is missing API methods. BUG=489445 Review URL: https://codereview.chromium.org/1145833003 Cr-Commit-Position: refs/heads/master@{#330663}
void CastCastView::ButtonPressed(views::Button* sender, const ui::Event& event) { DCHECK(sender == stop_button_); cast_config_delegate_->StopCasting(); }
void CastCastView::ButtonPressed(views::Button* sender, const ui::Event& event) { DCHECK(sender == stop_button_); StopCast(); }
C
Chrome
1
CVE-2017-11147
https://www.cvedetails.com/cve/CVE-2017-11147/
CWE-125
https://git.php.net/?p=php-src.git;a=commit;h=e5246580a85f031e1a3b8064edbaa55c1643a451
e5246580a85f031e1a3b8064edbaa55c1643a451
null
ZEND_INI_MH(phar_ini_cache_list) /* {{{ */ { PHAR_G(cache_list) = new_value; if (stage == ZEND_INI_STAGE_STARTUP) { phar_split_cache_list(TSRMLS_C); } return SUCCESS; } /* }}} */
ZEND_INI_MH(phar_ini_cache_list) /* {{{ */ { PHAR_G(cache_list) = new_value; if (stage == ZEND_INI_STAGE_STARTUP) { phar_split_cache_list(TSRMLS_C); } return SUCCESS; } /* }}} */
C
php
0
CVE-2016-1583
https://www.cvedetails.com/cve/CVE-2016-1583/
CWE-119
https://github.com/torvalds/linux/commit/f5364c150aa645b3d7daa21b5c0b9feaa1c9cd6d
f5364c150aa645b3d7daa21b5c0b9feaa1c9cd6d
Merge branch 'stacking-fixes' (vfs stacking fixes from Jann) Merge filesystem stacking fixes from Jann Horn. * emailed patches from Jann Horn <[email protected]>: sched: panic on corrupted stack end ecryptfs: forbid opening files without mmap handler proc: prevent stacking filesystems on top
static void sched_dl_do_global(void) { u64 new_bw = -1; struct dl_bw *dl_b; int cpu; unsigned long flags; def_dl_bandwidth.dl_period = global_rt_period(); def_dl_bandwidth.dl_runtime = global_rt_runtime(); if (global_rt_runtime() != RUNTIME_INF) new_bw = to_ratio(global_rt_period(), global_rt_runtime()); /* * FIXME: As above... */ for_each_possible_cpu(cpu) { rcu_read_lock_sched(); dl_b = dl_bw_of(cpu); raw_spin_lock_irqsave(&dl_b->lock, flags); dl_b->bw = new_bw; raw_spin_unlock_irqrestore(&dl_b->lock, flags); rcu_read_unlock_sched(); } }
static void sched_dl_do_global(void) { u64 new_bw = -1; struct dl_bw *dl_b; int cpu; unsigned long flags; def_dl_bandwidth.dl_period = global_rt_period(); def_dl_bandwidth.dl_runtime = global_rt_runtime(); if (global_rt_runtime() != RUNTIME_INF) new_bw = to_ratio(global_rt_period(), global_rt_runtime()); /* * FIXME: As above... */ for_each_possible_cpu(cpu) { rcu_read_lock_sched(); dl_b = dl_bw_of(cpu); raw_spin_lock_irqsave(&dl_b->lock, flags); dl_b->bw = new_bw; raw_spin_unlock_irqrestore(&dl_b->lock, flags); rcu_read_unlock_sched(); } }
C
linux
0
CVE-2017-18203
https://www.cvedetails.com/cve/CVE-2017-18203/
CWE-362
https://github.com/torvalds/linux/commit/b9a41d21dceadf8104812626ef85dc56ee8a60ed
b9a41d21dceadf8104812626ef85dc56ee8a60ed
dm: fix race between dm_get_from_kobject() and __dm_destroy() The following BUG_ON was hit when testing repeat creation and removal of DM devices: kernel BUG at drivers/md/dm.c:2919! CPU: 7 PID: 750 Comm: systemd-udevd Not tainted 4.1.44 Call Trace: [<ffffffff81649e8b>] dm_get_from_kobject+0x34/0x3a [<ffffffff81650ef1>] dm_attr_show+0x2b/0x5e [<ffffffff817b46d1>] ? mutex_lock+0x26/0x44 [<ffffffff811df7f5>] sysfs_kf_seq_show+0x83/0xcf [<ffffffff811de257>] kernfs_seq_show+0x23/0x25 [<ffffffff81199118>] seq_read+0x16f/0x325 [<ffffffff811de994>] kernfs_fop_read+0x3a/0x13f [<ffffffff8117b625>] __vfs_read+0x26/0x9d [<ffffffff8130eb59>] ? security_file_permission+0x3c/0x44 [<ffffffff8117bdb8>] ? rw_verify_area+0x83/0xd9 [<ffffffff8117be9d>] vfs_read+0x8f/0xcf [<ffffffff81193e34>] ? __fdget_pos+0x12/0x41 [<ffffffff8117c686>] SyS_read+0x4b/0x76 [<ffffffff817b606e>] system_call_fastpath+0x12/0x71 The bug can be easily triggered, if an extra delay (e.g. 10ms) is added between the test of DMF_FREEING & DMF_DELETING and dm_get() in dm_get_from_kobject(). To fix it, we need to ensure the test of DMF_FREEING & DMF_DELETING and dm_get() are done in an atomic way, so _minor_lock is used. The other callers of dm_get() have also been checked to be OK: some callers invoke dm_get() under _minor_lock, some callers invoke it under _hash_lock, and dm_start_request() invoke it after increasing md->open_count. Cc: [email protected] Signed-off-by: Hou Tao <[email protected]> Signed-off-by: Mike Snitzer <[email protected]>
static void clone_endio(struct bio *bio) { blk_status_t error = bio->bi_status; struct dm_target_io *tio = container_of(bio, struct dm_target_io, clone); struct dm_io *io = tio->io; struct mapped_device *md = tio->io->md; dm_endio_fn endio = tio->ti->type->end_io; if (unlikely(error == BLK_STS_TARGET)) { if (bio_op(bio) == REQ_OP_WRITE_SAME && !bio->bi_disk->queue->limits.max_write_same_sectors) disable_write_same(md); if (bio_op(bio) == REQ_OP_WRITE_ZEROES && !bio->bi_disk->queue->limits.max_write_zeroes_sectors) disable_write_zeroes(md); } if (endio) { int r = endio(tio->ti, bio, &error); switch (r) { case DM_ENDIO_REQUEUE: error = BLK_STS_DM_REQUEUE; /*FALLTHRU*/ case DM_ENDIO_DONE: break; case DM_ENDIO_INCOMPLETE: /* The target will handle the io */ return; default: DMWARN("unimplemented target endio return value: %d", r); BUG(); } } free_tio(tio); dec_pending(io, error); }
static void clone_endio(struct bio *bio) { blk_status_t error = bio->bi_status; struct dm_target_io *tio = container_of(bio, struct dm_target_io, clone); struct dm_io *io = tio->io; struct mapped_device *md = tio->io->md; dm_endio_fn endio = tio->ti->type->end_io; if (unlikely(error == BLK_STS_TARGET)) { if (bio_op(bio) == REQ_OP_WRITE_SAME && !bio->bi_disk->queue->limits.max_write_same_sectors) disable_write_same(md); if (bio_op(bio) == REQ_OP_WRITE_ZEROES && !bio->bi_disk->queue->limits.max_write_zeroes_sectors) disable_write_zeroes(md); } if (endio) { int r = endio(tio->ti, bio, &error); switch (r) { case DM_ENDIO_REQUEUE: error = BLK_STS_DM_REQUEUE; /*FALLTHRU*/ case DM_ENDIO_DONE: break; case DM_ENDIO_INCOMPLETE: /* The target will handle the io */ return; default: DMWARN("unimplemented target endio return value: %d", r); BUG(); } } free_tio(tio); dec_pending(io, error); }
C
linux
0
CVE-2011-4097
https://www.cvedetails.com/cve/CVE-2011-4097/
CWE-189
https://github.com/torvalds/linux/commit/56c6a8a4aadca809e04276eabe5552935c51387f
56c6a8a4aadca809e04276eabe5552935c51387f
oom: fix integer overflow of points in oom_badness commit ff05b6f7ae762b6eb464183eec994b28ea09f6dd upstream. An integer overflow will happen on 64bit archs if task's sum of rss, swapents and nr_ptes exceeds (2^31)/1000 value. This was introduced by commit f755a04 oom: use pte pages in OOM score where the oom score computation was divided into several steps and it's no longer computed as one expression in unsigned long(rss, swapents, nr_pte are unsigned long), where the result value assigned to points(int) is in range(1..1000). So there could be an int overflow while computing 176 points *= 1000; and points may have negative value. Meaning the oom score for a mem hog task will be one. 196 if (points <= 0) 197 return 1; For example: [ 3366] 0 3366 35390480 24303939 5 0 0 oom01 Out of memory: Kill process 3366 (oom01) score 1 or sacrifice child Here the oom1 process consumes more than 24303939(rss)*4096~=92GB physical memory, but it's oom score is one. In this situation the mem hog task is skipped and oom killer kills another and most probably innocent task with oom score greater than one. The points variable should be of type long instead of int to prevent the int overflow. Signed-off-by: Frantisek Hrbata <[email protected]> Acked-by: KOSAKI Motohiro <[email protected]> Acked-by: Oleg Nesterov <[email protected]> Acked-by: David Rientjes <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
unsigned int oom_badness(struct task_struct *p, struct mem_cgroup *mem, const nodemask_t *nodemask, unsigned long totalpages) { long points; if (oom_unkillable_task(p, mem, nodemask)) return 0; p = find_lock_task_mm(p); if (!p) return 0; /* * Shortcut check for a thread sharing p->mm that is OOM_SCORE_ADJ_MIN * so the entire heuristic doesn't need to be executed for something * that cannot be killed. */ if (atomic_read(&p->mm->oom_disable_count)) { task_unlock(p); return 0; } /* * The memory controller may have a limit of 0 bytes, so avoid a divide * by zero, if necessary. */ if (!totalpages) totalpages = 1; /* * The baseline for the badness score is the proportion of RAM that each * task's rss, pagetable and swap space use. */ points = get_mm_rss(p->mm) + p->mm->nr_ptes; points += get_mm_counter(p->mm, MM_SWAPENTS); points *= 1000; points /= totalpages; task_unlock(p); /* * Root processes get 3% bonus, just like the __vm_enough_memory() * implementation used by LSMs. */ if (has_capability_noaudit(p, CAP_SYS_ADMIN)) points -= 30; /* * /proc/pid/oom_score_adj ranges from -1000 to +1000 such that it may * either completely disable oom killing or always prefer a certain * task. */ points += p->signal->oom_score_adj; /* * Never return 0 for an eligible task that may be killed since it's * possible that no single user task uses more than 0.1% of memory and * no single admin tasks uses more than 3.0%. */ if (points <= 0) return 1; return (points < 1000) ? points : 1000; }
unsigned int oom_badness(struct task_struct *p, struct mem_cgroup *mem, const nodemask_t *nodemask, unsigned long totalpages) { int points; if (oom_unkillable_task(p, mem, nodemask)) return 0; p = find_lock_task_mm(p); if (!p) return 0; /* * Shortcut check for a thread sharing p->mm that is OOM_SCORE_ADJ_MIN * so the entire heuristic doesn't need to be executed for something * that cannot be killed. */ if (atomic_read(&p->mm->oom_disable_count)) { task_unlock(p); return 0; } /* * The memory controller may have a limit of 0 bytes, so avoid a divide * by zero, if necessary. */ if (!totalpages) totalpages = 1; /* * The baseline for the badness score is the proportion of RAM that each * task's rss, pagetable and swap space use. */ points = get_mm_rss(p->mm) + p->mm->nr_ptes; points += get_mm_counter(p->mm, MM_SWAPENTS); points *= 1000; points /= totalpages; task_unlock(p); /* * Root processes get 3% bonus, just like the __vm_enough_memory() * implementation used by LSMs. */ if (has_capability_noaudit(p, CAP_SYS_ADMIN)) points -= 30; /* * /proc/pid/oom_score_adj ranges from -1000 to +1000 such that it may * either completely disable oom killing or always prefer a certain * task. */ points += p->signal->oom_score_adj; /* * Never return 0 for an eligible task that may be killed since it's * possible that no single user task uses more than 0.1% of memory and * no single admin tasks uses more than 3.0%. */ if (points <= 0) return 1; return (points < 1000) ? points : 1000; }
C
linux
1
CVE-2016-1583
https://www.cvedetails.com/cve/CVE-2016-1583/
CWE-119
https://github.com/torvalds/linux/commit/f5364c150aa645b3d7daa21b5c0b9feaa1c9cd6d
f5364c150aa645b3d7daa21b5c0b9feaa1c9cd6d
Merge branch 'stacking-fixes' (vfs stacking fixes from Jann) Merge filesystem stacking fixes from Jann Horn. * emailed patches from Jann Horn <[email protected]>: sched: panic on corrupted stack end ecryptfs: forbid opening files without mmap handler proc: prevent stacking filesystems on top
void idle_task_exit(void) { struct mm_struct *mm = current->active_mm; BUG_ON(cpu_online(smp_processor_id())); if (mm != &init_mm) { switch_mm_irqs_off(mm, &init_mm, current); finish_arch_post_lock_switch(); } mmdrop(mm); }
void idle_task_exit(void) { struct mm_struct *mm = current->active_mm; BUG_ON(cpu_online(smp_processor_id())); if (mm != &init_mm) { switch_mm_irqs_off(mm, &init_mm, current); finish_arch_post_lock_switch(); } mmdrop(mm); }
C
linux
0