CVE ID
stringlengths
13
43
CVE Page
stringlengths
45
48
CWE ID
stringclasses
90 values
codeLink
stringlengths
46
139
commit_id
stringlengths
6
81
commit_message
stringlengths
3
13.3k
func_after
stringlengths
14
241k
func_before
stringlengths
14
241k
lang
stringclasses
3 values
project
stringclasses
309 values
vul
int8
0
1
CVE-2014-4503
https://www.cvedetails.com/cve/CVE-2014-4503/
CWE-20
https://github.com/sgminer-dev/sgminer/commit/910c36089940e81fb85c65b8e63dcd2fac71470c
910c36089940e81fb85c65b8e63dcd2fac71470c
stratum: parse_notify(): Don't die on malformed bbversion/prev_hash/nbit/ntime. Might have introduced a memory leak, don't have time to check. :( Should the other hex2bin()'s be checked? Thanks to Mick Ayzenberg <mick.dejavusecurity.com> for finding this.
void thr_info_cancel(struct thr_info *thr) { if (!thr) return; if (PTH(thr) != 0L) { pthread_cancel(thr->pth); PTH(thr) = 0L; } cgsem_destroy(&thr->sem); }
void thr_info_cancel(struct thr_info *thr) { if (!thr) return; if (PTH(thr) != 0L) { pthread_cancel(thr->pth); PTH(thr) = 0L; } cgsem_destroy(&thr->sem); }
C
sgminer
0
CVE-2015-6787
https://www.cvedetails.com/cve/CVE-2015-6787/
null
https://github.com/chromium/chromium/commit/f911e11e7f6b5c0d6f5ee694a9871de6619889f7
f911e11e7f6b5c0d6f5ee694a9871de6619889f7
Reland "[CI] Make paint property nodes non-ref-counted" This reverts commit 887383b30842d9d9006e11bb6932660a3cb5b1b7. Reason for revert: Retry in M69. Original change's description: > Revert "[CI] Make paint property nodes non-ref-counted" > > This reverts commit 70fc0b018c9517558b7aa2be00edf2debb449123. > > Reason for revert: Caused bugs found by clusterfuzz > > Original change's description: > > [CI] Make paint property nodes non-ref-counted > > > > Now all paint property nodes are owned by ObjectPaintProperties > > (and LocalFrameView temporarily before removing non-RLS mode). > > Others just use raw pointers or references. > > > > Bug: 833496 > > Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2 > > Change-Id: I2d544fe153bb94698623248748df63c8aa2081ae > > Reviewed-on: https://chromium-review.googlesource.com/1031101 > > Reviewed-by: Tien-Ren Chen <trchen@chromium.org> > > Commit-Queue: Xianzhu Wang <wangxianzhu@chromium.org> > > Cr-Commit-Position: refs/heads/master@{#554626} > > TBR=wangxianzhu@chromium.org,trchen@chromium.org,chrishtr@chromium.org > > Change-Id: I02bb50d6744cb81a797246a0116b677e80a3c69f > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: 833496,837932,837943 > Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2 > Reviewed-on: https://chromium-review.googlesource.com/1034292 > Reviewed-by: Xianzhu Wang <wangxianzhu@chromium.org> > Commit-Queue: Xianzhu Wang <wangxianzhu@chromium.org> > Cr-Commit-Position: refs/heads/master@{#554653} TBR=wangxianzhu@chromium.org,trchen@chromium.org,chrishtr@chromium.org # Not skipping CQ checks because original CL landed > 1 day ago. Bug: 833496, 837932, 837943 Change-Id: I0b4ef70db1f1f211ba97c30d617225355c750992 Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2 Reviewed-on: https://chromium-review.googlesource.com/1083491 Commit-Queue: Xianzhu Wang <wangxianzhu@chromium.org> Reviewed-by: Xianzhu Wang <wangxianzhu@chromium.org> Cr-Commit-Position: refs/heads/master@{#563930}
void FragmentPaintPropertyTreeBuilder::UpdateTransform() { if (object_.IsSVGChild()) { UpdateTransformForNonRootSVG(); return; } DCHECK(properties_); if (NeedsPaintPropertyUpdate()) { const ComputedStyle& style = object_.StyleRef(); if (NeedsTransform(object_)) { TransformPaintPropertyNode::State state; if (object_.IsBox()) { auto& box = ToLayoutBox(object_); state.origin = TransformOrigin(box); style.ApplyTransform( state.matrix, box.Size(), ComputedStyle::kExcludeTransformOrigin, ComputedStyle::kIncludeMotionPath, ComputedStyle::kIncludeIndependentTransformProperties); if (RuntimeEnabledFeatures::SlimmingPaintV2Enabled() || RuntimeEnabledFeatures::BlinkGenPropertyTreesEnabled()) { state.rendering_context_id = context_.current.rendering_context_id; if (style.Preserves3D() && !state.rendering_context_id) { state.rendering_context_id = PtrHash<const LayoutObject>::GetHash(&object_); } state.direct_compositing_reasons = CompositingReasonsForTransform(box); } } state.flattens_inherited_transform = context_.current.should_flatten_inherited_transform; if (RuntimeEnabledFeatures::SlimmingPaintV2Enabled() || RuntimeEnabledFeatures::BlinkGenPropertyTreesEnabled()) { state.backface_visibility = object_.HasHiddenBackface() ? TransformPaintPropertyNode::BackfaceVisibility::kHidden : TransformPaintPropertyNode::BackfaceVisibility::kVisible; state.compositor_element_id = CompositorElementIdFromUniqueObjectId( object_.UniqueId(), CompositorElementIdNamespace::kPrimary); } OnUpdate(properties_->UpdateTransform(*context_.current.transform, std::move(state))); } else { OnClear(properties_->ClearTransform()); } } if (properties_->Transform()) { context_.current.transform = properties_->Transform(); if (object_.StyleRef().Preserves3D()) { context_.current.rendering_context_id = properties_->Transform()->RenderingContextId(); context_.current.should_flatten_inherited_transform = false; } else { context_.current.rendering_context_id = 0; context_.current.should_flatten_inherited_transform = true; } } }
void FragmentPaintPropertyTreeBuilder::UpdateTransform() { if (object_.IsSVGChild()) { UpdateTransformForNonRootSVG(); return; } DCHECK(properties_); if (NeedsPaintPropertyUpdate()) { const ComputedStyle& style = object_.StyleRef(); if (NeedsTransform(object_)) { TransformPaintPropertyNode::State state; if (object_.IsBox()) { auto& box = ToLayoutBox(object_); state.origin = TransformOrigin(box); style.ApplyTransform( state.matrix, box.Size(), ComputedStyle::kExcludeTransformOrigin, ComputedStyle::kIncludeMotionPath, ComputedStyle::kIncludeIndependentTransformProperties); if (RuntimeEnabledFeatures::SlimmingPaintV2Enabled() || RuntimeEnabledFeatures::BlinkGenPropertyTreesEnabled()) { state.rendering_context_id = context_.current.rendering_context_id; if (style.Preserves3D() && !state.rendering_context_id) { state.rendering_context_id = PtrHash<const LayoutObject>::GetHash(&object_); } state.direct_compositing_reasons = CompositingReasonsForTransform(box); } } state.flattens_inherited_transform = context_.current.should_flatten_inherited_transform; if (RuntimeEnabledFeatures::SlimmingPaintV2Enabled() || RuntimeEnabledFeatures::BlinkGenPropertyTreesEnabled()) { state.backface_visibility = object_.HasHiddenBackface() ? TransformPaintPropertyNode::BackfaceVisibility::kHidden : TransformPaintPropertyNode::BackfaceVisibility::kVisible; state.compositor_element_id = CompositorElementIdFromUniqueObjectId( object_.UniqueId(), CompositorElementIdNamespace::kPrimary); } OnUpdate(properties_->UpdateTransform(context_.current.transform, std::move(state))); } else { OnClear(properties_->ClearTransform()); } } if (properties_->Transform()) { context_.current.transform = properties_->Transform(); if (object_.StyleRef().Preserves3D()) { context_.current.rendering_context_id = properties_->Transform()->RenderingContextId(); context_.current.should_flatten_inherited_transform = false; } else { context_.current.rendering_context_id = 0; context_.current.should_flatten_inherited_transform = true; } } }
C
Chrome
1
CVE-2015-7515
https://www.cvedetails.com/cve/CVE-2015-7515/
null
https://github.com/torvalds/linux/commit/8e20cf2bce122ce9262d6034ee5d5b76fbb92f96
8e20cf2bce122ce9262d6034ee5d5b76fbb92f96
Input: aiptek - fix crash on detecting device without endpoints The aiptek driver crashes in aiptek_probe() when a specially crafted USB device without endpoints is detected. This fix adds a check that the device has proper configuration expected by the driver. Also an error return value is changed to more matching one in one of the error paths. Reported-by: Ralf Spenneberg <ralf@spenneberg.net> Signed-off-by: Vladis Dronov <vdronov@redhat.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
aiptek_command(struct aiptek *aiptek, unsigned char command, unsigned char data) { const int sizeof_buf = 3 * sizeof(u8); int ret; u8 *buf; buf = kmalloc(sizeof_buf, GFP_KERNEL); if (!buf) return -ENOMEM; buf[0] = 2; buf[1] = command; buf[2] = data; if ((ret = aiptek_set_report(aiptek, 3, 2, buf, sizeof_buf)) != sizeof_buf) { dev_dbg(&aiptek->intf->dev, "aiptek_program: failed, tried to send: 0x%02x 0x%02x\n", command, data); } kfree(buf); return ret < 0 ? ret : 0; }
aiptek_command(struct aiptek *aiptek, unsigned char command, unsigned char data) { const int sizeof_buf = 3 * sizeof(u8); int ret; u8 *buf; buf = kmalloc(sizeof_buf, GFP_KERNEL); if (!buf) return -ENOMEM; buf[0] = 2; buf[1] = command; buf[2] = data; if ((ret = aiptek_set_report(aiptek, 3, 2, buf, sizeof_buf)) != sizeof_buf) { dev_dbg(&aiptek->intf->dev, "aiptek_program: failed, tried to send: 0x%02x 0x%02x\n", command, data); } kfree(buf); return ret < 0 ? ret : 0; }
C
linux
0
CVE-2015-3412
https://www.cvedetails.com/cve/CVE-2015-3412/
CWE-254
https://git.php.net/?p=php-src.git;a=commit;h=4435b9142ff9813845d5c97ab29a5d637bedb257
4435b9142ff9813845d5c97ab29a5d637bedb257
null
PHP_PGSQL_API int php_pgsql_meta_data(PGconn *pg_link, const char *table_name, zval *meta TSRMLS_DC) { PGresult *pg_result; char *src, *tmp_name, *tmp_name2 = NULL; char *escaped; smart_str querystr = {0}; size_t new_len; int i, num_rows; zval *elem; if (!*table_name) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "The table name must be specified"); return FAILURE; } src = estrdup(table_name); tmp_name = php_strtok_r(src, ".", &tmp_name2); if (!tmp_name2 || !*tmp_name2) { /* Default schema */ tmp_name2 = tmp_name; tmp_name = "public"; } smart_str_appends(&querystr, "SELECT a.attname, a.attnum, t.typname, a.attlen, a.attnotnull, a.atthasdef, a.attndims, t.typtype = 'e' " "FROM pg_class as c, pg_attribute a, pg_type t, pg_namespace n " "WHERE a.attnum > 0 AND a.attrelid = c.oid AND c.relname = '"); escaped = (char *)safe_emalloc(strlen(tmp_name2), 2, 1); new_len = PQescapeStringConn(pg_link, escaped, tmp_name2, strlen(tmp_name2), NULL); if (new_len) { smart_str_appendl(&querystr, escaped, new_len); } efree(escaped); smart_str_appends(&querystr, "' AND c.relnamespace = n.oid AND n.nspname = '"); escaped = (char *)safe_emalloc(strlen(tmp_name), 2, 1); new_len = PQescapeStringConn(pg_link, escaped, tmp_name, strlen(tmp_name), NULL); if (new_len) { smart_str_appendl(&querystr, escaped, new_len); } efree(escaped); smart_str_appends(&querystr, "' AND a.atttypid = t.oid ORDER BY a.attnum;"); smart_str_0(&querystr); efree(src); pg_result = PQexec(pg_link, querystr.c); if (PQresultStatus(pg_result) != PGRES_TUPLES_OK || (num_rows = PQntuples(pg_result)) == 0) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Table '%s' doesn't exists", table_name); smart_str_free(&querystr); PQclear(pg_result); return FAILURE; } smart_str_free(&querystr); for (i = 0; i < num_rows; i++) { char *name; MAKE_STD_ZVAL(elem); array_init(elem); add_assoc_long(elem, "num", atoi(PQgetvalue(pg_result,i,1))); add_assoc_string(elem, "type", PQgetvalue(pg_result,i,2), 1); add_assoc_long(elem, "len", atoi(PQgetvalue(pg_result,i,3))); if (!strcmp(PQgetvalue(pg_result,i,4), "t")) { add_assoc_bool(elem, "not null", 1); } else { add_assoc_bool(elem, "not null", 0); } if (!strcmp(PQgetvalue(pg_result,i,5), "t")) { add_assoc_bool(elem, "has default", 1); } else { add_assoc_bool(elem, "has default", 0); } add_assoc_long(elem, "array dims", atoi(PQgetvalue(pg_result,i,6))); if (!strcmp(PQgetvalue(pg_result,i,7), "t")) { add_assoc_bool(elem, "is enum", 1); } else { add_assoc_bool(elem, "is enum", 0); } name = PQgetvalue(pg_result,i,0); add_assoc_zval(meta, name, elem); } PQclear(pg_result); return SUCCESS; }
PHP_PGSQL_API int php_pgsql_meta_data(PGconn *pg_link, const char *table_name, zval *meta TSRMLS_DC) { PGresult *pg_result; char *src, *tmp_name, *tmp_name2 = NULL; char *escaped; smart_str querystr = {0}; size_t new_len; int i, num_rows; zval *elem; if (!*table_name) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "The table name must be specified"); return FAILURE; } src = estrdup(table_name); tmp_name = php_strtok_r(src, ".", &tmp_name2); if (!tmp_name2 || !*tmp_name2) { /* Default schema */ tmp_name2 = tmp_name; tmp_name = "public"; } smart_str_appends(&querystr, "SELECT a.attname, a.attnum, t.typname, a.attlen, a.attnotnull, a.atthasdef, a.attndims, t.typtype = 'e' " "FROM pg_class as c, pg_attribute a, pg_type t, pg_namespace n " "WHERE a.attnum > 0 AND a.attrelid = c.oid AND c.relname = '"); escaped = (char *)safe_emalloc(strlen(tmp_name2), 2, 1); new_len = PQescapeStringConn(pg_link, escaped, tmp_name2, strlen(tmp_name2), NULL); if (new_len) { smart_str_appendl(&querystr, escaped, new_len); } efree(escaped); smart_str_appends(&querystr, "' AND c.relnamespace = n.oid AND n.nspname = '"); escaped = (char *)safe_emalloc(strlen(tmp_name), 2, 1); new_len = PQescapeStringConn(pg_link, escaped, tmp_name, strlen(tmp_name), NULL); if (new_len) { smart_str_appendl(&querystr, escaped, new_len); } efree(escaped); smart_str_appends(&querystr, "' AND a.atttypid = t.oid ORDER BY a.attnum;"); smart_str_0(&querystr); efree(src); pg_result = PQexec(pg_link, querystr.c); if (PQresultStatus(pg_result) != PGRES_TUPLES_OK || (num_rows = PQntuples(pg_result)) == 0) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Table '%s' doesn't exists", table_name); smart_str_free(&querystr); PQclear(pg_result); return FAILURE; } smart_str_free(&querystr); for (i = 0; i < num_rows; i++) { char *name; MAKE_STD_ZVAL(elem); array_init(elem); add_assoc_long(elem, "num", atoi(PQgetvalue(pg_result,i,1))); add_assoc_string(elem, "type", PQgetvalue(pg_result,i,2), 1); add_assoc_long(elem, "len", atoi(PQgetvalue(pg_result,i,3))); if (!strcmp(PQgetvalue(pg_result,i,4), "t")) { add_assoc_bool(elem, "not null", 1); } else { add_assoc_bool(elem, "not null", 0); } if (!strcmp(PQgetvalue(pg_result,i,5), "t")) { add_assoc_bool(elem, "has default", 1); } else { add_assoc_bool(elem, "has default", 0); } add_assoc_long(elem, "array dims", atoi(PQgetvalue(pg_result,i,6))); if (!strcmp(PQgetvalue(pg_result,i,7), "t")) { add_assoc_bool(elem, "is enum", 1); } else { add_assoc_bool(elem, "is enum", 0); } name = PQgetvalue(pg_result,i,0); add_assoc_zval(meta, name, elem); } PQclear(pg_result); return SUCCESS; }
C
php
0
CVE-2017-5118
https://www.cvedetails.com/cve/CVE-2017-5118/
CWE-732
https://github.com/chromium/chromium/commit/0ab2412a104d2f235d7b9fe19d30ef605a410832
0ab2412a104d2f235d7b9fe19d30ef605a410832
Inherit CSP when we inherit the security origin This prevents attacks that use main window navigation to get out of the existing csp constraints such as the related bug Bug: 747847 Change-Id: I1e57b50da17f65d38088205b0a3c7c49ef2ae4d8 Reviewed-on: https://chromium-review.googlesource.com/592027 Reviewed-by: Mike West <mkwst@chromium.org> Commit-Queue: Andy Paicu <andypaicu@chromium.org> Cr-Commit-Position: refs/heads/master@{#492333}
v8::Local<v8::Value> WebLocalFrameImpl::ExecuteScriptAndReturnValue( const WebScriptSource& source) { DCHECK(GetFrame()); TextPosition position(OrdinalNumber::FromOneBasedInt(source.start_line), OrdinalNumber::First()); return GetFrame() ->GetScriptController() .ExecuteScriptInMainWorldAndReturnValue( ScriptSourceCode(source.code, source.url, position)); }
v8::Local<v8::Value> WebLocalFrameImpl::ExecuteScriptAndReturnValue( const WebScriptSource& source) { DCHECK(GetFrame()); TextPosition position(OrdinalNumber::FromOneBasedInt(source.start_line), OrdinalNumber::First()); return GetFrame() ->GetScriptController() .ExecuteScriptInMainWorldAndReturnValue( ScriptSourceCode(source.code, source.url, position)); }
C
Chrome
0
CVE-2016-2449
https://www.cvedetails.com/cve/CVE-2016-2449/
CWE-264
https://android.googlesource.com/platform/frameworks/av/+/b04aee833c5cfb6b31b8558350feb14bb1a0f353
b04aee833c5cfb6b31b8558350feb14bb1a0f353
Camera3Device: Validate template ID Validate template ID before creating a default request. Bug: 26866110 Bug: 27568958 Change-Id: Ifda457024f1d5c2b1382f189c1a8d5fda852d30d
status_t Camera3Device::disconnect() { ATRACE_CALL(); Mutex::Autolock il(mInterfaceLock); ALOGV("%s: E", __FUNCTION__); status_t res = OK; { Mutex::Autolock l(mLock); if (mStatus == STATUS_UNINITIALIZED) return res; if (mStatus == STATUS_ACTIVE || (mStatus == STATUS_ERROR && mRequestThread != NULL)) { res = mRequestThread->clearRepeatingRequests(); if (res != OK) { SET_ERR_L("Can't stop streaming"); } else { res = waitUntilStateThenRelock(/*active*/ false, kShutdownTimeout); if (res != OK) { SET_ERR_L("Timeout waiting for HAL to drain"); } } } if (mStatus == STATUS_ERROR) { CLOGE("Shutting down in an error state"); } if (mStatusTracker != NULL) { mStatusTracker->requestExit(); } if (mRequestThread != NULL) { mRequestThread->requestExit(); } mOutputStreams.clear(); mInputStream.clear(); } if (mRequestThread != NULL && mStatus != STATUS_ERROR) { mRequestThread->join(); } if (mStatusTracker != NULL) { mStatusTracker->join(); } camera3_device_t *hal3Device; { Mutex::Autolock l(mLock); mRequestThread.clear(); mStatusTracker.clear(); hal3Device = mHal3Device; } if (hal3Device != NULL) { ATRACE_BEGIN("camera3->close"); hal3Device->common.close(&hal3Device->common); ATRACE_END(); } { Mutex::Autolock l(mLock); mHal3Device = NULL; internalUpdateStatusLocked(STATUS_UNINITIALIZED); } ALOGV("%s: X", __FUNCTION__); return res; }
status_t Camera3Device::disconnect() { ATRACE_CALL(); Mutex::Autolock il(mInterfaceLock); ALOGV("%s: E", __FUNCTION__); status_t res = OK; { Mutex::Autolock l(mLock); if (mStatus == STATUS_UNINITIALIZED) return res; if (mStatus == STATUS_ACTIVE || (mStatus == STATUS_ERROR && mRequestThread != NULL)) { res = mRequestThread->clearRepeatingRequests(); if (res != OK) { SET_ERR_L("Can't stop streaming"); } else { res = waitUntilStateThenRelock(/*active*/ false, kShutdownTimeout); if (res != OK) { SET_ERR_L("Timeout waiting for HAL to drain"); } } } if (mStatus == STATUS_ERROR) { CLOGE("Shutting down in an error state"); } if (mStatusTracker != NULL) { mStatusTracker->requestExit(); } if (mRequestThread != NULL) { mRequestThread->requestExit(); } mOutputStreams.clear(); mInputStream.clear(); } if (mRequestThread != NULL && mStatus != STATUS_ERROR) { mRequestThread->join(); } if (mStatusTracker != NULL) { mStatusTracker->join(); } camera3_device_t *hal3Device; { Mutex::Autolock l(mLock); mRequestThread.clear(); mStatusTracker.clear(); hal3Device = mHal3Device; } if (hal3Device != NULL) { ATRACE_BEGIN("camera3->close"); hal3Device->common.close(&hal3Device->common); ATRACE_END(); } { Mutex::Autolock l(mLock); mHal3Device = NULL; internalUpdateStatusLocked(STATUS_UNINITIALIZED); } ALOGV("%s: X", __FUNCTION__); return res; }
C
Android
0
CVE-2013-7421
https://www.cvedetails.com/cve/CVE-2013-7421/
CWE-264
https://github.com/torvalds/linux/commit/5d26a105b5a73e5635eae0629b42fa0a90e07b7b
5d26a105b5a73e5635eae0629b42fa0a90e07b7b
crypto: prefix module autoloading with "crypto-" This prefixes all crypto module loading with "crypto-" so we never run the risk of exposing module auto-loading to userspace via a crypto API, as demonstrated by Mathias Krause: https://lkml.org/lkml/2013/3/4/70 Signed-off-by: Kees Cook <keescook@chromium.org> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
static void __exit des_s390_exit(void) { if (ctrblk) { crypto_unregister_alg(&ctr_des_alg); crypto_unregister_alg(&ctr_des3_alg); free_page((unsigned long) ctrblk); } crypto_unregister_alg(&cbc_des3_alg); crypto_unregister_alg(&ecb_des3_alg); crypto_unregister_alg(&des3_alg); crypto_unregister_alg(&cbc_des_alg); crypto_unregister_alg(&ecb_des_alg); crypto_unregister_alg(&des_alg); }
static void __exit des_s390_exit(void) { if (ctrblk) { crypto_unregister_alg(&ctr_des_alg); crypto_unregister_alg(&ctr_des3_alg); free_page((unsigned long) ctrblk); } crypto_unregister_alg(&cbc_des3_alg); crypto_unregister_alg(&ecb_des3_alg); crypto_unregister_alg(&des3_alg); crypto_unregister_alg(&cbc_des_alg); crypto_unregister_alg(&ecb_des_alg); crypto_unregister_alg(&des_alg); }
C
linux
0
CVE-2016-10030
https://www.cvedetails.com/cve/CVE-2016-10030/
CWE-284
https://github.com/SchedMD/slurm/commit/92362a92fffe60187df61f99ab11c249d44120ee
92362a92fffe60187df61f99ab11c249d44120ee
Fix security issue in _prolog_error(). Fix security issue caused by insecure file path handling triggered by the failure of a Prolog script. To exploit this a user needs to anticipate or cause the Prolog to fail for their job. (This commit is slightly different from the fix to the 15.08 branch.) CVE-2016-10030.
_steps_completed_now(uint32_t jobid) { List steps; ListIterator i; step_loc_t *stepd; bool rc = true; steps = stepd_available(conf->spooldir, conf->node_name); i = list_iterator_create(steps); while ((stepd = list_next(i))) { if (stepd->jobid == jobid) { int fd; fd = stepd_connect(stepd->directory, stepd->nodename, stepd->jobid, stepd->stepid, &stepd->protocol_version); if (fd == -1) continue; if (stepd_state(fd, stepd->protocol_version) != SLURMSTEPD_NOT_RUNNING) { rc = false; close(fd); break; } close(fd); } } list_iterator_destroy(i); FREE_NULL_LIST(steps); return rc; }
_steps_completed_now(uint32_t jobid) { List steps; ListIterator i; step_loc_t *stepd; bool rc = true; steps = stepd_available(conf->spooldir, conf->node_name); i = list_iterator_create(steps); while ((stepd = list_next(i))) { if (stepd->jobid == jobid) { int fd; fd = stepd_connect(stepd->directory, stepd->nodename, stepd->jobid, stepd->stepid, &stepd->protocol_version); if (fd == -1) continue; if (stepd_state(fd, stepd->protocol_version) != SLURMSTEPD_NOT_RUNNING) { rc = false; close(fd); break; } close(fd); } } list_iterator_destroy(i); FREE_NULL_LIST(steps); return rc; }
C
slurm
0
CVE-2014-0203
https://www.cvedetails.com/cve/CVE-2014-0203/
CWE-20
https://github.com/torvalds/linux/commit/86acdca1b63e6890540fa19495cfc708beff3d8b
86acdca1b63e6890540fa19495cfc708beff3d8b
fix autofs/afs/etc. magic mountpoint breakage We end up trying to kfree() nd.last.name on open("/mnt/tmp", O_CREAT) if /mnt/tmp is an autofs direct mount. The reason is that nd.last_type is bogus here; we want LAST_BIND for everything of that kind and we get LAST_NORM left over from finding parent directory. So make sure that it *is* set properly; set to LAST_BIND before doing ->follow_link() - for normal symlinks it will be changed by __vfs_follow_link() and everything else needs it set that way. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
static int do_path_lookup(int dfd, const char *name, unsigned int flags, struct nameidata *nd) { int retval = path_init(dfd, name, flags, nd); if (!retval) retval = path_walk(name, nd); if (unlikely(!retval && !audit_dummy_context() && nd->path.dentry && nd->path.dentry->d_inode)) audit_inode(name, nd->path.dentry); if (nd->root.mnt) { path_put(&nd->root); nd->root.mnt = NULL; } return retval; }
static int do_path_lookup(int dfd, const char *name, unsigned int flags, struct nameidata *nd) { int retval = path_init(dfd, name, flags, nd); if (!retval) retval = path_walk(name, nd); if (unlikely(!retval && !audit_dummy_context() && nd->path.dentry && nd->path.dentry->d_inode)) audit_inode(name, nd->path.dentry); if (nd->root.mnt) { path_put(&nd->root); nd->root.mnt = NULL; } return retval; }
C
linux
0
CVE-2015-0274
https://www.cvedetails.com/cve/CVE-2015-0274/
CWE-19
https://github.com/torvalds/linux/commit/8275cdd0e7ac550dcce2b3ef6d2fb3b808c1ae59
8275cdd0e7ac550dcce2b3ef6d2fb3b808c1ae59
xfs: remote attribute overwrite causes transaction overrun Commit e461fcb ("xfs: remote attribute lookups require the value length") passes the remote attribute length in the xfs_da_args structure on lookup so that CRC calculations and validity checking can be performed correctly by related code. This, unfortunately has the side effect of changing the args->valuelen parameter in cases where it shouldn't. That is, when we replace a remote attribute, the incoming replacement stores the value and length in args->value and args->valuelen, but then the lookup which finds the existing remote attribute overwrites args->valuelen with the length of the remote attribute being replaced. Hence when we go to create the new attribute, we create it of the size of the existing remote attribute, not the size it is supposed to be. When the new attribute is much smaller than the old attribute, this results in a transaction overrun and an ASSERT() failure on a debug kernel: XFS: Assertion failed: tp->t_blk_res_used <= tp->t_blk_res, file: fs/xfs/xfs_trans.c, line: 331 Fix this by keeping the remote attribute value length separate to the attribute value length in the xfs_da_args structure. The enables us to pass the length of the remote attribute to be removed without overwriting the new attribute's length. Also, ensure that when we save remote block contexts for a later rename we zero the original state variables so that we don't confuse the state of the attribute to be removes with the state of the new attribute that we just added. [Spotted by Brain Foster.] Signed-off-by: Dave Chinner <dchinner@redhat.com> Reviewed-by: Brian Foster <bfoster@redhat.com> Signed-off-by: Dave Chinner <david@fromorbit.com>
xfs_attr_name_to_xname( struct xfs_name *xname, const unsigned char *aname) { if (!aname) return EINVAL; xname->name = aname; xname->len = strlen((char *)aname); if (xname->len >= MAXNAMELEN) return EFAULT; /* match IRIX behaviour */ return 0; }
xfs_attr_name_to_xname( struct xfs_name *xname, const unsigned char *aname) { if (!aname) return EINVAL; xname->name = aname; xname->len = strlen((char *)aname); if (xname->len >= MAXNAMELEN) return EFAULT; /* match IRIX behaviour */ return 0; }
C
linux
0
CVE-2017-7533
https://www.cvedetails.com/cve/CVE-2017-7533/
CWE-362
https://github.com/torvalds/linux/commit/49d31c2f389acfe83417083e1208422b4091cd9e
49d31c2f389acfe83417083e1208422b4091cd9e
dentry name snapshots take_dentry_name_snapshot() takes a safe snapshot of dentry name; if the name is a short one, it gets copied into caller-supplied structure, otherwise an extra reference to external name is grabbed (those are never modified). In either case the pointer to stable string is stored into the same structure. dentry must be held by the caller of take_dentry_name_snapshot(), but may be freely dropped afterwards - the snapshot will stay until destroyed by release_dentry_name_snapshot(). Intended use: struct name_snapshot s; take_dentry_name_snapshot(&s, dentry); ... access s.name ... release_dentry_name_snapshot(&s); Replaces fsnotify_oldname_...(), gets used in fsnotify to obtain the name to pass down with event. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
static void __d_move(struct dentry *dentry, struct dentry *target, bool exchange) { struct inode *dir = NULL; unsigned n; if (!dentry->d_inode) printk(KERN_WARNING "VFS: moving negative dcache entry\n"); BUG_ON(d_ancestor(dentry, target)); BUG_ON(d_ancestor(target, dentry)); dentry_lock_for_move(dentry, target); if (unlikely(d_in_lookup(target))) { dir = target->d_parent->d_inode; n = start_dir_add(dir); __d_lookup_done(target); } write_seqcount_begin(&dentry->d_seq); write_seqcount_begin_nested(&target->d_seq, DENTRY_D_LOCK_NESTED); /* unhash both */ /* __d_drop does write_seqcount_barrier, but they're OK to nest. */ __d_drop(dentry); __d_drop(target); /* Switch the names.. */ if (exchange) swap_names(dentry, target); else copy_name(dentry, target); /* rehash in new place(s) */ __d_rehash(dentry); if (exchange) __d_rehash(target); /* ... and switch them in the tree */ if (IS_ROOT(dentry)) { /* splicing a tree */ dentry->d_flags |= DCACHE_RCUACCESS; dentry->d_parent = target->d_parent; target->d_parent = target; list_del_init(&target->d_child); list_move(&dentry->d_child, &dentry->d_parent->d_subdirs); } else { /* swapping two dentries */ swap(dentry->d_parent, target->d_parent); list_move(&target->d_child, &target->d_parent->d_subdirs); list_move(&dentry->d_child, &dentry->d_parent->d_subdirs); if (exchange) fsnotify_update_flags(target); fsnotify_update_flags(dentry); } write_seqcount_end(&target->d_seq); write_seqcount_end(&dentry->d_seq); if (dir) end_dir_add(dir, n); dentry_unlock_for_move(dentry, target); }
static void __d_move(struct dentry *dentry, struct dentry *target, bool exchange) { struct inode *dir = NULL; unsigned n; if (!dentry->d_inode) printk(KERN_WARNING "VFS: moving negative dcache entry\n"); BUG_ON(d_ancestor(dentry, target)); BUG_ON(d_ancestor(target, dentry)); dentry_lock_for_move(dentry, target); if (unlikely(d_in_lookup(target))) { dir = target->d_parent->d_inode; n = start_dir_add(dir); __d_lookup_done(target); } write_seqcount_begin(&dentry->d_seq); write_seqcount_begin_nested(&target->d_seq, DENTRY_D_LOCK_NESTED); /* unhash both */ /* __d_drop does write_seqcount_barrier, but they're OK to nest. */ __d_drop(dentry); __d_drop(target); /* Switch the names.. */ if (exchange) swap_names(dentry, target); else copy_name(dentry, target); /* rehash in new place(s) */ __d_rehash(dentry); if (exchange) __d_rehash(target); /* ... and switch them in the tree */ if (IS_ROOT(dentry)) { /* splicing a tree */ dentry->d_flags |= DCACHE_RCUACCESS; dentry->d_parent = target->d_parent; target->d_parent = target; list_del_init(&target->d_child); list_move(&dentry->d_child, &dentry->d_parent->d_subdirs); } else { /* swapping two dentries */ swap(dentry->d_parent, target->d_parent); list_move(&target->d_child, &target->d_parent->d_subdirs); list_move(&dentry->d_child, &dentry->d_parent->d_subdirs); if (exchange) fsnotify_update_flags(target); fsnotify_update_flags(dentry); } write_seqcount_end(&target->d_seq); write_seqcount_end(&dentry->d_seq); if (dir) end_dir_add(dir, n); dentry_unlock_for_move(dentry, target); }
C
linux
0
CVE-2014-7909
https://www.cvedetails.com/cve/CVE-2014-7909/
CWE-189
https://github.com/chromium/chromium/commit/2571533bbb5b554ff47205c8ef1513ccc0817c3e
2571533bbb5b554ff47205c8ef1513ccc0817c3e
DocumentThreadableLoader: Add guards for sync notifyFinished() in setResource() In loadRequest(), setResource() can call clear() synchronously: DocumentThreadableLoader::clear() DocumentThreadableLoader::handleError() Resource::didAddClient() RawResource::didAddClient() and thus |m_client| can be null while resource() isn't null after setResource(), causing crashes (Issue 595964). This CL checks whether |*this| is destructed and whether |m_client| is null after setResource(). BUG=595964 Review-Url: https://codereview.chromium.org/1902683002 Cr-Commit-Position: refs/heads/master@{#391001}
void DocumentThreadableLoader::clear() { m_client = nullptr; if (!m_async) return; m_timeoutTimer.stop(); m_requestStartedSeconds = 0.0; clearResource(); }
void DocumentThreadableLoader::clear() { m_client = nullptr; if (!m_async) return; m_timeoutTimer.stop(); m_requestStartedSeconds = 0.0; clearResource(); }
C
Chrome
0
CVE-2011-1019
https://www.cvedetails.com/cve/CVE-2011-1019/
CWE-264
https://github.com/torvalds/linux/commit/8909c9ad8ff03611c9c96c9a92656213e4bb495b
8909c9ad8ff03611c9c96c9a92656213e4bb495b
net: don't allow CAP_NET_ADMIN to load non-netdev kernel modules Since a8f80e8ff94ecba629542d9b4b5f5a8ee3eb565c any process with CAP_NET_ADMIN may load any module from /lib/modules/. This doesn't mean that CAP_NET_ADMIN is a superset of CAP_SYS_MODULE as modules are limited to /lib/modules/**. However, CAP_NET_ADMIN capability shouldn't allow anybody load any module not related to networking. This patch restricts an ability of autoloading modules to netdev modules with explicit aliases. This fixes CVE-2011-1019. Arnd Bergmann suggested to leave untouched the old pre-v2.6.32 behavior of loading netdev modules by name (without any prefix) for processes with CAP_SYS_MODULE to maintain the compatibility with network scripts that use autoloading netdev modules by aliases like "eth0", "wlan0". Currently there are only three users of the feature in the upstream kernel: ipip, ip_gre and sit. root@albatros:~# capsh --drop=$(seq -s, 0 11),$(seq -s, 13 34) -- root@albatros:~# grep Cap /proc/$$/status CapInh: 0000000000000000 CapPrm: fffffff800001000 CapEff: fffffff800001000 CapBnd: fffffff800001000 root@albatros:~# modprobe xfs FATAL: Error inserting xfs (/lib/modules/2.6.38-rc6-00001-g2bf4ca3/kernel/fs/xfs/xfs.ko): Operation not permitted root@albatros:~# lsmod | grep xfs root@albatros:~# ifconfig xfs xfs: error fetching interface information: Device not found root@albatros:~# lsmod | grep xfs root@albatros:~# lsmod | grep sit root@albatros:~# ifconfig sit sit: error fetching interface information: Device not found root@albatros:~# lsmod | grep sit root@albatros:~# ifconfig sit0 sit0 Link encap:IPv6-in-IPv4 NOARP MTU:1480 Metric:1 root@albatros:~# lsmod | grep sit sit 10457 0 tunnel4 2957 1 sit For CAP_SYS_MODULE module loading is still relaxed: root@albatros:~# grep Cap /proc/$$/status CapInh: 0000000000000000 CapPrm: ffffffffffffffff CapEff: ffffffffffffffff CapBnd: ffffffffffffffff root@albatros:~# ifconfig xfs xfs: error fetching interface information: Device not found root@albatros:~# lsmod | grep xfs xfs 745319 0 Reference: https://lkml.org/lkml/2011/2/24/203 Signed-off-by: Vasiliy Kulikov <segoon@openwall.com> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru> Acked-by: David S. Miller <davem@davemloft.net> Acked-by: Kees Cook <kees.cook@canonical.com> Signed-off-by: James Morris <jmorris@namei.org>
__be32 try_6rd(struct in6_addr *v6dst, struct ip_tunnel *tunnel) { __be32 dst = 0; #ifdef CONFIG_IPV6_SIT_6RD if (ipv6_prefix_equal(v6dst, &tunnel->ip6rd.prefix, tunnel->ip6rd.prefixlen)) { unsigned int pbw0, pbi0; int pbi1; u32 d; pbw0 = tunnel->ip6rd.prefixlen >> 5; pbi0 = tunnel->ip6rd.prefixlen & 0x1f; d = (ntohl(v6dst->s6_addr32[pbw0]) << pbi0) >> tunnel->ip6rd.relay_prefixlen; pbi1 = pbi0 - tunnel->ip6rd.relay_prefixlen; if (pbi1 > 0) d |= ntohl(v6dst->s6_addr32[pbw0 + 1]) >> (32 - pbi1); dst = tunnel->ip6rd.relay_prefix | htonl(d); } #else if (v6dst->s6_addr16[0] == htons(0x2002)) { /* 6to4 v6 addr has 16 bits prefix, 32 v4addr, 16 SLA, ... */ memcpy(&dst, &v6dst->s6_addr16[1], 4); } #endif return dst; }
__be32 try_6rd(struct in6_addr *v6dst, struct ip_tunnel *tunnel) { __be32 dst = 0; #ifdef CONFIG_IPV6_SIT_6RD if (ipv6_prefix_equal(v6dst, &tunnel->ip6rd.prefix, tunnel->ip6rd.prefixlen)) { unsigned int pbw0, pbi0; int pbi1; u32 d; pbw0 = tunnel->ip6rd.prefixlen >> 5; pbi0 = tunnel->ip6rd.prefixlen & 0x1f; d = (ntohl(v6dst->s6_addr32[pbw0]) << pbi0) >> tunnel->ip6rd.relay_prefixlen; pbi1 = pbi0 - tunnel->ip6rd.relay_prefixlen; if (pbi1 > 0) d |= ntohl(v6dst->s6_addr32[pbw0 + 1]) >> (32 - pbi1); dst = tunnel->ip6rd.relay_prefix | htonl(d); } #else if (v6dst->s6_addr16[0] == htons(0x2002)) { /* 6to4 v6 addr has 16 bits prefix, 32 v4addr, 16 SLA, ... */ memcpy(&dst, &v6dst->s6_addr16[1], 4); } #endif return dst; }
C
linux
0
CVE-2016-5218
https://www.cvedetails.com/cve/CVE-2016-5218/
CWE-20
https://github.com/chromium/chromium/commit/45d901b56f578a74b19ba0d10fa5c4c467f19303
45d901b56f578a74b19ba0d10fa5c4c467f19303
Paint tab groups with the group color. * The background of TabGroupHeader now uses the group color. * The backgrounds of tabs in the group are tinted with the group color. This treatment, along with the colors chosen, are intended to be a placeholder. Bug: 905491 Change-Id: Ic808548f8eba23064606e7fb8c9bba281d0d117f Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1610504 Commit-Queue: Bret Sepulveda <bsep@chromium.org> Reviewed-by: Taylor Bergquist <tbergquist@chromium.org> Cr-Commit-Position: refs/heads/master@{#660498}
void TabAnimationDelegate::AnimationProgressed( const gfx::Animation* animation) { tab_->SetVisible(tab_strip_->ShouldTabBeVisible(tab_)); }
void TabAnimationDelegate::AnimationProgressed( const gfx::Animation* animation) { tab_->SetVisible(tab_strip_->ShouldTabBeVisible(tab_)); }
C
Chrome
0
null
null
null
https://github.com/chromium/chromium/commit/41a7e42ef575c10375f574145e5d023118fbd149
41a7e42ef575c10375f574145e5d023118fbd149
chromeos: Send 'keypress' for the content when composing a character with dead keys This change leaves characters outside BMP unable to be typed on docs.google.com, but surely fixes the problem for most use cases. BUG=132668 TEST=Create a document on docs.google.com and try typing a character with dead keys (e.g. type '^'+'a' with keyboard layout "English - US international") Review URL: https://chromiumcodereview.appspot.com/10565032 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@142705 0039d316-1c4b-4281-b951-d872f2087c98
void InputMethodIBus::OnDestroy(IBusInputContext* context) { DCHECK_EQ(context_, context); g_object_unref(context_); context_ = NULL; context_focused_ = false; ConfirmCompositionText(); OnInputMethodChanged(); }
void InputMethodIBus::OnDestroy(IBusInputContext* context) { DCHECK_EQ(context_, context); g_object_unref(context_); context_ = NULL; context_focused_ = false; ConfirmCompositionText(); OnInputMethodChanged(); }
C
Chrome
0
CVE-2019-10664
https://www.cvedetails.com/cve/CVE-2019-10664/
CWE-89
https://github.com/domoticz/domoticz/commit/ee70db46f81afa582c96b887b73bcd2a86feda00
ee70db46f81afa582c96b887b73bcd2a86feda00
Fixed possible SQL Injection Vulnerability (Thanks to Fabio Carretto!)
void CWebServer::Cmd_DeletePlan(WebEmSession & session, const request& req, Json::Value &root) { if (session.rights != 2) { session.reply_status = reply::forbidden; return; //Only admin user allowed } std::string idx = request::findValue(&req, "idx"); if (idx.empty()) return; root["status"] = "OK"; root["title"] = "DeletePlan"; m_sql.safe_query( "DELETE FROM DeviceToPlansMap WHERE (PlanID == '%q')", idx.c_str() ); m_sql.safe_query( "DELETE FROM Plans WHERE (ID == '%q')", idx.c_str() ); }
void CWebServer::Cmd_DeletePlan(WebEmSession & session, const request& req, Json::Value &root) { if (session.rights != 2) { session.reply_status = reply::forbidden; return; //Only admin user allowed } std::string idx = request::findValue(&req, "idx"); if (idx.empty()) return; root["status"] = "OK"; root["title"] = "DeletePlan"; m_sql.safe_query( "DELETE FROM DeviceToPlansMap WHERE (PlanID == '%q')", idx.c_str() ); m_sql.safe_query( "DELETE FROM Plans WHERE (ID == '%q')", idx.c_str() ); }
C
domoticz
0
CVE-2011-4930
https://www.cvedetails.com/cve/CVE-2011-4930/
CWE-134
https://htcondor-git.cs.wisc.edu/?p=condor.git;a=commitdiff;h=5e5571d1a431eb3c61977b6dd6ec90186ef79867
5e5571d1a431eb3c61977b6dd6ec90186ef79867
null
int getJobAdExitSignal(ClassAd *jad, int &exit_signal) { if( ! jad->LookupInteger(ATTR_ON_EXIT_SIGNAL, exit_signal) ) { return FALSE; } return TRUE; }
int getJobAdExitSignal(ClassAd *jad, int &exit_signal) { if( ! jad->LookupInteger(ATTR_ON_EXIT_SIGNAL, exit_signal) ) { return FALSE; } return TRUE; }
CPP
htcondor
0
CVE-2014-3168
https://www.cvedetails.com/cve/CVE-2014-3168/
null
https://github.com/chromium/chromium/commit/f592cf6a66b63decc7e7093b36501229a5de1f1d
f592cf6a66b63decc7e7093b36501229a5de1f1d
SVG: Moving animating <svg> to other iframe should not crash. Moving SVGSVGElement with its SMILTimeContainer already started caused crash before this patch. |SVGDocumentExtentions::startAnimations()| calls begin() against all SMILTimeContainers in the document, but the SMILTimeContainer for <svg> moved from other document may be already started. BUG=369860 Review URL: https://codereview.chromium.org/290353002 git-svn-id: svn://svn.chromium.org/blink/trunk@174338 bbb929c8-8fbe-4397-9dbb-9b2b20218538
void SVGDocumentExtensions::dispatchSVGLoadEventToOutermostSVGElements() { WillBeHeapVector<RefPtrWillBeMember<SVGSVGElement> > timeContainers; timeContainers.appendRange(m_timeContainers.begin(), m_timeContainers.end()); WillBeHeapVector<RefPtrWillBeMember<SVGSVGElement> >::iterator end = timeContainers.end(); for (WillBeHeapVector<RefPtrWillBeMember<SVGSVGElement> >::iterator it = timeContainers.begin(); it != end; ++it) { SVGSVGElement* outerSVG = (*it).get(); if (!outerSVG->isOutermostSVGSVGElement()) continue; if (outerSVG->document().wellFormed() || !outerSVG->document().isSVGDocument()) outerSVG->sendSVGLoadEventIfPossible(); } }
void SVGDocumentExtensions::dispatchSVGLoadEventToOutermostSVGElements() { WillBeHeapVector<RefPtrWillBeMember<SVGSVGElement> > timeContainers; timeContainers.appendRange(m_timeContainers.begin(), m_timeContainers.end()); WillBeHeapVector<RefPtrWillBeMember<SVGSVGElement> >::iterator end = timeContainers.end(); for (WillBeHeapVector<RefPtrWillBeMember<SVGSVGElement> >::iterator it = timeContainers.begin(); it != end; ++it) { SVGSVGElement* outerSVG = (*it).get(); if (!outerSVG->isOutermostSVGSVGElement()) continue; if (outerSVG->document().wellFormed() || !outerSVG->document().isSVGDocument()) outerSVG->sendSVGLoadEventIfPossible(); } }
C
Chrome
0
CVE-2013-2868
https://www.cvedetails.com/cve/CVE-2013-2868/
null
https://github.com/chromium/chromium/commit/8c95ab0b50f8a257514f9647929267e62b1e611d
8c95ab0b50f8a257514f9647929267e62b1e611d
Fix syncing of NPAPI plugins. This fix adds a check for |plugin| permission while syncing NPAPI plugins. BUG=252034 Review URL: https://chromiumcodereview.appspot.com/16816024 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@207830 0039d316-1c4b-4281-b951-d872f2087c98
bool IsSyncable(const Extension* extension) { bool is_syncable = (extension->location() == Manifest::INTERNAL && !extension->was_installed_by_default()); is_syncable |= (extension->id() == extension_misc::kWebStoreAppId); return is_syncable; }
bool IsSyncable(const Extension* extension) { bool is_syncable = (extension->location() == Manifest::INTERNAL && !extension->was_installed_by_default()); is_syncable |= (extension->id() == extension_misc::kWebStoreAppId); return is_syncable; }
C
Chrome
0
CVE-2018-13006
https://www.cvedetails.com/cve/CVE-2018-13006/
CWE-125
https://github.com/gpac/gpac/commit/bceb03fd2be95097a7b409ea59914f332fb6bc86
bceb03fd2be95097a7b409ea59914f332fb6bc86
fixed 2 possible heap overflows (inc. #1088)
static GF_Err gf_isom_dump_srt_track(GF_ISOFile *the_file, u32 track, FILE *dump) { u32 i, j, k, count, di, len, ts, cur_frame; u64 start, end; GF_Tx3gSampleEntryBox *txtd; GF_BitStream *bs; char szDur[100]; GF_TrackBox *trak = gf_isom_get_track_from_file(the_file, track); if (!trak) return GF_BAD_PARAM; switch (trak->Media->handler->handlerType) { case GF_ISOM_MEDIA_TEXT: case GF_ISOM_MEDIA_SUBT: break; default: return GF_BAD_PARAM; } ts = trak->Media->mediaHeader->timeScale; cur_frame = 0; end = 0; count = gf_isom_get_sample_count(the_file, track); for (i=0; i<count; i++) { GF_TextSample *txt; GF_ISOSample *s = gf_isom_get_sample(the_file, track, i+1, &di); if (!s) continue; start = s->DTS; if (s->dataLength==2) { gf_isom_sample_del(&s); continue; } if (i+1<count) { GF_ISOSample *next = gf_isom_get_sample_info(the_file, track, i+2, NULL, NULL); if (next) { end = next->DTS; gf_isom_sample_del(&next); } } else { end = gf_isom_get_media_duration(the_file, track) ; } cur_frame++; fprintf(dump, "%d\n", cur_frame); tx3g_format_time(start, ts, szDur, GF_TRUE); fprintf(dump, "%s --> ", szDur); tx3g_format_time(end, ts, szDur, GF_TRUE); fprintf(dump, "%s\n", szDur); bs = gf_bs_new(s->data, s->dataLength, GF_BITSTREAM_READ); txt = gf_isom_parse_texte_sample(bs); gf_bs_del(bs); txtd = (GF_Tx3gSampleEntryBox *)gf_list_get(trak->Media->information->sampleTable->SampleDescription->other_boxes, di-1); if (!txt->len) { fprintf(dump, "\n"); } else { u32 styles, char_num, new_styles, color, new_color; u16 utf16Line[10000]; /*UTF16*/ if ((txt->len>2) && ((unsigned char) txt->text[0] == (unsigned char) 0xFE) && ((unsigned char) txt->text[1] == (unsigned char) 0xFF)) { memcpy(utf16Line, txt->text+2, sizeof(char)*txt->len); ( ((char *)utf16Line)[txt->len] ) = 0; len = txt->len; } else { u8 *str = (u8 *) (txt->text); size_t res = gf_utf8_mbstowcs(utf16Line, 10000, (const char **) &str); if (res==(size_t)-1) return GF_NON_COMPLIANT_BITSTREAM; len = (u32) res; utf16Line[len] = 0; } char_num = 0; styles = 0; new_styles = txtd->default_style.style_flags; color = new_color = txtd->default_style.text_color; for (j=0; j<len; j++) { Bool is_new_line; if (txt->styles) { new_styles = txtd->default_style.style_flags; new_color = txtd->default_style.text_color; for (k=0; k<txt->styles->entry_count; k++) { if (txt->styles->styles[k].startCharOffset>char_num) continue; if (txt->styles->styles[k].endCharOffset<char_num+1) continue; if (txt->styles->styles[k].style_flags & (GF_TXT_STYLE_ITALIC | GF_TXT_STYLE_BOLD | GF_TXT_STYLE_UNDERLINED)) { new_styles = txt->styles->styles[k].style_flags; new_color = txt->styles->styles[k].text_color; break; } } } if (new_styles != styles) { if ((new_styles & GF_TXT_STYLE_BOLD) && !(styles & GF_TXT_STYLE_BOLD)) fprintf(dump, "<b>"); if ((new_styles & GF_TXT_STYLE_ITALIC) && !(styles & GF_TXT_STYLE_ITALIC)) fprintf(dump, "<i>"); if ((new_styles & GF_TXT_STYLE_UNDERLINED) && !(styles & GF_TXT_STYLE_UNDERLINED)) fprintf(dump, "<u>"); if ((styles & GF_TXT_STYLE_UNDERLINED) && !(new_styles & GF_TXT_STYLE_UNDERLINED)) fprintf(dump, "</u>"); if ((styles & GF_TXT_STYLE_ITALIC) && !(new_styles & GF_TXT_STYLE_ITALIC)) fprintf(dump, "</i>"); if ((styles & GF_TXT_STYLE_BOLD) && !(new_styles & GF_TXT_STYLE_BOLD)) fprintf(dump, "</b>"); styles = new_styles; } if (new_color != color) { if (new_color ==txtd->default_style.text_color) { fprintf(dump, "</font>"); } else { fprintf(dump, "<font color=\"%s\">", gf_color_get_name(new_color) ); } color = new_color; } /*not sure if styles must be reseted at line breaks in srt...*/ is_new_line = GF_FALSE; if ((utf16Line[j]=='\n') || (utf16Line[j]=='\r') ) { if ((utf16Line[j]=='\r') && (utf16Line[j+1]=='\n')) j++; fprintf(dump, "\n"); is_new_line = GF_TRUE; } if (!is_new_line) { size_t sl; char szChar[30]; s16 swT[2], *swz; swT[0] = utf16Line[j]; swT[1] = 0; swz= (s16 *)swT; sl = gf_utf8_wcstombs(szChar, 30, (const unsigned short **) &swz); if (sl == (size_t)-1) sl=0; szChar[(u32) sl]=0; fprintf(dump, "%s", szChar); } char_num++; } new_styles = 0; if (new_styles != styles) { if (styles & GF_TXT_STYLE_UNDERLINED) fprintf(dump, "</u>"); if (styles & GF_TXT_STYLE_ITALIC) fprintf(dump, "</i>"); if (styles & GF_TXT_STYLE_BOLD) fprintf(dump, "</b>"); } if (color != txtd->default_style.text_color) { fprintf(dump, "</font>"); } fprintf(dump, "\n"); } gf_isom_sample_del(&s); gf_isom_delete_text_sample(txt); fprintf(dump, "\n"); gf_set_progress("SRT Extract", i, count); } if (count) gf_set_progress("SRT Extract", i, count); return GF_OK; }
static GF_Err gf_isom_dump_srt_track(GF_ISOFile *the_file, u32 track, FILE *dump) { u32 i, j, k, count, di, len, ts, cur_frame; u64 start, end; GF_Tx3gSampleEntryBox *txtd; GF_BitStream *bs; char szDur[100]; GF_TrackBox *trak = gf_isom_get_track_from_file(the_file, track); if (!trak) return GF_BAD_PARAM; switch (trak->Media->handler->handlerType) { case GF_ISOM_MEDIA_TEXT: case GF_ISOM_MEDIA_SUBT: break; default: return GF_BAD_PARAM; } ts = trak->Media->mediaHeader->timeScale; cur_frame = 0; end = 0; count = gf_isom_get_sample_count(the_file, track); for (i=0; i<count; i++) { GF_TextSample *txt; GF_ISOSample *s = gf_isom_get_sample(the_file, track, i+1, &di); if (!s) continue; start = s->DTS; if (s->dataLength==2) { gf_isom_sample_del(&s); continue; } if (i+1<count) { GF_ISOSample *next = gf_isom_get_sample_info(the_file, track, i+2, NULL, NULL); if (next) { end = next->DTS; gf_isom_sample_del(&next); } } else { end = gf_isom_get_media_duration(the_file, track) ; } cur_frame++; fprintf(dump, "%d\n", cur_frame); tx3g_format_time(start, ts, szDur, GF_TRUE); fprintf(dump, "%s --> ", szDur); tx3g_format_time(end, ts, szDur, GF_TRUE); fprintf(dump, "%s\n", szDur); bs = gf_bs_new(s->data, s->dataLength, GF_BITSTREAM_READ); txt = gf_isom_parse_texte_sample(bs); gf_bs_del(bs); txtd = (GF_Tx3gSampleEntryBox *)gf_list_get(trak->Media->information->sampleTable->SampleDescription->other_boxes, di-1); if (!txt->len) { fprintf(dump, "\n"); } else { u32 styles, char_num, new_styles, color, new_color; u16 utf16Line[10000]; /*UTF16*/ if ((txt->len>2) && ((unsigned char) txt->text[0] == (unsigned char) 0xFE) && ((unsigned char) txt->text[1] == (unsigned char) 0xFF)) { memcpy(utf16Line, txt->text+2, sizeof(char)*txt->len); ( ((char *)utf16Line)[txt->len] ) = 0; len = txt->len; } else { u8 *str = (u8 *) (txt->text); size_t res = gf_utf8_mbstowcs(utf16Line, 10000, (const char **) &str); if (res==(size_t)-1) return GF_NON_COMPLIANT_BITSTREAM; len = (u32) res; utf16Line[len] = 0; } char_num = 0; styles = 0; new_styles = txtd->default_style.style_flags; color = new_color = txtd->default_style.text_color; for (j=0; j<len; j++) { Bool is_new_line; if (txt->styles) { new_styles = txtd->default_style.style_flags; new_color = txtd->default_style.text_color; for (k=0; k<txt->styles->entry_count; k++) { if (txt->styles->styles[k].startCharOffset>char_num) continue; if (txt->styles->styles[k].endCharOffset<char_num+1) continue; if (txt->styles->styles[k].style_flags & (GF_TXT_STYLE_ITALIC | GF_TXT_STYLE_BOLD | GF_TXT_STYLE_UNDERLINED)) { new_styles = txt->styles->styles[k].style_flags; new_color = txt->styles->styles[k].text_color; break; } } } if (new_styles != styles) { if ((new_styles & GF_TXT_STYLE_BOLD) && !(styles & GF_TXT_STYLE_BOLD)) fprintf(dump, "<b>"); if ((new_styles & GF_TXT_STYLE_ITALIC) && !(styles & GF_TXT_STYLE_ITALIC)) fprintf(dump, "<i>"); if ((new_styles & GF_TXT_STYLE_UNDERLINED) && !(styles & GF_TXT_STYLE_UNDERLINED)) fprintf(dump, "<u>"); if ((styles & GF_TXT_STYLE_UNDERLINED) && !(new_styles & GF_TXT_STYLE_UNDERLINED)) fprintf(dump, "</u>"); if ((styles & GF_TXT_STYLE_ITALIC) && !(new_styles & GF_TXT_STYLE_ITALIC)) fprintf(dump, "</i>"); if ((styles & GF_TXT_STYLE_BOLD) && !(new_styles & GF_TXT_STYLE_BOLD)) fprintf(dump, "</b>"); styles = new_styles; } if (new_color != color) { if (new_color ==txtd->default_style.text_color) { fprintf(dump, "</font>"); } else { fprintf(dump, "<font color=\"%s\">", gf_color_get_name(new_color) ); } color = new_color; } /*not sure if styles must be reseted at line breaks in srt...*/ is_new_line = GF_FALSE; if ((utf16Line[j]=='\n') || (utf16Line[j]=='\r') ) { if ((utf16Line[j]=='\r') && (utf16Line[j+1]=='\n')) j++; fprintf(dump, "\n"); is_new_line = GF_TRUE; } if (!is_new_line) { size_t sl; char szChar[30]; s16 swT[2], *swz; swT[0] = utf16Line[j]; swT[1] = 0; swz= (s16 *)swT; sl = gf_utf8_wcstombs(szChar, 30, (const unsigned short **) &swz); if (sl == (size_t)-1) sl=0; szChar[(u32) sl]=0; fprintf(dump, "%s", szChar); } char_num++; } new_styles = 0; if (new_styles != styles) { if (styles & GF_TXT_STYLE_UNDERLINED) fprintf(dump, "</u>"); if (styles & GF_TXT_STYLE_ITALIC) fprintf(dump, "</i>"); if (styles & GF_TXT_STYLE_BOLD) fprintf(dump, "</b>"); } if (color != txtd->default_style.text_color) { fprintf(dump, "</font>"); } fprintf(dump, "\n"); } gf_isom_sample_del(&s); gf_isom_delete_text_sample(txt); fprintf(dump, "\n"); gf_set_progress("SRT Extract", i, count); } if (count) gf_set_progress("SRT Extract", i, count); return GF_OK; }
C
gpac
0
CVE-2013-0886
https://www.cvedetails.com/cve/CVE-2013-0886/
null
https://github.com/chromium/chromium/commit/18d67244984a574ba2dd8779faabc0e3e34f4b76
18d67244984a574ba2dd8779faabc0e3e34f4b76
Implement TextureImageTransportSurface using texture mailbox This has a couple of advantages: - allow tearing down and recreating the UI parent context without losing the renderer contexts - do not require a context to be able to generate textures when creating the GLSurfaceHandle - clearer ownership semantics that potentially allows for more robust and easier lost context handling/thumbnailing/etc., since a texture is at any given time owned by either: UI parent, mailbox, or TextureImageTransportSurface - simplify frontbuffer protection logic; the frontbuffer textures are now owned by RWHV where they are refcounted The TextureImageTransportSurface informs RenderWidgetHostView of the mailbox names for the front- and backbuffer textures by associating them with a surface_handle (1 or 2) in the AcceleratedSurfaceNew message. During SwapBuffers() or PostSubBuffer() cycles, it then uses produceTextureCHROMIUM() and consumeTextureCHROMIUM() to transfer ownership between renderer and browser compositor. RWHV sends back the surface_handle of the buffer being returned with the Swap ACK (or 0 if no buffer is being returned in which case TextureImageTransportSurface will allocate a new texture - note that this could be used to simply keep textures for thumbnailing). BUG=154815,139616 TBR=sky@chromium.org Review URL: https://chromiumcodereview.appspot.com/11194042 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@171569 0039d316-1c4b-4281-b951-d872f2087c98
void RenderWidgetHostViewAura::GetHitTestMask(gfx::Path* mask) const { }
void RenderWidgetHostViewAura::GetHitTestMask(gfx::Path* mask) const { }
C
Chrome
0
CVE-2016-7976
https://www.cvedetails.com/cve/CVE-2016-7976/
CWE-20
http://git.ghostscript.com/?p=user/chrisl/ghostpdl.git;a=commit;h=6d444c273da5499a4cd72f21cb6d4c9a5256807d
6d444c273da5499a4cd72f21cb6d4c9a5256807d
null
gs_lib_ctx_get_default_device_list(const gs_memory_t *mem, char** dev_list_str, int *list_str_len) { /* In the case the lib ctx hasn't been initialised */ if (mem && mem->gs_lib_ctx && mem->gs_lib_ctx->default_device_list) { *dev_list_str = mem->gs_lib_ctx->default_device_list; } else { *dev_list_str = (char *)gs_dev_defaults; } *list_str_len = strlen(*dev_list_str); return 0; }
gs_lib_ctx_get_default_device_list(const gs_memory_t *mem, char** dev_list_str, int *list_str_len) { /* In the case the lib ctx hasn't been initialised */ if (mem && mem->gs_lib_ctx && mem->gs_lib_ctx->default_device_list) { *dev_list_str = mem->gs_lib_ctx->default_device_list; } else { *dev_list_str = (char *)gs_dev_defaults; } *list_str_len = strlen(*dev_list_str); return 0; }
C
ghostscript
0
CVE-2011-2795
https://www.cvedetails.com/cve/CVE-2011-2795/
CWE-264
https://github.com/chromium/chromium/commit/73edae623529f04c668268de49d00324b96166a2
73edae623529f04c668268de49d00324b96166a2
There are too many poorly named functions to create a fragment from markup https://bugs.webkit.org/show_bug.cgi?id=87339 Reviewed by Eric Seidel. Source/WebCore: Moved all functions that create a fragment from markup to markup.h/cpp. There should be no behavioral change. * dom/Range.cpp: (WebCore::Range::createContextualFragment): * dom/Range.h: Removed createDocumentFragmentForElement. * dom/ShadowRoot.cpp: (WebCore::ShadowRoot::setInnerHTML): * editing/markup.cpp: (WebCore::createFragmentFromMarkup): (WebCore::createFragmentForInnerOuterHTML): Renamed from createFragmentFromSource. (WebCore::createFragmentForTransformToFragment): Moved from XSLTProcessor. (WebCore::removeElementPreservingChildren): Moved from Range. (WebCore::createContextualFragment): Ditto. * editing/markup.h: * html/HTMLElement.cpp: (WebCore::HTMLElement::setInnerHTML): (WebCore::HTMLElement::setOuterHTML): (WebCore::HTMLElement::insertAdjacentHTML): * inspector/DOMPatchSupport.cpp: (WebCore::DOMPatchSupport::patchNode): Added a FIXME since this code should be using one of the functions listed in markup.h * xml/XSLTProcessor.cpp: (WebCore::XSLTProcessor::transformToFragment): Source/WebKit/qt: Replace calls to Range::createDocumentFragmentForElement by calls to createContextualDocumentFragment. * Api/qwebelement.cpp: (QWebElement::appendInside): (QWebElement::prependInside): (QWebElement::prependOutside): (QWebElement::appendOutside): (QWebElement::encloseContentsWith): (QWebElement::encloseWith): git-svn-id: svn://svn.chromium.org/blink/trunk@118414 bbb929c8-8fbe-4397-9dbb-9b2b20218538
String createFullMarkup(const Node* node) { if (!node) return String(); Document* document = node->document(); if (!document) return String(); Frame* frame = document->frame(); if (!frame) return String(); String markupString = createMarkup(node, IncludeNode, 0); Node::NodeType nodeType = node->nodeType(); if (nodeType != Node::DOCUMENT_NODE && nodeType != Node::DOCUMENT_TYPE_NODE) markupString = frame->documentTypeString() + markupString; return markupString; }
String createFullMarkup(const Node* node) { if (!node) return String(); Document* document = node->document(); if (!document) return String(); Frame* frame = document->frame(); if (!frame) return String(); String markupString = createMarkup(node, IncludeNode, 0); Node::NodeType nodeType = node->nodeType(); if (nodeType != Node::DOCUMENT_NODE && nodeType != Node::DOCUMENT_TYPE_NODE) markupString = frame->documentTypeString() + markupString; return markupString; }
C
Chrome
0
CVE-2018-12232
https://www.cvedetails.com/cve/CVE-2018-12232/
CWE-362
https://github.com/torvalds/linux/commit/6d8c50dcb029872b298eea68cc6209c866fd3e14
6d8c50dcb029872b298eea68cc6209c866fd3e14
socket: close race condition between sock_close() and sockfs_setattr() fchownat() doesn't even hold refcnt of fd until it figures out fd is really needed (otherwise is ignored) and releases it after it resolves the path. This means sock_close() could race with sockfs_setattr(), which leads to a NULL pointer dereference since typically we set sock->sk to NULL in ->release(). As pointed out by Al, this is unique to sockfs. So we can fix this in socket layer by acquiring inode_lock in sock_close() and checking against NULL in sockfs_setattr(). sock_release() is called in many places, only the sock_close() path matters here. And fortunately, this should not affect normal sock_close() as it is only called when the last fd refcnt is gone. It only affects sock_close() with a parallel sockfs_setattr() in progress, which is not common. Fixes: 86741ec25462 ("net: core: Add a UID field to struct sock.") Reported-by: shankarapailoor <shankarapailoor@gmail.com> Cc: Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp> Cc: Lorenzo Colitti <lorenzo@google.com> Cc: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
SYSCALL_DEFINE6(recvfrom, int, fd, void __user *, ubuf, size_t, size, unsigned int, flags, struct sockaddr __user *, addr, int __user *, addr_len) { return __sys_recvfrom(fd, ubuf, size, flags, addr, addr_len); }
SYSCALL_DEFINE6(recvfrom, int, fd, void __user *, ubuf, size_t, size, unsigned int, flags, struct sockaddr __user *, addr, int __user *, addr_len) { return __sys_recvfrom(fd, ubuf, size, flags, addr, addr_len); }
C
linux
0
CVE-2014-8109
https://www.cvedetails.com/cve/CVE-2014-8109/
CWE-264
https://github.com/apache/httpd/commit/3f1693d558d0758f829c8b53993f1749ddf6ffcb
3f1693d558d0758f829c8b53993f1749ddf6ffcb
Merge r1642499 from trunk: *) SECURITY: CVE-2014-8109 (cve.mitre.org) mod_lua: Fix handling of the Require line when a LuaAuthzProvider is used in multiple Require directives with different arguments. PR57204 [Edward Lu <Chaosed0 gmail.com>] Submitted By: Edward Lu Committed By: covener Submitted by: covener Reviewed/backported by: jim git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1642861 13f79535-47bb-0310-9956-ffa450edef68
static const char *scope_to_string(unsigned int scope) { switch (scope) { case AP_LUA_SCOPE_ONCE: case AP_LUA_SCOPE_UNSET: return "once"; case AP_LUA_SCOPE_REQUEST: return "request"; case AP_LUA_SCOPE_CONN: return "conn"; #if APR_HAS_THREADS case AP_LUA_SCOPE_THREAD: return "thread"; case AP_LUA_SCOPE_SERVER: return "server"; #endif default: ap_assert(0); return 0; } }
static const char *scope_to_string(unsigned int scope) { switch (scope) { case AP_LUA_SCOPE_ONCE: case AP_LUA_SCOPE_UNSET: return "once"; case AP_LUA_SCOPE_REQUEST: return "request"; case AP_LUA_SCOPE_CONN: return "conn"; #if APR_HAS_THREADS case AP_LUA_SCOPE_THREAD: return "thread"; case AP_LUA_SCOPE_SERVER: return "server"; #endif default: ap_assert(0); return 0; } }
C
httpd
0
CVE-2012-2820
https://www.cvedetails.com/cve/CVE-2012-2820/
CWE-20
https://github.com/chromium/chromium/commit/dbcfe72cb16222c9f7e7907fcc5f35b27cc25331
dbcfe72cb16222c9f7e7907fcc5f35b27cc25331
Removing dead code from NetworkActionPredictor. BUG=none Review URL: http://codereview.chromium.org/9358062 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@121926 0039d316-1c4b-4281-b951-d872f2087c98
void NetworkActionPredictor::BeginTransaction() { if (!initialized_) return; content::BrowserThread::PostTask(content::BrowserThread::DB, FROM_HERE, base::Bind(&NetworkActionPredictorDatabase::BeginTransaction, db_)); }
void NetworkActionPredictor::BeginTransaction() { if (!initialized_) return; content::BrowserThread::PostTask(content::BrowserThread::DB, FROM_HERE, base::Bind(&NetworkActionPredictorDatabase::BeginTransaction, db_)); }
C
Chrome
0
CVE-2019-11470
https://www.cvedetails.com/cve/CVE-2019-11470/
CWE-400
https://github.com/ImageMagick/ImageMagick/commit/e3cdce6fe12193f235b8c0ae5efe6880a25eb957
e3cdce6fe12193f235b8c0ae5efe6880a25eb957
https://github.com/ImageMagick/ImageMagick/issues/1472
ModuleExport size_t RegisterCINImage(void) { MagickInfo *entry; entry=AcquireMagickInfo("CIN","CIN","Cineon Image File"); entry->decoder=(DecodeImageHandler *) ReadCINImage; entry->encoder=(EncodeImageHandler *) WriteCINImage; entry->magick=(IsImageFormatHandler *) IsCIN; entry->flags|=CoderDecoderSeekableStreamFlag; entry->flags^=CoderAdjoinFlag; (void) RegisterMagickInfo(entry); return(MagickImageCoderSignature); }
ModuleExport size_t RegisterCINImage(void) { MagickInfo *entry; entry=AcquireMagickInfo("CIN","CIN","Cineon Image File"); entry->decoder=(DecodeImageHandler *) ReadCINImage; entry->encoder=(EncodeImageHandler *) WriteCINImage; entry->magick=(IsImageFormatHandler *) IsCIN; entry->flags|=CoderDecoderSeekableStreamFlag; entry->flags^=CoderAdjoinFlag; (void) RegisterMagickInfo(entry); return(MagickImageCoderSignature); }
C
ImageMagick
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::SaveTabContents( Browser* browser, DictionaryValue* args, IPC::Message* reply_message) { int tab_index = 0; FilePath::StringType filename; FilePath::StringType parent_directory; WebContents* web_contents = NULL; if (!args->GetInteger("tab_index", &tab_index) || !args->GetString("filename", &filename)) { AutomationJSONReply(this, reply_message) .SendError("tab_index or filename param missing"); return; } else { web_contents = browser->GetWebContentsAt(tab_index); if (!web_contents) { AutomationJSONReply(this, reply_message).SendError("no tab at tab_index"); return; } } parent_directory = FilePath(filename).DirName().value(); if (!web_contents->SavePage( FilePath(filename), FilePath(parent_directory), SavePackage::SAVE_AS_ONLY_HTML)) { AutomationJSONReply(this, reply_message).SendError( "Could not initiate SavePage"); return; } new SavePackageNotificationObserver( DownloadServiceFactory::GetForProfile( browser->profile())->GetDownloadManager(), this, reply_message); }
void TestingAutomationProvider::SaveTabContents( Browser* browser, DictionaryValue* args, IPC::Message* reply_message) { int tab_index = 0; FilePath::StringType filename; FilePath::StringType parent_directory; WebContents* web_contents = NULL; if (!args->GetInteger("tab_index", &tab_index) || !args->GetString("filename", &filename)) { AutomationJSONReply(this, reply_message) .SendError("tab_index or filename param missing"); return; } else { web_contents = browser->GetWebContentsAt(tab_index); if (!web_contents) { AutomationJSONReply(this, reply_message).SendError("no tab at tab_index"); return; } } parent_directory = FilePath(filename).DirName().value(); if (!web_contents->SavePage( FilePath(filename), FilePath(parent_directory), SavePackage::SAVE_AS_ONLY_HTML)) { AutomationJSONReply(this, reply_message).SendError( "Could not initiate SavePage"); return; } new SavePackageNotificationObserver( DownloadServiceFactory::GetForProfile( browser->profile())->GetDownloadManager(), this, reply_message); }
C
Chrome
0
CVE-2019-5747
https://www.cvedetails.com/cve/CVE-2019-5747/
CWE-125
https://git.busybox.net/busybox/commit/?id=74d9f1ba37010face4bd1449df4d60dd84450b06
74d9f1ba37010face4bd1449df4d60dd84450b06
null
static NOINLINE int send_renew(uint32_t xid, uint32_t server, uint32_t ciaddr) { struct dhcp_packet packet; struct in_addr temp_addr; /* * RFC 2131 4.3.2 DHCPREQUEST message * ... * DHCPREQUEST generated during RENEWING state: * * 'server identifier' MUST NOT be filled in, 'requested IP address' * option MUST NOT be filled in, 'ciaddr' MUST be filled in with * client's IP address. In this situation, the client is completely * configured, and is trying to extend its lease. This message will * be unicast, so no relay agents will be involved in its * transmission. Because 'giaddr' is therefore not filled in, the * DHCP server will trust the value in 'ciaddr', and use it when * replying to the client. */ /* Fill in: op, htype, hlen, cookie, chaddr fields, * random xid field (we override it below), * client-id option (unless -C), message type option: */ init_packet(&packet, DHCPREQUEST); packet.xid = xid; packet.ciaddr = ciaddr; /* Add options: maxsize, * optionally: hostname, fqdn, vendorclass, * "param req" option according to -O, and options specified with -x */ add_client_options(&packet); temp_addr.s_addr = server; bb_error_msg("sending renew to %s", inet_ntoa(temp_addr)); return bcast_or_ucast(&packet, ciaddr, server); }
static NOINLINE int send_renew(uint32_t xid, uint32_t server, uint32_t ciaddr) { struct dhcp_packet packet; struct in_addr temp_addr; /* * RFC 2131 4.3.2 DHCPREQUEST message * ... * DHCPREQUEST generated during RENEWING state: * * 'server identifier' MUST NOT be filled in, 'requested IP address' * option MUST NOT be filled in, 'ciaddr' MUST be filled in with * client's IP address. In this situation, the client is completely * configured, and is trying to extend its lease. This message will * be unicast, so no relay agents will be involved in its * transmission. Because 'giaddr' is therefore not filled in, the * DHCP server will trust the value in 'ciaddr', and use it when * replying to the client. */ /* Fill in: op, htype, hlen, cookie, chaddr fields, * random xid field (we override it below), * client-id option (unless -C), message type option: */ init_packet(&packet, DHCPREQUEST); packet.xid = xid; packet.ciaddr = ciaddr; /* Add options: maxsize, * optionally: hostname, fqdn, vendorclass, * "param req" option according to -O, and options specified with -x */ add_client_options(&packet); temp_addr.s_addr = server; bb_error_msg("sending renew to %s", inet_ntoa(temp_addr)); return bcast_or_ucast(&packet, ciaddr, server); }
C
busybox
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 R=jochen@chromium.org Review URL: https://codereview.chromium.org/196343011 git-svn-id: svn://svn.chromium.org/blink/trunk@169176 bbb929c8-8fbe-4397-9dbb-9b2b20218538
static void testInterfacePythonAttributeAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) { TestObjectPython* imp = V8TestObjectPython::toNative(info.Holder()); V8TRYCATCH_VOID(TestInterfacePythonImplementation*, cppValue, V8TestInterfacePython::toNativeWithTypeCheck(info.GetIsolate(), jsValue)); imp->setTestInterfacePythonAttribute(WTF::getPtr(cppValue)); }
static void testInterfacePythonAttributeAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) { TestObjectPython* imp = V8TestObjectPython::toNative(info.Holder()); V8TRYCATCH_VOID(TestInterfacePythonImplementation*, cppValue, V8TestInterfacePython::toNativeWithTypeCheck(info.GetIsolate(), jsValue)); imp->setTestInterfacePythonAttribute(WTF::getPtr(cppValue)); }
C
Chrome
0
null
null
null
https://github.com/chromium/chromium/commit/e3de7fc7dbb642ed034afa1c1fed70a748a60f35
e3de7fc7dbb642ed034afa1c1fed70a748a60f35
Add missing null-check in OverscrollControllerAndroid::Animate() Without it, there's a crash when running with disable-overscroll-edge-effect switch. BUG=501472 Review URL: https://codereview.chromium.org/1195453003 Cr-Commit-Position: refs/heads/master@{#334897}
void OverscrollControllerAndroid::OnGestureEventAck( const blink::WebGestureEvent& event, InputEventAckState ack_result) { if (!enabled_) return; if (event.type == blink::WebInputEvent::GestureScrollEnd || event.type == blink::WebInputEvent::GestureFlingStart) { OnOverscrolled(DidOverscrollParams()); } if (event.type == blink::WebInputEvent::GestureScrollUpdate && refresh_effect_) { bool consumed = ack_result == INPUT_EVENT_ACK_STATE_CONSUMED || event.data.scrollUpdate.previousUpdateInSequencePrevented; refresh_effect_->OnScrollUpdateAck(consumed); } }
void OverscrollControllerAndroid::OnGestureEventAck( const blink::WebGestureEvent& event, InputEventAckState ack_result) { if (!enabled_) return; if (event.type == blink::WebInputEvent::GestureScrollEnd || event.type == blink::WebInputEvent::GestureFlingStart) { OnOverscrolled(DidOverscrollParams()); } if (event.type == blink::WebInputEvent::GestureScrollUpdate && refresh_effect_) { bool consumed = ack_result == INPUT_EVENT_ACK_STATE_CONSUMED || event.data.scrollUpdate.previousUpdateInSequencePrevented; refresh_effect_->OnScrollUpdateAck(consumed); } }
C
Chrome
0
CVE-2013-1929
https://www.cvedetails.com/cve/CVE-2013-1929/
CWE-119
https://github.com/torvalds/linux/commit/715230a44310a8cf66fbfb5a46f9a62a9b2de424
715230a44310a8cf66fbfb5a46f9a62a9b2de424
tg3: fix length overflow in VPD firmware parsing Commit 184b89044fb6e2a74611dafa69b1dce0d98612c6 ("tg3: Use VPD fw version when present") introduced VPD parsing that contained a potential length overflow. Limit the hardware's reported firmware string length (max 255 bytes) to stay inside the driver's firmware string length (32 bytes). On overflow, truncate the formatted firmware string instead of potentially overwriting portions of the tg3 struct. http://cansecwest.com/slides/2013/PrivateCore%20CSW%202013.pdf Signed-off-by: Kees Cook <keescook@chromium.org> Reported-by: Oded Horovitz <oded@privatecore.com> Reported-by: Brad Spengler <spender@grsecurity.net> Cc: stable@vger.kernel.org Cc: Matt Carlson <mcarlson@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
static int tg3_5700_link_polarity(struct tg3 *tp, u32 speed) { if (tp->led_ctrl == LED_CTRL_MODE_PHY_2) return 1; else if ((tp->phy_id & TG3_PHY_ID_MASK) == TG3_PHY_ID_BCM5411) { if (speed != SPEED_10) return 1; } else if (speed == SPEED_10) return 1; return 0; }
static int tg3_5700_link_polarity(struct tg3 *tp, u32 speed) { if (tp->led_ctrl == LED_CTRL_MODE_PHY_2) return 1; else if ((tp->phy_id & TG3_PHY_ID_MASK) == TG3_PHY_ID_BCM5411) { if (speed != SPEED_10) return 1; } else if (speed == SPEED_10) return 1; return 0; }
C
linux
0
CVE-2017-5019
https://www.cvedetails.com/cve/CVE-2017-5019/
CWE-416
https://github.com/chromium/chromium/commit/f03ea5a5c2ff26e239dfd23e263b15da2d9cee93
f03ea5a5c2ff26e239dfd23e263b15da2d9cee93
Convert FrameHostMsg_DidAddMessageToConsole to Mojo. Note: Since this required changing the test RenderViewImplTest.DispatchBeforeUnloadCanDetachFrame, I manually re-introduced https://crbug.com/666714 locally (the bug the test was added for), and reran the test to confirm that it still covers the bug. Bug: 786836 Change-Id: I110668fa6f0f261fd2ac36bb91a8d8b31c99f4f1 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1526270 Commit-Queue: Lowell Manners <lowell@chromium.org> Reviewed-by: Daniel Cheng <dcheng@chromium.org> Reviewed-by: Camille Lamy <clamy@chromium.org> Cr-Commit-Position: refs/heads/master@{#653137}
WebBluetoothServiceImpl* RenderFrameHostImpl::CreateWebBluetoothService( blink::mojom::WebBluetoothServiceRequest request) { auto web_bluetooth_service = std::make_unique<WebBluetoothServiceImpl>(this, std::move(request)); web_bluetooth_service->SetClientConnectionErrorHandler( base::BindOnce(&RenderFrameHostImpl::DeleteWebBluetoothService, base::Unretained(this), web_bluetooth_service.get())); web_bluetooth_services_.push_back(std::move(web_bluetooth_service)); return web_bluetooth_services_.back().get(); }
WebBluetoothServiceImpl* RenderFrameHostImpl::CreateWebBluetoothService( blink::mojom::WebBluetoothServiceRequest request) { auto web_bluetooth_service = std::make_unique<WebBluetoothServiceImpl>(this, std::move(request)); web_bluetooth_service->SetClientConnectionErrorHandler( base::BindOnce(&RenderFrameHostImpl::DeleteWebBluetoothService, base::Unretained(this), web_bluetooth_service.get())); web_bluetooth_services_.push_back(std::move(web_bluetooth_service)); return web_bluetooth_services_.back().get(); }
C
Chrome
0
null
null
null
https://github.com/chromium/chromium/commit/1797c8188e7d42f0adf6ce0e607307cd313e1d7d
1797c8188e7d42f0adf6ce0e607307cd313e1d7d
Set the original URL for downloads https://bugs.webkit.org/show_bug.cgi?id=49628 Reviewed by John Sullivan. WebCore: Export symbols needed by WebKit2. * WebCore.exp.in: WebKit2: * WebProcess/Downloads/DownloadManager.cpp: (WebKit::DownloadManager::startDownload): * WebProcess/Downloads/DownloadManager.h: startDownload now takes the originating web page. * WebProcess/Downloads/cf/DownloadCFNet.cpp: (WebKit::Download::start): start now takes the originating web page. * WebProcess/Downloads/mac/DownloadMac.mm: (WebKit::originatingURL): (WebKit::setOriginalURLForDownload): Port code over from WebKit1 that sets the download URL. (WebKit::Download::start): Call setOriginalURLForDownload. * WebProcess/Downloads/qt/DownloadQt.cpp: (WebKit::Download::start): start now takes the originating web page. * WebProcess/WebPage/WebFrame.cpp: (WebKit::WebFrame::startDownload): Pass the web page to DownloadManager::startDownload. git-svn-id: svn://svn.chromium.org/blink/trunk@72145 bbb929c8-8fbe-4397-9dbb-9b2b20218538
void WebFrame::suspendAnimations() { if (!m_coreFrame) return; AnimationController* controller = m_coreFrame->animation(); if (!controller) return; controller->suspendAnimations(); }
void WebFrame::suspendAnimations() { if (!m_coreFrame) return; AnimationController* controller = m_coreFrame->animation(); if (!controller) return; controller->suspendAnimations(); }
C
Chrome
0
CVE-2012-5148
https://www.cvedetails.com/cve/CVE-2012-5148/
CWE-20
https://github.com/chromium/chromium/commit/e89cfcb9090e8c98129ae9160c513f504db74599
e89cfcb9090e8c98129ae9160c513f504db74599
Remove TabContents from TabStripModelObserver::TabDetachedAt. BUG=107201 TEST=no visible change Review URL: https://chromiumcodereview.appspot.com/11293205 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@167122 0039d316-1c4b-4281-b951-d872f2087c98
void TabStripGtk::TabReplacedAt(TabStripModel* tab_strip_model, TabContents* old_contents, TabContents* new_contents, int index) { TabChangedAt(new_contents, index, ALL); }
void TabStripGtk::TabReplacedAt(TabStripModel* tab_strip_model, TabContents* old_contents, TabContents* new_contents, int index) { TabChangedAt(new_contents, index, ALL); }
C
Chrome
0
CVE-2012-2870
https://www.cvedetails.com/cve/CVE-2012-2870/
CWE-399
https://github.com/chromium/chromium/commit/9939d35f9827ed0929646607cbdb071af627ac38
9939d35f9827ed0929646607cbdb071af627ac38
Handle a bad XSLT expression better. BUG=138672 Review URL: https://chromiumcodereview.appspot.com/10830177 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@150123 0039d316-1c4b-4281-b951-d872f2087c98
xsltCompileRelativePathPattern(xsltParserContextPtr ctxt, xmlChar *token, int novar) { xsltCompileStepPattern(ctxt, token, novar); if (ctxt->error) goto error; SKIP_BLANKS; while ((CUR != 0) && (CUR != '|')) { if ((CUR == '/') && (NXT(1) == '/')) { PUSH(XSLT_OP_ANCESTOR, NULL, NULL, novar); NEXT; NEXT; SKIP_BLANKS; xsltCompileStepPattern(ctxt, NULL, novar); } else if (CUR == '/') { PUSH(XSLT_OP_PARENT, NULL, NULL, novar); NEXT; SKIP_BLANKS; if ((CUR != 0) && (CUR != '|')) { xsltCompileRelativePathPattern(ctxt, NULL, novar); } } else { ctxt->error = 1; } if (ctxt->error) goto error; SKIP_BLANKS; } error: return; }
xsltCompileRelativePathPattern(xsltParserContextPtr ctxt, xmlChar *token, int novar) { xsltCompileStepPattern(ctxt, token, novar); if (ctxt->error) goto error; SKIP_BLANKS; while ((CUR != 0) && (CUR != '|')) { if ((CUR == '/') && (NXT(1) == '/')) { PUSH(XSLT_OP_ANCESTOR, NULL, NULL, novar); NEXT; NEXT; SKIP_BLANKS; xsltCompileStepPattern(ctxt, NULL, novar); } else if (CUR == '/') { PUSH(XSLT_OP_PARENT, NULL, NULL, novar); NEXT; SKIP_BLANKS; if ((CUR != 0) && (CUR != '|')) { xsltCompileRelativePathPattern(ctxt, NULL, novar); } } else { ctxt->error = 1; } if (ctxt->error) goto error; SKIP_BLANKS; } error: return; }
C
Chrome
0
CVE-2019-11922
https://www.cvedetails.com/cve/CVE-2019-11922/
CWE-362
https://github.com/facebook/zstd/pull/1404/commits/3e5cdf1b6a85843e991d7d10f6a2567c15580da0
3e5cdf1b6a85843e991d7d10f6a2567c15580da0
fixed T36302429
size_t ZSTD_initCStream_usingCDict_advanced(ZSTD_CStream* zcs, const ZSTD_CDict* cdict, ZSTD_frameParameters fParams, unsigned long long pledgedSrcSize) { DEBUGLOG(4, "ZSTD_initCStream_usingCDict_advanced"); if (!cdict) return ERROR(dictionary_wrong); /* cannot handle NULL cdict (does not know what to do) */ { ZSTD_CCtx_params params = zcs->requestedParams; params.cParams = ZSTD_getCParamsFromCDict(cdict); params.fParams = fParams; return ZSTD_initCStream_internal(zcs, NULL, 0, cdict, params, pledgedSrcSize); } }
size_t ZSTD_initCStream_usingCDict_advanced(ZSTD_CStream* zcs, const ZSTD_CDict* cdict, ZSTD_frameParameters fParams, unsigned long long pledgedSrcSize) { DEBUGLOG(4, "ZSTD_initCStream_usingCDict_advanced"); if (!cdict) return ERROR(dictionary_wrong); /* cannot handle NULL cdict (does not know what to do) */ { ZSTD_CCtx_params params = zcs->requestedParams; params.cParams = ZSTD_getCParamsFromCDict(cdict); params.fParams = fParams; return ZSTD_initCStream_internal(zcs, NULL, 0, cdict, params, pledgedSrcSize); } }
C
zstd
0
CVE-2013-4248
https://www.cvedetails.com/cve/CVE-2013-4248/
CWE-20
https://git.php.net/?p=php-src.git;a=commit;h=2874696a5a8d46639d261571f915c493cd875897
2874696a5a8d46639d261571f915c493cd875897
null
static time_t asn1_time_to_time_t(ASN1_UTCTIME * timestr TSRMLS_DC) /* {{{ */ { /* This is how the time string is formatted: snprintf(p, sizeof(p), "%02d%02d%02d%02d%02d%02dZ",ts->tm_year%100, ts->tm_mon+1,ts->tm_mday,ts->tm_hour,ts->tm_min,ts->tm_sec); */ time_t ret; struct tm thetime; char * strbuf; char * thestr; long gmadjust = 0; if (timestr->length < 13) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "extension author too lazy to parse %s correctly", timestr->data); return (time_t)-1; } strbuf = estrdup((char *)timestr->data); memset(&thetime, 0, sizeof(thetime)); /* we work backwards so that we can use atoi more easily */ thestr = strbuf + timestr->length - 3; thetime.tm_sec = atoi(thestr); *thestr = '\0'; thestr -= 2; thetime.tm_min = atoi(thestr); *thestr = '\0'; thestr -= 2; thetime.tm_hour = atoi(thestr); *thestr = '\0'; thestr -= 2; thetime.tm_mday = atoi(thestr); *thestr = '\0'; thestr -= 2; thetime.tm_mon = atoi(thestr)-1; *thestr = '\0'; thestr -= 2; thetime.tm_year = atoi(thestr); if (thetime.tm_year < 68) { thetime.tm_year += 100; } thetime.tm_isdst = -1; ret = mktime(&thetime); #if HAVE_TM_GMTOFF gmadjust = thetime.tm_gmtoff; #else /* ** If correcting for daylight savings time, we set the adjustment to ** the value of timezone - 3600 seconds. Otherwise, we need to overcorrect and ** set the adjustment to the main timezone + 3600 seconds. */ gmadjust = -(thetime.tm_isdst ? (long)timezone - 3600 : (long)timezone + 3600); #endif ret += gmadjust; efree(strbuf); return ret; } /* }}} */
static time_t asn1_time_to_time_t(ASN1_UTCTIME * timestr TSRMLS_DC) /* {{{ */ { /* This is how the time string is formatted: snprintf(p, sizeof(p), "%02d%02d%02d%02d%02d%02dZ",ts->tm_year%100, ts->tm_mon+1,ts->tm_mday,ts->tm_hour,ts->tm_min,ts->tm_sec); */ time_t ret; struct tm thetime; char * strbuf; char * thestr; long gmadjust = 0; if (timestr->length < 13) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "extension author too lazy to parse %s correctly", timestr->data); return (time_t)-1; } strbuf = estrdup((char *)timestr->data); memset(&thetime, 0, sizeof(thetime)); /* we work backwards so that we can use atoi more easily */ thestr = strbuf + timestr->length - 3; thetime.tm_sec = atoi(thestr); *thestr = '\0'; thestr -= 2; thetime.tm_min = atoi(thestr); *thestr = '\0'; thestr -= 2; thetime.tm_hour = atoi(thestr); *thestr = '\0'; thestr -= 2; thetime.tm_mday = atoi(thestr); *thestr = '\0'; thestr -= 2; thetime.tm_mon = atoi(thestr)-1; *thestr = '\0'; thestr -= 2; thetime.tm_year = atoi(thestr); if (thetime.tm_year < 68) { thetime.tm_year += 100; } thetime.tm_isdst = -1; ret = mktime(&thetime); #if HAVE_TM_GMTOFF gmadjust = thetime.tm_gmtoff; #else /* ** If correcting for daylight savings time, we set the adjustment to ** the value of timezone - 3600 seconds. Otherwise, we need to overcorrect and ** set the adjustment to the main timezone + 3600 seconds. */ gmadjust = -(thetime.tm_isdst ? (long)timezone - 3600 : (long)timezone + 3600); #endif ret += gmadjust; efree(strbuf); return ret; } /* }}} */
C
php
0
CVE-2011-2351
https://www.cvedetails.com/cve/CVE-2011-2351/
CWE-399
https://github.com/chromium/chromium/commit/bf381d8a02c3d272d4dd879ac719d8993dfb5ad6
bf381d8a02c3d272d4dd879ac719d8993dfb5ad6
Enable HistoryModelWorker by default, now that bug 69561 is fixed. BUG=69561 TEST=Run sync manually and run integration tests, sync should not crash. Review URL: http://codereview.chromium.org/7016007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@85211 0039d316-1c4b-4281-b951-d872f2087c98
PendingConfigureDataTypesState() : deleted_type(false), reason(sync_api::CONFIGURE_REASON_UNKNOWN) {}
PendingConfigureDataTypesState() : deleted_type(false), reason(sync_api::CONFIGURE_REASON_UNKNOWN) {}
C
Chrome
0
CVE-2017-8849
https://www.cvedetails.com/cve/CVE-2017-8849/
CWE-20
https://cgit.kde.org/smb4k.git/commit/?id=a90289b0962663bc1d247bbbd31b9e65b2ca000e
a90289b0962663bc1d247bbbd31b9e65b2ca000e
null
Smb4KShare* Smb4KGlobal::findShareByPath(const QString &path) { Smb4KShare *share = 0; mutex.lock(); if (!path.isEmpty() && !p->mountedSharesList.isEmpty()) { for (Smb4KShare *s : p->mountedSharesList) { if (QString::compare(s->path(), path, Qt::CaseInsensitive) == 0 || QString::compare(s->canonicalPath(), path, Qt::CaseInsensitive) == 0) { share = s; break; } else { } } } else { } mutex.unlock(); return share; }
Smb4KShare* Smb4KGlobal::findShareByPath(const QString &path) { Smb4KShare *share = 0; mutex.lock(); if (!path.isEmpty() && !p->mountedSharesList.isEmpty()) { for (Smb4KShare *s : p->mountedSharesList) { if (QString::compare(s->path(), path, Qt::CaseInsensitive) == 0 || QString::compare(s->canonicalPath(), path, Qt::CaseInsensitive) == 0) { share = s; break; } else { } } } else { } mutex.unlock(); return share; }
CPP
kde
0
CVE-2017-5118
https://www.cvedetails.com/cve/CVE-2017-5118/
CWE-732
https://github.com/chromium/chromium/commit/0ab2412a104d2f235d7b9fe19d30ef605a410832
0ab2412a104d2f235d7b9fe19d30ef605a410832
Inherit CSP when we inherit the security origin This prevents attacks that use main window navigation to get out of the existing csp constraints such as the related bug Bug: 747847 Change-Id: I1e57b50da17f65d38088205b0a3c7c49ef2ae4d8 Reviewed-on: https://chromium-review.googlesource.com/592027 Reviewed-by: Mike West <mkwst@chromium.org> Commit-Queue: Andy Paicu <andypaicu@chromium.org> Cr-Commit-Position: refs/heads/master@{#492333}
bool Document::IsSecureTransitionTo(const KURL& url) const { RefPtr<SecurityOrigin> other = SecurityOrigin::Create(url); return GetSecurityOrigin()->CanAccess(other.Get()); }
bool Document::IsSecureTransitionTo(const KURL& url) const { RefPtr<SecurityOrigin> other = SecurityOrigin::Create(url); return GetSecurityOrigin()->CanAccess(other.Get()); }
C
Chrome
0
CVE-2011-1019
https://www.cvedetails.com/cve/CVE-2011-1019/
CWE-264
https://github.com/torvalds/linux/commit/8909c9ad8ff03611c9c96c9a92656213e4bb495b
8909c9ad8ff03611c9c96c9a92656213e4bb495b
net: don't allow CAP_NET_ADMIN to load non-netdev kernel modules Since a8f80e8ff94ecba629542d9b4b5f5a8ee3eb565c any process with CAP_NET_ADMIN may load any module from /lib/modules/. This doesn't mean that CAP_NET_ADMIN is a superset of CAP_SYS_MODULE as modules are limited to /lib/modules/**. However, CAP_NET_ADMIN capability shouldn't allow anybody load any module not related to networking. This patch restricts an ability of autoloading modules to netdev modules with explicit aliases. This fixes CVE-2011-1019. Arnd Bergmann suggested to leave untouched the old pre-v2.6.32 behavior of loading netdev modules by name (without any prefix) for processes with CAP_SYS_MODULE to maintain the compatibility with network scripts that use autoloading netdev modules by aliases like "eth0", "wlan0". Currently there are only three users of the feature in the upstream kernel: ipip, ip_gre and sit. root@albatros:~# capsh --drop=$(seq -s, 0 11),$(seq -s, 13 34) -- root@albatros:~# grep Cap /proc/$$/status CapInh: 0000000000000000 CapPrm: fffffff800001000 CapEff: fffffff800001000 CapBnd: fffffff800001000 root@albatros:~# modprobe xfs FATAL: Error inserting xfs (/lib/modules/2.6.38-rc6-00001-g2bf4ca3/kernel/fs/xfs/xfs.ko): Operation not permitted root@albatros:~# lsmod | grep xfs root@albatros:~# ifconfig xfs xfs: error fetching interface information: Device not found root@albatros:~# lsmod | grep xfs root@albatros:~# lsmod | grep sit root@albatros:~# ifconfig sit sit: error fetching interface information: Device not found root@albatros:~# lsmod | grep sit root@albatros:~# ifconfig sit0 sit0 Link encap:IPv6-in-IPv4 NOARP MTU:1480 Metric:1 root@albatros:~# lsmod | grep sit sit 10457 0 tunnel4 2957 1 sit For CAP_SYS_MODULE module loading is still relaxed: root@albatros:~# grep Cap /proc/$$/status CapInh: 0000000000000000 CapPrm: ffffffffffffffff CapEff: ffffffffffffffff CapBnd: ffffffffffffffff root@albatros:~# ifconfig xfs xfs: error fetching interface information: Device not found root@albatros:~# lsmod | grep xfs xfs 745319 0 Reference: https://lkml.org/lkml/2011/2/24/203 Signed-off-by: Vasiliy Kulikov <segoon@openwall.com> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru> Acked-by: David S. Miller <davem@davemloft.net> Acked-by: Kees Cook <kees.cook@canonical.com> Signed-off-by: James Morris <jmorris@namei.org>
int netif_receive_skb(struct sk_buff *skb) { if (netdev_tstamp_prequeue) net_timestamp_check(skb); if (skb_defer_rx_timestamp(skb)) return NET_RX_SUCCESS; #ifdef CONFIG_RPS { struct rps_dev_flow voidflow, *rflow = &voidflow; int cpu, ret; rcu_read_lock(); cpu = get_rps_cpu(skb->dev, skb, &rflow); if (cpu >= 0) { ret = enqueue_to_backlog(skb, cpu, &rflow->last_qtail); rcu_read_unlock(); } else { rcu_read_unlock(); ret = __netif_receive_skb(skb); } return ret; } #else return __netif_receive_skb(skb); #endif }
int netif_receive_skb(struct sk_buff *skb) { if (netdev_tstamp_prequeue) net_timestamp_check(skb); if (skb_defer_rx_timestamp(skb)) return NET_RX_SUCCESS; #ifdef CONFIG_RPS { struct rps_dev_flow voidflow, *rflow = &voidflow; int cpu, ret; rcu_read_lock(); cpu = get_rps_cpu(skb->dev, skb, &rflow); if (cpu >= 0) { ret = enqueue_to_backlog(skb, cpu, &rflow->last_qtail); rcu_read_unlock(); } else { rcu_read_unlock(); ret = __netif_receive_skb(skb); } return ret; } #else return __netif_receive_skb(skb); #endif }
C
linux
0
CVE-2014-3191
https://www.cvedetails.com/cve/CVE-2014-3191/
CWE-416
https://github.com/chromium/chromium/commit/11a4cc4a6d6e665d9a118fada4b7c658d6f70d95
11a4cc4a6d6e665d9a118fada4b7c658d6f70d95
Defer call to updateWidgetPositions() outside of RenderLayerScrollableArea. updateWidgetPositions() can destroy the render tree, so it should never be called from inside RenderLayerScrollableArea. Leaving it there allows for the potential of use-after-free bugs. BUG=402407 R=vollick@chromium.org Review URL: https://codereview.chromium.org/490473003 git-svn-id: svn://svn.chromium.org/blink/trunk@180681 bbb929c8-8fbe-4397-9dbb-9b2b20218538
bool FrameView::isScrollable() { IntSize contentsSize = this->contentsSize(); IntSize visibleContentSize = visibleContentRect().size(); if ((contentsSize.height() <= visibleContentSize.height() && contentsSize.width() <= visibleContentSize.width())) return false; HTMLFrameOwnerElement* owner = m_frame->deprecatedLocalOwner(); if (owner && (!owner->renderer() || !owner->renderer()->visibleToHitTesting())) return false; ScrollbarMode horizontalMode; ScrollbarMode verticalMode; calculateScrollbarModesForLayoutAndSetViewportRenderer(horizontalMode, verticalMode, RulesFromWebContentOnly); if (horizontalMode == ScrollbarAlwaysOff && verticalMode == ScrollbarAlwaysOff) return false; return true; }
bool FrameView::isScrollable() { IntSize contentsSize = this->contentsSize(); IntSize visibleContentSize = visibleContentRect().size(); if ((contentsSize.height() <= visibleContentSize.height() && contentsSize.width() <= visibleContentSize.width())) return false; HTMLFrameOwnerElement* owner = m_frame->deprecatedLocalOwner(); if (owner && (!owner->renderer() || !owner->renderer()->visibleToHitTesting())) return false; ScrollbarMode horizontalMode; ScrollbarMode verticalMode; calculateScrollbarModesForLayoutAndSetViewportRenderer(horizontalMode, verticalMode, RulesFromWebContentOnly); if (horizontalMode == ScrollbarAlwaysOff && verticalMode == ScrollbarAlwaysOff) return false; return true; }
C
Chrome
0
CVE-2016-3909
https://www.cvedetails.com/cve/CVE-2016-3909/
CWE-264
https://android.googlesource.com/platform/frameworks/av/+/d4271b792bdad85a80e2b83ab34c4b30b74f53ec
d4271b792bdad85a80e2b83ab34c4b30b74f53ec
SoftMPEG4: Check the buffer size before writing the reference frame. Also prevent overflow in SoftMPEG4 and division by zero in SoftMPEG4Encoder. Bug: 30033990 Change-Id: I7701f5fc54c2670587d122330e5dc851f64ed3c2 (cherry picked from commit 695123195034402ca76169b195069c28c30342d3)
android::SoftOMXComponent *createSoftOMXComponent( const char *name, const OMX_CALLBACKTYPE *callbacks, OMX_PTR appData, OMX_COMPONENTTYPE **component) { using namespace android; if (!strcmp(name, "OMX.google.h263.decoder")) { return new android::SoftMPEG4( name, "video_decoder.h263", OMX_VIDEO_CodingH263, kH263ProfileLevels, ARRAY_SIZE(kH263ProfileLevels), callbacks, appData, component); } else if (!strcmp(name, "OMX.google.mpeg4.decoder")) { return new android::SoftMPEG4( name, "video_decoder.mpeg4", OMX_VIDEO_CodingMPEG4, kM4VProfileLevels, ARRAY_SIZE(kM4VProfileLevels), callbacks, appData, component); } else { CHECK(!"Unknown component"); } return NULL; }
android::SoftOMXComponent *createSoftOMXComponent( const char *name, const OMX_CALLBACKTYPE *callbacks, OMX_PTR appData, OMX_COMPONENTTYPE **component) { using namespace android; if (!strcmp(name, "OMX.google.h263.decoder")) { return new android::SoftMPEG4( name, "video_decoder.h263", OMX_VIDEO_CodingH263, kH263ProfileLevels, ARRAY_SIZE(kH263ProfileLevels), callbacks, appData, component); } else if (!strcmp(name, "OMX.google.mpeg4.decoder")) { return new android::SoftMPEG4( name, "video_decoder.mpeg4", OMX_VIDEO_CodingMPEG4, kM4VProfileLevels, ARRAY_SIZE(kM4VProfileLevels), callbacks, appData, component); } else { CHECK(!"Unknown component"); } return NULL; }
C
Android
0
CVE-2019-17547
https://www.cvedetails.com/cve/CVE-2019-17547/
null
https://github.com/ImageMagick/ImageMagick/commit/ecf7c6b288e11e7e7f75387c5e9e93e423b98397
ecf7c6b288e11e7e7f75387c5e9e93e423b98397
...
static MagickBooleanType TraceRoundRectangle(MVGInfo *mvg_info, const PointInfo start,const PointInfo end,PointInfo arc) { PointInfo degrees, point, segment; PrimitiveInfo *primitive_info; register PrimitiveInfo *p; register ssize_t i; ssize_t offset; offset=mvg_info->offset; segment.x=fabs(end.x-start.x); segment.y=fabs(end.y-start.y); if ((segment.x < MagickEpsilon) || (segment.y < MagickEpsilon)) { (*mvg_info->primitive_info+mvg_info->offset)->coordinates=0; return(MagickTrue); } if (arc.x > (0.5*segment.x)) arc.x=0.5*segment.x; if (arc.y > (0.5*segment.y)) arc.y=0.5*segment.y; point.x=start.x+segment.x-arc.x; point.y=start.y+arc.y; degrees.x=270.0; degrees.y=360.0; if (TraceEllipse(mvg_info,point,arc,degrees) == MagickFalse) return(MagickFalse); p=(*mvg_info->primitive_info)+mvg_info->offset; mvg_info->offset+=p->coordinates; point.x=start.x+segment.x-arc.x; point.y=start.y+segment.y-arc.y; degrees.x=0.0; degrees.y=90.0; if (TraceEllipse(mvg_info,point,arc,degrees) == MagickFalse) return(MagickFalse); p=(*mvg_info->primitive_info)+mvg_info->offset; mvg_info->offset+=p->coordinates; point.x=start.x+arc.x; point.y=start.y+segment.y-arc.y; degrees.x=90.0; degrees.y=180.0; if (TraceEllipse(mvg_info,point,arc,degrees) == MagickFalse) return(MagickFalse); p=(*mvg_info->primitive_info)+mvg_info->offset; mvg_info->offset+=p->coordinates; point.x=start.x+arc.x; point.y=start.y+arc.y; degrees.x=180.0; degrees.y=270.0; if (TraceEllipse(mvg_info,point,arc,degrees) == MagickFalse) return(MagickFalse); p=(*mvg_info->primitive_info)+mvg_info->offset; mvg_info->offset+=p->coordinates; if (CheckPrimitiveExtent(mvg_info,PrimitiveExtentPad) == MagickFalse) return(MagickFalse); p=(*mvg_info->primitive_info)+mvg_info->offset; if (TracePoint(p,(*mvg_info->primitive_info+offset)->point) == MagickFalse) return(MagickFalse); p+=p->coordinates; mvg_info->offset=offset; primitive_info=(*mvg_info->primitive_info)+offset; primitive_info->coordinates=(size_t) (p-primitive_info); primitive_info->closed_subpath=MagickTrue; for (i=0; i < (ssize_t) primitive_info->coordinates; i++) { p->primitive=primitive_info->primitive; p--; } return(MagickTrue); }
static MagickBooleanType TraceRoundRectangle(MVGInfo *mvg_info, const PointInfo start,const PointInfo end,PointInfo arc) { PointInfo degrees, point, segment; PrimitiveInfo *primitive_info; register PrimitiveInfo *p; register ssize_t i; ssize_t offset; offset=mvg_info->offset; segment.x=fabs(end.x-start.x); segment.y=fabs(end.y-start.y); if ((segment.x < MagickEpsilon) || (segment.y < MagickEpsilon)) { (*mvg_info->primitive_info+mvg_info->offset)->coordinates=0; return(MagickTrue); } if (arc.x > (0.5*segment.x)) arc.x=0.5*segment.x; if (arc.y > (0.5*segment.y)) arc.y=0.5*segment.y; point.x=start.x+segment.x-arc.x; point.y=start.y+arc.y; degrees.x=270.0; degrees.y=360.0; if (TraceEllipse(mvg_info,point,arc,degrees) == MagickFalse) return(MagickFalse); p=(*mvg_info->primitive_info)+mvg_info->offset; mvg_info->offset+=p->coordinates; point.x=start.x+segment.x-arc.x; point.y=start.y+segment.y-arc.y; degrees.x=0.0; degrees.y=90.0; if (TraceEllipse(mvg_info,point,arc,degrees) == MagickFalse) return(MagickFalse); p=(*mvg_info->primitive_info)+mvg_info->offset; mvg_info->offset+=p->coordinates; point.x=start.x+arc.x; point.y=start.y+segment.y-arc.y; degrees.x=90.0; degrees.y=180.0; if (TraceEllipse(mvg_info,point,arc,degrees) == MagickFalse) return(MagickFalse); p=(*mvg_info->primitive_info)+mvg_info->offset; mvg_info->offset+=p->coordinates; point.x=start.x+arc.x; point.y=start.y+arc.y; degrees.x=180.0; degrees.y=270.0; if (TraceEllipse(mvg_info,point,arc,degrees) == MagickFalse) return(MagickFalse); p=(*mvg_info->primitive_info)+mvg_info->offset; mvg_info->offset+=p->coordinates; if (CheckPrimitiveExtent(mvg_info,PrimitiveExtentPad) == MagickFalse) return(MagickFalse); p=(*mvg_info->primitive_info)+mvg_info->offset; if (TracePoint(p,(*mvg_info->primitive_info+offset)->point) == MagickFalse) return(MagickFalse); p+=p->coordinates; mvg_info->offset=offset; primitive_info=(*mvg_info->primitive_info)+offset; primitive_info->coordinates=(size_t) (p-primitive_info); primitive_info->closed_subpath=MagickTrue; for (i=0; i < (ssize_t) primitive_info->coordinates; i++) { p->primitive=primitive_info->primitive; p--; } return(MagickTrue); }
C
ImageMagick
0
CVE-2011-3097
https://www.cvedetails.com/cve/CVE-2011-3097/
CWE-20
https://github.com/chromium/chromium/commit/027429ee5abe6e2fb5e3b2b4542f0a6fe0dbc12d
027429ee5abe6e2fb5e3b2b4542f0a6fe0dbc12d
Metrics for measuring how much overhead reading compressed content states adds. BUG=104293 TEST=NONE Review URL: https://chromiumcodereview.appspot.com/9426039 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@123733 0039d316-1c4b-4281-b951-d872f2087c98
void SessionService::UpdateTabNavigation( const SessionID& window_id, const SessionID& tab_id, int index, const NavigationEntry& entry) { if (!ShouldTrackEntry(entry.GetVirtualURL()) || !ShouldTrackChangesToWindow(window_id)) { return; } if (tab_to_available_range_.find(tab_id.id()) != tab_to_available_range_.end()) { std::pair<int, int>& range = tab_to_available_range_[tab_id.id()]; range.first = std::min(index, range.first); range.second = std::max(index, range.second); } ScheduleCommand(CreateUpdateTabNavigationCommand(kCommandUpdateTabNavigation, tab_id.id(), index, entry)); }
void SessionService::UpdateTabNavigation( const SessionID& window_id, const SessionID& tab_id, int index, const NavigationEntry& entry) { if (!ShouldTrackEntry(entry.GetVirtualURL()) || !ShouldTrackChangesToWindow(window_id)) { return; } if (tab_to_available_range_.find(tab_id.id()) != tab_to_available_range_.end()) { std::pair<int, int>& range = tab_to_available_range_[tab_id.id()]; range.first = std::min(index, range.first); range.second = std::max(index, range.second); } ScheduleCommand(CreateUpdateTabNavigationCommand(kCommandUpdateTabNavigation, tab_id.id(), index, entry)); }
C
Chrome
0
null
null
null
https://github.com/chromium/chromium/commit/9d02cda7a634fbd6e53d98091f618057f0174387
9d02cda7a634fbd6e53d98091f618057f0174387
Coverity: Fixing pass by value. CID=101462, 101458, 101437, 101471, 101467 BUG=NONE TEST=NONE Review URL: http://codereview.chromium.org/9006023 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@115257 0039d316-1c4b-4281-b951-d872f2087c98
void ExtensionHelper::OnInlineWebstoreInstallResponse( int install_id, bool success, const std::string& error) { ChromeWebstoreExtension::HandleInstallResponse(install_id, success, error); }
void ExtensionHelper::OnInlineWebstoreInstallResponse( int install_id, bool success, const std::string& error) { ChromeWebstoreExtension::HandleInstallResponse(install_id, success, error); }
C
Chrome
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 R=jochen@chromium.org Review URL: https://codereview.chromium.org/196343011 git-svn-id: svn://svn.chromium.org/blink/trunk@169176 bbb929c8-8fbe-4397-9dbb-9b2b20218538
static void voidMethodVariadicTestInterfaceEmptyArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); TestObjectPythonV8Internal::voidMethodVariadicTestInterfaceEmptyArgMethod(info); TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); }
static void voidMethodVariadicTestInterfaceEmptyArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); TestObjectPythonV8Internal::voidMethodVariadicTestInterfaceEmptyArgMethod(info); TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); }
C
Chrome
0
CVE-2014-3171
https://www.cvedetails.com/cve/CVE-2014-3171/
null
https://github.com/chromium/chromium/commit/d10a8dac48d3a9467e81c62cb45208344f4542db
d10a8dac48d3a9467e81c62cb45208344f4542db
Replace further questionable HashMap::add usages in bindings BUG=390928 R=dcarney@chromium.org Review URL: https://codereview.chromium.org/411273002 git-svn-id: svn://svn.chromium.org/blink/trunk@178823 bbb929c8-8fbe-4397-9dbb-9b2b20218538
DenseArrayState(v8::Handle<v8::Array> array, v8::Handle<v8::Array> propertyNames, StateBase* next, v8::Isolate* isolate) : AbstractObjectState(array, next) , m_arrayIndex(0) , m_arrayLength(array->Length()) { m_propertyNames = v8::Local<v8::Array>::New(isolate, propertyNames); }
DenseArrayState(v8::Handle<v8::Array> array, v8::Handle<v8::Array> propertyNames, StateBase* next, v8::Isolate* isolate) : AbstractObjectState(array, next) , m_arrayIndex(0) , m_arrayLength(array->Length()) { m_propertyNames = v8::Local<v8::Array>::New(isolate, propertyNames); }
C
Chrome
0
CVE-2012-2375
https://www.cvedetails.com/cve/CVE-2012-2375/
CWE-189
https://github.com/torvalds/linux/commit/20e0fa98b751facf9a1101edaefbc19c82616a68
20e0fa98b751facf9a1101edaefbc19c82616a68
Fix length of buffer copied in __nfs4_get_acl_uncached _copy_from_pages() used to copy data from the temporary buffer to the user passed buffer is passed the wrong size parameter when copying data. res.acl_len contains both the bitmap and acl lenghts while acl_len contains the acl length after adjusting for the bitmap size. Signed-off-by: Sachin Prabhu <sprabhu@redhat.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
static void nfs4_zap_acl_attr(struct inode *inode) { nfs4_set_cached_acl(inode, NULL); }
static void nfs4_zap_acl_attr(struct inode *inode) { nfs4_set_cached_acl(inode, NULL); }
C
linux
0
CVE-2013-4150
https://www.cvedetails.com/cve/CVE-2013-4150/
CWE-119
https://git.qemu.org/?p=qemu.git;a=commit;h=eea750a5623ddac7a61982eec8f1c93481857578
eea750a5623ddac7a61982eec8f1c93481857578
null
static void virtio_net_device_unrealize(DeviceState *dev, Error **errp) { VirtIODevice *vdev = VIRTIO_DEVICE(dev); VirtIONet *n = VIRTIO_NET(dev); int i; /* This will stop vhost backend if appropriate. */ virtio_net_set_status(vdev, 0); unregister_savevm(dev, "virtio-net", n); if (n->netclient_name) { g_free(n->netclient_name); n->netclient_name = NULL; } if (n->netclient_type) { g_free(n->netclient_type); n->netclient_type = NULL; } g_free(n->mac_table.macs); g_free(n->vlans); for (i = 0; i < n->max_queues; i++) { VirtIONetQueue *q = &n->vqs[i]; NetClientState *nc = qemu_get_subqueue(n->nic, i); qemu_purge_queued_packets(nc); if (q->tx_timer) { timer_del(q->tx_timer); timer_free(q->tx_timer); } else if (q->tx_bh) { qemu_bh_delete(q->tx_bh); } } g_free(n->vqs); qemu_del_nic(n->nic); virtio_cleanup(vdev); }
static void virtio_net_device_unrealize(DeviceState *dev, Error **errp) { VirtIODevice *vdev = VIRTIO_DEVICE(dev); VirtIONet *n = VIRTIO_NET(dev); int i; /* This will stop vhost backend if appropriate. */ virtio_net_set_status(vdev, 0); unregister_savevm(dev, "virtio-net", n); if (n->netclient_name) { g_free(n->netclient_name); n->netclient_name = NULL; } if (n->netclient_type) { g_free(n->netclient_type); n->netclient_type = NULL; } g_free(n->mac_table.macs); g_free(n->vlans); for (i = 0; i < n->max_queues; i++) { VirtIONetQueue *q = &n->vqs[i]; NetClientState *nc = qemu_get_subqueue(n->nic, i); qemu_purge_queued_packets(nc); if (q->tx_timer) { timer_del(q->tx_timer); timer_free(q->tx_timer); } else if (q->tx_bh) { qemu_bh_delete(q->tx_bh); } } g_free(n->vqs); qemu_del_nic(n->nic); virtio_cleanup(vdev); }
C
qemu
0
CVE-2018-6079
https://www.cvedetails.com/cve/CVE-2018-6079/
CWE-200
https://github.com/chromium/chromium/commit/d128139d53e9268e87921e82d89b3f2053cb83fd
d128139d53e9268e87921e82d89b3f2053cb83fd
Fix tabs sharing TEXTURE_2D_ARRAY/TEXTURE_3D data. In linux and android, we are seeing an issue where texture data from one tab overwrites the texture data of another tab. This is happening for apps which are using webgl2 texture of type TEXTURE_2D_ARRAY/TEXTURE_3D. Due to a bug in virtual context save/restore code for above texture formats, the texture data is not properly restored while switching tabs. Hence texture data from one tab overwrites other. This CL has fix for that issue, an update for existing test expectations and a new unit test for this bug. Bug: 788448 Cq-Include-Trybots: master.tryserver.chromium.android:android_optional_gpu_tests_rel;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: Ie933984cdd2d1381f42eb4638f730c8245207a28 Reviewed-on: https://chromium-review.googlesource.com/930327 Reviewed-by: Zhenyao Mo <zmo@chromium.org> Commit-Queue: vikas soni <vikassoni@chromium.org> Cr-Commit-Position: refs/heads/master@{#539111}
void ContextState::RestoreProgramSettings( const ContextState* prev_state, bool restore_transform_feedback_bindings) const { bool flag = (restore_transform_feedback_bindings && feature_info_->IsES3Capable()); if (flag && prev_state) { if (prev_state->bound_transform_feedback.get() && prev_state->bound_transform_feedback->active() && !prev_state->bound_transform_feedback->paused()) { api()->glPauseTransformFeedbackFn(); } } api()->glUseProgramFn(current_program.get() ? current_program->service_id() : 0); if (flag) { if (bound_transform_feedback.get()) { bound_transform_feedback->DoBindTransformFeedback(GL_TRANSFORM_FEEDBACK); } else { api()->glBindTransformFeedbackFn(GL_TRANSFORM_FEEDBACK, 0); } } }
void ContextState::RestoreProgramSettings( const ContextState* prev_state, bool restore_transform_feedback_bindings) const { bool flag = (restore_transform_feedback_bindings && feature_info_->IsES3Capable()); if (flag && prev_state) { if (prev_state->bound_transform_feedback.get() && prev_state->bound_transform_feedback->active() && !prev_state->bound_transform_feedback->paused()) { api()->glPauseTransformFeedbackFn(); } } api()->glUseProgramFn(current_program.get() ? current_program->service_id() : 0); if (flag) { if (bound_transform_feedback.get()) { bound_transform_feedback->DoBindTransformFeedback(GL_TRANSFORM_FEEDBACK); } else { api()->glBindTransformFeedbackFn(GL_TRANSFORM_FEEDBACK, 0); } } }
C
Chrome
0
CVE-2017-1000251
https://www.cvedetails.com/cve/CVE-2017-1000251/
CWE-119
https://github.com/torvalds/linux/commit/f2fcfcd670257236ebf2088bbdf26f6a8ef459fe
f2fcfcd670257236ebf2088bbdf26f6a8ef459fe
Bluetooth: Add configuration support for ERTM and Streaming mode Add support to config_req and config_rsp to configure ERTM and Streaming mode. If the remote device specifies ERTM or Streaming mode, then the same mode is proposed. Otherwise ERTM or Basic mode is used. And in case of a state 2 device, the remote device should propose the same mode. If not, then the channel gets disconnected. Signed-off-by: Gustavo F. Padovan <gustavo@las.ic.unicamp.br> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
static struct sock *__l2cap_get_chan_by_ident(struct l2cap_chan_list *l, u8 ident) { struct sock *s; for (s = l->head; s; s = l2cap_pi(s)->next_c) { if (l2cap_pi(s)->ident == ident) break; } return s; }
static struct sock *__l2cap_get_chan_by_ident(struct l2cap_chan_list *l, u8 ident) { struct sock *s; for (s = l->head; s; s = l2cap_pi(s)->next_c) { if (l2cap_pi(s)->ident == ident) break; } return s; }
C
linux
0
CVE-2011-1080
https://www.cvedetails.com/cve/CVE-2011-1080/
CWE-20
https://github.com/torvalds/linux/commit/d846f71195d57b0bbb143382647c2c6638b04c5a
d846f71195d57b0bbb143382647c2c6638b04c5a
bridge: netfilter: fix information leak Struct tmp is copied from userspace. It is not checked whether the "name" field is NULL terminated. This may lead to buffer overflow and passing contents of kernel stack as a module name to try_then_request_module() and, consequently, to modprobe commandline. It would be seen by all userspace processes. Signed-off-by: Vasiliy Kulikov <segoon@openwall.com> Signed-off-by: Patrick McHardy <kaber@trash.net>
ebt_basic_match(const struct ebt_entry *e, const struct sk_buff *skb, const struct net_device *in, const struct net_device *out) { const struct ethhdr *h = eth_hdr(skb); const struct net_bridge_port *p; __be16 ethproto; int verdict, i; if (vlan_tx_tag_present(skb)) ethproto = htons(ETH_P_8021Q); else ethproto = h->h_proto; if (e->bitmask & EBT_802_3) { if (FWINV2(ntohs(ethproto) >= 1536, EBT_IPROTO)) return 1; } else if (!(e->bitmask & EBT_NOPROTO) && FWINV2(e->ethproto != ethproto, EBT_IPROTO)) return 1; if (FWINV2(ebt_dev_check(e->in, in), EBT_IIN)) return 1; if (FWINV2(ebt_dev_check(e->out, out), EBT_IOUT)) return 1; /* rcu_read_lock()ed by nf_hook_slow */ if (in && (p = br_port_get_rcu(in)) != NULL && FWINV2(ebt_dev_check(e->logical_in, p->br->dev), EBT_ILOGICALIN)) return 1; if (out && (p = br_port_get_rcu(out)) != NULL && FWINV2(ebt_dev_check(e->logical_out, p->br->dev), EBT_ILOGICALOUT)) return 1; if (e->bitmask & EBT_SOURCEMAC) { verdict = 0; for (i = 0; i < 6; i++) verdict |= (h->h_source[i] ^ e->sourcemac[i]) & e->sourcemsk[i]; if (FWINV2(verdict != 0, EBT_ISOURCE) ) return 1; } if (e->bitmask & EBT_DESTMAC) { verdict = 0; for (i = 0; i < 6; i++) verdict |= (h->h_dest[i] ^ e->destmac[i]) & e->destmsk[i]; if (FWINV2(verdict != 0, EBT_IDEST) ) return 1; } return 0; }
ebt_basic_match(const struct ebt_entry *e, const struct sk_buff *skb, const struct net_device *in, const struct net_device *out) { const struct ethhdr *h = eth_hdr(skb); const struct net_bridge_port *p; __be16 ethproto; int verdict, i; if (vlan_tx_tag_present(skb)) ethproto = htons(ETH_P_8021Q); else ethproto = h->h_proto; if (e->bitmask & EBT_802_3) { if (FWINV2(ntohs(ethproto) >= 1536, EBT_IPROTO)) return 1; } else if (!(e->bitmask & EBT_NOPROTO) && FWINV2(e->ethproto != ethproto, EBT_IPROTO)) return 1; if (FWINV2(ebt_dev_check(e->in, in), EBT_IIN)) return 1; if (FWINV2(ebt_dev_check(e->out, out), EBT_IOUT)) return 1; /* rcu_read_lock()ed by nf_hook_slow */ if (in && (p = br_port_get_rcu(in)) != NULL && FWINV2(ebt_dev_check(e->logical_in, p->br->dev), EBT_ILOGICALIN)) return 1; if (out && (p = br_port_get_rcu(out)) != NULL && FWINV2(ebt_dev_check(e->logical_out, p->br->dev), EBT_ILOGICALOUT)) return 1; if (e->bitmask & EBT_SOURCEMAC) { verdict = 0; for (i = 0; i < 6; i++) verdict |= (h->h_source[i] ^ e->sourcemac[i]) & e->sourcemsk[i]; if (FWINV2(verdict != 0, EBT_ISOURCE) ) return 1; } if (e->bitmask & EBT_DESTMAC) { verdict = 0; for (i = 0; i < 6; i++) verdict |= (h->h_dest[i] ^ e->destmac[i]) & e->destmsk[i]; if (FWINV2(verdict != 0, EBT_IDEST) ) return 1; } return 0; }
C
linux
0
CVE-2015-1274
https://www.cvedetails.com/cve/CVE-2015-1274/
CWE-254
https://github.com/chromium/chromium/commit/d27468a832d5316884bd02f459cbf493697fd7e1
d27468a832d5316884bd02f459cbf493697fd7e1
Switch to equalIgnoringASCIICase throughout modules/accessibility BUG=627682 Review-Url: https://codereview.chromium.org/2793913007 Cr-Commit-Position: refs/heads/master@{#461858}
DEFINE_TRACE(AXObjectCacheImpl) { visitor->trace(m_document); visitor->trace(m_nodeObjectMapping); visitor->trace(m_objects); visitor->trace(m_notificationsToPost); AXObjectCache::trace(visitor); }
DEFINE_TRACE(AXObjectCacheImpl) { visitor->trace(m_document); visitor->trace(m_nodeObjectMapping); visitor->trace(m_objects); visitor->trace(m_notificationsToPost); AXObjectCache::trace(visitor); }
C
Chrome
0
CVE-2019-11922
https://www.cvedetails.com/cve/CVE-2019-11922/
CWE-362
https://github.com/facebook/zstd/pull/1404/commits/3e5cdf1b6a85843e991d7d10f6a2567c15580da0
3e5cdf1b6a85843e991d7d10f6a2567c15580da0
fixed T36302429
static size_t ZSTD_compress_frameChunk (ZSTD_CCtx* cctx, void* dst, size_t dstCapacity, const void* src, size_t srcSize, U32 lastFrameChunk) { size_t blockSize = cctx->blockSize; size_t remaining = srcSize; const BYTE* ip = (const BYTE*)src; BYTE* const ostart = (BYTE*)dst; BYTE* op = ostart; U32 const maxDist = (U32)1 << cctx->appliedParams.cParams.windowLog; assert(cctx->appliedParams.cParams.windowLog <= 31); DEBUGLOG(5, "ZSTD_compress_frameChunk (blockSize=%u)", (U32)blockSize); if (cctx->appliedParams.fParams.checksumFlag && srcSize) XXH64_update(&cctx->xxhState, src, srcSize); while (remaining) { ZSTD_matchState_t* const ms = &cctx->blockState.matchState; U32 const lastBlock = lastFrameChunk & (blockSize >= remaining); if (dstCapacity < ZSTD_blockHeaderSize + MIN_CBLOCK_SIZE) return ERROR(dstSize_tooSmall); /* not enough space to store compressed block */ if (remaining < blockSize) blockSize = remaining; if (ZSTD_window_needOverflowCorrection(ms->window, ip + blockSize)) { U32 const cycleLog = ZSTD_cycleLog(cctx->appliedParams.cParams.chainLog, cctx->appliedParams.cParams.strategy); U32 const correction = ZSTD_window_correctOverflow(&ms->window, cycleLog, maxDist, ip); ZSTD_STATIC_ASSERT(ZSTD_CHAINLOG_MAX <= 30); ZSTD_STATIC_ASSERT(ZSTD_WINDOWLOG_MAX_32 <= 30); ZSTD_STATIC_ASSERT(ZSTD_WINDOWLOG_MAX <= 31); ZSTD_reduceIndex(cctx, correction); if (ms->nextToUpdate < correction) ms->nextToUpdate = 0; else ms->nextToUpdate -= correction; ms->loadedDictEnd = 0; ms->dictMatchState = NULL; } ZSTD_window_enforceMaxDist(&ms->window, ip + blockSize, maxDist, &ms->loadedDictEnd, &ms->dictMatchState); if (ms->nextToUpdate < ms->window.lowLimit) ms->nextToUpdate = ms->window.lowLimit; { size_t cSize = ZSTD_compressBlock_internal(cctx, op+ZSTD_blockHeaderSize, dstCapacity-ZSTD_blockHeaderSize, ip, blockSize); if (ZSTD_isError(cSize)) return cSize; if (cSize == 0) { /* block is not compressible */ cSize = ZSTD_noCompressBlock(op, dstCapacity, ip, blockSize, lastBlock); if (ZSTD_isError(cSize)) return cSize; } else { U32 const cBlockHeader24 = lastBlock + (((U32)bt_compressed)<<1) + (U32)(cSize << 3); MEM_writeLE24(op, cBlockHeader24); cSize += ZSTD_blockHeaderSize; } ip += blockSize; assert(remaining >= blockSize); remaining -= blockSize; op += cSize; assert(dstCapacity >= cSize); dstCapacity -= cSize; DEBUGLOG(5, "ZSTD_compress_frameChunk: adding a block of size %u", (U32)cSize); } } if (lastFrameChunk && (op>ostart)) cctx->stage = ZSTDcs_ending; return op-ostart; }
static size_t ZSTD_compress_frameChunk (ZSTD_CCtx* cctx, void* dst, size_t dstCapacity, const void* src, size_t srcSize, U32 lastFrameChunk) { size_t blockSize = cctx->blockSize; size_t remaining = srcSize; const BYTE* ip = (const BYTE*)src; BYTE* const ostart = (BYTE*)dst; BYTE* op = ostart; U32 const maxDist = (U32)1 << cctx->appliedParams.cParams.windowLog; assert(cctx->appliedParams.cParams.windowLog <= 31); DEBUGLOG(5, "ZSTD_compress_frameChunk (blockSize=%u)", (U32)blockSize); if (cctx->appliedParams.fParams.checksumFlag && srcSize) XXH64_update(&cctx->xxhState, src, srcSize); while (remaining) { ZSTD_matchState_t* const ms = &cctx->blockState.matchState; U32 const lastBlock = lastFrameChunk & (blockSize >= remaining); if (dstCapacity < ZSTD_blockHeaderSize + MIN_CBLOCK_SIZE) return ERROR(dstSize_tooSmall); /* not enough space to store compressed block */ if (remaining < blockSize) blockSize = remaining; if (ZSTD_window_needOverflowCorrection(ms->window, ip + blockSize)) { U32 const cycleLog = ZSTD_cycleLog(cctx->appliedParams.cParams.chainLog, cctx->appliedParams.cParams.strategy); U32 const correction = ZSTD_window_correctOverflow(&ms->window, cycleLog, maxDist, ip); ZSTD_STATIC_ASSERT(ZSTD_CHAINLOG_MAX <= 30); ZSTD_STATIC_ASSERT(ZSTD_WINDOWLOG_MAX_32 <= 30); ZSTD_STATIC_ASSERT(ZSTD_WINDOWLOG_MAX <= 31); ZSTD_reduceIndex(cctx, correction); if (ms->nextToUpdate < correction) ms->nextToUpdate = 0; else ms->nextToUpdate -= correction; ms->loadedDictEnd = 0; ms->dictMatchState = NULL; } ZSTD_window_enforceMaxDist(&ms->window, ip + blockSize, maxDist, &ms->loadedDictEnd, &ms->dictMatchState); if (ms->nextToUpdate < ms->window.lowLimit) ms->nextToUpdate = ms->window.lowLimit; { size_t cSize = ZSTD_compressBlock_internal(cctx, op+ZSTD_blockHeaderSize, dstCapacity-ZSTD_blockHeaderSize, ip, blockSize); if (ZSTD_isError(cSize)) return cSize; if (cSize == 0) { /* block is not compressible */ cSize = ZSTD_noCompressBlock(op, dstCapacity, ip, blockSize, lastBlock); if (ZSTD_isError(cSize)) return cSize; } else { U32 const cBlockHeader24 = lastBlock + (((U32)bt_compressed)<<1) + (U32)(cSize << 3); MEM_writeLE24(op, cBlockHeader24); cSize += ZSTD_blockHeaderSize; } ip += blockSize; assert(remaining >= blockSize); remaining -= blockSize; op += cSize; assert(dstCapacity >= cSize); dstCapacity -= cSize; DEBUGLOG(5, "ZSTD_compress_frameChunk: adding a block of size %u", (U32)cSize); } } if (lastFrameChunk && (op>ostart)) cctx->stage = ZSTDcs_ending; return op-ostart; }
C
zstd
0
CVE-2019-17178
https://www.cvedetails.com/cve/CVE-2019-17178/
CWE-772
https://github.com/akallabeth/FreeRDP/commit/fc80ab45621bd966f70594c0b7393ec005a94007
fc80ab45621bd966f70594c0b7393ec005a94007
Fixed #5645: realloc return handling
static BOOL band_match(const RECTANGLE_16* band1, const RECTANGLE_16* band2, RECTANGLE_16* endPtr) { int refBand2 = band2->top; const RECTANGLE_16* band2Start = band2; while ((band1 < band2Start) && (band2 < endPtr) && (band2->top == refBand2)) { if ((band1->left != band2->left) || (band1->right != band2->right)) return FALSE; band1++; band2++; } if (band1 != band2Start) return FALSE; return (band2 == endPtr) || (band2->top != refBand2); }
static BOOL band_match(const RECTANGLE_16* band1, const RECTANGLE_16* band2, RECTANGLE_16* endPtr) { int refBand2 = band2->top; const RECTANGLE_16* band2Start = band2; while ((band1 < band2Start) && (band2 < endPtr) && (band2->top == refBand2)) { if ((band1->left != band2->left) || (band1->right != band2->right)) return FALSE; band1++; band2++; } if (band1 != band2Start) return FALSE; return (band2 == endPtr) || (band2->top != refBand2); }
C
FreeRDP
0
CVE-2017-8072
https://www.cvedetails.com/cve/CVE-2017-8072/
CWE-388
https://github.com/torvalds/linux/commit/8e9faa15469ed7c7467423db4c62aeed3ff4cae3
8e9faa15469ed7c7467423db4c62aeed3ff4cae3
HID: cp2112: fix gpio-callback error handling In case of a zero-length report, the gpio direction_input callback would currently return success instead of an errno. Fixes: 1ffb3c40ffb5 ("HID: cp2112: make transfer buffers DMA capable") Cc: stable <stable@vger.kernel.org> # 4.9 Signed-off-by: Johan Hovold <johan@kernel.org> Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
static int __maybe_unused cp2112_allocate_irq(struct cp2112_device *dev, int pin) { int ret; if (dev->desc[pin]) return -EINVAL; dev->desc[pin] = gpiochip_request_own_desc(&dev->gc, pin, "HID/I2C:Event"); if (IS_ERR(dev->desc[pin])) { dev_err(dev->gc.parent, "Failed to request GPIO\n"); return PTR_ERR(dev->desc[pin]); } ret = gpiochip_lock_as_irq(&dev->gc, pin); if (ret) { dev_err(dev->gc.parent, "Failed to lock GPIO as interrupt\n"); goto err_desc; } ret = gpiod_to_irq(dev->desc[pin]); if (ret < 0) { dev_err(dev->gc.parent, "Failed to translate GPIO to IRQ\n"); goto err_lock; } return ret; err_lock: gpiochip_unlock_as_irq(&dev->gc, pin); err_desc: gpiochip_free_own_desc(dev->desc[pin]); dev->desc[pin] = NULL; return ret; }
static int __maybe_unused cp2112_allocate_irq(struct cp2112_device *dev, int pin) { int ret; if (dev->desc[pin]) return -EINVAL; dev->desc[pin] = gpiochip_request_own_desc(&dev->gc, pin, "HID/I2C:Event"); if (IS_ERR(dev->desc[pin])) { dev_err(dev->gc.parent, "Failed to request GPIO\n"); return PTR_ERR(dev->desc[pin]); } ret = gpiochip_lock_as_irq(&dev->gc, pin); if (ret) { dev_err(dev->gc.parent, "Failed to lock GPIO as interrupt\n"); goto err_desc; } ret = gpiod_to_irq(dev->desc[pin]); if (ret < 0) { dev_err(dev->gc.parent, "Failed to translate GPIO to IRQ\n"); goto err_lock; } return ret; err_lock: gpiochip_unlock_as_irq(&dev->gc, pin); err_desc: gpiochip_free_own_desc(dev->desc[pin]); dev->desc[pin] = NULL; return ret; }
C
linux
0
null
null
null
https://github.com/chromium/chromium/commit/1161a49d663dd395bd639549c2dfe7324f847938
1161a49d663dd395bd639549c2dfe7324f847938
Don't populate URL data in WebDropData when dragging files. This is considered a potential security issue as well, since it leaks filesystem paths. BUG=332579 Review URL: https://codereview.chromium.org/135633002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@244538 0039d316-1c4b-4281-b951-d872f2087c98
Tab* TabStrip::GetTabAt(Tab* tab, const gfx::Point& tab_in_tab_coordinates) { gfx::Point local_point = tab_in_tab_coordinates; ConvertPointToTarget(tab, this, &local_point); views::View* view = GetEventHandlerForPoint(local_point); if (!view) return NULL; // No tab contains the point. while (view && view != this && view->id() != VIEW_ID_TAB) view = view->parent(); return view && view->id() == VIEW_ID_TAB ? static_cast<Tab*>(view) : NULL; }
Tab* TabStrip::GetTabAt(Tab* tab, const gfx::Point& tab_in_tab_coordinates) { gfx::Point local_point = tab_in_tab_coordinates; ConvertPointToTarget(tab, this, &local_point); views::View* view = GetEventHandlerForPoint(local_point); if (!view) return NULL; // No tab contains the point. while (view && view != this && view->id() != VIEW_ID_TAB) view = view->parent(); return view && view->id() == VIEW_ID_TAB ? static_cast<Tab*>(view) : NULL; }
C
Chrome
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: 范龙飞 <long7573@126.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Jens Axboe <axboe@kernel.dk>
static ssize_t loop_attr_show(struct device *dev, char *page, ssize_t (*callback)(struct loop_device *, char *)) { struct gendisk *disk = dev_to_disk(dev); struct loop_device *lo = disk->private_data; return callback(lo, page); }
static ssize_t loop_attr_show(struct device *dev, char *page, ssize_t (*callback)(struct loop_device *, char *)) { struct gendisk *disk = dev_to_disk(dev); struct loop_device *lo = disk->private_data; return callback(lo, page); }
C
linux
0
null
null
null
https://github.com/chromium/chromium/commit/3454ed7b88318dcd4539c6e1a50d27b0ca535686
3454ed7b88318dcd4539c6e1a50d27b0ca535686
Allow automatic search engine detection on https BUG=521128 Review URL: https://codereview.chromium.org/1393113002 Cr-Commit-Position: refs/heads/master@{#352982}
bool SearchEngineTabHelper::OnMessageReceived( const IPC::Message& message, content::RenderFrameHost* render_frame_host) { bool handled = true; IPC_BEGIN_MESSAGE_MAP(SearchEngineTabHelper, message) IPC_MESSAGE_HANDLER(ChromeViewHostMsg_PageHasOSDD, OnPageHasOSDD) IPC_MESSAGE_UNHANDLED(handled = false) IPC_END_MESSAGE_MAP() return handled; }
bool SearchEngineTabHelper::OnMessageReceived( const IPC::Message& message, content::RenderFrameHost* render_frame_host) { bool handled = true; IPC_BEGIN_MESSAGE_MAP(SearchEngineTabHelper, message) IPC_MESSAGE_HANDLER(ChromeViewHostMsg_PageHasOSDD, OnPageHasOSDD) IPC_MESSAGE_UNHANDLED(handled = false) IPC_END_MESSAGE_MAP() return handled; }
C
Chrome
0
CVE-2017-9526
https://www.cvedetails.com/cve/CVE-2017-9526/
CWE-200
https://git.gnupg.org/cgi-bin/gitweb.cgi?p=libgcrypt.git;a=commit;h=5a22de904a0a366ae79f03ff1e13a1232a89e26b
5a22de904a0a366ae79f03ff1e13a1232a89e26b
null
eddsa_encodempi (gcry_mpi_t mpi, unsigned int minlen, unsigned char **r_buffer, unsigned int *r_buflen) { unsigned char *rawmpi; unsigned int rawmpilen; rawmpi = _gcry_mpi_get_buffer (mpi, minlen, &rawmpilen, NULL); if (!rawmpi) return gpg_err_code_from_syserror (); *r_buffer = rawmpi; *r_buflen = rawmpilen; return 0; }
eddsa_encodempi (gcry_mpi_t mpi, unsigned int minlen, unsigned char **r_buffer, unsigned int *r_buflen) { unsigned char *rawmpi; unsigned int rawmpilen; rawmpi = _gcry_mpi_get_buffer (mpi, minlen, &rawmpilen, NULL); if (!rawmpi) return gpg_err_code_from_syserror (); *r_buffer = rawmpi; *r_buflen = rawmpilen; return 0; }
C
gnupg
0
null
null
null
https://github.com/chromium/chromium/commit/aac449e7154720b895ff1e7f3497c2ce95ae1a5a
aac449e7154720b895ff1e7f3497c2ce95ae1a5a
POSIX: make sure that we never pass directory descriptors into the sandbox. BUG=43304 http://codereview.chromium.org/2733011/show git-svn-id: svn://svn.chromium.org/chrome/trunk/src@49446 0039d316-1c4b-4281-b951-d872f2087c98
int Lookup(const std::string& channel_id) { AutoLock locked(lock_); ChannelToFDMap::const_iterator i = map_.find(channel_id); if (i == map_.end()) return -1; return i->second; }
int Lookup(const std::string& channel_id) { AutoLock locked(lock_); ChannelToFDMap::const_iterator i = map_.find(channel_id); if (i == map_.end()) return -1; return i->second; }
C
Chrome
0
CVE-2017-8284
https://www.cvedetails.com/cve/CVE-2017-8284/
CWE-94
https://github.com/qemu/qemu/commit/30663fd26c0307e414622c7a8607fbc04f92ec14
30663fd26c0307e414622c7a8607fbc04f92ec14
tcg/i386: Check the size of instruction being translated This fixes the bug: 'user-to-root privesc inside VM via bad translation caching' reported by Jann Horn here: https://bugs.chromium.org/p/project-zero/issues/detail?id=1122 Reviewed-by: Richard Henderson <rth@twiddle.net> CC: Peter Maydell <peter.maydell@linaro.org> CC: Paolo Bonzini <pbonzini@redhat.com> Reported-by: Jann Horn <jannh@google.com> Signed-off-by: Pranith Kumar <bobby.prani@gmail.com> Message-Id: <20170323175851.14342-1-bobby.prani@gmail.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
static inline void gen_op_ld_v(DisasContext *s, int idx, TCGv t0, TCGv a0) { tcg_gen_qemu_ld_tl(t0, a0, s->mem_index, idx | MO_LE); }
static inline void gen_op_ld_v(DisasContext *s, int idx, TCGv t0, TCGv a0) { tcg_gen_qemu_ld_tl(t0, a0, s->mem_index, idx | MO_LE); }
C
qemu
0
CVE-2016-5189
https://www.cvedetails.com/cve/CVE-2016-5189/
CWE-284
https://github.com/chromium/chromium/commit/2440e872debd68ae7c2a8bf9ddb34df2cce378cd
2440e872debd68ae7c2a8bf9ddb34df2cce378cd
[GCPW] Disallow sign in of consumer accounts when mdm is enabled. Unless the registry key "mdm_aca" is explicitly set to 1, always fail sign in of consumer accounts when mdm enrollment is enabled. Consumer accounts are defined as accounts with gmail.com or googlemail.com domain. Bug: 944049 Change-Id: Icb822f3737d90931de16a8d3317616dd2b159edd Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1532903 Commit-Queue: Tien Mai <tienmai@chromium.org> Reviewed-by: Roger Tawa <rogerta@chromium.org> Cr-Commit-Position: refs/heads/master@{#646278}
HRESULT CGaiaCredentialBase::CreateGaiaLogonToken( base::win::ScopedHandle* token, PSID* sid) { DCHECK(token); DCHECK(sid); auto policy = ScopedLsaPolicy::Create(POLICY_ALL_ACCESS); if (!policy) { LOGFN(ERROR) << "LsaOpenPolicy failed"; return E_UNEXPECTED; } wchar_t gaia_username[kWindowsUsernameBufferLength]; HRESULT hr = policy->RetrievePrivateData(kLsaKeyGaiaUsername, gaia_username, base::size(gaia_username)); if (FAILED(hr)) { LOGFN(ERROR) << "Retrieve gaia username hr=" << putHR(hr); return hr; } wchar_t password[32]; hr = policy->RetrievePrivateData(kLsaKeyGaiaPassword, password, base::size(password)); if (FAILED(hr)) { LOGFN(ERROR) << "Retrieve password for gaia user '" << gaia_username << "' hr=" << putHR(hr); return hr; } base::string16 local_domain = OSUserManager::GetLocalDomain(); hr = OSUserManager::Get()->CreateLogonToken(local_domain.c_str(), gaia_username, password, /*interactive=*/false, token); if (FAILED(hr)) { LOGFN(ERROR) << "CreateLogonToken hr=" << putHR(hr); return hr; } hr = OSProcessManager::Get()->GetTokenLogonSID(*token, sid); if (FAILED(hr)) { LOGFN(ERROR) << "GetTokenLogonSID hr=" << putHR(hr); token->Close(); return hr; } wchar_t* sid_string; if (::ConvertSidToStringSid(*sid, &sid_string)) { LOGFN(INFO) << "logon-sid=" << sid_string; LocalFree(sid_string); } else { LOGFN(ERROR) << "logon-sid=<can't get string>"; } return S_OK; }
HRESULT CGaiaCredentialBase::CreateGaiaLogonToken( base::win::ScopedHandle* token, PSID* sid) { DCHECK(token); DCHECK(sid); auto policy = ScopedLsaPolicy::Create(POLICY_ALL_ACCESS); if (!policy) { LOGFN(ERROR) << "LsaOpenPolicy failed"; return E_UNEXPECTED; } wchar_t gaia_username[kWindowsUsernameBufferLength]; HRESULT hr = policy->RetrievePrivateData(kLsaKeyGaiaUsername, gaia_username, base::size(gaia_username)); if (FAILED(hr)) { LOGFN(ERROR) << "Retrieve gaia username hr=" << putHR(hr); return hr; } wchar_t password[32]; hr = policy->RetrievePrivateData(kLsaKeyGaiaPassword, password, base::size(password)); if (FAILED(hr)) { LOGFN(ERROR) << "Retrieve password for gaia user '" << gaia_username << "' hr=" << putHR(hr); return hr; } base::string16 local_domain = OSUserManager::GetLocalDomain(); hr = OSUserManager::Get()->CreateLogonToken(local_domain.c_str(), gaia_username, password, /*interactive=*/false, token); if (FAILED(hr)) { LOGFN(ERROR) << "CreateLogonToken hr=" << putHR(hr); return hr; } hr = OSProcessManager::Get()->GetTokenLogonSID(*token, sid); if (FAILED(hr)) { LOGFN(ERROR) << "GetTokenLogonSID hr=" << putHR(hr); token->Close(); return hr; } wchar_t* sid_string; if (::ConvertSidToStringSid(*sid, &sid_string)) { LOGFN(INFO) << "logon-sid=" << sid_string; LocalFree(sid_string); } else { LOGFN(ERROR) << "logon-sid=<can't get string>"; } return S_OK; }
C
Chrome
0
CVE-2016-5218
https://www.cvedetails.com/cve/CVE-2016-5218/
CWE-20
https://github.com/chromium/chromium/commit/45d901b56f578a74b19ba0d10fa5c4c467f19303
45d901b56f578a74b19ba0d10fa5c4c467f19303
Paint tab groups with the group color. * The background of TabGroupHeader now uses the group color. * The backgrounds of tabs in the group are tinted with the group color. This treatment, along with the colors chosen, are intended to be a placeholder. Bug: 905491 Change-Id: Ic808548f8eba23064606e7fb8c9bba281d0d117f Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1610504 Commit-Queue: Bret Sepulveda <bsep@chromium.org> Reviewed-by: Taylor Bergquist <tbergquist@chromium.org> Cr-Commit-Position: refs/heads/master@{#660498}
void TabStrip::OnMouseExited(const ui::MouseEvent& event) { UpdateHoverCard(nullptr, false); }
void TabStrip::OnMouseExited(const ui::MouseEvent& event) { UpdateHoverCard(nullptr, false); }
C
Chrome
0
CVE-2015-6817
https://www.cvedetails.com/cve/CVE-2015-6817/
CWE-287
https://github.com/pgbouncer/pgbouncer/commit/7ca3e5279d05fceb1e8a043c6f5b6f58dea3ed38
7ca3e5279d05fceb1e8a043c6f5b6f58dea3ed38
Remove too early set of auth_user When query returns 0 rows (user not found), this user stays as login user... Should fix #69.
static const char *hdr2hex(const struct MBuf *data, char *buf, unsigned buflen) { const uint8_t *bin = data->data + data->read_pos; unsigned int dlen; dlen = mbuf_avail_for_read(data); return bin2hex(bin, dlen, buf, buflen); }
static const char *hdr2hex(const struct MBuf *data, char *buf, unsigned buflen) { const uint8_t *bin = data->data + data->read_pos; unsigned int dlen; dlen = mbuf_avail_for_read(data); return bin2hex(bin, dlen, buf, buflen); }
C
pgbouncer
0
null
null
null
https://github.com/chromium/chromium/commit/19190765882e272a6a2162c89acdb29110f7e3cf
19190765882e272a6a2162c89acdb29110f7e3cf
Revert 102184 - [Sync] use base::Time in sync Make EntryKernel/Entry/BaseNode use base::Time instead of int64s. Add sync/util/time.h, with utility functions to manage the sync proto time format. Store times on disk in proto format instead of the local system. This requires a database version bump (to 77). Update SessionChangeProcessor/SessionModelAssociator to use base::Time, too. Remove hackish Now() function. Remove ZeroFields() function, and instead zero-initialize in EntryKernel::EntryKernel() directly. BUG= TEST= Review URL: http://codereview.chromium.org/7981006 TBR=akalin@chromium.org Review URL: http://codereview.chromium.org/7977034 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@102186 0039d316-1c4b-4281-b951-d872f2087c98
bool SyncerProtoUtil::PostClientToServerMessage( const ClientToServerMessage& msg, ClientToServerResponse* response, SyncSession* session) { CHECK(response); DCHECK(!msg.get_updates().has_from_timestamp()); // Deprecated. DCHECK(!msg.get_updates().has_requested_types()); // Deprecated. DCHECK(msg.has_store_birthday() || IsVeryFirstGetUpdates(msg)) << "Must call AddRequestBirthday to set birthday."; ScopedDirLookup dir(session->context()->directory_manager(), session->context()->account_name()); if (!dir.good()) return false; if (!PostAndProcessHeaders(session->context()->connection_manager(), session, msg, response)) return false; browser_sync::SyncProtocolError sync_protocol_error; if (!VerifyResponseBirthday(dir, response)) { sync_protocol_error.error_type = browser_sync::NOT_MY_BIRTHDAY; sync_protocol_error.action = browser_sync::DISABLE_SYNC_ON_CLIENT; } else if (response->has_error()) { sync_protocol_error = ConvertErrorPBToLocalType(response->error()); } else { sync_protocol_error = ConvertLegacyErrorCodeToNewError( response->error_code()); } sessions::StatusController* status = session->status_controller(); status->set_sync_protocol_error(sync_protocol_error); session->delegate()->OnSyncProtocolError(session->TakeSnapshot()); switch (sync_protocol_error.error_type) { case browser_sync::UNKNOWN_ERROR: LOG(WARNING) << "Sync protocol out-of-date. The server is using a more " << "recent version."; return false; case browser_sync::SYNC_SUCCESS: LogResponseProfilingData(*response); return true; case browser_sync::THROTTLED: LOG(WARNING) << "Client silenced by server."; session->delegate()->OnSilencedUntil(base::TimeTicks::Now() + GetThrottleDelay(*response)); return false; case browser_sync::TRANSIENT_ERROR: return false; case browser_sync::MIGRATION_DONE: HandleMigrationDoneResponse(response, session); return false; case browser_sync::CLEAR_PENDING: case browser_sync::NOT_MY_BIRTHDAY: return false; default: NOTREACHED(); return false; } }
bool SyncerProtoUtil::PostClientToServerMessage( const ClientToServerMessage& msg, ClientToServerResponse* response, SyncSession* session) { CHECK(response); DCHECK(!msg.get_updates().has_from_timestamp()); // Deprecated. DCHECK(!msg.get_updates().has_requested_types()); // Deprecated. DCHECK(msg.has_store_birthday() || IsVeryFirstGetUpdates(msg)) << "Must call AddRequestBirthday to set birthday."; ScopedDirLookup dir(session->context()->directory_manager(), session->context()->account_name()); if (!dir.good()) return false; if (!PostAndProcessHeaders(session->context()->connection_manager(), session, msg, response)) return false; browser_sync::SyncProtocolError sync_protocol_error; if (!VerifyResponseBirthday(dir, response)) { sync_protocol_error.error_type = browser_sync::NOT_MY_BIRTHDAY; sync_protocol_error.action = browser_sync::DISABLE_SYNC_ON_CLIENT; } else if (response->has_error()) { sync_protocol_error = ConvertErrorPBToLocalType(response->error()); } else { sync_protocol_error = ConvertLegacyErrorCodeToNewError( response->error_code()); } sessions::StatusController* status = session->status_controller(); status->set_sync_protocol_error(sync_protocol_error); session->delegate()->OnSyncProtocolError(session->TakeSnapshot()); switch (sync_protocol_error.error_type) { case browser_sync::UNKNOWN_ERROR: LOG(WARNING) << "Sync protocol out-of-date. The server is using a more " << "recent version."; return false; case browser_sync::SYNC_SUCCESS: LogResponseProfilingData(*response); return true; case browser_sync::THROTTLED: LOG(WARNING) << "Client silenced by server."; session->delegate()->OnSilencedUntil(base::TimeTicks::Now() + GetThrottleDelay(*response)); return false; case browser_sync::TRANSIENT_ERROR: return false; case browser_sync::MIGRATION_DONE: HandleMigrationDoneResponse(response, session); return false; case browser_sync::CLEAR_PENDING: case browser_sync::NOT_MY_BIRTHDAY: return false; default: NOTREACHED(); return false; } }
C
Chrome
0
CVE-2016-3751
https://www.cvedetails.com/cve/CVE-2016-3751/
null
https://android.googlesource.com/platform/external/libpng/+/9d4853418ab2f754c2b63e091c29c5529b8b86ca
9d4853418ab2f754c2b63e091c29c5529b8b86ca
DO NOT MERGE Update libpng to 1.6.20 BUG:23265085 Change-Id: I85199805636d771f3597b691b63bc0bf46084833 (cherry picked from commit bbe98b40cda082024b669fa508931042eed18f82)
allocbuffer(Image *image) { png_size_t size = PNG_IMAGE_BUFFER_SIZE(image->image, image->stride); if (size+32 > image->bufsize) { freebuffer(image); image->buffer = voidcast(png_bytep, malloc(size+32)); if (image->buffer == NULL) { fflush(stdout); fprintf(stderr, "simpletest: out of memory allocating %lu(+32) byte buffer\n", (unsigned long)size); exit(1); } image->bufsize = size+32; } memset(image->buffer, 95, image->bufsize); memset(image->buffer+16, BUFFER_INIT8, size); image->allocsize = size; }
allocbuffer(Image *image) { png_size_t size = PNG_IMAGE_BUFFER_SIZE(image->image, image->stride); if (size+32 > image->bufsize) { freebuffer(image); image->buffer = voidcast(png_bytep, malloc(size+32)); if (image->buffer == NULL) { fflush(stdout); fprintf(stderr, "simpletest: out of memory allocating %lu(+32) byte buffer\n", (unsigned long)size); exit(1); } image->bufsize = size+32; } memset(image->buffer, 95, image->bufsize); memset(image->buffer+16, BUFFER_INIT8, size); image->allocsize = size; }
C
Android
0
CVE-2013-2853
https://www.cvedetails.com/cve/CVE-2013-2853/
null
https://github.com/chromium/chromium/commit/9c18dbcb79e5f700c453d1ac01fb6d8768e4844a
9c18dbcb79e5f700c453d1ac01fb6d8768e4844a
net: don't process truncated headers on HTTPS connections. This change causes us to not process any headers unless they are correctly terminated with a \r\n\r\n sequence. BUG=244260 Review URL: https://chromiumcodereview.appspot.com/15688012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@202927 0039d316-1c4b-4281-b951-d872f2087c98
int HttpStreamParser::DoReadBodyComplete(int result) { if (result == 0 && !IsResponseBodyComplete() && CanFindEndOfResponse()) { if (chunked_decoder_.get()) result = ERR_INCOMPLETE_CHUNKED_ENCODING; else result = ERR_CONTENT_LENGTH_MISMATCH; } if (result > 0 && chunked_decoder_.get()) { result = chunked_decoder_->FilterBuf(user_read_buf_->data(), result); if (result == 0 && !chunked_decoder_->reached_eof()) { io_state_ = STATE_READ_BODY; return OK; } } if (result > 0) response_body_read_ += result; if (result <= 0 || IsResponseBodyComplete()) { io_state_ = STATE_DONE; int additional_save_amount = read_buf_->offset() - read_buf_unused_offset_; int save_amount = 0; if (chunked_decoder_.get()) { save_amount = chunked_decoder_->bytes_after_eof(); } else if (response_body_length_ >= 0) { int64 extra_data_read = response_body_read_ - response_body_length_; if (extra_data_read > 0) { save_amount = static_cast<int>(extra_data_read); if (result > 0) result -= save_amount; } } CHECK_LE(save_amount + additional_save_amount, kMaxBufSize); if (read_buf_->capacity() < save_amount + additional_save_amount) { read_buf_->SetCapacity(save_amount + additional_save_amount); } if (save_amount) { memcpy(read_buf_->StartOfBuffer(), user_read_buf_->data() + result, save_amount); } read_buf_->set_offset(save_amount); if (additional_save_amount) { memmove(read_buf_->data(), read_buf_->StartOfBuffer() + read_buf_unused_offset_, additional_save_amount); read_buf_->set_offset(save_amount + additional_save_amount); } read_buf_unused_offset_ = 0; } else { io_state_ = STATE_BODY_PENDING; user_read_buf_ = NULL; user_read_buf_len_ = 0; } return result; }
int HttpStreamParser::DoReadBodyComplete(int result) { if (result == 0 && !IsResponseBodyComplete() && CanFindEndOfResponse()) { if (chunked_decoder_.get()) result = ERR_INCOMPLETE_CHUNKED_ENCODING; else result = ERR_CONTENT_LENGTH_MISMATCH; } if (result > 0 && chunked_decoder_.get()) { result = chunked_decoder_->FilterBuf(user_read_buf_->data(), result); if (result == 0 && !chunked_decoder_->reached_eof()) { io_state_ = STATE_READ_BODY; return OK; } } if (result > 0) response_body_read_ += result; if (result <= 0 || IsResponseBodyComplete()) { io_state_ = STATE_DONE; int additional_save_amount = read_buf_->offset() - read_buf_unused_offset_; int save_amount = 0; if (chunked_decoder_.get()) { save_amount = chunked_decoder_->bytes_after_eof(); } else if (response_body_length_ >= 0) { int64 extra_data_read = response_body_read_ - response_body_length_; if (extra_data_read > 0) { save_amount = static_cast<int>(extra_data_read); if (result > 0) result -= save_amount; } } CHECK_LE(save_amount + additional_save_amount, kMaxBufSize); if (read_buf_->capacity() < save_amount + additional_save_amount) { read_buf_->SetCapacity(save_amount + additional_save_amount); } if (save_amount) { memcpy(read_buf_->StartOfBuffer(), user_read_buf_->data() + result, save_amount); } read_buf_->set_offset(save_amount); if (additional_save_amount) { memmove(read_buf_->data(), read_buf_->StartOfBuffer() + read_buf_unused_offset_, additional_save_amount); read_buf_->set_offset(save_amount + additional_save_amount); } read_buf_unused_offset_ = 0; } else { io_state_ = STATE_BODY_PENDING; user_read_buf_ = NULL; user_read_buf_len_ = 0; } return result; }
C
Chrome
0
CVE-2015-8543
https://www.cvedetails.com/cve/CVE-2015-8543/
null
https://github.com/torvalds/linux/commit/79462ad02e861803b3840cc782248c7359451cd9
79462ad02e861803b3840cc782248c7359451cd9
net: add validation for the socket syscall protocol argument 郭永刚 reported that one could simply crash the kernel as root by using a simple program: int socket_fd; struct sockaddr_in addr; addr.sin_port = 0; addr.sin_addr.s_addr = INADDR_ANY; addr.sin_family = 10; socket_fd = socket(10,3,0x40000000); connect(socket_fd , &addr,16); AF_INET, AF_INET6 sockets actually only support 8-bit protocol identifiers. inet_sock's skc_protocol field thus is sized accordingly, thus larger protocol identifiers simply cut off the higher bits and store a zero in the protocol fields. This could lead to e.g. NULL function pointer because as a result of the cut off inet_num is zero and we call down to inet_autobind, which is NULL for raw sockets. kernel: Call Trace: kernel: [<ffffffff816db90e>] ? inet_autobind+0x2e/0x70 kernel: [<ffffffff816db9a4>] inet_dgram_connect+0x54/0x80 kernel: [<ffffffff81645069>] SYSC_connect+0xd9/0x110 kernel: [<ffffffff810ac51b>] ? ptrace_notify+0x5b/0x80 kernel: [<ffffffff810236d8>] ? syscall_trace_enter_phase2+0x108/0x200 kernel: [<ffffffff81645e0e>] SyS_connect+0xe/0x10 kernel: [<ffffffff81779515>] tracesys_phase2+0x84/0x89 I found no particular commit which introduced this problem. CVE: CVE-2015-8543 Cc: Cong Wang <cwang@twopensource.com> Reported-by: 郭永刚 <guoyonggang@360.cn> Signed-off-by: Hannes Frederic Sowa <hannes@stressinduktion.org> Signed-off-by: David S. Miller <davem@davemloft.net>
static int irda_open_lsap(struct irda_sock *self, int pid) { notify_t notify; if (self->lsap) { net_warn_ratelimited("%s(), busy!\n", __func__); return -EBUSY; } /* Initialize callbacks to be used by the IrDA stack */ irda_notify_init(&notify); notify.udata_indication = irda_data_indication; notify.instance = self; strncpy(notify.name, "Ultra", NOTIFY_MAX_NAME); self->lsap = irlmp_open_lsap(LSAP_CONNLESS, &notify, pid); if (self->lsap == NULL) { pr_debug("%s(), Unable to allocate LSAP!\n", __func__); return -ENOMEM; } return 0; }
static int irda_open_lsap(struct irda_sock *self, int pid) { notify_t notify; if (self->lsap) { net_warn_ratelimited("%s(), busy!\n", __func__); return -EBUSY; } /* Initialize callbacks to be used by the IrDA stack */ irda_notify_init(&notify); notify.udata_indication = irda_data_indication; notify.instance = self; strncpy(notify.name, "Ultra", NOTIFY_MAX_NAME); self->lsap = irlmp_open_lsap(LSAP_CONNLESS, &notify, pid); if (self->lsap == NULL) { pr_debug("%s(), Unable to allocate LSAP!\n", __func__); return -ENOMEM; } return 0; }
C
linux
0
CVE-2018-1116
https://www.cvedetails.com/cve/CVE-2018-1116/
CWE-200
https://cgit.freedesktop.org/polkit/commit/?id=bc7ffad5364
bc7ffad53643a9c80231fc41f5582d6a8931c32c
null
sd_source_prepare (GSource *source, gint *timeout) { *timeout = -1; return FALSE; }
sd_source_prepare (GSource *source, gint *timeout) { *timeout = -1; return FALSE; }
C
polkit
0
CVE-2016-5337
https://www.cvedetails.com/cve/CVE-2016-5337/
CWE-200
https://git.qemu.org/?p=qemu.git;a=commit;h=844864fbae66935951529408831c2f22367a57b6
844864fbae66935951529408831c2f22367a57b6
null
static int megasas_dcmd_ld_get_list(MegasasState *s, MegasasCmd *cmd) { struct mfi_ld_list info; size_t dcmd_size = sizeof(info), resid; uint32_t num_ld_disks = 0, max_ld_disks; uint64_t ld_size; BusChild *kid; memset(&info, 0, dcmd_size); if (cmd->iov_size > dcmd_size) { trace_megasas_dcmd_invalid_xfer_len(cmd->index, cmd->iov_size, dcmd_size); return MFI_STAT_INVALID_PARAMETER; } max_ld_disks = (cmd->iov_size - 8) / 16; if (megasas_is_jbod(s)) { max_ld_disks = 0; } if (max_ld_disks > MFI_MAX_LD) { max_ld_disks = MFI_MAX_LD; } QTAILQ_FOREACH(kid, &s->bus.qbus.children, sibling) { SCSIDevice *sdev = SCSI_DEVICE(kid->child); if (num_ld_disks >= max_ld_disks) { break; } /* Logical device size is in blocks */ blk_get_geometry(sdev->conf.blk, &ld_size); info.ld_list[num_ld_disks].ld.v.target_id = sdev->id; info.ld_list[num_ld_disks].state = MFI_LD_STATE_OPTIMAL; info.ld_list[num_ld_disks].size = cpu_to_le64(ld_size); num_ld_disks++; } info.ld_count = cpu_to_le32(num_ld_disks); trace_megasas_dcmd_ld_get_list(cmd->index, num_ld_disks, max_ld_disks); resid = dma_buf_read((uint8_t *)&info, dcmd_size, &cmd->qsg); cmd->iov_size = dcmd_size - resid; return MFI_STAT_OK; }
static int megasas_dcmd_ld_get_list(MegasasState *s, MegasasCmd *cmd) { struct mfi_ld_list info; size_t dcmd_size = sizeof(info), resid; uint32_t num_ld_disks = 0, max_ld_disks; uint64_t ld_size; BusChild *kid; memset(&info, 0, dcmd_size); if (cmd->iov_size > dcmd_size) { trace_megasas_dcmd_invalid_xfer_len(cmd->index, cmd->iov_size, dcmd_size); return MFI_STAT_INVALID_PARAMETER; } max_ld_disks = (cmd->iov_size - 8) / 16; if (megasas_is_jbod(s)) { max_ld_disks = 0; } if (max_ld_disks > MFI_MAX_LD) { max_ld_disks = MFI_MAX_LD; } QTAILQ_FOREACH(kid, &s->bus.qbus.children, sibling) { SCSIDevice *sdev = SCSI_DEVICE(kid->child); if (num_ld_disks >= max_ld_disks) { break; } /* Logical device size is in blocks */ blk_get_geometry(sdev->conf.blk, &ld_size); info.ld_list[num_ld_disks].ld.v.target_id = sdev->id; info.ld_list[num_ld_disks].state = MFI_LD_STATE_OPTIMAL; info.ld_list[num_ld_disks].size = cpu_to_le64(ld_size); num_ld_disks++; } info.ld_count = cpu_to_le32(num_ld_disks); trace_megasas_dcmd_ld_get_list(cmd->index, num_ld_disks, max_ld_disks); resid = dma_buf_read((uint8_t *)&info, dcmd_size, &cmd->qsg); cmd->iov_size = dcmd_size - resid; return MFI_STAT_OK; }
C
qemu
0
CVE-2011-2858
https://www.cvedetails.com/cve/CVE-2011-2858/
CWE-119
https://github.com/chromium/chromium/commit/c13e1da62b5f5f0e6fe8c1f769a5a28415415244
c13e1da62b5f5f0e6fe8c1f769a5a28415415244
Revert "Revert 100494 - Fix bug in SimulateAttrib0.""" TEST=none BUG=95625 TBR=apatrick@chromium.org Review URL: http://codereview.chromium.org/7796016 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@100507 0039d316-1c4b-4281-b951-d872f2087c98
void DoReleaseShaderCompiler() { }
void DoReleaseShaderCompiler() { }
C
Chrome
0
CVE-2011-3053
https://www.cvedetails.com/cve/CVE-2011-3053/
CWE-399
https://github.com/chromium/chromium/commit/c442b3eda2f1fdd4d1d4864c34c43cbaf223acae
c442b3eda2f1fdd4d1d4864c34c43cbaf223acae
chromeos: Move audio, power, and UI files into subdirs. This moves more files from chrome/browser/chromeos/ into subdirectories. BUG=chromium-os:22896 TEST=did chrome os builds both with and without aura TBR=sky Review URL: http://codereview.chromium.org/9125006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@116746 0039d316-1c4b-4281-b951-d872f2087c98
AddDNSCertProvenanceCheckingWarningInfoBarIfNecessary( TabContentsWrapper* tab) { if (!command_line_.HasSwitch(switches::kEnableDNSCertProvenanceChecking)) return; const char* kLearnMoreURL = "http://dev.chromium.org/dnscertprovenancechecking"; string16 message = l10n_util::GetStringUTF16( IDS_DNS_CERT_PROVENANCE_CHECKING_WARNING_MESSAGE); tab->infobar_tab_helper()->AddInfoBar( new LearnMoreInfoBar(tab->infobar_tab_helper(), message, GURL(kLearnMoreURL))); }
AddDNSCertProvenanceCheckingWarningInfoBarIfNecessary( TabContentsWrapper* tab) { if (!command_line_.HasSwitch(switches::kEnableDNSCertProvenanceChecking)) return; const char* kLearnMoreURL = "http://dev.chromium.org/dnscertprovenancechecking"; string16 message = l10n_util::GetStringUTF16( IDS_DNS_CERT_PROVENANCE_CHECKING_WARNING_MESSAGE); tab->infobar_tab_helper()->AddInfoBar( new LearnMoreInfoBar(tab->infobar_tab_helper(), message, GURL(kLearnMoreURL))); }
C
Chrome
0
CVE-2018-16078
https://www.cvedetails.com/cve/CVE-2018-16078/
null
https://github.com/chromium/chromium/commit/b025e82307a8490501bb030266cd955c391abcb7
b025e82307a8490501bb030266cd955c391abcb7
[AF] Don't simplify/dedupe suggestions for (partially) filled sections. Since Autofill does not fill field by field anymore, this simplifying and deduping of suggestions is not useful anymore. Bug: 858820 Cq-Include-Trybots: luci.chromium.try:ios-simulator-full-configs;master.tryserver.chromium.mac:ios-simulator-cronet Change-Id: I36f7cfe425a0bdbf5ba7503a3d96773b405cc19b Reviewed-on: https://chromium-review.googlesource.com/1128255 Reviewed-by: Roger McFarlane <rogerm@chromium.org> Commit-Queue: Sebastien Seguin-Gagnon <sebsg@chromium.org> Cr-Commit-Position: refs/heads/master@{#573315}
bool AutofillManager::ShouldUploadForm(const FormStructure& form) { return IsAutofillEnabled() && !driver()->IsIncognito() && form.ShouldBeUploaded(); }
bool AutofillManager::ShouldUploadForm(const FormStructure& form) { return IsAutofillEnabled() && !driver()->IsIncognito() && form.ShouldBeUploaded(); }
C
Chrome
0
CVE-2014-1742
https://www.cvedetails.com/cve/CVE-2014-1742/
CWE-399
https://github.com/chromium/chromium/commit/870f3e99a1282023753fe8d8aed90879cbc6838f
870f3e99a1282023753fe8d8aed90879cbc6838f
Tracing: Add support for PII whitelisting of individual trace event arguments R=dsinclair,shatch BUG=546093 Review URL: https://codereview.chromium.org/1415013003 Cr-Commit-Position: refs/heads/master@{#356690}
void EndTraceAndFlushInThreadWithMessageLoop() { WaitableEvent flush_complete_event(false, false); Thread flush_thread("flush"); flush_thread.Start(); flush_thread.task_runner()->PostTask( FROM_HERE, base::Bind(&TraceEventTestFixture::EndTraceAndFlushAsync, base::Unretained(this), &flush_complete_event)); flush_complete_event.Wait(); }
void EndTraceAndFlushInThreadWithMessageLoop() { WaitableEvent flush_complete_event(false, false); Thread flush_thread("flush"); flush_thread.Start(); flush_thread.task_runner()->PostTask( FROM_HERE, base::Bind(&TraceEventTestFixture::EndTraceAndFlushAsync, base::Unretained(this), &flush_complete_event)); flush_complete_event.Wait(); }
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 <xiexiuqi@huawei.com> Analyzed-by: Vincent Guittot <vincent.guittot@linaro.org> Reported-by: Zhipeng Xie <xiezhipeng1@huawei.com> Reported-by: Sargun Dhillon <sargun@sargun.me> Reported-by: Xie XiuQi <xiexiuqi@huawei.com> Tested-by: Zhipeng Xie <xiezhipeng1@huawei.com> Tested-by: Sargun Dhillon <sargun@sargun.me> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Acked-by: Vincent Guittot <vincent.guittot@linaro.org> Cc: <stable@vger.kernel.org> # v4.13+ Cc: Bin Li <huawei.libin@huawei.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Tejun Heo <tj@kernel.org> Cc: Thomas Gleixner <tglx@linutronix.de> Fixes: a9e7f6544b9c ("sched/fair: Fix O(nr_cgroups) in load balance path") Link: http://lkml.kernel.org/r/1545879866-27809-1-git-send-email-xiexiuqi@huawei.com Signed-off-by: Ingo Molnar <mingo@kernel.org>
static inline bool nohz_idle_balance(struct rq *this_rq, enum cpu_idle_type idle) { return false; }
static inline bool nohz_idle_balance(struct rq *this_rq, enum cpu_idle_type idle) { return false; }
C
linux
0
CVE-2018-20067
https://www.cvedetails.com/cve/CVE-2018-20067/
CWE-254
https://github.com/chromium/chromium/commit/a7d715ae5b654d1f98669fd979a00282a7229044
a7d715ae5b654d1f98669fd979a00282a7229044
Prevent renderer initiated back navigation to cancel a browser one. Renderer initiated back/forward navigations must not be able to cancel ongoing browser initiated navigation if they are not user initiated. Note: 'normal' renderer initiated navigation uses the FrameHost::BeginNavigation() path. A code similar to this patch is done in NavigatorImpl::OnBeginNavigation(). Test: ----- Added: NavigationBrowserTest. * HistoryBackInBeforeUnload * HistoryBackInBeforeUnloadAfterSetTimeout * HistoryBackCancelPendingNavigationNoUserGesture * HistoryBackCancelPendingNavigationUserGesture Fixed: * (WPT) .../the-history-interface/traverse_the_history_2.html * (WPT) .../the-history-interface/traverse_the_history_3.html * (WPT) .../the-history-interface/traverse_the_history_4.html * (WPT) .../the-history-interface/traverse_the_history_5.html Bug: 879965 Change-Id: I1a9bfaaea1ffc219e6c32f6e676b660e746c578c Reviewed-on: https://chromium-review.googlesource.com/1209744 Commit-Queue: Arthur Sonzogni <arthursonzogni@chromium.org> Reviewed-by: Daniel Cheng <dcheng@chromium.org> Reviewed-by: Mustaq Ahmed <mustaq@chromium.org> Reviewed-by: Camille Lamy <clamy@chromium.org> Reviewed-by: Charlie Reis <creis@chromium.org> Cr-Commit-Position: refs/heads/master@{#592823}
void RenderViewImpl::OnMoveOrResizeStarted() { if (webview()) webview()->HidePopups(); }
void RenderViewImpl::OnMoveOrResizeStarted() { if (webview()) webview()->HidePopups(); }
C
Chrome
0
CVE-2018-12904
https://www.cvedetails.com/cve/CVE-2018-12904/
null
https://github.com/torvalds/linux/commit/727ba748e110b4de50d142edca9d6a9b7e6111d8
727ba748e110b4de50d142edca9d6a9b7e6111d8
kvm: nVMX: Enforce cpl=0 for VMX instructions VMX instructions executed inside a L1 VM will always trigger a VM exit even when executed with cpl 3. This means we must perform the privilege check in software. Fixes: 70f3aac964ae("kvm: nVMX: Remove superfluous VMX instruction fault checks") Cc: stable@vger.kernel.org Signed-off-by: Felix Wilhelm <fwilhelm@google.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
static inline void evmcs_write16(unsigned long field, u16 value) {}
static inline void evmcs_write16(unsigned long field, u16 value) {}
C
linux
0
CVE-2018-17206
https://www.cvedetails.com/cve/CVE-2018-17206/
null
https://github.com/openvswitch/ovs/commit/9237a63c47bd314b807cda0bd2216264e82edbe8
9237a63c47bd314b807cda0bd2216264e82edbe8
ofp-actions: Avoid buffer overread in BUNDLE action decoding. Reported-at: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=9052 Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Justin Pettit <jpettit@ovn.org>
parse_METER(char *arg, struct ofpbuf *ofpacts, enum ofputil_protocol *usable_protocols) { *usable_protocols &= OFPUTIL_P_OF13_UP; return str_to_u32(arg, &ofpact_put_METER(ofpacts)->meter_id); }
parse_METER(char *arg, struct ofpbuf *ofpacts, enum ofputil_protocol *usable_protocols) { *usable_protocols &= OFPUTIL_P_OF13_UP; return str_to_u32(arg, &ofpact_put_METER(ofpacts)->meter_id); }
C
ovs
0
CVE-2017-1000198
https://www.cvedetails.com/cve/CVE-2017-1000198/
CWE-119
https://github.com/open-iscsi/tcmu-runner/commit/61bd03e600d2abf309173e9186f4d465bb1b7157
61bd03e600d2abf309173e9186f4d465bb1b7157
glfs: discard glfs_check_config Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>
static int tcmu_glfs_read(struct tcmu_device *dev, struct tcmulib_cmd *cmd, struct iovec *iov, size_t iov_cnt, size_t length, off_t offset) { struct glfs_state *state = tcmu_get_dev_private(dev); glfs_cbk_cookie *cookie; cookie = calloc(1, sizeof(*cookie)); if (!cookie) { tcmu_err("Could not allocate cookie: %m\n"); goto out; } cookie->dev = dev; cookie->cmd = cmd; cookie->length = length; cookie->op = TCMU_GLFS_READ; if (glfs_preadv_async(state->gfd, iov, iov_cnt, offset, SEEK_SET, glfs_async_cbk, cookie) < 0) { tcmu_err("glfs_preadv_async failed: %m\n"); goto out; } return 0; out: free(cookie); return SAM_STAT_TASK_SET_FULL; }
static int tcmu_glfs_read(struct tcmu_device *dev, struct tcmulib_cmd *cmd, struct iovec *iov, size_t iov_cnt, size_t length, off_t offset) { struct glfs_state *state = tcmu_get_dev_private(dev); glfs_cbk_cookie *cookie; cookie = calloc(1, sizeof(*cookie)); if (!cookie) { tcmu_err("Could not allocate cookie: %m\n"); goto out; } cookie->dev = dev; cookie->cmd = cmd; cookie->length = length; cookie->op = TCMU_GLFS_READ; if (glfs_preadv_async(state->gfd, iov, iov_cnt, offset, SEEK_SET, glfs_async_cbk, cookie) < 0) { tcmu_err("glfs_preadv_async failed: %m\n"); goto out; } return 0; out: free(cookie); return SAM_STAT_TASK_SET_FULL; }
C
tcmu-runner
0
CVE-2017-8063
https://www.cvedetails.com/cve/CVE-2017-8063/
CWE-119
https://github.com/torvalds/linux/commit/3f190e3aec212fc8c61e202c51400afa7384d4bc
3f190e3aec212fc8c61e202c51400afa7384d4bc
[media] cxusb: Use a dma capable buffer also for reading Commit 17ce039b4e54 ("[media] cxusb: don't do DMA on stack") added a kmalloc'ed bounce buffer for writes, but missed to do the same for reads. As the read only happens after the write is finished, we can reuse the same buffer. As dvb_usb_generic_rw handles a read length of 0 by itself, avoid calling it using the dvb_usb_generic_read wrapper function. Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
static int dib7070_set_param_override(struct dvb_frontend *fe) { struct dtv_frontend_properties *p = &fe->dtv_property_cache; struct dvb_usb_adapter *adap = fe->dvb->priv; struct dib0700_adapter_state *state = adap->priv; u16 offset; u8 band = BAND_OF_FREQUENCY(p->frequency/1000); switch (band) { case BAND_VHF: offset = 950; break; default: case BAND_UHF: offset = 550; break; } state->dib7000p_ops.set_wbd_ref(fe, offset + dib0070_wbd_offset(fe)); return state->set_param_save(fe); }
static int dib7070_set_param_override(struct dvb_frontend *fe) { struct dtv_frontend_properties *p = &fe->dtv_property_cache; struct dvb_usb_adapter *adap = fe->dvb->priv; struct dib0700_adapter_state *state = adap->priv; u16 offset; u8 band = BAND_OF_FREQUENCY(p->frequency/1000); switch (band) { case BAND_VHF: offset = 950; break; default: case BAND_UHF: offset = 550; break; } state->dib7000p_ops.set_wbd_ref(fe, offset + dib0070_wbd_offset(fe)); return state->set_param_save(fe); }
C
linux
0
null
null
null
https://github.com/chromium/chromium/commit/b9e2ecab97a8a7f3cce06951ab92a3eaef559206
b9e2ecab97a8a7f3cce06951ab92a3eaef559206
Do not discount a MANUAL_SUBFRAME load just because it involved some redirects. R=brettw BUG=21353 TEST=none Review URL: http://codereview.chromium.org/246073 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@27887 0039d316-1c4b-4281-b951-d872f2087c98
bool WebFrameLoaderClient::representationExistsForURLScheme(const String& URLScheme) const { return false; }
bool WebFrameLoaderClient::representationExistsForURLScheme(const String& URLScheme) const { return false; }
C
Chrome
0
CVE-2011-1768
https://www.cvedetails.com/cve/CVE-2011-1768/
CWE-362
https://github.com/torvalds/linux/commit/d5aa407f59f5b83d2c50ec88f5bf56d40f1f8978
d5aa407f59f5b83d2c50ec88f5bf56d40f1f8978
tunnels: fix netns vs proto registration ordering Same stuff as in ip_gre patch: receive hook can be called before netns setup is done, oopsing in net_generic(). Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
static int ip4ip6_rcv(struct sk_buff *skb) { return ip6_tnl_rcv(skb, ETH_P_IP, IPPROTO_IPIP, ip4ip6_dscp_ecn_decapsulate); }
static int ip4ip6_rcv(struct sk_buff *skb) { return ip6_tnl_rcv(skb, ETH_P_IP, IPPROTO_IPIP, ip4ip6_dscp_ecn_decapsulate); }
C
linux
0
CVE-2016-0811
https://www.cvedetails.com/cve/CVE-2016-0811/
CWE-200
https://android.googlesource.com/platform%2Fframeworks%2Fav/+/22f824feac43d5758f9a70b77f2aca840ba62c3b
22f824feac43d5758f9a70b77f2aca840ba62c3b
Fix security vulnerability in ICrypto DO NOT MERGE b/25800375 Change-Id: I03c9395f7c7de4ac5813a1207452aac57aa39484
virtual status_t destroyPlugin() { Parcel data, reply; data.writeInterfaceToken(ICrypto::getInterfaceDescriptor()); remote()->transact(DESTROY_PLUGIN, data, &reply); return reply.readInt32(); }
virtual status_t destroyPlugin() { Parcel data, reply; data.writeInterfaceToken(ICrypto::getInterfaceDescriptor()); remote()->transact(DESTROY_PLUGIN, data, &reply); return reply.readInt32(); }
C
Android
0
CVE-2016-9539
https://www.cvedetails.com/cve/CVE-2016-9539/
CWE-125
https://github.com/vadz/libtiff/commit/ae9365db1b271b62b35ce018eac8799b1d5e8a53
ae9365db1b271b62b35ce018eac8799b1d5e8a53
* tools/tiffcrop.c: fix out-of-bound read of up to 3 bytes in readContigTilesIntoBuffer(). Reported as MSVR 35092 by Axel Souchet & Vishal Chauhan from the MSRC Vulnerabilities & Mitigations team.
static int writeBufferToContigTiles (TIFF* out, uint8* buf, uint32 imagelength, uint32 imagewidth, tsample_t spp, struct dump_opts* dump) { uint16 bps; uint32 tl, tw; uint32 row, col, nrow, ncol; uint32 src_rowsize, col_offset; uint32 tile_rowsize = TIFFTileRowSize(out); uint8* bufp = (uint8*) buf; tsize_t tile_buffsize = 0; tsize_t tilesize = TIFFTileSize(out); unsigned char *tilebuf = NULL; if( !TIFFGetField(out, TIFFTAG_TILELENGTH, &tl) || !TIFFGetField(out, TIFFTAG_TILEWIDTH, &tw) || !TIFFGetField(out, TIFFTAG_BITSPERSAMPLE, &bps) ) return 1; if (tilesize == 0 || tile_rowsize == 0 || tl == 0 || tw == 0) { TIFFError("writeBufferToContigTiles", "Tile size, tile row size, tile width, or tile length is zero"); exit(-1); } tile_buffsize = tilesize; if (tilesize < (tsize_t)(tl * tile_rowsize)) { #ifdef DEBUG2 TIFFError("writeBufferToContigTiles", "Tilesize %lu is too small, using alternate calculation %u", tilesize, tl * tile_rowsize); #endif tile_buffsize = tl * tile_rowsize; if (tl != tile_buffsize / tile_rowsize) { TIFFError("writeBufferToContigTiles", "Integer overflow when calculating buffer size"); exit(-1); } } tilebuf = _TIFFmalloc(tile_buffsize); if (tilebuf == 0) return 1; src_rowsize = ((imagewidth * spp * bps) + 7) / 8; for (row = 0; row < imagelength; row += tl) { nrow = (row + tl > imagelength) ? imagelength - row : tl; for (col = 0; col < imagewidth; col += tw) { /* Calculate visible portion of tile. */ if (col + tw > imagewidth) ncol = imagewidth - col; else ncol = tw; col_offset = (((col * bps * spp) + 7) / 8); bufp = buf + (row * src_rowsize) + col_offset; if (extractContigSamplesToTileBuffer(tilebuf, bufp, nrow, ncol, imagewidth, tw, 0, spp, spp, bps, dump) > 0) { TIFFError("writeBufferToContigTiles", "Unable to extract data to tile for row %lu, col %lu", (unsigned long) row, (unsigned long)col); _TIFFfree(tilebuf); return 1; } if (TIFFWriteTile(out, tilebuf, col, row, 0, 0) < 0) { TIFFError("writeBufferToContigTiles", "Cannot write tile at %lu %lu", (unsigned long) col, (unsigned long) row); _TIFFfree(tilebuf); return 1; } } } _TIFFfree(tilebuf); return 0; } /* end writeBufferToContigTiles */
static int writeBufferToContigTiles (TIFF* out, uint8* buf, uint32 imagelength, uint32 imagewidth, tsample_t spp, struct dump_opts* dump) { uint16 bps; uint32 tl, tw; uint32 row, col, nrow, ncol; uint32 src_rowsize, col_offset; uint32 tile_rowsize = TIFFTileRowSize(out); uint8* bufp = (uint8*) buf; tsize_t tile_buffsize = 0; tsize_t tilesize = TIFFTileSize(out); unsigned char *tilebuf = NULL; if( !TIFFGetField(out, TIFFTAG_TILELENGTH, &tl) || !TIFFGetField(out, TIFFTAG_TILEWIDTH, &tw) || !TIFFGetField(out, TIFFTAG_BITSPERSAMPLE, &bps) ) return 1; if (tilesize == 0 || tile_rowsize == 0 || tl == 0 || tw == 0) { TIFFError("writeBufferToContigTiles", "Tile size, tile row size, tile width, or tile length is zero"); exit(-1); } tile_buffsize = tilesize; if (tilesize < (tsize_t)(tl * tile_rowsize)) { #ifdef DEBUG2 TIFFError("writeBufferToContigTiles", "Tilesize %lu is too small, using alternate calculation %u", tilesize, tl * tile_rowsize); #endif tile_buffsize = tl * tile_rowsize; if (tl != tile_buffsize / tile_rowsize) { TIFFError("writeBufferToContigTiles", "Integer overflow when calculating buffer size"); exit(-1); } } tilebuf = _TIFFmalloc(tile_buffsize); if (tilebuf == 0) return 1; src_rowsize = ((imagewidth * spp * bps) + 7) / 8; for (row = 0; row < imagelength; row += tl) { nrow = (row + tl > imagelength) ? imagelength - row : tl; for (col = 0; col < imagewidth; col += tw) { /* Calculate visible portion of tile. */ if (col + tw > imagewidth) ncol = imagewidth - col; else ncol = tw; col_offset = (((col * bps * spp) + 7) / 8); bufp = buf + (row * src_rowsize) + col_offset; if (extractContigSamplesToTileBuffer(tilebuf, bufp, nrow, ncol, imagewidth, tw, 0, spp, spp, bps, dump) > 0) { TIFFError("writeBufferToContigTiles", "Unable to extract data to tile for row %lu, col %lu", (unsigned long) row, (unsigned long)col); _TIFFfree(tilebuf); return 1; } if (TIFFWriteTile(out, tilebuf, col, row, 0, 0) < 0) { TIFFError("writeBufferToContigTiles", "Cannot write tile at %lu %lu", (unsigned long) col, (unsigned long) row); _TIFFfree(tilebuf); return 1; } } } _TIFFfree(tilebuf); return 0; } /* end writeBufferToContigTiles */
C
libtiff
0
CVE-2013-0904
https://www.cvedetails.com/cve/CVE-2013-0904/
CWE-119
https://github.com/chromium/chromium/commit/b2b21468c1f7f08b30a7c1755316f6026c50eb2a
b2b21468c1f7f08b30a7c1755316f6026c50eb2a
Separate repaint and layout requirements of StyleDifference (Step 1) Previously StyleDifference was an enum that proximately bigger values imply smaller values (e.g. StyleDifferenceLayout implies StyleDifferenceRepaint). This causes unnecessary repaints in some cases on layout change. Convert StyleDifference to a structure containing relatively independent flags. This change doesn't directly improve the result, but can make further repaint optimizations possible. Step 1 doesn't change any functionality. RenderStyle still generate the legacy StyleDifference enum when comparing styles and convert the result to the new StyleDifference. Implicit requirements are not handled during the conversion. Converted call sites to use the new StyleDifference according to the following conversion rules: - diff == StyleDifferenceEqual (&& !context) => diff.hasNoChange() - diff == StyleDifferenceRepaint => diff.needsRepaintObjectOnly() - diff == StyleDifferenceRepaintLayer => diff.needsRepaintLayer() - diff == StyleDifferenceRepaint || diff == StyleDifferenceRepaintLayer => diff.needsRepaintLayer() - diff >= StyleDifferenceRepaint => diff.needsRepaint() || diff.needsLayout() - diff >= StyleDifferenceRepaintLayer => diff.needsRepaintLayer() || diff.needsLayout() - diff > StyleDifferenceRepaintLayer => diff.needsLayout() - diff == StyleDifferencePositionedMovementLayoutOnly => diff.needsPositionedMovementLayoutOnly() - diff == StyleDifferenceLayout => diff.needsFullLayout() BUG=358460 TEST=All existing layout tests. R=eseidel@chromium.org, esprehn@chromium.org, jchaffraix@chromium.org Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=171983 Review URL: https://codereview.chromium.org/236203020 git-svn-id: svn://svn.chromium.org/blink/trunk@172331 bbb929c8-8fbe-4397-9dbb-9b2b20218538
static inline int adjustedScrollDelta(int beginningDelta) { const int speedReducer = 12; int adjustedDelta = beginningDelta / speedReducer; if (adjustedDelta > 1) adjustedDelta = static_cast<int>(adjustedDelta * sqrt(static_cast<double>(adjustedDelta))) - 1; else if (adjustedDelta < -1) adjustedDelta = static_cast<int>(adjustedDelta * sqrt(static_cast<double>(-adjustedDelta))) + 1; return adjustedDelta; }
static inline int adjustedScrollDelta(int beginningDelta) { const int speedReducer = 12; int adjustedDelta = beginningDelta / speedReducer; if (adjustedDelta > 1) adjustedDelta = static_cast<int>(adjustedDelta * sqrt(static_cast<double>(adjustedDelta))) - 1; else if (adjustedDelta < -1) adjustedDelta = static_cast<int>(adjustedDelta * sqrt(static_cast<double>(-adjustedDelta))) + 1; return adjustedDelta; }
C
Chrome
0
CVE-2011-2875
https://www.cvedetails.com/cve/CVE-2011-2875/
CWE-20
https://github.com/chromium/chromium/commit/ab5e55ff333def909d025ac45da9ffa0d88a63f2
ab5e55ff333def909d025ac45da9ffa0d88a63f2
Unreviewed, rolling out r127612, r127660, and r127664. http://trac.webkit.org/changeset/127612 http://trac.webkit.org/changeset/127660 http://trac.webkit.org/changeset/127664 https://bugs.webkit.org/show_bug.cgi?id=95920 Source/Platform: * Platform.gypi: * chromium/public/WebRTCPeerConnectionHandler.h: (WebKit): (WebRTCPeerConnectionHandler): * chromium/public/WebRTCVoidRequest.h: Removed. Source/WebCore: * CMakeLists.txt: * GNUmakefile.list.am: * Modules/mediastream/RTCErrorCallback.h: (WebCore): (RTCErrorCallback): * Modules/mediastream/RTCErrorCallback.idl: * Modules/mediastream/RTCPeerConnection.cpp: (WebCore::RTCPeerConnection::createOffer): * Modules/mediastream/RTCPeerConnection.h: (WebCore): (RTCPeerConnection): * Modules/mediastream/RTCPeerConnection.idl: * Modules/mediastream/RTCSessionDescriptionCallback.h: (WebCore): (RTCSessionDescriptionCallback): * Modules/mediastream/RTCSessionDescriptionCallback.idl: * Modules/mediastream/RTCSessionDescriptionRequestImpl.cpp: (WebCore::RTCSessionDescriptionRequestImpl::create): (WebCore::RTCSessionDescriptionRequestImpl::RTCSessionDescriptionRequestImpl): (WebCore::RTCSessionDescriptionRequestImpl::requestSucceeded): (WebCore::RTCSessionDescriptionRequestImpl::requestFailed): (WebCore::RTCSessionDescriptionRequestImpl::clear): * Modules/mediastream/RTCSessionDescriptionRequestImpl.h: (RTCSessionDescriptionRequestImpl): * Modules/mediastream/RTCVoidRequestImpl.cpp: Removed. * Modules/mediastream/RTCVoidRequestImpl.h: Removed. * WebCore.gypi: * platform/chromium/support/WebRTCVoidRequest.cpp: Removed. * platform/mediastream/RTCPeerConnectionHandler.cpp: (RTCPeerConnectionHandlerDummy): (WebCore::RTCPeerConnectionHandlerDummy::RTCPeerConnectionHandlerDummy): * platform/mediastream/RTCPeerConnectionHandler.h: (WebCore): (WebCore::RTCPeerConnectionHandler::~RTCPeerConnectionHandler): (RTCPeerConnectionHandler): (WebCore::RTCPeerConnectionHandler::RTCPeerConnectionHandler): * platform/mediastream/RTCVoidRequest.h: Removed. * platform/mediastream/chromium/RTCPeerConnectionHandlerChromium.cpp: * platform/mediastream/chromium/RTCPeerConnectionHandlerChromium.h: (RTCPeerConnectionHandlerChromium): Tools: * DumpRenderTree/chromium/MockWebRTCPeerConnectionHandler.cpp: (MockWebRTCPeerConnectionHandler::SuccessCallbackTask::SuccessCallbackTask): (MockWebRTCPeerConnectionHandler::SuccessCallbackTask::runIfValid): (MockWebRTCPeerConnectionHandler::FailureCallbackTask::FailureCallbackTask): (MockWebRTCPeerConnectionHandler::FailureCallbackTask::runIfValid): (MockWebRTCPeerConnectionHandler::createOffer): * DumpRenderTree/chromium/MockWebRTCPeerConnectionHandler.h: (MockWebRTCPeerConnectionHandler): (SuccessCallbackTask): (FailureCallbackTask): LayoutTests: * fast/mediastream/RTCPeerConnection-createOffer.html: * fast/mediastream/RTCPeerConnection-localDescription-expected.txt: Removed. * fast/mediastream/RTCPeerConnection-localDescription.html: Removed. * fast/mediastream/RTCPeerConnection-remoteDescription-expected.txt: Removed. * fast/mediastream/RTCPeerConnection-remoteDescription.html: Removed. git-svn-id: svn://svn.chromium.org/blink/trunk@127679 bbb929c8-8fbe-4397-9dbb-9b2b20218538
void WebRTCVoidRequest::requestFailed(const WebString& error) const { ASSERT(m_private.get()); m_private->requestFailed(error); }
void WebRTCVoidRequest::requestFailed(const WebString& error) const { ASSERT(m_private.get()); m_private->requestFailed(error); }
C
Chrome
0
CVE-2015-1213
https://www.cvedetails.com/cve/CVE-2015-1213/
CWE-119
https://github.com/chromium/chromium/commit/faaa2fd0a05f1622d9a8806da118d4f3b602e707
faaa2fd0a05f1622d9a8806da118d4f3b602e707
[Blink>Media] Allow autoplay muted on Android by default There was a mistake causing autoplay muted is shipped on Android but it will be disabled if the chromium embedder doesn't specify content setting for "AllowAutoplay" preference. This CL makes the AllowAutoplay preference true by default so that it is allowed by embedders (including AndroidWebView) unless they explicitly disable it. Intent to ship: https://groups.google.com/a/chromium.org/d/msg/blink-dev/Q1cnzNI2GpI/AL_eyUNABgAJ BUG=689018 Review-Url: https://codereview.chromium.org/2677173002 Cr-Commit-Position: refs/heads/master@{#448423}
void HTMLMediaElement::createPlaceholderTracksIfNecessary() { if (!mediaTracksEnabledInternally()) return; if (hasAudio() && !audioTracks().length()) { addAudioTrack("audio", WebMediaPlayerClient::AudioTrackKindMain, "Audio Track", "", false); } if (hasVideo() && !videoTracks().length()) { addVideoTrack("video", WebMediaPlayerClient::VideoTrackKindMain, "Video Track", "", false); } }
void HTMLMediaElement::createPlaceholderTracksIfNecessary() { if (!mediaTracksEnabledInternally()) return; if (hasAudio() && !audioTracks().length()) { addAudioTrack("audio", WebMediaPlayerClient::AudioTrackKindMain, "Audio Track", "", false); } if (hasVideo() && !videoTracks().length()) { addVideoTrack("video", WebMediaPlayerClient::VideoTrackKindMain, "Video Track", "", false); } }
C
Chrome
0
CVE-2015-1790
https://www.cvedetails.com/cve/CVE-2015-1790/
null
https://github.com/openssl/openssl/commit/59302b600e8d5b77ef144e447bb046fd7ab72686
59302b600e8d5b77ef144e447bb046fd7ab72686
PKCS#7: Fix NULL dereference with missing EncryptedContent. CVE-2015-1790 Reviewed-by: Rich Salz <rsalz@openssl.org>
static ASN1_TYPE *get_attribute(STACK_OF(X509_ATTRIBUTE) *sk, int nid) { int idx; X509_ATTRIBUTE *xa; idx = X509at_get_attr_by_NID(sk, nid, -1); xa = X509at_get_attr(sk, idx); return X509_ATTRIBUTE_get0_type(xa, 0); }
static ASN1_TYPE *get_attribute(STACK_OF(X509_ATTRIBUTE) *sk, int nid) { int idx; X509_ATTRIBUTE *xa; idx = X509at_get_attr_by_NID(sk, nid, -1); xa = X509at_get_attr(sk, idx); return X509_ATTRIBUTE_get0_type(xa, 0); }
C
openssl
0
CVE-2013-2635
https://www.cvedetails.com/cve/CVE-2013-2635/
CWE-399
https://github.com/torvalds/linux/commit/84d73cd3fb142bf1298a8c13fd4ca50fd2432372
84d73cd3fb142bf1298a8c13fd4ca50fd2432372
rtnl: fix info leak on RTM_GETLINK request for VF devices Initialize the mac address buffer with 0 as the driver specific function will probably not fill the whole buffer. In fact, all in-kernel drivers fill only ETH_ALEN of the MAX_ADDR_LEN bytes, i.e. 6 of the 32 possible bytes. Therefore we currently leak 26 bytes of stack memory to userland via the netlink interface. Signed-off-by: Mathias Krause <minipli@googlemail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
static int rtnl_bridge_notify(struct net_device *dev, u16 flags) { struct net *net = dev_net(dev); struct net_device *br_dev = netdev_master_upper_dev_get(dev); struct sk_buff *skb; int err = -EOPNOTSUPP; skb = nlmsg_new(bridge_nlmsg_size(), GFP_ATOMIC); if (!skb) { err = -ENOMEM; goto errout; } if ((!flags || (flags & BRIDGE_FLAGS_MASTER)) && br_dev && br_dev->netdev_ops->ndo_bridge_getlink) { err = br_dev->netdev_ops->ndo_bridge_getlink(skb, 0, 0, dev, 0); if (err < 0) goto errout; } if ((flags & BRIDGE_FLAGS_SELF) && dev->netdev_ops->ndo_bridge_getlink) { err = dev->netdev_ops->ndo_bridge_getlink(skb, 0, 0, dev, 0); if (err < 0) goto errout; } rtnl_notify(skb, net, 0, RTNLGRP_LINK, NULL, GFP_ATOMIC); return 0; errout: WARN_ON(err == -EMSGSIZE); kfree_skb(skb); rtnl_set_sk_err(net, RTNLGRP_LINK, err); return err; }
static int rtnl_bridge_notify(struct net_device *dev, u16 flags) { struct net *net = dev_net(dev); struct net_device *br_dev = netdev_master_upper_dev_get(dev); struct sk_buff *skb; int err = -EOPNOTSUPP; skb = nlmsg_new(bridge_nlmsg_size(), GFP_ATOMIC); if (!skb) { err = -ENOMEM; goto errout; } if ((!flags || (flags & BRIDGE_FLAGS_MASTER)) && br_dev && br_dev->netdev_ops->ndo_bridge_getlink) { err = br_dev->netdev_ops->ndo_bridge_getlink(skb, 0, 0, dev, 0); if (err < 0) goto errout; } if ((flags & BRIDGE_FLAGS_SELF) && dev->netdev_ops->ndo_bridge_getlink) { err = dev->netdev_ops->ndo_bridge_getlink(skb, 0, 0, dev, 0); if (err < 0) goto errout; } rtnl_notify(skb, net, 0, RTNLGRP_LINK, NULL, GFP_ATOMIC); return 0; errout: WARN_ON(err == -EMSGSIZE); kfree_skb(skb); rtnl_set_sk_err(net, RTNLGRP_LINK, err); return err; }
C
linux
0
CVE-2016-9793
https://www.cvedetails.com/cve/CVE-2016-9793/
CWE-119
https://github.com/torvalds/linux/commit/b98b0bc8c431e3ceb4b26b0dfc8db509518fb290
b98b0bc8c431e3ceb4b26b0dfc8db509518fb290
net: avoid signed overflows for SO_{SND|RCV}BUFFORCE CAP_NET_ADMIN users should not be allowed to set negative sk_sndbuf or sk_rcvbuf values, as it can lead to various memory corruptions, crashes, OOM... Note that before commit 82981930125a ("net: cleanups in sock_setsockopt()"), the bug was even more serious, since SO_SNDBUF and SO_RCVBUF were vulnerable. This needs to be backported to all known linux kernels. Again, many thanks to syzkaller team for discovering this gem. Signed-off-by: Eric Dumazet <edumazet@google.com> Reported-by: Andrey Konovalov <andreyknvl@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
static void __sk_free(struct sock *sk) { if (unlikely(sock_diag_has_destroy_listeners(sk) && sk->sk_net_refcnt)) sock_diag_broadcast_destroy(sk); else sk_destruct(sk); }
static void __sk_free(struct sock *sk) { if (unlikely(sock_diag_has_destroy_listeners(sk) && sk->sk_net_refcnt)) sock_diag_broadcast_destroy(sk); else sk_destruct(sk); }
C
linux
0
CVE-2014-0221
https://www.cvedetails.com/cve/CVE-2014-0221/
CWE-399
https://git.openssl.org/gitweb/?p=openssl.git;a=commit;h=d3152655d5319ce883c8e3ac4b99f8de4c59d846
d3152655d5319ce883c8e3ac4b99f8de4c59d846
null
dtls1_write_message_header(SSL *s, unsigned char *p) { struct hm_header_st *msg_hdr = &s->d1->w_msg_hdr; *p++ = msg_hdr->type; l2n3(msg_hdr->msg_len, p); s2n(msg_hdr->seq, p); l2n3(msg_hdr->frag_off, p); l2n3(msg_hdr->frag_len, p); return p; }
dtls1_write_message_header(SSL *s, unsigned char *p) { struct hm_header_st *msg_hdr = &s->d1->w_msg_hdr; *p++ = msg_hdr->type; l2n3(msg_hdr->msg_len, p); s2n(msg_hdr->seq, p); l2n3(msg_hdr->frag_off, p); l2n3(msg_hdr->frag_len, p); return p; }
C
openssl
0
null
null
null
https://github.com/chromium/chromium/commit/a0fe4d88137213aa24fbb16fd7eec34533345c9b
a0fe4d88137213aa24fbb16fd7eec34533345c9b
Move supports-high-dpi flag into registry. Calls to SetProcessDpiAwareness need to happen immediately when the app starts. Specifically, before user profile settings have been initialized. This patch moves the --supports-high-dpi into the registry. BUG=339152, 149881, 160457 Review URL: https://codereview.chromium.org/153403003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@256811 0039d316-1c4b-4281-b951-d872f2087c98
void PerformTestWithLeftRightRects(const gfx::Size& html_rect_size, const gfx::Rect& copy_rect, const gfx::Size& output_size, const gfx::Size& expected_bitmap_size, bool video_frame) { const gfx::Size box_size(html_rect_size.width() / 2, html_rect_size.height()); SetTestUrl(base::StringPrintf( "data:text/html,<!doctype html>" "<div class='left'>" " <div class='right'></div>" "</div>" "<style>" "body { padding: 0; margin: 0; }" ".left { position: absolute;" " background: #0ff;" " width: %dpx;" " height: %dpx;" "}" ".right { position: absolute;" " left: %dpx;" " background: #ff0;" " width: %dpx;" " height: %dpx;" "}" "</style>" "<script>" " domAutomationController.setAutomationId(0);" " domAutomationController.send(\"DONE\");" "</script>", box_size.width(), box_size.height(), box_size.width(), box_size.width(), box_size.height())); SET_UP_SURFACE_OR_PASS_TEST("\"DONE\""); if (!ShouldContinueAfterTestURLLoad()) return; RenderWidgetHostViewPort* rwhvp = GetRenderWidgetHostViewPort(); if (video_frame && !rwhvp->CanCopyToVideoFrame()) { #if defined(OS_MACOSX) if (!content::GpuDataManager::GetInstance()->GpuAccessAllowed(NULL)) { LOG(WARNING) << ("Blindly passing this test because copying to " "video frames is not supported on this platform."); return; } #endif NOTREACHED(); } uint32 frame = rwhvp->RendererFrameNumber(); while (!GetRenderWidgetHost()->ScheduleComposite()) GiveItSomeTime(); while (rwhvp->RendererFrameNumber() == frame) GiveItSomeTime(); SkBitmap expected_bitmap; SetupLeftRightBitmap(expected_bitmap_size, &expected_bitmap); SetExpectedCopyFromCompositingSurfaceResult(true, expected_bitmap); base::RunLoop run_loop; if (video_frame) { SetAllowableError(0x10); SetExcludeRect( gfx::Rect(output_size.width() / 2 - 1, 0, 2, output_size.height())); scoped_refptr<media::VideoFrame> video_frame = media::VideoFrame::CreateFrame(media::VideoFrame::YV12, expected_bitmap_size, gfx::Rect(expected_bitmap_size), expected_bitmap_size, base::TimeDelta()); base::Callback<void(bool success)> callback = base::Bind(&CompositingRenderWidgetHostViewBrowserTestTabCapture:: CopyFromCompositingSurfaceCallbackForVideo, base::Unretained(this), video_frame, run_loop.QuitClosure()); rwhvp->CopyFromCompositingSurfaceToVideoFrame(copy_rect, video_frame, callback); } else { #if defined(USE_AURA) if (!content::GpuDataManager::GetInstance() ->CanUseGpuBrowserCompositor()) { SetAllowableError(2); SetExcludeRect( gfx::Rect(output_size.width() / 2 - 1, 0, 2, output_size.height())); } #endif base::Callback<void(bool, const SkBitmap&)> callback = base::Bind(&CompositingRenderWidgetHostViewBrowserTestTabCapture:: CopyFromCompositingSurfaceCallback, base::Unretained(this), run_loop.QuitClosure()); rwhvp->CopyFromCompositingSurface(copy_rect, output_size, callback, SkBitmap::kARGB_8888_Config); } run_loop.Run(); }
void PerformTestWithLeftRightRects(const gfx::Size& html_rect_size, const gfx::Rect& copy_rect, const gfx::Size& output_size, const gfx::Size& expected_bitmap_size, bool video_frame) { const gfx::Size box_size(html_rect_size.width() / 2, html_rect_size.height()); SetTestUrl(base::StringPrintf( "data:text/html,<!doctype html>" "<div class='left'>" " <div class='right'></div>" "</div>" "<style>" "body { padding: 0; margin: 0; }" ".left { position: absolute;" " background: #0ff;" " width: %dpx;" " height: %dpx;" "}" ".right { position: absolute;" " left: %dpx;" " background: #ff0;" " width: %dpx;" " height: %dpx;" "}" "</style>" "<script>" " domAutomationController.setAutomationId(0);" " domAutomationController.send(\"DONE\");" "</script>", box_size.width(), box_size.height(), box_size.width(), box_size.width(), box_size.height())); SET_UP_SURFACE_OR_PASS_TEST("\"DONE\""); if (!ShouldContinueAfterTestURLLoad()) return; RenderWidgetHostViewPort* rwhvp = GetRenderWidgetHostViewPort(); if (video_frame && !rwhvp->CanCopyToVideoFrame()) { #if defined(OS_MACOSX) if (!content::GpuDataManager::GetInstance()->GpuAccessAllowed(NULL)) { LOG(WARNING) << ("Blindly passing this test because copying to " "video frames is not supported on this platform."); return; } #endif NOTREACHED(); } uint32 frame = rwhvp->RendererFrameNumber(); while (!GetRenderWidgetHost()->ScheduleComposite()) GiveItSomeTime(); while (rwhvp->RendererFrameNumber() == frame) GiveItSomeTime(); SkBitmap expected_bitmap; SetupLeftRightBitmap(expected_bitmap_size, &expected_bitmap); SetExpectedCopyFromCompositingSurfaceResult(true, expected_bitmap); base::RunLoop run_loop; if (video_frame) { SetAllowableError(0x10); SetExcludeRect( gfx::Rect(output_size.width() / 2 - 1, 0, 2, output_size.height())); scoped_refptr<media::VideoFrame> video_frame = media::VideoFrame::CreateFrame(media::VideoFrame::YV12, expected_bitmap_size, gfx::Rect(expected_bitmap_size), expected_bitmap_size, base::TimeDelta()); base::Callback<void(bool success)> callback = base::Bind(&CompositingRenderWidgetHostViewBrowserTestTabCapture:: CopyFromCompositingSurfaceCallbackForVideo, base::Unretained(this), video_frame, run_loop.QuitClosure()); rwhvp->CopyFromCompositingSurfaceToVideoFrame(copy_rect, video_frame, callback); } else { #if defined(USE_AURA) if (!content::GpuDataManager::GetInstance() ->CanUseGpuBrowserCompositor()) { SetAllowableError(2); SetExcludeRect( gfx::Rect(output_size.width() / 2 - 1, 0, 2, output_size.height())); } #endif base::Callback<void(bool, const SkBitmap&)> callback = base::Bind(&CompositingRenderWidgetHostViewBrowserTestTabCapture:: CopyFromCompositingSurfaceCallback, base::Unretained(this), run_loop.QuitClosure()); rwhvp->CopyFromCompositingSurface(copy_rect, output_size, callback, SkBitmap::kARGB_8888_Config); } run_loop.Run(); }
C
Chrome
0
CVE-2011-1296
https://www.cvedetails.com/cve/CVE-2011-1296/
CWE-20
https://github.com/chromium/chromium/commit/c90c6ca59378d7e86d1a2f28fe96bada35df1508
c90c6ca59378d7e86d1a2f28fe96bada35df1508
Rename the TabContentWrapper pieces to be "TabHelper"s. (Except for the PasswordManager... for now.) Also, just pre-create them up-front. It saves us effort, as they're all going to be eventually created anyway, so being lazy saves us nothing and creates headaches since the rules about what can be lazy differ from feature to feature. BUG=71097 TEST=zero visible change Review URL: http://codereview.chromium.org/6480117 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@75170 0039d316-1c4b-4281-b951-d872f2087c98
AutomationProvider::~AutomationProvider() { STLDeleteContainerPairSecondPointers(port_containers_.begin(), port_containers_.end()); port_containers_.clear(); if (channel_.get()) channel_->Close(); g_browser_process->ReleaseModule(); }
AutomationProvider::~AutomationProvider() { STLDeleteContainerPairSecondPointers(port_containers_.begin(), port_containers_.end()); port_containers_.clear(); if (channel_.get()) channel_->Close(); g_browser_process->ReleaseModule(); }
C
Chrome
0
CVE-2013-0842
https://www.cvedetails.com/cve/CVE-2013-0842/
null
https://github.com/chromium/chromium/commit/10cbaf017570ba6454174c55b844647aa6a9b3b4
10cbaf017570ba6454174c55b844647aa6a9b3b4
Validate that paths don't contain embedded NULLs at deserialization. BUG=166867 Review URL: https://chromiumcodereview.appspot.com/11743009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@174935 0039d316-1c4b-4281-b951-d872f2087c98
void ParamTraits<base::FileDescriptor>::Log(const param_type& p, std::string* l) { if (p.auto_close) { l->append(StringPrintf("FD(%d auto-close)", p.fd)); } else { l->append(StringPrintf("FD(%d)", p.fd)); } }
void ParamTraits<base::FileDescriptor>::Log(const param_type& p, std::string* l) { if (p.auto_close) { l->append(StringPrintf("FD(%d auto-close)", p.fd)); } else { l->append(StringPrintf("FD(%d)", p.fd)); } }
C
Chrome
0
null
null
null
https://github.com/chromium/chromium/commit/8353baf8d1504dbdd4ad7584ff2466de657521cd
8353baf8d1504dbdd4ad7584ff2466de657521cd
Remove WebFrame::canHaveSecureChild To simplify the public API, ServiceWorkerNetworkProvider can do the parent walk itself. Follow-up to https://crrev.com/ad1850962644e19. BUG=607543 Review-Url: https://codereview.chromium.org/2082493002 Cr-Commit-Position: refs/heads/master@{#400896}
void WebFrame::insertAfter(WebFrame* newChild, WebFrame* previousSibling) { newChild->m_parent = this; WebFrame* next; if (!previousSibling) { next = m_firstChild; m_firstChild = newChild; } else { DCHECK_EQ(previousSibling->m_parent, this); next = previousSibling->m_nextSibling; previousSibling->m_nextSibling = newChild; newChild->m_previousSibling = previousSibling; } if (next) { newChild->m_nextSibling = next; next->m_previousSibling = newChild; } else { m_lastChild = newChild; } toImplBase()->frame()->tree().invalidateScopedChildCount(); toImplBase()->frame()->host()->incrementSubframeCount(); }
void WebFrame::insertAfter(WebFrame* newChild, WebFrame* previousSibling) { newChild->m_parent = this; WebFrame* next; if (!previousSibling) { next = m_firstChild; m_firstChild = newChild; } else { DCHECK_EQ(previousSibling->m_parent, this); next = previousSibling->m_nextSibling; previousSibling->m_nextSibling = newChild; newChild->m_previousSibling = previousSibling; } if (next) { newChild->m_nextSibling = next; next->m_previousSibling = newChild; } else { m_lastChild = newChild; } toImplBase()->frame()->tree().invalidateScopedChildCount(); toImplBase()->frame()->host()->incrementSubframeCount(); }
C
Chrome
0
CVE-2011-4621
https://www.cvedetails.com/cve/CVE-2011-4621/
null
https://github.com/torvalds/linux/commit/f26f9aff6aaf67e9a430d16c266f91b13a5bff64
f26f9aff6aaf67e9a430d16c266f91b13a5bff64
Sched: fix skip_clock_update optimization idle_balance() drops/retakes rq->lock, leaving the previous task vulnerable to set_tsk_need_resched(). Clear it after we return from balancing instead, and in setup_thread_stack() as well, so no successfully descheduled or never scheduled task has it set. Need resched confused the skip_clock_update logic, which assumes that the next call to update_rq_clock() will come nearly immediately after being set. Make the optimization robust against the waking a sleeper before it sucessfully deschedules case by checking that the current task has not been dequeued before setting the flag, since it is that useless clock update we're trying to save, and clear unconditionally in schedule() proper instead of conditionally in put_prev_task(). Signed-off-by: Mike Galbraith <efault@gmx.de> Reported-by: Bjoern B. Brandenburg <bbb.lst@gmail.com> Tested-by: Yong Zhang <yong.zhang0@gmail.com> Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: stable@kernel.org LKML-Reference: <1291802742.1417.9.camel@marge.simson.net> Signed-off-by: Ingo Molnar <mingo@elte.hu>
static unsigned long cpu_avg_load_per_task(int cpu) { struct rq *rq = cpu_rq(cpu); unsigned long nr_running = ACCESS_ONCE(rq->nr_running); if (nr_running) rq->avg_load_per_task = rq->load.weight / nr_running; else rq->avg_load_per_task = 0; return rq->avg_load_per_task; }
static unsigned long cpu_avg_load_per_task(int cpu) { struct rq *rq = cpu_rq(cpu); unsigned long nr_running = ACCESS_ONCE(rq->nr_running); if (nr_running) rq->avg_load_per_task = rq->load.weight / nr_running; else rq->avg_load_per_task = 0; return rq->avg_load_per_task; }
C
linux
0
CVE-2011-2699
https://www.cvedetails.com/cve/CVE-2011-2699/
null
https://github.com/torvalds/linux/commit/87c48fa3b4630905f98268dde838ee43626a060c
87c48fa3b4630905f98268dde838ee43626a060c
ipv6: make fragment identifications less predictable IPv6 fragment identification generation is way beyond what we use for IPv4 : It uses a single generator. Its not scalable and allows DOS attacks. Now inetpeer is IPv6 aware, we can use it to provide a more secure and scalable frag ident generator (per destination, instead of system wide) This patch : 1) defines a new secure_ipv6_id() helper 2) extends inet_getid() to provide 32bit results 3) extends ipv6_select_ident() with a new dest parameter Reported-by: Fernando Gont <fernando@gont.com.ar> Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
struct inet_peer *inet_getpeer(struct inetpeer_addr *daddr, int create) struct inet_peer *inet_getpeer(const struct inetpeer_addr *daddr, int create) { struct inet_peer __rcu **stack[PEER_MAXDEPTH], ***stackptr; struct inet_peer_base *base = family_to_base(daddr->family); struct inet_peer *p; unsigned int sequence; int invalidated, gccnt = 0; /* Attempt a lockless lookup first. * Because of a concurrent writer, we might not find an existing entry. */ rcu_read_lock(); sequence = read_seqbegin(&base->lock); p = lookup_rcu(daddr, base); invalidated = read_seqretry(&base->lock, sequence); rcu_read_unlock(); if (p) return p; /* If no writer did a change during our lookup, we can return early. */ if (!create && !invalidated) return NULL; /* retry an exact lookup, taking the lock before. * At least, nodes should be hot in our cache. */ write_seqlock_bh(&base->lock); relookup: p = lookup(daddr, stack, base); if (p != peer_avl_empty) { atomic_inc(&p->refcnt); write_sequnlock_bh(&base->lock); return p; } if (!gccnt) { gccnt = inet_peer_gc(base, stack, stackptr); if (gccnt && create) goto relookup; } p = create ? kmem_cache_alloc(peer_cachep, GFP_ATOMIC) : NULL; if (p) { p->daddr = *daddr; atomic_set(&p->refcnt, 1); atomic_set(&p->rid, 0); atomic_set(&p->ip_id_count, (daddr->family == AF_INET) ? secure_ip_id(daddr->addr.a4) : secure_ipv6_id(daddr->addr.a6)); p->tcp_ts_stamp = 0; p->metrics[RTAX_LOCK-1] = INETPEER_METRICS_NEW; p->rate_tokens = 0; p->rate_last = 0; p->pmtu_expires = 0; p->pmtu_orig = 0; memset(&p->redirect_learned, 0, sizeof(p->redirect_learned)); /* Link the node. */ link_to_pool(p, base); base->total++; } write_sequnlock_bh(&base->lock); return p; }
struct inet_peer *inet_getpeer(struct inetpeer_addr *daddr, int create) { struct inet_peer __rcu **stack[PEER_MAXDEPTH], ***stackptr; struct inet_peer_base *base = family_to_base(daddr->family); struct inet_peer *p; unsigned int sequence; int invalidated, gccnt = 0; /* Attempt a lockless lookup first. * Because of a concurrent writer, we might not find an existing entry. */ rcu_read_lock(); sequence = read_seqbegin(&base->lock); p = lookup_rcu(daddr, base); invalidated = read_seqretry(&base->lock, sequence); rcu_read_unlock(); if (p) return p; /* If no writer did a change during our lookup, we can return early. */ if (!create && !invalidated) return NULL; /* retry an exact lookup, taking the lock before. * At least, nodes should be hot in our cache. */ write_seqlock_bh(&base->lock); relookup: p = lookup(daddr, stack, base); if (p != peer_avl_empty) { atomic_inc(&p->refcnt); write_sequnlock_bh(&base->lock); return p; } if (!gccnt) { gccnt = inet_peer_gc(base, stack, stackptr); if (gccnt && create) goto relookup; } p = create ? kmem_cache_alloc(peer_cachep, GFP_ATOMIC) : NULL; if (p) { p->daddr = *daddr; atomic_set(&p->refcnt, 1); atomic_set(&p->rid, 0); atomic_set(&p->ip_id_count, secure_ip_id(daddr->addr.a4)); p->tcp_ts_stamp = 0; p->metrics[RTAX_LOCK-1] = INETPEER_METRICS_NEW; p->rate_tokens = 0; p->rate_last = 0; p->pmtu_expires = 0; p->pmtu_orig = 0; memset(&p->redirect_learned, 0, sizeof(p->redirect_learned)); /* Link the node. */ link_to_pool(p, base); base->total++; } write_sequnlock_bh(&base->lock); return p; }
C
linux
1