CVE ID
stringlengths
13
43
CVE Page
stringlengths
45
48
CWE ID
stringclasses
90 values
codeLink
stringlengths
46
139
commit_id
stringlengths
6
81
commit_message
stringlengths
3
13.3k
func_after
stringlengths
14
241k
func_before
stringlengths
14
241k
lang
stringclasses
3 values
project
stringclasses
309 values
vul
int8
0
1
CVE-2016-5696
https://www.cvedetails.com/cve/CVE-2016-5696/
CWE-200
https://github.com/torvalds/linux/commit/75ff39ccc1bd5d3c455b6822ab09e533c551f758
75ff39ccc1bd5d3c455b6822ab09e533c551f758
tcp: make challenge acks less predictable Yue Cao claims that current host rate limiting of challenge ACKS (RFC 5961) could leak enough information to allow a patient attacker to hijack TCP sessions. He will soon provide details in an academic paper. This patch increases the default limit from 100 to 1000, and adds some randomization so that the attacker can no longer hijack sessions without spending a considerable amount of probes. Based on initial analysis and patch from Linus. Note that we also have per socket rate limiting, so it is tempting to remove the host limit in the future. v2: randomize the count of challenge acks per second, not the period. Fixes: 282f23c6ee34 ("tcp: implement RFC 5961 3.2") Reported-by: Yue Cao <[email protected]> Signed-off-by: Eric Dumazet <[email protected]> Suggested-by: Linus Torvalds <[email protected]> Cc: Yuchung Cheng <[email protected]> Cc: Neal Cardwell <[email protected]> Acked-by: Neal Cardwell <[email protected]> Acked-by: Yuchung Cheng <[email protected]> Signed-off-by: David S. Miller <[email protected]>
static void tcp_ecn_accept_cwr(struct tcp_sock *tp, const struct sk_buff *skb) { if (tcp_hdr(skb)->cwr) tp->ecn_flags &= ~TCP_ECN_DEMAND_CWR; }
static void tcp_ecn_accept_cwr(struct tcp_sock *tp, const struct sk_buff *skb) { if (tcp_hdr(skb)->cwr) tp->ecn_flags &= ~TCP_ECN_DEMAND_CWR; }
C
linux
0
CVE-2011-2858
https://www.cvedetails.com/cve/CVE-2011-2858/
CWE-119
https://github.com/chromium/chromium/commit/c13e1da62b5f5f0e6fe8c1f769a5a28415415244
c13e1da62b5f5f0e6fe8c1f769a5a28415415244
Revert "Revert 100494 - Fix bug in SimulateAttrib0.""" TEST=none BUG=95625 [email protected] Review URL: http://codereview.chromium.org/7796016 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@100507 0039d316-1c4b-4281-b951-d872f2087c98
void GLES2DecoderImpl::DoBindRenderbuffer(GLenum target, GLuint client_id) { RenderbufferManager::RenderbufferInfo* info = NULL; GLuint service_id = 0; if (client_id != 0) { info = GetRenderbufferInfo(client_id); if (!info) { if (!group_->bind_generates_resource()) { SetGLError( GL_INVALID_VALUE, "glBindRenderbuffer: id not generated by glGenRenderbuffers"); return; } glGenRenderbuffersEXT(1, &service_id); CreateRenderbufferInfo(client_id, service_id); info = GetRenderbufferInfo(client_id); IdAllocatorInterface* id_allocator = group_->GetIdAllocator(id_namespaces::kRenderbuffers); id_allocator->MarkAsUsed(client_id); } else { service_id = info->service_id(); } info->MarkAsValid(); } bound_renderbuffer_ = info; glBindRenderbufferEXT(target, service_id); }
void GLES2DecoderImpl::DoBindRenderbuffer(GLenum target, GLuint client_id) { RenderbufferManager::RenderbufferInfo* info = NULL; GLuint service_id = 0; if (client_id != 0) { info = GetRenderbufferInfo(client_id); if (!info) { if (!group_->bind_generates_resource()) { SetGLError( GL_INVALID_VALUE, "glBindRenderbuffer: id not generated by glGenRenderbuffers"); return; } glGenRenderbuffersEXT(1, &service_id); CreateRenderbufferInfo(client_id, service_id); info = GetRenderbufferInfo(client_id); IdAllocatorInterface* id_allocator = group_->GetIdAllocator(id_namespaces::kRenderbuffers); id_allocator->MarkAsUsed(client_id); } else { service_id = info->service_id(); } info->MarkAsValid(); } bound_renderbuffer_ = info; glBindRenderbufferEXT(target, service_id); }
C
Chrome
0
CVE-2013-0836
https://www.cvedetails.com/cve/CVE-2013-0836/
CWE-399
https://github.com/chromium/chromium/commit/f7038db6ef172459f14b1b67a5155b8dd210be0f
f7038db6ef172459f14b1b67a5155b8dd210be0f
Progressive JPEG outputScanlines() calls should handle failure outputScanlines() can fail and delete |this|, so any attempt to access members thereafter should be avoided. Copy the decoder pointer member, and use that copy to detect and handle the failure case. BUG=232763 [email protected] Review URL: https://codereview.chromium.org/14844003 git-svn-id: svn://svn.chromium.org/blink/trunk@150545 bbb929c8-8fbe-4397-9dbb-9b2b20218538
bool JPEGImageDecoder::outputScanlines(ImageFrame& buffer) { return m_scaled ? outputScanlines<colorSpace, true>(buffer) : outputScanlines<colorSpace, false>(buffer); }
bool JPEGImageDecoder::outputScanlines(ImageFrame& buffer) { return m_scaled ? outputScanlines<colorSpace, true>(buffer) : outputScanlines<colorSpace, false>(buffer); }
C
Chrome
0
CVE-2012-2875
https://www.cvedetails.com/cve/CVE-2012-2875/
null
https://github.com/chromium/chromium/commit/7d97e1d327f153cce6137ef8b533d45d083802d9
7d97e1d327f153cce6137ef8b533d45d083802d9
Refresh promo notifications as they're fetched The "guard" existed for notification scheduling was preventing "turn-off a promo" and "update a promo" scenarios. Yet I do not believe it was adding any actual safety: if things on a server backend go wrong, the clients will be affected one way or the other, and it is better to have an option to shut the malformed promo down "as quickly as possible" (~in 12-24 hours). BUG= TEST= Review URL: https://chromiumcodereview.appspot.com/10696204 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@146462 0039d316-1c4b-4281-b951-d872f2087c98
bool PromoResourceService::CanShowNotificationPromo(Profile* profile) { NotificationPromo notification_promo(profile); notification_promo.InitFromPrefs(); return notification_promo.CanShow(); }
bool PromoResourceService::CanShowNotificationPromo(Profile* profile) { NotificationPromo notification_promo(profile); notification_promo.InitFromPrefs(); return notification_promo.CanShow(); }
C
Chrome
0
CVE-2010-1149
https://www.cvedetails.com/cve/CVE-2010-1149/
CWE-200
https://cgit.freedesktop.org/udisks/commit/?id=0fcc7cb3b66f23fac53ae08647aa0007a2bd56c4
0fcc7cb3b66f23fac53ae08647aa0007a2bd56c4
null
filesystem_create_create_luks_device_completed_cb (DBusGMethodInvocation *context, Device *device, gboolean job_was_cancelled, int status, const char *stderr, const char *stdout, gpointer user_data) { MkfsLuksData *data = user_data; /* poke the kernel so we can reread the data (new uuid etc.) */ device_generate_kernel_change_event (device); if (WEXITSTATUS (status) == 0 && !job_was_cancelled) { /* OK! So we've got ourselves an luks device. Let's set it up so we can create a file * system. Sit and wait for the change event to appear so we can setup with the right UUID. */ data->device_changed_signal_handler_id = g_signal_connect_after (device->priv->daemon, "device-changed", (GCallback) filesystem_create_wait_for_luks_device_changed_cb, mkfse_data_ref (data)); /* set up timeout for error reporting if waiting failed * * (the signal handler and the timeout handler share the ref to data * as one will cancel the other) */ data->device_changed_timeout_id = g_timeout_add (10 * 1000, filesystem_create_wait_for_luks_device_not_seen_cb, data); } else { if (job_was_cancelled) { throw_error (context, ERROR_CANCELLED, "Job was cancelled"); } else { throw_error (context, ERROR_FAILED, "Error creating file system: cryptsetup exited with exit code %d: %s", WEXITSTATUS (status), stderr); } } }
filesystem_create_create_luks_device_completed_cb (DBusGMethodInvocation *context, Device *device, gboolean job_was_cancelled, int status, const char *stderr, const char *stdout, gpointer user_data) { MkfsLuksData *data = user_data; /* poke the kernel so we can reread the data (new uuid etc.) */ device_generate_kernel_change_event (device); if (WEXITSTATUS (status) == 0 && !job_was_cancelled) { /* OK! So we've got ourselves an luks device. Let's set it up so we can create a file * system. Sit and wait for the change event to appear so we can setup with the right UUID. */ data->device_changed_signal_handler_id = g_signal_connect_after (device->priv->daemon, "device-changed", (GCallback) filesystem_create_wait_for_luks_device_changed_cb, mkfse_data_ref (data)); /* set up timeout for error reporting if waiting failed * * (the signal handler and the timeout handler share the ref to data * as one will cancel the other) */ data->device_changed_timeout_id = g_timeout_add (10 * 1000, filesystem_create_wait_for_luks_device_not_seen_cb, data); } else { if (job_was_cancelled) { throw_error (context, ERROR_CANCELLED, "Job was cancelled"); } else { throw_error (context, ERROR_FAILED, "Error creating file system: cryptsetup exited with exit code %d: %s", WEXITSTATUS (status), stderr); } } }
C
udisks
0
CVE-2015-1300
https://www.cvedetails.com/cve/CVE-2015-1300/
CWE-254
https://github.com/chromium/chromium/commit/9c391ac04f9ac478c8b0e43b359c2b43a6c892ab
9c391ac04f9ac478c8b0e43b359c2b43a6c892ab
Use pdf compositor service for printing when OOPIF is enabled When OOPIF is enabled (by site-per-process flag or top-document-isolation feature), use the pdf compositor service for converting PaintRecord to PDF on renderers. In the future, this will make compositing PDF from multiple renderers possible. [email protected] BUG=455764 Change-Id: I3c28f03f4358e4228239fe1a33384f85e7716e8f Reviewed-on: https://chromium-review.googlesource.com/699765 Commit-Queue: Wei Li <[email protected]> Reviewed-by: Daniel Cheng <[email protected]> Reviewed-by: Lei Zhang <[email protected]> Cr-Commit-Position: refs/heads/master@{#511616}
bool HeadlessWebContentsImpl::OpenURL(const GURL& url) { if (!url.is_valid()) return false; content::NavigationController::LoadURLParams params(url); params.transition_type = ui::PageTransitionFromInt( ui::PAGE_TRANSITION_TYPED | ui::PAGE_TRANSITION_FROM_ADDRESS_BAR); web_contents_->GetController().LoadURLWithParams(params); web_contents_delegate_->ActivateContents(web_contents_.get()); web_contents_->Focus(); return true; }
bool HeadlessWebContentsImpl::OpenURL(const GURL& url) { if (!url.is_valid()) return false; content::NavigationController::LoadURLParams params(url); params.transition_type = ui::PageTransitionFromInt( ui::PAGE_TRANSITION_TYPED | ui::PAGE_TRANSITION_FROM_ADDRESS_BAR); web_contents_->GetController().LoadURLWithParams(params); web_contents_delegate_->ActivateContents(web_contents_.get()); web_contents_->Focus(); return true; }
C
Chrome
0
CVE-2019-13045
https://www.cvedetails.com/cve/CVE-2019-13045/
CWE-416
https://github.com/irssi/irssi/commit/d23b0d22cc611e43c88d99192a59f413f951a955
d23b0d22cc611e43c88d99192a59f413f951a955
Merge pull request #1058 from ailin-nemui/sasl-reconnect copy sasl username and password values
static void init_userinfo(void) { unsigned int changed; const char *set, *nick, *user_name, *str; changed = 0; /* check if nick/username/realname wasn't read from setup.. */ set = settings_get_str("real_name"); if (set == NULL || *set == '\0') { str = g_getenv("IRCNAME"); settings_set_str("real_name", str != NULL ? str : g_get_real_name()); changed |= USER_SETTINGS_REAL_NAME; } /* username */ user_name = settings_get_str("user_name"); if (user_name == NULL || *user_name == '\0') { str = g_getenv("IRCUSER"); settings_set_str("user_name", str != NULL ? str : g_get_user_name()); user_name = settings_get_str("user_name"); changed |= USER_SETTINGS_USER_NAME; } /* nick */ nick = settings_get_str("nick"); if (nick == NULL || *nick == '\0') { str = g_getenv("IRCNICK"); settings_set_str("nick", str != NULL ? str : user_name); nick = settings_get_str("nick"); changed |= USER_SETTINGS_NICK; } /* host name */ set = settings_get_str("hostname"); if (set == NULL || *set == '\0') { str = g_getenv("IRCHOST"); if (str != NULL) { settings_set_str("hostname", str); changed |= USER_SETTINGS_HOSTNAME; } } signal_emit("irssi init userinfo changed", 1, GUINT_TO_POINTER(changed)); }
static void init_userinfo(void) { unsigned int changed; const char *set, *nick, *user_name, *str; changed = 0; /* check if nick/username/realname wasn't read from setup.. */ set = settings_get_str("real_name"); if (set == NULL || *set == '\0') { str = g_getenv("IRCNAME"); settings_set_str("real_name", str != NULL ? str : g_get_real_name()); changed |= USER_SETTINGS_REAL_NAME; } /* username */ user_name = settings_get_str("user_name"); if (user_name == NULL || *user_name == '\0') { str = g_getenv("IRCUSER"); settings_set_str("user_name", str != NULL ? str : g_get_user_name()); user_name = settings_get_str("user_name"); changed |= USER_SETTINGS_USER_NAME; } /* nick */ nick = settings_get_str("nick"); if (nick == NULL || *nick == '\0') { str = g_getenv("IRCNICK"); settings_set_str("nick", str != NULL ? str : user_name); nick = settings_get_str("nick"); changed |= USER_SETTINGS_NICK; } /* host name */ set = settings_get_str("hostname"); if (set == NULL || *set == '\0') { str = g_getenv("IRCHOST"); if (str != NULL) { settings_set_str("hostname", str); changed |= USER_SETTINGS_HOSTNAME; } } signal_emit("irssi init userinfo changed", 1, GUINT_TO_POINTER(changed)); }
C
irssi
0
CVE-2016-3910
https://www.cvedetails.com/cve/CVE-2016-3910/
CWE-264
https://android.googlesource.com/platform/frameworks/av/+/035cb12f392860113dce96116a5150e2fde6f0cc
035cb12f392860113dce96116a5150e2fde6f0cc
soundtrigger: add size check on sound model and recogntion data Bug: 30148546 Change-Id: I082f535a853c96571887eeea37c6d41ecee7d8c0 (cherry picked from commit bb00d8f139ff51336ab3c810d35685003949bcf8) (cherry picked from commit ef0c91518446e65533ca8bab6726a845f27c73fd)
void SoundTriggerHwService::sendSoundModelEvent(struct sound_trigger_model_event *event, Module *module) { AutoMutex lock(mServiceLock); sp<IMemory> eventMemory = prepareSoundModelEvent_l(event); if (eventMemory == 0) { return; } sp<Module> strongModule; for (size_t i = 0; i < mModules.size(); i++) { if (mModules.valueAt(i).get() == module) { strongModule = mModules.valueAt(i); break; } } if (strongModule == 0) { return; } sendCallbackEvent_l(new CallbackEvent(CallbackEvent::TYPE_SOUNDMODEL, eventMemory, strongModule)); }
void SoundTriggerHwService::sendSoundModelEvent(struct sound_trigger_model_event *event, Module *module) { AutoMutex lock(mServiceLock); sp<IMemory> eventMemory = prepareSoundModelEvent_l(event); if (eventMemory == 0) { return; } sp<Module> strongModule; for (size_t i = 0; i < mModules.size(); i++) { if (mModules.valueAt(i).get() == module) { strongModule = mModules.valueAt(i); break; } } if (strongModule == 0) { return; } sendCallbackEvent_l(new CallbackEvent(CallbackEvent::TYPE_SOUNDMODEL, eventMemory, strongModule)); }
C
Android
0
null
null
null
https://github.com/chromium/chromium/commit/3b7ff00418c0e7593d42e5648ba39397e23fe2f9
3b7ff00418c0e7593d42e5648ba39397e23fe2f9
sync: ensure sync init path doesn't block on CheckTime The call to RequestEarlyExit (which calls Abort) only happens if the SyncBackendHost has received the initialization callback from the SyncManager. But during init, the SyncManager could make a call to CheckTime, meaning that call would never be aborted. This patch makes sure to cover that case. BUG=93829 TEST=None at the moment :( Review URL: http://codereview.chromium.org/7862011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@100543 0039d316-1c4b-4281-b951-d872f2087c98
SyncBackendHost::Core::~Core() { DCHECK(!sync_manager_.get()); }
SyncBackendHost::Core::~Core() { DCHECK(!sync_manager_.get()); }
C
Chrome
0
CVE-2016-10507
https://www.cvedetails.com/cve/CVE-2016-10507/
CWE-190
https://github.com/uclouvain/openjpeg/commit/da940424816e11d624362ce080bc026adffa26e8
da940424816e11d624362ce080bc026adffa26e8
Merge pull request #834 from trylab/issue833 Fix issue 833.
static void opj_applyLUT8u_8u32s_C1P3R( OPJ_UINT8 const* pSrc, OPJ_INT32 srcStride, OPJ_INT32* const* pDst, OPJ_INT32 const* pDstStride, OPJ_UINT8 const* const* pLUT, OPJ_UINT32 width, OPJ_UINT32 height) { OPJ_UINT32 y; OPJ_INT32* pR = pDst[0]; OPJ_INT32* pG = pDst[1]; OPJ_INT32* pB = pDst[2]; OPJ_UINT8 const* pLUT_R = pLUT[0]; OPJ_UINT8 const* pLUT_G = pLUT[1]; OPJ_UINT8 const* pLUT_B = pLUT[2]; for (y = height; y != 0U; --y) { OPJ_UINT32 x; for(x = 0; x < width; x++) { OPJ_UINT8 idx = pSrc[x]; pR[x] = (OPJ_INT32)pLUT_R[idx]; pG[x] = (OPJ_INT32)pLUT_G[idx]; pB[x] = (OPJ_INT32)pLUT_B[idx]; } pSrc += srcStride; pR += pDstStride[0]; pG += pDstStride[1]; pB += pDstStride[2]; } }
static void opj_applyLUT8u_8u32s_C1P3R( OPJ_UINT8 const* pSrc, OPJ_INT32 srcStride, OPJ_INT32* const* pDst, OPJ_INT32 const* pDstStride, OPJ_UINT8 const* const* pLUT, OPJ_UINT32 width, OPJ_UINT32 height) { OPJ_UINT32 y; OPJ_INT32* pR = pDst[0]; OPJ_INT32* pG = pDst[1]; OPJ_INT32* pB = pDst[2]; OPJ_UINT8 const* pLUT_R = pLUT[0]; OPJ_UINT8 const* pLUT_G = pLUT[1]; OPJ_UINT8 const* pLUT_B = pLUT[2]; for (y = height; y != 0U; --y) { OPJ_UINT32 x; for(x = 0; x < width; x++) { OPJ_UINT8 idx = pSrc[x]; pR[x] = (OPJ_INT32)pLUT_R[idx]; pG[x] = (OPJ_INT32)pLUT_G[idx]; pB[x] = (OPJ_INT32)pLUT_B[idx]; } pSrc += srcStride; pR += pDstStride[0]; pG += pDstStride[1]; pB += pDstStride[2]; } }
C
openjpeg
0
CVE-2019-5838
https://www.cvedetails.com/cve/CVE-2019-5838/
CWE-20
https://github.com/chromium/chromium/commit/0660e08731fd42076d7242068e9eaed1482b14d5
0660e08731fd42076d7242068e9eaed1482b14d5
Call CanCaptureVisiblePage in page capture API. Currently the pageCapture permission allows access to arbitrary local files and chrome:// pages which can be a security concern. In order to address this, the page capture API needs to be changed similar to the captureVisibleTab API. The API will now only allow extensions to capture otherwise-restricted URLs if the user has granted activeTab. In addition, file:// URLs are only capturable with the "Allow on file URLs" option enabled. Bug: 893087 Change-Id: I6d6225a3efb70fc033e2e1c031c633869afac624 Reviewed-on: https://chromium-review.googlesource.com/c/1330689 Commit-Queue: Bettina Dea <[email protected]> Reviewed-by: Devlin <[email protected]> Reviewed-by: Varun Khaneja <[email protected]> Cr-Commit-Position: refs/heads/master@{#615248}
ActiveTabWithServiceTest() {}
ActiveTabWithServiceTest() {}
C
Chrome
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 <[email protected]> Cc: Michael Cree <[email protected]> Cc: Will Deacon <[email protected]> Cc: Deng-Cheng Zhu <[email protected]> Cc: Anton Blanchard <[email protected]> Cc: Eric B Munson <[email protected]> Cc: Heiko Carstens <[email protected]> Cc: Paul Mundt <[email protected]> Cc: David S. Miller <[email protected]> Cc: Frederic Weisbecker <[email protected]> Cc: Jason Wessel <[email protected]> Cc: Don Zickus <[email protected]> Link: http://lkml.kernel.org/n/[email protected] Signed-off-by: Ingo Molnar <[email protected]>
static void thaw_limited_counters(struct cpu_hw_events *cpuhw, unsigned long pmc5, unsigned long pmc6) { struct perf_event *event; u64 val, prev; int i; for (i = 0; i < cpuhw->n_limited; ++i) { event = cpuhw->limited_counter[i]; event->hw.idx = cpuhw->limited_hwidx[i]; val = (event->hw.idx == 5) ? pmc5 : pmc6; prev = local64_read(&event->hw.prev_count); if (check_and_compute_delta(prev, val)) local64_set(&event->hw.prev_count, val); perf_event_update_userpage(event); } }
static void thaw_limited_counters(struct cpu_hw_events *cpuhw, unsigned long pmc5, unsigned long pmc6) { struct perf_event *event; u64 val, prev; int i; for (i = 0; i < cpuhw->n_limited; ++i) { event = cpuhw->limited_counter[i]; event->hw.idx = cpuhw->limited_hwidx[i]; val = (event->hw.idx == 5) ? pmc5 : pmc6; prev = local64_read(&event->hw.prev_count); if (check_and_compute_delta(prev, val)) local64_set(&event->hw.prev_count, val); perf_event_update_userpage(event); } }
C
linux
0
CVE-2017-11144
https://www.cvedetails.com/cve/CVE-2017-11144/
CWE-754
https://git.php.net/?p=php-src.git;a=commit;h=73cabfedf519298e1a11192699f44d53c529315e
73cabfedf519298e1a11192699f44d53c529315e
null
int DSA_set0_pqg(DSA *d, BIGNUM *p, BIGNUM *q, BIGNUM *g) { d->p = p; d->q = q; d->g = g; return 1; }
int DSA_set0_pqg(DSA *d, BIGNUM *p, BIGNUM *q, BIGNUM *g) { d->p = p; d->q = q; d->g = g; return 1; }
C
php
0
CVE-2013-2879
https://www.cvedetails.com/cve/CVE-2013-2879/
CWE-200
https://github.com/chromium/chromium/commit/afbc71b7a78ac99810a6b22b2b0a2e85dde18794
afbc71b7a78ac99810a6b22b2b0a2e85dde18794
Display confirmation dialog for untrusted signins BUG=252062 Review URL: https://chromiumcodereview.appspot.com/17482002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@208520 0039d316-1c4b-4281-b951-d872f2087c98
content::WebUIDataSource* CreateWebUIDataSource() { content::WebUIDataSource* source = content::WebUIDataSource::Create(chrome::kChromeUIInlineLoginHost); source->SetUseJsonJSFormatV2(); source->SetJsonPath("strings.js"); source->SetDefaultResource(IDR_INLINE_LOGIN_HTML); source->AddResourcePath("inline_login.css", IDR_INLINE_LOGIN_CSS); source->AddResourcePath("inline_login.js", IDR_INLINE_LOGIN_JS); return source; };
content::WebUIDataSource* CreateWebUIDataSource() { content::WebUIDataSource* source = content::WebUIDataSource::Create(chrome::kChromeUIInlineLoginHost); source->SetUseJsonJSFormatV2(); source->SetJsonPath("strings.js"); source->SetDefaultResource(IDR_INLINE_LOGIN_HTML); source->AddResourcePath("inline_login.css", IDR_INLINE_LOGIN_CSS); source->AddResourcePath("inline_login.js", IDR_INLINE_LOGIN_JS); return source; };
C
Chrome
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 void ssh_queue_incoming_data(Ssh ssh, const unsigned char **data, int *datalen) { bufchain_add(&ssh->queued_incoming_data, *data, *datalen); *data += *datalen; *datalen = 0; }
static void ssh_queue_incoming_data(Ssh ssh, const unsigned char **data, int *datalen) { bufchain_add(&ssh->queued_incoming_data, *data, *datalen); *data += *datalen; *datalen = 0; }
C
tartarus
0
CVE-2018-5759
https://www.cvedetails.com/cve/CVE-2018-5759/
CWE-674
http://git.ghostscript.com/?p=mujs.git;a=commit;h=4d45a96e57fbabf00a7378b337d0ddcace6f38c1
4d45a96e57fbabf00a7378b337d0ddcace6f38c1
null
static void jsP_freejumps(js_State *J, js_JumpList *node) { while (node) { js_JumpList *next = node->next; js_free(J, node); node = next; } }
static void jsP_freejumps(js_State *J, js_JumpList *node) { while (node) { js_JumpList *next = node->next; js_free(J, node); node = next; } }
C
ghostscript
0
CVE-2019-17547
https://www.cvedetails.com/cve/CVE-2019-17547/
null
https://github.com/ImageMagick/ImageMagick/commit/ecf7c6b288e11e7e7f75387c5e9e93e423b98397
ecf7c6b288e11e7e7f75387c5e9e93e423b98397
...
MagickExport DrawInfo *AcquireDrawInfo(void) { DrawInfo *draw_info; draw_info=(DrawInfo *) AcquireCriticalMemory(sizeof(*draw_info)); GetDrawInfo((ImageInfo *) NULL,draw_info); return(draw_info); }
MagickExport DrawInfo *AcquireDrawInfo(void) { DrawInfo *draw_info; draw_info=(DrawInfo *) AcquireCriticalMemory(sizeof(*draw_info)); GetDrawInfo((ImageInfo *) NULL,draw_info); return(draw_info); }
C
ImageMagick
0
CVE-2018-18346
https://www.cvedetails.com/cve/CVE-2018-18346/
CWE-20
https://github.com/chromium/chromium/commit/9004be20a4cfde70456579489258c3aca4ed45a4
9004be20a4cfde70456579489258c3aca4ed45a4
Add trace event to sync_sessions::OnReadAllMetadata() It is likely a cause of janks on UI thread on Android. Add a trace event to get metrics about the duration. BUG=902203 Change-Id: I4c4e9c2a20790264b982007ea7ee88ddfa7b972c Reviewed-on: https://chromium-review.googlesource.com/c/1319369 Reviewed-by: Mikel Astiz <[email protected]> Commit-Queue: ssid <[email protected]> Cr-Commit-Position: refs/heads/master@{#606104}
bool SessionStore::StorageKeyMatchesLocalSession( const std::string& storage_key) const { std::string session_tag; int tab_node_id; bool success = DecodeStorageKey(storage_key, &session_tag, &tab_node_id); DCHECK(success); return session_tag == local_session_info_.session_tag; }
bool SessionStore::StorageKeyMatchesLocalSession( const std::string& storage_key) const { std::string session_tag; int tab_node_id; bool success = DecodeStorageKey(storage_key, &session_tag, &tab_node_id); DCHECK(success); return session_tag == local_session_info_.session_tag; }
C
Chrome
0
CVE-2017-6903
https://www.cvedetails.com/cve/CVE-2017-6903/
CWE-269
https://github.com/ioquake/ioq3/commit/b173ac05993f634a42be3d3535e1b158de0c3372
b173ac05993f634a42be3d3535e1b158de0c3372
Merge some file writing extension checks from OpenJK. Thanks Ensiform. https://github.com/JACoders/OpenJK/commit/05928a57f9e4aae15a3bd0 https://github.com/JACoders/OpenJK/commit/ef124fd0fc48af164581176
void Com_ReadFromPipe( void ) { static char buf[MAX_STRING_CHARS]; static int accu = 0; int read; if( !pipefile ) return; while( ( read = FS_Read( buf + accu, sizeof( buf ) - accu - 1, pipefile ) ) > 0 ) { char *brk = NULL; int i; for( i = accu; i < accu + read; ++i ) { if( buf[ i ] == '\0' ) buf[ i ] = '\n'; if( buf[ i ] == '\n' || buf[ i ] == '\r' ) brk = &buf[ i + 1 ]; } buf[ accu + read ] = '\0'; accu += read; if( brk ) { char tmp = *brk; *brk = '\0'; Cbuf_ExecuteText( EXEC_APPEND, buf ); *brk = tmp; accu -= brk - buf; memmove( buf, brk, accu + 1 ); } else if( accu >= sizeof( buf ) - 1 ) // full { Cbuf_ExecuteText( EXEC_APPEND, buf ); accu = 0; } } }
void Com_ReadFromPipe( void ) { static char buf[MAX_STRING_CHARS]; static int accu = 0; int read; if( !pipefile ) return; while( ( read = FS_Read( buf + accu, sizeof( buf ) - accu - 1, pipefile ) ) > 0 ) { char *brk = NULL; int i; for( i = accu; i < accu + read; ++i ) { if( buf[ i ] == '\0' ) buf[ i ] = '\n'; if( buf[ i ] == '\n' || buf[ i ] == '\r' ) brk = &buf[ i + 1 ]; } buf[ accu + read ] = '\0'; accu += read; if( brk ) { char tmp = *brk; *brk = '\0'; Cbuf_ExecuteText( EXEC_APPEND, buf ); *brk = tmp; accu -= brk - buf; memmove( buf, brk, accu + 1 ); } else if( accu >= sizeof( buf ) - 1 ) // full { Cbuf_ExecuteText( EXEC_APPEND, buf ); accu = 0; } } }
C
OpenJK
0
CVE-2015-3836
https://www.cvedetails.com/cve/CVE-2015-3836/
CWE-189
https://android.googlesource.com/platform/external/sonivox/+/e999f077f6ef59d20282f1e04786816a31fb8be6
e999f077f6ef59d20282f1e04786816a31fb8be6
DLS parser: fix wave pool size check. Bug: 21132860. Change-Id: I8ae872ea2cc2e8fec5fa0b7815f0b6b31ce744ff (cherry picked from commit 2d7f8e1be2241e48458f5d3cab5e90be2b07c699)
static void Convert_rgn (SDLS_SYNTHESIZER_DATA *pDLSData, EAS_U16 regionIndex, EAS_U16 artIndex, EAS_U16 waveIndex, S_WSMP_DATA *pWsmp) { S_DLS_REGION *pRgn; /* setup pointers to data structures */ pRgn = &pDLSData->pDLS->pDLSRegions[regionIndex]; /* intiailize indices */ pRgn->wtRegion.artIndex = artIndex; pRgn->wtRegion.waveIndex = waveIndex; /* convert region data */ /*lint -e{704} use shift for performance */ pRgn->wtRegion.gain = (EAS_I16) (pWsmp->gain >> 16); pRgn->wtRegion.loopStart = pWsmp->loopStart; pRgn->wtRegion.loopEnd = (pWsmp->loopStart + pWsmp->loopLength); pRgn->wtRegion.tuning = pWsmp->fineTune -(pWsmp->unityNote * 100) + ConvertSampleRate(pWsmp->sampleRate); if (pWsmp->loopLength != 0) pRgn->wtRegion.region.keyGroupAndFlags |= REGION_FLAG_IS_LOOPED; }
static void Convert_rgn (SDLS_SYNTHESIZER_DATA *pDLSData, EAS_U16 regionIndex, EAS_U16 artIndex, EAS_U16 waveIndex, S_WSMP_DATA *pWsmp) { S_DLS_REGION *pRgn; /* setup pointers to data structures */ pRgn = &pDLSData->pDLS->pDLSRegions[regionIndex]; /* intiailize indices */ pRgn->wtRegion.artIndex = artIndex; pRgn->wtRegion.waveIndex = waveIndex; /* convert region data */ /*lint -e{704} use shift for performance */ pRgn->wtRegion.gain = (EAS_I16) (pWsmp->gain >> 16); pRgn->wtRegion.loopStart = pWsmp->loopStart; pRgn->wtRegion.loopEnd = (pWsmp->loopStart + pWsmp->loopLength); pRgn->wtRegion.tuning = pWsmp->fineTune -(pWsmp->unityNote * 100) + ConvertSampleRate(pWsmp->sampleRate); if (pWsmp->loopLength != 0) pRgn->wtRegion.region.keyGroupAndFlags |= REGION_FLAG_IS_LOOPED; }
C
Android
0
CVE-2019-16994
https://www.cvedetails.com/cve/CVE-2019-16994/
CWE-772
https://github.com/torvalds/linux/commit/07f12b26e21ab359261bf75cfcb424fdc7daeb6d
07f12b26e21ab359261bf75cfcb424fdc7daeb6d
net: sit: fix memory leak in sit_init_net() If register_netdev() is failed to register sitn->fb_tunnel_dev, it will go to err_reg_dev and forget to free netdev(sitn->fb_tunnel_dev). BUG: memory leak unreferenced object 0xffff888378daad00 (size 512): comm "syz-executor.1", pid 4006, jiffies 4295121142 (age 16.115s) hex dump (first 32 bytes): 00 e6 ed c0 83 88 ff ff 00 00 00 00 00 00 00 00 ................ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ backtrace: [<00000000d6dcb63e>] kvmalloc include/linux/mm.h:577 [inline] [<00000000d6dcb63e>] kvzalloc include/linux/mm.h:585 [inline] [<00000000d6dcb63e>] netif_alloc_netdev_queues net/core/dev.c:8380 [inline] [<00000000d6dcb63e>] alloc_netdev_mqs+0x600/0xcc0 net/core/dev.c:8970 [<00000000867e172f>] sit_init_net+0x295/0xa40 net/ipv6/sit.c:1848 [<00000000871019fa>] ops_init+0xad/0x3e0 net/core/net_namespace.c:129 [<00000000319507f6>] setup_net+0x2ba/0x690 net/core/net_namespace.c:314 [<0000000087db4f96>] copy_net_ns+0x1dc/0x330 net/core/net_namespace.c:437 [<0000000057efc651>] create_new_namespaces+0x382/0x730 kernel/nsproxy.c:107 [<00000000676f83de>] copy_namespaces+0x2ed/0x3d0 kernel/nsproxy.c:165 [<0000000030b74bac>] copy_process.part.27+0x231e/0x6db0 kernel/fork.c:1919 [<00000000fff78746>] copy_process kernel/fork.c:1713 [inline] [<00000000fff78746>] _do_fork+0x1bc/0xe90 kernel/fork.c:2224 [<000000001c2e0d1c>] do_syscall_64+0xc8/0x580 arch/x86/entry/common.c:290 [<00000000ec48bd44>] entry_SYSCALL_64_after_hwframe+0x49/0xbe [<0000000039acff8a>] 0xffffffffffffffff Signed-off-by: Mao Wenan <[email protected]> Signed-off-by: David S. Miller <[email protected]>
static int ipip6_changelink(struct net_device *dev, struct nlattr *tb[], struct nlattr *data[], struct netlink_ext_ack *extack) { struct ip_tunnel *t = netdev_priv(dev); struct ip_tunnel_parm p; struct ip_tunnel_encap ipencap; struct net *net = t->net; struct sit_net *sitn = net_generic(net, sit_net_id); #ifdef CONFIG_IPV6_SIT_6RD struct ip_tunnel_6rd ip6rd; #endif __u32 fwmark = t->fwmark; int err; if (dev == sitn->fb_tunnel_dev) return -EINVAL; if (ipip6_netlink_encap_parms(data, &ipencap)) { err = ip_tunnel_encap_setup(t, &ipencap); if (err < 0) return err; } ipip6_netlink_parms(data, &p, &fwmark); if (((dev->flags & IFF_POINTOPOINT) && !p.iph.daddr) || (!(dev->flags & IFF_POINTOPOINT) && p.iph.daddr)) return -EINVAL; t = ipip6_tunnel_locate(net, &p, 0); if (t) { if (t->dev != dev) return -EEXIST; } else t = netdev_priv(dev); ipip6_tunnel_update(t, &p, fwmark); #ifdef CONFIG_IPV6_SIT_6RD if (ipip6_netlink_6rd_parms(data, &ip6rd)) return ipip6_tunnel_update_6rd(t, &ip6rd); #endif return 0; }
static int ipip6_changelink(struct net_device *dev, struct nlattr *tb[], struct nlattr *data[], struct netlink_ext_ack *extack) { struct ip_tunnel *t = netdev_priv(dev); struct ip_tunnel_parm p; struct ip_tunnel_encap ipencap; struct net *net = t->net; struct sit_net *sitn = net_generic(net, sit_net_id); #ifdef CONFIG_IPV6_SIT_6RD struct ip_tunnel_6rd ip6rd; #endif __u32 fwmark = t->fwmark; int err; if (dev == sitn->fb_tunnel_dev) return -EINVAL; if (ipip6_netlink_encap_parms(data, &ipencap)) { err = ip_tunnel_encap_setup(t, &ipencap); if (err < 0) return err; } ipip6_netlink_parms(data, &p, &fwmark); if (((dev->flags & IFF_POINTOPOINT) && !p.iph.daddr) || (!(dev->flags & IFF_POINTOPOINT) && p.iph.daddr)) return -EINVAL; t = ipip6_tunnel_locate(net, &p, 0); if (t) { if (t->dev != dev) return -EEXIST; } else t = netdev_priv(dev); ipip6_tunnel_update(t, &p, fwmark); #ifdef CONFIG_IPV6_SIT_6RD if (ipip6_netlink_6rd_parms(data, &ip6rd)) return ipip6_tunnel_update_6rd(t, &ip6rd); #endif return 0; }
C
linux
0
CVE-2014-9940
https://www.cvedetails.com/cve/CVE-2014-9940/
CWE-416
https://github.com/torvalds/linux/commit/60a2362f769cf549dc466134efe71c8bf9fbaaba
60a2362f769cf549dc466134efe71c8bf9fbaaba
regulator: core: Fix regualtor_ena_gpio_free not to access pin after freeing After freeing pin from regulator_ena_gpio_free, loop can access the pin. So this patch fixes not to access pin after freeing. Signed-off-by: Seung-Woo Kim <[email protected]> Signed-off-by: Mark Brown <[email protected]>
void regulator_unregister_supply_alias(struct device *dev, const char *id) { struct regulator_supply_alias *map; map = regulator_find_supply_alias(dev, id); if (map) { list_del(&map->list); kfree(map); } }
void regulator_unregister_supply_alias(struct device *dev, const char *id) { struct regulator_supply_alias *map; map = regulator_find_supply_alias(dev, id); if (map) { list_del(&map->list); kfree(map); } }
C
linux
0
CVE-2016-5199
https://www.cvedetails.com/cve/CVE-2016-5199/
CWE-119
https://github.com/chromium/chromium/commit/c995d4fe5e96f4d6d4a88b7867279b08e72d2579
c995d4fe5e96f4d6d4a88b7867279b08e72d2579
Move IsDataSaverEnabledByUser to be a static method and use it This method now officially becomes the source of truth that everything in the code base eventually calls into to determine whether or not DataSaver is enabled. Bug: 934399 Change-Id: Iae837b710ace8cc3101188f79d02cbc2d4f0fd93 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1537242 Reviewed-by: Joshua Pawlicki <[email protected]> Reviewed-by: Tarun Bansal <[email protected]> Commit-Queue: Robert Ogden <[email protected]> Cr-Commit-Position: refs/heads/master@{#643948}
OptimizationHintsComponentInstallerPolicy::GetMimeTypes() const { return std::vector<std::string>(); }
OptimizationHintsComponentInstallerPolicy::GetMimeTypes() const { return std::vector<std::string>(); }
C
Chrome
0
CVE-2013-2884
https://www.cvedetails.com/cve/CVE-2013-2884/
CWE-399
https://github.com/chromium/chromium/commit/4ac8bc08e3306f38a5ab3e551aef6ad43753579c
4ac8bc08e3306f38a5ab3e551aef6ad43753579c
Set Attr.ownerDocument in Element#setAttributeNode() Attr objects can move across documents by setAttributeNode(). So It needs to reset ownerDocument through TreeScopeAdoptr::adoptIfNeeded(). BUG=248950 TEST=set-attribute-node-from-iframe.html Review URL: https://chromiumcodereview.appspot.com/17583003 git-svn-id: svn://svn.chromium.org/blink/trunk@152938 bbb929c8-8fbe-4397-9dbb-9b2b20218538
void Element::clearHasPendingResources() { ensureElementRareData()->setHasPendingResources(false); }
void Element::clearHasPendingResources() { ensureElementRareData()->setHasPendingResources(false); }
C
Chrome
0
CVE-2015-1224
https://www.cvedetails.com/cve/CVE-2015-1224/
CWE-17
https://github.com/chromium/chromium/commit/5c6e9372daae557d6857f02888e84363eeff9be9
5c6e9372daae557d6857f02888e84363eeff9be9
Rename MostVisitedSites.MostVisitedURLsObserver to Observer. BUG=677672 Review-Url: https://codereview.chromium.org/2697543002 Cr-Commit-Position: refs/heads/master@{#449958}
void MostVisitedSitesBridge::SetMostVisitedURLsObserver( void MostVisitedSitesBridge::SetObserver( JNIEnv* env, const JavaParamRef<jobject>& obj, const JavaParamRef<jobject>& j_observer, jint num_sites) { java_observer_.reset(new JavaObserver(env, j_observer)); most_visited_->SetMostVisitedURLsObserver(java_observer_.get(), num_sites); }
void MostVisitedSitesBridge::SetMostVisitedURLsObserver( JNIEnv* env, const JavaParamRef<jobject>& obj, const JavaParamRef<jobject>& j_observer, jint num_sites) { java_observer_.reset(new JavaObserver(env, j_observer)); most_visited_->SetMostVisitedURLsObserver(java_observer_.get(), num_sites); }
C
Chrome
1
CVE-2011-2829
https://www.cvedetails.com/cve/CVE-2011-2829/
CWE-189
https://github.com/chromium/chromium/commit/a4b20ed4917f1f6fc83b6375a48e2c3895d43a8a
a4b20ed4917f1f6fc83b6375a48e2c3895d43a8a
Add chromium_code: 1 to surface.gyp and gl.gyp to pick up -Werror. It looks like this was dropped accidentally in http://codereview.chromium.org/6718027 (surface.gyp) and http://codereview.chromium.org/6722026 (gl.gyp) Remove now-redudant code that's implied by chromium_code: 1. Fix the warnings that have crept in since chromium_code: 1 was removed. BUG=none TEST=none Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=91598 Review URL: http://codereview.chromium.org/7227009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@91813 0039d316-1c4b-4281-b951-d872f2087c98
GLenum StubGLCheckFramebufferStatus(GLenum target) { return glCheckFramebufferStatusEXT(target); }
GLenum StubGLCheckFramebufferStatus(GLenum target) { return glCheckFramebufferStatusEXT(target); }
C
Chrome
0
CVE-2016-1639
https://www.cvedetails.com/cve/CVE-2016-1639/
null
https://github.com/chromium/chromium/commit/c66b1fc49870c514b1c1e8b53498153176d7ec2b
c66b1fc49870c514b1c1e8b53498153176d7ec2b
cros: Check initial auth type when showing views login. Bug: 859611 Change-Id: I0298db9bbf4aed6bd40600aef2e1c5794e8cd058 Reviewed-on: https://chromium-review.googlesource.com/1123056 Reviewed-by: Xiaoyin Hu <[email protected]> Commit-Queue: Jacob Dufault <[email protected]> Cr-Commit-Position: refs/heads/master@{#572224}
LoginDisplay* LoginDisplayHostWebUI::GetLoginDisplay() { return login_display_.get(); }
LoginDisplay* LoginDisplayHostWebUI::GetLoginDisplay() { return login_display_.get(); }
C
Chrome
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 <[email protected]> Cc: Michael Cree <[email protected]> Cc: Will Deacon <[email protected]> Cc: Deng-Cheng Zhu <[email protected]> Cc: Anton Blanchard <[email protected]> Cc: Eric B Munson <[email protected]> Cc: Heiko Carstens <[email protected]> Cc: Paul Mundt <[email protected]> Cc: David S. Miller <[email protected]> Cc: Frederic Weisbecker <[email protected]> Cc: Jason Wessel <[email protected]> Cc: Don Zickus <[email protected]> Link: http://lkml.kernel.org/n/[email protected] Signed-off-by: Ingo Molnar <[email protected]>
static int init_sched_domains(const struct cpumask *cpu_map) { int err; arch_update_cpu_topology(); ndoms_cur = 1; doms_cur = alloc_sched_domains(ndoms_cur); if (!doms_cur) doms_cur = &fallback_doms; cpumask_andnot(doms_cur[0], cpu_map, cpu_isolated_map); dattr_cur = NULL; err = build_sched_domains(doms_cur[0], NULL); register_sched_domain_sysctl(); return err; }
static int init_sched_domains(const struct cpumask *cpu_map) { int err; arch_update_cpu_topology(); ndoms_cur = 1; doms_cur = alloc_sched_domains(ndoms_cur); if (!doms_cur) doms_cur = &fallback_doms; cpumask_andnot(doms_cur[0], cpu_map, cpu_isolated_map); dattr_cur = NULL; err = build_sched_domains(doms_cur[0], NULL); register_sched_domain_sysctl(); return err; }
C
linux
0
null
null
null
https://github.com/chromium/chromium/commit/ccd0226c79553e318657d6285c2feacebd105996
ccd0226c79553e318657d6285c2feacebd105996
Don't allow more than one pending print dialog per browser instance. As a future TODO, it might be nice to limit it per-tab instead of per-app. BUG=46575 TEST=manual Review URL: http://codereview.chromium.org/2848011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@50203 0039d316-1c4b-4281-b951-d872f2087c98
void ResourceMessageFilter::DoOnClipboardReadText(Clipboard::Buffer buffer, IPC::Message* reply_msg) { string16 result; GetClipboard()->ReadText(buffer, &result); ViewHostMsg_ClipboardReadText::WriteReplyParams(reply_msg, result); ChromeThread::PostTask( ChromeThread::IO, FROM_HERE, NewRunnableMethod( this, &ResourceMessageFilter::SendDelayedReply, reply_msg)); }
void ResourceMessageFilter::DoOnClipboardReadText(Clipboard::Buffer buffer, IPC::Message* reply_msg) { string16 result; GetClipboard()->ReadText(buffer, &result); ViewHostMsg_ClipboardReadText::WriteReplyParams(reply_msg, result); ChromeThread::PostTask( ChromeThread::IO, FROM_HERE, NewRunnableMethod( this, &ResourceMessageFilter::SendDelayedReply, reply_msg)); }
C
Chrome
0
CVE-2015-3885
https://www.cvedetails.com/cve/CVE-2015-3885/
CWE-189
https://github.com/rawstudio/rawstudio/commit/983bda1f0fa5fa86884381208274198a620f006e
983bda1f0fa5fa86884381208274198a620f006e
Avoid overflow in ljpeg_start().
void CLASS fill_holes (int holes) { int row, col, val[4]; for (row=2; row < height-2; row++) { if (!HOLE(row)) continue; for (col=1; col < width-1; col+=4) { val[0] = BAYER(row-1,col-1); val[1] = BAYER(row-1,col+1); val[2] = BAYER(row+1,col-1); val[3] = BAYER(row+1,col+1); BAYER(row,col) = median4(val); } for (col=2; col < width-2; col+=4) if (HOLE(row-2) || HOLE(row+2)) BAYER(row,col) = (BAYER(row,col-2) + BAYER(row,col+2)) >> 1; else { val[0] = BAYER(row,col-2); val[1] = BAYER(row,col+2); val[2] = BAYER(row-2,col); val[3] = BAYER(row+2,col); BAYER(row,col) = median4(val); } } }
void CLASS fill_holes (int holes) { int row, col, val[4]; for (row=2; row < height-2; row++) { if (!HOLE(row)) continue; for (col=1; col < width-1; col+=4) { val[0] = BAYER(row-1,col-1); val[1] = BAYER(row-1,col+1); val[2] = BAYER(row+1,col-1); val[3] = BAYER(row+1,col+1); BAYER(row,col) = median4(val); } for (col=2; col < width-2; col+=4) if (HOLE(row-2) || HOLE(row+2)) BAYER(row,col) = (BAYER(row,col-2) + BAYER(row,col+2)) >> 1; else { val[0] = BAYER(row,col-2); val[1] = BAYER(row,col+2); val[2] = BAYER(row-2,col); val[3] = BAYER(row+2,col); BAYER(row,col) = median4(val); } } }
C
rawstudio
0
CVE-2017-5104
https://www.cvedetails.com/cve/CVE-2017-5104/
CWE-20
https://github.com/chromium/chromium/commit/adca986a53b31b6da4cb22f8e755f6856daea89a
adca986a53b31b6da4cb22f8e755f6856daea89a
Don't show current RenderWidgetHostView while interstitial is showing. Also moves interstitial page tracking from RenderFrameHostManager to WebContents, since interstitial pages are not frame-specific. This was necessary for subframes to detect if an interstitial page is showing. BUG=729105 TEST=See comment 13 of bug for repro steps CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_site_isolation Review-Url: https://codereview.chromium.org/2938313002 Cr-Commit-Position: refs/heads/master@{#480117}
WebUIImpl* RenderFrameHostManager::GetNavigatingWebUI() const { if (IsBrowserSideNavigationEnabled()) { if (speculative_render_frame_host_) return speculative_render_frame_host_->web_ui(); } else { if (pending_render_frame_host_) return pending_render_frame_host_->web_ui(); } return render_frame_host_->pending_web_ui(); }
WebUIImpl* RenderFrameHostManager::GetNavigatingWebUI() const { if (IsBrowserSideNavigationEnabled()) { if (speculative_render_frame_host_) return speculative_render_frame_host_->web_ui(); } else { if (pending_render_frame_host_) return pending_render_frame_host_->web_ui(); } return render_frame_host_->pending_web_ui(); }
C
Chrome
0
CVE-2012-2895
https://www.cvedetails.com/cve/CVE-2012-2895/
CWE-119
https://github.com/chromium/chromium/commit/16dcd30c215801941d9890859fd79a234128fc3e
16dcd30c215801941d9890859fd79a234128fc3e
Refactors to simplify rename pathway in DownloadFileManager. This is https://chromiumcodereview.appspot.com/10668004 / r144817 (reverted due to CrOS failure) with the completion logic moved to after the auto-opening. The tests that test the auto-opening (for web store install) were waiting for download completion to check install, and hence were failing when completion was moved earlier. Doing this right would probably require another state (OPENED). BUG=123998 BUG-134930 [email protected] Review URL: https://chromiumcodereview.appspot.com/10701040 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@145157 0039d316-1c4b-4281-b951-d872f2087c98
~MockDownloadFileManager() {}
~MockDownloadFileManager() {}
C
Chrome
0
CVE-2017-5061
https://www.cvedetails.com/cve/CVE-2017-5061/
CWE-362
https://github.com/chromium/chromium/commit/5d78b84d39bd34bc9fce9d01c0dcd5a22a330d34
5d78b84d39bd34bc9fce9d01c0dcd5a22a330d34
(Reland) Discard compositor frames from unloaded web content This is a reland of https://codereview.chromium.org/2707243005/ with a small change to fix an uninitialized memory error that fails on MSAN bots. BUG=672847 [email protected], [email protected] CQ_INCLUDE_TRYBOTS=master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_site_isolation Review-Url: https://codereview.chromium.org/2731283003 Cr-Commit-Position: refs/heads/master@{#454954}
static gfx::Vector2dF ScrollNodeWithLocalDelta( ScrollNode* scroll_node, const gfx::Vector2dF& local_delta, float page_scale_factor, LayerTreeImpl* layer_tree_impl) { ScrollTree& scroll_tree = layer_tree_impl->property_trees()->scroll_tree; gfx::ScrollOffset previous_offset = scroll_tree.current_scroll_offset(scroll_node->owning_layer_id); gfx::Vector2dF delta = local_delta; delta.Scale(1.f / page_scale_factor); scroll_tree.ScrollBy(scroll_node, delta, layer_tree_impl); gfx::ScrollOffset scrolled = scroll_tree.current_scroll_offset(scroll_node->owning_layer_id) - previous_offset; gfx::Vector2dF consumed_scroll(scrolled.x(), scrolled.y()); consumed_scroll.Scale(page_scale_factor); return consumed_scroll; }
static gfx::Vector2dF ScrollNodeWithLocalDelta( ScrollNode* scroll_node, const gfx::Vector2dF& local_delta, float page_scale_factor, LayerTreeImpl* layer_tree_impl) { ScrollTree& scroll_tree = layer_tree_impl->property_trees()->scroll_tree; gfx::ScrollOffset previous_offset = scroll_tree.current_scroll_offset(scroll_node->owning_layer_id); gfx::Vector2dF delta = local_delta; delta.Scale(1.f / page_scale_factor); scroll_tree.ScrollBy(scroll_node, delta, layer_tree_impl); gfx::ScrollOffset scrolled = scroll_tree.current_scroll_offset(scroll_node->owning_layer_id) - previous_offset; gfx::Vector2dF consumed_scroll(scrolled.x(), scrolled.y()); consumed_scroll.Scale(page_scale_factor); return consumed_scroll; }
C
Chrome
0
CVE-2013-6623
https://www.cvedetails.com/cve/CVE-2013-6623/
CWE-119
https://github.com/chromium/chromium/commit/9fd9d629fcf836bb0d6210015d33a299cf6bca34
9fd9d629fcf836bb0d6210015d33a299cf6bca34
Make the policy fetch for first time login blocking The CL makes policy fetching for first time login blocking for all users, except the ones that are known to be non-enterprise users. BUG=334584 Review URL: https://codereview.chromium.org/330843002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@282925 0039d316-1c4b-4281-b951-d872f2087c98
Browser* InProcessBrowserTest::CreateBrowserForPopup(Profile* profile) { Browser* browser = new Browser(Browser::CreateParams(Browser::TYPE_POPUP, profile, chrome::GetActiveDesktop())); AddBlankTabAndShow(browser); return browser; }
Browser* InProcessBrowserTest::CreateBrowserForPopup(Profile* profile) { Browser* browser = new Browser(Browser::CreateParams(Browser::TYPE_POPUP, profile, chrome::GetActiveDesktop())); AddBlankTabAndShow(browser); return browser; }
C
Chrome
0
CVE-2018-6053
https://www.cvedetails.com/cve/CVE-2018-6053/
CWE-200
https://github.com/chromium/chromium/commit/6c6888565ff1fde9ef21ef17c27ad4c8304643d2
6c6888565ff1fde9ef21ef17c27ad4c8304643d2
TopSites: Clear thumbnails from the cache when their URLs get removed We already cleared the thumbnails from persistent storage, but they remained in the in-memory cache, so they remained accessible (until the next Chrome restart) even after all browsing data was cleared. Bug: 758169 Change-Id: Id916d22358430a82e6d5043ac04fa463a32f824f Reviewed-on: https://chromium-review.googlesource.com/758640 Commit-Queue: Marc Treib <[email protected]> Reviewed-by: Sylvain Defresne <[email protected]> Cr-Commit-Position: refs/heads/master@{#514861}
bool TopSitesImpl::IsKnownURL(const GURL& url) { return loaded_ && cache_->IsKnownURL(url); }
bool TopSitesImpl::IsKnownURL(const GURL& url) { return loaded_ && cache_->IsKnownURL(url); }
C
Chrome
0
CVE-2017-5012
https://www.cvedetails.com/cve/CVE-2017-5012/
CWE-119
https://github.com/chromium/chromium/commit/5b51043c7c8e7e6b86e68e6d93d95ad24e11cf0e
5b51043c7c8e7e6b86e68e6d93d95ad24e11cf0e
[Payments] Prohibit opening payments UI in background tab. Before this patch, calling PaymentRequest.show() would bring the background window to the foreground, which allows a page to open a pop-under. This patch adds a check for the browser window being active (in foreground) in PaymentRequest.show(). If the window is not active (in background), then PaymentRequest.show() promise is rejected with "AbortError: User cancelled request." No UI is shown in that case. After this patch, calling PaymentRequest.show() does not bring the background window to the foreground, thus preventing opening a pop-under. Bug: 768230 Change-Id: I2b90f9086ceca5ed7b7bdf8045e44d7e99d566d0 Reviewed-on: https://chromium-review.googlesource.com/681843 Reviewed-by: anthonyvd <[email protected]> Commit-Queue: Rouslan Solomakhin <[email protected]> Cr-Commit-Position: refs/heads/master@{#504406}
void ChromePaymentRequestDelegate::CloseDialog() { if (dialog_) { dialog_->CloseDialog(); dialog_ = nullptr; } }
void ChromePaymentRequestDelegate::CloseDialog() { if (dialog_) { dialog_->CloseDialog(); dialog_ = nullptr; } }
C
Chrome
0
CVE-2018-6151
https://www.cvedetails.com/cve/CVE-2018-6151/
CWE-125
https://github.com/chromium/chromium/commit/cbb2c0940d4e3914ccd74f6466ff4cb9e50e0e86
cbb2c0940d4e3914ccd74f6466ff4cb9e50e0e86
Don't downcast DownloadManagerDelegate to ChromeDownloadManagerDelegate. DownloadManager has public SetDelegate method and tests and or other subsystems can install their own implementations of the delegate. Bug: 805905 Change-Id: Iecf1e0aceada0e1048bed1e2d2ceb29ca64295b8 TBR: tests updated to follow the API change. Reviewed-on: https://chromium-review.googlesource.com/894702 Reviewed-by: David Vallet <[email protected]> Reviewed-by: Min Qin <[email protected]> Cr-Commit-Position: refs/heads/master@{#533515}
int DownloadCoreServiceImpl::NonMaliciousDownloadCount() const { if (!download_manager_created_) return 0; return BrowserContext::GetDownloadManager(profile_) ->NonMaliciousInProgressCount(); }
int DownloadCoreServiceImpl::NonMaliciousDownloadCount() const { if (!download_manager_created_) return 0; return BrowserContext::GetDownloadManager(profile_) ->NonMaliciousInProgressCount(); }
C
Chrome
0
null
null
null
https://github.com/chromium/chromium/commit/1161a49d663dd395bd639549c2dfe7324f847938
1161a49d663dd395bd639549c2dfe7324f847938
Don't populate URL data in WebDropData when dragging files. This is considered a potential security issue as well, since it leaks filesystem paths. BUG=332579 Review URL: https://codereview.chromium.org/135633002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@244538 0039d316-1c4b-4281-b951-d872f2087c98
bool IsScrollEndEffectEnabled() { return CommandLine::ForCurrentProcess()->GetSwitchValueASCII( switches::kScrollEndEffect) == "1"; }
bool IsScrollEndEffectEnabled() { return CommandLine::ForCurrentProcess()->GetSwitchValueASCII( switches::kScrollEndEffect) == "1"; }
C
Chrome
0
CVE-2016-7798
https://www.cvedetails.com/cve/CVE-2016-7798/
CWE-310
https://github.com/ruby/openssl/commit/8108e0a6db133f3375608303fdd2083eb5115062
8108e0a6db133f3375608303fdd2083eb5115062
cipher: don't set dummy encryption key in Cipher#initialize Remove the encryption key initialization from Cipher#initialize. This is effectively a revert of r32723 ("Avoid possible SEGV from AES encryption/decryption", 2011-07-28). r32723, which added the key initialization, was a workaround for Ruby Bug #2768. For some certain ciphers, calling EVP_CipherUpdate() before setting an encryption key caused segfault. It was not a problem until OpenSSL implemented GCM mode - the encryption key could be overridden by repeated calls of EVP_CipherInit_ex(). But, it is not the case for AES-GCM ciphers. Setting a key, an IV, a key, in this order causes the IV to be reset to an all-zero IV. The problem of Bug #2768 persists on the current versions of OpenSSL. So, make Cipher#update raise an exception if a key is not yet set by the user. Since encrypting or decrypting without key does not make any sense, this should not break existing applications. Users can still call Cipher#key= and Cipher#iv= multiple times with their own responsibility. Reference: https://bugs.ruby-lang.org/issues/2768 Reference: https://bugs.ruby-lang.org/issues/8221 Reference: https://github.com/ruby/openssl/issues/49
ossl_cipher_new(const EVP_CIPHER *cipher) { VALUE ret; EVP_CIPHER_CTX *ctx; ret = ossl_cipher_alloc(cCipher); AllocCipher(ret, ctx); if (EVP_CipherInit_ex(ctx, cipher, NULL, NULL, NULL, -1) != 1) ossl_raise(eCipherError, NULL); return ret; }
ossl_cipher_new(const EVP_CIPHER *cipher) { VALUE ret; EVP_CIPHER_CTX *ctx; ret = ossl_cipher_alloc(cCipher); AllocCipher(ret, ctx); if (EVP_CipherInit_ex(ctx, cipher, NULL, NULL, NULL, -1) != 1) ossl_raise(eCipherError, NULL); return ret; }
C
openssl
0
CVE-2019-5796
https://www.cvedetails.com/cve/CVE-2019-5796/
CWE-362
https://github.com/chromium/chromium/commit/5bb223676defeba9c44a5ce42460c86e24561e73
5bb223676defeba9c44a5ce42460c86e24561e73
[GuestView] - Introduce MimeHandlerViewAttachHelper This CL is for the most part a mechanical change which extracts almost all the frame-based MimeHandlerView code out of ExtensionsGuestViewMessageFilter. This change both removes the current clutter form EGVMF as well as fixesa race introduced when the frame-based logic was added to EGVMF. The reason for the race was that EGVMF is destroyed on IO thread but all the access to it (for frame-based MHV) are from UI. [email protected],[email protected] Bug: 659750, 896679, 911161, 918861 Change-Id: I6474b870e4d56daa68be03637bb633665d9f9dda Reviewed-on: https://chromium-review.googlesource.com/c/1401451 Commit-Queue: Ehsan Karamad <[email protected]> Reviewed-by: James MacLean <[email protected]> Reviewed-by: Ehsan Karamad <[email protected]> Cr-Commit-Position: refs/heads/master@{#621155}
ChromeContentBrowserClient::GetExtraServiceManifests() { return std::vector<content::ContentBrowserClient::ServiceManifestInfo>({ #if BUILDFLAG(ENABLE_NACL) {nacl::kNaClLoaderServiceName, IDR_NACL_LOADER_MANIFEST}, #if defined(OS_WIN) {nacl::kNaClBrokerServiceName, IDR_NACL_BROKER_MANIFEST}, #endif // defined(OS_WIN) #endif // BUILDFLAG(ENABLE_NACL) #if BUILDFLAG(ENABLE_PRINTING) {printing::mojom::kServiceName, IDR_PDF_COMPOSITOR_MANIFEST}, #endif {chrome::mojom::kRendererServiceName, IDR_CHROME_RENDERER_SERVICE_MANIFEST}, }); }
ChromeContentBrowserClient::GetExtraServiceManifests() { return std::vector<content::ContentBrowserClient::ServiceManifestInfo>({ #if BUILDFLAG(ENABLE_NACL) {nacl::kNaClLoaderServiceName, IDR_NACL_LOADER_MANIFEST}, #if defined(OS_WIN) {nacl::kNaClBrokerServiceName, IDR_NACL_BROKER_MANIFEST}, #endif // defined(OS_WIN) #endif // BUILDFLAG(ENABLE_NACL) #if BUILDFLAG(ENABLE_PRINTING) {printing::mojom::kServiceName, IDR_PDF_COMPOSITOR_MANIFEST}, #endif {chrome::mojom::kRendererServiceName, IDR_CHROME_RENDERER_SERVICE_MANIFEST}, }); }
C
Chrome
0
CVE-2011-2822
https://www.cvedetails.com/cve/CVE-2011-2822/
CWE-20
https://github.com/chromium/chromium/commit/a64c3cf0ab6da24a9a010a45ebe4794422d40c71
a64c3cf0ab6da24a9a010a45ebe4794422d40c71
Be a little more careful whether something is an URL or a file path. BUG=72492 Review URL: http://codereview.chromium.org/7572046 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@95731 0039d316-1c4b-4281-b951-d872f2087c98
static void FixupPort(const std::string& text, const url_parse::Component& part, std::string* url) { if (!part.is_valid()) return; url->append(":"); url->append(text, part.begin, part.len); }
static void FixupPort(const std::string& text, const url_parse::Component& part, std::string* url) { if (!part.is_valid()) return; url->append(":"); url->append(text, part.begin, part.len); }
C
Chrome
0
CVE-2016-3837
https://www.cvedetails.com/cve/CVE-2016-3837/
CWE-200
https://android.googlesource.com/platform/frameworks/opt/net/wifi/+/a209ff12ba9617c10550678ff93d01fb72a33399
a209ff12ba9617c10550678ff93d01fb72a33399
Deal correctly with short strings The parseMacAddress function anticipates only properly formed MAC addresses (6 hexadecimal octets separated by ":"). This change properly deals with situations where the string is shorter than expected, making sure that the passed in char* reference in parseHexByte never exceeds the end of the string. BUG: 28164077 TEST: Added a main function: int main(int argc, char **argv) { unsigned char addr[6]; if (argc > 1) { memset(addr, 0, sizeof(addr)); parseMacAddress(argv[1], addr); printf("Result: %02x:%02x:%02x:%02x:%02x:%02x\n", addr[0], addr[1], addr[2], addr[3], addr[4], addr[5]); } } Tested with "", "a" "ab" "ab:c" "abxc". Change-Id: I0db8d0037e48b62333d475296a45b22ab0efe386
void onLinkStatsResults(wifi_request_id id, wifi_iface_stat *iface_stat, int num_radios, wifi_radio_stat *radio_stats) { if (iface_stat != 0) { memcpy(&link_stat, iface_stat, sizeof(wifi_iface_stat)); } else { memset(&link_stat, 0, sizeof(wifi_iface_stat)); } if (num_radios > 0 && radio_stats != 0) { memcpy(&radio_stat, radio_stats, sizeof(wifi_radio_stat)); } else { memset(&radio_stat, 0, sizeof(wifi_radio_stat)); } }
void onLinkStatsResults(wifi_request_id id, wifi_iface_stat *iface_stat, int num_radios, wifi_radio_stat *radio_stats) { if (iface_stat != 0) { memcpy(&link_stat, iface_stat, sizeof(wifi_iface_stat)); } else { memset(&link_stat, 0, sizeof(wifi_iface_stat)); } if (num_radios > 0 && radio_stats != 0) { memcpy(&radio_stat, radio_stats, sizeof(wifi_radio_stat)); } else { memset(&radio_stat, 0, sizeof(wifi_radio_stat)); } }
C
Android
0
CVE-2011-3209
https://www.cvedetails.com/cve/CVE-2011-3209/
CWE-189
https://github.com/torvalds/linux/commit/f8bd2258e2d520dff28c855658bd24bdafb5102d
f8bd2258e2d520dff28c855658bd24bdafb5102d
remove div_long_long_rem x86 is the only arch right now, which provides an optimized for div_long_long_rem and it has the downside that one has to be very careful that the divide doesn't overflow. The API is a little akward, as the arguments for the unsigned divide are signed. The signed version also doesn't handle a negative divisor and produces worse code on 64bit archs. There is little incentive to keep this API alive, so this converts the few users to the new API. Signed-off-by: Roman Zippel <[email protected]> Cc: Ralf Baechle <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Thomas Gleixner <[email protected]> Cc: john stultz <[email protected]> Cc: Christoph Lameter <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
static void bump_cpu_timer(struct k_itimer *timer, union cpu_time_count now) { int i; if (timer->it.cpu.incr.sched == 0) return; if (CPUCLOCK_WHICH(timer->it_clock) == CPUCLOCK_SCHED) { unsigned long long delta, incr; if (now.sched < timer->it.cpu.expires.sched) return; incr = timer->it.cpu.incr.sched; delta = now.sched + incr - timer->it.cpu.expires.sched; /* Don't use (incr*2 < delta), incr*2 might overflow. */ for (i = 0; incr < delta - incr; i++) incr = incr << 1; for (; i >= 0; incr >>= 1, i--) { if (delta < incr) continue; timer->it.cpu.expires.sched += incr; timer->it_overrun += 1 << i; delta -= incr; } } else { cputime_t delta, incr; if (cputime_lt(now.cpu, timer->it.cpu.expires.cpu)) return; incr = timer->it.cpu.incr.cpu; delta = cputime_sub(cputime_add(now.cpu, incr), timer->it.cpu.expires.cpu); /* Don't use (incr*2 < delta), incr*2 might overflow. */ for (i = 0; cputime_lt(incr, cputime_sub(delta, incr)); i++) incr = cputime_add(incr, incr); for (; i >= 0; incr = cputime_halve(incr), i--) { if (cputime_lt(delta, incr)) continue; timer->it.cpu.expires.cpu = cputime_add(timer->it.cpu.expires.cpu, incr); timer->it_overrun += 1 << i; delta = cputime_sub(delta, incr); } } }
static void bump_cpu_timer(struct k_itimer *timer, union cpu_time_count now) { int i; if (timer->it.cpu.incr.sched == 0) return; if (CPUCLOCK_WHICH(timer->it_clock) == CPUCLOCK_SCHED) { unsigned long long delta, incr; if (now.sched < timer->it.cpu.expires.sched) return; incr = timer->it.cpu.incr.sched; delta = now.sched + incr - timer->it.cpu.expires.sched; /* Don't use (incr*2 < delta), incr*2 might overflow. */ for (i = 0; incr < delta - incr; i++) incr = incr << 1; for (; i >= 0; incr >>= 1, i--) { if (delta < incr) continue; timer->it.cpu.expires.sched += incr; timer->it_overrun += 1 << i; delta -= incr; } } else { cputime_t delta, incr; if (cputime_lt(now.cpu, timer->it.cpu.expires.cpu)) return; incr = timer->it.cpu.incr.cpu; delta = cputime_sub(cputime_add(now.cpu, incr), timer->it.cpu.expires.cpu); /* Don't use (incr*2 < delta), incr*2 might overflow. */ for (i = 0; cputime_lt(incr, cputime_sub(delta, incr)); i++) incr = cputime_add(incr, incr); for (; i >= 0; incr = cputime_halve(incr), i--) { if (cputime_lt(delta, incr)) continue; timer->it.cpu.expires.cpu = cputime_add(timer->it.cpu.expires.cpu, incr); timer->it_overrun += 1 << i; delta = cputime_sub(delta, incr); } } }
C
linux
0
CVE-2016-4303
https://www.cvedetails.com/cve/CVE-2016-4303/
CWE-119
https://github.com/esnet/iperf/commit/91f2fa59e8ed80dfbf400add0164ee0e508e412a
91f2fa59e8ed80dfbf400add0164ee0e508e412a
Fix a buffer overflow / heap corruption issue that could occur if a malformed JSON string was passed on the control channel. This issue, present in the cJSON library, was already fixed upstream, so was addressed here in iperf3 by importing a newer version of cJSON (plus local ESnet modifications). Discovered and reported by Dave McDaniel, Cisco Talos. Based on a patch by @dopheide-esnet, with input from @DaveGamble. Cross-references: TALOS-CAN-0164, ESNET-SECADV-2016-0001, CVE-2016-4303 (cherry picked from commit ed94082be27d971a5e1b08b666e2c217cf470a40) Signed-off-by: Bruce A. Mah <[email protected]>
void cJSON_Delete( cJSON *c ) void cJSON_Delete(cJSON *c) { cJSON *next; while (c) { next=c->next; if (!(c->type&cJSON_IsReference) && c->child) cJSON_Delete(c->child); if (!(c->type&cJSON_IsReference) && c->valuestring) cJSON_free(c->valuestring); if (!(c->type&cJSON_StringIsConst) && c->string) cJSON_free(c->string); cJSON_free(c); c=next; } }
void cJSON_Delete( cJSON *c ) { cJSON *next; while ( c ) { next = c->next; if ( ! ( c->type & cJSON_IsReference ) && c->child ) cJSON_Delete( c->child ); if ( ! ( c->type & cJSON_IsReference ) && c->valuestring ) cJSON_free( c->valuestring ); if ( c->string ) cJSON_free( c->string ); cJSON_free( c ); c = next; } }
C
iperf
1
CVE-2016-2451
https://www.cvedetails.com/cve/CVE-2016-2451/
CWE-264
https://android.googlesource.com/platform/frameworks/av/+/f9ed2fe6d61259e779a37d4c2d7edb33a1c1f8ba
f9ed2fe6d61259e779a37d4c2d7edb33a1c1f8ba
Add VPX output buffer size check and handle dead observers more gracefully Bug: 27597103 Change-Id: Id7acb25d5ef69b197da15ec200a9e4f9e7b03518
status_t OMX::fillBuffer(node_id node, buffer_id buffer, int fenceFd) { return findInstance(node)->fillBuffer(buffer, fenceFd); }
status_t OMX::fillBuffer(node_id node, buffer_id buffer, int fenceFd) { return findInstance(node)->fillBuffer(buffer, fenceFd); }
C
Android
0
CVE-2016-8645
https://www.cvedetails.com/cve/CVE-2016-8645/
CWE-284
https://github.com/torvalds/linux/commit/ac6e780070e30e4c35bd395acfe9191e6268bdd3
ac6e780070e30e4c35bd395acfe9191e6268bdd3
tcp: take care of truncations done by sk_filter() With syzkaller help, Marco Grassi found a bug in TCP stack, crashing in tcp_collapse() Root cause is that sk_filter() can truncate the incoming skb, but TCP stack was not really expecting this to happen. It probably was expecting a simple DROP or ACCEPT behavior. We first need to make sure no part of TCP header could be removed. Then we need to adjust TCP_SKB_CB(skb)->end_seq Many thanks to syzkaller team and Marco for giving us a reproducer. Signed-off-by: Eric Dumazet <[email protected]> Reported-by: Marco Grassi <[email protected]> Reported-by: Vladis Dronov <[email protected]> Signed-off-by: David S. Miller <[email protected]>
static int tcp_v6_parse_md5_keys(struct sock *sk, char __user *optval, int optlen) { struct tcp_md5sig cmd; struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *)&cmd.tcpm_addr; if (optlen < sizeof(cmd)) return -EINVAL; if (copy_from_user(&cmd, optval, sizeof(cmd))) return -EFAULT; if (sin6->sin6_family != AF_INET6) return -EINVAL; if (!cmd.tcpm_keylen) { if (ipv6_addr_v4mapped(&sin6->sin6_addr)) return tcp_md5_do_del(sk, (union tcp_md5_addr *)&sin6->sin6_addr.s6_addr32[3], AF_INET); return tcp_md5_do_del(sk, (union tcp_md5_addr *)&sin6->sin6_addr, AF_INET6); } if (cmd.tcpm_keylen > TCP_MD5SIG_MAXKEYLEN) return -EINVAL; if (ipv6_addr_v4mapped(&sin6->sin6_addr)) return tcp_md5_do_add(sk, (union tcp_md5_addr *)&sin6->sin6_addr.s6_addr32[3], AF_INET, cmd.tcpm_key, cmd.tcpm_keylen, GFP_KERNEL); return tcp_md5_do_add(sk, (union tcp_md5_addr *)&sin6->sin6_addr, AF_INET6, cmd.tcpm_key, cmd.tcpm_keylen, GFP_KERNEL); }
static int tcp_v6_parse_md5_keys(struct sock *sk, char __user *optval, int optlen) { struct tcp_md5sig cmd; struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *)&cmd.tcpm_addr; if (optlen < sizeof(cmd)) return -EINVAL; if (copy_from_user(&cmd, optval, sizeof(cmd))) return -EFAULT; if (sin6->sin6_family != AF_INET6) return -EINVAL; if (!cmd.tcpm_keylen) { if (ipv6_addr_v4mapped(&sin6->sin6_addr)) return tcp_md5_do_del(sk, (union tcp_md5_addr *)&sin6->sin6_addr.s6_addr32[3], AF_INET); return tcp_md5_do_del(sk, (union tcp_md5_addr *)&sin6->sin6_addr, AF_INET6); } if (cmd.tcpm_keylen > TCP_MD5SIG_MAXKEYLEN) return -EINVAL; if (ipv6_addr_v4mapped(&sin6->sin6_addr)) return tcp_md5_do_add(sk, (union tcp_md5_addr *)&sin6->sin6_addr.s6_addr32[3], AF_INET, cmd.tcpm_key, cmd.tcpm_keylen, GFP_KERNEL); return tcp_md5_do_add(sk, (union tcp_md5_addr *)&sin6->sin6_addr, AF_INET6, cmd.tcpm_key, cmd.tcpm_keylen, GFP_KERNEL); }
C
linux
0
CVE-2011-3963
https://www.cvedetails.com/cve/CVE-2011-3963/
CWE-119
https://github.com/chromium/chromium/commit/0a38f71865b63025dce4de1f8cca71979c48d14d
0a38f71865b63025dce4de1f8cca71979c48d14d
Implement methods for pairing of bluetooth devices. BUG=chromium:100392,chromium:102139 TEST= Review URL: http://codereview.chromium.org/8495018 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@109094 0039d316-1c4b-4281-b951-d872f2087c98
BluetoothOptionsHandler::~BluetoothOptionsHandler() { if (!CommandLine::ForCurrentProcess() ->HasSwitch(switches::kEnableBluetooth)) { return; } chromeos::BluetoothManager* bluetooth_manager = chromeos::BluetoothManager::GetInstance(); DCHECK(bluetooth_manager); chromeos::BluetoothAdapter* default_adapter = bluetooth_manager->DefaultAdapter(); if (default_adapter != NULL) { default_adapter->RemoveObserver(this); } bluetooth_manager->RemoveObserver(this); }
BluetoothOptionsHandler::~BluetoothOptionsHandler() { if (!CommandLine::ForCurrentProcess() ->HasSwitch(switches::kEnableBluetooth)) { return; } chromeos::BluetoothManager* bluetooth_manager = chromeos::BluetoothManager::GetInstance(); DCHECK(bluetooth_manager); chromeos::BluetoothAdapter* default_adapter = bluetooth_manager->DefaultAdapter(); if (default_adapter != NULL) { default_adapter->RemoveObserver(this); } bluetooth_manager->RemoveObserver(this); }
C
Chrome
0
CVE-2017-15115
https://www.cvedetails.com/cve/CVE-2017-15115/
CWE-416
https://github.com/torvalds/linux/commit/df80cd9b28b9ebaa284a41df611dbf3a2d05ca74
df80cd9b28b9ebaa284a41df611dbf3a2d05ca74
sctp: do not peel off an assoc from one netns to another one Now when peeling off an association to the sock in another netns, all transports in this assoc are not to be rehashed and keep use the old key in hashtable. As a transport uses sk->net as the hash key to insert into hashtable, it would miss removing these transports from hashtable due to the new netns when closing the sock and all transports are being freeed, then later an use-after-free issue could be caused when looking up an asoc and dereferencing those transports. This is a very old issue since very beginning, ChunYu found it with syzkaller fuzz testing with this series: socket$inet6_sctp() bind$inet6() sendto$inet6() unshare(0x40000000) getsockopt$inet_sctp6_SCTP_GET_ASSOC_ID_LIST() getsockopt$inet_sctp6_SCTP_SOCKOPT_PEELOFF() This patch is to block this call when peeling one assoc off from one netns to another one, so that the netns of all transport would not go out-sync with the key in hashtable. Note that this patch didn't fix it by rehashing transports, as it's difficult to handle the situation when the tuple is already in use in the new netns. Besides, no one would like to peel off one assoc to another netns, considering ipaddrs, ifaces, etc. are usually different. Reported-by: ChunYu Wang <[email protected]> Signed-off-by: Xin Long <[email protected]> Acked-by: Marcelo Ricardo Leitner <[email protected]> Acked-by: Neil Horman <[email protected]> Signed-off-by: David S. Miller <[email protected]>
static int __sctp_setsockopt_connectx(struct sock *sk, struct sockaddr __user *addrs, int addrs_size, sctp_assoc_t *assoc_id) { struct sockaddr *kaddrs; gfp_t gfp = GFP_KERNEL; int err = 0; pr_debug("%s: sk:%p addrs:%p addrs_size:%d\n", __func__, sk, addrs, addrs_size); if (unlikely(addrs_size <= 0)) return -EINVAL; /* Check the user passed a healthy pointer. */ if (unlikely(!access_ok(VERIFY_READ, addrs, addrs_size))) return -EFAULT; /* Alloc space for the address array in kernel memory. */ if (sk->sk_socket->file) gfp = GFP_USER | __GFP_NOWARN; kaddrs = kmalloc(addrs_size, gfp); if (unlikely(!kaddrs)) return -ENOMEM; if (__copy_from_user(kaddrs, addrs, addrs_size)) { err = -EFAULT; } else { err = __sctp_connect(sk, kaddrs, addrs_size, assoc_id); } kfree(kaddrs); return err; }
static int __sctp_setsockopt_connectx(struct sock *sk, struct sockaddr __user *addrs, int addrs_size, sctp_assoc_t *assoc_id) { struct sockaddr *kaddrs; gfp_t gfp = GFP_KERNEL; int err = 0; pr_debug("%s: sk:%p addrs:%p addrs_size:%d\n", __func__, sk, addrs, addrs_size); if (unlikely(addrs_size <= 0)) return -EINVAL; /* Check the user passed a healthy pointer. */ if (unlikely(!access_ok(VERIFY_READ, addrs, addrs_size))) return -EFAULT; /* Alloc space for the address array in kernel memory. */ if (sk->sk_socket->file) gfp = GFP_USER | __GFP_NOWARN; kaddrs = kmalloc(addrs_size, gfp); if (unlikely(!kaddrs)) return -ENOMEM; if (__copy_from_user(kaddrs, addrs, addrs_size)) { err = -EFAULT; } else { err = __sctp_connect(sk, kaddrs, addrs_size, assoc_id); } kfree(kaddrs); return err; }
C
linux
0
CVE-2017-13090
https://www.cvedetails.com/cve/CVE-2017-13090/
CWE-119
https://git.savannah.gnu.org/cgit/wget.git/commit/?id=ba6b44f6745b14dce414761a8e4b35d31b176bba
ba6b44f6745b14dce414761a8e4b35d31b176bba
null
retrieve_url (struct url * orig_parsed, const char *origurl, char **file, char **newloc, const char *refurl, int *dt, bool recursive, struct iri *iri, bool register_status) { uerr_t result; char *url; bool location_changed; bool iri_fallbacked = 0; int dummy; char *mynewloc, *proxy; struct url *u = orig_parsed, *proxy_url; int up_error_code; /* url parse error code */ char *local_file = NULL; int redirection_count = 0; bool method_suspended = false; char *saved_body_data = NULL; char *saved_method = NULL; char *saved_body_file_name = NULL; /* If dt is NULL, use local storage. */ if (!dt) { dt = &dummy; dummy = 0; } url = xstrdup (origurl); if (newloc) *newloc = NULL; if (file) *file = NULL; if (!refurl) refurl = opt.referer; redirected: /* (also for IRI fallbacking) */ result = NOCONERROR; mynewloc = NULL; xfree(local_file); proxy_url = NULL; proxy = getproxy (u); if (proxy) { struct iri *pi = iri_new (); set_uri_encoding (pi, opt.locale, true); pi->utf8_encode = false; /* Parse the proxy URL. */ proxy_url = url_parse (proxy, &up_error_code, pi, true); if (!proxy_url) { char *error = url_error (proxy, up_error_code); logprintf (LOG_NOTQUIET, _("Error parsing proxy URL %s: %s.\n"), proxy, error); xfree (url); xfree (error); xfree (proxy); iri_free (pi); RESTORE_METHOD; result = PROXERR; goto bail; } if (proxy_url->scheme != SCHEME_HTTP && proxy_url->scheme != u->scheme) { logprintf (LOG_NOTQUIET, _("Error in proxy URL %s: Must be HTTP.\n"), proxy); url_free (proxy_url); xfree (url); xfree (proxy); iri_free (pi); RESTORE_METHOD; result = PROXERR; goto bail; } iri_free(pi); xfree (proxy); } if (u->scheme == SCHEME_HTTP #ifdef HAVE_SSL || u->scheme == SCHEME_HTTPS #endif || (proxy_url && proxy_url->scheme == SCHEME_HTTP)) { #ifdef HAVE_HSTS #ifdef TESTING /* we don't link against main.o when we're testing */ hsts_store_t hsts_store = NULL; #else extern hsts_store_t hsts_store; #endif if (opt.hsts && hsts_store) { if (hsts_match (hsts_store, u)) logprintf (LOG_VERBOSE, "URL transformed to HTTPS due to an HSTS policy\n"); } #endif result = http_loop (u, orig_parsed, &mynewloc, &local_file, refurl, dt, proxy_url, iri); } else if (u->scheme == SCHEME_FTP #ifdef HAVE_SSL || u->scheme == SCHEME_FTPS #endif ) { /* If this is a redirection, temporarily turn off opt.ftp_glob and opt.recursive, both being undesirable when following redirects. */ bool oldrec = recursive, glob = opt.ftp_glob; if (redirection_count) oldrec = glob = false; result = ftp_loop (u, orig_parsed, &local_file, dt, proxy_url, recursive, glob); recursive = oldrec; /* There is a possibility of having HTTP being redirected to FTP. In these cases we must decide whether the text is HTML according to the suffix. The HTML suffixes are `.html', `.htm' and a few others, case-insensitive. */ if (redirection_count && local_file && (u->scheme == SCHEME_FTP #ifdef HAVE_SSL || u->scheme == SCHEME_FTPS #endif )) { if (has_html_suffix_p (local_file)) *dt |= TEXTHTML; } } if (proxy_url) { url_free (proxy_url); proxy_url = NULL; } location_changed = (result == NEWLOCATION || result == NEWLOCATION_KEEP_POST); if (location_changed) { char *construced_newloc; struct url *newloc_parsed; assert (mynewloc != NULL); xfree (local_file); /* The HTTP specs only allow absolute URLs to appear in redirects, but a ton of boneheaded webservers and CGIs out there break the rules and use relative URLs, and popular browsers are lenient about this, so wget should be too. */ construced_newloc = uri_merge (url, mynewloc ? mynewloc : ""); xfree (mynewloc); mynewloc = construced_newloc; #ifdef ENABLE_IRI /* Reset UTF-8 encoding state, set the URI encoding and reset the content encoding. */ iri->utf8_encode = opt.enable_iri; if (opt.encoding_remote) set_uri_encoding (iri, opt.encoding_remote, true); set_content_encoding (iri, NULL); xfree (iri->orig_url); #endif /* Now, see if this new location makes sense. */ newloc_parsed = url_parse (mynewloc, &up_error_code, iri, true); if (!newloc_parsed) { char *error = url_error (mynewloc, up_error_code); logprintf (LOG_NOTQUIET, "%s: %s.\n", escnonprint_uri (mynewloc), error); if (orig_parsed != u) { url_free (u); } xfree (url); xfree (mynewloc); xfree (error); RESTORE_METHOD; goto bail; } /* Now mynewloc will become newloc_parsed->url, because if the Location contained relative paths like .././something, we don't want that propagating as url. */ xfree (mynewloc); mynewloc = xstrdup (newloc_parsed->url); /* Check for max. number of redirections. */ if (++redirection_count > opt.max_redirect) { logprintf (LOG_NOTQUIET, _("%d redirections exceeded.\n"), opt.max_redirect); url_free (newloc_parsed); if (orig_parsed != u) { url_free (u); } xfree (url); xfree (mynewloc); RESTORE_METHOD; result = WRONGCODE; goto bail; } xfree (url); url = mynewloc; if (orig_parsed != u) { url_free (u); } u = newloc_parsed; /* If we're being redirected from POST, and we received a redirect code different than 307, we don't want to POST again. Many requests answer POST with a redirection to an index page; that redirection is clearly a GET. We "suspend" POST data for the duration of the redirections, and restore it when we're done. RFC2616 HTTP/1.1 introduces code 307 Temporary Redirect specifically to preserve the method of the request. */ if (result != NEWLOCATION_KEEP_POST && !method_suspended) SUSPEND_METHOD; goto redirected; } else { xfree(mynewloc); } /* Try to not encode in UTF-8 if fetching failed */ if (!(*dt & RETROKF) && iri->utf8_encode) { iri->utf8_encode = false; if (orig_parsed != u) { url_free (u); } u = url_parse (origurl, NULL, iri, true); if (u) { if (strcmp(u->url, orig_parsed->url)) { DEBUGP (("[IRI fallbacking to non-utf8 for %s\n", quote (url))); xfree (url); url = xstrdup (u->url); iri_fallbacked = 1; goto redirected; } else DEBUGP (("[Needn't fallback to non-utf8 for %s\n", quote (url))); } else DEBUGP (("[Couldn't fallback to non-utf8 for %s\n", quote (url))); } if (local_file && u && (*dt & RETROKF || opt.content_on_error)) { register_download (u->url, local_file); if (!opt.spider && redirection_count && 0 != strcmp (origurl, u->url)) register_redirection (origurl, u->url); if (*dt & TEXTHTML) register_html (local_file); if (*dt & TEXTCSS) register_css (local_file); } if (file) *file = local_file ? local_file : NULL; else xfree (local_file); if (orig_parsed != u) { url_free (u); } if (redirection_count || iri_fallbacked) { if (newloc) *newloc = url; else xfree (url); } else { if (newloc) *newloc = NULL; xfree (url); } RESTORE_METHOD; bail: if (register_status) inform_exit_status (result); return result; }
retrieve_url (struct url * orig_parsed, const char *origurl, char **file, char **newloc, const char *refurl, int *dt, bool recursive, struct iri *iri, bool register_status) { uerr_t result; char *url; bool location_changed; bool iri_fallbacked = 0; int dummy; char *mynewloc, *proxy; struct url *u = orig_parsed, *proxy_url; int up_error_code; /* url parse error code */ char *local_file = NULL; int redirection_count = 0; bool method_suspended = false; char *saved_body_data = NULL; char *saved_method = NULL; char *saved_body_file_name = NULL; /* If dt is NULL, use local storage. */ if (!dt) { dt = &dummy; dummy = 0; } url = xstrdup (origurl); if (newloc) *newloc = NULL; if (file) *file = NULL; if (!refurl) refurl = opt.referer; redirected: /* (also for IRI fallbacking) */ result = NOCONERROR; mynewloc = NULL; xfree(local_file); proxy_url = NULL; proxy = getproxy (u); if (proxy) { struct iri *pi = iri_new (); set_uri_encoding (pi, opt.locale, true); pi->utf8_encode = false; /* Parse the proxy URL. */ proxy_url = url_parse (proxy, &up_error_code, pi, true); if (!proxy_url) { char *error = url_error (proxy, up_error_code); logprintf (LOG_NOTQUIET, _("Error parsing proxy URL %s: %s.\n"), proxy, error); xfree (url); xfree (error); xfree (proxy); iri_free (pi); RESTORE_METHOD; result = PROXERR; goto bail; } if (proxy_url->scheme != SCHEME_HTTP && proxy_url->scheme != u->scheme) { logprintf (LOG_NOTQUIET, _("Error in proxy URL %s: Must be HTTP.\n"), proxy); url_free (proxy_url); xfree (url); xfree (proxy); iri_free (pi); RESTORE_METHOD; result = PROXERR; goto bail; } iri_free(pi); xfree (proxy); } if (u->scheme == SCHEME_HTTP #ifdef HAVE_SSL || u->scheme == SCHEME_HTTPS #endif || (proxy_url && proxy_url->scheme == SCHEME_HTTP)) { #ifdef HAVE_HSTS #ifdef TESTING /* we don't link against main.o when we're testing */ hsts_store_t hsts_store = NULL; #else extern hsts_store_t hsts_store; #endif if (opt.hsts && hsts_store) { if (hsts_match (hsts_store, u)) logprintf (LOG_VERBOSE, "URL transformed to HTTPS due to an HSTS policy\n"); } #endif result = http_loop (u, orig_parsed, &mynewloc, &local_file, refurl, dt, proxy_url, iri); } else if (u->scheme == SCHEME_FTP #ifdef HAVE_SSL || u->scheme == SCHEME_FTPS #endif ) { /* If this is a redirection, temporarily turn off opt.ftp_glob and opt.recursive, both being undesirable when following redirects. */ bool oldrec = recursive, glob = opt.ftp_glob; if (redirection_count) oldrec = glob = false; result = ftp_loop (u, orig_parsed, &local_file, dt, proxy_url, recursive, glob); recursive = oldrec; /* There is a possibility of having HTTP being redirected to FTP. In these cases we must decide whether the text is HTML according to the suffix. The HTML suffixes are `.html', `.htm' and a few others, case-insensitive. */ if (redirection_count && local_file && (u->scheme == SCHEME_FTP #ifdef HAVE_SSL || u->scheme == SCHEME_FTPS #endif )) { if (has_html_suffix_p (local_file)) *dt |= TEXTHTML; } } if (proxy_url) { url_free (proxy_url); proxy_url = NULL; } location_changed = (result == NEWLOCATION || result == NEWLOCATION_KEEP_POST); if (location_changed) { char *construced_newloc; struct url *newloc_parsed; assert (mynewloc != NULL); xfree (local_file); /* The HTTP specs only allow absolute URLs to appear in redirects, but a ton of boneheaded webservers and CGIs out there break the rules and use relative URLs, and popular browsers are lenient about this, so wget should be too. */ construced_newloc = uri_merge (url, mynewloc ? mynewloc : ""); xfree (mynewloc); mynewloc = construced_newloc; #ifdef ENABLE_IRI /* Reset UTF-8 encoding state, set the URI encoding and reset the content encoding. */ iri->utf8_encode = opt.enable_iri; if (opt.encoding_remote) set_uri_encoding (iri, opt.encoding_remote, true); set_content_encoding (iri, NULL); xfree (iri->orig_url); #endif /* Now, see if this new location makes sense. */ newloc_parsed = url_parse (mynewloc, &up_error_code, iri, true); if (!newloc_parsed) { char *error = url_error (mynewloc, up_error_code); logprintf (LOG_NOTQUIET, "%s: %s.\n", escnonprint_uri (mynewloc), error); if (orig_parsed != u) { url_free (u); } xfree (url); xfree (mynewloc); xfree (error); RESTORE_METHOD; goto bail; } /* Now mynewloc will become newloc_parsed->url, because if the Location contained relative paths like .././something, we don't want that propagating as url. */ xfree (mynewloc); mynewloc = xstrdup (newloc_parsed->url); /* Check for max. number of redirections. */ if (++redirection_count > opt.max_redirect) { logprintf (LOG_NOTQUIET, _("%d redirections exceeded.\n"), opt.max_redirect); url_free (newloc_parsed); if (orig_parsed != u) { url_free (u); } xfree (url); xfree (mynewloc); RESTORE_METHOD; result = WRONGCODE; goto bail; } xfree (url); url = mynewloc; if (orig_parsed != u) { url_free (u); } u = newloc_parsed; /* If we're being redirected from POST, and we received a redirect code different than 307, we don't want to POST again. Many requests answer POST with a redirection to an index page; that redirection is clearly a GET. We "suspend" POST data for the duration of the redirections, and restore it when we're done. RFC2616 HTTP/1.1 introduces code 307 Temporary Redirect specifically to preserve the method of the request. */ if (result != NEWLOCATION_KEEP_POST && !method_suspended) SUSPEND_METHOD; goto redirected; } else { xfree(mynewloc); } /* Try to not encode in UTF-8 if fetching failed */ if (!(*dt & RETROKF) && iri->utf8_encode) { iri->utf8_encode = false; if (orig_parsed != u) { url_free (u); } u = url_parse (origurl, NULL, iri, true); if (u) { if (strcmp(u->url, orig_parsed->url)) { DEBUGP (("[IRI fallbacking to non-utf8 for %s\n", quote (url))); xfree (url); url = xstrdup (u->url); iri_fallbacked = 1; goto redirected; } else DEBUGP (("[Needn't fallback to non-utf8 for %s\n", quote (url))); } else DEBUGP (("[Couldn't fallback to non-utf8 for %s\n", quote (url))); } if (local_file && u && (*dt & RETROKF || opt.content_on_error)) { register_download (u->url, local_file); if (!opt.spider && redirection_count && 0 != strcmp (origurl, u->url)) register_redirection (origurl, u->url); if (*dt & TEXTHTML) register_html (local_file); if (*dt & TEXTCSS) register_css (local_file); } if (file) *file = local_file ? local_file : NULL; else xfree (local_file); if (orig_parsed != u) { url_free (u); } if (redirection_count || iri_fallbacked) { if (newloc) *newloc = url; else xfree (url); } else { if (newloc) *newloc = NULL; xfree (url); } RESTORE_METHOD; bail: if (register_status) inform_exit_status (result); return result; }
C
savannah
0
CVE-2012-3400
https://www.cvedetails.com/cve/CVE-2012-3400/
CWE-119
https://github.com/torvalds/linux/commit/adee11b2085bee90bd8f4f52123ffb07882d6256
adee11b2085bee90bd8f4f52123ffb07882d6256
udf: Avoid run away loop when partition table length is corrupted Check provided length of partition table so that (possibly maliciously) corrupted partition table cannot cause accessing data beyond current buffer. Signed-off-by: Jan Kara <[email protected]>
static int udf_fill_super(struct super_block *sb, void *options, int silent) { int i; int ret; struct inode *inode = NULL; struct udf_options uopt; struct kernel_lb_addr rootdir, fileset; struct udf_sb_info *sbi; uopt.flags = (1 << UDF_FLAG_USE_AD_IN_ICB) | (1 << UDF_FLAG_STRICT); uopt.uid = -1; uopt.gid = -1; uopt.umask = 0; uopt.fmode = UDF_INVALID_MODE; uopt.dmode = UDF_INVALID_MODE; sbi = kzalloc(sizeof(struct udf_sb_info), GFP_KERNEL); if (!sbi) return -ENOMEM; sb->s_fs_info = sbi; mutex_init(&sbi->s_alloc_mutex); if (!udf_parse_options((char *)options, &uopt, false)) goto error_out; if (uopt.flags & (1 << UDF_FLAG_UTF8) && uopt.flags & (1 << UDF_FLAG_NLS_MAP)) { udf_err(sb, "utf8 cannot be combined with iocharset\n"); goto error_out; } #ifdef CONFIG_UDF_NLS if ((uopt.flags & (1 << UDF_FLAG_NLS_MAP)) && !uopt.nls_map) { uopt.nls_map = load_nls_default(); if (!uopt.nls_map) uopt.flags &= ~(1 << UDF_FLAG_NLS_MAP); else udf_debug("Using default NLS map\n"); } #endif if (!(uopt.flags & (1 << UDF_FLAG_NLS_MAP))) uopt.flags |= (1 << UDF_FLAG_UTF8); fileset.logicalBlockNum = 0xFFFFFFFF; fileset.partitionReferenceNum = 0xFFFF; sbi->s_flags = uopt.flags; sbi->s_uid = uopt.uid; sbi->s_gid = uopt.gid; sbi->s_umask = uopt.umask; sbi->s_fmode = uopt.fmode; sbi->s_dmode = uopt.dmode; sbi->s_nls_map = uopt.nls_map; rwlock_init(&sbi->s_cred_lock); if (uopt.session == 0xFFFFFFFF) sbi->s_session = udf_get_last_session(sb); else sbi->s_session = uopt.session; udf_debug("Multi-session=%d\n", sbi->s_session); /* Fill in the rest of the superblock */ sb->s_op = &udf_sb_ops; sb->s_export_op = &udf_export_ops; sb->s_dirt = 0; sb->s_magic = UDF_SUPER_MAGIC; sb->s_time_gran = 1000; if (uopt.flags & (1 << UDF_FLAG_BLOCKSIZE_SET)) { ret = udf_load_vrs(sb, &uopt, silent, &fileset); } else { uopt.blocksize = bdev_logical_block_size(sb->s_bdev); ret = udf_load_vrs(sb, &uopt, silent, &fileset); if (!ret && uopt.blocksize != UDF_DEFAULT_BLOCKSIZE) { if (!silent) pr_notice("Rescanning with blocksize %d\n", UDF_DEFAULT_BLOCKSIZE); uopt.blocksize = UDF_DEFAULT_BLOCKSIZE; ret = udf_load_vrs(sb, &uopt, silent, &fileset); } } if (!ret) { udf_warn(sb, "No partition found (1)\n"); goto error_out; } udf_debug("Lastblock=%d\n", sbi->s_last_block); if (sbi->s_lvid_bh) { struct logicalVolIntegrityDescImpUse *lvidiu = udf_sb_lvidiu(sbi); uint16_t minUDFReadRev = le16_to_cpu(lvidiu->minUDFReadRev); uint16_t minUDFWriteRev = le16_to_cpu(lvidiu->minUDFWriteRev); /* uint16_t maxUDFWriteRev = le16_to_cpu(lvidiu->maxUDFWriteRev); */ if (minUDFReadRev > UDF_MAX_READ_VERSION) { udf_err(sb, "minUDFReadRev=%x (max is %x)\n", le16_to_cpu(lvidiu->minUDFReadRev), UDF_MAX_READ_VERSION); goto error_out; } else if (minUDFWriteRev > UDF_MAX_WRITE_VERSION) sb->s_flags |= MS_RDONLY; sbi->s_udfrev = minUDFWriteRev; if (minUDFReadRev >= UDF_VERS_USE_EXTENDED_FE) UDF_SET_FLAG(sb, UDF_FLAG_USE_EXTENDED_FE); if (minUDFReadRev >= UDF_VERS_USE_STREAMS) UDF_SET_FLAG(sb, UDF_FLAG_USE_STREAMS); } if (!sbi->s_partitions) { udf_warn(sb, "No partition found (2)\n"); goto error_out; } if (sbi->s_partmaps[sbi->s_partition].s_partition_flags & UDF_PART_FLAG_READ_ONLY) { pr_notice("Partition marked readonly; forcing readonly mount\n"); sb->s_flags |= MS_RDONLY; } if (udf_find_fileset(sb, &fileset, &rootdir)) { udf_warn(sb, "No fileset found\n"); goto error_out; } if (!silent) { struct timestamp ts; udf_time_to_disk_stamp(&ts, sbi->s_record_time); udf_info("Mounting volume '%s', timestamp %04u/%02u/%02u %02u:%02u (%x)\n", sbi->s_volume_ident, le16_to_cpu(ts.year), ts.month, ts.day, ts.hour, ts.minute, le16_to_cpu(ts.typeAndTimezone)); } if (!(sb->s_flags & MS_RDONLY)) udf_open_lvid(sb); /* Assign the root inode */ /* assign inodes by physical block number */ /* perhaps it's not extensible enough, but for now ... */ inode = udf_iget(sb, &rootdir); if (!inode) { udf_err(sb, "Error in udf_iget, block=%d, partition=%d\n", rootdir.logicalBlockNum, rootdir.partitionReferenceNum); goto error_out; } /* Allocate a dentry for the root inode */ sb->s_root = d_make_root(inode); if (!sb->s_root) { udf_err(sb, "Couldn't allocate root dentry\n"); goto error_out; } sb->s_maxbytes = MAX_LFS_FILESIZE; sb->s_max_links = UDF_MAX_LINKS; return 0; error_out: if (sbi->s_vat_inode) iput(sbi->s_vat_inode); if (sbi->s_partitions) for (i = 0; i < sbi->s_partitions; i++) udf_free_partition(&sbi->s_partmaps[i]); #ifdef CONFIG_UDF_NLS if (UDF_QUERY_FLAG(sb, UDF_FLAG_NLS_MAP)) unload_nls(sbi->s_nls_map); #endif if (!(sb->s_flags & MS_RDONLY)) udf_close_lvid(sb); brelse(sbi->s_lvid_bh); kfree(sbi->s_partmaps); kfree(sbi); sb->s_fs_info = NULL; return -EINVAL; }
static int udf_fill_super(struct super_block *sb, void *options, int silent) { int i; int ret; struct inode *inode = NULL; struct udf_options uopt; struct kernel_lb_addr rootdir, fileset; struct udf_sb_info *sbi; uopt.flags = (1 << UDF_FLAG_USE_AD_IN_ICB) | (1 << UDF_FLAG_STRICT); uopt.uid = -1; uopt.gid = -1; uopt.umask = 0; uopt.fmode = UDF_INVALID_MODE; uopt.dmode = UDF_INVALID_MODE; sbi = kzalloc(sizeof(struct udf_sb_info), GFP_KERNEL); if (!sbi) return -ENOMEM; sb->s_fs_info = sbi; mutex_init(&sbi->s_alloc_mutex); if (!udf_parse_options((char *)options, &uopt, false)) goto error_out; if (uopt.flags & (1 << UDF_FLAG_UTF8) && uopt.flags & (1 << UDF_FLAG_NLS_MAP)) { udf_err(sb, "utf8 cannot be combined with iocharset\n"); goto error_out; } #ifdef CONFIG_UDF_NLS if ((uopt.flags & (1 << UDF_FLAG_NLS_MAP)) && !uopt.nls_map) { uopt.nls_map = load_nls_default(); if (!uopt.nls_map) uopt.flags &= ~(1 << UDF_FLAG_NLS_MAP); else udf_debug("Using default NLS map\n"); } #endif if (!(uopt.flags & (1 << UDF_FLAG_NLS_MAP))) uopt.flags |= (1 << UDF_FLAG_UTF8); fileset.logicalBlockNum = 0xFFFFFFFF; fileset.partitionReferenceNum = 0xFFFF; sbi->s_flags = uopt.flags; sbi->s_uid = uopt.uid; sbi->s_gid = uopt.gid; sbi->s_umask = uopt.umask; sbi->s_fmode = uopt.fmode; sbi->s_dmode = uopt.dmode; sbi->s_nls_map = uopt.nls_map; rwlock_init(&sbi->s_cred_lock); if (uopt.session == 0xFFFFFFFF) sbi->s_session = udf_get_last_session(sb); else sbi->s_session = uopt.session; udf_debug("Multi-session=%d\n", sbi->s_session); /* Fill in the rest of the superblock */ sb->s_op = &udf_sb_ops; sb->s_export_op = &udf_export_ops; sb->s_dirt = 0; sb->s_magic = UDF_SUPER_MAGIC; sb->s_time_gran = 1000; if (uopt.flags & (1 << UDF_FLAG_BLOCKSIZE_SET)) { ret = udf_load_vrs(sb, &uopt, silent, &fileset); } else { uopt.blocksize = bdev_logical_block_size(sb->s_bdev); ret = udf_load_vrs(sb, &uopt, silent, &fileset); if (!ret && uopt.blocksize != UDF_DEFAULT_BLOCKSIZE) { if (!silent) pr_notice("Rescanning with blocksize %d\n", UDF_DEFAULT_BLOCKSIZE); uopt.blocksize = UDF_DEFAULT_BLOCKSIZE; ret = udf_load_vrs(sb, &uopt, silent, &fileset); } } if (!ret) { udf_warn(sb, "No partition found (1)\n"); goto error_out; } udf_debug("Lastblock=%d\n", sbi->s_last_block); if (sbi->s_lvid_bh) { struct logicalVolIntegrityDescImpUse *lvidiu = udf_sb_lvidiu(sbi); uint16_t minUDFReadRev = le16_to_cpu(lvidiu->minUDFReadRev); uint16_t minUDFWriteRev = le16_to_cpu(lvidiu->minUDFWriteRev); /* uint16_t maxUDFWriteRev = le16_to_cpu(lvidiu->maxUDFWriteRev); */ if (minUDFReadRev > UDF_MAX_READ_VERSION) { udf_err(sb, "minUDFReadRev=%x (max is %x)\n", le16_to_cpu(lvidiu->minUDFReadRev), UDF_MAX_READ_VERSION); goto error_out; } else if (minUDFWriteRev > UDF_MAX_WRITE_VERSION) sb->s_flags |= MS_RDONLY; sbi->s_udfrev = minUDFWriteRev; if (minUDFReadRev >= UDF_VERS_USE_EXTENDED_FE) UDF_SET_FLAG(sb, UDF_FLAG_USE_EXTENDED_FE); if (minUDFReadRev >= UDF_VERS_USE_STREAMS) UDF_SET_FLAG(sb, UDF_FLAG_USE_STREAMS); } if (!sbi->s_partitions) { udf_warn(sb, "No partition found (2)\n"); goto error_out; } if (sbi->s_partmaps[sbi->s_partition].s_partition_flags & UDF_PART_FLAG_READ_ONLY) { pr_notice("Partition marked readonly; forcing readonly mount\n"); sb->s_flags |= MS_RDONLY; } if (udf_find_fileset(sb, &fileset, &rootdir)) { udf_warn(sb, "No fileset found\n"); goto error_out; } if (!silent) { struct timestamp ts; udf_time_to_disk_stamp(&ts, sbi->s_record_time); udf_info("Mounting volume '%s', timestamp %04u/%02u/%02u %02u:%02u (%x)\n", sbi->s_volume_ident, le16_to_cpu(ts.year), ts.month, ts.day, ts.hour, ts.minute, le16_to_cpu(ts.typeAndTimezone)); } if (!(sb->s_flags & MS_RDONLY)) udf_open_lvid(sb); /* Assign the root inode */ /* assign inodes by physical block number */ /* perhaps it's not extensible enough, but for now ... */ inode = udf_iget(sb, &rootdir); if (!inode) { udf_err(sb, "Error in udf_iget, block=%d, partition=%d\n", rootdir.logicalBlockNum, rootdir.partitionReferenceNum); goto error_out; } /* Allocate a dentry for the root inode */ sb->s_root = d_make_root(inode); if (!sb->s_root) { udf_err(sb, "Couldn't allocate root dentry\n"); goto error_out; } sb->s_maxbytes = MAX_LFS_FILESIZE; sb->s_max_links = UDF_MAX_LINKS; return 0; error_out: if (sbi->s_vat_inode) iput(sbi->s_vat_inode); if (sbi->s_partitions) for (i = 0; i < sbi->s_partitions; i++) udf_free_partition(&sbi->s_partmaps[i]); #ifdef CONFIG_UDF_NLS if (UDF_QUERY_FLAG(sb, UDF_FLAG_NLS_MAP)) unload_nls(sbi->s_nls_map); #endif if (!(sb->s_flags & MS_RDONLY)) udf_close_lvid(sb); brelse(sbi->s_lvid_bh); kfree(sbi->s_partmaps); kfree(sbi); sb->s_fs_info = NULL; return -EINVAL; }
C
linux
0
null
null
null
https://github.com/chromium/chromium/commit/b9e2ecab97a8a7f3cce06951ab92a3eaef559206
b9e2ecab97a8a7f3cce06951ab92a3eaef559206
Do not discount a MANUAL_SUBFRAME load just because it involved some redirects. R=brettw BUG=21353 TEST=none Review URL: http://codereview.chromium.org/246073 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@27887 0039d316-1c4b-4281-b951-d872f2087c98
void JavascriptGo(std::string distance) { GURL url("javascript:history.go('" + distance + "')"); ASSERT_TRUE(tab_->NavigateToURL(url)); }
void JavascriptGo(std::string distance) { GURL url("javascript:history.go('" + distance + "')"); ASSERT_TRUE(tab_->NavigateToURL(url)); }
C
Chrome
0
CVE-2013-2857
https://www.cvedetails.com/cve/CVE-2013-2857/
CWE-416
https://github.com/chromium/chromium/commit/7d085fbb43b21e959900b94f191588fd10546a94
7d085fbb43b21e959900b94f191588fd10546a94
Error event was fired synchronously blowing away the input element from underneath. Remove the FIXME and fire it asynchronously using errorEventSender(). BUG=240124 Review URL: https://chromiumcodereview.appspot.com/14741011 git-svn-id: svn://svn.chromium.org/blink/trunk@150232 bbb929c8-8fbe-4397-9dbb-9b2b20218538
void ImageLoader::setImageWithoutConsideringPendingLoadEvent(CachedImage* newImage) { ASSERT(m_failedLoadURL.isEmpty()); CachedImage* oldImage = m_image.get(); if (newImage != oldImage) { m_image = newImage; if (m_hasPendingBeforeLoadEvent) { beforeLoadEventSender().cancelEvent(this); m_hasPendingBeforeLoadEvent = false; } if (m_hasPendingLoadEvent) { loadEventSender().cancelEvent(this); m_hasPendingLoadEvent = false; } if (m_hasPendingErrorEvent) { errorEventSender().cancelEvent(this); m_hasPendingErrorEvent = false; } m_imageComplete = true; if (newImage) newImage->addClient(this); if (oldImage) oldImage->removeClient(this); } if (RenderImageResource* imageResource = renderImageResource()) imageResource->resetAnimation(); }
void ImageLoader::setImageWithoutConsideringPendingLoadEvent(CachedImage* newImage) { ASSERT(m_failedLoadURL.isEmpty()); CachedImage* oldImage = m_image.get(); if (newImage != oldImage) { m_image = newImage; if (m_hasPendingBeforeLoadEvent) { beforeLoadEventSender().cancelEvent(this); m_hasPendingBeforeLoadEvent = false; } if (m_hasPendingLoadEvent) { loadEventSender().cancelEvent(this); m_hasPendingLoadEvent = false; } if (m_hasPendingErrorEvent) { errorEventSender().cancelEvent(this); m_hasPendingErrorEvent = false; } m_imageComplete = true; if (newImage) newImage->addClient(this); if (oldImage) oldImage->removeClient(this); } if (RenderImageResource* imageResource = renderImageResource()) imageResource->resetAnimation(); }
C
Chrome
0
CVE-2014-8172
https://www.cvedetails.com/cve/CVE-2014-8172/
CWE-17
https://github.com/torvalds/linux/commit/eee5cc2702929fd41cce28058dc6d6717f723f87
eee5cc2702929fd41cce28058dc6d6717f723f87
get rid of s_files and files_lock The only thing we need it for is alt-sysrq-r (emergency remount r/o) and these days we can do just as well without going through the list of files. Signed-off-by: Al Viro <[email protected]>
struct file *file_open_root(struct dentry *dentry, struct vfsmount *mnt, const char *filename, int flags) { struct open_flags op; int err = build_open_flags(flags, 0, &op); if (err) return ERR_PTR(err); if (flags & O_CREAT) return ERR_PTR(-EINVAL); if (!filename && (flags & O_DIRECTORY)) if (!dentry->d_inode->i_op->lookup) return ERR_PTR(-ENOTDIR); return do_file_open_root(dentry, mnt, filename, &op); }
struct file *file_open_root(struct dentry *dentry, struct vfsmount *mnt, const char *filename, int flags) { struct open_flags op; int err = build_open_flags(flags, 0, &op); if (err) return ERR_PTR(err); if (flags & O_CREAT) return ERR_PTR(-EINVAL); if (!filename && (flags & O_DIRECTORY)) if (!dentry->d_inode->i_op->lookup) return ERR_PTR(-ENOTDIR); return do_file_open_root(dentry, mnt, filename, &op); }
C
linux
0
CVE-2016-6720
https://www.cvedetails.com/cve/CVE-2016-6720/
CWE-200
https://android.googlesource.com/platform/frameworks/av/+/0f177948ae2640bfe4d70f8e4248e106406b3b0a
0f177948ae2640bfe4d70f8e4248e106406b3b0a
DO NOT MERGE: IOMX: work against metadata buffer spoofing - Prohibit direct set/getParam/Settings for extensions meant for OMXNodeInstance alone. This disallows enabling metadata mode without the knowledge of OMXNodeInstance. - Use a backup buffer for metadata mode buffers and do not directly share with clients. - Disallow setting up metadata mode/tunneling/input surface after first sendCommand. - Disallow store-meta for input cross process. - Disallow emptyBuffer for surface input (via IOMX). - Fix checking for input surface. Bug: 29422020 Change-Id: I801c77b80e703903f62e42d76fd2e76a34e4bc8e (cherry picked from commit 7c3c2fa3e233c656fc8c2fc2a6634b3ecf8a23e8)
OMX_U32 getPortIndex() { return mPortIndex; }
OMX_U32 getPortIndex() { return mPortIndex; }
C
Android
0
CVE-2016-1625
https://www.cvedetails.com/cve/CVE-2016-1625/
CWE-264
https://github.com/chromium/chromium/commit/41cc463ecc5f0ba708a2c8282a7e7208ca7daa57
41cc463ecc5f0ba708a2c8282a7e7208ca7daa57
Remove some unused includes in headless/ Bug: Change-Id: Icb5351bb6112fc89e36dab82c15f32887dab9217 Reviewed-on: https://chromium-review.googlesource.com/720594 Reviewed-by: David Vallet <[email protected]> Commit-Queue: Iris Uy <[email protected]> Cr-Commit-Position: refs/heads/master@{#509313}
HeadlessDevToolsManagerDelegate::HeadlessDevToolsManagerDelegate( base::WeakPtr<HeadlessBrowserImpl> browser) : browser_(std::move(browser)) { command_map_["Target.createTarget"] = base::Bind( &HeadlessDevToolsManagerDelegate::CreateTarget, base::Unretained(this)); command_map_["Target.closeTarget"] = base::Bind( &HeadlessDevToolsManagerDelegate::CloseTarget, base::Unretained(this)); command_map_["Target.createBrowserContext"] = base::Bind(&HeadlessDevToolsManagerDelegate::CreateBrowserContext, base::Unretained(this)); command_map_["Target.disposeBrowserContext"] = base::Bind(&HeadlessDevToolsManagerDelegate::DisposeBrowserContext, base::Unretained(this)); command_map_["Browser.close"] = base::Bind( &HeadlessDevToolsManagerDelegate::Close, base::Unretained(this)); command_map_["Browser.getWindowForTarget"] = base::Bind(&HeadlessDevToolsManagerDelegate::GetWindowForTarget, base::Unretained(this)); command_map_["Browser.getWindowBounds"] = base::Bind(&HeadlessDevToolsManagerDelegate::GetWindowBounds, base::Unretained(this)); command_map_["Browser.setWindowBounds"] = base::Bind(&HeadlessDevToolsManagerDelegate::SetWindowBounds, base::Unretained(this)); command_map_["HeadlessExperimental.enable"] = base::Bind(&HeadlessDevToolsManagerDelegate::EnableHeadlessExperimental, base::Unretained(this)); command_map_["HeadlessExperimental.disable"] = base::Bind(&HeadlessDevToolsManagerDelegate::DisableHeadlessExperimental, base::Unretained(this)); unhandled_command_map_["Network.emulateNetworkConditions"] = base::Bind(&HeadlessDevToolsManagerDelegate::EmulateNetworkConditions, base::Unretained(this)); unhandled_command_map_["Network.disable"] = base::Bind( &HeadlessDevToolsManagerDelegate::NetworkDisable, base::Unretained(this)); async_command_map_["Page.printToPDF"] = base::Bind( &HeadlessDevToolsManagerDelegate::PrintToPDF, base::Unretained(this)); async_command_map_["HeadlessExperimental.beginFrame"] = base::Bind( &HeadlessDevToolsManagerDelegate::BeginFrame, base::Unretained(this)); }
HeadlessDevToolsManagerDelegate::HeadlessDevToolsManagerDelegate( base::WeakPtr<HeadlessBrowserImpl> browser) : browser_(std::move(browser)) { command_map_["Target.createTarget"] = base::Bind( &HeadlessDevToolsManagerDelegate::CreateTarget, base::Unretained(this)); command_map_["Target.closeTarget"] = base::Bind( &HeadlessDevToolsManagerDelegate::CloseTarget, base::Unretained(this)); command_map_["Target.createBrowserContext"] = base::Bind(&HeadlessDevToolsManagerDelegate::CreateBrowserContext, base::Unretained(this)); command_map_["Target.disposeBrowserContext"] = base::Bind(&HeadlessDevToolsManagerDelegate::DisposeBrowserContext, base::Unretained(this)); command_map_["Browser.close"] = base::Bind( &HeadlessDevToolsManagerDelegate::Close, base::Unretained(this)); command_map_["Browser.getWindowForTarget"] = base::Bind(&HeadlessDevToolsManagerDelegate::GetWindowForTarget, base::Unretained(this)); command_map_["Browser.getWindowBounds"] = base::Bind(&HeadlessDevToolsManagerDelegate::GetWindowBounds, base::Unretained(this)); command_map_["Browser.setWindowBounds"] = base::Bind(&HeadlessDevToolsManagerDelegate::SetWindowBounds, base::Unretained(this)); command_map_["HeadlessExperimental.enable"] = base::Bind(&HeadlessDevToolsManagerDelegate::EnableHeadlessExperimental, base::Unretained(this)); command_map_["HeadlessExperimental.disable"] = base::Bind(&HeadlessDevToolsManagerDelegate::DisableHeadlessExperimental, base::Unretained(this)); unhandled_command_map_["Network.emulateNetworkConditions"] = base::Bind(&HeadlessDevToolsManagerDelegate::EmulateNetworkConditions, base::Unretained(this)); unhandled_command_map_["Network.disable"] = base::Bind( &HeadlessDevToolsManagerDelegate::NetworkDisable, base::Unretained(this)); async_command_map_["Page.printToPDF"] = base::Bind( &HeadlessDevToolsManagerDelegate::PrintToPDF, base::Unretained(this)); async_command_map_["HeadlessExperimental.beginFrame"] = base::Bind( &HeadlessDevToolsManagerDelegate::BeginFrame, base::Unretained(this)); }
C
Chrome
0
CVE-2015-8746
https://www.cvedetails.com/cve/CVE-2015-8746/
null
https://github.com/torvalds/linux/commit/18e3b739fdc826481c6a1335ce0c5b19b3d415da
18e3b739fdc826481c6a1335ce0c5b19b3d415da
NFS: Fix a NULL pointer dereference of migration recovery ops for v4.2 client ---Steps to Reproduce-- <nfs-server> # cat /etc/exports /nfs/referal *(rw,insecure,no_subtree_check,no_root_squash,crossmnt) /nfs/old *(ro,insecure,subtree_check,root_squash,crossmnt) <nfs-client> # mount -t nfs nfs-server:/nfs/ /mnt/ # ll /mnt/*/ <nfs-server> # cat /etc/exports /nfs/referal *(rw,insecure,no_subtree_check,no_root_squash,crossmnt,refer=/nfs/old/@nfs-server) /nfs/old *(ro,insecure,subtree_check,root_squash,crossmnt) # service nfs restart <nfs-client> # ll /mnt/*/ --->>>>> oops here [ 5123.102925] BUG: unable to handle kernel NULL pointer dereference at (null) [ 5123.103363] IP: [<ffffffffa03ed38b>] nfs4_proc_get_locations+0x9b/0x120 [nfsv4] [ 5123.103752] PGD 587b9067 PUD 3cbf5067 PMD 0 [ 5123.104131] Oops: 0000 [#1] [ 5123.104529] Modules linked in: nfsv4(OE) nfs(OE) fscache(E) nfsd(OE) xfs libcrc32c iscsi_tcp libiscsi_tcp libiscsi scsi_transport_iscsi coretemp crct10dif_pclmul crc32_pclmul crc32c_intel ghash_clmulni_intel ppdev vmw_balloon parport_pc parport i2c_piix4 shpchp auth_rpcgss nfs_acl vmw_vmci lockd grace sunrpc vmwgfx drm_kms_helper ttm drm mptspi serio_raw scsi_transport_spi e1000 mptscsih mptbase ata_generic pata_acpi [last unloaded: nfsd] [ 5123.105887] CPU: 0 PID: 15853 Comm: ::1-manager Tainted: G OE 4.2.0-rc6+ #214 [ 5123.106358] Hardware name: VMware, Inc. VMware Virtual Platform/440BX Desktop Reference Platform, BIOS 6.00 05/20/2014 [ 5123.106860] task: ffff88007620f300 ti: ffff88005877c000 task.ti: ffff88005877c000 [ 5123.107363] RIP: 0010:[<ffffffffa03ed38b>] [<ffffffffa03ed38b>] nfs4_proc_get_locations+0x9b/0x120 [nfsv4] [ 5123.107909] RSP: 0018:ffff88005877fdb8 EFLAGS: 00010246 [ 5123.108435] RAX: ffff880053f3bc00 RBX: ffff88006ce6c908 RCX: ffff880053a0d240 [ 5123.108968] RDX: ffffea0000e6d940 RSI: ffff8800399a0000 RDI: ffff88006ce6c908 [ 5123.109503] RBP: ffff88005877fe28 R08: ffffffff81c708a0 R09: 0000000000000000 [ 5123.110045] R10: 00000000000001a2 R11: ffff88003ba7f5c8 R12: ffff880054c55800 [ 5123.110618] R13: 0000000000000000 R14: ffff880053a0d240 R15: ffff880053a0d240 [ 5123.111169] FS: 0000000000000000(0000) GS:ffffffff81c27000(0000) knlGS:0000000000000000 [ 5123.111726] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 5123.112286] CR2: 0000000000000000 CR3: 0000000054cac000 CR4: 00000000001406f0 [ 5123.112888] Stack: [ 5123.113458] ffffea0000e6d940 ffff8800399a0000 00000000000167d0 0000000000000000 [ 5123.114049] 0000000000000000 0000000000000000 0000000000000000 00000000a7ec82c6 [ 5123.114662] ffff88005877fe18 ffffea0000e6d940 ffff8800399a0000 ffff880054c55800 [ 5123.115264] Call Trace: [ 5123.115868] [<ffffffffa03fb44b>] nfs4_try_migration+0xbb/0x220 [nfsv4] [ 5123.116487] [<ffffffffa03fcb3b>] nfs4_run_state_manager+0x4ab/0x7b0 [nfsv4] [ 5123.117104] [<ffffffffa03fc690>] ? nfs4_do_reclaim+0x510/0x510 [nfsv4] [ 5123.117813] [<ffffffff810a4527>] kthread+0xd7/0xf0 [ 5123.118456] [<ffffffff810a4450>] ? kthread_worker_fn+0x160/0x160 [ 5123.119108] [<ffffffff816d9cdf>] ret_from_fork+0x3f/0x70 [ 5123.119723] [<ffffffff810a4450>] ? kthread_worker_fn+0x160/0x160 [ 5123.120329] Code: 4c 8b 6a 58 74 17 eb 52 48 8d 55 a8 89 c6 4c 89 e7 e8 4a b5 ff ff 8b 45 b0 85 c0 74 1c 4c 89 f9 48 8b 55 90 48 8b 75 98 48 89 df <41> ff 55 00 3d e8 d8 ff ff 41 89 c6 74 cf 48 8b 4d c8 65 48 33 [ 5123.121643] RIP [<ffffffffa03ed38b>] nfs4_proc_get_locations+0x9b/0x120 [nfsv4] [ 5123.122308] RSP <ffff88005877fdb8> [ 5123.122942] CR2: 0000000000000000 Fixes: ec011fe847 ("NFS: Introduce a vector of migration recovery ops") Cc: [email protected] # v3.13+ Signed-off-by: Kinglong Mee <[email protected]> Signed-off-by: Trond Myklebust <[email protected]>
static int _nfs4_do_set_security_label(struct inode *inode, struct nfs4_label *ilabel, struct nfs_fattr *fattr, struct nfs4_label *olabel) { struct iattr sattr = {0}; struct nfs_server *server = NFS_SERVER(inode); const u32 bitmask[3] = { 0, 0, FATTR4_WORD2_SECURITY_LABEL }; struct nfs_setattrargs arg = { .fh = NFS_FH(inode), .iap = &sattr, .server = server, .bitmask = bitmask, .label = ilabel, }; struct nfs_setattrres res = { .fattr = fattr, .label = olabel, .server = server, }; struct rpc_message msg = { .rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_SETATTR], .rpc_argp = &arg, .rpc_resp = &res, }; int status; nfs4_stateid_copy(&arg.stateid, &zero_stateid); status = nfs4_call_sync(server->client, server, &msg, &arg.seq_args, &res.seq_res, 1); if (status) dprintk("%s failed: %d\n", __func__, status); return status; }
static int _nfs4_do_set_security_label(struct inode *inode, struct nfs4_label *ilabel, struct nfs_fattr *fattr, struct nfs4_label *olabel) { struct iattr sattr = {0}; struct nfs_server *server = NFS_SERVER(inode); const u32 bitmask[3] = { 0, 0, FATTR4_WORD2_SECURITY_LABEL }; struct nfs_setattrargs arg = { .fh = NFS_FH(inode), .iap = &sattr, .server = server, .bitmask = bitmask, .label = ilabel, }; struct nfs_setattrres res = { .fattr = fattr, .label = olabel, .server = server, }; struct rpc_message msg = { .rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_SETATTR], .rpc_argp = &arg, .rpc_resp = &res, }; int status; nfs4_stateid_copy(&arg.stateid, &zero_stateid); status = nfs4_call_sync(server->client, server, &msg, &arg.seq_args, &res.seq_res, 1); if (status) dprintk("%s failed: %d\n", __func__, status); return status; }
C
linux
0
CVE-2013-2146
https://www.cvedetails.com/cve/CVE-2013-2146/
CWE-20
https://github.com/torvalds/linux/commit/f1923820c447e986a9da0fc6bf60c1dccdf0408e
f1923820c447e986a9da0fc6bf60c1dccdf0408e
perf/x86: Fix offcore_rsp valid mask for SNB/IVB The valid mask for both offcore_response_0 and offcore_response_1 was wrong for SNB/SNB-EP, IVB/IVB-EP. It was possible to write to reserved bit and cause a GP fault crashing the kernel. This patch fixes the problem by correctly marking the reserved bits in the valid mask for all the processors mentioned above. A distinction between desktop and server parts is introduced because bits 24-30 are only available on the server parts. This version of the patch is just a rebase to perf/urgent tree and should apply to older kernels as well. Signed-off-by: Stephane Eranian <[email protected]> Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Signed-off-by: Ingo Molnar <[email protected]>
static void intel_fixup_er(struct perf_event *event, int idx) { event->hw.extra_reg.idx = idx; if (idx == EXTRA_REG_RSP_0) { event->hw.config &= ~INTEL_ARCH_EVENT_MASK; event->hw.config |= 0x01b7; event->hw.extra_reg.reg = MSR_OFFCORE_RSP_0; } else if (idx == EXTRA_REG_RSP_1) { event->hw.config &= ~INTEL_ARCH_EVENT_MASK; event->hw.config |= 0x01bb; event->hw.extra_reg.reg = MSR_OFFCORE_RSP_1; } }
static void intel_fixup_er(struct perf_event *event, int idx) { event->hw.extra_reg.idx = idx; if (idx == EXTRA_REG_RSP_0) { event->hw.config &= ~INTEL_ARCH_EVENT_MASK; event->hw.config |= 0x01b7; event->hw.extra_reg.reg = MSR_OFFCORE_RSP_0; } else if (idx == EXTRA_REG_RSP_1) { event->hw.config &= ~INTEL_ARCH_EVENT_MASK; event->hw.config |= 0x01bb; event->hw.extra_reg.reg = MSR_OFFCORE_RSP_1; } }
C
linux
0
CVE-2017-5104
https://www.cvedetails.com/cve/CVE-2017-5104/
CWE-20
https://github.com/chromium/chromium/commit/adca986a53b31b6da4cb22f8e755f6856daea89a
adca986a53b31b6da4cb22f8e755f6856daea89a
Don't show current RenderWidgetHostView while interstitial is showing. Also moves interstitial page tracking from RenderFrameHostManager to WebContents, since interstitial pages are not frame-specific. This was necessary for subframes to detect if an interstitial page is showing. BUG=729105 TEST=See comment 13 of bug for repro steps CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_site_isolation Review-Url: https://codereview.chromium.org/2938313002 Cr-Commit-Position: refs/heads/master@{#480117}
void RenderFrameHostManager::CreateProxiesForNewNamedFrame() { if (!SiteIsolationPolicy::AreCrossProcessFramesPossible()) return; DCHECK(!frame_tree_node_->frame_name().empty()); FrameTreeNode* opener = frame_tree_node_->opener(); if (!opener || !frame_tree_node_->IsMainFrame()) return; SiteInstance* current_instance = render_frame_host_->GetSiteInstance(); for (FrameTreeNode* ancestor = opener->parent(); ancestor; ancestor = ancestor->parent()) { RenderFrameHostImpl* ancestor_rfh = ancestor->current_frame_host(); if (ancestor_rfh->GetSiteInstance() != current_instance) CreateRenderFrameProxy(ancestor_rfh->GetSiteInstance()); } }
void RenderFrameHostManager::CreateProxiesForNewNamedFrame() { if (!SiteIsolationPolicy::AreCrossProcessFramesPossible()) return; DCHECK(!frame_tree_node_->frame_name().empty()); FrameTreeNode* opener = frame_tree_node_->opener(); if (!opener || !frame_tree_node_->IsMainFrame()) return; SiteInstance* current_instance = render_frame_host_->GetSiteInstance(); for (FrameTreeNode* ancestor = opener->parent(); ancestor; ancestor = ancestor->parent()) { RenderFrameHostImpl* ancestor_rfh = ancestor->current_frame_host(); if (ancestor_rfh->GetSiteInstance() != current_instance) CreateRenderFrameProxy(ancestor_rfh->GetSiteInstance()); } }
C
Chrome
0
CVE-2012-5375
https://www.cvedetails.com/cve/CVE-2012-5375/
CWE-310
https://github.com/torvalds/linux/commit/9c52057c698fb96f8f07e7a4bcf4801a092bda89
9c52057c698fb96f8f07e7a4bcf4801a092bda89
Btrfs: fix hash overflow handling The handling for directory crc hash overflows was fairly obscure, split_leaf returns EOVERFLOW when we try to extend the item and that is supposed to bubble up to userland. For a while it did so, but along the way we added better handling of errors and forced the FS readonly if we hit IO errors during the directory insertion. Along the way, we started testing only for EEXIST and the EOVERFLOW case was dropped. The end result is that we may force the FS readonly if we catch a directory hash bucket overflow. This fixes a few problem spots. First I add tests for EOVERFLOW in the places where we can safely just return the error up the chain. btrfs_rename is harder though, because it tries to insert the new directory item only after it has already unlinked anything the rename was going to overwrite. Rather than adding very complex logic, I added a helper to test for the hash overflow case early while it is still safe to bail out. Snapshot and subvolume creation had a similar problem, so they are using the new helper now too. Signed-off-by: Chris Mason <[email protected]> Reported-by: Pascal Junod <[email protected]>
int btrfs_commit_transaction_async(struct btrfs_trans_handle *trans, struct btrfs_root *root, int wait_for_unblock) { struct btrfs_async_commit *ac; struct btrfs_transaction *cur_trans; ac = kmalloc(sizeof(*ac), GFP_NOFS); if (!ac) return -ENOMEM; INIT_DELAYED_WORK(&ac->work, do_async_commit); ac->root = root; ac->newtrans = btrfs_join_transaction(root); if (IS_ERR(ac->newtrans)) { int err = PTR_ERR(ac->newtrans); kfree(ac); return err; } /* take transaction reference */ cur_trans = trans->transaction; atomic_inc(&cur_trans->use_count); btrfs_end_transaction(trans, root); /* * Tell lockdep we've released the freeze rwsem, since the * async commit thread will be the one to unlock it. */ if (trans->type < TRANS_JOIN_NOLOCK) rwsem_release( &root->fs_info->sb->s_writers.lock_map[SB_FREEZE_FS-1], 1, _THIS_IP_); schedule_delayed_work(&ac->work, 0); /* wait for transaction to start and unblock */ if (wait_for_unblock) wait_current_trans_commit_start_and_unblock(root, cur_trans); else wait_current_trans_commit_start(root, cur_trans); if (current->journal_info == trans) current->journal_info = NULL; put_transaction(cur_trans); return 0; }
int btrfs_commit_transaction_async(struct btrfs_trans_handle *trans, struct btrfs_root *root, int wait_for_unblock) { struct btrfs_async_commit *ac; struct btrfs_transaction *cur_trans; ac = kmalloc(sizeof(*ac), GFP_NOFS); if (!ac) return -ENOMEM; INIT_DELAYED_WORK(&ac->work, do_async_commit); ac->root = root; ac->newtrans = btrfs_join_transaction(root); if (IS_ERR(ac->newtrans)) { int err = PTR_ERR(ac->newtrans); kfree(ac); return err; } /* take transaction reference */ cur_trans = trans->transaction; atomic_inc(&cur_trans->use_count); btrfs_end_transaction(trans, root); /* * Tell lockdep we've released the freeze rwsem, since the * async commit thread will be the one to unlock it. */ if (trans->type < TRANS_JOIN_NOLOCK) rwsem_release( &root->fs_info->sb->s_writers.lock_map[SB_FREEZE_FS-1], 1, _THIS_IP_); schedule_delayed_work(&ac->work, 0); /* wait for transaction to start and unblock */ if (wait_for_unblock) wait_current_trans_commit_start_and_unblock(root, cur_trans); else wait_current_trans_commit_start(root, cur_trans); if (current->journal_info == trans) current->journal_info = NULL; put_transaction(cur_trans); return 0; }
C
linux
0
CVE-2014-3200
https://www.cvedetails.com/cve/CVE-2014-3200/
null
https://github.com/chromium/chromium/commit/c0947dabeaa10da67798c1bbc668dca4b280cad5
c0947dabeaa10da67798c1bbc668dca4b280cad5
[Contextual Search] Change "Now on Tap" to "Contextual Cards" BUG=644934 Review-Url: https://codereview.chromium.org/2361163003 Cr-Commit-Position: refs/heads/master@{#420899}
base::string16 TemplateURL::GenerateKeyword(const GURL& url) { DCHECK(url.is_valid()); base::string16 keyword = url_formatter::StripWWW( url_formatter::IDNToUnicode(url.host())); return keyword.empty() ? base::ASCIIToUTF16("www") : keyword; }
base::string16 TemplateURL::GenerateKeyword(const GURL& url) { DCHECK(url.is_valid()); base::string16 keyword = url_formatter::StripWWW( url_formatter::IDNToUnicode(url.host())); return keyword.empty() ? base::ASCIIToUTF16("www") : keyword; }
C
Chrome
0
CVE-2012-5139
https://www.cvedetails.com/cve/CVE-2012-5139/
CWE-416
https://github.com/chromium/chromium/commit/9e417dae2833230a651989bb4e56b835355dda39
9e417dae2833230a651989bb4e56b835355dda39
Tests were marked as Flaky. BUG=151811,151810 [email protected],[email protected] NOTRY=true Review URL: https://chromiumcodereview.appspot.com/10968052 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@158204 0039d316-1c4b-4281-b951-d872f2087c98
static std::string error_headers() { return URLRequestTestJob::test_error_headers(); }
static std::string error_headers() { return URLRequestTestJob::test_error_headers(); }
C
Chrome
0
null
null
null
https://github.com/chromium/chromium/commit/b7e899141194fa27d55a990e38ae8bdcc5183a90
b7e899141194fa27d55a990e38ae8bdcc5183a90
C++ readability change for cindylau. BUG=none TEST=none Review URL: http://codereview.chromium.org/2090008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@48733 0039d316-1c4b-4281-b951-d872f2087c98
bool CookiesFunction::ParseUrl(const DictionaryValue* details, GURL* url) { bool CookiesFunction::ParseUrl(const DictionaryValue* details, GURL* url, bool check_host_permissions) { DCHECK(details && url); std::string url_string; // Get the URL string or return false. EXTENSION_FUNCTION_VALIDATE(details->GetString(keys::kUrlKey, &url_string)); *url = GURL(url_string); if (!url->is_valid()) { error_ = ExtensionErrorUtils::FormatErrorMessage( keys::kInvalidUrlError, url_string); return false; } // Check against host permissions if needed. if (check_host_permissions && !GetExtension()->HasHostPermission(*url)) { error_ = ExtensionErrorUtils::FormatErrorMessage( keys::kNoHostPermissionsError, url->spec()); return false; } return true; }
bool CookiesFunction::ParseUrl(const DictionaryValue* details, GURL* url) { DCHECK(details && url); std::string url_string; EXTENSION_FUNCTION_VALIDATE(details->GetString(keys::kUrlKey, &url_string)); *url = GURL(url_string); if (!url->is_valid()) { error_ = ExtensionErrorUtils::FormatErrorMessage( keys::kInvalidUrlError, url_string); return false; } return true; }
C
Chrome
1
CVE-2013-0904
https://www.cvedetails.com/cve/CVE-2013-0904/
CWE-119
https://github.com/chromium/chromium/commit/b2b21468c1f7f08b30a7c1755316f6026c50eb2a
b2b21468c1f7f08b30a7c1755316f6026c50eb2a
Separate repaint and layout requirements of StyleDifference (Step 1) Previously StyleDifference was an enum that proximately bigger values imply smaller values (e.g. StyleDifferenceLayout implies StyleDifferenceRepaint). This causes unnecessary repaints in some cases on layout change. Convert StyleDifference to a structure containing relatively independent flags. This change doesn't directly improve the result, but can make further repaint optimizations possible. Step 1 doesn't change any functionality. RenderStyle still generate the legacy StyleDifference enum when comparing styles and convert the result to the new StyleDifference. Implicit requirements are not handled during the conversion. Converted call sites to use the new StyleDifference according to the following conversion rules: - diff == StyleDifferenceEqual (&& !context) => diff.hasNoChange() - diff == StyleDifferenceRepaint => diff.needsRepaintObjectOnly() - diff == StyleDifferenceRepaintLayer => diff.needsRepaintLayer() - diff == StyleDifferenceRepaint || diff == StyleDifferenceRepaintLayer => diff.needsRepaintLayer() - diff >= StyleDifferenceRepaint => diff.needsRepaint() || diff.needsLayout() - diff >= StyleDifferenceRepaintLayer => diff.needsRepaintLayer() || diff.needsLayout() - diff > StyleDifferenceRepaintLayer => diff.needsLayout() - diff == StyleDifferencePositionedMovementLayoutOnly => diff.needsPositionedMovementLayoutOnly() - diff == StyleDifferenceLayout => diff.needsFullLayout() BUG=358460 TEST=All existing layout tests. [email protected], [email protected], [email protected] Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=171983 Review URL: https://codereview.chromium.org/236203020 git-svn-id: svn://svn.chromium.org/blink/trunk@172331 bbb929c8-8fbe-4397-9dbb-9b2b20218538
RenderBlockFlow::MarginValues RenderBlockFlow::marginValuesForChild(RenderBox* child) const { LayoutUnit childBeforePositive = 0; LayoutUnit childBeforeNegative = 0; LayoutUnit childAfterPositive = 0; LayoutUnit childAfterNegative = 0; LayoutUnit beforeMargin = 0; LayoutUnit afterMargin = 0; RenderBlockFlow* childRenderBlockFlow = child->isRenderBlockFlow() ? toRenderBlockFlow(child) : 0; if (!child->isWritingModeRoot()) { if (childRenderBlockFlow) { childBeforePositive = childRenderBlockFlow->maxPositiveMarginBefore(); childBeforeNegative = childRenderBlockFlow->maxNegativeMarginBefore(); childAfterPositive = childRenderBlockFlow->maxPositiveMarginAfter(); childAfterNegative = childRenderBlockFlow->maxNegativeMarginAfter(); } else { beforeMargin = child->marginBefore(); afterMargin = child->marginAfter(); } } else if (child->isHorizontalWritingMode() == isHorizontalWritingMode()) { if (childRenderBlockFlow) { childBeforePositive = childRenderBlockFlow->maxPositiveMarginAfter(); childBeforeNegative = childRenderBlockFlow->maxNegativeMarginAfter(); childAfterPositive = childRenderBlockFlow->maxPositiveMarginBefore(); childAfterNegative = childRenderBlockFlow->maxNegativeMarginBefore(); } else { beforeMargin = child->marginAfter(); afterMargin = child->marginBefore(); } } else { beforeMargin = marginBeforeForChild(child); afterMargin = marginAfterForChild(child); } if (beforeMargin) { if (beforeMargin > 0) childBeforePositive = beforeMargin; else childBeforeNegative = -beforeMargin; } if (afterMargin) { if (afterMargin > 0) childAfterPositive = afterMargin; else childAfterNegative = -afterMargin; } return RenderBlockFlow::MarginValues(childBeforePositive, childBeforeNegative, childAfterPositive, childAfterNegative); }
RenderBlockFlow::MarginValues RenderBlockFlow::marginValuesForChild(RenderBox* child) const { LayoutUnit childBeforePositive = 0; LayoutUnit childBeforeNegative = 0; LayoutUnit childAfterPositive = 0; LayoutUnit childAfterNegative = 0; LayoutUnit beforeMargin = 0; LayoutUnit afterMargin = 0; RenderBlockFlow* childRenderBlockFlow = child->isRenderBlockFlow() ? toRenderBlockFlow(child) : 0; if (!child->isWritingModeRoot()) { if (childRenderBlockFlow) { childBeforePositive = childRenderBlockFlow->maxPositiveMarginBefore(); childBeforeNegative = childRenderBlockFlow->maxNegativeMarginBefore(); childAfterPositive = childRenderBlockFlow->maxPositiveMarginAfter(); childAfterNegative = childRenderBlockFlow->maxNegativeMarginAfter(); } else { beforeMargin = child->marginBefore(); afterMargin = child->marginAfter(); } } else if (child->isHorizontalWritingMode() == isHorizontalWritingMode()) { if (childRenderBlockFlow) { childBeforePositive = childRenderBlockFlow->maxPositiveMarginAfter(); childBeforeNegative = childRenderBlockFlow->maxNegativeMarginAfter(); childAfterPositive = childRenderBlockFlow->maxPositiveMarginBefore(); childAfterNegative = childRenderBlockFlow->maxNegativeMarginBefore(); } else { beforeMargin = child->marginAfter(); afterMargin = child->marginBefore(); } } else { beforeMargin = marginBeforeForChild(child); afterMargin = marginAfterForChild(child); } if (beforeMargin) { if (beforeMargin > 0) childBeforePositive = beforeMargin; else childBeforeNegative = -beforeMargin; } if (afterMargin) { if (afterMargin > 0) childAfterPositive = afterMargin; else childAfterNegative = -afterMargin; } return RenderBlockFlow::MarginValues(childBeforePositive, childBeforeNegative, childAfterPositive, childAfterNegative); }
C
Chrome
0
CVE-2013-6663
https://www.cvedetails.com/cve/CVE-2013-6663/
CWE-399
https://github.com/chromium/chromium/commit/cace1e6998293b9b025d4bbdaf5cb5b6a1c2efb4
cace1e6998293b9b025d4bbdaf5cb5b6a1c2efb4
Fix crash when resizing a view destroys the render tree This is a simple fix for not holding a renderer across FrameView resizes. Calling view->resize() can destroy renderers so this patch updates SVGImage::setContainerSize to query the renderer after the resize is complete. A similar issue does not exist for the dom tree which is not destroyed. BUG=344492 Review URL: https://codereview.chromium.org/178043006 git-svn-id: svn://svn.chromium.org/blink/trunk@168113 bbb929c8-8fbe-4397-9dbb-9b2b20218538
void SVGImage::draw(GraphicsContext* context, const FloatRect& dstRect, const FloatRect& srcRect, CompositeOperator compositeOp, blink::WebBlendMode blendMode) { if (!m_page) return; GraphicsContextStateSaver stateSaver(*context); context->setCompositeOperation(compositeOp, blendMode); context->clip(enclosingIntRect(dstRect)); bool compositingRequiresTransparencyLayer = compositeOp != CompositeSourceOver || blendMode != blink::WebBlendModeNormal; float opacity = context->getNormalizedAlpha() / 255.f; bool requiresTransparencyLayer = compositingRequiresTransparencyLayer || opacity < 1; if (requiresTransparencyLayer) { context->beginTransparencyLayer(opacity); if (compositingRequiresTransparencyLayer) context->setCompositeOperation(CompositeSourceOver, blink::WebBlendModeNormal); } FloatSize scale(dstRect.width() / srcRect.width(), dstRect.height() / srcRect.height()); FloatSize topLeftOffset(srcRect.location().x() * scale.width(), srcRect.location().y() * scale.height()); FloatPoint destOffset = dstRect.location() - topLeftOffset; context->translate(destOffset.x(), destOffset.y()); context->scale(scale); FrameView* view = frameView(); view->resize(containerSize()); if (view->needsLayout()) view->layout(); view->paint(context, enclosingIntRect(srcRect)); if (requiresTransparencyLayer) context->endLayer(); stateSaver.restore(); if (imageObserver()) imageObserver()->didDraw(this); }
void SVGImage::draw(GraphicsContext* context, const FloatRect& dstRect, const FloatRect& srcRect, CompositeOperator compositeOp, blink::WebBlendMode blendMode) { if (!m_page) return; GraphicsContextStateSaver stateSaver(*context); context->setCompositeOperation(compositeOp, blendMode); context->clip(enclosingIntRect(dstRect)); bool compositingRequiresTransparencyLayer = compositeOp != CompositeSourceOver || blendMode != blink::WebBlendModeNormal; float opacity = context->getNormalizedAlpha() / 255.f; bool requiresTransparencyLayer = compositingRequiresTransparencyLayer || opacity < 1; if (requiresTransparencyLayer) { context->beginTransparencyLayer(opacity); if (compositingRequiresTransparencyLayer) context->setCompositeOperation(CompositeSourceOver, blink::WebBlendModeNormal); } FloatSize scale(dstRect.width() / srcRect.width(), dstRect.height() / srcRect.height()); FloatSize topLeftOffset(srcRect.location().x() * scale.width(), srcRect.location().y() * scale.height()); FloatPoint destOffset = dstRect.location() - topLeftOffset; context->translate(destOffset.x(), destOffset.y()); context->scale(scale); FrameView* view = frameView(); view->resize(containerSize()); if (view->needsLayout()) view->layout(); view->paint(context, enclosingIntRect(srcRect)); if (requiresTransparencyLayer) context->endLayer(); stateSaver.restore(); if (imageObserver()) imageObserver()->didDraw(this); }
C
Chrome
0
null
null
null
https://github.com/chromium/chromium/commit/bfa69d49b17f33635c79f79819b90a8d2089c4b3
bfa69d49b17f33635c79f79819b90a8d2089c4b3
Change notification cmd line enabling to use the new RuntimeEnabledFeatures code. BUG=25318 TEST=none Review URL: http://codereview.chromium.org/339093 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@30660 0039d316-1c4b-4281-b951-d872f2087c98
void RenderThread::WidgetRestored() { DCHECK(hidden_widget_count_ > 0); hidden_widget_count_--; }
void RenderThread::WidgetRestored() { DCHECK(hidden_widget_count_ > 0); hidden_widget_count_--; }
C
Chrome
0
CVE-2018-12232
https://www.cvedetails.com/cve/CVE-2018-12232/
CWE-362
https://github.com/torvalds/linux/commit/6d8c50dcb029872b298eea68cc6209c866fd3e14
6d8c50dcb029872b298eea68cc6209c866fd3e14
socket: close race condition between sock_close() and sockfs_setattr() fchownat() doesn't even hold refcnt of fd until it figures out fd is really needed (otherwise is ignored) and releases it after it resolves the path. This means sock_close() could race with sockfs_setattr(), which leads to a NULL pointer dereference since typically we set sock->sk to NULL in ->release(). As pointed out by Al, this is unique to sockfs. So we can fix this in socket layer by acquiring inode_lock in sock_close() and checking against NULL in sockfs_setattr(). sock_release() is called in many places, only the sock_close() path matters here. And fortunately, this should not affect normal sock_close() as it is only called when the last fd refcnt is gone. It only affects sock_close() with a parallel sockfs_setattr() in progress, which is not common. Fixes: 86741ec25462 ("net: core: Add a UID field to struct sock.") Reported-by: shankarapailoor <[email protected]> Cc: Tetsuo Handa <[email protected]> Cc: Lorenzo Colitti <[email protected]> Cc: Al Viro <[email protected]> Signed-off-by: Cong Wang <[email protected]> Signed-off-by: David S. Miller <[email protected]>
static bool skb_is_swtx_tstamp(const struct sk_buff *skb, int false_tstamp) { return skb->tstamp && !false_tstamp && skb_is_err_queue(skb); }
static bool skb_is_swtx_tstamp(const struct sk_buff *skb, int false_tstamp) { return skb->tstamp && !false_tstamp && skb_is_err_queue(skb); }
C
linux
0
CVE-2015-6763
https://www.cvedetails.com/cve/CVE-2015-6763/
null
https://github.com/chromium/chromium/commit/f1574f25e1402e748bf2bd7e28ce3dd96ceb1ca4
f1574f25e1402e748bf2bd7e28ce3dd96ceb1ca4
MacViews: Enable secure text input for password Textfields. In Cocoa the NSTextInputContext automatically enables secure text input when activated and it's in the secure text entry mode. RenderWidgetHostViewMac did the similar thing for ages following the WebKit example. views::Textfield needs to do the same thing in a fashion that's sycnrhonized with RenderWidgetHostViewMac, otherwise the race conditions are possible when the Textfield gets focus, activates the secure text input mode and the RWHVM loses focus immediately afterwards and disables the secure text input instead of leaving it in the enabled state. BUG=818133,677220 Change-Id: I6db6c4b59e4a1a72cbb7f8c7056f71b04a3df08b Reviewed-on: https://chromium-review.googlesource.com/943064 Commit-Queue: Michail Pishchagin <[email protected]> Reviewed-by: Pavel Feldman <[email protected]> Reviewed-by: Avi Drissman <[email protected]> Reviewed-by: Peter Kasting <[email protected]> Cr-Commit-Position: refs/heads/master@{#542517}
LocalDOMWindow* LocalDOMWindow::From(const ScriptState* script_state) { v8::HandleScope scope(script_state->GetIsolate()); return blink::ToLocalDOMWindow(script_state->GetContext()); }
LocalDOMWindow* LocalDOMWindow::From(const ScriptState* script_state) { v8::HandleScope scope(script_state->GetIsolate()); return blink::ToLocalDOMWindow(script_state->GetContext()); }
C
Chrome
0
CVE-2016-5384
https://www.cvedetails.com/cve/CVE-2016-5384/
CWE-415
https://cgit.freedesktop.org/fontconfig/commit/?id=7a4a5bd7897d216f0794ca9dbce0a4a5c9d14940
7a4a5bd7897d216f0794ca9dbce0a4a5c9d14940
null
FcCacheFindByStat (struct stat *cache_stat) { FcCacheSkip *s; lock_cache (); for (s = fcCacheChains[0]; s; s = s->next[0]) if (s->cache_dev == cache_stat->st_dev && s->cache_ino == cache_stat->st_ino && s->cache_mtime == cache_stat->st_mtime) { #ifdef HAVE_STRUCT_STAT_ST_MTIM if (s->cache_mtime != cache_stat->st_mtim.tv_nsec) continue; #endif FcRefInc (&s->ref); unlock_cache (); return s->cache; } unlock_cache (); return NULL; }
FcCacheFindByStat (struct stat *cache_stat) { FcCacheSkip *s; lock_cache (); for (s = fcCacheChains[0]; s; s = s->next[0]) if (s->cache_dev == cache_stat->st_dev && s->cache_ino == cache_stat->st_ino && s->cache_mtime == cache_stat->st_mtime) { #ifdef HAVE_STRUCT_STAT_ST_MTIM if (s->cache_mtime != cache_stat->st_mtim.tv_nsec) continue; #endif FcRefInc (&s->ref); unlock_cache (); return s->cache; } unlock_cache (); return NULL; }
C
fontconfig
0
CVE-2018-12904
https://www.cvedetails.com/cve/CVE-2018-12904/
null
https://github.com/torvalds/linux/commit/727ba748e110b4de50d142edca9d6a9b7e6111d8
727ba748e110b4de50d142edca9d6a9b7e6111d8
kvm: nVMX: Enforce cpl=0 for VMX instructions VMX instructions executed inside a L1 VM will always trigger a VM exit even when executed with cpl 3. This means we must perform the privilege check in software. Fixes: 70f3aac964ae("kvm: nVMX: Remove superfluous VMX instruction fault checks") Cc: [email protected] Signed-off-by: Felix Wilhelm <[email protected]> Signed-off-by: Paolo Bonzini <[email protected]>
static int enter_vmx_operation(struct kvm_vcpu *vcpu) { struct vcpu_vmx *vmx = to_vmx(vcpu); struct vmcs *shadow_vmcs; int r; r = alloc_loaded_vmcs(&vmx->nested.vmcs02); if (r < 0) goto out_vmcs02; vmx->nested.cached_vmcs12 = kmalloc(VMCS12_SIZE, GFP_KERNEL); if (!vmx->nested.cached_vmcs12) goto out_cached_vmcs12; if (enable_shadow_vmcs) { shadow_vmcs = alloc_vmcs(); if (!shadow_vmcs) goto out_shadow_vmcs; /* mark vmcs as shadow */ shadow_vmcs->revision_id |= (1u << 31); /* init shadow vmcs */ vmcs_clear(shadow_vmcs); vmx->vmcs01.shadow_vmcs = shadow_vmcs; } hrtimer_init(&vmx->nested.preemption_timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL_PINNED); vmx->nested.preemption_timer.function = vmx_preemption_timer_fn; vmx->nested.vmxon = true; return 0; out_shadow_vmcs: kfree(vmx->nested.cached_vmcs12); out_cached_vmcs12: free_loaded_vmcs(&vmx->nested.vmcs02); out_vmcs02: return -ENOMEM; }
static int enter_vmx_operation(struct kvm_vcpu *vcpu) { struct vcpu_vmx *vmx = to_vmx(vcpu); struct vmcs *shadow_vmcs; int r; r = alloc_loaded_vmcs(&vmx->nested.vmcs02); if (r < 0) goto out_vmcs02; vmx->nested.cached_vmcs12 = kmalloc(VMCS12_SIZE, GFP_KERNEL); if (!vmx->nested.cached_vmcs12) goto out_cached_vmcs12; if (enable_shadow_vmcs) { shadow_vmcs = alloc_vmcs(); if (!shadow_vmcs) goto out_shadow_vmcs; /* mark vmcs as shadow */ shadow_vmcs->revision_id |= (1u << 31); /* init shadow vmcs */ vmcs_clear(shadow_vmcs); vmx->vmcs01.shadow_vmcs = shadow_vmcs; } hrtimer_init(&vmx->nested.preemption_timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL_PINNED); vmx->nested.preemption_timer.function = vmx_preemption_timer_fn; vmx->nested.vmxon = true; return 0; out_shadow_vmcs: kfree(vmx->nested.cached_vmcs12); out_cached_vmcs12: free_loaded_vmcs(&vmx->nested.vmcs02); out_vmcs02: return -ENOMEM; }
C
linux
0
CVE-2017-5061
https://www.cvedetails.com/cve/CVE-2017-5061/
CWE-362
https://github.com/chromium/chromium/commit/5d78b84d39bd34bc9fce9d01c0dcd5a22a330d34
5d78b84d39bd34bc9fce9d01c0dcd5a22a330d34
(Reland) Discard compositor frames from unloaded web content This is a reland of https://codereview.chromium.org/2707243005/ with a small change to fix an uninitialized memory error that fails on MSAN bots. BUG=672847 [email protected], [email protected] CQ_INCLUDE_TRYBOTS=master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_site_isolation Review-Url: https://codereview.chromium.org/2731283003 Cr-Commit-Position: refs/heads/master@{#454954}
static int GetLayersUpdateTimeHistogramBucket(size_t numLayers) { if (numLayers < 10) return 0; if (numLayers < 30) return 1; if (numLayers < 70) return 2; if (numLayers < 150) return 3; return 4; }
static int GetLayersUpdateTimeHistogramBucket(size_t numLayers) { if (numLayers < 10) return 0; if (numLayers < 30) return 1; if (numLayers < 70) return 2; if (numLayers < 150) return 3; return 4; }
C
Chrome
0
CVE-2014-2739
https://www.cvedetails.com/cve/CVE-2014-2739/
CWE-20
https://github.com/torvalds/linux/commit/b2853fd6c2d0f383dbdf7427e263eb576a633867
b2853fd6c2d0f383dbdf7427e263eb576a633867
IB/core: Don't resolve passive side RoCE L2 address in CMA REQ handler The code that resolves the passive side source MAC within the rdma_cm connection request handler was both redundant and buggy, so remove it. It was redundant since later, when an RC QP is modified to RTR state, the resolution will take place in the ib_core module. It was buggy because this callback also deals with UD SIDR exchange, for which we incorrectly looked at the REQ member of the CM event and dereferenced a random value. Fixes: dd5f03beb4f7 ("IB/core: Ethernet L2 attributes in verbs/cm structures") Signed-off-by: Moni Shoua <[email protected]> Signed-off-by: Or Gerlitz <[email protected]> Signed-off-by: Roland Dreier <[email protected]>
static int cm_lap_handler(struct cm_work *work) { struct cm_id_private *cm_id_priv; struct cm_lap_msg *lap_msg; struct ib_cm_lap_event_param *param; struct ib_mad_send_buf *msg = NULL; int ret; /* todo: verify LAP request and send reject APR if invalid. */ lap_msg = (struct cm_lap_msg *)work->mad_recv_wc->recv_buf.mad; cm_id_priv = cm_acquire_id(lap_msg->remote_comm_id, lap_msg->local_comm_id); if (!cm_id_priv) return -EINVAL; param = &work->cm_event.param.lap_rcvd; param->alternate_path = &work->path[0]; cm_format_path_from_lap(cm_id_priv, param->alternate_path, lap_msg); work->cm_event.private_data = &lap_msg->private_data; spin_lock_irq(&cm_id_priv->lock); if (cm_id_priv->id.state != IB_CM_ESTABLISHED) goto unlock; switch (cm_id_priv->id.lap_state) { case IB_CM_LAP_UNINIT: case IB_CM_LAP_IDLE: break; case IB_CM_MRA_LAP_SENT: atomic_long_inc(&work->port->counter_group[CM_RECV_DUPLICATES]. counter[CM_LAP_COUNTER]); if (cm_alloc_response_msg(work->port, work->mad_recv_wc, &msg)) goto unlock; cm_format_mra((struct cm_mra_msg *) msg->mad, cm_id_priv, CM_MSG_RESPONSE_OTHER, cm_id_priv->service_timeout, cm_id_priv->private_data, cm_id_priv->private_data_len); spin_unlock_irq(&cm_id_priv->lock); if (ib_post_send_mad(msg, NULL)) cm_free_msg(msg); goto deref; case IB_CM_LAP_RCVD: atomic_long_inc(&work->port->counter_group[CM_RECV_DUPLICATES]. counter[CM_LAP_COUNTER]); goto unlock; default: goto unlock; } cm_id_priv->id.lap_state = IB_CM_LAP_RCVD; cm_id_priv->tid = lap_msg->hdr.tid; cm_init_av_for_response(work->port, work->mad_recv_wc->wc, work->mad_recv_wc->recv_buf.grh, &cm_id_priv->av); cm_init_av_by_path(param->alternate_path, &cm_id_priv->alt_av); ret = atomic_inc_and_test(&cm_id_priv->work_count); if (!ret) list_add_tail(&work->list, &cm_id_priv->work_list); spin_unlock_irq(&cm_id_priv->lock); if (ret) cm_process_work(cm_id_priv, work); else cm_deref_id(cm_id_priv); return 0; unlock: spin_unlock_irq(&cm_id_priv->lock); deref: cm_deref_id(cm_id_priv); return -EINVAL; }
static int cm_lap_handler(struct cm_work *work) { struct cm_id_private *cm_id_priv; struct cm_lap_msg *lap_msg; struct ib_cm_lap_event_param *param; struct ib_mad_send_buf *msg = NULL; int ret; /* todo: verify LAP request and send reject APR if invalid. */ lap_msg = (struct cm_lap_msg *)work->mad_recv_wc->recv_buf.mad; cm_id_priv = cm_acquire_id(lap_msg->remote_comm_id, lap_msg->local_comm_id); if (!cm_id_priv) return -EINVAL; param = &work->cm_event.param.lap_rcvd; param->alternate_path = &work->path[0]; cm_format_path_from_lap(cm_id_priv, param->alternate_path, lap_msg); work->cm_event.private_data = &lap_msg->private_data; spin_lock_irq(&cm_id_priv->lock); if (cm_id_priv->id.state != IB_CM_ESTABLISHED) goto unlock; switch (cm_id_priv->id.lap_state) { case IB_CM_LAP_UNINIT: case IB_CM_LAP_IDLE: break; case IB_CM_MRA_LAP_SENT: atomic_long_inc(&work->port->counter_group[CM_RECV_DUPLICATES]. counter[CM_LAP_COUNTER]); if (cm_alloc_response_msg(work->port, work->mad_recv_wc, &msg)) goto unlock; cm_format_mra((struct cm_mra_msg *) msg->mad, cm_id_priv, CM_MSG_RESPONSE_OTHER, cm_id_priv->service_timeout, cm_id_priv->private_data, cm_id_priv->private_data_len); spin_unlock_irq(&cm_id_priv->lock); if (ib_post_send_mad(msg, NULL)) cm_free_msg(msg); goto deref; case IB_CM_LAP_RCVD: atomic_long_inc(&work->port->counter_group[CM_RECV_DUPLICATES]. counter[CM_LAP_COUNTER]); goto unlock; default: goto unlock; } cm_id_priv->id.lap_state = IB_CM_LAP_RCVD; cm_id_priv->tid = lap_msg->hdr.tid; cm_init_av_for_response(work->port, work->mad_recv_wc->wc, work->mad_recv_wc->recv_buf.grh, &cm_id_priv->av); cm_init_av_by_path(param->alternate_path, &cm_id_priv->alt_av); ret = atomic_inc_and_test(&cm_id_priv->work_count); if (!ret) list_add_tail(&work->list, &cm_id_priv->work_list); spin_unlock_irq(&cm_id_priv->lock); if (ret) cm_process_work(cm_id_priv, work); else cm_deref_id(cm_id_priv); return 0; unlock: spin_unlock_irq(&cm_id_priv->lock); deref: cm_deref_id(cm_id_priv); return -EINVAL; }
C
linux
0
CVE-2017-14604
https://www.cvedetails.com/cve/CVE-2017-14604/
CWE-20
https://github.com/GNOME/nautilus/commit/1630f53481f445ada0a455e9979236d31a8d3bb0
1630f53481f445ada0a455e9979236d31a8d3bb0
mime-actions: use file metadata for trusting desktop files Currently we only trust desktop files that have the executable bit set, and don't replace the displayed icon or the displayed name until it's trusted, which prevents for running random programs by a malicious desktop file. However, the executable permission is preserved if the desktop file comes from a compressed file. To prevent this, add a metadata::trusted metadata to the file once the user acknowledges the file as trusted. This adds metadata to the file, which cannot be added unless it has access to the computer. Also remove the SHEBANG "trusted" content we were putting inside the desktop file, since that doesn't add more security since it can come with the file itself. https://bugzilla.gnome.org/show_bug.cgi?id=777991
start_monitoring_file_list (NautilusDirectory *directory) { DirectoryLoadState *state; if (!directory->details->file_list_monitored) { g_assert (!directory->details->directory_load_in_progress); directory->details->file_list_monitored = TRUE; nautilus_file_list_ref (directory->details->file_list); } if (directory->details->directory_loaded || directory->details->directory_load_in_progress != NULL) { return; } if (!async_job_start (directory, "file list")) { return; } mark_all_files_unconfirmed (directory); state = g_new0 (DirectoryLoadState, 1); state->directory = directory; state->cancellable = g_cancellable_new (); state->load_mime_list_hash = istr_set_new (); state->load_file_count = 0; g_assert (directory->details->location != NULL); state->load_directory_file = nautilus_directory_get_corresponding_file (directory); state->load_directory_file->details->loading_directory = TRUE; #ifdef DEBUG_LOAD_DIRECTORY g_message ("load_directory called to monitor file list of %p", directory->details->location); #endif directory->details->directory_load_in_progress = state; g_file_enumerate_children_async (directory->details->location, NAUTILUS_FILE_DEFAULT_ATTRIBUTES, 0, /* flags */ G_PRIORITY_DEFAULT, /* prio */ state->cancellable, enumerate_children_callback, state); }
start_monitoring_file_list (NautilusDirectory *directory) { DirectoryLoadState *state; if (!directory->details->file_list_monitored) { g_assert (!directory->details->directory_load_in_progress); directory->details->file_list_monitored = TRUE; nautilus_file_list_ref (directory->details->file_list); } if (directory->details->directory_loaded || directory->details->directory_load_in_progress != NULL) { return; } if (!async_job_start (directory, "file list")) { return; } mark_all_files_unconfirmed (directory); state = g_new0 (DirectoryLoadState, 1); state->directory = directory; state->cancellable = g_cancellable_new (); state->load_mime_list_hash = istr_set_new (); state->load_file_count = 0; g_assert (directory->details->location != NULL); state->load_directory_file = nautilus_directory_get_corresponding_file (directory); state->load_directory_file->details->loading_directory = TRUE; #ifdef DEBUG_LOAD_DIRECTORY g_message ("load_directory called to monitor file list of %p", directory->details->location); #endif directory->details->directory_load_in_progress = state; g_file_enumerate_children_async (directory->details->location, NAUTILUS_FILE_DEFAULT_ATTRIBUTES, 0, /* flags */ G_PRIORITY_DEFAULT, /* prio */ state->cancellable, enumerate_children_callback, state); }
C
nautilus
0
null
null
null
https://github.com/chromium/chromium/commit/3e5dae3b38fdb566fb2b7183e810b82eb3ce6f21
3e5dae3b38fdb566fb2b7183e810b82eb3ce6f21
Use a new field trial group to enable the SWReporter BUG=533484 Review URL: https://codereview.chromium.org/1376803002 Cr-Commit-Position: refs/heads/master@{#351788}
void RegisterProfilePrefsForSwReporter( user_prefs::PrefRegistrySyncable* registry) { registry->RegisterStringPref(prefs::kSwReporterPromptVersion, ""); registry->RegisterStringPref(prefs::kSwReporterPromptSeed, ""); }
void RegisterProfilePrefsForSwReporter( user_prefs::PrefRegistrySyncable* registry) { registry->RegisterStringPref(prefs::kSwReporterPromptVersion, ""); registry->RegisterStringPref(prefs::kSwReporterPromptSeed, ""); }
C
Chrome
0
CVE-2013-7026
https://www.cvedetails.com/cve/CVE-2013-7026/
CWE-362
https://github.com/torvalds/linux/commit/a399b29dfbaaaf91162b2dc5a5875dd51bbfa2a1
a399b29dfbaaaf91162b2dc5a5875dd51bbfa2a1
ipc,shm: fix shm_file deletion races When IPC_RMID races with other shm operations there's potential for use-after-free of the shm object's associated file (shm_file). Here's the race before this patch: TASK 1 TASK 2 ------ ------ shm_rmid() ipc_lock_object() shmctl() shp = shm_obtain_object_check() shm_destroy() shum_unlock() fput(shp->shm_file) ipc_lock_object() shmem_lock(shp->shm_file) <OOPS> The oops is caused because shm_destroy() calls fput() after dropping the ipc_lock. fput() clears the file's f_inode, f_path.dentry, and f_path.mnt, which causes various NULL pointer references in task 2. I reliably see the oops in task 2 if with shmlock, shmu This patch fixes the races by: 1) set shm_file=NULL in shm_destroy() while holding ipc_object_lock(). 2) modify at risk operations to check shm_file while holding ipc_object_lock(). Example workloads, which each trigger oops... Workload 1: while true; do id=$(shmget 1 4096) shm_rmid $id & shmlock $id & wait done The oops stack shows accessing NULL f_inode due to racing fput: _raw_spin_lock shmem_lock SyS_shmctl Workload 2: while true; do id=$(shmget 1 4096) shmat $id 4096 & shm_rmid $id & wait done The oops stack is similar to workload 1 due to NULL f_inode: touch_atime shmem_mmap shm_mmap mmap_region do_mmap_pgoff do_shmat SyS_shmat Workload 3: while true; do id=$(shmget 1 4096) shmlock $id shm_rmid $id & shmunlock $id & wait done The oops stack shows second fput tripping on an NULL f_inode. The first fput() completed via from shm_destroy(), but a racing thread did a get_file() and queued this fput(): locks_remove_flock __fput ____fput task_work_run do_notify_resume int_signal Fixes: c2c737a0461e ("ipc,shm: shorten critical region for shmat") Fixes: 2caacaa82a51 ("ipc,shm: shorten critical region for shmctl") Signed-off-by: Greg Thelen <[email protected]> Cc: Davidlohr Bueso <[email protected]> Cc: Rik van Riel <[email protected]> Cc: Manfred Spraul <[email protected]> Cc: <[email protected]> # 3.10.17+ 3.11.6+ Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
static inline void shm_rmid(struct ipc_namespace *ns, struct shmid_kernel *s) { ipc_rmid(&shm_ids(ns), &s->shm_perm); }
static inline void shm_rmid(struct ipc_namespace *ns, struct shmid_kernel *s) { ipc_rmid(&shm_ids(ns), &s->shm_perm); }
C
linux
0
CVE-2015-3418
https://www.cvedetails.com/cve/CVE-2015-3418/
CWE-369
https://cgit.freedesktop.org/xorg/xserver/commit/?id=dc777c346d5d452a53b13b917c45f6a1bad2f20b
dc777c346d5d452a53b13b917c45f6a1bad2f20b
null
ProcChangeAccessControl(ClientPtr client) { REQUEST(xSetAccessControlReq); REQUEST_SIZE_MATCH(xSetAccessControlReq); if ((stuff->mode != EnableAccess) && (stuff->mode != DisableAccess)) { client->errorValue = stuff->mode; return BadValue; } return ChangeAccessControl(client, stuff->mode == EnableAccess); }
ProcChangeAccessControl(ClientPtr client) { REQUEST(xSetAccessControlReq); REQUEST_SIZE_MATCH(xSetAccessControlReq); if ((stuff->mode != EnableAccess) && (stuff->mode != DisableAccess)) { client->errorValue = stuff->mode; return BadValue; } return ChangeAccessControl(client, stuff->mode == EnableAccess); }
C
xserver
0
CVE-2014-3185
https://www.cvedetails.com/cve/CVE-2014-3185/
CWE-119
https://github.com/torvalds/linux/commit/6817ae225cd650fb1c3295d769298c38b1eba818
6817ae225cd650fb1c3295d769298c38b1eba818
USB: whiteheat: Added bounds checking for bulk command response This patch fixes a potential security issue in the whiteheat USB driver which might allow a local attacker to cause kernel memory corrpution. This is due to an unchecked memcpy into a fixed size buffer (of 64 bytes). On EHCI and XHCI busses it's possible to craft responses greater than 64 bytes leading a buffer overflow. Signed-off-by: James Forshaw <[email protected]> Cc: stable <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
static int whiteheat_port_remove(struct usb_serial_port *port) { struct whiteheat_private *info; info = usb_get_serial_port_data(port); kfree(info); return 0; }
static int whiteheat_port_remove(struct usb_serial_port *port) { struct whiteheat_private *info; info = usb_get_serial_port_data(port); kfree(info); return 0; }
C
linux
0
CVE-2016-9557
https://www.cvedetails.com/cve/CVE-2016-9557/
CWE-190
https://github.com/mdadams/jasper/commit/d42b2388f7f8e0332c846675133acea151fc557a
d42b2388f7f8e0332c846675133acea151fc557a
The generation of the configuration file jas_config.h has been completely reworked in order to avoid pollution of the global namespace. Some problematic types like uchar, ulong, and friends have been replaced with names with a jas_ prefix. An option max_samples has been added to the BMP and JPEG decoders to restrict the maximum size of image that they can decode. This change was made as a (possibly temporary) fix to address security concerns. A max_samples command-line option has also been added to imginfo. Whether an image component (for jas_image_t) is stored in memory or on disk is now based on the component size (rather than the image size). Some debug log message were added. Some new integer overflow checks were added. Some new safe integer add/multiply functions were added. More pre-C99 cruft was removed. JasPer has numerous "hacks" to handle pre-C99 compilers. JasPer now assumes C99 support. So, this pre-C99 cruft is unnecessary and can be removed. The regression jasper-doublefree-mem_close.jpg has been re-enabled. Theoretically, it should work more predictably now.
void jas_tmr_stop(jas_tmr_t *tmr) { if (getrusage(RUSAGE_SELF, &tmr->stop) < 0) { abort(); } }
void jas_tmr_stop(jas_tmr_t *tmr) { if (getrusage(RUSAGE_SELF, &tmr->stop) < 0) { abort(); } }
C
jasper
0
CVE-2017-12146
https://www.cvedetails.com/cve/CVE-2017-12146/
CWE-362
https://github.com/torvalds/linux/commit/6265539776a0810b7ce6398c27866ddb9c6bd154
6265539776a0810b7ce6398c27866ddb9c6bd154
driver core: platform: fix race condition with driver_override The driver_override implementation is susceptible to race condition when different threads are reading vs storing a different driver override. Add locking to avoid race condition. Fixes: 3d713e0e382e ("driver core: platform: add device binding path 'driver_override'") Cc: [email protected] Signed-off-by: Adrian Salido <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
int platform_pm_poweroff(struct device *dev) { struct device_driver *drv = dev->driver; int ret = 0; if (!drv) return 0; if (drv->pm) { if (drv->pm->poweroff) ret = drv->pm->poweroff(dev); } else { ret = platform_legacy_suspend(dev, PMSG_HIBERNATE); } return ret; }
int platform_pm_poweroff(struct device *dev) { struct device_driver *drv = dev->driver; int ret = 0; if (!drv) return 0; if (drv->pm) { if (drv->pm->poweroff) ret = drv->pm->poweroff(dev); } else { ret = platform_legacy_suspend(dev, PMSG_HIBERNATE); } return ret; }
C
linux
0
CVE-2016-6491
https://www.cvedetails.com/cve/CVE-2016-6491/
CWE-125
https://github.com/ImageMagick/ImageMagick/commit/dd84447b63a71fa8c3f47071b09454efc667767b
dd84447b63a71fa8c3f47071b09454efc667767b
Prevent buffer overflow (bug report from Ibrahim el-sayed)
MagickExport void DestroyImageProperties(Image *image) { assert(image != (Image *) NULL); assert(image->signature == MagickCoreSignature); if (image->debug != MagickFalse) (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename); if (image->properties != (void *) NULL) image->properties=(void *) DestroySplayTree((SplayTreeInfo *) image->properties); }
MagickExport void DestroyImageProperties(Image *image) { assert(image != (Image *) NULL); assert(image->signature == MagickCoreSignature); if (image->debug != MagickFalse) (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename); if (image->properties != (void *) NULL) image->properties=(void *) DestroySplayTree((SplayTreeInfo *) image->properties); }
C
ImageMagick
0
CVE-2018-17206
https://www.cvedetails.com/cve/CVE-2018-17206/
null
https://github.com/openvswitch/ovs/commit/9237a63c47bd314b807cda0bd2216264e82edbe8
9237a63c47bd314b807cda0bd2216264e82edbe8
ofp-actions: Avoid buffer overread in BUNDLE action decoding. Reported-at: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=9052 Signed-off-by: Ben Pfaff <[email protected]> Acked-by: Justin Pettit <[email protected]>
ofpacts_parse_instructions(const char *s, struct ofpbuf *ofpacts, enum ofputil_protocol *usable_protocols) { return ofpacts_parse_copy(s, ofpacts, usable_protocols, true, 0); }
ofpacts_parse_instructions(const char *s, struct ofpbuf *ofpacts, enum ofputil_protocol *usable_protocols) { return ofpacts_parse_copy(s, ofpacts, usable_protocols, true, 0); }
C
ovs
0
CVE-2019-12589
https://www.cvedetails.com/cve/CVE-2019-12589/
CWE-284
https://github.com/netblue30/firejail/commit/eecf35c2f8249489a1d3e512bb07f0d427183134
eecf35c2f8249489a1d3e512bb07f0d427183134
mount runtime seccomp files read-only (#2602) avoid creating locations in the file system that are both writable and executable (in this case for processes with euid of the user). for the same reason also remove user owned libfiles when it is not needed any more
static void save_nogroups(void) { if (arg_nogroups == 0) return; FILE *fp = fopen(RUN_GROUPS_CFG, "w"); if (fp) { fprintf(fp, "\n"); SET_PERMS_STREAM(fp, 0, 0, 0644); // assume mode 0644 fclose(fp); } else { fprintf(stderr, "Error: cannot save nogroups state\n"); exit(1); } }
static void save_nogroups(void) { if (arg_nogroups == 0) return; FILE *fp = fopen(RUN_GROUPS_CFG, "w"); if (fp) { fprintf(fp, "\n"); SET_PERMS_STREAM(fp, 0, 0, 0644); // assume mode 0644 fclose(fp); } else { fprintf(stderr, "Error: cannot save nogroups state\n"); exit(1); } }
C
firejail
0
CVE-2017-5580
https://www.cvedetails.com/cve/CVE-2017-5580/
CWE-119
https://cgit.freedesktop.org/virglrenderer/commit/src/gallium/auxiliary/tgsi/tgsi_text.c?id=28894a30a17a84529be102b21118e55d6c9f23fa
28894a30a17a84529be102b21118e55d6c9f23fa
null
parse_register_file_bracket( struct translate_ctx *ctx, uint *file ) { if (!parse_file( &ctx->cur, file )) { report_error( ctx, "Unknown register file" ); return FALSE; } eat_opt_white( &ctx->cur ); if (*ctx->cur != '[') { report_error( ctx, "Expected `['" ); return FALSE; } ctx->cur++; return TRUE; }
parse_register_file_bracket( struct translate_ctx *ctx, uint *file ) { if (!parse_file( &ctx->cur, file )) { report_error( ctx, "Unknown register file" ); return FALSE; } eat_opt_white( &ctx->cur ); if (*ctx->cur != '[') { report_error( ctx, "Expected `['" ); return FALSE; } ctx->cur++; return TRUE; }
C
virglrenderer
0
CVE-2014-2739
https://www.cvedetails.com/cve/CVE-2014-2739/
CWE-20
https://github.com/torvalds/linux/commit/b2853fd6c2d0f383dbdf7427e263eb576a633867
b2853fd6c2d0f383dbdf7427e263eb576a633867
IB/core: Don't resolve passive side RoCE L2 address in CMA REQ handler The code that resolves the passive side source MAC within the rdma_cm connection request handler was both redundant and buggy, so remove it. It was redundant since later, when an RC QP is modified to RTR state, the resolution will take place in the ib_core module. It was buggy because this callback also deals with UD SIDR exchange, for which we incorrectly looked at the REQ member of the CM event and dereferenced a random value. Fixes: dd5f03beb4f7 ("IB/core: Ethernet L2 attributes in verbs/cm structures") Signed-off-by: Moni Shoua <[email protected]> Signed-off-by: Or Gerlitz <[email protected]> Signed-off-by: Roland Dreier <[email protected]>
static void cm_format_rep(struct cm_rep_msg *rep_msg, struct cm_id_private *cm_id_priv, struct ib_cm_rep_param *param) { cm_format_mad_hdr(&rep_msg->hdr, CM_REP_ATTR_ID, cm_id_priv->tid); rep_msg->local_comm_id = cm_id_priv->id.local_id; rep_msg->remote_comm_id = cm_id_priv->id.remote_id; cm_rep_set_starting_psn(rep_msg, cpu_to_be32(param->starting_psn)); rep_msg->resp_resources = param->responder_resources; cm_rep_set_target_ack_delay(rep_msg, cm_id_priv->av.port->cm_dev->ack_delay); cm_rep_set_failover(rep_msg, param->failover_accepted); cm_rep_set_rnr_retry_count(rep_msg, param->rnr_retry_count); rep_msg->local_ca_guid = cm_id_priv->id.device->node_guid; if (cm_id_priv->qp_type != IB_QPT_XRC_TGT) { rep_msg->initiator_depth = param->initiator_depth; cm_rep_set_flow_ctrl(rep_msg, param->flow_control); cm_rep_set_srq(rep_msg, param->srq); cm_rep_set_local_qpn(rep_msg, cpu_to_be32(param->qp_num)); } else { cm_rep_set_srq(rep_msg, 1); cm_rep_set_local_eecn(rep_msg, cpu_to_be32(param->qp_num)); } if (param->private_data && param->private_data_len) memcpy(rep_msg->private_data, param->private_data, param->private_data_len); }
static void cm_format_rep(struct cm_rep_msg *rep_msg, struct cm_id_private *cm_id_priv, struct ib_cm_rep_param *param) { cm_format_mad_hdr(&rep_msg->hdr, CM_REP_ATTR_ID, cm_id_priv->tid); rep_msg->local_comm_id = cm_id_priv->id.local_id; rep_msg->remote_comm_id = cm_id_priv->id.remote_id; cm_rep_set_starting_psn(rep_msg, cpu_to_be32(param->starting_psn)); rep_msg->resp_resources = param->responder_resources; cm_rep_set_target_ack_delay(rep_msg, cm_id_priv->av.port->cm_dev->ack_delay); cm_rep_set_failover(rep_msg, param->failover_accepted); cm_rep_set_rnr_retry_count(rep_msg, param->rnr_retry_count); rep_msg->local_ca_guid = cm_id_priv->id.device->node_guid; if (cm_id_priv->qp_type != IB_QPT_XRC_TGT) { rep_msg->initiator_depth = param->initiator_depth; cm_rep_set_flow_ctrl(rep_msg, param->flow_control); cm_rep_set_srq(rep_msg, param->srq); cm_rep_set_local_qpn(rep_msg, cpu_to_be32(param->qp_num)); } else { cm_rep_set_srq(rep_msg, 1); cm_rep_set_local_eecn(rep_msg, cpu_to_be32(param->qp_num)); } if (param->private_data && param->private_data_len) memcpy(rep_msg->private_data, param->private_data, param->private_data_len); }
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 <[email protected]> Reviewed-by: Lei Zhang <[email protected]> Reviewed-by: John Abd-El-Malek <[email protected]> Reviewed-by: Daniel Cheng <[email protected]> Reviewed-by: Sadrul Chowdhury <[email protected]> Reviewed-by: Yuzhu Shen <[email protected]> Reviewed-by: Robert Sesek <[email protected]> Commit-Queue: Ken Rockot <[email protected]> Cr-Commit-Position: refs/heads/master@{#530268}
void StartCapture(int client_id, const media::VideoCaptureParams& params) { const auto state_update_callback = base::Bind( &VideoCaptureImplTest::OnStateUpdate, base::Unretained(this)); const auto frame_ready_callback = base::Bind(&VideoCaptureImplTest::OnFrameReady, base::Unretained(this)); video_capture_impl_->StartCapture(client_id, params, state_update_callback, frame_ready_callback); }
void StartCapture(int client_id, const media::VideoCaptureParams& params) { const auto state_update_callback = base::Bind( &VideoCaptureImplTest::OnStateUpdate, base::Unretained(this)); const auto frame_ready_callback = base::Bind(&VideoCaptureImplTest::OnFrameReady, base::Unretained(this)); video_capture_impl_->StartCapture(client_id, params, state_update_callback, frame_ready_callback); }
C
Chrome
0
CVE-2011-3209
https://www.cvedetails.com/cve/CVE-2011-3209/
CWE-189
https://github.com/torvalds/linux/commit/f8bd2258e2d520dff28c855658bd24bdafb5102d
f8bd2258e2d520dff28c855658bd24bdafb5102d
remove div_long_long_rem x86 is the only arch right now, which provides an optimized for div_long_long_rem and it has the downside that one has to be very careful that the divide doesn't overflow. The API is a little akward, as the arguments for the unsigned divide are signed. The signed version also doesn't handle a negative divisor and produces worse code on 64bit archs. There is little incentive to keep this API alive, so this converts the few users to the new API. Signed-off-by: Roman Zippel <[email protected]> Cc: Ralf Baechle <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Thomas Gleixner <[email protected]> Cc: john stultz <[email protected]> Cc: Christoph Lameter <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
static int validate_slab(struct kmem_cache *s, struct page *page, unsigned long *map) { void *p; void *addr = page_address(page); if (!check_slab(s, page) || !on_freelist(s, page, NULL)) return 0; /* Now we know that a valid freelist exists */ bitmap_zero(map, page->objects); for_each_free_object(p, s, page->freelist) { set_bit(slab_index(p, s, addr), map); if (!check_object(s, page, p, 0)) return 0; } for_each_object(p, s, addr, page->objects) if (!test_bit(slab_index(p, s, addr), map)) if (!check_object(s, page, p, 1)) return 0; return 1; }
static int validate_slab(struct kmem_cache *s, struct page *page, unsigned long *map) { void *p; void *addr = page_address(page); if (!check_slab(s, page) || !on_freelist(s, page, NULL)) return 0; /* Now we know that a valid freelist exists */ bitmap_zero(map, page->objects); for_each_free_object(p, s, page->freelist) { set_bit(slab_index(p, s, addr), map); if (!check_object(s, page, p, 0)) return 0; } for_each_object(p, s, addr, page->objects) if (!test_bit(slab_index(p, s, addr), map)) if (!check_object(s, page, p, 1)) return 0; return 1; }
C
linux
0
CVE-2018-1000040
https://www.cvedetails.com/cve/CVE-2018-1000040/
CWE-20
http://git.ghostscript.com/?p=mupdf.git;a=commitdiff;h=83d4dae44c71816c084a635550acc1a51529b881;hp=f597300439e62f5e921f0d7b1e880b5c1a1f1607
83d4dae44c71816c084a635550acc1a51529b881
null
fz_get_icc_link(fz_context *ctx, const fz_colorspace *dst, int dst_extras, const fz_colorspace *src, int src_extras, const fz_colorspace *prf, const fz_color_params *rend, int num_bytes, int copy_spots, int *src_n) { fz_icclink *link = NULL; fz_iccprofile *src_icc = NULL; fz_iccprofile *dst_icc = dst->data; fz_iccprofile *prf_icc = NULL; fz_link_key *key = NULL; fz_icclink *new_link; assert(!copy_spots || src_extras == dst_extras); if (prf != NULL) prf_icc = prf->data; if (fz_colorspace_is_icc(ctx, src)) src_icc = src->data; else if (fz_colorspace_is_cal(ctx, src)) { fz_cal_colorspace *cal; cal = src->data; src_icc = cal->profile; /* Check if we have any work to do. */ if (src_icc == NULL) src_icc = fz_icc_from_cal(ctx, src); if (src_icc->cmm_handle == NULL) { fz_cmm_init_profile(ctx, src_icc); /* The CMM failed to make a profile. Use the default. */ if (src_icc->cmm_handle == NULL) { switch (src->n) { case 1: src_icc = fz_device_gray(ctx)->data; break; case 3: src_icc = fz_device_rgb(ctx)->data; break; case 4: src_icc = fz_device_cmyk(ctx)->data; break; default: fz_throw(ctx, FZ_ERROR_GENERIC, "Poorly formed Cal color space"); } /* To avoid repeated failures building the pdf-cal color space, * assign the default profile. */ fz_cmm_fin_profile(ctx, src_icc); cal->profile = src_icc; } } } else src_icc = get_base_icc_profile(ctx, src); if (src_icc == NULL) fz_throw(ctx, FZ_ERROR_GENERIC, "Profile missing during link creation"); *src_n = src_icc->num_devcomp; fz_var(link); fz_var(key); if (rend == NULL) rend = fz_default_color_params(ctx); fz_try(ctx) { /* Check the storable to see if we have a copy. */ key = fz_malloc_struct(ctx, fz_link_key); key->refs = 1; memcpy(&key->dst_md5, dst_icc->md5, 16); memcpy(&key->src_md5, src_icc->md5, 16); key->rend.ri = rend->ri; key->rend.bp = rend->bp; key->src_extras = src_extras; key->dst_extras = dst_extras; key->depth = num_bytes; key->proof = (prf_icc != NULL); key->copy_spots = copy_spots; link = fz_find_item(ctx, fz_drop_link_imp, key, &fz_link_store_type); /* Not found. Make new one add to store. */ if (link == NULL) { link = fz_new_icc_link(ctx, dst_icc, dst_extras, src_icc, src_extras, prf_icc, rend, num_bytes, copy_spots); new_link = fz_store_item(ctx, key, link, sizeof(fz_icclink), &fz_link_store_type); if (new_link != NULL) { /* Found one while adding! Perhaps from another thread? */ fz_drop_icclink(ctx, link); link = new_link; } } } fz_always(ctx) { fz_drop_link_key(ctx, key); } fz_catch(ctx) { /* Ignore any error that came just from the enstoring. */ if (link == NULL) fz_rethrow(ctx); } return link; }
fz_get_icc_link(fz_context *ctx, const fz_colorspace *dst, int dst_extras, const fz_colorspace *src, int src_extras, const fz_colorspace *prf, const fz_color_params *rend, int num_bytes, int copy_spots, int *src_n) { fz_icclink *link = NULL; fz_iccprofile *src_icc = NULL; fz_iccprofile *dst_icc = dst->data; fz_iccprofile *prf_icc = NULL; fz_link_key *key = NULL; fz_icclink *new_link; assert(!copy_spots || src_extras == dst_extras); if (prf != NULL) prf_icc = prf->data; if (fz_colorspace_is_icc(ctx, src)) src_icc = src->data; else if (fz_colorspace_is_cal(ctx, src)) { fz_cal_colorspace *cal; cal = src->data; src_icc = cal->profile; /* Check if we have any work to do. */ if (src_icc == NULL) src_icc = fz_icc_from_cal(ctx, src); if (src_icc->cmm_handle == NULL) { fz_cmm_init_profile(ctx, src_icc); /* The CMM failed to make a profile. Use the default. */ if (src_icc->cmm_handle == NULL) { switch (src->n) { case 1: src_icc = fz_device_gray(ctx)->data; break; case 3: src_icc = fz_device_rgb(ctx)->data; break; case 4: src_icc = fz_device_cmyk(ctx)->data; break; default: fz_throw(ctx, FZ_ERROR_GENERIC, "Poorly formed Cal color space"); } /* To avoid repeated failures building the pdf-cal color space, * assign the default profile. */ fz_cmm_fin_profile(ctx, src_icc); cal->profile = src_icc; } } } else src_icc = get_base_icc_profile(ctx, src); if (src_icc == NULL) fz_throw(ctx, FZ_ERROR_GENERIC, "Profile missing during link creation"); *src_n = src_icc->num_devcomp; fz_var(link); fz_var(key); if (rend == NULL) rend = fz_default_color_params(ctx); fz_try(ctx) { /* Check the storable to see if we have a copy. */ key = fz_malloc_struct(ctx, fz_link_key); key->refs = 1; memcpy(&key->dst_md5, dst_icc->md5, 16); memcpy(&key->src_md5, src_icc->md5, 16); key->rend.ri = rend->ri; key->rend.bp = rend->bp; key->src_extras = src_extras; key->dst_extras = dst_extras; key->depth = num_bytes; key->proof = (prf_icc != NULL); key->copy_spots = copy_spots; link = fz_find_item(ctx, fz_drop_link_imp, key, &fz_link_store_type); /* Not found. Make new one add to store. */ if (link == NULL) { link = fz_new_icc_link(ctx, dst_icc, dst_extras, src_icc, src_extras, prf_icc, rend, num_bytes, copy_spots); new_link = fz_store_item(ctx, key, link, sizeof(fz_icclink), &fz_link_store_type); if (new_link != NULL) { /* Found one while adding! Perhaps from another thread? */ fz_drop_icclink(ctx, link); link = new_link; } } } fz_always(ctx) { fz_drop_link_key(ctx, key); } fz_catch(ctx) { /* Ignore any error that came just from the enstoring. */ if (link == NULL) fz_rethrow(ctx); } return link; }
C
ghostscript
0
null
null
null
https://github.com/chromium/chromium/commit/d4cd2b2c0953ad7e9fa988c234eb9361be80fe81
d4cd2b2c0953ad7e9fa988c234eb9361be80fe81
DevTools: 'Overrides' UI overlay obstructs page and element inspector BUG=302862 [email protected] Review URL: https://codereview.chromium.org/40233006 git-svn-id: svn://svn.chromium.org/blink/trunk@160559 bbb929c8-8fbe-4397-9dbb-9b2b20218538
void InspectorResourceAgent::clearBrowserCache(ErrorString*) { m_client->clearBrowserCache(); }
void InspectorResourceAgent::clearBrowserCache(ErrorString*) { m_client->clearBrowserCache(); }
C
Chrome
0
CVE-2015-8543
https://www.cvedetails.com/cve/CVE-2015-8543/
null
https://github.com/torvalds/linux/commit/79462ad02e861803b3840cc782248c7359451cd9
79462ad02e861803b3840cc782248c7359451cd9
net: add validation for the socket syscall protocol argument 郭永刚 reported that one could simply crash the kernel as root by using a simple program: int socket_fd; struct sockaddr_in addr; addr.sin_port = 0; addr.sin_addr.s_addr = INADDR_ANY; addr.sin_family = 10; socket_fd = socket(10,3,0x40000000); connect(socket_fd , &addr,16); AF_INET, AF_INET6 sockets actually only support 8-bit protocol identifiers. inet_sock's skc_protocol field thus is sized accordingly, thus larger protocol identifiers simply cut off the higher bits and store a zero in the protocol fields. This could lead to e.g. NULL function pointer because as a result of the cut off inet_num is zero and we call down to inet_autobind, which is NULL for raw sockets. kernel: Call Trace: kernel: [<ffffffff816db90e>] ? inet_autobind+0x2e/0x70 kernel: [<ffffffff816db9a4>] inet_dgram_connect+0x54/0x80 kernel: [<ffffffff81645069>] SYSC_connect+0xd9/0x110 kernel: [<ffffffff810ac51b>] ? ptrace_notify+0x5b/0x80 kernel: [<ffffffff810236d8>] ? syscall_trace_enter_phase2+0x108/0x200 kernel: [<ffffffff81645e0e>] SyS_connect+0xe/0x10 kernel: [<ffffffff81779515>] tracesys_phase2+0x84/0x89 I found no particular commit which introduced this problem. CVE: CVE-2015-8543 Cc: Cong Wang <[email protected]> Reported-by: 郭永刚 <[email protected]> Signed-off-by: Hannes Frederic Sowa <[email protected]> Signed-off-by: David S. Miller <[email protected]>
unsigned int dn_mss_from_pmtu(struct net_device *dev, int mtu) { unsigned int mss = 230 - DN_MAX_NSP_DATA_HEADER; if (dev) { struct dn_dev *dn_db = rcu_dereference_raw(dev->dn_ptr); mtu -= LL_RESERVED_SPACE(dev); if (dn_db->use_long) mtu -= 21; else mtu -= 6; mtu -= DN_MAX_NSP_DATA_HEADER; } else { /* * 21 = long header, 16 = guess at MAC header length */ mtu -= (21 + DN_MAX_NSP_DATA_HEADER + 16); } if (mtu > mss) mss = mtu; return mss; }
unsigned int dn_mss_from_pmtu(struct net_device *dev, int mtu) { unsigned int mss = 230 - DN_MAX_NSP_DATA_HEADER; if (dev) { struct dn_dev *dn_db = rcu_dereference_raw(dev->dn_ptr); mtu -= LL_RESERVED_SPACE(dev); if (dn_db->use_long) mtu -= 21; else mtu -= 6; mtu -= DN_MAX_NSP_DATA_HEADER; } else { /* * 21 = long header, 16 = guess at MAC header length */ mtu -= (21 + DN_MAX_NSP_DATA_HEADER + 16); } if (mtu > mss) mss = mtu; return mss; }
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 <[email protected]> Reviewed-by: Kentaro Hara <[email protected]> Cr-Commit-Position: refs/heads/master@{#560434}
void LargeObjectPage::PoisonUnmarkedObjects() { HeapObjectHeader* header = GetHeapObjectHeader(); if (!header->IsMarked()) ASAN_POISON_MEMORY_REGION(header->Payload(), header->PayloadSize()); }
void LargeObjectPage::PoisonUnmarkedObjects() { HeapObjectHeader* header = GetHeapObjectHeader(); if (!header->IsMarked()) ASAN_POISON_MEMORY_REGION(header->Payload(), header->PayloadSize()); }
C
Chrome
0
null
null
null
https://github.com/chromium/chromium/commit/8876cdc1294b2a10be1724a04f864c542e2d9b6f
8876cdc1294b2a10be1724a04f864c542e2d9b6f
[SVG] Handle non-SVGAnimateElement results in calculateAnimatedValue() Currently, SVGAnimateElement::calculateAnimatedValue() assumes that the result element is a subtype of SVGAnimateElement, but that is not always the case: SMILTimeContainer::updateAnimations() may pick an SVGAnimateMotionElement for the result. This CL is a workaround - we should take a good look at the SVG animation type hierarchy and figure out why this is needed. BUG=333176 [email protected] Review URL: https://codereview.chromium.org/133893005 git-svn-id: svn://svn.chromium.org/blink/trunk@165009 bbb929c8-8fbe-4397-9dbb-9b2b20218538
void SVGAnimateElement::applyResultsToTarget() { ASSERT(m_animatedPropertyType != AnimatedTransformList || hasTagName(SVGNames::animateTransformTag)); ASSERT(m_animatedPropertyType != AnimatedUnknown); ASSERT(m_animator); if (!m_animatedType) return; if (m_animatedProperties.isEmpty()) { applyCSSPropertyToTargetAndInstances(targetElement(), attributeName(), m_animatedType->valueAsString()); return; } m_animator->animValDidChange(m_animatedProperties); notifyTargetAndInstancesAboutAnimValChange(targetElement(), attributeName()); }
void SVGAnimateElement::applyResultsToTarget() { ASSERT(m_animatedPropertyType != AnimatedTransformList || hasTagName(SVGNames::animateTransformTag)); ASSERT(m_animatedPropertyType != AnimatedUnknown); ASSERT(m_animator); if (!m_animatedType) return; if (m_animatedProperties.isEmpty()) { applyCSSPropertyToTargetAndInstances(targetElement(), attributeName(), m_animatedType->valueAsString()); return; } m_animator->animValDidChange(m_animatedProperties); notifyTargetAndInstancesAboutAnimValChange(targetElement(), attributeName()); }
C
Chrome
0
CVE-2017-9620
https://www.cvedetails.com/cve/CVE-2017-9620/
CWE-125
http://git.ghostscript.com/?p=ghostpdl.git;a=commit;h=3ee55637480d5e319a5de0481b01c3346855cbc9
3ee55637480d5e319a5de0481b01c3346855cbc9
null
xps_parse_glyphs(xps_context_t *ctx, char *base_uri, xps_resource_t *dict, xps_item_t *root) { xps_item_t *node; int code; char *fill_uri; char *opacity_mask_uri; char *bidi_level_att; /*char *caret_stops_att;*/ char *fill_att; char *font_size_att; char *font_uri_att; char *origin_x_att; char *origin_y_att; char *is_sideways_att; char *indices_att; char *unicode_att; char *style_att; char *transform_att; char *clip_att; char *opacity_att; char *opacity_mask_att; xps_item_t *transform_tag = NULL; xps_item_t *clip_tag = NULL; xps_item_t *fill_tag = NULL; xps_item_t *opacity_mask_tag = NULL; char *fill_opacity_att = NULL; xps_part_t *part; xps_font_t *font; char partname[1024]; char *subfont; gs_matrix matrix; float font_size = 10.0; int subfontid = 0; int is_sideways = 0; int bidi_level = 0; int sim_bold = 0; int sim_italic = 0; gs_matrix shear = { 1, 0, 0.36397f, 1, 0, 0 }; /* shear by 20 degrees */ /* * Extract attributes and extended attributes. */ bidi_level_att = xps_att(root, "BidiLevel"); /*caret_stops_att = xps_att(root, "CaretStops");*/ fill_att = xps_att(root, "Fill"); font_size_att = xps_att(root, "FontRenderingEmSize"); font_uri_att = xps_att(root, "FontUri"); origin_x_att = xps_att(root, "OriginX"); origin_y_att = xps_att(root, "OriginY"); is_sideways_att = xps_att(root, "IsSideways"); indices_att = xps_att(root, "Indices"); unicode_att = xps_att(root, "UnicodeString"); style_att = xps_att(root, "StyleSimulations"); transform_att = xps_att(root, "RenderTransform"); clip_att = xps_att(root, "Clip"); opacity_att = xps_att(root, "Opacity"); opacity_mask_att = xps_att(root, "OpacityMask"); for (node = xps_down(root); node; node = xps_next(node)) { if (!strcmp(xps_tag(node), "Glyphs.RenderTransform")) transform_tag = xps_down(node); if (!strcmp(xps_tag(node), "Glyphs.OpacityMask")) opacity_mask_tag = xps_down(node); if (!strcmp(xps_tag(node), "Glyphs.Clip")) clip_tag = xps_down(node); if (!strcmp(xps_tag(node), "Glyphs.Fill")) fill_tag = xps_down(node); } fill_uri = base_uri; opacity_mask_uri = base_uri; xps_resolve_resource_reference(ctx, dict, &transform_att, &transform_tag, NULL); xps_resolve_resource_reference(ctx, dict, &clip_att, &clip_tag, NULL); xps_resolve_resource_reference(ctx, dict, &fill_att, &fill_tag, &fill_uri); xps_resolve_resource_reference(ctx, dict, &opacity_mask_att, &opacity_mask_tag, &opacity_mask_uri); /* * Check that we have all the necessary information. */ if (!font_size_att || !font_uri_att || !origin_x_att || !origin_y_att) return gs_throw(-1, "missing attributes in glyphs element"); if (!indices_att && !unicode_att) return 0; /* nothing to draw */ if (is_sideways_att) is_sideways = !strcmp(is_sideways_att, "true"); if (bidi_level_att) bidi_level = atoi(bidi_level_att); /* * Find and load the font resource */ xps_absolute_path(partname, base_uri, font_uri_att, sizeof partname); subfont = strrchr(partname, '#'); if (subfont) { subfontid = atoi(subfont + 1); *subfont = 0; } font = xps_hash_lookup(ctx->font_table, partname); if (!font) { part = xps_read_part(ctx, partname); if (!part) return gs_throw1(-1, "cannot find font resource part '%s'", partname); /* deobfuscate if necessary */ if (strstr(part->name, ".odttf")) xps_deobfuscate_font_resource(ctx, part); if (strstr(part->name, ".ODTTF")) xps_deobfuscate_font_resource(ctx, part); font = xps_new_font(ctx, part->data, part->size, subfontid); if (!font) return gs_rethrow1(-1, "cannot load font resource '%s'", partname); xps_select_best_font_encoding(font); xps_hash_insert(ctx, ctx->font_table, part->name, font); /* NOTE: we kept part->name in the hashtable and part->data in the font */ xps_free(ctx, part); } if (style_att) { if (!strcmp(style_att, "BoldSimulation")) sim_bold = 1; else if (!strcmp(style_att, "ItalicSimulation")) sim_italic = 1; else if (!strcmp(style_att, "BoldItalicSimulation")) sim_bold = sim_italic = 1; } /* * Set up graphics state. */ gs_gsave(ctx->pgs); if (transform_att || transform_tag) { gs_matrix transform; if (transform_att) xps_parse_render_transform(ctx, transform_att, &transform); if (transform_tag) xps_parse_matrix_transform(ctx, transform_tag, &transform); gs_concat(ctx->pgs, &transform); } if (clip_att || clip_tag) { if (clip_att) xps_parse_abbreviated_geometry(ctx, clip_att); if (clip_tag) xps_parse_path_geometry(ctx, dict, clip_tag, 0); xps_clip(ctx); } font_size = atof(font_size_att); gs_setfont(ctx->pgs, font->font); gs_make_scaling(font_size, -font_size, &matrix); if (is_sideways) gs_matrix_rotate(&matrix, 90.0, &matrix); if (sim_italic) gs_matrix_multiply(&shear, &matrix, &matrix); gs_setcharmatrix(ctx->pgs, &matrix); gs_matrix_multiply(&matrix, &font->font->orig_FontMatrix, &font->font->FontMatrix); code = xps_begin_opacity(ctx, opacity_mask_uri, dict, opacity_att, opacity_mask_tag, false, false); if (code) { gs_grestore(ctx->pgs); return gs_rethrow(code, "cannot create transparency group"); } /* * If it's a solid color brush fill/stroke do a simple fill */ if (fill_tag && !strcmp(xps_tag(fill_tag), "SolidColorBrush")) { fill_opacity_att = xps_att(fill_tag, "Opacity"); fill_att = xps_att(fill_tag, "Color"); fill_tag = NULL; } if (fill_att) { float samples[XPS_MAX_COLORS]; gs_color_space *colorspace; xps_parse_color(ctx, base_uri, fill_att, &colorspace, samples); if (fill_opacity_att) samples[0] *= atof(fill_opacity_att); xps_set_color(ctx, colorspace, samples); if (sim_bold) { /* widening strokes by 1% of em size */ gs_setlinewidth(ctx->pgs, font_size * 0.02); gs_settextrenderingmode(ctx->pgs, 2); } code = xps_parse_glyphs_imp(ctx, font, font_size, atof(origin_x_att), atof(origin_y_att), is_sideways, bidi_level, indices_att, unicode_att, sim_bold && !ctx->preserve_tr_mode, sim_bold); if (code) { xps_end_opacity(ctx, opacity_mask_uri, dict, opacity_att, opacity_mask_tag); gs_grestore(ctx->pgs); return gs_rethrow(code, "cannot parse glyphs data"); } if (sim_bold && !ctx->preserve_tr_mode) { gs_gsave(ctx->pgs); gs_fill(ctx->pgs); gs_grestore(ctx->pgs); gs_stroke(ctx->pgs); } gs_settextrenderingmode(ctx->pgs, 0); } /* * If it's a visual brush or image, use the charpath as a clip mask to paint brush */ if (fill_tag) { ctx->fill_rule = 1; /* always use non-zero winding rule for char paths */ code = xps_parse_glyphs_imp(ctx, font, font_size, atof(origin_x_att), atof(origin_y_att), is_sideways, bidi_level, indices_att, unicode_att, 1, sim_bold); if (code) { xps_end_opacity(ctx, opacity_mask_uri, dict, opacity_att, opacity_mask_tag); gs_grestore(ctx->pgs); return gs_rethrow(code, "cannot parse glyphs data"); } code = xps_parse_brush(ctx, fill_uri, dict, fill_tag); if (code) { xps_end_opacity(ctx, opacity_mask_uri, dict, opacity_att, opacity_mask_tag); gs_grestore(ctx->pgs); return gs_rethrow(code, "cannot parse fill brush"); } } xps_end_opacity(ctx, opacity_mask_uri, dict, opacity_att, opacity_mask_tag); gs_grestore(ctx->pgs); return 0; }
xps_parse_glyphs(xps_context_t *ctx, char *base_uri, xps_resource_t *dict, xps_item_t *root) { xps_item_t *node; int code; char *fill_uri; char *opacity_mask_uri; char *bidi_level_att; /*char *caret_stops_att;*/ char *fill_att; char *font_size_att; char *font_uri_att; char *origin_x_att; char *origin_y_att; char *is_sideways_att; char *indices_att; char *unicode_att; char *style_att; char *transform_att; char *clip_att; char *opacity_att; char *opacity_mask_att; xps_item_t *transform_tag = NULL; xps_item_t *clip_tag = NULL; xps_item_t *fill_tag = NULL; xps_item_t *opacity_mask_tag = NULL; char *fill_opacity_att = NULL; xps_part_t *part; xps_font_t *font; char partname[1024]; char *subfont; gs_matrix matrix; float font_size = 10.0; int subfontid = 0; int is_sideways = 0; int bidi_level = 0; int sim_bold = 0; int sim_italic = 0; gs_matrix shear = { 1, 0, 0.36397f, 1, 0, 0 }; /* shear by 20 degrees */ /* * Extract attributes and extended attributes. */ bidi_level_att = xps_att(root, "BidiLevel"); /*caret_stops_att = xps_att(root, "CaretStops");*/ fill_att = xps_att(root, "Fill"); font_size_att = xps_att(root, "FontRenderingEmSize"); font_uri_att = xps_att(root, "FontUri"); origin_x_att = xps_att(root, "OriginX"); origin_y_att = xps_att(root, "OriginY"); is_sideways_att = xps_att(root, "IsSideways"); indices_att = xps_att(root, "Indices"); unicode_att = xps_att(root, "UnicodeString"); style_att = xps_att(root, "StyleSimulations"); transform_att = xps_att(root, "RenderTransform"); clip_att = xps_att(root, "Clip"); opacity_att = xps_att(root, "Opacity"); opacity_mask_att = xps_att(root, "OpacityMask"); for (node = xps_down(root); node; node = xps_next(node)) { if (!strcmp(xps_tag(node), "Glyphs.RenderTransform")) transform_tag = xps_down(node); if (!strcmp(xps_tag(node), "Glyphs.OpacityMask")) opacity_mask_tag = xps_down(node); if (!strcmp(xps_tag(node), "Glyphs.Clip")) clip_tag = xps_down(node); if (!strcmp(xps_tag(node), "Glyphs.Fill")) fill_tag = xps_down(node); } fill_uri = base_uri; opacity_mask_uri = base_uri; xps_resolve_resource_reference(ctx, dict, &transform_att, &transform_tag, NULL); xps_resolve_resource_reference(ctx, dict, &clip_att, &clip_tag, NULL); xps_resolve_resource_reference(ctx, dict, &fill_att, &fill_tag, &fill_uri); xps_resolve_resource_reference(ctx, dict, &opacity_mask_att, &opacity_mask_tag, &opacity_mask_uri); /* * Check that we have all the necessary information. */ if (!font_size_att || !font_uri_att || !origin_x_att || !origin_y_att) return gs_throw(-1, "missing attributes in glyphs element"); if (!indices_att && !unicode_att) return 0; /* nothing to draw */ if (is_sideways_att) is_sideways = !strcmp(is_sideways_att, "true"); if (bidi_level_att) bidi_level = atoi(bidi_level_att); /* * Find and load the font resource */ xps_absolute_path(partname, base_uri, font_uri_att, sizeof partname); subfont = strrchr(partname, '#'); if (subfont) { subfontid = atoi(subfont + 1); *subfont = 0; } font = xps_hash_lookup(ctx->font_table, partname); if (!font) { part = xps_read_part(ctx, partname); if (!part) return gs_throw1(-1, "cannot find font resource part '%s'", partname); /* deobfuscate if necessary */ if (strstr(part->name, ".odttf")) xps_deobfuscate_font_resource(ctx, part); if (strstr(part->name, ".ODTTF")) xps_deobfuscate_font_resource(ctx, part); font = xps_new_font(ctx, part->data, part->size, subfontid); if (!font) return gs_rethrow1(-1, "cannot load font resource '%s'", partname); xps_select_best_font_encoding(font); xps_hash_insert(ctx, ctx->font_table, part->name, font); /* NOTE: we kept part->name in the hashtable and part->data in the font */ xps_free(ctx, part); } if (style_att) { if (!strcmp(style_att, "BoldSimulation")) sim_bold = 1; else if (!strcmp(style_att, "ItalicSimulation")) sim_italic = 1; else if (!strcmp(style_att, "BoldItalicSimulation")) sim_bold = sim_italic = 1; } /* * Set up graphics state. */ gs_gsave(ctx->pgs); if (transform_att || transform_tag) { gs_matrix transform; if (transform_att) xps_parse_render_transform(ctx, transform_att, &transform); if (transform_tag) xps_parse_matrix_transform(ctx, transform_tag, &transform); gs_concat(ctx->pgs, &transform); } if (clip_att || clip_tag) { if (clip_att) xps_parse_abbreviated_geometry(ctx, clip_att); if (clip_tag) xps_parse_path_geometry(ctx, dict, clip_tag, 0); xps_clip(ctx); } font_size = atof(font_size_att); gs_setfont(ctx->pgs, font->font); gs_make_scaling(font_size, -font_size, &matrix); if (is_sideways) gs_matrix_rotate(&matrix, 90.0, &matrix); if (sim_italic) gs_matrix_multiply(&shear, &matrix, &matrix); gs_setcharmatrix(ctx->pgs, &matrix); gs_matrix_multiply(&matrix, &font->font->orig_FontMatrix, &font->font->FontMatrix); code = xps_begin_opacity(ctx, opacity_mask_uri, dict, opacity_att, opacity_mask_tag, false, false); if (code) { gs_grestore(ctx->pgs); return gs_rethrow(code, "cannot create transparency group"); } /* * If it's a solid color brush fill/stroke do a simple fill */ if (fill_tag && !strcmp(xps_tag(fill_tag), "SolidColorBrush")) { fill_opacity_att = xps_att(fill_tag, "Opacity"); fill_att = xps_att(fill_tag, "Color"); fill_tag = NULL; } if (fill_att) { float samples[XPS_MAX_COLORS]; gs_color_space *colorspace; xps_parse_color(ctx, base_uri, fill_att, &colorspace, samples); if (fill_opacity_att) samples[0] *= atof(fill_opacity_att); xps_set_color(ctx, colorspace, samples); if (sim_bold) { /* widening strokes by 1% of em size */ gs_setlinewidth(ctx->pgs, font_size * 0.02); gs_settextrenderingmode(ctx->pgs, 2); } code = xps_parse_glyphs_imp(ctx, font, font_size, atof(origin_x_att), atof(origin_y_att), is_sideways, bidi_level, indices_att, unicode_att, sim_bold && !ctx->preserve_tr_mode, sim_bold); if (code) { xps_end_opacity(ctx, opacity_mask_uri, dict, opacity_att, opacity_mask_tag); gs_grestore(ctx->pgs); return gs_rethrow(code, "cannot parse glyphs data"); } if (sim_bold && !ctx->preserve_tr_mode) { gs_gsave(ctx->pgs); gs_fill(ctx->pgs); gs_grestore(ctx->pgs); gs_stroke(ctx->pgs); } gs_settextrenderingmode(ctx->pgs, 0); } /* * If it's a visual brush or image, use the charpath as a clip mask to paint brush */ if (fill_tag) { ctx->fill_rule = 1; /* always use non-zero winding rule for char paths */ code = xps_parse_glyphs_imp(ctx, font, font_size, atof(origin_x_att), atof(origin_y_att), is_sideways, bidi_level, indices_att, unicode_att, 1, sim_bold); if (code) { xps_end_opacity(ctx, opacity_mask_uri, dict, opacity_att, opacity_mask_tag); gs_grestore(ctx->pgs); return gs_rethrow(code, "cannot parse glyphs data"); } code = xps_parse_brush(ctx, fill_uri, dict, fill_tag); if (code) { xps_end_opacity(ctx, opacity_mask_uri, dict, opacity_att, opacity_mask_tag); gs_grestore(ctx->pgs); return gs_rethrow(code, "cannot parse fill brush"); } } xps_end_opacity(ctx, opacity_mask_uri, dict, opacity_att, opacity_mask_tag); gs_grestore(ctx->pgs); return 0; }
C
ghostscript
0
CVE-2015-1285
https://www.cvedetails.com/cve/CVE-2015-1285/
CWE-200
https://github.com/chromium/chromium/commit/39595f8d4dffcb644d438106dcb64a30c139ff0e
39595f8d4dffcb644d438106dcb64a30c139ff0e
[reland] Do not set default wallpaper unless it should do so. [email protected], [email protected] Bug: 751382 Change-Id: Id0793dfe467f737526a95b1e66ed01fbb8860bda Reviewed-on: https://chromium-review.googlesource.com/619754 Commit-Queue: Xiaoqian Dai <[email protected]> Reviewed-by: Alexander Alekseev <[email protected]> Reviewed-by: Biao She <[email protected]> Cr-Original-Commit-Position: refs/heads/master@{#498325} Reviewed-on: https://chromium-review.googlesource.com/646430 Cr-Commit-Position: refs/heads/master@{#498982}
WallpaperManager* WallpaperManager::Get() { DCHECK(wallpaper_manager); return wallpaper_manager; }
WallpaperManager* WallpaperManager::Get() { DCHECK(wallpaper_manager); return wallpaper_manager; }
C
Chrome
0
CVE-2018-14568
https://www.cvedetails.com/cve/CVE-2018-14568/
null
https://github.com/OISF/suricata/pull/3428/commits/843d0b7a10bb45627f94764a6c5d468a24143345
843d0b7a10bb45627f94764a6c5d468a24143345
stream: support RST getting lost/ignored In case of a valid RST on a SYN, the state is switched to 'TCP_CLOSED'. However, the target of the RST may not have received it, or may not have accepted it. Also, the RST may have been injected, so the supposed sender may not actually be aware of the RST that was sent in it's name. In this case the previous behavior was to switch the state to CLOSED and accept no further TCP updates or stream reassembly. This patch changes this. It still switches the state to CLOSED, as this is by far the most likely to be correct. However, it will reconsider the state if the receiver continues to talk. To do this on each state change the previous state will be recorded in TcpSession::pstate. If a non-RST packet is received after a RST, this TcpSession::pstate is used to try to continue the conversation. If the (supposed) sender of the RST is also continueing the conversation as normal, it's highly likely it didn't send the RST. In this case a stream event is generated. Ticket: #2501 Reported-By: Kirill Shipulin
static int StreamTcpTest09 (void) { Packet *p = SCMalloc(SIZE_OF_PACKET); FAIL_IF(unlikely(p == NULL)); Flow f; ThreadVars tv; StreamTcpThread stt; TCPHdr tcph; uint8_t payload[1] = {0x42}; memset(p, 0, SIZE_OF_PACKET); PacketQueue pq; memset(&pq,0,sizeof(PacketQueue)); memset (&f, 0, sizeof(Flow)); memset(&tv, 0, sizeof (ThreadVars)); memset(&stt, 0, sizeof(StreamTcpThread)); memset(&tcph, 0, sizeof(TCPHdr)); FLOW_INITIALIZE(&f); p->flow = &f; StreamTcpUTInit(&stt.ra_ctx); stream_config.midstream = TRUE; tcph.th_win = htons(5480); tcph.th_seq = htonl(10); tcph.th_ack = htonl(20); tcph.th_flags = TH_ACK|TH_PUSH; p->tcph = &tcph; p->payload = payload; p->payload_len = 1; FAIL_IF(StreamTcpPacket(&tv, p, &stt, &pq) == -1); p->tcph->th_seq = htonl(12); p->tcph->th_ack = htonl(23); p->tcph->th_flags = TH_ACK|TH_PUSH; p->flowflags = FLOW_PKT_TOSERVER; FAIL_IF(p->flow->protoctx == NULL); StreamTcpSetSessionNoReassemblyFlag(((TcpSession *)(p->flow->protoctx)), 0); FAIL_IF(StreamTcpPacket(&tv, p, &stt, &pq) == -1); p->tcph->th_seq = htonl(11); p->tcph->th_ack = htonl(23); p->tcph->th_flags = TH_ACK|TH_PUSH; p->flowflags = FLOW_PKT_TOSERVER; FAIL_IF(StreamTcpPacket(&tv, p, &stt, &pq) == -1); FAIL_IF(((TcpSession *) (p->flow->protoctx))->client.seg_list->next != NULL); StreamTcpSessionClear(p->flow->protoctx); SCFree(p); FLOW_DESTROY(&f); StreamTcpUTDeinit(stt.ra_ctx); PASS; }
static int StreamTcpTest09 (void) { Packet *p = SCMalloc(SIZE_OF_PACKET); FAIL_IF(unlikely(p == NULL)); Flow f; ThreadVars tv; StreamTcpThread stt; TCPHdr tcph; uint8_t payload[1] = {0x42}; memset(p, 0, SIZE_OF_PACKET); PacketQueue pq; memset(&pq,0,sizeof(PacketQueue)); memset (&f, 0, sizeof(Flow)); memset(&tv, 0, sizeof (ThreadVars)); memset(&stt, 0, sizeof(StreamTcpThread)); memset(&tcph, 0, sizeof(TCPHdr)); FLOW_INITIALIZE(&f); p->flow = &f; StreamTcpUTInit(&stt.ra_ctx); stream_config.midstream = TRUE; tcph.th_win = htons(5480); tcph.th_seq = htonl(10); tcph.th_ack = htonl(20); tcph.th_flags = TH_ACK|TH_PUSH; p->tcph = &tcph; p->payload = payload; p->payload_len = 1; FAIL_IF(StreamTcpPacket(&tv, p, &stt, &pq) == -1); p->tcph->th_seq = htonl(12); p->tcph->th_ack = htonl(23); p->tcph->th_flags = TH_ACK|TH_PUSH; p->flowflags = FLOW_PKT_TOSERVER; FAIL_IF(p->flow->protoctx == NULL); StreamTcpSetSessionNoReassemblyFlag(((TcpSession *)(p->flow->protoctx)), 0); FAIL_IF(StreamTcpPacket(&tv, p, &stt, &pq) == -1); p->tcph->th_seq = htonl(11); p->tcph->th_ack = htonl(23); p->tcph->th_flags = TH_ACK|TH_PUSH; p->flowflags = FLOW_PKT_TOSERVER; FAIL_IF(StreamTcpPacket(&tv, p, &stt, &pq) == -1); FAIL_IF(((TcpSession *) (p->flow->protoctx))->client.seg_list->next != NULL); StreamTcpSessionClear(p->flow->protoctx); SCFree(p); FLOW_DESTROY(&f); StreamTcpUTDeinit(stt.ra_ctx); PASS; }
C
suricata
0
CVE-2017-5932
https://www.cvedetails.com/cve/CVE-2017-5932/
CWE-20
https://git.savannah.gnu.org/cgit/bash.git/commit/?id=4f747edc625815f449048579f6e65869914dd715
4f747edc625815f449048579f6e65869914dd715
null
print_dev_fd_list () { register int i; fprintf (stderr, "pid %ld: dev_fd_list:", (long)getpid ()); fflush (stderr); for (i = 0; i < totfds; i++) { if (dev_fd_list[i]) fprintf (stderr, " %d", i); } fprintf (stderr, "\n"); }
print_dev_fd_list () { register int i; fprintf (stderr, "pid %ld: dev_fd_list:", (long)getpid ()); fflush (stderr); for (i = 0; i < totfds; i++) { if (dev_fd_list[i]) fprintf (stderr, " %d", i); } fprintf (stderr, "\n"); }
C
savannah
0
CVE-2018-7191
https://www.cvedetails.com/cve/CVE-2018-7191/
CWE-476
https://github.com/torvalds/linux/commit/0ad646c81b2182f7fa67ec0c8c825e0ee165696d
0ad646c81b2182f7fa67ec0c8c825e0ee165696d
tun: call dev_get_valid_name() before register_netdevice() register_netdevice() could fail early when we have an invalid dev name, in which case ->ndo_uninit() is not called. For tun device, this is a problem because a timer etc. are already initialized and it expects ->ndo_uninit() to clean them up. We could move these initializations into a ->ndo_init() so that register_netdevice() knows better, however this is still complicated due to the logic in tun_detach(). Therefore, I choose to just call dev_get_valid_name() before register_netdevice(), which is quicker and much easier to audit. And for this specific case, it is already enough. Fixes: 96442e42429e ("tuntap: choose the txq based on rxq") Reported-by: Dmitry Alexeev <[email protected]> Cc: Jason Wang <[email protected]> Cc: "Michael S. Tsirkin" <[email protected]> Signed-off-by: Cong Wang <[email protected]> Signed-off-by: David S. Miller <[email protected]>
static void skb_gro_reset_offset(struct sk_buff *skb) { const struct skb_shared_info *pinfo = skb_shinfo(skb); const skb_frag_t *frag0 = &pinfo->frags[0]; NAPI_GRO_CB(skb)->data_offset = 0; NAPI_GRO_CB(skb)->frag0 = NULL; NAPI_GRO_CB(skb)->frag0_len = 0; if (skb_mac_header(skb) == skb_tail_pointer(skb) && pinfo->nr_frags && !PageHighMem(skb_frag_page(frag0))) { NAPI_GRO_CB(skb)->frag0 = skb_frag_address(frag0); NAPI_GRO_CB(skb)->frag0_len = min_t(unsigned int, skb_frag_size(frag0), skb->end - skb->tail); } }
static void skb_gro_reset_offset(struct sk_buff *skb) { const struct skb_shared_info *pinfo = skb_shinfo(skb); const skb_frag_t *frag0 = &pinfo->frags[0]; NAPI_GRO_CB(skb)->data_offset = 0; NAPI_GRO_CB(skb)->frag0 = NULL; NAPI_GRO_CB(skb)->frag0_len = 0; if (skb_mac_header(skb) == skb_tail_pointer(skb) && pinfo->nr_frags && !PageHighMem(skb_frag_page(frag0))) { NAPI_GRO_CB(skb)->frag0 = skb_frag_address(frag0); NAPI_GRO_CB(skb)->frag0_len = min_t(unsigned int, skb_frag_size(frag0), skb->end - skb->tail); } }
C
linux
0
CVE-2016-5165
https://www.cvedetails.com/cve/CVE-2016-5165/
CWE-79
https://github.com/chromium/chromium/commit/19b8593007150b9a78da7d13f6e5f8feb10881a7
19b8593007150b9a78da7d13f6e5f8feb10881a7
Add CPU metrics provider and Add CPU/GPU provider for UKM. Bug: 907674 Change-Id: I61b88aeac8d2a7ff81d812fa5a267f48203ec7e2 Reviewed-on: https://chromium-review.googlesource.com/c/1381376 Commit-Queue: Nik Bhagat <[email protected]> Reviewed-by: Robert Kaplow <[email protected]> Cr-Commit-Position: refs/heads/master@{#618037}
void ChromeMetricsServiceClient::OnPluginLoadingError( const base::FilePath& plugin_path) { #if BUILDFLAG(ENABLE_PLUGINS) plugin_metrics_provider_->LogPluginLoadingError(plugin_path); #else NOTREACHED(); #endif // BUILDFLAG(ENABLE_PLUGINS) }
void ChromeMetricsServiceClient::OnPluginLoadingError( const base::FilePath& plugin_path) { #if BUILDFLAG(ENABLE_PLUGINS) plugin_metrics_provider_->LogPluginLoadingError(plugin_path); #else NOTREACHED(); #endif // BUILDFLAG(ENABLE_PLUGINS) }
C
Chrome
0
CVE-2017-5101
https://www.cvedetails.com/cve/CVE-2017-5101/
CWE-20
https://github.com/chromium/chromium/commit/29734f46c6dc9362783091180c2ee279ad53637f
29734f46c6dc9362783091180c2ee279ad53637f
media: remove base::SharedMemoryHandle usage in v4l2 encoder This replaces a use of the legacy UnalignedSharedMemory ctor taking a SharedMemoryHandle with the current ctor taking a PlatformSharedMemoryRegion. Bug: 849207 Change-Id: Iea24ebdcd941cf2fa97e19cf2aeac1a18f9773d9 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1697602 Commit-Queue: Matthew Cary (CET) <[email protected]> Reviewed-by: Ricky Liang <[email protected]> Cr-Commit-Position: refs/heads/master@{#681740}
size_t V4L2JpegEncodeAccelerator::EncodedInstance::InputBufferQueuedCount() { return input_buffer_map_.size() - free_input_buffers_.size(); }
size_t V4L2JpegEncodeAccelerator::EncodedInstance::InputBufferQueuedCount() { return input_buffer_map_.size() - free_input_buffers_.size(); }
C
Chrome
0
CVE-2015-6773
https://www.cvedetails.com/cve/CVE-2015-6773/
CWE-119
https://github.com/chromium/chromium/commit/33827275411b33371e7bb750cce20f11de85002d
33827275411b33371e7bb750cce20f11de85002d
Move SelectionTemplate::is_handle_visible_ to FrameSelection This patch moves |is_handle_visible_| to |FrameSelection| from |SelectionTemplate| since handle visibility is used only for setting |FrameSelection|, hence it is a redundant member variable of |SelectionTemplate|. Bug: 742093 Change-Id: I3add4da3844fb40be34dcb4d4b46b5fa6fed1d7e Reviewed-on: https://chromium-review.googlesource.com/595389 Commit-Queue: Yoshifumi Inoue <[email protected]> Reviewed-by: Xiaocheng Hu <[email protected]> Reviewed-by: Kent Tamura <[email protected]> Cr-Commit-Position: refs/heads/master@{#491660}
WebTextInputMode InputMethodController::InputModeOfFocusedElement() const { if (!RuntimeEnabledFeatures::InputModeAttributeEnabled()) return kWebTextInputModeDefault; AtomicString mode = GetInputModeAttribute(GetDocument().FocusedElement()); if (mode.IsEmpty()) return kWebTextInputModeDefault; if (mode == InputModeNames::verbatim) return kWebTextInputModeVerbatim; if (mode == InputModeNames::latin) return kWebTextInputModeLatin; if (mode == InputModeNames::latin_name) return kWebTextInputModeLatinName; if (mode == InputModeNames::latin_prose) return kWebTextInputModeLatinProse; if (mode == InputModeNames::full_width_latin) return kWebTextInputModeFullWidthLatin; if (mode == InputModeNames::kana) return kWebTextInputModeKana; if (mode == InputModeNames::kana_name) return kWebTextInputModeKanaName; if (mode == InputModeNames::katakana) return kWebTextInputModeKataKana; if (mode == InputModeNames::numeric) return kWebTextInputModeNumeric; if (mode == InputModeNames::tel) return kWebTextInputModeTel; if (mode == InputModeNames::email) return kWebTextInputModeEmail; if (mode == InputModeNames::url) return kWebTextInputModeUrl; return kWebTextInputModeDefault; }
WebTextInputMode InputMethodController::InputModeOfFocusedElement() const { if (!RuntimeEnabledFeatures::InputModeAttributeEnabled()) return kWebTextInputModeDefault; AtomicString mode = GetInputModeAttribute(GetDocument().FocusedElement()); if (mode.IsEmpty()) return kWebTextInputModeDefault; if (mode == InputModeNames::verbatim) return kWebTextInputModeVerbatim; if (mode == InputModeNames::latin) return kWebTextInputModeLatin; if (mode == InputModeNames::latin_name) return kWebTextInputModeLatinName; if (mode == InputModeNames::latin_prose) return kWebTextInputModeLatinProse; if (mode == InputModeNames::full_width_latin) return kWebTextInputModeFullWidthLatin; if (mode == InputModeNames::kana) return kWebTextInputModeKana; if (mode == InputModeNames::kana_name) return kWebTextInputModeKanaName; if (mode == InputModeNames::katakana) return kWebTextInputModeKataKana; if (mode == InputModeNames::numeric) return kWebTextInputModeNumeric; if (mode == InputModeNames::tel) return kWebTextInputModeTel; if (mode == InputModeNames::email) return kWebTextInputModeEmail; if (mode == InputModeNames::url) return kWebTextInputModeUrl; return kWebTextInputModeDefault; }
C
Chrome
0
CVE-2017-14054
https://www.cvedetails.com/cve/CVE-2017-14054/
CWE-834
https://github.com/FFmpeg/FFmpeg/commit/124eb202e70678539544f6268efc98131f19fa49
124eb202e70678539544f6268efc98131f19fa49
avformat/rmdec: Fix DoS due to lack of eof check Fixes: loop.ivr Found-by: Xiaohei and Wangchu from Alibaba Security Team Signed-off-by: Michael Niedermayer <[email protected]>
static int ivr_read_header(AVFormatContext *s) { unsigned tag, type, len, tlen, value; int i, j, n, count, nb_streams = 0, ret; uint8_t key[256], val[256]; AVIOContext *pb = s->pb; AVStream *st; int64_t pos, offset, temp; pos = avio_tell(pb); tag = avio_rl32(pb); if (tag == MKTAG('.','R','1','M')) { if (avio_rb16(pb) != 1) return AVERROR_INVALIDDATA; if (avio_r8(pb) != 1) return AVERROR_INVALIDDATA; len = avio_rb32(pb); avio_skip(pb, len); avio_skip(pb, 5); temp = avio_rb64(pb); while (!avio_feof(pb) && temp) { offset = temp; temp = avio_rb64(pb); } avio_skip(pb, offset - avio_tell(pb)); if (avio_r8(pb) != 1) return AVERROR_INVALIDDATA; len = avio_rb32(pb); avio_skip(pb, len); if (avio_r8(pb) != 2) return AVERROR_INVALIDDATA; avio_skip(pb, 16); pos = avio_tell(pb); tag = avio_rl32(pb); } if (tag != MKTAG('.','R','E','C')) return AVERROR_INVALIDDATA; if (avio_r8(pb) != 0) return AVERROR_INVALIDDATA; count = avio_rb32(pb); for (i = 0; i < count; i++) { if (avio_feof(pb)) return AVERROR_INVALIDDATA; type = avio_r8(pb); tlen = avio_rb32(pb); avio_get_str(pb, tlen, key, sizeof(key)); len = avio_rb32(pb); if (type == 5) { avio_get_str(pb, len, val, sizeof(val)); av_log(s, AV_LOG_DEBUG, "%s = '%s'\n", key, val); } else if (type == 4) { av_log(s, AV_LOG_DEBUG, "%s = '0x", key); for (j = 0; j < len; j++) { if (avio_feof(pb)) return AVERROR_INVALIDDATA; av_log(s, AV_LOG_DEBUG, "%X", avio_r8(pb)); } av_log(s, AV_LOG_DEBUG, "'\n"); } else if (len == 4 && type == 3 && !strncmp(key, "StreamCount", tlen)) { nb_streams = value = avio_rb32(pb); } else if (len == 4 && type == 3) { value = avio_rb32(pb); av_log(s, AV_LOG_DEBUG, "%s = %d\n", key, value); } else { av_log(s, AV_LOG_DEBUG, "Skipping unsupported key: %s\n", key); avio_skip(pb, len); } } for (n = 0; n < nb_streams; n++) { st = avformat_new_stream(s, NULL); if (!st) return AVERROR(ENOMEM); st->priv_data = ff_rm_alloc_rmstream(); if (!st->priv_data) return AVERROR(ENOMEM); if (avio_r8(pb) != 1) return AVERROR_INVALIDDATA; count = avio_rb32(pb); for (i = 0; i < count; i++) { if (avio_feof(pb)) return AVERROR_INVALIDDATA; type = avio_r8(pb); tlen = avio_rb32(pb); avio_get_str(pb, tlen, key, sizeof(key)); len = avio_rb32(pb); if (type == 5) { avio_get_str(pb, len, val, sizeof(val)); av_log(s, AV_LOG_DEBUG, "%s = '%s'\n", key, val); } else if (type == 4 && !strncmp(key, "OpaqueData", tlen)) { ret = ffio_ensure_seekback(pb, 4); if (ret < 0) return ret; if (avio_rb32(pb) == MKBETAG('M', 'L', 'T', 'I')) { ret = rm_read_multi(s, pb, st, NULL); } else { avio_seek(pb, -4, SEEK_CUR); ret = ff_rm_read_mdpr_codecdata(s, pb, st, st->priv_data, len, NULL); } if (ret < 0) return ret; } else if (type == 4) { int j; av_log(s, AV_LOG_DEBUG, "%s = '0x", key); for (j = 0; j < len; j++) av_log(s, AV_LOG_DEBUG, "%X", avio_r8(pb)); av_log(s, AV_LOG_DEBUG, "'\n"); } else if (len == 4 && type == 3 && !strncmp(key, "Duration", tlen)) { st->duration = avio_rb32(pb); } else if (len == 4 && type == 3) { value = avio_rb32(pb); av_log(s, AV_LOG_DEBUG, "%s = %d\n", key, value); } else { av_log(s, AV_LOG_DEBUG, "Skipping unsupported key: %s\n", key); avio_skip(pb, len); } } } if (avio_r8(pb) != 6) return AVERROR_INVALIDDATA; avio_skip(pb, 12); avio_skip(pb, avio_rb64(pb) + pos - avio_tell(s->pb)); if (avio_r8(pb) != 8) return AVERROR_INVALIDDATA; avio_skip(pb, 8); return 0; }
static int ivr_read_header(AVFormatContext *s) { unsigned tag, type, len, tlen, value; int i, j, n, count, nb_streams = 0, ret; uint8_t key[256], val[256]; AVIOContext *pb = s->pb; AVStream *st; int64_t pos, offset, temp; pos = avio_tell(pb); tag = avio_rl32(pb); if (tag == MKTAG('.','R','1','M')) { if (avio_rb16(pb) != 1) return AVERROR_INVALIDDATA; if (avio_r8(pb) != 1) return AVERROR_INVALIDDATA; len = avio_rb32(pb); avio_skip(pb, len); avio_skip(pb, 5); temp = avio_rb64(pb); while (!avio_feof(pb) && temp) { offset = temp; temp = avio_rb64(pb); } avio_skip(pb, offset - avio_tell(pb)); if (avio_r8(pb) != 1) return AVERROR_INVALIDDATA; len = avio_rb32(pb); avio_skip(pb, len); if (avio_r8(pb) != 2) return AVERROR_INVALIDDATA; avio_skip(pb, 16); pos = avio_tell(pb); tag = avio_rl32(pb); } if (tag != MKTAG('.','R','E','C')) return AVERROR_INVALIDDATA; if (avio_r8(pb) != 0) return AVERROR_INVALIDDATA; count = avio_rb32(pb); for (i = 0; i < count; i++) { if (avio_feof(pb)) return AVERROR_INVALIDDATA; type = avio_r8(pb); tlen = avio_rb32(pb); avio_get_str(pb, tlen, key, sizeof(key)); len = avio_rb32(pb); if (type == 5) { avio_get_str(pb, len, val, sizeof(val)); av_log(s, AV_LOG_DEBUG, "%s = '%s'\n", key, val); } else if (type == 4) { av_log(s, AV_LOG_DEBUG, "%s = '0x", key); for (j = 0; j < len; j++) av_log(s, AV_LOG_DEBUG, "%X", avio_r8(pb)); av_log(s, AV_LOG_DEBUG, "'\n"); } else if (len == 4 && type == 3 && !strncmp(key, "StreamCount", tlen)) { nb_streams = value = avio_rb32(pb); } else if (len == 4 && type == 3) { value = avio_rb32(pb); av_log(s, AV_LOG_DEBUG, "%s = %d\n", key, value); } else { av_log(s, AV_LOG_DEBUG, "Skipping unsupported key: %s\n", key); avio_skip(pb, len); } } for (n = 0; n < nb_streams; n++) { st = avformat_new_stream(s, NULL); if (!st) return AVERROR(ENOMEM); st->priv_data = ff_rm_alloc_rmstream(); if (!st->priv_data) return AVERROR(ENOMEM); if (avio_r8(pb) != 1) return AVERROR_INVALIDDATA; count = avio_rb32(pb); for (i = 0; i < count; i++) { if (avio_feof(pb)) return AVERROR_INVALIDDATA; type = avio_r8(pb); tlen = avio_rb32(pb); avio_get_str(pb, tlen, key, sizeof(key)); len = avio_rb32(pb); if (type == 5) { avio_get_str(pb, len, val, sizeof(val)); av_log(s, AV_LOG_DEBUG, "%s = '%s'\n", key, val); } else if (type == 4 && !strncmp(key, "OpaqueData", tlen)) { ret = ffio_ensure_seekback(pb, 4); if (ret < 0) return ret; if (avio_rb32(pb) == MKBETAG('M', 'L', 'T', 'I')) { ret = rm_read_multi(s, pb, st, NULL); } else { avio_seek(pb, -4, SEEK_CUR); ret = ff_rm_read_mdpr_codecdata(s, pb, st, st->priv_data, len, NULL); } if (ret < 0) return ret; } else if (type == 4) { int j; av_log(s, AV_LOG_DEBUG, "%s = '0x", key); for (j = 0; j < len; j++) av_log(s, AV_LOG_DEBUG, "%X", avio_r8(pb)); av_log(s, AV_LOG_DEBUG, "'\n"); } else if (len == 4 && type == 3 && !strncmp(key, "Duration", tlen)) { st->duration = avio_rb32(pb); } else if (len == 4 && type == 3) { value = avio_rb32(pb); av_log(s, AV_LOG_DEBUG, "%s = %d\n", key, value); } else { av_log(s, AV_LOG_DEBUG, "Skipping unsupported key: %s\n", key); avio_skip(pb, len); } } } if (avio_r8(pb) != 6) return AVERROR_INVALIDDATA; avio_skip(pb, 12); avio_skip(pb, avio_rb64(pb) + pos - avio_tell(s->pb)); if (avio_r8(pb) != 8) return AVERROR_INVALIDDATA; avio_skip(pb, 8); return 0; }
C
FFmpeg
1
CVE-2017-7889
https://www.cvedetails.com/cve/CVE-2017-7889/
CWE-732
https://github.com/torvalds/linux/commit/a4866aa812518ed1a37d8ea0c881dc946409de94
a4866aa812518ed1a37d8ea0c881dc946409de94
mm: Tighten x86 /dev/mem with zeroing reads Under CONFIG_STRICT_DEVMEM, reading System RAM through /dev/mem is disallowed. However, on x86, the first 1MB was always allowed for BIOS and similar things, regardless of it actually being System RAM. It was possible for heap to end up getting allocated in low 1MB RAM, and then read by things like x86info or dd, which would trip hardened usercopy: usercopy: kernel memory exposure attempt detected from ffff880000090000 (dma-kmalloc-256) (4096 bytes) This changes the x86 exception for the low 1MB by reading back zeros for System RAM areas instead of blindly allowing them. More work is needed to extend this to mmap, but currently mmap doesn't go through usercopy, so hardened usercopy won't Oops the kernel. Reported-by: Tommi Rantala <[email protected]> Tested-by: Tommi Rantala <[email protected]> Signed-off-by: Kees Cook <[email protected]>
static void __init probe_page_size_mask(void) { #if !defined(CONFIG_KMEMCHECK) /* * For CONFIG_KMEMCHECK or pagealloc debugging, identity mapping will * use small pages. * This will simplify cpa(), which otherwise needs to support splitting * large pages into small in interrupt context, etc. */ if (boot_cpu_has(X86_FEATURE_PSE) && !debug_pagealloc_enabled()) page_size_mask |= 1 << PG_LEVEL_2M; #endif /* Enable PSE if available */ if (boot_cpu_has(X86_FEATURE_PSE)) cr4_set_bits_and_update_boot(X86_CR4_PSE); /* Enable PGE if available */ if (boot_cpu_has(X86_FEATURE_PGE)) { cr4_set_bits_and_update_boot(X86_CR4_PGE); __supported_pte_mask |= _PAGE_GLOBAL; } else __supported_pte_mask &= ~_PAGE_GLOBAL; /* Enable 1 GB linear kernel mappings if available: */ if (direct_gbpages && boot_cpu_has(X86_FEATURE_GBPAGES)) { printk(KERN_INFO "Using GB pages for direct mapping\n"); page_size_mask |= 1 << PG_LEVEL_1G; } else { direct_gbpages = 0; } }
static void __init probe_page_size_mask(void) { #if !defined(CONFIG_KMEMCHECK) /* * For CONFIG_KMEMCHECK or pagealloc debugging, identity mapping will * use small pages. * This will simplify cpa(), which otherwise needs to support splitting * large pages into small in interrupt context, etc. */ if (boot_cpu_has(X86_FEATURE_PSE) && !debug_pagealloc_enabled()) page_size_mask |= 1 << PG_LEVEL_2M; #endif /* Enable PSE if available */ if (boot_cpu_has(X86_FEATURE_PSE)) cr4_set_bits_and_update_boot(X86_CR4_PSE); /* Enable PGE if available */ if (boot_cpu_has(X86_FEATURE_PGE)) { cr4_set_bits_and_update_boot(X86_CR4_PGE); __supported_pte_mask |= _PAGE_GLOBAL; } else __supported_pte_mask &= ~_PAGE_GLOBAL; /* Enable 1 GB linear kernel mappings if available: */ if (direct_gbpages && boot_cpu_has(X86_FEATURE_GBPAGES)) { printk(KERN_INFO "Using GB pages for direct mapping\n"); page_size_mask |= 1 << PG_LEVEL_1G; } else { direct_gbpages = 0; } }
C
linux
0