CVE ID
stringlengths
13
43
CVE Page
stringlengths
45
48
CWE ID
stringclasses
90 values
codeLink
stringlengths
46
139
commit_id
stringlengths
6
81
commit_message
stringlengths
3
13.3k
func_after
stringlengths
14
241k
func_before
stringlengths
14
241k
lang
stringclasses
3 values
project
stringclasses
309 values
vul
int8
0
1
null
null
null
https://github.com/chromium/chromium/commit/dc3857aac17be72c96f28d860d875235b3be349a
dc3857aac17be72c96f28d860d875235b3be349a
Unreviewed, rolling out r142736. http://trac.webkit.org/changeset/142736 https://bugs.webkit.org/show_bug.cgi?id=109716 Broke ABI, nightly builds crash on launch (Requested by ap on #webkit). Patch by Sheriff Bot <webkit.review.bot@gmail.com> on 2013-02-13 Source/WebKit2: * Shared/APIClientTraits.cpp: (WebKit): * Shared/APIClientTraits.h: * UIProcess/API/C/WKPage.h: * UIProcess/API/gtk/WebKitLoaderClient.cpp: (attachLoaderClientToView): * WebProcess/InjectedBundle/API/c/WKBundlePage.h: * WebProcess/qt/QtBuiltinBundlePage.cpp: (WebKit::QtBuiltinBundlePage::QtBuiltinBundlePage): Tools: * MiniBrowser/mac/WK2BrowserWindowController.m: (-[WK2BrowserWindowController awakeFromNib]): * WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp: (WTR::InjectedBundlePage::InjectedBundlePage): * WebKitTestRunner/TestController.cpp: (WTR::TestController::createWebViewWithOptions): git-svn-id: svn://svn.chromium.org/blink/trunk@142762 bbb929c8-8fbe-4397-9dbb-9b2b20218538
uint64_t InjectedBundlePage::didExceedDatabaseQuota(WKBundlePageRef page, WKSecurityOriginRef origin, WKStringRef databaseName, WKStringRef databaseDisplayName, uint64_t currentQuotaBytes, uint64_t currentOriginUsageBytes, uint64_t currentDatabaseUsageBytes, uint64_t expectedUsageBytes, const void* clientInfo) { return static_cast<InjectedBundlePage*>(const_cast<void*>(clientInfo))->didExceedDatabaseQuota(origin, databaseName, databaseDisplayName, currentQuotaBytes, currentOriginUsageBytes, currentDatabaseUsageBytes, expectedUsageBytes); }
uint64_t InjectedBundlePage::didExceedDatabaseQuota(WKBundlePageRef page, WKSecurityOriginRef origin, WKStringRef databaseName, WKStringRef databaseDisplayName, uint64_t currentQuotaBytes, uint64_t currentOriginUsageBytes, uint64_t currentDatabaseUsageBytes, uint64_t expectedUsageBytes, const void* clientInfo) { return static_cast<InjectedBundlePage*>(const_cast<void*>(clientInfo))->didExceedDatabaseQuota(origin, databaseName, databaseDisplayName, currentQuotaBytes, currentOriginUsageBytes, currentDatabaseUsageBytes, expectedUsageBytes); }
C
Chrome
0
CVE-2013-6420
https://www.cvedetails.com/cve/CVE-2013-6420/
CWE-119
https://git.php.net/?p=php-src.git;a=commit;h=c1224573c773b6845e83505f717fbf820fc18415
c1224573c773b6845e83505f717fbf820fc18415
null
int php_openssl_get_x509_list_id(void) /* {{{ */ { return le_x509; } /* }}} */
int php_openssl_get_x509_list_id(void) /* {{{ */ { return le_x509; } /* }}} */
C
php
0
CVE-2015-1278
https://www.cvedetails.com/cve/CVE-2015-1278/
CWE-254
https://github.com/chromium/chromium/commit/784f56a9c97a838448dd23f9bdc7c05fe8e639b3
784f56a9c97a838448dd23f9bdc7c05fe8e639b3
Correctly reset FP in RFHI whenever origin changes Bug: 713364 Change-Id: Id8bb923750e20f3db6fc9358b1d44120513ac95f CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_site_isolation Change-Id: Id8bb923750e20f3db6fc9358b1d44120513ac95f Reviewed-on: https://chromium-review.googlesource.com/482380 Commit-Queue: Ian Clelland <iclelland@chromium.org> Reviewed-by: Charles Reis <creis@chromium.org> Cr-Commit-Position: refs/heads/master@{#466778}
void RenderFrameHostImpl::FailedNavigation( const CommonNavigationParams& common_params, const BeginNavigationParams& begin_params, const RequestNavigationParams& request_params, bool has_stale_copy_in_cache, int error_code) { UpdatePermissionsForNavigation(common_params, request_params); ResetWaitingState(); Send(new FrameMsg_FailedNavigation(routing_id_, common_params, request_params, has_stale_copy_in_cache, error_code)); RenderFrameDevToolsAgentHost::OnFailedNavigation( this, common_params, begin_params, static_cast<net::Error>(error_code)); is_loading_ = true; frame_tree_node_->ResetNavigationRequest(true, true); }
void RenderFrameHostImpl::FailedNavigation( const CommonNavigationParams& common_params, const BeginNavigationParams& begin_params, const RequestNavigationParams& request_params, bool has_stale_copy_in_cache, int error_code) { UpdatePermissionsForNavigation(common_params, request_params); ResetWaitingState(); Send(new FrameMsg_FailedNavigation(routing_id_, common_params, request_params, has_stale_copy_in_cache, error_code)); RenderFrameDevToolsAgentHost::OnFailedNavigation( this, common_params, begin_params, static_cast<net::Error>(error_code)); is_loading_ = true; frame_tree_node_->ResetNavigationRequest(true, true); }
C
Chrome
0
CVE-2018-6033
https://www.cvedetails.com/cve/CVE-2018-6033/
CWE-20
https://github.com/chromium/chromium/commit/a8d6ae61d266d8bc44c3dd2d08bda32db701e359
a8d6ae61d266d8bc44c3dd2d08bda32db701e359
Downloads : Fixed an issue of opening incorrect download file When one download overwrites another completed download, calling download.open in the old download causes the new download to open, which could be dangerous and undesirable. In this CL, we are trying to avoid this by blocking the opening of the old download. Bug: 793620 Change-Id: Ic948175756700ad7c08489c3cc347330daedb6f8 Reviewed-on: https://chromium-review.googlesource.com/826477 Reviewed-by: David Trainor <dtrainor@chromium.org> Reviewed-by: Xing Liu <xingliu@chromium.org> Reviewed-by: John Abd-El-Malek <jam@chromium.org> Commit-Queue: Shakti Sahu <shaktisahu@chromium.org> Cr-Commit-Position: refs/heads/master@{#525810}
DownloadItemImpl::DestinationInfo::DestinationInfo( const base::FilePath& target_path, const base::FilePath& current_path, int64_t received_bytes, bool all_data_saved, const std::string& hash, base::Time end_time) : target_path(target_path), current_path(current_path), received_bytes(received_bytes), all_data_saved(all_data_saved), hash(hash), end_time(end_time) {}
DownloadItemImpl::DestinationInfo::DestinationInfo( const base::FilePath& target_path, const base::FilePath& current_path, int64_t received_bytes, bool all_data_saved, const std::string& hash, base::Time end_time) : target_path(target_path), current_path(current_path), received_bytes(received_bytes), all_data_saved(all_data_saved), hash(hash), end_time(end_time) {}
C
Chrome
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 <mblsha@yandex-team.ru> Reviewed-by: Pavel Feldman <pfeldman@chromium.org> Reviewed-by: Avi Drissman <avi@chromium.org> Reviewed-by: Peter Kasting <pkasting@chromium.org> Cr-Commit-Position: refs/heads/master@{#542517}
void HTMLInputElement::setRangeText(const String& replacement, unsigned start, unsigned end, const String& selection_mode, ExceptionState& exception_state) { if (!input_type_->SupportsSelectionAPI()) { exception_state.ThrowDOMException(kInvalidStateError, "The input element's type ('" + input_type_->FormControlType() + "') does not support selection."); return; } TextControlElement::setRangeText(replacement, start, end, selection_mode, exception_state); }
void HTMLInputElement::setRangeText(const String& replacement, unsigned start, unsigned end, const String& selection_mode, ExceptionState& exception_state) { if (!input_type_->SupportsSelectionAPI()) { exception_state.ThrowDOMException(kInvalidStateError, "The input element's type ('" + input_type_->FormControlType() + "') does not support selection."); return; } TextControlElement::setRangeText(replacement, start, end, selection_mode, exception_state); }
C
Chrome
0
CVE-2016-1672
https://www.cvedetails.com/cve/CVE-2016-1672/
CWE-284
https://github.com/chromium/chromium/commit/75b803b1c81ed9fa5513cbff550232b4fb915e7b
75b803b1c81ed9fa5513cbff550232b4fb915e7b
[Extensions] Harden against bindings interception There's more we can do but this is a start. BUG=590275 BUG=590118 Review URL: https://codereview.chromium.org/1748943002 Cr-Commit-Position: refs/heads/master@{#378621}
std::string ModuleSystem::ExceptionHandler::CreateExceptionString( const v8::TryCatch& try_catch) { v8::Local<v8::Message> message(try_catch.Message()); if (message.IsEmpty()) { return "try_catch has no message"; } std::string resource_name = "<unknown resource>"; if (!message->GetScriptOrigin().ResourceName().IsEmpty()) { v8::String::Utf8Value resource_name_v8( message->GetScriptOrigin().ResourceName()); resource_name.assign(*resource_name_v8, resource_name_v8.length()); } std::string error_message = "<no error message>"; if (!message->Get().IsEmpty()) { v8::String::Utf8Value error_message_v8(message->Get()); error_message.assign(*error_message_v8, error_message_v8.length()); } auto maybe = message->GetLineNumber(context_->v8_context()); int line_number = maybe.IsJust() ? maybe.FromJust() : 0; return base::StringPrintf("%s:%d: %s", resource_name.c_str(), line_number, error_message.c_str()); }
std::string ModuleSystem::ExceptionHandler::CreateExceptionString( const v8::TryCatch& try_catch) { v8::Local<v8::Message> message(try_catch.Message()); if (message.IsEmpty()) { return "try_catch has no message"; } std::string resource_name = "<unknown resource>"; if (!message->GetScriptOrigin().ResourceName().IsEmpty()) { v8::String::Utf8Value resource_name_v8( message->GetScriptOrigin().ResourceName()); resource_name.assign(*resource_name_v8, resource_name_v8.length()); } std::string error_message = "<no error message>"; if (!message->Get().IsEmpty()) { v8::String::Utf8Value error_message_v8(message->Get()); error_message.assign(*error_message_v8, error_message_v8.length()); } auto maybe = message->GetLineNumber(context_->v8_context()); int line_number = maybe.IsJust() ? maybe.FromJust() : 0; return base::StringPrintf("%s:%d: %s", resource_name.c_str(), line_number, error_message.c_str()); }
C
Chrome
0
CVE-2018-13406
https://www.cvedetails.com/cve/CVE-2018-13406/
CWE-190
https://github.com/torvalds/linux/commit/9f645bcc566a1e9f921bdae7528a01ced5bc3713
9f645bcc566a1e9f921bdae7528a01ced5bc3713
video: uvesafb: Fix integer overflow in allocation cmap->len can get close to INT_MAX/2, allowing for an integer overflow in allocation. This uses kmalloc_array() instead to catch the condition. Reported-by: Dr Silvio Cesare of InfoSect <silvio.cesare@gmail.com> Fixes: 8bdb3a2d7df48 ("uvesafb: the driver core") Cc: stable@vger.kernel.org Signed-off-by: Kees Cook <keescook@chromium.org>
static ssize_t uvesafb_show_product_name(struct device *dev, struct device_attribute *attr, char *buf) { struct fb_info *info = platform_get_drvdata(to_platform_device(dev)); struct uvesafb_par *par = info->par; if (par->vbe_ib.oem_product_name_ptr) return snprintf(buf, PAGE_SIZE, "%s\n", (char *) (&par->vbe_ib) + par->vbe_ib.oem_product_name_ptr); else return 0; }
static ssize_t uvesafb_show_product_name(struct device *dev, struct device_attribute *attr, char *buf) { struct fb_info *info = platform_get_drvdata(to_platform_device(dev)); struct uvesafb_par *par = info->par; if (par->vbe_ib.oem_product_name_ptr) return snprintf(buf, PAGE_SIZE, "%s\n", (char *) (&par->vbe_ib) + par->vbe_ib.oem_product_name_ptr); else return 0; }
C
linux
0
CVE-2014-3171
https://www.cvedetails.com/cve/CVE-2014-3171/
null
https://github.com/chromium/chromium/commit/d10a8dac48d3a9467e81c62cb45208344f4542db
d10a8dac48d3a9467e81c62cb45208344f4542db
Replace further questionable HashMap::add usages in bindings BUG=390928 R=dcarney@chromium.org Review URL: https://codereview.chromium.org/411273002 git-svn-id: svn://svn.chromium.org/blink/trunk@178823 bbb929c8-8fbe-4397-9dbb-9b2b20218538
void writeFile(const File& file) { append(FileTag); doWriteFile(file); }
void writeFile(const File& file) { append(FileTag); doWriteFile(file); }
C
Chrome
0
CVE-2018-20169
https://www.cvedetails.com/cve/CVE-2018-20169/
CWE-400
https://github.com/torvalds/linux/commit/704620afc70cf47abb9d6a1a57f3825d2bca49cf
704620afc70cf47abb9d6a1a57f3825d2bca49cf
USB: check usb_get_extra_descriptor for proper size When reading an extra descriptor, we need to properly check the minimum and maximum size allowed, to prevent from invalid data being sent by a device. Reported-by: Hui Peng <benquike@gmail.com> Reported-by: Mathias Payer <mathias.payer@nebelwelt.net> Co-developed-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Hui Peng <benquike@gmail.com> Signed-off-by: Mathias Payer <mathias.payer@nebelwelt.net> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Cc: stable <stable@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
int usb_port_disable(struct usb_device *udev) { struct usb_hub *hub = usb_hub_to_struct_hub(udev->parent); return hub_port_disable(hub, udev->portnum, 0); }
int usb_port_disable(struct usb_device *udev) { struct usb_hub *hub = usb_hub_to_struct_hub(udev->parent); return hub_port_disable(hub, udev->portnum, 0); }
C
linux
0
CVE-2018-6063
https://www.cvedetails.com/cve/CVE-2018-6063/
CWE-787
https://github.com/chromium/chromium/commit/673ce95d481ea9368c4d4d43ac756ba1d6d9e608
673ce95d481ea9368c4d4d43ac756ba1d6d9e608
Correct mojo::WrapSharedMemoryHandle usage Fixes some incorrect uses of mojo::WrapSharedMemoryHandle which were assuming that the call actually has any control over the memory protection applied to a handle when mapped. Where fixing usage is infeasible for this CL, TODOs are added to annotate follow-up work. Also updates the API and documentation to (hopefully) improve clarity and avoid similar mistakes from being made in the future. BUG=792900 Cq-Include-Trybots: master.tryserver.chromium.android:android_optional_gpu_tests_rel;master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel Change-Id: I0578aaa9ca3bfcb01aaf2451315d1ede95458477 Reviewed-on: https://chromium-review.googlesource.com/818282 Reviewed-by: Wei Li <weili@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org> Reviewed-by: John Abd-El-Malek <jam@chromium.org> Reviewed-by: Daniel Cheng <dcheng@chromium.org> Reviewed-by: Sadrul Chowdhury <sadrul@chromium.org> Reviewed-by: Yuzhu Shen <yzshen@chromium.org> Reviewed-by: Robert Sesek <rsesek@chromium.org> Commit-Queue: Ken Rockot <rockot@chromium.org> Cr-Commit-Position: refs/heads/master@{#530268}
bool MojoAudioOutputIPC::AuthorizationRequested() { return stream_provider_.is_bound(); }
bool MojoAudioOutputIPC::AuthorizationRequested() { return stream_provider_.is_bound(); }
C
Chrome
0
CVE-2016-5170
https://www.cvedetails.com/cve/CVE-2016-5170/
CWE-416
https://github.com/chromium/chromium/commit/c3957448cfc6e299165196a33cd954b790875fdb
c3957448cfc6e299165196a33cd954b790875fdb
Cleanup and remove dead code in SetFocusedElement This early-out was added in: https://crrev.com/ce8ea3446283965c7eabab592cbffe223b1cf2bc Back then, we applied fragment focus in LayoutUpdated() which could cause this issue. This got cleaned up in: https://crrev.com/45236fd563e9df53dc45579be1f3d0b4784885a2 so that focus is no longer applied after layout. +Cleanup: Goto considered harmful Bug: 795381 Change-Id: Ifeb4d2e03e872fd48cca6720b1d4de36ad1ecbb7 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1524417 Commit-Queue: David Bokan <bokan@chromium.org> Reviewed-by: Stefan Zager <szager@chromium.org> Cr-Commit-Position: refs/heads/master@{#641101}
mojom::blink::DocumentInterfaceBroker* Document::GetDocumentInterfaceBroker() { if (!GetFrame()) return nullptr; return &GetFrame()->GetDocumentInterfaceBroker(); }
mojom::blink::DocumentInterfaceBroker* Document::GetDocumentInterfaceBroker() { if (!GetFrame()) return nullptr; return &GetFrame()->GetDocumentInterfaceBroker(); }
C
Chrome
0
CVE-2018-12684
https://www.cvedetails.com/cve/CVE-2018-12684/
CWE-125
https://github.com/civetweb/civetweb/commit/8fd069f6dedb064339f1091069ac96f3f8bdb552
8fd069f6dedb064339f1091069ac96f3f8bdb552
Check length of memcmp
deprecated_websocket_data_wrapper(struct mg_connection *conn, int bits, char *data, size_t len, void *cbdata) { struct mg_callbacks *pcallbacks = (struct mg_callbacks *)cbdata; if (pcallbacks->websocket_data) { return pcallbacks->websocket_data(conn, bits, data, len); } /* No handler set - assume "OK" */ return 1; }
deprecated_websocket_data_wrapper(struct mg_connection *conn, int bits, char *data, size_t len, void *cbdata) { struct mg_callbacks *pcallbacks = (struct mg_callbacks *)cbdata; if (pcallbacks->websocket_data) { return pcallbacks->websocket_data(conn, bits, data, len); } /* No handler set - assume "OK" */ return 1; }
C
civetweb
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::DiscardNonCommittedEntriesInternal() { DiscardPendingEntry(false); DiscardTransientEntry(); }
void NavigationControllerImpl::DiscardNonCommittedEntriesInternal() { DiscardPendingEntry(false); DiscardTransientEntry(); }
C
Chrome
0
CVE-2016-3136
https://www.cvedetails.com/cve/CVE-2016-3136/
null
https://github.com/torvalds/linux/commit/4e9a0b05257f29cf4b75f3209243ed71614d062e
4e9a0b05257f29cf4b75f3209243ed71614d062e
USB: mct_u232: add sanity checking in probe An attack using the lack of sanity checking in probe is known. This patch checks for the existence of a second port. CVE-2016-3136 Signed-off-by: Oliver Neukum <ONeukum@suse.com> CC: stable@vger.kernel.org [johan: add error message ] Signed-off-by: Johan Hovold <johan@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
static void mct_u232_unthrottle(struct tty_struct *tty) { struct usb_serial_port *port = tty->driver_data; struct mct_u232_private *priv = usb_get_serial_port_data(port); unsigned int control_state; spin_lock_irq(&priv->lock); if ((priv->rx_flags & THROTTLED) && C_CRTSCTS(tty)) { priv->rx_flags &= ~THROTTLED; priv->control_state |= TIOCM_RTS; control_state = priv->control_state; spin_unlock_irq(&priv->lock); mct_u232_set_modem_ctrl(port, control_state); } else { spin_unlock_irq(&priv->lock); } }
static void mct_u232_unthrottle(struct tty_struct *tty) { struct usb_serial_port *port = tty->driver_data; struct mct_u232_private *priv = usb_get_serial_port_data(port); unsigned int control_state; spin_lock_irq(&priv->lock); if ((priv->rx_flags & THROTTLED) && C_CRTSCTS(tty)) { priv->rx_flags &= ~THROTTLED; priv->control_state |= TIOCM_RTS; control_state = priv->control_state; spin_unlock_irq(&priv->lock); mct_u232_set_modem_ctrl(port, control_state); } else { spin_unlock_irq(&priv->lock); } }
C
linux
0
CVE-2019-13225
https://www.cvedetails.com/cve/CVE-2019-13225/
CWE-476
https://github.com/kkos/oniguruma/commit/c509265c5f6ae7264f7b8a8aae1cfa5fc59d108c
c509265c5f6ae7264f7b8a8aae1cfa5fc59d108c
Fix CVE-2019-13225: problem in converting if-then-else pattern to bytecode.
unset_addr_list_init(UnsetAddrList* list, int size) { UnsetAddr* p = (UnsetAddr* )xmalloc(sizeof(UnsetAddr)* size); CHECK_NULL_RETURN_MEMERR(p); list->num = 0; list->alloc = size; list->us = p; return 0; }
unset_addr_list_init(UnsetAddrList* list, int size) { UnsetAddr* p = (UnsetAddr* )xmalloc(sizeof(UnsetAddr)* size); CHECK_NULL_RETURN_MEMERR(p); list->num = 0; list->alloc = size; list->us = p; return 0; }
C
oniguruma
0
CVE-2016-2449
https://www.cvedetails.com/cve/CVE-2016-2449/
CWE-264
https://android.googlesource.com/platform/frameworks/av/+/b04aee833c5cfb6b31b8558350feb14bb1a0f353
b04aee833c5cfb6b31b8558350feb14bb1a0f353
Camera3Device: Validate template ID Validate template ID before creating a default request. Bug: 26866110 Bug: 27568958 Change-Id: Ifda457024f1d5c2b1382f189c1a8d5fda852d30d
status_t Camera3Device::convertMetadataListToRequestListLocked( const List<const CameraMetadata> &metadataList, RequestList *requestList) { if (requestList == NULL) { CLOGE("requestList cannot be NULL."); return BAD_VALUE; } int32_t burstId = 0; for (List<const CameraMetadata>::const_iterator it = metadataList.begin(); it != metadataList.end(); ++it) { sp<CaptureRequest> newRequest = setUpRequestLocked(*it); if (newRequest == 0) { CLOGE("Can't create capture request"); return BAD_VALUE; } newRequest->mResultExtras.burstId = burstId++; if (it->exists(ANDROID_REQUEST_ID)) { if (it->find(ANDROID_REQUEST_ID).count == 0) { CLOGE("RequestID entry exists; but must not be empty in metadata"); return BAD_VALUE; } newRequest->mResultExtras.requestId = it->find(ANDROID_REQUEST_ID).data.i32[0]; } else { CLOGE("RequestID does not exist in metadata"); return BAD_VALUE; } requestList->push_back(newRequest); ALOGV("%s: requestId = %" PRId32, __FUNCTION__, newRequest->mResultExtras.requestId); } if (mIsConstrainedHighSpeedConfiguration && requestList->size() > 0) { auto firstRequest = requestList->begin(); for (auto& outputStream : (*firstRequest)->mOutputStreams) { if (outputStream->isVideoStream()) { (*firstRequest)->mBatchSize = requestList->size(); break; } } } return OK; }
status_t Camera3Device::convertMetadataListToRequestListLocked( const List<const CameraMetadata> &metadataList, RequestList *requestList) { if (requestList == NULL) { CLOGE("requestList cannot be NULL."); return BAD_VALUE; } int32_t burstId = 0; for (List<const CameraMetadata>::const_iterator it = metadataList.begin(); it != metadataList.end(); ++it) { sp<CaptureRequest> newRequest = setUpRequestLocked(*it); if (newRequest == 0) { CLOGE("Can't create capture request"); return BAD_VALUE; } newRequest->mResultExtras.burstId = burstId++; if (it->exists(ANDROID_REQUEST_ID)) { if (it->find(ANDROID_REQUEST_ID).count == 0) { CLOGE("RequestID entry exists; but must not be empty in metadata"); return BAD_VALUE; } newRequest->mResultExtras.requestId = it->find(ANDROID_REQUEST_ID).data.i32[0]; } else { CLOGE("RequestID does not exist in metadata"); return BAD_VALUE; } requestList->push_back(newRequest); ALOGV("%s: requestId = %" PRId32, __FUNCTION__, newRequest->mResultExtras.requestId); } if (mIsConstrainedHighSpeedConfiguration && requestList->size() > 0) { auto firstRequest = requestList->begin(); for (auto& outputStream : (*firstRequest)->mOutputStreams) { if (outputStream->isVideoStream()) { (*firstRequest)->mBatchSize = requestList->size(); break; } } } return OK; }
C
Android
0
CVE-2015-3412
https://www.cvedetails.com/cve/CVE-2015-3412/
CWE-254
https://git.php.net/?p=php-src.git;a=commit;h=4435b9142ff9813845d5c97ab29a5d637bedb257
4435b9142ff9813845d5c97ab29a5d637bedb257
null
PHP_FUNCTION(link) { char *topath, *frompath; int topath_len, frompath_len; int ret; char source_p[MAXPATHLEN]; char dest_p[MAXPATHLEN]; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "pp", &topath, &topath_len, &frompath, &frompath_len) == FAILURE) { return; } if (!expand_filepath(frompath, source_p TSRMLS_CC) || !expand_filepath(topath, dest_p TSRMLS_CC)) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "No such file or directory"); RETURN_FALSE; } if (php_stream_locate_url_wrapper(source_p, NULL, STREAM_LOCATE_WRAPPERS_ONLY TSRMLS_CC) || php_stream_locate_url_wrapper(dest_p, NULL, STREAM_LOCATE_WRAPPERS_ONLY TSRMLS_CC) ) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to link to a URL"); RETURN_FALSE; } if (php_check_open_basedir(dest_p TSRMLS_CC)) { RETURN_FALSE; } if (php_check_open_basedir(source_p TSRMLS_CC)) { RETURN_FALSE; } #ifndef ZTS ret = link(topath, frompath); #else ret = link(dest_p, source_p); #endif if (ret == -1) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", strerror(errno)); RETURN_FALSE; } RETURN_TRUE; }
PHP_FUNCTION(link) { char *topath, *frompath; int topath_len, frompath_len; int ret; char source_p[MAXPATHLEN]; char dest_p[MAXPATHLEN]; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "pp", &topath, &topath_len, &frompath, &frompath_len) == FAILURE) { return; } if (!expand_filepath(frompath, source_p TSRMLS_CC) || !expand_filepath(topath, dest_p TSRMLS_CC)) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "No such file or directory"); RETURN_FALSE; } if (php_stream_locate_url_wrapper(source_p, NULL, STREAM_LOCATE_WRAPPERS_ONLY TSRMLS_CC) || php_stream_locate_url_wrapper(dest_p, NULL, STREAM_LOCATE_WRAPPERS_ONLY TSRMLS_CC) ) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to link to a URL"); RETURN_FALSE; } if (php_check_open_basedir(dest_p TSRMLS_CC)) { RETURN_FALSE; } if (php_check_open_basedir(source_p TSRMLS_CC)) { RETURN_FALSE; } #ifndef ZTS ret = link(topath, frompath); #else ret = link(dest_p, source_p); #endif if (ret == -1) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", strerror(errno)); RETURN_FALSE; } RETURN_TRUE; }
C
php
0
CVE-2013-7421
https://www.cvedetails.com/cve/CVE-2013-7421/
CWE-264
https://github.com/torvalds/linux/commit/5d26a105b5a73e5635eae0629b42fa0a90e07b7b
5d26a105b5a73e5635eae0629b42fa0a90e07b7b
crypto: prefix module autoloading with "crypto-" This prefixes all crypto module loading with "crypto-" so we never run the risk of exposing module auto-loading to userspace via a crypto API, as demonstrated by Mathias Krause: https://lkml.org/lkml/2013/3/4/70 Signed-off-by: Kees Cook <keescook@chromium.org> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
static void __exit fini(void) { crypto_unregister_algs(bf_algs, ARRAY_SIZE(bf_algs)); }
static void __exit fini(void) { crypto_unregister_algs(bf_algs, ARRAY_SIZE(bf_algs)); }
C
linux
0
CVE-2011-4930
https://www.cvedetails.com/cve/CVE-2011-4930/
CWE-134
https://htcondor-git.cs.wisc.edu/?p=condor.git;a=commitdiff;h=5e5571d1a431eb3c61977b6dd6ec90186ef79867
5e5571d1a431eb3c61977b6dd6ec90186ef79867
null
GahpServer *GahpServer::FindOrCreateGahpServer(const char *id, const char *path, const ArgList *args) { int rc; GahpServer *server = NULL; if ( path == NULL ) { path = GAHPCLIENT_DEFAULT_SERVER_PATH; } rc = GahpServersById.lookup( HashKey( id ), server ); if ( rc != 0 ) { server = new GahpServer( id, path, args ); ASSERT(server); GahpServersById.insert( HashKey( id ), server ); } else { ASSERT(server); } return server; }
GahpServer *GahpServer::FindOrCreateGahpServer(const char *id, const char *path, const ArgList *args) { int rc; GahpServer *server = NULL; if ( path == NULL ) { path = GAHPCLIENT_DEFAULT_SERVER_PATH; } rc = GahpServersById.lookup( HashKey( id ), server ); if ( rc != 0 ) { server = new GahpServer( id, path, args ); ASSERT(server); GahpServersById.insert( HashKey( id ), server ); } else { ASSERT(server); } return server; }
CPP
htcondor
0
CVE-2013-2929
https://www.cvedetails.com/cve/CVE-2013-2929/
CWE-264
https://github.com/torvalds/linux/commit/d049f74f2dbe71354d43d393ac3a188947811348
d049f74f2dbe71354d43d393ac3a188947811348
exec/ptrace: fix get_dumpable() incorrect tests The get_dumpable() return value is not boolean. Most users of the function actually want to be testing for non-SUID_DUMP_USER(1) rather than SUID_DUMP_DISABLE(0). The SUID_DUMP_ROOT(2) is also considered a protected state. Almost all places did this correctly, excepting the two places fixed in this patch. Wrong logic: if (dumpable == SUID_DUMP_DISABLE) { /* be protective */ } or if (dumpable == 0) { /* be protective */ } or if (!dumpable) { /* be protective */ } Correct logic: if (dumpable != SUID_DUMP_USER) { /* be protective */ } or if (dumpable != 1) { /* be protective */ } Without this patch, if the system had set the sysctl fs/suid_dumpable=2, a user was able to ptrace attach to processes that had dropped privileges to that user. (This may have been partially mitigated if Yama was enabled.) The macros have been moved into the file that declares get/set_dumpable(), which means things like the ia64 code can see them too. CVE-2013-2929 Reported-by: Vasily Kulikov <segoon@openwall.com> Signed-off-by: Kees Cook <keescook@chromium.org> Cc: "Luck, Tony" <tony.luck@intel.com> Cc: Oleg Nesterov <oleg@redhat.com> Cc: "Eric W. Biederman" <ebiederm@xmission.com> Cc: <stable@vger.kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
int prepare_binprm(struct linux_binprm *bprm) { umode_t mode; struct inode * inode = file_inode(bprm->file); int retval; mode = inode->i_mode; if (bprm->file->f_op == NULL) return -EACCES; /* clear any previous set[ug]id data from a previous binary */ bprm->cred->euid = current_euid(); bprm->cred->egid = current_egid(); if (!(bprm->file->f_path.mnt->mnt_flags & MNT_NOSUID) && !current->no_new_privs && kuid_has_mapping(bprm->cred->user_ns, inode->i_uid) && kgid_has_mapping(bprm->cred->user_ns, inode->i_gid)) { /* Set-uid? */ if (mode & S_ISUID) { bprm->per_clear |= PER_CLEAR_ON_SETID; bprm->cred->euid = inode->i_uid; } /* Set-gid? */ /* * If setgid is set but no group execute bit then this * is a candidate for mandatory locking, not a setgid * executable. */ if ((mode & (S_ISGID | S_IXGRP)) == (S_ISGID | S_IXGRP)) { bprm->per_clear |= PER_CLEAR_ON_SETID; bprm->cred->egid = inode->i_gid; } } /* fill in binprm security blob */ retval = security_bprm_set_creds(bprm); if (retval) return retval; bprm->cred_prepared = 1; memset(bprm->buf, 0, BINPRM_BUF_SIZE); return kernel_read(bprm->file, 0, bprm->buf, BINPRM_BUF_SIZE); }
int prepare_binprm(struct linux_binprm *bprm) { umode_t mode; struct inode * inode = file_inode(bprm->file); int retval; mode = inode->i_mode; if (bprm->file->f_op == NULL) return -EACCES; /* clear any previous set[ug]id data from a previous binary */ bprm->cred->euid = current_euid(); bprm->cred->egid = current_egid(); if (!(bprm->file->f_path.mnt->mnt_flags & MNT_NOSUID) && !current->no_new_privs && kuid_has_mapping(bprm->cred->user_ns, inode->i_uid) && kgid_has_mapping(bprm->cred->user_ns, inode->i_gid)) { /* Set-uid? */ if (mode & S_ISUID) { bprm->per_clear |= PER_CLEAR_ON_SETID; bprm->cred->euid = inode->i_uid; } /* Set-gid? */ /* * If setgid is set but no group execute bit then this * is a candidate for mandatory locking, not a setgid * executable. */ if ((mode & (S_ISGID | S_IXGRP)) == (S_ISGID | S_IXGRP)) { bprm->per_clear |= PER_CLEAR_ON_SETID; bprm->cred->egid = inode->i_gid; } } /* fill in binprm security blob */ retval = security_bprm_set_creds(bprm); if (retval) return retval; bprm->cred_prepared = 1; memset(bprm->buf, 0, BINPRM_BUF_SIZE); return kernel_read(bprm->file, 0, bprm->buf, BINPRM_BUF_SIZE); }
C
linux
0
CVE-2018-16425
https://www.cvedetails.com/cve/CVE-2018-16425/
CWE-415
https://github.com/OpenSC/OpenSC/commit/360e95d45ac4123255a4c796db96337f332160ad#diff-d643a0fa169471dbf2912f4866dc49c5
360e95d45ac4123255a4c796db96337f332160ad#diff-d643a0fa169471dbf2912f4866dc49c5
fixed out of bounds writes Thanks to Eric Sesterhenn from X41 D-SEC GmbH for reporting the problems.
static int muscle_create_directory(sc_card_t *card, sc_file_t *file) { mscfs_t *fs = MUSCLE_FS(card); msc_id objectId; u8* oid = objectId.id; unsigned id = file->id; unsigned short read_perm = 0, write_perm = 0, delete_perm = 0; int objectSize; int r; if(id == 0) /* No null name files */ return SC_ERROR_INVALID_ARGUMENTS; /* No nesting directories */ if(fs->currentPath[0] != 0x3F || fs->currentPath[1] != 0x00) return SC_ERROR_NOT_SUPPORTED; oid[0] = ((id & 0xFF00) >> 8) & 0xFF; oid[1] = id & 0xFF; oid[2] = oid[3] = 0; objectSize = file->size; muscle_parse_acls(file, &read_perm, &write_perm, &delete_perm); r = msc_create_object(card, objectId, objectSize, read_perm, write_perm, delete_perm); mscfs_clear_cache(fs); if(r >= 0) return 0; return r; }
static int muscle_create_directory(sc_card_t *card, sc_file_t *file) { mscfs_t *fs = MUSCLE_FS(card); msc_id objectId; u8* oid = objectId.id; unsigned id = file->id; unsigned short read_perm = 0, write_perm = 0, delete_perm = 0; int objectSize; int r; if(id == 0) /* No null name files */ return SC_ERROR_INVALID_ARGUMENTS; /* No nesting directories */ if(fs->currentPath[0] != 0x3F || fs->currentPath[1] != 0x00) return SC_ERROR_NOT_SUPPORTED; oid[0] = ((id & 0xFF00) >> 8) & 0xFF; oid[1] = id & 0xFF; oid[2] = oid[3] = 0; objectSize = file->size; muscle_parse_acls(file, &read_perm, &write_perm, &delete_perm); r = msc_create_object(card, objectId, objectSize, read_perm, write_perm, delete_perm); mscfs_clear_cache(fs); if(r >= 0) return 0; return r; }
C
OpenSC
0
CVE-2016-10012
https://www.cvedetails.com/cve/CVE-2016-10012/
CWE-119
https://github.com/openbsd/src/commit/3095060f479b86288e31c79ecbc5131a66bcd2f9
3095060f479b86288e31c79ecbc5131a66bcd2f9
Remove support for pre-authentication compression. Doing compression early in the protocol probably seemed reasonable in the 1990s, but today it's clearly a bad idea in terms of both cryptography (cf. multiple compression oracle attacks in TLS) and attack surface. Moreover, to support it across privilege-separation zlib needed the assistance of a complex shared-memory manager that made the required attack surface considerably larger. Prompted by Guido Vranken pointing out a compiler-elided security check in the shared memory manager found by Stack (http://css.csail.mit.edu/stack/); ok deraadt@ markus@ NB. pre-auth authentication has been disabled by default in sshd for >10 years.
dump_cfg_fmtint(ServerOpCodes code, int val) { printf("%s %s\n", lookup_opcode_name(code), fmt_intarg(code, val)); }
dump_cfg_fmtint(ServerOpCodes code, int val) { printf("%s %s\n", lookup_opcode_name(code), fmt_intarg(code, val)); }
C
src
0
CVE-2017-5014
https://www.cvedetails.com/cve/CVE-2017-5014/
CWE-119
https://github.com/chromium/chromium/commit/35eb28748d45b87695a69eceffaff73a0be476af
35eb28748d45b87695a69eceffaff73a0be476af
Remove unused histograms from the background loader offliner. Bug: 975512 Change-Id: I87b0a91bed60e3a9e8a1fd9ae9b18cac27a0859f Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1683361 Reviewed-by: Cathy Li <chili@chromium.org> Reviewed-by: Steven Holte <holte@chromium.org> Commit-Queue: Peter Williamson <petewil@chromium.org> Cr-Commit-Position: refs/heads/master@{#675332}
void BackgroundLoaderOffliner::OnNetworkBytesChanged(int64_t bytes) { if (pending_request_ && save_state_ != SAVING) { network_bytes_ += bytes; progress_callback_.Run(*pending_request_, network_bytes_); } }
void BackgroundLoaderOffliner::OnNetworkBytesChanged(int64_t bytes) { if (pending_request_ && save_state_ != SAVING) { network_bytes_ += bytes; progress_callback_.Run(*pending_request_, network_bytes_); } }
C
Chrome
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 <mblsha@yandex-team.ru> Reviewed-by: Pavel Feldman <pfeldman@chromium.org> Reviewed-by: Avi Drissman <avi@chromium.org> Reviewed-by: Peter Kasting <pkasting@chromium.org> Cr-Commit-Position: refs/heads/master@{#542517}
void InputType::SetValueAsDate(double, ExceptionState& exception_state) const { exception_state.ThrowDOMException( kInvalidStateError, "This input element does not support Date values."); }
void InputType::SetValueAsDate(double, ExceptionState& exception_state) const { exception_state.ThrowDOMException( kInvalidStateError, "This input element does not support Date values."); }
C
Chrome
0
CVE-2017-13694
https://www.cvedetails.com/cve/CVE-2017-13694/
CWE-200
https://github.com/acpica/acpica/pull/278/commits/4a0243ecb4c94e2d73510d096c5ea4d0711fc6c0
4a0243ecb4c94e2d73510d096c5ea4d0711fc6c0
acpi: acpica: fix acpi parse and parseext cache leaks I'm Seunghun Han, and I work for National Security Research Institute of South Korea. I have been doing a research on ACPI and found an ACPI cache leak in ACPI early abort cases. Boot log of ACPI cache leak is as follows: [ 0.352414] ACPI: Added _OSI(Module Device) [ 0.353182] ACPI: Added _OSI(Processor Device) [ 0.353182] ACPI: Added _OSI(3.0 _SCP Extensions) [ 0.353182] ACPI: Added _OSI(Processor Aggregator Device) [ 0.356028] ACPI: Unable to start the ACPI Interpreter [ 0.356799] ACPI Error: Could not remove SCI handler (20170303/evmisc-281) [ 0.360215] kmem_cache_destroy Acpi-State: Slab cache still has objects [ 0.360648] CPU: 0 PID: 1 Comm: swapper/0 Tainted: G W 4.12.0-rc4-next-20170608+ #10 [ 0.361273] Hardware name: innotek GmbH VirtualBox/VirtualBox, BIOS VirtualBox 12/01/2006 [ 0.361873] Call Trace: [ 0.362243] ? dump_stack+0x5c/0x81 [ 0.362591] ? kmem_cache_destroy+0x1aa/0x1c0 [ 0.362944] ? acpi_sleep_proc_init+0x27/0x27 [ 0.363296] ? acpi_os_delete_cache+0xa/0x10 [ 0.363646] ? acpi_ut_delete_caches+0x6d/0x7b [ 0.364000] ? acpi_terminate+0xa/0x14 [ 0.364000] ? acpi_init+0x2af/0x34f [ 0.364000] ? __class_create+0x4c/0x80 [ 0.364000] ? video_setup+0x7f/0x7f [ 0.364000] ? acpi_sleep_proc_init+0x27/0x27 [ 0.364000] ? do_one_initcall+0x4e/0x1a0 [ 0.364000] ? kernel_init_freeable+0x189/0x20a [ 0.364000] ? rest_init+0xc0/0xc0 [ 0.364000] ? kernel_init+0xa/0x100 [ 0.364000] ? ret_from_fork+0x25/0x30 I analyzed this memory leak in detail. I found that “Acpi-State” cache and “Acpi-Parse” cache were merged because the size of cache objects was same slab cache size. I finally found “Acpi-Parse” cache and “Acpi-ParseExt” cache were leaked using SLAB_NEVER_MERGE flag in kmem_cache_create() function. Real ACPI cache leak point is as follows: [ 0.360101] ACPI: Added _OSI(Module Device) [ 0.360101] ACPI: Added _OSI(Processor Device) [ 0.360101] ACPI: Added _OSI(3.0 _SCP Extensions) [ 0.361043] ACPI: Added _OSI(Processor Aggregator Device) [ 0.364016] ACPI: Unable to start the ACPI Interpreter [ 0.365061] ACPI Error: Could not remove SCI handler (20170303/evmisc-281) [ 0.368174] kmem_cache_destroy Acpi-Parse: Slab cache still has objects [ 0.369332] CPU: 1 PID: 1 Comm: swapper/0 Tainted: G W 4.12.0-rc4-next-20170608+ #8 [ 0.371256] Hardware name: innotek GmbH VirtualBox/VirtualBox, BIOS VirtualBox 12/01/2006 [ 0.372000] Call Trace: [ 0.372000] ? dump_stack+0x5c/0x81 [ 0.372000] ? kmem_cache_destroy+0x1aa/0x1c0 [ 0.372000] ? acpi_sleep_proc_init+0x27/0x27 [ 0.372000] ? acpi_os_delete_cache+0xa/0x10 [ 0.372000] ? acpi_ut_delete_caches+0x56/0x7b [ 0.372000] ? acpi_terminate+0xa/0x14 [ 0.372000] ? acpi_init+0x2af/0x34f [ 0.372000] ? __class_create+0x4c/0x80 [ 0.372000] ? video_setup+0x7f/0x7f [ 0.372000] ? acpi_sleep_proc_init+0x27/0x27 [ 0.372000] ? do_one_initcall+0x4e/0x1a0 [ 0.372000] ? kernel_init_freeable+0x189/0x20a [ 0.372000] ? rest_init+0xc0/0xc0 [ 0.372000] ? kernel_init+0xa/0x100 [ 0.372000] ? ret_from_fork+0x25/0x30 [ 0.388039] kmem_cache_destroy Acpi-ParseExt: Slab cache still has objects [ 0.389063] CPU: 1 PID: 1 Comm: swapper/0 Tainted: G W 4.12.0-rc4-next-20170608+ #8 [ 0.390557] Hardware name: innotek GmbH VirtualBox/VirtualBox, BIOS VirtualBox 12/01/2006 [ 0.392000] Call Trace: [ 0.392000] ? dump_stack+0x5c/0x81 [ 0.392000] ? kmem_cache_destroy+0x1aa/0x1c0 [ 0.392000] ? acpi_sleep_proc_init+0x27/0x27 [ 0.392000] ? acpi_os_delete_cache+0xa/0x10 [ 0.392000] ? acpi_ut_delete_caches+0x6d/0x7b [ 0.392000] ? acpi_terminate+0xa/0x14 [ 0.392000] ? acpi_init+0x2af/0x34f [ 0.392000] ? __class_create+0x4c/0x80 [ 0.392000] ? video_setup+0x7f/0x7f [ 0.392000] ? acpi_sleep_proc_init+0x27/0x27 [ 0.392000] ? do_one_initcall+0x4e/0x1a0 [ 0.392000] ? kernel_init_freeable+0x189/0x20a [ 0.392000] ? rest_init+0xc0/0xc0 [ 0.392000] ? kernel_init+0xa/0x100 [ 0.392000] ? ret_from_fork+0x25/0x30 When early abort is occurred due to invalid ACPI information, Linux kernel terminates ACPI by calling acpi_terminate() function. The function calls acpi_ut_delete_caches() function to delete local caches (acpi_gbl_namespace_ cache, state_cache, operand_cache, ps_node_cache, ps_node_ext_cache). But the deletion codes in acpi_ut_delete_caches() function only delete slab caches using kmem_cache_destroy() function, therefore the cache objects should be flushed before acpi_ut_delete_caches() function. “Acpi-Parse” cache and “Acpi-ParseExt” cache are used in an AML parse function, acpi_ps_parse_loop(). The function should have flush codes to handle an error state due to invalid AML codes. This cache leak has a security threat because an old kernel (<= 4.9) shows memory locations of kernel functions in stack dump. Some malicious users could use this information to neutralize kernel ASLR. To fix ACPI cache leak for enhancing security, I made a patch which has flush codes in acpi_ps_parse_loop() function. I hope that this patch improves the security of Linux kernel. Thank you. Signed-off-by: Seunghun Han <kkamagui@gmail.com>
AcpiPsCreateOp ( ACPI_WALK_STATE *WalkState, UINT8 *AmlOpStart, ACPI_PARSE_OBJECT **NewOp) { ACPI_STATUS Status = AE_OK; ACPI_PARSE_OBJECT *Op; ACPI_PARSE_OBJECT *NamedOp = NULL; ACPI_PARSE_OBJECT *ParentScope; UINT8 ArgumentCount; const ACPI_OPCODE_INFO *OpInfo; ACPI_FUNCTION_TRACE_PTR (PsCreateOp, WalkState); Status = AcpiPsGetAmlOpcode (WalkState); if (Status == AE_CTRL_PARSE_CONTINUE) { return_ACPI_STATUS (AE_CTRL_PARSE_CONTINUE); } if (ACPI_FAILURE (Status)) { return_ACPI_STATUS (Status); } /* Create Op structure and append to parent's argument list */ WalkState->OpInfo = AcpiPsGetOpcodeInfo (WalkState->Opcode); Op = AcpiPsAllocOp (WalkState->Opcode, AmlOpStart); if (!Op) { return_ACPI_STATUS (AE_NO_MEMORY); } if (WalkState->OpInfo->Flags & AML_NAMED) { Status = AcpiPsBuildNamedOp (WalkState, AmlOpStart, Op, &NamedOp); AcpiPsFreeOp (Op); if (ACPI_FAILURE (Status)) { return_ACPI_STATUS (Status); } *NewOp = NamedOp; return_ACPI_STATUS (AE_OK); } /* Not a named opcode, just allocate Op and append to parent */ if (WalkState->OpInfo->Flags & AML_CREATE) { /* * Backup to beginning of CreateXXXfield declaration * BodyLength is unknown until we parse the body */ Op->Named.Data = AmlOpStart; Op->Named.Length = 0; } if (WalkState->Opcode == AML_BANK_FIELD_OP) { /* * Backup to beginning of BankField declaration * BodyLength is unknown until we parse the body */ Op->Named.Data = AmlOpStart; Op->Named.Length = 0; } ParentScope = AcpiPsGetParentScope (&(WalkState->ParserState)); AcpiPsAppendArg (ParentScope, Op); if (ParentScope) { OpInfo = AcpiPsGetOpcodeInfo (ParentScope->Common.AmlOpcode); if (OpInfo->Flags & AML_HAS_TARGET) { ArgumentCount = AcpiPsGetArgumentCount (OpInfo->Type); if (ParentScope->Common.ArgListLength > ArgumentCount) { Op->Common.Flags |= ACPI_PARSEOP_TARGET; } } /* * Special case for both Increment() and Decrement(), where * the lone argument is both a source and a target. */ else if ((ParentScope->Common.AmlOpcode == AML_INCREMENT_OP) || (ParentScope->Common.AmlOpcode == AML_DECREMENT_OP)) { Op->Common.Flags |= ACPI_PARSEOP_TARGET; } } if (WalkState->DescendingCallback != NULL) { /* * Find the object. This will either insert the object into * the namespace or simply look it up */ WalkState->Op = *NewOp = Op; Status = WalkState->DescendingCallback (WalkState, &Op); Status = AcpiPsNextParseState (WalkState, Op, Status); if (Status == AE_CTRL_PENDING) { Status = AE_CTRL_PARSE_PENDING; } } return_ACPI_STATUS (Status); }
AcpiPsCreateOp ( ACPI_WALK_STATE *WalkState, UINT8 *AmlOpStart, ACPI_PARSE_OBJECT **NewOp) { ACPI_STATUS Status = AE_OK; ACPI_PARSE_OBJECT *Op; ACPI_PARSE_OBJECT *NamedOp = NULL; ACPI_PARSE_OBJECT *ParentScope; UINT8 ArgumentCount; const ACPI_OPCODE_INFO *OpInfo; ACPI_FUNCTION_TRACE_PTR (PsCreateOp, WalkState); Status = AcpiPsGetAmlOpcode (WalkState); if (Status == AE_CTRL_PARSE_CONTINUE) { return_ACPI_STATUS (AE_CTRL_PARSE_CONTINUE); } if (ACPI_FAILURE (Status)) { return_ACPI_STATUS (Status); } /* Create Op structure and append to parent's argument list */ WalkState->OpInfo = AcpiPsGetOpcodeInfo (WalkState->Opcode); Op = AcpiPsAllocOp (WalkState->Opcode, AmlOpStart); if (!Op) { return_ACPI_STATUS (AE_NO_MEMORY); } if (WalkState->OpInfo->Flags & AML_NAMED) { Status = AcpiPsBuildNamedOp (WalkState, AmlOpStart, Op, &NamedOp); AcpiPsFreeOp (Op); if (ACPI_FAILURE (Status)) { return_ACPI_STATUS (Status); } *NewOp = NamedOp; return_ACPI_STATUS (AE_OK); } /* Not a named opcode, just allocate Op and append to parent */ if (WalkState->OpInfo->Flags & AML_CREATE) { /* * Backup to beginning of CreateXXXfield declaration * BodyLength is unknown until we parse the body */ Op->Named.Data = AmlOpStart; Op->Named.Length = 0; } if (WalkState->Opcode == AML_BANK_FIELD_OP) { /* * Backup to beginning of BankField declaration * BodyLength is unknown until we parse the body */ Op->Named.Data = AmlOpStart; Op->Named.Length = 0; } ParentScope = AcpiPsGetParentScope (&(WalkState->ParserState)); AcpiPsAppendArg (ParentScope, Op); if (ParentScope) { OpInfo = AcpiPsGetOpcodeInfo (ParentScope->Common.AmlOpcode); if (OpInfo->Flags & AML_HAS_TARGET) { ArgumentCount = AcpiPsGetArgumentCount (OpInfo->Type); if (ParentScope->Common.ArgListLength > ArgumentCount) { Op->Common.Flags |= ACPI_PARSEOP_TARGET; } } /* * Special case for both Increment() and Decrement(), where * the lone argument is both a source and a target. */ else if ((ParentScope->Common.AmlOpcode == AML_INCREMENT_OP) || (ParentScope->Common.AmlOpcode == AML_DECREMENT_OP)) { Op->Common.Flags |= ACPI_PARSEOP_TARGET; } } if (WalkState->DescendingCallback != NULL) { /* * Find the object. This will either insert the object into * the namespace or simply look it up */ WalkState->Op = *NewOp = Op; Status = WalkState->DescendingCallback (WalkState, &Op); Status = AcpiPsNextParseState (WalkState, Op, Status); if (Status == AE_CTRL_PENDING) { Status = AE_CTRL_PARSE_PENDING; } } return_ACPI_STATUS (Status); }
C
acpica
0
CVE-2016-5354
https://www.cvedetails.com/cve/CVE-2016-5354/
CWE-476
https://github.com/wireshark/wireshark/commit/2cb5985bf47bdc8bea78d28483ed224abdd33dc6
2cb5985bf47bdc8bea78d28483ed224abdd33dc6
Make class "type" for USB conversations. USB dissectors can't assume that only their class type has been passed around in the conversation. Make explicit check that class type expected matches the dissector and stop/prevent dissection if there isn't a match. Bug: 12356 Change-Id: Ib23973a4ebd0fbb51952ffc118daf95e3389a209 Reviewed-on: https://code.wireshark.org/review/15212 Petri-Dish: Michael Mann <mmann78@netscape.net> Reviewed-by: Martin Kaiser <wireshark@kaiser.cx> Petri-Dish: Martin Kaiser <wireshark@kaiser.cx> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
dissect_bmControl(proto_tree *tree, tvbuff_t *tvb, int offset, gint ett_subtree, const int** bm_items) { guint8 bm_size = 0; bm_size = tvb_get_guint8(tvb, offset); proto_tree_add_item(tree, hf_usb_vid_bControlSize, tvb, offset, 1, ENC_LITTLE_ENDIAN); ++offset; if (bm_size > 0) { proto_tree_add_bitmask_len(tree, tvb, offset, bm_size, hf_usb_vid_bmControl, ett_subtree, bm_items, &ei_usb_vid_bitmask_len, ENC_LITTLE_ENDIAN); offset += bm_size; } return offset; }
dissect_bmControl(proto_tree *tree, tvbuff_t *tvb, int offset, gint ett_subtree, const int** bm_items) { guint8 bm_size = 0; bm_size = tvb_get_guint8(tvb, offset); proto_tree_add_item(tree, hf_usb_vid_bControlSize, tvb, offset, 1, ENC_LITTLE_ENDIAN); ++offset; if (bm_size > 0) { proto_tree_add_bitmask_len(tree, tvb, offset, bm_size, hf_usb_vid_bmControl, ett_subtree, bm_items, &ei_usb_vid_bitmask_len, ENC_LITTLE_ENDIAN); offset += bm_size; } return offset; }
C
wireshark
0
CVE-2006-4192
https://www.cvedetails.com/cve/CVE-2006-4192/
null
https://cgit.freedesktop.org/gstreamer/gst-plugins-bad/commit/?id=bc2cdd57d549ab3ba59782e9b395d0cd683fd3ac
bc2cdd57d549ab3ba59782e9b395d0cd683fd3ac
null
UINT CSoundFile::GetSaveFormats() const { UINT n = 0; if ((!m_nSamples) || (!m_nChannels) || (m_nType == MOD_TYPE_NONE)) return 0; switch(m_nType) { case MOD_TYPE_MOD: n = MOD_TYPE_MOD; case MOD_TYPE_S3M: n = MOD_TYPE_S3M; } n |= MOD_TYPE_XM | MOD_TYPE_IT; if (!m_nInstruments) { if (m_nSamples < 32) n |= MOD_TYPE_MOD; n |= MOD_TYPE_S3M; } return n; }
UINT CSoundFile::GetSaveFormats() const { UINT n = 0; if ((!m_nSamples) || (!m_nChannels) || (m_nType == MOD_TYPE_NONE)) return 0; switch(m_nType) { case MOD_TYPE_MOD: n = MOD_TYPE_MOD; case MOD_TYPE_S3M: n = MOD_TYPE_S3M; } n |= MOD_TYPE_XM | MOD_TYPE_IT; if (!m_nInstruments) { if (m_nSamples < 32) n |= MOD_TYPE_MOD; n |= MOD_TYPE_S3M; } return n; }
CPP
gstreamer
0
CVE-2017-6542
https://www.cvedetails.com/cve/CVE-2017-6542/
CWE-119
https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=4ff22863d895cb7ebfced4cf923a012a614adaa8
4ff22863d895cb7ebfced4cf923a012a614adaa8
null
static Bignum ssh2_pkt_getmp(struct Packet *pkt) { char *p; int length; Bignum b; ssh_pkt_getstring(pkt, &p, &length); if (!p) return NULL; if (p[0] & 0x80) return NULL; b = bignum_from_bytes((unsigned char *)p, length); return b; }
static Bignum ssh2_pkt_getmp(struct Packet *pkt) { char *p; int length; Bignum b; ssh_pkt_getstring(pkt, &p, &length); if (!p) return NULL; if (p[0] & 0x80) return NULL; b = bignum_from_bytes((unsigned char *)p, length); return b; }
C
tartarus
0
CVE-2016-1667
https://www.cvedetails.com/cve/CVE-2016-1667/
CWE-284
https://github.com/chromium/chromium/commit/350f7d4b2c76950c8e7271284de84a9756b796e1
350f7d4b2c76950c8e7271284de84a9756b796e1
P2PQuicStream write functionality. This adds the P2PQuicStream::WriteData function and adds tests. It also adds the concept of a write buffered amount, enforcing this at the P2PQuicStreamImpl. Bug: 874296 Change-Id: Id02c8aa8d5368a87bb24a2e50dab5ef94bcae131 Reviewed-on: https://chromium-review.googlesource.com/c/1315534 Commit-Queue: Seth Hampson <shampson@chromium.org> Reviewed-by: Henrik Boström <hbos@chromium.org> Cr-Commit-Position: refs/heads/master@{#605766}
void QuicTransportHost::OnConnectionFailed(const std::string& error_details, bool from_remote) { DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); stream_hosts_.clear(); PostCrossThreadTask(*proxy_thread(), FROM_HERE, CrossThreadBind(&QuicTransportProxy::OnConnectionFailed, proxy_, error_details, from_remote)); }
void QuicTransportHost::OnConnectionFailed(const std::string& error_details, bool from_remote) { DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); stream_hosts_.clear(); PostCrossThreadTask(*proxy_thread(), FROM_HERE, CrossThreadBind(&QuicTransportProxy::OnConnectionFailed, proxy_, error_details, from_remote)); }
C
Chrome
0
CVE-2017-5120
https://www.cvedetails.com/cve/CVE-2017-5120/
null
https://github.com/chromium/chromium/commit/b7277af490d28ac7f802c015bb0ff31395768556
b7277af490d28ac7f802c015bb0ff31395768556
bindings: Support "attribute FrozenArray<T>?" Adds a quick hack to support a case of "attribute FrozenArray<T>?". Bug: 1028047 Change-Id: Ib3cecc4beb6bcc0fb0dbc667aca595454cc90c86 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1933866 Reviewed-by: Hitoshi Yoshida <peria@chromium.org> Commit-Queue: Yuki Shiino <yukishiino@chromium.org> Cr-Commit-Position: refs/heads/master@{#718676}
void V8TestObject::CustomSetterImplementedAsLongAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_customSetterImplementedAsLongAttribute_Getter"); test_object_v8_internal::CustomSetterImplementedAsLongAttributeAttributeGetter(info); }
void V8TestObject::CustomSetterImplementedAsLongAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_customSetterImplementedAsLongAttribute_Getter"); test_object_v8_internal::CustomSetterImplementedAsLongAttributeAttributeGetter(info); }
C
Chrome
0
CVE-2016-5200
https://www.cvedetails.com/cve/CVE-2016-5200/
CWE-119
https://github.com/chromium/chromium/commit/2f19869af13bbfdcfd682a55c0d2c61c6e102475
2f19869af13bbfdcfd682a55c0d2c61c6e102475
chrome/browser/ui/webauthn: long domains may cause a line break. As requested by UX in [1], allow long host names to split a title into two lines. This allows us to show more of the name before eliding, although sufficiently long names will still trigger elision. Screenshot at https://drive.google.com/open?id=1_V6t2CeZDAVazy3Px-OET2LnB__aEW1r. [1] https://docs.google.com/presentation/d/1TtxkPUchyVZulqgdMcfui-68B0W-DWaFFVJEffGIbLA/edit#slide=id.g5913c4105f_1_12 Change-Id: I70f6541e0db3e9942239304de43b487a7561ca34 Bug: 870892 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1601812 Auto-Submit: Adam Langley <agl@chromium.org> Commit-Queue: Nina Satragno <nsatragno@chromium.org> Reviewed-by: Nina Satragno <nsatragno@chromium.org> Cr-Commit-Position: refs/heads/master@{#658114}
const gfx::VectorIcon& AuthenticatorPaaskSheetModel::GetStepIllustration( ImageColorScheme color_scheme) const { return color_scheme == ImageColorScheme::kDark ? kWebauthnPhoneDarkIcon : kWebauthnPhoneIcon; }
const gfx::VectorIcon& AuthenticatorPaaskSheetModel::GetStepIllustration( ImageColorScheme color_scheme) const { return color_scheme == ImageColorScheme::kDark ? kWebauthnPhoneDarkIcon : kWebauthnPhoneIcon; }
C
Chrome
0
CVE-2012-2875
https://www.cvedetails.com/cve/CVE-2012-2875/
null
https://github.com/chromium/chromium/commit/40ed2b7ae4f6f5adb1b0ce9acf9c4dece339c2a6
40ed2b7ae4f6f5adb1b0ce9acf9c4dece339c2a6
gdata: Define the resource ID for the root directory Per the spec, the resource ID for the root directory is defined as "folder:root". Add the resource ID to the root directory in our file system representation so we can look up the root directory by the resource ID. BUG=127697 TEST=add unit tests Review URL: https://chromiumcodereview.appspot.com/10332253 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@137928 0039d316-1c4b-4281-b951-d872f2087c98
void GDataRootDirectory::FindEntryByPath(const FilePath& file_path, const FindEntryCallback& callback) { DCHECK(!callback.is_null()); std::vector<FilePath::StringType> components; file_path.GetComponents(&components); GDataDirectory* current_dir = this; FilePath directory_path; util::GDataSearchPathType path_type = util::GetSearchPathStatusForPathComponents(components); if (path_type == util::GDATA_SEARCH_PATH_ROOT || path_type == util::GDATA_SEARCH_PATH_QUERY) { callback.Run(base::PLATFORM_FILE_OK, file_path.DirName(), fake_search_directory_.get()); return; } if (path_type != util::GDATA_SEARCH_PATH_INVALID) { if (!ModifyFindEntryParamsForSearchPath(file_path, &components, &current_dir, &directory_path)) { callback.Run(base::PLATFORM_FILE_ERROR_NOT_FOUND, FilePath(), NULL); return; } } for (size_t i = 0; i < components.size() && current_dir; i++) { directory_path = directory_path.Append(current_dir->file_name()); if (i == components.size() - 1) { if (current_dir->file_name() == components[i]) callback.Run(base::PLATFORM_FILE_OK, directory_path, current_dir); else callback.Run(base::PLATFORM_FILE_ERROR_NOT_FOUND, FilePath(), NULL); return; } GDataEntry* entry = current_dir->FindChild(components[i + 1]); if (!entry) { callback.Run(base::PLATFORM_FILE_ERROR_NOT_FOUND, FilePath(), NULL); return; } if (entry->file_info().is_directory) { current_dir = entry->AsGDataDirectory(); } else { if ((i + 1) == (components.size() - 1)) callback.Run(base::PLATFORM_FILE_OK, directory_path, entry); else callback.Run(base::PLATFORM_FILE_ERROR_NOT_FOUND, FilePath(), NULL); return; } } callback.Run(base::PLATFORM_FILE_ERROR_NOT_FOUND, FilePath(), NULL); }
void GDataRootDirectory::FindEntryByPath(const FilePath& file_path, const FindEntryCallback& callback) { DCHECK(!callback.is_null()); std::vector<FilePath::StringType> components; file_path.GetComponents(&components); GDataDirectory* current_dir = this; FilePath directory_path; util::GDataSearchPathType path_type = util::GetSearchPathStatusForPathComponents(components); if (path_type == util::GDATA_SEARCH_PATH_ROOT || path_type == util::GDATA_SEARCH_PATH_QUERY) { callback.Run(base::PLATFORM_FILE_OK, file_path.DirName(), fake_search_directory_.get()); return; } if (path_type != util::GDATA_SEARCH_PATH_INVALID) { if (!ModifyFindEntryParamsForSearchPath(file_path, &components, &current_dir, &directory_path)) { callback.Run(base::PLATFORM_FILE_ERROR_NOT_FOUND, FilePath(), NULL); return; } } for (size_t i = 0; i < components.size() && current_dir; i++) { directory_path = directory_path.Append(current_dir->file_name()); if (i == components.size() - 1) { if (current_dir->file_name() == components[i]) callback.Run(base::PLATFORM_FILE_OK, directory_path, current_dir); else callback.Run(base::PLATFORM_FILE_ERROR_NOT_FOUND, FilePath(), NULL); return; } GDataEntry* entry = current_dir->FindChild(components[i + 1]); if (!entry) { callback.Run(base::PLATFORM_FILE_ERROR_NOT_FOUND, FilePath(), NULL); return; } if (entry->file_info().is_directory) { current_dir = entry->AsGDataDirectory(); } else { if ((i + 1) == (components.size() - 1)) callback.Run(base::PLATFORM_FILE_OK, directory_path, entry); else callback.Run(base::PLATFORM_FILE_ERROR_NOT_FOUND, FilePath(), NULL); return; } } callback.Run(base::PLATFORM_FILE_ERROR_NOT_FOUND, FilePath(), NULL); }
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 <kbr@chromium.org> Reviewed-by: Kentaro Hara <haraken@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Kenneth Russell <kbr@chromium.org> Cr-Commit-Position: refs/heads/master@{#657568}
void WebGLRenderingContextBase::attachShader(WebGLProgram* program, WebGLShader* shader) { if (!ValidateWebGLProgramOrShader("attachShader", program) || !ValidateWebGLProgramOrShader("attachShader", shader)) return; if (!program->AttachShader(shader)) { SynthesizeGLError(GL_INVALID_OPERATION, "attachShader", "shader attachment already has shader"); return; } ContextGL()->AttachShader(ObjectOrZero(program), ObjectOrZero(shader)); shader->OnAttached(); }
void WebGLRenderingContextBase::attachShader(WebGLProgram* program, WebGLShader* shader) { if (!ValidateWebGLProgramOrShader("attachShader", program) || !ValidateWebGLProgramOrShader("attachShader", shader)) return; if (!program->AttachShader(shader)) { SynthesizeGLError(GL_INVALID_OPERATION, "attachShader", "shader attachment already has shader"); return; } ContextGL()->AttachShader(ObjectOrZero(program), ObjectOrZero(shader)); shader->OnAttached(); }
C
Chrome
0
CVE-2012-5148
https://www.cvedetails.com/cve/CVE-2012-5148/
CWE-20
https://github.com/chromium/chromium/commit/e89cfcb9090e8c98129ae9160c513f504db74599
e89cfcb9090e8c98129ae9160c513f504db74599
Remove TabContents from TabStripModelObserver::TabDetachedAt. BUG=107201 TEST=no visible change Review URL: https://chromiumcodereview.appspot.com/11293205 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@167122 0039d316-1c4b-4281-b951-d872f2087c98
void BrowserWindowGtk::MaybeShowBookmarkBar(bool animate) { TRACE_EVENT0("ui::gtk", "BrowserWindowGtk::MaybeShowBookmarkBar"); if (!IsBookmarkBarSupported()) return; TabContents* tab = GetDisplayedTab(); if (tab) bookmark_bar_->SetPageNavigator(browser_.get()); BookmarkBar::State state = browser_->bookmark_bar_state(); if (contents_container_->HasPreview() && state == BookmarkBar::DETACHED) state = BookmarkBar::HIDDEN; toolbar_->UpdateForBookmarkBarVisibility(state == BookmarkBar::DETACHED); PlaceBookmarkBar(state == BookmarkBar::DETACHED); bookmark_bar_->SetBookmarkBarState( state, animate ? BookmarkBar::ANIMATE_STATE_CHANGE : BookmarkBar::DONT_ANIMATE_STATE_CHANGE); }
void BrowserWindowGtk::MaybeShowBookmarkBar(bool animate) { TRACE_EVENT0("ui::gtk", "BrowserWindowGtk::MaybeShowBookmarkBar"); if (!IsBookmarkBarSupported()) return; TabContents* tab = GetDisplayedTab(); if (tab) bookmark_bar_->SetPageNavigator(browser_.get()); BookmarkBar::State state = browser_->bookmark_bar_state(); if (contents_container_->HasPreview() && state == BookmarkBar::DETACHED) state = BookmarkBar::HIDDEN; toolbar_->UpdateForBookmarkBarVisibility(state == BookmarkBar::DETACHED); PlaceBookmarkBar(state == BookmarkBar::DETACHED); bookmark_bar_->SetBookmarkBarState( state, animate ? BookmarkBar::ANIMATE_STATE_CHANGE : BookmarkBar::DONT_ANIMATE_STATE_CHANGE); }
C
Chrome
0
CVE-2014-3480
https://www.cvedetails.com/cve/CVE-2014-3480/
CWE-20
https://github.com/file/file/commit/40bade80cbe2af1d0b2cd0420cebd5d5905a2382
40bade80cbe2af1d0b2cd0420cebd5d5905a2382
Fix incorrect bounds check for sector count. (Francisco Alonso and Jan Kaluza at RedHat)
cdf_read_property_info(const cdf_stream_t *sst, const cdf_header_t *h, uint32_t offs, cdf_property_info_t **info, size_t *count, size_t *maxcount) { const cdf_section_header_t *shp; cdf_section_header_t sh; const uint8_t *p, *q, *e; int16_t s16; int32_t s32; uint32_t u32; int64_t s64; uint64_t u64; cdf_timestamp_t tp; size_t i, o, o4, nelements, j; cdf_property_info_t *inp; if (offs > UINT32_MAX / 4) { errno = EFTYPE; goto out; } shp = CAST(const cdf_section_header_t *, (const void *) ((const char *)sst->sst_tab + offs)); if (cdf_check_stream_offset(sst, h, shp, sizeof(*shp), __LINE__) == -1) goto out; sh.sh_len = CDF_TOLE4(shp->sh_len); #define CDF_SHLEN_LIMIT (UINT32_MAX / 8) if (sh.sh_len > CDF_SHLEN_LIMIT) { errno = EFTYPE; goto out; } sh.sh_properties = CDF_TOLE4(shp->sh_properties); #define CDF_PROP_LIMIT (UINT32_MAX / (4 * sizeof(*inp))) if (sh.sh_properties > CDF_PROP_LIMIT) goto out; DPRINTF(("section len: %u properties %u\n", sh.sh_len, sh.sh_properties)); if (*maxcount) { if (*maxcount > CDF_PROP_LIMIT) goto out; *maxcount += sh.sh_properties; inp = CAST(cdf_property_info_t *, realloc(*info, *maxcount * sizeof(*inp))); } else { *maxcount = sh.sh_properties; inp = CAST(cdf_property_info_t *, malloc(*maxcount * sizeof(*inp))); } if (inp == NULL) goto out; *info = inp; inp += *count; *count += sh.sh_properties; p = CAST(const uint8_t *, (const void *) ((const char *)(const void *)sst->sst_tab + offs + sizeof(sh))); e = CAST(const uint8_t *, (const void *) (((const char *)(const void *)shp) + sh.sh_len)); if (cdf_check_stream_offset(sst, h, e, 0, __LINE__) == -1) goto out; for (i = 0; i < sh.sh_properties; i++) { size_t ofs = CDF_GETUINT32(p, (i << 1) + 1); q = (const uint8_t *)(const void *) ((const char *)(const void *)p + ofs - 2 * sizeof(uint32_t)); if (q > e) { DPRINTF(("Ran of the end %p > %p\n", q, e)); goto out; } inp[i].pi_id = CDF_GETUINT32(p, i << 1); inp[i].pi_type = CDF_GETUINT32(q, 0); DPRINTF(("%" SIZE_T_FORMAT "u) id=%x type=%x offs=0x%tx,0x%x\n", i, inp[i].pi_id, inp[i].pi_type, q - p, offs)); if (inp[i].pi_type & CDF_VECTOR) { nelements = CDF_GETUINT32(q, 1); if (nelements == 0) { DPRINTF(("CDF_VECTOR with nelements == 0\n")); goto out; } o = 2; } else { nelements = 1; o = 1; } o4 = o * sizeof(uint32_t); if (inp[i].pi_type & (CDF_ARRAY|CDF_BYREF|CDF_RESERVED)) goto unknown; switch (inp[i].pi_type & CDF_TYPEMASK) { case CDF_NULL: case CDF_EMPTY: break; case CDF_SIGNED16: if (inp[i].pi_type & CDF_VECTOR) goto unknown; (void)memcpy(&s16, &q[o4], sizeof(s16)); inp[i].pi_s16 = CDF_TOLE2(s16); break; case CDF_SIGNED32: if (inp[i].pi_type & CDF_VECTOR) goto unknown; (void)memcpy(&s32, &q[o4], sizeof(s32)); inp[i].pi_s32 = CDF_TOLE4((uint32_t)s32); break; case CDF_BOOL: case CDF_UNSIGNED32: if (inp[i].pi_type & CDF_VECTOR) goto unknown; (void)memcpy(&u32, &q[o4], sizeof(u32)); inp[i].pi_u32 = CDF_TOLE4(u32); break; case CDF_SIGNED64: if (inp[i].pi_type & CDF_VECTOR) goto unknown; (void)memcpy(&s64, &q[o4], sizeof(s64)); inp[i].pi_s64 = CDF_TOLE8((uint64_t)s64); break; case CDF_UNSIGNED64: if (inp[i].pi_type & CDF_VECTOR) goto unknown; (void)memcpy(&u64, &q[o4], sizeof(u64)); inp[i].pi_u64 = CDF_TOLE8((uint64_t)u64); break; case CDF_FLOAT: if (inp[i].pi_type & CDF_VECTOR) goto unknown; (void)memcpy(&u32, &q[o4], sizeof(u32)); u32 = CDF_TOLE4(u32); memcpy(&inp[i].pi_f, &u32, sizeof(inp[i].pi_f)); break; case CDF_DOUBLE: if (inp[i].pi_type & CDF_VECTOR) goto unknown; (void)memcpy(&u64, &q[o4], sizeof(u64)); u64 = CDF_TOLE8((uint64_t)u64); memcpy(&inp[i].pi_d, &u64, sizeof(inp[i].pi_d)); break; case CDF_LENGTH32_STRING: case CDF_LENGTH32_WSTRING: if (nelements > 1) { size_t nelem = inp - *info; if (*maxcount > CDF_PROP_LIMIT || nelements > CDF_PROP_LIMIT) goto out; *maxcount += nelements; inp = CAST(cdf_property_info_t *, realloc(*info, *maxcount * sizeof(*inp))); if (inp == NULL) goto out; *info = inp; inp = *info + nelem; } DPRINTF(("nelements = %" SIZE_T_FORMAT "u\n", nelements)); for (j = 0; j < nelements && i < sh.sh_properties; j++, i++) { uint32_t l = CDF_GETUINT32(q, o); inp[i].pi_str.s_len = l; inp[i].pi_str.s_buf = (const char *) (const void *)(&q[o4 + sizeof(l)]); DPRINTF(("l = %d, r = %" SIZE_T_FORMAT "u, s = %s\n", l, CDF_ROUND(l, sizeof(l)), inp[i].pi_str.s_buf)); if (l & 1) l++; o += l >> 1; if (q + o >= e) goto out; o4 = o * sizeof(uint32_t); } i--; break; case CDF_FILETIME: if (inp[i].pi_type & CDF_VECTOR) goto unknown; (void)memcpy(&tp, &q[o4], sizeof(tp)); inp[i].pi_tp = CDF_TOLE8((uint64_t)tp); break; case CDF_CLIPBOARD: if (inp[i].pi_type & CDF_VECTOR) goto unknown; break; default: unknown: DPRINTF(("Don't know how to deal with %x\n", inp[i].pi_type)); break; } } return 0; out: free(*info); return -1; }
cdf_read_property_info(const cdf_stream_t *sst, const cdf_header_t *h, uint32_t offs, cdf_property_info_t **info, size_t *count, size_t *maxcount) { const cdf_section_header_t *shp; cdf_section_header_t sh; const uint8_t *p, *q, *e; int16_t s16; int32_t s32; uint32_t u32; int64_t s64; uint64_t u64; cdf_timestamp_t tp; size_t i, o, o4, nelements, j; cdf_property_info_t *inp; if (offs > UINT32_MAX / 4) { errno = EFTYPE; goto out; } shp = CAST(const cdf_section_header_t *, (const void *) ((const char *)sst->sst_tab + offs)); if (cdf_check_stream_offset(sst, h, shp, sizeof(*shp), __LINE__) == -1) goto out; sh.sh_len = CDF_TOLE4(shp->sh_len); #define CDF_SHLEN_LIMIT (UINT32_MAX / 8) if (sh.sh_len > CDF_SHLEN_LIMIT) { errno = EFTYPE; goto out; } sh.sh_properties = CDF_TOLE4(shp->sh_properties); #define CDF_PROP_LIMIT (UINT32_MAX / (4 * sizeof(*inp))) if (sh.sh_properties > CDF_PROP_LIMIT) goto out; DPRINTF(("section len: %u properties %u\n", sh.sh_len, sh.sh_properties)); if (*maxcount) { if (*maxcount > CDF_PROP_LIMIT) goto out; *maxcount += sh.sh_properties; inp = CAST(cdf_property_info_t *, realloc(*info, *maxcount * sizeof(*inp))); } else { *maxcount = sh.sh_properties; inp = CAST(cdf_property_info_t *, malloc(*maxcount * sizeof(*inp))); } if (inp == NULL) goto out; *info = inp; inp += *count; *count += sh.sh_properties; p = CAST(const uint8_t *, (const void *) ((const char *)(const void *)sst->sst_tab + offs + sizeof(sh))); e = CAST(const uint8_t *, (const void *) (((const char *)(const void *)shp) + sh.sh_len)); if (cdf_check_stream_offset(sst, h, e, 0, __LINE__) == -1) goto out; for (i = 0; i < sh.sh_properties; i++) { size_t ofs = CDF_GETUINT32(p, (i << 1) + 1); q = (const uint8_t *)(const void *) ((const char *)(const void *)p + ofs - 2 * sizeof(uint32_t)); if (q > e) { DPRINTF(("Ran of the end %p > %p\n", q, e)); goto out; } inp[i].pi_id = CDF_GETUINT32(p, i << 1); inp[i].pi_type = CDF_GETUINT32(q, 0); DPRINTF(("%" SIZE_T_FORMAT "u) id=%x type=%x offs=0x%tx,0x%x\n", i, inp[i].pi_id, inp[i].pi_type, q - p, offs)); if (inp[i].pi_type & CDF_VECTOR) { nelements = CDF_GETUINT32(q, 1); if (nelements == 0) { DPRINTF(("CDF_VECTOR with nelements == 0\n")); goto out; } o = 2; } else { nelements = 1; o = 1; } o4 = o * sizeof(uint32_t); if (inp[i].pi_type & (CDF_ARRAY|CDF_BYREF|CDF_RESERVED)) goto unknown; switch (inp[i].pi_type & CDF_TYPEMASK) { case CDF_NULL: case CDF_EMPTY: break; case CDF_SIGNED16: if (inp[i].pi_type & CDF_VECTOR) goto unknown; (void)memcpy(&s16, &q[o4], sizeof(s16)); inp[i].pi_s16 = CDF_TOLE2(s16); break; case CDF_SIGNED32: if (inp[i].pi_type & CDF_VECTOR) goto unknown; (void)memcpy(&s32, &q[o4], sizeof(s32)); inp[i].pi_s32 = CDF_TOLE4((uint32_t)s32); break; case CDF_BOOL: case CDF_UNSIGNED32: if (inp[i].pi_type & CDF_VECTOR) goto unknown; (void)memcpy(&u32, &q[o4], sizeof(u32)); inp[i].pi_u32 = CDF_TOLE4(u32); break; case CDF_SIGNED64: if (inp[i].pi_type & CDF_VECTOR) goto unknown; (void)memcpy(&s64, &q[o4], sizeof(s64)); inp[i].pi_s64 = CDF_TOLE8((uint64_t)s64); break; case CDF_UNSIGNED64: if (inp[i].pi_type & CDF_VECTOR) goto unknown; (void)memcpy(&u64, &q[o4], sizeof(u64)); inp[i].pi_u64 = CDF_TOLE8((uint64_t)u64); break; case CDF_FLOAT: if (inp[i].pi_type & CDF_VECTOR) goto unknown; (void)memcpy(&u32, &q[o4], sizeof(u32)); u32 = CDF_TOLE4(u32); memcpy(&inp[i].pi_f, &u32, sizeof(inp[i].pi_f)); break; case CDF_DOUBLE: if (inp[i].pi_type & CDF_VECTOR) goto unknown; (void)memcpy(&u64, &q[o4], sizeof(u64)); u64 = CDF_TOLE8((uint64_t)u64); memcpy(&inp[i].pi_d, &u64, sizeof(inp[i].pi_d)); break; case CDF_LENGTH32_STRING: case CDF_LENGTH32_WSTRING: if (nelements > 1) { size_t nelem = inp - *info; if (*maxcount > CDF_PROP_LIMIT || nelements > CDF_PROP_LIMIT) goto out; *maxcount += nelements; inp = CAST(cdf_property_info_t *, realloc(*info, *maxcount * sizeof(*inp))); if (inp == NULL) goto out; *info = inp; inp = *info + nelem; } DPRINTF(("nelements = %" SIZE_T_FORMAT "u\n", nelements)); for (j = 0; j < nelements && i < sh.sh_properties; j++, i++) { uint32_t l = CDF_GETUINT32(q, o); inp[i].pi_str.s_len = l; inp[i].pi_str.s_buf = (const char *) (const void *)(&q[o4 + sizeof(l)]); DPRINTF(("l = %d, r = %" SIZE_T_FORMAT "u, s = %s\n", l, CDF_ROUND(l, sizeof(l)), inp[i].pi_str.s_buf)); if (l & 1) l++; o += l >> 1; if (q + o >= e) goto out; o4 = o * sizeof(uint32_t); } i--; break; case CDF_FILETIME: if (inp[i].pi_type & CDF_VECTOR) goto unknown; (void)memcpy(&tp, &q[o4], sizeof(tp)); inp[i].pi_tp = CDF_TOLE8((uint64_t)tp); break; case CDF_CLIPBOARD: if (inp[i].pi_type & CDF_VECTOR) goto unknown; break; default: unknown: DPRINTF(("Don't know how to deal with %x\n", inp[i].pi_type)); break; } } return 0; out: free(*info); return -1; }
C
file
0
CVE-2017-5120
https://www.cvedetails.com/cve/CVE-2017-5120/
null
https://github.com/chromium/chromium/commit/b7277af490d28ac7f802c015bb0ff31395768556
b7277af490d28ac7f802c015bb0ff31395768556
bindings: Support "attribute FrozenArray<T>?" Adds a quick hack to support a case of "attribute FrozenArray<T>?". Bug: 1028047 Change-Id: Ib3cecc4beb6bcc0fb0dbc667aca595454cc90c86 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1933866 Reviewed-by: Hitoshi Yoshida <peria@chromium.org> Commit-Queue: Yuki Shiino <yukishiino@chromium.org> Cr-Commit-Position: refs/heads/master@{#718676}
static void UnforgeableLongAttributeAttributeGetter(const v8::FunctionCallbackInfo<v8::Value>& info) { v8::Local<v8::Object> holder = info.Holder(); TestObject* impl = V8TestObject::ToImpl(holder); V8SetReturnValueInt(info, impl->unforgeableLongAttribute()); }
static void UnforgeableLongAttributeAttributeGetter(const v8::FunctionCallbackInfo<v8::Value>& info) { v8::Local<v8::Object> holder = info.Holder(); TestObject* impl = V8TestObject::ToImpl(holder); V8SetReturnValueInt(info, impl->unforgeableLongAttribute()); }
C
Chrome
0
CVE-2016-10048
https://www.cvedetails.com/cve/CVE-2016-10048/
CWE-22
https://github.com/ImageMagick/ImageMagick/commit/fc6080f1321fd21e86ef916195cc110b05d9effb
fc6080f1321fd21e86ef916195cc110b05d9effb
Coder path traversal is not authorized, bug report provided by Masaaki Chida
MagickExport XMLTreeInfo *DestroyXMLTree(XMLTreeInfo *xml_info) { assert(xml_info != (XMLTreeInfo *) NULL); assert((xml_info->signature == MagickSignature) || (((XMLTreeRoot *) xml_info)->signature == MagickSignature)); if (xml_info->debug != MagickFalse) (void) LogMagickEvent(TraceEvent,GetMagickModule(),"..."); DestroyXMLTreeChild(xml_info); DestroyXMLTreeOrdered(xml_info); DestroyXMLTreeRoot(xml_info); xml_info->attributes=DestroyXMLTreeAttributes(xml_info->attributes); xml_info->content=DestroyString(xml_info->content); xml_info->tag=DestroyString(xml_info->tag); xml_info=(XMLTreeInfo *) RelinquishMagickMemory(xml_info); return((XMLTreeInfo *) NULL); }
MagickExport XMLTreeInfo *DestroyXMLTree(XMLTreeInfo *xml_info) { assert(xml_info != (XMLTreeInfo *) NULL); assert((xml_info->signature == MagickSignature) || (((XMLTreeRoot *) xml_info)->signature == MagickSignature)); if (xml_info->debug != MagickFalse) (void) LogMagickEvent(TraceEvent,GetMagickModule(),"..."); DestroyXMLTreeChild(xml_info); DestroyXMLTreeOrdered(xml_info); DestroyXMLTreeRoot(xml_info); xml_info->attributes=DestroyXMLTreeAttributes(xml_info->attributes); xml_info->content=DestroyString(xml_info->content); xml_info->tag=DestroyString(xml_info->tag); xml_info=(XMLTreeInfo *) RelinquishMagickMemory(xml_info); return((XMLTreeInfo *) NULL); }
C
ImageMagick
0
CVE-2016-5219
https://www.cvedetails.com/cve/CVE-2016-5219/
CWE-416
https://github.com/chromium/chromium/commit/a4150b688a754d3d10d2ca385155b1c95d77d6ae
a4150b688a754d3d10d2ca385155b1c95d77d6ae
Add GL_PROGRAM_COMPLETION_QUERY_CHROMIUM This makes the query of GL_COMPLETION_STATUS_KHR to programs much cheaper by minimizing the round-trip to the GPU thread. Bug: 881152, 957001 Change-Id: Iadfa798af29225e752c710ca5c25f50b3dd3101a Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1586630 Commit-Queue: Kenneth Russell <kbr@chromium.org> Reviewed-by: Kentaro Hara <haraken@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Kenneth Russell <kbr@chromium.org> Cr-Commit-Position: refs/heads/master@{#657568}
Capabilities GLES2DecoderImpl::GetCapabilities() { DCHECK(initialized()); Capabilities caps; const gl::GLVersionInfo& version_info = gl_version_info(); caps.VisitPrecisions([&version_info]( GLenum shader, GLenum type, Capabilities::ShaderPrecision* shader_precision) { GLint range[2] = {0, 0}; GLint precision = 0; QueryShaderPrecisionFormat(version_info, shader, type, range, &precision); shader_precision->min_range = range[0]; shader_precision->max_range = range[1]; shader_precision->precision = precision; }); DoGetIntegerv(GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS, &caps.max_combined_texture_image_units, 1); DoGetIntegerv(GL_MAX_CUBE_MAP_TEXTURE_SIZE, &caps.max_cube_map_texture_size, 1); DoGetIntegerv(GL_MAX_FRAGMENT_UNIFORM_VECTORS, &caps.max_fragment_uniform_vectors, 1); DoGetIntegerv(GL_MAX_RENDERBUFFER_SIZE, &caps.max_renderbuffer_size, 1); DoGetIntegerv(GL_MAX_TEXTURE_IMAGE_UNITS, &caps.max_texture_image_units, 1); DoGetIntegerv(GL_MAX_TEXTURE_SIZE, &caps.max_texture_size, 1); DoGetIntegerv(GL_MAX_VARYING_VECTORS, &caps.max_varying_vectors, 1); DoGetIntegerv(GL_MAX_VERTEX_ATTRIBS, &caps.max_vertex_attribs, 1); DoGetIntegerv(GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS, &caps.max_vertex_texture_image_units, 1); DoGetIntegerv(GL_MAX_VERTEX_UNIFORM_VECTORS, &caps.max_vertex_uniform_vectors, 1); { GLint dims[2] = {0, 0}; DoGetIntegerv(GL_MAX_VIEWPORT_DIMS, dims, 2); caps.max_viewport_width = dims[0]; caps.max_viewport_height = dims[1]; } DoGetIntegerv(GL_NUM_COMPRESSED_TEXTURE_FORMATS, &caps.num_compressed_texture_formats, 1); DoGetIntegerv(GL_NUM_SHADER_BINARY_FORMATS, &caps.num_shader_binary_formats, 1); DoGetIntegerv(GL_BIND_GENERATES_RESOURCE_CHROMIUM, &caps.bind_generates_resource_chromium, 1); if (feature_info_->IsWebGL2OrES3Context()) { DoGetIntegerv(GL_MAX_3D_TEXTURE_SIZE, &caps.max_3d_texture_size, 1); DoGetIntegerv(GL_MAX_ARRAY_TEXTURE_LAYERS, &caps.max_array_texture_layers, 1); DoGetIntegerv(GL_MAX_COLOR_ATTACHMENTS, &caps.max_color_attachments, 1); DoGetInteger64v(GL_MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS, &caps.max_combined_fragment_uniform_components, 1); DoGetIntegerv(GL_MAX_COMBINED_UNIFORM_BLOCKS, &caps.max_combined_uniform_blocks, 1); DoGetInteger64v(GL_MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS, &caps.max_combined_vertex_uniform_components, 1); DoGetIntegerv(GL_MAX_DRAW_BUFFERS, &caps.max_draw_buffers, 1); DoGetInteger64v(GL_MAX_ELEMENT_INDEX, &caps.max_element_index, 1); DoGetIntegerv(GL_MAX_ELEMENTS_INDICES, &caps.max_elements_indices, 1); DoGetIntegerv(GL_MAX_ELEMENTS_VERTICES, &caps.max_elements_vertices, 1); DoGetIntegerv(GL_MAX_FRAGMENT_INPUT_COMPONENTS, &caps.max_fragment_input_components, 1); DoGetIntegerv(GL_MAX_FRAGMENT_UNIFORM_BLOCKS, &caps.max_fragment_uniform_blocks, 1); DoGetIntegerv(GL_MAX_FRAGMENT_UNIFORM_COMPONENTS, &caps.max_fragment_uniform_components, 1); DoGetIntegerv(GL_MAX_PROGRAM_TEXEL_OFFSET, &caps.max_program_texel_offset, 1); DoGetInteger64v(GL_MAX_SERVER_WAIT_TIMEOUT, &caps.max_server_wait_timeout, 1); if (caps.max_server_wait_timeout < 0) caps.max_server_wait_timeout = 0; DoGetFloatv(GL_MAX_TEXTURE_LOD_BIAS, &caps.max_texture_lod_bias, 1); DoGetIntegerv(GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS, &caps.max_transform_feedback_interleaved_components, 1); DoGetIntegerv(GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS, &caps.max_transform_feedback_separate_attribs, 1); DoGetIntegerv(GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS, &caps.max_transform_feedback_separate_components, 1); DoGetInteger64v(GL_MAX_UNIFORM_BLOCK_SIZE, &caps.max_uniform_block_size, 1); DoGetIntegerv(GL_MAX_UNIFORM_BUFFER_BINDINGS, &caps.max_uniform_buffer_bindings, 1); DoGetIntegerv(GL_MAX_VARYING_COMPONENTS, &caps.max_varying_components, 1); DoGetIntegerv(GL_MAX_VERTEX_OUTPUT_COMPONENTS, &caps.max_vertex_output_components, 1); DoGetIntegerv(GL_MAX_VERTEX_UNIFORM_BLOCKS, &caps.max_vertex_uniform_blocks, 1); DoGetIntegerv(GL_MAX_VERTEX_UNIFORM_COMPONENTS, &caps.max_vertex_uniform_components, 1); DoGetIntegerv(GL_MIN_PROGRAM_TEXEL_OFFSET, &caps.min_program_texel_offset, 1); DoGetIntegerv(GL_NUM_EXTENSIONS, &caps.num_extensions, 1); DoGetIntegerv(GL_NUM_PROGRAM_BINARY_FORMATS, &caps.num_program_binary_formats, 1); DoGetIntegerv(GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT, &caps.uniform_buffer_offset_alignment, 1); caps.major_version = 3; caps.minor_version = 0; } if (feature_info_->feature_flags().multisampled_render_to_texture || feature_info_->feature_flags().chromium_framebuffer_multisample || feature_info_->IsWebGL2OrES3Context()) { caps.max_samples = ComputeMaxSamples(); } caps.num_stencil_bits = num_stencil_bits_; caps.egl_image_external = feature_info_->feature_flags().oes_egl_image_external; caps.texture_format_astc = feature_info_->feature_flags().ext_texture_format_astc; caps.texture_format_atc = feature_info_->feature_flags().ext_texture_format_atc; caps.texture_format_bgra8888 = feature_info_->feature_flags().ext_texture_format_bgra8888; caps.texture_format_dxt1 = feature_info_->feature_flags().ext_texture_format_dxt1; caps.texture_format_dxt5 = feature_info_->feature_flags().ext_texture_format_dxt5; caps.texture_format_etc1 = feature_info_->feature_flags().oes_compressed_etc1_rgb8_texture; caps.texture_format_etc1_npot = caps.texture_format_etc1 && !workarounds().etc1_power_of_two_only; caps.disable_one_component_textures = mailbox_manager()->UsesSync() && workarounds().avoid_one_component_egl_images; caps.texture_rectangle = feature_info_->feature_flags().arb_texture_rectangle; caps.texture_usage = feature_info_->feature_flags().angle_texture_usage; caps.texture_storage = feature_info_->feature_flags().ext_texture_storage; caps.discard_framebuffer = feature_info_->feature_flags().ext_discard_framebuffer; caps.sync_query = feature_info_->feature_flags().chromium_sync_query; caps.chromium_image_rgb_emulation = ChromiumImageNeedsRGBEmulation(); #if defined(OS_MACOSX) caps.iosurface = true; #endif caps.use_gpu_fences_for_overlay_planes = surface_->SupportsPlaneGpuFences(); caps.post_sub_buffer = supports_post_sub_buffer_; caps.swap_buffers_with_bounds = supports_swap_buffers_with_bounds_; caps.commit_overlay_planes = supports_commit_overlay_planes_; caps.surfaceless = surfaceless_; bool is_offscreen = !!offscreen_target_frame_buffer_.get(); caps.flips_vertically = !is_offscreen && surface_->FlipsVertically(); caps.msaa_is_slow = workarounds().msaa_is_slow; caps.avoid_stencil_buffers = workarounds().avoid_stencil_buffers; caps.multisample_compatibility = feature_info_->feature_flags().ext_multisample_compatibility; caps.dc_layers = supports_dc_layers_; caps.use_dc_overlays_for_video = surface_->UseOverlaysForVideo(); caps.protected_video_swap_chain = surface_->SupportsProtectedVideo(); caps.blend_equation_advanced = feature_info_->feature_flags().blend_equation_advanced; caps.blend_equation_advanced_coherent = feature_info_->feature_flags().blend_equation_advanced_coherent; caps.texture_rg = feature_info_->feature_flags().ext_texture_rg; caps.texture_norm16 = feature_info_->feature_flags().ext_texture_norm16; caps.texture_half_float_linear = feature_info_->oes_texture_half_float_linear_available(); caps.color_buffer_half_float_rgba = feature_info_->ext_color_buffer_float_available() || feature_info_->ext_color_buffer_half_float_available(); caps.image_ycbcr_422 = feature_info_->feature_flags().chromium_image_ycbcr_422; caps.image_ycbcr_420v = feature_info_->feature_flags().chromium_image_ycbcr_420v; caps.image_ycbcr_420v_disabled_for_video_frames = group_->gpu_preferences() .disable_biplanar_gpu_memory_buffers_for_video_frames; caps.image_xr30 = feature_info_->feature_flags().chromium_image_xr30; caps.image_xb30 = feature_info_->feature_flags().chromium_image_xb30; caps.max_copy_texture_chromium_size = workarounds().max_copy_texture_chromium_size; caps.render_buffer_format_bgra8888 = feature_info_->feature_flags().ext_render_buffer_format_bgra8888; caps.occlusion_query = feature_info_->feature_flags().occlusion_query; caps.occlusion_query_boolean = feature_info_->feature_flags().occlusion_query_boolean; caps.timer_queries = query_manager_->GPUTimingAvailable(); caps.gpu_rasterization = group_->gpu_feature_info() .status_values[GPU_FEATURE_TYPE_GPU_RASTERIZATION] == kGpuFeatureStatusEnabled; if (workarounds().disable_non_empty_post_sub_buffers_for_onscreen_surfaces && !surface_->IsOffscreen()) { caps.disable_non_empty_post_sub_buffers = true; } if (workarounds().broken_egl_image_ref_counting && group_->gpu_preferences().enable_threaded_texture_mailboxes) { caps.disable_2d_canvas_copy_on_write = true; } caps.texture_npot = feature_info_->feature_flags().npot_ok; caps.texture_storage_image = feature_info_->feature_flags().chromium_texture_storage_image; caps.supports_oop_raster = false; caps.chromium_gpu_fence = feature_info_->feature_flags().chromium_gpu_fence; caps.unpremultiply_and_dither_copy = feature_info_->feature_flags().unpremultiply_and_dither_copy; caps.separate_stencil_ref_mask_writemask = feature_info_->feature_flags().separate_stencil_ref_mask_writemask; caps.chromium_nonblocking_readback = feature_info_->context_type() == CONTEXT_TYPE_WEBGL2; caps.num_surface_buffers = surface_->GetBufferCount(); caps.mesa_framebuffer_flip_y = feature_info_->feature_flags().mesa_framebuffer_flip_y; caps.gpu_memory_buffer_formats = feature_info_->feature_flags().gpu_memory_buffer_formats; caps.texture_target_exception_list = group_->gpu_preferences().texture_target_exception_list; return caps; }
Capabilities GLES2DecoderImpl::GetCapabilities() { DCHECK(initialized()); Capabilities caps; const gl::GLVersionInfo& version_info = gl_version_info(); caps.VisitPrecisions([&version_info]( GLenum shader, GLenum type, Capabilities::ShaderPrecision* shader_precision) { GLint range[2] = {0, 0}; GLint precision = 0; QueryShaderPrecisionFormat(version_info, shader, type, range, &precision); shader_precision->min_range = range[0]; shader_precision->max_range = range[1]; shader_precision->precision = precision; }); DoGetIntegerv(GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS, &caps.max_combined_texture_image_units, 1); DoGetIntegerv(GL_MAX_CUBE_MAP_TEXTURE_SIZE, &caps.max_cube_map_texture_size, 1); DoGetIntegerv(GL_MAX_FRAGMENT_UNIFORM_VECTORS, &caps.max_fragment_uniform_vectors, 1); DoGetIntegerv(GL_MAX_RENDERBUFFER_SIZE, &caps.max_renderbuffer_size, 1); DoGetIntegerv(GL_MAX_TEXTURE_IMAGE_UNITS, &caps.max_texture_image_units, 1); DoGetIntegerv(GL_MAX_TEXTURE_SIZE, &caps.max_texture_size, 1); DoGetIntegerv(GL_MAX_VARYING_VECTORS, &caps.max_varying_vectors, 1); DoGetIntegerv(GL_MAX_VERTEX_ATTRIBS, &caps.max_vertex_attribs, 1); DoGetIntegerv(GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS, &caps.max_vertex_texture_image_units, 1); DoGetIntegerv(GL_MAX_VERTEX_UNIFORM_VECTORS, &caps.max_vertex_uniform_vectors, 1); { GLint dims[2] = {0, 0}; DoGetIntegerv(GL_MAX_VIEWPORT_DIMS, dims, 2); caps.max_viewport_width = dims[0]; caps.max_viewport_height = dims[1]; } DoGetIntegerv(GL_NUM_COMPRESSED_TEXTURE_FORMATS, &caps.num_compressed_texture_formats, 1); DoGetIntegerv(GL_NUM_SHADER_BINARY_FORMATS, &caps.num_shader_binary_formats, 1); DoGetIntegerv(GL_BIND_GENERATES_RESOURCE_CHROMIUM, &caps.bind_generates_resource_chromium, 1); if (feature_info_->IsWebGL2OrES3Context()) { DoGetIntegerv(GL_MAX_3D_TEXTURE_SIZE, &caps.max_3d_texture_size, 1); DoGetIntegerv(GL_MAX_ARRAY_TEXTURE_LAYERS, &caps.max_array_texture_layers, 1); DoGetIntegerv(GL_MAX_COLOR_ATTACHMENTS, &caps.max_color_attachments, 1); DoGetInteger64v(GL_MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS, &caps.max_combined_fragment_uniform_components, 1); DoGetIntegerv(GL_MAX_COMBINED_UNIFORM_BLOCKS, &caps.max_combined_uniform_blocks, 1); DoGetInteger64v(GL_MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS, &caps.max_combined_vertex_uniform_components, 1); DoGetIntegerv(GL_MAX_DRAW_BUFFERS, &caps.max_draw_buffers, 1); DoGetInteger64v(GL_MAX_ELEMENT_INDEX, &caps.max_element_index, 1); DoGetIntegerv(GL_MAX_ELEMENTS_INDICES, &caps.max_elements_indices, 1); DoGetIntegerv(GL_MAX_ELEMENTS_VERTICES, &caps.max_elements_vertices, 1); DoGetIntegerv(GL_MAX_FRAGMENT_INPUT_COMPONENTS, &caps.max_fragment_input_components, 1); DoGetIntegerv(GL_MAX_FRAGMENT_UNIFORM_BLOCKS, &caps.max_fragment_uniform_blocks, 1); DoGetIntegerv(GL_MAX_FRAGMENT_UNIFORM_COMPONENTS, &caps.max_fragment_uniform_components, 1); DoGetIntegerv(GL_MAX_PROGRAM_TEXEL_OFFSET, &caps.max_program_texel_offset, 1); DoGetInteger64v(GL_MAX_SERVER_WAIT_TIMEOUT, &caps.max_server_wait_timeout, 1); if (caps.max_server_wait_timeout < 0) caps.max_server_wait_timeout = 0; DoGetFloatv(GL_MAX_TEXTURE_LOD_BIAS, &caps.max_texture_lod_bias, 1); DoGetIntegerv(GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS, &caps.max_transform_feedback_interleaved_components, 1); DoGetIntegerv(GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS, &caps.max_transform_feedback_separate_attribs, 1); DoGetIntegerv(GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS, &caps.max_transform_feedback_separate_components, 1); DoGetInteger64v(GL_MAX_UNIFORM_BLOCK_SIZE, &caps.max_uniform_block_size, 1); DoGetIntegerv(GL_MAX_UNIFORM_BUFFER_BINDINGS, &caps.max_uniform_buffer_bindings, 1); DoGetIntegerv(GL_MAX_VARYING_COMPONENTS, &caps.max_varying_components, 1); DoGetIntegerv(GL_MAX_VERTEX_OUTPUT_COMPONENTS, &caps.max_vertex_output_components, 1); DoGetIntegerv(GL_MAX_VERTEX_UNIFORM_BLOCKS, &caps.max_vertex_uniform_blocks, 1); DoGetIntegerv(GL_MAX_VERTEX_UNIFORM_COMPONENTS, &caps.max_vertex_uniform_components, 1); DoGetIntegerv(GL_MIN_PROGRAM_TEXEL_OFFSET, &caps.min_program_texel_offset, 1); DoGetIntegerv(GL_NUM_EXTENSIONS, &caps.num_extensions, 1); DoGetIntegerv(GL_NUM_PROGRAM_BINARY_FORMATS, &caps.num_program_binary_formats, 1); DoGetIntegerv(GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT, &caps.uniform_buffer_offset_alignment, 1); caps.major_version = 3; caps.minor_version = 0; } if (feature_info_->feature_flags().multisampled_render_to_texture || feature_info_->feature_flags().chromium_framebuffer_multisample || feature_info_->IsWebGL2OrES3Context()) { caps.max_samples = ComputeMaxSamples(); } caps.num_stencil_bits = num_stencil_bits_; caps.egl_image_external = feature_info_->feature_flags().oes_egl_image_external; caps.texture_format_astc = feature_info_->feature_flags().ext_texture_format_astc; caps.texture_format_atc = feature_info_->feature_flags().ext_texture_format_atc; caps.texture_format_bgra8888 = feature_info_->feature_flags().ext_texture_format_bgra8888; caps.texture_format_dxt1 = feature_info_->feature_flags().ext_texture_format_dxt1; caps.texture_format_dxt5 = feature_info_->feature_flags().ext_texture_format_dxt5; caps.texture_format_etc1 = feature_info_->feature_flags().oes_compressed_etc1_rgb8_texture; caps.texture_format_etc1_npot = caps.texture_format_etc1 && !workarounds().etc1_power_of_two_only; caps.disable_one_component_textures = mailbox_manager()->UsesSync() && workarounds().avoid_one_component_egl_images; caps.texture_rectangle = feature_info_->feature_flags().arb_texture_rectangle; caps.texture_usage = feature_info_->feature_flags().angle_texture_usage; caps.texture_storage = feature_info_->feature_flags().ext_texture_storage; caps.discard_framebuffer = feature_info_->feature_flags().ext_discard_framebuffer; caps.sync_query = feature_info_->feature_flags().chromium_sync_query; caps.chromium_image_rgb_emulation = ChromiumImageNeedsRGBEmulation(); #if defined(OS_MACOSX) caps.iosurface = true; #endif caps.use_gpu_fences_for_overlay_planes = surface_->SupportsPlaneGpuFences(); caps.post_sub_buffer = supports_post_sub_buffer_; caps.swap_buffers_with_bounds = supports_swap_buffers_with_bounds_; caps.commit_overlay_planes = supports_commit_overlay_planes_; caps.surfaceless = surfaceless_; bool is_offscreen = !!offscreen_target_frame_buffer_.get(); caps.flips_vertically = !is_offscreen && surface_->FlipsVertically(); caps.msaa_is_slow = workarounds().msaa_is_slow; caps.avoid_stencil_buffers = workarounds().avoid_stencil_buffers; caps.multisample_compatibility = feature_info_->feature_flags().ext_multisample_compatibility; caps.dc_layers = supports_dc_layers_; caps.use_dc_overlays_for_video = surface_->UseOverlaysForVideo(); caps.protected_video_swap_chain = surface_->SupportsProtectedVideo(); caps.blend_equation_advanced = feature_info_->feature_flags().blend_equation_advanced; caps.blend_equation_advanced_coherent = feature_info_->feature_flags().blend_equation_advanced_coherent; caps.texture_rg = feature_info_->feature_flags().ext_texture_rg; caps.texture_norm16 = feature_info_->feature_flags().ext_texture_norm16; caps.texture_half_float_linear = feature_info_->oes_texture_half_float_linear_available(); caps.color_buffer_half_float_rgba = feature_info_->ext_color_buffer_float_available() || feature_info_->ext_color_buffer_half_float_available(); caps.image_ycbcr_422 = feature_info_->feature_flags().chromium_image_ycbcr_422; caps.image_ycbcr_420v = feature_info_->feature_flags().chromium_image_ycbcr_420v; caps.image_ycbcr_420v_disabled_for_video_frames = group_->gpu_preferences() .disable_biplanar_gpu_memory_buffers_for_video_frames; caps.image_xr30 = feature_info_->feature_flags().chromium_image_xr30; caps.image_xb30 = feature_info_->feature_flags().chromium_image_xb30; caps.max_copy_texture_chromium_size = workarounds().max_copy_texture_chromium_size; caps.render_buffer_format_bgra8888 = feature_info_->feature_flags().ext_render_buffer_format_bgra8888; caps.occlusion_query = feature_info_->feature_flags().occlusion_query; caps.occlusion_query_boolean = feature_info_->feature_flags().occlusion_query_boolean; caps.timer_queries = query_manager_->GPUTimingAvailable(); caps.gpu_rasterization = group_->gpu_feature_info() .status_values[GPU_FEATURE_TYPE_GPU_RASTERIZATION] == kGpuFeatureStatusEnabled; if (workarounds().disable_non_empty_post_sub_buffers_for_onscreen_surfaces && !surface_->IsOffscreen()) { caps.disable_non_empty_post_sub_buffers = true; } if (workarounds().broken_egl_image_ref_counting && group_->gpu_preferences().enable_threaded_texture_mailboxes) { caps.disable_2d_canvas_copy_on_write = true; } caps.texture_npot = feature_info_->feature_flags().npot_ok; caps.texture_storage_image = feature_info_->feature_flags().chromium_texture_storage_image; caps.supports_oop_raster = false; caps.chromium_gpu_fence = feature_info_->feature_flags().chromium_gpu_fence; caps.unpremultiply_and_dither_copy = feature_info_->feature_flags().unpremultiply_and_dither_copy; caps.separate_stencil_ref_mask_writemask = feature_info_->feature_flags().separate_stencil_ref_mask_writemask; caps.chromium_nonblocking_readback = feature_info_->context_type() == CONTEXT_TYPE_WEBGL2; caps.num_surface_buffers = surface_->GetBufferCount(); caps.mesa_framebuffer_flip_y = feature_info_->feature_flags().mesa_framebuffer_flip_y; caps.gpu_memory_buffer_formats = feature_info_->feature_flags().gpu_memory_buffer_formats; caps.texture_target_exception_list = group_->gpu_preferences().texture_target_exception_list; return caps; }
C
Chrome
0
CVE-2018-6066
https://www.cvedetails.com/cve/CVE-2018-6066/
CWE-200
https://github.com/chromium/chromium/commit/fad67a5b73639d7211b24fd9bdb242e82039b765
fad67a5b73639d7211b24fd9bdb242e82039b765
Check CORS using PassesAccessControlCheck() with supplied SecurityOrigin Partial revert of https://chromium-review.googlesource.com/535694. Bug: 799477 Change-Id: I878bb9bcb83afaafe8601293db9aa644fc5929b3 Reviewed-on: https://chromium-review.googlesource.com/898427 Commit-Queue: Hiroshige Hayashizaki <hiroshige@chromium.org> Reviewed-by: Kouhei Ueno <kouhei@chromium.org> Reviewed-by: Yutaka Hirano <yhirano@chromium.org> Reviewed-by: Takeshi Yoshino <tyoshino@chromium.org> Cr-Commit-Position: refs/heads/master@{#535176}
void Resource::DidAddClient(ResourceClient* c) { if (scoped_refptr<SharedBuffer> data = Data()) { data->ForEachSegment([this, &c](const char* segment, size_t segment_size, size_t segment_offset) -> bool { c->DataReceived(this, segment, segment_size); return HasClient(c); }); } if (!HasClient(c)) return; if (IsLoaded()) { c->NotifyFinished(this); if (clients_.Contains(c)) { finished_clients_.insert(c); clients_.erase(c); } } }
void Resource::DidAddClient(ResourceClient* c) { if (scoped_refptr<SharedBuffer> data = Data()) { data->ForEachSegment([this, &c](const char* segment, size_t segment_size, size_t segment_offset) -> bool { c->DataReceived(this, segment, segment_size); return HasClient(c); }); } if (!HasClient(c)) return; if (IsLoaded()) { c->NotifyFinished(this); if (clients_.Contains(c)) { finished_clients_.insert(c); clients_.erase(c); } } }
C
Chrome
0
CVE-2012-0045
https://www.cvedetails.com/cve/CVE-2012-0045/
null
https://github.com/torvalds/linux/commit/c2226fc9e87ba3da060e47333657cd6616652b84
c2226fc9e87ba3da060e47333657cd6616652b84
KVM: x86: fix missing checks in syscall emulation On hosts without this patch, 32bit guests will crash (and 64bit guests may behave in a wrong way) for example by simply executing following nasm-demo-application: [bits 32] global _start SECTION .text _start: syscall (I tested it with winxp and linux - both always crashed) Disassembly of section .text: 00000000 <_start>: 0: 0f 05 syscall The reason seems a missing "invalid opcode"-trap (int6) for the syscall opcode "0f05", which is not available on Intel CPUs within non-longmodes, as also on some AMD CPUs within legacy-mode. (depending on CPU vendor, MSR_EFER and cpuid) Because previous mentioned OSs may not engage corresponding syscall target-registers (STAR, LSTAR, CSTAR), they remain NULL and (non trapping) syscalls are leading to multiple faults and finally crashs. Depending on the architecture (AMD or Intel) pretended by guests, various checks according to vendor's documentation are implemented to overcome the current issue and behave like the CPUs physical counterparts. [mtosatti: cleanup/beautify code] Signed-off-by: Stephan Baerwolf <stephan.baerwolf@tu-ilmenau.de> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
static int emulator_do_task_switch(struct x86_emulate_ctxt *ctxt, u16 tss_selector, int reason, bool has_error_code, u32 error_code) { struct x86_emulate_ops *ops = ctxt->ops; struct desc_struct curr_tss_desc, next_tss_desc; int ret; u16 old_tss_sel = get_segment_selector(ctxt, VCPU_SREG_TR); ulong old_tss_base = ops->get_cached_segment_base(ctxt, VCPU_SREG_TR); u32 desc_limit; /* FIXME: old_tss_base == ~0 ? */ ret = read_segment_descriptor(ctxt, tss_selector, &next_tss_desc); if (ret != X86EMUL_CONTINUE) return ret; ret = read_segment_descriptor(ctxt, old_tss_sel, &curr_tss_desc); if (ret != X86EMUL_CONTINUE) return ret; /* FIXME: check that next_tss_desc is tss */ if (reason != TASK_SWITCH_IRET) { if ((tss_selector & 3) > next_tss_desc.dpl || ops->cpl(ctxt) > next_tss_desc.dpl) return emulate_gp(ctxt, 0); } desc_limit = desc_limit_scaled(&next_tss_desc); if (!next_tss_desc.p || ((desc_limit < 0x67 && (next_tss_desc.type & 8)) || desc_limit < 0x2b)) { emulate_ts(ctxt, tss_selector & 0xfffc); return X86EMUL_PROPAGATE_FAULT; } if (reason == TASK_SWITCH_IRET || reason == TASK_SWITCH_JMP) { curr_tss_desc.type &= ~(1 << 1); /* clear busy flag */ write_segment_descriptor(ctxt, old_tss_sel, &curr_tss_desc); } if (reason == TASK_SWITCH_IRET) ctxt->eflags = ctxt->eflags & ~X86_EFLAGS_NT; /* set back link to prev task only if NT bit is set in eflags note that old_tss_sel is not used afetr this point */ if (reason != TASK_SWITCH_CALL && reason != TASK_SWITCH_GATE) old_tss_sel = 0xffff; if (next_tss_desc.type & 8) ret = task_switch_32(ctxt, tss_selector, old_tss_sel, old_tss_base, &next_tss_desc); else ret = task_switch_16(ctxt, tss_selector, old_tss_sel, old_tss_base, &next_tss_desc); if (ret != X86EMUL_CONTINUE) return ret; if (reason == TASK_SWITCH_CALL || reason == TASK_SWITCH_GATE) ctxt->eflags = ctxt->eflags | X86_EFLAGS_NT; if (reason != TASK_SWITCH_IRET) { next_tss_desc.type |= (1 << 1); /* set busy flag */ write_segment_descriptor(ctxt, tss_selector, &next_tss_desc); } ops->set_cr(ctxt, 0, ops->get_cr(ctxt, 0) | X86_CR0_TS); ops->set_segment(ctxt, tss_selector, &next_tss_desc, 0, VCPU_SREG_TR); if (has_error_code) { ctxt->op_bytes = ctxt->ad_bytes = (next_tss_desc.type & 8) ? 4 : 2; ctxt->lock_prefix = 0; ctxt->src.val = (unsigned long) error_code; ret = em_push(ctxt); } return ret; }
static int emulator_do_task_switch(struct x86_emulate_ctxt *ctxt, u16 tss_selector, int reason, bool has_error_code, u32 error_code) { struct x86_emulate_ops *ops = ctxt->ops; struct desc_struct curr_tss_desc, next_tss_desc; int ret; u16 old_tss_sel = get_segment_selector(ctxt, VCPU_SREG_TR); ulong old_tss_base = ops->get_cached_segment_base(ctxt, VCPU_SREG_TR); u32 desc_limit; /* FIXME: old_tss_base == ~0 ? */ ret = read_segment_descriptor(ctxt, tss_selector, &next_tss_desc); if (ret != X86EMUL_CONTINUE) return ret; ret = read_segment_descriptor(ctxt, old_tss_sel, &curr_tss_desc); if (ret != X86EMUL_CONTINUE) return ret; /* FIXME: check that next_tss_desc is tss */ if (reason != TASK_SWITCH_IRET) { if ((tss_selector & 3) > next_tss_desc.dpl || ops->cpl(ctxt) > next_tss_desc.dpl) return emulate_gp(ctxt, 0); } desc_limit = desc_limit_scaled(&next_tss_desc); if (!next_tss_desc.p || ((desc_limit < 0x67 && (next_tss_desc.type & 8)) || desc_limit < 0x2b)) { emulate_ts(ctxt, tss_selector & 0xfffc); return X86EMUL_PROPAGATE_FAULT; } if (reason == TASK_SWITCH_IRET || reason == TASK_SWITCH_JMP) { curr_tss_desc.type &= ~(1 << 1); /* clear busy flag */ write_segment_descriptor(ctxt, old_tss_sel, &curr_tss_desc); } if (reason == TASK_SWITCH_IRET) ctxt->eflags = ctxt->eflags & ~X86_EFLAGS_NT; /* set back link to prev task only if NT bit is set in eflags note that old_tss_sel is not used afetr this point */ if (reason != TASK_SWITCH_CALL && reason != TASK_SWITCH_GATE) old_tss_sel = 0xffff; if (next_tss_desc.type & 8) ret = task_switch_32(ctxt, tss_selector, old_tss_sel, old_tss_base, &next_tss_desc); else ret = task_switch_16(ctxt, tss_selector, old_tss_sel, old_tss_base, &next_tss_desc); if (ret != X86EMUL_CONTINUE) return ret; if (reason == TASK_SWITCH_CALL || reason == TASK_SWITCH_GATE) ctxt->eflags = ctxt->eflags | X86_EFLAGS_NT; if (reason != TASK_SWITCH_IRET) { next_tss_desc.type |= (1 << 1); /* set busy flag */ write_segment_descriptor(ctxt, tss_selector, &next_tss_desc); } ops->set_cr(ctxt, 0, ops->get_cr(ctxt, 0) | X86_CR0_TS); ops->set_segment(ctxt, tss_selector, &next_tss_desc, 0, VCPU_SREG_TR); if (has_error_code) { ctxt->op_bytes = ctxt->ad_bytes = (next_tss_desc.type & 8) ? 4 : 2; ctxt->lock_prefix = 0; ctxt->src.val = (unsigned long) error_code; ret = em_push(ctxt); } return ret; }
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 <dave@linux.vnet.ibm.com> Acked-by: Mel Gorman <mel@csn.ul.ie> Acked-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com> Reported-by: Christoph Lameter <cl@linux.com> Tested-by: Christoph Lameter <cl@linux.com> Cc: Andrea Arcangeli <aarcange@redhat.com> Cc: <stable@vger.kernel.org> [2.6.32+] Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
int hugetlb_overcommit_handler(struct ctl_table *table, int write, void __user *buffer, size_t *length, loff_t *ppos) { struct hstate *h = &default_hstate; unsigned long tmp; int ret; tmp = h->nr_overcommit_huge_pages; if (write && h->order >= MAX_ORDER) return -EINVAL; table->data = &tmp; table->maxlen = sizeof(unsigned long); ret = proc_doulongvec_minmax(table, write, buffer, length, ppos); if (ret) goto out; if (write) { spin_lock(&hugetlb_lock); h->nr_overcommit_huge_pages = tmp; spin_unlock(&hugetlb_lock); } out: return ret; }
int hugetlb_overcommit_handler(struct ctl_table *table, int write, void __user *buffer, size_t *length, loff_t *ppos) { struct hstate *h = &default_hstate; unsigned long tmp; int ret; tmp = h->nr_overcommit_huge_pages; if (write && h->order >= MAX_ORDER) return -EINVAL; table->data = &tmp; table->maxlen = sizeof(unsigned long); ret = proc_doulongvec_minmax(table, write, buffer, length, ppos); if (ret) goto out; if (write) { spin_lock(&hugetlb_lock); h->nr_overcommit_huge_pages = tmp; spin_unlock(&hugetlb_lock); } out: return ret; }
C
linux
0
CVE-2012-3552
https://www.cvedetails.com/cve/CVE-2012-3552/
CWE-362
https://github.com/torvalds/linux/commit/f6d8bd051c391c1c0458a30b2a7abcd939329259
f6d8bd051c391c1c0458a30b2a7abcd939329259
inet: add RCU protection to inet->opt We lack proper synchronization to manipulate inet->opt ip_options Problem is ip_make_skb() calls ip_setup_cork() and ip_setup_cork() possibly makes a copy of ipc->opt (struct ip_options), without any protection against another thread manipulating inet->opt. Another thread can change inet->opt pointer and free old one under us. Use RCU to protect inet->opt (changed to inet->inet_opt). Instead of handling atomic refcounts, just copy ip_options when necessary, to avoid cache line dirtying. We cant insert an rcu_head in struct ip_options since its included in skb->cb[], so this patch is large because I had to introduce a new ip_options_rcu structure. Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com> Cc: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: David S. Miller <davem@davemloft.net>
static int inet_sk_reselect_saddr(struct sock *sk) { struct inet_sock *inet = inet_sk(sk); __be32 old_saddr = inet->inet_saddr; __be32 daddr = inet->inet_daddr; struct flowi4 fl4; struct rtable *rt; __be32 new_saddr; struct ip_options_rcu *inet_opt; inet_opt = rcu_dereference_protected(inet->inet_opt, sock_owned_by_user(sk)); if (inet_opt && inet_opt->opt.srr) daddr = inet_opt->opt.faddr; /* Query new route. */ rt = ip_route_connect(&fl4, daddr, 0, RT_CONN_FLAGS(sk), sk->sk_bound_dev_if, sk->sk_protocol, inet->inet_sport, inet->inet_dport, sk, false); if (IS_ERR(rt)) return PTR_ERR(rt); sk_setup_caps(sk, &rt->dst); new_saddr = rt->rt_src; if (new_saddr == old_saddr) return 0; if (sysctl_ip_dynaddr > 1) { printk(KERN_INFO "%s(): shifting inet->saddr from %pI4 to %pI4\n", __func__, &old_saddr, &new_saddr); } inet->inet_saddr = inet->inet_rcv_saddr = new_saddr; /* * XXX The only one ugly spot where we need to * XXX really change the sockets identity after * XXX it has entered the hashes. -DaveM * * Besides that, it does not check for connection * uniqueness. Wait for troubles. */ __sk_prot_rehash(sk); return 0; }
static int inet_sk_reselect_saddr(struct sock *sk) { struct inet_sock *inet = inet_sk(sk); __be32 old_saddr = inet->inet_saddr; __be32 daddr = inet->inet_daddr; struct flowi4 fl4; struct rtable *rt; __be32 new_saddr; if (inet->opt && inet->opt->srr) daddr = inet->opt->faddr; /* Query new route. */ rt = ip_route_connect(&fl4, daddr, 0, RT_CONN_FLAGS(sk), sk->sk_bound_dev_if, sk->sk_protocol, inet->inet_sport, inet->inet_dport, sk, false); if (IS_ERR(rt)) return PTR_ERR(rt); sk_setup_caps(sk, &rt->dst); new_saddr = rt->rt_src; if (new_saddr == old_saddr) return 0; if (sysctl_ip_dynaddr > 1) { printk(KERN_INFO "%s(): shifting inet->saddr from %pI4 to %pI4\n", __func__, &old_saddr, &new_saddr); } inet->inet_saddr = inet->inet_rcv_saddr = new_saddr; /* * XXX The only one ugly spot where we need to * XXX really change the sockets identity after * XXX it has entered the hashes. -DaveM * * Besides that, it does not check for connection * uniqueness. Wait for troubles. */ __sk_prot_rehash(sk); return 0; }
C
linux
1
CVE-2016-1586
https://www.cvedetails.com/cve/CVE-2016-1586/
CWE-20
https://git.launchpad.net/oxide/commit/?id=29014da83e5fc358d6bff0f574e9ed45e61a35ac
29014da83e5fc358d6bff0f574e9ed45e61a35ac
null
QQmlComponent* OxideQQuickWebView::beforeUnloadDialog() const { Q_D(const OxideQQuickWebView); return d->before_unload_dialog_; }
QQmlComponent* OxideQQuickWebView::beforeUnloadDialog() const { Q_D(const OxideQQuickWebView); return d->before_unload_dialog_; }
CPP
launchpad
0
CVE-2016-2476
https://www.cvedetails.com/cve/CVE-2016-2476/
CWE-119
https://android.googlesource.com/platform/frameworks/av/+/295c883fe3105b19bcd0f9e07d54c6b589fc5bff
295c883fe3105b19bcd0f9e07d54c6b589fc5bff
DO NOT MERGE Verify OMX buffer sizes prior to access Bug: 27207275 Change-Id: I4412825d1ee233d993af0a67708bea54304ff62d
OMX_ERRORTYPE SoftAVC::setProfileParams() { IV_STATUS_T status; ive_ctl_set_profile_params_ip_t s_profile_params_ip; ive_ctl_set_profile_params_op_t s_profile_params_op; s_profile_params_ip.e_cmd = IVE_CMD_VIDEO_CTL; s_profile_params_ip.e_sub_cmd = IVE_CMD_CTL_SET_PROFILE_PARAMS; s_profile_params_ip.e_profile = DEFAULT_EPROFILE; s_profile_params_ip.u4_entropy_coding_mode = mEntropyMode; s_profile_params_ip.u4_timestamp_high = -1; s_profile_params_ip.u4_timestamp_low = -1; s_profile_params_ip.u4_size = sizeof(ive_ctl_set_profile_params_ip_t); s_profile_params_op.u4_size = sizeof(ive_ctl_set_profile_params_op_t); status = ive_api_function(mCodecCtx, &s_profile_params_ip, &s_profile_params_op); if (status != IV_SUCCESS) { ALOGE("Unable to set profile params = 0x%x\n", s_profile_params_op.u4_error_code); return OMX_ErrorUndefined; } return OMX_ErrorNone; }
OMX_ERRORTYPE SoftAVC::setProfileParams() { IV_STATUS_T status; ive_ctl_set_profile_params_ip_t s_profile_params_ip; ive_ctl_set_profile_params_op_t s_profile_params_op; s_profile_params_ip.e_cmd = IVE_CMD_VIDEO_CTL; s_profile_params_ip.e_sub_cmd = IVE_CMD_CTL_SET_PROFILE_PARAMS; s_profile_params_ip.e_profile = DEFAULT_EPROFILE; s_profile_params_ip.u4_entropy_coding_mode = mEntropyMode; s_profile_params_ip.u4_timestamp_high = -1; s_profile_params_ip.u4_timestamp_low = -1; s_profile_params_ip.u4_size = sizeof(ive_ctl_set_profile_params_ip_t); s_profile_params_op.u4_size = sizeof(ive_ctl_set_profile_params_op_t); status = ive_api_function(mCodecCtx, &s_profile_params_ip, &s_profile_params_op); if (status != IV_SUCCESS) { ALOGE("Unable to set profile params = 0x%x\n", s_profile_params_op.u4_error_code); return OMX_ErrorUndefined; } return OMX_ErrorNone; }
C
Android
0
CVE-2011-2918
https://www.cvedetails.com/cve/CVE-2011-2918/
CWE-399
https://github.com/torvalds/linux/commit/a8b0ca17b80e92faab46ee7179ba9e99ccb61233
a8b0ca17b80e92faab46ee7179ba9e99ccb61233
perf: Remove the nmi parameter from the swevent and overflow interface The nmi parameter indicated if we could do wakeups from the current context, if not, we would set some state and self-IPI and let the resulting interrupt do the wakeup. For the various event classes: - hardware: nmi=0; PMI is in fact an NMI or we run irq_work_run from the PMI-tail (ARM etc.) - tracepoint: nmi=0; since tracepoint could be from NMI context. - software: nmi=[0,1]; some, like the schedule thing cannot perform wakeups, and hence need 0. As one can see, there is very little nmi=1 usage, and the down-side of not using it is that on some platforms some software events can have a jiffy delay in wakeup (when arch_irq_work_raise isn't implemented). The up-side however is that we can remove the nmi parameter and save a bunch of conditionals in fast paths. Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Michael Cree <mcree@orcon.net.nz> Cc: Will Deacon <will.deacon@arm.com> Cc: Deng-Cheng Zhu <dengcheng.zhu@gmail.com> Cc: Anton Blanchard <anton@samba.org> Cc: Eric B Munson <emunson@mgebm.net> Cc: Heiko Carstens <heiko.carstens@de.ibm.com> Cc: Paul Mundt <lethal@linux-sh.org> Cc: David S. Miller <davem@davemloft.net> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Jason Wessel <jason.wessel@windriver.com> Cc: Don Zickus <dzickus@redhat.com> Link: http://lkml.kernel.org/n/tip-agjev8eu666tvknpb3iaj0fg@git.kernel.org Signed-off-by: Ingo Molnar <mingo@elte.hu>
static int set_segment_reg(struct task_struct *task, unsigned long offset, u16 value) { /* * The value argument was already truncated to 16 bits. */ if (invalid_selector(value)) return -EIO; switch (offset) { case offsetof(struct user_regs_struct,fs): /* * If this is setting fs as for normal 64-bit use but * setting fs_base has implicitly changed it, leave it. */ if ((value == FS_TLS_SEL && task->thread.fsindex == 0 && task->thread.fs != 0) || (value == 0 && task->thread.fsindex == FS_TLS_SEL && task->thread.fs == 0)) break; task->thread.fsindex = value; if (task == current) loadsegment(fs, task->thread.fsindex); break; case offsetof(struct user_regs_struct,gs): /* * If this is setting gs as for normal 64-bit use but * setting gs_base has implicitly changed it, leave it. */ if ((value == GS_TLS_SEL && task->thread.gsindex == 0 && task->thread.gs != 0) || (value == 0 && task->thread.gsindex == GS_TLS_SEL && task->thread.gs == 0)) break; task->thread.gsindex = value; if (task == current) load_gs_index(task->thread.gsindex); break; case offsetof(struct user_regs_struct,ds): task->thread.ds = value; if (task == current) loadsegment(ds, task->thread.ds); break; case offsetof(struct user_regs_struct,es): task->thread.es = value; if (task == current) loadsegment(es, task->thread.es); break; /* * Can't actually change these in 64-bit mode. */ case offsetof(struct user_regs_struct,cs): if (unlikely(value == 0)) return -EIO; #ifdef CONFIG_IA32_EMULATION if (test_tsk_thread_flag(task, TIF_IA32)) task_pt_regs(task)->cs = value; #endif break; case offsetof(struct user_regs_struct,ss): if (unlikely(value == 0)) return -EIO; #ifdef CONFIG_IA32_EMULATION if (test_tsk_thread_flag(task, TIF_IA32)) task_pt_regs(task)->ss = value; #endif break; } return 0; }
static int set_segment_reg(struct task_struct *task, unsigned long offset, u16 value) { /* * The value argument was already truncated to 16 bits. */ if (invalid_selector(value)) return -EIO; switch (offset) { case offsetof(struct user_regs_struct,fs): /* * If this is setting fs as for normal 64-bit use but * setting fs_base has implicitly changed it, leave it. */ if ((value == FS_TLS_SEL && task->thread.fsindex == 0 && task->thread.fs != 0) || (value == 0 && task->thread.fsindex == FS_TLS_SEL && task->thread.fs == 0)) break; task->thread.fsindex = value; if (task == current) loadsegment(fs, task->thread.fsindex); break; case offsetof(struct user_regs_struct,gs): /* * If this is setting gs as for normal 64-bit use but * setting gs_base has implicitly changed it, leave it. */ if ((value == GS_TLS_SEL && task->thread.gsindex == 0 && task->thread.gs != 0) || (value == 0 && task->thread.gsindex == GS_TLS_SEL && task->thread.gs == 0)) break; task->thread.gsindex = value; if (task == current) load_gs_index(task->thread.gsindex); break; case offsetof(struct user_regs_struct,ds): task->thread.ds = value; if (task == current) loadsegment(ds, task->thread.ds); break; case offsetof(struct user_regs_struct,es): task->thread.es = value; if (task == current) loadsegment(es, task->thread.es); break; /* * Can't actually change these in 64-bit mode. */ case offsetof(struct user_regs_struct,cs): if (unlikely(value == 0)) return -EIO; #ifdef CONFIG_IA32_EMULATION if (test_tsk_thread_flag(task, TIF_IA32)) task_pt_regs(task)->cs = value; #endif break; case offsetof(struct user_regs_struct,ss): if (unlikely(value == 0)) return -EIO; #ifdef CONFIG_IA32_EMULATION if (test_tsk_thread_flag(task, TIF_IA32)) task_pt_regs(task)->ss = value; #endif break; } return 0; }
C
linux
0
CVE-2013-7421
https://www.cvedetails.com/cve/CVE-2013-7421/
CWE-264
https://github.com/torvalds/linux/commit/5d26a105b5a73e5635eae0629b42fa0a90e07b7b
5d26a105b5a73e5635eae0629b42fa0a90e07b7b
crypto: prefix module autoloading with "crypto-" This prefixes all crypto module loading with "crypto-" so we never run the risk of exposing module auto-loading to userspace via a crypto API, as demonstrated by Mathias Krause: https://lkml.org/lkml/2013/3/4/70 Signed-off-by: Kees Cook <keescook@chromium.org> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
static void __exit fcrypt_mod_fini(void) { crypto_unregister_alg(&fcrypt_alg); }
static void __exit fcrypt_mod_fini(void) { crypto_unregister_alg(&fcrypt_alg); }
C
linux
0
CVE-2016-10066
https://www.cvedetails.com/cve/CVE-2016-10066/
CWE-119
https://github.com/ImageMagick/ImageMagick/commit/f6e9d0d9955e85bdd7540b251cd50d598dacc5e6
f6e9d0d9955e85bdd7540b251cd50d598dacc5e6
null
ModuleExport void UnregisterDJVUImage(void) { (void) UnregisterMagickInfo("DJVU"); }
ModuleExport void UnregisterDJVUImage(void) { (void) UnregisterMagickInfo("DJVU"); }
C
ImageMagick
0
CVE-2019-7395
https://www.cvedetails.com/cve/CVE-2019-7395/
CWE-399
https://github.com/ImageMagick/ImageMagick/commit/8a43abefb38c5e29138e1c9c515b313363541c06
8a43abefb38c5e29138e1c9c515b313363541c06
https://github.com/ImageMagick/ImageMagick/issues/1451
static inline void SetPSDPixel(Image *image,const size_t channels, const ssize_t type,const size_t packet_size,const Quantum pixel,Quantum *q, ExceptionInfo *exception) { if (image->storage_class == PseudoClass) { PixelInfo *color; if (type == 0) { if (packet_size == 1) SetPixelIndex(image,ScaleQuantumToChar(pixel),q); else SetPixelIndex(image,ScaleQuantumToShort(pixel),q); } color=image->colormap+(ssize_t) ConstrainColormapIndex(image, (ssize_t) GetPixelIndex(image,q),exception); if ((type == 0) && (channels > 1)) return; else color->alpha=(MagickRealType) pixel; SetPixelViaPixelInfo(image,color,q); return; } switch (type) { case -1: { SetPixelAlpha(image,pixel,q); break; } case -2: case 0: { SetPixelRed(image,pixel,q); break; } case -3: case 1: { SetPixelGreen(image,pixel,q); break; } case -4: case 2: { SetPixelBlue(image,pixel,q); break; } case 3: { if (image->colorspace == CMYKColorspace) SetPixelBlack(image,pixel,q); else if (image->alpha_trait != UndefinedPixelTrait) SetPixelAlpha(image,pixel,q); break; } case 4: { if ((IssRGBCompatibleColorspace(image->colorspace) != MagickFalse) && (channels > 3)) break; if (image->alpha_trait != UndefinedPixelTrait) SetPixelAlpha(image,pixel,q); break; } } }
static inline void SetPSDPixel(Image *image,const size_t channels, const ssize_t type,const size_t packet_size,const Quantum pixel,Quantum *q, ExceptionInfo *exception) { if (image->storage_class == PseudoClass) { PixelInfo *color; if (type == 0) { if (packet_size == 1) SetPixelIndex(image,ScaleQuantumToChar(pixel),q); else SetPixelIndex(image,ScaleQuantumToShort(pixel),q); } color=image->colormap+(ssize_t) ConstrainColormapIndex(image, (ssize_t) GetPixelIndex(image,q),exception); if ((type == 0) && (channels > 1)) return; else color->alpha=(MagickRealType) pixel; SetPixelViaPixelInfo(image,color,q); return; } switch (type) { case -1: { SetPixelAlpha(image,pixel,q); break; } case -2: case 0: { SetPixelRed(image,pixel,q); break; } case -3: case 1: { SetPixelGreen(image,pixel,q); break; } case -4: case 2: { SetPixelBlue(image,pixel,q); break; } case 3: { if (image->colorspace == CMYKColorspace) SetPixelBlack(image,pixel,q); else if (image->alpha_trait != UndefinedPixelTrait) SetPixelAlpha(image,pixel,q); break; } case 4: { if ((IssRGBCompatibleColorspace(image->colorspace) != MagickFalse) && (channels > 3)) break; if (image->alpha_trait != UndefinedPixelTrait) SetPixelAlpha(image,pixel,q); break; } } }
C
ImageMagick
0
CVE-2016-10065
https://www.cvedetails.com/cve/CVE-2016-10065/
CWE-284
https://github.com/ImageMagick/ImageMagick/commit/134463b926fa965571aa4febd61b810be5e7da05
134463b926fa965571aa4febd61b810be5e7da05
https://github.com/ImageMagick/ImageMagick/issues/129
static void ImportBGROQuantum(const Image *image,QuantumInfo *quantum_info, const MagickSizeType number_pixels,const unsigned char *magick_restrict p, Quantum *magick_restrict q,ExceptionInfo *exception) { QuantumAny range; register ssize_t x; unsigned int pixel; assert(image != (Image *) NULL); assert(image->signature == MagickCoreSignature); switch (quantum_info->depth) { case 8: { unsigned char pixel; for (x=0; x < (ssize_t) number_pixels; x++) { p=PushCharPixel(p,&pixel); SetPixelBlue(image,ScaleCharToQuantum(pixel),q); p=PushCharPixel(p,&pixel); SetPixelGreen(image,ScaleCharToQuantum(pixel),q); p=PushCharPixel(p,&pixel); SetPixelRed(image,ScaleCharToQuantum(pixel),q); p=PushCharPixel(p,&pixel); SetPixelOpacity(image,ScaleCharToQuantum(pixel),q); p+=quantum_info->pad; q+=GetPixelChannels(image); } break; } case 10: { pixel=0; if (quantum_info->pack == MagickFalse) { register ssize_t i; size_t quantum; ssize_t n; n=0; quantum=0; for (x=0; x < (ssize_t) number_pixels; x++) { for (i=0; i < 4; i++) { switch (n % 3) { case 0: { p=PushLongPixel(quantum_info->endian,p,&pixel); quantum=(size_t) (ScaleShortToQuantum((unsigned short) (((pixel >> 22) & 0x3ff) << 6))); break; } case 1: { quantum=(size_t) (ScaleShortToQuantum((unsigned short) (((pixel >> 12) & 0x3ff) << 6))); break; } case 2: { quantum=(size_t) (ScaleShortToQuantum((unsigned short) (((pixel >> 2) & 0x3ff) << 6))); break; } } switch (i) { case 0: SetPixelRed(image,(Quantum) quantum,q); break; case 1: SetPixelGreen(image,(Quantum) quantum,q); break; case 2: SetPixelBlue(image,(Quantum) quantum,q); break; case 3: SetPixelOpacity(image,(Quantum) quantum,q); break; } n++; } p+=quantum_info->pad; q+=GetPixelChannels(image); } break; } for (x=0; x < (ssize_t) number_pixels; x++) { p=PushQuantumPixel(quantum_info,p,&pixel); SetPixelRed(image,ScaleShortToQuantum((unsigned short) (pixel << 6)),q); p=PushQuantumPixel(quantum_info,p,&pixel); SetPixelGreen(image,ScaleShortToQuantum((unsigned short) (pixel << 6)), q); p=PushQuantumPixel(quantum_info,p,&pixel); SetPixelBlue(image,ScaleShortToQuantum((unsigned short) (pixel << 6)), q); p=PushQuantumPixel(quantum_info,p,&pixel); SetPixelOpacity(image,ScaleShortToQuantum((unsigned short) (pixel << 6)), q); q+=GetPixelChannels(image); } break; } case 16: { unsigned short pixel; if (quantum_info->format == FloatingPointQuantumFormat) { for (x=0; x < (ssize_t) number_pixels; x++) { p=PushShortPixel(quantum_info->endian,p,&pixel); SetPixelRed(image,ClampToQuantum(QuantumRange* HalfToSinglePrecision(pixel)),q); p=PushShortPixel(quantum_info->endian,p,&pixel); SetPixelGreen(image,ClampToQuantum(QuantumRange* HalfToSinglePrecision(pixel)),q); p=PushShortPixel(quantum_info->endian,p,&pixel); SetPixelBlue(image,ClampToQuantum(QuantumRange* HalfToSinglePrecision(pixel)),q); p=PushShortPixel(quantum_info->endian,p,&pixel); SetPixelOpacity(image,ClampToQuantum(QuantumRange* HalfToSinglePrecision(pixel)),q); p+=quantum_info->pad; q+=GetPixelChannels(image); } break; } for (x=0; x < (ssize_t) number_pixels; x++) { p=PushShortPixel(quantum_info->endian,p,&pixel); SetPixelBlue(image,ScaleShortToQuantum(pixel),q); p=PushShortPixel(quantum_info->endian,p,&pixel); SetPixelGreen(image,ScaleShortToQuantum(pixel),q); p=PushShortPixel(quantum_info->endian,p,&pixel); SetPixelRed(image,ScaleShortToQuantum(pixel),q); p=PushShortPixel(quantum_info->endian,p,&pixel); SetPixelOpacity(image,ScaleShortToQuantum(pixel),q); p+=quantum_info->pad; q+=GetPixelChannels(image); } break; } case 32: { unsigned int pixel; if (quantum_info->format == FloatingPointQuantumFormat) { float pixel; for (x=0; x < (ssize_t) number_pixels; x++) { p=PushFloatPixel(quantum_info,p,&pixel); SetPixelRed(image,ClampToQuantum(pixel),q); p=PushFloatPixel(quantum_info,p,&pixel); SetPixelGreen(image,ClampToQuantum(pixel),q); p=PushFloatPixel(quantum_info,p,&pixel); SetPixelBlue(image,ClampToQuantum(pixel),q); p=PushFloatPixel(quantum_info,p,&pixel); SetPixelOpacity(image,ClampToQuantum(pixel),q); p+=quantum_info->pad; q+=GetPixelChannels(image); } break; } for (x=0; x < (ssize_t) number_pixels; x++) { p=PushLongPixel(quantum_info->endian,p,&pixel); SetPixelBlue(image,ScaleLongToQuantum(pixel),q); p=PushLongPixel(quantum_info->endian,p,&pixel); SetPixelGreen(image,ScaleLongToQuantum(pixel),q); p=PushLongPixel(quantum_info->endian,p,&pixel); SetPixelRed(image,ScaleLongToQuantum(pixel),q); p=PushLongPixel(quantum_info->endian,p,&pixel); SetPixelOpacity(image,ScaleLongToQuantum(pixel),q); p+=quantum_info->pad; q+=GetPixelChannels(image); } break; } case 64: { if (quantum_info->format == FloatingPointQuantumFormat) { double pixel; for (x=0; x < (ssize_t) number_pixels; x++) { p=PushDoublePixel(quantum_info,p,&pixel); SetPixelRed(image,ClampToQuantum(pixel),q); p=PushDoublePixel(quantum_info,p,&pixel); SetPixelGreen(image,ClampToQuantum(pixel),q); p=PushDoublePixel(quantum_info,p,&pixel); SetPixelBlue(image,ClampToQuantum(pixel),q); p=PushDoublePixel(quantum_info,p,&pixel); SetPixelOpacity(image,ClampToQuantum(pixel),q); p+=quantum_info->pad; q+=GetPixelChannels(image); } break; } } default: { range=GetQuantumRange(quantum_info->depth); for (x=0; x < (ssize_t) number_pixels; x++) { p=PushQuantumPixel(quantum_info,p,&pixel); SetPixelBlue(image,ScaleAnyToQuantum(pixel,range),q); p=PushQuantumPixel(quantum_info,p,&pixel); SetPixelGreen(image,ScaleAnyToQuantum(pixel,range),q); p=PushQuantumPixel(quantum_info,p,&pixel); SetPixelRed(image,ScaleAnyToQuantum(pixel,range),q); p=PushQuantumPixel(quantum_info,p,&pixel); SetPixelOpacity(image,ScaleAnyToQuantum(pixel,range),q); q+=GetPixelChannels(image); } break; } } }
static void ImportBGROQuantum(const Image *image,QuantumInfo *quantum_info, const MagickSizeType number_pixels,const unsigned char *magick_restrict p, Quantum *magick_restrict q,ExceptionInfo *exception) { QuantumAny range; register ssize_t x; unsigned int pixel; assert(image != (Image *) NULL); assert(image->signature == MagickCoreSignature); switch (quantum_info->depth) { case 8: { unsigned char pixel; for (x=0; x < (ssize_t) number_pixels; x++) { p=PushCharPixel(p,&pixel); SetPixelBlue(image,ScaleCharToQuantum(pixel),q); p=PushCharPixel(p,&pixel); SetPixelGreen(image,ScaleCharToQuantum(pixel),q); p=PushCharPixel(p,&pixel); SetPixelRed(image,ScaleCharToQuantum(pixel),q); p=PushCharPixel(p,&pixel); SetPixelOpacity(image,ScaleCharToQuantum(pixel),q); p+=quantum_info->pad; q+=GetPixelChannels(image); } break; } case 10: { pixel=0; if (quantum_info->pack == MagickFalse) { register ssize_t i; size_t quantum; ssize_t n; n=0; quantum=0; for (x=0; x < (ssize_t) number_pixels; x++) { for (i=0; i < 4; i++) { switch (n % 3) { case 0: { p=PushLongPixel(quantum_info->endian,p,&pixel); quantum=(size_t) (ScaleShortToQuantum((unsigned short) (((pixel >> 22) & 0x3ff) << 6))); break; } case 1: { quantum=(size_t) (ScaleShortToQuantum((unsigned short) (((pixel >> 12) & 0x3ff) << 6))); break; } case 2: { quantum=(size_t) (ScaleShortToQuantum((unsigned short) (((pixel >> 2) & 0x3ff) << 6))); break; } } switch (i) { case 0: SetPixelRed(image,(Quantum) quantum,q); break; case 1: SetPixelGreen(image,(Quantum) quantum,q); break; case 2: SetPixelBlue(image,(Quantum) quantum,q); break; case 3: SetPixelOpacity(image,(Quantum) quantum,q); break; } n++; } p+=quantum_info->pad; q+=GetPixelChannels(image); } break; } for (x=0; x < (ssize_t) number_pixels; x++) { p=PushQuantumPixel(quantum_info,p,&pixel); SetPixelRed(image,ScaleShortToQuantum((unsigned short) (pixel << 6)),q); p=PushQuantumPixel(quantum_info,p,&pixel); SetPixelGreen(image,ScaleShortToQuantum((unsigned short) (pixel << 6)), q); p=PushQuantumPixel(quantum_info,p,&pixel); SetPixelBlue(image,ScaleShortToQuantum((unsigned short) (pixel << 6)), q); p=PushQuantumPixel(quantum_info,p,&pixel); SetPixelOpacity(image,ScaleShortToQuantum((unsigned short) (pixel << 6)), q); q+=GetPixelChannels(image); } break; } case 16: { unsigned short pixel; if (quantum_info->format == FloatingPointQuantumFormat) { for (x=0; x < (ssize_t) number_pixels; x++) { p=PushShortPixel(quantum_info->endian,p,&pixel); SetPixelRed(image,ClampToQuantum(QuantumRange* HalfToSinglePrecision(pixel)),q); p=PushShortPixel(quantum_info->endian,p,&pixel); SetPixelGreen(image,ClampToQuantum(QuantumRange* HalfToSinglePrecision(pixel)),q); p=PushShortPixel(quantum_info->endian,p,&pixel); SetPixelBlue(image,ClampToQuantum(QuantumRange* HalfToSinglePrecision(pixel)),q); p=PushShortPixel(quantum_info->endian,p,&pixel); SetPixelOpacity(image,ClampToQuantum(QuantumRange* HalfToSinglePrecision(pixel)),q); p+=quantum_info->pad; q+=GetPixelChannels(image); } break; } for (x=0; x < (ssize_t) number_pixels; x++) { p=PushShortPixel(quantum_info->endian,p,&pixel); SetPixelBlue(image,ScaleShortToQuantum(pixel),q); p=PushShortPixel(quantum_info->endian,p,&pixel); SetPixelGreen(image,ScaleShortToQuantum(pixel),q); p=PushShortPixel(quantum_info->endian,p,&pixel); SetPixelRed(image,ScaleShortToQuantum(pixel),q); p=PushShortPixel(quantum_info->endian,p,&pixel); SetPixelOpacity(image,ScaleShortToQuantum(pixel),q); p+=quantum_info->pad; q+=GetPixelChannels(image); } break; } case 32: { unsigned int pixel; if (quantum_info->format == FloatingPointQuantumFormat) { float pixel; for (x=0; x < (ssize_t) number_pixels; x++) { p=PushFloatPixel(quantum_info,p,&pixel); SetPixelRed(image,ClampToQuantum(pixel),q); p=PushFloatPixel(quantum_info,p,&pixel); SetPixelGreen(image,ClampToQuantum(pixel),q); p=PushFloatPixel(quantum_info,p,&pixel); SetPixelBlue(image,ClampToQuantum(pixel),q); p=PushFloatPixel(quantum_info,p,&pixel); SetPixelOpacity(image,ClampToQuantum(pixel),q); p+=quantum_info->pad; q+=GetPixelChannels(image); } break; } for (x=0; x < (ssize_t) number_pixels; x++) { p=PushLongPixel(quantum_info->endian,p,&pixel); SetPixelBlue(image,ScaleLongToQuantum(pixel),q); p=PushLongPixel(quantum_info->endian,p,&pixel); SetPixelGreen(image,ScaleLongToQuantum(pixel),q); p=PushLongPixel(quantum_info->endian,p,&pixel); SetPixelRed(image,ScaleLongToQuantum(pixel),q); p=PushLongPixel(quantum_info->endian,p,&pixel); SetPixelOpacity(image,ScaleLongToQuantum(pixel),q); p+=quantum_info->pad; q+=GetPixelChannels(image); } break; } case 64: { if (quantum_info->format == FloatingPointQuantumFormat) { double pixel; for (x=0; x < (ssize_t) number_pixels; x++) { p=PushDoublePixel(quantum_info,p,&pixel); SetPixelRed(image,ClampToQuantum(pixel),q); p=PushDoublePixel(quantum_info,p,&pixel); SetPixelGreen(image,ClampToQuantum(pixel),q); p=PushDoublePixel(quantum_info,p,&pixel); SetPixelBlue(image,ClampToQuantum(pixel),q); p=PushDoublePixel(quantum_info,p,&pixel); SetPixelOpacity(image,ClampToQuantum(pixel),q); p+=quantum_info->pad; q+=GetPixelChannels(image); } break; } } default: { range=GetQuantumRange(quantum_info->depth); for (x=0; x < (ssize_t) number_pixels; x++) { p=PushQuantumPixel(quantum_info,p,&pixel); SetPixelBlue(image,ScaleAnyToQuantum(pixel,range),q); p=PushQuantumPixel(quantum_info,p,&pixel); SetPixelGreen(image,ScaleAnyToQuantum(pixel,range),q); p=PushQuantumPixel(quantum_info,p,&pixel); SetPixelRed(image,ScaleAnyToQuantum(pixel,range),q); p=PushQuantumPixel(quantum_info,p,&pixel); SetPixelOpacity(image,ScaleAnyToQuantum(pixel,range),q); q+=GetPixelChannels(image); } break; } } }
C
ImageMagick
0
CVE-2013-2871
https://www.cvedetails.com/cve/CVE-2013-2871/
CWE-20
https://github.com/chromium/chromium/commit/bb9cfb0aba25f4b13e57bdd4a9fac80ba071e7b9
bb9cfb0aba25f4b13e57bdd4a9fac80ba071e7b9
Setting input.x-webkit-speech should not cause focus change In r150866, we introduced element()->focus() in destroyShadowSubtree() to retain focus on <input> when its type attribute gets changed. But when x-webkit-speech attribute is changed, the element is detached before calling destroyShadowSubtree() and element()->focus() failed This patch moves detach() after destroyShadowSubtree() to fix the problem. BUG=243818 TEST=fast/forms/input-type-change-focusout.html NOTRY=true Review URL: https://chromiumcodereview.appspot.com/16084005 git-svn-id: svn://svn.chromium.org/blink/trunk@151444 bbb929c8-8fbe-4397-9dbb-9b2b20218538
void HTMLInputElement::blur() { m_inputType->blur(); }
void HTMLInputElement::blur() { m_inputType->blur(); }
C
Chrome
0
CVE-2018-18345
https://www.cvedetails.com/cve/CVE-2018-18345/
null
https://github.com/chromium/chromium/commit/2078096efde1976b0fa9c820df90cedbfb2b13bc
2078096efde1976b0fa9c820df90cedbfb2b13bc
Lock down blob/filesystem URL creation with a stronger CPSP::CanCommitURL() ChildProcessSecurityPolicy::CanCommitURL() is a security check that's supposed to tell whether a given renderer process is allowed to commit a given URL. It is currently used to validate (1) blob and filesystem URL creation, and (2) Origin headers. Currently, it has scheme-based checks that disallow things like web renderers creating blob/filesystem URLs in chrome-extension: origins, but it cannot stop one web origin from creating those URLs for another origin. This CL locks down its use for (1) to also consult CanAccessDataForOrigin(). With site isolation, this will check origin locks and ensure that foo.com cannot create blob/filesystem URLs for other origins. For now, this CL does not provide the same enforcements for (2), Origin header validation, which has additional constraints that need to be solved first (see https://crbug.com/515309). Bug: 886976, 888001 Change-Id: I743ef05469e4000b2c0bee840022162600cc237f Reviewed-on: https://chromium-review.googlesource.com/1235343 Commit-Queue: Alex Moshchuk <alexmos@chromium.org> Reviewed-by: Charlie Reis <creis@chromium.org> Cr-Commit-Position: refs/heads/master@{#594914}
void ChildProcessSecurityPolicyImpl::AddIsolatedOrigins( std::vector<url::Origin> origins_to_add) { base::EraseIf(origins_to_add, [](const url::Origin& origin) { if (IsolatedOriginUtil::IsValidIsolatedOrigin(origin)) return false; // Don't remove. LOG(ERROR) << "Invalid isolated origin: " << origin; return true; // Remove. }); base::AutoLock lock(lock_); for (const url::Origin& origin : origins_to_add) { GURL key(SiteInstanceImpl::GetSiteForOrigin(origin)); isolated_origins_[key].insert(origin); } }
void ChildProcessSecurityPolicyImpl::AddIsolatedOrigins( std::vector<url::Origin> origins_to_add) { base::EraseIf(origins_to_add, [](const url::Origin& origin) { if (IsolatedOriginUtil::IsValidIsolatedOrigin(origin)) return false; // Don't remove. LOG(ERROR) << "Invalid isolated origin: " << origin; return true; // Remove. }); base::AutoLock lock(lock_); for (const url::Origin& origin : origins_to_add) { GURL key(SiteInstanceImpl::GetSiteForOrigin(origin)); isolated_origins_[key].insert(origin); } }
C
Chrome
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 <jmattson@google.com> Cc: stable@vger.kernel.org Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
static inline bool is_invalid_opcode(u32 intr_info) { return is_exception_n(intr_info, UD_VECTOR); }
static inline bool is_invalid_opcode(u32 intr_info) { return is_exception_n(intr_info, UD_VECTOR); }
C
linux
0
CVE-2018-6158
https://www.cvedetails.com/cve/CVE-2018-6158/
CWE-362
https://github.com/chromium/chromium/commit/20b65d00ca3d8696430e22efad7485366f8c3a21
20b65d00ca3d8696430e22efad7485366f8c3a21
[oilpan] Fix GCInfoTable for multiple threads Previously, grow and access from different threads could lead to a race on the table backing; see bug. - Rework the table to work on an existing reservation. - Commit upon growing, avoiding any copies. Drive-by: Fix over-allocation of table. Bug: chromium:841280 Change-Id: I329cb6f40091e14e8c05334ba1104a9440c31d43 Reviewed-on: https://chromium-review.googlesource.com/1061525 Commit-Queue: Michael Lippautz <mlippautz@chromium.org> Reviewed-by: Kentaro Hara <haraken@chromium.org> Cr-Commit-Position: refs/heads/master@{#560434}
virtual ~Mixin() {}
virtual ~Mixin() {}
C
Chrome
0
CVE-2012-3412
https://www.cvedetails.com/cve/CVE-2012-3412/
CWE-189
https://github.com/torvalds/linux/commit/68cb695ccecf949d48949e72f8ce591fdaaa325c
68cb695ccecf949d48949e72f8ce591fdaaa325c
sfc: Fix maximum number of TSO segments and minimum TX queue size [ Upstream commit 7e6d06f0de3f74ca929441add094518ae332257c ] Currently an skb requiring TSO may not fit within a minimum-size TX queue. The TX queue selected for the skb may stall and trigger the TX watchdog repeatedly (since the problem skb will be retried after the TX reset). This issue is designated as CVE-2012-3412. Set the maximum number of TSO segments for our devices to 100. This should make no difference to behaviour unless the actual MSS is less than about 700. Increase the minimum TX queue size accordingly to allow for 2 worst-case skbs, so that there will definitely be space to add an skb after we wake a queue. To avoid invalidating existing configurations, change efx_ethtool_set_ringparam() to fix up values that are too small rather than returning -EINVAL. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
static int efx_probe_interrupts(struct efx_nic *efx) { int max_channels = min_t(int, efx->type->phys_addr_channels, EFX_MAX_CHANNELS); int rc, i; if (efx->interrupt_mode == EFX_INT_MODE_MSIX) { struct msix_entry xentries[EFX_MAX_CHANNELS]; int n_channels; n_channels = efx_wanted_channels(); if (separate_tx_channels) n_channels *= 2; n_channels = min(n_channels, max_channels); for (i = 0; i < n_channels; i++) xentries[i].entry = i; rc = pci_enable_msix(efx->pci_dev, xentries, n_channels); if (rc > 0) { netif_err(efx, drv, efx->net_dev, "WARNING: Insufficient MSI-X vectors" " available (%d < %d).\n", rc, n_channels); netif_err(efx, drv, efx->net_dev, "WARNING: Performance may be reduced.\n"); EFX_BUG_ON_PARANOID(rc >= n_channels); n_channels = rc; rc = pci_enable_msix(efx->pci_dev, xentries, n_channels); } if (rc == 0) { efx->n_channels = n_channels; if (separate_tx_channels) { efx->n_tx_channels = max(efx->n_channels / 2, 1U); efx->n_rx_channels = max(efx->n_channels - efx->n_tx_channels, 1U); } else { efx->n_tx_channels = efx->n_channels; efx->n_rx_channels = efx->n_channels; } rc = efx_init_rx_cpu_rmap(efx, xentries); if (rc) { pci_disable_msix(efx->pci_dev); return rc; } for (i = 0; i < n_channels; i++) efx_get_channel(efx, i)->irq = xentries[i].vector; } else { /* Fall back to single channel MSI */ efx->interrupt_mode = EFX_INT_MODE_MSI; netif_err(efx, drv, efx->net_dev, "could not enable MSI-X\n"); } } /* Try single interrupt MSI */ if (efx->interrupt_mode == EFX_INT_MODE_MSI) { efx->n_channels = 1; efx->n_rx_channels = 1; efx->n_tx_channels = 1; rc = pci_enable_msi(efx->pci_dev); if (rc == 0) { efx_get_channel(efx, 0)->irq = efx->pci_dev->irq; } else { netif_err(efx, drv, efx->net_dev, "could not enable MSI\n"); efx->interrupt_mode = EFX_INT_MODE_LEGACY; } } /* Assume legacy interrupts */ if (efx->interrupt_mode == EFX_INT_MODE_LEGACY) { efx->n_channels = 1 + (separate_tx_channels ? 1 : 0); efx->n_rx_channels = 1; efx->n_tx_channels = 1; efx->legacy_irq = efx->pci_dev->irq; } return 0; }
static int efx_probe_interrupts(struct efx_nic *efx) { int max_channels = min_t(int, efx->type->phys_addr_channels, EFX_MAX_CHANNELS); int rc, i; if (efx->interrupt_mode == EFX_INT_MODE_MSIX) { struct msix_entry xentries[EFX_MAX_CHANNELS]; int n_channels; n_channels = efx_wanted_channels(); if (separate_tx_channels) n_channels *= 2; n_channels = min(n_channels, max_channels); for (i = 0; i < n_channels; i++) xentries[i].entry = i; rc = pci_enable_msix(efx->pci_dev, xentries, n_channels); if (rc > 0) { netif_err(efx, drv, efx->net_dev, "WARNING: Insufficient MSI-X vectors" " available (%d < %d).\n", rc, n_channels); netif_err(efx, drv, efx->net_dev, "WARNING: Performance may be reduced.\n"); EFX_BUG_ON_PARANOID(rc >= n_channels); n_channels = rc; rc = pci_enable_msix(efx->pci_dev, xentries, n_channels); } if (rc == 0) { efx->n_channels = n_channels; if (separate_tx_channels) { efx->n_tx_channels = max(efx->n_channels / 2, 1U); efx->n_rx_channels = max(efx->n_channels - efx->n_tx_channels, 1U); } else { efx->n_tx_channels = efx->n_channels; efx->n_rx_channels = efx->n_channels; } rc = efx_init_rx_cpu_rmap(efx, xentries); if (rc) { pci_disable_msix(efx->pci_dev); return rc; } for (i = 0; i < n_channels; i++) efx_get_channel(efx, i)->irq = xentries[i].vector; } else { /* Fall back to single channel MSI */ efx->interrupt_mode = EFX_INT_MODE_MSI; netif_err(efx, drv, efx->net_dev, "could not enable MSI-X\n"); } } /* Try single interrupt MSI */ if (efx->interrupt_mode == EFX_INT_MODE_MSI) { efx->n_channels = 1; efx->n_rx_channels = 1; efx->n_tx_channels = 1; rc = pci_enable_msi(efx->pci_dev); if (rc == 0) { efx_get_channel(efx, 0)->irq = efx->pci_dev->irq; } else { netif_err(efx, drv, efx->net_dev, "could not enable MSI\n"); efx->interrupt_mode = EFX_INT_MODE_LEGACY; } } /* Assume legacy interrupts */ if (efx->interrupt_mode == EFX_INT_MODE_LEGACY) { efx->n_channels = 1 + (separate_tx_channels ? 1 : 0); efx->n_rx_channels = 1; efx->n_tx_channels = 1; efx->legacy_irq = efx->pci_dev->irq; } return 0; }
C
linux
0
CVE-2011-2918
https://www.cvedetails.com/cve/CVE-2011-2918/
CWE-399
https://github.com/torvalds/linux/commit/a8b0ca17b80e92faab46ee7179ba9e99ccb61233
a8b0ca17b80e92faab46ee7179ba9e99ccb61233
perf: Remove the nmi parameter from the swevent and overflow interface The nmi parameter indicated if we could do wakeups from the current context, if not, we would set some state and self-IPI and let the resulting interrupt do the wakeup. For the various event classes: - hardware: nmi=0; PMI is in fact an NMI or we run irq_work_run from the PMI-tail (ARM etc.) - tracepoint: nmi=0; since tracepoint could be from NMI context. - software: nmi=[0,1]; some, like the schedule thing cannot perform wakeups, and hence need 0. As one can see, there is very little nmi=1 usage, and the down-side of not using it is that on some platforms some software events can have a jiffy delay in wakeup (when arch_irq_work_raise isn't implemented). The up-side however is that we can remove the nmi parameter and save a bunch of conditionals in fast paths. Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Michael Cree <mcree@orcon.net.nz> Cc: Will Deacon <will.deacon@arm.com> Cc: Deng-Cheng Zhu <dengcheng.zhu@gmail.com> Cc: Anton Blanchard <anton@samba.org> Cc: Eric B Munson <emunson@mgebm.net> Cc: Heiko Carstens <heiko.carstens@de.ibm.com> Cc: Paul Mundt <lethal@linux-sh.org> Cc: David S. Miller <davem@davemloft.net> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Jason Wessel <jason.wessel@windriver.com> Cc: Don Zickus <dzickus@redhat.com> Link: http://lkml.kernel.org/n/tip-agjev8eu666tvknpb3iaj0fg@git.kernel.org Signed-off-by: Ingo Molnar <mingo@elte.hu>
group_sched_out(struct perf_event *group_event, struct perf_cpu_context *cpuctx, struct perf_event_context *ctx) { struct perf_event *event; int state = group_event->state; event_sched_out(group_event, cpuctx, ctx); /* * Schedule out siblings (if any): */ list_for_each_entry(event, &group_event->sibling_list, group_entry) event_sched_out(event, cpuctx, ctx); if (state == PERF_EVENT_STATE_ACTIVE && group_event->attr.exclusive) cpuctx->exclusive = 0; }
group_sched_out(struct perf_event *group_event, struct perf_cpu_context *cpuctx, struct perf_event_context *ctx) { struct perf_event *event; int state = group_event->state; event_sched_out(group_event, cpuctx, ctx); /* * Schedule out siblings (if any): */ list_for_each_entry(event, &group_event->sibling_list, group_entry) event_sched_out(event, cpuctx, ctx); if (state == PERF_EVENT_STATE_ACTIVE && group_event->attr.exclusive) cpuctx->exclusive = 0; }
C
linux
0
null
null
null
https://github.com/chromium/chromium/commit/df831400bcb63db4259b5858281b1727ba972a2a
df831400bcb63db4259b5858281b1727ba972a2a
WebKit2: Support window bounce when panning. https://bugs.webkit.org/show_bug.cgi?id=58065 <rdar://problem/9244367> Reviewed by Adam Roben. Make gestureDidScroll synchronous, as once we scroll, we need to know whether or not we are at the beginning or end of the scrollable document. If we are at either end of the scrollable document, we call the Windows 7 API to bounce the window to give an indication that you are past an end of the document. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::gestureDidScroll): Pass a boolean for the reply, and return it. * UIProcess/WebPageProxy.h: * UIProcess/win/WebView.cpp: (WebKit::WebView::WebView): Inititalize a new variable. (WebKit::WebView::onGesture): Once we send the message to scroll, check if have gone to an end of the document, and if we have, bounce the window. * UIProcess/win/WebView.h: * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: GestureDidScroll is now sync. * WebProcess/WebPage/win/WebPageWin.cpp: (WebKit::WebPage::gestureDidScroll): When we are done scrolling, check if we have a vertical scrollbar and if we are at the beginning or the end of the scrollable document. git-svn-id: svn://svn.chromium.org/blink/trunk@83197 bbb929c8-8fbe-4397-9dbb-9b2b20218538
bool WebView::isViewWindowActive() { HWND activeWindow = ::GetActiveWindow(); return (activeWindow && m_topLevelParentWindow == findTopLevelParentWindow(activeWindow)); }
bool WebView::isViewWindowActive() { HWND activeWindow = ::GetActiveWindow(); return (activeWindow && m_topLevelParentWindow == findTopLevelParentWindow(activeWindow)); }
C
Chrome
0
CVE-2018-9511
https://www.cvedetails.com/cve/CVE-2018-9511/
CWE-909
https://android.googlesource.com/platform/system/netd/+/931418b16c7197ca2df34c2a5609e49791125abe
931418b16c7197ca2df34c2a5609e49791125abe
Set optlen for UDP-encap check in XfrmController When setting the socket owner for an encap socket XfrmController will first attempt to verify that the socket has the UDP-encap socket option set. When doing so it would pass in an uninitialized optlen parameter which could cause the call to not modify the option value if the optlen happened to be too short. So for example if the stack happened to contain a zero where optlen was located the check would fail and the socket owner would not be changed. Fix this by setting optlen to the size of the option value parameter. Test: run cts -m CtsNetTestCases BUG: 111650288 Change-Id: I57b6e9dba09c1acda71e3ec2084652e961667bd9 (cherry picked from commit fc42a105147310bd680952d4b71fe32974bd8506)
netdutils::Status XfrmController::ipSecAddSecurityAssociation( int32_t transformId, int32_t mode, const std::string& sourceAddress, const std::string& destinationAddress, int32_t underlyingNetId, int32_t spi, int32_t markValue, int32_t markMask, const std::string& authAlgo, const std::vector<uint8_t>& authKey, int32_t authTruncBits, const std::string& cryptAlgo, const std::vector<uint8_t>& cryptKey, int32_t cryptTruncBits, const std::string& aeadAlgo, const std::vector<uint8_t>& aeadKey, int32_t aeadIcvBits, int32_t encapType, int32_t encapLocalPort, int32_t encapRemotePort) { ALOGD("XfrmController::%s, line=%d", __FUNCTION__, __LINE__); ALOGD("transformId=%d", transformId); ALOGD("mode=%d", mode); ALOGD("sourceAddress=%s", sourceAddress.c_str()); ALOGD("destinationAddress=%s", destinationAddress.c_str()); ALOGD("underlyingNetworkId=%d", underlyingNetId); ALOGD("spi=%0.8x", spi); ALOGD("markValue=%x", markValue); ALOGD("markMask=%x", markMask); ALOGD("authAlgo=%s", authAlgo.c_str()); ALOGD("authTruncBits=%d", authTruncBits); ALOGD("cryptAlgo=%s", cryptAlgo.c_str()); ALOGD("cryptTruncBits=%d,", cryptTruncBits); ALOGD("aeadAlgo=%s", aeadAlgo.c_str()); ALOGD("aeadIcvBits=%d,", aeadIcvBits); ALOGD("encapType=%d", encapType); ALOGD("encapLocalPort=%d", encapLocalPort); ALOGD("encapRemotePort=%d", encapRemotePort); XfrmSaInfo saInfo{}; netdutils::Status ret = fillXfrmId(sourceAddress, destinationAddress, spi, markValue, markMask, transformId, &saInfo); if (!isOk(ret)) { return ret; } saInfo.auth = XfrmAlgo{ .name = authAlgo, .key = authKey, .truncLenBits = static_cast<uint16_t>(authTruncBits)}; saInfo.crypt = XfrmAlgo{ .name = cryptAlgo, .key = cryptKey, .truncLenBits = static_cast<uint16_t>(cryptTruncBits)}; saInfo.aead = XfrmAlgo{ .name = aeadAlgo, .key = aeadKey, .truncLenBits = static_cast<uint16_t>(aeadIcvBits)}; switch (static_cast<XfrmMode>(mode)) { case XfrmMode::TRANSPORT: case XfrmMode::TUNNEL: saInfo.mode = static_cast<XfrmMode>(mode); break; default: return netdutils::statusFromErrno(EINVAL, "Invalid xfrm mode"); } XfrmSocketImpl sock; netdutils::Status socketStatus = sock.open(); if (!isOk(socketStatus)) { ALOGD("Sock open failed for XFRM, line=%d", __LINE__); return socketStatus; } switch (static_cast<XfrmEncapType>(encapType)) { case XfrmEncapType::ESPINUDP: case XfrmEncapType::ESPINUDP_NON_IKE: if (saInfo.addrFamily != AF_INET) { return netdutils::statusFromErrno(EAFNOSUPPORT, "IPv6 encap not supported"); } saInfo.encap.srcPort = encapLocalPort; saInfo.encap.dstPort = encapRemotePort; case XfrmEncapType::NONE: saInfo.encap.type = static_cast<XfrmEncapType>(encapType); break; default: return netdutils::statusFromErrno(EINVAL, "Invalid encap type"); } saInfo.netId = underlyingNetId; ret = updateSecurityAssociation(saInfo, sock); if (!isOk(ret)) { ALOGD("Failed updating a Security Association, line=%d", __LINE__); } return ret; }
netdutils::Status XfrmController::ipSecAddSecurityAssociation( int32_t transformId, int32_t mode, const std::string& sourceAddress, const std::string& destinationAddress, int32_t underlyingNetId, int32_t spi, int32_t markValue, int32_t markMask, const std::string& authAlgo, const std::vector<uint8_t>& authKey, int32_t authTruncBits, const std::string& cryptAlgo, const std::vector<uint8_t>& cryptKey, int32_t cryptTruncBits, const std::string& aeadAlgo, const std::vector<uint8_t>& aeadKey, int32_t aeadIcvBits, int32_t encapType, int32_t encapLocalPort, int32_t encapRemotePort) { ALOGD("XfrmController::%s, line=%d", __FUNCTION__, __LINE__); ALOGD("transformId=%d", transformId); ALOGD("mode=%d", mode); ALOGD("sourceAddress=%s", sourceAddress.c_str()); ALOGD("destinationAddress=%s", destinationAddress.c_str()); ALOGD("underlyingNetworkId=%d", underlyingNetId); ALOGD("spi=%0.8x", spi); ALOGD("markValue=%x", markValue); ALOGD("markMask=%x", markMask); ALOGD("authAlgo=%s", authAlgo.c_str()); ALOGD("authTruncBits=%d", authTruncBits); ALOGD("cryptAlgo=%s", cryptAlgo.c_str()); ALOGD("cryptTruncBits=%d,", cryptTruncBits); ALOGD("aeadAlgo=%s", aeadAlgo.c_str()); ALOGD("aeadIcvBits=%d,", aeadIcvBits); ALOGD("encapType=%d", encapType); ALOGD("encapLocalPort=%d", encapLocalPort); ALOGD("encapRemotePort=%d", encapRemotePort); XfrmSaInfo saInfo{}; netdutils::Status ret = fillXfrmId(sourceAddress, destinationAddress, spi, markValue, markMask, transformId, &saInfo); if (!isOk(ret)) { return ret; } saInfo.auth = XfrmAlgo{ .name = authAlgo, .key = authKey, .truncLenBits = static_cast<uint16_t>(authTruncBits)}; saInfo.crypt = XfrmAlgo{ .name = cryptAlgo, .key = cryptKey, .truncLenBits = static_cast<uint16_t>(cryptTruncBits)}; saInfo.aead = XfrmAlgo{ .name = aeadAlgo, .key = aeadKey, .truncLenBits = static_cast<uint16_t>(aeadIcvBits)}; switch (static_cast<XfrmMode>(mode)) { case XfrmMode::TRANSPORT: case XfrmMode::TUNNEL: saInfo.mode = static_cast<XfrmMode>(mode); break; default: return netdutils::statusFromErrno(EINVAL, "Invalid xfrm mode"); } XfrmSocketImpl sock; netdutils::Status socketStatus = sock.open(); if (!isOk(socketStatus)) { ALOGD("Sock open failed for XFRM, line=%d", __LINE__); return socketStatus; } switch (static_cast<XfrmEncapType>(encapType)) { case XfrmEncapType::ESPINUDP: case XfrmEncapType::ESPINUDP_NON_IKE: if (saInfo.addrFamily != AF_INET) { return netdutils::statusFromErrno(EAFNOSUPPORT, "IPv6 encap not supported"); } saInfo.encap.srcPort = encapLocalPort; saInfo.encap.dstPort = encapRemotePort; case XfrmEncapType::NONE: saInfo.encap.type = static_cast<XfrmEncapType>(encapType); break; default: return netdutils::statusFromErrno(EINVAL, "Invalid encap type"); } saInfo.netId = underlyingNetId; ret = updateSecurityAssociation(saInfo, sock); if (!isOk(ret)) { ALOGD("Failed updating a Security Association, line=%d", __LINE__); } return ret; }
C
Android
0
CVE-2014-3191
https://www.cvedetails.com/cve/CVE-2014-3191/
CWE-416
https://github.com/chromium/chromium/commit/11a4cc4a6d6e665d9a118fada4b7c658d6f70d95
11a4cc4a6d6e665d9a118fada4b7c658d6f70d95
Defer call to updateWidgetPositions() outside of RenderLayerScrollableArea. updateWidgetPositions() can destroy the render tree, so it should never be called from inside RenderLayerScrollableArea. Leaving it there allows for the potential of use-after-free bugs. BUG=402407 R=vollick@chromium.org Review URL: https://codereview.chromium.org/490473003 git-svn-id: svn://svn.chromium.org/blink/trunk@180681 bbb929c8-8fbe-4397-9dbb-9b2b20218538
bool FrameView::isRubberBandInProgress() const { if (scrollbarsSuppressed()) return false; if (ScrollAnimator* scrollAnimator = existingScrollAnimator()) return scrollAnimator->isRubberBandInProgress(); return false; }
bool FrameView::isRubberBandInProgress() const { if (scrollbarsSuppressed()) return false; if (ScrollAnimator* scrollAnimator = existingScrollAnimator()) return scrollAnimator->isRubberBandInProgress(); return false; }
C
Chrome
0
CVE-2016-1583
https://www.cvedetails.com/cve/CVE-2016-1583/
CWE-119
https://github.com/torvalds/linux/commit/f5364c150aa645b3d7daa21b5c0b9feaa1c9cd6d
f5364c150aa645b3d7daa21b5c0b9feaa1c9cd6d
Merge branch 'stacking-fixes' (vfs stacking fixes from Jann) Merge filesystem stacking fixes from Jann Horn. * emailed patches from Jann Horn <jannh@google.com>: sched: panic on corrupted stack end ecryptfs: forbid opening files without mmap handler proc: prevent stacking filesystems on top
int __weak arch_update_cpu_topology(void) { return 0; }
int __weak arch_update_cpu_topology(void) { return 0; }
C
linux
0
null
null
null
https://github.com/chromium/chromium/commit/befb46ae3385fa13975521e9a2281e35805b339e
befb46ae3385fa13975521e9a2281e35805b339e
2009-10-23 Chris Evans <cevans@chromium.org> Reviewed by Adam Barth. Added test for bug 27239 (ignore Refresh for view source mode). https://bugs.webkit.org/show_bug.cgi?id=27239 * http/tests/security/view-source-no-refresh.html: Added * http/tests/security/view-source-no-refresh-expected.txt: Added * http/tests/security/resources/view-source-no-refresh.php: Added 2009-10-23 Chris Evans <cevans@chromium.org> Reviewed by Adam Barth. Ignore the Refresh header if we're in view source mode. https://bugs.webkit.org/show_bug.cgi?id=27239 Test: http/tests/security/view-source-no-refresh.html * loader/FrameLoader.cpp: ignore Refresh in view-source mode. git-svn-id: svn://svn.chromium.org/blink/trunk@50018 bbb929c8-8fbe-4397-9dbb-9b2b20218538
void FrameLoader::loadedResourceFromMemoryCache(const CachedResource* resource) { Page* page = m_frame->page(); if (!page) return; #if ENABLE(INSPECTOR) page->inspectorController()->didLoadResourceFromMemoryCache(m_documentLoader.get(), resource); #endif if (!resource->sendResourceLoadCallbacks() || m_documentLoader->haveToldClientAboutLoad(resource->url())) return; if (!page->areMemoryCacheClientCallsEnabled()) { m_documentLoader->recordMemoryCacheLoadForFutureClientNotification(resource->url()); m_documentLoader->didTellClientAboutLoad(resource->url()); return; } ResourceRequest request(resource->url()); if (m_client->dispatchDidLoadResourceFromMemoryCache(m_documentLoader.get(), request, resource->response(), resource->encodedSize())) { m_documentLoader->didTellClientAboutLoad(resource->url()); return; } unsigned long identifier; ResourceError error; requestFromDelegate(request, identifier, error); notifier()->sendRemainingDelegateMessages(m_documentLoader.get(), identifier, resource->response(), resource->encodedSize(), error); }
void FrameLoader::loadedResourceFromMemoryCache(const CachedResource* resource) { Page* page = m_frame->page(); if (!page) return; #if ENABLE(INSPECTOR) page->inspectorController()->didLoadResourceFromMemoryCache(m_documentLoader.get(), resource); #endif if (!resource->sendResourceLoadCallbacks() || m_documentLoader->haveToldClientAboutLoad(resource->url())) return; if (!page->areMemoryCacheClientCallsEnabled()) { m_documentLoader->recordMemoryCacheLoadForFutureClientNotification(resource->url()); m_documentLoader->didTellClientAboutLoad(resource->url()); return; } ResourceRequest request(resource->url()); if (m_client->dispatchDidLoadResourceFromMemoryCache(m_documentLoader.get(), request, resource->response(), resource->encodedSize())) { m_documentLoader->didTellClientAboutLoad(resource->url()); return; } unsigned long identifier; ResourceError error; requestFromDelegate(request, identifier, error); notifier()->sendRemainingDelegateMessages(m_documentLoader.get(), identifier, resource->response(), resource->encodedSize(), error); }
C
Chrome
0
CVE-2015-1335
https://www.cvedetails.com/cve/CVE-2015-1335/
CWE-59
https://github.com/lxc/lxc/commit/592fd47a6245508b79fe6ac819fe6d3b2c1289be
592fd47a6245508b79fe6ac819fe6d3b2c1289be
CVE-2015-1335: Protect container mounts against symlinks When a container starts up, lxc sets up the container's inital fstree by doing a bunch of mounting, guided by the container configuration file. The container config is owned by the admin or user on the host, so we do not try to guard against bad entries. However, since the mount target is in the container, it's possible that the container admin could divert the mount with symbolic links. This could bypass proper container startup (i.e. confinement of a root-owned container by the restrictive apparmor policy, by diverting the required write to /proc/self/attr/current), or bypass the (path-based) apparmor policy by diverting, say, /proc to /mnt in the container. To prevent this, 1. do not allow mounts to paths containing symbolic links 2. do not allow bind mounts from relative paths containing symbolic links. Details: Define safe_mount which ensures that the container has not inserted any symbolic links into any mount targets for mounts to be done during container setup. The host's mount path may contain symbolic links. As it is under the control of the administrator, that's ok. So safe_mount begins the check for symbolic links after the rootfs->mount, by opening that directory. It opens each directory along the path using openat() relative to the parent directory using O_NOFOLLOW. When the target is reached, it mounts onto /proc/self/fd/<targetfd>. Use safe_mount() in mount_entry(), when mounting container proc, and when needed. In particular, safe_mount() need not be used in any case where: 1. the mount is done in the container's namespace 2. the mount is for the container's rootfs 3. the mount is relative to a tmpfs or proc/sysfs which we have just safe_mount()ed ourselves Since we were using proc/net as a temporary placeholder for /proc/sys/net during container startup, and proc/net is a symbolic link, use proc/tty instead. Update the lxc.container.conf manpage with details about the new restrictions. Finally, add a testcase to test some symbolic link possibilities. Reported-by: Roman Fiedler Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com> Acked-by: Stéphane Graber <stgraber@ubuntu.com>
static bool verify_and_prune(const char *cgroup_use) { const char *p; char *e; int i, j; for (p = cgroup_use; p && *p; p = e + 1) { e = strchr(p, ','); if (e) *e = '\0'; if (!in_subsystem_list(p)) { ERROR("Controller %s required by lxc.cgroup.use but not available\n", p); return false; } if (e) *e = ','; if (!e) break; } for (i = 0; i < nr_subsystems;) { if (in_comma_list(subsystems[i], cgroup_use)) { i++; continue; } free(subsystems[i]); for (j = i; j < nr_subsystems-1; j++) subsystems[j] = subsystems[j+1]; subsystems[nr_subsystems-1] = NULL; nr_subsystems--; } return true; }
static bool verify_and_prune(const char *cgroup_use) { const char *p; char *e; int i, j; for (p = cgroup_use; p && *p; p = e + 1) { e = strchr(p, ','); if (e) *e = '\0'; if (!in_subsystem_list(p)) { ERROR("Controller %s required by lxc.cgroup.use but not available\n", p); return false; } if (e) *e = ','; if (!e) break; } for (i = 0; i < nr_subsystems;) { if (in_comma_list(subsystems[i], cgroup_use)) { i++; continue; } free(subsystems[i]); for (j = i; j < nr_subsystems-1; j++) subsystems[j] = subsystems[j+1]; subsystems[nr_subsystems-1] = NULL; nr_subsystems--; } return true; }
C
lxc
0
null
null
null
https://github.com/chromium/chromium/commit/a1f6ba4c1c488be710013f8548ff5513b32a7f3b
a1f6ba4c1c488be710013f8548ff5513b32a7f3b
Define DEBUG_GL_COMMANDS only in debug builds. https://bugs.webkit.org/show_bug.cgi?id=74083 Reviewed by Noam Rosenthal. No tests added as this change does not affect functionality. * platform/graphics/opengl/TextureMapperGL.cpp: git-svn-id: svn://svn.chromium.org/blink/trunk@102359 bbb929c8-8fbe-4397-9dbb-9b2b20218538
void BitmapTextureGL::setContentsToImage(Image* image) { ImageUID uid = image ? uidForImage(image) : 0; if (!image || !uid) { if (m_imageUID) destroy(); return; } if (uid == m_imageUID) return; bool found = false; GLuint newTextureID = m_textureMapper->data().directlyCompositedImages.findOrCreate(uid, found); if (newTextureID != m_id) { m_imageUID = uid; destroy(); m_id = newTextureID; reset(image->size(), false); if (!found) { GraphicsContext context(beginPaint(IntRect(0, 0, m_textureSize.width(), m_textureSize.height()))); context.drawImage(image, ColorSpaceDeviceRGB, IntPoint(0, 0), CompositeCopy); endPaint(); } } }
void BitmapTextureGL::setContentsToImage(Image* image) { ImageUID uid = image ? uidForImage(image) : 0; if (!image || !uid) { if (m_imageUID) destroy(); return; } if (uid == m_imageUID) return; bool found = false; GLuint newTextureID = m_textureMapper->data().directlyCompositedImages.findOrCreate(uid, found); if (newTextureID != m_id) { m_imageUID = uid; destroy(); m_id = newTextureID; reset(image->size(), false); if (!found) { GraphicsContext context(beginPaint(IntRect(0, 0, m_textureSize.width(), m_textureSize.height()))); context.drawImage(image, ColorSpaceDeviceRGB, IntPoint(0, 0), CompositeCopy); endPaint(); } } }
C
Chrome
0
CVE-2011-2789
https://www.cvedetails.com/cve/CVE-2011-2789/
CWE-399
https://github.com/chromium/chromium/commit/55ef04e135edaa9abfbf3647634b11ed57dc49e9
55ef04e135edaa9abfbf3647634b11ed57dc49e9
Maintain a map of all resources in the resource tracker and clear instance back pointers when needed, BUG=85808 Review URL: http://codereview.chromium.org/7196001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@89746 0039d316-1c4b-4281-b951-d872f2087c98
int32 ResourceTracker::AddVar(Var* var) { if (last_var_id_ == std::numeric_limits<int32>::max() >> kPPIdTypeBits) return 0; int32 new_id = MakeTypedId(++last_var_id_, PP_ID_TYPE_VAR); live_vars_.insert(std::make_pair(new_id, std::make_pair(var, 1))); ObjectVar* object_var = var->AsObjectVar(); if (object_var) { PP_Instance instance = object_var->instance()->pp_instance(); DCHECK(instance_map_.find(instance) != instance_map_.end()); instance_map_[instance]->object_vars.insert(new_id); } return new_id; }
int32 ResourceTracker::AddVar(Var* var) { if (last_var_id_ == std::numeric_limits<int32>::max() >> kPPIdTypeBits) return 0; int32 new_id = MakeTypedId(++last_var_id_, PP_ID_TYPE_VAR); live_vars_.insert(std::make_pair(new_id, std::make_pair(var, 1))); ObjectVar* object_var = var->AsObjectVar(); if (object_var) { PP_Instance instance = object_var->instance()->pp_instance(); DCHECK(instance_map_.find(instance) != instance_map_.end()); instance_map_[instance]->object_vars.insert(new_id); } return new_id; }
C
Chrome
0
CVE-2015-1593
https://www.cvedetails.com/cve/CVE-2015-1593/
CWE-264
https://github.com/torvalds/linux/commit/4e7c22d447bb6d7e37bfe39ff658486ae78e8d77
4e7c22d447bb6d7e37bfe39ff658486ae78e8d77
x86, mm/ASLR: Fix stack randomization on 64-bit systems The issue is that the stack for processes is not properly randomized on 64 bit architectures due to an integer overflow. The affected function is randomize_stack_top() in file "fs/binfmt_elf.c": static unsigned long randomize_stack_top(unsigned long stack_top) { unsigned int random_variable = 0; if ((current->flags & PF_RANDOMIZE) && !(current->personality & ADDR_NO_RANDOMIZE)) { random_variable = get_random_int() & STACK_RND_MASK; random_variable <<= PAGE_SHIFT; } return PAGE_ALIGN(stack_top) + random_variable; return PAGE_ALIGN(stack_top) - random_variable; } Note that, it declares the "random_variable" variable as "unsigned int". Since the result of the shifting operation between STACK_RND_MASK (which is 0x3fffff on x86_64, 22 bits) and PAGE_SHIFT (which is 12 on x86_64): random_variable <<= PAGE_SHIFT; then the two leftmost bits are dropped when storing the result in the "random_variable". This variable shall be at least 34 bits long to hold the (22+12) result. These two dropped bits have an impact on the entropy of process stack. Concretely, the total stack entropy is reduced by four: from 2^28 to 2^30 (One fourth of expected entropy). This patch restores back the entropy by correcting the types involved in the operations in the functions randomize_stack_top() and stack_maxrandom_size(). The successful fix can be tested with: $ for i in `seq 1 10`; do cat /proc/self/maps | grep stack; done 7ffeda566000-7ffeda587000 rw-p 00000000 00:00 0 [stack] 7fff5a332000-7fff5a353000 rw-p 00000000 00:00 0 [stack] 7ffcdb7a1000-7ffcdb7c2000 rw-p 00000000 00:00 0 [stack] 7ffd5e2c4000-7ffd5e2e5000 rw-p 00000000 00:00 0 [stack] ... Once corrected, the leading bytes should be between 7ffc and 7fff, rather than always being 7fff. Signed-off-by: Hector Marco-Gisbert <hecmargi@upv.es> Signed-off-by: Ismael Ripoll <iripoll@upv.es> [ Rebased, fixed 80 char bugs, cleaned up commit message, added test example and CVE ] Signed-off-by: Kees Cook <keescook@chromium.org> Cc: <stable@vger.kernel.org> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Andrew Morton <akpm@linux-foundation.org> Cc: Al Viro <viro@zeniv.linux.org.uk> Fixes: CVE-2015-1593 Link: http://lkml.kernel.org/r/20150214173350.GA18393@www.outflux.net Signed-off-by: Borislav Petkov <bp@suse.de>
static int load_elf_library(struct file *file) { struct elf_phdr *elf_phdata; struct elf_phdr *eppnt; unsigned long elf_bss, bss, len; int retval, error, i, j; struct elfhdr elf_ex; error = -ENOEXEC; retval = kernel_read(file, 0, (char *)&elf_ex, sizeof(elf_ex)); if (retval != sizeof(elf_ex)) goto out; if (memcmp(elf_ex.e_ident, ELFMAG, SELFMAG) != 0) goto out; /* First of all, some simple consistency checks */ if (elf_ex.e_type != ET_EXEC || elf_ex.e_phnum > 2 || !elf_check_arch(&elf_ex) || !file->f_op->mmap) goto out; /* Now read in all of the header information */ j = sizeof(struct elf_phdr) * elf_ex.e_phnum; /* j < ELF_MIN_ALIGN because elf_ex.e_phnum <= 2 */ error = -ENOMEM; elf_phdata = kmalloc(j, GFP_KERNEL); if (!elf_phdata) goto out; eppnt = elf_phdata; error = -ENOEXEC; retval = kernel_read(file, elf_ex.e_phoff, (char *)eppnt, j); if (retval != j) goto out_free_ph; for (j = 0, i = 0; i<elf_ex.e_phnum; i++) if ((eppnt + i)->p_type == PT_LOAD) j++; if (j != 1) goto out_free_ph; while (eppnt->p_type != PT_LOAD) eppnt++; /* Now use mmap to map the library into memory. */ error = vm_mmap(file, ELF_PAGESTART(eppnt->p_vaddr), (eppnt->p_filesz + ELF_PAGEOFFSET(eppnt->p_vaddr)), PROT_READ | PROT_WRITE | PROT_EXEC, MAP_FIXED | MAP_PRIVATE | MAP_DENYWRITE, (eppnt->p_offset - ELF_PAGEOFFSET(eppnt->p_vaddr))); if (error != ELF_PAGESTART(eppnt->p_vaddr)) goto out_free_ph; elf_bss = eppnt->p_vaddr + eppnt->p_filesz; if (padzero(elf_bss)) { error = -EFAULT; goto out_free_ph; } len = ELF_PAGESTART(eppnt->p_filesz + eppnt->p_vaddr + ELF_MIN_ALIGN - 1); bss = eppnt->p_memsz + eppnt->p_vaddr; if (bss > len) vm_brk(len, bss - len); error = 0; out_free_ph: kfree(elf_phdata); out: return error; }
static int load_elf_library(struct file *file) { struct elf_phdr *elf_phdata; struct elf_phdr *eppnt; unsigned long elf_bss, bss, len; int retval, error, i, j; struct elfhdr elf_ex; error = -ENOEXEC; retval = kernel_read(file, 0, (char *)&elf_ex, sizeof(elf_ex)); if (retval != sizeof(elf_ex)) goto out; if (memcmp(elf_ex.e_ident, ELFMAG, SELFMAG) != 0) goto out; /* First of all, some simple consistency checks */ if (elf_ex.e_type != ET_EXEC || elf_ex.e_phnum > 2 || !elf_check_arch(&elf_ex) || !file->f_op->mmap) goto out; /* Now read in all of the header information */ j = sizeof(struct elf_phdr) * elf_ex.e_phnum; /* j < ELF_MIN_ALIGN because elf_ex.e_phnum <= 2 */ error = -ENOMEM; elf_phdata = kmalloc(j, GFP_KERNEL); if (!elf_phdata) goto out; eppnt = elf_phdata; error = -ENOEXEC; retval = kernel_read(file, elf_ex.e_phoff, (char *)eppnt, j); if (retval != j) goto out_free_ph; for (j = 0, i = 0; i<elf_ex.e_phnum; i++) if ((eppnt + i)->p_type == PT_LOAD) j++; if (j != 1) goto out_free_ph; while (eppnt->p_type != PT_LOAD) eppnt++; /* Now use mmap to map the library into memory. */ error = vm_mmap(file, ELF_PAGESTART(eppnt->p_vaddr), (eppnt->p_filesz + ELF_PAGEOFFSET(eppnt->p_vaddr)), PROT_READ | PROT_WRITE | PROT_EXEC, MAP_FIXED | MAP_PRIVATE | MAP_DENYWRITE, (eppnt->p_offset - ELF_PAGEOFFSET(eppnt->p_vaddr))); if (error != ELF_PAGESTART(eppnt->p_vaddr)) goto out_free_ph; elf_bss = eppnt->p_vaddr + eppnt->p_filesz; if (padzero(elf_bss)) { error = -EFAULT; goto out_free_ph; } len = ELF_PAGESTART(eppnt->p_filesz + eppnt->p_vaddr + ELF_MIN_ALIGN - 1); bss = eppnt->p_memsz + eppnt->p_vaddr; if (bss > len) vm_brk(len, bss - len); error = 0; out_free_ph: kfree(elf_phdata); out: return error; }
C
linux
0
CVE-2014-3615
https://www.cvedetails.com/cve/CVE-2014-3615/
CWE-200
https://git.qemu.org/?p=qemu.git;a=commitdiff;h=c1b886c45dc70f247300f549dce9833f3fa2def5
c1b886c45dc70f247300f549dce9833f3fa2def5
null
uint32_t vga_ioport_read(void *opaque, uint32_t addr) { VGACommonState *s = opaque; int val, index; if (vga_ioport_invalid(s, addr)) { val = 0xff; } else { switch(addr) { case VGA_ATT_W: if (s->ar_flip_flop == 0) { val = s->ar_index; } else { val = 0; } break; case VGA_ATT_R: index = s->ar_index & 0x1f; if (index < VGA_ATT_C) { val = s->ar[index]; } else { val = 0; } break; case VGA_MIS_W: val = s->st00; break; case VGA_SEQ_I: val = s->sr_index; break; case VGA_SEQ_D: val = s->sr[s->sr_index]; #ifdef DEBUG_VGA_REG printf("vga: read SR%x = 0x%02x\n", s->sr_index, val); #endif break; case VGA_PEL_IR: val = s->dac_state; break; case VGA_PEL_IW: val = s->dac_write_index; break; case VGA_PEL_D: val = s->palette[s->dac_read_index * 3 + s->dac_sub_index]; if (++s->dac_sub_index == 3) { s->dac_sub_index = 0; s->dac_read_index++; } break; case VGA_FTC_R: val = s->fcr; break; case VGA_MIS_R: val = s->msr; break; case VGA_GFX_I: val = s->gr_index; break; case VGA_GFX_D: val = s->gr[s->gr_index]; #ifdef DEBUG_VGA_REG printf("vga: read GR%x = 0x%02x\n", s->gr_index, val); #endif break; case VGA_CRT_IM: case VGA_CRT_IC: val = s->cr_index; break; case VGA_CRT_DM: case VGA_CRT_DC: val = s->cr[s->cr_index]; #ifdef DEBUG_VGA_REG printf("vga: read CR%x = 0x%02x\n", s->cr_index, val); #endif break; case VGA_IS1_RM: case VGA_IS1_RC: /* just toggle to fool polling */ val = s->st01 = s->retrace(s); s->ar_flip_flop = 0; break; default: val = 0x00; break; } } #if defined(DEBUG_VGA) printf("VGA: read addr=0x%04x data=0x%02x\n", addr, val); #endif return val; }
uint32_t vga_ioport_read(void *opaque, uint32_t addr) { VGACommonState *s = opaque; int val, index; if (vga_ioport_invalid(s, addr)) { val = 0xff; } else { switch(addr) { case VGA_ATT_W: if (s->ar_flip_flop == 0) { val = s->ar_index; } else { val = 0; } break; case VGA_ATT_R: index = s->ar_index & 0x1f; if (index < VGA_ATT_C) { val = s->ar[index]; } else { val = 0; } break; case VGA_MIS_W: val = s->st00; break; case VGA_SEQ_I: val = s->sr_index; break; case VGA_SEQ_D: val = s->sr[s->sr_index]; #ifdef DEBUG_VGA_REG printf("vga: read SR%x = 0x%02x\n", s->sr_index, val); #endif break; case VGA_PEL_IR: val = s->dac_state; break; case VGA_PEL_IW: val = s->dac_write_index; break; case VGA_PEL_D: val = s->palette[s->dac_read_index * 3 + s->dac_sub_index]; if (++s->dac_sub_index == 3) { s->dac_sub_index = 0; s->dac_read_index++; } break; case VGA_FTC_R: val = s->fcr; break; case VGA_MIS_R: val = s->msr; break; case VGA_GFX_I: val = s->gr_index; break; case VGA_GFX_D: val = s->gr[s->gr_index]; #ifdef DEBUG_VGA_REG printf("vga: read GR%x = 0x%02x\n", s->gr_index, val); #endif break; case VGA_CRT_IM: case VGA_CRT_IC: val = s->cr_index; break; case VGA_CRT_DM: case VGA_CRT_DC: val = s->cr[s->cr_index]; #ifdef DEBUG_VGA_REG printf("vga: read CR%x = 0x%02x\n", s->cr_index, val); #endif break; case VGA_IS1_RM: case VGA_IS1_RC: /* just toggle to fool polling */ val = s->st01 = s->retrace(s); s->ar_flip_flop = 0; break; default: val = 0x00; break; } } #if defined(DEBUG_VGA) printf("VGA: read addr=0x%04x data=0x%02x\n", addr, val); #endif return val; }
C
qemu
0
CVE-2016-10517
https://www.cvedetails.com/cve/CVE-2016-10517/
CWE-254
https://github.com/antirez/redis/commit/874804da0c014a7d704b3d285aa500098a931f50
874804da0c014a7d704b3d285aa500098a931f50
Security: Cross Protocol Scripting protection. This is an attempt at mitigating problems due to cross protocol scripting, an attack targeting services using line oriented protocols like Redis that can accept HTTP requests as valid protocol, by discarding the invalid parts and accepting the payloads sent, for example, via a POST request. For this to be effective, when we detect POST and Host: and terminate the connection asynchronously, the networking code was modified in order to never process further input. It was later verified that in a pipelined request containing a POST command, the successive commands are not executed.
void closeListeningSockets(int unlink_unix_socket) { int j; for (j = 0; j < server.ipfd_count; j++) close(server.ipfd[j]); if (server.sofd != -1) close(server.sofd); if (server.cluster_enabled) for (j = 0; j < server.cfd_count; j++) close(server.cfd[j]); if (unlink_unix_socket && server.unixsocket) { serverLog(LL_NOTICE,"Removing the unix socket file."); unlink(server.unixsocket); /* don't care if this fails */ } }
void closeListeningSockets(int unlink_unix_socket) { int j; for (j = 0; j < server.ipfd_count; j++) close(server.ipfd[j]); if (server.sofd != -1) close(server.sofd); if (server.cluster_enabled) for (j = 0; j < server.cfd_count; j++) close(server.cfd[j]); if (unlink_unix_socket && server.unixsocket) { serverLog(LL_NOTICE,"Removing the unix socket file."); unlink(server.unixsocket); /* don't care if this fails */ } }
C
redis
0
CVE-2018-11469
https://www.cvedetails.com/cve/CVE-2018-11469/
CWE-200
https://git.haproxy.org/?p=haproxy-1.8.git;a=commit;h=17514045e5d934dede62116216c1b016fe23dd06
17514045e5d934dede62116216c1b016fe23dd06
null
enum act_return http_action_reject(struct act_rule *rule, struct proxy *px, struct session *sess, struct stream *s, int flags) { channel_abort(&s->req); channel_abort(&s->res); s->req.analysers = 0; s->res.analysers = 0; HA_ATOMIC_ADD(&s->be->be_counters.denied_req, 1); HA_ATOMIC_ADD(&sess->fe->fe_counters.denied_req, 1); if (sess->listener && sess->listener->counters) HA_ATOMIC_ADD(&sess->listener->counters->denied_req, 1); if (!(s->flags & SF_ERR_MASK)) s->flags |= SF_ERR_PRXCOND; if (!(s->flags & SF_FINST_MASK)) s->flags |= SF_FINST_R; return ACT_RET_CONT; }
enum act_return http_action_reject(struct act_rule *rule, struct proxy *px, struct session *sess, struct stream *s, int flags) { channel_abort(&s->req); channel_abort(&s->res); s->req.analysers = 0; s->res.analysers = 0; HA_ATOMIC_ADD(&s->be->be_counters.denied_req, 1); HA_ATOMIC_ADD(&sess->fe->fe_counters.denied_req, 1); if (sess->listener && sess->listener->counters) HA_ATOMIC_ADD(&sess->listener->counters->denied_req, 1); if (!(s->flags & SF_ERR_MASK)) s->flags |= SF_ERR_PRXCOND; if (!(s->flags & SF_FINST_MASK)) s->flags |= SF_FINST_R; return ACT_RET_CONT; }
C
haproxy
0
CVE-2017-5019
https://www.cvedetails.com/cve/CVE-2017-5019/
CWE-416
https://github.com/chromium/chromium/commit/f03ea5a5c2ff26e239dfd23e263b15da2d9cee93
f03ea5a5c2ff26e239dfd23e263b15da2d9cee93
Convert FrameHostMsg_DidAddMessageToConsole to Mojo. Note: Since this required changing the test RenderViewImplTest.DispatchBeforeUnloadCanDetachFrame, I manually re-introduced https://crbug.com/666714 locally (the bug the test was added for), and reran the test to confirm that it still covers the bug. Bug: 786836 Change-Id: I110668fa6f0f261fd2ac36bb91a8d8b31c99f4f1 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1526270 Commit-Queue: Lowell Manners <lowell@chromium.org> Reviewed-by: Daniel Cheng <dcheng@chromium.org> Reviewed-by: Camille Lamy <clamy@chromium.org> Cr-Commit-Position: refs/heads/master@{#653137}
void RenderFrameImpl::DidChangeName(const blink::WebString& name) { if (current_history_item_.IsNull()) { unique_name_helper_.UpdateName(name.Utf8()); } GetFrameHost()->DidChangeName(name.Utf8(), unique_name_helper_.value()); if (!committed_first_load_) name_changed_before_first_commit_ = true; }
void RenderFrameImpl::DidChangeName(const blink::WebString& name) { if (current_history_item_.IsNull()) { unique_name_helper_.UpdateName(name.Utf8()); } GetFrameHost()->DidChangeName(name.Utf8(), unique_name_helper_.value()); if (!committed_first_load_) name_changed_before_first_commit_ = true; }
C
Chrome
0
CVE-2017-15398
https://www.cvedetails.com/cve/CVE-2017-15398/
CWE-119
https://github.com/chromium/chromium/commit/7a6484fa7b7f86ea06749bfc9d10bb67b145140b
7a6484fa7b7f86ea06749bfc9d10bb67b145140b
Fix Stack Buffer Overflow in QuicClientPromisedInfo::OnPromiseHeaders BUG=777728 Cq-Include-Trybots: master.tryserver.chromium.android:android_cronet_tester;master.tryserver.chromium.mac:ios-simulator-cronet Change-Id: I6a80db88aafdf20c7abd3847404b818565681310 Reviewed-on: https://chromium-review.googlesource.com/748425 Reviewed-by: Zhongyi Shi <zhongyi@chromium.org> Commit-Queue: Ryan Hamilton <rch@chromium.org> Cr-Commit-Position: refs/heads/master@{#513105}
void QuicClientPromisedInfo::Reset(QuicRstStreamErrorCode error_code) { QuicClientPushPromiseIndex::Delegate* delegate = client_request_delegate_; session_->ResetPromised(id_, error_code); session_->DeletePromised(this); if (delegate) { delegate->OnRendezvousResult(nullptr); } }
void QuicClientPromisedInfo::Reset(QuicRstStreamErrorCode error_code) { QuicClientPushPromiseIndex::Delegate* delegate = client_request_delegate_; session_->ResetPromised(id_, error_code); session_->DeletePromised(this); if (delegate) { delegate->OnRendezvousResult(nullptr); } }
C
Chrome
0
null
null
null
https://github.com/chromium/chromium/commit/a1ce1b69e269a7e61ea0bf0691b90be0cbe9b4c5
a1ce1b69e269a7e61ea0bf0691b90be0cbe9b4c5
2009-05-04 Kai Brüning <kai@granus.net> Reviewed by Eric Seidel. https://bugs.webkit.org/show_bug.cgi?id=24883 24883: Bad success test in parseXMLDocumentFragment in XMLTokenizerLibxml2.cpp Fixed test whether all the chunk has been processed to correctly count utf8 bytes. Test: fast/innerHTML/innerHTML-nbsp.xhtml * dom/XMLTokenizerLibxml2.cpp: (WebCore::parseXMLDocumentFragment): git-svn-id: svn://svn.chromium.org/blink/trunk@43195 bbb929c8-8fbe-4397-9dbb-9b2b20218538
void XMLTokenizer::startDocument(const xmlChar* version, const xmlChar* encoding, int standalone) { ExceptionCode ec = 0; if (version) m_doc->setXMLVersion(toString(version), ec); m_doc->setXMLStandalone(standalone == 1, ec); // possible values are 0, 1, and -1 if (encoding) m_doc->setXMLEncoding(toString(encoding)); }
void XMLTokenizer::startDocument(const xmlChar* version, const xmlChar* encoding, int standalone) { ExceptionCode ec = 0; if (version) m_doc->setXMLVersion(toString(version), ec); m_doc->setXMLStandalone(standalone == 1, ec); // possible values are 0, 1, and -1 if (encoding) m_doc->setXMLEncoding(toString(encoding)); }
C
Chrome
0
CVE-2017-9059
https://www.cvedetails.com/cve/CVE-2017-9059/
CWE-404
https://github.com/torvalds/linux/commit/c70422f760c120480fee4de6c38804c72aa26bc1
c70422f760c120480fee4de6c38804c72aa26bc1
Merge tag 'nfsd-4.12' of git://linux-nfs.org/~bfields/linux Pull nfsd updates from Bruce Fields: "Another RDMA update from Chuck Lever, and a bunch of miscellaneous bugfixes" * tag 'nfsd-4.12' of git://linux-nfs.org/~bfields/linux: (26 commits) nfsd: Fix up the "supattr_exclcreat" attributes nfsd: encoders mustn't use unitialized values in error cases nfsd: fix undefined behavior in nfsd4_layout_verify lockd: fix lockd shutdown race NFSv4: Fix callback server shutdown SUNRPC: Refactor svc_set_num_threads() NFSv4.x/callback: Create the callback service through svc_create_pooled lockd: remove redundant check on block svcrdma: Clean out old XDR encoders svcrdma: Remove the req_map cache svcrdma: Remove unused RDMA Write completion handler svcrdma: Reduce size of sge array in struct svc_rdma_op_ctxt svcrdma: Clean up RPC-over-RDMA backchannel reply processing svcrdma: Report Write/Reply chunk overruns svcrdma: Clean up RDMA_ERROR path svcrdma: Use rdma_rw API in RPC reply path svcrdma: Introduce local rdma_rw API helpers svcrdma: Clean up svc_rdma_get_inv_rkey() svcrdma: Add helper to save pages under I/O svcrdma: Eliminate RPCRDMA_SQ_DEPTH_MULT ...
nfs4_inc_and_copy_stateid(stateid_t *dst, struct nfs4_stid *stid) { stateid_t *src = &stid->sc_stateid; spin_lock(&stid->sc_lock); if (unlikely(++src->si_generation == 0)) src->si_generation = 1; memcpy(dst, src, sizeof(*dst)); spin_unlock(&stid->sc_lock); }
nfs4_inc_and_copy_stateid(stateid_t *dst, struct nfs4_stid *stid) { stateid_t *src = &stid->sc_stateid; spin_lock(&stid->sc_lock); if (unlikely(++src->si_generation == 0)) src->si_generation = 1; memcpy(dst, src, sizeof(*dst)); spin_unlock(&stid->sc_lock); }
C
linux
0
CVE-2013-2548
https://www.cvedetails.com/cve/CVE-2013-2548/
CWE-310
https://github.com/torvalds/linux/commit/9a5467bf7b6e9e02ec9c3da4e23747c05faeaac6
9a5467bf7b6e9e02ec9c3da4e23747c05faeaac6
crypto: user - fix info leaks in report API Three errors resulting in kernel memory disclosure: 1/ The structures used for the netlink based crypto algorithm report API are located on the stack. As snprintf() does not fill the remainder of the buffer with null bytes, those stack bytes will be disclosed to users of the API. Switch to strncpy() to fix this. 2/ crypto_report_one() does not initialize all field of struct crypto_user_alg. Fix this to fix the heap info leak. 3/ For the module name we should copy only as many bytes as module_name() returns -- not as much as the destination buffer could hold. But the current code does not and therefore copies random data from behind the end of the module name, as the module name is always shorter than CRYPTO_MAX_ALG_NAME. Also switch to use strncpy() to copy the algorithm's name and driver_name. They are strings, after all. Signed-off-by: Mathias Krause <minipli@googlemail.com> Cc: Steffen Klassert <steffen.klassert@secunet.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
static int no_givdecrypt(struct skcipher_givcrypt_request *req) { return -ENOSYS; }
static int no_givdecrypt(struct skcipher_givcrypt_request *req) { return -ENOSYS; }
C
linux
0
CVE-2018-6096
https://www.cvedetails.com/cve/CVE-2018-6096/
null
https://github.com/chromium/chromium/commit/36f801fdbec07d116a6f4f07bb363f10897d6a51
36f801fdbec07d116a6f4f07bb363f10897d6a51
If a page calls |window.focus()|, kick it out of fullscreen. BUG=776418, 800056 Change-Id: I1880fe600e4814c073f247c43b1c1ac80c8fc017 Reviewed-on: https://chromium-review.googlesource.com/852378 Reviewed-by: Nasko Oskov <nasko@chromium.org> Reviewed-by: Philip Jägenstedt <foolip@chromium.org> Commit-Queue: Avi Drissman <avi@chromium.org> Cr-Commit-Position: refs/heads/master@{#533790}
bool WebViewTest::TapElement(WebInputEvent::Type type, Element* element) { if (!element || !element->GetLayoutObject()) return false; DCHECK(web_view_helper_.GetWebView()); element->scrollIntoViewIfNeeded(); IntPoint center = web_view_helper_.GetWebView() ->MainFrameImpl() ->GetFrameView() ->ContentsToScreen( element->GetLayoutObject()->AbsoluteBoundingBoxRect()) .Center(); WebGestureEvent event(type, WebInputEvent::kNoModifiers, WebInputEvent::kTimeStampForTesting); event.source_device = kWebGestureDeviceTouchscreen; event.x = center.X(); event.y = center.Y(); web_view_helper_.GetWebView()->HandleInputEvent( WebCoalescedInputEvent(event)); RunPendingTasks(); return true; }
bool WebViewTest::TapElement(WebInputEvent::Type type, Element* element) { if (!element || !element->GetLayoutObject()) return false; DCHECK(web_view_helper_.GetWebView()); element->scrollIntoViewIfNeeded(); IntPoint center = web_view_helper_.GetWebView() ->MainFrameImpl() ->GetFrameView() ->ContentsToScreen( element->GetLayoutObject()->AbsoluteBoundingBoxRect()) .Center(); WebGestureEvent event(type, WebInputEvent::kNoModifiers, WebInputEvent::kTimeStampForTesting); event.source_device = kWebGestureDeviceTouchscreen; event.x = center.X(); event.y = center.Y(); web_view_helper_.GetWebView()->HandleInputEvent( WebCoalescedInputEvent(event)); RunPendingTasks(); return true; }
C
Chrome
0
CVE-2014-5045
https://www.cvedetails.com/cve/CVE-2014-5045/
CWE-59
https://github.com/torvalds/linux/commit/295dc39d941dc2ae53d5c170365af4c9d5c16212
295dc39d941dc2ae53d5c170365af4c9d5c16212
fs: umount on symlink leaks mnt count Currently umount on symlink blocks following umount: /vz is separate mount # ls /vz/ -al | grep test drwxr-xr-x. 2 root root 4096 Jul 19 01:14 testdir lrwxrwxrwx. 1 root root 11 Jul 19 01:16 testlink -> /vz/testdir # umount -l /vz/testlink umount: /vz/testlink: not mounted (expected) # lsof /vz # umount /vz umount: /vz: device is busy. (unexpected) In this case mountpoint_last() gets an extra refcount on path->mnt Signed-off-by: Vasily Averin <vvs@openvz.org> Acked-by: Ian Kent <raven@themaw.net> Acked-by: Jeff Layton <jlayton@primarydata.com> Cc: stable@vger.kernel.org Signed-off-by: Christoph Hellwig <hch@lst.de>
static int follow_managed(struct path *path, unsigned flags) { struct vfsmount *mnt = path->mnt; /* held by caller, must be left alone */ unsigned managed; bool need_mntput = false; int ret = 0; /* Given that we're not holding a lock here, we retain the value in a * local variable for each dentry as we look at it so that we don't see * the components of that value change under us */ while (managed = ACCESS_ONCE(path->dentry->d_flags), managed &= DCACHE_MANAGED_DENTRY, unlikely(managed != 0)) { /* Allow the filesystem to manage the transit without i_mutex * being held. */ if (managed & DCACHE_MANAGE_TRANSIT) { BUG_ON(!path->dentry->d_op); BUG_ON(!path->dentry->d_op->d_manage); ret = path->dentry->d_op->d_manage(path->dentry, false); if (ret < 0) break; } /* Transit to a mounted filesystem. */ if (managed & DCACHE_MOUNTED) { struct vfsmount *mounted = lookup_mnt(path); if (mounted) { dput(path->dentry); if (need_mntput) mntput(path->mnt); path->mnt = mounted; path->dentry = dget(mounted->mnt_root); need_mntput = true; continue; } /* Something is mounted on this dentry in another * namespace and/or whatever was mounted there in this * namespace got unmounted before lookup_mnt() could * get it */ } /* Handle an automount point */ if (managed & DCACHE_NEED_AUTOMOUNT) { ret = follow_automount(path, flags, &need_mntput); if (ret < 0) break; continue; } /* We didn't change the current path point */ break; } if (need_mntput && path->mnt == mnt) mntput(path->mnt); if (ret == -EISDIR) ret = 0; return ret < 0 ? ret : need_mntput; }
static int follow_managed(struct path *path, unsigned flags) { struct vfsmount *mnt = path->mnt; /* held by caller, must be left alone */ unsigned managed; bool need_mntput = false; int ret = 0; /* Given that we're not holding a lock here, we retain the value in a * local variable for each dentry as we look at it so that we don't see * the components of that value change under us */ while (managed = ACCESS_ONCE(path->dentry->d_flags), managed &= DCACHE_MANAGED_DENTRY, unlikely(managed != 0)) { /* Allow the filesystem to manage the transit without i_mutex * being held. */ if (managed & DCACHE_MANAGE_TRANSIT) { BUG_ON(!path->dentry->d_op); BUG_ON(!path->dentry->d_op->d_manage); ret = path->dentry->d_op->d_manage(path->dentry, false); if (ret < 0) break; } /* Transit to a mounted filesystem. */ if (managed & DCACHE_MOUNTED) { struct vfsmount *mounted = lookup_mnt(path); if (mounted) { dput(path->dentry); if (need_mntput) mntput(path->mnt); path->mnt = mounted; path->dentry = dget(mounted->mnt_root); need_mntput = true; continue; } /* Something is mounted on this dentry in another * namespace and/or whatever was mounted there in this * namespace got unmounted before lookup_mnt() could * get it */ } /* Handle an automount point */ if (managed & DCACHE_NEED_AUTOMOUNT) { ret = follow_automount(path, flags, &need_mntput); if (ret < 0) break; continue; } /* We didn't change the current path point */ break; } if (need_mntput && path->mnt == mnt) mntput(path->mnt); if (ret == -EISDIR) ret = 0; return ret < 0 ? ret : need_mntput; }
C
linux
0
CVE-2012-4508
https://www.cvedetails.com/cve/CVE-2012-4508/
CWE-362
https://github.com/torvalds/linux/commit/dee1f973ca341c266229faa5a1a5bb268bed3531
dee1f973ca341c266229faa5a1a5bb268bed3531
ext4: race-condition protection for ext4_convert_unwritten_extents_endio We assumed that at the time we call ext4_convert_unwritten_extents_endio() extent in question is fully inside [map.m_lblk, map->m_len] because it was already split during submission. But this may not be true due to a race between writeback vs fallocate. If extent in question is larger than requested we will split it again. Special precautions should being done if zeroout required because [map.m_lblk, map->m_len] already contains valid data. Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu> Cc: stable@vger.kernel.org
int ext4_convert_unwritten_extents(struct inode *inode, loff_t offset, ssize_t len) { handle_t *handle; unsigned int max_blocks; int ret = 0; int ret2 = 0; struct ext4_map_blocks map; unsigned int credits, blkbits = inode->i_blkbits; map.m_lblk = offset >> blkbits; /* * We can't just convert len to max_blocks because * If blocksize = 4096 offset = 3072 and len = 2048 */ max_blocks = ((EXT4_BLOCK_ALIGN(len + offset, blkbits) >> blkbits) - map.m_lblk); /* * credits to insert 1 extent into extent tree */ credits = ext4_chunk_trans_blocks(inode, max_blocks); while (ret >= 0 && ret < max_blocks) { map.m_lblk += ret; map.m_len = (max_blocks -= ret); handle = ext4_journal_start(inode, credits); if (IS_ERR(handle)) { ret = PTR_ERR(handle); break; } ret = ext4_map_blocks(handle, inode, &map, EXT4_GET_BLOCKS_IO_CONVERT_EXT); if (ret <= 0) { WARN_ON(ret <= 0); ext4_msg(inode->i_sb, KERN_ERR, "%s:%d: inode #%lu: block %u: len %u: " "ext4_ext_map_blocks returned %d", __func__, __LINE__, inode->i_ino, map.m_lblk, map.m_len, ret); } ext4_mark_inode_dirty(handle, inode); ret2 = ext4_journal_stop(handle); if (ret <= 0 || ret2 ) break; } return ret > 0 ? ret2 : ret; }
int ext4_convert_unwritten_extents(struct inode *inode, loff_t offset, ssize_t len) { handle_t *handle; unsigned int max_blocks; int ret = 0; int ret2 = 0; struct ext4_map_blocks map; unsigned int credits, blkbits = inode->i_blkbits; map.m_lblk = offset >> blkbits; /* * We can't just convert len to max_blocks because * If blocksize = 4096 offset = 3072 and len = 2048 */ max_blocks = ((EXT4_BLOCK_ALIGN(len + offset, blkbits) >> blkbits) - map.m_lblk); /* * credits to insert 1 extent into extent tree */ credits = ext4_chunk_trans_blocks(inode, max_blocks); while (ret >= 0 && ret < max_blocks) { map.m_lblk += ret; map.m_len = (max_blocks -= ret); handle = ext4_journal_start(inode, credits); if (IS_ERR(handle)) { ret = PTR_ERR(handle); break; } ret = ext4_map_blocks(handle, inode, &map, EXT4_GET_BLOCKS_IO_CONVERT_EXT); if (ret <= 0) { WARN_ON(ret <= 0); ext4_msg(inode->i_sb, KERN_ERR, "%s:%d: inode #%lu: block %u: len %u: " "ext4_ext_map_blocks returned %d", __func__, __LINE__, inode->i_ino, map.m_lblk, map.m_len, ret); } ext4_mark_inode_dirty(handle, inode); ret2 = ext4_journal_stop(handle); if (ret <= 0 || ret2 ) break; } return ret > 0 ? ret2 : ret; }
C
linux
0
CVE-2014-3154
https://www.cvedetails.com/cve/CVE-2014-3154/
null
https://github.com/chromium/chromium/commit/f14efc560a12a513696d6396413b138879dabd7a
f14efc560a12a513696d6396413b138879dabd7a
[FileAPI] Clean up WebFileSystemImpl before Blink shutdown WebFileSystemImpl should not outlive V8 instance, since it may have references to V8. This CL ensures it deleted before Blink shutdown. BUG=369525 Review URL: https://codereview.chromium.org/270633009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@269345 0039d316-1c4b-4281-b951-d872f2087c98
void ChildThread::OnSetIPCLoggingEnabled(bool enable) { if (enable) IPC::Logging::GetInstance()->Enable(); else IPC::Logging::GetInstance()->Disable(); }
void ChildThread::OnSetIPCLoggingEnabled(bool enable) { if (enable) IPC::Logging::GetInstance()->Enable(); else IPC::Logging::GetInstance()->Disable(); }
C
Chrome
0
CVE-2016-5200
https://www.cvedetails.com/cve/CVE-2016-5200/
CWE-119
https://github.com/chromium/chromium/commit/2f19869af13bbfdcfd682a55c0d2c61c6e102475
2f19869af13bbfdcfd682a55c0d2c61c6e102475
chrome/browser/ui/webauthn: long domains may cause a line break. As requested by UX in [1], allow long host names to split a title into two lines. This allows us to show more of the name before eliding, although sufficiently long names will still trigger elision. Screenshot at https://drive.google.com/open?id=1_V6t2CeZDAVazy3Px-OET2LnB__aEW1r. [1] https://docs.google.com/presentation/d/1TtxkPUchyVZulqgdMcfui-68B0W-DWaFFVJEffGIbLA/edit#slide=id.g5913c4105f_1_12 Change-Id: I70f6541e0db3e9942239304de43b487a7561ca34 Bug: 870892 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1601812 Auto-Submit: Adam Langley <agl@chromium.org> Commit-Queue: Nina Satragno <nsatragno@chromium.org> Reviewed-by: Nina Satragno <nsatragno@chromium.org> Cr-Commit-Position: refs/heads/master@{#658114}
const gfx::VectorIcon& AuthenticatorBleActivateSheetModel::GetStepIllustration( ImageColorScheme color_scheme) const { return color_scheme == ImageColorScheme::kDark ? kWebauthnBleTapDarkIcon : kWebauthnBleTapIcon; }
const gfx::VectorIcon& AuthenticatorBleActivateSheetModel::GetStepIllustration( ImageColorScheme color_scheme) const { return color_scheme == ImageColorScheme::kDark ? kWebauthnBleTapDarkIcon : kWebauthnBleTapIcon; }
C
Chrome
0
CVE-2017-5112
https://www.cvedetails.com/cve/CVE-2017-5112/
CWE-119
https://github.com/chromium/chromium/commit/f6ac1dba5e36f338a490752a2cbef3339096d9fe
f6ac1dba5e36f338a490752a2cbef3339096d9fe
Reset ES3 pixel pack parameters and PIXEL_PACK_BUFFER binding in DrawingBuffer before ReadPixels() and recover them later. BUG=740603 TEST=new conformance test R=kbr@chromium.org,piman@chromium.org Change-Id: I3ea54c6cc34f34e249f7c8b9f792d93c5e1958f4 Reviewed-on: https://chromium-review.googlesource.com/570840 Reviewed-by: Antoine Labour <piman@chromium.org> Reviewed-by: Kenneth Russell <kbr@chromium.org> Commit-Queue: Zhenyao Mo <zmo@chromium.org> Cr-Commit-Position: refs/heads/master@{#486518}
void DrawingBuffer::SetFilterQuality(SkFilterQuality filter_quality) { if (filter_quality_ != filter_quality) { filter_quality_ = filter_quality; if (layer_) layer_->SetNearestNeighbor(filter_quality == kNone_SkFilterQuality); } }
void DrawingBuffer::SetFilterQuality(SkFilterQuality filter_quality) { if (filter_quality_ != filter_quality) { filter_quality_ = filter_quality; if (layer_) layer_->SetNearestNeighbor(filter_quality == kNone_SkFilterQuality); } }
C
Chrome
0
CVE-2016-3746
https://www.cvedetails.com/cve/CVE-2016-3746/
null
https://android.googlesource.com/platform/hardware/qcom/media/+/5b82f4f90c3d531313714df4b936f92fb0ff15cf
5b82f4f90c3d531313714df4b936f92fb0ff15cf
DO NOT MERGE mm-video-v4l2: vdec: Avoid processing ETBs/FTBs in invalid states (per the spec) ETB/FTB should not be handled in states other than Executing, Paused and Idle. This avoids accessing invalid buffers. Also add a lock to protect the private-buffers from being deleted while accessing from another thread. Bug: 27890802 Security Vulnerability - Heap Use-After-Free and Possible LPE in MediaServer (libOmxVdec problem #6) CRs-Fixed: 1008882 Change-Id: Iaac2e383cd53cf9cf8042c9ed93ddc76dba3907e
OMX_ERRORTYPE omx_vdec::push_input_vc1 (OMX_HANDLETYPE hComp) { OMX_U8 *buf, *pdest; OMX_U32 partial_frame = 1; OMX_U32 buf_len, dest_len; if (first_frame == 0) { first_frame = 1; DEBUG_PRINT_LOW("First i/p buffer for VC1 arbitrary bytes"); if (!m_vendor_config.pData) { DEBUG_PRINT_LOW("Check profile type in 1st source buffer"); buf = psource_frame->pBuffer; buf_len = psource_frame->nFilledLen; if ((*((OMX_U32 *) buf) & VC1_SP_MP_START_CODE_MASK) == VC1_SP_MP_START_CODE) { m_vc1_profile = VC1_SP_MP_RCV; } else if (*((OMX_U32 *) buf) & VC1_AP_SEQ_START_CODE) { m_vc1_profile = VC1_AP; } else { DEBUG_PRINT_ERROR("Invalid sequence layer in first buffer"); return OMX_ErrorStreamCorrupt; } } else { pdest = pdest_frame->pBuffer + pdest_frame->nFilledLen + pdest_frame->nOffset; dest_len = pdest_frame->nAllocLen - (pdest_frame->nFilledLen + pdest_frame->nOffset); if (dest_len < m_vendor_config.nDataSize) { DEBUG_PRINT_ERROR("Destination buffer full"); return OMX_ErrorBadParameter; } else { memcpy(pdest, m_vendor_config.pData, m_vendor_config.nDataSize); pdest_frame->nFilledLen += m_vendor_config.nDataSize; } } } switch (m_vc1_profile) { case VC1_AP: DEBUG_PRINT_LOW("VC1 AP, hence parse using frame start code"); if (push_input_sc_codec(hComp) != OMX_ErrorNone) { DEBUG_PRINT_ERROR("Error In Parsing VC1 AP start code"); return OMX_ErrorBadParameter; } break; case VC1_SP_MP_RCV: default: DEBUG_PRINT_ERROR("Unsupported VC1 profile in ArbitraryBytes Mode"); return OMX_ErrorBadParameter; } return OMX_ErrorNone; }
OMX_ERRORTYPE omx_vdec::push_input_vc1 (OMX_HANDLETYPE hComp) { OMX_U8 *buf, *pdest; OMX_U32 partial_frame = 1; OMX_U32 buf_len, dest_len; if (first_frame == 0) { first_frame = 1; DEBUG_PRINT_LOW("First i/p buffer for VC1 arbitrary bytes"); if (!m_vendor_config.pData) { DEBUG_PRINT_LOW("Check profile type in 1st source buffer"); buf = psource_frame->pBuffer; buf_len = psource_frame->nFilledLen; if ((*((OMX_U32 *) buf) & VC1_SP_MP_START_CODE_MASK) == VC1_SP_MP_START_CODE) { m_vc1_profile = VC1_SP_MP_RCV; } else if (*((OMX_U32 *) buf) & VC1_AP_SEQ_START_CODE) { m_vc1_profile = VC1_AP; } else { DEBUG_PRINT_ERROR("Invalid sequence layer in first buffer"); return OMX_ErrorStreamCorrupt; } } else { pdest = pdest_frame->pBuffer + pdest_frame->nFilledLen + pdest_frame->nOffset; dest_len = pdest_frame->nAllocLen - (pdest_frame->nFilledLen + pdest_frame->nOffset); if (dest_len < m_vendor_config.nDataSize) { DEBUG_PRINT_ERROR("Destination buffer full"); return OMX_ErrorBadParameter; } else { memcpy(pdest, m_vendor_config.pData, m_vendor_config.nDataSize); pdest_frame->nFilledLen += m_vendor_config.nDataSize; } } } switch (m_vc1_profile) { case VC1_AP: DEBUG_PRINT_LOW("VC1 AP, hence parse using frame start code"); if (push_input_sc_codec(hComp) != OMX_ErrorNone) { DEBUG_PRINT_ERROR("Error In Parsing VC1 AP start code"); return OMX_ErrorBadParameter; } break; case VC1_SP_MP_RCV: default: DEBUG_PRINT_ERROR("Unsupported VC1 profile in ArbitraryBytes Mode"); return OMX_ErrorBadParameter; } return OMX_ErrorNone; }
C
Android
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
BOOLEAN btif_rc_get_connected_peer(BD_ADDR peer_addr) { if (btif_rc_cb.rc_connected == TRUE) { bdcpy(peer_addr, btif_rc_cb.rc_addr); return TRUE; } return FALSE; }
BOOLEAN btif_rc_get_connected_peer(BD_ADDR peer_addr) { if (btif_rc_cb.rc_connected == TRUE) { bdcpy(peer_addr, btif_rc_cb.rc_addr); return TRUE; } return FALSE; }
C
Android
0
CVE-2014-3160
https://www.cvedetails.com/cve/CVE-2014-3160/
CWE-264
https://github.com/chromium/chromium/commit/ee281f7cac9df44fe241a37f188b28be8845ded0
ee281f7cac9df44fe241a37f188b28be8845ded0
Enforce SVG image security rules SVG images have unique security rules that prevent them from loading any external resources. This patch enforces these rules in ResourceFetcher::canRequest for all non-data-uri resources. This locks down our SVG resource handling and fixes two security bugs. In the case of SVG images that reference other images, we had a bug where a cached subresource would be used directly from the cache. This has been fixed because the canRequest check occurs before we use cached resources. In the case of SVG images that use CSS imports, we had a bug where imports were blindly requested. This has been fixed by stopping all non-data-uri requests in SVG images. With this patch we now match Gecko's behavior on both testcases. BUG=380885, 382296 Review URL: https://codereview.chromium.org/320763002 git-svn-id: svn://svn.chromium.org/blink/trunk@176084 bbb929c8-8fbe-4397-9dbb-9b2b20218538
void ResourceFetcher::didFinishLoading(const Resource* resource, double finishTime, int64_t encodedDataLength) { TRACE_EVENT_ASYNC_END0("net", "Resource", resource); context().dispatchDidFinishLoading(m_documentLoader, resource->identifier(), finishTime, encodedDataLength); }
void ResourceFetcher::didFinishLoading(const Resource* resource, double finishTime, int64_t encodedDataLength) { TRACE_EVENT_ASYNC_END0("net", "Resource", resource); context().dispatchDidFinishLoading(m_documentLoader, resource->identifier(), finishTime, encodedDataLength); }
C
Chrome
0
CVE-2015-8863
https://www.cvedetails.com/cve/CVE-2015-8863/
CWE-119
https://github.com/stedolan/jq/commit/8eb1367ca44e772963e704a700ef72ae2e12babd
8eb1367ca44e772963e704a700ef72ae2e12babd
Heap buffer overflow in tokenadd() (fix #105) This was an off-by one: the NUL terminator byte was not allocated on resize. This was triggered by JSON-encoded numbers longer than 256 bytes.
static void parser_init(struct jv_parser* p, int flags) { p->flags = flags; if ((p->flags & JV_PARSE_STREAMING)) { p->path = jv_array(); } else { p->path = jv_invalid(); p->flags &= ~(JV_PARSE_STREAM_ERRORS); } p->stack = 0; p->stacklen = p->stackpos = 0; p->last_seen = JV_LAST_NONE; p->output = jv_invalid(); p->next = jv_invalid(); p->tokenbuf = 0; p->tokenlen = p->tokenpos = 0; if ((p->flags & JV_PARSE_SEQ)) p->st = JV_PARSER_WAITING_FOR_RS; else p->st = JV_PARSER_NORMAL; p->eof = 0; p->curr_buf = 0; p->curr_buf_length = p->curr_buf_pos = p->curr_buf_is_partial = 0; p->bom_strip_position = 0; p->last_ch_was_ws = 0; p->line = 1; p->column = 0; jvp_dtoa_context_init(&p->dtoa); }
static void parser_init(struct jv_parser* p, int flags) { p->flags = flags; if ((p->flags & JV_PARSE_STREAMING)) { p->path = jv_array(); } else { p->path = jv_invalid(); p->flags &= ~(JV_PARSE_STREAM_ERRORS); } p->stack = 0; p->stacklen = p->stackpos = 0; p->last_seen = JV_LAST_NONE; p->output = jv_invalid(); p->next = jv_invalid(); p->tokenbuf = 0; p->tokenlen = p->tokenpos = 0; if ((p->flags & JV_PARSE_SEQ)) p->st = JV_PARSER_WAITING_FOR_RS; else p->st = JV_PARSER_NORMAL; p->eof = 0; p->curr_buf = 0; p->curr_buf_length = p->curr_buf_pos = p->curr_buf_is_partial = 0; p->bom_strip_position = 0; p->last_ch_was_ws = 0; p->line = 1; p->column = 0; jvp_dtoa_context_init(&p->dtoa); }
C
jq
0
CVE-2017-16529
https://www.cvedetails.com/cve/CVE-2017-16529/
CWE-125
https://github.com/torvalds/linux/commit/bfc81a8bc18e3c4ba0cbaa7666ff76be2f998991
bfc81a8bc18e3c4ba0cbaa7666ff76be2f998991
ALSA: usb-audio: Check out-of-bounds access by corrupted buffer descriptor When a USB-audio device receives a maliciously adjusted or corrupted buffer descriptor, the USB-audio driver may access an out-of-bounce value at its parser. This was detected by syzkaller, something like: BUG: KASAN: slab-out-of-bounds in usb_audio_probe+0x27b2/0x2ab0 Read of size 1 at addr ffff88006b83a9e8 by task kworker/0:1/24 CPU: 0 PID: 24 Comm: kworker/0:1 Not tainted 4.14.0-rc1-42251-gebb2c2437d80 #224 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Bochs 01/01/2011 Workqueue: usb_hub_wq hub_event Call Trace: __dump_stack lib/dump_stack.c:16 dump_stack+0x292/0x395 lib/dump_stack.c:52 print_address_description+0x78/0x280 mm/kasan/report.c:252 kasan_report_error mm/kasan/report.c:351 kasan_report+0x22f/0x340 mm/kasan/report.c:409 __asan_report_load1_noabort+0x19/0x20 mm/kasan/report.c:427 snd_usb_create_streams sound/usb/card.c:248 usb_audio_probe+0x27b2/0x2ab0 sound/usb/card.c:605 usb_probe_interface+0x35d/0x8e0 drivers/usb/core/driver.c:361 really_probe drivers/base/dd.c:413 driver_probe_device+0x610/0xa00 drivers/base/dd.c:557 __device_attach_driver+0x230/0x290 drivers/base/dd.c:653 bus_for_each_drv+0x161/0x210 drivers/base/bus.c:463 __device_attach+0x26e/0x3d0 drivers/base/dd.c:710 device_initial_probe+0x1f/0x30 drivers/base/dd.c:757 bus_probe_device+0x1eb/0x290 drivers/base/bus.c:523 device_add+0xd0b/0x1660 drivers/base/core.c:1835 usb_set_configuration+0x104e/0x1870 drivers/usb/core/message.c:1932 generic_probe+0x73/0xe0 drivers/usb/core/generic.c:174 usb_probe_device+0xaf/0xe0 drivers/usb/core/driver.c:266 really_probe drivers/base/dd.c:413 driver_probe_device+0x610/0xa00 drivers/base/dd.c:557 __device_attach_driver+0x230/0x290 drivers/base/dd.c:653 bus_for_each_drv+0x161/0x210 drivers/base/bus.c:463 __device_attach+0x26e/0x3d0 drivers/base/dd.c:710 device_initial_probe+0x1f/0x30 drivers/base/dd.c:757 bus_probe_device+0x1eb/0x290 drivers/base/bus.c:523 device_add+0xd0b/0x1660 drivers/base/core.c:1835 usb_new_device+0x7b8/0x1020 drivers/usb/core/hub.c:2457 hub_port_connect drivers/usb/core/hub.c:4903 hub_port_connect_change drivers/usb/core/hub.c:5009 port_event drivers/usb/core/hub.c:5115 hub_event+0x194d/0x3740 drivers/usb/core/hub.c:5195 process_one_work+0xc7f/0x1db0 kernel/workqueue.c:2119 worker_thread+0x221/0x1850 kernel/workqueue.c:2253 kthread+0x3a1/0x470 kernel/kthread.c:231 ret_from_fork+0x2a/0x40 arch/x86/entry/entry_64.S:431 This patch adds the checks of out-of-bounce accesses at appropriate places and bails out when it goes out of the given buffer. Reported-by: Andrey Konovalov <andreyknvl@google.com> Tested-by: Andrey Konovalov <andreyknvl@google.com> Cc: <stable@vger.kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
static int __usb_audio_resume(struct usb_interface *intf, bool reset_resume) { struct snd_usb_audio *chip = usb_get_intfdata(intf); struct usb_mixer_interface *mixer; struct list_head *p; int err = 0; if (chip == (void *)-1L) return 0; if (--chip->num_suspended_intf) return 0; atomic_inc(&chip->active); /* avoid autopm */ /* * ALSA leaves material resumption to user space * we just notify and restart the mixers */ list_for_each_entry(mixer, &chip->mixer_list, list) { err = snd_usb_mixer_resume(mixer, reset_resume); if (err < 0) goto err_out; } list_for_each(p, &chip->midi_list) { snd_usbmidi_resume(p); } if (!chip->autosuspended) snd_power_change_state(chip->card, SNDRV_CTL_POWER_D0); chip->autosuspended = 0; err_out: atomic_dec(&chip->active); /* allow autopm after this point */ return err; }
static int __usb_audio_resume(struct usb_interface *intf, bool reset_resume) { struct snd_usb_audio *chip = usb_get_intfdata(intf); struct usb_mixer_interface *mixer; struct list_head *p; int err = 0; if (chip == (void *)-1L) return 0; if (--chip->num_suspended_intf) return 0; atomic_inc(&chip->active); /* avoid autopm */ /* * ALSA leaves material resumption to user space * we just notify and restart the mixers */ list_for_each_entry(mixer, &chip->mixer_list, list) { err = snd_usb_mixer_resume(mixer, reset_resume); if (err < 0) goto err_out; } list_for_each(p, &chip->midi_list) { snd_usbmidi_resume(p); } if (!chip->autosuspended) snd_power_change_state(chip->card, SNDRV_CTL_POWER_D0); chip->autosuspended = 0; err_out: atomic_dec(&chip->active); /* allow autopm after this point */ return err; }
C
linux
0
CVE-2010-1149
https://www.cvedetails.com/cve/CVE-2010-1149/
CWE-200
https://cgit.freedesktop.org/udisks/commit/?id=0fcc7cb3b66f23fac53ae08647aa0007a2bd56c4
0fcc7cb3b66f23fac53ae08647aa0007a2bd56c4
null
device_job_cancel_authorized_cb (Daemon *daemon, Device *device, DBusGMethodInvocation *context, const gchar *action_id, guint num_user_data, gpointer *user_data_elements) { if (!device->priv->job_in_progress) { throw_error (context, ERROR_FAILED, "There is no job to cancel"); goto out; } if (!device->priv->job_is_cancellable) { throw_error (context, ERROR_FAILED, "Job cannot be cancelled"); goto out; } job_cancel (device); /* TODO: wait returning once the job is actually cancelled? */ dbus_g_method_return (context); out: ; }
device_job_cancel_authorized_cb (Daemon *daemon, Device *device, DBusGMethodInvocation *context, const gchar *action_id, guint num_user_data, gpointer *user_data_elements) { if (!device->priv->job_in_progress) { throw_error (context, ERROR_FAILED, "There is no job to cancel"); goto out; } if (!device->priv->job_is_cancellable) { throw_error (context, ERROR_FAILED, "Job cannot be cancelled"); goto out; } job_cancel (device); /* TODO: wait returning once the job is actually cancelled? */ dbus_g_method_return (context); out: ; }
C
udisks
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 <dave@linux.vnet.ibm.com> Acked-by: Mel Gorman <mel@csn.ul.ie> Acked-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com> Reported-by: Christoph Lameter <cl@linux.com> Tested-by: Christoph Lameter <cl@linux.com> Cc: Andrea Arcangeli <aarcange@redhat.com> Cc: <stable@vger.kernel.org> [2.6.32+] Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
static void enqueue_huge_page(struct hstate *h, struct page *page) { int nid = page_to_nid(page); list_add(&page->lru, &h->hugepage_freelists[nid]); h->free_huge_pages++; h->free_huge_pages_node[nid]++; }
static void enqueue_huge_page(struct hstate *h, struct page *page) { int nid = page_to_nid(page); list_add(&page->lru, &h->hugepage_freelists[nid]); h->free_huge_pages++; h->free_huge_pages_node[nid]++; }
C
linux
0
CVE-2016-2538
https://www.cvedetails.com/cve/CVE-2016-2538/
CWE-189
https://git.qemu.org/?p=qemu.git;a=commit;h=fe3c546c5ff2a6210f9a4d8561cc64051ca8603e
fe3c546c5ff2a6210f9a4d8561cc64051ca8603e
null
static int rndis_parse(USBNetState *s, uint8_t *data, int length) { uint32_t msg_type; le32 *tmp = (le32 *) data; msg_type = le32_to_cpup(tmp); switch (msg_type) { case RNDIS_INITIALIZE_MSG: s->rndis_state = RNDIS_INITIALIZED; return rndis_init_response(s, (rndis_init_msg_type *) data); case RNDIS_HALT_MSG: s->rndis_state = RNDIS_UNINITIALIZED; return 0; case RNDIS_QUERY_MSG: return rndis_query_response(s, (rndis_query_msg_type *) data, length); case RNDIS_SET_MSG: return rndis_set_response(s, (rndis_set_msg_type *) data, length); case RNDIS_RESET_MSG: rndis_clear_responsequeue(s); s->out_ptr = 0; usb_net_reset_in_buf(s); return rndis_reset_response(s, (rndis_reset_msg_type *) data); case RNDIS_KEEPALIVE_MSG: /* For USB: host does this every 5 seconds */ return rndis_keepalive_response(s, (rndis_keepalive_msg_type *) data); } return USB_RET_STALL; }
static int rndis_parse(USBNetState *s, uint8_t *data, int length) { uint32_t msg_type; le32 *tmp = (le32 *) data; msg_type = le32_to_cpup(tmp); switch (msg_type) { case RNDIS_INITIALIZE_MSG: s->rndis_state = RNDIS_INITIALIZED; return rndis_init_response(s, (rndis_init_msg_type *) data); case RNDIS_HALT_MSG: s->rndis_state = RNDIS_UNINITIALIZED; return 0; case RNDIS_QUERY_MSG: return rndis_query_response(s, (rndis_query_msg_type *) data, length); case RNDIS_SET_MSG: return rndis_set_response(s, (rndis_set_msg_type *) data, length); case RNDIS_RESET_MSG: rndis_clear_responsequeue(s); s->out_ptr = 0; usb_net_reset_in_buf(s); return rndis_reset_response(s, (rndis_reset_msg_type *) data); case RNDIS_KEEPALIVE_MSG: /* For USB: host does this every 5 seconds */ return rndis_keepalive_response(s, (rndis_keepalive_msg_type *) data); } return USB_RET_STALL; }
C
qemu
0
CVE-2017-16359
https://www.cvedetails.com/cve/CVE-2017-16359/
CWE-476
https://github.com/radare/radare2/commit/62e39f34b2705131a2d08aff0c2e542c6a52cf0e
62e39f34b2705131a2d08aff0c2e542c6a52cf0e
Fix #8764 - huge vd_aux caused pointer wraparound
static Sdb *store_versioninfo_gnu_verneed(ELFOBJ *bin, Elf_(Shdr) *shdr, int sz) { ut8 *end, *need = NULL; const char *section_name = ""; Elf_(Shdr) *link_shdr = NULL; const char *link_section_name = ""; Sdb *sdb_vernaux = NULL; Sdb *sdb_version = NULL; Sdb *sdb = NULL; int i, cnt; if (!bin || !bin->dynstr) { return NULL; } if (shdr->sh_link > bin->ehdr.e_shnum) { return NULL; } if (shdr->sh_size < 1 || shdr->sh_size > SIZE_MAX) { return NULL; } sdb = sdb_new0 (); if (!sdb) { return NULL; } link_shdr = &bin->shdr[shdr->sh_link]; if (bin->shstrtab && shdr->sh_name < bin->shstrtab_size) { section_name = &bin->shstrtab[shdr->sh_name]; } if (bin->shstrtab && link_shdr->sh_name < bin->shstrtab_size) { link_section_name = &bin->shstrtab[link_shdr->sh_name]; } if (!(need = (ut8*) calloc (R_MAX (1, shdr->sh_size), sizeof (ut8)))) { bprintf ("Warning: Cannot allocate memory for Elf_(Verneed)\n"); goto beach; } end = need + shdr->sh_size; sdb_set (sdb, "section_name", section_name, 0); sdb_num_set (sdb, "num_entries", shdr->sh_info, 0); sdb_num_set (sdb, "addr", shdr->sh_addr, 0); sdb_num_set (sdb, "offset", shdr->sh_offset, 0); sdb_num_set (sdb, "link", shdr->sh_link, 0); sdb_set (sdb, "link_section_name", link_section_name, 0); if (shdr->sh_offset > bin->size || shdr->sh_offset + shdr->sh_size > bin->size) { goto beach; } if (shdr->sh_offset + shdr->sh_size < shdr->sh_size) { goto beach; } i = r_buf_read_at (bin->b, shdr->sh_offset, need, shdr->sh_size); if (i < 0) goto beach; for (i = 0, cnt = 0; cnt < shdr->sh_info; ++cnt) { int j, isum; ut8 *vstart = need + i; Elf_(Verneed) vvn = {0}; if (vstart + sizeof (Elf_(Verneed)) > end) { goto beach; } Elf_(Verneed) *entry = &vvn; char key[32] = {0}; sdb_version = sdb_new0 (); if (!sdb_version) { goto beach; } j = 0; vvn.vn_version = READ16 (vstart, j) vvn.vn_cnt = READ16 (vstart, j) vvn.vn_file = READ32 (vstart, j) vvn.vn_aux = READ32 (vstart, j) vvn.vn_next = READ32 (vstart, j) sdb_num_set (sdb_version, "vn_version", entry->vn_version, 0); sdb_num_set (sdb_version, "idx", i, 0); if (entry->vn_file > bin->dynstr_size) { goto beach; } { char *s = r_str_ndup (&bin->dynstr[entry->vn_file], 16); sdb_set (sdb_version, "file_name", s, 0); free (s); } sdb_num_set (sdb_version, "cnt", entry->vn_cnt, 0); st32 vnaux = entry->vn_aux; if (vnaux < 1) { goto beach; } vstart += vnaux; for (j = 0, isum = i + entry->vn_aux; j < entry->vn_cnt && vstart + sizeof (Elf_(Vernaux)) <= end; ++j) { int k; Elf_(Vernaux) * aux = NULL; Elf_(Vernaux) vaux = {0}; sdb_vernaux = sdb_new0 (); if (!sdb_vernaux) { goto beach; } aux = (Elf_(Vernaux)*)&vaux; k = 0; vaux.vna_hash = READ32 (vstart, k) vaux.vna_flags = READ16 (vstart, k) vaux.vna_other = READ16 (vstart, k) vaux.vna_name = READ32 (vstart, k) vaux.vna_next = READ32 (vstart, k) if (aux->vna_name > bin->dynstr_size) { goto beach; } sdb_num_set (sdb_vernaux, "idx", isum, 0); if (aux->vna_name > 0 && aux->vna_name + 8 < bin->dynstr_size) { char name [16]; strncpy (name, &bin->dynstr[aux->vna_name], sizeof (name)-1); name[sizeof(name)-1] = 0; sdb_set (sdb_vernaux, "name", name, 0); } sdb_set (sdb_vernaux, "flags", get_ver_flags (aux->vna_flags), 0); sdb_num_set (sdb_vernaux, "version", aux->vna_other, 0); isum += aux->vna_next; vstart += aux->vna_next; snprintf (key, sizeof (key), "vernaux%d", j); sdb_ns_set (sdb_version, key, sdb_vernaux); } if ((int)entry->vn_next < 0) { bprintf ("Invalid vn_next\n"); break; } i += entry->vn_next; snprintf (key, sizeof (key), "version%d", cnt ); sdb_ns_set (sdb, key, sdb_version); if (!entry->vn_next) { break; } } free (need); return sdb; beach: free (need); sdb_free (sdb_vernaux); sdb_free (sdb_version); sdb_free (sdb); return NULL; }
static Sdb *store_versioninfo_gnu_verneed(ELFOBJ *bin, Elf_(Shdr) *shdr, int sz) { ut8 *end, *need = NULL; const char *section_name = ""; Elf_(Shdr) *link_shdr = NULL; const char *link_section_name = ""; Sdb *sdb_vernaux = NULL; Sdb *sdb_version = NULL; Sdb *sdb = NULL; int i, cnt; if (!bin || !bin->dynstr) { return NULL; } if (shdr->sh_link > bin->ehdr.e_shnum) { return NULL; } if (shdr->sh_size < 1 || shdr->sh_size > SIZE_MAX) { return NULL; } sdb = sdb_new0 (); if (!sdb) { return NULL; } link_shdr = &bin->shdr[shdr->sh_link]; if (bin->shstrtab && shdr->sh_name < bin->shstrtab_size) { section_name = &bin->shstrtab[shdr->sh_name]; } if (bin->shstrtab && link_shdr->sh_name < bin->shstrtab_size) { link_section_name = &bin->shstrtab[link_shdr->sh_name]; } if (!(need = (ut8*) calloc (R_MAX (1, shdr->sh_size), sizeof (ut8)))) { bprintf ("Warning: Cannot allocate memory for Elf_(Verneed)\n"); goto beach; } end = need + shdr->sh_size; sdb_set (sdb, "section_name", section_name, 0); sdb_num_set (sdb, "num_entries", shdr->sh_info, 0); sdb_num_set (sdb, "addr", shdr->sh_addr, 0); sdb_num_set (sdb, "offset", shdr->sh_offset, 0); sdb_num_set (sdb, "link", shdr->sh_link, 0); sdb_set (sdb, "link_section_name", link_section_name, 0); if (shdr->sh_offset > bin->size || shdr->sh_offset + shdr->sh_size > bin->size) { goto beach; } if (shdr->sh_offset + shdr->sh_size < shdr->sh_size) { goto beach; } i = r_buf_read_at (bin->b, shdr->sh_offset, need, shdr->sh_size); if (i < 0) goto beach; for (i = 0, cnt = 0; cnt < shdr->sh_info; ++cnt) { int j, isum; ut8 *vstart = need + i; Elf_(Verneed) vvn = {0}; if (vstart + sizeof (Elf_(Verneed)) > end) { goto beach; } Elf_(Verneed) *entry = &vvn; char key[32] = {0}; sdb_version = sdb_new0 (); if (!sdb_version) { goto beach; } j = 0; vvn.vn_version = READ16 (vstart, j) vvn.vn_cnt = READ16 (vstart, j) vvn.vn_file = READ32 (vstart, j) vvn.vn_aux = READ32 (vstart, j) vvn.vn_next = READ32 (vstart, j) sdb_num_set (sdb_version, "vn_version", entry->vn_version, 0); sdb_num_set (sdb_version, "idx", i, 0); if (entry->vn_file > bin->dynstr_size) { goto beach; } { char *s = r_str_ndup (&bin->dynstr[entry->vn_file], 16); sdb_set (sdb_version, "file_name", s, 0); free (s); } sdb_num_set (sdb_version, "cnt", entry->vn_cnt, 0); st32 vnaux = entry->vn_aux; if (vnaux < 1) { goto beach; } vstart += vnaux; for (j = 0, isum = i + entry->vn_aux; j < entry->vn_cnt && vstart + sizeof (Elf_(Vernaux)) <= end; ++j) { int k; Elf_(Vernaux) * aux = NULL; Elf_(Vernaux) vaux = {0}; sdb_vernaux = sdb_new0 (); if (!sdb_vernaux) { goto beach; } aux = (Elf_(Vernaux)*)&vaux; k = 0; vaux.vna_hash = READ32 (vstart, k) vaux.vna_flags = READ16 (vstart, k) vaux.vna_other = READ16 (vstart, k) vaux.vna_name = READ32 (vstart, k) vaux.vna_next = READ32 (vstart, k) if (aux->vna_name > bin->dynstr_size) { goto beach; } sdb_num_set (sdb_vernaux, "idx", isum, 0); if (aux->vna_name > 0 && aux->vna_name + 8 < bin->dynstr_size) { char name [16]; strncpy (name, &bin->dynstr[aux->vna_name], sizeof (name)-1); name[sizeof(name)-1] = 0; sdb_set (sdb_vernaux, "name", name, 0); } sdb_set (sdb_vernaux, "flags", get_ver_flags (aux->vna_flags), 0); sdb_num_set (sdb_vernaux, "version", aux->vna_other, 0); isum += aux->vna_next; vstart += aux->vna_next; snprintf (key, sizeof (key), "vernaux%d", j); sdb_ns_set (sdb_version, key, sdb_vernaux); } if ((int)entry->vn_next < 0) { bprintf ("Invalid vn_next\n"); break; } i += entry->vn_next; snprintf (key, sizeof (key), "version%d", cnt ); sdb_ns_set (sdb, key, sdb_version); if (!entry->vn_next) { break; } } free (need); return sdb; beach: free (need); sdb_free (sdb_vernaux); sdb_free (sdb_version); sdb_free (sdb); return NULL; }
C
radare2
0
CVE-2017-8825
https://www.cvedetails.com/cve/CVE-2017-8825/
CWE-476
https://github.com/dinhviethoa/libetpan/commit/1fe8fbc032ccda1db9af66d93016b49c16c1f22d
1fe8fbc032ccda1db9af66d93016b49c16c1f22d
Fixed crash #274
int mailimf_word_parse(const char * message, size_t length, size_t * indx, char ** result) { size_t cur_token; char * word; int r; cur_token = * indx; r = mailimf_atom_parse(message, length, &cur_token, &word); if (r == MAILIMF_ERROR_PARSE) r = mailimf_quoted_string_parse(message, length, &cur_token, &word); if (r != MAILIMF_NO_ERROR) return r; * result = word; * indx = cur_token; return MAILIMF_NO_ERROR; }
int mailimf_word_parse(const char * message, size_t length, size_t * indx, char ** result) { size_t cur_token; char * word; int r; cur_token = * indx; r = mailimf_atom_parse(message, length, &cur_token, &word); if (r == MAILIMF_ERROR_PARSE) r = mailimf_quoted_string_parse(message, length, &cur_token, &word); if (r != MAILIMF_NO_ERROR) return r; * result = word; * indx = cur_token; return MAILIMF_NO_ERROR; }
C
libetpan
0
CVE-2019-17178
https://www.cvedetails.com/cve/CVE-2019-17178/
CWE-772
https://github.com/akallabeth/FreeRDP/commit/fc80ab45621bd966f70594c0b7393ec005a94007
fc80ab45621bd966f70594c0b7393ec005a94007
Fixed #5645: realloc return handling
static void add_coins(Coin* c1, const Coin* c2) { size_t i; for(i = 0; i < c2->symbols.size; i++) uivector_push_back(&c1->symbols, c2->symbols.data[i]); c1->weight += c2->weight; }
static void add_coins(Coin* c1, const Coin* c2) { size_t i; for(i = 0; i < c2->symbols.size; i++) uivector_push_back(&c1->symbols, c2->symbols.data[i]); c1->weight += c2->weight; }
C
FreeRDP
0
null
null
null
https://github.com/chromium/chromium/commit/3a353ebdb7753a3fbeb401c4c0e0f3358ccbb90b
3a353ebdb7753a3fbeb401c4c0e0f3358ccbb90b
Support pausing media when a context is frozen. Media is resumed when the context is unpaused. This feature will be used for bfcache and pausing iframes feature policy. BUG=907125 Change-Id: Ic3925ea1a4544242b7bf0b9ad8c9cb9f63976bbd Reviewed-on: https://chromium-review.googlesource.com/c/1410126 Commit-Queue: Dave Tapuska <dtapuska@chromium.org> Reviewed-by: Kentaro Hara <haraken@chromium.org> Reviewed-by: Mounir Lamouri <mlamouri@chromium.org> Cr-Commit-Position: refs/heads/master@{#623319}
void HTMLMediaElement::AutomaticTrackSelectionForUpdatedUserPreference() { if (!text_tracks_ || !text_tracks_->length()) return; MarkCaptionAndSubtitleTracksAsUnconfigured(); processing_preference_change_ = true; text_tracks_visible_ = false; HonorUserPreferencesForAutomaticTextTrackSelection(); processing_preference_change_ = false; text_tracks_visible_ = text_tracks_->HasShowingTracks(); UpdateTextTrackDisplay(); }
void HTMLMediaElement::AutomaticTrackSelectionForUpdatedUserPreference() { if (!text_tracks_ || !text_tracks_->length()) return; MarkCaptionAndSubtitleTracksAsUnconfigured(); processing_preference_change_ = true; text_tracks_visible_ = false; HonorUserPreferencesForAutomaticTextTrackSelection(); processing_preference_change_ = false; text_tracks_visible_ = text_tracks_->HasShowingTracks(); UpdateTextTrackDisplay(); }
C
Chrome
0
CVE-2014-7906
https://www.cvedetails.com/cve/CVE-2014-7906/
CWE-399
https://github.com/chromium/chromium/commit/3a2cf7d1376ae33054b878232fb38b8fbed29e31
3a2cf7d1376ae33054b878232fb38b8fbed29e31
Pepper: Access PepperMediaDeviceManager through a WeakPtr Its lifetime is scoped to the RenderFrame, and it might go away before the hosts that refer to it. BUG=423030 Review URL: https://codereview.chromium.org/653243003 Cr-Commit-Position: refs/heads/master@{#299897}
virtual ~TestDelegate() { CHECK(callbacks_.empty()); }
virtual ~TestDelegate() { CHECK(callbacks_.empty()); }
C
Chrome
0
CVE-2017-15868
https://www.cvedetails.com/cve/CVE-2017-15868/
CWE-20
https://github.com/torvalds/linux/commit/71bb99a02b32b4cc4265118e85f6035ca72923f0
71bb99a02b32b4cc4265118e85f6035ca72923f0
Bluetooth: bnep: bnep_add_connection() should verify that it's dealing with l2cap socket same story as cmtp Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
static void __bnep_unlink_session(struct bnep_session *s) { list_del(&s->list); }
static void __bnep_unlink_session(struct bnep_session *s) { list_del(&s->list); }
C
linux
0
CVE-2016-10068
https://www.cvedetails.com/cve/CVE-2016-10068/
CWE-20
https://github.com/ImageMagick/ImageMagick/commit/56d6e20de489113617cbbddaf41e92600a34db22
56d6e20de489113617cbbddaf41e92600a34db22
Prevent fault in MSL interpreter
static Image *ReadMSLImage(const ImageInfo *image_info,ExceptionInfo *exception) { Image *image; /* Open image file. */ assert(image_info != (const ImageInfo *) NULL); assert(image_info->signature == MagickSignature); if (image_info->debug != MagickFalse) (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s", image_info->filename); assert(exception != (ExceptionInfo *) NULL); assert(exception->signature == MagickSignature); image=(Image *) NULL; (void) ProcessMSLScript(image_info,&image,exception); return(GetFirstImageInList(image)); }
static Image *ReadMSLImage(const ImageInfo *image_info,ExceptionInfo *exception) { Image *image; /* Open image file. */ assert(image_info != (const ImageInfo *) NULL); assert(image_info->signature == MagickSignature); if (image_info->debug != MagickFalse) (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s", image_info->filename); assert(exception != (ExceptionInfo *) NULL); assert(exception->signature == MagickSignature); image=(Image *) NULL; (void) ProcessMSLScript(image_info,&image,exception); return(GetFirstImageInList(image)); }
C
ImageMagick
0
CVE-2018-18352
https://www.cvedetails.com/cve/CVE-2018-18352/
CWE-732
https://github.com/chromium/chromium/commit/a9cbaa7a40e2b2723cfc2f266c42f4980038a949
a9cbaa7a40e2b2723cfc2f266c42f4980038a949
Simplify "WouldTaintOrigin" concept in media/blink Currently WebMediaPlayer has three predicates: - DidGetOpaqueResponseFromServiceWorker - HasSingleSecurityOrigin - DidPassCORSAccessCheck . These are used to determine whether the response body is available for scripts. They are known to be confusing, and actually MediaElementAudioSourceHandler::WouldTaintOrigin misuses them. This CL merges the three predicates to one, WouldTaintOrigin, to remove the confusion. Now the "response type" concept is available and we don't need a custom CORS check, so this CL removes BaseAudioContext::WouldTaintOrigin. This CL also renames URLData::has_opaque_data_ and its (direct and indirect) data accessors to match the spec. Bug: 849942, 875153 Change-Id: I6acf50169d7445c4ff614e80ac606f79ee577d2a Reviewed-on: https://chromium-review.googlesource.com/c/1238098 Reviewed-by: Fredrik Hubinette <hubbe@chromium.org> Reviewed-by: Kinuko Yasuda <kinuko@chromium.org> Reviewed-by: Raymond Toy <rtoy@chromium.org> Commit-Queue: Yutaka Hirano <yhirano@chromium.org> Cr-Commit-Position: refs/heads/master@{#598258}
double HTMLMediaElement::playbackRate() const { return playback_rate_; }
double HTMLMediaElement::playbackRate() const { return playback_rate_; }
C
Chrome
0
CVE-2017-8284
https://www.cvedetails.com/cve/CVE-2017-8284/
CWE-94
https://github.com/qemu/qemu/commit/30663fd26c0307e414622c7a8607fbc04f92ec14
30663fd26c0307e414622c7a8607fbc04f92ec14
tcg/i386: Check the size of instruction being translated This fixes the bug: 'user-to-root privesc inside VM via bad translation caching' reported by Jann Horn here: https://bugs.chromium.org/p/project-zero/issues/detail?id=1122 Reviewed-by: Richard Henderson <rth@twiddle.net> CC: Peter Maydell <peter.maydell@linaro.org> CC: Paolo Bonzini <pbonzini@redhat.com> Reported-by: Jann Horn <jannh@google.com> Signed-off-by: Pranith Kumar <bobby.prani@gmail.com> Message-Id: <20170323175851.14342-1-bobby.prani@gmail.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
static void gen_lea_v_seg(DisasContext *s, TCGMemOp aflag, TCGv a0, int def_seg, int ovr_seg) { switch (aflag) { #ifdef TARGET_X86_64 case MO_64: if (ovr_seg < 0) { tcg_gen_mov_tl(cpu_A0, a0); return; } break; #endif case MO_32: /* 32 bit address */ if (ovr_seg < 0 && s->addseg) { ovr_seg = def_seg; } if (ovr_seg < 0) { tcg_gen_ext32u_tl(cpu_A0, a0); return; } break; case MO_16: /* 16 bit address */ tcg_gen_ext16u_tl(cpu_A0, a0); a0 = cpu_A0; if (ovr_seg < 0) { if (s->addseg) { ovr_seg = def_seg; } else { return; } } break; default: tcg_abort(); } if (ovr_seg >= 0) { TCGv seg = cpu_seg_base[ovr_seg]; if (aflag == MO_64) { tcg_gen_add_tl(cpu_A0, a0, seg); } else if (CODE64(s)) { tcg_gen_ext32u_tl(cpu_A0, a0); tcg_gen_add_tl(cpu_A0, cpu_A0, seg); } else { tcg_gen_add_tl(cpu_A0, a0, seg); tcg_gen_ext32u_tl(cpu_A0, cpu_A0); } } }
static void gen_lea_v_seg(DisasContext *s, TCGMemOp aflag, TCGv a0, int def_seg, int ovr_seg) { switch (aflag) { #ifdef TARGET_X86_64 case MO_64: if (ovr_seg < 0) { tcg_gen_mov_tl(cpu_A0, a0); return; } break; #endif case MO_32: /* 32 bit address */ if (ovr_seg < 0 && s->addseg) { ovr_seg = def_seg; } if (ovr_seg < 0) { tcg_gen_ext32u_tl(cpu_A0, a0); return; } break; case MO_16: /* 16 bit address */ tcg_gen_ext16u_tl(cpu_A0, a0); a0 = cpu_A0; if (ovr_seg < 0) { if (s->addseg) { ovr_seg = def_seg; } else { return; } } break; default: tcg_abort(); } if (ovr_seg >= 0) { TCGv seg = cpu_seg_base[ovr_seg]; if (aflag == MO_64) { tcg_gen_add_tl(cpu_A0, a0, seg); } else if (CODE64(s)) { tcg_gen_ext32u_tl(cpu_A0, a0); tcg_gen_add_tl(cpu_A0, cpu_A0, seg); } else { tcg_gen_add_tl(cpu_A0, a0, seg); tcg_gen_ext32u_tl(cpu_A0, cpu_A0); } } }
C
qemu
0
CVE-2018-18690
https://www.cvedetails.com/cve/CVE-2018-18690/
CWE-754
https://github.com/torvalds/linux/commit/7b38460dc8e4eafba06c78f8e37099d3b34d473c
7b38460dc8e4eafba06c78f8e37099d3b34d473c
xfs: don't fail when converting shortform attr to long form during ATTR_REPLACE Kanda Motohiro reported that expanding a tiny xattr into a large xattr fails on XFS because we remove the tiny xattr from a shortform fork and then try to re-add it after converting the fork to extents format having not removed the ATTR_REPLACE flag. This fails because the attr is no longer present, causing a fs shutdown. This is derived from the patch in his bug report, but we really shouldn't ignore a nonzero retval from the remove call. Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=199119 Reported-by: kanda.motohiro@gmail.com Reviewed-by: Dave Chinner <dchinner@redhat.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
xfs_attr_shortform_addname(xfs_da_args_t *args) { int newsize, forkoff, retval; trace_xfs_attr_sf_addname(args); retval = xfs_attr_shortform_lookup(args); if ((args->flags & ATTR_REPLACE) && (retval == -ENOATTR)) { return retval; } else if (retval == -EEXIST) { if (args->flags & ATTR_CREATE) return retval; retval = xfs_attr_shortform_remove(args); if (retval) return retval; /* * Since we have removed the old attr, clear ATTR_REPLACE so * that the leaf format add routine won't trip over the attr * not being around. */ args->flags &= ~ATTR_REPLACE; } if (args->namelen >= XFS_ATTR_SF_ENTSIZE_MAX || args->valuelen >= XFS_ATTR_SF_ENTSIZE_MAX) return -ENOSPC; newsize = XFS_ATTR_SF_TOTSIZE(args->dp); newsize += XFS_ATTR_SF_ENTSIZE_BYNAME(args->namelen, args->valuelen); forkoff = xfs_attr_shortform_bytesfit(args->dp, newsize); if (!forkoff) return -ENOSPC; xfs_attr_shortform_add(args, forkoff); return 0; }
xfs_attr_shortform_addname(xfs_da_args_t *args) { int newsize, forkoff, retval; trace_xfs_attr_sf_addname(args); retval = xfs_attr_shortform_lookup(args); if ((args->flags & ATTR_REPLACE) && (retval == -ENOATTR)) { return retval; } else if (retval == -EEXIST) { if (args->flags & ATTR_CREATE) return retval; retval = xfs_attr_shortform_remove(args); ASSERT(retval == 0); } if (args->namelen >= XFS_ATTR_SF_ENTSIZE_MAX || args->valuelen >= XFS_ATTR_SF_ENTSIZE_MAX) return -ENOSPC; newsize = XFS_ATTR_SF_TOTSIZE(args->dp); newsize += XFS_ATTR_SF_ENTSIZE_BYNAME(args->namelen, args->valuelen); forkoff = xfs_attr_shortform_bytesfit(args->dp, newsize); if (!forkoff) return -ENOSPC; xfs_attr_shortform_add(args, forkoff); return 0; }
C
linux
1
null
null
null
https://github.com/chromium/chromium/commit/a0af50481db56aa780942e8595a20c36b2c34f5c
a0af50481db56aa780942e8595a20c36b2c34f5c
Build fix following bug #30696. Patch by Gavin Barraclough <barraclough@apple.com> on 2009-10-22 Reviewed by NOBODY (build fix). * WebCoreSupport/FrameLoaderClientGtk.cpp: (WebKit::FrameLoaderClient::windowObjectCleared): * webkit/webkitwebframe.cpp: (webkit_web_frame_get_global_context): git-svn-id: svn://svn.chromium.org/blink/trunk@49964 bbb929c8-8fbe-4397-9dbb-9b2b20218538
void FrameLoaderClient::dispatchDidChangeLocationWithinPage() { WebKitWebFramePrivate* priv = m_frame->priv; g_free(priv->uri); priv->uri = g_strdup(core(m_frame)->loader()->url().prettyURL().utf8().data()); g_object_notify(G_OBJECT(m_frame), "uri"); WebKitWebView* webView = getViewFromFrame(m_frame); if (m_frame == webkit_web_view_get_main_frame(webView)) g_object_notify(G_OBJECT(webView), "uri"); }
void FrameLoaderClient::dispatchDidChangeLocationWithinPage() { WebKitWebFramePrivate* priv = m_frame->priv; g_free(priv->uri); priv->uri = g_strdup(core(m_frame)->loader()->url().prettyURL().utf8().data()); g_object_notify(G_OBJECT(m_frame), "uri"); WebKitWebView* webView = getViewFromFrame(m_frame); if (m_frame == webkit_web_view_get_main_frame(webView)) g_object_notify(G_OBJECT(webView), "uri"); }
C
Chrome
0
CVE-2018-20784
https://www.cvedetails.com/cve/CVE-2018-20784/
CWE-400
https://github.com/torvalds/linux/commit/c40f7d74c741a907cfaeb73a7697081881c497d0
c40f7d74c741a907cfaeb73a7697081881c497d0
sched/fair: Fix infinite loop in update_blocked_averages() by reverting a9e7f6544b9c Zhipeng Xie, Xie XiuQi and Sargun Dhillon reported lockups in the scheduler under high loads, starting at around the v4.18 time frame, and Zhipeng Xie tracked it down to bugs in the rq->leaf_cfs_rq_list manipulation. Do a (manual) revert of: a9e7f6544b9c ("sched/fair: Fix O(nr_cgroups) in load balance path") It turns out that the list_del_leaf_cfs_rq() introduced by this commit is a surprising property that was not considered in followup commits such as: 9c2791f936ef ("sched/fair: Fix hierarchical order in rq->leaf_cfs_rq_list") As Vincent Guittot explains: "I think that there is a bigger problem with commit a9e7f6544b9c and cfs_rq throttling: Let take the example of the following topology TG2 --> TG1 --> root: 1) The 1st time a task is enqueued, we will add TG2 cfs_rq then TG1 cfs_rq to leaf_cfs_rq_list and we are sure to do the whole branch in one path because it has never been used and can't be throttled so tmp_alone_branch will point to leaf_cfs_rq_list at the end. 2) Then TG1 is throttled 3) and we add TG3 as a new child of TG1. 4) The 1st enqueue of a task on TG3 will add TG3 cfs_rq just before TG1 cfs_rq and tmp_alone_branch will stay on rq->leaf_cfs_rq_list. With commit a9e7f6544b9c, we can del a cfs_rq from rq->leaf_cfs_rq_list. So if the load of TG1 cfs_rq becomes NULL before step 2) above, TG1 cfs_rq is removed from the list. Then at step 4), TG3 cfs_rq is added at the beginning of rq->leaf_cfs_rq_list but tmp_alone_branch still points to TG3 cfs_rq because its throttled parent can't be enqueued when the lock is released. tmp_alone_branch doesn't point to rq->leaf_cfs_rq_list whereas it should. So if TG3 cfs_rq is removed or destroyed before tmp_alone_branch points on another TG cfs_rq, the next TG cfs_rq that will be added, will be linked outside rq->leaf_cfs_rq_list - which is bad. In addition, we can break the ordering of the cfs_rq in rq->leaf_cfs_rq_list but this ordering is used to update and propagate the update from leaf down to root." Instead of trying to work through all these cases and trying to reproduce the very high loads that produced the lockup to begin with, simplify the code temporarily by reverting a9e7f6544b9c - which change was clearly not thought through completely. This (hopefully) gives us a kernel that doesn't lock up so people can continue to enjoy their holidays without worrying about regressions. ;-) [ mingo: Wrote changelog, fixed weird spelling in code comment while at it. ] Analyzed-by: Xie XiuQi <xiexiuqi@huawei.com> Analyzed-by: Vincent Guittot <vincent.guittot@linaro.org> Reported-by: Zhipeng Xie <xiezhipeng1@huawei.com> Reported-by: Sargun Dhillon <sargun@sargun.me> Reported-by: Xie XiuQi <xiexiuqi@huawei.com> Tested-by: Zhipeng Xie <xiezhipeng1@huawei.com> Tested-by: Sargun Dhillon <sargun@sargun.me> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Acked-by: Vincent Guittot <vincent.guittot@linaro.org> Cc: <stable@vger.kernel.org> # v4.13+ Cc: Bin Li <huawei.libin@huawei.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Tejun Heo <tj@kernel.org> Cc: Thomas Gleixner <tglx@linutronix.de> Fixes: a9e7f6544b9c ("sched/fair: Fix O(nr_cgroups) in load balance path") Link: http://lkml.kernel.org/r/1545879866-27809-1-git-send-email-xiexiuqi@huawei.com Signed-off-by: Ingo Molnar <mingo@kernel.org>
static inline unsigned long task_util_est(struct task_struct *p) { return max(task_util(p), _task_util_est(p)); }
static inline unsigned long task_util_est(struct task_struct *p) { return max(task_util(p), _task_util_est(p)); }
C
linux
0
CVE-2013-0217
https://www.cvedetails.com/cve/CVE-2013-0217/
CWE-399
https://github.com/torvalds/linux/commit/7d5145d8eb2b9791533ffe4dc003b129b9696c48
7d5145d8eb2b9791533ffe4dc003b129b9696c48
xen/netback: don't leak pages on failure in xen_netbk_tx_check_gop. Signed-off-by: Matthew Daley <mattjd@gmail.com> Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> Acked-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Jan Beulich <JBeulich@suse.com> Signed-off-by: David S. Miller <davem@davemloft.net>
void xen_netbk_queue_tx_skb(struct xenvif *vif, struct sk_buff *skb) { struct xen_netbk *netbk = vif->netbk; skb_queue_tail(&netbk->rx_queue, skb); xen_netbk_kick_thread(netbk); }
void xen_netbk_queue_tx_skb(struct xenvif *vif, struct sk_buff *skb) { struct xen_netbk *netbk = vif->netbk; skb_queue_tail(&netbk->rx_queue, skb); xen_netbk_kick_thread(netbk); }
C
linux
0
CVE-2013-6381
https://www.cvedetails.com/cve/CVE-2013-6381/
CWE-119
https://github.com/torvalds/linux/commit/6fb392b1a63ae36c31f62bc3fc8630b49d602b62
6fb392b1a63ae36c31f62bc3fc8630b49d602b62
qeth: avoid buffer overflow in snmp ioctl Check user-defined length in snmp ioctl request and allow request only if it fits into a qeth command buffer. Signed-off-by: Ursula Braun <ursula.braun@de.ibm.com> Signed-off-by: Frank Blaschka <frank.blaschka@de.ibm.com> Reviewed-by: Heiko Carstens <heicars2@linux.vnet.ibm.com> Reported-by: Nico Golde <nico@ngolde.de> Reported-by: Fabian Yamaguchi <fabs@goesec.de> Cc: <stable@vger.kernel.org> Signed-off-by: David S. Miller <davem@davemloft.net>
void qeth_qdio_input_handler(struct ccw_device *ccwdev, unsigned int qdio_err, unsigned int queue, int first_elem, int count, unsigned long card_ptr) { struct qeth_card *card = (struct qeth_card *)card_ptr; QETH_CARD_TEXT_(card, 2, "qihq%d", queue); QETH_CARD_TEXT_(card, 2, "qiec%d", qdio_err); if (qeth_is_cq(card, queue)) qeth_qdio_cq_handler(card, qdio_err, queue, first_elem, count); else if (qdio_err) qeth_schedule_recovery(card); }
void qeth_qdio_input_handler(struct ccw_device *ccwdev, unsigned int qdio_err, unsigned int queue, int first_elem, int count, unsigned long card_ptr) { struct qeth_card *card = (struct qeth_card *)card_ptr; QETH_CARD_TEXT_(card, 2, "qihq%d", queue); QETH_CARD_TEXT_(card, 2, "qiec%d", qdio_err); if (qeth_is_cq(card, queue)) qeth_qdio_cq_handler(card, qdio_err, queue, first_elem, count); else if (qdio_err) qeth_schedule_recovery(card); }
C
linux
0