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-17434
https://www.cvedetails.com/cve/CVE-2017-17434/
null
https://git.samba.org/?p=rsync.git;a=commit;h=70aeb5fddd1b2f8e143276f8d5a085db16c593b9
70aeb5fddd1b2f8e143276f8d5a085db16c593b9
null
void send_protected_args(int fd, char *args[]) { int i; #ifdef ICONV_OPTION int convert = ic_send != (iconv_t)-1; xbuf outbuf, inbuf; if (convert) alloc_xbuf(&outbuf, 1024); #endif for (i = 0; args[i]; i++) {} /* find first NULL */ args[i] = "rsync"; /* set a new arg0 */ if (DEBUG_GTE(CMD, 1)) print_child_argv("protected args:", args + i + 1); do { if (!args[i][0]) write_buf(fd, ".", 2); #ifdef ICONV_OPTION else if (convert) { INIT_XBUF_STRLEN(inbuf, args[i]); iconvbufs(ic_send, &inbuf, &outbuf, ICB_EXPAND_OUT | ICB_INCLUDE_BAD | ICB_INCLUDE_INCOMPLETE | ICB_INIT); outbuf.buf[outbuf.len] = '\0'; write_buf(fd, outbuf.buf, outbuf.len + 1); outbuf.len = 0; } #endif else write_buf(fd, args[i], strlen(args[i]) + 1); } while (args[++i]); write_byte(fd, 0); #ifdef ICONV_OPTION if (convert) free(outbuf.buf); #endif }
void send_protected_args(int fd, char *args[]) { int i; #ifdef ICONV_OPTION int convert = ic_send != (iconv_t)-1; xbuf outbuf, inbuf; if (convert) alloc_xbuf(&outbuf, 1024); #endif for (i = 0; args[i]; i++) {} /* find first NULL */ args[i] = "rsync"; /* set a new arg0 */ if (DEBUG_GTE(CMD, 1)) print_child_argv("protected args:", args + i + 1); do { if (!args[i][0]) write_buf(fd, ".", 2); #ifdef ICONV_OPTION else if (convert) { INIT_XBUF_STRLEN(inbuf, args[i]); iconvbufs(ic_send, &inbuf, &outbuf, ICB_EXPAND_OUT | ICB_INCLUDE_BAD | ICB_INCLUDE_INCOMPLETE | ICB_INIT); outbuf.buf[outbuf.len] = '\0'; write_buf(fd, outbuf.buf, outbuf.len + 1); outbuf.len = 0; } #endif else write_buf(fd, args[i], strlen(args[i]) + 1); } while (args[++i]); write_byte(fd, 0); #ifdef ICONV_OPTION if (convert) free(outbuf.buf); #endif }
C
samba
0
CVE-2014-3191
https://www.cvedetails.com/cve/CVE-2014-3191/
CWE-416
https://github.com/chromium/chromium/commit/11a4cc4a6d6e665d9a118fada4b7c658d6f70d95
11a4cc4a6d6e665d9a118fada4b7c658d6f70d95
Defer call to updateWidgetPositions() outside of RenderLayerScrollableArea. updateWidgetPositions() can destroy the render tree, so it should never be called from inside RenderLayerScrollableArea. Leaving it there allows for the potential of use-after-free bugs. BUG=402407 [email protected] Review URL: https://codereview.chromium.org/490473003 git-svn-id: svn://svn.chromium.org/blink/trunk@180681 bbb929c8-8fbe-4397-9dbb-9b2b20218538
void FrameView::performPreLayoutTasks() { TRACE_EVENT0("blink", "FrameView::performPreLayoutTasks"); lifecycle().advanceTo(DocumentLifecycle::InPreLayout); TemporaryChange<bool> changeSchedulingEnabled(m_layoutSchedulingEnabled, false); if (!m_nestedLayoutCount && !m_inSynchronousPostLayout && m_postLayoutTasksTimer.isActive()) { m_inSynchronousPostLayout = true; performPostLayoutTasks(); m_inSynchronousPostLayout = false; } Document* document = m_frame->document(); document->notifyResizeForViewportUnits(); if (!document->styleResolver() || document->styleResolver()->mediaQueryAffectedByViewportChange()) { document->styleResolverChanged(); document->mediaQueryAffectingValueChanged(); InspectorInstrumentation::mediaQueryResultChanged(document); } else { document->evaluateMediaQueryList(); } document->updateRenderTreeIfNeeded(); lifecycle().advanceTo(DocumentLifecycle::StyleClean); }
void FrameView::performPreLayoutTasks() { TRACE_EVENT0("blink", "FrameView::performPreLayoutTasks"); lifecycle().advanceTo(DocumentLifecycle::InPreLayout); TemporaryChange<bool> changeSchedulingEnabled(m_layoutSchedulingEnabled, false); if (!m_nestedLayoutCount && !m_inSynchronousPostLayout && m_postLayoutTasksTimer.isActive()) { m_inSynchronousPostLayout = true; performPostLayoutTasks(); m_inSynchronousPostLayout = false; } Document* document = m_frame->document(); document->notifyResizeForViewportUnits(); if (!document->styleResolver() || document->styleResolver()->mediaQueryAffectedByViewportChange()) { document->styleResolverChanged(); document->mediaQueryAffectingValueChanged(); InspectorInstrumentation::mediaQueryResultChanged(document); } else { document->evaluateMediaQueryList(); } document->updateRenderTreeIfNeeded(); lifecycle().advanceTo(DocumentLifecycle::StyleClean); }
C
Chrome
0
CVE-2019-5760
https://www.cvedetails.com/cve/CVE-2019-5760/
CWE-416
https://github.com/chromium/chromium/commit/3514a77e7fa2e5b8bfe5d98af22964bbd69d680f
3514a77e7fa2e5b8bfe5d98af22964bbd69d680f
Check weak pointers in RTCPeerConnectionHandler::WebRtcSetDescriptionObserverImpl Bug: 912074 Change-Id: I8ba86751f5d5bf12db51520f985ef0d3dae63ed8 Reviewed-on: https://chromium-review.googlesource.com/c/1411916 Commit-Queue: Guido Urdaneta <[email protected]> Reviewed-by: Henrik Boström <[email protected]> Cr-Commit-Position: refs/heads/master@{#622945}
void RTCPeerConnectionHandler::Stop() { DCHECK(task_runner_->RunsTasksInCurrentSequence()); DVLOG(1) << "RTCPeerConnectionHandler::stop"; if (is_closed_ || !native_peer_connection_.get()) return; // Already stopped. if (peer_connection_tracker_) peer_connection_tracker_->TrackStop(this); native_peer_connection_->Close(); is_closed_ = true; }
void RTCPeerConnectionHandler::Stop() { DCHECK(task_runner_->RunsTasksInCurrentSequence()); DVLOG(1) << "RTCPeerConnectionHandler::stop"; if (is_closed_ || !native_peer_connection_.get()) return; // Already stopped. if (peer_connection_tracker_) peer_connection_tracker_->TrackStop(this); native_peer_connection_->Close(); is_closed_ = true; }
C
Chrome
0
CVE-2017-5035
https://www.cvedetails.com/cve/CVE-2017-5035/
CWE-362
https://github.com/chromium/chromium/commit/c32cd2069ae8062b52e5b7b1faf5936bd71a583a
c32cd2069ae8062b52e5b7b1faf5936bd71a583a
Add DumpWithoutCrashing in RendererDidNavigateToExistingPage This is intended to be reverted after investigating the linked bug. BUG=688425 CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_site_isolation Review-Url: https://codereview.chromium.org/2701523004 Cr-Commit-Position: refs/heads/master@{#450900}
void NavigationControllerImpl::NavigateToPendingEntry(ReloadType reload_type) { needs_reload_ = false; if (pending_entry_index_ != -1 && pending_entry_index_ == last_committed_entry_index_ && (entries_[pending_entry_index_]->restore_type() == RestoreType::NONE) && (entries_[pending_entry_index_]->GetTransitionType() & ui::PAGE_TRANSITION_FORWARD_BACK)) { delegate_->Stop(); if (delegate_->GetInterstitialPage()) delegate_->GetInterstitialPage()->DontProceed(); DiscardNonCommittedEntries(); return; } if (delegate_->GetInterstitialPage()) { static_cast<InterstitialPageImpl*>(delegate_->GetInterstitialPage()) ->CancelForNavigation(); } NavigationEntryImpl* last_navigation = last_pending_entry_ ? last_pending_entry_ : GetLastCommittedEntry(); if (reload_type == ReloadType::NONE && last_navigation && pending_entry_ && ShouldTreatNavigationAsReload(pending_entry_) && !last_navigation->ssl_error() && last_transient_entry_index_ == -1 && pending_entry_->frame_tree_node_id() == -1 && pending_entry_->GetURL() == last_navigation->GetURL() && !pending_entry_->GetHasPostData() && !last_navigation->GetHasPostData() && last_navigation->GetVirtualURL() == pending_entry_->GetVirtualURL() && (pending_entry_->GetURL().SchemeIs(url::kDataScheme) && pending_entry_->GetBaseURLForDataURL().is_valid() ? pending_entry_->GetBaseURLForDataURL() == last_navigation->GetBaseURLForDataURL() : true)) { reload_type = ReloadType::NORMAL; } if (last_pending_entry_index_ == -1 && last_pending_entry_) delete last_pending_entry_; last_transient_entry_index_ = -1; last_pending_entry_ = nullptr; last_pending_entry_index_ = -1; if (!pending_entry_) { CHECK_NE(pending_entry_index_, -1); pending_entry_ = entries_[pending_entry_index_].get(); } if (IsRendererDebugURL(pending_entry_->GetURL())) { if (!delegate_->GetRenderViewHost()->IsRenderViewLive() && !IsInitialNavigation()) { DiscardNonCommittedEntries(); return; } } CHECK(!in_navigate_to_pending_entry_); in_navigate_to_pending_entry_ = true; bool success = NavigateToPendingEntryInternal(reload_type); in_navigate_to_pending_entry_ = false; if (!success) DiscardNonCommittedEntries(); }
void NavigationControllerImpl::NavigateToPendingEntry(ReloadType reload_type) { needs_reload_ = false; if (pending_entry_index_ != -1 && pending_entry_index_ == last_committed_entry_index_ && (entries_[pending_entry_index_]->restore_type() == RestoreType::NONE) && (entries_[pending_entry_index_]->GetTransitionType() & ui::PAGE_TRANSITION_FORWARD_BACK)) { delegate_->Stop(); if (delegate_->GetInterstitialPage()) delegate_->GetInterstitialPage()->DontProceed(); DiscardNonCommittedEntries(); return; } if (delegate_->GetInterstitialPage()) { static_cast<InterstitialPageImpl*>(delegate_->GetInterstitialPage()) ->CancelForNavigation(); } NavigationEntryImpl* last_navigation = last_pending_entry_ ? last_pending_entry_ : GetLastCommittedEntry(); if (reload_type == ReloadType::NONE && last_navigation && pending_entry_ && ShouldTreatNavigationAsReload(pending_entry_) && !last_navigation->ssl_error() && last_transient_entry_index_ == -1 && pending_entry_->frame_tree_node_id() == -1 && pending_entry_->GetURL() == last_navigation->GetURL() && !pending_entry_->GetHasPostData() && !last_navigation->GetHasPostData() && last_navigation->GetVirtualURL() == pending_entry_->GetVirtualURL() && (pending_entry_->GetURL().SchemeIs(url::kDataScheme) && pending_entry_->GetBaseURLForDataURL().is_valid() ? pending_entry_->GetBaseURLForDataURL() == last_navigation->GetBaseURLForDataURL() : true)) { reload_type = ReloadType::NORMAL; } if (last_pending_entry_index_ == -1 && last_pending_entry_) delete last_pending_entry_; last_transient_entry_index_ = -1; last_pending_entry_ = nullptr; last_pending_entry_index_ = -1; if (!pending_entry_) { CHECK_NE(pending_entry_index_, -1); pending_entry_ = entries_[pending_entry_index_].get(); } if (IsRendererDebugURL(pending_entry_->GetURL())) { if (!delegate_->GetRenderViewHost()->IsRenderViewLive() && !IsInitialNavigation()) { DiscardNonCommittedEntries(); return; } } CHECK(!in_navigate_to_pending_entry_); in_navigate_to_pending_entry_ = true; bool success = NavigateToPendingEntryInternal(reload_type); in_navigate_to_pending_entry_ = false; if (!success) DiscardNonCommittedEntries(); }
C
Chrome
0
CVE-2017-5009
https://www.cvedetails.com/cve/CVE-2017-5009/
CWE-119
https://github.com/chromium/chromium/commit/1c40f9042ae2d6ee7483d72998aabb5e73b2ff60
1c40f9042ae2d6ee7483d72998aabb5e73b2ff60
DevTools: send proper resource type in Network.RequestWillBeSent This patch plumbs resoure type into the DispatchWillSendRequest instrumenation. This allows us to report accurate type in Network.RequestWillBeSent event, instead of "Other", that we report today. BUG=765501 R=dgozman Change-Id: I0134c08b841e8dd247fdc8ff208bfd51e462709c Reviewed-on: https://chromium-review.googlesource.com/667504 Reviewed-by: Pavel Feldman <[email protected]> Reviewed-by: Dmitry Gozman <[email protected]> Commit-Queue: Andrey Lushnikov <[email protected]> Cr-Commit-Position: refs/heads/master@{#507936}
void ResourceFetcher::MakePreloadedResourceBlockOnloadIfNeeded( Resource* resource, const FetchParameters& params) { if (resource && resource->Loader() && resource->IsLoadEventBlockingResourceType() && resource->IsLinkPreload() && !params.IsLinkPreload() && non_blocking_loaders_.Contains(resource->Loader())) { non_blocking_loaders_.erase(resource->Loader()); loaders_.insert(resource->Loader()); } }
void ResourceFetcher::MakePreloadedResourceBlockOnloadIfNeeded( Resource* resource, const FetchParameters& params) { if (resource && resource->Loader() && resource->IsLoadEventBlockingResourceType() && resource->IsLinkPreload() && !params.IsLinkPreload() && non_blocking_loaders_.Contains(resource->Loader())) { non_blocking_loaders_.erase(resource->Loader()); loaders_.insert(resource->Loader()); } }
C
Chrome
0
CVE-2019-14980
https://www.cvedetails.com/cve/CVE-2019-14980/
CWE-416
https://github.com/ImageMagick/ImageMagick/commit/c5d012a46ae22be9444326aa37969a3f75daa3ba
c5d012a46ae22be9444326aa37969a3f75daa3ba
https://github.com/ImageMagick/ImageMagick6/issues/43
MagickExport MagickOffsetType SeekBlob(Image *image, const MagickOffsetType offset,const int whence) { BlobInfo *magick_restrict blob_info; assert(image != (Image *) NULL); assert(image->signature == MagickCoreSignature); if (image->debug != MagickFalse) (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename); assert(image->blob != (BlobInfo *) NULL); assert(image->blob->type != UndefinedStream); blob_info=image->blob; switch (blob_info->type) { case UndefinedStream: break; case StandardStream: case PipeStream: return(-1); case FileStream: { if ((offset < 0) && (whence == SEEK_SET)) return(-1); if (fseek(blob_info->file_info.file,offset,whence) < 0) return(-1); blob_info->offset=TellBlob(image); break; } case ZipStream: { #if defined(MAGICKCORE_ZLIB_DELEGATE) if (gzseek(blob_info->file_info.gzfile,offset,whence) < 0) return(-1); #endif blob_info->offset=TellBlob(image); break; } case BZipStream: return(-1); case FifoStream: return(-1); case BlobStream: { switch (whence) { case SEEK_SET: default: { if (offset < 0) return(-1); blob_info->offset=offset; break; } case SEEK_CUR: { if (((offset > 0) && (blob_info->offset > (SSIZE_MAX-offset))) || ((offset < 0) && (blob_info->offset < (-SSIZE_MAX-offset)))) { errno=EOVERFLOW; return(-1); } if ((blob_info->offset+offset) < 0) return(-1); blob_info->offset+=offset; break; } case SEEK_END: { if (((MagickOffsetType) blob_info->length+offset) < 0) return(-1); blob_info->offset=blob_info->length+offset; break; } } if (blob_info->offset < (MagickOffsetType) ((off_t) blob_info->length)) { blob_info->eof=MagickFalse; break; } if (blob_info->offset >= (MagickOffsetType) ((off_t) blob_info->extent)) return(-1); break; } case CustomStream: { if (blob_info->custom_stream->seeker == (CustomStreamSeeker) NULL) return(-1); blob_info->offset=blob_info->custom_stream->seeker(offset,whence, blob_info->custom_stream->data); break; } } return(blob_info->offset); }
MagickExport MagickOffsetType SeekBlob(Image *image, const MagickOffsetType offset,const int whence) { BlobInfo *magick_restrict blob_info; assert(image != (Image *) NULL); assert(image->signature == MagickCoreSignature); if (image->debug != MagickFalse) (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename); assert(image->blob != (BlobInfo *) NULL); assert(image->blob->type != UndefinedStream); blob_info=image->blob; switch (blob_info->type) { case UndefinedStream: break; case StandardStream: case PipeStream: return(-1); case FileStream: { if ((offset < 0) && (whence == SEEK_SET)) return(-1); if (fseek(blob_info->file_info.file,offset,whence) < 0) return(-1); blob_info->offset=TellBlob(image); break; } case ZipStream: { #if defined(MAGICKCORE_ZLIB_DELEGATE) if (gzseek(blob_info->file_info.gzfile,offset,whence) < 0) return(-1); #endif blob_info->offset=TellBlob(image); break; } case BZipStream: return(-1); case FifoStream: return(-1); case BlobStream: { switch (whence) { case SEEK_SET: default: { if (offset < 0) return(-1); blob_info->offset=offset; break; } case SEEK_CUR: { if (((offset > 0) && (blob_info->offset > (SSIZE_MAX-offset))) || ((offset < 0) && (blob_info->offset < (-SSIZE_MAX-offset)))) { errno=EOVERFLOW; return(-1); } if ((blob_info->offset+offset) < 0) return(-1); blob_info->offset+=offset; break; } case SEEK_END: { if (((MagickOffsetType) blob_info->length+offset) < 0) return(-1); blob_info->offset=blob_info->length+offset; break; } } if (blob_info->offset < (MagickOffsetType) ((off_t) blob_info->length)) { blob_info->eof=MagickFalse; break; } if (blob_info->offset >= (MagickOffsetType) ((off_t) blob_info->extent)) return(-1); break; } case CustomStream: { if (blob_info->custom_stream->seeker == (CustomStreamSeeker) NULL) return(-1); blob_info->offset=blob_info->custom_stream->seeker(offset,whence, blob_info->custom_stream->data); break; } } return(blob_info->offset); }
C
ImageMagick6
0
CVE-2015-1215
https://www.cvedetails.com/cve/CVE-2015-1215/
CWE-119
https://github.com/chromium/chromium/commit/2bceda4948deeaed0a5a99305d0d488eb952f64f
2bceda4948deeaed0a5a99305d0d488eb952f64f
Allow serialization of empty bluetooth uuids. This change allows the passing WTF::Optional<String> types as bluetooth.mojom.UUID optional parameter without needing to ensure the passed object isn't empty. BUG=None R=juncai, dcheng Review-Url: https://codereview.chromium.org/2646613003 Cr-Commit-Position: refs/heads/master@{#445809}
ScriptPromise BluetoothRemoteGATTCharacteristic::getDescriptor( ScriptState* scriptState, const StringOrUnsignedLong& descriptorUUID, ExceptionState& exceptionState) { String descriptor = BluetoothUUID::getDescriptor(descriptorUUID, exceptionState); if (exceptionState.hadException()) return exceptionState.reject(scriptState); return getDescriptorsImpl(scriptState, mojom::blink::WebBluetoothGATTQueryQuantity::SINGLE, descriptor); }
ScriptPromise BluetoothRemoteGATTCharacteristic::getDescriptor( ScriptState* scriptState, const StringOrUnsignedLong& descriptorUUID, ExceptionState& exceptionState) { String descriptor = BluetoothUUID::getDescriptor(descriptorUUID, exceptionState); if (exceptionState.hadException()) return exceptionState.reject(scriptState); return getDescriptorsImpl(scriptState, mojom::blink::WebBluetoothGATTQueryQuantity::SINGLE, descriptor); }
C
Chrome
0
CVE-2010-1149
https://www.cvedetails.com/cve/CVE-2010-1149/
CWE-200
https://cgit.freedesktop.org/udisks/commit/?id=0fcc7cb3b66f23fac53ae08647aa0007a2bd56c4
0fcc7cb3b66f23fac53ae08647aa0007a2bd56c4
null
job_local_end (Device *device) { if (!device->priv->job_in_progress || device->priv->job != NULL) { g_warning ("There is no job running"); goto out; } device->priv->job_in_progress = FALSE; g_free (device->priv->job_id); device->priv->job_id = NULL; device->priv->job_initiated_by_uid = 0; device->priv->job_is_cancellable = FALSE; device->priv->job_percentage = -1.0; emit_job_changed (device); out: ; }
job_local_end (Device *device) { if (!device->priv->job_in_progress || device->priv->job != NULL) { g_warning ("There is no job running"); goto out; } device->priv->job_in_progress = FALSE; g_free (device->priv->job_id); device->priv->job_id = NULL; device->priv->job_initiated_by_uid = 0; device->priv->job_is_cancellable = FALSE; device->priv->job_percentage = -1.0; emit_job_changed (device); out: ; }
C
udisks
0
CVE-2016-3120
https://www.cvedetails.com/cve/CVE-2016-3120/
CWE-476
https://github.com/krb5/krb5/commit/93b4a6306a0026cf1cc31ac4bd8a49ba5d034ba7
93b4a6306a0026cf1cc31ac4bd8a49ba5d034ba7
Fix S4U2Self KDC crash when anon is restricted In validate_as_request(), when enforcing restrict_anonymous_to_tgt, use client.princ instead of request->client; the latter is NULL when validating S4U2Self requests. CVE-2016-3120: In MIT krb5 1.9 and later, an authenticated attacker can cause krb5kdc to dereference a null pointer if the restrict_anonymous_to_tgt option is set to true, by making an S4U2Self request. CVSSv2 Vector: AV:N/AC:H/Au:S/C:N/I:N/A:C/E:H/RL:OF/RC:C ticket: 8458 (new) target_version: 1.14-next target_version: 1.13-next
get_local_tgt(krb5_context context, const krb5_data *realm, krb5_db_entry *candidate, krb5_db_entry **alias_out, krb5_db_entry **storage_out) { krb5_error_code ret; krb5_principal princ; krb5_db_entry *tgt; *alias_out = NULL; *storage_out = NULL; ret = krb5_build_principal_ext(context, &princ, realm->length, realm->data, KRB5_TGS_NAME_SIZE, KRB5_TGS_NAME, realm->length, realm->data, 0); if (ret) return ret; if (!krb5_principal_compare(context, candidate->princ, princ)) { ret = krb5_db_get_principal(context, princ, 0, &tgt); if (!ret) *storage_out = *alias_out = tgt; } else { *alias_out = candidate; } krb5_free_principal(context, princ); return ret; }
get_local_tgt(krb5_context context, const krb5_data *realm, krb5_db_entry *candidate, krb5_db_entry **alias_out, krb5_db_entry **storage_out) { krb5_error_code ret; krb5_principal princ; krb5_db_entry *tgt; *alias_out = NULL; *storage_out = NULL; ret = krb5_build_principal_ext(context, &princ, realm->length, realm->data, KRB5_TGS_NAME_SIZE, KRB5_TGS_NAME, realm->length, realm->data, 0); if (ret) return ret; if (!krb5_principal_compare(context, candidate->princ, princ)) { ret = krb5_db_get_principal(context, princ, 0, &tgt); if (!ret) *storage_out = *alias_out = tgt; } else { *alias_out = candidate; } krb5_free_principal(context, princ); return ret; }
C
krb5
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}
static AccessibilityRole decideRoleFromSibling(LayoutTableCell* siblingCell) { if (!siblingCell) return CellRole; if (Node* siblingNode = siblingCell->node()) { if (siblingNode->hasTagName(thTag)) return ColumnHeaderRole; if (siblingNode->hasTagName(tdTag)) return RowHeaderRole; } return CellRole; }
static AccessibilityRole decideRoleFromSibling(LayoutTableCell* siblingCell) { if (!siblingCell) return CellRole; if (Node* siblingNode = siblingCell->node()) { if (siblingNode->hasTagName(thTag)) return ColumnHeaderRole; if (siblingNode->hasTagName(tdTag)) return RowHeaderRole; } return CellRole; }
C
Chrome
0
CVE-2017-0553
https://www.cvedetails.com/cve/CVE-2017-0553/
CWE-190
http://git.infradead.org/users/tgr/libnl.git/commit/3e18948f17148e6a3c4255bdeaaf01ef6081ceeb
3e18948f17148e6a3c4255bdeaaf01ef6081ceeb
null
struct nl_msg *nlmsg_alloc_simple(int nlmsgtype, int flags) { struct nl_msg *msg; struct nlmsghdr nlh = { .nlmsg_type = nlmsgtype, .nlmsg_flags = flags, }; msg = nlmsg_inherit(&nlh); if (msg) NL_DBG(2, "msg %p: Allocated new simple message\n", msg); return msg; }
struct nl_msg *nlmsg_alloc_simple(int nlmsgtype, int flags) { struct nl_msg *msg; struct nlmsghdr nlh = { .nlmsg_type = nlmsgtype, .nlmsg_flags = flags, }; msg = nlmsg_inherit(&nlh); if (msg) NL_DBG(2, "msg %p: Allocated new simple message\n", msg); return msg; }
C
infradead
0
null
null
null
https://github.com/chromium/chromium/commit/befb46ae3385fa13975521e9a2281e35805b339e
befb46ae3385fa13975521e9a2281e35805b339e
2009-10-23 Chris Evans <[email protected]> Reviewed by Adam Barth. Added test for bug 27239 (ignore Refresh for view source mode). https://bugs.webkit.org/show_bug.cgi?id=27239 * http/tests/security/view-source-no-refresh.html: Added * http/tests/security/view-source-no-refresh-expected.txt: Added * http/tests/security/resources/view-source-no-refresh.php: Added 2009-10-23 Chris Evans <[email protected]> Reviewed by Adam Barth. Ignore the Refresh header if we're in view source mode. https://bugs.webkit.org/show_bug.cgi?id=27239 Test: http/tests/security/view-source-no-refresh.html * loader/FrameLoader.cpp: ignore Refresh in view-source mode. git-svn-id: svn://svn.chromium.org/blink/trunk@50018 bbb929c8-8fbe-4397-9dbb-9b2b20218538
void FrameLoader::detachFromParent() { RefPtr<Frame> protect(m_frame); closeURL(); stopAllLoaders(); history()->saveScrollPositionAndViewStateToItem(history()->currentItem()); detachChildren(); #if ENABLE(INSPECTOR) if (Page* page = m_frame->page()) page->inspectorController()->frameDetachedFromParent(m_frame); #endif detachViewsAndDocumentLoader(); if (Frame* parent = m_frame->tree()->parent()) { parent->loader()->closeAndRemoveChild(m_frame); parent->loader()->scheduleCheckCompleted(); } else { m_frame->setView(0); m_frame->pageDestroyed(); } }
void FrameLoader::detachFromParent() { RefPtr<Frame> protect(m_frame); closeURL(); stopAllLoaders(); history()->saveScrollPositionAndViewStateToItem(history()->currentItem()); detachChildren(); #if ENABLE(INSPECTOR) if (Page* page = m_frame->page()) page->inspectorController()->frameDetachedFromParent(m_frame); #endif detachViewsAndDocumentLoader(); if (Frame* parent = m_frame->tree()->parent()) { parent->loader()->closeAndRemoveChild(m_frame); parent->loader()->scheduleCheckCompleted(); } else { m_frame->setView(0); m_frame->pageDestroyed(); } }
C
Chrome
0
CVE-2018-6051
https://www.cvedetails.com/cve/CVE-2018-6051/
CWE-79
https://github.com/chromium/chromium/commit/0da6dcdbe8e34740133773d20cc466b89d399d0a
0da6dcdbe8e34740133773d20cc466b89d399d0a
Restrict the xss audit report URL to same origin BUG=441275 [email protected],[email protected] Change-Id: I27bc8e251b9ad962c3b4fdebf084a2b9152f915d Reviewed-on: https://chromium-review.googlesource.com/768367 Reviewed-by: Tom Sepez <[email protected]> Reviewed-by: Mike West <[email protected]> Commit-Queue: Jochen Eisinger <[email protected]> Cr-Commit-Position: refs/heads/master@{#516666}
static bool IsSemicolonSeparatedValueContainingJavaScriptURL( const String& value) { Vector<String> value_list; value.Split(';', value_list); for (size_t i = 0; i < value_list.size(); ++i) { String stripped = StripLeadingAndTrailingHTMLSpaces(value_list[i]); if (ProtocolIsJavaScript(stripped)) return true; } return false; }
static bool IsSemicolonSeparatedValueContainingJavaScriptURL( const String& value) { Vector<String> value_list; value.Split(';', value_list); for (size_t i = 0; i < value_list.size(); ++i) { String stripped = StripLeadingAndTrailingHTMLSpaces(value_list[i]); if (ProtocolIsJavaScript(stripped)) return true; } return false; }
C
Chrome
0
CVE-2016-5219
https://www.cvedetails.com/cve/CVE-2016-5219/
CWE-416
https://github.com/chromium/chromium/commit/a4150b688a754d3d10d2ca385155b1c95d77d6ae
a4150b688a754d3d10d2ca385155b1c95d77d6ae
Add GL_PROGRAM_COMPLETION_QUERY_CHROMIUM This makes the query of GL_COMPLETION_STATUS_KHR to programs much cheaper by minimizing the round-trip to the GPU thread. Bug: 881152, 957001 Change-Id: Iadfa798af29225e752c710ca5c25f50b3dd3101a Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1586630 Commit-Queue: Kenneth Russell <[email protected]> Reviewed-by: Kentaro Hara <[email protected]> Reviewed-by: Geoff Lang <[email protected]> Reviewed-by: Kenneth Russell <[email protected]> Cr-Commit-Position: refs/heads/master@{#657568}
void GLES2DecoderPassthroughImpl::RestoreRenderbufferBindings() {}
void GLES2DecoderPassthroughImpl::RestoreRenderbufferBindings() {}
C
Chrome
0
CVE-2015-8539
https://www.cvedetails.com/cve/CVE-2015-8539/
CWE-264
https://github.com/torvalds/linux/commit/096fe9eaea40a17e125569f9e657e34cdb6d73bd
096fe9eaea40a17e125569f9e657e34cdb6d73bd
KEYS: Fix handling of stored error in a negatively instantiated user key If a user key gets negatively instantiated, an error code is cached in the payload area. A negatively instantiated key may be then be positively instantiated by updating it with valid data. However, the ->update key type method must be aware that the error code may be there. The following may be used to trigger the bug in the user key type: keyctl request2 user user "" @u keyctl add user user "a" @u which manifests itself as: BUG: unable to handle kernel paging request at 00000000ffffff8a IP: [<ffffffff810a376f>] __call_rcu.constprop.76+0x1f/0x280 kernel/rcu/tree.c:3046 PGD 7cc30067 PUD 0 Oops: 0002 [#1] SMP Modules linked in: CPU: 3 PID: 2644 Comm: a.out Not tainted 4.3.0+ #49 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Bochs 01/01/2011 task: ffff88003ddea700 ti: ffff88003dd88000 task.ti: ffff88003dd88000 RIP: 0010:[<ffffffff810a376f>] [<ffffffff810a376f>] __call_rcu.constprop.76+0x1f/0x280 [<ffffffff810a376f>] __call_rcu.constprop.76+0x1f/0x280 kernel/rcu/tree.c:3046 RSP: 0018:ffff88003dd8bdb0 EFLAGS: 00010246 RAX: 00000000ffffff82 RBX: 0000000000000000 RCX: 0000000000000001 RDX: ffffffff81e3fe40 RSI: 0000000000000000 RDI: 00000000ffffff82 RBP: ffff88003dd8bde0 R08: ffff88007d2d2da0 R09: 0000000000000000 R10: 0000000000000000 R11: ffff88003e8073c0 R12: 00000000ffffff82 R13: ffff88003dd8be68 R14: ffff88007d027600 R15: ffff88003ddea700 FS: 0000000000b92880(0063) GS:ffff88007fd00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 000000008005003b CR2: 00000000ffffff8a CR3: 000000007cc5f000 CR4: 00000000000006e0 Stack: ffff88003dd8bdf0 ffffffff81160a8a 0000000000000000 00000000ffffff82 ffff88003dd8be68 ffff88007d027600 ffff88003dd8bdf0 ffffffff810a39e5 ffff88003dd8be20 ffffffff812a31ab ffff88007d027600 ffff88007d027620 Call Trace: [<ffffffff810a39e5>] kfree_call_rcu+0x15/0x20 kernel/rcu/tree.c:3136 [<ffffffff812a31ab>] user_update+0x8b/0xb0 security/keys/user_defined.c:129 [< inline >] __key_update security/keys/key.c:730 [<ffffffff8129e5c1>] key_create_or_update+0x291/0x440 security/keys/key.c:908 [< inline >] SYSC_add_key security/keys/keyctl.c:125 [<ffffffff8129fc21>] SyS_add_key+0x101/0x1e0 security/keys/keyctl.c:60 [<ffffffff8185f617>] entry_SYSCALL_64_fastpath+0x12/0x6a arch/x86/entry/entry_64.S:185 Note the error code (-ENOKEY) in EDX. A similar bug can be tripped by: keyctl request2 trusted user "" @u keyctl add trusted user "a" @u This should also affect encrypted keys - but that has to be correctly parameterised or it will fail with EINVAL before getting to the bit that will crashes. Reported-by: Dmitry Vyukov <[email protected]> Signed-off-by: David Howells <[email protected]> Acked-by: Mimi Zohar <[email protected]> Signed-off-by: James Morris <[email protected]>
static int __init init_trusted(void) { int ret; ret = trusted_shash_alloc(); if (ret < 0) return ret; ret = register_key_type(&key_type_trusted); if (ret < 0) trusted_shash_release(); return ret; }
static int __init init_trusted(void) { int ret; ret = trusted_shash_alloc(); if (ret < 0) return ret; ret = register_key_type(&key_type_trusted); if (ret < 0) trusted_shash_release(); return ret; }
C
linux
0
CVE-2015-5697
https://www.cvedetails.com/cve/CVE-2015-5697/
CWE-200
https://github.com/torvalds/linux/commit/b6878d9e03043695dbf3fa1caa6dfc09db225b16
b6878d9e03043695dbf3fa1caa6dfc09db225b16
md: use kzalloc() when bitmap is disabled In drivers/md/md.c get_bitmap_file() uses kmalloc() for creating a mdu_bitmap_file_t called "file". 5769 file = kmalloc(sizeof(*file), GFP_NOIO); 5770 if (!file) 5771 return -ENOMEM; This structure is copied to user space at the end of the function. 5786 if (err == 0 && 5787 copy_to_user(arg, file, sizeof(*file))) 5788 err = -EFAULT But if bitmap is disabled only the first byte of "file" is initialized with zero, so it's possible to read some bytes (up to 4095) of kernel space memory from user space. This is an information leak. 5775 /* bitmap disabled, zero the first byte and copy out */ 5776 if (!mddev->bitmap_info.file) 5777 file->pathname[0] = '\0'; Signed-off-by: Benjamin Randazzo <[email protected]> Signed-off-by: NeilBrown <[email protected]>
static int sb_equal(mdp_super_t *sb1, mdp_super_t *sb2) { int ret; mdp_super_t *tmp1, *tmp2; tmp1 = kmalloc(sizeof(*tmp1),GFP_KERNEL); tmp2 = kmalloc(sizeof(*tmp2),GFP_KERNEL); if (!tmp1 || !tmp2) { ret = 0; printk(KERN_INFO "md.c sb_equal(): failed to allocate memory!\n"); goto abort; } *tmp1 = *sb1; *tmp2 = *sb2; /* * nr_disks is not constant */ tmp1->nr_disks = 0; tmp2->nr_disks = 0; ret = (memcmp(tmp1, tmp2, MD_SB_GENERIC_CONSTANT_WORDS * 4) == 0); abort: kfree(tmp1); kfree(tmp2); return ret; }
static int sb_equal(mdp_super_t *sb1, mdp_super_t *sb2) { int ret; mdp_super_t *tmp1, *tmp2; tmp1 = kmalloc(sizeof(*tmp1),GFP_KERNEL); tmp2 = kmalloc(sizeof(*tmp2),GFP_KERNEL); if (!tmp1 || !tmp2) { ret = 0; printk(KERN_INFO "md.c sb_equal(): failed to allocate memory!\n"); goto abort; } *tmp1 = *sb1; *tmp2 = *sb2; /* * nr_disks is not constant */ tmp1->nr_disks = 0; tmp2->nr_disks = 0; ret = (memcmp(tmp1, tmp2, MD_SB_GENERIC_CONSTANT_WORDS * 4) == 0); abort: kfree(tmp1); kfree(tmp2); return ret; }
C
linux
0
CVE-2014-7842
https://www.cvedetails.com/cve/CVE-2014-7842/
CWE-362
https://github.com/torvalds/linux/commit/a2b9e6c1a35afcc0973acb72e591c714e78885ff
a2b9e6c1a35afcc0973acb72e591c714e78885ff
KVM: x86: Don't report guest userspace emulation error to userspace Commit fc3a9157d314 ("KVM: X86: Don't report L2 emulation failures to user-space") disabled the reporting of L2 (nested guest) emulation failures to userspace due to race-condition between a vmexit and the instruction emulator. The same rational applies also to userspace applications that are permitted by the guest OS to access MMIO area or perform PIO. This patch extends the current behavior - of injecting a #UD instead of reporting it to userspace - also for guest userspace code. Signed-off-by: Nadav Amit <[email protected]> Signed-off-by: Paolo Bonzini <[email protected]>
int kvm_arch_vcpu_runnable(struct kvm_vcpu *vcpu) { if (is_guest_mode(vcpu) && kvm_x86_ops->check_nested_events) kvm_x86_ops->check_nested_events(vcpu, false); return (vcpu->arch.mp_state == KVM_MP_STATE_RUNNABLE && !vcpu->arch.apf.halted) || !list_empty_careful(&vcpu->async_pf.done) || kvm_apic_has_events(vcpu) || vcpu->arch.pv.pv_unhalted || atomic_read(&vcpu->arch.nmi_queued) || (kvm_arch_interrupt_allowed(vcpu) && kvm_cpu_has_interrupt(vcpu)); }
int kvm_arch_vcpu_runnable(struct kvm_vcpu *vcpu) { if (is_guest_mode(vcpu) && kvm_x86_ops->check_nested_events) kvm_x86_ops->check_nested_events(vcpu, false); return (vcpu->arch.mp_state == KVM_MP_STATE_RUNNABLE && !vcpu->arch.apf.halted) || !list_empty_careful(&vcpu->async_pf.done) || kvm_apic_has_events(vcpu) || vcpu->arch.pv.pv_unhalted || atomic_read(&vcpu->arch.nmi_queued) || (kvm_arch_interrupt_allowed(vcpu) && kvm_cpu_has_interrupt(vcpu)); }
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
static CHANNEL_SETUP_REC *create_channel_setup(void) { return g_malloc0(sizeof(CHANNEL_SETUP_REC)); }
static CHANNEL_SETUP_REC *create_channel_setup(void) { return g_malloc0(sizeof(CHANNEL_SETUP_REC)); }
C
irssi
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_setup_make_content_type(apr_pool_t *pool) { int i; for (i = 0; needcset[i]; i++) { continue; } needcset_patterns = (const apr_strmatch_pattern **) apr_palloc(pool, (i + 1) * sizeof(apr_strmatch_pattern *)); for (i = 0; needcset[i]; i++) { needcset_patterns[i] = apr_strmatch_precompile(pool, needcset[i], 0); } needcset_patterns[i] = NULL; charset_pattern = apr_strmatch_precompile(pool, "charset=", 0); }
AP_DECLARE(void) ap_setup_make_content_type(apr_pool_t *pool) { int i; for (i = 0; needcset[i]; i++) { continue; } needcset_patterns = (const apr_strmatch_pattern **) apr_palloc(pool, (i + 1) * sizeof(apr_strmatch_pattern *)); for (i = 0; needcset[i]; i++) { needcset_patterns[i] = apr_strmatch_precompile(pool, needcset[i], 0); } needcset_patterns[i] = NULL; charset_pattern = apr_strmatch_precompile(pool, "charset=", 0); }
C
httpd
0
CVE-2016-1907
https://www.cvedetails.com/cve/CVE-2016-1907/
CWE-119
https://anongit.mindrot.org/openssh.git/commit/?id=2fecfd486bdba9f51b3a789277bb0733ca36e1c0
2fecfd486bdba9f51b3a789277bb0733ca36e1c0
null
sshpkt_put_bignum2(struct ssh *ssh, const BIGNUM *v) { return sshbuf_put_bignum2(ssh->state->outgoing_packet, v); }
sshpkt_put_bignum2(struct ssh *ssh, const BIGNUM *v) { return sshbuf_put_bignum2(ssh->state->outgoing_packet, v); }
C
mindrot
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}
bool LayerTreeHostImpl::AnimationsPreserveAxisAlignment( const LayerImpl* layer) const { return mutator_host_->AnimationsPreserveAxisAlignment(layer->element_id()); }
bool LayerTreeHostImpl::AnimationsPreserveAxisAlignment( const LayerImpl* layer) const { return mutator_host_->AnimationsPreserveAxisAlignment(layer->element_id()); }
C
Chrome
0
CVE-2013-1858
https://www.cvedetails.com/cve/CVE-2013-1858/
CWE-264
https://github.com/torvalds/linux/commit/e66eded8309ebf679d3d3c1f5820d1f2ca332c71
e66eded8309ebf679d3d3c1f5820d1f2ca332c71
userns: Don't allow CLONE_NEWUSER | CLONE_FS Don't allowing sharing the root directory with processes in a different user namespace. There doesn't seem to be any point, and to allow it would require the overhead of putting a user namespace reference in fs_struct (for permission checks) and incrementing that reference count on practically every call to fork. So just perform the inexpensive test of forbidding sharing fs_struct acrosss processes in different user namespaces. We already disallow other forms of threading when unsharing a user namespace so this should be no real burden in practice. This updates setns, clone, and unshare to disallow multiple user namespaces sharing an fs_struct. Cc: [email protected] Signed-off-by: "Eric W. Biederman" <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
static int userns_install(struct nsproxy *nsproxy, void *ns) { struct user_namespace *user_ns = ns; struct cred *cred; /* Don't allow gaining capabilities by reentering * the same user namespace. */ if (user_ns == current_user_ns()) return -EINVAL; /* Threaded processes may not enter a different user namespace */ if (atomic_read(&current->mm->mm_users) > 1) return -EINVAL; if (current->fs->users != 1) return -EINVAL; if (!ns_capable(user_ns, CAP_SYS_ADMIN)) return -EPERM; cred = prepare_creds(); if (!cred) return -ENOMEM; put_user_ns(cred->user_ns); set_cred_user_ns(cred, get_user_ns(user_ns)); return commit_creds(cred); }
static int userns_install(struct nsproxy *nsproxy, void *ns) { struct user_namespace *user_ns = ns; struct cred *cred; /* Don't allow gaining capabilities by reentering * the same user namespace. */ if (user_ns == current_user_ns()) return -EINVAL; /* Threaded processes may not enter a different user namespace */ if (atomic_read(&current->mm->mm_users) > 1) return -EINVAL; if (!ns_capable(user_ns, CAP_SYS_ADMIN)) return -EPERM; cred = prepare_creds(); if (!cred) return -ENOMEM; put_user_ns(cred->user_ns); set_cred_user_ns(cred, get_user_ns(user_ns)); return commit_creds(cred); }
C
linux
1
CVE-2014-7841
https://www.cvedetails.com/cve/CVE-2014-7841/
CWE-399
https://github.com/torvalds/linux/commit/e40607cbe270a9e8360907cb1e62ddf0736e4864
e40607cbe270a9e8360907cb1e62ddf0736e4864
net: sctp: fix NULL pointer dereference in af->from_addr_param on malformed packet An SCTP server doing ASCONF will panic on malformed INIT ping-of-death in the form of: ------------ INIT[PARAM: SET_PRIMARY_IP] ------------> While the INIT chunk parameter verification dissects through many things in order to detect malformed input, it misses to actually check parameters inside of parameters. E.g. RFC5061, section 4.2.4 proposes a 'set primary IP address' parameter in ASCONF, which has as a subparameter an address parameter. So an attacker may send a parameter type other than SCTP_PARAM_IPV4_ADDRESS or SCTP_PARAM_IPV6_ADDRESS, param_type2af() will subsequently return 0 and thus sctp_get_af_specific() returns NULL, too, which we then happily dereference unconditionally through af->from_addr_param(). The trace for the log: BUG: unable to handle kernel NULL pointer dereference at 0000000000000078 IP: [<ffffffffa01e9c62>] sctp_process_init+0x492/0x990 [sctp] PGD 0 Oops: 0000 [#1] SMP [...] Pid: 0, comm: swapper Not tainted 2.6.32-504.el6.x86_64 #1 Bochs Bochs RIP: 0010:[<ffffffffa01e9c62>] [<ffffffffa01e9c62>] sctp_process_init+0x492/0x990 [sctp] [...] Call Trace: <IRQ> [<ffffffffa01f2add>] ? sctp_bind_addr_copy+0x5d/0xe0 [sctp] [<ffffffffa01e1fcb>] sctp_sf_do_5_1B_init+0x21b/0x340 [sctp] [<ffffffffa01e3751>] sctp_do_sm+0x71/0x1210 [sctp] [<ffffffffa01e5c09>] ? sctp_endpoint_lookup_assoc+0xc9/0xf0 [sctp] [<ffffffffa01e61f6>] sctp_endpoint_bh_rcv+0x116/0x230 [sctp] [<ffffffffa01ee986>] sctp_inq_push+0x56/0x80 [sctp] [<ffffffffa01fcc42>] sctp_rcv+0x982/0xa10 [sctp] [<ffffffffa01d5123>] ? ipt_local_in_hook+0x23/0x28 [iptable_filter] [<ffffffff8148bdc9>] ? nf_iterate+0x69/0xb0 [<ffffffff81496d10>] ? ip_local_deliver_finish+0x0/0x2d0 [<ffffffff8148bf86>] ? nf_hook_slow+0x76/0x120 [<ffffffff81496d10>] ? ip_local_deliver_finish+0x0/0x2d0 [...] A minimal way to address this is to check for NULL as we do on all other such occasions where we know sctp_get_af_specific() could possibly return with NULL. Fixes: d6de3097592b ("[SCTP]: Add the handling of "Set Primary IP Address" parameter to INIT") Signed-off-by: Daniel Borkmann <[email protected]> Cc: Vlad Yasevich <[email protected]> Acked-by: Neil Horman <[email protected]> Signed-off-by: David S. Miller <[email protected]>
static struct sctp_chunk *_sctp_make_chunk(const struct sctp_association *asoc, __u8 type, __u8 flags, int paylen) { struct sctp_chunk *retval; sctp_chunkhdr_t *chunk_hdr; struct sk_buff *skb; struct sock *sk; /* No need to allocate LL here, as this is only a chunk. */ skb = alloc_skb(WORD_ROUND(sizeof(sctp_chunkhdr_t) + paylen), GFP_ATOMIC); if (!skb) goto nodata; /* Make room for the chunk header. */ chunk_hdr = (sctp_chunkhdr_t *)skb_put(skb, sizeof(sctp_chunkhdr_t)); chunk_hdr->type = type; chunk_hdr->flags = flags; chunk_hdr->length = htons(sizeof(sctp_chunkhdr_t)); sk = asoc ? asoc->base.sk : NULL; retval = sctp_chunkify(skb, asoc, sk); if (!retval) { kfree_skb(skb); goto nodata; } retval->chunk_hdr = chunk_hdr; retval->chunk_end = ((__u8 *)chunk_hdr) + sizeof(struct sctp_chunkhdr); /* Determine if the chunk needs to be authenticated */ if (sctp_auth_send_cid(type, asoc)) retval->auth = 1; return retval; nodata: return NULL; }
static struct sctp_chunk *_sctp_make_chunk(const struct sctp_association *asoc, __u8 type, __u8 flags, int paylen) { struct sctp_chunk *retval; sctp_chunkhdr_t *chunk_hdr; struct sk_buff *skb; struct sock *sk; /* No need to allocate LL here, as this is only a chunk. */ skb = alloc_skb(WORD_ROUND(sizeof(sctp_chunkhdr_t) + paylen), GFP_ATOMIC); if (!skb) goto nodata; /* Make room for the chunk header. */ chunk_hdr = (sctp_chunkhdr_t *)skb_put(skb, sizeof(sctp_chunkhdr_t)); chunk_hdr->type = type; chunk_hdr->flags = flags; chunk_hdr->length = htons(sizeof(sctp_chunkhdr_t)); sk = asoc ? asoc->base.sk : NULL; retval = sctp_chunkify(skb, asoc, sk); if (!retval) { kfree_skb(skb); goto nodata; } retval->chunk_hdr = chunk_hdr; retval->chunk_end = ((__u8 *)chunk_hdr) + sizeof(struct sctp_chunkhdr); /* Determine if the chunk needs to be authenticated */ if (sctp_auth_send_cid(type, asoc)) retval->auth = 1; return retval; nodata: return NULL; }
C
linux
0
CVE-2016-3839
https://www.cvedetails.com/cve/CVE-2016-3839/
CWE-284
https://android.googlesource.com/platform/system/bt/+/472271b153c5dc53c28beac55480a8d8434b2d5c
472271b153c5dc53c28beac55480a8d8434b2d5c
DO NOT MERGE Fix potential DoS caused by delivering signal to BT process Bug: 28885210 Change-Id: I63866d894bfca47464d6e42e3fb0357c4f94d360 Conflicts: btif/co/bta_hh_co.c btif/src/btif_core.c Merge conflict resolution of ag/1161415 (referencing ag/1164670) - Directly into mnc-mr2-release
bt_status_t btif_le_test_mode(uint16_t opcode, uint8_t *buf, uint8_t len) { switch (opcode) { case HCI_BLE_TRANSMITTER_TEST: if (len != 3) return BT_STATUS_PARM_INVALID; BTM_BleTransmitterTest(buf[0],buf[1],buf[2], btif_dm_ble_tx_test_cback); break; case HCI_BLE_RECEIVER_TEST: if (len != 1) return BT_STATUS_PARM_INVALID; BTM_BleReceiverTest(buf[0], btif_dm_ble_rx_test_cback); break; case HCI_BLE_TEST_END: BTM_BleTestEnd((tBTM_CMPL_CB*) btif_dm_ble_test_end_cback); break; default: BTIF_TRACE_ERROR("%s: Unknown LE Test Mode Command 0x%x", __FUNCTION__, opcode); return BT_STATUS_UNSUPPORTED; } return BT_STATUS_SUCCESS; }
bt_status_t btif_le_test_mode(uint16_t opcode, uint8_t *buf, uint8_t len) { switch (opcode) { case HCI_BLE_TRANSMITTER_TEST: if (len != 3) return BT_STATUS_PARM_INVALID; BTM_BleTransmitterTest(buf[0],buf[1],buf[2], btif_dm_ble_tx_test_cback); break; case HCI_BLE_RECEIVER_TEST: if (len != 1) return BT_STATUS_PARM_INVALID; BTM_BleReceiverTest(buf[0], btif_dm_ble_rx_test_cback); break; case HCI_BLE_TEST_END: BTM_BleTestEnd((tBTM_CMPL_CB*) btif_dm_ble_test_end_cback); break; default: BTIF_TRACE_ERROR("%s: Unknown LE Test Mode Command 0x%x", __FUNCTION__, opcode); return BT_STATUS_UNSUPPORTED; } return BT_STATUS_SUCCESS; }
C
Android
0
CVE-2015-2301
https://www.cvedetails.com/cve/CVE-2015-2301/
null
https://git.php.net/?p=php-src.git;a=commit;h=b2cf3f064b8f5efef89bb084521b61318c71781b
b2cf3f064b8f5efef89bb084521b61318c71781b
null
static zval *phar_convert_to_other(phar_archive_data *source, int convert, char *ext, php_uint32 flags TSRMLS_DC) /* {{{ */ { phar_archive_data *phar; phar_entry_info *entry, newentry; zval *ret; /* invalidate phar cache */ PHAR_G(last_phar) = NULL; PHAR_G(last_phar_name) = PHAR_G(last_alias) = NULL; phar = (phar_archive_data *) ecalloc(1, sizeof(phar_archive_data)); /* set whole-archive compression and type from parameter */ phar->flags = flags; phar->is_data = source->is_data; switch (convert) { case PHAR_FORMAT_TAR: phar->is_tar = 1; break; case PHAR_FORMAT_ZIP: phar->is_zip = 1; break; default: phar->is_data = 0; break; } zend_hash_init(&(phar->manifest), sizeof(phar_entry_info), zend_get_hash_value, destroy_phar_manifest_entry, 0); zend_hash_init(&phar->mounted_dirs, sizeof(char *), zend_get_hash_value, NULL, 0); zend_hash_init(&phar->virtual_dirs, sizeof(char *), zend_get_hash_value, NULL, 0); phar->fp = php_stream_fopen_tmpfile(); if (phar->fp == NULL) { zend_throw_exception_ex(phar_ce_PharException, 0 TSRMLS_CC, "unable to create temporary file"); return NULL; } phar->fname = source->fname; phar->fname_len = source->fname_len; phar->is_temporary_alias = source->is_temporary_alias; phar->alias = source->alias; if (source->metadata) { zval *t; t = source->metadata; ALLOC_ZVAL(phar->metadata); *phar->metadata = *t; zval_copy_ctor(phar->metadata); Z_SET_REFCOUNT_P(phar->metadata, 1); phar->metadata_len = 0; } /* first copy each file's uncompressed contents to a temporary file and set per-file flags */ for (zend_hash_internal_pointer_reset(&source->manifest); SUCCESS == zend_hash_has_more_elements(&source->manifest); zend_hash_move_forward(&source->manifest)) { if (FAILURE == zend_hash_get_current_data(&source->manifest, (void **) &entry)) { zend_hash_destroy(&(phar->manifest)); php_stream_close(phar->fp); efree(phar); zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC, "Cannot convert phar archive \"%s\"", source->fname); return NULL; } newentry = *entry; if (newentry.link) { newentry.link = estrdup(newentry.link); goto no_copy; } if (newentry.tmp) { newentry.tmp = estrdup(newentry.tmp); goto no_copy; } newentry.metadata_str.c = 0; if (FAILURE == phar_copy_file_contents(&newentry, phar->fp TSRMLS_CC)) { zend_hash_destroy(&(phar->manifest)); php_stream_close(phar->fp); efree(phar); /* exception already thrown */ return NULL; } no_copy: newentry.filename = estrndup(newentry.filename, newentry.filename_len); if (newentry.metadata) { zval *t; t = newentry.metadata; ALLOC_ZVAL(newentry.metadata); *newentry.metadata = *t; zval_copy_ctor(newentry.metadata); Z_SET_REFCOUNT_P(newentry.metadata, 1); newentry.metadata_str.c = NULL; newentry.metadata_str.len = 0; } newentry.is_zip = phar->is_zip; newentry.is_tar = phar->is_tar; if (newentry.is_tar) { newentry.tar_type = (entry->is_dir ? TAR_DIR : TAR_FILE); } newentry.is_modified = 1; newentry.phar = phar; newentry.old_flags = newentry.flags & ~PHAR_ENT_COMPRESSION_MASK; /* remove compression from old_flags */ phar_set_inode(&newentry TSRMLS_CC); zend_hash_add(&(phar->manifest), newentry.filename, newentry.filename_len, (void*)&newentry, sizeof(phar_entry_info), NULL); phar_add_virtual_dirs(phar, newentry.filename, newentry.filename_len TSRMLS_CC); } if ((ret = phar_rename_archive(phar, ext, 0 TSRMLS_CC))) { return ret; } else { zend_hash_destroy(&(phar->manifest)); zend_hash_destroy(&(phar->mounted_dirs)); zend_hash_destroy(&(phar->virtual_dirs)); php_stream_close(phar->fp); efree(phar->fname); efree(phar); return NULL; } } /* }}} */
static zval *phar_convert_to_other(phar_archive_data *source, int convert, char *ext, php_uint32 flags TSRMLS_DC) /* {{{ */ { phar_archive_data *phar; phar_entry_info *entry, newentry; zval *ret; /* invalidate phar cache */ PHAR_G(last_phar) = NULL; PHAR_G(last_phar_name) = PHAR_G(last_alias) = NULL; phar = (phar_archive_data *) ecalloc(1, sizeof(phar_archive_data)); /* set whole-archive compression and type from parameter */ phar->flags = flags; phar->is_data = source->is_data; switch (convert) { case PHAR_FORMAT_TAR: phar->is_tar = 1; break; case PHAR_FORMAT_ZIP: phar->is_zip = 1; break; default: phar->is_data = 0; break; } zend_hash_init(&(phar->manifest), sizeof(phar_entry_info), zend_get_hash_value, destroy_phar_manifest_entry, 0); zend_hash_init(&phar->mounted_dirs, sizeof(char *), zend_get_hash_value, NULL, 0); zend_hash_init(&phar->virtual_dirs, sizeof(char *), zend_get_hash_value, NULL, 0); phar->fp = php_stream_fopen_tmpfile(); if (phar->fp == NULL) { zend_throw_exception_ex(phar_ce_PharException, 0 TSRMLS_CC, "unable to create temporary file"); return NULL; } phar->fname = source->fname; phar->fname_len = source->fname_len; phar->is_temporary_alias = source->is_temporary_alias; phar->alias = source->alias; if (source->metadata) { zval *t; t = source->metadata; ALLOC_ZVAL(phar->metadata); *phar->metadata = *t; zval_copy_ctor(phar->metadata); Z_SET_REFCOUNT_P(phar->metadata, 1); phar->metadata_len = 0; } /* first copy each file's uncompressed contents to a temporary file and set per-file flags */ for (zend_hash_internal_pointer_reset(&source->manifest); SUCCESS == zend_hash_has_more_elements(&source->manifest); zend_hash_move_forward(&source->manifest)) { if (FAILURE == zend_hash_get_current_data(&source->manifest, (void **) &entry)) { zend_hash_destroy(&(phar->manifest)); php_stream_close(phar->fp); efree(phar); zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC, "Cannot convert phar archive \"%s\"", source->fname); return NULL; } newentry = *entry; if (newentry.link) { newentry.link = estrdup(newentry.link); goto no_copy; } if (newentry.tmp) { newentry.tmp = estrdup(newentry.tmp); goto no_copy; } newentry.metadata_str.c = 0; if (FAILURE == phar_copy_file_contents(&newentry, phar->fp TSRMLS_CC)) { zend_hash_destroy(&(phar->manifest)); php_stream_close(phar->fp); efree(phar); /* exception already thrown */ return NULL; } no_copy: newentry.filename = estrndup(newentry.filename, newentry.filename_len); if (newentry.metadata) { zval *t; t = newentry.metadata; ALLOC_ZVAL(newentry.metadata); *newentry.metadata = *t; zval_copy_ctor(newentry.metadata); Z_SET_REFCOUNT_P(newentry.metadata, 1); newentry.metadata_str.c = NULL; newentry.metadata_str.len = 0; } newentry.is_zip = phar->is_zip; newentry.is_tar = phar->is_tar; if (newentry.is_tar) { newentry.tar_type = (entry->is_dir ? TAR_DIR : TAR_FILE); } newentry.is_modified = 1; newentry.phar = phar; newentry.old_flags = newentry.flags & ~PHAR_ENT_COMPRESSION_MASK; /* remove compression from old_flags */ phar_set_inode(&newentry TSRMLS_CC); zend_hash_add(&(phar->manifest), newentry.filename, newentry.filename_len, (void*)&newentry, sizeof(phar_entry_info), NULL); phar_add_virtual_dirs(phar, newentry.filename, newentry.filename_len TSRMLS_CC); } if ((ret = phar_rename_archive(phar, ext, 0 TSRMLS_CC))) { return ret; } else { zend_hash_destroy(&(phar->manifest)); zend_hash_destroy(&(phar->mounted_dirs)); zend_hash_destroy(&(phar->virtual_dirs)); php_stream_close(phar->fp); efree(phar->fname); efree(phar); return NULL; } } /* }}} */
C
php
0
CVE-2014-8109
https://www.cvedetails.com/cve/CVE-2014-8109/
CWE-264
https://github.com/apache/httpd/commit/3f1693d558d0758f829c8b53993f1749ddf6ffcb
3f1693d558d0758f829c8b53993f1749ddf6ffcb
Merge r1642499 from trunk: *) SECURITY: CVE-2014-8109 (cve.mitre.org) mod_lua: Fix handling of the Require line when a LuaAuthzProvider is used in multiple Require directives with different arguments. PR57204 [Edward Lu <Chaosed0 gmail.com>] Submitted By: Edward Lu Committed By: covener Submitted by: covener Reviewed/backported by: jim git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1642861 13f79535-47bb-0310-9956-ffa450edef68
static int lua_post_config(apr_pool_t *pconf, apr_pool_t *plog, apr_pool_t *ptemp, server_rec *s) { apr_pool_t **pool; const char *tempdir; apr_status_t rs; lua_ssl_val = APR_RETRIEVE_OPTIONAL_FN(ssl_var_lookup); lua_ssl_is_https = APR_RETRIEVE_OPTIONAL_FN(ssl_is_https); if (ap_state_query(AP_SQ_MAIN_STATE) == AP_SQ_MS_CREATE_PRE_CONFIG) return OK; /* Create ivm mutex */ rs = ap_global_mutex_create(&lua_ivm_mutex, NULL, "lua-ivm-shm", NULL, s, pconf, 0); if (APR_SUCCESS != rs) { return HTTP_INTERNAL_SERVER_ERROR; } /* Create shared memory space */ rs = apr_temp_dir_get(&tempdir, pconf); if (rs != APR_SUCCESS) { ap_log_error(APLOG_MARK, APLOG_ERR, rs, s, APLOGNO(02664) "mod_lua IVM: Failed to find temporary directory"); return HTTP_INTERNAL_SERVER_ERROR; } lua_ivm_shmfile = apr_psprintf(pconf, "%s/httpd_lua_shm.%ld", tempdir, (long int)getpid()); rs = apr_shm_create(&lua_ivm_shm, sizeof(apr_pool_t**), (const char *) lua_ivm_shmfile, pconf); if (rs != APR_SUCCESS) { ap_log_error(APLOG_MARK, APLOG_ERR, rs, s, APLOGNO(02665) "mod_lua: Failed to create shared memory segment on file %s", lua_ivm_shmfile); return HTTP_INTERNAL_SERVER_ERROR; } pool = (apr_pool_t **)apr_shm_baseaddr_get(lua_ivm_shm); apr_pool_create(pool, pconf); apr_pool_cleanup_register(pconf, NULL, shm_cleanup_wrapper, apr_pool_cleanup_null); return OK; }
static int lua_post_config(apr_pool_t *pconf, apr_pool_t *plog, apr_pool_t *ptemp, server_rec *s) { apr_pool_t **pool; const char *tempdir; apr_status_t rs; lua_ssl_val = APR_RETRIEVE_OPTIONAL_FN(ssl_var_lookup); lua_ssl_is_https = APR_RETRIEVE_OPTIONAL_FN(ssl_is_https); if (ap_state_query(AP_SQ_MAIN_STATE) == AP_SQ_MS_CREATE_PRE_CONFIG) return OK; /* Create ivm mutex */ rs = ap_global_mutex_create(&lua_ivm_mutex, NULL, "lua-ivm-shm", NULL, s, pconf, 0); if (APR_SUCCESS != rs) { return HTTP_INTERNAL_SERVER_ERROR; } /* Create shared memory space */ rs = apr_temp_dir_get(&tempdir, pconf); if (rs != APR_SUCCESS) { ap_log_error(APLOG_MARK, APLOG_ERR, rs, s, APLOGNO(02664) "mod_lua IVM: Failed to find temporary directory"); return HTTP_INTERNAL_SERVER_ERROR; } lua_ivm_shmfile = apr_psprintf(pconf, "%s/httpd_lua_shm.%ld", tempdir, (long int)getpid()); rs = apr_shm_create(&lua_ivm_shm, sizeof(apr_pool_t**), (const char *) lua_ivm_shmfile, pconf); if (rs != APR_SUCCESS) { ap_log_error(APLOG_MARK, APLOG_ERR, rs, s, APLOGNO(02665) "mod_lua: Failed to create shared memory segment on file %s", lua_ivm_shmfile); return HTTP_INTERNAL_SERVER_ERROR; } pool = (apr_pool_t **)apr_shm_baseaddr_get(lua_ivm_shm); apr_pool_create(pool, pconf); apr_pool_cleanup_register(pconf, NULL, shm_cleanup_wrapper, apr_pool_cleanup_null); return OK; }
C
httpd
0
CVE-2012-2744
https://www.cvedetails.com/cve/CVE-2012-2744/
null
https://github.com/torvalds/linux/commit/9e2dcf72023d1447f09c47d77c99b0c49659e5ce
9e2dcf72023d1447f09c47d77c99b0c49659e5ce
netfilter: nf_conntrack_reasm: properly handle packets fragmented into a single fragment When an ICMPV6_PKT_TOOBIG message is received with a MTU below 1280, all further packets include a fragment header. Unlike regular defragmentation, conntrack also needs to "reassemble" those fragments in order to obtain a packet without the fragment header for connection tracking. Currently nf_conntrack_reasm checks whether a fragment has either IP6_MF set or an offset != 0, which makes it ignore those fragments. Remove the invalid check and make reassembly handle fragment queues containing only a single fragment. Reported-and-tested-by: Ulrich Weber <[email protected]> Signed-off-by: Patrick McHardy <[email protected]>
static int nf_ct_frag6_queue(struct nf_ct_frag6_queue *fq, struct sk_buff *skb, const struct frag_hdr *fhdr, int nhoff) { struct sk_buff *prev, *next; int offset, end; if (fq->q.last_in & INET_FRAG_COMPLETE) { pr_debug("Allready completed\n"); goto err; } offset = ntohs(fhdr->frag_off) & ~0x7; end = offset + (ntohs(ipv6_hdr(skb)->payload_len) - ((u8 *)(fhdr + 1) - (u8 *)(ipv6_hdr(skb) + 1))); if ((unsigned int)end > IPV6_MAXPLEN) { pr_debug("offset is too large.\n"); return -1; } if (skb->ip_summed == CHECKSUM_COMPLETE) { const unsigned char *nh = skb_network_header(skb); skb->csum = csum_sub(skb->csum, csum_partial(nh, (u8 *)(fhdr + 1) - nh, 0)); } /* Is this the final fragment? */ if (!(fhdr->frag_off & htons(IP6_MF))) { /* If we already have some bits beyond end * or have different end, the segment is corrupted. */ if (end < fq->q.len || ((fq->q.last_in & INET_FRAG_LAST_IN) && end != fq->q.len)) { pr_debug("already received last fragment\n"); goto err; } fq->q.last_in |= INET_FRAG_LAST_IN; fq->q.len = end; } else { /* Check if the fragment is rounded to 8 bytes. * Required by the RFC. */ if (end & 0x7) { /* RFC2460 says always send parameter problem in * this case. -DaveM */ pr_debug("end of fragment not rounded to 8 bytes.\n"); return -1; } if (end > fq->q.len) { /* Some bits beyond end -> corruption. */ if (fq->q.last_in & INET_FRAG_LAST_IN) { pr_debug("last packet already reached.\n"); goto err; } fq->q.len = end; } } if (end == offset) goto err; /* Point into the IP datagram 'data' part. */ if (!pskb_pull(skb, (u8 *) (fhdr + 1) - skb->data)) { pr_debug("queue: message is too short.\n"); goto err; } if (pskb_trim_rcsum(skb, end - offset)) { pr_debug("Can't trim\n"); goto err; } /* Find out which fragments are in front and at the back of us * in the chain of fragments so far. We must know where to put * this fragment, right? */ prev = NULL; for (next = fq->q.fragments; next != NULL; next = next->next) { if (NFCT_FRAG6_CB(next)->offset >= offset) break; /* bingo! */ prev = next; } /* We found where to put this one. Check for overlap with * preceding fragment, and, if needed, align things so that * any overlaps are eliminated. */ if (prev) { int i = (NFCT_FRAG6_CB(prev)->offset + prev->len) - offset; if (i > 0) { offset += i; if (end <= offset) { pr_debug("overlap\n"); goto err; } if (!pskb_pull(skb, i)) { pr_debug("Can't pull\n"); goto err; } if (skb->ip_summed != CHECKSUM_UNNECESSARY) skb->ip_summed = CHECKSUM_NONE; } } /* Look for overlap with succeeding segments. * If we can merge fragments, do it. */ while (next && NFCT_FRAG6_CB(next)->offset < end) { /* overlap is 'i' bytes */ int i = end - NFCT_FRAG6_CB(next)->offset; if (i < next->len) { /* Eat head of the next overlapped fragment * and leave the loop. The next ones cannot overlap. */ pr_debug("Eat head of the overlapped parts.: %d", i); if (!pskb_pull(next, i)) goto err; /* next fragment */ NFCT_FRAG6_CB(next)->offset += i; fq->q.meat -= i; if (next->ip_summed != CHECKSUM_UNNECESSARY) next->ip_summed = CHECKSUM_NONE; break; } else { struct sk_buff *free_it = next; /* Old fragmnet is completely overridden with * new one drop it. */ next = next->next; if (prev) prev->next = next; else fq->q.fragments = next; fq->q.meat -= free_it->len; frag_kfree_skb(free_it, NULL); } } NFCT_FRAG6_CB(skb)->offset = offset; /* Insert this fragment in the chain of fragments. */ skb->next = next; if (prev) prev->next = skb; else fq->q.fragments = skb; skb->dev = NULL; fq->q.stamp = skb->tstamp; fq->q.meat += skb->len; atomic_add(skb->truesize, &nf_init_frags.mem); /* The first fragment. * nhoffset is obtained from the first fragment, of course. */ if (offset == 0) { fq->nhoffset = nhoff; fq->q.last_in |= INET_FRAG_FIRST_IN; } write_lock(&nf_frags.lock); list_move_tail(&fq->q.lru_list, &nf_init_frags.lru_list); write_unlock(&nf_frags.lock); return 0; err: return -1; }
static int nf_ct_frag6_queue(struct nf_ct_frag6_queue *fq, struct sk_buff *skb, const struct frag_hdr *fhdr, int nhoff) { struct sk_buff *prev, *next; int offset, end; if (fq->q.last_in & INET_FRAG_COMPLETE) { pr_debug("Allready completed\n"); goto err; } offset = ntohs(fhdr->frag_off) & ~0x7; end = offset + (ntohs(ipv6_hdr(skb)->payload_len) - ((u8 *)(fhdr + 1) - (u8 *)(ipv6_hdr(skb) + 1))); if ((unsigned int)end > IPV6_MAXPLEN) { pr_debug("offset is too large.\n"); return -1; } if (skb->ip_summed == CHECKSUM_COMPLETE) { const unsigned char *nh = skb_network_header(skb); skb->csum = csum_sub(skb->csum, csum_partial(nh, (u8 *)(fhdr + 1) - nh, 0)); } /* Is this the final fragment? */ if (!(fhdr->frag_off & htons(IP6_MF))) { /* If we already have some bits beyond end * or have different end, the segment is corrupted. */ if (end < fq->q.len || ((fq->q.last_in & INET_FRAG_LAST_IN) && end != fq->q.len)) { pr_debug("already received last fragment\n"); goto err; } fq->q.last_in |= INET_FRAG_LAST_IN; fq->q.len = end; } else { /* Check if the fragment is rounded to 8 bytes. * Required by the RFC. */ if (end & 0x7) { /* RFC2460 says always send parameter problem in * this case. -DaveM */ pr_debug("end of fragment not rounded to 8 bytes.\n"); return -1; } if (end > fq->q.len) { /* Some bits beyond end -> corruption. */ if (fq->q.last_in & INET_FRAG_LAST_IN) { pr_debug("last packet already reached.\n"); goto err; } fq->q.len = end; } } if (end == offset) goto err; /* Point into the IP datagram 'data' part. */ if (!pskb_pull(skb, (u8 *) (fhdr + 1) - skb->data)) { pr_debug("queue: message is too short.\n"); goto err; } if (pskb_trim_rcsum(skb, end - offset)) { pr_debug("Can't trim\n"); goto err; } /* Find out which fragments are in front and at the back of us * in the chain of fragments so far. We must know where to put * this fragment, right? */ prev = NULL; for (next = fq->q.fragments; next != NULL; next = next->next) { if (NFCT_FRAG6_CB(next)->offset >= offset) break; /* bingo! */ prev = next; } /* We found where to put this one. Check for overlap with * preceding fragment, and, if needed, align things so that * any overlaps are eliminated. */ if (prev) { int i = (NFCT_FRAG6_CB(prev)->offset + prev->len) - offset; if (i > 0) { offset += i; if (end <= offset) { pr_debug("overlap\n"); goto err; } if (!pskb_pull(skb, i)) { pr_debug("Can't pull\n"); goto err; } if (skb->ip_summed != CHECKSUM_UNNECESSARY) skb->ip_summed = CHECKSUM_NONE; } } /* Look for overlap with succeeding segments. * If we can merge fragments, do it. */ while (next && NFCT_FRAG6_CB(next)->offset < end) { /* overlap is 'i' bytes */ int i = end - NFCT_FRAG6_CB(next)->offset; if (i < next->len) { /* Eat head of the next overlapped fragment * and leave the loop. The next ones cannot overlap. */ pr_debug("Eat head of the overlapped parts.: %d", i); if (!pskb_pull(next, i)) goto err; /* next fragment */ NFCT_FRAG6_CB(next)->offset += i; fq->q.meat -= i; if (next->ip_summed != CHECKSUM_UNNECESSARY) next->ip_summed = CHECKSUM_NONE; break; } else { struct sk_buff *free_it = next; /* Old fragmnet is completely overridden with * new one drop it. */ next = next->next; if (prev) prev->next = next; else fq->q.fragments = next; fq->q.meat -= free_it->len; frag_kfree_skb(free_it, NULL); } } NFCT_FRAG6_CB(skb)->offset = offset; /* Insert this fragment in the chain of fragments. */ skb->next = next; if (prev) prev->next = skb; else fq->q.fragments = skb; skb->dev = NULL; fq->q.stamp = skb->tstamp; fq->q.meat += skb->len; atomic_add(skb->truesize, &nf_init_frags.mem); /* The first fragment. * nhoffset is obtained from the first fragment, of course. */ if (offset == 0) { fq->nhoffset = nhoff; fq->q.last_in |= INET_FRAG_FIRST_IN; } write_lock(&nf_frags.lock); list_move_tail(&fq->q.lru_list, &nf_init_frags.lru_list); write_unlock(&nf_frags.lock); return 0; err: return -1; }
C
linux
0
CVE-2012-3520
https://www.cvedetails.com/cve/CVE-2012-3520/
CWE-287
https://github.com/torvalds/linux/commit/e0e3cea46d31d23dc40df0a49a7a2c04fe8edfea
e0e3cea46d31d23dc40df0a49a7a2c04fe8edfea
af_netlink: force credentials passing [CVE-2012-3520] Pablo Neira Ayuso discovered that avahi and potentially NetworkManager accept spoofed Netlink messages because of a kernel bug. The kernel passes all-zero SCM_CREDENTIALS ancillary data to the receiver if the sender did not provide such data, instead of not including any such data at all or including the correct data from the peer (as it is the case with AF_UNIX). This bug was introduced in commit 16e572626961 (af_unix: dont send SCM_CREDENTIALS by default) This patch forces passing credentials for netlink, as before the regression. Another fix would be to not add SCM_CREDENTIALS in netlink messages if not provided by the sender, but it might break some programs. With help from Florian Weimer & Petr Matousek This issue is designated as CVE-2012-3520 Signed-off-by: Eric Dumazet <[email protected]> Cc: Petr Matousek <[email protected]> Cc: Florian Weimer <[email protected]> Cc: Pablo Neira Ayuso <[email protected]> Signed-off-by: David S. Miller <[email protected]>
void netlink_ack(struct sk_buff *in_skb, struct nlmsghdr *nlh, int err) { struct sk_buff *skb; struct nlmsghdr *rep; struct nlmsgerr *errmsg; size_t payload = sizeof(*errmsg); /* error messages get the original request appened */ if (err) payload += nlmsg_len(nlh); skb = nlmsg_new(payload, GFP_KERNEL); if (!skb) { struct sock *sk; sk = netlink_lookup(sock_net(in_skb->sk), in_skb->sk->sk_protocol, NETLINK_CB(in_skb).pid); if (sk) { sk->sk_err = ENOBUFS; sk->sk_error_report(sk); sock_put(sk); } return; } rep = __nlmsg_put(skb, NETLINK_CB(in_skb).pid, nlh->nlmsg_seq, NLMSG_ERROR, payload, 0); errmsg = nlmsg_data(rep); errmsg->error = err; memcpy(&errmsg->msg, nlh, err ? nlh->nlmsg_len : sizeof(*nlh)); netlink_unicast(in_skb->sk, skb, NETLINK_CB(in_skb).pid, MSG_DONTWAIT); }
void netlink_ack(struct sk_buff *in_skb, struct nlmsghdr *nlh, int err) { struct sk_buff *skb; struct nlmsghdr *rep; struct nlmsgerr *errmsg; size_t payload = sizeof(*errmsg); /* error messages get the original request appened */ if (err) payload += nlmsg_len(nlh); skb = nlmsg_new(payload, GFP_KERNEL); if (!skb) { struct sock *sk; sk = netlink_lookup(sock_net(in_skb->sk), in_skb->sk->sk_protocol, NETLINK_CB(in_skb).pid); if (sk) { sk->sk_err = ENOBUFS; sk->sk_error_report(sk); sock_put(sk); } return; } rep = __nlmsg_put(skb, NETLINK_CB(in_skb).pid, nlh->nlmsg_seq, NLMSG_ERROR, payload, 0); errmsg = nlmsg_data(rep); errmsg->error = err; memcpy(&errmsg->msg, nlh, err ? nlh->nlmsg_len : sizeof(*nlh)); netlink_unicast(in_skb->sk, skb, NETLINK_CB(in_skb).pid, MSG_DONTWAIT); }
C
linux
0
CVE-2014-1715
https://www.cvedetails.com/cve/CVE-2014-1715/
CWE-22
https://github.com/chromium/chromium/commit/ce70785c73a2b7cf2b34de0d8439ca31929b4743
ce70785c73a2b7cf2b34de0d8439ca31929b4743
Consistently check if a block can handle pagination strut propagation. https://codereview.chromium.org/1360753002 got it right for inline child layout, but did nothing for block child layout. BUG=329421 [email protected],[email protected] Review URL: https://codereview.chromium.org/1387553002 Cr-Commit-Position: refs/heads/master@{#352429}
static bool inNormalFlow(LayoutBox* child) { LayoutBlock* curr = child->containingBlock(); LayoutView* layoutView = child->view(); while (curr && curr != layoutView) { if (curr->isLayoutFlowThread()) return true; if (curr->isFloatingOrOutOfFlowPositioned()) return false; curr = curr->containingBlock(); } return true; }
static bool inNormalFlow(LayoutBox* child) { LayoutBlock* curr = child->containingBlock(); LayoutView* layoutView = child->view(); while (curr && curr != layoutView) { if (curr->isLayoutFlowThread()) return true; if (curr->isFloatingOrOutOfFlowPositioned()) return false; curr = curr->containingBlock(); } return true; }
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 chksum_update(struct shash_desc *desc, const u8 *data, unsigned int length) { struct chksum_desc_ctx *ctx = shash_desc_ctx(desc); ctx->crc = crc_t10dif_generic(ctx->crc, data, length); return 0; }
static int chksum_update(struct shash_desc *desc, const u8 *data, unsigned int length) { struct chksum_desc_ctx *ctx = shash_desc_ctx(desc); ctx->crc = crc_t10dif_generic(ctx->crc, data, length); return 0; }
C
linux
0
CVE-2015-1196
https://www.cvedetails.com/cve/CVE-2015-1196/
CWE-59
https://git.savannah.gnu.org/cgit/patch.git/commit/?id=4e9269a5fc1fe80a1095a92593dd85db871e1fd3
4e9269a5fc1fe80a1095a92593dd85db871e1fd3
null
static inline struct timespec pch_timestamp (bool which) { return p_timestamp[which]; }
static inline struct timespec pch_timestamp (bool which) { return p_timestamp[which]; }
C
savannah
0
CVE-2016-2496
https://www.cvedetails.com/cve/CVE-2016-2496/
CWE-264
https://android.googlesource.com/platform/frameworks/native/+/03a53d1c7765eeb3af0bc34c3dff02ada1953fbf
03a53d1c7765eeb3af0bc34c3dff02ada1953fbf
Add new MotionEvent flag for partially obscured windows. Due to more complex window layouts resulting in lots of overlapping windows, the policy around FLAG_WINDOW_IS_OBSCURED has changed to only be set when the point at which the window was touched is obscured. Unfortunately, this doesn't prevent tapjacking attacks that overlay the dialog's text, making a potentially dangerous operation seem innocuous. To avoid this on particularly sensitive dialogs, introduce a new flag that really does tell you when your window is being even partially overlapped. We aren't exposing this as API since we plan on making the original flag more robust. This is really a workaround for system dialogs since we generally know their layout and screen position, and that they're unlikely to be overlapped by other applications. Bug: 26677796 Change-Id: I9e336afe90f262ba22015876769a9c510048fd47
ssize_t InputDispatcher::InputState::findKeyMemento(const KeyEntry* entry) const { for (size_t i = 0; i < mKeyMementos.size(); i++) { const KeyMemento& memento = mKeyMementos.itemAt(i); if (memento.deviceId == entry->deviceId && memento.source == entry->source && memento.keyCode == entry->keyCode && memento.scanCode == entry->scanCode) { return i; } } return -1; }
ssize_t InputDispatcher::InputState::findKeyMemento(const KeyEntry* entry) const { for (size_t i = 0; i < mKeyMementos.size(); i++) { const KeyMemento& memento = mKeyMementos.itemAt(i); if (memento.deviceId == entry->deviceId && memento.source == entry->source && memento.keyCode == entry->keyCode && memento.scanCode == entry->scanCode) { return i; } } return -1; }
C
Android
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 longMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); TestObjectV8Internal::longMethodMethod(info); TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); }
static void longMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); TestObjectV8Internal::longMethodMethod(info); TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); }
C
Chrome
0
CVE-2012-2816
https://www.cvedetails.com/cve/CVE-2012-2816/
null
https://github.com/chromium/chromium/commit/cd0bd79d6ebdb72183e6f0833673464cc10b3600
cd0bd79d6ebdb72183e6f0833673464cc10b3600
Convert plugin and GPU process to brokered handle duplication. BUG=119250 Review URL: https://chromiumcodereview.appspot.com/9958034 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@132303 0039d316-1c4b-4281-b951-d872f2087c98
void WebPluginDelegateProxy::ImeCompositionCompleted(const string16& text, int plugin_id) { if (instance_id_ != plugin_id) return; IPC::Message* msg = new PluginMsg_ImeCompositionCompleted(instance_id_, text); msg->set_unblock(true); Send(msg); }
void WebPluginDelegateProxy::ImeCompositionCompleted(const string16& text, int plugin_id) { if (instance_id_ != plugin_id) return; IPC::Message* msg = new PluginMsg_ImeCompositionCompleted(instance_id_, text); msg->set_unblock(true); Send(msg); }
C
Chrome
0
CVE-2012-2867
https://www.cvedetails.com/cve/CVE-2012-2867/
null
https://github.com/chromium/chromium/commit/b7a161633fd7ecb59093c2c56ed908416292d778
b7a161633fd7ecb59093c2c56ed908416292d778
[GTK][WTR] Implement AccessibilityUIElement::stringValue https://bugs.webkit.org/show_bug.cgi?id=102951 Reviewed by Martin Robinson. Implement AccessibilityUIElement::stringValue in the ATK backend in the same manner it is implemented in DumpRenderTree. * WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp: (WTR::replaceCharactersForResults): (WTR): (WTR::AccessibilityUIElement::stringValue): git-svn-id: svn://svn.chromium.org/blink/trunk@135485 bbb929c8-8fbe-4397-9dbb-9b2b20218538
PassRefPtr<AccessibilityUIElement> AccessibilityUIElement::selectedChildAtIndex(unsigned index) const { return 0; }
PassRefPtr<AccessibilityUIElement> AccessibilityUIElement::selectedChildAtIndex(unsigned index) const { return 0; }
C
Chrome
0
CVE-2016-7969
https://www.cvedetails.com/cve/CVE-2016-7969/
CWE-125
https://github.com/libass/libass/pull/240/commits/b72b283b936a600c730e00875d7d067bded3fc26
b72b283b936a600c730e00875d7d067bded3fc26
Fix line wrapping mode 0/3 bugs This fixes two separate bugs: a) Don't move a linebreak into the first symbol. This results in a empty line at the front, which does not help to equalize line lengths at all. b) When moving a linebreak into a symbol that already is a break, the number of lines must be decremented. Otherwise, uninitialized memory is possibly used for later layout operations. Found by fuzzer test case id:000085,sig:11,src:003377+003350,op:splice,rep:8.
ASS_Image *ass_render_frame(ASS_Renderer *priv, ASS_Track *track, long long now, int *detect_change) { int i, cnt, rc; EventImages *last; ASS_Image **tail; rc = ass_start_frame(priv, track, now); if (rc != 0) { if (detect_change) { *detect_change = 2; } return NULL; } cnt = 0; for (i = 0; i < track->n_events; ++i) { ASS_Event *event = track->events + i; if ((event->Start <= now) && (now < (event->Start + event->Duration))) { if (cnt >= priv->eimg_size) { priv->eimg_size += 100; priv->eimg = realloc(priv->eimg, priv->eimg_size * sizeof(EventImages)); } rc = ass_render_event(priv, event, priv->eimg + cnt); if (!rc) ++cnt; } } qsort(priv->eimg, cnt, sizeof(EventImages), cmp_event_layer); last = priv->eimg; for (i = 1; i < cnt; ++i) if (last->event->Layer != priv->eimg[i].event->Layer) { fix_collisions(priv, last, priv->eimg + i - last); last = priv->eimg + i; } if (cnt > 0) fix_collisions(priv, last, priv->eimg + cnt - last); tail = &priv->images_root; for (i = 0; i < cnt; ++i) { ASS_Image *cur = priv->eimg[i].imgs; while (cur) { *tail = cur; tail = &cur->next; cur = cur->next; } } ass_frame_ref(priv->images_root); if (detect_change) *detect_change = ass_detect_change(priv); ass_frame_unref(priv->prev_images_root); priv->prev_images_root = NULL; return priv->images_root; }
ASS_Image *ass_render_frame(ASS_Renderer *priv, ASS_Track *track, long long now, int *detect_change) { int i, cnt, rc; EventImages *last; ASS_Image **tail; rc = ass_start_frame(priv, track, now); if (rc != 0) { if (detect_change) { *detect_change = 2; } return NULL; } cnt = 0; for (i = 0; i < track->n_events; ++i) { ASS_Event *event = track->events + i; if ((event->Start <= now) && (now < (event->Start + event->Duration))) { if (cnt >= priv->eimg_size) { priv->eimg_size += 100; priv->eimg = realloc(priv->eimg, priv->eimg_size * sizeof(EventImages)); } rc = ass_render_event(priv, event, priv->eimg + cnt); if (!rc) ++cnt; } } qsort(priv->eimg, cnt, sizeof(EventImages), cmp_event_layer); last = priv->eimg; for (i = 1; i < cnt; ++i) if (last->event->Layer != priv->eimg[i].event->Layer) { fix_collisions(priv, last, priv->eimg + i - last); last = priv->eimg + i; } if (cnt > 0) fix_collisions(priv, last, priv->eimg + cnt - last); tail = &priv->images_root; for (i = 0; i < cnt; ++i) { ASS_Image *cur = priv->eimg[i].imgs; while (cur) { *tail = cur; tail = &cur->next; cur = cur->next; } } ass_frame_ref(priv->images_root); if (detect_change) *detect_change = ass_detect_change(priv); ass_frame_unref(priv->prev_images_root); priv->prev_images_root = NULL; return priv->images_root; }
C
libass
0
CVE-2014-0196
https://www.cvedetails.com/cve/CVE-2014-0196/
CWE-362
https://github.com/torvalds/linux/commit/4291086b1f081b869c6d79e5b7441633dc3ace00
4291086b1f081b869c6d79e5b7441633dc3ace00
n_tty: Fix n_tty_write crash when echoing in raw mode The tty atomic_write_lock does not provide an exclusion guarantee for the tty driver if the termios settings are LECHO & !OPOST. And since it is unexpected and not allowed to call TTY buffer helpers like tty_insert_flip_string concurrently, this may lead to crashes when concurrect writers call pty_write. In that case the following two writers: * the ECHOing from a workqueue and * pty_write from the process race and can overflow the corresponding TTY buffer like follows. If we look into tty_insert_flip_string_fixed_flag, there is: int space = __tty_buffer_request_room(port, goal, flags); struct tty_buffer *tb = port->buf.tail; ... memcpy(char_buf_ptr(tb, tb->used), chars, space); ... tb->used += space; so the race of the two can result in something like this: A B __tty_buffer_request_room __tty_buffer_request_room memcpy(buf(tb->used), ...) tb->used += space; memcpy(buf(tb->used), ...) ->BOOM B's memcpy is past the tty_buffer due to the previous A's tb->used increment. Since the N_TTY line discipline input processing can output concurrently with a tty write, obtain the N_TTY ldisc output_lock to serialize echo output with normal tty writes. This ensures the tty buffer helper tty_insert_flip_string is not called concurrently and everything is fine. Note that this is nicely reproducible by an ordinary user using forkpty and some setup around that (raw termios + ECHO). And it is present in kernels at least after commit d945cb9cce20ac7143c2de8d88b187f62db99bdc (pty: Rework the pty layer to use the normal buffering logic) in 2.6.31-rc3. js: add more info to the commit log js: switch to bool js: lock unconditionally js: lock only the tty->ops->write call References: CVE-2014-0196 Reported-and-tested-by: Jiri Slaby <[email protected]> Signed-off-by: Peter Hurley <[email protected]> Signed-off-by: Jiri Slaby <[email protected]> Cc: Linus Torvalds <[email protected]> Cc: Alan Cox <[email protected]> Cc: <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
n_tty_receive_buf_raw(struct tty_struct *tty, const unsigned char *cp, char *fp, int count) { struct n_tty_data *ldata = tty->disc_data; char flag = TTY_NORMAL; while (count--) { if (fp) flag = *fp++; if (likely(flag == TTY_NORMAL)) put_tty_queue(*cp++, ldata); else n_tty_receive_char_flagged(tty, *cp++, flag); } }
n_tty_receive_buf_raw(struct tty_struct *tty, const unsigned char *cp, char *fp, int count) { struct n_tty_data *ldata = tty->disc_data; char flag = TTY_NORMAL; while (count--) { if (fp) flag = *fp++; if (likely(flag == TTY_NORMAL)) put_tty_queue(*cp++, ldata); else n_tty_receive_char_flagged(tty, *cp++, flag); } }
C
linux
0
CVE-2013-4118
https://www.cvedetails.com/cve/CVE-2013-4118/
CWE-476
https://github.com/FreeRDP/FreeRDP/commit/7d58aac24fe20ffaad7bd9b40c9ddf457c1b06e7
7d58aac24fe20ffaad7bd9b40c9ddf457c1b06e7
security: add a NULL pointer check to fix a server crash.
BOOL rdp_send_data_pdu(rdpRdp* rdp, STREAM* s, BYTE type, UINT16 channel_id) { UINT16 length; UINT32 sec_bytes; BYTE* sec_hold; length = stream_get_length(s); stream_set_pos(s, 0); rdp_write_header(rdp, s, length, MCS_GLOBAL_CHANNEL_ID); sec_bytes = rdp_get_sec_bytes(rdp); sec_hold = s->p; stream_seek(s, sec_bytes); rdp_write_share_control_header(s, length - sec_bytes, PDU_TYPE_DATA, channel_id); rdp_write_share_data_header(s, length - sec_bytes, type, rdp->settings->ShareId); s->p = sec_hold; length += rdp_security_stream_out(rdp, s, length); stream_set_pos(s, length); if (transport_write(rdp->transport, s) < 0) return FALSE; return TRUE; }
BOOL rdp_send_data_pdu(rdpRdp* rdp, STREAM* s, BYTE type, UINT16 channel_id) { UINT16 length; UINT32 sec_bytes; BYTE* sec_hold; length = stream_get_length(s); stream_set_pos(s, 0); rdp_write_header(rdp, s, length, MCS_GLOBAL_CHANNEL_ID); sec_bytes = rdp_get_sec_bytes(rdp); sec_hold = s->p; stream_seek(s, sec_bytes); rdp_write_share_control_header(s, length - sec_bytes, PDU_TYPE_DATA, channel_id); rdp_write_share_data_header(s, length - sec_bytes, type, rdp->settings->ShareId); s->p = sec_hold; length += rdp_security_stream_out(rdp, s, length); stream_set_pos(s, length); if (transport_write(rdp->transport, s) < 0) return FALSE; return TRUE; }
C
FreeRDP
0
CVE-2018-20065
https://www.cvedetails.com/cve/CVE-2018-20065/
CWE-20
https://github.com/chromium/chromium/commit/33b9b0262029fea75c436229f9bdfe74b1937ad2
33b9b0262029fea75c436229f9bdfe74b1937ad2
Change TemporaryAddressSpoof test to not depend on PDF OpenActions. OpenActions that navigate to URIs are going to be blocked when https://pdfium-review.googlesource.com/c/pdfium/+/42731 relands. It was reverted because this test was breaking and blocking the pdfium roll into chromium. The test will now click on a link in the PDF that navigates to the URI. Bug: 851821 Change-Id: I49853e99de7b989858b1962ad4a92a4168d4c2db Reviewed-on: https://chromium-review.googlesource.com/c/1244367 Commit-Queue: Henrique Nakashima <[email protected]> Reviewed-by: Charlie Reis <[email protected]> Reviewed-by: Devlin <[email protected]> Cr-Commit-Position: refs/heads/master@{#596011}
std::string RunCreateWindowExpectError(const std::string& args) { scoped_refptr<WindowsCreateFunction> function(new WindowsCreateFunction); function->set_extension(ExtensionBuilder("Test").Build().get()); return api_test_utils::RunFunctionAndReturnError(function.get(), args, browser()->profile()); }
std::string RunCreateWindowExpectError(const std::string& args) { scoped_refptr<WindowsCreateFunction> function(new WindowsCreateFunction); function->set_extension(ExtensionBuilder("Test").Build().get()); return api_test_utils::RunFunctionAndReturnError(function.get(), args, browser()->profile()); }
C
Chrome
0
CVE-2016-3839
https://www.cvedetails.com/cve/CVE-2016-3839/
CWE-284
https://android.googlesource.com/platform/system/bt/+/472271b153c5dc53c28beac55480a8d8434b2d5c
472271b153c5dc53c28beac55480a8d8434b2d5c
DO NOT MERGE Fix potential DoS caused by delivering signal to BT process Bug: 28885210 Change-Id: I63866d894bfca47464d6e42e3fb0357c4f94d360 Conflicts: btif/co/bta_hh_co.c btif/src/btif_core.c Merge conflict resolution of ag/1161415 (referencing ag/1164670) - Directly into mnc-mr2-release
static int adev_set_mode(struct audio_hw_device *dev, int mode) { UNUSED(dev); UNUSED(mode); FNLOG(); return 0; }
static int adev_set_mode(struct audio_hw_device *dev, int mode) { UNUSED(dev); UNUSED(mode); FNLOG(); return 0; }
C
Android
0
CVE-2017-5847
https://www.cvedetails.com/cve/CVE-2017-5847/
CWE-125
https://github.com/GStreamer/gst-plugins-ugly/commit/d21017b52a585f145e8d62781bcc1c5fefc7ee37
d21017b52a585f145e8d62781bcc1c5fefc7ee37
asfdemux: Check that we have enough data available before parsing bool/uint extended content descriptors https://bugzilla.gnome.org/show_bug.cgi?id=777955
gst_asf_demux_class_init (GstASFDemuxClass * klass) { GstElementClass *gstelement_class; gstelement_class = (GstElementClass *) klass; gst_element_class_set_static_metadata (gstelement_class, "ASF Demuxer", "Codec/Demuxer", "Demultiplexes ASF Streams", "Owen Fraser-Green <[email protected]>"); gst_element_class_add_static_pad_template (gstelement_class, &audio_src_template); gst_element_class_add_static_pad_template (gstelement_class, &video_src_template); gst_element_class_add_static_pad_template (gstelement_class, &gst_asf_demux_sink_template); gstelement_class->change_state = GST_DEBUG_FUNCPTR (gst_asf_demux_change_state); gstelement_class->send_event = GST_DEBUG_FUNCPTR (gst_asf_demux_element_send_event); }
gst_asf_demux_class_init (GstASFDemuxClass * klass) { GstElementClass *gstelement_class; gstelement_class = (GstElementClass *) klass; gst_element_class_set_static_metadata (gstelement_class, "ASF Demuxer", "Codec/Demuxer", "Demultiplexes ASF Streams", "Owen Fraser-Green <[email protected]>"); gst_element_class_add_static_pad_template (gstelement_class, &audio_src_template); gst_element_class_add_static_pad_template (gstelement_class, &video_src_template); gst_element_class_add_static_pad_template (gstelement_class, &gst_asf_demux_sink_template); gstelement_class->change_state = GST_DEBUG_FUNCPTR (gst_asf_demux_change_state); gstelement_class->send_event = GST_DEBUG_FUNCPTR (gst_asf_demux_element_send_event); }
C
gst-plugins-ugly
0
CVE-2016-9588
https://www.cvedetails.com/cve/CVE-2016-9588/
CWE-388
https://github.com/torvalds/linux/commit/ef85b67385436ddc1998f45f1d6a210f935b3388
ef85b67385436ddc1998f45f1d6a210f935b3388
kvm: nVMX: Allow L1 to intercept software exceptions (#BP and #OF) When L2 exits to L0 due to "exception or NMI", software exceptions (#BP and #OF) for which L1 has requested an intercept should be handled by L1 rather than L0. Previously, only hardware exceptions were forwarded to L1. Signed-off-by: Jim Mattson <[email protected]> Cc: [email protected] Signed-off-by: Paolo Bonzini <[email protected]>
static inline bool vmx_feature_control_msr_valid(struct kvm_vcpu *vcpu, uint64_t val) { uint64_t valid_bits = to_vmx(vcpu)->msr_ia32_feature_control_valid_bits; return !(val & ~valid_bits); }
static inline bool vmx_feature_control_msr_valid(struct kvm_vcpu *vcpu, uint64_t val) { uint64_t valid_bits = to_vmx(vcpu)->msr_ia32_feature_control_valid_bits; return !(val & ~valid_bits); }
C
linux
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
ModuleExport void UnregisterJPEGImage(void) { (void) UnregisterMagickInfo("PJPG"); (void) UnregisterMagickInfo("JPS"); (void) UnregisterMagickInfo("JPG"); (void) UnregisterMagickInfo("JPEG"); (void) UnregisterMagickInfo("JPE"); }
ModuleExport void UnregisterJPEGImage(void) { (void) UnregisterMagickInfo("PJPG"); (void) UnregisterMagickInfo("JPS"); (void) UnregisterMagickInfo("JPG"); (void) UnregisterMagickInfo("JPEG"); (void) UnregisterMagickInfo("JPE"); }
C
ImageMagick
0
CVE-2017-16612
https://www.cvedetails.com/cve/CVE-2017-16612/
CWE-190
https://cgit.freedesktop.org/xorg/lib/libXcursor/commit/?id=4794b5dd34688158fb51a2943032569d3780c4b8
4794b5dd34688158fb51a2943032569d3780c4b8
null
XcursorXcFileLoad (XcursorFile *file, XcursorComments **commentsp, XcursorImages **imagesp) { XcursorFileHeader *fileHeader; int nimage; int ncomment; XcursorImages *images; XcursorImage *image; XcursorComment *comment; XcursorComments *comments; int toc; if (!file) return 0; fileHeader = _XcursorReadFileHeader (file); if (!fileHeader) return 0; nimage = 0; ncomment = 0; for (toc = 0; toc < fileHeader->ntoc; toc++) { switch (fileHeader->tocs[toc].type) { case XCURSOR_COMMENT_TYPE: ncomment++; break; case XCURSOR_IMAGE_TYPE: nimage++; break; } } images = XcursorImagesCreate (nimage); if (!images) return 0; comments = XcursorCommentsCreate (ncomment); if (!comments) { XcursorImagesDestroy (images); return 0; } for (toc = 0; toc < fileHeader->ntoc; toc++) { switch (fileHeader->tocs[toc].type) { case XCURSOR_COMMENT_TYPE: comment = _XcursorReadComment (file, fileHeader, toc); if (comment) { comments->comments[comments->ncomment] = comment; comments->ncomment++; } break; case XCURSOR_IMAGE_TYPE: image = _XcursorReadImage (file, fileHeader, toc); if (image) { images->images[images->nimage] = image; images->nimage++; } break; } } _XcursorFileHeaderDestroy (fileHeader); if (images->nimage != nimage || comments->ncomment != ncomment) { XcursorImagesDestroy (images); XcursorCommentsDestroy (comments); images = NULL; comments = NULL; return XcursorFalse; } *imagesp = images; *commentsp = comments; return XcursorTrue; }
XcursorXcFileLoad (XcursorFile *file, XcursorComments **commentsp, XcursorImages **imagesp) { XcursorFileHeader *fileHeader; int nimage; int ncomment; XcursorImages *images; XcursorImage *image; XcursorComment *comment; XcursorComments *comments; int toc; if (!file) return 0; fileHeader = _XcursorReadFileHeader (file); if (!fileHeader) return 0; nimage = 0; ncomment = 0; for (toc = 0; toc < fileHeader->ntoc; toc++) { switch (fileHeader->tocs[toc].type) { case XCURSOR_COMMENT_TYPE: ncomment++; break; case XCURSOR_IMAGE_TYPE: nimage++; break; } } images = XcursorImagesCreate (nimage); if (!images) return 0; comments = XcursorCommentsCreate (ncomment); if (!comments) { XcursorImagesDestroy (images); return 0; } for (toc = 0; toc < fileHeader->ntoc; toc++) { switch (fileHeader->tocs[toc].type) { case XCURSOR_COMMENT_TYPE: comment = _XcursorReadComment (file, fileHeader, toc); if (comment) { comments->comments[comments->ncomment] = comment; comments->ncomment++; } break; case XCURSOR_IMAGE_TYPE: image = _XcursorReadImage (file, fileHeader, toc); if (image) { images->images[images->nimage] = image; images->nimage++; } break; } } _XcursorFileHeaderDestroy (fileHeader); if (images->nimage != nimage || comments->ncomment != ncomment) { XcursorImagesDestroy (images); XcursorCommentsDestroy (comments); images = NULL; comments = NULL; return XcursorFalse; } *imagesp = images; *commentsp = comments; return XcursorTrue; }
C
xcursor
0
CVE-2018-11232
https://www.cvedetails.com/cve/CVE-2018-11232/
CWE-20
https://github.com/torvalds/linux/commit/f09444639099584bc4784dfcd85ada67c6f33e0f
f09444639099584bc4784dfcd85ada67c6f33e0f
coresight: fix kernel panic caused by invalid CPU Commit d52c9750f150 ("coresight: reset "enable_sink" flag when need be") caused a kernel panic because of the using of an invalid value: after 'for_each_cpu(cpu, mask)', value of local variable 'cpu' become invalid, causes following 'cpu_to_node' access invalid memory area. This patch brings the deleted 'cpu = cpumask_first(mask)' back. Panic log: $ perf record -e cs_etm// ls Unable to handle kernel paging request at virtual address fffe801804af4f10 pgd = ffff8017ce031600 [fffe801804af4f10] *pgd=0000000000000000, *pud=0000000000000000 Internal error: Oops: 96000004 [#1] SMP Modules linked in: CPU: 33 PID: 1619 Comm: perf Not tainted 4.7.1+ #16 Hardware name: Huawei Taishan 2280 /CH05TEVBA, BIOS 1.10 11/24/2016 task: ffff8017cb0c8400 ti: ffff8017cb154000 task.ti: ffff8017cb154000 PC is at tmc_alloc_etf_buffer+0x60/0xd4 LR is at tmc_alloc_etf_buffer+0x44/0xd4 pc : [<ffff000008633df8>] lr : [<ffff000008633ddc>] pstate: 60000145 sp : ffff8017cb157b40 x29: ffff8017cb157b40 x28: 0000000000000000 ...skip... 7a60: ffff000008c64dc8 0000000000000006 0000000000000253 ffffffffffffffff 7a80: 0000000000000000 0000000000000000 ffff0000080872cc 0000000000000001 [<ffff000008633df8>] tmc_alloc_etf_buffer+0x60/0xd4 [<ffff000008632b9c>] etm_setup_aux+0x1dc/0x1e8 [<ffff00000816eed4>] rb_alloc_aux+0x2b0/0x338 [<ffff00000816a5e4>] perf_mmap+0x414/0x568 [<ffff0000081ab694>] mmap_region+0x324/0x544 [<ffff0000081abbe8>] do_mmap+0x334/0x3e0 [<ffff000008191150>] vm_mmap_pgoff+0xa4/0xc8 [<ffff0000081a9a30>] SyS_mmap_pgoff+0xb0/0x22c [<ffff0000080872e4>] sys_mmap+0x18/0x28 [<ffff0000080843f0>] el0_svc_naked+0x24/0x28 Code: 912040a5 d0001c00 f873d821 911c6000 (b8656822) ---[ end trace 98933da8f92b0c9a ]--- Signed-off-by: Wang Nan <[email protected]> Cc: Xia Kaixu <[email protected]> Cc: Li Zefan <[email protected]> Cc: Mathieu Poirier <[email protected]> Cc: [email protected] Cc: [email protected] Fixes: d52c9750f150 ("coresight: reset "enable_sink" flag when need be") Signed-off-by: Mathieu Poirier <[email protected]> Cc: stable <[email protected]> # 4.10 Signed-off-by: Greg Kroah-Hartman <[email protected]>
static void etm_event_destroy(struct perf_event *event) { kfree(event->hw.addr_filters); event->hw.addr_filters = NULL; }
static void etm_event_destroy(struct perf_event *event) { kfree(event->hw.addr_filters); event->hw.addr_filters = NULL; }
C
linux
0
CVE-2017-5023
https://www.cvedetails.com/cve/CVE-2017-5023/
CWE-476
https://github.com/chromium/chromium/commit/03c2e97746a2c471ae136b0c669f8d0c033fe168
03c2e97746a2c471ae136b0c669f8d0c033fe168
Convert DCHECKs to CHECKs for histogram types When a histogram is looked up by name, there is currently a DCHECK that verifies the type of the stored histogram matches the expected type. A mismatch represents a significant problem because the returned HistogramBase is cast to a Histogram in ValidateRangeChecksum, potentially causing a crash. This CL converts the DCHECK to a CHECK to prevent the possibility of type confusion in release builds. BUG=651443 [email protected] Review-Url: https://codereview.chromium.org/2381893003 Cr-Commit-Position: refs/heads/master@{#421929}
Factory(const std::string& name, const std::vector<Sample>* custom_ranges, int32_t flags) : Histogram::Factory(name, CUSTOM_HISTOGRAM, 0, 0, 0, flags) { custom_ranges_ = custom_ranges; }
Factory(const std::string& name, const std::vector<Sample>* custom_ranges, int32_t flags) : Histogram::Factory(name, CUSTOM_HISTOGRAM, 0, 0, 0, flags) { custom_ranges_ = custom_ranges; }
C
Chrome
0
CVE-2014-8481
https://www.cvedetails.com/cve/CVE-2014-8481/
CWE-399
https://github.com/torvalds/linux/commit/a430c9166312e1aa3d80bce32374233bdbfeba32
a430c9166312e1aa3d80bce32374233bdbfeba32
KVM: emulate: avoid accessing NULL ctxt->memopp A failure to decode the instruction can cause a NULL pointer access. This is fixed simply by moving the "done" label as close as possible to the return. This fixes CVE-2014-8481. Reported-by: Andy Lutomirski <[email protected]> Cc: [email protected] Fixes: 41061cdb98a0bec464278b4db8e894a3121671f5 Signed-off-by: Paolo Bonzini <[email protected]>
static int em_bswap(struct x86_emulate_ctxt *ctxt) { switch (ctxt->op_bytes) { #ifdef CONFIG_X86_64 case 8: asm("bswap %0" : "+r"(ctxt->dst.val)); break; #endif default: asm("bswap %0" : "+r"(*(u32 *)&ctxt->dst.val)); break; } return X86EMUL_CONTINUE; }
static int em_bswap(struct x86_emulate_ctxt *ctxt) { switch (ctxt->op_bytes) { #ifdef CONFIG_X86_64 case 8: asm("bswap %0" : "+r"(ctxt->dst.val)); break; #endif default: asm("bswap %0" : "+r"(*(u32 *)&ctxt->dst.val)); break; } return X86EMUL_CONTINUE; }
C
linux
0
CVE-2014-3610
https://www.cvedetails.com/cve/CVE-2014-3610/
CWE-264
https://github.com/torvalds/linux/commit/854e8bb1aa06c578c2c9145fa6bfe3680ef63b23
854e8bb1aa06c578c2c9145fa6bfe3680ef63b23
KVM: x86: Check non-canonical addresses upon WRMSR Upon WRMSR, the CPU should inject #GP if a non-canonical value (address) is written to certain MSRs. The behavior is "almost" identical for AMD and Intel (ignoring MSRs that are not implemented in either architecture since they would anyhow #GP). However, IA32_SYSENTER_ESP and IA32_SYSENTER_EIP cause #GP if non-canonical address is written on Intel but not on AMD (which ignores the top 32-bits). Accordingly, this patch injects a #GP on the MSRs which behave identically on Intel and AMD. To eliminate the differences between the architecutres, the value which is written to IA32_SYSENTER_ESP and IA32_SYSENTER_EIP is turned to canonical value before writing instead of injecting a #GP. Some references from Intel and AMD manuals: According to Intel SDM description of WRMSR instruction #GP is expected on WRMSR "If the source register contains a non-canonical address and ECX specifies one of the following MSRs: IA32_DS_AREA, IA32_FS_BASE, IA32_GS_BASE, IA32_KERNEL_GS_BASE, IA32_LSTAR, IA32_SYSENTER_EIP, IA32_SYSENTER_ESP." According to AMD manual instruction manual: LSTAR/CSTAR (SYSCALL): "The WRMSR instruction loads the target RIP into the LSTAR and CSTAR registers. If an RIP written by WRMSR is not in canonical form, a general-protection exception (#GP) occurs." IA32_GS_BASE and IA32_FS_BASE (WRFSBASE/WRGSBASE): "The address written to the base field must be in canonical form or a #GP fault will occur." IA32_KERNEL_GS_BASE (SWAPGS): "The address stored in the KernelGSbase MSR must be in canonical form." This patch fixes CVE-2014-3610. Cc: [email protected] Signed-off-by: Nadav Amit <[email protected]> Signed-off-by: Paolo Bonzini <[email protected]>
static void svm_set_interrupt_shadow(struct kvm_vcpu *vcpu, int mask) { struct vcpu_svm *svm = to_svm(vcpu); if (mask == 0) svm->vmcb->control.int_state &= ~SVM_INTERRUPT_SHADOW_MASK; else svm->vmcb->control.int_state |= SVM_INTERRUPT_SHADOW_MASK; }
static void svm_set_interrupt_shadow(struct kvm_vcpu *vcpu, int mask) { struct vcpu_svm *svm = to_svm(vcpu); if (mask == 0) svm->vmcb->control.int_state &= ~SVM_INTERRUPT_SHADOW_MASK; else svm->vmcb->control.int_state |= SVM_INTERRUPT_SHADOW_MASK; }
C
linux
0
CVE-2012-2900
https://www.cvedetails.com/cve/CVE-2012-2900/
null
https://github.com/chromium/chromium/commit/9597042cad54926f50d58f5ada39205eb734d7be
9597042cad54926f50d58f5ada39205eb734d7be
Revert 137988 - VAVDA is the hardware video decode accelerator for Chrome on Linux and ChromeOS for Intel CPUs (Sandy Bridge and newer). This CL enables VAVDA acceleration for ChromeOS, both for HTML5 video and Flash. The feature is currently hidden behind a command line flag and can be enabled by adding the --enable-vaapi parameter to command line. BUG=117062 TEST=Manual runs of test streams. Change-Id: I386e16739e2ef2230f52a0a434971b33d8654699 Review URL: https://chromiumcodereview.appspot.com/9814001 This is causing crbug.com/129103 [email protected] Review URL: https://chromiumcodereview.appspot.com/10411066 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@138208 0039d316-1c4b-4281-b951-d872f2087c98
GpuProcessHost::SurfaceRef::~SurfaceRef() { BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, base::Bind(&ReleasePermanentXIDDispatcher, surface_)); }
GpuProcessHost::SurfaceRef::~SurfaceRef() { BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, base::Bind(&ReleasePermanentXIDDispatcher, surface_)); }
C
Chrome
0
CVE-2011-3234
https://www.cvedetails.com/cve/CVE-2011-3234/
CWE-119
https://github.com/chromium/chromium/commit/52dac009556881941c60d378e34867cdb2fd00a0
52dac009556881941c60d378e34867cdb2fd00a0
Coverity: Add a missing NULL check. BUG=none TEST=none CID=16813 Review URL: http://codereview.chromium.org/7216034 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@89991 0039d316-1c4b-4281-b951-d872f2087c98
bool ExtensionPrefs::ReadExtensionPrefBoolean( const std::string& extension_id, const std::string& pref_key) { const DictionaryValue* ext = GetExtensionPref(extension_id); if (!ext) { return false; } return ReadBooleanFromPref(ext, pref_key); }
bool ExtensionPrefs::ReadExtensionPrefBoolean( const std::string& extension_id, const std::string& pref_key) { const DictionaryValue* ext = GetExtensionPref(extension_id); if (!ext) { return false; } return ReadBooleanFromPref(ext, pref_key); }
C
Chrome
0
CVE-2017-0380
https://www.cvedetails.com/cve/CVE-2017-0380/
CWE-532
https://github.com/torproject/tor/commit/09ea89764a4d3a907808ed7d4fe42abfe64bd486
09ea89764a4d3a907808ed7d4fe42abfe64bd486
Fix log-uninitialized-stack bug in rend_service_intro_established. Fixes bug 23490; bugfix on 0.2.7.2-alpha. TROVE-2017-008 CVE-2017-0380
rend_service_del_ephemeral(const char *service_id) { rend_service_t *s; if (!rend_valid_service_id(service_id)) { log_warn(LD_CONFIG, "Requested malformed Onion Service id for removal."); return -1; } if ((s = rend_service_get_by_service_id(service_id)) == NULL) { log_warn(LD_CONFIG, "Requested non-existent Onion Service id for " "removal."); return -1; } if (!rend_service_is_ephemeral(s)) { log_warn(LD_CONFIG, "Requested non-ephemeral Onion Service for removal."); return -1; } /* Kill the intro point circuit for the Onion Service, and remove it from * the list. Closing existing connections is the application's problem. * * XXX: As with the comment in rend_config_services(), a nice abstraction * would be ideal here, but for now just duplicate the code. */ SMARTLIST_FOREACH_BEGIN(circuit_get_global_list(), circuit_t *, circ) { if (!circ->marked_for_close && (circ->purpose == CIRCUIT_PURPOSE_S_ESTABLISH_INTRO || circ->purpose == CIRCUIT_PURPOSE_S_INTRO)) { origin_circuit_t *oc = TO_ORIGIN_CIRCUIT(circ); tor_assert(oc->rend_data); if (!rend_circuit_pk_digest_eq(oc, (uint8_t *) s->pk_digest)) { continue; } log_debug(LD_REND, "Closing intro point %s for service %s.", safe_str_client(extend_info_describe( oc->build_state->chosen_exit)), rend_data_get_address(oc->rend_data)); circuit_mark_for_close(circ, END_CIRC_REASON_FINISHED); } } SMARTLIST_FOREACH_END(circ); smartlist_remove(rend_service_list, s); rend_service_free(s); log_debug(LD_CONFIG, "Removed ephemeral Onion Service: %s", service_id); return 0; }
rend_service_del_ephemeral(const char *service_id) { rend_service_t *s; if (!rend_valid_service_id(service_id)) { log_warn(LD_CONFIG, "Requested malformed Onion Service id for removal."); return -1; } if ((s = rend_service_get_by_service_id(service_id)) == NULL) { log_warn(LD_CONFIG, "Requested non-existent Onion Service id for " "removal."); return -1; } if (!rend_service_is_ephemeral(s)) { log_warn(LD_CONFIG, "Requested non-ephemeral Onion Service for removal."); return -1; } /* Kill the intro point circuit for the Onion Service, and remove it from * the list. Closing existing connections is the application's problem. * * XXX: As with the comment in rend_config_services(), a nice abstraction * would be ideal here, but for now just duplicate the code. */ SMARTLIST_FOREACH_BEGIN(circuit_get_global_list(), circuit_t *, circ) { if (!circ->marked_for_close && (circ->purpose == CIRCUIT_PURPOSE_S_ESTABLISH_INTRO || circ->purpose == CIRCUIT_PURPOSE_S_INTRO)) { origin_circuit_t *oc = TO_ORIGIN_CIRCUIT(circ); tor_assert(oc->rend_data); if (!rend_circuit_pk_digest_eq(oc, (uint8_t *) s->pk_digest)) { continue; } log_debug(LD_REND, "Closing intro point %s for service %s.", safe_str_client(extend_info_describe( oc->build_state->chosen_exit)), rend_data_get_address(oc->rend_data)); circuit_mark_for_close(circ, END_CIRC_REASON_FINISHED); } } SMARTLIST_FOREACH_END(circ); smartlist_remove(rend_service_list, s); rend_service_free(s); log_debug(LD_CONFIG, "Removed ephemeral Onion Service: %s", service_id); return 0; }
C
tor
0
CVE-2010-1149
https://www.cvedetails.com/cve/CVE-2010-1149/
CWE-200
https://cgit.freedesktop.org/udisks/commit/?id=0fcc7cb3b66f23fac53ae08647aa0007a2bd56c4
0fcc7cb3b66f23fac53ae08647aa0007a2bd56c4
null
filesystem_create_wait_for_luks_device_not_seen_cb (gpointer user_data) { MkfsLuksData *data = user_data; throw_error (data->context, ERROR_FAILED, "Error creating luks encrypted file system: timeout (10s) waiting for luks device to show up"); g_signal_handler_disconnect (data->device->priv->daemon, data->device_changed_signal_handler_id); mkfse_data_unref (data); return FALSE; }
filesystem_create_wait_for_luks_device_not_seen_cb (gpointer user_data) { MkfsLuksData *data = user_data; throw_error (data->context, ERROR_FAILED, "Error creating luks encrypted file system: timeout (10s) waiting for luks device to show up"); g_signal_handler_disconnect (data->device->priv->daemon, data->device_changed_signal_handler_id); mkfse_data_unref (data); return FALSE; }
C
udisks
0
CVE-2017-7533
https://www.cvedetails.com/cve/CVE-2017-7533/
CWE-362
https://github.com/torvalds/linux/commit/49d31c2f389acfe83417083e1208422b4091cd9e
49d31c2f389acfe83417083e1208422b4091cd9e
dentry name snapshots take_dentry_name_snapshot() takes a safe snapshot of dentry name; if the name is a short one, it gets copied into caller-supplied structure, otherwise an extra reference to external name is grabbed (those are never modified). In either case the pointer to stable string is stored into the same structure. dentry must be held by the caller of take_dentry_name_snapshot(), but may be freely dropped afterwards - the snapshot will stay until destroyed by release_dentry_name_snapshot(). Intended use: struct name_snapshot s; take_dentry_name_snapshot(&s, dentry); ... access s.name ... release_dentry_name_snapshot(&s); Replaces fsnotify_oldname_...(), gets used in fsnotify to obtain the name to pass down with event. Signed-off-by: Al Viro <[email protected]>
void d_invalidate(struct dentry *dentry) { /* * If it's already been dropped, return OK. */ spin_lock(&dentry->d_lock); if (d_unhashed(dentry)) { spin_unlock(&dentry->d_lock); return; } spin_unlock(&dentry->d_lock); /* Negative dentries can be dropped without further checks */ if (!dentry->d_inode) { d_drop(dentry); return; } for (;;) { struct detach_data data; data.mountpoint = NULL; INIT_LIST_HEAD(&data.select.dispose); data.select.start = dentry; data.select.found = 0; d_walk(dentry, &data, detach_and_collect, check_and_drop); if (!list_empty(&data.select.dispose)) shrink_dentry_list(&data.select.dispose); else if (!data.mountpoint) return; if (data.mountpoint) { detach_mounts(data.mountpoint); dput(data.mountpoint); } cond_resched(); } }
void d_invalidate(struct dentry *dentry) { /* * If it's already been dropped, return OK. */ spin_lock(&dentry->d_lock); if (d_unhashed(dentry)) { spin_unlock(&dentry->d_lock); return; } spin_unlock(&dentry->d_lock); /* Negative dentries can be dropped without further checks */ if (!dentry->d_inode) { d_drop(dentry); return; } for (;;) { struct detach_data data; data.mountpoint = NULL; INIT_LIST_HEAD(&data.select.dispose); data.select.start = dentry; data.select.found = 0; d_walk(dentry, &data, detach_and_collect, check_and_drop); if (!list_empty(&data.select.dispose)) shrink_dentry_list(&data.select.dispose); else if (!data.mountpoint) return; if (data.mountpoint) { detach_mounts(data.mountpoint); dput(data.mountpoint); } cond_resched(); } }
C
linux
0
CVE-2016-2476
https://www.cvedetails.com/cve/CVE-2016-2476/
CWE-119
https://android.googlesource.com/platform/frameworks/av/+/94d9e646454f6246bf823b6897bd6aea5f08eda3
94d9e646454f6246bf823b6897bd6aea5f08eda3
Fix initialization of AAC presentation struct Otherwise the new size checks trip on this. Bug: 27207275 Change-Id: I1f8f01097e3a88ff041b69279a6121be842f1766
bool ACodec::FlushingState::onOMXEvent( OMX_EVENTTYPE event, OMX_U32 data1, OMX_U32 data2) { ALOGV("[%s] FlushingState onOMXEvent(%u,%d)", mCodec->mComponentName.c_str(), event, (OMX_S32)data1); switch (event) { case OMX_EventCmdComplete: { if (data1 != (OMX_U32)OMX_CommandFlush) { ALOGE("unexpected EventCmdComplete %s(%d) data2:%d in FlushingState", asString((OMX_COMMANDTYPE)data1), data1, data2); mCodec->signalError(OMX_ErrorUndefined, FAILED_TRANSACTION); return true; } if (data2 == kPortIndexInput || data2 == kPortIndexOutput) { if (mFlushComplete[data2]) { ALOGW("Flush already completed for %s port", data2 == kPortIndexInput ? "input" : "output"); return true; } mFlushComplete[data2] = true; if (mFlushComplete[kPortIndexInput] && mFlushComplete[kPortIndexOutput]) { changeStateIfWeOwnAllBuffers(); } } else if (data2 == OMX_ALL) { if (!mFlushComplete[kPortIndexInput] || !mFlushComplete[kPortIndexOutput]) { ALOGW("received flush complete event for OMX_ALL before ports have been" "flushed (%d/%d)", mFlushComplete[kPortIndexInput], mFlushComplete[kPortIndexOutput]); return false; } changeStateIfWeOwnAllBuffers(); } else { ALOGW("data2 not OMX_ALL but %u in EventCmdComplete CommandFlush", data2); } return true; } case OMX_EventPortSettingsChanged: { sp<AMessage> msg = new AMessage(kWhatOMXMessage, mCodec); msg->setInt32("type", omx_message::EVENT); msg->setInt32("node", mCodec->mNode); msg->setInt32("event", event); msg->setInt32("data1", data1); msg->setInt32("data2", data2); ALOGV("[%s] Deferring OMX_EventPortSettingsChanged", mCodec->mComponentName.c_str()); mCodec->deferMessage(msg); return true; } default: return BaseState::onOMXEvent(event, data1, data2); } return true; }
bool ACodec::FlushingState::onOMXEvent( OMX_EVENTTYPE event, OMX_U32 data1, OMX_U32 data2) { ALOGV("[%s] FlushingState onOMXEvent(%u,%d)", mCodec->mComponentName.c_str(), event, (OMX_S32)data1); switch (event) { case OMX_EventCmdComplete: { if (data1 != (OMX_U32)OMX_CommandFlush) { ALOGE("unexpected EventCmdComplete %s(%d) data2:%d in FlushingState", asString((OMX_COMMANDTYPE)data1), data1, data2); mCodec->signalError(OMX_ErrorUndefined, FAILED_TRANSACTION); return true; } if (data2 == kPortIndexInput || data2 == kPortIndexOutput) { if (mFlushComplete[data2]) { ALOGW("Flush already completed for %s port", data2 == kPortIndexInput ? "input" : "output"); return true; } mFlushComplete[data2] = true; if (mFlushComplete[kPortIndexInput] && mFlushComplete[kPortIndexOutput]) { changeStateIfWeOwnAllBuffers(); } } else if (data2 == OMX_ALL) { if (!mFlushComplete[kPortIndexInput] || !mFlushComplete[kPortIndexOutput]) { ALOGW("received flush complete event for OMX_ALL before ports have been" "flushed (%d/%d)", mFlushComplete[kPortIndexInput], mFlushComplete[kPortIndexOutput]); return false; } changeStateIfWeOwnAllBuffers(); } else { ALOGW("data2 not OMX_ALL but %u in EventCmdComplete CommandFlush", data2); } return true; } case OMX_EventPortSettingsChanged: { sp<AMessage> msg = new AMessage(kWhatOMXMessage, mCodec); msg->setInt32("type", omx_message::EVENT); msg->setInt32("node", mCodec->mNode); msg->setInt32("event", event); msg->setInt32("data1", data1); msg->setInt32("data2", data2); ALOGV("[%s] Deferring OMX_EventPortSettingsChanged", mCodec->mComponentName.c_str()); mCodec->deferMessage(msg); return true; } default: return BaseState::onOMXEvent(event, data1, data2); } return true; }
C
Android
0
CVE-2019-7308
https://www.cvedetails.com/cve/CVE-2019-7308/
CWE-189
https://github.com/torvalds/linux/commit/d3bd7413e0ca40b60cf60d4003246d067cafdeda
d3bd7413e0ca40b60cf60d4003246d067cafdeda
bpf: fix sanitation of alu op with pointer / scalar type from different paths While 979d63d50c0c ("bpf: prevent out of bounds speculation on pointer arithmetic") took care of rejecting alu op on pointer when e.g. pointer came from two different map values with different map properties such as value size, Jann reported that a case was not covered yet when a given alu op is used in both "ptr_reg += reg" and "numeric_reg += reg" from different branches where we would incorrectly try to sanitize based on the pointer's limit. Catch this corner case and reject the program instead. Fixes: 979d63d50c0c ("bpf: prevent out of bounds speculation on pointer arithmetic") Reported-by: Jann Horn <[email protected]> Signed-off-by: Daniel Borkmann <[email protected]> Acked-by: Alexei Starovoitov <[email protected]> Signed-off-by: Alexei Starovoitov <[email protected]>
static int retrieve_ptr_limit(const struct bpf_reg_state *ptr_reg, u32 *ptr_limit, u8 opcode, bool off_is_neg) { bool mask_to_left = (opcode == BPF_ADD && off_is_neg) || (opcode == BPF_SUB && !off_is_neg); u32 off; switch (ptr_reg->type) { case PTR_TO_STACK: off = ptr_reg->off + ptr_reg->var_off.value; if (mask_to_left) *ptr_limit = MAX_BPF_STACK + off; else *ptr_limit = -off; return 0; case PTR_TO_MAP_VALUE: if (mask_to_left) { *ptr_limit = ptr_reg->umax_value + ptr_reg->off; } else { off = ptr_reg->smin_value + ptr_reg->off; *ptr_limit = ptr_reg->map_ptr->value_size - off; } return 0; default: return -EINVAL; } }
static int retrieve_ptr_limit(const struct bpf_reg_state *ptr_reg, u32 *ptr_limit, u8 opcode, bool off_is_neg) { bool mask_to_left = (opcode == BPF_ADD && off_is_neg) || (opcode == BPF_SUB && !off_is_neg); u32 off; switch (ptr_reg->type) { case PTR_TO_STACK: off = ptr_reg->off + ptr_reg->var_off.value; if (mask_to_left) *ptr_limit = MAX_BPF_STACK + off; else *ptr_limit = -off; return 0; case PTR_TO_MAP_VALUE: if (mask_to_left) { *ptr_limit = ptr_reg->umax_value + ptr_reg->off; } else { off = ptr_reg->smin_value + ptr_reg->off; *ptr_limit = ptr_reg->map_ptr->value_size - off; } return 0; default: return -EINVAL; } }
C
linux
0
CVE-2015-5366
https://www.cvedetails.com/cve/CVE-2015-5366/
CWE-399
https://github.com/torvalds/linux/commit/beb39db59d14990e401e235faf66a6b9b31240b0
beb39db59d14990e401e235faf66a6b9b31240b0
udp: fix behavior of wrong checksums We have two problems in UDP stack related to bogus checksums : 1) We return -EAGAIN to application even if receive queue is not empty. This breaks applications using edge trigger epoll() 2) Under UDP flood, we can loop forever without yielding to other processes, potentially hanging the host, especially on non SMP. This patch is an attempt to make things better. We might in the future add extra support for rt applications wanting to better control time spent doing a recv() in a hostile environment. For example we could validate checksums before queuing packets in socket receive queue. Signed-off-by: Eric Dumazet <[email protected]> Cc: Willem de Bruijn <[email protected]> Signed-off-by: David S. Miller <[email protected]>
static int udp_v6_push_pending_frames(struct sock *sk) { struct sk_buff *skb; struct udp_sock *up = udp_sk(sk); struct flowi6 fl6; int err = 0; if (up->pending == AF_INET) return udp_push_pending_frames(sk); /* ip6_finish_skb will release the cork, so make a copy of * fl6 here. */ fl6 = inet_sk(sk)->cork.fl.u.ip6; skb = ip6_finish_skb(sk); if (!skb) goto out; err = udp_v6_send_skb(skb, &fl6); out: up->len = 0; up->pending = 0; return err; }
static int udp_v6_push_pending_frames(struct sock *sk) { struct sk_buff *skb; struct udp_sock *up = udp_sk(sk); struct flowi6 fl6; int err = 0; if (up->pending == AF_INET) return udp_push_pending_frames(sk); /* ip6_finish_skb will release the cork, so make a copy of * fl6 here. */ fl6 = inet_sk(sk)->cork.fl.u.ip6; skb = ip6_finish_skb(sk); if (!skb) goto out; err = udp_v6_send_skb(skb, &fl6); out: up->len = 0; up->pending = 0; return err; }
C
linux
0
CVE-2011-2350
https://www.cvedetails.com/cve/CVE-2011-2350/
CWE-20
https://github.com/chromium/chromium/commit/b944f670bb7a8a919daac497a4ea0536c954c201
b944f670bb7a8a919daac497a4ea0536c954c201
[JSC] Implement a helper method createNotEnoughArgumentsError() https://bugs.webkit.org/show_bug.cgi?id=85102 Reviewed by Geoffrey Garen. In bug 84787, kbr@ requested to avoid hard-coding createTypeError(exec, "Not enough arguments") here and there. This patch implements createNotEnoughArgumentsError(exec) and uses it in JSC bindings. c.f. a corresponding bug for V8 bindings is bug 85097. Source/JavaScriptCore: * runtime/Error.cpp: (JSC::createNotEnoughArgumentsError): (JSC): * runtime/Error.h: (JSC): Source/WebCore: Test: bindings/scripts/test/TestObj.idl * bindings/scripts/CodeGeneratorJS.pm: Modified as described above. (GenerateArgumentsCountCheck): * bindings/js/JSDataViewCustom.cpp: Ditto. (WebCore::getDataViewMember): (WebCore::setDataViewMember): * bindings/js/JSDeprecatedPeerConnectionCustom.cpp: (WebCore::JSDeprecatedPeerConnectionConstructor::constructJSDeprecatedPeerConnection): * bindings/js/JSDirectoryEntryCustom.cpp: (WebCore::JSDirectoryEntry::getFile): (WebCore::JSDirectoryEntry::getDirectory): * bindings/js/JSSharedWorkerCustom.cpp: (WebCore::JSSharedWorkerConstructor::constructJSSharedWorker): * bindings/js/JSWebKitMutationObserverCustom.cpp: (WebCore::JSWebKitMutationObserverConstructor::constructJSWebKitMutationObserver): (WebCore::JSWebKitMutationObserver::observe): * bindings/js/JSWorkerCustom.cpp: (WebCore::JSWorkerConstructor::constructJSWorker): * bindings/scripts/test/JS/JSFloat64Array.cpp: Updated run-bindings-tests. (WebCore::jsFloat64ArrayPrototypeFunctionFoo): * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp: (WebCore::jsTestActiveDOMObjectPrototypeFunctionExcitingFunction): (WebCore::jsTestActiveDOMObjectPrototypeFunctionPostMessage): * bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp: (WebCore::jsTestCustomNamedGetterPrototypeFunctionAnotherFunction): * bindings/scripts/test/JS/JSTestEventTarget.cpp: (WebCore::jsTestEventTargetPrototypeFunctionItem): (WebCore::jsTestEventTargetPrototypeFunctionAddEventListener): (WebCore::jsTestEventTargetPrototypeFunctionRemoveEventListener): (WebCore::jsTestEventTargetPrototypeFunctionDispatchEvent): * bindings/scripts/test/JS/JSTestInterface.cpp: (WebCore::JSTestInterfaceConstructor::constructJSTestInterface): (WebCore::jsTestInterfacePrototypeFunctionSupplementalMethod2): * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp: (WebCore::jsTestMediaQueryListListenerPrototypeFunctionMethod): * bindings/scripts/test/JS/JSTestNamedConstructor.cpp: (WebCore::JSTestNamedConstructorNamedConstructor::constructJSTestNamedConstructor): * bindings/scripts/test/JS/JSTestObj.cpp: (WebCore::JSTestObjConstructor::constructJSTestObj): (WebCore::jsTestObjPrototypeFunctionVoidMethodWithArgs): (WebCore::jsTestObjPrototypeFunctionIntMethodWithArgs): (WebCore::jsTestObjPrototypeFunctionObjMethodWithArgs): (WebCore::jsTestObjPrototypeFunctionMethodWithSequenceArg): (WebCore::jsTestObjPrototypeFunctionMethodReturningSequence): (WebCore::jsTestObjPrototypeFunctionMethodThatRequiresAllArgsAndThrows): (WebCore::jsTestObjPrototypeFunctionSerializedValue): (WebCore::jsTestObjPrototypeFunctionIdbKey): (WebCore::jsTestObjPrototypeFunctionOptionsObject): (WebCore::jsTestObjPrototypeFunctionAddEventListener): (WebCore::jsTestObjPrototypeFunctionRemoveEventListener): (WebCore::jsTestObjPrototypeFunctionMethodWithNonOptionalArgAndOptionalArg): (WebCore::jsTestObjPrototypeFunctionMethodWithNonOptionalArgAndTwoOptionalArgs): (WebCore::jsTestObjPrototypeFunctionMethodWithCallbackArg): (WebCore::jsTestObjPrototypeFunctionMethodWithNonCallbackArgAndCallbackArg): (WebCore::jsTestObjPrototypeFunctionOverloadedMethod1): (WebCore::jsTestObjPrototypeFunctionOverloadedMethod2): (WebCore::jsTestObjPrototypeFunctionOverloadedMethod3): (WebCore::jsTestObjPrototypeFunctionOverloadedMethod4): (WebCore::jsTestObjPrototypeFunctionOverloadedMethod5): (WebCore::jsTestObjPrototypeFunctionOverloadedMethod6): (WebCore::jsTestObjPrototypeFunctionOverloadedMethod7): (WebCore::jsTestObjConstructorFunctionClassMethod2): (WebCore::jsTestObjConstructorFunctionOverloadedMethod11): (WebCore::jsTestObjConstructorFunctionOverloadedMethod12): (WebCore::jsTestObjPrototypeFunctionMethodWithUnsignedLongArray): (WebCore::jsTestObjPrototypeFunctionConvert1): (WebCore::jsTestObjPrototypeFunctionConvert2): (WebCore::jsTestObjPrototypeFunctionConvert3): (WebCore::jsTestObjPrototypeFunctionConvert4): (WebCore::jsTestObjPrototypeFunctionConvert5): (WebCore::jsTestObjPrototypeFunctionStrictFunction): * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp: (WebCore::JSTestSerializedScriptValueInterfaceConstructor::constructJSTestSerializedScriptValueInterface): (WebCore::jsTestSerializedScriptValueInterfacePrototypeFunctionAcceptTransferList): git-svn-id: svn://svn.chromium.org/blink/trunk@115536 bbb929c8-8fbe-4397-9dbb-9b2b20218538
void setJSTestObjUnsignedLongLongAttr(ExecState* exec, JSObject* thisObject, JSValue value) { JSTestObj* castedThis = jsCast<JSTestObj*>(thisObject); TestObj* impl = static_cast<TestObj*>(castedThis->impl()); impl->setUnsignedLongLongAttr(static_cast<unsigned long long>(value.toInteger(exec))); }
void setJSTestObjUnsignedLongLongAttr(ExecState* exec, JSObject* thisObject, JSValue value) { JSTestObj* castedThis = jsCast<JSTestObj*>(thisObject); TestObj* impl = static_cast<TestObj*>(castedThis->impl()); impl->setUnsignedLongLongAttr(static_cast<unsigned long long>(value.toInteger(exec))); }
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 u64 vmx_get_segment_base(struct kvm_vcpu *vcpu, int seg) { struct kvm_segment s; if (to_vmx(vcpu)->rmode.vm86_active) { vmx_get_segment(vcpu, &s, seg); return s.base; } return vmx_read_guest_seg_base(to_vmx(vcpu), seg); }
static u64 vmx_get_segment_base(struct kvm_vcpu *vcpu, int seg) { struct kvm_segment s; if (to_vmx(vcpu)->rmode.vm86_active) { vmx_get_segment(vcpu, &s, seg); return s.base; } return vmx_read_guest_seg_base(to_vmx(vcpu), seg); }
C
linux
0
CVE-2018-20067
https://www.cvedetails.com/cve/CVE-2018-20067/
CWE-254
https://github.com/chromium/chromium/commit/a7d715ae5b654d1f98669fd979a00282a7229044
a7d715ae5b654d1f98669fd979a00282a7229044
Prevent renderer initiated back navigation to cancel a browser one. Renderer initiated back/forward navigations must not be able to cancel ongoing browser initiated navigation if they are not user initiated. Note: 'normal' renderer initiated navigation uses the FrameHost::BeginNavigation() path. A code similar to this patch is done in NavigatorImpl::OnBeginNavigation(). Test: ----- Added: NavigationBrowserTest. * HistoryBackInBeforeUnload * HistoryBackInBeforeUnloadAfterSetTimeout * HistoryBackCancelPendingNavigationNoUserGesture * HistoryBackCancelPendingNavigationUserGesture Fixed: * (WPT) .../the-history-interface/traverse_the_history_2.html * (WPT) .../the-history-interface/traverse_the_history_3.html * (WPT) .../the-history-interface/traverse_the_history_4.html * (WPT) .../the-history-interface/traverse_the_history_5.html Bug: 879965 Change-Id: I1a9bfaaea1ffc219e6c32f6e676b660e746c578c Reviewed-on: https://chromium-review.googlesource.com/1209744 Commit-Queue: Arthur Sonzogni <[email protected]> Reviewed-by: Daniel Cheng <[email protected]> Reviewed-by: Mustaq Ahmed <[email protected]> Reviewed-by: Camille Lamy <[email protected]> Reviewed-by: Charlie Reis <[email protected]> Cr-Commit-Position: refs/heads/master@{#592823}
void RenderViewImpl::SetFocus(bool enable) { GetWidget()->SetFocus(enable); }
void RenderViewImpl::SetFocus(bool enable) { GetWidget()->SetFocus(enable); }
C
Chrome
0
CVE-2016-1237
https://www.cvedetails.com/cve/CVE-2016-1237/
CWE-284
https://github.com/torvalds/linux/commit/999653786df6954a31044528ac3f7a5dadca08f4
999653786df6954a31044528ac3f7a5dadca08f4
nfsd: check permissions when setting ACLs Use set_posix_acl, which includes proper permission checks, instead of calling ->set_acl directly. Without this anyone may be able to grant themselves permissions to a file by setting the ACL. Lock the inode to make the new checks atomic with respect to set_acl. (Also, nfsd was the only caller of set_acl not locking the inode, so I suspect this may fix other races.) This also simplifies the code, and ensures our ACLs are checked by posix_acl_valid. The permission checks and the inode locking were lost with commit 4ac7249e, which changed nfsd to use the set_acl inode operation directly instead of going through xattr handlers. Reported-by: David Sinquin <[email protected]> [[email protected]: use set_posix_acl] Fixes: 4ac7249e Cc: Christoph Hellwig <[email protected]> Cc: Al Viro <[email protected]> Cc: [email protected] Signed-off-by: J. Bruce Fields <[email protected]>
nfsd4_set_nfs4_acl(struct svc_rqst *rqstp, struct svc_fh *fhp, struct nfs4_acl *acl) { __be32 error; int host_error; struct dentry *dentry; struct inode *inode; struct posix_acl *pacl = NULL, *dpacl = NULL; unsigned int flags = 0; /* Get inode */ error = fh_verify(rqstp, fhp, 0, NFSD_MAY_SATTR); if (error) return error; dentry = fhp->fh_dentry; inode = d_inode(dentry); if (S_ISDIR(inode->i_mode)) flags = NFS4_ACL_DIR; host_error = nfs4_acl_nfsv4_to_posix(acl, &pacl, &dpacl, flags); if (host_error == -EINVAL) return nfserr_attrnotsupp; if (host_error < 0) goto out_nfserr; fh_lock(fhp); host_error = set_posix_acl(inode, ACL_TYPE_ACCESS, pacl); if (host_error < 0) goto out_drop_lock; if (S_ISDIR(inode->i_mode)) { host_error = set_posix_acl(inode, ACL_TYPE_DEFAULT, dpacl); } out_drop_lock: fh_unlock(fhp); posix_acl_release(pacl); posix_acl_release(dpacl); out_nfserr: if (host_error == -EOPNOTSUPP) return nfserr_attrnotsupp; else return nfserrno(host_error); }
nfsd4_set_nfs4_acl(struct svc_rqst *rqstp, struct svc_fh *fhp, struct nfs4_acl *acl) { __be32 error; int host_error; struct dentry *dentry; struct inode *inode; struct posix_acl *pacl = NULL, *dpacl = NULL; unsigned int flags = 0; /* Get inode */ error = fh_verify(rqstp, fhp, 0, NFSD_MAY_SATTR); if (error) return error; dentry = fhp->fh_dentry; inode = d_inode(dentry); if (!inode->i_op->set_acl || !IS_POSIXACL(inode)) return nfserr_attrnotsupp; if (S_ISDIR(inode->i_mode)) flags = NFS4_ACL_DIR; host_error = nfs4_acl_nfsv4_to_posix(acl, &pacl, &dpacl, flags); if (host_error == -EINVAL) return nfserr_attrnotsupp; if (host_error < 0) goto out_nfserr; host_error = inode->i_op->set_acl(inode, pacl, ACL_TYPE_ACCESS); if (host_error < 0) goto out_release; if (S_ISDIR(inode->i_mode)) { host_error = inode->i_op->set_acl(inode, dpacl, ACL_TYPE_DEFAULT); } out_release: posix_acl_release(pacl); posix_acl_release(dpacl); out_nfserr: if (host_error == -EOPNOTSUPP) return nfserr_attrnotsupp; else return nfserrno(host_error); }
C
linux
1
CVE-2018-6041
https://www.cvedetails.com/cve/CVE-2018-6041/
CWE-20
https://github.com/chromium/chromium/commit/5cd363bc34f508c63b66e653bc41bd1783a4b711
5cd363bc34f508c63b66e653bc41bd1783a4b711
Fix issue with pending NavigationEntry being discarded incorrectly This CL fixes an issue where we would attempt to discard a pending NavigationEntry when a cross-process navigation to this NavigationEntry is interrupted by another navigation to the same NavigationEntry. BUG=760342,797656,796135 Change-Id: I204deff1efd4d572dd2e0b20e492592d48d787d9 Reviewed-on: https://chromium-review.googlesource.com/850877 Reviewed-by: Charlie Reis <[email protected]> Commit-Queue: Camille Lamy <[email protected]> Cr-Commit-Position: refs/heads/master@{#528611}
RenderFrameHostManager::GetSiteInstanceForNavigation( const GURL& dest_url, SiteInstance* source_instance, SiteInstance* dest_instance, SiteInstance* candidate_instance, ui::PageTransition transition, bool dest_is_restore, bool dest_is_view_source_mode, bool was_server_redirect) { DCHECK(!source_instance || !dest_instance); SiteInstance* current_instance = render_frame_host_->GetSiteInstance(); if (current_instance->GetSiteURL().SchemeIs(kGuestScheme)) return current_instance; BrowserContext* browser_context = delegate_->GetControllerForRenderManager().GetBrowserContext(); const GURL& current_effective_url = !render_frame_host_->last_successful_url().is_empty() ? SiteInstanceImpl::GetEffectiveURL( browser_context, render_frame_host_->last_successful_url()) : render_frame_host_->GetSiteInstance()->GetSiteURL(); const NavigationEntry* current_entry = delegate_->GetLastCommittedNavigationEntryForRenderManager(); bool current_is_view_source_mode = current_entry ? current_entry->IsViewSourceMode() : dest_is_view_source_mode; bool force_swap = ShouldSwapBrowsingInstancesForNavigation( current_effective_url, current_is_view_source_mode, dest_instance, SiteInstanceImpl::GetEffectiveURL(browser_context, dest_url), dest_is_view_source_mode); SiteInstanceDescriptor new_instance_descriptor = SiteInstanceDescriptor(current_instance); if (ShouldTransitionCrossSite() || force_swap) { new_instance_descriptor = DetermineSiteInstanceForURL( dest_url, source_instance, current_instance, dest_instance, transition, dest_is_restore, dest_is_view_source_mode, force_swap, was_server_redirect); } scoped_refptr<SiteInstance> new_instance = ConvertToSiteInstance(new_instance_descriptor, candidate_instance); if (force_swap) CHECK_NE(new_instance, current_instance); if (new_instance == current_instance) { RenderProcessHostImpl::CleanupSpareRenderProcessHost(); } DCHECK_EQ(new_instance->GetBrowserContext(), browser_context); SiteInstanceImpl* new_instance_impl = static_cast<SiteInstanceImpl*>(new_instance.get()); if (!frame_tree_node_->IsMainFrame() && !new_instance_impl->HasProcess() && new_instance_impl->RequiresDedicatedProcess()) { new_instance_impl->set_process_reuse_policy( SiteInstanceImpl::ProcessReusePolicy::REUSE_PENDING_OR_COMMITTED_SITE); } return new_instance; }
RenderFrameHostManager::GetSiteInstanceForNavigation( const GURL& dest_url, SiteInstance* source_instance, SiteInstance* dest_instance, SiteInstance* candidate_instance, ui::PageTransition transition, bool dest_is_restore, bool dest_is_view_source_mode, bool was_server_redirect) { DCHECK(!source_instance || !dest_instance); SiteInstance* current_instance = render_frame_host_->GetSiteInstance(); if (current_instance->GetSiteURL().SchemeIs(kGuestScheme)) return current_instance; BrowserContext* browser_context = delegate_->GetControllerForRenderManager().GetBrowserContext(); const GURL& current_effective_url = !render_frame_host_->last_successful_url().is_empty() ? SiteInstanceImpl::GetEffectiveURL( browser_context, render_frame_host_->last_successful_url()) : render_frame_host_->GetSiteInstance()->GetSiteURL(); const NavigationEntry* current_entry = delegate_->GetLastCommittedNavigationEntryForRenderManager(); bool current_is_view_source_mode = current_entry ? current_entry->IsViewSourceMode() : dest_is_view_source_mode; bool force_swap = ShouldSwapBrowsingInstancesForNavigation( current_effective_url, current_is_view_source_mode, dest_instance, SiteInstanceImpl::GetEffectiveURL(browser_context, dest_url), dest_is_view_source_mode); SiteInstanceDescriptor new_instance_descriptor = SiteInstanceDescriptor(current_instance); if (ShouldTransitionCrossSite() || force_swap) { new_instance_descriptor = DetermineSiteInstanceForURL( dest_url, source_instance, current_instance, dest_instance, transition, dest_is_restore, dest_is_view_source_mode, force_swap, was_server_redirect); } scoped_refptr<SiteInstance> new_instance = ConvertToSiteInstance(new_instance_descriptor, candidate_instance); if (force_swap) CHECK_NE(new_instance, current_instance); if (new_instance == current_instance) { RenderProcessHostImpl::CleanupSpareRenderProcessHost(); } DCHECK_EQ(new_instance->GetBrowserContext(), browser_context); SiteInstanceImpl* new_instance_impl = static_cast<SiteInstanceImpl*>(new_instance.get()); if (!frame_tree_node_->IsMainFrame() && !new_instance_impl->HasProcess() && new_instance_impl->RequiresDedicatedProcess()) { new_instance_impl->set_process_reuse_policy( SiteInstanceImpl::ProcessReusePolicy::REUSE_PENDING_OR_COMMITTED_SITE); } return new_instance; }
C
Chrome
0
CVE-2019-1010292
https://www.cvedetails.com/cve/CVE-2019-1010292/
CWE-119
https://github.com/OP-TEE/optee_os/commit/e3adcf566cb278444830e7badfdcc3983e334fd1
e3adcf566cb278444830e7badfdcc3983e334fd1
core: ensure that supplied range matches MOBJ In set_rmem_param() if the MOBJ is found by the cookie it's verified to represent non-secure shared memory. Prior to this patch the supplied sub-range to be used of the MOBJ was not checked here and relied on later checks further down the chain. Those checks seems to be enough for user TAs, but not for pseudo TAs where the size isn't checked. This patch adds a check for offset and size to see that they remain inside the memory covered by the MOBJ. Fixes: OP-TEE-2018-0004: "Unchecked parameters are passed through from REE". Signed-off-by: Jens Wiklander <[email protected]> Tested-by: Joakim Bech <[email protected]> (QEMU v7, v8) Reviewed-by: Joakim Bech <[email protected]> Reported-by: Riscure <[email protected]> Reported-by: Alyssa Milburn <[email protected]> Acked-by: Etienne Carriere <[email protected]>
void __weak tee_entry_std(struct thread_smc_args *smc_args) { paddr_t parg; struct optee_msg_arg *arg = NULL; /* fix gcc warning */ uint32_t num_params = 0; /* fix gcc warning */ struct mobj *mobj; if (smc_args->a0 != OPTEE_SMC_CALL_WITH_ARG) { EMSG("Unknown SMC 0x%" PRIx64, (uint64_t)smc_args->a0); DMSG("Expected 0x%x\n", OPTEE_SMC_CALL_WITH_ARG); smc_args->a0 = OPTEE_SMC_RETURN_EBADCMD; return; } parg = (uint64_t)smc_args->a1 << 32 | smc_args->a2; /* Check if this region is in static shared space */ if (core_pbuf_is(CORE_MEM_NSEC_SHM, parg, sizeof(struct optee_msg_arg))) { mobj = get_cmd_buffer(parg, &num_params); } else { if (parg & SMALL_PAGE_MASK) { smc_args->a0 = OPTEE_SMC_RETURN_EBADADDR; return; } mobj = map_cmd_buffer(parg, &num_params); } if (!mobj || !ALIGNMENT_IS_OK(parg, struct optee_msg_arg)) { EMSG("Bad arg address 0x%" PRIxPA, parg); smc_args->a0 = OPTEE_SMC_RETURN_EBADADDR; mobj_free(mobj); return; } arg = mobj_get_va(mobj, 0); assert(arg && mobj_is_nonsec(mobj)); /* Enable foreign interrupts for STD calls */ thread_set_foreign_intr(true); switch (arg->cmd) { case OPTEE_MSG_CMD_OPEN_SESSION: entry_open_session(smc_args, arg, num_params); break; case OPTEE_MSG_CMD_CLOSE_SESSION: entry_close_session(smc_args, arg, num_params); break; case OPTEE_MSG_CMD_INVOKE_COMMAND: entry_invoke_command(smc_args, arg, num_params); break; case OPTEE_MSG_CMD_CANCEL: entry_cancel(smc_args, arg, num_params); break; case OPTEE_MSG_CMD_REGISTER_SHM: register_shm(smc_args, arg, num_params); break; case OPTEE_MSG_CMD_UNREGISTER_SHM: unregister_shm(smc_args, arg, num_params); break; default: EMSG("Unknown cmd 0x%x\n", arg->cmd); smc_args->a0 = OPTEE_SMC_RETURN_EBADCMD; } mobj_free(mobj); }
void __weak tee_entry_std(struct thread_smc_args *smc_args) { paddr_t parg; struct optee_msg_arg *arg = NULL; /* fix gcc warning */ uint32_t num_params = 0; /* fix gcc warning */ struct mobj *mobj; if (smc_args->a0 != OPTEE_SMC_CALL_WITH_ARG) { EMSG("Unknown SMC 0x%" PRIx64, (uint64_t)smc_args->a0); DMSG("Expected 0x%x\n", OPTEE_SMC_CALL_WITH_ARG); smc_args->a0 = OPTEE_SMC_RETURN_EBADCMD; return; } parg = (uint64_t)smc_args->a1 << 32 | smc_args->a2; /* Check if this region is in static shared space */ if (core_pbuf_is(CORE_MEM_NSEC_SHM, parg, sizeof(struct optee_msg_arg))) { mobj = get_cmd_buffer(parg, &num_params); } else { if (parg & SMALL_PAGE_MASK) { smc_args->a0 = OPTEE_SMC_RETURN_EBADADDR; return; } mobj = map_cmd_buffer(parg, &num_params); } if (!mobj || !ALIGNMENT_IS_OK(parg, struct optee_msg_arg)) { EMSG("Bad arg address 0x%" PRIxPA, parg); smc_args->a0 = OPTEE_SMC_RETURN_EBADADDR; mobj_free(mobj); return; } arg = mobj_get_va(mobj, 0); assert(arg && mobj_is_nonsec(mobj)); /* Enable foreign interrupts for STD calls */ thread_set_foreign_intr(true); switch (arg->cmd) { case OPTEE_MSG_CMD_OPEN_SESSION: entry_open_session(smc_args, arg, num_params); break; case OPTEE_MSG_CMD_CLOSE_SESSION: entry_close_session(smc_args, arg, num_params); break; case OPTEE_MSG_CMD_INVOKE_COMMAND: entry_invoke_command(smc_args, arg, num_params); break; case OPTEE_MSG_CMD_CANCEL: entry_cancel(smc_args, arg, num_params); break; case OPTEE_MSG_CMD_REGISTER_SHM: register_shm(smc_args, arg, num_params); break; case OPTEE_MSG_CMD_UNREGISTER_SHM: unregister_shm(smc_args, arg, num_params); break; default: EMSG("Unknown cmd 0x%x\n", arg->cmd); smc_args->a0 = OPTEE_SMC_RETURN_EBADCMD; } mobj_free(mobj); }
C
optee_os
0
null
null
null
https://github.com/chromium/chromium/commit/f2f703241635fa96fa630b83afcc9a330cc21b7e
f2f703241635fa96fa630b83afcc9a330cc21b7e
CrOS Shelf: Get rid of 'split view' mode for shelf background In the new UI, "maximized" and "split view" are treated the same in specs, so there is no more need for a separate "split view" mode. This folds it into the "maximized" mode. Note that the only thing that _seems_ different in shelf_background_animator is ShelfBackgroundAnimator::kMaxAlpha (255) vs kShelfTranslucentMaximizedWindow (254), which should be virtually impossible to distinguish. This CL therefore does not have any visual effect (and doesn't directly fix the linked bug, but is relevant). Bug: 899289 Change-Id: I60947338176ac15ca016b1ba4edf13d16362cb24 Reviewed-on: https://chromium-review.googlesource.com/c/1469741 Commit-Queue: Xiyuan Xia <[email protected]> Reviewed-by: Xiyuan Xia <[email protected]> Auto-Submit: Manu Cornet <[email protected]> Cr-Commit-Position: refs/heads/master@{#631752}
void ProcessScrollInternal(ui::EventType type, const gfx::Vector2dF& delta, bool bounds_check) { if (GetShelfLayoutManager()->visibility_state() == SHELF_HIDDEN) return; if (type == ui::ET_GESTURE_SCROLL_BEGIN) { scroll_ = gfx::Vector2dF(); was_visible_on_drag_start_ = GetShelfLayoutManager()->IsVisible(); return; } if (type == ui::ET_GESTURE_SCROLL_END) return; if (type == ui::ET_GESTURE_SCROLL_UPDATE) scroll_.Add(delta); Shelf* shelf = AshTestBase::GetPrimaryShelf(); gfx::Rect shelf_bounds = GetShelfWidget()->GetWindowBoundsInScreen(); float scroll_delta = GetShelfLayoutManager()->PrimaryAxisValue(scroll_.y(), scroll_.x()); bool increasing_drag = GetShelfLayoutManager()->SelectValueForShelfAlignment( scroll_delta<0, scroll_delta> 0, scroll_delta < 0); const int shelf_size = GetShelfLayoutManager()->PrimaryAxisValue( shelf_bounds.height(), shelf_bounds.width()); if (was_visible_on_drag_start_) { if (increasing_drag) { const int bounds_delta = GetShelfLayoutManager()->SelectValueForShelfAlignment( visible_shelf_bounds_.y() - shelf_bounds.y(), shelf_bounds.x() - visible_shelf_bounds_.x(), visible_shelf_bounds_.x() - shelf_bounds.x()); EXPECT_GE(bounds_delta, 0); EXPECT_LE(bounds_delta, std::abs(scroll_delta)); } else { if (SHELF_ALIGNMENT_BOTTOM == shelf->alignment()) EXPECT_LE(visible_shelf_bounds_.y(), shelf_bounds.y()); else if (SHELF_ALIGNMENT_LEFT == shelf->alignment()) EXPECT_LE(shelf_bounds.x(), visible_shelf_bounds_.x()); else if (SHELF_ALIGNMENT_RIGHT == shelf->alignment()) EXPECT_LE(visible_shelf_bounds_.x(), shelf_bounds.x()); } } else { if (increasing_drag && bounds_check) { constexpr float kEpsilon = 1.f; if (std::abs(scroll_delta) < shelf_size) { if (SHELF_ALIGNMENT_BOTTOM == shelf->alignment()) { EXPECT_NEAR(shelf_bounds.y(), auto_hidden_shelf_bounds_.y() + kHiddenShelfInScreenPortion - std::abs(scroll_delta), kEpsilon); } else if (SHELF_ALIGNMENT_LEFT == shelf->alignment()) { EXPECT_NEAR(shelf_bounds.x(), auto_hidden_shelf_bounds_.x() - kHiddenShelfInScreenPortion + std::abs(scroll_delta), kEpsilon); } else if (SHELF_ALIGNMENT_RIGHT == shelf->alignment()) { EXPECT_NEAR(shelf_bounds.x(), auto_hidden_shelf_bounds_.x() + kHiddenShelfInScreenPortion - std::abs(scroll_delta), kEpsilon); } } else { if (SHELF_ALIGNMENT_BOTTOM == shelf->alignment()) { EXPECT_GT(shelf_bounds.y(), auto_hidden_shelf_bounds_.y() + kHiddenShelfInScreenPortion - std::abs(scroll_delta)); } else if (SHELF_ALIGNMENT_LEFT == shelf->alignment()) { EXPECT_LT(shelf_bounds.x(), auto_hidden_shelf_bounds_.x() - kHiddenShelfInScreenPortion + std::abs(scroll_delta)); } else if (SHELF_ALIGNMENT_RIGHT == shelf->alignment()) { EXPECT_GT(shelf_bounds.x(), auto_hidden_shelf_bounds_.x() + kHiddenShelfInScreenPortion - std::abs(scroll_delta)); } } } } }
void ProcessScrollInternal(ui::EventType type, const gfx::Vector2dF& delta, bool bounds_check) { if (GetShelfLayoutManager()->visibility_state() == SHELF_HIDDEN) return; if (type == ui::ET_GESTURE_SCROLL_BEGIN) { scroll_ = gfx::Vector2dF(); was_visible_on_drag_start_ = GetShelfLayoutManager()->IsVisible(); return; } if (type == ui::ET_GESTURE_SCROLL_END) return; if (type == ui::ET_GESTURE_SCROLL_UPDATE) scroll_.Add(delta); Shelf* shelf = AshTestBase::GetPrimaryShelf(); gfx::Rect shelf_bounds = GetShelfWidget()->GetWindowBoundsInScreen(); float scroll_delta = GetShelfLayoutManager()->PrimaryAxisValue(scroll_.y(), scroll_.x()); bool increasing_drag = GetShelfLayoutManager()->SelectValueForShelfAlignment( scroll_delta<0, scroll_delta> 0, scroll_delta < 0); const int shelf_size = GetShelfLayoutManager()->PrimaryAxisValue( shelf_bounds.height(), shelf_bounds.width()); if (was_visible_on_drag_start_) { if (increasing_drag) { const int bounds_delta = GetShelfLayoutManager()->SelectValueForShelfAlignment( visible_shelf_bounds_.y() - shelf_bounds.y(), shelf_bounds.x() - visible_shelf_bounds_.x(), visible_shelf_bounds_.x() - shelf_bounds.x()); EXPECT_GE(bounds_delta, 0); EXPECT_LE(bounds_delta, std::abs(scroll_delta)); } else { if (SHELF_ALIGNMENT_BOTTOM == shelf->alignment()) EXPECT_LE(visible_shelf_bounds_.y(), shelf_bounds.y()); else if (SHELF_ALIGNMENT_LEFT == shelf->alignment()) EXPECT_LE(shelf_bounds.x(), visible_shelf_bounds_.x()); else if (SHELF_ALIGNMENT_RIGHT == shelf->alignment()) EXPECT_LE(visible_shelf_bounds_.x(), shelf_bounds.x()); } } else { if (increasing_drag && bounds_check) { constexpr float kEpsilon = 1.f; if (std::abs(scroll_delta) < shelf_size) { if (SHELF_ALIGNMENT_BOTTOM == shelf->alignment()) { EXPECT_NEAR(shelf_bounds.y(), auto_hidden_shelf_bounds_.y() + kHiddenShelfInScreenPortion - std::abs(scroll_delta), kEpsilon); } else if (SHELF_ALIGNMENT_LEFT == shelf->alignment()) { EXPECT_NEAR(shelf_bounds.x(), auto_hidden_shelf_bounds_.x() - kHiddenShelfInScreenPortion + std::abs(scroll_delta), kEpsilon); } else if (SHELF_ALIGNMENT_RIGHT == shelf->alignment()) { EXPECT_NEAR(shelf_bounds.x(), auto_hidden_shelf_bounds_.x() + kHiddenShelfInScreenPortion - std::abs(scroll_delta), kEpsilon); } } else { if (SHELF_ALIGNMENT_BOTTOM == shelf->alignment()) { EXPECT_GT(shelf_bounds.y(), auto_hidden_shelf_bounds_.y() + kHiddenShelfInScreenPortion - std::abs(scroll_delta)); } else if (SHELF_ALIGNMENT_LEFT == shelf->alignment()) { EXPECT_LT(shelf_bounds.x(), auto_hidden_shelf_bounds_.x() - kHiddenShelfInScreenPortion + std::abs(scroll_delta)); } else if (SHELF_ALIGNMENT_RIGHT == shelf->alignment()) { EXPECT_GT(shelf_bounds.x(), auto_hidden_shelf_bounds_.x() + kHiddenShelfInScreenPortion - std::abs(scroll_delta)); } } } } }
C
Chrome
0
CVE-2016-8654
https://www.cvedetails.com/cve/CVE-2016-8654/
CWE-119
https://github.com/mdadams/jasper/commit/4a59cfaf9ab3d48fca4a15c0d2674bf7138e3d1a
4a59cfaf9ab3d48fca4a15c0d2674bf7138e3d1a
Fixed a buffer overrun problem in the QMFB code in the JPC codec that was caused by a buffer being allocated with a size that was too small in some cases. Added a new regression test case.
void jpc_ns_invlift_col(jpc_fix_t *a, int numrows, int stride, int parity) { jpc_fix_t *lptr; jpc_fix_t *hptr; register jpc_fix_t *lptr2; register jpc_fix_t *hptr2; register int n; int llen; llen = (numrows + 1 - parity) >> 1; if (numrows > 1) { /* Apply the scaling step. */ #if defined(WT_DOSCALE) lptr = &a[0]; n = llen; while (n-- > 0) { lptr2 = lptr; lptr2[0] = jpc_fix_mul(lptr2[0], jpc_dbltofix(1.0 / LGAIN)); ++lptr2; lptr += stride; } hptr = &a[llen * stride]; n = numrows - llen; while (n-- > 0) { hptr2 = hptr; hptr2[0] = jpc_fix_mul(hptr2[0], jpc_dbltofix(1.0 / HGAIN)); ++hptr2; hptr += stride; } #endif /* Apply the first lifting step. */ lptr = &a[0]; hptr = &a[llen * stride]; if (!parity) { lptr2 = lptr; hptr2 = hptr; jpc_fix_minuseq(lptr2[0], jpc_fix_mul(jpc_dbltofix(2.0 * DELTA), hptr2[0])); ++lptr2; ++hptr2; lptr += stride; } n = llen - (!parity) - (parity != (numrows & 1)); while (n-- > 0) { lptr2 = lptr; hptr2 = hptr; jpc_fix_minuseq(lptr2[0], jpc_fix_mul(jpc_dbltofix(DELTA), jpc_fix_add(hptr2[0], hptr2[stride]))); ++lptr2; ++hptr2; lptr += stride; hptr += stride; } if (parity != (numrows & 1)) { lptr2 = lptr; hptr2 = hptr; jpc_fix_minuseq(lptr2[0], jpc_fix_mul(jpc_dbltofix(2.0 * DELTA), hptr2[0])); ++lptr2; ++hptr2; } /* Apply the second lifting step. */ lptr = &a[0]; hptr = &a[llen * stride]; if (parity) { lptr2 = lptr; hptr2 = hptr; jpc_fix_minuseq(hptr2[0], jpc_fix_mul(jpc_dbltofix(2.0 * GAMMA), lptr2[0])); ++hptr2; ++lptr2; hptr += stride; } n = numrows - llen - parity - (parity == (numrows & 1)); while (n-- > 0) { lptr2 = lptr; hptr2 = hptr; jpc_fix_minuseq(hptr2[0], jpc_fix_mul(jpc_dbltofix(GAMMA), jpc_fix_add(lptr2[0], lptr2[stride]))); ++lptr2; ++hptr2; hptr += stride; lptr += stride; } if (parity == (numrows & 1)) { lptr2 = lptr; hptr2 = hptr; jpc_fix_minuseq(hptr2[0], jpc_fix_mul(jpc_dbltofix(2.0 * GAMMA), lptr2[0])); ++lptr2; ++hptr2; } /* Apply the third lifting step. */ lptr = &a[0]; hptr = &a[llen * stride]; if (!parity) { lptr2 = lptr; hptr2 = hptr; jpc_fix_minuseq(lptr2[0], jpc_fix_mul(jpc_dbltofix(2.0 * BETA), hptr2[0])); ++lptr2; ++hptr2; lptr += stride; } n = llen - (!parity) - (parity != (numrows & 1)); while (n-- > 0) { lptr2 = lptr; hptr2 = hptr; jpc_fix_minuseq(lptr2[0], jpc_fix_mul(jpc_dbltofix(BETA), jpc_fix_add(hptr2[0], hptr2[stride]))); ++lptr2; ++hptr2; lptr += stride; hptr += stride; } if (parity != (numrows & 1)) { lptr2 = lptr; hptr2 = hptr; jpc_fix_minuseq(lptr2[0], jpc_fix_mul(jpc_dbltofix(2.0 * BETA), hptr2[0])); ++lptr2; ++hptr2; } /* Apply the fourth lifting step. */ lptr = &a[0]; hptr = &a[llen * stride]; if (parity) { lptr2 = lptr; hptr2 = hptr; jpc_fix_minuseq(hptr2[0], jpc_fix_mul(jpc_dbltofix(2.0 * ALPHA), lptr2[0])); ++hptr2; ++lptr2; hptr += stride; } n = numrows - llen - parity - (parity == (numrows & 1)); while (n-- > 0) { lptr2 = lptr; hptr2 = hptr; jpc_fix_minuseq(hptr2[0], jpc_fix_mul(jpc_dbltofix(ALPHA), jpc_fix_add(lptr2[0], lptr2[stride]))); ++lptr2; ++hptr2; hptr += stride; lptr += stride; } if (parity == (numrows & 1)) { lptr2 = lptr; hptr2 = hptr; jpc_fix_minuseq(hptr2[0], jpc_fix_mul(jpc_dbltofix(2.0 * ALPHA), lptr2[0])); ++lptr2; ++hptr2; } } else { #if defined(WT_LENONE) if (parity) { lptr2 = &a[0]; lptr2[0] = jpc_fix_asr(lptr2[0], 1); ++lptr2; } #endif } }
void jpc_ns_invlift_col(jpc_fix_t *a, int numrows, int stride, int parity) { jpc_fix_t *lptr; jpc_fix_t *hptr; register jpc_fix_t *lptr2; register jpc_fix_t *hptr2; register int n; int llen; llen = (numrows + 1 - parity) >> 1; if (numrows > 1) { /* Apply the scaling step. */ #if defined(WT_DOSCALE) lptr = &a[0]; n = llen; while (n-- > 0) { lptr2 = lptr; lptr2[0] = jpc_fix_mul(lptr2[0], jpc_dbltofix(1.0 / LGAIN)); ++lptr2; lptr += stride; } hptr = &a[llen * stride]; n = numrows - llen; while (n-- > 0) { hptr2 = hptr; hptr2[0] = jpc_fix_mul(hptr2[0], jpc_dbltofix(1.0 / HGAIN)); ++hptr2; hptr += stride; } #endif /* Apply the first lifting step. */ lptr = &a[0]; hptr = &a[llen * stride]; if (!parity) { lptr2 = lptr; hptr2 = hptr; jpc_fix_minuseq(lptr2[0], jpc_fix_mul(jpc_dbltofix(2.0 * DELTA), hptr2[0])); ++lptr2; ++hptr2; lptr += stride; } n = llen - (!parity) - (parity != (numrows & 1)); while (n-- > 0) { lptr2 = lptr; hptr2 = hptr; jpc_fix_minuseq(lptr2[0], jpc_fix_mul(jpc_dbltofix(DELTA), jpc_fix_add(hptr2[0], hptr2[stride]))); ++lptr2; ++hptr2; lptr += stride; hptr += stride; } if (parity != (numrows & 1)) { lptr2 = lptr; hptr2 = hptr; jpc_fix_minuseq(lptr2[0], jpc_fix_mul(jpc_dbltofix(2.0 * DELTA), hptr2[0])); ++lptr2; ++hptr2; } /* Apply the second lifting step. */ lptr = &a[0]; hptr = &a[llen * stride]; if (parity) { lptr2 = lptr; hptr2 = hptr; jpc_fix_minuseq(hptr2[0], jpc_fix_mul(jpc_dbltofix(2.0 * GAMMA), lptr2[0])); ++hptr2; ++lptr2; hptr += stride; } n = numrows - llen - parity - (parity == (numrows & 1)); while (n-- > 0) { lptr2 = lptr; hptr2 = hptr; jpc_fix_minuseq(hptr2[0], jpc_fix_mul(jpc_dbltofix(GAMMA), jpc_fix_add(lptr2[0], lptr2[stride]))); ++lptr2; ++hptr2; hptr += stride; lptr += stride; } if (parity == (numrows & 1)) { lptr2 = lptr; hptr2 = hptr; jpc_fix_minuseq(hptr2[0], jpc_fix_mul(jpc_dbltofix(2.0 * GAMMA), lptr2[0])); ++lptr2; ++hptr2; } /* Apply the third lifting step. */ lptr = &a[0]; hptr = &a[llen * stride]; if (!parity) { lptr2 = lptr; hptr2 = hptr; jpc_fix_minuseq(lptr2[0], jpc_fix_mul(jpc_dbltofix(2.0 * BETA), hptr2[0])); ++lptr2; ++hptr2; lptr += stride; } n = llen - (!parity) - (parity != (numrows & 1)); while (n-- > 0) { lptr2 = lptr; hptr2 = hptr; jpc_fix_minuseq(lptr2[0], jpc_fix_mul(jpc_dbltofix(BETA), jpc_fix_add(hptr2[0], hptr2[stride]))); ++lptr2; ++hptr2; lptr += stride; hptr += stride; } if (parity != (numrows & 1)) { lptr2 = lptr; hptr2 = hptr; jpc_fix_minuseq(lptr2[0], jpc_fix_mul(jpc_dbltofix(2.0 * BETA), hptr2[0])); ++lptr2; ++hptr2; } /* Apply the fourth lifting step. */ lptr = &a[0]; hptr = &a[llen * stride]; if (parity) { lptr2 = lptr; hptr2 = hptr; jpc_fix_minuseq(hptr2[0], jpc_fix_mul(jpc_dbltofix(2.0 * ALPHA), lptr2[0])); ++hptr2; ++lptr2; hptr += stride; } n = numrows - llen - parity - (parity == (numrows & 1)); while (n-- > 0) { lptr2 = lptr; hptr2 = hptr; jpc_fix_minuseq(hptr2[0], jpc_fix_mul(jpc_dbltofix(ALPHA), jpc_fix_add(lptr2[0], lptr2[stride]))); ++lptr2; ++hptr2; hptr += stride; lptr += stride; } if (parity == (numrows & 1)) { lptr2 = lptr; hptr2 = hptr; jpc_fix_minuseq(hptr2[0], jpc_fix_mul(jpc_dbltofix(2.0 * ALPHA), lptr2[0])); ++lptr2; ++hptr2; } } else { #if defined(WT_LENONE) if (parity) { lptr2 = &a[0]; lptr2[0] = jpc_fix_asr(lptr2[0], 1); ++lptr2; } #endif } }
C
jasper
0
CVE-2017-8284
https://www.cvedetails.com/cve/CVE-2017-8284/
CWE-94
https://github.com/qemu/qemu/commit/30663fd26c0307e414622c7a8607fbc04f92ec14
30663fd26c0307e414622c7a8607fbc04f92ec14
tcg/i386: Check the size of instruction being translated This fixes the bug: 'user-to-root privesc inside VM via bad translation caching' reported by Jann Horn here: https://bugs.chromium.org/p/project-zero/issues/detail?id=1122 Reviewed-by: Richard Henderson <[email protected]> CC: Peter Maydell <[email protected]> CC: Paolo Bonzini <[email protected]> Reported-by: Jann Horn <[email protected]> Signed-off-by: Pranith Kumar <[email protected]> Message-Id: <[email protected]> Signed-off-by: Paolo Bonzini <[email protected]>
void gen_intermediate_code(CPUX86State *env, TranslationBlock *tb) { X86CPU *cpu = x86_env_get_cpu(env); CPUState *cs = CPU(cpu); DisasContext dc1, *dc = &dc1; target_ulong pc_ptr; uint32_t flags; target_ulong pc_start; target_ulong cs_base; int num_insns; int max_insns; /* generate intermediate code */ pc_start = tb->pc; cs_base = tb->cs_base; flags = tb->flags; dc->pe = (flags >> HF_PE_SHIFT) & 1; dc->code32 = (flags >> HF_CS32_SHIFT) & 1; dc->ss32 = (flags >> HF_SS32_SHIFT) & 1; dc->addseg = (flags >> HF_ADDSEG_SHIFT) & 1; dc->f_st = 0; dc->vm86 = (flags >> VM_SHIFT) & 1; dc->cpl = (flags >> HF_CPL_SHIFT) & 3; dc->iopl = (flags >> IOPL_SHIFT) & 3; dc->tf = (flags >> TF_SHIFT) & 1; dc->singlestep_enabled = cs->singlestep_enabled; dc->cc_op = CC_OP_DYNAMIC; dc->cc_op_dirty = false; dc->cs_base = cs_base; dc->tb = tb; dc->popl_esp_hack = 0; /* select memory access functions */ dc->mem_index = 0; #ifdef CONFIG_SOFTMMU dc->mem_index = cpu_mmu_index(env, false); #endif dc->cpuid_features = env->features[FEAT_1_EDX]; dc->cpuid_ext_features = env->features[FEAT_1_ECX]; dc->cpuid_ext2_features = env->features[FEAT_8000_0001_EDX]; dc->cpuid_ext3_features = env->features[FEAT_8000_0001_ECX]; dc->cpuid_7_0_ebx_features = env->features[FEAT_7_0_EBX]; dc->cpuid_xsave_features = env->features[FEAT_XSAVE]; #ifdef TARGET_X86_64 dc->lma = (flags >> HF_LMA_SHIFT) & 1; dc->code64 = (flags >> HF_CS64_SHIFT) & 1; #endif dc->flags = flags; dc->jmp_opt = !(dc->tf || cs->singlestep_enabled || (flags & HF_INHIBIT_IRQ_MASK)); /* Do not optimize repz jumps at all in icount mode, because rep movsS instructions are execured with different paths in !repz_opt and repz_opt modes. The first one was used always except single step mode. And this setting disables jumps optimization and control paths become equivalent in run and single step modes. Now there will be no jump optimization for repz in record/replay modes and there will always be an additional step for ecx=0 when icount is enabled. */ dc->repz_opt = !dc->jmp_opt && !(tb->cflags & CF_USE_ICOUNT); #if 0 /* check addseg logic */ if (!dc->addseg && (dc->vm86 || !dc->pe || !dc->code32)) printf("ERROR addseg\n"); #endif cpu_T0 = tcg_temp_new(); cpu_T1 = tcg_temp_new(); cpu_A0 = tcg_temp_new(); cpu_tmp0 = tcg_temp_new(); cpu_tmp1_i64 = tcg_temp_new_i64(); cpu_tmp2_i32 = tcg_temp_new_i32(); cpu_tmp3_i32 = tcg_temp_new_i32(); cpu_tmp4 = tcg_temp_new(); cpu_ptr0 = tcg_temp_new_ptr(); cpu_ptr1 = tcg_temp_new_ptr(); cpu_cc_srcT = tcg_temp_local_new(); dc->is_jmp = DISAS_NEXT; pc_ptr = pc_start; num_insns = 0; max_insns = tb->cflags & CF_COUNT_MASK; if (max_insns == 0) { max_insns = CF_COUNT_MASK; } if (max_insns > TCG_MAX_INSNS) { max_insns = TCG_MAX_INSNS; } gen_tb_start(tb); for(;;) { tcg_gen_insn_start(pc_ptr, dc->cc_op); num_insns++; /* If RF is set, suppress an internally generated breakpoint. */ if (unlikely(cpu_breakpoint_test(cs, pc_ptr, tb->flags & HF_RF_MASK ? BP_GDB : BP_ANY))) { gen_debug(dc, pc_ptr - dc->cs_base); /* The address covered by the breakpoint must be included in [tb->pc, tb->pc + tb->size) in order to for it to be properly cleared -- thus we increment the PC here so that the logic setting tb->size below does the right thing. */ pc_ptr += 1; goto done_generating; } if (num_insns == max_insns && (tb->cflags & CF_LAST_IO)) { gen_io_start(); } pc_ptr = disas_insn(env, dc, pc_ptr); /* stop translation if indicated */ if (dc->is_jmp) break; /* if single step mode, we generate only one instruction and generate an exception */ /* if irq were inhibited with HF_INHIBIT_IRQ_MASK, we clear the flag and abort the translation to give the irqs a change to be happen */ if (dc->tf || dc->singlestep_enabled || (flags & HF_INHIBIT_IRQ_MASK)) { gen_jmp_im(pc_ptr - dc->cs_base); gen_eob(dc); break; } /* Do not cross the boundary of the pages in icount mode, it can cause an exception. Do it only when boundary is crossed by the first instruction in the block. If current instruction already crossed the bound - it's ok, because an exception hasn't stopped this code. */ if ((tb->cflags & CF_USE_ICOUNT) && ((pc_ptr & TARGET_PAGE_MASK) != ((pc_ptr + TARGET_MAX_INSN_SIZE - 1) & TARGET_PAGE_MASK) || (pc_ptr & ~TARGET_PAGE_MASK) == 0)) { gen_jmp_im(pc_ptr - dc->cs_base); gen_eob(dc); break; } /* if too long translation, stop generation too */ if (tcg_op_buf_full() || (pc_ptr - pc_start) >= (TARGET_PAGE_SIZE - 32) || num_insns >= max_insns) { gen_jmp_im(pc_ptr - dc->cs_base); gen_eob(dc); break; } if (singlestep) { gen_jmp_im(pc_ptr - dc->cs_base); gen_eob(dc); break; } } if (tb->cflags & CF_LAST_IO) gen_io_end(); done_generating: gen_tb_end(tb, num_insns); #ifdef DEBUG_DISAS if (qemu_loglevel_mask(CPU_LOG_TB_IN_ASM) && qemu_log_in_addr_range(pc_start)) { int disas_flags; qemu_log_lock(); qemu_log("----------------\n"); qemu_log("IN: %s\n", lookup_symbol(pc_start)); #ifdef TARGET_X86_64 if (dc->code64) disas_flags = 2; else #endif disas_flags = !dc->code32; log_target_disas(cs, pc_start, pc_ptr - pc_start, disas_flags); qemu_log("\n"); qemu_log_unlock(); } #endif tb->size = pc_ptr - pc_start; tb->icount = num_insns; }
void gen_intermediate_code(CPUX86State *env, TranslationBlock *tb) { X86CPU *cpu = x86_env_get_cpu(env); CPUState *cs = CPU(cpu); DisasContext dc1, *dc = &dc1; target_ulong pc_ptr; uint32_t flags; target_ulong pc_start; target_ulong cs_base; int num_insns; int max_insns; /* generate intermediate code */ pc_start = tb->pc; cs_base = tb->cs_base; flags = tb->flags; dc->pe = (flags >> HF_PE_SHIFT) & 1; dc->code32 = (flags >> HF_CS32_SHIFT) & 1; dc->ss32 = (flags >> HF_SS32_SHIFT) & 1; dc->addseg = (flags >> HF_ADDSEG_SHIFT) & 1; dc->f_st = 0; dc->vm86 = (flags >> VM_SHIFT) & 1; dc->cpl = (flags >> HF_CPL_SHIFT) & 3; dc->iopl = (flags >> IOPL_SHIFT) & 3; dc->tf = (flags >> TF_SHIFT) & 1; dc->singlestep_enabled = cs->singlestep_enabled; dc->cc_op = CC_OP_DYNAMIC; dc->cc_op_dirty = false; dc->cs_base = cs_base; dc->tb = tb; dc->popl_esp_hack = 0; /* select memory access functions */ dc->mem_index = 0; #ifdef CONFIG_SOFTMMU dc->mem_index = cpu_mmu_index(env, false); #endif dc->cpuid_features = env->features[FEAT_1_EDX]; dc->cpuid_ext_features = env->features[FEAT_1_ECX]; dc->cpuid_ext2_features = env->features[FEAT_8000_0001_EDX]; dc->cpuid_ext3_features = env->features[FEAT_8000_0001_ECX]; dc->cpuid_7_0_ebx_features = env->features[FEAT_7_0_EBX]; dc->cpuid_xsave_features = env->features[FEAT_XSAVE]; #ifdef TARGET_X86_64 dc->lma = (flags >> HF_LMA_SHIFT) & 1; dc->code64 = (flags >> HF_CS64_SHIFT) & 1; #endif dc->flags = flags; dc->jmp_opt = !(dc->tf || cs->singlestep_enabled || (flags & HF_INHIBIT_IRQ_MASK)); /* Do not optimize repz jumps at all in icount mode, because rep movsS instructions are execured with different paths in !repz_opt and repz_opt modes. The first one was used always except single step mode. And this setting disables jumps optimization and control paths become equivalent in run and single step modes. Now there will be no jump optimization for repz in record/replay modes and there will always be an additional step for ecx=0 when icount is enabled. */ dc->repz_opt = !dc->jmp_opt && !(tb->cflags & CF_USE_ICOUNT); #if 0 /* check addseg logic */ if (!dc->addseg && (dc->vm86 || !dc->pe || !dc->code32)) printf("ERROR addseg\n"); #endif cpu_T0 = tcg_temp_new(); cpu_T1 = tcg_temp_new(); cpu_A0 = tcg_temp_new(); cpu_tmp0 = tcg_temp_new(); cpu_tmp1_i64 = tcg_temp_new_i64(); cpu_tmp2_i32 = tcg_temp_new_i32(); cpu_tmp3_i32 = tcg_temp_new_i32(); cpu_tmp4 = tcg_temp_new(); cpu_ptr0 = tcg_temp_new_ptr(); cpu_ptr1 = tcg_temp_new_ptr(); cpu_cc_srcT = tcg_temp_local_new(); dc->is_jmp = DISAS_NEXT; pc_ptr = pc_start; num_insns = 0; max_insns = tb->cflags & CF_COUNT_MASK; if (max_insns == 0) { max_insns = CF_COUNT_MASK; } if (max_insns > TCG_MAX_INSNS) { max_insns = TCG_MAX_INSNS; } gen_tb_start(tb); for(;;) { tcg_gen_insn_start(pc_ptr, dc->cc_op); num_insns++; /* If RF is set, suppress an internally generated breakpoint. */ if (unlikely(cpu_breakpoint_test(cs, pc_ptr, tb->flags & HF_RF_MASK ? BP_GDB : BP_ANY))) { gen_debug(dc, pc_ptr - dc->cs_base); /* The address covered by the breakpoint must be included in [tb->pc, tb->pc + tb->size) in order to for it to be properly cleared -- thus we increment the PC here so that the logic setting tb->size below does the right thing. */ pc_ptr += 1; goto done_generating; } if (num_insns == max_insns && (tb->cflags & CF_LAST_IO)) { gen_io_start(); } pc_ptr = disas_insn(env, dc, pc_ptr); /* stop translation if indicated */ if (dc->is_jmp) break; /* if single step mode, we generate only one instruction and generate an exception */ /* if irq were inhibited with HF_INHIBIT_IRQ_MASK, we clear the flag and abort the translation to give the irqs a change to be happen */ if (dc->tf || dc->singlestep_enabled || (flags & HF_INHIBIT_IRQ_MASK)) { gen_jmp_im(pc_ptr - dc->cs_base); gen_eob(dc); break; } /* Do not cross the boundary of the pages in icount mode, it can cause an exception. Do it only when boundary is crossed by the first instruction in the block. If current instruction already crossed the bound - it's ok, because an exception hasn't stopped this code. */ if ((tb->cflags & CF_USE_ICOUNT) && ((pc_ptr & TARGET_PAGE_MASK) != ((pc_ptr + TARGET_MAX_INSN_SIZE - 1) & TARGET_PAGE_MASK) || (pc_ptr & ~TARGET_PAGE_MASK) == 0)) { gen_jmp_im(pc_ptr - dc->cs_base); gen_eob(dc); break; } /* if too long translation, stop generation too */ if (tcg_op_buf_full() || (pc_ptr - pc_start) >= (TARGET_PAGE_SIZE - 32) || num_insns >= max_insns) { gen_jmp_im(pc_ptr - dc->cs_base); gen_eob(dc); break; } if (singlestep) { gen_jmp_im(pc_ptr - dc->cs_base); gen_eob(dc); break; } } if (tb->cflags & CF_LAST_IO) gen_io_end(); done_generating: gen_tb_end(tb, num_insns); #ifdef DEBUG_DISAS if (qemu_loglevel_mask(CPU_LOG_TB_IN_ASM) && qemu_log_in_addr_range(pc_start)) { int disas_flags; qemu_log_lock(); qemu_log("----------------\n"); qemu_log("IN: %s\n", lookup_symbol(pc_start)); #ifdef TARGET_X86_64 if (dc->code64) disas_flags = 2; else #endif disas_flags = !dc->code32; log_target_disas(cs, pc_start, pc_ptr - pc_start, disas_flags); qemu_log("\n"); qemu_log_unlock(); } #endif tb->size = pc_ptr - pc_start; tb->icount = num_insns; }
C
qemu
0
CVE-2015-6763
https://www.cvedetails.com/cve/CVE-2015-6763/
null
https://github.com/chromium/chromium/commit/f1574f25e1402e748bf2bd7e28ce3dd96ceb1ca4
f1574f25e1402e748bf2bd7e28ce3dd96ceb1ca4
MacViews: Enable secure text input for password Textfields. In Cocoa the NSTextInputContext automatically enables secure text input when activated and it's in the secure text entry mode. RenderWidgetHostViewMac did the similar thing for ages following the WebKit example. views::Textfield needs to do the same thing in a fashion that's sycnrhonized with RenderWidgetHostViewMac, otherwise the race conditions are possible when the Textfield gets focus, activates the secure text input mode and the RWHVM loses focus immediately afterwards and disables the secure text input instead of leaving it in the enabled state. BUG=818133,677220 Change-Id: I6db6c4b59e4a1a72cbb7f8c7056f71b04a3df08b Reviewed-on: https://chromium-review.googlesource.com/943064 Commit-Queue: Michail Pishchagin <[email protected]> Reviewed-by: Pavel Feldman <[email protected]> Reviewed-by: Avi Drissman <[email protected]> Reviewed-by: Peter Kasting <[email protected]> Cr-Commit-Position: refs/heads/master@{#542517}
LocalDOMWindow* LocalDOMWindow::ToLocalDOMWindow() { return this; }
LocalDOMWindow* LocalDOMWindow::ToLocalDOMWindow() { return this; }
C
Chrome
0
CVE-2019-15164
https://www.cvedetails.com/cve/CVE-2019-15164/
CWE-918
https://github.com/the-tcpdump-group/libpcap/commit/33834cb2a4d035b52aa2a26742f832a112e90a0a
33834cb2a4d035b52aa2a26742f832a112e90a0a
In the open request, reject capture sources that are URLs. You shouldn't be able to ask a server to open a remote device on some *other* server; just open it yourself. This addresses Include Security issue F13: [libpcap] Remote Packet Capture Daemon Allows Opening Capture URLs.
static void session_close(struct session *session) { if (session->have_thread) { pcap_breakloop(session->fp); #ifdef _WIN32 SetEvent(pcap_getevent(session->fp)); WaitForSingleObject(session->thread, INFINITE); CloseHandle(session->thread); session->have_thread = 0; session->thread = INVALID_HANDLE_VALUE; #else pthread_kill(session->thread, SIGUSR1); pthread_join(session->thread, NULL); session->have_thread = 0; memset(&session->thread, 0, sizeof(session->thread)); #endif } if (session->sockdata != INVALID_SOCKET) { sock_close(session->sockdata, NULL, 0); session->sockdata = INVALID_SOCKET; } if (session->fp) { pcap_close(session->fp); session->fp = NULL; } }
static void session_close(struct session *session) { if (session->have_thread) { pcap_breakloop(session->fp); #ifdef _WIN32 SetEvent(pcap_getevent(session->fp)); WaitForSingleObject(session->thread, INFINITE); CloseHandle(session->thread); session->have_thread = 0; session->thread = INVALID_HANDLE_VALUE; #else pthread_kill(session->thread, SIGUSR1); pthread_join(session->thread, NULL); session->have_thread = 0; memset(&session->thread, 0, sizeof(session->thread)); #endif } if (session->sockdata != INVALID_SOCKET) { sock_close(session->sockdata, NULL, 0); session->sockdata = INVALID_SOCKET; } if (session->fp) { pcap_close(session->fp); session->fp = NULL; } }
C
libpcap
0
CVE-2018-18350
https://www.cvedetails.com/cve/CVE-2018-18350/
null
https://github.com/chromium/chromium/commit/d683fb12566eaec180ee0e0506288f46cc7a43e7
d683fb12566eaec180ee0e0506288f46cc7a43e7
Inherit CSP when self-navigating to local-scheme URL As the linked bug example shows, we should inherit CSP when we navigate to a local-scheme URL (even if we are in a main browsing context). Bug: 799747 Change-Id: I8413aa8e8049461ebcf0ffbf7b04c41d1340af02 Reviewed-on: https://chromium-review.googlesource.com/c/1234337 Reviewed-by: Mike West <[email protected]> Commit-Queue: Andy Paicu <[email protected]> Cr-Commit-Position: refs/heads/master@{#597889}
DocumentInit& DocumentInit::WithOwnerDocument(Document* owner_document) { DCHECK(!owner_document_); owner_document_ = owner_document; return *this; }
DocumentInit& DocumentInit::WithOwnerDocument(Document* owner_document) { DCHECK(!owner_document_); owner_document_ = owner_document; return *this; }
C
Chrome
0
CVE-2019-1559
https://www.cvedetails.com/cve/CVE-2019-1559/
CWE-200
https://git.openssl.org/gitweb/?p=openssl.git;a=commitdiff;h=e9bbefbf0f24c57645e7ad6a5a71ae649d18ac8e
e9bbefbf0f24c57645e7ad6a5a71ae649d18ac8e
null
static int dtls1_record_replay_check(SSL *s, DTLS1_BITMAP *bitmap) { int cmp; unsigned int shift; const unsigned char *seq = s->s3->read_sequence; cmp = satsub64be(seq, bitmap->max_seq_num); if (cmp > 0) { memcpy(s->s3->rrec.seq_num, seq, 8); return 1; /* this record in new */ } shift = -cmp; if (shift >= sizeof(bitmap->map) * 8) return 0; /* stale, outside the window */ else if (bitmap->map & (1UL << shift)) return 0; /* record previously received */ memcpy(s->s3->rrec.seq_num, seq, 8); return 1; }
static int dtls1_record_replay_check(SSL *s, DTLS1_BITMAP *bitmap) { int cmp; unsigned int shift; const unsigned char *seq = s->s3->read_sequence; cmp = satsub64be(seq, bitmap->max_seq_num); if (cmp > 0) { memcpy(s->s3->rrec.seq_num, seq, 8); return 1; /* this record in new */ } shift = -cmp; if (shift >= sizeof(bitmap->map) * 8) return 0; /* stale, outside the window */ else if (bitmap->map & (1UL << shift)) return 0; /* record previously received */ memcpy(s->s3->rrec.seq_num, seq, 8); return 1; }
C
openssl
0
CVE-2015-6763
https://www.cvedetails.com/cve/CVE-2015-6763/
null
https://github.com/chromium/chromium/commit/f1574f25e1402e748bf2bd7e28ce3dd96ceb1ca4
f1574f25e1402e748bf2bd7e28ce3dd96ceb1ca4
MacViews: Enable secure text input for password Textfields. In Cocoa the NSTextInputContext automatically enables secure text input when activated and it's in the secure text entry mode. RenderWidgetHostViewMac did the similar thing for ages following the WebKit example. views::Textfield needs to do the same thing in a fashion that's sycnrhonized with RenderWidgetHostViewMac, otherwise the race conditions are possible when the Textfield gets focus, activates the secure text input mode and the RWHVM loses focus immediately afterwards and disables the secure text input instead of leaving it in the enabled state. BUG=818133,677220 Change-Id: I6db6c4b59e4a1a72cbb7f8c7056f71b04a3df08b Reviewed-on: https://chromium-review.googlesource.com/943064 Commit-Queue: Michail Pishchagin <[email protected]> Reviewed-by: Pavel Feldman <[email protected]> Reviewed-by: Avi Drissman <[email protected]> Reviewed-by: Peter Kasting <[email protected]> Cr-Commit-Position: refs/heads/master@{#542517}
void Textfield::SetColor(SkColor value) { GetRenderText()->SetColor(value); cursor_view_.layer()->SetColor(value); SchedulePaint(); }
void Textfield::SetColor(SkColor value) { GetRenderText()->SetColor(value); cursor_view_.layer()->SetColor(value); SchedulePaint(); }
C
Chrome
0
CVE-2014-1700
https://www.cvedetails.com/cve/CVE-2014-1700/
CWE-399
https://github.com/chromium/chromium/commit/685c3980d31b5199924086b8c93a1ce751d24733
685c3980d31b5199924086b8c93a1ce751d24733
content: Rename webkit_test_helpers.{cc,h} to blink_test_helpers.{cc,h} Now that webkit/ is gone, we are preparing ourselves for the merge of third_party/WebKit into //blink. BUG=None BUG=content_shell && content_unittests [email protected] Review URL: https://codereview.chromium.org/1118183003 Cr-Commit-Position: refs/heads/master@{#328202}
ShellContentBrowserClient::CreateRequestContextForStoragePartition( BrowserContext* content_browser_context, const base::FilePath& partition_path, bool in_memory, ProtocolHandlerMap* protocol_handlers, URLRequestInterceptorScopedVector request_interceptors) { ShellBrowserContext* shell_browser_context = ShellBrowserContextForBrowserContext(content_browser_context); return shell_browser_context->CreateRequestContextForStoragePartition( partition_path, in_memory, protocol_handlers, request_interceptors.Pass()); }
ShellContentBrowserClient::CreateRequestContextForStoragePartition( BrowserContext* content_browser_context, const base::FilePath& partition_path, bool in_memory, ProtocolHandlerMap* protocol_handlers, URLRequestInterceptorScopedVector request_interceptors) { ShellBrowserContext* shell_browser_context = ShellBrowserContextForBrowserContext(content_browser_context); return shell_browser_context->CreateRequestContextForStoragePartition( partition_path, in_memory, protocol_handlers, request_interceptors.Pass()); }
C
Chrome
0
CVE-2016-10030
https://www.cvedetails.com/cve/CVE-2016-10030/
CWE-284
https://github.com/SchedMD/slurm/commit/92362a92fffe60187df61f99ab11c249d44120ee
92362a92fffe60187df61f99ab11c249d44120ee
Fix security issue in _prolog_error(). Fix security issue caused by insecure file path handling triggered by the failure of a Prolog script. To exploit this a user needs to anticipate or cause the Prolog to fail for their job. (This commit is slightly different from the fix to the 15.08 branch.) CVE-2016-10030.
_gids_dup(gids_t *g) { int buf_size; gids_t *n = xmalloc(sizeof(gids_t)); n->ngids = g->ngids; buf_size = g->ngids * sizeof(gid_t); n->gids = xmalloc(buf_size); memcpy(n->gids, g->gids, buf_size); return n; }
_gids_dup(gids_t *g) { int buf_size; gids_t *n = xmalloc(sizeof(gids_t)); n->ngids = g->ngids; buf_size = g->ngids * sizeof(gid_t); n->gids = xmalloc(buf_size); memcpy(n->gids, g->gids, buf_size); return n; }
C
slurm
0
CVE-2016-8633
https://www.cvedetails.com/cve/CVE-2016-8633/
CWE-119
https://github.com/torvalds/linux/commit/667121ace9dbafb368618dbabcf07901c962ddac
667121ace9dbafb368618dbabcf07901c962ddac
firewire: net: guard against rx buffer overflows The IP-over-1394 driver firewire-net lacked input validation when handling incoming fragmented datagrams. A maliciously formed fragment with a respectively large datagram_offset would cause a memcpy past the datagram buffer. So, drop any packets carrying a fragment with offset + length larger than datagram_size. In addition, ensure that - GASP header, unfragmented encapsulation header, or fragment encapsulation header actually exists before we access it, - the encapsulated datagram or fragment is of nonzero size. Reported-by: Eyal Itkin <[email protected]> Reviewed-by: Eyal Itkin <[email protected]> Fixes: CVE 2016-8633 Cc: [email protected] Signed-off-by: Stefan Richter <[email protected]>
static inline void fwnet_make_uf_hdr(struct rfc2734_header *hdr, unsigned ether_type) { hdr->w0 = fwnet_set_hdr_lf(RFC2374_HDR_UNFRAG) | fwnet_set_hdr_ether_type(ether_type); }
static inline void fwnet_make_uf_hdr(struct rfc2734_header *hdr, unsigned ether_type) { hdr->w0 = fwnet_set_hdr_lf(RFC2374_HDR_UNFRAG) | fwnet_set_hdr_ether_type(ether_type); }
C
linux
0
CVE-2017-5009
https://www.cvedetails.com/cve/CVE-2017-5009/
CWE-119
https://github.com/chromium/chromium/commit/1c40f9042ae2d6ee7483d72998aabb5e73b2ff60
1c40f9042ae2d6ee7483d72998aabb5e73b2ff60
DevTools: send proper resource type in Network.RequestWillBeSent This patch plumbs resoure type into the DispatchWillSendRequest instrumenation. This allows us to report accurate type in Network.RequestWillBeSent event, instead of "Other", that we report today. BUG=765501 R=dgozman Change-Id: I0134c08b841e8dd247fdc8ff208bfd51e462709c Reviewed-on: https://chromium-review.googlesource.com/667504 Reviewed-by: Pavel Feldman <[email protected]> Reviewed-by: Dmitry Gozman <[email protected]> Commit-Queue: Andrey Lushnikov <[email protected]> Cr-Commit-Position: refs/heads/master@{#507936}
const KURL& FrameFetchContext::Url() const { if (IsDetached()) return frozen_state_->url; if (!document_) return NullURL(); return document_->Url(); }
const KURL& FrameFetchContext::Url() const { if (IsDetached()) return frozen_state_->url; if (!document_) return NullURL(); return document_->Url(); }
C
Chrome
0
CVE-2016-5768
https://www.cvedetails.com/cve/CVE-2016-5768/
CWE-415
https://github.com/php/php-src/commit/5b597a2e5b28e2d5a52fc1be13f425f08f47cb62?w=1
5b597a2e5b28e2d5a52fc1be13f425f08f47cb62?w=1
Fix bug #72402: _php_mb_regex_ereg_replace_exec - double free
static void _php_mb_regex_set_options(OnigOptionType options, OnigSyntaxType *syntax, OnigOptionType *prev_options, OnigSyntaxType **prev_syntax TSRMLS_DC) static void _php_mb_regex_set_options(OnigOptionType options, OnigSyntaxType *syntax, OnigOptionType *prev_options, OnigSyntaxType **prev_syntax TSRMLS_DC) { if (prev_options != NULL) { *prev_options = MBREX(regex_default_options); } if (prev_syntax != NULL) { *prev_syntax = MBREX(regex_default_syntax); } MBREX(regex_default_options) = options; MBREX(regex_default_syntax) = syntax; }
static void _php_mb_regex_set_options(OnigOptionType options, OnigSyntaxType *syntax, OnigOptionType *prev_options, OnigSyntaxType **prev_syntax TSRMLS_DC) { if (prev_options != NULL) { *prev_options = MBREX(regex_default_options); } if (prev_syntax != NULL) { *prev_syntax = MBREX(regex_default_syntax); } MBREX(regex_default_options) = options; MBREX(regex_default_syntax) = syntax; }
C
php-src
1
CVE-2015-1285
https://www.cvedetails.com/cve/CVE-2015-1285/
CWE-200
https://github.com/chromium/chromium/commit/39595f8d4dffcb644d438106dcb64a30c139ff0e
39595f8d4dffcb644d438106dcb64a30c139ff0e
[reland] Do not set default wallpaper unless it should do so. [email protected], [email protected] Bug: 751382 Change-Id: Id0793dfe467f737526a95b1e66ed01fbb8860bda Reviewed-on: https://chromium-review.googlesource.com/619754 Commit-Queue: Xiaoqian Dai <[email protected]> Reviewed-by: Alexander Alekseev <[email protected]> Reviewed-by: Biao She <[email protected]> Cr-Original-Commit-Position: refs/heads/master@{#498325} Reviewed-on: https://chromium-review.googlesource.com/646430 Cr-Commit-Position: refs/heads/master@{#498982}
rescaled_large_exists() const { return rescaled_large_exists_; }
rescaled_large_exists() const { return rescaled_large_exists_; }
C
Chrome
0
CVE-2016-1640
https://www.cvedetails.com/cve/CVE-2016-1640/
CWE-17
https://github.com/chromium/chromium/commit/0a1c15fecb1240ab909e1431b6127410c3b380e0
0a1c15fecb1240ab909e1431b6127410c3b380e0
Make the webstore inline install dialog be tab-modal Also clean up a few minor lint errors while I'm in here. BUG=550047 Review URL: https://codereview.chromium.org/1496033003 Cr-Commit-Position: refs/heads/master@{#363925}
void ExtensionInstallDialogView::InitView() { int left_column_width = (prompt_->ShouldShowPermissions() || prompt_->GetRetainedFileCount() > 0) ? kPermissionsLeftColumnWidth : kNoPermissionsLeftColumnWidth; if (is_external_install()) left_column_width = kExternalInstallLeftColumnWidth; int column_set_id = 0; views::GridLayout* layout = CreateLayout(left_column_width, column_set_id); ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); if (prompt_->has_webstore_data()) { layout->StartRow(0, column_set_id); views::View* rating = new views::View(); rating->SetLayoutManager(new views::BoxLayout( views::BoxLayout::kHorizontal, 0, 0, 0)); layout->AddView(rating); prompt_->AppendRatingStars(AddResourceIcon, rating); const gfx::FontList& small_font_list = rb.GetFontList(ui::ResourceBundle::SmallFont); views::Label* rating_count = new views::Label(prompt_->GetRatingCount(), small_font_list); rating_count->SetBorder(views::Border::CreateEmptyBorder(0, 2, 0, 0)); rating->AddChildView(rating_count); layout->StartRow(0, column_set_id); views::Label* user_count = new views::Label(prompt_->GetUserCount(), small_font_list); user_count->SetAutoColorReadabilityEnabled(false); user_count->SetEnabledColor(SK_ColorGRAY); layout->AddView(user_count); layout->StartRow(0, column_set_id); views::Link* store_link = new views::Link( l10n_util::GetStringUTF16(IDS_EXTENSION_PROMPT_STORE_LINK)); store_link->SetFontList(small_font_list); store_link->set_listener(this); layout->AddView(store_link); if (prompt_->ShouldShowPermissions()) { layout->AddPaddingRow(0, views::kRelatedControlVerticalSpacing); layout->StartRow(0, column_set_id); layout->AddView(new views::Separator(views::Separator::HORIZONTAL), 3, 1, views::GridLayout::FILL, views::GridLayout::FILL); } } int content_width = left_column_width + views::kPanelHorizMargin + kIconSize; CustomScrollableView* scrollable = new CustomScrollableView(); views::GridLayout* scroll_layout = new views::GridLayout(scrollable); scrollable->SetLayoutManager(scroll_layout); views::ColumnSet* scrollable_column_set = scroll_layout->AddColumnSet(column_set_id); int scrollable_width = prompt_->has_webstore_data() ? content_width : left_column_width; scrollable_column_set->AddColumn(views::GridLayout::LEADING, views::GridLayout::LEADING, 0, // no resizing views::GridLayout::USE_PREF, scrollable_width, scrollable_width); int padding_width = content_width + views::kButtonHEdgeMarginNew - scrollable_width; scrollable_column_set->AddPaddingColumn(0, padding_width); layout->StartRow(0, column_set_id); scroll_view_ = new views::ScrollView(); scroll_view_->set_hide_horizontal_scrollbar(true); scroll_view_->SetContents(scrollable); layout->AddView(scroll_view_, 4, 1); if (is_bundle_install()) { BundleInstaller::ItemList items = prompt_->bundle()->GetItemsWithState( BundleInstaller::Item::STATE_PENDING); scroll_layout->AddPaddingRow(0, views::kRelatedControlSmallVerticalSpacing); for (const BundleInstaller::Item& item : items) { scroll_layout->StartRow(0, column_set_id); views::Label* extension_label = new views::Label(item.GetNameForDisplay()); extension_label->SetMultiLine(true); extension_label->SetHorizontalAlignment(gfx::ALIGN_LEFT); extension_label->SizeToFit( scrollable_width - kSmallIconSize - kSmallIconPadding); gfx::ImageSkia image = gfx::ImageSkia::CreateFrom1xBitmap(item.icon); scroll_layout->AddView(new IconedView(extension_label, image)); } scroll_layout->AddPaddingRow(0, views::kRelatedControlVerticalSpacing); } if (prompt_->ShouldShowPermissions()) { bool has_permissions = prompt_->GetPermissionCount( ExtensionInstallPrompt::PermissionsType::ALL_PERMISSIONS) > 0; if (has_permissions) { AddPermissions( scroll_layout, rb, column_set_id, scrollable_width, ExtensionInstallPrompt::PermissionsType::REGULAR_PERMISSIONS); AddPermissions( scroll_layout, rb, column_set_id, scrollable_width, ExtensionInstallPrompt::PermissionsType::WITHHELD_PERMISSIONS); } else { scroll_layout->AddPaddingRow(0, views::kRelatedControlVerticalSpacing); scroll_layout->StartRow(0, column_set_id); views::Label* permission_label = new views::Label( l10n_util::GetStringUTF16(IDS_EXTENSION_NO_SPECIAL_PERMISSIONS)); permission_label->SetMultiLine(true); permission_label->SetHorizontalAlignment(gfx::ALIGN_LEFT); permission_label->SizeToFit(scrollable_width); scroll_layout->AddView(permission_label); } } if (prompt_->GetRetainedFileCount()) { scroll_layout->AddPaddingRow(0, views::kRelatedControlVerticalSpacing); scroll_layout->StartRow(0, column_set_id); views::Label* retained_files_header = new views::Label(prompt_->GetRetainedFilesHeading()); retained_files_header->SetMultiLine(true); retained_files_header->SetHorizontalAlignment(gfx::ALIGN_LEFT); retained_files_header->SizeToFit(scrollable_width); scroll_layout->AddView(retained_files_header); scroll_layout->StartRow(0, column_set_id); PermissionDetails details; for (size_t i = 0; i < prompt_->GetRetainedFileCount(); ++i) { details.push_back(prompt_->GetRetainedFile(i)); } ExpandableContainerView* issue_advice_view = new ExpandableContainerView(this, base::string16(), details, scrollable_width, false); scroll_layout->AddView(issue_advice_view); } if (prompt_->GetRetainedDeviceCount()) { scroll_layout->AddPaddingRow(0, views::kRelatedControlVerticalSpacing); scroll_layout->StartRow(0, column_set_id); views::Label* retained_devices_header = new views::Label(prompt_->GetRetainedDevicesHeading()); retained_devices_header->SetMultiLine(true); retained_devices_header->SetHorizontalAlignment(gfx::ALIGN_LEFT); retained_devices_header->SizeToFit(scrollable_width); scroll_layout->AddView(retained_devices_header); scroll_layout->StartRow(0, column_set_id); PermissionDetails details; for (size_t i = 0; i < prompt_->GetRetainedDeviceCount(); ++i) { details.push_back(prompt_->GetRetainedDeviceMessageString(i)); } ExpandableContainerView* issue_advice_view = new ExpandableContainerView(this, base::string16(), details, scrollable_width, false); scroll_layout->AddView(issue_advice_view); } DCHECK_GE(prompt_->type(), 0); UMA_HISTOGRAM_ENUMERATION("Extensions.InstallPrompt.Type", prompt_->type(), ExtensionInstallPrompt::NUM_PROMPT_TYPES); scroll_view_->ClipHeightTo( 0, std::min(kScrollViewMaxHeight, scrollable->GetPreferredSize().height())); dialog_size_ = gfx::Size( content_width + 2 * views::kButtonHEdgeMarginNew, container_->GetPreferredSize().height()); std::string event_name = ExperienceSamplingEvent::kExtensionInstallDialog; event_name.append( ExtensionInstallPrompt::PromptTypeToString(prompt_->type())); sampling_event_ = ExperienceSamplingEvent::Create(event_name); }
void ExtensionInstallDialogView::InitView() { int left_column_width = (prompt_->ShouldShowPermissions() || prompt_->GetRetainedFileCount() > 0) ? kPermissionsLeftColumnWidth : kNoPermissionsLeftColumnWidth; if (is_external_install()) left_column_width = kExternalInstallLeftColumnWidth; int column_set_id = 0; views::GridLayout* layout = CreateLayout(left_column_width, column_set_id); ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); if (prompt_->has_webstore_data()) { layout->StartRow(0, column_set_id); views::View* rating = new views::View(); rating->SetLayoutManager(new views::BoxLayout( views::BoxLayout::kHorizontal, 0, 0, 0)); layout->AddView(rating); prompt_->AppendRatingStars(AddResourceIcon, rating); const gfx::FontList& small_font_list = rb.GetFontList(ui::ResourceBundle::SmallFont); views::Label* rating_count = new views::Label(prompt_->GetRatingCount(), small_font_list); rating_count->SetBorder(views::Border::CreateEmptyBorder(0, 2, 0, 0)); rating->AddChildView(rating_count); layout->StartRow(0, column_set_id); views::Label* user_count = new views::Label(prompt_->GetUserCount(), small_font_list); user_count->SetAutoColorReadabilityEnabled(false); user_count->SetEnabledColor(SK_ColorGRAY); layout->AddView(user_count); layout->StartRow(0, column_set_id); views::Link* store_link = new views::Link( l10n_util::GetStringUTF16(IDS_EXTENSION_PROMPT_STORE_LINK)); store_link->SetFontList(small_font_list); store_link->set_listener(this); layout->AddView(store_link); if (prompt_->ShouldShowPermissions()) { layout->AddPaddingRow(0, views::kRelatedControlVerticalSpacing); layout->StartRow(0, column_set_id); layout->AddView(new views::Separator(views::Separator::HORIZONTAL), 3, 1, views::GridLayout::FILL, views::GridLayout::FILL); } } int content_width = left_column_width + views::kPanelHorizMargin + kIconSize; CustomScrollableView* scrollable = new CustomScrollableView(); views::GridLayout* scroll_layout = new views::GridLayout(scrollable); scrollable->SetLayoutManager(scroll_layout); views::ColumnSet* scrollable_column_set = scroll_layout->AddColumnSet(column_set_id); int scrollable_width = prompt_->has_webstore_data() ? content_width : left_column_width; scrollable_column_set->AddColumn(views::GridLayout::LEADING, views::GridLayout::LEADING, 0, // no resizing views::GridLayout::USE_PREF, scrollable_width, scrollable_width); int padding_width = content_width + views::kButtonHEdgeMarginNew - scrollable_width; scrollable_column_set->AddPaddingColumn(0, padding_width); layout->StartRow(0, column_set_id); scroll_view_ = new views::ScrollView(); scroll_view_->set_hide_horizontal_scrollbar(true); scroll_view_->SetContents(scrollable); layout->AddView(scroll_view_, 4, 1); if (is_bundle_install()) { BundleInstaller::ItemList items = prompt_->bundle()->GetItemsWithState( BundleInstaller::Item::STATE_PENDING); scroll_layout->AddPaddingRow(0, views::kRelatedControlSmallVerticalSpacing); for (const BundleInstaller::Item& item : items) { scroll_layout->StartRow(0, column_set_id); views::Label* extension_label = new views::Label(item.GetNameForDisplay()); extension_label->SetMultiLine(true); extension_label->SetHorizontalAlignment(gfx::ALIGN_LEFT); extension_label->SizeToFit( scrollable_width - kSmallIconSize - kSmallIconPadding); gfx::ImageSkia image = gfx::ImageSkia::CreateFrom1xBitmap(item.icon); scroll_layout->AddView(new IconedView(extension_label, image)); } scroll_layout->AddPaddingRow(0, views::kRelatedControlVerticalSpacing); } if (prompt_->ShouldShowPermissions()) { bool has_permissions = prompt_->GetPermissionCount( ExtensionInstallPrompt::PermissionsType::ALL_PERMISSIONS) > 0; if (has_permissions) { AddPermissions( scroll_layout, rb, column_set_id, scrollable_width, ExtensionInstallPrompt::PermissionsType::REGULAR_PERMISSIONS); AddPermissions( scroll_layout, rb, column_set_id, scrollable_width, ExtensionInstallPrompt::PermissionsType::WITHHELD_PERMISSIONS); } else { scroll_layout->AddPaddingRow(0, views::kRelatedControlVerticalSpacing); scroll_layout->StartRow(0, column_set_id); views::Label* permission_label = new views::Label( l10n_util::GetStringUTF16(IDS_EXTENSION_NO_SPECIAL_PERMISSIONS)); permission_label->SetMultiLine(true); permission_label->SetHorizontalAlignment(gfx::ALIGN_LEFT); permission_label->SizeToFit(scrollable_width); scroll_layout->AddView(permission_label); } } if (prompt_->GetRetainedFileCount()) { scroll_layout->AddPaddingRow(0, views::kRelatedControlVerticalSpacing); scroll_layout->StartRow(0, column_set_id); views::Label* retained_files_header = new views::Label(prompt_->GetRetainedFilesHeading()); retained_files_header->SetMultiLine(true); retained_files_header->SetHorizontalAlignment(gfx::ALIGN_LEFT); retained_files_header->SizeToFit(scrollable_width); scroll_layout->AddView(retained_files_header); scroll_layout->StartRow(0, column_set_id); PermissionDetails details; for (size_t i = 0; i < prompt_->GetRetainedFileCount(); ++i) { details.push_back(prompt_->GetRetainedFile(i)); } ExpandableContainerView* issue_advice_view = new ExpandableContainerView(this, base::string16(), details, scrollable_width, false); scroll_layout->AddView(issue_advice_view); } if (prompt_->GetRetainedDeviceCount()) { scroll_layout->AddPaddingRow(0, views::kRelatedControlVerticalSpacing); scroll_layout->StartRow(0, column_set_id); views::Label* retained_devices_header = new views::Label(prompt_->GetRetainedDevicesHeading()); retained_devices_header->SetMultiLine(true); retained_devices_header->SetHorizontalAlignment(gfx::ALIGN_LEFT); retained_devices_header->SizeToFit(scrollable_width); scroll_layout->AddView(retained_devices_header); scroll_layout->StartRow(0, column_set_id); PermissionDetails details; for (size_t i = 0; i < prompt_->GetRetainedDeviceCount(); ++i) { details.push_back(prompt_->GetRetainedDeviceMessageString(i)); } ExpandableContainerView* issue_advice_view = new ExpandableContainerView(this, base::string16(), details, scrollable_width, false); scroll_layout->AddView(issue_advice_view); } DCHECK(prompt_->type() >= 0); UMA_HISTOGRAM_ENUMERATION("Extensions.InstallPrompt.Type", prompt_->type(), ExtensionInstallPrompt::NUM_PROMPT_TYPES); scroll_view_->ClipHeightTo( 0, std::min(kScrollViewMaxHeight, scrollable->GetPreferredSize().height())); dialog_size_ = gfx::Size( content_width + 2 * views::kButtonHEdgeMarginNew, container_->GetPreferredSize().height()); std::string event_name = ExperienceSamplingEvent::kExtensionInstallDialog; event_name.append( ExtensionInstallPrompt::PromptTypeToString(prompt_->type())); sampling_event_ = ExperienceSamplingEvent::Create(event_name); }
C
Chrome
1
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 GamepadProvider::OnDevicesChanged(base::SystemMonitor::DeviceType type) { base::AutoLock lock(devices_changed_lock_); devices_changed_ = true; }
void GamepadProvider::OnDevicesChanged(base::SystemMonitor::DeviceType type) { base::AutoLock lock(devices_changed_lock_); devices_changed_ = true; }
C
Chrome
0
CVE-2013-6624
https://www.cvedetails.com/cve/CVE-2013-6624/
CWE-399
https://github.com/chromium/chromium/commit/36773850210becda3d76f27285ecd899fafdfc72
36773850210becda3d76f27285ecd899fafdfc72
Fix tracking of the id attribute string if it is shared across elements. The patch to remove AtomicStringImpl: http://src.chromium.org/viewvc/blink?view=rev&rev=154790 Exposed a lifetime issue with strings for id attributes. We simply need to use AtomicString. BUG=290566 Review URL: https://codereview.chromium.org/33793004 git-svn-id: svn://svn.chromium.org/blink/trunk@160250 bbb929c8-8fbe-4397-9dbb-9b2b20218538
explicit DialogHandler(v8::Handle<v8::Value> dialogArguments) : m_dialogArguments(dialogArguments) { }
explicit DialogHandler(v8::Handle<v8::Value> dialogArguments) : m_dialogArguments(dialogArguments) { }
C
Chrome
0
CVE-2016-5199
https://www.cvedetails.com/cve/CVE-2016-5199/
CWE-119
https://github.com/chromium/chromium/commit/c995d4fe5e96f4d6d4a88b7867279b08e72d2579
c995d4fe5e96f4d6d4a88b7867279b08e72d2579
Move IsDataSaverEnabledByUser to be a static method and use it This method now officially becomes the source of truth that everything in the code base eventually calls into to determine whether or not DataSaver is enabled. Bug: 934399 Change-Id: Iae837b710ace8cc3101188f79d02cbc2d4f0fd93 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1537242 Reviewed-by: Joshua Pawlicki <[email protected]> Reviewed-by: Tarun Bansal <[email protected]> Commit-Queue: Robert Ogden <[email protected]> Cr-Commit-Position: refs/heads/master@{#643948}
base::string16 ChromeContentBrowserClient::GetAppContainerSidForSandboxType( int sandbox_type) const { switch (sandbox_type) { case service_manager::SANDBOX_TYPE_RENDERER: return base::string16(install_static::GetSandboxSidPrefix()) + L"129201922"; case service_manager::SANDBOX_TYPE_UTILITY: return base::string16(); case service_manager::SANDBOX_TYPE_GPU: return base::string16(); case service_manager::SANDBOX_TYPE_PPAPI: return base::string16(install_static::GetSandboxSidPrefix()) + L"129201925"; #if BUILDFLAG(ENABLE_NACL) case PROCESS_TYPE_NACL_LOADER: return base::string16(); case PROCESS_TYPE_NACL_BROKER: return base::string16(); #endif } CHECK(0); return base::string16(); }
base::string16 ChromeContentBrowserClient::GetAppContainerSidForSandboxType( int sandbox_type) const { switch (sandbox_type) { case service_manager::SANDBOX_TYPE_RENDERER: return base::string16(install_static::GetSandboxSidPrefix()) + L"129201922"; case service_manager::SANDBOX_TYPE_UTILITY: return base::string16(); case service_manager::SANDBOX_TYPE_GPU: return base::string16(); case service_manager::SANDBOX_TYPE_PPAPI: return base::string16(install_static::GetSandboxSidPrefix()) + L"129201925"; #if BUILDFLAG(ENABLE_NACL) case PROCESS_TYPE_NACL_LOADER: return base::string16(); case PROCESS_TYPE_NACL_BROKER: return base::string16(); #endif } CHECK(0); return base::string16(); }
C
Chrome
0
CVE-2012-5149
https://www.cvedetails.com/cve/CVE-2012-5149/
CWE-189
https://github.com/chromium/chromium/commit/503bea2643350c6378de5f7a268b85cf2480e1ac
503bea2643350c6378de5f7a268b85cf2480e1ac
Improve validation when creating audio streams. BUG=166795 Review URL: https://codereview.chromium.org/11647012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@173981 0039d316-1c4b-4281-b951-d872f2087c98
void AudioInputRendererHost::DoSendRecordingMessage( media::AudioInputController* controller) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); }
void AudioInputRendererHost::DoSendRecordingMessage( media::AudioInputController* controller) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); }
C
Chrome
0
CVE-2016-2460
https://www.cvedetails.com/cve/CVE-2016-2460/
CWE-200
https://android.googlesource.com/platform/frameworks/native/+/a30d7d90c4f718e46fb41a99b3d52800e1011b73
a30d7d90c4f718e46fb41a99b3d52800e1011b73
BQ: fix some uninitialized variables Bug 27555981 Bug 27556038 Change-Id: I436b6fec589677d7e36c0e980f6e59808415dc0e
virtual status_t setTransformHint(uint32_t hint) { Parcel data, reply; data.writeInterfaceToken(IGraphicBufferConsumer::getInterfaceDescriptor()); data.writeUint32(hint); status_t result = remote()->transact(SET_TRANSFORM_HINT, data, &reply); if (result != NO_ERROR) { return result; } return reply.readInt32(); }
virtual status_t setTransformHint(uint32_t hint) { Parcel data, reply; data.writeInterfaceToken(IGraphicBufferConsumer::getInterfaceDescriptor()); data.writeUint32(hint); status_t result = remote()->transact(SET_TRANSFORM_HINT, data, &reply); if (result != NO_ERROR) { return result; } return reply.readInt32(); }
C
Android
0
CVE-2017-5035
https://www.cvedetails.com/cve/CVE-2017-5035/
CWE-362
https://github.com/chromium/chromium/commit/c32cd2069ae8062b52e5b7b1faf5936bd71a583a
c32cd2069ae8062b52e5b7b1faf5936bd71a583a
Add DumpWithoutCrashing in RendererDidNavigateToExistingPage This is intended to be reverted after investigating the linked bug. BUG=688425 CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_site_isolation Review-Url: https://codereview.chromium.org/2701523004 Cr-Commit-Position: refs/heads/master@{#450900}
void NavigationControllerImpl::ContinuePendingReload() { if (pending_reload_ == ReloadType::NONE) { NOTREACHED(); } else { Reload(pending_reload_, false); pending_reload_ = ReloadType::NONE; } }
void NavigationControllerImpl::ContinuePendingReload() { if (pending_reload_ == ReloadType::NONE) { NOTREACHED(); } else { Reload(pending_reload_, false); pending_reload_ = ReloadType::NONE; } }
C
Chrome
0
CVE-2016-5350
https://www.cvedetails.com/cve/CVE-2016-5350/
CWE-399
https://github.com/wireshark/wireshark/commit/b4d16b4495b732888e12baf5b8a7e9bf2665e22b
b4d16b4495b732888e12baf5b8a7e9bf2665e22b
SPOOLSS: Try to avoid an infinite loop. Use tvb_reported_length_remaining in dissect_spoolss_uint16uni. Make sure our offset always increments in dissect_spoolss_keybuffer. Change-Id: I7017c9685bb2fa27161d80a03b8fca4ef630e793 Reviewed-on: https://code.wireshark.org/review/14687 Reviewed-by: Gerald Combs <[email protected]> Petri-Dish: Gerald Combs <[email protected]> Tested-by: Petri Dish Buildbot <[email protected]> Reviewed-by: Michael Mann <[email protected]>
dissect_spoolss_doc_info(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, dcerpc_info *di, guint8 *drep) { proto_tree *subtree; guint32 level; subtree = proto_tree_add_subtree( tree, tvb, offset, 0, ett_DOC_INFO, NULL, "Document info"); offset = dissect_ndr_uint32( tvb, offset, pinfo, subtree, di, drep, hf_level, &level); offset = dissect_ndr_pointer( tvb, offset, pinfo, subtree, di, drep, dissect_spoolss_doc_info_data, NDR_POINTER_UNIQUE, "Document info", -1); return offset; }
dissect_spoolss_doc_info(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, dcerpc_info *di, guint8 *drep) { proto_tree *subtree; guint32 level; subtree = proto_tree_add_subtree( tree, tvb, offset, 0, ett_DOC_INFO, NULL, "Document info"); offset = dissect_ndr_uint32( tvb, offset, pinfo, subtree, di, drep, hf_level, &level); offset = dissect_ndr_pointer( tvb, offset, pinfo, subtree, di, drep, dissect_spoolss_doc_info_data, NDR_POINTER_UNIQUE, "Document info", -1); return offset; }
C
wireshark
0
CVE-2013-0921
https://www.cvedetails.com/cve/CVE-2013-0921/
CWE-264
https://github.com/chromium/chromium/commit/e9841fbdaf41b4a2baaa413f94d5c0197f9261f4
e9841fbdaf41b4a2baaa413f94d5c0197f9261f4
Ensure extensions and the Chrome Web Store are loaded in new BrowsingInstances. BUG=174943 TEST=Can't post message to CWS. See bug for repro steps. Review URL: https://chromiumcodereview.appspot.com/12301013 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@184208 0039d316-1c4b-4281-b951-d872f2087c98
bool ChromeContentBrowserClient::AllowWorkerDatabase( const GURL& url, const string16& name, const string16& display_name, unsigned long estimated_size, content::ResourceContext* context, const std::vector<std::pair<int, int> >& render_views) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); ProfileIOData* io_data = ProfileIOData::FromResourceContext(context); CookieSettings* cookie_settings = io_data->GetCookieSettings(); bool allow = cookie_settings->IsSettingCookieAllowed(url, url); std::vector<std::pair<int, int> >::const_iterator i; for (i = render_views.begin(); i != render_views.end(); ++i) { BrowserThread::PostTask( BrowserThread::UI, FROM_HERE, base::Bind(&TabSpecificContentSettings::WebDatabaseAccessed, i->first, i->second, url, name, display_name, !allow)); } return allow; }
bool ChromeContentBrowserClient::AllowWorkerDatabase( const GURL& url, const string16& name, const string16& display_name, unsigned long estimated_size, content::ResourceContext* context, const std::vector<std::pair<int, int> >& render_views) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); ProfileIOData* io_data = ProfileIOData::FromResourceContext(context); CookieSettings* cookie_settings = io_data->GetCookieSettings(); bool allow = cookie_settings->IsSettingCookieAllowed(url, url); std::vector<std::pair<int, int> >::const_iterator i; for (i = render_views.begin(); i != render_views.end(); ++i) { BrowserThread::PostTask( BrowserThread::UI, FROM_HERE, base::Bind(&TabSpecificContentSettings::WebDatabaseAccessed, i->first, i->second, url, name, display_name, !allow)); } return allow; }
C
Chrome
0
CVE-2016-6130
https://www.cvedetails.com/cve/CVE-2016-6130/
CWE-362
https://github.com/torvalds/linux/commit/532c34b5fbf1687df63b3fcd5b2846312ac943c6
532c34b5fbf1687df63b3fcd5b2846312ac943c6
s390/sclp_ctl: fix potential information leak with /dev/sclp The sclp_ctl_ioctl_sccb function uses two copy_from_user calls to retrieve the sclp request from user space. The first copy_from_user fetches the length of the request which is stored in the first two bytes of the request. The second copy_from_user gets the complete sclp request, but this copies the length field a second time. A malicious user may have changed the length in the meantime. Reported-by: Pengfei Wang <[email protected]> Reviewed-by: Michael Holzheu <[email protected]> Signed-off-by: Martin Schwidefsky <[email protected]>
static long sclp_ctl_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) { void __user *argp; if (is_compat_task()) argp = compat_ptr(arg); else argp = (void __user *) arg; switch (cmd) { case SCLP_CTL_SCCB: return sclp_ctl_ioctl_sccb(argp); default: /* unknown ioctl number */ return -ENOTTY; } }
static long sclp_ctl_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) { void __user *argp; if (is_compat_task()) argp = compat_ptr(arg); else argp = (void __user *) arg; switch (cmd) { case SCLP_CTL_SCCB: return sclp_ctl_ioctl_sccb(argp); default: /* unknown ioctl number */ return -ENOTTY; } }
C
linux
0
CVE-2012-2390
https://www.cvedetails.com/cve/CVE-2012-2390/
CWE-399
https://github.com/torvalds/linux/commit/c50ac050811d6485616a193eb0f37bfbd191cc89
c50ac050811d6485616a193eb0f37bfbd191cc89
hugetlb: fix resv_map leak in error path When called for anonymous (non-shared) mappings, hugetlb_reserve_pages() does a resv_map_alloc(). It depends on code in hugetlbfs's vm_ops->close() to release that allocation. However, in the mmap() failure path, we do a plain unmap_region() without the remove_vma() which actually calls vm_ops->close(). This is a decent fix. This leak could get reintroduced if new code (say, after hugetlb_reserve_pages() in hugetlbfs_file_mmap()) decides to return an error. But, I think it would have to unroll the reservation anyway. Christoph's test case: http://marc.info/?l=linux-mm&m=133728900729735 This patch applies to 3.4 and later. A version for earlier kernels is at https://lkml.org/lkml/2012/5/22/418. Signed-off-by: Dave Hansen <[email protected]> Acked-by: Mel Gorman <[email protected]> Acked-by: KOSAKI Motohiro <[email protected]> Reported-by: Christoph Lameter <[email protected]> Tested-by: Christoph Lameter <[email protected]> Cc: Andrea Arcangeli <[email protected]> Cc: <[email protected]> [2.6.32+] Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
static void __init gather_bootmem_prealloc(void) { struct huge_bootmem_page *m; list_for_each_entry(m, &huge_boot_pages, list) { struct hstate *h = m->hstate; struct page *page; #ifdef CONFIG_HIGHMEM page = pfn_to_page(m->phys >> PAGE_SHIFT); free_bootmem_late((unsigned long)m, sizeof(struct huge_bootmem_page)); #else page = virt_to_page(m); #endif __ClearPageReserved(page); WARN_ON(page_count(page) != 1); prep_compound_huge_page(page, h->order); prep_new_huge_page(h, page, page_to_nid(page)); /* * If we had gigantic hugepages allocated at boot time, we need * to restore the 'stolen' pages to totalram_pages in order to * fix confusing memory reports from free(1) and another * side-effects, like CommitLimit going negative. */ if (h->order > (MAX_ORDER - 1)) totalram_pages += 1 << h->order; } }
static void __init gather_bootmem_prealloc(void) { struct huge_bootmem_page *m; list_for_each_entry(m, &huge_boot_pages, list) { struct hstate *h = m->hstate; struct page *page; #ifdef CONFIG_HIGHMEM page = pfn_to_page(m->phys >> PAGE_SHIFT); free_bootmem_late((unsigned long)m, sizeof(struct huge_bootmem_page)); #else page = virt_to_page(m); #endif __ClearPageReserved(page); WARN_ON(page_count(page) != 1); prep_compound_huge_page(page, h->order); prep_new_huge_page(h, page, page_to_nid(page)); /* * If we had gigantic hugepages allocated at boot time, we need * to restore the 'stolen' pages to totalram_pages in order to * fix confusing memory reports from free(1) and another * side-effects, like CommitLimit going negative. */ if (h->order > (MAX_ORDER - 1)) totalram_pages += 1 << h->order; } }
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
static zend_object_value spl_filesystem_object_new_check(zend_class_entry *class_type TSRMLS_DC) { zend_object_value ret = spl_filesystem_object_new_ex(class_type, NULL TSRMLS_CC); ret.handlers = &spl_filesystem_object_check_handlers; return ret; }
static zend_object_value spl_filesystem_object_new_check(zend_class_entry *class_type TSRMLS_DC) { zend_object_value ret = spl_filesystem_object_new_ex(class_type, NULL TSRMLS_CC); ret.handlers = &spl_filesystem_object_check_handlers; return ret; }
C
php-src
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 BrowserCommandController::UpdatePrintingState() { bool print_enabled = CanPrint(browser_); command_updater_.UpdateCommandEnabled(IDC_PRINT, print_enabled); command_updater_.UpdateCommandEnabled(IDC_ADVANCED_PRINT, CanAdvancedPrint(browser_)); command_updater_.UpdateCommandEnabled(IDC_PRINT_TO_DESTINATION, print_enabled); #if defined(OS_WIN) HMODULE metro_module = base::win::GetMetroModule(); if (metro_module != NULL) { typedef void (*MetroEnablePrinting)(BOOL); MetroEnablePrinting metro_enable_printing = reinterpret_cast<MetroEnablePrinting>( ::GetProcAddress(metro_module, "MetroEnablePrinting")); if (metro_enable_printing) metro_enable_printing(print_enabled); } #endif }
void BrowserCommandController::UpdatePrintingState() { bool print_enabled = CanPrint(browser_); command_updater_.UpdateCommandEnabled(IDC_PRINT, print_enabled); command_updater_.UpdateCommandEnabled(IDC_ADVANCED_PRINT, CanAdvancedPrint(browser_)); command_updater_.UpdateCommandEnabled(IDC_PRINT_TO_DESTINATION, print_enabled); #if defined(OS_WIN) HMODULE metro_module = base::win::GetMetroModule(); if (metro_module != NULL) { typedef void (*MetroEnablePrinting)(BOOL); MetroEnablePrinting metro_enable_printing = reinterpret_cast<MetroEnablePrinting>( ::GetProcAddress(metro_module, "MetroEnablePrinting")); if (metro_enable_printing) metro_enable_printing(print_enabled); } #endif }
C
Chrome
0
CVE-2014-7822
https://www.cvedetails.com/cve/CVE-2014-7822/
CWE-264
https://github.com/torvalds/linux/commit/8d0207652cbe27d1f962050737848e5ad4671958
8d0207652cbe27d1f962050737848e5ad4671958
->splice_write() via ->write_iter() iter_file_splice_write() - a ->splice_write() instance that gathers the pipe buffers, builds a bio_vec-based iov_iter covering those and feeds it to ->write_iter(). A bunch of simple cases coverted to that... [AV: fixed the braino spotted by Cyrill] Signed-off-by: Al Viro <[email protected]>
static int ubifs_readpage(struct file *file, struct page *page) { if (ubifs_bulk_read(page)) return 0; do_readpage(page); unlock_page(page); return 0; }
static int ubifs_readpage(struct file *file, struct page *page) { if (ubifs_bulk_read(page)) return 0; do_readpage(page); unlock_page(page); return 0; }
C
linux
0
CVE-2011-3896
https://www.cvedetails.com/cve/CVE-2011-3896/
CWE-119
https://github.com/chromium/chromium/commit/5925dff83699508b5e2735afb0297dfb310e159d
5925dff83699508b5e2735afb0297dfb310e159d
Implement a bubble that appears at the top of the screen when a tab enters fullscreen mode via webkitRequestFullScreen(), telling the user how to exit fullscreen. This is implemented as an NSView rather than an NSWindow because the floating chrome that appears in presentation mode should overlap the bubble. Content-initiated fullscreen mode makes use of 'presentation mode' on the Mac: the mode in which the UI is hidden, accessible by moving the cursor to the top of the screen. On Snow Leopard, this mode is synonymous with fullscreen mode. On Lion, however, fullscreen mode does not imply presentation mode: in non-presentation fullscreen mode, the chrome is permanently shown. It is possible to switch between presentation mode and fullscreen mode using the presentation mode UI control. When a tab initiates fullscreen mode on Lion, we enter presentation mode if not in presentation mode already. When the user exits fullscreen mode using Chrome UI (i.e. keyboard shortcuts, menu items, buttons, switching tabs, etc.) we return the user to the mode they were in before the tab entered fullscreen. BUG=14471 TEST=Enter fullscreen mode using webkitRequestFullScreen. You should see a bubble pop down from the top of the screen. Need to test the Lion logic somehow, with no Lion trybots. BUG=96883 Original review http://codereview.chromium.org/7890056/ TBR=thakis Review URL: http://codereview.chromium.org/7920024 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@101624 0039d316-1c4b-4281-b951-d872f2087c98
TabContents* Browser::OpenApplication( Profile* profile, const Extension* extension, extension_misc::LaunchContainer container, WindowOpenDisposition disposition) { TabContents* tab = NULL; ExtensionPrefs* prefs = profile->GetExtensionService()->extension_prefs(); prefs->SetActiveBit(extension->id(), true); UMA_HISTOGRAM_ENUMERATION("Extensions.AppLaunchContainer", container, 100); switch (container) { case extension_misc::LAUNCH_WINDOW: case extension_misc::LAUNCH_PANEL: tab = Browser::OpenApplicationWindow(profile, extension, container, GURL(), NULL); break; case extension_misc::LAUNCH_TAB: { tab = Browser::OpenApplicationTab(profile, extension, disposition); break; } default: NOTREACHED(); break; } return tab; }
TabContents* Browser::OpenApplication( Profile* profile, const Extension* extension, extension_misc::LaunchContainer container, WindowOpenDisposition disposition) { TabContents* tab = NULL; ExtensionPrefs* prefs = profile->GetExtensionService()->extension_prefs(); prefs->SetActiveBit(extension->id(), true); UMA_HISTOGRAM_ENUMERATION("Extensions.AppLaunchContainer", container, 100); switch (container) { case extension_misc::LAUNCH_WINDOW: case extension_misc::LAUNCH_PANEL: tab = Browser::OpenApplicationWindow(profile, extension, container, GURL(), NULL); break; case extension_misc::LAUNCH_TAB: { tab = Browser::OpenApplicationTab(profile, extension, disposition); break; } default: NOTREACHED(); break; } return tab; }
C
Chrome
0
CVE-2018-6085
https://www.cvedetails.com/cve/CVE-2018-6085/
CWE-20
https://github.com/chromium/chromium/commit/df5b1e1f88e013bc96107cc52c4a4f33a8238444
df5b1e1f88e013bc96107cc52c4a4f33a8238444
Blockfile cache: fix long-standing sparse + evict reentrancy problem Thanks to nedwilliamson@ (on gmail) for an alternative perspective plus a reduction to make fixing this much easier. Bug: 826626, 518908, 537063, 802886 Change-Id: Ibfa01416f9a8e7f7b361e4f93b4b6b134728b85f Reviewed-on: https://chromium-review.googlesource.com/985052 Reviewed-by: Matt Menke <[email protected]> Commit-Queue: Maks Orlovich <[email protected]> Cr-Commit-Position: refs/heads/master@{#547103}
void BackendImpl::SyncEndEnumeration( std::unique_ptr<Rankings::Iterator> iterator) { iterator->Reset(); }
void BackendImpl::SyncEndEnumeration( std::unique_ptr<Rankings::Iterator> iterator) { iterator->Reset(); }
C
Chrome
0
CVE-2015-6787
https://www.cvedetails.com/cve/CVE-2015-6787/
null
https://github.com/chromium/chromium/commit/f911e11e7f6b5c0d6f5ee694a9871de6619889f7
f911e11e7f6b5c0d6f5ee694a9871de6619889f7
Reland "[CI] Make paint property nodes non-ref-counted" This reverts commit 887383b30842d9d9006e11bb6932660a3cb5b1b7. Reason for revert: Retry in M69. Original change's description: > Revert "[CI] Make paint property nodes non-ref-counted" > > This reverts commit 70fc0b018c9517558b7aa2be00edf2debb449123. > > Reason for revert: Caused bugs found by clusterfuzz > > Original change's description: > > [CI] Make paint property nodes non-ref-counted > > > > Now all paint property nodes are owned by ObjectPaintProperties > > (and LocalFrameView temporarily before removing non-RLS mode). > > Others just use raw pointers or references. > > > > Bug: 833496 > > Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2 > > Change-Id: I2d544fe153bb94698623248748df63c8aa2081ae > > Reviewed-on: https://chromium-review.googlesource.com/1031101 > > Reviewed-by: Tien-Ren Chen <[email protected]> > > Commit-Queue: Xianzhu Wang <[email protected]> > > Cr-Commit-Position: refs/heads/master@{#554626} > > [email protected],[email protected],[email protected] > > Change-Id: I02bb50d6744cb81a797246a0116b677e80a3c69f > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: 833496,837932,837943 > Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2 > Reviewed-on: https://chromium-review.googlesource.com/1034292 > Reviewed-by: Xianzhu Wang <[email protected]> > Commit-Queue: Xianzhu Wang <[email protected]> > Cr-Commit-Position: refs/heads/master@{#554653} [email protected],[email protected],[email protected] # Not skipping CQ checks because original CL landed > 1 day ago. Bug: 833496, 837932, 837943 Change-Id: I0b4ef70db1f1f211ba97c30d617225355c750992 Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2 Reviewed-on: https://chromium-review.googlesource.com/1083491 Commit-Queue: Xianzhu Wang <[email protected]> Reviewed-by: Xianzhu Wang <[email protected]> Cr-Commit-Position: refs/heads/master@{#563930}
static void Update(scoped_refptr<ClipPaintPropertyNode> node, static void Update(std::unique_ptr<ClipPaintPropertyNode>& node, const ClipPaintPropertyNode& new_parent, const FloatRoundedRect& new_clip_rect) { node->Update(new_parent, ClipPaintPropertyNode::State{nullptr, new_clip_rect}); }
static void Update(scoped_refptr<ClipPaintPropertyNode> node, scoped_refptr<const ClipPaintPropertyNode> new_parent, const FloatRoundedRect& new_clip_rect) { node->Update(std::move(new_parent), ClipPaintPropertyNode::State{nullptr, new_clip_rect}); }
C
Chrome
1
CVE-2015-6787
https://www.cvedetails.com/cve/CVE-2015-6787/
null
https://github.com/chromium/chromium/commit/f911e11e7f6b5c0d6f5ee694a9871de6619889f7
f911e11e7f6b5c0d6f5ee694a9871de6619889f7
Reland "[CI] Make paint property nodes non-ref-counted" This reverts commit 887383b30842d9d9006e11bb6932660a3cb5b1b7. Reason for revert: Retry in M69. Original change's description: > Revert "[CI] Make paint property nodes non-ref-counted" > > This reverts commit 70fc0b018c9517558b7aa2be00edf2debb449123. > > Reason for revert: Caused bugs found by clusterfuzz > > Original change's description: > > [CI] Make paint property nodes non-ref-counted > > > > Now all paint property nodes are owned by ObjectPaintProperties > > (and LocalFrameView temporarily before removing non-RLS mode). > > Others just use raw pointers or references. > > > > Bug: 833496 > > Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2 > > Change-Id: I2d544fe153bb94698623248748df63c8aa2081ae > > Reviewed-on: https://chromium-review.googlesource.com/1031101 > > Reviewed-by: Tien-Ren Chen <[email protected]> > > Commit-Queue: Xianzhu Wang <[email protected]> > > Cr-Commit-Position: refs/heads/master@{#554626} > > [email protected],[email protected],[email protected] > > Change-Id: I02bb50d6744cb81a797246a0116b677e80a3c69f > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: 833496,837932,837943 > Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2 > Reviewed-on: https://chromium-review.googlesource.com/1034292 > Reviewed-by: Xianzhu Wang <[email protected]> > Commit-Queue: Xianzhu Wang <[email protected]> > Cr-Commit-Position: refs/heads/master@{#554653} [email protected],[email protected],[email protected] # Not skipping CQ checks because original CL landed > 1 day ago. Bug: 833496, 837932, 837943 Change-Id: I0b4ef70db1f1f211ba97c30d617225355c750992 Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2 Reviewed-on: https://chromium-review.googlesource.com/1083491 Commit-Queue: Xianzhu Wang <[email protected]> Reviewed-by: Xianzhu Wang <[email protected]> Cr-Commit-Position: refs/heads/master@{#563930}
TestPaintArtifact& TestPaintArtifact::ScrollHitTest( DisplayItemClient& client, const TransformPaintPropertyNode& scroll_offset) { display_item_list_.AllocateAndConstruct<ScrollHitTestDisplayItem>( client, DisplayItem::kScrollHitTest, scroll_offset); return *this; }
TestPaintArtifact& TestPaintArtifact::ScrollHitTest( DisplayItemClient& client, scoped_refptr<const TransformPaintPropertyNode> scroll_offset) { display_item_list_.AllocateAndConstruct<ScrollHitTestDisplayItem>( client, DisplayItem::kScrollHitTest, std::move(scroll_offset)); return *this; }
C
Chrome
1
CVE-2018-11596
https://www.cvedetails.com/cve/CVE-2018-11596/
CWE-119
https://github.com/espruino/Espruino/commit/ce1924193862d58cb43d3d4d9dada710a8361b89
ce1924193862d58cb43d3d4d9dada710a8361b89
fix jsvGetString regression
bool jsvIsMemoryFull() { return !jsVarFirstEmpty; }
bool jsvIsMemoryFull() { return !jsVarFirstEmpty; }
C
Espruino
0
CVE-2010-4650
https://www.cvedetails.com/cve/CVE-2010-4650/
CWE-119
https://github.com/torvalds/linux/commit/7572777eef78ebdee1ecb7c258c0ef94d35bad16
7572777eef78ebdee1ecb7c258c0ef94d35bad16
fuse: verify ioctl retries Verify that the total length of the iovec returned in FUSE_IOCTL_RETRY doesn't overflow iov_length(). Signed-off-by: Miklos Szeredi <[email protected]> CC: Tejun Heo <[email protected]> CC: <[email protected]> [2.6.31+]
static int fuse_get_user_pages(struct fuse_req *req, const char __user *buf, size_t *nbytesp, int write) { size_t nbytes = *nbytesp; unsigned long user_addr = (unsigned long) buf; unsigned offset = user_addr & ~PAGE_MASK; int npages; /* Special case for kernel I/O: can copy directly into the buffer */ if (segment_eq(get_fs(), KERNEL_DS)) { if (write) req->in.args[1].value = (void *) user_addr; else req->out.args[0].value = (void *) user_addr; return 0; } nbytes = min_t(size_t, nbytes, FUSE_MAX_PAGES_PER_REQ << PAGE_SHIFT); npages = (nbytes + offset + PAGE_SIZE - 1) >> PAGE_SHIFT; npages = clamp(npages, 1, FUSE_MAX_PAGES_PER_REQ); npages = get_user_pages_fast(user_addr, npages, !write, req->pages); if (npages < 0) return npages; req->num_pages = npages; req->page_offset = offset; if (write) req->in.argpages = 1; else req->out.argpages = 1; nbytes = (req->num_pages << PAGE_SHIFT) - req->page_offset; *nbytesp = min(*nbytesp, nbytes); return 0; }
static int fuse_get_user_pages(struct fuse_req *req, const char __user *buf, size_t *nbytesp, int write) { size_t nbytes = *nbytesp; unsigned long user_addr = (unsigned long) buf; unsigned offset = user_addr & ~PAGE_MASK; int npages; /* Special case for kernel I/O: can copy directly into the buffer */ if (segment_eq(get_fs(), KERNEL_DS)) { if (write) req->in.args[1].value = (void *) user_addr; else req->out.args[0].value = (void *) user_addr; return 0; } nbytes = min_t(size_t, nbytes, FUSE_MAX_PAGES_PER_REQ << PAGE_SHIFT); npages = (nbytes + offset + PAGE_SIZE - 1) >> PAGE_SHIFT; npages = clamp(npages, 1, FUSE_MAX_PAGES_PER_REQ); npages = get_user_pages_fast(user_addr, npages, !write, req->pages); if (npages < 0) return npages; req->num_pages = npages; req->page_offset = offset; if (write) req->in.argpages = 1; else req->out.argpages = 1; nbytes = (req->num_pages << PAGE_SHIFT) - req->page_offset; *nbytesp = min(*nbytesp, nbytes); return 0; }
C
linux
0
CVE-2011-3896
https://www.cvedetails.com/cve/CVE-2011-3896/
CWE-119
https://github.com/chromium/chromium/commit/5925dff83699508b5e2735afb0297dfb310e159d
5925dff83699508b5e2735afb0297dfb310e159d
Implement a bubble that appears at the top of the screen when a tab enters fullscreen mode via webkitRequestFullScreen(), telling the user how to exit fullscreen. This is implemented as an NSView rather than an NSWindow because the floating chrome that appears in presentation mode should overlap the bubble. Content-initiated fullscreen mode makes use of 'presentation mode' on the Mac: the mode in which the UI is hidden, accessible by moving the cursor to the top of the screen. On Snow Leopard, this mode is synonymous with fullscreen mode. On Lion, however, fullscreen mode does not imply presentation mode: in non-presentation fullscreen mode, the chrome is permanently shown. It is possible to switch between presentation mode and fullscreen mode using the presentation mode UI control. When a tab initiates fullscreen mode on Lion, we enter presentation mode if not in presentation mode already. When the user exits fullscreen mode using Chrome UI (i.e. keyboard shortcuts, menu items, buttons, switching tabs, etc.) we return the user to the mode they were in before the tab entered fullscreen. BUG=14471 TEST=Enter fullscreen mode using webkitRequestFullScreen. You should see a bubble pop down from the top of the screen. Need to test the Lion logic somehow, with no Lion trybots. BUG=96883 Original review http://codereview.chromium.org/7890056/ TBR=thakis Review URL: http://codereview.chromium.org/7920024 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@101624 0039d316-1c4b-4281-b951-d872f2087c98
void Browser::ExecuteCommandWithDisposition( int id, WindowOpenDisposition disposition) { if (!GetSelectedTabContentsWrapper()) return; DCHECK(command_updater_.IsCommandEnabled(id)) << "Invalid/disabled command " << id; if (block_command_execution_) { DCHECK_EQ(last_blocked_command_id_, -1); last_blocked_command_id_ = id; last_blocked_command_disposition_ = disposition; return; } switch (id) { case IDC_BACK: GoBack(disposition); break; case IDC_FORWARD: GoForward(disposition); break; case IDC_RELOAD: Reload(disposition); break; case IDC_RELOAD_IGNORING_CACHE: ReloadIgnoringCache(disposition); break; case IDC_HOME: Home(disposition); break; case IDC_OPEN_CURRENT_URL: OpenCurrentURL(); break; case IDC_STOP: Stop(); break; case IDC_NEW_WINDOW: NewWindow(); break; case IDC_NEW_INCOGNITO_WINDOW: NewIncognitoWindow(); break; case IDC_CLOSE_WINDOW: CloseWindow(); break; case IDC_NEW_TAB: NewTab(); break; case IDC_CLOSE_TAB: CloseTab(); break; case IDC_SELECT_NEXT_TAB: SelectNextTab(); break; case IDC_SELECT_PREVIOUS_TAB: SelectPreviousTab(); break; case IDC_TABPOSE: OpenTabpose(); break; case IDC_MOVE_TAB_NEXT: MoveTabNext(); break; case IDC_MOVE_TAB_PREVIOUS: MoveTabPrevious(); break; case IDC_SELECT_TAB_0: case IDC_SELECT_TAB_1: case IDC_SELECT_TAB_2: case IDC_SELECT_TAB_3: case IDC_SELECT_TAB_4: case IDC_SELECT_TAB_5: case IDC_SELECT_TAB_6: case IDC_SELECT_TAB_7: SelectNumberedTab(id - IDC_SELECT_TAB_0); break; case IDC_SELECT_LAST_TAB: SelectLastTab(); break; case IDC_DUPLICATE_TAB: DuplicateTab(); break; case IDC_RESTORE_TAB: RestoreTab(); break; case IDC_COPY_URL: WriteCurrentURLToClipboard(); break; case IDC_SHOW_AS_TAB: ConvertPopupToTabbedBrowser(); break; case IDC_FULLSCREEN: ToggleFullscreenMode(); break; #if defined(OS_MACOSX) case IDC_PRESENTATION_MODE: TogglePresentationMode(); break; #endif case IDC_EXIT: Exit(); break; case IDC_TOGGLE_VERTICAL_TABS: ToggleUseVerticalTabs(); break; case IDC_COMPACT_NAVBAR: ToggleUseCompactNavigationBar(); break; #if defined(OS_CHROMEOS) case IDC_SEARCH: Search(); break; case IDC_SHOW_KEYBOARD_OVERLAY: ShowKeyboardOverlay(); break; #endif case IDC_SAVE_PAGE: SavePage(); break; case IDC_BOOKMARK_PAGE: BookmarkCurrentPage(); break; case IDC_BOOKMARK_ALL_TABS: BookmarkAllTabs(); break; case IDC_VIEW_SOURCE: ViewSelectedSource(); break; case IDC_EMAIL_PAGE_LOCATION: EmailPageLocation(); break; case IDC_PRINT: Print(); break; case IDC_ADVANCED_PRINT: AdvancedPrint(); break; case IDC_ENCODING_AUTO_DETECT: ToggleEncodingAutoDetect(); break; case IDC_ENCODING_UTF8: case IDC_ENCODING_UTF16LE: case IDC_ENCODING_ISO88591: case IDC_ENCODING_WINDOWS1252: case IDC_ENCODING_GBK: case IDC_ENCODING_GB18030: case IDC_ENCODING_BIG5HKSCS: case IDC_ENCODING_BIG5: case IDC_ENCODING_KOREAN: case IDC_ENCODING_SHIFTJIS: case IDC_ENCODING_ISO2022JP: case IDC_ENCODING_EUCJP: case IDC_ENCODING_THAI: case IDC_ENCODING_ISO885915: case IDC_ENCODING_MACINTOSH: case IDC_ENCODING_ISO88592: case IDC_ENCODING_WINDOWS1250: case IDC_ENCODING_ISO88595: case IDC_ENCODING_WINDOWS1251: case IDC_ENCODING_KOI8R: case IDC_ENCODING_KOI8U: case IDC_ENCODING_ISO88597: case IDC_ENCODING_WINDOWS1253: case IDC_ENCODING_ISO88594: case IDC_ENCODING_ISO885913: case IDC_ENCODING_WINDOWS1257: case IDC_ENCODING_ISO88593: case IDC_ENCODING_ISO885910: case IDC_ENCODING_ISO885914: case IDC_ENCODING_ISO885916: case IDC_ENCODING_WINDOWS1254: case IDC_ENCODING_ISO88596: case IDC_ENCODING_WINDOWS1256: case IDC_ENCODING_ISO88598: case IDC_ENCODING_ISO88598I: case IDC_ENCODING_WINDOWS1255: case IDC_ENCODING_WINDOWS1258: OverrideEncoding(id); break; case IDC_CUT: Cut(); break; case IDC_COPY: Copy(); break; case IDC_PASTE: Paste(); break; case IDC_FIND: Find(); break; case IDC_FIND_NEXT: FindNext(); break; case IDC_FIND_PREVIOUS: FindPrevious(); break; case IDC_ZOOM_PLUS: Zoom(PageZoom::ZOOM_IN); break; case IDC_ZOOM_NORMAL: Zoom(PageZoom::RESET); break; case IDC_ZOOM_MINUS: Zoom(PageZoom::ZOOM_OUT); break; case IDC_FOCUS_TOOLBAR: FocusToolbar(); break; case IDC_FOCUS_LOCATION: FocusLocationBar(); break; case IDC_FOCUS_SEARCH: FocusSearch(); break; case IDC_FOCUS_MENU_BAR: FocusAppMenu(); break; case IDC_FOCUS_BOOKMARKS: FocusBookmarksToolbar(); break; case IDC_FOCUS_CHROMEOS_STATUS: FocusChromeOSStatus(); break; case IDC_FOCUS_NEXT_PANE: FocusNextPane(); break; case IDC_FOCUS_PREVIOUS_PANE: FocusPreviousPane(); break; case IDC_OPEN_FILE: OpenFile(); break; case IDC_CREATE_SHORTCUTS: OpenCreateShortcutsDialog(); break; case IDC_DEV_TOOLS: ToggleDevToolsWindow( DEVTOOLS_TOGGLE_ACTION_NONE); break; case IDC_DEV_TOOLS_CONSOLE: ToggleDevToolsWindow( DEVTOOLS_TOGGLE_ACTION_SHOW_CONSOLE); break; case IDC_DEV_TOOLS_INSPECT: ToggleDevToolsWindow( DEVTOOLS_TOGGLE_ACTION_INSPECT); break; case IDC_TASK_MANAGER: OpenTaskManager(false); break; case IDC_VIEW_BACKGROUND_PAGES: OpenTaskManager(true); break; case IDC_FEEDBACK: OpenBugReportDialog(); break; case IDC_SHOW_BOOKMARK_BAR: ToggleBookmarkBar(); break; case IDC_PROFILING_ENABLED: Profiling::Toggle(); break; case IDC_SHOW_BOOKMARK_MANAGER: OpenBookmarkManager(); break; case IDC_SHOW_APP_MENU: ShowAppMenu(); break; case IDC_SHOW_HISTORY: ShowHistoryTab(); break; case IDC_SHOW_DOWNLOADS: ShowDownloadsTab(); break; case IDC_MANAGE_EXTENSIONS: ShowExtensionsTab(); break; case IDC_SYNC_BOOKMARKS: OpenSyncMyBookmarksDialog(); break; case IDC_OPTIONS: OpenOptionsDialog(); break; case IDC_EDIT_SEARCH_ENGINES: OpenSearchEngineOptionsDialog(); break; case IDC_VIEW_PASSWORDS: OpenPasswordManager(); break; case IDC_CLEAR_BROWSING_DATA: OpenClearBrowsingDataDialog(); break; case IDC_IMPORT_SETTINGS: OpenImportSettingsDialog(); break; case IDC_ABOUT: OpenAboutChromeDialog(); break; case IDC_UPGRADE_DIALOG: OpenUpdateChromeDialog(); break; case IDC_VIEW_INCOMPATIBILITIES: ShowAboutConflictsTab(); break; case IDC_HELP_PAGE: ShowHelpTab(); break; #if defined(OS_CHROMEOS) case IDC_FILE_MANAGER: OpenFileManager(); break; case IDC_SYSTEM_OPTIONS: OpenSystemOptionsDialog(); break; case IDC_INTERNET_OPTIONS: OpenInternetOptionsDialog(); break; case IDC_LANGUAGE_OPTIONS: OpenLanguageOptionsDialog(); break; #endif case IDC_SHOW_SYNC_SETUP: ShowSyncSetup(); break; case IDC_TOGGLE_SPEECH_INPUT: ToggleSpeechInput(); break; default: LOG(WARNING) << "Received Unimplemented Command: " << id; break; } }
void Browser::ExecuteCommandWithDisposition( int id, WindowOpenDisposition disposition) { if (!GetSelectedTabContentsWrapper()) return; DCHECK(command_updater_.IsCommandEnabled(id)) << "Invalid/disabled command " << id; if (block_command_execution_) { DCHECK_EQ(last_blocked_command_id_, -1); last_blocked_command_id_ = id; last_blocked_command_disposition_ = disposition; return; } switch (id) { case IDC_BACK: GoBack(disposition); break; case IDC_FORWARD: GoForward(disposition); break; case IDC_RELOAD: Reload(disposition); break; case IDC_RELOAD_IGNORING_CACHE: ReloadIgnoringCache(disposition); break; case IDC_HOME: Home(disposition); break; case IDC_OPEN_CURRENT_URL: OpenCurrentURL(); break; case IDC_STOP: Stop(); break; case IDC_NEW_WINDOW: NewWindow(); break; case IDC_NEW_INCOGNITO_WINDOW: NewIncognitoWindow(); break; case IDC_CLOSE_WINDOW: CloseWindow(); break; case IDC_NEW_TAB: NewTab(); break; case IDC_CLOSE_TAB: CloseTab(); break; case IDC_SELECT_NEXT_TAB: SelectNextTab(); break; case IDC_SELECT_PREVIOUS_TAB: SelectPreviousTab(); break; case IDC_TABPOSE: OpenTabpose(); break; case IDC_MOVE_TAB_NEXT: MoveTabNext(); break; case IDC_MOVE_TAB_PREVIOUS: MoveTabPrevious(); break; case IDC_SELECT_TAB_0: case IDC_SELECT_TAB_1: case IDC_SELECT_TAB_2: case IDC_SELECT_TAB_3: case IDC_SELECT_TAB_4: case IDC_SELECT_TAB_5: case IDC_SELECT_TAB_6: case IDC_SELECT_TAB_7: SelectNumberedTab(id - IDC_SELECT_TAB_0); break; case IDC_SELECT_LAST_TAB: SelectLastTab(); break; case IDC_DUPLICATE_TAB: DuplicateTab(); break; case IDC_RESTORE_TAB: RestoreTab(); break; case IDC_COPY_URL: WriteCurrentURLToClipboard(); break; case IDC_SHOW_AS_TAB: ConvertPopupToTabbedBrowser(); break; case IDC_FULLSCREEN: ToggleFullscreenMode(); break; #if defined(OS_MACOSX) case IDC_PRESENTATION_MODE: TogglePresentationMode(); break; #endif case IDC_EXIT: Exit(); break; case IDC_TOGGLE_VERTICAL_TABS: ToggleUseVerticalTabs(); break; case IDC_COMPACT_NAVBAR: ToggleUseCompactNavigationBar(); break; #if defined(OS_CHROMEOS) case IDC_SEARCH: Search(); break; case IDC_SHOW_KEYBOARD_OVERLAY: ShowKeyboardOverlay(); break; #endif case IDC_SAVE_PAGE: SavePage(); break; case IDC_BOOKMARK_PAGE: BookmarkCurrentPage(); break; case IDC_BOOKMARK_ALL_TABS: BookmarkAllTabs(); break; case IDC_VIEW_SOURCE: ViewSelectedSource(); break; case IDC_EMAIL_PAGE_LOCATION: EmailPageLocation(); break; case IDC_PRINT: Print(); break; case IDC_ADVANCED_PRINT: AdvancedPrint(); break; case IDC_ENCODING_AUTO_DETECT: ToggleEncodingAutoDetect(); break; case IDC_ENCODING_UTF8: case IDC_ENCODING_UTF16LE: case IDC_ENCODING_ISO88591: case IDC_ENCODING_WINDOWS1252: case IDC_ENCODING_GBK: case IDC_ENCODING_GB18030: case IDC_ENCODING_BIG5HKSCS: case IDC_ENCODING_BIG5: case IDC_ENCODING_KOREAN: case IDC_ENCODING_SHIFTJIS: case IDC_ENCODING_ISO2022JP: case IDC_ENCODING_EUCJP: case IDC_ENCODING_THAI: case IDC_ENCODING_ISO885915: case IDC_ENCODING_MACINTOSH: case IDC_ENCODING_ISO88592: case IDC_ENCODING_WINDOWS1250: case IDC_ENCODING_ISO88595: case IDC_ENCODING_WINDOWS1251: case IDC_ENCODING_KOI8R: case IDC_ENCODING_KOI8U: case IDC_ENCODING_ISO88597: case IDC_ENCODING_WINDOWS1253: case IDC_ENCODING_ISO88594: case IDC_ENCODING_ISO885913: case IDC_ENCODING_WINDOWS1257: case IDC_ENCODING_ISO88593: case IDC_ENCODING_ISO885910: case IDC_ENCODING_ISO885914: case IDC_ENCODING_ISO885916: case IDC_ENCODING_WINDOWS1254: case IDC_ENCODING_ISO88596: case IDC_ENCODING_WINDOWS1256: case IDC_ENCODING_ISO88598: case IDC_ENCODING_ISO88598I: case IDC_ENCODING_WINDOWS1255: case IDC_ENCODING_WINDOWS1258: OverrideEncoding(id); break; case IDC_CUT: Cut(); break; case IDC_COPY: Copy(); break; case IDC_PASTE: Paste(); break; case IDC_FIND: Find(); break; case IDC_FIND_NEXT: FindNext(); break; case IDC_FIND_PREVIOUS: FindPrevious(); break; case IDC_ZOOM_PLUS: Zoom(PageZoom::ZOOM_IN); break; case IDC_ZOOM_NORMAL: Zoom(PageZoom::RESET); break; case IDC_ZOOM_MINUS: Zoom(PageZoom::ZOOM_OUT); break; case IDC_FOCUS_TOOLBAR: FocusToolbar(); break; case IDC_FOCUS_LOCATION: FocusLocationBar(); break; case IDC_FOCUS_SEARCH: FocusSearch(); break; case IDC_FOCUS_MENU_BAR: FocusAppMenu(); break; case IDC_FOCUS_BOOKMARKS: FocusBookmarksToolbar(); break; case IDC_FOCUS_CHROMEOS_STATUS: FocusChromeOSStatus(); break; case IDC_FOCUS_NEXT_PANE: FocusNextPane(); break; case IDC_FOCUS_PREVIOUS_PANE: FocusPreviousPane(); break; case IDC_OPEN_FILE: OpenFile(); break; case IDC_CREATE_SHORTCUTS: OpenCreateShortcutsDialog(); break; case IDC_DEV_TOOLS: ToggleDevToolsWindow( DEVTOOLS_TOGGLE_ACTION_NONE); break; case IDC_DEV_TOOLS_CONSOLE: ToggleDevToolsWindow( DEVTOOLS_TOGGLE_ACTION_SHOW_CONSOLE); break; case IDC_DEV_TOOLS_INSPECT: ToggleDevToolsWindow( DEVTOOLS_TOGGLE_ACTION_INSPECT); break; case IDC_TASK_MANAGER: OpenTaskManager(false); break; case IDC_VIEW_BACKGROUND_PAGES: OpenTaskManager(true); break; case IDC_FEEDBACK: OpenBugReportDialog(); break; case IDC_SHOW_BOOKMARK_BAR: ToggleBookmarkBar(); break; case IDC_PROFILING_ENABLED: Profiling::Toggle(); break; case IDC_SHOW_BOOKMARK_MANAGER: OpenBookmarkManager(); break; case IDC_SHOW_APP_MENU: ShowAppMenu(); break; case IDC_SHOW_HISTORY: ShowHistoryTab(); break; case IDC_SHOW_DOWNLOADS: ShowDownloadsTab(); break; case IDC_MANAGE_EXTENSIONS: ShowExtensionsTab(); break; case IDC_SYNC_BOOKMARKS: OpenSyncMyBookmarksDialog(); break; case IDC_OPTIONS: OpenOptionsDialog(); break; case IDC_EDIT_SEARCH_ENGINES: OpenSearchEngineOptionsDialog(); break; case IDC_VIEW_PASSWORDS: OpenPasswordManager(); break; case IDC_CLEAR_BROWSING_DATA: OpenClearBrowsingDataDialog(); break; case IDC_IMPORT_SETTINGS: OpenImportSettingsDialog(); break; case IDC_ABOUT: OpenAboutChromeDialog(); break; case IDC_UPGRADE_DIALOG: OpenUpdateChromeDialog(); break; case IDC_VIEW_INCOMPATIBILITIES: ShowAboutConflictsTab(); break; case IDC_HELP_PAGE: ShowHelpTab(); break; #if defined(OS_CHROMEOS) case IDC_FILE_MANAGER: OpenFileManager(); break; case IDC_SYSTEM_OPTIONS: OpenSystemOptionsDialog(); break; case IDC_INTERNET_OPTIONS: OpenInternetOptionsDialog(); break; case IDC_LANGUAGE_OPTIONS: OpenLanguageOptionsDialog(); break; #endif case IDC_SHOW_SYNC_SETUP: ShowSyncSetup(); break; case IDC_TOGGLE_SPEECH_INPUT: ToggleSpeechInput(); break; default: LOG(WARNING) << "Received Unimplemented Command: " << id; break; } }
C
Chrome
0
CVE-2018-6196
https://www.cvedetails.com/cve/CVE-2018-6196/
CWE-835
https://github.com/tats/w3m/commit/8354763b90490d4105695df52674d0fcef823e92
8354763b90490d4105695df52674d0fcef823e92
Prevent negative indent value in feed_table_block_tag() Bug-Debian: https://github.com/tats/w3m/issues/88
bsearch_2short(short e1, short *ent1, short e2, short *ent2, int base, short *indexarray, int nent) { int n = nent; int k = 0; int e = e1 * base + e2; while (n > 0) { int nn = n / 2; int idx = indexarray[k + nn]; int ne = ent1[idx] * base + ent2[idx]; if (ne == e) { k += nn; break; } else if (ne < e) { n -= nn + 1; k += nn + 1; } else { n = nn; } } return k; }
bsearch_2short(short e1, short *ent1, short e2, short *ent2, int base, short *indexarray, int nent) { int n = nent; int k = 0; int e = e1 * base + e2; while (n > 0) { int nn = n / 2; int idx = indexarray[k + nn]; int ne = ent1[idx] * base + ent2[idx]; if (ne == e) { k += nn; break; } else if (ne < e) { n -= nn + 1; k += nn + 1; } else { n = nn; } } return k; }
C
w3m
0
CVE-2011-2797
https://www.cvedetails.com/cve/CVE-2011-2797/
CWE-399
https://github.com/chromium/chromium/commit/80742f2ffeb9e90cd85cbee27acb9f924ffebd16
80742f2ffeb9e90cd85cbee27acb9f924ffebd16
Add support for the "uploadrequired" attribute for Autofill query responses BUG=84693 TEST=unit_tests --gtest_filter=AutofillDownloadTest.QueryAndUploadTest Review URL: http://codereview.chromium.org/6969090 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@87729 0039d316-1c4b-4281-b951-d872f2087c98
void AutofillManager::OnFormsSeen(const std::vector<FormData>& forms) { bool enabled = IsAutofillEnabled(); if (!has_logged_autofill_enabled_) { metric_logger_->LogIsAutofillEnabledAtPageLoad(enabled); has_logged_autofill_enabled_ = true; } if (!enabled) return; ParseForms(forms); }
void AutofillManager::OnFormsSeen(const std::vector<FormData>& forms) { bool enabled = IsAutofillEnabled(); if (!has_logged_autofill_enabled_) { metric_logger_->LogIsAutofillEnabledAtPageLoad(enabled); has_logged_autofill_enabled_ = true; } if (!enabled) return; ParseForms(forms); }
C
Chrome
0
CVE-2017-5019
https://www.cvedetails.com/cve/CVE-2017-5019/
CWE-416
https://github.com/chromium/chromium/commit/f03ea5a5c2ff26e239dfd23e263b15da2d9cee93
f03ea5a5c2ff26e239dfd23e263b15da2d9cee93
Convert FrameHostMsg_DidAddMessageToConsole to Mojo. Note: Since this required changing the test RenderViewImplTest.DispatchBeforeUnloadCanDetachFrame, I manually re-introduced https://crbug.com/666714 locally (the bug the test was added for), and reran the test to confirm that it still covers the bug. Bug: 786836 Change-Id: I110668fa6f0f261fd2ac36bb91a8d8b31c99f4f1 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1526270 Commit-Queue: Lowell Manners <[email protected]> Reviewed-by: Daniel Cheng <[email protected]> Reviewed-by: Camille Lamy <[email protected]> Cr-Commit-Position: refs/heads/master@{#653137}
void RenderFrameImpl::PostMessageEvent(int32_t source_routing_id, const base::string16& source_origin, const base::string16& target_origin, blink::TransferableMessage message) { message.EnsureDataIsOwned(); WebFrame* source_frame = nullptr; if (source_routing_id != MSG_ROUTING_NONE) { RenderFrameProxy* source_proxy = RenderFrameProxy::FromRoutingID(source_routing_id); if (source_proxy) source_frame = source_proxy->web_frame(); } WebSecurityOrigin target_security_origin; if (!target_origin.empty()) { target_security_origin = WebSecurityOrigin::CreateFromString( WebString::FromUTF16(target_origin)); } WebDOMMessageEvent msg_event(std::move(message), WebString::FromUTF16(source_origin), source_frame, frame_->GetDocument()); frame_->DispatchMessageEventWithOriginCheck(target_security_origin, msg_event, message.has_user_gesture); }
void RenderFrameImpl::PostMessageEvent(int32_t source_routing_id, const base::string16& source_origin, const base::string16& target_origin, blink::TransferableMessage message) { message.EnsureDataIsOwned(); WebFrame* source_frame = nullptr; if (source_routing_id != MSG_ROUTING_NONE) { RenderFrameProxy* source_proxy = RenderFrameProxy::FromRoutingID(source_routing_id); if (source_proxy) source_frame = source_proxy->web_frame(); } WebSecurityOrigin target_security_origin; if (!target_origin.empty()) { target_security_origin = WebSecurityOrigin::CreateFromString( WebString::FromUTF16(target_origin)); } WebDOMMessageEvent msg_event(std::move(message), WebString::FromUTF16(source_origin), source_frame, frame_->GetDocument()); frame_->DispatchMessageEventWithOriginCheck(target_security_origin, msg_event, message.has_user_gesture); }
C
Chrome
0