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-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 <[email protected]>
Reviewed-by: Daniel Cheng <[email protected]>
Reviewed-by: Camille Lamy <[email protected]>
Cr-Commit-Position: refs/heads/master@{#653137}
|
void RenderFrameImpl::BindWidget(mojom::WidgetRequest request) {
GetLocalRootRenderWidget()->SetWidgetBinding(std::move(request));
}
|
void RenderFrameImpl::BindWidget(mojom::WidgetRequest request) {
GetLocalRootRenderWidget()->SetWidgetBinding(std::move(request));
}
|
C
|
Chrome
| 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 <[email protected]>
Signed-off-by: Herbert Xu <[email protected]>
|
static int sha512_neon_import(struct shash_desc *desc, const void *in)
{
struct sha512_state *sctx = shash_desc_ctx(desc);
memcpy(sctx, in, sizeof(*sctx));
return 0;
}
|
static int sha512_neon_import(struct shash_desc *desc, const void *in)
{
struct sha512_state *sctx = shash_desc_ctx(desc);
memcpy(sctx, in, sizeof(*sctx));
return 0;
}
|
C
|
linux
| 0 |
CVE-2014-2706
|
https://www.cvedetails.com/cve/CVE-2014-2706/
|
CWE-362
|
https://github.com/torvalds/linux/commit/1d147bfa64293b2723c4fec50922168658e613ba
|
1d147bfa64293b2723c4fec50922168658e613ba
|
mac80211: fix AP powersave TX vs. wakeup race
There is a race between the TX path and the STA wakeup: while
a station is sleeping, mac80211 buffers frames until it wakes
up, then the frames are transmitted. However, the RX and TX
path are concurrent, so the packet indicating wakeup can be
processed while a packet is being transmitted.
This can lead to a situation where the buffered frames list
is emptied on the one side, while a frame is being added on
the other side, as the station is still seen as sleeping in
the TX path.
As a result, the newly added frame will not be send anytime
soon. It might be sent much later (and out of order) when the
station goes to sleep and wakes up the next time.
Additionally, it can lead to the crash below.
Fix all this by synchronising both paths with a new lock.
Both path are not fastpath since they handle PS situations.
In a later patch we'll remove the extra skb queue locks to
reduce locking overhead.
BUG: unable to handle kernel
NULL pointer dereference at 000000b0
IP: [<ff6f1791>] ieee80211_report_used_skb+0x11/0x3e0 [mac80211]
*pde = 00000000
Oops: 0000 [#1] SMP DEBUG_PAGEALLOC
EIP: 0060:[<ff6f1791>] EFLAGS: 00210282 CPU: 1
EIP is at ieee80211_report_used_skb+0x11/0x3e0 [mac80211]
EAX: e5900da0 EBX: 00000000 ECX: 00000001 EDX: 00000000
ESI: e41d00c0 EDI: e5900da0 EBP: ebe458e4 ESP: ebe458b0
DS: 007b ES: 007b FS: 00d8 GS: 00e0 SS: 0068
CR0: 8005003b CR2: 000000b0 CR3: 25a78000 CR4: 000407d0
DR0: 00000000 DR1: 00000000 DR2: 00000000 DR3: 00000000
DR6: ffff0ff0 DR7: 00000400
Process iperf (pid: 3934, ti=ebe44000 task=e757c0b0 task.ti=ebe44000)
iwlwifi 0000:02:00.0: I iwl_pcie_enqueue_hcmd Sending command LQ_CMD (#4e), seq: 0x0903, 92 bytes at 3[3]:9
Stack:
e403b32c ebe458c4 00200002 00200286 e403b338 ebe458cc c10960bb e5900da0
ff76a6ec ebe458d8 00000000 e41d00c0 e5900da0 ebe458f0 ff6f1b75 e403b210
ebe4598c ff723dc1 00000000 ff76a6ec e597c978 e403b758 00000002 00000002
Call Trace:
[<ff6f1b75>] ieee80211_free_txskb+0x15/0x20 [mac80211]
[<ff723dc1>] invoke_tx_handlers+0x1661/0x1780 [mac80211]
[<ff7248a5>] ieee80211_tx+0x75/0x100 [mac80211]
[<ff7249bf>] ieee80211_xmit+0x8f/0xc0 [mac80211]
[<ff72550e>] ieee80211_subif_start_xmit+0x4fe/0xe20 [mac80211]
[<c149ef70>] dev_hard_start_xmit+0x450/0x950
[<c14b9aa9>] sch_direct_xmit+0xa9/0x250
[<c14b9c9b>] __qdisc_run+0x4b/0x150
[<c149f732>] dev_queue_xmit+0x2c2/0xca0
Cc: [email protected]
Reported-by: Yaara Rozenblum <[email protected]>
Signed-off-by: Emmanuel Grumbach <[email protected]>
Reviewed-by: Stanislaw Gruszka <[email protected]>
[reword commit log, use a separate lock]
Signed-off-by: Johannes Berg <[email protected]>
|
static void sta_info_hash_add(struct ieee80211_local *local,
struct sta_info *sta)
{
lockdep_assert_held(&local->sta_mtx);
sta->hnext = local->sta_hash[STA_HASH(sta->sta.addr)];
rcu_assign_pointer(local->sta_hash[STA_HASH(sta->sta.addr)], sta);
}
|
static void sta_info_hash_add(struct ieee80211_local *local,
struct sta_info *sta)
{
lockdep_assert_held(&local->sta_mtx);
sta->hnext = local->sta_hash[STA_HASH(sta->sta.addr)];
rcu_assign_pointer(local->sta_hash[STA_HASH(sta->sta.addr)], sta);
}
|
C
|
linux
| 0 |
CVE-2016-5096
|
https://www.cvedetails.com/cve/CVE-2016-5096/
|
CWE-190
|
https://github.com/php/php-src/commit/abd159cce48f3e34f08e4751c568e09677d5ec9c?w=1
|
abd159cce48f3e34f08e4751c568e09677d5ec9c?w=1
|
Fix bug #72114 - int/size_t confusion in fread
|
PHP_FUNCTION(file)
{
char *filename;
int filename_len;
char *target_buf=NULL, *p, *s, *e;
register int i = 0;
int target_len;
char eol_marker = '\n';
long flags = 0;
zend_bool use_include_path;
zend_bool include_new_line;
zend_bool skip_blank_lines;
php_stream *stream;
zval *zcontext = NULL;
php_stream_context *context = NULL;
/* Parse arguments */
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p|lr!", &filename, &filename_len, &flags, &zcontext) == FAILURE) {
return;
}
if (flags < 0 || flags > (PHP_FILE_USE_INCLUDE_PATH | PHP_FILE_IGNORE_NEW_LINES | PHP_FILE_SKIP_EMPTY_LINES | PHP_FILE_NO_DEFAULT_CONTEXT)) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "'%ld' flag is not supported", flags);
RETURN_FALSE;
}
use_include_path = flags & PHP_FILE_USE_INCLUDE_PATH;
include_new_line = !(flags & PHP_FILE_IGNORE_NEW_LINES);
skip_blank_lines = flags & PHP_FILE_SKIP_EMPTY_LINES;
context = php_stream_context_from_zval(zcontext, flags & PHP_FILE_NO_DEFAULT_CONTEXT);
stream = php_stream_open_wrapper_ex(filename, "rb", (use_include_path ? USE_PATH : 0) | REPORT_ERRORS, NULL, context);
if (!stream) {
RETURN_FALSE;
}
/* Initialize return array */
array_init(return_value);
if ((target_len = php_stream_copy_to_mem(stream, &target_buf, PHP_STREAM_COPY_ALL, 0))) {
s = target_buf;
e = target_buf + target_len;
if (!(p = php_stream_locate_eol(stream, target_buf, target_len TSRMLS_CC))) {
p = e;
goto parse_eol;
}
if (stream->flags & PHP_STREAM_FLAG_EOL_MAC) {
eol_marker = '\r';
}
/* for performance reasons the code is duplicated, so that the if (include_new_line)
* will not need to be done for every single line in the file. */
if (include_new_line) {
do {
p++;
parse_eol:
add_index_stringl(return_value, i++, estrndup(s, p-s), p-s, 0);
s = p;
} while ((p = memchr(p, eol_marker, (e-p))));
} else {
do {
int windows_eol = 0;
if (p != target_buf && eol_marker == '\n' && *(p - 1) == '\r') {
windows_eol++;
}
if (skip_blank_lines && !(p-s-windows_eol)) {
s = ++p;
continue;
}
add_index_stringl(return_value, i++, estrndup(s, p-s-windows_eol), p-s-windows_eol, 0);
s = ++p;
} while ((p = memchr(p, eol_marker, (e-p))));
}
/* handle any left overs of files without new lines */
if (s != e) {
p = e;
goto parse_eol;
}
}
if (target_buf) {
efree(target_buf);
}
php_stream_close(stream);
}
|
PHP_FUNCTION(file)
{
char *filename;
int filename_len;
char *target_buf=NULL, *p, *s, *e;
register int i = 0;
int target_len;
char eol_marker = '\n';
long flags = 0;
zend_bool use_include_path;
zend_bool include_new_line;
zend_bool skip_blank_lines;
php_stream *stream;
zval *zcontext = NULL;
php_stream_context *context = NULL;
/* Parse arguments */
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p|lr!", &filename, &filename_len, &flags, &zcontext) == FAILURE) {
return;
}
if (flags < 0 || flags > (PHP_FILE_USE_INCLUDE_PATH | PHP_FILE_IGNORE_NEW_LINES | PHP_FILE_SKIP_EMPTY_LINES | PHP_FILE_NO_DEFAULT_CONTEXT)) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "'%ld' flag is not supported", flags);
RETURN_FALSE;
}
use_include_path = flags & PHP_FILE_USE_INCLUDE_PATH;
include_new_line = !(flags & PHP_FILE_IGNORE_NEW_LINES);
skip_blank_lines = flags & PHP_FILE_SKIP_EMPTY_LINES;
context = php_stream_context_from_zval(zcontext, flags & PHP_FILE_NO_DEFAULT_CONTEXT);
stream = php_stream_open_wrapper_ex(filename, "rb", (use_include_path ? USE_PATH : 0) | REPORT_ERRORS, NULL, context);
if (!stream) {
RETURN_FALSE;
}
/* Initialize return array */
array_init(return_value);
if ((target_len = php_stream_copy_to_mem(stream, &target_buf, PHP_STREAM_COPY_ALL, 0))) {
s = target_buf;
e = target_buf + target_len;
if (!(p = php_stream_locate_eol(stream, target_buf, target_len TSRMLS_CC))) {
p = e;
goto parse_eol;
}
if (stream->flags & PHP_STREAM_FLAG_EOL_MAC) {
eol_marker = '\r';
}
/* for performance reasons the code is duplicated, so that the if (include_new_line)
* will not need to be done for every single line in the file. */
if (include_new_line) {
do {
p++;
parse_eol:
add_index_stringl(return_value, i++, estrndup(s, p-s), p-s, 0);
s = p;
} while ((p = memchr(p, eol_marker, (e-p))));
} else {
do {
int windows_eol = 0;
if (p != target_buf && eol_marker == '\n' && *(p - 1) == '\r') {
windows_eol++;
}
if (skip_blank_lines && !(p-s-windows_eol)) {
s = ++p;
continue;
}
add_index_stringl(return_value, i++, estrndup(s, p-s-windows_eol), p-s-windows_eol, 0);
s = ++p;
} while ((p = memchr(p, eol_marker, (e-p))));
}
/* handle any left overs of files without new lines */
if (s != e) {
p = e;
goto parse_eol;
}
}
if (target_buf) {
efree(target_buf);
}
php_stream_close(stream);
}
|
C
|
php-src
| 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 |
ReadUserLogState::EventNum( const ReadUserLog::FileState &state ) const
{
const ReadUserLogFileState::FileState *istate;
if ( ( !convertState(state, istate) ) || ( !istate->m_version ) ) {
return -1;
}
return (filesize_t) istate->m_event_num.asint;
}
|
ReadUserLogState::EventNum( const ReadUserLog::FileState &state ) const
{
const ReadUserLogFileState::FileState *istate;
if ( ( !convertState(state, istate) ) || ( !istate->m_version ) ) {
return -1;
}
return (filesize_t) istate->m_event_num.asint;
}
|
CPP
|
htcondor
| 0 |
CVE-2014-3515
|
https://www.cvedetails.com/cve/CVE-2014-3515/
| null |
https://git.php.net/?p=php-src.git;a=commit;h=88223c5245e9b470e1e6362bfd96829562ffe6ab
|
88223c5245e9b470e1e6362bfd96829562ffe6ab
| null |
SPL_METHOD(SplObjectStorage, rewind)
{
spl_SplObjectStorage *intern = (spl_SplObjectStorage*)zend_object_store_get_object(getThis() TSRMLS_CC);
if (zend_parse_parameters_none() == FAILURE) {
return;
}
zend_hash_internal_pointer_reset_ex(&intern->storage, &intern->pos);
intern->index = 0;
} /* }}} */
/* {{{ proto bool SplObjectStorage::valid()
|
SPL_METHOD(SplObjectStorage, rewind)
{
spl_SplObjectStorage *intern = (spl_SplObjectStorage*)zend_object_store_get_object(getThis() TSRMLS_CC);
if (zend_parse_parameters_none() == FAILURE) {
return;
}
zend_hash_internal_pointer_reset_ex(&intern->storage, &intern->pos);
intern->index = 0;
} /* }}} */
/* {{{ proto bool SplObjectStorage::valid()
|
C
|
php
| 0 |
CVE-2016-5185
|
https://www.cvedetails.com/cve/CVE-2016-5185/
|
CWE-416
|
https://github.com/chromium/chromium/commit/f2d26633cbd50735ac2af30436888b71ac0abad3
|
f2d26633cbd50735ac2af30436888b71ac0abad3
|
[Autofill] Remove AutofillPopupViewViews and associated feature.
Bug: 906135,831603
Change-Id: I3c982f8b3ffb4928c7c878e74e10113999106499
Reviewed-on: https://chromium-review.googlesource.com/c/1387124
Reviewed-by: Robert Kaplow <[email protected]>
Reviewed-by: Vasilii Sukhanov <[email protected]>
Reviewed-by: Fabio Tirelo <[email protected]>
Reviewed-by: Tommy Martino <[email protected]>
Commit-Queue: Mathieu Perreault <[email protected]>
Cr-Commit-Position: refs/heads/master@{#621360}
|
std::unique_ptr<views::View> AutofillPopupViewViews::CreateWrapperView() {
auto wrapper_view = std::make_unique<views::ScrollView>();
scroll_view_ = wrapper_view.get();
scroll_view_->set_hide_horizontal_scrollbar(true);
scroll_view_->SetContents(this);
return wrapper_view;
}
|
std::unique_ptr<views::View> AutofillPopupViewViews::CreateWrapperView() {
auto wrapper_view = std::make_unique<views::ScrollView>();
scroll_view_ = wrapper_view.get();
scroll_view_->set_hide_horizontal_scrollbar(true);
scroll_view_->SetContents(this);
return wrapper_view;
}
|
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
|
bool ExtensionPrefs::HasAllowFileAccessSetting(
const std::string& extension_id) const {
const DictionaryValue* ext = GetExtensionPref(extension_id);
return ext && ext->HasKey(kPrefAllowFileAccess);
}
|
bool ExtensionPrefs::HasAllowFileAccessSetting(
const std::string& extension_id) const {
const DictionaryValue* ext = GetExtensionPref(extension_id);
return ext && ext->HasKey(kPrefAllowFileAccess);
}
|
C
|
Chrome
| 0 |
CVE-2014-4502
|
https://www.cvedetails.com/cve/CVE-2014-4502/
|
CWE-119
|
https://github.com/ckolivas/cgminer/commit/e1c5050734123973b99d181c45e74b2cbb00272e
|
e1c5050734123973b99d181c45e74b2cbb00272e
|
Do some random sanity checking for stratum message parsing
|
void _cg_memcpy(void *dest, const void *src, unsigned int n, const char *file, const char *func, const int line)
{
if (unlikely(n < 1 || n > (1ul << 31))) {
applog(LOG_ERR, "ERR: Asked to memcpy %u bytes from %s %s():%d",
n, file, func, line);
return;
}
memcpy(dest, src, n);
}
|
void _cg_memcpy(void *dest, const void *src, unsigned int n, const char *file, const char *func, const int line)
{
if (unlikely(n < 1 || n > (1ul << 31))) {
applog(LOG_ERR, "ERR: Asked to memcpy %u bytes from %s %s():%d",
n, file, func, line);
return;
}
memcpy(dest, src, n);
}
|
C
|
cgminer
| 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 BrowserEventRouter::DispatchEventsAcrossIncognito(
Profile* profile,
const char* event_name,
scoped_ptr<ListValue> event_args,
scoped_ptr<ListValue> cross_incognito_args) {
if (!profile_->IsSameProfile(profile) ||
!extensions::ExtensionSystem::Get(profile)->event_router())
return;
extensions::ExtensionSystem::Get(profile)->event_router()->
DispatchEventsToRenderersAcrossIncognito(event_name, event_args.Pass(),
profile, cross_incognito_args.Pass(), GURL());
}
|
void BrowserEventRouter::DispatchEventsAcrossIncognito(
Profile* profile,
const char* event_name,
scoped_ptr<ListValue> event_args,
scoped_ptr<ListValue> cross_incognito_args) {
if (!profile_->IsSameProfile(profile) ||
!extensions::ExtensionSystem::Get(profile)->event_router())
return;
extensions::ExtensionSystem::Get(profile)->event_router()->
DispatchEventsToRenderersAcrossIncognito(event_name, event_args.Pass(),
profile, cross_incognito_args.Pass(), GURL());
}
|
C
|
Chrome
| 0 |
null | null | null |
https://github.com/chromium/chromium/commit/df831400bcb63db4259b5858281b1727ba972a2a
|
df831400bcb63db4259b5858281b1727ba972a2a
|
WebKit2: Support window bounce when panning.
https://bugs.webkit.org/show_bug.cgi?id=58065
<rdar://problem/9244367>
Reviewed by Adam Roben.
Make gestureDidScroll synchronous, as once we scroll, we need to know
whether or not we are at the beginning or end of the scrollable document.
If we are at either end of the scrollable document, we call the Windows 7
API to bounce the window to give an indication that you are past an end
of the document.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::gestureDidScroll): Pass a boolean for the reply, and return it.
* UIProcess/WebPageProxy.h:
* UIProcess/win/WebView.cpp:
(WebKit::WebView::WebView): Inititalize a new variable.
(WebKit::WebView::onGesture): Once we send the message to scroll, check if have gone to
an end of the document, and if we have, bounce the window.
* UIProcess/win/WebView.h:
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in: GestureDidScroll is now sync.
* WebProcess/WebPage/win/WebPageWin.cpp:
(WebKit::WebPage::gestureDidScroll): When we are done scrolling, check if we have a vertical
scrollbar and if we are at the beginning or the end of the scrollable document.
git-svn-id: svn://svn.chromium.org/blink/trunk@83197 bbb929c8-8fbe-4397-9dbb-9b2b20218538
|
void WebPageProxy::findString(const String& string, FindOptions options, unsigned maxMatchCount)
{
process()->send(Messages::WebPage::FindString(string, options, maxMatchCount), m_pageID);
}
|
void WebPageProxy::findString(const String& string, FindOptions options, unsigned maxMatchCount)
{
process()->send(Messages::WebPage::FindString(string, options, maxMatchCount), m_pageID);
}
|
C
|
Chrome
| 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}
|
Response InspectorAccessibilityAgent::getPartialAXTree(
int domNodeId,
Maybe<bool> fetchRelatives,
std::unique_ptr<protocol::Array<AXNode>>* nodes) {
if (!m_domAgent->enabled())
return Response::Error("DOM agent must be enabled");
Node* domNode = nullptr;
Response response = m_domAgent->assertNode(domNodeId, domNode);
if (!response.isSuccess())
return response;
Document& document = domNode->document();
document.updateStyleAndLayoutIgnorePendingStylesheets();
DocumentLifecycle::DisallowTransitionScope disallowTransition(
document.lifecycle());
LocalFrame* localFrame = document.frame();
if (!localFrame)
return Response::Error("Frame is detached.");
std::unique_ptr<ScopedAXObjectCache> scopedCache =
ScopedAXObjectCache::create(document);
AXObjectCacheImpl* cache = toAXObjectCacheImpl(scopedCache->get());
AXObject* inspectedAXObject = cache->getOrCreate(domNode);
*nodes = protocol::Array<protocol::Accessibility::AXNode>::create();
if (!inspectedAXObject || inspectedAXObject->accessibilityIsIgnored()) {
(*nodes)->addItem(buildObjectForIgnoredNode(domNode, inspectedAXObject,
fetchRelatives.fromMaybe(true),
*nodes, *cache));
return Response::OK();
} else {
(*nodes)->addItem(
buildProtocolAXObject(*inspectedAXObject, inspectedAXObject,
fetchRelatives.fromMaybe(true), *nodes, *cache));
}
if (!inspectedAXObject)
return Response::OK();
AXObject* parent = inspectedAXObject->parentObjectUnignored();
if (!parent)
return Response::OK();
if (fetchRelatives.fromMaybe(true))
addAncestors(*parent, inspectedAXObject, *nodes, *cache);
return Response::OK();
}
|
Response InspectorAccessibilityAgent::getPartialAXTree(
int domNodeId,
Maybe<bool> fetchRelatives,
std::unique_ptr<protocol::Array<AXNode>>* nodes) {
if (!m_domAgent->enabled())
return Response::Error("DOM agent must be enabled");
Node* domNode = nullptr;
Response response = m_domAgent->assertNode(domNodeId, domNode);
if (!response.isSuccess())
return response;
Document& document = domNode->document();
document.updateStyleAndLayoutIgnorePendingStylesheets();
DocumentLifecycle::DisallowTransitionScope disallowTransition(
document.lifecycle());
LocalFrame* localFrame = document.frame();
if (!localFrame)
return Response::Error("Frame is detached.");
std::unique_ptr<ScopedAXObjectCache> scopedCache =
ScopedAXObjectCache::create(document);
AXObjectCacheImpl* cache = toAXObjectCacheImpl(scopedCache->get());
AXObject* inspectedAXObject = cache->getOrCreate(domNode);
*nodes = protocol::Array<protocol::Accessibility::AXNode>::create();
if (!inspectedAXObject || inspectedAXObject->accessibilityIsIgnored()) {
(*nodes)->addItem(buildObjectForIgnoredNode(domNode, inspectedAXObject,
fetchRelatives.fromMaybe(true),
*nodes, *cache));
return Response::OK();
} else {
(*nodes)->addItem(
buildProtocolAXObject(*inspectedAXObject, inspectedAXObject,
fetchRelatives.fromMaybe(true), *nodes, *cache));
}
if (!inspectedAXObject)
return Response::OK();
AXObject* parent = inspectedAXObject->parentObjectUnignored();
if (!parent)
return Response::OK();
if (fetchRelatives.fromMaybe(true))
addAncestors(*parent, inspectedAXObject, *nodes, *cache);
return Response::OK();
}
|
C
|
Chrome
| 0 |
CVE-2019-14763
|
https://www.cvedetails.com/cve/CVE-2019-14763/
|
CWE-189
|
https://github.com/torvalds/linux/commit/c91815b596245fd7da349ecc43c8def670d2269e
|
c91815b596245fd7da349ecc43c8def670d2269e
|
usb: dwc3: gadget: never call ->complete() from ->ep_queue()
This is a requirement which has always existed but, somehow, wasn't
reflected in the documentation and problems weren't found until now
when Tuba Yavuz found a possible deadlock happening between dwc3 and
f_hid. She described the situation as follows:
spin_lock_irqsave(&hidg->write_spinlock, flags); // first acquire
/* we our function has been disabled by host */
if (!hidg->req) {
free_ep_req(hidg->in_ep, hidg->req);
goto try_again;
}
[...]
status = usb_ep_queue(hidg->in_ep, hidg->req, GFP_ATOMIC);
=>
[...]
=> usb_gadget_giveback_request
=>
f_hidg_req_complete
=>
spin_lock_irqsave(&hidg->write_spinlock, flags); // second acquire
Note that this happens because dwc3 would call ->complete() on a
failed usb_ep_queue() due to failed Start Transfer command. This is,
anyway, a theoretical situation because dwc3 currently uses "No
Response Update Transfer" command for Bulk and Interrupt endpoints.
It's still good to make this case impossible to happen even if the "No
Reponse Update Transfer" command is changed.
Reported-by: Tuba Yavuz <[email protected]>
Signed-off-by: Felipe Balbi <[email protected]>
Cc: stable <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
|
static int dwc3_gadget_ep_enable(struct usb_ep *ep,
const struct usb_endpoint_descriptor *desc)
{
struct dwc3_ep *dep;
struct dwc3 *dwc;
unsigned long flags;
int ret;
if (!ep || !desc || desc->bDescriptorType != USB_DT_ENDPOINT) {
pr_debug("dwc3: invalid parameters\n");
return -EINVAL;
}
if (!desc->wMaxPacketSize) {
pr_debug("dwc3: missing wMaxPacketSize\n");
return -EINVAL;
}
dep = to_dwc3_ep(ep);
dwc = dep->dwc;
if (dev_WARN_ONCE(dwc->dev, dep->flags & DWC3_EP_ENABLED,
"%s is already enabled\n",
dep->name))
return 0;
spin_lock_irqsave(&dwc->lock, flags);
ret = __dwc3_gadget_ep_enable(dep, false, false);
spin_unlock_irqrestore(&dwc->lock, flags);
return ret;
}
|
static int dwc3_gadget_ep_enable(struct usb_ep *ep,
const struct usb_endpoint_descriptor *desc)
{
struct dwc3_ep *dep;
struct dwc3 *dwc;
unsigned long flags;
int ret;
if (!ep || !desc || desc->bDescriptorType != USB_DT_ENDPOINT) {
pr_debug("dwc3: invalid parameters\n");
return -EINVAL;
}
if (!desc->wMaxPacketSize) {
pr_debug("dwc3: missing wMaxPacketSize\n");
return -EINVAL;
}
dep = to_dwc3_ep(ep);
dwc = dep->dwc;
if (dev_WARN_ONCE(dwc->dev, dep->flags & DWC3_EP_ENABLED,
"%s is already enabled\n",
dep->name))
return 0;
spin_lock_irqsave(&dwc->lock, flags);
ret = __dwc3_gadget_ep_enable(dep, false, false);
spin_unlock_irqrestore(&dwc->lock, flags);
return ret;
}
|
C
|
linux
| 0 |
CVE-2018-14036
|
https://www.cvedetails.com/cve/CVE-2018-14036/
|
CWE-22
|
https://cgit.freedesktop.org/accountsservice/commit/?id=f9abd359f71a5bce421b9ae23432f539a067847a
|
f9abd359f71a5bce421b9ae23432f539a067847a
| null |
on_user_property_notify (User *user)
{
if (user->changed_timeout_id != 0)
return;
user->changed_timeout_id = g_timeout_add (250, (GSourceFunc) on_user_changed_timeout, user);
}
|
on_user_property_notify (User *user)
{
if (user->changed_timeout_id != 0)
return;
user->changed_timeout_id = g_timeout_add (250, (GSourceFunc) on_user_changed_timeout, user);
}
|
C
|
accountsservice
| 0 |
CVE-2016-1621
|
https://www.cvedetails.com/cve/CVE-2016-1621/
|
CWE-119
|
https://android.googlesource.com/platform/external/libvpx/+/5a9753fca56f0eeb9f61e342b2fccffc364f9426
|
5a9753fca56f0eeb9f61e342b2fccffc364f9426
|
Merge Conflict Fix CL to lmp-mr1-release for ag/849478
DO NOT MERGE - libvpx: Pull from upstream
Current HEAD: 7105df53d7dc13d5e575bc8df714ec8d1da36b06
BUG=23452792
Change-Id: Ic78176fc369e0bacc71d423e0e2e6075d004aaec
|
virtual ~Trans16x16TestBase() {}
|
virtual ~Trans16x16TestBase() {}
|
C
|
Android
| 0 |
CVE-2013-2146
|
https://www.cvedetails.com/cve/CVE-2013-2146/
|
CWE-20
|
https://github.com/torvalds/linux/commit/f1923820c447e986a9da0fc6bf60c1dccdf0408e
|
f1923820c447e986a9da0fc6bf60c1dccdf0408e
|
perf/x86: Fix offcore_rsp valid mask for SNB/IVB
The valid mask for both offcore_response_0 and
offcore_response_1 was wrong for SNB/SNB-EP,
IVB/IVB-EP. It was possible to write to
reserved bit and cause a GP fault crashing
the kernel.
This patch fixes the problem by correctly marking the
reserved bits in the valid mask for all the processors
mentioned above.
A distinction between desktop and server parts is introduced
because bits 24-30 are only available on the server parts.
This version of the patch is just a rebase to perf/urgent tree
and should apply to older kernels as well.
Signed-off-by: Stephane Eranian <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Signed-off-by: Ingo Molnar <[email protected]>
|
static void intel_pebs_aliases_snb(struct perf_event *event)
{
if ((event->hw.config & X86_RAW_EVENT_MASK) == 0x003c) {
/*
* Use an alternative encoding for CPU_CLK_UNHALTED.THREAD_P
* (0x003c) so that we can use it with PEBS.
*
* The regular CPU_CLK_UNHALTED.THREAD_P event (0x003c) isn't
* PEBS capable. However we can use UOPS_RETIRED.ALL
* (0x01c2), which is a PEBS capable event, to get the same
* count.
*
* UOPS_RETIRED.ALL counts the number of cycles that retires
* CNTMASK micro-ops. By setting CNTMASK to a value (16)
* larger than the maximum number of micro-ops that can be
* retired per cycle (4) and then inverting the condition, we
* count all cycles that retire 16 or less micro-ops, which
* is every cycle.
*
* Thereby we gain a PEBS capable cycle counter.
*/
u64 alt_config = X86_CONFIG(.event=0xc2, .umask=0x01, .inv=1, .cmask=16);
alt_config |= (event->hw.config & ~X86_RAW_EVENT_MASK);
event->hw.config = alt_config;
}
}
|
static void intel_pebs_aliases_snb(struct perf_event *event)
{
if ((event->hw.config & X86_RAW_EVENT_MASK) == 0x003c) {
/*
* Use an alternative encoding for CPU_CLK_UNHALTED.THREAD_P
* (0x003c) so that we can use it with PEBS.
*
* The regular CPU_CLK_UNHALTED.THREAD_P event (0x003c) isn't
* PEBS capable. However we can use UOPS_RETIRED.ALL
* (0x01c2), which is a PEBS capable event, to get the same
* count.
*
* UOPS_RETIRED.ALL counts the number of cycles that retires
* CNTMASK micro-ops. By setting CNTMASK to a value (16)
* larger than the maximum number of micro-ops that can be
* retired per cycle (4) and then inverting the condition, we
* count all cycles that retire 16 or less micro-ops, which
* is every cycle.
*
* Thereby we gain a PEBS capable cycle counter.
*/
u64 alt_config = X86_CONFIG(.event=0xc2, .umask=0x01, .inv=1, .cmask=16);
alt_config |= (event->hw.config & ~X86_RAW_EVENT_MASK);
event->hw.config = alt_config;
}
}
|
C
|
linux
| 0 |
CVE-2017-5075
|
https://www.cvedetails.com/cve/CVE-2017-5075/
|
CWE-200
|
https://github.com/chromium/chromium/commit/fea16c8b60ff3d0756d5eb392394963b647bc41a
|
fea16c8b60ff3d0756d5eb392394963b647bc41a
|
CSP: Strip the fragment from reported URLs.
We should have been stripping the fragment from the URL we report for
CSP violations, but we weren't. Now we are, by running the URLs through
`stripURLForUseInReport()`, which implements the stripping algorithm
from CSP2: https://www.w3.org/TR/CSP2/#strip-uri-for-reporting
Eventually, we will migrate more completely to the CSP3 world that
doesn't require such detailed stripping, as it exposes less data to the
reports, but we're not there yet.
BUG=678776
Review-Url: https://codereview.chromium.org/2619783002
Cr-Commit-Position: refs/heads/master@{#458045}
|
bool ContentSecurityPolicy::allowAncestors(
LocalFrame* frame,
const KURL& url,
SecurityViolationReportingPolicy reportingPolicy) const {
return isAllowedByAll<&CSPDirectiveList::allowAncestors>(
m_policies, frame, url, reportingPolicy);
}
|
bool ContentSecurityPolicy::allowAncestors(
LocalFrame* frame,
const KURL& url,
SecurityViolationReportingPolicy reportingPolicy) const {
return isAllowedByAll<&CSPDirectiveList::allowAncestors>(
m_policies, frame, url, reportingPolicy);
}
|
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
|
guint32 IBusStateFromXFlags(unsigned int flags) {
return (flags & (LockMask | ControlMask | ShiftMask | Mod1Mask |
Button1Mask | Button2Mask | Button3Mask));
}
|
guint32 IBusStateFromXFlags(unsigned int flags) {
return (flags & (LockMask | ControlMask | ShiftMask | Mod1Mask |
Button1Mask | Button2Mask | Button3Mask));
}
|
C
|
Chrome
| 0 |
CVE-2015-3845
|
https://www.cvedetails.com/cve/CVE-2015-3845/
|
CWE-264
|
https://android.googlesource.com/platform/frameworks/native/+/e68cbc3e9e66df4231e70efa3e9c41abc12aea20
|
e68cbc3e9e66df4231e70efa3e9c41abc12aea20
|
Disregard alleged binder entities beyond parcel bounds
When appending one parcel's contents to another, ignore binder
objects within the source Parcel that appear to lie beyond the
formal bounds of that Parcel's data buffer.
Bug 17312693
Change-Id: If592a260f3fcd9a56fc160e7feb2c8b44c73f514
(cherry picked from commit 27182be9f20f4f5b48316666429f09b9ecc1f22e)
|
Parcel::Blob::Blob() :
mMapped(false), mData(NULL), mSize(0) {
}
|
Parcel::Blob::Blob() :
mMapped(false), mData(NULL), mSize(0) {
}
|
C
|
Android
| 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}
|
bool roleAllowsModal(AccessibilityRole role) {
return role == DialogRole || role == AlertDialogRole;
}
|
bool roleAllowsModal(AccessibilityRole role) {
return role == DialogRole || role == AlertDialogRole;
}
|
C
|
Chrome
| 0 |
CVE-2019-15148
|
https://www.cvedetails.com/cve/CVE-2019-15148/
|
CWE-787
|
https://github.com/gopro/gpmf-parser/commit/341f12cd5b97ab419e53853ca00176457c9f1681
|
341f12cd5b97ab419e53853ca00176457c9f1681
|
fixed many security issues with the too crude mp4 reader
|
void SavePayload(size_t handle, uint32_t *payload, uint32_t index)
void LongSeek(mp4object *mp4, int64_t offset)
{
if (mp4 && offset)
{
if (mp4->filepos + offset < mp4->filesize)
{
LONGSEEK(mp4->mediafp, offset, SEEK_CUR);
mp4->filepos += offset;
}
else
{
mp4->filepos = mp4->filesize;
}
}
}
|
void SavePayload(size_t handle, uint32_t *payload, uint32_t index)
{
mp4object *mp4 = (mp4object *)handle;
if (mp4 == NULL) return;
uint32_t *MP4buffer = NULL;
if (index < mp4->indexcount && mp4->mediafp && payload)
{
LONGSEEK(mp4->mediafp, mp4->metaoffsets[index], SEEK_SET);
fwrite(payload, 1, mp4->metasizes[index], mp4->mediafp);
}
return;
}
|
C
|
gpmf-parser
| 1 |
CVE-2016-7534
|
https://www.cvedetails.com/cve/CVE-2016-7534/
|
CWE-125
|
https://github.com/ImageMagick/ImageMagick/commit/430403b0029b37decf216d57f810899cab2317dd
|
430403b0029b37decf216d57f810899cab2317dd
|
https://github.com/ImageMagick/ImageMagick/issues/126
|
MagickExport MagickBooleanType SetQuantumPad(const Image *image,
QuantumInfo *quantum_info,const size_t pad)
{
assert(image != (Image *) NULL);
assert(image->signature == MagickCoreSignature);
if (image->debug != MagickFalse)
(void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename);
assert(quantum_info != (QuantumInfo *) NULL);
assert(quantum_info->signature == MagickCoreSignature);
quantum_info->pad=pad;
return(SetQuantumDepth(image,quantum_info,quantum_info->depth));
}
|
MagickExport MagickBooleanType SetQuantumPad(const Image *image,
QuantumInfo *quantum_info,const size_t pad)
{
assert(image != (Image *) NULL);
assert(image->signature == MagickCoreSignature);
if (image->debug != MagickFalse)
(void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename);
assert(quantum_info != (QuantumInfo *) NULL);
assert(quantum_info->signature == MagickCoreSignature);
quantum_info->pad=pad;
return(SetQuantumDepth(image,quantum_info,quantum_info->depth));
}
|
C
|
ImageMagick
| 0 |
CVE-2014-3160
|
https://www.cvedetails.com/cve/CVE-2014-3160/
|
CWE-264
|
https://github.com/chromium/chromium/commit/ee281f7cac9df44fe241a37f188b28be8845ded0
|
ee281f7cac9df44fe241a37f188b28be8845ded0
|
Enforce SVG image security rules
SVG images have unique security rules that prevent them from loading
any external resources. This patch enforces these rules in
ResourceFetcher::canRequest for all non-data-uri resources. This locks
down our SVG resource handling and fixes two security bugs.
In the case of SVG images that reference other images, we had a bug
where a cached subresource would be used directly from the cache.
This has been fixed because the canRequest check occurs before we use
cached resources.
In the case of SVG images that use CSS imports, we had a bug where
imports were blindly requested. This has been fixed by stopping all
non-data-uri requests in SVG images.
With this patch we now match Gecko's behavior on both testcases.
BUG=380885, 382296
Review URL: https://codereview.chromium.org/320763002
git-svn-id: svn://svn.chromium.org/blink/trunk@176084 bbb929c8-8fbe-4397-9dbb-9b2b20218538
|
bool ResourceFetcher::canAccessRedirect(Resource* resource, ResourceRequest& request, const ResourceResponse& redirectResponse, ResourceLoaderOptions& options)
{
if (!canRequest(resource->type(), request.url(), options, false, FetchRequest::UseDefaultOriginRestrictionForType))
return false;
if (options.corsEnabled == IsCORSEnabled) {
SecurityOrigin* sourceOrigin = options.securityOrigin.get();
if (!sourceOrigin && document())
sourceOrigin = document()->securityOrigin();
String errorMessage;
if (!CrossOriginAccessControl::handleRedirect(resource, sourceOrigin, request, redirectResponse, options, errorMessage)) {
if (frame() && frame()->document())
frame()->document()->addConsoleMessage(JSMessageSource, ErrorMessageLevel, errorMessage);
return false;
}
}
if (resource->type() == Resource::Image && shouldDeferImageLoad(request.url()))
return false;
return true;
}
|
bool ResourceFetcher::canAccessRedirect(Resource* resource, ResourceRequest& request, const ResourceResponse& redirectResponse, ResourceLoaderOptions& options)
{
if (!canRequest(resource->type(), request.url(), options, false, FetchRequest::UseDefaultOriginRestrictionForType))
return false;
if (options.corsEnabled == IsCORSEnabled) {
SecurityOrigin* sourceOrigin = options.securityOrigin.get();
if (!sourceOrigin && document())
sourceOrigin = document()->securityOrigin();
String errorMessage;
if (!CrossOriginAccessControl::handleRedirect(resource, sourceOrigin, request, redirectResponse, options, errorMessage)) {
if (frame() && frame()->document())
frame()->document()->addConsoleMessage(JSMessageSource, ErrorMessageLevel, errorMessage);
return false;
}
}
if (resource->type() == Resource::Image && shouldDeferImageLoad(request.url()))
return false;
return true;
}
|
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 <[email protected]>
Commit-Queue: Sebastien Seguin-Gagnon <[email protected]>
Cr-Commit-Position: refs/heads/master@{#573315}
|
void CheckSuggestions(int expected_page_id, const Suggestion& suggestion0) {
std::vector<Suggestion> suggestion_vector;
suggestion_vector.push_back(suggestion0);
external_delegate_->CheckSuggestions(expected_page_id, 1,
&suggestion_vector[0]);
}
|
void CheckSuggestions(int expected_page_id, const Suggestion& suggestion0) {
std::vector<Suggestion> suggestion_vector;
suggestion_vector.push_back(suggestion0);
external_delegate_->CheckSuggestions(expected_page_id, 1,
&suggestion_vector[0]);
}
|
C
|
Chrome
| 0 |
null | null | null |
https://github.com/chromium/chromium/commit/6c5d779aaf0dec9628da8a20751e95fd09554b14
|
6c5d779aaf0dec9628da8a20751e95fd09554b14
|
Move the cancellation of blocked requests code from ResourceDispatcherHost::~ResourceDispatcherHost() to ResourceDispatcherHost::OnShutdown().
This causes the requests to be cancelled on the IO thread rather than the UI thread, which is important since cancellation may delete the URLRequest (and URLRequests should not outlive the IO thread).
BUG=39243
Review URL: http://codereview.chromium.org/1213004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@42575 0039d316-1c4b-4281-b951-d872f2087c98
|
void ResourceDispatcherHost::OnAuthRequired(
URLRequest* request,
net::AuthChallengeInfo* auth_info) {
ResourceDispatcherHostRequestInfo* info = InfoForRequest(request);
DCHECK(!info->login_handler()) <<
"OnAuthRequired called with login_handler pending";
info->set_login_handler(CreateLoginPrompt(auth_info, request));
}
|
void ResourceDispatcherHost::OnAuthRequired(
URLRequest* request,
net::AuthChallengeInfo* auth_info) {
ResourceDispatcherHostRequestInfo* info = InfoForRequest(request);
DCHECK(!info->login_handler()) <<
"OnAuthRequired called with login_handler pending";
info->set_login_handler(CreateLoginPrompt(auth_info, request));
}
|
C
|
Chrome
| 0 |
CVE-2016-1665
|
https://www.cvedetails.com/cve/CVE-2016-1665/
|
CWE-20
|
https://github.com/chromium/chromium/commit/282f53ffdc3b1902da86f6a0791af736837efbf8
|
282f53ffdc3b1902da86f6a0791af736837efbf8
|
[signin] Add metrics to track the source for refresh token updated events
This CL add a source for update and revoke credentials operations. It then
surfaces the source in the chrome://signin-internals page.
This CL also records the following histograms that track refresh token events:
* Signin.RefreshTokenUpdated.ToValidToken.Source
* Signin.RefreshTokenUpdated.ToInvalidToken.Source
* Signin.RefreshTokenRevoked.Source
These histograms are needed to validate the assumptions of how often tokens
are revoked by the browser and the sources for the token revocations.
Bug: 896182
Change-Id: I2fcab80ee8e5699708e695bc3289fa6d34859a90
Reviewed-on: https://chromium-review.googlesource.com/c/1286464
Reviewed-by: Jochen Eisinger <[email protected]>
Reviewed-by: David Roger <[email protected]>
Reviewed-by: Ilya Sherman <[email protected]>
Commit-Queue: Mihai Sardarescu <[email protected]>
Cr-Commit-Position: refs/heads/master@{#606181}
|
void PeopleHandler::MarkFirstSetupComplete() {
signin::SetUserSkippedPromo(profile_);
ProfileSyncService* service = GetSyncService();
if (!service || service->IsFirstSetupComplete())
return;
base::FilePath profile_file_path = profile_->GetPath();
ProfileMetrics::LogProfileSyncSignIn(profile_file_path);
sync_blocker_.reset();
service->SetFirstSetupComplete();
FireWebUIListener("sync-settings-saved");
}
|
void PeopleHandler::MarkFirstSetupComplete() {
signin::SetUserSkippedPromo(profile_);
ProfileSyncService* service = GetSyncService();
if (!service || service->IsFirstSetupComplete())
return;
base::FilePath profile_file_path = profile_->GetPath();
ProfileMetrics::LogProfileSyncSignIn(profile_file_path);
sync_blocker_.reset();
service->SetFirstSetupComplete();
FireWebUIListener("sync-settings-saved");
}
|
C
|
Chrome
| 0 |
CVE-2017-5550
|
https://www.cvedetails.com/cve/CVE-2017-5550/
|
CWE-200
|
https://github.com/torvalds/linux/commit/b9dc6f65bc5e232d1c05fe34b5daadc7e8bbf1fb
|
b9dc6f65bc5e232d1c05fe34b5daadc7e8bbf1fb
|
fix a fencepost error in pipe_advance()
The logics in pipe_advance() used to release all buffers past the new
position failed in cases when the number of buffers to release was equal
to pipe->buffers. If that happened, none of them had been released,
leaving pipe full. Worse, it was trivial to trigger and we end up with
pipe full of uninitialized pages. IOW, it's an infoleak.
Cc: [email protected] # v4.9
Reported-by: "Alan J. Wylie" <[email protected]>
Tested-by: "Alan J. Wylie" <[email protected]>
Signed-off-by: Al Viro <[email protected]>
|
static inline void data_start(const struct iov_iter *i, int *idxp, size_t *offp)
{
size_t off = i->iov_offset;
int idx = i->idx;
if (off && (!allocated(&i->pipe->bufs[idx]) || off == PAGE_SIZE)) {
idx = next_idx(idx, i->pipe);
off = 0;
}
*idxp = idx;
*offp = off;
}
|
static inline void data_start(const struct iov_iter *i, int *idxp, size_t *offp)
{
size_t off = i->iov_offset;
int idx = i->idx;
if (off && (!allocated(&i->pipe->bufs[idx]) || off == PAGE_SIZE)) {
idx = next_idx(idx, i->pipe);
off = 0;
}
*idxp = idx;
*offp = off;
}
|
C
|
linux
| 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 |
pseudo_get_user_info(ClassAd *&ad)
{
static ClassAd* user_ad = NULL;
if( ! user_ad ) {
user_ad = new ClassAd;
#ifndef WIN32
char buf[1024];
sprintf( buf, "%s = %d", ATTR_UID, (int)get_user_uid() );
user_ad->Insert( buf );
sprintf( buf, "%s = %d", ATTR_GID, (int)get_user_gid() );
user_ad->Insert( buf );
#endif
}
ad = user_ad;
return 0;
}
|
pseudo_get_user_info(ClassAd *&ad)
{
static ClassAd* user_ad = NULL;
if( ! user_ad ) {
user_ad = new ClassAd;
#ifndef WIN32
char buf[1024];
sprintf( buf, "%s = %d", ATTR_UID, (int)get_user_uid() );
user_ad->Insert( buf );
sprintf( buf, "%s = %d", ATTR_GID, (int)get_user_gid() );
user_ad->Insert( buf );
#endif
}
ad = user_ad;
return 0;
}
|
CPP
|
htcondor
| 0 |
CVE-2017-10661
|
https://www.cvedetails.com/cve/CVE-2017-10661/
|
CWE-416
|
https://github.com/torvalds/linux/commit/1e38da300e1e395a15048b0af1e5305bd91402f6
|
1e38da300e1e395a15048b0af1e5305bd91402f6
|
timerfd: Protect the might cancel mechanism proper
The handling of the might_cancel queueing is not properly protected, so
parallel operations on the file descriptor can race with each other and
lead to list corruptions or use after free.
Protect the context for these operations with a seperate lock.
The wait queue lock cannot be reused for this because that would create a
lock inversion scenario vs. the cancel lock. Replacing might_cancel with an
atomic (atomic_t or atomic bit) does not help either because it still can
race vs. the actual list operation.
Reported-by: Dmitry Vyukov <[email protected]>
Signed-off-by: Thomas Gleixner <[email protected]>
Cc: "[email protected]"
Cc: syzkaller <[email protected]>
Cc: Al Viro <[email protected]>
Cc: [email protected]
Link: http://lkml.kernel.org/r/alpine.DEB.2.20.1701311521430.3457@nanos
Signed-off-by: Thomas Gleixner <[email protected]>
|
static ktime_t timerfd_get_remaining(struct timerfd_ctx *ctx)
{
ktime_t remaining;
if (isalarm(ctx))
remaining = alarm_expires_remaining(&ctx->t.alarm);
else
remaining = hrtimer_expires_remaining_adjusted(&ctx->t.tmr);
return remaining < 0 ? 0: remaining;
}
|
static ktime_t timerfd_get_remaining(struct timerfd_ctx *ctx)
{
ktime_t remaining;
if (isalarm(ctx))
remaining = alarm_expires_remaining(&ctx->t.alarm);
else
remaining = hrtimer_expires_remaining_adjusted(&ctx->t.tmr);
return remaining < 0 ? 0: remaining;
}
|
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 <[email protected]>
Reviewed-by: Brian Foster <[email protected]>
Signed-off-by: Dave Chinner <[email protected]>
|
xfs_attr_put_listent(
xfs_attr_list_context_t *context,
int flags,
unsigned char *name,
int namelen,
int valuelen,
unsigned char *value)
{
struct attrlist *alist = (struct attrlist *)context->alist;
attrlist_ent_t *aep;
int arraytop;
ASSERT(!(context->flags & ATTR_KERNOVAL));
ASSERT(context->count >= 0);
ASSERT(context->count < (ATTR_MAX_VALUELEN/8));
ASSERT(context->firstu >= sizeof(*alist));
ASSERT(context->firstu <= context->bufsize);
/*
* Only list entries in the right namespace.
*/
if (((context->flags & ATTR_SECURE) == 0) !=
((flags & XFS_ATTR_SECURE) == 0))
return 0;
if (((context->flags & ATTR_ROOT) == 0) !=
((flags & XFS_ATTR_ROOT) == 0))
return 0;
arraytop = sizeof(*alist) +
context->count * sizeof(alist->al_offset[0]);
context->firstu -= ATTR_ENTSIZE(namelen);
if (context->firstu < arraytop) {
trace_xfs_attr_list_full(context);
alist->al_more = 1;
context->seen_enough = 1;
return 1;
}
aep = (attrlist_ent_t *)&context->alist[context->firstu];
aep->a_valuelen = valuelen;
memcpy(aep->a_name, name, namelen);
aep->a_name[namelen] = 0;
alist->al_offset[context->count++] = context->firstu;
alist->al_count = context->count;
trace_xfs_attr_list_add(context);
return 0;
}
|
xfs_attr_put_listent(
xfs_attr_list_context_t *context,
int flags,
unsigned char *name,
int namelen,
int valuelen,
unsigned char *value)
{
struct attrlist *alist = (struct attrlist *)context->alist;
attrlist_ent_t *aep;
int arraytop;
ASSERT(!(context->flags & ATTR_KERNOVAL));
ASSERT(context->count >= 0);
ASSERT(context->count < (ATTR_MAX_VALUELEN/8));
ASSERT(context->firstu >= sizeof(*alist));
ASSERT(context->firstu <= context->bufsize);
/*
* Only list entries in the right namespace.
*/
if (((context->flags & ATTR_SECURE) == 0) !=
((flags & XFS_ATTR_SECURE) == 0))
return 0;
if (((context->flags & ATTR_ROOT) == 0) !=
((flags & XFS_ATTR_ROOT) == 0))
return 0;
arraytop = sizeof(*alist) +
context->count * sizeof(alist->al_offset[0]);
context->firstu -= ATTR_ENTSIZE(namelen);
if (context->firstu < arraytop) {
trace_xfs_attr_list_full(context);
alist->al_more = 1;
context->seen_enough = 1;
return 1;
}
aep = (attrlist_ent_t *)&context->alist[context->firstu];
aep->a_valuelen = valuelen;
memcpy(aep->a_name, name, namelen);
aep->a_name[namelen] = 0;
alist->al_offset[context->count++] = context->firstu;
alist->al_count = context->count;
trace_xfs_attr_list_add(context);
return 0;
}
|
C
|
linux
| 0 |
CVE-2018-12436
|
https://www.cvedetails.com/cve/CVE-2018-12436/
|
CWE-200
|
https://github.com/wolfSSL/wolfssl/commit/9b9568d500f31f964af26ba8d01e542e1f27e5ca
|
9b9568d500f31f964af26ba8d01e542e1f27e5ca
|
Change ECDSA signing to use blinding.
|
int wc_ecc_set_curve(ecc_key* key, int keysize, int curve_id)
{
if (keysize <= 0 && curve_id < 0) {
return BAD_FUNC_ARG;
}
if (keysize > ECC_MAXSIZE) {
return ECC_BAD_ARG_E;
}
/* handle custom case */
if (key->idx != ECC_CUSTOM_IDX) {
int x;
/* default values */
key->idx = 0;
key->dp = NULL;
/* find ecc_set based on curve_id or key size */
for (x = 0; ecc_sets[x].size != 0; x++) {
if (curve_id > ECC_CURVE_DEF) {
if (curve_id == ecc_sets[x].id)
break;
}
else if (keysize <= ecc_sets[x].size) {
break;
}
}
if (ecc_sets[x].size == 0) {
WOLFSSL_MSG("ECC Curve not found");
return ECC_CURVE_OID_E;
}
key->idx = x;
key->dp = &ecc_sets[x];
}
return 0;
}
|
int wc_ecc_set_curve(ecc_key* key, int keysize, int curve_id)
{
if (keysize <= 0 && curve_id < 0) {
return BAD_FUNC_ARG;
}
if (keysize > ECC_MAXSIZE) {
return ECC_BAD_ARG_E;
}
/* handle custom case */
if (key->idx != ECC_CUSTOM_IDX) {
int x;
/* default values */
key->idx = 0;
key->dp = NULL;
/* find ecc_set based on curve_id or key size */
for (x = 0; ecc_sets[x].size != 0; x++) {
if (curve_id > ECC_CURVE_DEF) {
if (curve_id == ecc_sets[x].id)
break;
}
else if (keysize <= ecc_sets[x].size) {
break;
}
}
if (ecc_sets[x].size == 0) {
WOLFSSL_MSG("ECC Curve not found");
return ECC_CURVE_OID_E;
}
key->idx = x;
key->dp = &ecc_sets[x];
}
return 0;
}
|
C
|
wolfssl
| 0 |
CVE-2011-4131
|
https://www.cvedetails.com/cve/CVE-2011-4131/
|
CWE-189
|
https://github.com/torvalds/linux/commit/bf118a342f10dafe44b14451a1392c3254629a1f
|
bf118a342f10dafe44b14451a1392c3254629a1f
|
NFSv4: include bitmap in nfsv4 get acl data
The NFSv4 bitmap size is unbounded: a server can return an arbitrary
sized bitmap in an FATTR4_WORD0_ACL request. Replace using the
nfs4_fattr_bitmap_maxsz as a guess to the maximum bitmask returned by a server
with the inclusion of the bitmap (xdr length plus bitmasks) and the acl data
xdr length to the (cached) acl page data.
This is a general solution to commit e5012d1f "NFSv4.1: update
nfs4_fattr_bitmap_maxsz" and fixes hitting a BUG_ON in xdr_shrink_bufhead
when getting ACLs.
Fix a bug in decode_getacl that returned -EINVAL on ACLs > page when getxattr
was called with a NULL buffer, preventing ACL > PAGE_SIZE from being retrieved.
Cc: [email protected]
Signed-off-by: Andy Adamson <[email protected]>
Signed-off-by: Trond Myklebust <[email protected]>
|
static void encode_free_stateid(struct xdr_stream *xdr,
struct nfs41_free_stateid_args *args,
struct compound_hdr *hdr)
{
__be32 *p;
p = reserve_space(xdr, 4 + NFS4_STATEID_SIZE);
*p++ = cpu_to_be32(OP_FREE_STATEID);
xdr_encode_opaque_fixed(p, args->stateid->data, NFS4_STATEID_SIZE);
hdr->nops++;
hdr->replen += decode_free_stateid_maxsz;
}
|
static void encode_free_stateid(struct xdr_stream *xdr,
struct nfs41_free_stateid_args *args,
struct compound_hdr *hdr)
{
__be32 *p;
p = reserve_space(xdr, 4 + NFS4_STATEID_SIZE);
*p++ = cpu_to_be32(OP_FREE_STATEID);
xdr_encode_opaque_fixed(p, args->stateid->data, NFS4_STATEID_SIZE);
hdr->nops++;
hdr->replen += decode_free_stateid_maxsz;
}
|
C
|
linux
| 0 |
CVE-2011-2789
|
https://www.cvedetails.com/cve/CVE-2011-2789/
|
CWE-399
|
https://github.com/chromium/chromium/commit/55ef04e135edaa9abfbf3647634b11ed57dc49e9
|
55ef04e135edaa9abfbf3647634b11ed57dc49e9
|
Maintain a map of all resources in the resource tracker and clear instance back pointers when needed,
BUG=85808
Review URL: http://codereview.chromium.org/7196001
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@89746 0039d316-1c4b-4281-b951-d872f2087c98
|
void PPB_Widget_Impl::SetLocation(const PP_Rect* location) {
location_ = *location;
SetLocationInternal(location);
}
|
void PPB_Widget_Impl::SetLocation(const PP_Rect* location) {
location_ = *location;
SetLocationInternal(location);
}
|
C
|
Chrome
| 0 |
CVE-2015-5479
|
https://www.cvedetails.com/cve/CVE-2015-5479/
|
CWE-189
|
https://git.libav.org/?p=libav.git;a=commitdiff;h=0a49a62f998747cfa564d98d36a459fe70d3299b
|
0a49a62f998747cfa564d98d36a459fe70d3299b
| null |
static void h263_decode_dquant(MpegEncContext *s){
static const int8_t quant_tab[4] = { -1, -2, 1, 2 };
if(s->modified_quant){
if(get_bits1(&s->gb))
s->qscale= ff_modified_quant_tab[get_bits1(&s->gb)][ s->qscale ];
else
s->qscale= get_bits(&s->gb, 5);
}else
s->qscale += quant_tab[get_bits(&s->gb, 2)];
ff_set_qscale(s, s->qscale);
}
|
static void h263_decode_dquant(MpegEncContext *s){
static const int8_t quant_tab[4] = { -1, -2, 1, 2 };
if(s->modified_quant){
if(get_bits1(&s->gb))
s->qscale= ff_modified_quant_tab[get_bits1(&s->gb)][ s->qscale ];
else
s->qscale= get_bits(&s->gb, 5);
}else
s->qscale += quant_tab[get_bits(&s->gb, 2)];
ff_set_qscale(s, s->qscale);
}
|
C
|
libav
| 0 |
CVE-2014-4652
|
https://www.cvedetails.com/cve/CVE-2014-4652/
|
CWE-362
|
https://github.com/torvalds/linux/commit/07f4d9d74a04aa7c72c5dae0ef97565f28f17b92
|
07f4d9d74a04aa7c72c5dae0ef97565f28f17b92
|
ALSA: control: Protect user controls against concurrent access
The user-control put and get handlers as well as the tlv do not protect against
concurrent access from multiple threads. Since the state of the control is not
updated atomically it is possible that either two write operations or a write
and a read operation race against each other. Both can lead to arbitrary memory
disclosure. This patch introduces a new lock that protects user-controls from
concurrent access. Since applications typically access controls sequentially
than in parallel a single lock per card should be fine.
Signed-off-by: Lars-Peter Clausen <[email protected]>
Acked-by: Jaroslav Kysela <[email protected]>
Cc: <[email protected]>
Signed-off-by: Takashi Iwai <[email protected]>
|
int __init snd_card_info_init(void)
{
struct snd_info_entry *entry;
entry = snd_info_create_module_entry(THIS_MODULE, "cards", NULL);
if (! entry)
return -ENOMEM;
entry->c.text.read = snd_card_info_read;
if (snd_info_register(entry) < 0) {
snd_info_free_entry(entry);
return -ENOMEM;
}
snd_card_info_entry = entry;
#ifdef MODULE
entry = snd_info_create_module_entry(THIS_MODULE, "modules", NULL);
if (entry) {
entry->c.text.read = snd_card_module_info_read;
if (snd_info_register(entry) < 0)
snd_info_free_entry(entry);
else
snd_card_module_info_entry = entry;
}
#endif
return 0;
}
|
int __init snd_card_info_init(void)
{
struct snd_info_entry *entry;
entry = snd_info_create_module_entry(THIS_MODULE, "cards", NULL);
if (! entry)
return -ENOMEM;
entry->c.text.read = snd_card_info_read;
if (snd_info_register(entry) < 0) {
snd_info_free_entry(entry);
return -ENOMEM;
}
snd_card_info_entry = entry;
#ifdef MODULE
entry = snd_info_create_module_entry(THIS_MODULE, "modules", NULL);
if (entry) {
entry->c.text.read = snd_card_module_info_read;
if (snd_info_register(entry) < 0)
snd_info_free_entry(entry);
else
snd_card_module_info_entry = entry;
}
#endif
return 0;
}
|
C
|
linux
| 0 |
CVE-2019-15538
|
https://www.cvedetails.com/cve/CVE-2019-15538/
|
CWE-399
|
https://github.com/torvalds/linux/commit/1fb254aa983bf190cfd685d40c64a480a9bafaee
|
1fb254aa983bf190cfd685d40c64a480a9bafaee
|
xfs: fix missing ILOCK unlock when xfs_setattr_nonsize fails due to EDQUOT
Benjamin Moody reported to Debian that XFS partially wedges when a chgrp
fails on account of being out of disk quota. I ran his reproducer
script:
# adduser dummy
# adduser dummy plugdev
# dd if=/dev/zero bs=1M count=100 of=test.img
# mkfs.xfs test.img
# mount -t xfs -o gquota test.img /mnt
# mkdir -p /mnt/dummy
# chown -c dummy /mnt/dummy
# xfs_quota -xc 'limit -g bsoft=100k bhard=100k plugdev' /mnt
(and then as user dummy)
$ dd if=/dev/urandom bs=1M count=50 of=/mnt/dummy/foo
$ chgrp plugdev /mnt/dummy/foo
and saw:
================================================
WARNING: lock held when returning to user space!
5.3.0-rc5 #rc5 Tainted: G W
------------------------------------------------
chgrp/47006 is leaving the kernel with locks still held!
1 lock held by chgrp/47006:
#0: 000000006664ea2d (&xfs_nondir_ilock_class){++++}, at: xfs_ilock+0xd2/0x290 [xfs]
...which is clearly caused by xfs_setattr_nonsize failing to unlock the
ILOCK after the xfs_qm_vop_chown_reserve call fails. Add the missing
unlock.
Reported-by: [email protected]
Fixes: 253f4911f297 ("xfs: better xfs_trans_alloc interface")
Signed-off-by: Darrick J. Wong <[email protected]>
Reviewed-by: Dave Chinner <[email protected]>
Tested-by: Salvatore Bonaccorso <[email protected]>
|
xfs_vn_mkdir(
struct inode *dir,
struct dentry *dentry,
umode_t mode)
{
return xfs_vn_mknod(dir, dentry, mode|S_IFDIR, 0);
}
|
xfs_vn_mkdir(
struct inode *dir,
struct dentry *dentry,
umode_t mode)
{
return xfs_vn_mknod(dir, dentry, mode|S_IFDIR, 0);
}
|
C
|
linux
| 0 |
CVE-2018-16790
|
https://www.cvedetails.com/cve/CVE-2018-16790/
|
CWE-125
|
https://github.com/mongodb/mongo-c-driver/commit/0d9a4d98bfdf4acd2c0138d4aaeb4e2e0934bd84
|
0d9a4d98bfdf4acd2c0138d4aaeb4e2e0934bd84
|
Fix for CVE-2018-16790 -- Verify bounds before binary length read.
As reported here: https://jira.mongodb.org/browse/CDRIVER-2819,
a heap overread occurs due a failure to correctly verify data
bounds.
In the original check, len - o returns the data left including the
sizeof(l) we just read. Instead, the comparison should check
against the data left NOT including the binary int32, i.e. just
subtype (byte*) instead of int32 subtype (byte*).
Added in test for corrupted BSON example.
|
test_bson_append_bool (void)
{
bson_t *b;
bson_t *b2;
b = bson_new ();
BSON_ASSERT (bson_append_bool (b, "bool", -1, true));
b2 = get_bson ("test19.bson");
BSON_ASSERT_BSON_EQUAL (b, b2);
bson_destroy (b);
bson_destroy (b2);
}
|
test_bson_append_bool (void)
{
bson_t *b;
bson_t *b2;
b = bson_new ();
BSON_ASSERT (bson_append_bool (b, "bool", -1, true));
b2 = get_bson ("test19.bson");
BSON_ASSERT_BSON_EQUAL (b, b2);
bson_destroy (b);
bson_destroy (b2);
}
|
C
|
mongo-c-driver
| 0 |
CVE-2017-5104
|
https://www.cvedetails.com/cve/CVE-2017-5104/
|
CWE-20
|
https://github.com/chromium/chromium/commit/adca986a53b31b6da4cb22f8e755f6856daea89a
|
adca986a53b31b6da4cb22f8e755f6856daea89a
|
Don't show current RenderWidgetHostView while interstitial is showing.
Also moves interstitial page tracking from RenderFrameHostManager to
WebContents, since interstitial pages are not frame-specific. This was
necessary for subframes to detect if an interstitial page is showing.
BUG=729105
TEST=See comment 13 of bug for repro steps
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_site_isolation
Review-Url: https://codereview.chromium.org/2938313002
Cr-Commit-Position: refs/heads/master@{#480117}
|
int RenderFrameHostManager::GetOpenerRoutingID(SiteInstance* instance) {
if (!frame_tree_node_->opener())
return MSG_ROUTING_NONE;
return frame_tree_node_->opener()
->render_manager()
->GetRoutingIdForSiteInstance(instance);
}
|
int RenderFrameHostManager::GetOpenerRoutingID(SiteInstance* instance) {
if (!frame_tree_node_->opener())
return MSG_ROUTING_NONE;
return frame_tree_node_->opener()
->render_manager()
->GetRoutingIdForSiteInstance(instance);
}
|
C
|
Chrome
| 0 |
CVE-2012-2888
|
https://www.cvedetails.com/cve/CVE-2012-2888/
|
CWE-399
|
https://github.com/chromium/chromium/commit/3b0d77670a0613f409110817455d2137576b485a
|
3b0d77670a0613f409110817455d2137576b485a
|
Revert 143656 - Add an IPC channel between the NaCl loader process and the renderer.
BUG=116317
TEST=ppapi, nacl tests, manual testing for experimental IPC proxy.
Review URL: https://chromiumcodereview.appspot.com/10641016
[email protected]
Review URL: https://chromiumcodereview.appspot.com/10625007
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@143665 0039d316-1c4b-4281-b951-d872f2087c98
|
base::MessageLoopProxy* ProxyChannelDelegate::GetIPCMessageLoop() {
|
base::MessageLoopProxy* ProxyChannelDelegate::GetIPCMessageLoop() {
return RenderThread::Get()->GetIOMessageLoopProxy().get();
}
|
C
|
Chrome
| 1 |
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 |
GahpServer::err_pipe_ready(int /*pipe_end*/)
{
int count = 0;
char buff[5001];
buff[0] = '\0';
while (((count = (daemonCore->Read_Pipe(m_gahp_errorfd, &buff, 5000))))>0) {
char *prev_line = buff;
char *newline = buff - 1;
buff[count]='\0';
while ( (newline = strchr( newline + 1, '\n' ) ) != NULL ) {
*newline = '\0';
dprintf( D_FULLDEBUG, "GAHP[%d] (stderr) -> %s%s\n", m_gahp_pid,
m_gahp_error_buffer.c_str(), prev_line );
prev_line = newline + 1;
m_gahp_error_buffer = "";
}
m_gahp_error_buffer += prev_line;
}
return TRUE;
}
|
GahpServer::err_pipe_ready(int /*pipe_end*/)
{
int count = 0;
char buff[5001];
buff[0] = '\0';
while (((count = (daemonCore->Read_Pipe(m_gahp_errorfd, &buff, 5000))))>0) {
char *prev_line = buff;
char *newline = buff - 1;
buff[count]='\0';
while ( (newline = strchr( newline + 1, '\n' ) ) != NULL ) {
*newline = '\0';
dprintf( D_FULLDEBUG, "GAHP[%d] (stderr) -> %s%s\n", m_gahp_pid,
m_gahp_error_buffer.c_str(), prev_line );
prev_line = newline + 1;
m_gahp_error_buffer = "";
}
m_gahp_error_buffer += prev_line;
}
return TRUE;
}
|
CPP
|
htcondor
| 0 |
CVE-2018-6158
|
https://www.cvedetails.com/cve/CVE-2018-6158/
|
CWE-362
|
https://github.com/chromium/chromium/commit/20b65d00ca3d8696430e22efad7485366f8c3a21
|
20b65d00ca3d8696430e22efad7485366f8c3a21
|
[oilpan] Fix GCInfoTable for multiple threads
Previously, grow and access from different threads could lead to a race
on the table backing; see bug.
- Rework the table to work on an existing reservation.
- Commit upon growing, avoiding any copies.
Drive-by: Fix over-allocation of table.
Bug: chromium:841280
Change-Id: I329cb6f40091e14e8c05334ba1104a9440c31d43
Reviewed-on: https://chromium-review.googlesource.com/1061525
Commit-Queue: Michael Lippautz <[email protected]>
Reviewed-by: Kentaro Hara <[email protected]>
Cr-Commit-Position: refs/heads/master@{#560434}
|
void MarkingVisitor::RegisterBackingStoreCallback(void* backing_store,
MovingObjectCallback callback,
void* callback_data) {
if (marking_mode_ != kGlobalMarkingWithCompaction)
return;
Heap().RegisterMovingObjectCallback(
reinterpret_cast<MovableReference>(backing_store), callback,
callback_data);
}
|
void MarkingVisitor::RegisterBackingStoreCallback(void* backing_store,
MovingObjectCallback callback,
void* callback_data) {
if (marking_mode_ != kGlobalMarkingWithCompaction)
return;
Heap().RegisterMovingObjectCallback(
reinterpret_cast<MovableReference>(backing_store), callback,
callback_data);
}
|
C
|
Chrome
| 0 |
CVE-2017-14230
|
https://www.cvedetails.com/cve/CVE-2017-14230/
|
CWE-20
|
https://github.com/cyrusimap/cyrus-imapd/commit/6bd33275368edfa71ae117de895488584678ac79
|
6bd33275368edfa71ae117de895488584678ac79
|
mboxlist: fix uninitialised memory use where pattern is "Other Users"
|
EXPORTED int mboxlist_createmailboxcheck(const char *name, int mbtype __attribute__((unused)),
const char *partition,
int isadmin, const char *userid,
const struct auth_state *auth_state,
char **newacl, char **newpartition,
int forceuser)
{
char *part = NULL;
char *acl = NULL;
int r = 0;
r = mboxlist_create_namecheck(name, userid, auth_state,
isadmin, forceuser);
if (r) goto done;
if (newacl) {
r = mboxlist_create_acl(name, &acl);
if (r) goto done;
}
if (newpartition) {
r = mboxlist_create_partition(name, partition, &part);
if (r) goto done;
}
done:
if (r || !newacl) free(acl);
else *newacl = acl;
if (r || !newpartition) free(part);
else *newpartition = part;
return r;
}
|
EXPORTED int mboxlist_createmailboxcheck(const char *name, int mbtype __attribute__((unused)),
const char *partition,
int isadmin, const char *userid,
const struct auth_state *auth_state,
char **newacl, char **newpartition,
int forceuser)
{
char *part = NULL;
char *acl = NULL;
int r = 0;
r = mboxlist_create_namecheck(name, userid, auth_state,
isadmin, forceuser);
if (r) goto done;
if (newacl) {
r = mboxlist_create_acl(name, &acl);
if (r) goto done;
}
if (newpartition) {
r = mboxlist_create_partition(name, partition, &part);
if (r) goto done;
}
done:
if (r || !newacl) free(acl);
else *newacl = acl;
if (r || !newpartition) free(part);
else *newpartition = part;
return r;
}
|
C
|
cyrus-imapd
| 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 <[email protected]>
Signed-off-by: Herbert Xu <[email protected]>
|
static int md5_sparc64_final(struct shash_desc *desc, u8 *out)
{
struct md5_state *sctx = shash_desc_ctx(desc);
unsigned int i, index, padlen;
u32 *dst = (u32 *)out;
__le64 bits;
static const u8 padding[MD5_HMAC_BLOCK_SIZE] = { 0x80, };
bits = cpu_to_le64(sctx->byte_count << 3);
/* Pad out to 56 mod 64 and append length */
index = sctx->byte_count % MD5_HMAC_BLOCK_SIZE;
padlen = (index < 56) ? (56 - index) : ((MD5_HMAC_BLOCK_SIZE+56) - index);
/* We need to fill a whole block for __md5_sparc64_update() */
if (padlen <= 56) {
sctx->byte_count += padlen;
memcpy((u8 *)sctx->block + index, padding, padlen);
} else {
__md5_sparc64_update(sctx, padding, padlen, index);
}
__md5_sparc64_update(sctx, (const u8 *)&bits, sizeof(bits), 56);
/* Store state in digest */
for (i = 0; i < MD5_HASH_WORDS; i++)
dst[i] = sctx->hash[i];
/* Wipe context */
memset(sctx, 0, sizeof(*sctx));
return 0;
}
|
static int md5_sparc64_final(struct shash_desc *desc, u8 *out)
{
struct md5_state *sctx = shash_desc_ctx(desc);
unsigned int i, index, padlen;
u32 *dst = (u32 *)out;
__le64 bits;
static const u8 padding[MD5_HMAC_BLOCK_SIZE] = { 0x80, };
bits = cpu_to_le64(sctx->byte_count << 3);
/* Pad out to 56 mod 64 and append length */
index = sctx->byte_count % MD5_HMAC_BLOCK_SIZE;
padlen = (index < 56) ? (56 - index) : ((MD5_HMAC_BLOCK_SIZE+56) - index);
/* We need to fill a whole block for __md5_sparc64_update() */
if (padlen <= 56) {
sctx->byte_count += padlen;
memcpy((u8 *)sctx->block + index, padding, padlen);
} else {
__md5_sparc64_update(sctx, padding, padlen, index);
}
__md5_sparc64_update(sctx, (const u8 *)&bits, sizeof(bits), 56);
/* Store state in digest */
for (i = 0; i < MD5_HASH_WORDS; i++)
dst[i] = sctx->hash[i];
/* Wipe context */
memset(sctx, 0, sizeof(*sctx));
return 0;
}
|
C
|
linux
| 0 |
null | null | null |
https://github.com/chromium/chromium/commit/be655fd4fb9ab3291a855a939496111674037a2f
|
be655fd4fb9ab3291a855a939496111674037a2f
|
Always use FrameNavigationDisabler during DocumentLoader detach.
BUG=617495
Review-Url: https://codereview.chromium.org/2079473002
Cr-Commit-Position: refs/heads/master@{#400558}
|
bool FrameLoader::allAncestorsAreComplete() const
{
for (Frame* ancestor = m_frame; ancestor; ancestor = ancestor->tree().parent()) {
if (ancestor->isLoading())
return false;
}
return true;
}
|
bool FrameLoader::allAncestorsAreComplete() const
{
for (Frame* ancestor = m_frame; ancestor; ancestor = ancestor->tree().parent()) {
if (ancestor->isLoading())
return false;
}
return true;
}
|
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
[email protected]
Review URL: https://codereview.chromium.org/196343011
git-svn-id: svn://svn.chromium.org/blink/trunk@169176 bbb929c8-8fbe-4397-9dbb-9b2b20218538
|
static void reflectLongAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
{
TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope;
TestObjectPythonV8Internal::reflectLongAttributeAttributeSetter(jsValue, info);
TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
}
|
static void reflectLongAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
{
TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope;
TestObjectPythonV8Internal::reflectLongAttributeAttributeSetter(jsValue, info);
TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
}
|
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<std::vector<char> >::Write(Message* m, const param_type& p) {
if (p.empty()) {
m->WriteData(NULL, 0);
} else {
m->WriteData(&p.front(), static_cast<int>(p.size()));
}
}
|
void ParamTraits<std::vector<char> >::Write(Message* m, const param_type& p) {
if (p.empty()) {
m->WriteData(NULL, 0);
} else {
m->WriteData(&p.front(), static_cast<int>(p.size()));
}
}
|
C
|
Chrome
| 0 |
CVE-2013-0882
|
https://www.cvedetails.com/cve/CVE-2013-0882/
|
CWE-119
|
https://github.com/chromium/chromium/commit/25f9415f43d607d3d01f542f067e3cc471983e6b
|
25f9415f43d607d3d01f542f067e3cc471983e6b
|
Add HTMLFormControlElement::supportsAutofocus to fix a FIXME comment.
This virtual function should return true if the form control can hanlde
'autofocucs' attribute if it is specified.
Note: HTMLInputElement::supportsAutofocus reuses InputType::isInteractiveContent
because interactiveness is required for autofocus capability.
BUG=none
TEST=none; no behavior changes.
Review URL: https://codereview.chromium.org/143343003
git-svn-id: svn://svn.chromium.org/blink/trunk@165432 bbb929c8-8fbe-4397-9dbb-9b2b20218538
|
HTMLFormControlElement::~HTMLFormControlElement()
{
setForm(0);
}
|
HTMLFormControlElement::~HTMLFormControlElement()
{
setForm(0);
}
|
C
|
Chrome
| 0 |
CVE-2014-9644
|
https://www.cvedetails.com/cve/CVE-2014-9644/
|
CWE-264
|
https://github.com/torvalds/linux/commit/4943ba16bbc2db05115707b3ff7b4874e9e3c560
|
4943ba16bbc2db05115707b3ff7b4874e9e3c560
|
crypto: include crypto- module prefix in template
This adds the module loading prefix "crypto-" to the template lookup
as well.
For example, attempting to load 'vfat(blowfish)' via AF_ALG now correctly
includes the "crypto-" prefix at every level, correctly rejecting "vfat":
net-pf-38
algif-hash
crypto-vfat(blowfish)
crypto-vfat(blowfish)-all
crypto-vfat
Reported-by: Mathias Krause <[email protected]>
Signed-off-by: Kees Cook <[email protected]>
Acked-by: Mathias Krause <[email protected]>
Signed-off-by: Herbert Xu <[email protected]>
|
static struct crypto_instance *crypto_cbc_alloc(struct rtattr **tb)
{
struct crypto_instance *inst;
struct crypto_alg *alg;
int err;
err = crypto_check_attr_type(tb, CRYPTO_ALG_TYPE_BLKCIPHER);
if (err)
return ERR_PTR(err);
alg = crypto_get_attr_alg(tb, CRYPTO_ALG_TYPE_CIPHER,
CRYPTO_ALG_TYPE_MASK);
if (IS_ERR(alg))
return ERR_CAST(alg);
inst = ERR_PTR(-EINVAL);
if (!is_power_of_2(alg->cra_blocksize))
goto out_put_alg;
inst = crypto_alloc_instance("cbc", alg);
if (IS_ERR(inst))
goto out_put_alg;
inst->alg.cra_flags = CRYPTO_ALG_TYPE_BLKCIPHER;
inst->alg.cra_priority = alg->cra_priority;
inst->alg.cra_blocksize = alg->cra_blocksize;
inst->alg.cra_alignmask = alg->cra_alignmask;
inst->alg.cra_type = &crypto_blkcipher_type;
/* We access the data as u32s when xoring. */
inst->alg.cra_alignmask |= __alignof__(u32) - 1;
inst->alg.cra_blkcipher.ivsize = alg->cra_blocksize;
inst->alg.cra_blkcipher.min_keysize = alg->cra_cipher.cia_min_keysize;
inst->alg.cra_blkcipher.max_keysize = alg->cra_cipher.cia_max_keysize;
inst->alg.cra_ctxsize = sizeof(struct crypto_cbc_ctx);
inst->alg.cra_init = crypto_cbc_init_tfm;
inst->alg.cra_exit = crypto_cbc_exit_tfm;
inst->alg.cra_blkcipher.setkey = crypto_cbc_setkey;
inst->alg.cra_blkcipher.encrypt = crypto_cbc_encrypt;
inst->alg.cra_blkcipher.decrypt = crypto_cbc_decrypt;
out_put_alg:
crypto_mod_put(alg);
return inst;
}
|
static struct crypto_instance *crypto_cbc_alloc(struct rtattr **tb)
{
struct crypto_instance *inst;
struct crypto_alg *alg;
int err;
err = crypto_check_attr_type(tb, CRYPTO_ALG_TYPE_BLKCIPHER);
if (err)
return ERR_PTR(err);
alg = crypto_get_attr_alg(tb, CRYPTO_ALG_TYPE_CIPHER,
CRYPTO_ALG_TYPE_MASK);
if (IS_ERR(alg))
return ERR_CAST(alg);
inst = ERR_PTR(-EINVAL);
if (!is_power_of_2(alg->cra_blocksize))
goto out_put_alg;
inst = crypto_alloc_instance("cbc", alg);
if (IS_ERR(inst))
goto out_put_alg;
inst->alg.cra_flags = CRYPTO_ALG_TYPE_BLKCIPHER;
inst->alg.cra_priority = alg->cra_priority;
inst->alg.cra_blocksize = alg->cra_blocksize;
inst->alg.cra_alignmask = alg->cra_alignmask;
inst->alg.cra_type = &crypto_blkcipher_type;
/* We access the data as u32s when xoring. */
inst->alg.cra_alignmask |= __alignof__(u32) - 1;
inst->alg.cra_blkcipher.ivsize = alg->cra_blocksize;
inst->alg.cra_blkcipher.min_keysize = alg->cra_cipher.cia_min_keysize;
inst->alg.cra_blkcipher.max_keysize = alg->cra_cipher.cia_max_keysize;
inst->alg.cra_ctxsize = sizeof(struct crypto_cbc_ctx);
inst->alg.cra_init = crypto_cbc_init_tfm;
inst->alg.cra_exit = crypto_cbc_exit_tfm;
inst->alg.cra_blkcipher.setkey = crypto_cbc_setkey;
inst->alg.cra_blkcipher.encrypt = crypto_cbc_encrypt;
inst->alg.cra_blkcipher.decrypt = crypto_cbc_decrypt;
out_put_alg:
crypto_mod_put(alg);
return inst;
}
|
C
|
linux
| 0 |
CVE-2015-8956
|
https://www.cvedetails.com/cve/CVE-2015-8956/
|
CWE-476
|
https://github.com/torvalds/linux/commit/951b6a0717db97ce420547222647bcc40bf1eacd
|
951b6a0717db97ce420547222647bcc40bf1eacd
|
Bluetooth: Fix potential NULL dereference in RFCOMM bind callback
addr can be NULL and it should not be dereferenced before NULL checking.
Signed-off-by: Jaganath Kanakkassery <[email protected]>
Signed-off-by: Marcel Holtmann <[email protected]>
|
static int rfcomm_sock_listen(struct socket *sock, int backlog)
{
struct sock *sk = sock->sk;
int err = 0;
BT_DBG("sk %p backlog %d", sk, backlog);
lock_sock(sk);
if (sk->sk_state != BT_BOUND) {
err = -EBADFD;
goto done;
}
if (sk->sk_type != SOCK_STREAM) {
err = -EINVAL;
goto done;
}
if (!rfcomm_pi(sk)->channel) {
bdaddr_t *src = &rfcomm_pi(sk)->src;
u8 channel;
err = -EINVAL;
write_lock(&rfcomm_sk_list.lock);
for (channel = 1; channel < 31; channel++)
if (!__rfcomm_get_listen_sock_by_addr(channel, src)) {
rfcomm_pi(sk)->channel = channel;
err = 0;
break;
}
write_unlock(&rfcomm_sk_list.lock);
if (err < 0)
goto done;
}
sk->sk_max_ack_backlog = backlog;
sk->sk_ack_backlog = 0;
sk->sk_state = BT_LISTEN;
done:
release_sock(sk);
return err;
}
|
static int rfcomm_sock_listen(struct socket *sock, int backlog)
{
struct sock *sk = sock->sk;
int err = 0;
BT_DBG("sk %p backlog %d", sk, backlog);
lock_sock(sk);
if (sk->sk_state != BT_BOUND) {
err = -EBADFD;
goto done;
}
if (sk->sk_type != SOCK_STREAM) {
err = -EINVAL;
goto done;
}
if (!rfcomm_pi(sk)->channel) {
bdaddr_t *src = &rfcomm_pi(sk)->src;
u8 channel;
err = -EINVAL;
write_lock(&rfcomm_sk_list.lock);
for (channel = 1; channel < 31; channel++)
if (!__rfcomm_get_listen_sock_by_addr(channel, src)) {
rfcomm_pi(sk)->channel = channel;
err = 0;
break;
}
write_unlock(&rfcomm_sk_list.lock);
if (err < 0)
goto done;
}
sk->sk_max_ack_backlog = backlog;
sk->sk_ack_backlog = 0;
sk->sk_state = BT_LISTEN;
done:
release_sock(sk);
return err;
}
|
C
|
linux
| 0 |
CVE-2018-6096
|
https://www.cvedetails.com/cve/CVE-2018-6096/
| null |
https://github.com/chromium/chromium/commit/36f801fdbec07d116a6f4f07bb363f10897d6a51
|
36f801fdbec07d116a6f4f07bb363f10897d6a51
|
If a page calls |window.focus()|, kick it out of fullscreen.
BUG=776418, 800056
Change-Id: I1880fe600e4814c073f247c43b1c1ac80c8fc017
Reviewed-on: https://chromium-review.googlesource.com/852378
Reviewed-by: Nasko Oskov <[email protected]>
Reviewed-by: Philip Jägenstedt <[email protected]>
Commit-Queue: Avi Drissman <[email protected]>
Cr-Commit-Position: refs/heads/master@{#533790}
|
MhtmlSaveStatus WriteMHTMLToDisk(std::vector<WebThreadSafeData> mhtml_contents,
base::File file) {
TRACE_EVENT0("page-serialization", "WriteMHTMLToDisk (RenderFrameImpl)");
SCOPED_UMA_HISTOGRAM_TIMER(
"PageSerialization.MhtmlGeneration.WriteToDiskTime.SingleFrame");
DCHECK(!RenderThread::Get()) << "Should not run in the main renderer thread";
MhtmlSaveStatus save_status = MhtmlSaveStatus::SUCCESS;
for (const WebThreadSafeData& data : mhtml_contents) {
if (!data.IsEmpty() &&
file.WriteAtCurrentPos(data.Data(), data.size()) < 0) {
save_status = MhtmlSaveStatus::FILE_WRITTING_ERROR;
break;
}
}
file.Close();
return save_status;
}
|
MhtmlSaveStatus WriteMHTMLToDisk(std::vector<WebThreadSafeData> mhtml_contents,
base::File file) {
TRACE_EVENT0("page-serialization", "WriteMHTMLToDisk (RenderFrameImpl)");
SCOPED_UMA_HISTOGRAM_TIMER(
"PageSerialization.MhtmlGeneration.WriteToDiskTime.SingleFrame");
DCHECK(!RenderThread::Get()) << "Should not run in the main renderer thread";
MhtmlSaveStatus save_status = MhtmlSaveStatus::SUCCESS;
for (const WebThreadSafeData& data : mhtml_contents) {
if (!data.IsEmpty() &&
file.WriteAtCurrentPos(data.Data(), data.size()) < 0) {
save_status = MhtmlSaveStatus::FILE_WRITTING_ERROR;
break;
}
}
file.Close();
return save_status;
}
|
C
|
Chrome
| 0 |
CVE-2012-5670
|
https://www.cvedetails.com/cve/CVE-2012-5670/
|
CWE-119
|
https://git.savannah.gnu.org/cgit/freetype/freetype2.git/commit/?id=7f2e4f4f553f6836be7683f66226afac3fa979b8
|
7f2e4f4f553f6836be7683f66226afac3fa979b8
| null |
_bdf_atol( char* s,
char** end,
int base )
{
long v, neg;
const unsigned char* dmap;
if ( s == 0 || *s == 0 )
return 0;
/* Make sure the radix is something recognizable. Default to 10. */
switch ( base )
{
case 8:
dmap = odigits;
break;
case 16:
dmap = hdigits;
break;
default:
base = 10;
dmap = ddigits;
break;
}
/* Check for a minus sign. */
neg = 0;
if ( *s == '-' )
{
s++;
neg = 1;
}
/* Check for the special hex prefix. */
if ( *s == '0' &&
( *( s + 1 ) == 'x' || *( s + 1 ) == 'X' ) )
{
base = 16;
dmap = hdigits;
s += 2;
}
for ( v = 0; sbitset( dmap, *s ); s++ )
v = v * base + a2i[(int)*s];
if ( end != 0 )
*end = s;
return ( !neg ) ? v : -v;
}
|
_bdf_atol( char* s,
char** end,
int base )
{
long v, neg;
const unsigned char* dmap;
if ( s == 0 || *s == 0 )
return 0;
/* Make sure the radix is something recognizable. Default to 10. */
switch ( base )
{
case 8:
dmap = odigits;
break;
case 16:
dmap = hdigits;
break;
default:
base = 10;
dmap = ddigits;
break;
}
/* Check for a minus sign. */
neg = 0;
if ( *s == '-' )
{
s++;
neg = 1;
}
/* Check for the special hex prefix. */
if ( *s == '0' &&
( *( s + 1 ) == 'x' || *( s + 1 ) == 'X' ) )
{
base = 16;
dmap = hdigits;
s += 2;
}
for ( v = 0; sbitset( dmap, *s ); s++ )
v = v * base + a2i[(int)*s];
if ( end != 0 )
*end = s;
return ( !neg ) ? v : -v;
}
|
C
|
savannah
| 0 |
CVE-2017-5060
|
https://www.cvedetails.com/cve/CVE-2017-5060/
|
CWE-20
|
https://github.com/chromium/chromium/commit/08cb718ba7c3961c1006176c9faba0a5841ec792
|
08cb718ba7c3961c1006176c9faba0a5841ec792
|
Block domain labels made of Cyrillic letters that look alike Latin
Block a label made entirely of Latin-look-alike Cyrillic letters when the TLD is not an IDN (i.e. this check is ON only for TLDs like 'com', 'net', 'uk', but not applied for IDN TLDs like рф.
BUG=683314
TEST=components_unittests --gtest_filter=U*IDN*
Review-Url: https://codereview.chromium.org/2683793010
Cr-Commit-Position: refs/heads/master@{#459226}
|
void AppendFormattedComponent(const std::string& spec,
const url::Component& original_component,
const AppendComponentTransform& transform,
base::string16* output,
url::Component* output_component,
base::OffsetAdjuster::Adjustments* adjustments) {
DCHECK(output);
if (original_component.is_nonempty()) {
size_t original_component_begin =
static_cast<size_t>(original_component.begin);
size_t output_component_begin = output->length();
std::string component_str(spec, original_component_begin,
static_cast<size_t>(original_component.len));
base::OffsetAdjuster::Adjustments component_transform_adjustments;
output->append(
transform.Execute(component_str, &component_transform_adjustments));
for (base::OffsetAdjuster::Adjustments::iterator comp_iter =
component_transform_adjustments.begin();
comp_iter != component_transform_adjustments.end(); ++comp_iter)
comp_iter->original_offset += original_component_begin;
if (adjustments) {
adjustments->insert(adjustments->end(),
component_transform_adjustments.begin(),
component_transform_adjustments.end());
}
if (output_component) {
output_component->begin = static_cast<int>(output_component_begin);
output_component->len =
static_cast<int>(output->length() - output_component_begin);
}
} else if (output_component) {
output_component->reset();
}
}
|
void AppendFormattedComponent(const std::string& spec,
const url::Component& original_component,
const AppendComponentTransform& transform,
base::string16* output,
url::Component* output_component,
base::OffsetAdjuster::Adjustments* adjustments) {
DCHECK(output);
if (original_component.is_nonempty()) {
size_t original_component_begin =
static_cast<size_t>(original_component.begin);
size_t output_component_begin = output->length();
std::string component_str(spec, original_component_begin,
static_cast<size_t>(original_component.len));
base::OffsetAdjuster::Adjustments component_transform_adjustments;
output->append(
transform.Execute(component_str, &component_transform_adjustments));
for (base::OffsetAdjuster::Adjustments::iterator comp_iter =
component_transform_adjustments.begin();
comp_iter != component_transform_adjustments.end(); ++comp_iter)
comp_iter->original_offset += original_component_begin;
if (adjustments) {
adjustments->insert(adjustments->end(),
component_transform_adjustments.begin(),
component_transform_adjustments.end());
}
if (output_component) {
output_component->begin = static_cast<int>(output_component_begin);
output_component->len =
static_cast<int>(output->length() - output_component_begin);
}
} else if (output_component) {
output_component->reset();
}
}
|
C
|
Chrome
| 0 |
CVE-2018-18445
|
https://www.cvedetails.com/cve/CVE-2018-18445/
|
CWE-125
|
https://github.com/torvalds/linux/commit/b799207e1e1816b09e7a5920fbb2d5fcf6edd681
|
b799207e1e1816b09e7a5920fbb2d5fcf6edd681
|
bpf: 32-bit RSH verification must truncate input before the ALU op
When I wrote commit 468f6eafa6c4 ("bpf: fix 32-bit ALU op verification"), I
assumed that, in order to emulate 64-bit arithmetic with 32-bit logic, it
is sufficient to just truncate the output to 32 bits; and so I just moved
the register size coercion that used to be at the start of the function to
the end of the function.
That assumption is true for almost every op, but not for 32-bit right
shifts, because those can propagate information towards the least
significant bit. Fix it by always truncating inputs for 32-bit ops to 32
bits.
Also get rid of the coerce_reg_to_size() after the ALU op, since that has
no effect.
Fixes: 468f6eafa6c4 ("bpf: fix 32-bit ALU op verification")
Acked-by: Daniel Borkmann <[email protected]>
Signed-off-by: Jann Horn <[email protected]>
Signed-off-by: Daniel Borkmann <[email protected]>
|
static void sanitize_dead_code(struct bpf_verifier_env *env)
{
struct bpf_insn_aux_data *aux_data = env->insn_aux_data;
struct bpf_insn trap = BPF_JMP_IMM(BPF_JA, 0, 0, -1);
struct bpf_insn *insn = env->prog->insnsi;
const int insn_cnt = env->prog->len;
int i;
for (i = 0; i < insn_cnt; i++) {
if (aux_data[i].seen)
continue;
memcpy(insn + i, &trap, sizeof(trap));
}
}
|
static void sanitize_dead_code(struct bpf_verifier_env *env)
{
struct bpf_insn_aux_data *aux_data = env->insn_aux_data;
struct bpf_insn trap = BPF_JMP_IMM(BPF_JA, 0, 0, -1);
struct bpf_insn *insn = env->prog->insnsi;
const int insn_cnt = env->prog->len;
int i;
for (i = 0; i < insn_cnt; i++) {
if (aux_data[i].seen)
continue;
memcpy(insn + i, &trap, sizeof(trap));
}
}
|
C
|
linux
| 0 |
CVE-2015-1300
|
https://www.cvedetails.com/cve/CVE-2015-1300/
|
CWE-254
|
https://github.com/chromium/chromium/commit/9c391ac04f9ac478c8b0e43b359c2b43a6c892ab
|
9c391ac04f9ac478c8b0e43b359c2b43a6c892ab
|
Use pdf compositor service for printing when OOPIF is enabled
When OOPIF is enabled (by site-per-process flag or
top-document-isolation feature), use the pdf compositor service for
converting PaintRecord to PDF on renderers.
In the future, this will make compositing PDF from multiple renderers
possible.
[email protected]
BUG=455764
Change-Id: I3c28f03f4358e4228239fe1a33384f85e7716e8f
Reviewed-on: https://chromium-review.googlesource.com/699765
Commit-Queue: Wei Li <[email protected]>
Reviewed-by: Daniel Cheng <[email protected]>
Reviewed-by: Lei Zhang <[email protected]>
Cr-Commit-Position: refs/heads/master@{#511616}
|
ChromeContentUtilityClient::ChromeContentUtilityClient()
: utility_process_running_elevated_(false) {
#if BUILDFLAG(ENABLE_EXTENSIONS)
extensions::InitExtensionsClient();
#endif
#if BUILDFLAG(ENABLE_PRINT_PREVIEW) || \
(BUILDFLAG(ENABLE_BASIC_PRINTING) && defined(OS_WIN))
handlers_.push_back(base::MakeUnique<printing::PrintingHandler>());
#endif
}
|
ChromeContentUtilityClient::ChromeContentUtilityClient()
: utility_process_running_elevated_(false) {
#if BUILDFLAG(ENABLE_EXTENSIONS)
extensions::InitExtensionsClient();
#endif
#if BUILDFLAG(ENABLE_PRINT_PREVIEW) || \
(BUILDFLAG(ENABLE_BASIC_PRINTING) && defined(OS_WIN))
handlers_.push_back(base::MakeUnique<printing::PrintingHandler>());
#endif
}
|
C
|
Chrome
| 0 |
CVE-2016-6722
|
https://www.cvedetails.com/cve/CVE-2016-6722/
|
CWE-200
|
https://android.googlesource.com/platform/frameworks/av/+/89c03b3b9ff74a507a8b8334c50b08b334483556
|
89c03b3b9ff74a507a8b8334c50b08b334483556
|
SampleIterator: clear members on seekTo error
Bug: 31091777
Change-Id: Iddf99d0011961d0fd3d755e57db4365b6a6a1193
(cherry picked from commit 03237ce0f9584c98ccda76c2474a4ae84c763f5b)
|
SampleIterator::SampleIterator(SampleTable *table)
: mTable(table),
mInitialized(false),
mTimeToSampleIndex(0),
mTTSSampleIndex(0),
mTTSSampleTime(0),
mTTSCount(0),
mTTSDuration(0) {
reset();
}
|
SampleIterator::SampleIterator(SampleTable *table)
: mTable(table),
mInitialized(false),
mTimeToSampleIndex(0),
mTTSSampleIndex(0),
mTTSSampleTime(0),
mTTSCount(0),
mTTSDuration(0) {
reset();
}
|
C
|
Android
| 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.
[email protected], [email protected], [email protected]
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
|
LayoutRect RenderBox::clippedOverflowRectForRepaint(const RenderLayerModelObject* repaintContainer) const
{
if (style()->visibility() != VISIBLE && !enclosingLayer()->hasVisibleContent())
return LayoutRect();
LayoutRect r = visualOverflowRect();
RenderView* v = view();
if (!RuntimeEnabledFeatures::repaintAfterLayoutEnabled() && v) {
r.move(v->layoutDelta());
}
computeRectForRepaint(repaintContainer, r);
return r;
}
|
LayoutRect RenderBox::clippedOverflowRectForRepaint(const RenderLayerModelObject* repaintContainer) const
{
if (style()->visibility() != VISIBLE && !enclosingLayer()->hasVisibleContent())
return LayoutRect();
LayoutRect r = visualOverflowRect();
RenderView* v = view();
if (!RuntimeEnabledFeatures::repaintAfterLayoutEnabled() && v) {
r.move(v->layoutDelta());
}
computeRectForRepaint(repaintContainer, r);
return r;
}
|
C
|
Chrome
| 0 |
CVE-2018-13006
|
https://www.cvedetails.com/cve/CVE-2018-13006/
|
CWE-125
|
https://github.com/gpac/gpac/commit/bceb03fd2be95097a7b409ea59914f332fb6bc86
|
bceb03fd2be95097a7b409ea59914f332fb6bc86
|
fixed 2 possible heap overflows (inc. #1088)
|
GF_Err co64_Read(GF_Box *s,GF_BitStream *bs)
{
u32 entries;
GF_ChunkLargeOffsetBox *ptr = (GF_ChunkLargeOffsetBox *) s;
ptr->nb_entries = gf_bs_read_u32(bs);
ISOM_DECREASE_SIZE(ptr, 4)
if (ptr->nb_entries > ptr->size / 8) {
GF_LOG(GF_LOG_ERROR, GF_LOG_CONTAINER, ("[iso file] Invalid number of entries %d in co64\n", ptr->nb_entries));
return GF_ISOM_INVALID_FILE;
}
ptr->offsets = (u64 *) gf_malloc(ptr->nb_entries * sizeof(u64) );
if (ptr->offsets == NULL) return GF_OUT_OF_MEM;
ptr->alloc_size = ptr->nb_entries;
for (entries = 0; entries < ptr->nb_entries; entries++) {
ptr->offsets[entries] = gf_bs_read_u64(bs);
}
return GF_OK;
}
|
GF_Err co64_Read(GF_Box *s,GF_BitStream *bs)
{
u32 entries;
GF_ChunkLargeOffsetBox *ptr = (GF_ChunkLargeOffsetBox *) s;
ptr->nb_entries = gf_bs_read_u32(bs);
ISOM_DECREASE_SIZE(ptr, 4)
if (ptr->nb_entries > ptr->size / 8) {
GF_LOG(GF_LOG_ERROR, GF_LOG_CONTAINER, ("[iso file] Invalid number of entries %d in co64\n", ptr->nb_entries));
return GF_ISOM_INVALID_FILE;
}
ptr->offsets = (u64 *) gf_malloc(ptr->nb_entries * sizeof(u64) );
if (ptr->offsets == NULL) return GF_OUT_OF_MEM;
ptr->alloc_size = ptr->nb_entries;
for (entries = 0; entries < ptr->nb_entries; entries++) {
ptr->offsets[entries] = gf_bs_read_u64(bs);
}
return GF_OK;
}
|
C
|
gpac
| 0 |
CVE-2019-17541
|
https://www.cvedetails.com/cve/CVE-2019-17541/
| null |
https://github.com/ImageMagick/ImageMagick/commit/39f226a9c137f547e12afde972eeba7551124493
|
39f226a9c137f547e12afde972eeba7551124493
|
https://github.com/ImageMagick/ImageMagick/issues/1641
|
static MagickBooleanType JPEGWarningHandler(j_common_ptr jpeg_info,int level)
{
#define JPEGExcessiveWarnings 1000
char
message[JMSG_LENGTH_MAX];
ErrorManager
*error_manager;
ExceptionInfo
*exception;
Image
*image;
*message='\0';
error_manager=(ErrorManager *) jpeg_info->client_data;
exception=error_manager->exception;
image=error_manager->image;
if (level < 0)
{
/*
Process warning message.
*/
(jpeg_info->err->format_message)(jpeg_info,message);
if (jpeg_info->err->num_warnings++ < JPEGExcessiveWarnings)
ThrowBinaryException(CorruptImageWarning,(char *) message,
image->filename);
}
else
if ((image->debug != MagickFalse) &&
(level >= jpeg_info->err->trace_level))
{
/*
Process trace message.
*/
(jpeg_info->err->format_message)(jpeg_info,message);
(void) LogMagickEvent(CoderEvent,GetMagickModule(),
"[%s] JPEG Trace: \"%s\"",image->filename,message);
}
return(MagickTrue);
}
|
static MagickBooleanType JPEGWarningHandler(j_common_ptr jpeg_info,int level)
{
#define JPEGExcessiveWarnings 1000
char
message[JMSG_LENGTH_MAX];
ErrorManager
*error_manager;
ExceptionInfo
*exception;
Image
*image;
*message='\0';
error_manager=(ErrorManager *) jpeg_info->client_data;
exception=error_manager->exception;
image=error_manager->image;
if (level < 0)
{
/*
Process warning message.
*/
(jpeg_info->err->format_message)(jpeg_info,message);
if (jpeg_info->err->num_warnings++ < JPEGExcessiveWarnings)
ThrowBinaryException(CorruptImageWarning,(char *) message,
image->filename);
}
else
if ((image->debug != MagickFalse) &&
(level >= jpeg_info->err->trace_level))
{
/*
Process trace message.
*/
(jpeg_info->err->format_message)(jpeg_info,message);
(void) LogMagickEvent(CoderEvent,GetMagickModule(),
"[%s] JPEG Trace: \"%s\"",image->filename,message);
}
return(MagickTrue);
}
|
C
|
ImageMagick
| 0 |
CVE-2014-0146
|
https://www.cvedetails.com/cve/CVE-2014-0146/
|
CWE-476
|
https://git.qemu.org/?p=qemu.git;a=commit;h=11b128f4062dd7f89b14abc8877ff20d41b28be9
|
11b128f4062dd7f89b14abc8877ff20d41b28be9
| null |
int qcow2_mark_corrupt(BlockDriverState *bs)
{
BDRVQcowState *s = bs->opaque;
s->incompatible_features |= QCOW2_INCOMPAT_CORRUPT;
return qcow2_update_header(bs);
}
|
int qcow2_mark_corrupt(BlockDriverState *bs)
{
BDRVQcowState *s = bs->opaque;
s->incompatible_features |= QCOW2_INCOMPAT_CORRUPT;
return qcow2_update_header(bs);
}
|
C
|
qemu
| 0 |
CVE-2017-5122
|
https://www.cvedetails.com/cve/CVE-2017-5122/
|
CWE-119
|
https://github.com/chromium/chromium/commit/f8675cbb337440a11bf9afb10ea11bae42bb92cb
|
f8675cbb337440a11bf9afb10ea11bae42bb92cb
|
cros: Enable some tests in //ash/wm in ash_unittests --mash
For the ones that fail, disable them via filter file instead of in the
code, per our disablement policy.
Bug: 698085, 695556, 698878, 698888, 698093, 698894
Test: ash_unittests --mash
Change-Id: Ic145ab6a95508968d6884d14fac2a3ca08888d26
Reviewed-on: https://chromium-review.googlesource.com/752423
Commit-Queue: James Cook <[email protected]>
Reviewed-by: Steven Bennetts <[email protected]>
Cr-Commit-Position: refs/heads/master@{#513836}
|
explicit EventTestWindow(bool modal) : TestWindow(modal), mouse_presses_(0) {}
|
explicit EventTestWindow(bool modal) : TestWindow(modal), mouse_presses_(0) {}
|
C
|
Chrome
| 0 |
CVE-2017-7191
|
https://www.cvedetails.com/cve/CVE-2017-7191/
|
CWE-416
|
https://github.com/irssi/irssi/commit/77b2631c78461965bc9a7414aae206b5c514e1b3
|
77b2631c78461965bc9a7414aae206b5c514e1b3
|
Merge branch 'netjoin-timeout' into 'master'
fe-netjoin: remove irc servers on "server disconnected" signal
Closes #7
See merge request !10
|
static NETJOIN_REC *netjoin_find(IRC_SERVER_REC *server, const char *nick)
{
NETJOIN_SERVER_REC *srec;
GSList *tmp;
g_return_val_if_fail(server != NULL, NULL);
g_return_val_if_fail(nick != NULL, NULL);
srec = netjoin_find_server(server);
if (srec == NULL) return NULL;
for (tmp = srec->netjoins; tmp != NULL; tmp = tmp->next) {
NETJOIN_REC *rec = tmp->data;
if (g_ascii_strcasecmp(rec->nick, nick) == 0)
return rec;
}
return NULL;
}
|
static NETJOIN_REC *netjoin_find(IRC_SERVER_REC *server, const char *nick)
{
NETJOIN_SERVER_REC *srec;
GSList *tmp;
g_return_val_if_fail(server != NULL, NULL);
g_return_val_if_fail(nick != NULL, NULL);
srec = netjoin_find_server(server);
if (srec == NULL) return NULL;
for (tmp = srec->netjoins; tmp != NULL; tmp = tmp->next) {
NETJOIN_REC *rec = tmp->data;
if (g_ascii_strcasecmp(rec->nick, nick) == 0)
return rec;
}
return NULL;
}
|
C
|
irssi
| 0 |
null | null | null |
https://github.com/chromium/chromium/commit/a46bcef82b29d30836a0f26226e3d4aca4fa9612
|
a46bcef82b29d30836a0f26226e3d4aca4fa9612
|
Access ChromotingHost::clients_ only on network thread.
Previously ChromotingHost was doing some work on the main thread and
some on the network thread. |clients_| and some other members were
accessed without lock on both of these threads. Moved most of the
ChromotingHost activity to the network thread to avoid possible
race conditions.
BUG=96325
TEST=Chromoting works
Review URL: http://codereview.chromium.org/8495024
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@109556 0039d316-1c4b-4281-b951-d872f2087c98
|
HostNPScriptObject::HostNPScriptObject(
NPP plugin,
NPObject* parent,
PluginMessageLoopProxy::Delegate* plugin_thread_delegate)
: plugin_(plugin),
parent_(parent),
state_(kDisconnected),
np_thread_id_(base::PlatformThread::CurrentId()),
plugin_message_loop_proxy_(
new PluginMessageLoopProxy(plugin_thread_delegate)),
host_context_(plugin_message_loop_proxy_),
failed_login_attempts_(0),
disconnected_event_(true, false),
am_currently_logging_(false),
nat_traversal_enabled_(false),
policy_received_(false) {
}
|
HostNPScriptObject::HostNPScriptObject(
NPP plugin,
NPObject* parent,
PluginMessageLoopProxy::Delegate* plugin_thread_delegate)
: plugin_(plugin),
parent_(parent),
state_(kDisconnected),
np_thread_id_(base::PlatformThread::CurrentId()),
plugin_message_loop_proxy_(
new PluginMessageLoopProxy(plugin_thread_delegate)),
host_context_(plugin_message_loop_proxy_),
failed_login_attempts_(0),
disconnected_event_(true, false),
am_currently_logging_(false),
nat_traversal_enabled_(false),
policy_received_(false) {
}
|
C
|
Chrome
| 0 |
CVE-2013-2915
|
https://www.cvedetails.com/cve/CVE-2013-2915/
| null |
https://github.com/chromium/chromium/commit/b12eb22a27110f49a2ad54b9e4ffd0ccb6cf9ce9
|
b12eb22a27110f49a2ad54b9e4ffd0ccb6cf9ce9
|
Delete unneeded pending entries in DidFailProvisionalLoad to prevent a spoof.
BUG=280512
BUG=278899
TEST=See bug for repro steps.
Review URL: https://chromiumcodereview.appspot.com/23978003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@222146 0039d316-1c4b-4281-b951-d872f2087c98
|
SiteInstance* GetSiteInstanceFromEntry(NavigationEntry* entry) {
return NavigationEntryImpl::FromNavigationEntry(entry)->site_instance();
}
|
SiteInstance* GetSiteInstanceFromEntry(NavigationEntry* entry) {
return NavigationEntryImpl::FromNavigationEntry(entry)->site_instance();
}
|
C
|
Chrome
| 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}
|
void SearchEngineTabHelper::OnPageHasOSDD(
const GURL& page_url,
const GURL& osdd_url,
const search_provider::OSDDType& msg_provider_type) {
if (!osdd_url.is_valid() || !osdd_url.SchemeIsHTTPOrHTTPS())
return;
Profile* profile =
Profile::FromBrowserContext(web_contents()->GetBrowserContext());
if (page_url != web_contents()->GetLastCommittedURL() ||
!TemplateURLFetcherFactory::GetForProfile(profile) ||
profile->IsOffTheRecord())
return;
TemplateURLFetcher::ProviderType provider_type =
(msg_provider_type == search_provider::AUTODETECTED_PROVIDER) ?
TemplateURLFetcher::AUTODETECTED_PROVIDER :
TemplateURLFetcher::EXPLICIT_PROVIDER;
const NavigationController& controller = web_contents()->GetController();
const NavigationEntry* entry = controller.GetLastCommittedEntry();
for (int index = controller.GetLastCommittedEntryIndex();
(index > 0) && IsFormSubmit(entry);
entry = controller.GetEntryAtIndex(index))
--index;
if (!entry || IsFormSubmit(entry))
return;
base::string16 keyword;
if (provider_type == TemplateURLFetcher::AUTODETECTED_PROVIDER) {
keyword = GenerateKeywordFromNavigationEntry(
entry, profile->GetPrefs()->GetString(prefs::kAcceptLanguages));
if (keyword.empty())
return;
}
TemplateURLFetcherFactory::GetForProfile(profile)->ScheduleDownload(
keyword, osdd_url, entry->GetFavicon().url,
base::Bind(&AssociateURLFetcherWithWebContents, web_contents()),
base::Bind(&SearchEngineTabHelper::OnDownloadedOSDD,
weak_ptr_factory_.GetWeakPtr()),
provider_type);
}
|
void SearchEngineTabHelper::OnPageHasOSDD(
const GURL& page_url,
const GURL& osdd_url,
const search_provider::OSDDType& msg_provider_type) {
if (!osdd_url.is_valid() || !osdd_url.SchemeIsHTTPOrHTTPS())
return;
Profile* profile =
Profile::FromBrowserContext(web_contents()->GetBrowserContext());
if (page_url != web_contents()->GetLastCommittedURL() ||
!TemplateURLFetcherFactory::GetForProfile(profile) ||
profile->IsOffTheRecord())
return;
TemplateURLFetcher::ProviderType provider_type =
(msg_provider_type == search_provider::AUTODETECTED_PROVIDER) ?
TemplateURLFetcher::AUTODETECTED_PROVIDER :
TemplateURLFetcher::EXPLICIT_PROVIDER;
const NavigationController& controller = web_contents()->GetController();
const NavigationEntry* entry = controller.GetLastCommittedEntry();
for (int index = controller.GetLastCommittedEntryIndex();
(index > 0) && IsFormSubmit(entry);
entry = controller.GetEntryAtIndex(index))
--index;
if (!entry || IsFormSubmit(entry))
return;
base::string16 keyword;
if (provider_type == TemplateURLFetcher::AUTODETECTED_PROVIDER) {
keyword = GenerateKeywordFromNavigationEntry(
entry, profile->GetPrefs()->GetString(prefs::kAcceptLanguages));
if (keyword.empty())
return;
}
TemplateURLFetcherFactory::GetForProfile(profile)->ScheduleDownload(
keyword, osdd_url, entry->GetFavicon().url,
base::Bind(&AssociateURLFetcherWithWebContents, web_contents()),
base::Bind(&SearchEngineTabHelper::OnDownloadedOSDD,
weak_ptr_factory_.GetWeakPtr()),
provider_type);
}
|
C
|
Chrome
| 0 |
CVE-2012-2875
|
https://www.cvedetails.com/cve/CVE-2012-2875/
| null |
https://github.com/chromium/chromium/commit/d345af9ed62ee5f431be327967f41c3cc3fe936a
|
d345af9ed62ee5f431be327967f41c3cc3fe936a
|
[BlackBerry] Adapt to new BlackBerry::Platform::TouchPoint API
https://bugs.webkit.org/show_bug.cgi?id=105143
RIM PR 171941
Reviewed by Rob Buis.
Internally reviewed by George Staikos.
Source/WebCore:
TouchPoint instances now provide document coordinates for the viewport
and content position of the touch event. The pixel coordinates stored
in the TouchPoint should no longer be needed in WebKit.
Also adapt to new method names and encapsulation of TouchPoint data
members.
No change in behavior, no new tests.
* platform/blackberry/PlatformTouchPointBlackBerry.cpp:
(WebCore::PlatformTouchPoint::PlatformTouchPoint):
Source/WebKit/blackberry:
TouchPoint instances now provide document coordinates for the viewport
and content position of the touch event. The pixel coordinates stored
in the TouchPoint should no longer be needed in WebKit. One exception
is when passing events to a full screen plugin.
Also adapt to new method names and encapsulation of TouchPoint data
members.
* Api/WebPage.cpp:
(BlackBerry::WebKit::WebPage::touchEvent):
(BlackBerry::WebKit::WebPage::touchPointAsMouseEvent):
(BlackBerry::WebKit::WebPagePrivate::dispatchTouchEventToFullScreenPlugin):
(BlackBerry::WebKit::WebPagePrivate::dispatchTouchPointAsMouseEventToFullScreenPlugin):
* WebKitSupport/InputHandler.cpp:
(BlackBerry::WebKit::InputHandler::shouldRequestSpellCheckingOptionsForPoint):
* WebKitSupport/InputHandler.h:
(InputHandler):
* WebKitSupport/TouchEventHandler.cpp:
(BlackBerry::WebKit::TouchEventHandler::doFatFingers):
(BlackBerry::WebKit::TouchEventHandler::handleTouchPoint):
* WebKitSupport/TouchEventHandler.h:
(TouchEventHandler):
Tools:
Adapt to new method names and encapsulation of TouchPoint data members.
* DumpRenderTree/blackberry/EventSender.cpp:
(addTouchPointCallback):
(updateTouchPointCallback):
(touchEndCallback):
(releaseTouchPointCallback):
(sendTouchEvent):
git-svn-id: svn://svn.chromium.org/blink/trunk@137880 bbb929c8-8fbe-4397-9dbb-9b2b20218538
|
void InputHandler::handleInputLocaleChanged(bool isRTL)
{
if (!isActiveTextEdit())
return;
ASSERT(m_currentFocusElement->document() && m_currentFocusElement->document()->frame());
RenderObject* renderer = m_currentFocusElement->renderer();
if (!renderer)
return;
Editor* editor = m_currentFocusElement->document()->frame()->editor();
ASSERT(editor);
if ((renderer->style()->direction() == RTL) != isRTL)
editor->setBaseWritingDirection(isRTL ? RightToLeftWritingDirection : LeftToRightWritingDirection);
}
|
void InputHandler::handleInputLocaleChanged(bool isRTL)
{
if (!isActiveTextEdit())
return;
ASSERT(m_currentFocusElement->document() && m_currentFocusElement->document()->frame());
RenderObject* renderer = m_currentFocusElement->renderer();
if (!renderer)
return;
Editor* editor = m_currentFocusElement->document()->frame()->editor();
ASSERT(editor);
if ((renderer->style()->direction() == RTL) != isRTL)
editor->setBaseWritingDirection(isRTL ? RightToLeftWritingDirection : LeftToRightWritingDirection);
}
|
C
|
Chrome
| 0 |
CVE-2014-9425
|
https://www.cvedetails.com/cve/CVE-2014-9425/
| null |
https://git.php.net/?p=php-src.git;a=commit;h=2bcf69d073190e4f032d883f3416dea1b027a39e
|
2bcf69d073190e4f032d883f3416dea1b027a39e
| null |
ZEND_API void zend_ts_hash_apply(TsHashTable *ht, apply_func_t apply_func)
{
begin_write(ht);
zend_hash_apply(TS_HASH(ht), apply_func);
end_write(ht);
}
|
ZEND_API void zend_ts_hash_apply(TsHashTable *ht, apply_func_t apply_func)
{
begin_write(ht);
zend_hash_apply(TS_HASH(ht), apply_func);
end_write(ht);
}
|
C
|
php
| 0 |
CVE-2014-5045
|
https://www.cvedetails.com/cve/CVE-2014-5045/
|
CWE-59
|
https://github.com/torvalds/linux/commit/295dc39d941dc2ae53d5c170365af4c9d5c16212
|
295dc39d941dc2ae53d5c170365af4c9d5c16212
|
fs: umount on symlink leaks mnt count
Currently umount on symlink blocks following umount:
/vz is separate mount
# ls /vz/ -al | grep test
drwxr-xr-x. 2 root root 4096 Jul 19 01:14 testdir
lrwxrwxrwx. 1 root root 11 Jul 19 01:16 testlink -> /vz/testdir
# umount -l /vz/testlink
umount: /vz/testlink: not mounted (expected)
# lsof /vz
# umount /vz
umount: /vz: device is busy. (unexpected)
In this case mountpoint_last() gets an extra refcount on path->mnt
Signed-off-by: Vasily Averin <[email protected]>
Acked-by: Ian Kent <[email protected]>
Acked-by: Jeff Layton <[email protected]>
Cc: [email protected]
Signed-off-by: Christoph Hellwig <[email protected]>
|
mountpoint_last(struct nameidata *nd, struct path *path)
{
int error = 0;
struct dentry *dentry;
struct dentry *dir = nd->path.dentry;
/* If we're in rcuwalk, drop out of it to handle last component */
if (nd->flags & LOOKUP_RCU) {
if (unlazy_walk(nd, NULL)) {
error = -ECHILD;
goto out;
}
}
nd->flags &= ~LOOKUP_PARENT;
if (unlikely(nd->last_type != LAST_NORM)) {
error = handle_dots(nd, nd->last_type);
if (error)
goto out;
dentry = dget(nd->path.dentry);
goto done;
}
mutex_lock(&dir->d_inode->i_mutex);
dentry = d_lookup(dir, &nd->last);
if (!dentry) {
/*
* No cached dentry. Mounted dentries are pinned in the cache,
* so that means that this dentry is probably a symlink or the
* path doesn't actually point to a mounted dentry.
*/
dentry = d_alloc(dir, &nd->last);
if (!dentry) {
error = -ENOMEM;
mutex_unlock(&dir->d_inode->i_mutex);
goto out;
}
dentry = lookup_real(dir->d_inode, dentry, nd->flags);
error = PTR_ERR(dentry);
if (IS_ERR(dentry)) {
mutex_unlock(&dir->d_inode->i_mutex);
goto out;
}
}
mutex_unlock(&dir->d_inode->i_mutex);
done:
if (!dentry->d_inode || d_is_negative(dentry)) {
error = -ENOENT;
dput(dentry);
goto out;
}
path->dentry = dentry;
path->mnt = nd->path.mnt;
if (should_follow_link(dentry, nd->flags & LOOKUP_FOLLOW))
return 1;
mntget(path->mnt);
follow_mount(path);
error = 0;
out:
terminate_walk(nd);
return error;
}
|
mountpoint_last(struct nameidata *nd, struct path *path)
{
int error = 0;
struct dentry *dentry;
struct dentry *dir = nd->path.dentry;
/* If we're in rcuwalk, drop out of it to handle last component */
if (nd->flags & LOOKUP_RCU) {
if (unlazy_walk(nd, NULL)) {
error = -ECHILD;
goto out;
}
}
nd->flags &= ~LOOKUP_PARENT;
if (unlikely(nd->last_type != LAST_NORM)) {
error = handle_dots(nd, nd->last_type);
if (error)
goto out;
dentry = dget(nd->path.dentry);
goto done;
}
mutex_lock(&dir->d_inode->i_mutex);
dentry = d_lookup(dir, &nd->last);
if (!dentry) {
/*
* No cached dentry. Mounted dentries are pinned in the cache,
* so that means that this dentry is probably a symlink or the
* path doesn't actually point to a mounted dentry.
*/
dentry = d_alloc(dir, &nd->last);
if (!dentry) {
error = -ENOMEM;
mutex_unlock(&dir->d_inode->i_mutex);
goto out;
}
dentry = lookup_real(dir->d_inode, dentry, nd->flags);
error = PTR_ERR(dentry);
if (IS_ERR(dentry)) {
mutex_unlock(&dir->d_inode->i_mutex);
goto out;
}
}
mutex_unlock(&dir->d_inode->i_mutex);
done:
if (!dentry->d_inode || d_is_negative(dentry)) {
error = -ENOENT;
dput(dentry);
goto out;
}
path->dentry = dentry;
path->mnt = mntget(nd->path.mnt);
if (should_follow_link(dentry, nd->flags & LOOKUP_FOLLOW))
return 1;
follow_mount(path);
error = 0;
out:
terminate_walk(nd);
return error;
}
|
C
|
linux
| 1 |
CVE-2019-13307
|
https://www.cvedetails.com/cve/CVE-2019-13307/
|
CWE-119
|
https://github.com/ImageMagick/ImageMagick6/commit/91e58d967a92250439ede038ccfb0913a81e59fe
|
91e58d967a92250439ede038ccfb0913a81e59fe
|
https://github.com/ImageMagick/ImageMagick/issues/1615
|
static void GetMeanPixelList(PixelList *pixel_list,MagickPixelPacket *pixel)
{
MagickRealType
sum;
register SkipList
*list;
register ssize_t
channel;
size_t
color;
ssize_t
count;
unsigned short
channels[ListChannels];
/*
Find the mean value for each of the color.
*/
for (channel=0; channel < 5; channel++)
{
list=pixel_list->lists+channel;
color=65536L;
count=0;
sum=0.0;
do
{
color=list->nodes[color].next[0];
sum+=(MagickRealType) list->nodes[color].count*color;
count+=list->nodes[color].count;
} while (count < (ssize_t) pixel_list->length);
sum/=pixel_list->length;
channels[channel]=(unsigned short) sum;
}
pixel->red=(MagickRealType) ScaleShortToQuantum(channels[0]);
pixel->green=(MagickRealType) ScaleShortToQuantum(channels[1]);
pixel->blue=(MagickRealType) ScaleShortToQuantum(channels[2]);
pixel->opacity=(MagickRealType) ScaleShortToQuantum(channels[3]);
pixel->index=(MagickRealType) ScaleShortToQuantum(channels[4]);
}
|
static void GetMeanPixelList(PixelList *pixel_list,MagickPixelPacket *pixel)
{
MagickRealType
sum;
register SkipList
*list;
register ssize_t
channel;
size_t
color;
ssize_t
count;
unsigned short
channels[ListChannels];
/*
Find the mean value for each of the color.
*/
for (channel=0; channel < 5; channel++)
{
list=pixel_list->lists+channel;
color=65536L;
count=0;
sum=0.0;
do
{
color=list->nodes[color].next[0];
sum+=(MagickRealType) list->nodes[color].count*color;
count+=list->nodes[color].count;
} while (count < (ssize_t) pixel_list->length);
sum/=pixel_list->length;
channels[channel]=(unsigned short) sum;
}
pixel->red=(MagickRealType) ScaleShortToQuantum(channels[0]);
pixel->green=(MagickRealType) ScaleShortToQuantum(channels[1]);
pixel->blue=(MagickRealType) ScaleShortToQuantum(channels[2]);
pixel->opacity=(MagickRealType) ScaleShortToQuantum(channels[3]);
pixel->index=(MagickRealType) ScaleShortToQuantum(channels[4]);
}
|
C
|
ImageMagick6
| 0 |
CVE-2011-2861
|
https://www.cvedetails.com/cve/CVE-2011-2861/
|
CWE-20
|
https://github.com/chromium/chromium/commit/8262245d384be025f13e2a5b3a03b7e5c98374ce
|
8262245d384be025f13e2a5b3a03b7e5c98374ce
|
DevTools: move DevToolsAgent/Client into content.
BUG=84078
TEST=
Review URL: http://codereview.chromium.org/7461019
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@93596 0039d316-1c4b-4281-b951-d872f2087c98
|
void RenderView::SendPendingAccessibilityNotifications() {
if (!accessibility_.get())
return;
if (pending_accessibility_notifications_.empty())
return;
std::vector<ViewHostMsg_AccessibilityNotification_Params> notifications;
for (size_t i = 0; i < pending_accessibility_notifications_.size(); i++) {
RendererAccessibilityNotification& notification =
pending_accessibility_notifications_[i];
WebAccessibilityObject obj = accessibility_->getObjectById(notification.id);
if (!obj.isValid())
continue;
ViewHostMsg_AccessibilityNotification_Params param;
WebAccessibilityNotificationToViewHostMsg(
pending_accessibility_notifications_[i].type, ¶m.notification_type);
param.acc_obj = WebAccessibility(
obj, accessibility_.get(), notification.ShouldIncludeChildren());
notifications.push_back(param);
}
pending_accessibility_notifications_.clear();
Send(new ViewHostMsg_AccessibilityNotifications(routing_id_, notifications));
accessibility_ack_pending_ = true;
}
|
void RenderView::SendPendingAccessibilityNotifications() {
if (!accessibility_.get())
return;
if (pending_accessibility_notifications_.empty())
return;
std::vector<ViewHostMsg_AccessibilityNotification_Params> notifications;
for (size_t i = 0; i < pending_accessibility_notifications_.size(); i++) {
RendererAccessibilityNotification& notification =
pending_accessibility_notifications_[i];
WebAccessibilityObject obj = accessibility_->getObjectById(notification.id);
if (!obj.isValid())
continue;
ViewHostMsg_AccessibilityNotification_Params param;
WebAccessibilityNotificationToViewHostMsg(
pending_accessibility_notifications_[i].type, ¶m.notification_type);
param.acc_obj = WebAccessibility(
obj, accessibility_.get(), notification.ShouldIncludeChildren());
notifications.push_back(param);
}
pending_accessibility_notifications_.clear();
Send(new ViewHostMsg_AccessibilityNotifications(routing_id_, notifications));
accessibility_ack_pending_ = true;
}
|
C
|
Chrome
| 0 |
null | null | null |
https://github.com/chromium/chromium/commit/69ec52bd0b32622770a25952386596ccb4ad6434
|
69ec52bd0b32622770a25952386596ccb4ad6434
|
[LayoutNG] A few small cleanups in flex code
- Don't use legacy when we don't have to
- Store NGBlockNode instead of NGLayoutInputNode
Bug: 845235
Change-Id: I99e48f7f69e4f53f0391e2cd542e117b501cb7d6
Reviewed-on: https://chromium-review.googlesource.com/c/1379061
Reviewed-by: Christian Biesinger <[email protected]>
Commit-Queue: David Grogan <[email protected]>
Cr-Commit-Position: refs/heads/master@{#616907}
|
bool NGFlexLayoutAlgorithm::MainAxisIsInlineAxis(NGBlockNode child) {
return child.Style().IsHorizontalWritingMode() ==
FlexLayoutAlgorithm::IsHorizontalFlow(Style());
}
|
bool NGFlexLayoutAlgorithm::MainAxisIsInlineAxis(NGBlockNode child) {
return child.Style().IsHorizontalWritingMode() ==
FlexLayoutAlgorithm::IsHorizontalFlow(Style());
}
|
C
|
Chrome
| 0 |
CVE-2018-6063
|
https://www.cvedetails.com/cve/CVE-2018-6063/
|
CWE-787
|
https://github.com/chromium/chromium/commit/673ce95d481ea9368c4d4d43ac756ba1d6d9e608
|
673ce95d481ea9368c4d4d43ac756ba1d6d9e608
|
Correct mojo::WrapSharedMemoryHandle usage
Fixes some incorrect uses of mojo::WrapSharedMemoryHandle which
were assuming that the call actually has any control over the memory
protection applied to a handle when mapped.
Where fixing usage is infeasible for this CL, TODOs are added to
annotate follow-up work.
Also updates the API and documentation to (hopefully) improve clarity
and avoid similar mistakes from being made in the future.
BUG=792900
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: I0578aaa9ca3bfcb01aaf2451315d1ede95458477
Reviewed-on: https://chromium-review.googlesource.com/818282
Reviewed-by: Wei Li <[email protected]>
Reviewed-by: Lei Zhang <[email protected]>
Reviewed-by: John Abd-El-Malek <[email protected]>
Reviewed-by: Daniel Cheng <[email protected]>
Reviewed-by: Sadrul Chowdhury <[email protected]>
Reviewed-by: Yuzhu Shen <[email protected]>
Reviewed-by: Robert Sesek <[email protected]>
Commit-Queue: Ken Rockot <[email protected]>
Cr-Commit-Position: refs/heads/master@{#530268}
|
void DiscardableSharedMemoryManager::AllocateLockedDiscardableSharedMemory(
int client_id,
size_t size,
int32_t id,
base::SharedMemoryHandle* shared_memory_handle) {
base::AutoLock lock(lock_);
MemorySegmentMap& client_segments = clients_[client_id];
if (client_segments.find(id) != client_segments.end()) {
LOG(ERROR) << "Invalid discardable shared memory ID";
*shared_memory_handle = base::SharedMemoryHandle();
return;
}
size_t limit = 0;
if (size < memory_limit_)
limit = memory_limit_ - size;
if (bytes_allocated_ > limit)
ReduceMemoryUsageUntilWithinLimit(limit);
std::unique_ptr<base::DiscardableSharedMemory> memory(
new base::DiscardableSharedMemory);
if (!memory->CreateAndMap(size)) {
*shared_memory_handle = base::SharedMemoryHandle();
return;
}
base::CheckedNumeric<size_t> checked_bytes_allocated = bytes_allocated_;
checked_bytes_allocated += memory->mapped_size();
if (!checked_bytes_allocated.IsValid()) {
*shared_memory_handle = base::SharedMemoryHandle();
return;
}
bytes_allocated_ = checked_bytes_allocated.ValueOrDie();
BytesAllocatedChanged(bytes_allocated_);
*shared_memory_handle = base::SharedMemory::DuplicateHandle(memory->handle());
memory->Close();
scoped_refptr<MemorySegment> segment(new MemorySegment(std::move(memory)));
client_segments[id] = segment.get();
segments_.push_back(segment.get());
std::push_heap(segments_.begin(), segments_.end(), CompareMemoryUsageTime);
if (bytes_allocated_ > memory_limit_)
ScheduleEnforceMemoryPolicy();
}
|
void DiscardableSharedMemoryManager::AllocateLockedDiscardableSharedMemory(
int client_id,
size_t size,
int32_t id,
base::SharedMemoryHandle* shared_memory_handle) {
base::AutoLock lock(lock_);
MemorySegmentMap& client_segments = clients_[client_id];
if (client_segments.find(id) != client_segments.end()) {
LOG(ERROR) << "Invalid discardable shared memory ID";
*shared_memory_handle = base::SharedMemoryHandle();
return;
}
size_t limit = 0;
if (size < memory_limit_)
limit = memory_limit_ - size;
if (bytes_allocated_ > limit)
ReduceMemoryUsageUntilWithinLimit(limit);
std::unique_ptr<base::DiscardableSharedMemory> memory(
new base::DiscardableSharedMemory);
if (!memory->CreateAndMap(size)) {
*shared_memory_handle = base::SharedMemoryHandle();
return;
}
base::CheckedNumeric<size_t> checked_bytes_allocated = bytes_allocated_;
checked_bytes_allocated += memory->mapped_size();
if (!checked_bytes_allocated.IsValid()) {
*shared_memory_handle = base::SharedMemoryHandle();
return;
}
bytes_allocated_ = checked_bytes_allocated.ValueOrDie();
BytesAllocatedChanged(bytes_allocated_);
*shared_memory_handle = base::SharedMemory::DuplicateHandle(memory->handle());
memory->Close();
scoped_refptr<MemorySegment> segment(new MemorySegment(std::move(memory)));
client_segments[id] = segment.get();
segments_.push_back(segment.get());
std::push_heap(segments_.begin(), segments_.end(), CompareMemoryUsageTime);
if (bytes_allocated_ > memory_limit_)
ScheduleEnforceMemoryPolicy();
}
|
C
|
Chrome
| 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 <[email protected]>
Signed-off-by: Herbert Xu <[email protected]>
|
static int zlib_decompress_setup(struct crypto_pcomp *tfm, void *params,
unsigned int len)
{
struct zlib_ctx *ctx = crypto_tfm_ctx(crypto_pcomp_tfm(tfm));
struct z_stream_s *stream = &ctx->decomp_stream;
struct nlattr *tb[ZLIB_DECOMP_MAX + 1];
int ret = 0;
ret = nla_parse(tb, ZLIB_DECOMP_MAX, params, len, NULL);
if (ret)
return ret;
zlib_decomp_exit(ctx);
ctx->decomp_windowBits = tb[ZLIB_DECOMP_WINDOWBITS]
? nla_get_u32(tb[ZLIB_DECOMP_WINDOWBITS])
: DEF_WBITS;
stream->workspace = vzalloc(zlib_inflate_workspacesize());
if (!stream->workspace)
return -ENOMEM;
ret = zlib_inflateInit2(stream, ctx->decomp_windowBits);
if (ret != Z_OK) {
vfree(stream->workspace);
stream->workspace = NULL;
return -EINVAL;
}
return 0;
}
|
static int zlib_decompress_setup(struct crypto_pcomp *tfm, void *params,
unsigned int len)
{
struct zlib_ctx *ctx = crypto_tfm_ctx(crypto_pcomp_tfm(tfm));
struct z_stream_s *stream = &ctx->decomp_stream;
struct nlattr *tb[ZLIB_DECOMP_MAX + 1];
int ret = 0;
ret = nla_parse(tb, ZLIB_DECOMP_MAX, params, len, NULL);
if (ret)
return ret;
zlib_decomp_exit(ctx);
ctx->decomp_windowBits = tb[ZLIB_DECOMP_WINDOWBITS]
? nla_get_u32(tb[ZLIB_DECOMP_WINDOWBITS])
: DEF_WBITS;
stream->workspace = vzalloc(zlib_inflate_workspacesize());
if (!stream->workspace)
return -ENOMEM;
ret = zlib_inflateInit2(stream, ctx->decomp_windowBits);
if (ret != Z_OK) {
vfree(stream->workspace);
stream->workspace = NULL;
return -EINVAL;
}
return 0;
}
|
C
|
linux
| 0 |
CVE-2017-14170
|
https://www.cvedetails.com/cve/CVE-2017-14170/
|
CWE-834
|
https://github.com/FFmpeg/FFmpeg/commit/900f39692ca0337a98a7cf047e4e2611071810c2
|
900f39692ca0337a98a7cf047e4e2611071810c2
|
avformat/mxfdec: Fix DoS issues in mxf_read_index_entry_array()
Fixes: 20170829A.mxf
Co-Author: 张洪亮(望初)" <[email protected]>
Found-by: Xiaohei and Wangchu from Alibaba Security Team
Signed-off-by: Michael Niedermayer <[email protected]>
|
static int mxf_read_close(AVFormatContext *s)
{
MXFContext *mxf = s->priv_data;
int i;
av_freep(&mxf->packages_refs);
for (i = 0; i < s->nb_streams; i++)
s->streams[i]->priv_data = NULL;
for (i = 0; i < mxf->metadata_sets_count; i++) {
mxf_free_metadataset(mxf->metadata_sets + i, 1);
}
av_freep(&mxf->partitions);
av_freep(&mxf->metadata_sets);
av_freep(&mxf->aesc);
av_freep(&mxf->local_tags);
if (mxf->index_tables) {
for (i = 0; i < mxf->nb_index_tables; i++) {
av_freep(&mxf->index_tables[i].segments);
av_freep(&mxf->index_tables[i].ptses);
av_freep(&mxf->index_tables[i].fake_index);
av_freep(&mxf->index_tables[i].offsets);
}
}
av_freep(&mxf->index_tables);
return 0;
}
|
static int mxf_read_close(AVFormatContext *s)
{
MXFContext *mxf = s->priv_data;
int i;
av_freep(&mxf->packages_refs);
for (i = 0; i < s->nb_streams; i++)
s->streams[i]->priv_data = NULL;
for (i = 0; i < mxf->metadata_sets_count; i++) {
mxf_free_metadataset(mxf->metadata_sets + i, 1);
}
av_freep(&mxf->partitions);
av_freep(&mxf->metadata_sets);
av_freep(&mxf->aesc);
av_freep(&mxf->local_tags);
if (mxf->index_tables) {
for (i = 0; i < mxf->nb_index_tables; i++) {
av_freep(&mxf->index_tables[i].segments);
av_freep(&mxf->index_tables[i].ptses);
av_freep(&mxf->index_tables[i].fake_index);
av_freep(&mxf->index_tables[i].offsets);
}
}
av_freep(&mxf->index_tables);
return 0;
}
|
C
|
FFmpeg
| 0 |
CVE-2011-2881
|
https://www.cvedetails.com/cve/CVE-2011-2881/
|
CWE-119
|
https://github.com/chromium/chromium/commit/88c4913f11967abfd08a8b22b4423710322ac49b
|
88c4913f11967abfd08a8b22b4423710322ac49b
|
[chromium] Fix shutdown race when posting main thread task to CCThreadProxy and enable tests
https://bugs.webkit.org/show_bug.cgi?id=70161
Reviewed by David Levin.
Source/WebCore:
Adds a weak pointer mechanism to cancel main thread tasks posted to CCThreadProxy instances from the compositor
thread. Previously there was a race condition where main thread tasks could run even after the CCThreadProxy was
destroyed.
This race does not exist in the other direction because when tearing down a CCThreadProxy we first post a quit
task to the compositor thread and then suspend execution of the main thread until all compositor tasks for the
CCThreadProxy have been drained.
Covered by the now-enabled CCLayerTreeHostTest* unit tests.
* WebCore.gypi:
* platform/graphics/chromium/cc/CCScopedMainThreadProxy.h: Added.
(WebCore::CCScopedMainThreadProxy::create):
(WebCore::CCScopedMainThreadProxy::postTask):
(WebCore::CCScopedMainThreadProxy::shutdown):
(WebCore::CCScopedMainThreadProxy::CCScopedMainThreadProxy):
(WebCore::CCScopedMainThreadProxy::runTaskIfNotShutdown):
* platform/graphics/chromium/cc/CCThreadProxy.cpp:
(WebCore::CCThreadProxy::CCThreadProxy):
(WebCore::CCThreadProxy::~CCThreadProxy):
(WebCore::CCThreadProxy::createBeginFrameAndCommitTaskOnCCThread):
* platform/graphics/chromium/cc/CCThreadProxy.h:
Source/WebKit/chromium:
Enables the CCLayerTreeHostTest* tests by default. Most tests are run twice in a single thread and multiple
thread configuration. Some tests run only in the multiple thread configuration if they depend on the compositor
thread scheduling draws by itself.
* tests/CCLayerTreeHostTest.cpp:
(::CCLayerTreeHostTest::timeout):
(::CCLayerTreeHostTest::clearTimeout):
(::CCLayerTreeHostTest::CCLayerTreeHostTest):
(::CCLayerTreeHostTest::onEndTest):
(::CCLayerTreeHostTest::TimeoutTask::TimeoutTask):
(::CCLayerTreeHostTest::TimeoutTask::clearTest):
(::CCLayerTreeHostTest::TimeoutTask::~TimeoutTask):
(::CCLayerTreeHostTest::TimeoutTask::Run):
(::CCLayerTreeHostTest::runTest):
(::CCLayerTreeHostTest::doBeginTest):
(::CCLayerTreeHostTestThreadOnly::runTest):
(::CCLayerTreeHostTestSetNeedsRedraw::commitCompleteOnCCThread):
git-svn-id: svn://svn.chromium.org/blink/trunk@97784 bbb929c8-8fbe-4397-9dbb-9b2b20218538
|
virtual void drawLayersOnCCThread(CCLayerTreeHostImpl*)
{
if (m_numDraws == 1)
postSetNeedsCommitThenRedrawToMainThread();
m_numDraws++;
postSetNeedsRedrawToMainThread();
}
|
virtual void drawLayersOnCCThread(CCLayerTreeHostImpl*)
{
if (m_numDraws == 1)
postSetNeedsCommitThenRedrawToMainThread();
m_numDraws++;
postSetNeedsRedrawToMainThread();
}
|
C
|
Chrome
| 0 |
CVE-2017-6903
|
https://www.cvedetails.com/cve/CVE-2017-6903/
|
CWE-269
|
https://github.com/iortcw/iortcw/commit/b6ff2bcb1e4e6976d61e316175c6d7c99860fe20
|
b6ff2bcb1e4e6976d61e316175c6d7c99860fe20
|
All: Don't load .pk3s as .dlls, and don't load user config files from .pk3s
|
static int QDECL paksort( const void *a, const void *b ) {
char *aa, *bb;
aa = *(char **)a;
bb = *(char **)b;
return FS_PathCmp( aa, bb );
}
|
static int QDECL paksort( const void *a, const void *b ) {
char *aa, *bb;
aa = *(char **)a;
bb = *(char **)b;
return FS_PathCmp( aa, bb );
}
|
C
|
OpenJK
| 0 |
CVE-2015-0253
|
https://www.cvedetails.com/cve/CVE-2015-0253/
| null |
https://github.com/apache/httpd/commit/6a974059190b8a0c7e499f4ab12fe108127099cb
|
6a974059190b8a0c7e499f4ab12fe108127099cb
|
*) SECURITY: CVE-2015-0253 (cve.mitre.org)
core: Fix a crash introduced in with ErrorDocument 400 pointing
to a local URL-path with the INCLUDES filter active, introduced
in 2.4.11. PR 57531. [Yann Ylavic]
Submitted By: ylavic
Committed By: covener
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1664205 13f79535-47bb-0310-9956-ffa450edef68
|
AP_DECLARE(void) ap_note_digest_auth_failure(request_rec *r)
{
ap_note_auth_failure(r);
}
|
AP_DECLARE(void) ap_note_digest_auth_failure(request_rec *r)
{
ap_note_auth_failure(r);
}
|
C
|
httpd
| 0 |
CVE-2017-5061
|
https://www.cvedetails.com/cve/CVE-2017-5061/
|
CWE-362
|
https://github.com/chromium/chromium/commit/5d78b84d39bd34bc9fce9d01c0dcd5a22a330d34
|
5d78b84d39bd34bc9fce9d01c0dcd5a22a330d34
|
(Reland) Discard compositor frames from unloaded web content
This is a reland of https://codereview.chromium.org/2707243005/ with a
small change to fix an uninitialized memory error that fails on MSAN
bots.
BUG=672847
[email protected], [email protected]
CQ_INCLUDE_TRYBOTS=master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_site_isolation
Review-Url: https://codereview.chromium.org/2731283003
Cr-Commit-Position: refs/heads/master@{#454954}
|
void LayerTreeHost::UnregisterLayer(Layer* layer) {
DCHECK(LayerById(layer->id()));
DCHECK(!in_paint_layer_contents_);
if (layer->element_id()) {
mutator_host_->UnregisterElement(layer->element_id(),
ElementListType::ACTIVE);
}
RemoveLayerShouldPushProperties(layer);
layer_id_map_.erase(layer->id());
}
|
void LayerTreeHost::UnregisterLayer(Layer* layer) {
DCHECK(LayerById(layer->id()));
DCHECK(!in_paint_layer_contents_);
if (layer->element_id()) {
mutator_host_->UnregisterElement(layer->element_id(),
ElementListType::ACTIVE);
}
RemoveLayerShouldPushProperties(layer);
layer_id_map_.erase(layer->id());
}
|
C
|
Chrome
| 0 |
CVE-2014-3690
|
https://www.cvedetails.com/cve/CVE-2014-3690/
|
CWE-399
|
https://github.com/torvalds/linux/commit/d974baa398f34393db76be45f7d4d04fbdbb4a0a
|
d974baa398f34393db76be45f7d4d04fbdbb4a0a
|
x86,kvm,vmx: Preserve CR4 across VM entry
CR4 isn't constant; at least the TSD and PCE bits can vary.
TBH, treating CR0 and CR3 as constant scares me a bit, too, but it looks
like it's correct.
This adds a branch and a read from cr4 to each vm entry. Because it is
extremely likely that consecutive entries into the same vcpu will have
the same host cr4 value, this fixes up the vmcs instead of restoring cr4
after the fact. A subsequent patch will add a kernel-wide cr4 shadow,
reducing the overhead in the common case to just two memory reads and a
branch.
Signed-off-by: Andy Lutomirski <[email protected]>
Acked-by: Paolo Bonzini <[email protected]>
Cc: [email protected]
Cc: Petr Matousek <[email protected]>
Cc: Gleb Natapov <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
|
static inline bool nested_cpu_has(struct vmcs12 *vmcs12, u32 bit)
{
return vmcs12->cpu_based_vm_exec_control & bit;
}
|
static inline bool nested_cpu_has(struct vmcs12 *vmcs12, u32 bit)
{
return vmcs12->cpu_based_vm_exec_control & bit;
}
|
C
|
linux
| 0 |
CVE-2018-17205
|
https://www.cvedetails.com/cve/CVE-2018-17205/
|
CWE-617
|
https://github.com/openvswitch/ovs/commit/0befd1f3745055c32940f5faf9559be6a14395e6
|
0befd1f3745055c32940f5faf9559be6a14395e6
|
ofproto: Fix OVS crash when reverting old flows in bundle commit
During bundle commit flows which are added in bundle are applied
to ofproto in-order. In case if a flow cannot be added (e.g. flow
action is go-to group id which does not exist), OVS tries to
revert back all previous flows which were successfully applied
from the same bundle. This is possible since OVS maintains list
of old flows which were replaced by flows from the bundle.
While reinserting old flows ovs asserts due to check on rule
state != RULE_INITIALIZED. This will work only for new flows, but
for old flow the rule state will be RULE_REMOVED. This is causing
an assert and OVS crash.
The ovs assert check should be modified to != RULE_INSERTED to prevent
any existing rule being re-inserted and allow new rules and old rules
(in case of revert) to get inserted.
Here is an example to trigger the assert:
$ ovs-vsctl add-br br-test -- set Bridge br-test datapath_type=netdev
$ cat flows.txt
flow add table=1,priority=0,in_port=2,actions=NORMAL
flow add table=1,priority=0,in_port=3,actions=NORMAL
$ ovs-ofctl dump-flows -OOpenflow13 br-test
cookie=0x0, duration=2.465s, table=1, n_packets=0, n_bytes=0, priority=0,in_port=2 actions=NORMAL
cookie=0x0, duration=2.465s, table=1, n_packets=0, n_bytes=0, priority=0,in_port=3 actions=NORMAL
$ cat flow-modify.txt
flow modify table=1,priority=0,in_port=2,actions=drop
flow modify table=1,priority=0,in_port=3,actions=group:10
$ ovs-ofctl bundle br-test flow-modify.txt -OOpenflow13
First flow rule will be modified since it is a valid rule. However second
rule is invalid since no group with id 10 exists. Bundle commit tries to
revert (insert) the first rule to old flow which results in ovs_assert at
ofproto_rule_insert__() since old rule->state = RULE_REMOVED.
Signed-off-by: Vishal Deep Ajmera <[email protected]>
Signed-off-by: Ben Pfaff <[email protected]>
|
ofproto_aa_mapping_register(struct ofproto *ofproto, void *aux,
const struct aa_mapping_settings *s)
{
if (!ofproto->ofproto_class->aa_mapping_set) {
return EOPNOTSUPP;
}
ofproto->ofproto_class->aa_mapping_set(ofproto, aux, s);
return 0;
}
|
ofproto_aa_mapping_register(struct ofproto *ofproto, void *aux,
const struct aa_mapping_settings *s)
{
if (!ofproto->ofproto_class->aa_mapping_set) {
return EOPNOTSUPP;
}
ofproto->ofproto_class->aa_mapping_set(ofproto, aux, s);
return 0;
}
|
C
|
ovs
| 0 |
CVE-2016-9806
|
https://www.cvedetails.com/cve/CVE-2016-9806/
|
CWE-415
|
https://github.com/torvalds/linux/commit/92964c79b357efd980812c4de5c1fd2ec8bb5520
|
92964c79b357efd980812c4de5c1fd2ec8bb5520
|
netlink: Fix dump skb leak/double free
When we free cb->skb after a dump, we do it after releasing the
lock. This means that a new dump could have started in the time
being and we'll end up freeing their skb instead of ours.
This patch saves the skb and module before we unlock so we free
the right memory.
Fixes: 16b304f3404f ("netlink: Eliminate kmalloc in netlink dump operation.")
Reported-by: Baozeng Ding <[email protected]>
Signed-off-by: Herbert Xu <[email protected]>
Acked-by: Cong Wang <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
|
static int netlink_sendmsg(struct socket *sock, struct msghdr *msg, size_t len)
{
struct sock *sk = sock->sk;
struct netlink_sock *nlk = nlk_sk(sk);
DECLARE_SOCKADDR(struct sockaddr_nl *, addr, msg->msg_name);
u32 dst_portid;
u32 dst_group;
struct sk_buff *skb;
int err;
struct scm_cookie scm;
u32 netlink_skb_flags = 0;
if (msg->msg_flags&MSG_OOB)
return -EOPNOTSUPP;
err = scm_send(sock, msg, &scm, true);
if (err < 0)
return err;
if (msg->msg_namelen) {
err = -EINVAL;
if (addr->nl_family != AF_NETLINK)
goto out;
dst_portid = addr->nl_pid;
dst_group = ffs(addr->nl_groups);
err = -EPERM;
if ((dst_group || dst_portid) &&
!netlink_allowed(sock, NL_CFG_F_NONROOT_SEND))
goto out;
netlink_skb_flags |= NETLINK_SKB_DST;
} else {
dst_portid = nlk->dst_portid;
dst_group = nlk->dst_group;
}
if (!nlk->bound) {
err = netlink_autobind(sock);
if (err)
goto out;
} else {
/* Ensure nlk is hashed and visible. */
smp_rmb();
}
err = -EMSGSIZE;
if (len > sk->sk_sndbuf - 32)
goto out;
err = -ENOBUFS;
skb = netlink_alloc_large_skb(len, dst_group);
if (skb == NULL)
goto out;
NETLINK_CB(skb).portid = nlk->portid;
NETLINK_CB(skb).dst_group = dst_group;
NETLINK_CB(skb).creds = scm.creds;
NETLINK_CB(skb).flags = netlink_skb_flags;
err = -EFAULT;
if (memcpy_from_msg(skb_put(skb, len), msg, len)) {
kfree_skb(skb);
goto out;
}
err = security_netlink_send(sk, skb);
if (err) {
kfree_skb(skb);
goto out;
}
if (dst_group) {
atomic_inc(&skb->users);
netlink_broadcast(sk, skb, dst_portid, dst_group, GFP_KERNEL);
}
err = netlink_unicast(sk, skb, dst_portid, msg->msg_flags&MSG_DONTWAIT);
out:
scm_destroy(&scm);
return err;
}
|
static int netlink_sendmsg(struct socket *sock, struct msghdr *msg, size_t len)
{
struct sock *sk = sock->sk;
struct netlink_sock *nlk = nlk_sk(sk);
DECLARE_SOCKADDR(struct sockaddr_nl *, addr, msg->msg_name);
u32 dst_portid;
u32 dst_group;
struct sk_buff *skb;
int err;
struct scm_cookie scm;
u32 netlink_skb_flags = 0;
if (msg->msg_flags&MSG_OOB)
return -EOPNOTSUPP;
err = scm_send(sock, msg, &scm, true);
if (err < 0)
return err;
if (msg->msg_namelen) {
err = -EINVAL;
if (addr->nl_family != AF_NETLINK)
goto out;
dst_portid = addr->nl_pid;
dst_group = ffs(addr->nl_groups);
err = -EPERM;
if ((dst_group || dst_portid) &&
!netlink_allowed(sock, NL_CFG_F_NONROOT_SEND))
goto out;
netlink_skb_flags |= NETLINK_SKB_DST;
} else {
dst_portid = nlk->dst_portid;
dst_group = nlk->dst_group;
}
if (!nlk->bound) {
err = netlink_autobind(sock);
if (err)
goto out;
} else {
/* Ensure nlk is hashed and visible. */
smp_rmb();
}
err = -EMSGSIZE;
if (len > sk->sk_sndbuf - 32)
goto out;
err = -ENOBUFS;
skb = netlink_alloc_large_skb(len, dst_group);
if (skb == NULL)
goto out;
NETLINK_CB(skb).portid = nlk->portid;
NETLINK_CB(skb).dst_group = dst_group;
NETLINK_CB(skb).creds = scm.creds;
NETLINK_CB(skb).flags = netlink_skb_flags;
err = -EFAULT;
if (memcpy_from_msg(skb_put(skb, len), msg, len)) {
kfree_skb(skb);
goto out;
}
err = security_netlink_send(sk, skb);
if (err) {
kfree_skb(skb);
goto out;
}
if (dst_group) {
atomic_inc(&skb->users);
netlink_broadcast(sk, skb, dst_portid, dst_group, GFP_KERNEL);
}
err = netlink_unicast(sk, skb, dst_portid, msg->msg_flags&MSG_DONTWAIT);
out:
scm_destroy(&scm);
return err;
}
|
C
|
linux
| 0 |
CVE-2017-11665
|
https://www.cvedetails.com/cve/CVE-2017-11665/
|
CWE-20
|
https://github.com/FFmpeg/FFmpeg/commit/ffcc82219cef0928bed2d558b19ef6ea35634130
|
ffcc82219cef0928bed2d558b19ef6ea35634130
|
avformat/rtmppkt: Convert ff_amf_get_field_value() to bytestream2
Fixes: out of array accesses
Found-by: JunDong Xie of Ant-financial Light-Year Security Lab
Signed-off-by: Michael Niedermayer <[email protected]>
|
int ff_rtmp_packet_write(URLContext *h, RTMPPacket *pkt,
int chunk_size, RTMPPacket **prev_pkt_ptr,
int *nb_prev_pkt)
{
uint8_t pkt_hdr[16], *p = pkt_hdr;
int mode = RTMP_PS_TWELVEBYTES;
int off = 0;
int written = 0;
int ret;
RTMPPacket *prev_pkt;
int use_delta; // flag if using timestamp delta, not RTMP_PS_TWELVEBYTES
uint32_t timestamp; // full 32-bit timestamp or delta value
if ((ret = ff_rtmp_check_alloc_array(prev_pkt_ptr, nb_prev_pkt,
pkt->channel_id)) < 0)
return ret;
prev_pkt = *prev_pkt_ptr;
use_delta = prev_pkt[pkt->channel_id].channel_id &&
pkt->extra == prev_pkt[pkt->channel_id].extra &&
pkt->timestamp >= prev_pkt[pkt->channel_id].timestamp;
timestamp = pkt->timestamp;
if (use_delta) {
timestamp -= prev_pkt[pkt->channel_id].timestamp;
}
if (timestamp >= 0xFFFFFF) {
pkt->ts_field = 0xFFFFFF;
} else {
pkt->ts_field = timestamp;
}
if (use_delta) {
if (pkt->type == prev_pkt[pkt->channel_id].type &&
pkt->size == prev_pkt[pkt->channel_id].size) {
mode = RTMP_PS_FOURBYTES;
if (pkt->ts_field == prev_pkt[pkt->channel_id].ts_field)
mode = RTMP_PS_ONEBYTE;
} else {
mode = RTMP_PS_EIGHTBYTES;
}
}
if (pkt->channel_id < 64) {
bytestream_put_byte(&p, pkt->channel_id | (mode << 6));
} else if (pkt->channel_id < 64 + 256) {
bytestream_put_byte(&p, 0 | (mode << 6));
bytestream_put_byte(&p, pkt->channel_id - 64);
} else {
bytestream_put_byte(&p, 1 | (mode << 6));
bytestream_put_le16(&p, pkt->channel_id - 64);
}
if (mode != RTMP_PS_ONEBYTE) {
bytestream_put_be24(&p, pkt->ts_field);
if (mode != RTMP_PS_FOURBYTES) {
bytestream_put_be24(&p, pkt->size);
bytestream_put_byte(&p, pkt->type);
if (mode == RTMP_PS_TWELVEBYTES)
bytestream_put_le32(&p, pkt->extra);
}
}
if (pkt->ts_field == 0xFFFFFF)
bytestream_put_be32(&p, timestamp);
prev_pkt[pkt->channel_id].channel_id = pkt->channel_id;
prev_pkt[pkt->channel_id].type = pkt->type;
prev_pkt[pkt->channel_id].size = pkt->size;
prev_pkt[pkt->channel_id].timestamp = pkt->timestamp;
prev_pkt[pkt->channel_id].ts_field = pkt->ts_field;
prev_pkt[pkt->channel_id].extra = pkt->extra;
if ((ret = ffurl_write(h, pkt_hdr, p - pkt_hdr)) < 0)
return ret;
written = p - pkt_hdr + pkt->size;
while (off < pkt->size) {
int towrite = FFMIN(chunk_size, pkt->size - off);
if ((ret = ffurl_write(h, pkt->data + off, towrite)) < 0)
return ret;
off += towrite;
if (off < pkt->size) {
uint8_t marker = 0xC0 | pkt->channel_id;
if ((ret = ffurl_write(h, &marker, 1)) < 0)
return ret;
written++;
if (pkt->ts_field == 0xFFFFFF) {
uint8_t ts_header[4];
AV_WB32(ts_header, timestamp);
if ((ret = ffurl_write(h, ts_header, 4)) < 0)
return ret;
written += 4;
}
}
}
return written;
}
|
int ff_rtmp_packet_write(URLContext *h, RTMPPacket *pkt,
int chunk_size, RTMPPacket **prev_pkt_ptr,
int *nb_prev_pkt)
{
uint8_t pkt_hdr[16], *p = pkt_hdr;
int mode = RTMP_PS_TWELVEBYTES;
int off = 0;
int written = 0;
int ret;
RTMPPacket *prev_pkt;
int use_delta; // flag if using timestamp delta, not RTMP_PS_TWELVEBYTES
uint32_t timestamp; // full 32-bit timestamp or delta value
if ((ret = ff_rtmp_check_alloc_array(prev_pkt_ptr, nb_prev_pkt,
pkt->channel_id)) < 0)
return ret;
prev_pkt = *prev_pkt_ptr;
use_delta = prev_pkt[pkt->channel_id].channel_id &&
pkt->extra == prev_pkt[pkt->channel_id].extra &&
pkt->timestamp >= prev_pkt[pkt->channel_id].timestamp;
timestamp = pkt->timestamp;
if (use_delta) {
timestamp -= prev_pkt[pkt->channel_id].timestamp;
}
if (timestamp >= 0xFFFFFF) {
pkt->ts_field = 0xFFFFFF;
} else {
pkt->ts_field = timestamp;
}
if (use_delta) {
if (pkt->type == prev_pkt[pkt->channel_id].type &&
pkt->size == prev_pkt[pkt->channel_id].size) {
mode = RTMP_PS_FOURBYTES;
if (pkt->ts_field == prev_pkt[pkt->channel_id].ts_field)
mode = RTMP_PS_ONEBYTE;
} else {
mode = RTMP_PS_EIGHTBYTES;
}
}
if (pkt->channel_id < 64) {
bytestream_put_byte(&p, pkt->channel_id | (mode << 6));
} else if (pkt->channel_id < 64 + 256) {
bytestream_put_byte(&p, 0 | (mode << 6));
bytestream_put_byte(&p, pkt->channel_id - 64);
} else {
bytestream_put_byte(&p, 1 | (mode << 6));
bytestream_put_le16(&p, pkt->channel_id - 64);
}
if (mode != RTMP_PS_ONEBYTE) {
bytestream_put_be24(&p, pkt->ts_field);
if (mode != RTMP_PS_FOURBYTES) {
bytestream_put_be24(&p, pkt->size);
bytestream_put_byte(&p, pkt->type);
if (mode == RTMP_PS_TWELVEBYTES)
bytestream_put_le32(&p, pkt->extra);
}
}
if (pkt->ts_field == 0xFFFFFF)
bytestream_put_be32(&p, timestamp);
prev_pkt[pkt->channel_id].channel_id = pkt->channel_id;
prev_pkt[pkt->channel_id].type = pkt->type;
prev_pkt[pkt->channel_id].size = pkt->size;
prev_pkt[pkt->channel_id].timestamp = pkt->timestamp;
prev_pkt[pkt->channel_id].ts_field = pkt->ts_field;
prev_pkt[pkt->channel_id].extra = pkt->extra;
if ((ret = ffurl_write(h, pkt_hdr, p - pkt_hdr)) < 0)
return ret;
written = p - pkt_hdr + pkt->size;
while (off < pkt->size) {
int towrite = FFMIN(chunk_size, pkt->size - off);
if ((ret = ffurl_write(h, pkt->data + off, towrite)) < 0)
return ret;
off += towrite;
if (off < pkt->size) {
uint8_t marker = 0xC0 | pkt->channel_id;
if ((ret = ffurl_write(h, &marker, 1)) < 0)
return ret;
written++;
if (pkt->ts_field == 0xFFFFFF) {
uint8_t ts_header[4];
AV_WB32(ts_header, timestamp);
if ((ret = ffurl_write(h, ts_header, 4)) < 0)
return ret;
written += 4;
}
}
}
return written;
}
|
C
|
FFmpeg
| 0 |
CVE-2015-8877
|
https://www.cvedetails.com/cve/CVE-2015-8877/
|
CWE-399
|
https://github.com/libgd/libgd/commit/4751b606fa38edc456d627140898a7ec679fcc24
|
4751b606fa38edc456d627140898a7ec679fcc24
|
gdImageScaleTwoPass memory leak fix
Fixing memory leak in gdImageScaleTwoPass, as reported by @cmb69 and
confirmed by @vapier. This bug actually bit me in production and I'm
very thankful that it was reported with an easy fix.
Fixes #173.
|
BGD_DECLARE(int) gdTransformAffineGetImage(gdImagePtr *dst,
const gdImagePtr src,
gdRectPtr src_area,
const double affine[6])
{
int res;
double m[6];
gdRect bbox;
gdRect area_full;
if (src_area == NULL) {
area_full.x = 0;
area_full.y = 0;
area_full.width = gdImageSX(src);
area_full.height = gdImageSY(src);
src_area = &area_full;
}
gdTransformAffineBoundingBox(src_area, affine, &bbox);
*dst = gdImageCreateTrueColor(bbox.width, bbox.height);
if (*dst == NULL) {
return GD_FALSE;
}
(*dst)->saveAlphaFlag = 1;
if (!src->trueColor) {
gdImagePaletteToTrueColor(src);
}
/* Translate to dst origin (0,0) */
gdAffineTranslate(m, -bbox.x, -bbox.y);
gdAffineConcat(m, affine, m);
gdImageAlphaBlending(*dst, 0);
res = gdTransformAffineCopy(*dst,
0,0,
src,
src_area,
m);
if (res != GD_TRUE) {
gdImageDestroy(*dst);
dst = NULL;
return GD_FALSE;
} else {
return GD_TRUE;
}
}
|
BGD_DECLARE(int) gdTransformAffineGetImage(gdImagePtr *dst,
const gdImagePtr src,
gdRectPtr src_area,
const double affine[6])
{
int res;
double m[6];
gdRect bbox;
gdRect area_full;
if (src_area == NULL) {
area_full.x = 0;
area_full.y = 0;
area_full.width = gdImageSX(src);
area_full.height = gdImageSY(src);
src_area = &area_full;
}
gdTransformAffineBoundingBox(src_area, affine, &bbox);
*dst = gdImageCreateTrueColor(bbox.width, bbox.height);
if (*dst == NULL) {
return GD_FALSE;
}
(*dst)->saveAlphaFlag = 1;
if (!src->trueColor) {
gdImagePaletteToTrueColor(src);
}
/* Translate to dst origin (0,0) */
gdAffineTranslate(m, -bbox.x, -bbox.y);
gdAffineConcat(m, affine, m);
gdImageAlphaBlending(*dst, 0);
res = gdTransformAffineCopy(*dst,
0,0,
src,
src_area,
m);
if (res != GD_TRUE) {
gdImageDestroy(*dst);
dst = NULL;
return GD_FALSE;
} else {
return GD_TRUE;
}
}
|
C
|
libgd
| 0 |
CVE-2012-5375
|
https://www.cvedetails.com/cve/CVE-2012-5375/
|
CWE-310
|
https://github.com/torvalds/linux/commit/9c52057c698fb96f8f07e7a4bcf4801a092bda89
|
9c52057c698fb96f8f07e7a4bcf4801a092bda89
|
Btrfs: fix hash overflow handling
The handling for directory crc hash overflows was fairly obscure,
split_leaf returns EOVERFLOW when we try to extend the item and that is
supposed to bubble up to userland. For a while it did so, but along the
way we added better handling of errors and forced the FS readonly if we
hit IO errors during the directory insertion.
Along the way, we started testing only for EEXIST and the EOVERFLOW case
was dropped. The end result is that we may force the FS readonly if we
catch a directory hash bucket overflow.
This fixes a few problem spots. First I add tests for EOVERFLOW in the
places where we can safely just return the error up the chain.
btrfs_rename is harder though, because it tries to insert the new
directory item only after it has already unlinked anything the rename
was going to overwrite. Rather than adding very complex logic, I added
a helper to test for the hash overflow case early while it is still safe
to bail out.
Snapshot and subvolume creation had a similar problem, so they are using
the new helper now too.
Signed-off-by: Chris Mason <[email protected]>
Reported-by: Pascal Junod <[email protected]>
|
int btrfs_orphan_add(struct btrfs_trans_handle *trans, struct inode *inode)
{
struct btrfs_root *root = BTRFS_I(inode)->root;
struct btrfs_block_rsv *block_rsv = NULL;
int reserve = 0;
int insert = 0;
int ret;
if (!root->orphan_block_rsv) {
block_rsv = btrfs_alloc_block_rsv(root, BTRFS_BLOCK_RSV_TEMP);
if (!block_rsv)
return -ENOMEM;
}
spin_lock(&root->orphan_lock);
if (!root->orphan_block_rsv) {
root->orphan_block_rsv = block_rsv;
} else if (block_rsv) {
btrfs_free_block_rsv(root, block_rsv);
block_rsv = NULL;
}
if (!test_and_set_bit(BTRFS_INODE_HAS_ORPHAN_ITEM,
&BTRFS_I(inode)->runtime_flags)) {
#if 0
/*
* For proper ENOSPC handling, we should do orphan
* cleanup when mounting. But this introduces backward
* compatibility issue.
*/
if (!xchg(&root->orphan_item_inserted, 1))
insert = 2;
else
insert = 1;
#endif
insert = 1;
atomic_inc(&root->orphan_inodes);
}
if (!test_and_set_bit(BTRFS_INODE_ORPHAN_META_RESERVED,
&BTRFS_I(inode)->runtime_flags))
reserve = 1;
spin_unlock(&root->orphan_lock);
/* grab metadata reservation from transaction handle */
if (reserve) {
ret = btrfs_orphan_reserve_metadata(trans, inode);
BUG_ON(ret); /* -ENOSPC in reservation; Logic error? JDM */
}
/* insert an orphan item to track this unlinked/truncated file */
if (insert >= 1) {
ret = btrfs_insert_orphan_item(trans, root, btrfs_ino(inode));
if (ret && ret != -EEXIST) {
clear_bit(BTRFS_INODE_HAS_ORPHAN_ITEM,
&BTRFS_I(inode)->runtime_flags);
btrfs_abort_transaction(trans, root, ret);
return ret;
}
ret = 0;
}
/* insert an orphan item to track subvolume contains orphan files */
if (insert >= 2) {
ret = btrfs_insert_orphan_item(trans, root->fs_info->tree_root,
root->root_key.objectid);
if (ret && ret != -EEXIST) {
btrfs_abort_transaction(trans, root, ret);
return ret;
}
}
return 0;
}
|
int btrfs_orphan_add(struct btrfs_trans_handle *trans, struct inode *inode)
{
struct btrfs_root *root = BTRFS_I(inode)->root;
struct btrfs_block_rsv *block_rsv = NULL;
int reserve = 0;
int insert = 0;
int ret;
if (!root->orphan_block_rsv) {
block_rsv = btrfs_alloc_block_rsv(root, BTRFS_BLOCK_RSV_TEMP);
if (!block_rsv)
return -ENOMEM;
}
spin_lock(&root->orphan_lock);
if (!root->orphan_block_rsv) {
root->orphan_block_rsv = block_rsv;
} else if (block_rsv) {
btrfs_free_block_rsv(root, block_rsv);
block_rsv = NULL;
}
if (!test_and_set_bit(BTRFS_INODE_HAS_ORPHAN_ITEM,
&BTRFS_I(inode)->runtime_flags)) {
#if 0
/*
* For proper ENOSPC handling, we should do orphan
* cleanup when mounting. But this introduces backward
* compatibility issue.
*/
if (!xchg(&root->orphan_item_inserted, 1))
insert = 2;
else
insert = 1;
#endif
insert = 1;
atomic_inc(&root->orphan_inodes);
}
if (!test_and_set_bit(BTRFS_INODE_ORPHAN_META_RESERVED,
&BTRFS_I(inode)->runtime_flags))
reserve = 1;
spin_unlock(&root->orphan_lock);
/* grab metadata reservation from transaction handle */
if (reserve) {
ret = btrfs_orphan_reserve_metadata(trans, inode);
BUG_ON(ret); /* -ENOSPC in reservation; Logic error? JDM */
}
/* insert an orphan item to track this unlinked/truncated file */
if (insert >= 1) {
ret = btrfs_insert_orphan_item(trans, root, btrfs_ino(inode));
if (ret && ret != -EEXIST) {
clear_bit(BTRFS_INODE_HAS_ORPHAN_ITEM,
&BTRFS_I(inode)->runtime_flags);
btrfs_abort_transaction(trans, root, ret);
return ret;
}
ret = 0;
}
/* insert an orphan item to track subvolume contains orphan files */
if (insert >= 2) {
ret = btrfs_insert_orphan_item(trans, root->fs_info->tree_root,
root->root_key.objectid);
if (ret && ret != -EEXIST) {
btrfs_abort_transaction(trans, root, ret);
return ret;
}
}
return 0;
}
|
C
|
linux
| 0 |
CVE-2016-5770
|
https://www.cvedetails.com/cve/CVE-2016-5770/
|
CWE-190
|
https://github.com/php/php-src/commit/7245bff300d3fa8bacbef7897ff080a6f1c23eba?w=1
|
7245bff300d3fa8bacbef7897ff080a6f1c23eba?w=1
|
Fix bug #72262 - do not overflow int
|
zend_object_iterator *spl_filesystem_tree_get_iterator(zend_class_entry *ce, zval *object, int by_ref TSRMLS_DC)
{
spl_filesystem_iterator *iterator;
spl_filesystem_object *dir_object;
if (by_ref) {
zend_error(E_ERROR, "An iterator cannot be used with foreach by reference");
}
dir_object = (spl_filesystem_object*)zend_object_store_get_object(object TSRMLS_CC);
iterator = spl_filesystem_object_to_iterator(dir_object);
/* initialize iterator if wasn't gotten before */
if (iterator->intern.data == NULL) {
iterator->intern.data = object;
iterator->intern.funcs = &spl_filesystem_tree_it_funcs;
}
zval_add_ref(&object);
return (zend_object_iterator*)iterator;
}
|
zend_object_iterator *spl_filesystem_tree_get_iterator(zend_class_entry *ce, zval *object, int by_ref TSRMLS_DC)
{
spl_filesystem_iterator *iterator;
spl_filesystem_object *dir_object;
if (by_ref) {
zend_error(E_ERROR, "An iterator cannot be used with foreach by reference");
}
dir_object = (spl_filesystem_object*)zend_object_store_get_object(object TSRMLS_CC);
iterator = spl_filesystem_object_to_iterator(dir_object);
/* initialize iterator if wasn't gotten before */
if (iterator->intern.data == NULL) {
iterator->intern.data = object;
iterator->intern.funcs = &spl_filesystem_tree_it_funcs;
}
zval_add_ref(&object);
return (zend_object_iterator*)iterator;
}
|
C
|
php-src
| 1 |
CVE-2016-5771
|
https://www.cvedetails.com/cve/CVE-2016-5771/
|
CWE-416
|
https://github.com/php/php-src/commit/3f627e580acfdaf0595ae3b115b8bec677f203ee?w=1
|
3f627e580acfdaf0595ae3b115b8bec677f203ee?w=1
|
Fixed ##72433: Use After Free Vulnerability in PHP's GC algorithm and unserialize
|
PHP_MINIT_FUNCTION(spl_array)
{
REGISTER_SPL_STD_CLASS_EX(ArrayObject, spl_array_object_new, spl_funcs_ArrayObject);
REGISTER_SPL_IMPLEMENTS(ArrayObject, Aggregate);
REGISTER_SPL_IMPLEMENTS(ArrayObject, ArrayAccess);
REGISTER_SPL_IMPLEMENTS(ArrayObject, Serializable);
REGISTER_SPL_IMPLEMENTS(ArrayObject, Countable);
memcpy(&spl_handler_ArrayObject, zend_get_std_object_handlers(), sizeof(zend_object_handlers));
spl_handler_ArrayObject.clone_obj = spl_array_object_clone;
spl_handler_ArrayObject.read_dimension = spl_array_read_dimension;
spl_handler_ArrayObject.write_dimension = spl_array_write_dimension;
spl_handler_ArrayObject.unset_dimension = spl_array_unset_dimension;
spl_handler_ArrayObject.has_dimension = spl_array_has_dimension;
spl_handler_ArrayObject.count_elements = spl_array_object_count_elements;
spl_handler_ArrayObject.get_properties = spl_array_get_properties;
spl_handler_ArrayObject.get_debug_info = spl_array_get_debug_info;
spl_handler_ArrayObject.get_gc = spl_array_get_gc;
spl_handler_ArrayObject.read_property = spl_array_read_property;
spl_handler_ArrayObject.write_property = spl_array_write_property;
spl_handler_ArrayObject.get_property_ptr_ptr = spl_array_get_property_ptr_ptr;
spl_handler_ArrayObject.has_property = spl_array_has_property;
spl_handler_ArrayObject.unset_property = spl_array_unset_property;
spl_handler_ArrayObject.compare_objects = spl_array_compare_objects;
REGISTER_SPL_STD_CLASS_EX(ArrayIterator, spl_array_object_new, spl_funcs_ArrayIterator);
REGISTER_SPL_IMPLEMENTS(ArrayIterator, Iterator);
REGISTER_SPL_IMPLEMENTS(ArrayIterator, ArrayAccess);
REGISTER_SPL_IMPLEMENTS(ArrayIterator, SeekableIterator);
REGISTER_SPL_IMPLEMENTS(ArrayIterator, Serializable);
REGISTER_SPL_IMPLEMENTS(ArrayIterator, Countable);
memcpy(&spl_handler_ArrayIterator, &spl_handler_ArrayObject, sizeof(zend_object_handlers));
spl_ce_ArrayIterator->get_iterator = spl_array_get_iterator;
REGISTER_SPL_SUB_CLASS_EX(RecursiveArrayIterator, ArrayIterator, spl_array_object_new, spl_funcs_RecursiveArrayIterator);
REGISTER_SPL_IMPLEMENTS(RecursiveArrayIterator, RecursiveIterator);
spl_ce_RecursiveArrayIterator->get_iterator = spl_array_get_iterator;
REGISTER_SPL_CLASS_CONST_LONG(ArrayObject, "STD_PROP_LIST", SPL_ARRAY_STD_PROP_LIST);
REGISTER_SPL_CLASS_CONST_LONG(ArrayObject, "ARRAY_AS_PROPS", SPL_ARRAY_ARRAY_AS_PROPS);
REGISTER_SPL_CLASS_CONST_LONG(ArrayIterator, "STD_PROP_LIST", SPL_ARRAY_STD_PROP_LIST);
REGISTER_SPL_CLASS_CONST_LONG(ArrayIterator, "ARRAY_AS_PROPS", SPL_ARRAY_ARRAY_AS_PROPS);
REGISTER_SPL_CLASS_CONST_LONG(RecursiveArrayIterator, "CHILD_ARRAYS_ONLY", SPL_ARRAY_CHILD_ARRAYS_ONLY);
return SUCCESS;
}
|
PHP_MINIT_FUNCTION(spl_array)
{
REGISTER_SPL_STD_CLASS_EX(ArrayObject, spl_array_object_new, spl_funcs_ArrayObject);
REGISTER_SPL_IMPLEMENTS(ArrayObject, Aggregate);
REGISTER_SPL_IMPLEMENTS(ArrayObject, ArrayAccess);
REGISTER_SPL_IMPLEMENTS(ArrayObject, Serializable);
REGISTER_SPL_IMPLEMENTS(ArrayObject, Countable);
memcpy(&spl_handler_ArrayObject, zend_get_std_object_handlers(), sizeof(zend_object_handlers));
spl_handler_ArrayObject.clone_obj = spl_array_object_clone;
spl_handler_ArrayObject.read_dimension = spl_array_read_dimension;
spl_handler_ArrayObject.write_dimension = spl_array_write_dimension;
spl_handler_ArrayObject.unset_dimension = spl_array_unset_dimension;
spl_handler_ArrayObject.has_dimension = spl_array_has_dimension;
spl_handler_ArrayObject.count_elements = spl_array_object_count_elements;
spl_handler_ArrayObject.get_properties = spl_array_get_properties;
spl_handler_ArrayObject.get_debug_info = spl_array_get_debug_info;
spl_handler_ArrayObject.read_property = spl_array_read_property;
spl_handler_ArrayObject.write_property = spl_array_write_property;
spl_handler_ArrayObject.get_property_ptr_ptr = spl_array_get_property_ptr_ptr;
spl_handler_ArrayObject.has_property = spl_array_has_property;
spl_handler_ArrayObject.unset_property = spl_array_unset_property;
spl_handler_ArrayObject.compare_objects = spl_array_compare_objects;
REGISTER_SPL_STD_CLASS_EX(ArrayIterator, spl_array_object_new, spl_funcs_ArrayIterator);
REGISTER_SPL_IMPLEMENTS(ArrayIterator, Iterator);
REGISTER_SPL_IMPLEMENTS(ArrayIterator, ArrayAccess);
REGISTER_SPL_IMPLEMENTS(ArrayIterator, SeekableIterator);
REGISTER_SPL_IMPLEMENTS(ArrayIterator, Serializable);
REGISTER_SPL_IMPLEMENTS(ArrayIterator, Countable);
memcpy(&spl_handler_ArrayIterator, &spl_handler_ArrayObject, sizeof(zend_object_handlers));
spl_ce_ArrayIterator->get_iterator = spl_array_get_iterator;
REGISTER_SPL_SUB_CLASS_EX(RecursiveArrayIterator, ArrayIterator, spl_array_object_new, spl_funcs_RecursiveArrayIterator);
REGISTER_SPL_IMPLEMENTS(RecursiveArrayIterator, RecursiveIterator);
spl_ce_RecursiveArrayIterator->get_iterator = spl_array_get_iterator;
REGISTER_SPL_CLASS_CONST_LONG(ArrayObject, "STD_PROP_LIST", SPL_ARRAY_STD_PROP_LIST);
REGISTER_SPL_CLASS_CONST_LONG(ArrayObject, "ARRAY_AS_PROPS", SPL_ARRAY_ARRAY_AS_PROPS);
REGISTER_SPL_CLASS_CONST_LONG(ArrayIterator, "STD_PROP_LIST", SPL_ARRAY_STD_PROP_LIST);
REGISTER_SPL_CLASS_CONST_LONG(ArrayIterator, "ARRAY_AS_PROPS", SPL_ARRAY_ARRAY_AS_PROPS);
REGISTER_SPL_CLASS_CONST_LONG(RecursiveArrayIterator, "CHILD_ARRAYS_ONLY", SPL_ARRAY_CHILD_ARRAYS_ONLY);
return SUCCESS;
}
|
C
|
php-src
| 1 |
CVE-2017-5850
|
https://www.cvedetails.com/cve/CVE-2017-5850/
|
CWE-770
|
https://github.com/openbsd/src/commit/142cfc82b932bc211218fbd7bdda8c7ce83f19df
|
142cfc82b932bc211218fbd7bdda8c7ce83f19df
|
Reimplement httpd's support for byte ranges.
The previous implementation loaded all the output into a single output
buffer and used its size to determine the Content-Length of the body.
The new implementation calculates the body length first and writes the
individual ranges in an async way using the bufferevent mechanism.
This prevents httpd from using too much memory and applies the
watermark and throttling mechanisms to range requests.
Problem reported by Pierre Kim (pierre.kim.sec at gmail.com)
OK benno@ sunil@
|
server_http_parsehost(char *host, char *buf, size_t len, int *portval)
{
char *start, *end, *port;
const char *errstr = NULL;
if (strlcpy(buf, host, len) >= len) {
log_debug("%s: host name too long", __func__);
return (NULL);
}
start = buf;
end = port = NULL;
if (*start == '[' && (end = strchr(start, ']')) != NULL) {
/* Address enclosed in [] with port, eg. [2001:db8::1]:80 */
start++;
*end++ = '\0';
if ((port = strchr(end, ':')) == NULL || *port == '\0')
port = NULL;
else
port++;
memmove(buf, start, strlen(start) + 1);
} else if ((end = strchr(start, ':')) != NULL) {
/* Name or address with port, eg. www.example.com:80 */
*end++ = '\0';
port = end;
} else {
/* Name or address with default port, eg. www.example.com */
port = NULL;
}
if (port != NULL) {
/* Save the requested port */
*portval = strtonum(port, 0, 0xffff, &errstr);
if (errstr != NULL) {
log_debug("%s: invalid port: %s", __func__,
strerror(errno));
return (NULL);
}
*portval = htons(*portval);
} else {
/* Port not given, indicate the default port */
*portval = -1;
}
return (start);
}
|
server_http_parsehost(char *host, char *buf, size_t len, int *portval)
{
char *start, *end, *port;
const char *errstr = NULL;
if (strlcpy(buf, host, len) >= len) {
log_debug("%s: host name too long", __func__);
return (NULL);
}
start = buf;
end = port = NULL;
if (*start == '[' && (end = strchr(start, ']')) != NULL) {
/* Address enclosed in [] with port, eg. [2001:db8::1]:80 */
start++;
*end++ = '\0';
if ((port = strchr(end, ':')) == NULL || *port == '\0')
port = NULL;
else
port++;
memmove(buf, start, strlen(start) + 1);
} else if ((end = strchr(start, ':')) != NULL) {
/* Name or address with port, eg. www.example.com:80 */
*end++ = '\0';
port = end;
} else {
/* Name or address with default port, eg. www.example.com */
port = NULL;
}
if (port != NULL) {
/* Save the requested port */
*portval = strtonum(port, 0, 0xffff, &errstr);
if (errstr != NULL) {
log_debug("%s: invalid port: %s", __func__,
strerror(errno));
return (NULL);
}
*portval = htons(*portval);
} else {
/* Port not given, indicate the default port */
*portval = -1;
}
return (start);
}
|
C
|
src
| 0 |
CVE-2014-8172
|
https://www.cvedetails.com/cve/CVE-2014-8172/
|
CWE-17
|
https://github.com/torvalds/linux/commit/eee5cc2702929fd41cce28058dc6d6717f723f87
|
eee5cc2702929fd41cce28058dc6d6717f723f87
|
get rid of s_files and files_lock
The only thing we need it for is alt-sysrq-r (emergency remount r/o)
and these days we can do just as well without going through the
list of files.
Signed-off-by: Al Viro <[email protected]>
|
SYSCALL_DEFINE3(fchown, unsigned int, fd, uid_t, user, gid_t, group)
{
struct fd f = fdget(fd);
int error = -EBADF;
if (!f.file)
goto out;
error = mnt_want_write_file(f.file);
if (error)
goto out_fput;
audit_inode(NULL, f.file->f_path.dentry, 0);
error = chown_common(&f.file->f_path, user, group);
mnt_drop_write_file(f.file);
out_fput:
fdput(f);
out:
return error;
}
|
SYSCALL_DEFINE3(fchown, unsigned int, fd, uid_t, user, gid_t, group)
{
struct fd f = fdget(fd);
int error = -EBADF;
if (!f.file)
goto out;
error = mnt_want_write_file(f.file);
if (error)
goto out_fput;
audit_inode(NULL, f.file->f_path.dentry, 0);
error = chown_common(&f.file->f_path, user, group);
mnt_drop_write_file(f.file);
out_fput:
fdput(f);
out:
return error;
}
|
C
|
linux
| 0 |
CVE-2019-13045
|
https://www.cvedetails.com/cve/CVE-2019-13045/
|
CWE-416
|
https://github.com/irssi/irssi/commit/d23b0d22cc611e43c88d99192a59f413f951a955
|
d23b0d22cc611e43c88d99192a59f413f951a955
|
Merge pull request #1058 from ailin-nemui/sasl-reconnect
copy sasl username and password values
|
void irc_servers_setup_deinit(void)
{
signal_remove("server setup fill reconn", (SIGNAL_FUNC) sig_server_setup_fill_reconn);
signal_remove("server setup fill connect", (SIGNAL_FUNC) sig_server_setup_fill_connect);
signal_remove("server setup fill chatnet", (SIGNAL_FUNC) sig_server_setup_fill_chatnet);
signal_remove("server setup read", (SIGNAL_FUNC) sig_server_setup_read);
signal_remove("server setup saved", (SIGNAL_FUNC) sig_server_setup_saved);
}
|
void irc_servers_setup_deinit(void)
{
signal_remove("server setup fill reconn", (SIGNAL_FUNC) sig_server_setup_fill_reconn);
signal_remove("server setup fill connect", (SIGNAL_FUNC) sig_server_setup_fill_connect);
signal_remove("server setup fill chatnet", (SIGNAL_FUNC) sig_server_setup_fill_chatnet);
signal_remove("server setup read", (SIGNAL_FUNC) sig_server_setup_read);
signal_remove("server setup saved", (SIGNAL_FUNC) sig_server_setup_saved);
}
|
C
|
irssi
| 0 |
CVE-2016-1621
|
https://www.cvedetails.com/cve/CVE-2016-1621/
|
CWE-119
|
https://android.googlesource.com/platform/external/libvpx/+/5a9753fca56f0eeb9f61e342b2fccffc364f9426
|
5a9753fca56f0eeb9f61e342b2fccffc364f9426
|
Merge Conflict Fix CL to lmp-mr1-release for ag/849478
DO NOT MERGE - libvpx: Pull from upstream
Current HEAD: 7105df53d7dc13d5e575bc8df714ec8d1da36b06
BUG=23452792
Change-Id: Ic78176fc369e0bacc71d423e0e2e6075d004aaec
|
string DecodeFile(const string& filename, int num_threads) {
libvpx_test::WebMVideoSource video(filename);
video.Init();
vpx_codec_dec_cfg_t cfg = vpx_codec_dec_cfg_t();
cfg.threads = num_threads;
libvpx_test::VP9Decoder decoder(cfg, 0);
libvpx_test::MD5 md5;
for (video.Begin(); video.cxdata(); video.Next()) {
const vpx_codec_err_t res =
decoder.DecodeFrame(video.cxdata(), video.frame_size());
if (res != VPX_CODEC_OK) {
EXPECT_EQ(VPX_CODEC_OK, res) << decoder.DecodeError();
break;
}
libvpx_test::DxDataIterator dec_iter = decoder.GetDxData();
const vpx_image_t *img = NULL;
while ((img = dec_iter.Next())) {
md5.Add(img);
}
}
return string(md5.Get());
}
|
string DecodeFile(const string& filename, int num_threads) {
libvpx_test::WebMVideoSource video(filename);
video.Init();
vpx_codec_dec_cfg_t cfg = {0};
cfg.threads = num_threads;
libvpx_test::VP9Decoder decoder(cfg, 0);
libvpx_test::MD5 md5;
for (video.Begin(); video.cxdata(); video.Next()) {
const vpx_codec_err_t res =
decoder.DecodeFrame(video.cxdata(), video.frame_size());
if (res != VPX_CODEC_OK) {
EXPECT_EQ(VPX_CODEC_OK, res) << decoder.DecodeError();
break;
}
libvpx_test::DxDataIterator dec_iter = decoder.GetDxData();
const vpx_image_t *img = NULL;
while ((img = dec_iter.Next())) {
md5.Add(img);
}
}
return string(md5.Get());
}
|
C
|
Android
| 1 |
CVE-2015-5296
|
https://www.cvedetails.com/cve/CVE-2015-5296/
|
CWE-20
|
https://git.samba.org/?p=samba.git;a=commit;h=a819d2b440aafa3138d95ff6e8b824da885a70e9
|
a819d2b440aafa3138d95ff6e8b824da885a70e9
| null |
NTSTATUS smb2cli_req_get_sent_iov(struct tevent_req *req,
struct iovec *sent_iov)
{
struct smbXcli_req_state *state =
tevent_req_data(req,
struct smbXcli_req_state);
if (tevent_req_is_in_progress(req)) {
return STATUS_PENDING;
}
sent_iov[0].iov_base = state->smb2.hdr;
sent_iov[0].iov_len = sizeof(state->smb2.hdr);
sent_iov[1].iov_base = discard_const(state->smb2.fixed);
sent_iov[1].iov_len = state->smb2.fixed_len;
if (state->smb2.dyn != NULL) {
sent_iov[2].iov_base = discard_const(state->smb2.dyn);
sent_iov[2].iov_len = state->smb2.dyn_len;
} else {
sent_iov[2].iov_base = NULL;
sent_iov[2].iov_len = 0;
}
return NT_STATUS_OK;
}
|
NTSTATUS smb2cli_req_get_sent_iov(struct tevent_req *req,
struct iovec *sent_iov)
{
struct smbXcli_req_state *state =
tevent_req_data(req,
struct smbXcli_req_state);
if (tevent_req_is_in_progress(req)) {
return STATUS_PENDING;
}
sent_iov[0].iov_base = state->smb2.hdr;
sent_iov[0].iov_len = sizeof(state->smb2.hdr);
sent_iov[1].iov_base = discard_const(state->smb2.fixed);
sent_iov[1].iov_len = state->smb2.fixed_len;
if (state->smb2.dyn != NULL) {
sent_iov[2].iov_base = discard_const(state->smb2.dyn);
sent_iov[2].iov_len = state->smb2.dyn_len;
} else {
sent_iov[2].iov_base = NULL;
sent_iov[2].iov_len = 0;
}
return NT_STATUS_OK;
}
|
C
|
samba
| 0 |
CVE-2015-5706
|
https://www.cvedetails.com/cve/CVE-2015-5706/
| null |
https://github.com/torvalds/linux/commit/f15133df088ecadd141ea1907f2c96df67c729f0
|
f15133df088ecadd141ea1907f2c96df67c729f0
|
path_openat(): fix double fput()
path_openat() jumps to the wrong place after do_tmpfile() - it has
already done path_cleanup() (as part of path_lookupat() called by
do_tmpfile()), so doing that again can lead to double fput().
Cc: [email protected] # v3.11+
Signed-off-by: Al Viro <[email protected]>
|
static struct dentry *lookup_dcache(struct qstr *name, struct dentry *dir,
unsigned int flags, bool *need_lookup)
{
struct dentry *dentry;
int error;
*need_lookup = false;
dentry = d_lookup(dir, name);
if (dentry) {
if (dentry->d_flags & DCACHE_OP_REVALIDATE) {
error = d_revalidate(dentry, flags);
if (unlikely(error <= 0)) {
if (error < 0) {
dput(dentry);
return ERR_PTR(error);
} else {
d_invalidate(dentry);
dput(dentry);
dentry = NULL;
}
}
}
}
if (!dentry) {
dentry = d_alloc(dir, name);
if (unlikely(!dentry))
return ERR_PTR(-ENOMEM);
*need_lookup = true;
}
return dentry;
}
|
static struct dentry *lookup_dcache(struct qstr *name, struct dentry *dir,
unsigned int flags, bool *need_lookup)
{
struct dentry *dentry;
int error;
*need_lookup = false;
dentry = d_lookup(dir, name);
if (dentry) {
if (dentry->d_flags & DCACHE_OP_REVALIDATE) {
error = d_revalidate(dentry, flags);
if (unlikely(error <= 0)) {
if (error < 0) {
dput(dentry);
return ERR_PTR(error);
} else {
d_invalidate(dentry);
dput(dentry);
dentry = NULL;
}
}
}
}
if (!dentry) {
dentry = d_alloc(dir, name);
if (unlikely(!dentry))
return ERR_PTR(-ENOMEM);
*need_lookup = true;
}
return dentry;
}
|
C
|
linux
| 0 |
CVE-2016-1665
|
https://www.cvedetails.com/cve/CVE-2016-1665/
|
CWE-20
|
https://github.com/chromium/chromium/commit/282f53ffdc3b1902da86f6a0791af736837efbf8
|
282f53ffdc3b1902da86f6a0791af736837efbf8
|
[signin] Add metrics to track the source for refresh token updated events
This CL add a source for update and revoke credentials operations. It then
surfaces the source in the chrome://signin-internals page.
This CL also records the following histograms that track refresh token events:
* Signin.RefreshTokenUpdated.ToValidToken.Source
* Signin.RefreshTokenUpdated.ToInvalidToken.Source
* Signin.RefreshTokenRevoked.Source
These histograms are needed to validate the assumptions of how often tokens
are revoked by the browser and the sources for the token revocations.
Bug: 896182
Change-Id: I2fcab80ee8e5699708e695bc3289fa6d34859a90
Reviewed-on: https://chromium-review.googlesource.com/c/1286464
Reviewed-by: Jochen Eisinger <[email protected]>
Reviewed-by: David Roger <[email protected]>
Reviewed-by: Ilya Sherman <[email protected]>
Commit-Queue: Mihai Sardarescu <[email protected]>
Cr-Commit-Position: refs/heads/master@{#606181}
|
bool SupervisedUserService::UserMayModifySettings(const Extension* extension,
base::string16* error) const {
DCHECK(ProfileIsSupervised());
ExtensionState result = GetExtensionState(*extension);
bool may_modify = result != ExtensionState::FORCED;
if (!may_modify && error)
*error = GetExtensionsLockedMessage();
return may_modify;
}
|
bool SupervisedUserService::UserMayModifySettings(const Extension* extension,
base::string16* error) const {
DCHECK(ProfileIsSupervised());
ExtensionState result = GetExtensionState(*extension);
bool may_modify = result != ExtensionState::FORCED;
if (!may_modify && error)
*error = GetExtensionsLockedMessage();
return may_modify;
}
|
C
|
Chrome
| 0 |
CVE-2018-6086
|
https://www.cvedetails.com/cve/CVE-2018-6086/
|
CWE-416
|
https://github.com/chromium/chromium/commit/c9d673b54832afde658f214d7da7d0453fa89774
|
c9d673b54832afde658f214d7da7d0453fa89774
|
[MemCache] Fix bug while iterating LRU list in eviction
It was possible to reanalyze a previously doomed entry.
Bug: 827492
Change-Id: I5d34d2ae87c96e0d2099e926e6eb2c1b30b01d63
Reviewed-on: https://chromium-review.googlesource.com/987919
Commit-Queue: Josh Karlin <[email protected]>
Reviewed-by: Maks Orlovich <[email protected]>
Cr-Commit-Position: refs/heads/master@{#547236}
|
bool MemBackendImpl::SetMaxSize(int max_bytes) {
static_assert(sizeof(max_bytes) == sizeof(max_size_),
"unsupported int model");
if (max_bytes < 0)
return false;
if (!max_bytes)
return true;
max_size_ = max_bytes;
return true;
}
|
bool MemBackendImpl::SetMaxSize(int max_bytes) {
static_assert(sizeof(max_bytes) == sizeof(max_size_),
"unsupported int model");
if (max_bytes < 0)
return false;
if (!max_bytes)
return true;
max_size_ = max_bytes;
return true;
}
|
C
|
Chrome
| 0 |
CVE-2009-3605
|
https://www.cvedetails.com/cve/CVE-2009-3605/
|
CWE-189
|
https://cgit.freedesktop.org/poppler/poppler/commit/?id=7b2d314a61fd0e12f47c62996cb49ec0d1ba747a
|
7b2d314a61fd0e12f47c62996cb49ec0d1ba747a
| null |
void GfxDeviceNColorSpace::getGray(GfxColor *color, GfxGray *gray) {
double x[gfxColorMaxComps], c[gfxColorMaxComps];
GfxColor color2;
int i;
for (i = 0; i < nComps; ++i) {
x[i] = colToDbl(color->c[i]);
}
func->transform(x, c);
for (i = 0; i < alt->getNComps(); ++i) {
color2.c[i] = dblToCol(c[i]);
}
alt->getGray(&color2, gray);
}
|
void GfxDeviceNColorSpace::getGray(GfxColor *color, GfxGray *gray) {
double x[gfxColorMaxComps], c[gfxColorMaxComps];
GfxColor color2;
int i;
for (i = 0; i < nComps; ++i) {
x[i] = colToDbl(color->c[i]);
}
func->transform(x, c);
for (i = 0; i < alt->getNComps(); ++i) {
color2.c[i] = dblToCol(c[i]);
}
alt->getGray(&color2, gray);
}
|
CPP
|
poppler
| 0 |
CVE-2017-5104
|
https://www.cvedetails.com/cve/CVE-2017-5104/
|
CWE-20
|
https://github.com/chromium/chromium/commit/adca986a53b31b6da4cb22f8e755f6856daea89a
|
adca986a53b31b6da4cb22f8e755f6856daea89a
|
Don't show current RenderWidgetHostView while interstitial is showing.
Also moves interstitial page tracking from RenderFrameHostManager to
WebContents, since interstitial pages are not frame-specific. This was
necessary for subframes to detect if an interstitial page is showing.
BUG=729105
TEST=See comment 13 of bug for repro steps
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_site_isolation
Review-Url: https://codereview.chromium.org/2938313002
Cr-Commit-Position: refs/heads/master@{#480117}
|
RenderFrameHostManager::RenderFrameHostManager(
FrameTreeNode* frame_tree_node,
RenderFrameHostDelegate* render_frame_delegate,
RenderWidgetHostDelegate* render_widget_delegate,
Delegate* delegate)
: frame_tree_node_(frame_tree_node),
delegate_(delegate),
render_frame_delegate_(render_frame_delegate),
render_widget_delegate_(render_widget_delegate),
weak_factory_(this) {
DCHECK(frame_tree_node_);
}
|
RenderFrameHostManager::RenderFrameHostManager(
FrameTreeNode* frame_tree_node,
RenderFrameHostDelegate* render_frame_delegate,
RenderWidgetHostDelegate* render_widget_delegate,
Delegate* delegate)
: frame_tree_node_(frame_tree_node),
delegate_(delegate),
render_frame_delegate_(render_frame_delegate),
render_widget_delegate_(render_widget_delegate),
interstitial_page_(nullptr),
weak_factory_(this) {
DCHECK(frame_tree_node_);
}
|
C
|
Chrome
| 1 |
CVE-2019-15938
|
https://www.cvedetails.com/cve/CVE-2019-15938/
|
CWE-119
|
https://git.pengutronix.de/cgit/barebox/commit/fs/nfs.c?h=next&id=574ce994016107ad8ab0f845a785f28d7eaa5208
|
574ce994016107ad8ab0f845a785f28d7eaa5208
| null |
static __be32 *xdr_inline_decode(struct xdr_stream *xdr, size_t nbytes)
{
__be32 *p;
if (nbytes == 0)
return xdr->p;
if (xdr->p == xdr->end)
return NULL;
p = __xdr_inline_decode(xdr, nbytes);
return p;
}
|
static __be32 *xdr_inline_decode(struct xdr_stream *xdr, size_t nbytes)
{
__be32 *p;
if (nbytes == 0)
return xdr->p;
if (xdr->p == xdr->end)
return NULL;
p = __xdr_inline_decode(xdr, nbytes);
return p;
}
|
C
|
pengutronix
| 0 |
CVE-2016-0826
|
https://www.cvedetails.com/cve/CVE-2016-0826/
|
CWE-264
|
https://android.googlesource.com/platform/frameworks/av/+/c9ab2b0bb05a7e19fb057e79b36e232809d70122
|
c9ab2b0bb05a7e19fb057e79b36e232809d70122
|
Camera: Disallow dumping clients directly
Camera service dumps should only be initiated through
ICameraService::dump.
Bug: 26265403
Change-Id: If3ca4718ed74bf33ad8a416192689203029e2803
|
status_t CameraDeviceClient::createStream(int width, int height, int format,
const sp<IGraphicBufferProducer>& bufferProducer)
{
ATRACE_CALL();
ALOGV("%s (w = %d, h = %d, f = 0x%x)", __FUNCTION__, width, height, format);
status_t res;
if ( (res = checkPid(__FUNCTION__) ) != OK) return res;
Mutex::Autolock icl(mBinderSerializationLock);
if (!mDevice.get()) return DEAD_OBJECT;
{
ssize_t index = mStreamMap.indexOfKey(bufferProducer->asBinder());
if (index != NAME_NOT_FOUND) {
ALOGW("%s: Camera %d: Buffer producer already has a stream for it "
"(ID %d)",
__FUNCTION__, mCameraId, index);
return ALREADY_EXISTS;
}
}
bool useAsync = false;
int32_t consumerUsage;
if ((res = bufferProducer->query(NATIVE_WINDOW_CONSUMER_USAGE_BITS,
&consumerUsage)) != OK) {
ALOGE("%s: Camera %d: Failed to query consumer usage", __FUNCTION__,
mCameraId);
return res;
}
if (consumerUsage & GraphicBuffer::USAGE_HW_TEXTURE) {
ALOGW("%s: Camera %d: Forcing asynchronous mode for stream",
__FUNCTION__, mCameraId);
useAsync = true;
}
sp<IBinder> binder;
sp<ANativeWindow> anw;
if (bufferProducer != 0) {
binder = bufferProducer->asBinder();
anw = new Surface(bufferProducer, useAsync);
}
if ((res = anw->query(anw.get(), NATIVE_WINDOW_WIDTH, &width)) != OK) {
ALOGE("%s: Camera %d: Failed to query Surface width", __FUNCTION__,
mCameraId);
return res;
}
if ((res = anw->query(anw.get(), NATIVE_WINDOW_HEIGHT, &height)) != OK) {
ALOGE("%s: Camera %d: Failed to query Surface height", __FUNCTION__,
mCameraId);
return res;
}
if ((res = anw->query(anw.get(), NATIVE_WINDOW_FORMAT, &format)) != OK) {
ALOGE("%s: Camera %d: Failed to query Surface format", __FUNCTION__,
mCameraId);
return res;
}
if (format >= HAL_PIXEL_FORMAT_RGBA_8888 &&
format <= HAL_PIXEL_FORMAT_BGRA_8888) {
ALOGW("%s: Camera %d: Overriding format 0x%x to IMPLEMENTATION_DEFINED",
__FUNCTION__, mCameraId, format);
format = HAL_PIXEL_FORMAT_IMPLEMENTATION_DEFINED;
}
int streamId = -1;
if (format == HAL_PIXEL_FORMAT_BLOB) {
CameraMetadata staticInfo = mDevice->info();
camera_metadata_entry_t entry = staticInfo.find(ANDROID_JPEG_MAX_SIZE);
if (entry.count == 0) {
ALOGE("%s: Camera %d: Can't find maximum JPEG size in "
"static metadata!", __FUNCTION__, mCameraId);
return INVALID_OPERATION;
}
int32_t maxJpegSize = entry.data.i32[0];
res = mDevice->createStream(anw, width, height, format, maxJpegSize,
&streamId);
} else {
res = mDevice->createStream(anw, width, height, format, /*size*/0,
&streamId);
}
if (res == OK) {
mStreamMap.add(bufferProducer->asBinder(), streamId);
ALOGV("%s: Camera %d: Successfully created a new stream ID %d",
__FUNCTION__, mCameraId, streamId);
/**
* Set the stream transform flags to automatically
* rotate the camera stream for preview use cases.
*/
int32_t transform = 0;
res = getRotationTransformLocked(&transform);
if (res != OK) {
return res;
}
res = mDevice->setStreamTransform(streamId, transform);
if (res != OK) {
ALOGE("%s: Failed to set stream transform (stream id %d)",
__FUNCTION__, streamId);
return res;
}
return streamId;
}
return res;
}
|
status_t CameraDeviceClient::createStream(int width, int height, int format,
const sp<IGraphicBufferProducer>& bufferProducer)
{
ATRACE_CALL();
ALOGV("%s (w = %d, h = %d, f = 0x%x)", __FUNCTION__, width, height, format);
status_t res;
if ( (res = checkPid(__FUNCTION__) ) != OK) return res;
Mutex::Autolock icl(mBinderSerializationLock);
if (!mDevice.get()) return DEAD_OBJECT;
{
ssize_t index = mStreamMap.indexOfKey(bufferProducer->asBinder());
if (index != NAME_NOT_FOUND) {
ALOGW("%s: Camera %d: Buffer producer already has a stream for it "
"(ID %d)",
__FUNCTION__, mCameraId, index);
return ALREADY_EXISTS;
}
}
bool useAsync = false;
int32_t consumerUsage;
if ((res = bufferProducer->query(NATIVE_WINDOW_CONSUMER_USAGE_BITS,
&consumerUsage)) != OK) {
ALOGE("%s: Camera %d: Failed to query consumer usage", __FUNCTION__,
mCameraId);
return res;
}
if (consumerUsage & GraphicBuffer::USAGE_HW_TEXTURE) {
ALOGW("%s: Camera %d: Forcing asynchronous mode for stream",
__FUNCTION__, mCameraId);
useAsync = true;
}
sp<IBinder> binder;
sp<ANativeWindow> anw;
if (bufferProducer != 0) {
binder = bufferProducer->asBinder();
anw = new Surface(bufferProducer, useAsync);
}
if ((res = anw->query(anw.get(), NATIVE_WINDOW_WIDTH, &width)) != OK) {
ALOGE("%s: Camera %d: Failed to query Surface width", __FUNCTION__,
mCameraId);
return res;
}
if ((res = anw->query(anw.get(), NATIVE_WINDOW_HEIGHT, &height)) != OK) {
ALOGE("%s: Camera %d: Failed to query Surface height", __FUNCTION__,
mCameraId);
return res;
}
if ((res = anw->query(anw.get(), NATIVE_WINDOW_FORMAT, &format)) != OK) {
ALOGE("%s: Camera %d: Failed to query Surface format", __FUNCTION__,
mCameraId);
return res;
}
if (format >= HAL_PIXEL_FORMAT_RGBA_8888 &&
format <= HAL_PIXEL_FORMAT_BGRA_8888) {
ALOGW("%s: Camera %d: Overriding format 0x%x to IMPLEMENTATION_DEFINED",
__FUNCTION__, mCameraId, format);
format = HAL_PIXEL_FORMAT_IMPLEMENTATION_DEFINED;
}
int streamId = -1;
if (format == HAL_PIXEL_FORMAT_BLOB) {
CameraMetadata staticInfo = mDevice->info();
camera_metadata_entry_t entry = staticInfo.find(ANDROID_JPEG_MAX_SIZE);
if (entry.count == 0) {
ALOGE("%s: Camera %d: Can't find maximum JPEG size in "
"static metadata!", __FUNCTION__, mCameraId);
return INVALID_OPERATION;
}
int32_t maxJpegSize = entry.data.i32[0];
res = mDevice->createStream(anw, width, height, format, maxJpegSize,
&streamId);
} else {
res = mDevice->createStream(anw, width, height, format, /*size*/0,
&streamId);
}
if (res == OK) {
mStreamMap.add(bufferProducer->asBinder(), streamId);
ALOGV("%s: Camera %d: Successfully created a new stream ID %d",
__FUNCTION__, mCameraId, streamId);
/**
* Set the stream transform flags to automatically
* rotate the camera stream for preview use cases.
*/
int32_t transform = 0;
res = getRotationTransformLocked(&transform);
if (res != OK) {
return res;
}
res = mDevice->setStreamTransform(streamId, transform);
if (res != OK) {
ALOGE("%s: Failed to set stream transform (stream id %d)",
__FUNCTION__, streamId);
return res;
}
return streamId;
}
return res;
}
|
C
|
Android
| 0 |
CVE-2019-15922
|
https://www.cvedetails.com/cve/CVE-2019-15922/
|
CWE-476
|
https://github.com/torvalds/linux/commit/58ccd2d31e502c37e108b285bf3d343eb00c235b
|
58ccd2d31e502c37e108b285bf3d343eb00c235b
|
paride/pf: Fix potential NULL pointer dereference
Syzkaller report this:
pf: pf version 1.04, major 47, cluster 64, nice 0
pf: No ATAPI disk detected
kasan: CONFIG_KASAN_INLINE enabled
kasan: GPF could be caused by NULL-ptr deref or user memory access
general protection fault: 0000 [#1] SMP KASAN PTI
CPU: 0 PID: 9887 Comm: syz-executor.0 Tainted: G C 5.1.0-rc3+ #8
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.10.2-1ubuntu1 04/01/2014
RIP: 0010:pf_init+0x7af/0x1000 [pf]
Code: 46 77 d2 48 89 d8 48 c1 e8 03 80 3c 28 00 74 08 48 89 df e8 03 25 a6 d2 4c 8b 23 49 8d bc 24 80 05 00 00 48 89 f8 48 c1 e8 03 <80> 3c 28 00 74 05 e8 e6 24 a6 d2 49 8b bc 24 80 05 00 00 e8 79 34
RSP: 0018:ffff8881abcbf998 EFLAGS: 00010202
RAX: 00000000000000b0 RBX: ffffffffc1e4a8a8 RCX: ffffffffaec50788
RDX: 0000000000039b10 RSI: ffffc9000153c000 RDI: 0000000000000580
RBP: dffffc0000000000 R08: ffffed103ee44e59 R09: ffffed103ee44e59
R10: 0000000000000001 R11: ffffed103ee44e58 R12: 0000000000000000
R13: ffffffffc1e4b028 R14: 0000000000000000 R15: 0000000000000020
FS: 00007f1b78a91700(0000) GS:ffff8881f7200000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f6d72b207f8 CR3: 00000001d5790004 CR4: 00000000007606f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
PKRU: 55555554
Call Trace:
? 0xffffffffc1e50000
do_one_initcall+0xbc/0x47d init/main.c:901
do_init_module+0x1b5/0x547 kernel/module.c:3456
load_module+0x6405/0x8c10 kernel/module.c:3804
__do_sys_finit_module+0x162/0x190 kernel/module.c:3898
do_syscall_64+0x9f/0x450 arch/x86/entry/common.c:290
entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x462e99
Code: f7 d8 64 89 02 b8 ff ff ff ff c3 66 0f 1f 44 00 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 bc ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f1b78a90c58 EFLAGS: 00000246 ORIG_RAX: 0000000000000139
RAX: ffffffffffffffda RBX: 000000000073bf00 RCX: 0000000000462e99
RDX: 0000000000000000 RSI: 0000000020000180 RDI: 0000000000000003
RBP: 00007f1b78a90c70 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 00007f1b78a916bc
R13: 00000000004bcefa R14: 00000000006f6fb0 R15: 0000000000000004
Modules linked in: pf(+) paride gpio_tps65218 tps65218 i2c_cht_wc ati_remote dc395x act_meta_skbtcindex act_ife ife ecdh_generic rc_xbox_dvd sky81452_regulator v4l2_fwnode leds_blinkm snd_usb_hiface comedi(C) aes_ti slhc cfi_cmdset_0020 mtd cfi_util sx8654 mdio_gpio of_mdio fixed_phy mdio_bitbang libphy alcor_pci matrix_keymap hid_uclogic usbhid scsi_transport_fc videobuf2_v4l2 videobuf2_dma_sg snd_soc_pcm179x_spi snd_soc_pcm179x_codec i2c_demux_pinctrl mdev snd_indigodj isl6405 mii enc28j60 cmac adt7316_i2c(C) adt7316(C) fmc_trivial fmc nf_reject_ipv4 authenc rc_dtt200u rtc_ds1672 dvb_usb_dibusb_mc dvb_usb_dibusb_mc_common dib3000mc dibx000_common dvb_usb_dibusb_common dvb_usb dvb_core videobuf2_common videobuf2_vmalloc videobuf2_memops regulator_haptic adf7242 mac802154 ieee802154 s5h1409 da9034_ts snd_intel8x0m wmi cx24120 usbcore sdhci_cadence sdhci_pltfm sdhci mmc_core joydev i2c_algo_bit scsi_transport_iscsi iscsi_boot_sysfs ves1820 lockd grace nfs_acl auth_rpcgss sunrp
c
ip_vs snd_soc_adau7002 snd_cs4281 snd_rawmidi gameport snd_opl3_lib snd_seq_device snd_hwdep snd_ac97_codec ad7418 hid_primax hid snd_soc_cs4265 snd_soc_core snd_pcm_dmaengine snd_pcm snd_timer ac97_bus snd_compress snd soundcore ti_adc108s102 eeprom_93cx6 i2c_algo_pca mlxreg_hotplug st_pressure st_sensors industrialio_triggered_buffer kfifo_buf industrialio v4l2_common videodev media snd_soc_adau_utils rc_pinnacle_grey rc_core pps_gpio leds_lm3692x nandcore ledtrig_pattern iptable_security iptable_raw iptable_mangle iptable_nat nf_nat nf_conntrack nf_defrag_ipv6 nf_defrag_ipv4 iptable_filter bpfilter ip6_vti ip_vti ip_gre ipip sit tunnel4 ip_tunnel hsr veth netdevsim vxcan batman_adv cfg80211 rfkill chnl_net caif nlmon dummy team bonding vcan bridge stp llc ip6_gre gre ip6_tunnel tunnel6 tun mousedev ppdev tpm kvm_intel kvm irqbypass crct10dif_pclmul crc32_pclmul crc32c_intel ghash_clmulni_intel aesni_intel ide_pci_generic aes_x86_64 piix crypto_simd input_leds psmouse cryp
td
glue_helper ide_core intel_agp serio_raw intel_gtt agpgart ata_generic i2c_piix4 pata_acpi parport_pc parport rtc_cmos floppy sch_fq_codel ip_tables x_tables sha1_ssse3 sha1_generic ipv6 [last unloaded: paride]
Dumping ftrace buffer:
(ftrace buffer empty)
---[ end trace 7a818cf5f210d79e ]---
If alloc_disk fails in pf_init_units, pf->disk will be
NULL, however in pf_detect and pf_exit, it's not check
this before free.It may result a NULL pointer dereference.
Also when register_blkdev failed, blk_cleanup_queue() and
blk_mq_free_tag_set() should be called to free resources.
Reported-by: Hulk Robot <[email protected]>
Fixes: 6ce59025f118 ("paride/pf: cleanup queues when detection fails")
Signed-off-by: YueHaibing <[email protected]>
Signed-off-by: Jens Axboe <[email protected]>
|
static int pf_getgeo(struct block_device *bdev, struct hd_geometry *geo)
{
struct pf_unit *pf = bdev->bd_disk->private_data;
sector_t capacity = get_capacity(pf->disk);
if (capacity < PF_FD_MAX) {
geo->cylinders = sector_div(capacity, PF_FD_HDS * PF_FD_SPT);
geo->heads = PF_FD_HDS;
geo->sectors = PF_FD_SPT;
} else {
geo->cylinders = sector_div(capacity, PF_HD_HDS * PF_HD_SPT);
geo->heads = PF_HD_HDS;
geo->sectors = PF_HD_SPT;
}
return 0;
}
|
static int pf_getgeo(struct block_device *bdev, struct hd_geometry *geo)
{
struct pf_unit *pf = bdev->bd_disk->private_data;
sector_t capacity = get_capacity(pf->disk);
if (capacity < PF_FD_MAX) {
geo->cylinders = sector_div(capacity, PF_FD_HDS * PF_FD_SPT);
geo->heads = PF_FD_HDS;
geo->sectors = PF_FD_SPT;
} else {
geo->cylinders = sector_div(capacity, PF_HD_HDS * PF_HD_SPT);
geo->heads = PF_HD_HDS;
geo->sectors = PF_HD_SPT;
}
return 0;
}
|
C
|
linux
| 0 |
CVE-2014-1713
|
https://www.cvedetails.com/cve/CVE-2014-1713/
|
CWE-399
|
https://github.com/chromium/chromium/commit/f85a87ec670ad0fce9d98d90c9a705b72a288154
|
f85a87ec670ad0fce9d98d90c9a705b72a288154
|
document.location bindings fix
BUG=352374
[email protected]
Review URL: https://codereview.chromium.org/196343011
git-svn-id: svn://svn.chromium.org/blink/trunk@169176 bbb929c8-8fbe-4397-9dbb-9b2b20218538
|
static void voidMethodTestInterfaceEmptyArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
{
TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
TestObjectPythonV8Internal::voidMethodTestInterfaceEmptyArgMethod(info);
TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
}
|
static void voidMethodTestInterfaceEmptyArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
{
TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
TestObjectPythonV8Internal::voidMethodTestInterfaceEmptyArgMethod(info);
TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
}
|
C
|
Chrome
| 0 |
null | null | null |
https://github.com/chromium/chromium/commit/181c7400b2bf50ba02ac77149749fb419b4d4797
|
181c7400b2bf50ba02ac77149749fb419b4d4797
|
gpu: Use GetUniformSetup computed result size.
[email protected]
BUG=468936
Review URL: https://codereview.chromium.org/1016193003
Cr-Commit-Position: refs/heads/master@{#321489}
|
void GLES2DecoderImpl::DoPopulateSubscribedValuesCHROMIUM(GLenum target) {
if (!CheckCurrentValuebuffer("glPopulateSubscribedValuesCHROMIUM")) {
return;
}
valuebuffer_manager()->UpdateValuebufferState(state_.bound_valuebuffer.get());
}
|
void GLES2DecoderImpl::DoPopulateSubscribedValuesCHROMIUM(GLenum target) {
if (!CheckCurrentValuebuffer("glPopulateSubscribedValuesCHROMIUM")) {
return;
}
valuebuffer_manager()->UpdateValuebufferState(state_.bound_valuebuffer.get());
}
|
C
|
Chrome
| 0 |
Subsets and Splits
CWE-119 Function Changes
This query retrieves specific examples (before and after code changes) of vulnerabilities with CWE-119, providing basic filtering but limited insight.
Vulnerable Code with CWE IDs
The query filters and combines records from multiple datasets to list specific vulnerability details, providing a basic overview of vulnerable functions but lacking deeper insights.
Vulnerable Functions in BigVul
Retrieves details of vulnerable functions from both validation and test datasets where vulnerabilities are present, providing a basic set of data points for further analysis.
Vulnerable Code Functions
This query filters and shows raw data for vulnerable functions, which provides basic insight into specific vulnerabilities but lacks broader analytical value.
Top 100 Vulnerable Functions
Retrieves 100 samples of vulnerabilities from the training dataset, showing the CVE ID, CWE ID, and code changes before and after the vulnerability, which is a basic filtering of vulnerability data.