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-4997
https://www.cvedetails.com/cve/CVE-2016-4997/
CWE-264
https://github.com/torvalds/linux/commit/ce683e5f9d045e5d67d1312a42b359cb2ab2a13c
ce683e5f9d045e5d67d1312a42b359cb2ab2a13c
netfilter: x_tables: check for bogus target offset We're currently asserting that targetoff + targetsize <= nextoff. Extend it to also check that targetoff is >= sizeof(xt_entry). Since this is generic code, add an argument pointing to the start of the match/target, we can then derive the base structure size from the delta. We also need the e->elems pointer in a followup change to validate matches. Signed-off-by: Florian Westphal <[email protected]> Signed-off-by: Pablo Neira Ayuso <[email protected]>
check_compat_entry_size_and_hooks(struct compat_arpt_entry *e, struct xt_table_info *newinfo, unsigned int *size, const unsigned char *base, const unsigned char *limit, const unsigned int *hook_entries, const unsigned int *underflows, const char *name) { struct xt_entry_target *t; struct xt_target *target; unsigned int entry_offset; int ret, off, h; duprintf("check_compat_entry_size_and_hooks %p\n", e); if ((unsigned long)e % __alignof__(struct compat_arpt_entry) != 0 || (unsigned char *)e + sizeof(struct compat_arpt_entry) >= limit || (unsigned char *)e + e->next_offset > limit) { duprintf("Bad offset %p, limit = %p\n", e, limit); return -EINVAL; } if (e->next_offset < sizeof(struct compat_arpt_entry) + sizeof(struct compat_xt_entry_target)) { duprintf("checking: element %p size %u\n", e, e->next_offset); return -EINVAL; } if (!arp_checkentry(&e->arp)) return -EINVAL; ret = xt_compat_check_entry_offsets(e, e->elems, e->target_offset, e->next_offset); if (ret) return ret; off = sizeof(struct arpt_entry) - sizeof(struct compat_arpt_entry); entry_offset = (void *)e - (void *)base; t = compat_arpt_get_target(e); target = xt_request_find_target(NFPROTO_ARP, t->u.user.name, t->u.user.revision); if (IS_ERR(target)) { duprintf("check_compat_entry_size_and_hooks: `%s' not found\n", t->u.user.name); ret = PTR_ERR(target); goto out; } t->u.kernel.target = target; off += xt_compat_target_offset(target); *size += off; ret = xt_compat_add_offset(NFPROTO_ARP, entry_offset, off); if (ret) goto release_target; /* Check hooks & underflows */ for (h = 0; h < NF_ARP_NUMHOOKS; h++) { if ((unsigned char *)e - base == hook_entries[h]) newinfo->hook_entry[h] = hook_entries[h]; if ((unsigned char *)e - base == underflows[h]) newinfo->underflow[h] = underflows[h]; } /* Clear counters and comefrom */ memset(&e->counters, 0, sizeof(e->counters)); e->comefrom = 0; return 0; release_target: module_put(t->u.kernel.target->me); out: return ret; }
check_compat_entry_size_and_hooks(struct compat_arpt_entry *e, struct xt_table_info *newinfo, unsigned int *size, const unsigned char *base, const unsigned char *limit, const unsigned int *hook_entries, const unsigned int *underflows, const char *name) { struct xt_entry_target *t; struct xt_target *target; unsigned int entry_offset; int ret, off, h; duprintf("check_compat_entry_size_and_hooks %p\n", e); if ((unsigned long)e % __alignof__(struct compat_arpt_entry) != 0 || (unsigned char *)e + sizeof(struct compat_arpt_entry) >= limit || (unsigned char *)e + e->next_offset > limit) { duprintf("Bad offset %p, limit = %p\n", e, limit); return -EINVAL; } if (e->next_offset < sizeof(struct compat_arpt_entry) + sizeof(struct compat_xt_entry_target)) { duprintf("checking: element %p size %u\n", e, e->next_offset); return -EINVAL; } if (!arp_checkentry(&e->arp)) return -EINVAL; ret = xt_compat_check_entry_offsets(e, e->target_offset, e->next_offset); if (ret) return ret; off = sizeof(struct arpt_entry) - sizeof(struct compat_arpt_entry); entry_offset = (void *)e - (void *)base; t = compat_arpt_get_target(e); target = xt_request_find_target(NFPROTO_ARP, t->u.user.name, t->u.user.revision); if (IS_ERR(target)) { duprintf("check_compat_entry_size_and_hooks: `%s' not found\n", t->u.user.name); ret = PTR_ERR(target); goto out; } t->u.kernel.target = target; off += xt_compat_target_offset(target); *size += off; ret = xt_compat_add_offset(NFPROTO_ARP, entry_offset, off); if (ret) goto release_target; /* Check hooks & underflows */ for (h = 0; h < NF_ARP_NUMHOOKS; h++) { if ((unsigned char *)e - base == hook_entries[h]) newinfo->hook_entry[h] = hook_entries[h]; if ((unsigned char *)e - base == underflows[h]) newinfo->underflow[h] = underflows[h]; } /* Clear counters and comefrom */ memset(&e->counters, 0, sizeof(e->counters)); e->comefrom = 0; return 0; release_target: module_put(t->u.kernel.target->me); out: return ret; }
C
linux
1
CVE-2016-10746
https://www.cvedetails.com/cve/CVE-2016-10746/
CWE-254
https://github.com/libvirt/libvirt/commit/506e9d6c2d4baaf580d489fff0690c0ff2ff588f
506e9d6c2d4baaf580d489fff0690c0ff2ff588f
virDomainGetTime: Deny on RO connections We have a policy that if API may end up talking to a guest agent it should require RW connection. We don't obey the rule in virDomainGetTime(). Signed-off-by: Michal Privoznik <[email protected]>
virDomainBlockJobSetSpeed(virDomainPtr dom, const char *disk, unsigned long bandwidth, unsigned int flags) { virConnectPtr conn; VIR_DOMAIN_DEBUG(dom, "disk=%s, bandwidth=%lu, flags=%x", disk, bandwidth, flags); virResetLastError(); virCheckDomainReturn(dom, -1); conn = dom->conn; virCheckReadOnlyGoto(conn->flags, error); virCheckNonNullArgGoto(disk, error); if (conn->driver->domainBlockJobSetSpeed) { int ret; ret = conn->driver->domainBlockJobSetSpeed(dom, disk, bandwidth, flags); if (ret < 0) goto error; return ret; } virReportUnsupportedError(); error: virDispatchError(dom->conn); return -1; }
virDomainBlockJobSetSpeed(virDomainPtr dom, const char *disk, unsigned long bandwidth, unsigned int flags) { virConnectPtr conn; VIR_DOMAIN_DEBUG(dom, "disk=%s, bandwidth=%lu, flags=%x", disk, bandwidth, flags); virResetLastError(); virCheckDomainReturn(dom, -1); conn = dom->conn; virCheckReadOnlyGoto(conn->flags, error); virCheckNonNullArgGoto(disk, error); if (conn->driver->domainBlockJobSetSpeed) { int ret; ret = conn->driver->domainBlockJobSetSpeed(dom, disk, bandwidth, flags); if (ret < 0) goto error; return ret; } virReportUnsupportedError(); error: virDispatchError(dom->conn); return -1; }
C
libvirt
0
CVE-2015-8816
https://www.cvedetails.com/cve/CVE-2015-8816/
null
https://github.com/torvalds/linux/commit/e50293ef9775c5f1cf3fcc093037dd6a8c5684ea
e50293ef9775c5f1cf3fcc093037dd6a8c5684ea
USB: fix invalid memory access in hub_activate() Commit 8520f38099cc ("USB: change hub initialization sleeps to delayed_work") changed the hub_activate() routine to make part of it run in a workqueue. However, the commit failed to take a reference to the usb_hub structure or to lock the hub interface while doing so. As a result, if a hub is plugged in and quickly unplugged before the work routine can run, the routine will try to access memory that has been deallocated. Or, if the hub is unplugged while the routine is running, the memory may be deallocated while it is in active use. This patch fixes the problem by taking a reference to the usb_hub at the start of hub_activate() and releasing it at the end (when the work is finished), and by locking the hub interface while the work routine is running. It also adds a check at the start of the routine to see if the hub has already been disconnected, in which nothing should be done. Signed-off-by: Alan Stern <[email protected]> Reported-by: Alexandru Cornea <[email protected]> Tested-by: Alexandru Cornea <[email protected]> Fixes: 8520f38099cc ("USB: change hub initialization sleeps to delayed_work") CC: <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
static bool use_new_scheme(struct usb_device *udev, int retry) { if (udev->speed == USB_SPEED_SUPER) return false; return USE_NEW_SCHEME(retry); }
static bool use_new_scheme(struct usb_device *udev, int retry) { if (udev->speed == USB_SPEED_SUPER) return false; return USE_NEW_SCHEME(retry); }
C
linux
0
CVE-2016-1641
https://www.cvedetails.com/cve/CVE-2016-1641/
null
https://github.com/chromium/chromium/commit/75ca8ffd7bd7c58ace1144df05e1307d8d707662
75ca8ffd7bd7c58ace1144df05e1307d8d707662
Don't call WebContents::DownloadImage() callback if the WebContents were deleted BUG=583718 Review URL: https://codereview.chromium.org/1685343004 Cr-Commit-Position: refs/heads/master@{#375700}
void WebContentsImpl::OnRenderFrameProxyVisibilityChanged(bool visible) { if (visible) WasShown(); else WasHidden(); }
void WebContentsImpl::OnRenderFrameProxyVisibilityChanged(bool visible) { if (visible) WasShown(); else WasHidden(); }
C
Chrome
0
CVE-2018-9510
https://www.cvedetails.com/cve/CVE-2018-9510/
CWE-200
https://android.googlesource.com/platform/system/bt/+/6e4b8e505173f803a5fc05abc09f64eef89dc308
6e4b8e505173f803a5fc05abc09f64eef89dc308
Checks the SMP length to fix OOB read Bug: 111937065 Test: manual Change-Id: I330880a6e1671d0117845430db4076dfe1aba688 Merged-In: I330880a6e1671d0117845430db4076dfe1aba688 (cherry picked from commit fceb753bda651c4135f3f93a510e5fcb4c7542b8)
void smp_key_distribution_by_transport(tSMP_CB* p_cb, tSMP_INT_DATA* p_data) { SMP_TRACE_DEBUG("%s", __func__); if (p_cb->smp_over_br) { smp_br_select_next_key(p_cb, NULL); } else { smp_key_distribution(p_cb, NULL); } }
void smp_key_distribution_by_transport(tSMP_CB* p_cb, tSMP_INT_DATA* p_data) { SMP_TRACE_DEBUG("%s", __func__); if (p_cb->smp_over_br) { smp_br_select_next_key(p_cb, NULL); } else { smp_key_distribution(p_cb, NULL); } }
C
Android
0
CVE-2016-6213
https://www.cvedetails.com/cve/CVE-2016-6213/
CWE-400
https://github.com/torvalds/linux/commit/d29216842a85c7970c536108e093963f02714498
d29216842a85c7970c536108e093963f02714498
mnt: Add a per mount namespace limit on the number of mounts CAI Qian <[email protected]> pointed out that the semantics of shared subtrees make it possible to create an exponentially increasing number of mounts in a mount namespace. mkdir /tmp/1 /tmp/2 mount --make-rshared / for i in $(seq 1 20) ; do mount --bind /tmp/1 /tmp/2 ; done Will create create 2^20 or 1048576 mounts, which is a practical problem as some people have managed to hit this by accident. As such CVE-2016-6213 was assigned. Ian Kent <[email protected]> described the situation for autofs users as follows: > The number of mounts for direct mount maps is usually not very large because of > the way they are implemented, large direct mount maps can have performance > problems. There can be anywhere from a few (likely case a few hundred) to less > than 10000, plus mounts that have been triggered and not yet expired. > > Indirect mounts have one autofs mount at the root plus the number of mounts that > have been triggered and not yet expired. > > The number of autofs indirect map entries can range from a few to the common > case of several thousand and in rare cases up to between 30000 and 50000. I've > not heard of people with maps larger than 50000 entries. > > The larger the number of map entries the greater the possibility for a large > number of active mounts so it's not hard to expect cases of a 1000 or somewhat > more active mounts. So I am setting the default number of mounts allowed per mount namespace at 100,000. This is more than enough for any use case I know of, but small enough to quickly stop an exponential increase in mounts. Which should be perfect to catch misconfigurations and malfunctioning programs. For anyone who needs a higher limit this can be changed by writing to the new /proc/sys/fs/mount-max sysctl. Tested-by: CAI Qian <[email protected]> Signed-off-by: "Eric W. Biederman" <[email protected]>
int propagate_mnt(struct mount *dest_mnt, struct mountpoint *dest_mp, struct mount *source_mnt, struct hlist_head *tree_list) { struct mount *m, *n; int ret = 0; /* * we don't want to bother passing tons of arguments to * propagate_one(); everything is serialized by namespace_sem, * so globals will do just fine. */ user_ns = current->nsproxy->mnt_ns->user_ns; last_dest = dest_mnt; first_source = source_mnt; last_source = source_mnt; mp = dest_mp; list = tree_list; dest_master = dest_mnt->mnt_master; /* all peers of dest_mnt, except dest_mnt itself */ for (n = next_peer(dest_mnt); n != dest_mnt; n = next_peer(n)) { ret = propagate_one(n); if (ret) goto out; } /* all slave groups */ for (m = next_group(dest_mnt, dest_mnt); m; m = next_group(m, dest_mnt)) { /* everything in that slave group */ n = m; do { ret = propagate_one(n); if (ret) goto out; n = next_peer(n); } while (n != m); } out: read_seqlock_excl(&mount_lock); hlist_for_each_entry(n, tree_list, mnt_hash) { m = n->mnt_parent; if (m->mnt_master != dest_mnt->mnt_master) CLEAR_MNT_MARK(m->mnt_master); } read_sequnlock_excl(&mount_lock); return ret; }
int propagate_mnt(struct mount *dest_mnt, struct mountpoint *dest_mp, struct mount *source_mnt, struct hlist_head *tree_list) { struct mount *m, *n; int ret = 0; /* * we don't want to bother passing tons of arguments to * propagate_one(); everything is serialized by namespace_sem, * so globals will do just fine. */ user_ns = current->nsproxy->mnt_ns->user_ns; last_dest = dest_mnt; first_source = source_mnt; last_source = source_mnt; mp = dest_mp; list = tree_list; dest_master = dest_mnt->mnt_master; /* all peers of dest_mnt, except dest_mnt itself */ for (n = next_peer(dest_mnt); n != dest_mnt; n = next_peer(n)) { ret = propagate_one(n); if (ret) goto out; } /* all slave groups */ for (m = next_group(dest_mnt, dest_mnt); m; m = next_group(m, dest_mnt)) { /* everything in that slave group */ n = m; do { ret = propagate_one(n); if (ret) goto out; n = next_peer(n); } while (n != m); } out: read_seqlock_excl(&mount_lock); hlist_for_each_entry(n, tree_list, mnt_hash) { m = n->mnt_parent; if (m->mnt_master != dest_mnt->mnt_master) CLEAR_MNT_MARK(m->mnt_master); } read_sequnlock_excl(&mount_lock); return ret; }
C
linux
0
CVE-2018-15857
https://www.cvedetails.com/cve/CVE-2018-15857/
CWE-416
https://github.com/xkbcommon/libxkbcommon/commit/c1e5ac16e77a21f87bdf3bc4dea61b037a17dddb
c1e5ac16e77a21f87bdf3bc4dea61b037a17dddb
xkbcomp: fix pointer value for FreeStmt Signed-off-by: Peter Hutterer <[email protected]>
ExprCreateMultiKeysymList(ExprDef *expr) { unsigned nLevels = darray_size(expr->keysym_list.symsMapIndex); darray_resize(expr->keysym_list.symsMapIndex, 1); darray_resize(expr->keysym_list.symsNumEntries, 1); darray_item(expr->keysym_list.symsMapIndex, 0) = 0; darray_item(expr->keysym_list.symsNumEntries, 0) = nLevels; return expr; }
ExprCreateMultiKeysymList(ExprDef *expr) { unsigned nLevels = darray_size(expr->keysym_list.symsMapIndex); darray_resize(expr->keysym_list.symsMapIndex, 1); darray_resize(expr->keysym_list.symsNumEntries, 1); darray_item(expr->keysym_list.symsMapIndex, 0) = 0; darray_item(expr->keysym_list.symsNumEntries, 0) = nLevels; return expr; }
C
libxkbcommon
0
CVE-2018-17570
https://www.cvedetails.com/cve/CVE-2018-17570/
CWE-190
https://github.com/viabtc/viabtc_exchange_server/commit/4a7c27bfe98f409623d4d857894d017ff0672cc9#diff-515c81af848352583bff286d6224875f
4a7c27bfe98f409623d4d857894d017ff0672cc9#diff-515c81af848352583bff286d6224875f
Merge pull request #131 from benjaminchodroff/master fix memory corruption and other 32bit overflows
static int broadcast_message(ws_svr *svr, uint8_t opcode, void *data, size_t size) { nw_ses *curr = svr->raw_svr->clt_list_head; while (curr) { nw_ses *next = curr->next; struct clt_info *info = curr->privdata; if (info->upgrade) { int ret = send_reply(curr, opcode, data, size); if (ret < 0) return ret; } curr = next; } return 0; }
static int broadcast_message(ws_svr *svr, uint8_t opcode, void *data, size_t size) { nw_ses *curr = svr->raw_svr->clt_list_head; while (curr) { nw_ses *next = curr->next; struct clt_info *info = curr->privdata; if (info->upgrade) { int ret = send_reply(curr, opcode, data, size); if (ret < 0) return ret; } curr = next; } return 0; }
C
viabtc_exchange_server
0
CVE-2015-2301
https://www.cvedetails.com/cve/CVE-2015-2301/
null
https://git.php.net/?p=php-src.git;a=commit;h=b2cf3f064b8f5efef89bb084521b61318c71781b
b2cf3f064b8f5efef89bb084521b61318c71781b
null
static int pharobj_cancompress(HashTable *manifest TSRMLS_DC) /* {{{ */ { int test; test = 1; zend_hash_apply_with_argument(manifest, phar_test_compression, &test TSRMLS_CC); return test; } /* }}} */
static int pharobj_cancompress(HashTable *manifest TSRMLS_DC) /* {{{ */ { int test; test = 1; zend_hash_apply_with_argument(manifest, phar_test_compression, &test TSRMLS_CC); return test; } /* }}} */
C
php
0
CVE-2016-5767
https://www.cvedetails.com/cve/CVE-2016-5767/
CWE-190
https://github.com/php/php-src/commit/c395c6e5d7e8df37a21265ff76e48fe75ceb5ae6?w=1
c395c6e5d7e8df37a21265ff76e48fe75ceb5ae6?w=1
iFixed bug #72446 - Integer Overflow in gdImagePaletteToTrueColor() resulting in heap overflow
void gdImageFilledRectangle (gdImagePtr im, int x1, int y1, int x2, int y2, int color) { int x, y; if (x1 == x2 && y1 == y2) { gdImageSetPixel(im, x1, y1, color); return; } if (x1 > x2) { x = x1; x1 = x2; x2 = x; } if (y1 > y2) { y = y1; y1 = y2; y2 = y; } if (x1 < 0) { x1 = 0; } if (x2 >= gdImageSX(im)) { x2 = gdImageSX(im) - 1; } if (y1 < 0) { y1 = 0; } if (y2 >= gdImageSY(im)) { y2 = gdImageSY(im) - 1; } for (y = y1; (y <= y2); y++) { for (x = x1; (x <= x2); x++) { gdImageSetPixel (im, x, y, color); } } }
void gdImageFilledRectangle (gdImagePtr im, int x1, int y1, int x2, int y2, int color) { int x, y; if (x1 == x2 && y1 == y2) { gdImageSetPixel(im, x1, y1, color); return; } if (x1 > x2) { x = x1; x1 = x2; x2 = x; } if (y1 > y2) { y = y1; y1 = y2; y2 = y; } if (x1 < 0) { x1 = 0; } if (x2 >= gdImageSX(im)) { x2 = gdImageSX(im) - 1; } if (y1 < 0) { y1 = 0; } if (y2 >= gdImageSY(im)) { y2 = gdImageSY(im) - 1; } for (y = y1; (y <= y2); y++) { for (x = x1; (x <= x2); x++) { gdImageSetPixel (im, x, y, color); } } }
C
php-src
0
CVE-2011-3050
https://www.cvedetails.com/cve/CVE-2011-3050/
CWE-399
https://github.com/chromium/chromium/commit/3da579b85a36e95c03d06b7c4ce9d618af4107bf
3da579b85a36e95c03d06b7c4ce9d618af4107bf
Relands cl 16982 as it wasn't the cause of the build breakage. Here's the description for that cl: Lands http://codereview.chromium.org/115505 for bug http://crbug.com/4030 for tyoshino. BUG=http://crbug.com/4030 TEST=make sure control-w dismisses bookmark manager. Review URL: http://codereview.chromium.org/113902 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@16987 0039d316-1c4b-4281-b951-d872f2087c98
BookmarkManagerView::CutCopyPasteType KeyCodeToCutCopyPaste( unsigned short virtual_keycode) { switch (virtual_keycode) { case VK_INSERT: if (GetKeyState(VK_CONTROL) < 0) return BookmarkManagerView::COPY; if (GetKeyState(VK_SHIFT) < 0) return BookmarkManagerView::PASTE; return BookmarkManagerView::NONE; case VK_DELETE: if (GetKeyState(VK_SHIFT) < 0) return BookmarkManagerView::CUT; return BookmarkManagerView::NONE; case 'C': if (GetKeyState(VK_CONTROL) < 0) return BookmarkManagerView::COPY; return BookmarkManagerView::NONE; case 'V': if (GetKeyState(VK_CONTROL) < 0) return BookmarkManagerView::PASTE; return BookmarkManagerView::NONE; case 'X': if (GetKeyState(VK_CONTROL) < 0) return BookmarkManagerView::CUT; return BookmarkManagerView::NONE; default: return BookmarkManagerView::NONE; } }
BookmarkManagerView::CutCopyPasteType KeyCodeToCutCopyPaste( unsigned short virtual_keycode) { switch (virtual_keycode) { case VK_INSERT: if (GetKeyState(VK_CONTROL) < 0) return BookmarkManagerView::COPY; if (GetKeyState(VK_SHIFT) < 0) return BookmarkManagerView::PASTE; return BookmarkManagerView::NONE; case VK_DELETE: if (GetKeyState(VK_SHIFT) < 0) return BookmarkManagerView::CUT; return BookmarkManagerView::NONE; case 'C': if (GetKeyState(VK_CONTROL) < 0) return BookmarkManagerView::COPY; return BookmarkManagerView::NONE; case 'V': if (GetKeyState(VK_CONTROL) < 0) return BookmarkManagerView::PASTE; return BookmarkManagerView::NONE; case 'X': if (GetKeyState(VK_CONTROL) < 0) return BookmarkManagerView::CUT; return BookmarkManagerView::NONE; default: return BookmarkManagerView::NONE; } }
C
Chrome
0
CVE-2017-7854
https://www.cvedetails.com/cve/CVE-2017-7854/
CWE-125
https://github.com/radare/radare2/commit/d2632f6483a3ceb5d8e0a5fb11142c51c43978b4
d2632f6483a3ceb5d8e0a5fb11142c51c43978b4
Fix crash in fuzzed wasm r2_hoobr_consume_init_expr
static size_t consume_s32 (ut8 *buf, ut8 *max, st32 *out, ut32 *offset) { size_t n; if (!buf || !max || !out) { return 0; } if (!(n = read_i32_leb128 (buf, max, out)) || n > 5) { return 0; } if (offset) { *offset += n; } return n; }
static size_t consume_s32 (ut8 *buf, ut8 *max, st32 *out, ut32 *offset) { size_t n; if (!buf || !max || !out) { return 0; } if (!(n = read_i32_leb128 (buf, max, out)) || n > 5) { return 0; } if (offset) { *offset += n; } return n; }
C
radare2
0
CVE-2011-2351
https://www.cvedetails.com/cve/CVE-2011-2351/
CWE-399
https://github.com/chromium/chromium/commit/bf381d8a02c3d272d4dd879ac719d8993dfb5ad6
bf381d8a02c3d272d4dd879ac719d8993dfb5ad6
Enable HistoryModelWorker by default, now that bug 69561 is fixed. BUG=69561 TEST=Run sync manually and run integration tests, sync should not crash. Review URL: http://codereview.chromium.org/7016007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@85211 0039d316-1c4b-4281-b951-d872f2087c98
void SyncBackendHost::FinishConfigureDataTypesOnFrontendLoop() { DCHECK_EQ(MessageLoop::current(), frontend_loop_); VLOG(1) << "Syncer in config mode. SBH executing" << "FinishConfigureDataTypesOnFrontendLoop"; if (pending_config_mode_state_->deleted_type) { core_thread_.message_loop()->PostTask(FROM_HERE, NewRunnableMethod(core_.get(), &SyncBackendHost::Core::DeferNudgeForCleanup)); } if (pending_config_mode_state_->added_types.none() && !core_->syncapi()->InitialSyncEndedForAllEnabledTypes()) { LOG(WARNING) << "No new types, but initial sync not finished." << "Possible sync db corruption / removal."; pending_config_mode_state_->added_types = syncable::ModelTypeBitSetFromSet( pending_config_mode_state_->initial_types); } if (pending_config_mode_state_->added_types.none()) { VLOG(1) << "SyncBackendHost(" << this << "): No new types added. " << "Calling ready_task directly"; pending_config_mode_state_->ready_task->Run(); } else { pending_download_state_.reset(pending_config_mode_state_.release()); syncable::ModelTypeBitSet types_copy(pending_download_state_->added_types); if (IsNigoriEnabled()) types_copy.set(syncable::NIGORI); VLOG(1) << "SyncBackendHost(" << this << "):New Types added. " << "Calling DoRequestConfig"; core_thread_.message_loop()->PostTask(FROM_HERE, NewRunnableMethod(core_.get(), &SyncBackendHost::Core::DoRequestConfig, types_copy, pending_download_state_->reason)); } pending_config_mode_state_.reset(); core_thread_.message_loop()->PostTask(FROM_HERE, NewRunnableMethod(core_.get(), &SyncBackendHost::Core::DoUpdateEnabledTypes)); }
void SyncBackendHost::FinishConfigureDataTypesOnFrontendLoop() { DCHECK_EQ(MessageLoop::current(), frontend_loop_); VLOG(1) << "Syncer in config mode. SBH executing" << "FinishConfigureDataTypesOnFrontendLoop"; if (pending_config_mode_state_->deleted_type) { core_thread_.message_loop()->PostTask(FROM_HERE, NewRunnableMethod(core_.get(), &SyncBackendHost::Core::DeferNudgeForCleanup)); } if (pending_config_mode_state_->added_types.none() && !core_->syncapi()->InitialSyncEndedForAllEnabledTypes()) { LOG(WARNING) << "No new types, but initial sync not finished." << "Possible sync db corruption / removal."; pending_config_mode_state_->added_types = syncable::ModelTypeBitSetFromSet( pending_config_mode_state_->initial_types); } if (pending_config_mode_state_->added_types.none()) { VLOG(1) << "SyncBackendHost(" << this << "): No new types added. " << "Calling ready_task directly"; pending_config_mode_state_->ready_task->Run(); } else { pending_download_state_.reset(pending_config_mode_state_.release()); syncable::ModelTypeBitSet types_copy(pending_download_state_->added_types); if (IsNigoriEnabled()) types_copy.set(syncable::NIGORI); VLOG(1) << "SyncBackendHost(" << this << "):New Types added. " << "Calling DoRequestConfig"; core_thread_.message_loop()->PostTask(FROM_HERE, NewRunnableMethod(core_.get(), &SyncBackendHost::Core::DoRequestConfig, types_copy, pending_download_state_->reason)); } pending_config_mode_state_.reset(); core_thread_.message_loop()->PostTask(FROM_HERE, NewRunnableMethod(core_.get(), &SyncBackendHost::Core::DoUpdateEnabledTypes)); }
C
Chrome
0
null
null
null
https://github.com/chromium/chromium/commit/d30a8bd191f17b61938fc87890bffc80049b0774
d30a8bd191f17b61938fc87890bffc80049b0774
[Extensions] Rework inline installation observation Instead of observing through the WebstoreAPI, observe directly in the TabHelper. This is a great deal less code, more direct, and also fixes a lifetime issue with the TabHelper being deleted before the inline installation completes. BUG=613949 Review-Url: https://codereview.chromium.org/2103663002 Cr-Commit-Position: refs/heads/master@{#403188}
void WebstoreStandaloneInstaller::OnInstallPromptDone( ExtensionInstallPrompt::Result result) { if (result == ExtensionInstallPrompt::Result::USER_CANCELED) { CompleteInstall(webstore_install::USER_CANCELLED, webstore_install::kUserCancelledError); return; } if (result == ExtensionInstallPrompt::Result::ABORTED || !CheckRequestorAlive()) { CompleteInstall(webstore_install::ABORTED, std::string()); return; } DCHECK(result == ExtensionInstallPrompt::Result::ACCEPTED); std::unique_ptr<WebstoreInstaller::Approval> approval = CreateApproval(); ExtensionService* extension_service = ExtensionSystem::Get(profile_)->extension_service(); const Extension* installed_extension = extension_service->GetExtensionById(id_, true /* include disabled */); if (installed_extension) { std::string install_message; webstore_install::Result install_result = webstore_install::SUCCESS; bool done = true; if (ExtensionPrefs::Get(profile_)->IsExtensionBlacklisted(id_)) { install_result = webstore_install::BLACKLISTED; install_message = webstore_install::kExtensionIsBlacklisted; } else if (!extension_service->IsExtensionEnabled(id_)) { extension_service->EnableExtension(id_); } // else extension is installed and enabled; no work to be done. if (done) { CompleteInstall(install_result, install_message); return; } } scoped_refptr<WebstoreInstaller> installer = new WebstoreInstaller(profile_, this, GetWebContents(), id_, std::move(approval), install_source_); installer->Start(); }
void WebstoreStandaloneInstaller::OnInstallPromptDone( ExtensionInstallPrompt::Result result) { if (result == ExtensionInstallPrompt::Result::USER_CANCELED) { CompleteInstall(webstore_install::USER_CANCELLED, kUserCancelledError); return; } if (result == ExtensionInstallPrompt::Result::ABORTED || !CheckRequestorAlive()) { CompleteInstall(webstore_install::ABORTED, std::string()); return; } DCHECK(result == ExtensionInstallPrompt::Result::ACCEPTED); std::unique_ptr<WebstoreInstaller::Approval> approval = CreateApproval(); ExtensionService* extension_service = ExtensionSystem::Get(profile_)->extension_service(); const Extension* installed_extension = extension_service->GetExtensionById(id_, true /* include disabled */); if (installed_extension) { std::string install_message; webstore_install::Result install_result = webstore_install::SUCCESS; bool done = true; if (ExtensionPrefs::Get(profile_)->IsExtensionBlacklisted(id_)) { install_result = webstore_install::BLACKLISTED; install_message = kExtensionIsBlacklisted; } else if (!extension_service->IsExtensionEnabled(id_)) { extension_service->EnableExtension(id_); } // else extension is installed and enabled; no work to be done. if (done) { CompleteInstall(install_result, install_message); return; } } scoped_refptr<WebstoreInstaller> installer = new WebstoreInstaller(profile_, this, GetWebContents(), id_, std::move(approval), install_source_); installer->Start(); }
C
Chrome
1
CVE-2016-10010
https://www.cvedetails.com/cve/CVE-2016-10010/
CWE-264
https://github.com/openbsd/src/commit/c76fac666ea038753294f2ac94d310f8adece9ce
c76fac666ea038753294f2ac94d310f8adece9ce
disable Unix-domain socket forwarding when privsep is disabled
process_buffered_input_packets(void) { dispatch_run(DISPATCH_NONBLOCK, NULL, active_state); }
process_buffered_input_packets(void) { dispatch_run(DISPATCH_NONBLOCK, NULL, active_state); }
C
src
0
CVE-2015-1271
https://www.cvedetails.com/cve/CVE-2015-1271/
CWE-119
https://github.com/chromium/chromium/commit/74fce5949bdf05a92c2bc0bd98e6e3e977c55376
74fce5949bdf05a92c2bc0bd98e6e3e977c55376
Fixed volume slider element event handling MediaControlVolumeSliderElement::defaultEventHandler has making redundant calls to setVolume() & setMuted() on mouse activity. E.g. if a mouse click changed the slider position, the above calls were made 4 times, once for each of these events: mousedown, input, mouseup, DOMActive, click. This crack got exposed when PointerEvents are enabled by default on M55, adding pointermove, pointerdown & pointerup to the list. This CL fixes the code to trigger the calls to setVolume() & setMuted() only when the slider position is changed. Also added pointer events to certain lists of mouse events in the code. BUG=677900 Review-Url: https://codereview.chromium.org/2622273003 Cr-Commit-Position: refs/heads/master@{#446032}
MediaControlVolumeSliderElement* MediaControlVolumeSliderElement::create( MediaControls& mediaControls) { MediaControlVolumeSliderElement* slider = new MediaControlVolumeSliderElement(mediaControls); slider->ensureUserAgentShadowRoot(); slider->setType(InputTypeNames::range); slider->setAttribute(stepAttr, "any"); slider->setAttribute(maxAttr, "1"); slider->setShadowPseudoId( AtomicString("-webkit-media-controls-volume-slider")); return slider; }
MediaControlVolumeSliderElement* MediaControlVolumeSliderElement::create( MediaControls& mediaControls) { MediaControlVolumeSliderElement* slider = new MediaControlVolumeSliderElement(mediaControls); slider->ensureUserAgentShadowRoot(); slider->setType(InputTypeNames::range); slider->setAttribute(stepAttr, "any"); slider->setAttribute(maxAttr, "1"); slider->setShadowPseudoId( AtomicString("-webkit-media-controls-volume-slider")); return slider; }
C
Chrome
0
CVE-2018-18386
https://www.cvedetails.com/cve/CVE-2018-18386/
CWE-704
https://github.com/torvalds/linux/commit/966031f340185eddd05affcf72b740549f056348
966031f340185eddd05affcf72b740549f056348
n_tty: fix EXTPROC vs ICANON interaction with TIOCINQ (aka FIONREAD) We added support for EXTPROC back in 2010 in commit 26df6d13406d ("tty: Add EXTPROC support for LINEMODE") and the intent was to allow it to override some (all?) ICANON behavior. Quoting from that original commit message: There is a new bit in the termios local flag word, EXTPROC. When this bit is set, several aspects of the terminal driver are disabled. Input line editing, character echo, and mapping of signals are all disabled. This allows the telnetd to turn off these functions when in linemode, but still keep track of what state the user wants the terminal to be in. but the problem turns out that "several aspects of the terminal driver are disabled" is a bit ambiguous, and you can really confuse the n_tty layer by setting EXTPROC and then causing some of the ICANON invariants to no longer be maintained. This fixes at least one such case (TIOCINQ) becoming unhappy because of the confusion over whether ICANON really means ICANON when EXTPROC is set. This basically makes TIOCINQ match the case of read: if EXTPROC is set, we ignore ICANON. Also, make sure to reset the ICANON state ie EXTPROC changes, not just if ICANON changes. Fixes: 26df6d13406d ("tty: Add EXTPROC support for LINEMODE") Reported-by: Tetsuo Handa <[email protected]> Reported-by: syzkaller <[email protected]> Cc: Jiri Slaby <[email protected]> Signed-off-by: Linus Torvalds <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
static int copy_from_read_buf(struct tty_struct *tty, unsigned char __user **b, size_t *nr) { struct n_tty_data *ldata = tty->disc_data; int retval; size_t n; bool is_eof; size_t head = smp_load_acquire(&ldata->commit_head); size_t tail = ldata->read_tail & (N_TTY_BUF_SIZE - 1); retval = 0; n = min(head - ldata->read_tail, N_TTY_BUF_SIZE - tail); n = min(*nr, n); if (n) { const unsigned char *from = read_buf_addr(ldata, tail); retval = copy_to_user(*b, from, n); n -= retval; is_eof = n == 1 && *from == EOF_CHAR(tty); tty_audit_add_data(tty, from, n); smp_store_release(&ldata->read_tail, ldata->read_tail + n); /* Turn single EOF into zero-length read */ if (L_EXTPROC(tty) && ldata->icanon && is_eof && (head == ldata->read_tail)) n = 0; *b += n; *nr -= n; } return retval; }
static int copy_from_read_buf(struct tty_struct *tty, unsigned char __user **b, size_t *nr) { struct n_tty_data *ldata = tty->disc_data; int retval; size_t n; bool is_eof; size_t head = smp_load_acquire(&ldata->commit_head); size_t tail = ldata->read_tail & (N_TTY_BUF_SIZE - 1); retval = 0; n = min(head - ldata->read_tail, N_TTY_BUF_SIZE - tail); n = min(*nr, n); if (n) { const unsigned char *from = read_buf_addr(ldata, tail); retval = copy_to_user(*b, from, n); n -= retval; is_eof = n == 1 && *from == EOF_CHAR(tty); tty_audit_add_data(tty, from, n); smp_store_release(&ldata->read_tail, ldata->read_tail + n); /* Turn single EOF into zero-length read */ if (L_EXTPROC(tty) && ldata->icanon && is_eof && (head == ldata->read_tail)) n = 0; *b += n; *nr -= n; } return retval; }
C
linux
0
CVE-2018-7752
https://www.cvedetails.com/cve/CVE-2018-7752/
CWE-119
https://github.com/gpac/gpac/commit/90dc7f853d31b0a4e9441cba97feccf36d8b69a4
90dc7f853d31b0a4e9441cba97feccf36d8b69a4
fix some exploitable overflows (#994, #997)
GF_Err hvcc_Size(GF_Box *s) { u32 i, count, j, subcount; GF_HEVCConfigurationBox *ptr = (GF_HEVCConfigurationBox *)s; if (!ptr->config) { ptr->size = 0; return GF_OK; } if (!ptr->config->is_lhvc) ptr->size += 23; else ptr->size += 6; count = gf_list_count(ptr->config->param_array); for (i=0; i<count; i++) { GF_HEVCParamArray *ar = (GF_HEVCParamArray*)gf_list_get(ptr->config->param_array, i); ptr->size += 3; subcount = gf_list_count(ar->nalus); for (j=0; j<subcount; j++) { ptr->size += 2 + ((GF_AVCConfigSlot *)gf_list_get(ar->nalus, j))->size; } } return GF_OK; }
GF_Err hvcc_Size(GF_Box *s) { u32 i, count, j, subcount; GF_HEVCConfigurationBox *ptr = (GF_HEVCConfigurationBox *)s; if (!ptr->config) { ptr->size = 0; return GF_OK; } if (!ptr->config->is_lhvc) ptr->size += 23; else ptr->size += 6; count = gf_list_count(ptr->config->param_array); for (i=0; i<count; i++) { GF_HEVCParamArray *ar = (GF_HEVCParamArray*)gf_list_get(ptr->config->param_array, i); ptr->size += 3; subcount = gf_list_count(ar->nalus); for (j=0; j<subcount; j++) { ptr->size += 2 + ((GF_AVCConfigSlot *)gf_list_get(ar->nalus, j))->size; } } return GF_OK; }
C
gpac
0
CVE-2013-6626
https://www.cvedetails.com/cve/CVE-2013-6626/
null
https://github.com/chromium/chromium/commit/90fb08ed0146c9beacfd4dde98a20fc45419fff3
90fb08ed0146c9beacfd4dde98a20fc45419fff3
Cancel JavaScript dialogs when an interstitial appears. BUG=295695 TEST=See bug for repro steps. Review URL: https://chromiumcodereview.appspot.com/24360011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@225026 0039d316-1c4b-4281-b951-d872f2087c98
RenderViewHost* WebContentsImpl::GetRenderViewHost() const { return render_manager_.current_host(); }
RenderViewHost* WebContentsImpl::GetRenderViewHost() const { return render_manager_.current_host(); }
C
Chrome
0
CVE-2019-7395
https://www.cvedetails.com/cve/CVE-2019-7395/
CWE-399
https://github.com/ImageMagick/ImageMagick/commit/8a43abefb38c5e29138e1c9c515b313363541c06
8a43abefb38c5e29138e1c9c515b313363541c06
https://github.com/ImageMagick/ImageMagick/issues/1451
static void PreservePSDOpacityMask(Image *image,LayerInfo* layer_info, ExceptionInfo *exception) { char *key; RandomInfo *random_info; StringInfo *key_info; if (image->debug != MagickFalse) (void) LogMagickEvent(CoderEvent,GetMagickModule(), " preserving opacity mask"); random_info=AcquireRandomInfo(); key_info=GetRandomKey(random_info,2+1); key=(char *) GetStringInfoDatum(key_info); key[8]=(char ) layer_info->mask.background; key[9]='\0'; layer_info->mask.image->page.x+=layer_info->page.x; layer_info->mask.image->page.y+=layer_info->page.y; (void) SetImageRegistry(ImageRegistryType,(const char *) key, layer_info->mask.image,exception); (void) SetImageArtifact(layer_info->image,"psd:opacity-mask", (const char *) key); key_info=DestroyStringInfo(key_info); random_info=DestroyRandomInfo(random_info); }
static void PreservePSDOpacityMask(Image *image,LayerInfo* layer_info, ExceptionInfo *exception) { char *key; RandomInfo *random_info; StringInfo *key_info; if (image->debug != MagickFalse) (void) LogMagickEvent(CoderEvent,GetMagickModule(), " preserving opacity mask"); random_info=AcquireRandomInfo(); key_info=GetRandomKey(random_info,2+1); key=(char *) GetStringInfoDatum(key_info); key[8]=(char ) layer_info->mask.background; key[9]='\0'; layer_info->mask.image->page.x+=layer_info->page.x; layer_info->mask.image->page.y+=layer_info->page.y; (void) SetImageRegistry(ImageRegistryType,(const char *) key, layer_info->mask.image,exception); (void) SetImageArtifact(layer_info->image,"psd:opacity-mask", (const char *) key); key_info=DestroyStringInfo(key_info); random_info=DestroyRandomInfo(random_info); }
C
ImageMagick
0
CVE-2016-3839
https://www.cvedetails.com/cve/CVE-2016-3839/
CWE-284
https://android.googlesource.com/platform/system/bt/+/472271b153c5dc53c28beac55480a8d8434b2d5c
472271b153c5dc53c28beac55480a8d8434b2d5c
DO NOT MERGE Fix potential DoS caused by delivering signal to BT process Bug: 28885210 Change-Id: I63866d894bfca47464d6e42e3fb0357c4f94d360 Conflicts: btif/co/bta_hh_co.c btif/src/btif_core.c Merge conflict resolution of ag/1161415 (referencing ag/1164670) - Directly into mnc-mr2-release
btpan_interface_t *btif_pan_get_interface() { return &pan_if; }
btpan_interface_t *btif_pan_get_interface() { return &pan_if; }
C
Android
0
CVE-2017-5077
https://www.cvedetails.com/cve/CVE-2017-5077/
CWE-125
https://github.com/chromium/chromium/commit/fec26ff33bf372476a70326f3669a35f34a9d474
fec26ff33bf372476a70326f3669a35f34a9d474
Origins should be represented as url::Origin (not as GURL). As pointed out in //docs/security/origin-vs-url.md, origins should be represented as url::Origin (not as GURL). This CL applies this guideline to predictor-related code and changes the type of the following fields from GURL to url::Origin: - OriginRequestSummary::origin - PreconnectedRequestStats::origin - PreconnectRequest::origin The old code did not depend on any non-origin parts of GURL (like path and/or query). Therefore, this CL has no intended behavior change. Bug: 973885 Change-Id: Idd14590b4834cb9d50c74ed747b595fe1a4ba357 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1895167 Commit-Queue: Łukasz Anforowicz <[email protected]> Reviewed-by: Alex Ilin <[email protected]> Cr-Commit-Position: refs/heads/master@{#716311}
void ResourcePrefetchPredictor::LearnOrigins( const std::string& host, const GURL& main_frame_origin, const std::map<url::Origin, OriginRequestSummary>& summaries) { DCHECK_CURRENTLY_ON(BrowserThread::UI); if (host.size() > ResourcePrefetchPredictorTables::kMaxStringLength) return; OriginData data; bool exists = origin_data_->TryGetData(host, &data); if (!exists) { data.set_host(host); data.set_last_visit_time(base::Time::Now().ToInternalValue()); size_t origins_size = summaries.size(); auto ordered_origins = std::vector<const OriginRequestSummary*>(origins_size); for (const auto& kv : summaries) { size_t index = kv.second.first_occurrence; DCHECK_LT(index, origins_size); ordered_origins[index] = &kv.second; } for (const OriginRequestSummary* summary : ordered_origins) { auto* origin_to_add = data.add_origins(); InitializeOriginStatFromOriginRequestSummary(origin_to_add, *summary); } } else { data.set_last_visit_time(base::Time::Now().ToInternalValue()); std::map<url::Origin, int> old_index; int old_size = static_cast<int>(data.origins_size()); for (int i = 0; i < old_size; ++i) { bool is_new = old_index .insert({url::Origin::Create(GURL(data.origins(i).origin())), i}) .second; DCHECK(is_new); } for (int i = 0; i < old_size; ++i) { auto* old_origin = data.mutable_origins(i); url::Origin origin = url::Origin::Create(GURL(old_origin->origin())); auto it = summaries.find(origin); if (it == summaries.end()) { old_origin->set_number_of_misses(old_origin->number_of_misses() + 1); old_origin->set_consecutive_misses(old_origin->consecutive_misses() + 1); } else { const auto& new_origin = it->second; old_origin->set_always_access_network(new_origin.always_access_network); old_origin->set_accessed_network(new_origin.accessed_network); int position = new_origin.first_occurrence + 1; int total = old_origin->number_of_hits() + old_origin->number_of_misses(); old_origin->set_average_position( ((old_origin->average_position() * total) + position) / (total + 1)); old_origin->set_number_of_hits(old_origin->number_of_hits() + 1); old_origin->set_consecutive_misses(0); } } for (const auto& kv : summaries) { if (old_index.find(kv.first) != old_index.end()) continue; auto* origin_to_add = data.add_origins(); InitializeOriginStatFromOriginRequestSummary(origin_to_add, kv.second); } } ResourcePrefetchPredictorTables::TrimOrigins(&data, config_.max_consecutive_misses); ResourcePrefetchPredictorTables::SortOrigins(&data, main_frame_origin.spec()); if (data.origins_size() > static_cast<int>(config_.max_origins_per_entry)) { data.mutable_origins()->DeleteSubrange( config_.max_origins_per_entry, data.origins_size() - config_.max_origins_per_entry); } if (data.origins_size() == 0) origin_data_->DeleteData({host}); else origin_data_->UpdateData(host, data); }
void ResourcePrefetchPredictor::LearnOrigins( const std::string& host, const GURL& main_frame_origin, const std::map<GURL, OriginRequestSummary>& summaries) { DCHECK_CURRENTLY_ON(BrowserThread::UI); if (host.size() > ResourcePrefetchPredictorTables::kMaxStringLength) return; OriginData data; bool exists = origin_data_->TryGetData(host, &data); if (!exists) { data.set_host(host); data.set_last_visit_time(base::Time::Now().ToInternalValue()); size_t origins_size = summaries.size(); auto ordered_origins = std::vector<const OriginRequestSummary*>(origins_size); for (const auto& kv : summaries) { size_t index = kv.second.first_occurrence; DCHECK_LT(index, origins_size); ordered_origins[index] = &kv.second; } for (const OriginRequestSummary* summary : ordered_origins) { auto* origin_to_add = data.add_origins(); InitializeOriginStatFromOriginRequestSummary(origin_to_add, *summary); } } else { data.set_last_visit_time(base::Time::Now().ToInternalValue()); std::map<GURL, int> old_index; int old_size = static_cast<int>(data.origins_size()); for (int i = 0; i < old_size; ++i) { bool is_new = old_index.insert({GURL(data.origins(i).origin()), i}).second; DCHECK(is_new); } for (int i = 0; i < old_size; ++i) { auto* old_origin = data.mutable_origins(i); GURL origin(old_origin->origin()); auto it = summaries.find(origin); if (it == summaries.end()) { old_origin->set_number_of_misses(old_origin->number_of_misses() + 1); old_origin->set_consecutive_misses(old_origin->consecutive_misses() + 1); } else { const auto& new_origin = it->second; old_origin->set_always_access_network(new_origin.always_access_network); old_origin->set_accessed_network(new_origin.accessed_network); int position = new_origin.first_occurrence + 1; int total = old_origin->number_of_hits() + old_origin->number_of_misses(); old_origin->set_average_position( ((old_origin->average_position() * total) + position) / (total + 1)); old_origin->set_number_of_hits(old_origin->number_of_hits() + 1); old_origin->set_consecutive_misses(0); } } for (const auto& kv : summaries) { if (old_index.find(kv.first) != old_index.end()) continue; auto* origin_to_add = data.add_origins(); InitializeOriginStatFromOriginRequestSummary(origin_to_add, kv.second); } } ResourcePrefetchPredictorTables::TrimOrigins(&data, config_.max_consecutive_misses); ResourcePrefetchPredictorTables::SortOrigins(&data, main_frame_origin.spec()); if (data.origins_size() > static_cast<int>(config_.max_origins_per_entry)) { data.mutable_origins()->DeleteSubrange( config_.max_origins_per_entry, data.origins_size() - config_.max_origins_per_entry); } if (data.origins_size() == 0) origin_data_->DeleteData({host}); else origin_data_->UpdateData(host, data); }
C
Chrome
1
CVE-2012-2816
https://www.cvedetails.com/cve/CVE-2012-2816/
null
https://github.com/chromium/chromium/commit/cd0bd79d6ebdb72183e6f0833673464cc10b3600
cd0bd79d6ebdb72183e6f0833673464cc10b3600
Convert plugin and GPU process to brokered handle duplication. BUG=119250 Review URL: https://chromiumcodereview.appspot.com/9958034 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@132303 0039d316-1c4b-4281-b951-d872f2087c98
void WebPluginProxy::InitiateHTTPRangeRequest( const char* url, const char* range_info, int range_request_id) { Send(new PluginHostMsg_InitiateHTTPRangeRequest( route_id_, url, range_info, range_request_id)); }
void WebPluginProxy::InitiateHTTPRangeRequest( const char* url, const char* range_info, int range_request_id) { Send(new PluginHostMsg_InitiateHTTPRangeRequest( route_id_, url, range_info, range_request_id)); }
C
Chrome
0
CVE-2017-5120
https://www.cvedetails.com/cve/CVE-2017-5120/
null
https://github.com/chromium/chromium/commit/b7277af490d28ac7f802c015bb0ff31395768556
b7277af490d28ac7f802c015bb0ff31395768556
bindings: Support "attribute FrozenArray<T>?" Adds a quick hack to support a case of "attribute FrozenArray<T>?". Bug: 1028047 Change-Id: Ib3cecc4beb6bcc0fb0dbc667aca595454cc90c86 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1933866 Reviewed-by: Hitoshi Yoshida <[email protected]> Commit-Queue: Yuki Shiino <[email protected]> Cr-Commit-Position: refs/heads/master@{#718676}
static void CSSAttributeAttributeSetter( v8::Local<v8::Value> v8_value, const v8::FunctionCallbackInfo<v8::Value>& info) { v8::Isolate* isolate = info.GetIsolate(); ALLOW_UNUSED_LOCAL(isolate); v8::Local<v8::Object> holder = info.Holder(); ALLOW_UNUSED_LOCAL(holder); TestObject* impl = V8TestObject::ToImpl(holder); ExceptionState exception_state(isolate, ExceptionState::kSetterContext, "TestObject", "cssAttribute"); int32_t cpp_value = NativeValueTraits<IDLLong>::NativeValue(info.GetIsolate(), v8_value, exception_state); if (exception_state.HadException()) return; impl->setCSSAttribute(cpp_value); }
static void CSSAttributeAttributeSetter( v8::Local<v8::Value> v8_value, const v8::FunctionCallbackInfo<v8::Value>& info) { v8::Isolate* isolate = info.GetIsolate(); ALLOW_UNUSED_LOCAL(isolate); v8::Local<v8::Object> holder = info.Holder(); ALLOW_UNUSED_LOCAL(holder); TestObject* impl = V8TestObject::ToImpl(holder); ExceptionState exception_state(isolate, ExceptionState::kSetterContext, "TestObject", "cssAttribute"); int32_t cpp_value = NativeValueTraits<IDLLong>::NativeValue(info.GetIsolate(), v8_value, exception_state); if (exception_state.HadException()) return; impl->setCSSAttribute(cpp_value); }
C
Chrome
0
CVE-2019-5792
https://www.cvedetails.com/cve/CVE-2019-5792/
CWE-190
https://github.com/chromium/chromium/commit/227851d714bdc081de4c7e81669420380fa6c000
227851d714bdc081de4c7e81669420380fa6c000
arc: add test for blocking incognito windows in screenshot BUG=778852 TEST=ArcVoiceInteractionFrameworkServiceUnittest. CapturingScreenshotBlocksIncognitoWindows Change-Id: I0bfa5a486759783d7c8926a309c6b5da9b02dcc6 Reviewed-on: https://chromium-review.googlesource.com/914983 Commit-Queue: Muyuan Li <[email protected]> Reviewed-by: Luis Hector Chavez <[email protected]> Cr-Commit-Position: refs/heads/master@{#536438}
bool ArcVoiceInteractionFrameworkService::ValidateTimeSinceUserInteraction() { DCHECK_CURRENTLY_ON(content::BrowserThread::UI); if (!context_request_remaining_count_) { LOG(ERROR) << "Illegal context request from container."; UMA_HISTOGRAM_BOOLEAN("VoiceInteraction.IllegalContextRequest", true); return false; } auto elapsed = base::TimeTicks::Now() - user_interaction_start_time_; elapsed = elapsed > kMaxTimeSinceUserInteractionForHistogram ? kMaxTimeSinceUserInteractionForHistogram : elapsed; UMA_HISTOGRAM_CUSTOM_COUNTS( "VoiceInteraction.UserInteractionToRequestArrival", elapsed.InMilliseconds(), 1, kMaxTimeSinceUserInteractionForHistogram.InMilliseconds(), 20); if (elapsed > kAllowedTimeSinceUserInteraction) { LOG(ERROR) << "Timed out since last user interaction."; context_request_remaining_count_ = 0; return false; } context_request_remaining_count_--; return true; }
bool ArcVoiceInteractionFrameworkService::ValidateTimeSinceUserInteraction() { DCHECK_CURRENTLY_ON(content::BrowserThread::UI); if (!context_request_remaining_count_) { LOG(ERROR) << "Illegal context request from container."; UMA_HISTOGRAM_BOOLEAN("VoiceInteraction.IllegalContextRequest", true); return false; } auto elapsed = base::TimeTicks::Now() - user_interaction_start_time_; elapsed = elapsed > kMaxTimeSinceUserInteractionForHistogram ? kMaxTimeSinceUserInteractionForHistogram : elapsed; UMA_HISTOGRAM_CUSTOM_COUNTS( "VoiceInteraction.UserInteractionToRequestArrival", elapsed.InMilliseconds(), 1, kMaxTimeSinceUserInteractionForHistogram.InMilliseconds(), 20); if (elapsed > kAllowedTimeSinceUserInteraction) { LOG(ERROR) << "Timed out since last user interaction."; context_request_remaining_count_ = 0; return false; } context_request_remaining_count_--; return true; }
C
Chrome
0
CVE-2013-0281
https://www.cvedetails.com/cve/CVE-2013-0281/
CWE-399
https://github.com/ClusterLabs/pacemaker/commit/564f7cc2a51dcd2f28ab12a13394f31be5aa3c93
564f7cc2a51dcd2f28ab12a13394f31be5aa3c93
High: core: Internal tls api improvements for reuse with future LRMD tls backend.
main(int argc, char **argv) { int flag; int argerr = 0; int exit_code = 0; int option_index = 0; pid_file = strdup("/tmp/ClusterMon.pid"); crm_log_cli_init("crm_mon"); crm_set_options(NULL, "mode [options]", long_options, "Provides a summary of cluster's current state." "\n\nOutputs varying levels of detail in a number of different formats.\n"); #ifndef ON_DARWIN /* prevent zombies */ signal(SIGCLD, SIG_IGN); #endif if (strcmp(crm_system_name, "crm_mon.cgi") == 0) { web_cgi = TRUE; one_shot = TRUE; } while (1) { flag = crm_get_option(argc, argv, &option_index); if (flag == -1) break; switch (flag) { case 'V': crm_bump_log_level(argc, argv); break; case 'Q': print_last_updated = FALSE; print_last_change = FALSE; break; case 'i': reconnect_msec = crm_get_msec(optarg); break; case 'n': group_by_node = TRUE; break; case 'r': inactive_resources = TRUE; break; case 'W': watch_fencing = TRUE; break; case 'd': daemonize = TRUE; break; case 't': print_timing = TRUE; print_operations = TRUE; break; case 'o': print_operations = TRUE; break; case 'f': print_failcount = TRUE; break; case 'A': print_nodes_attr = TRUE; break; case 'c': print_tickets = TRUE; break; case 'p': free(pid_file); pid_file = strdup(optarg); break; case 'x': xml_file = strdup(optarg); one_shot = TRUE; break; case 'h': as_html_file = strdup(optarg); break; case 'X': as_xml = TRUE; one_shot = TRUE; break; case 'w': web_cgi = TRUE; one_shot = TRUE; break; case 's': simple_status = TRUE; one_shot = TRUE; break; case 'S': snmp_target = optarg; break; case 'T': crm_mail_to = optarg; break; case 'F': crm_mail_from = optarg; break; case 'H': crm_mail_host = optarg; break; case 'P': crm_mail_prefix = optarg; break; case 'E': external_agent = optarg; break; case 'e': external_recipient = optarg; break; case '1': one_shot = TRUE; break; case 'N': as_console = FALSE; break; case 'C': snmp_community = optarg; break; case '$': case '?': crm_help(flag, EX_OK); break; default: printf("Argument code 0%o (%c) is not (?yet?) supported\n", flag, flag); ++argerr; break; } } if (optind < argc) { printf("non-option ARGV-elements: "); while (optind < argc) printf("%s ", argv[optind++]); printf("\n"); } if (argerr) { crm_help('?', EX_USAGE); } if (one_shot) { as_console = FALSE; } else if (daemonize) { as_console = FALSE; crm_enable_stderr(FALSE); if (!as_html_file && !snmp_target && !crm_mail_to && !external_agent && !as_xml) { printf ("Looks like you forgot to specify one or more of: --as-html, --as-xml, --mail-to, --snmp-target, --external-agent\n"); crm_help('?', EX_USAGE); } crm_make_daemon(crm_system_name, TRUE, pid_file); } else if (as_console) { #if CURSES_ENABLED initscr(); cbreak(); noecho(); crm_enable_stderr(FALSE); #else one_shot = TRUE; as_console = FALSE; printf("Defaulting to one-shot mode\n"); printf("You need to have curses available at compile time to enable console mode\n"); #endif } crm_info("Starting %s", crm_system_name); if (xml_file != NULL) { current_cib = filename2xml(xml_file); mon_refresh_display(NULL); return exit_code; } if (current_cib == NULL) { cib = cib_new(); if (!one_shot) { print_as("Attempting connection to the cluster..."); } do { exit_code = cib_connect(!one_shot); if (one_shot) { break; } else if (exit_code != pcmk_ok) { print_dot(); sleep(reconnect_msec / 1000); } } while (exit_code == -ENOTCONN); if (exit_code != pcmk_ok) { print_as("\nConnection to cluster failed: %s\n", pcmk_strerror(exit_code)); if (as_console) { sleep(2); } clean_up(-exit_code); } } if (one_shot) { return exit_code; } mainloop = g_main_new(FALSE); mainloop_add_signal(SIGTERM, mon_shutdown); mainloop_add_signal(SIGINT, mon_shutdown); #if CURSES_ENABLED if (as_console) { ncurses_winch_handler = signal(SIGWINCH, mon_winresize); if (ncurses_winch_handler == SIG_DFL || ncurses_winch_handler == SIG_IGN || ncurses_winch_handler == SIG_ERR) ncurses_winch_handler = NULL; } #endif refresh_trigger = mainloop_add_trigger(G_PRIORITY_LOW, mon_refresh_display, NULL); g_main_run(mainloop); g_main_destroy(mainloop); crm_info("Exiting %s", crm_system_name); clean_up(0); return 0; /* never reached */ }
main(int argc, char **argv) { int flag; int argerr = 0; int exit_code = 0; int option_index = 0; pid_file = strdup("/tmp/ClusterMon.pid"); crm_log_cli_init("crm_mon"); crm_set_options(NULL, "mode [options]", long_options, "Provides a summary of cluster's current state." "\n\nOutputs varying levels of detail in a number of different formats.\n"); #ifndef ON_DARWIN /* prevent zombies */ signal(SIGCLD, SIG_IGN); #endif if (strcmp(crm_system_name, "crm_mon.cgi") == 0) { web_cgi = TRUE; one_shot = TRUE; } while (1) { flag = crm_get_option(argc, argv, &option_index); if (flag == -1) break; switch (flag) { case 'V': crm_bump_log_level(argc, argv); break; case 'Q': print_last_updated = FALSE; print_last_change = FALSE; break; case 'i': reconnect_msec = crm_get_msec(optarg); break; case 'n': group_by_node = TRUE; break; case 'r': inactive_resources = TRUE; break; case 'W': watch_fencing = TRUE; break; case 'd': daemonize = TRUE; break; case 't': print_timing = TRUE; print_operations = TRUE; break; case 'o': print_operations = TRUE; break; case 'f': print_failcount = TRUE; break; case 'A': print_nodes_attr = TRUE; break; case 'c': print_tickets = TRUE; break; case 'p': free(pid_file); pid_file = strdup(optarg); break; case 'x': xml_file = strdup(optarg); one_shot = TRUE; break; case 'h': as_html_file = strdup(optarg); break; case 'X': as_xml = TRUE; one_shot = TRUE; break; case 'w': web_cgi = TRUE; one_shot = TRUE; break; case 's': simple_status = TRUE; one_shot = TRUE; break; case 'S': snmp_target = optarg; break; case 'T': crm_mail_to = optarg; break; case 'F': crm_mail_from = optarg; break; case 'H': crm_mail_host = optarg; break; case 'P': crm_mail_prefix = optarg; break; case 'E': external_agent = optarg; break; case 'e': external_recipient = optarg; break; case '1': one_shot = TRUE; break; case 'N': as_console = FALSE; break; case 'C': snmp_community = optarg; break; case '$': case '?': crm_help(flag, EX_OK); break; default: printf("Argument code 0%o (%c) is not (?yet?) supported\n", flag, flag); ++argerr; break; } } if (optind < argc) { printf("non-option ARGV-elements: "); while (optind < argc) printf("%s ", argv[optind++]); printf("\n"); } if (argerr) { crm_help('?', EX_USAGE); } if (one_shot) { as_console = FALSE; } else if (daemonize) { as_console = FALSE; crm_enable_stderr(FALSE); if (!as_html_file && !snmp_target && !crm_mail_to && !external_agent && !as_xml) { printf ("Looks like you forgot to specify one or more of: --as-html, --as-xml, --mail-to, --snmp-target, --external-agent\n"); crm_help('?', EX_USAGE); } crm_make_daemon(crm_system_name, TRUE, pid_file); } else if (as_console) { #if CURSES_ENABLED initscr(); cbreak(); noecho(); crm_enable_stderr(FALSE); #else one_shot = TRUE; as_console = FALSE; printf("Defaulting to one-shot mode\n"); printf("You need to have curses available at compile time to enable console mode\n"); #endif } crm_info("Starting %s", crm_system_name); if (xml_file != NULL) { current_cib = filename2xml(xml_file); mon_refresh_display(NULL); return exit_code; } if (current_cib == NULL) { cib = cib_new(); if (!one_shot) { print_as("Attempting connection to the cluster..."); } do { exit_code = cib_connect(!one_shot); if (one_shot) { break; } else if (exit_code != pcmk_ok) { print_dot(); sleep(reconnect_msec / 1000); } } while (exit_code == -ENOTCONN); if (exit_code != pcmk_ok) { print_as("\nConnection to cluster failed: %s\n", pcmk_strerror(exit_code)); if (as_console) { sleep(2); } clean_up(-exit_code); } } if (one_shot) { return exit_code; } mainloop = g_main_new(FALSE); mainloop_add_signal(SIGTERM, mon_shutdown); mainloop_add_signal(SIGINT, mon_shutdown); #if CURSES_ENABLED if (as_console) { ncurses_winch_handler = signal(SIGWINCH, mon_winresize); if (ncurses_winch_handler == SIG_DFL || ncurses_winch_handler == SIG_IGN || ncurses_winch_handler == SIG_ERR) ncurses_winch_handler = NULL; } #endif refresh_trigger = mainloop_add_trigger(G_PRIORITY_LOW, mon_refresh_display, NULL); g_main_run(mainloop); g_main_destroy(mainloop); crm_info("Exiting %s", crm_system_name); clean_up(0); return 0; /* never reached */ }
C
pacemaker
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]>
iperf_get_test_json_output(struct iperf_test *ipt) { return ipt->json_output; }
iperf_get_test_json_output(struct iperf_test *ipt) { return ipt->json_output; }
C
iperf
0
CVE-2018-20067
https://www.cvedetails.com/cve/CVE-2018-20067/
CWE-254
https://github.com/chromium/chromium/commit/a7d715ae5b654d1f98669fd979a00282a7229044
a7d715ae5b654d1f98669fd979a00282a7229044
Prevent renderer initiated back navigation to cancel a browser one. Renderer initiated back/forward navigations must not be able to cancel ongoing browser initiated navigation if they are not user initiated. Note: 'normal' renderer initiated navigation uses the FrameHost::BeginNavigation() path. A code similar to this patch is done in NavigatorImpl::OnBeginNavigation(). Test: ----- Added: NavigationBrowserTest. * HistoryBackInBeforeUnload * HistoryBackInBeforeUnloadAfterSetTimeout * HistoryBackCancelPendingNavigationNoUserGesture * HistoryBackCancelPendingNavigationUserGesture Fixed: * (WPT) .../the-history-interface/traverse_the_history_2.html * (WPT) .../the-history-interface/traverse_the_history_3.html * (WPT) .../the-history-interface/traverse_the_history_4.html * (WPT) .../the-history-interface/traverse_the_history_5.html Bug: 879965 Change-Id: I1a9bfaaea1ffc219e6c32f6e676b660e746c578c Reviewed-on: https://chromium-review.googlesource.com/1209744 Commit-Queue: Arthur Sonzogni <[email protected]> Reviewed-by: Daniel Cheng <[email protected]> Reviewed-by: Mustaq Ahmed <[email protected]> Reviewed-by: Camille Lamy <[email protected]> Reviewed-by: Charlie Reis <[email protected]> Cr-Commit-Position: refs/heads/master@{#592823}
NavigationType navigation_type() { return navigation_type_; }
NavigationType navigation_type() { return navigation_type_; }
C
Chrome
0
CVE-2016-4558
https://www.cvedetails.com/cve/CVE-2016-4558/
null
https://github.com/torvalds/linux/commit/92117d8443bc5afacc8d5ba82e541946310f106e
92117d8443bc5afacc8d5ba82e541946310f106e
bpf: fix refcnt overflow On a system with >32Gbyte of phyiscal memory and infinite RLIMIT_MEMLOCK, the malicious application may overflow 32-bit bpf program refcnt. It's also possible to overflow map refcnt on 1Tb system. Impose 32k hard limit which means that the same bpf program or map cannot be shared by more than 32k processes. Fixes: 1be7f75d1668 ("bpf: enable non-root eBPF programs") Reported-by: Jann Horn <[email protected]> Signed-off-by: Alexei Starovoitov <[email protected]> Acked-by: Daniel Borkmann <[email protected]> Signed-off-by: David S. Miller <[email protected]>
static int check_ctx_access(struct verifier_env *env, int off, int size, enum bpf_access_type t) { if (env->prog->aux->ops->is_valid_access && env->prog->aux->ops->is_valid_access(off, size, t)) return 0; verbose("invalid bpf_context access off=%d size=%d\n", off, size); return -EACCES; }
static int check_ctx_access(struct verifier_env *env, int off, int size, enum bpf_access_type t) { if (env->prog->aux->ops->is_valid_access && env->prog->aux->ops->is_valid_access(off, size, t)) return 0; verbose("invalid bpf_context access off=%d size=%d\n", off, size); return -EACCES; }
C
linux
0
CVE-2011-2918
https://www.cvedetails.com/cve/CVE-2011-2918/
CWE-399
https://github.com/torvalds/linux/commit/a8b0ca17b80e92faab46ee7179ba9e99ccb61233
a8b0ca17b80e92faab46ee7179ba9e99ccb61233
perf: Remove the nmi parameter from the swevent and overflow interface The nmi parameter indicated if we could do wakeups from the current context, if not, we would set some state and self-IPI and let the resulting interrupt do the wakeup. For the various event classes: - hardware: nmi=0; PMI is in fact an NMI or we run irq_work_run from the PMI-tail (ARM etc.) - tracepoint: nmi=0; since tracepoint could be from NMI context. - software: nmi=[0,1]; some, like the schedule thing cannot perform wakeups, and hence need 0. As one can see, there is very little nmi=1 usage, and the down-side of not using it is that on some platforms some software events can have a jiffy delay in wakeup (when arch_irq_work_raise isn't implemented). The up-side however is that we can remove the nmi parameter and save a bunch of conditionals in fast paths. Signed-off-by: Peter Zijlstra <[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]>
xscale2pmu_write_counter(int counter, u32 val) { switch (counter) { case XSCALE_CYCLE_COUNTER: asm volatile("mcr p14, 0, %0, c1, c1, 0" : : "r" (val)); break; case XSCALE_COUNTER0: asm volatile("mcr p14, 0, %0, c0, c2, 0" : : "r" (val)); break; case XSCALE_COUNTER1: asm volatile("mcr p14, 0, %0, c1, c2, 0" : : "r" (val)); break; case XSCALE_COUNTER2: asm volatile("mcr p14, 0, %0, c2, c2, 0" : : "r" (val)); break; case XSCALE_COUNTER3: asm volatile("mcr p14, 0, %0, c3, c2, 0" : : "r" (val)); break; } }
xscale2pmu_write_counter(int counter, u32 val) { switch (counter) { case XSCALE_CYCLE_COUNTER: asm volatile("mcr p14, 0, %0, c1, c1, 0" : : "r" (val)); break; case XSCALE_COUNTER0: asm volatile("mcr p14, 0, %0, c0, c2, 0" : : "r" (val)); break; case XSCALE_COUNTER1: asm volatile("mcr p14, 0, %0, c1, c2, 0" : : "r" (val)); break; case XSCALE_COUNTER2: asm volatile("mcr p14, 0, %0, c2, c2, 0" : : "r" (val)); break; case XSCALE_COUNTER3: asm volatile("mcr p14, 0, %0, c3, c2, 0" : : "r" (val)); break; } }
C
linux
0
CVE-2013-4264
https://www.cvedetails.com/cve/CVE-2013-4264/
CWE-119
https://github.com/FFmpeg/FFmpeg/commit/2960576378d17d71cc8dccc926352ce568b5eec1
2960576378d17d71cc8dccc926352ce568b5eec1
avcodec/g2meet: fix src pointer checks in kempf_decode_tile() Fixes Ticket2842 Signed-off-by: Michael Niedermayer <[email protected]>
static int g2m_init_buffers(G2MContext *c) { int aligned_height; if (!c->framebuf || c->old_width < c->width || c->old_height < c->height) { c->framebuf_stride = FFALIGN(c->width * 3, 16); aligned_height = FFALIGN(c->height, 16); av_free(c->framebuf); c->framebuf = av_mallocz(c->framebuf_stride * aligned_height); if (!c->framebuf) return AVERROR(ENOMEM); } if (!c->synth_tile || !c->jpeg_tile || c->old_tile_w < c->tile_width || c->old_tile_h < c->tile_height) { c->tile_stride = FFALIGN(c->tile_width * 3, 16); aligned_height = FFALIGN(c->tile_height, 16); av_free(c->synth_tile); av_free(c->jpeg_tile); av_free(c->kempf_buf); av_free(c->kempf_flags); c->synth_tile = av_mallocz(c->tile_stride * aligned_height); c->jpeg_tile = av_mallocz(c->tile_stride * aligned_height); c->kempf_buf = av_mallocz((c->tile_width + 1) * aligned_height + FF_INPUT_BUFFER_PADDING_SIZE); c->kempf_flags = av_mallocz( c->tile_width * aligned_height); if (!c->synth_tile || !c->jpeg_tile || !c->kempf_buf || !c->kempf_flags) return AVERROR(ENOMEM); } return 0; }
static int g2m_init_buffers(G2MContext *c) { int aligned_height; if (!c->framebuf || c->old_width < c->width || c->old_height < c->height) { c->framebuf_stride = FFALIGN(c->width * 3, 16); aligned_height = FFALIGN(c->height, 16); av_free(c->framebuf); c->framebuf = av_mallocz(c->framebuf_stride * aligned_height); if (!c->framebuf) return AVERROR(ENOMEM); } if (!c->synth_tile || !c->jpeg_tile || c->old_tile_w < c->tile_width || c->old_tile_h < c->tile_height) { c->tile_stride = FFALIGN(c->tile_width * 3, 16); aligned_height = FFALIGN(c->tile_height, 16); av_free(c->synth_tile); av_free(c->jpeg_tile); av_free(c->kempf_buf); av_free(c->kempf_flags); c->synth_tile = av_mallocz(c->tile_stride * aligned_height); c->jpeg_tile = av_mallocz(c->tile_stride * aligned_height); c->kempf_buf = av_mallocz((c->tile_width + 1) * aligned_height + FF_INPUT_BUFFER_PADDING_SIZE); c->kempf_flags = av_mallocz( c->tile_width * aligned_height); if (!c->synth_tile || !c->jpeg_tile || !c->kempf_buf || !c->kempf_flags) return AVERROR(ENOMEM); } return 0; }
C
FFmpeg
0
CVE-2018-6651
https://www.cvedetails.com/cve/CVE-2018-6651/
CWE-352
https://github.com/chrisd1100/uncurl/commit/448cd13e7b18c83855d706c564341ddd1e38e769
448cd13e7b18c83855d706c564341ddd1e38e769
origin matching must come at str end
UNCURL_EXPORT int32_t uncurl_read_body_all(struct uncurl_conn *ucc, char **body, uint32_t *body_len) { int32_t r = UNCURL_ERR_DEFAULT; int32_t e; *body = NULL; *body_len = 0; if (uncurl_check_header(ucc, "Transfer-Encoding", "chunked")) { e = uncurl_response_body_chunked(ucc, body, body_len); if (e != UNCURL_OK) {r = e; goto uncurl_response_body_end;} r = UNCURL_OK; } if (r != UNCURL_OK) { e = uncurl_get_header_int(ucc, "Content-Length", (int32_t *) body_len); if (e != UNCURL_OK) {r = e; goto uncurl_response_body_end;} if (*body_len == 0) {r = UNCURL_ERR_NO_BODY; goto uncurl_response_body_end;} if (*body_len > ucc->opts.max_body) {r = UNCURL_ERR_MAX_BODY; goto uncurl_response_body_end;} *body = calloc(*body_len + 1, 1); e = ucc->read(ucc->ctx, *body, *body_len); if (e != UNCURL_OK) {r = e; goto uncurl_response_body_end;} r = UNCURL_OK; } uncurl_response_body_end: if (r != UNCURL_OK) { free(*body); *body = NULL; } return r; }
UNCURL_EXPORT int32_t uncurl_read_body_all(struct uncurl_conn *ucc, char **body, uint32_t *body_len) { int32_t r = UNCURL_ERR_DEFAULT; int32_t e; *body = NULL; *body_len = 0; if (uncurl_check_header(ucc, "Transfer-Encoding", "chunked")) { e = uncurl_response_body_chunked(ucc, body, body_len); if (e != UNCURL_OK) {r = e; goto uncurl_response_body_end;} r = UNCURL_OK; } if (r != UNCURL_OK) { e = uncurl_get_header_int(ucc, "Content-Length", (int32_t *) body_len); if (e != UNCURL_OK) {r = e; goto uncurl_response_body_end;} if (*body_len == 0) {r = UNCURL_ERR_NO_BODY; goto uncurl_response_body_end;} if (*body_len > ucc->opts.max_body) {r = UNCURL_ERR_MAX_BODY; goto uncurl_response_body_end;} *body = calloc(*body_len + 1, 1); e = ucc->read(ucc->ctx, *body, *body_len); if (e != UNCURL_OK) {r = e; goto uncurl_response_body_end;} r = UNCURL_OK; } uncurl_response_body_end: if (r != UNCURL_OK) { free(*body); *body = NULL; } return r; }
C
uncurl
0
CVE-2013-0920
https://www.cvedetails.com/cve/CVE-2013-0920/
CWE-399
https://github.com/chromium/chromium/commit/12baa2097220e33c12b60aa5e6da6701637761bf
12baa2097220e33c12b60aa5e6da6701637761bf
Fix heap-use-after-free in BookmarksIOFunction::ShowSelectFileDialog. BUG=177410 Review URL: https://chromiumcodereview.appspot.com/12326086 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@184586 0039d316-1c4b-4281-b951-d872f2087c98
base::FilePath GetDefaultFilepathForBookmarkExport() { base::Time time = base::Time::Now(); #if defined(OS_POSIX) base::FilePath::StringType filename = l10n_util::GetStringFUTF8(IDS_EXPORT_BOOKMARKS_DEFAULT_FILENAME, base::TimeFormatShortDateNumeric(time)); #elif defined(OS_WIN) base::FilePath::StringType filename = l10n_util::GetStringFUTF16(IDS_EXPORT_BOOKMARKS_DEFAULT_FILENAME, base::TimeFormatShortDateNumeric(time)); #endif file_util::ReplaceIllegalCharactersInPath(&filename, '_'); base::FilePath default_path; PathService::Get(chrome::DIR_USER_DOCUMENTS, &default_path); return default_path.Append(filename); }
base::FilePath GetDefaultFilepathForBookmarkExport() { base::Time time = base::Time::Now(); #if defined(OS_POSIX) base::FilePath::StringType filename = l10n_util::GetStringFUTF8(IDS_EXPORT_BOOKMARKS_DEFAULT_FILENAME, base::TimeFormatShortDateNumeric(time)); #elif defined(OS_WIN) base::FilePath::StringType filename = l10n_util::GetStringFUTF16(IDS_EXPORT_BOOKMARKS_DEFAULT_FILENAME, base::TimeFormatShortDateNumeric(time)); #endif file_util::ReplaceIllegalCharactersInPath(&filename, '_'); base::FilePath default_path; PathService::Get(chrome::DIR_USER_DOCUMENTS, &default_path); return default_path.Append(filename); }
C
Chrome
0
CVE-2018-5388
https://www.cvedetails.com/cve/CVE-2018-5388/
CWE-787
https://git.strongswan.org/?p=strongswan.git;a=commitdiff;h=0acd1ab4
0acd1ab4d08d53d80393b1a37b8781f6e7b2b996
null
static void pop_end(stroke_msg_t *msg, const char* label, stroke_end_t *end) { pop_string(msg, &end->address); pop_string(msg, &end->subnets); pop_string(msg, &end->sourceip); pop_string(msg, &end->dns); pop_string(msg, &end->auth); pop_string(msg, &end->auth2); pop_string(msg, &end->id); pop_string(msg, &end->id2); pop_string(msg, &end->rsakey); pop_string(msg, &end->cert); pop_string(msg, &end->cert2); pop_string(msg, &end->ca); pop_string(msg, &end->ca2); pop_string(msg, &end->groups); pop_string(msg, &end->groups2); pop_string(msg, &end->cert_policy); pop_string(msg, &end->updown); DBG_OPT(" %s=%s", label, end->address); DBG_OPT(" %ssubnet=%s", label, end->subnets); DBG_OPT(" %ssourceip=%s", label, end->sourceip); DBG_OPT(" %sdns=%s", label, end->dns); DBG_OPT(" %sauth=%s", label, end->auth); DBG_OPT(" %sauth2=%s", label, end->auth2); DBG_OPT(" %sid=%s", label, end->id); DBG_OPT(" %sid2=%s", label, end->id2); DBG_OPT(" %srsakey=%s", label, end->rsakey); DBG_OPT(" %scert=%s", label, end->cert); DBG_OPT(" %scert2=%s", label, end->cert2); DBG_OPT(" %sca=%s", label, end->ca); DBG_OPT(" %sca2=%s", label, end->ca2); DBG_OPT(" %sgroups=%s", label, end->groups); DBG_OPT(" %sgroups2=%s", label, end->groups2); DBG_OPT(" %supdown=%s", label, end->updown); }
static void pop_end(stroke_msg_t *msg, const char* label, stroke_end_t *end) { pop_string(msg, &end->address); pop_string(msg, &end->subnets); pop_string(msg, &end->sourceip); pop_string(msg, &end->dns); pop_string(msg, &end->auth); pop_string(msg, &end->auth2); pop_string(msg, &end->id); pop_string(msg, &end->id2); pop_string(msg, &end->rsakey); pop_string(msg, &end->cert); pop_string(msg, &end->cert2); pop_string(msg, &end->ca); pop_string(msg, &end->ca2); pop_string(msg, &end->groups); pop_string(msg, &end->groups2); pop_string(msg, &end->cert_policy); pop_string(msg, &end->updown); DBG_OPT(" %s=%s", label, end->address); DBG_OPT(" %ssubnet=%s", label, end->subnets); DBG_OPT(" %ssourceip=%s", label, end->sourceip); DBG_OPT(" %sdns=%s", label, end->dns); DBG_OPT(" %sauth=%s", label, end->auth); DBG_OPT(" %sauth2=%s", label, end->auth2); DBG_OPT(" %sid=%s", label, end->id); DBG_OPT(" %sid2=%s", label, end->id2); DBG_OPT(" %srsakey=%s", label, end->rsakey); DBG_OPT(" %scert=%s", label, end->cert); DBG_OPT(" %scert2=%s", label, end->cert2); DBG_OPT(" %sca=%s", label, end->ca); DBG_OPT(" %sca2=%s", label, end->ca2); DBG_OPT(" %sgroups=%s", label, end->groups); DBG_OPT(" %sgroups2=%s", label, end->groups2); DBG_OPT(" %supdown=%s", label, end->updown); }
C
strongswan
0
CVE-2011-4621
https://www.cvedetails.com/cve/CVE-2011-4621/
null
https://github.com/torvalds/linux/commit/f26f9aff6aaf67e9a430d16c266f91b13a5bff64
f26f9aff6aaf67e9a430d16c266f91b13a5bff64
Sched: fix skip_clock_update optimization idle_balance() drops/retakes rq->lock, leaving the previous task vulnerable to set_tsk_need_resched(). Clear it after we return from balancing instead, and in setup_thread_stack() as well, so no successfully descheduled or never scheduled task has it set. Need resched confused the skip_clock_update logic, which assumes that the next call to update_rq_clock() will come nearly immediately after being set. Make the optimization robust against the waking a sleeper before it sucessfully deschedules case by checking that the current task has not been dequeued before setting the flag, since it is that useless clock update we're trying to save, and clear unconditionally in schedule() proper instead of conditionally in put_prev_task(). Signed-off-by: Mike Galbraith <[email protected]> Reported-by: Bjoern B. Brandenburg <[email protected]> Tested-by: Yong Zhang <[email protected]> Signed-off-by: Peter Zijlstra <[email protected]> Cc: [email protected] LKML-Reference: <[email protected]> Signed-off-by: Ingo Molnar <[email protected]>
SYSCALL_DEFINE1(unshare, unsigned long, unshare_flags) { int err = 0; struct fs_struct *fs, *new_fs = NULL; struct sighand_struct *new_sigh = NULL; struct mm_struct *mm, *new_mm = NULL, *active_mm = NULL; struct files_struct *fd, *new_fd = NULL; struct nsproxy *new_nsproxy = NULL; int do_sysvsem = 0; check_unshare_flags(&unshare_flags); /* Return -EINVAL for all unsupported flags */ err = -EINVAL; if (unshare_flags & ~(CLONE_THREAD|CLONE_FS|CLONE_NEWNS|CLONE_SIGHAND| CLONE_VM|CLONE_FILES|CLONE_SYSVSEM| CLONE_NEWUTS|CLONE_NEWIPC|CLONE_NEWNET)) goto bad_unshare_out; /* * CLONE_NEWIPC must also detach from the undolist: after switching * to a new ipc namespace, the semaphore arrays from the old * namespace are unreachable. */ if (unshare_flags & (CLONE_NEWIPC|CLONE_SYSVSEM)) do_sysvsem = 1; if ((err = unshare_thread(unshare_flags))) goto bad_unshare_out; if ((err = unshare_fs(unshare_flags, &new_fs))) goto bad_unshare_cleanup_thread; if ((err = unshare_sighand(unshare_flags, &new_sigh))) goto bad_unshare_cleanup_fs; if ((err = unshare_vm(unshare_flags, &new_mm))) goto bad_unshare_cleanup_sigh; if ((err = unshare_fd(unshare_flags, &new_fd))) goto bad_unshare_cleanup_vm; if ((err = unshare_nsproxy_namespaces(unshare_flags, &new_nsproxy, new_fs))) goto bad_unshare_cleanup_fd; if (new_fs || new_mm || new_fd || do_sysvsem || new_nsproxy) { if (do_sysvsem) { /* * CLONE_SYSVSEM is equivalent to sys_exit(). */ exit_sem(current); } if (new_nsproxy) { switch_task_namespaces(current, new_nsproxy); new_nsproxy = NULL; } task_lock(current); if (new_fs) { fs = current->fs; spin_lock(&fs->lock); current->fs = new_fs; if (--fs->users) new_fs = NULL; else new_fs = fs; spin_unlock(&fs->lock); } if (new_mm) { mm = current->mm; active_mm = current->active_mm; current->mm = new_mm; current->active_mm = new_mm; if (current->signal->oom_score_adj == OOM_SCORE_ADJ_MIN) { atomic_dec(&mm->oom_disable_count); atomic_inc(&new_mm->oom_disable_count); } activate_mm(active_mm, new_mm); new_mm = mm; } if (new_fd) { fd = current->files; current->files = new_fd; new_fd = fd; } task_unlock(current); } if (new_nsproxy) put_nsproxy(new_nsproxy); bad_unshare_cleanup_fd: if (new_fd) put_files_struct(new_fd); bad_unshare_cleanup_vm: if (new_mm) mmput(new_mm); bad_unshare_cleanup_sigh: if (new_sigh) if (atomic_dec_and_test(&new_sigh->count)) kmem_cache_free(sighand_cachep, new_sigh); bad_unshare_cleanup_fs: if (new_fs) free_fs_struct(new_fs); bad_unshare_cleanup_thread: bad_unshare_out: return err; }
SYSCALL_DEFINE1(unshare, unsigned long, unshare_flags) { int err = 0; struct fs_struct *fs, *new_fs = NULL; struct sighand_struct *new_sigh = NULL; struct mm_struct *mm, *new_mm = NULL, *active_mm = NULL; struct files_struct *fd, *new_fd = NULL; struct nsproxy *new_nsproxy = NULL; int do_sysvsem = 0; check_unshare_flags(&unshare_flags); /* Return -EINVAL for all unsupported flags */ err = -EINVAL; if (unshare_flags & ~(CLONE_THREAD|CLONE_FS|CLONE_NEWNS|CLONE_SIGHAND| CLONE_VM|CLONE_FILES|CLONE_SYSVSEM| CLONE_NEWUTS|CLONE_NEWIPC|CLONE_NEWNET)) goto bad_unshare_out; /* * CLONE_NEWIPC must also detach from the undolist: after switching * to a new ipc namespace, the semaphore arrays from the old * namespace are unreachable. */ if (unshare_flags & (CLONE_NEWIPC|CLONE_SYSVSEM)) do_sysvsem = 1; if ((err = unshare_thread(unshare_flags))) goto bad_unshare_out; if ((err = unshare_fs(unshare_flags, &new_fs))) goto bad_unshare_cleanup_thread; if ((err = unshare_sighand(unshare_flags, &new_sigh))) goto bad_unshare_cleanup_fs; if ((err = unshare_vm(unshare_flags, &new_mm))) goto bad_unshare_cleanup_sigh; if ((err = unshare_fd(unshare_flags, &new_fd))) goto bad_unshare_cleanup_vm; if ((err = unshare_nsproxy_namespaces(unshare_flags, &new_nsproxy, new_fs))) goto bad_unshare_cleanup_fd; if (new_fs || new_mm || new_fd || do_sysvsem || new_nsproxy) { if (do_sysvsem) { /* * CLONE_SYSVSEM is equivalent to sys_exit(). */ exit_sem(current); } if (new_nsproxy) { switch_task_namespaces(current, new_nsproxy); new_nsproxy = NULL; } task_lock(current); if (new_fs) { fs = current->fs; spin_lock(&fs->lock); current->fs = new_fs; if (--fs->users) new_fs = NULL; else new_fs = fs; spin_unlock(&fs->lock); } if (new_mm) { mm = current->mm; active_mm = current->active_mm; current->mm = new_mm; current->active_mm = new_mm; if (current->signal->oom_score_adj == OOM_SCORE_ADJ_MIN) { atomic_dec(&mm->oom_disable_count); atomic_inc(&new_mm->oom_disable_count); } activate_mm(active_mm, new_mm); new_mm = mm; } if (new_fd) { fd = current->files; current->files = new_fd; new_fd = fd; } task_unlock(current); } if (new_nsproxy) put_nsproxy(new_nsproxy); bad_unshare_cleanup_fd: if (new_fd) put_files_struct(new_fd); bad_unshare_cleanup_vm: if (new_mm) mmput(new_mm); bad_unshare_cleanup_sigh: if (new_sigh) if (atomic_dec_and_test(&new_sigh->count)) kmem_cache_free(sighand_cachep, new_sigh); bad_unshare_cleanup_fs: if (new_fs) free_fs_struct(new_fs); bad_unshare_cleanup_thread: bad_unshare_out: return err; }
C
linux
0
CVE-2016-5164
https://www.cvedetails.com/cve/CVE-2016-5164/
CWE-79
https://github.com/chromium/chromium/commit/93bc623489bdcfc7e9127614fcfb3258edf3f0f9
93bc623489bdcfc7e9127614fcfb3258edf3f0f9
[DevTools] Copy objects from debugger context to inspected context properly. BUG=637594 Review-Url: https://codereview.chromium.org/2253643002 Cr-Commit-Position: refs/heads/master@{#412436}
v8::MaybeLocal<v8::Function> firstArgAsFunction() { if (m_info.Length() < 1 || !m_info[0]->IsFunction()) return v8::MaybeLocal<v8::Function>(); return m_info[0].As<v8::Function>(); }
v8::MaybeLocal<v8::Function> firstArgAsFunction() { if (m_info.Length() < 1 || !m_info[0]->IsFunction()) return v8::MaybeLocal<v8::Function>(); return m_info[0].As<v8::Function>(); }
C
Chrome
0
CVE-2017-0375
https://www.cvedetails.com/cve/CVE-2017-0375/
CWE-617
https://github.com/torproject/tor/commit/79b59a2dfcb68897ee89d98587d09e55f07e68d7
79b59a2dfcb68897ee89d98587d09e55f07e68d7
TROVE-2017-004: Fix assertion failure in relay_send_end_cell_from_edge_ This fixes an assertion failure in relay_send_end_cell_from_edge_() when an origin circuit and a cpath_layer = NULL were passed. A service rendezvous circuit could do such a thing when a malformed BEGIN cell is received but shouldn't in the first place because the service needs to send an END cell on the circuit for which it can not do without a cpath_layer. Fixes #22493 Reported-by: Roger Dingledine <[email protected]> Signed-off-by: David Goulet <[email protected]>
connection_exit_about_to_close(edge_connection_t *edge_conn) { circuit_t *circ; connection_t *conn = TO_CONN(edge_conn); connection_edge_about_to_close(edge_conn); circ = circuit_get_by_edge_conn(edge_conn); if (circ) circuit_detach_stream(circ, edge_conn); if (conn->state == EXIT_CONN_STATE_RESOLVING) { connection_dns_remove(edge_conn); } }
connection_exit_about_to_close(edge_connection_t *edge_conn) { circuit_t *circ; connection_t *conn = TO_CONN(edge_conn); connection_edge_about_to_close(edge_conn); circ = circuit_get_by_edge_conn(edge_conn); if (circ) circuit_detach_stream(circ, edge_conn); if (conn->state == EXIT_CONN_STATE_RESOLVING) { connection_dns_remove(edge_conn); } }
C
tor
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::DiscardUnusedFrame( std::unique_ptr<RenderFrameHostImpl> render_frame_host) { SiteInstanceImpl* site_instance = render_frame_host->GetSiteInstance(); RenderViewHostImpl* rvh = render_frame_host->render_view_host(); RenderFrameProxyHost* proxy = nullptr; if (site_instance->HasSite() && site_instance->active_frame_count() > 1) { render_frame_host->CancelSuspendedNavigations(); proxy = GetRenderFrameProxyHost(site_instance); if (!proxy) proxy = CreateRenderFrameProxyHost(site_instance, rvh); } if (frame_tree_node_->IsMainFrame()) { rvh->set_main_frame_routing_id(MSG_ROUTING_NONE); rvh->set_is_active(false); rvh->set_is_swapped_out(true); } render_frame_host.reset(); if (proxy && !proxy->is_render_frame_proxy_live()) proxy->InitRenderFrameProxy(); }
void RenderFrameHostManager::DiscardUnusedFrame( std::unique_ptr<RenderFrameHostImpl> render_frame_host) { SiteInstanceImpl* site_instance = render_frame_host->GetSiteInstance(); RenderViewHostImpl* rvh = render_frame_host->render_view_host(); RenderFrameProxyHost* proxy = nullptr; if (site_instance->HasSite() && site_instance->active_frame_count() > 1) { render_frame_host->CancelSuspendedNavigations(); proxy = GetRenderFrameProxyHost(site_instance); if (!proxy) proxy = CreateRenderFrameProxyHost(site_instance, rvh); } if (frame_tree_node_->IsMainFrame()) { rvh->set_main_frame_routing_id(MSG_ROUTING_NONE); rvh->set_is_active(false); rvh->set_is_swapped_out(true); } render_frame_host.reset(); if (proxy && !proxy->is_render_frame_proxy_live()) proxy->InitRenderFrameProxy(); }
C
Chrome
0
CVE-2011-1160
https://www.cvedetails.com/cve/CVE-2011-1160/
CWE-200
https://github.com/torvalds/linux/commit/1309d7afbed112f0e8e90be9af975550caa0076b
1309d7afbed112f0e8e90be9af975550caa0076b
char/tpm: Fix unitialized usage of data buffer This patch fixes information leakage to the userspace by initializing the data buffer to zero. Reported-by: Peter Huewe <[email protected]> Signed-off-by: Peter Huewe <[email protected]> Signed-off-by: Marcel Selhorst <[email protected]> [ Also removed the silly "* sizeof(u8)". If that isn't 1, we have way deeper problems than a simple multiplication can fix. - Linus ] Signed-off-by: Linus Torvalds <[email protected]>
int __tpm_pcr_read(struct tpm_chip *chip, int pcr_idx, u8 *res_buf) { int rc; struct tpm_cmd_t cmd; cmd.header.in = pcrread_header; cmd.params.pcrread_in.pcr_idx = cpu_to_be32(pcr_idx); rc = transmit_cmd(chip, &cmd, READ_PCR_RESULT_SIZE, "attempting to read a pcr value"); if (rc == 0) memcpy(res_buf, cmd.params.pcrread_out.pcr_result, TPM_DIGEST_SIZE); return rc; }
int __tpm_pcr_read(struct tpm_chip *chip, int pcr_idx, u8 *res_buf) { int rc; struct tpm_cmd_t cmd; cmd.header.in = pcrread_header; cmd.params.pcrread_in.pcr_idx = cpu_to_be32(pcr_idx); rc = transmit_cmd(chip, &cmd, READ_PCR_RESULT_SIZE, "attempting to read a pcr value"); if (rc == 0) memcpy(res_buf, cmd.params.pcrread_out.pcr_result, TPM_DIGEST_SIZE); return rc; }
C
linux
0
CVE-2013-0884
https://www.cvedetails.com/cve/CVE-2013-0884/
null
https://github.com/chromium/chromium/commit/4c39b8e5670c4a0f2bb06008502ebb0c4fe322e0
4c39b8e5670c4a0f2bb06008502ebb0c4fe322e0
[4/4] Process clearBrowserCahce/cookies commands in browser. BUG=366585 Review URL: https://codereview.chromium.org/251183005 git-svn-id: svn://svn.chromium.org/blink/trunk@172984 bbb929c8-8fbe-4397-9dbb-9b2b20218538
void InspectorClientImpl::startGPUEventsRecording() { if (WebDevToolsAgentImpl* agent = devToolsAgent()) agent->startGPUEventsRecording(); }
void InspectorClientImpl::startGPUEventsRecording() { if (WebDevToolsAgentImpl* agent = devToolsAgent()) agent->startGPUEventsRecording(); }
C
Chrome
0
CVE-2015-1274
https://www.cvedetails.com/cve/CVE-2015-1274/
CWE-254
https://github.com/chromium/chromium/commit/d27468a832d5316884bd02f459cbf493697fd7e1
d27468a832d5316884bd02f459cbf493697fd7e1
Switch to equalIgnoringASCIICase throughout modules/accessibility BUG=627682 Review-Url: https://codereview.chromium.org/2793913007 Cr-Commit-Position: refs/heads/master@{#461858}
void AXObjectCacheImpl::childrenChanged(AXObject* obj) { if (!obj) return; obj->childrenChanged(); }
void AXObjectCacheImpl::childrenChanged(AXObject* obj) { if (!obj) return; obj->childrenChanged(); }
C
Chrome
0
CVE-2011-1833
https://www.cvedetails.com/cve/CVE-2011-1833/
CWE-264
https://github.com/torvalds/linux/commit/764355487ea220fdc2faf128d577d7f679b91f97
764355487ea220fdc2faf128d577d7f679b91f97
Ecryptfs: Add mount option to check uid of device being mounted = expect uid Close a TOCTOU race for mounts done via ecryptfs-mount-private. The mount source (device) can be raced when the ownership test is done in userspace. Provide Ecryptfs a means to force the uid check at mount time. Signed-off-by: John Johansen <[email protected]> Cc: <[email protected]> Signed-off-by: Tyler Hicks <[email protected]>
int ecryptfs_get_lower_file(struct dentry *dentry, struct inode *inode) { struct ecryptfs_inode_info *inode_info; int count, rc = 0; inode_info = ecryptfs_inode_to_private(inode); mutex_lock(&inode_info->lower_file_mutex); count = atomic_inc_return(&inode_info->lower_file_count); if (WARN_ON_ONCE(count < 1)) rc = -EINVAL; else if (count == 1) { rc = ecryptfs_init_lower_file(dentry, &inode_info->lower_file); if (rc) atomic_set(&inode_info->lower_file_count, 0); } mutex_unlock(&inode_info->lower_file_mutex); return rc; }
int ecryptfs_get_lower_file(struct dentry *dentry, struct inode *inode) { struct ecryptfs_inode_info *inode_info; int count, rc = 0; inode_info = ecryptfs_inode_to_private(inode); mutex_lock(&inode_info->lower_file_mutex); count = atomic_inc_return(&inode_info->lower_file_count); if (WARN_ON_ONCE(count < 1)) rc = -EINVAL; else if (count == 1) { rc = ecryptfs_init_lower_file(dentry, &inode_info->lower_file); if (rc) atomic_set(&inode_info->lower_file_count, 0); } mutex_unlock(&inode_info->lower_file_mutex); return rc; }
C
linux
0
CVE-2011-1768
https://www.cvedetails.com/cve/CVE-2011-1768/
CWE-362
https://github.com/torvalds/linux/commit/d5aa407f59f5b83d2c50ec88f5bf56d40f1f8978
d5aa407f59f5b83d2c50ec88f5bf56d40f1f8978
tunnels: fix netns vs proto registration ordering Same stuff as in ip_gre patch: receive hook can be called before netns setup is done, oopsing in net_generic(). Signed-off-by: Alexey Dobriyan <[email protected]> Signed-off-by: David S. Miller <[email protected]>
static int __init xfrm6_tunnel_init(void) { int rv; xfrm6_tunnel_spi_kmem = kmem_cache_create("xfrm6_tunnel_spi", sizeof(struct xfrm6_tunnel_spi), 0, SLAB_HWCACHE_ALIGN, NULL); if (!xfrm6_tunnel_spi_kmem) return -ENOMEM; rv = register_pernet_subsys(&xfrm6_tunnel_net_ops); if (rv < 0) goto out_pernet; rv = xfrm_register_type(&xfrm6_tunnel_type, AF_INET6); if (rv < 0) goto out_type; rv = xfrm6_tunnel_register(&xfrm6_tunnel_handler, AF_INET6); if (rv < 0) goto out_xfrm6; rv = xfrm6_tunnel_register(&xfrm46_tunnel_handler, AF_INET); if (rv < 0) goto out_xfrm46; return 0; out_xfrm46: xfrm6_tunnel_deregister(&xfrm6_tunnel_handler, AF_INET6); out_xfrm6: xfrm_unregister_type(&xfrm6_tunnel_type, AF_INET6); out_type: unregister_pernet_subsys(&xfrm6_tunnel_net_ops); out_pernet: kmem_cache_destroy(xfrm6_tunnel_spi_kmem); return rv; }
static int __init xfrm6_tunnel_init(void) { int rv; rv = xfrm_register_type(&xfrm6_tunnel_type, AF_INET6); if (rv < 0) goto err; rv = xfrm6_tunnel_register(&xfrm6_tunnel_handler, AF_INET6); if (rv < 0) goto unreg; rv = xfrm6_tunnel_register(&xfrm46_tunnel_handler, AF_INET); if (rv < 0) goto dereg6; rv = xfrm6_tunnel_spi_init(); if (rv < 0) goto dereg46; rv = register_pernet_subsys(&xfrm6_tunnel_net_ops); if (rv < 0) goto deregspi; return 0; deregspi: xfrm6_tunnel_spi_fini(); dereg46: xfrm6_tunnel_deregister(&xfrm46_tunnel_handler, AF_INET); dereg6: xfrm6_tunnel_deregister(&xfrm6_tunnel_handler, AF_INET6); unreg: xfrm_unregister_type(&xfrm6_tunnel_type, AF_INET6); err: return rv; }
C
linux
1
CVE-2019-16910
https://www.cvedetails.com/cve/CVE-2019-16910/
CWE-200
https://github.com/ARMmbed/mbedtls/commit/298a43a77ec0ed2c19a8c924ddd8571ef3e65dfd
298a43a77ec0ed2c19a8c924ddd8571ef3e65dfd
Merge remote-tracking branch 'upstream-restricted/pr/549' into mbedtls-2.7-restricted
int mbedtls_ecp_mul( mbedtls_ecp_group *grp, mbedtls_ecp_point *R, const mbedtls_mpi *m, const mbedtls_ecp_point *P, int (*f_rng)(void *, unsigned char *, size_t), void *p_rng ) { int ret = MBEDTLS_ERR_ECP_BAD_INPUT_DATA; #if defined(MBEDTLS_ECP_INTERNAL_ALT) char is_grp_capable = 0; #endif /* Common sanity checks */ if( mbedtls_mpi_cmp_int( &P->Z, 1 ) != 0 ) return( MBEDTLS_ERR_ECP_BAD_INPUT_DATA ); if( ( ret = mbedtls_ecp_check_privkey( grp, m ) ) != 0 || ( ret = mbedtls_ecp_check_pubkey( grp, P ) ) != 0 ) return( ret ); #if defined(MBEDTLS_ECP_INTERNAL_ALT) if ( is_grp_capable = mbedtls_internal_ecp_grp_capable( grp ) ) { MBEDTLS_MPI_CHK( mbedtls_internal_ecp_init( grp ) ); } #endif /* MBEDTLS_ECP_INTERNAL_ALT */ #if defined(ECP_MONTGOMERY) if( ecp_get_type( grp ) == ECP_TYPE_MONTGOMERY ) ret = ecp_mul_mxz( grp, R, m, P, f_rng, p_rng ); #endif #if defined(ECP_SHORTWEIERSTRASS) if( ecp_get_type( grp ) == ECP_TYPE_SHORT_WEIERSTRASS ) ret = ecp_mul_comb( grp, R, m, P, f_rng, p_rng ); #endif #if defined(MBEDTLS_ECP_INTERNAL_ALT) cleanup: if ( is_grp_capable ) { mbedtls_internal_ecp_free( grp ); } #endif /* MBEDTLS_ECP_INTERNAL_ALT */ return( ret ); }
int mbedtls_ecp_mul( mbedtls_ecp_group *grp, mbedtls_ecp_point *R, const mbedtls_mpi *m, const mbedtls_ecp_point *P, int (*f_rng)(void *, unsigned char *, size_t), void *p_rng ) { int ret = MBEDTLS_ERR_ECP_BAD_INPUT_DATA; #if defined(MBEDTLS_ECP_INTERNAL_ALT) char is_grp_capable = 0; #endif /* Common sanity checks */ if( mbedtls_mpi_cmp_int( &P->Z, 1 ) != 0 ) return( MBEDTLS_ERR_ECP_BAD_INPUT_DATA ); if( ( ret = mbedtls_ecp_check_privkey( grp, m ) ) != 0 || ( ret = mbedtls_ecp_check_pubkey( grp, P ) ) != 0 ) return( ret ); #if defined(MBEDTLS_ECP_INTERNAL_ALT) if ( is_grp_capable = mbedtls_internal_ecp_grp_capable( grp ) ) { MBEDTLS_MPI_CHK( mbedtls_internal_ecp_init( grp ) ); } #endif /* MBEDTLS_ECP_INTERNAL_ALT */ #if defined(ECP_MONTGOMERY) if( ecp_get_type( grp ) == ECP_TYPE_MONTGOMERY ) ret = ecp_mul_mxz( grp, R, m, P, f_rng, p_rng ); #endif #if defined(ECP_SHORTWEIERSTRASS) if( ecp_get_type( grp ) == ECP_TYPE_SHORT_WEIERSTRASS ) ret = ecp_mul_comb( grp, R, m, P, f_rng, p_rng ); #endif #if defined(MBEDTLS_ECP_INTERNAL_ALT) cleanup: if ( is_grp_capable ) { mbedtls_internal_ecp_free( grp ); } #endif /* MBEDTLS_ECP_INTERNAL_ALT */ return( ret ); }
C
mbedtls
0
CVE-2012-2136
https://www.cvedetails.com/cve/CVE-2012-2136/
CWE-20
https://github.com/torvalds/linux/commit/cc9b17ad29ecaa20bfe426a8d4dbfb94b13ff1cc
cc9b17ad29ecaa20bfe426a8d4dbfb94b13ff1cc
net: sock: validate data_len before allocating skb in sock_alloc_send_pskb() We need to validate the number of pages consumed by data_len, otherwise frags array could be overflowed by userspace. So this patch validate data_len and return -EMSGSIZE when data_len may occupies more frags than MAX_SKB_FRAGS. Signed-off-by: Jason Wang <[email protected]> Signed-off-by: David S. Miller <[email protected]>
void cred_to_ucred(struct pid *pid, const struct cred *cred, struct ucred *ucred) { ucred->pid = pid_vnr(pid); ucred->uid = ucred->gid = -1; if (cred) { struct user_namespace *current_ns = current_user_ns(); ucred->uid = from_kuid(current_ns, cred->euid); ucred->gid = from_kgid(current_ns, cred->egid); } }
void cred_to_ucred(struct pid *pid, const struct cred *cred, struct ucred *ucred) { ucred->pid = pid_vnr(pid); ucred->uid = ucred->gid = -1; if (cred) { struct user_namespace *current_ns = current_user_ns(); ucred->uid = from_kuid(current_ns, cred->euid); ucred->gid = from_kgid(current_ns, cred->egid); } }
C
linux
0
CVE-2014-3168
https://www.cvedetails.com/cve/CVE-2014-3168/
null
https://github.com/chromium/chromium/commit/f592cf6a66b63decc7e7093b36501229a5de1f1d
f592cf6a66b63decc7e7093b36501229a5de1f1d
SVG: Moving animating <svg> to other iframe should not crash. Moving SVGSVGElement with its SMILTimeContainer already started caused crash before this patch. |SVGDocumentExtentions::startAnimations()| calls begin() against all SMILTimeContainers in the document, but the SMILTimeContainer for <svg> moved from other document may be already started. BUG=369860 Review URL: https://codereview.chromium.org/290353002 git-svn-id: svn://svn.chromium.org/blink/trunk@174338 bbb929c8-8fbe-4397-9dbb-9b2b20218538
void SVGDocumentExtensions::trace(Visitor* visitor) { visitor->trace(m_timeContainers); visitor->trace(m_svgFontFaceElements); visitor->trace(m_pendingSVGFontFaceElementsForRemoval); }
void SVGDocumentExtensions::trace(Visitor* visitor) { visitor->trace(m_timeContainers); visitor->trace(m_svgFontFaceElements); visitor->trace(m_pendingSVGFontFaceElementsForRemoval); }
C
Chrome
0
CVE-2017-18203
https://www.cvedetails.com/cve/CVE-2017-18203/
CWE-362
https://github.com/torvalds/linux/commit/b9a41d21dceadf8104812626ef85dc56ee8a60ed
b9a41d21dceadf8104812626ef85dc56ee8a60ed
dm: fix race between dm_get_from_kobject() and __dm_destroy() The following BUG_ON was hit when testing repeat creation and removal of DM devices: kernel BUG at drivers/md/dm.c:2919! CPU: 7 PID: 750 Comm: systemd-udevd Not tainted 4.1.44 Call Trace: [<ffffffff81649e8b>] dm_get_from_kobject+0x34/0x3a [<ffffffff81650ef1>] dm_attr_show+0x2b/0x5e [<ffffffff817b46d1>] ? mutex_lock+0x26/0x44 [<ffffffff811df7f5>] sysfs_kf_seq_show+0x83/0xcf [<ffffffff811de257>] kernfs_seq_show+0x23/0x25 [<ffffffff81199118>] seq_read+0x16f/0x325 [<ffffffff811de994>] kernfs_fop_read+0x3a/0x13f [<ffffffff8117b625>] __vfs_read+0x26/0x9d [<ffffffff8130eb59>] ? security_file_permission+0x3c/0x44 [<ffffffff8117bdb8>] ? rw_verify_area+0x83/0xd9 [<ffffffff8117be9d>] vfs_read+0x8f/0xcf [<ffffffff81193e34>] ? __fdget_pos+0x12/0x41 [<ffffffff8117c686>] SyS_read+0x4b/0x76 [<ffffffff817b606e>] system_call_fastpath+0x12/0x71 The bug can be easily triggered, if an extra delay (e.g. 10ms) is added between the test of DMF_FREEING & DMF_DELETING and dm_get() in dm_get_from_kobject(). To fix it, we need to ensure the test of DMF_FREEING & DMF_DELETING and dm_get() are done in an atomic way, so _minor_lock is used. The other callers of dm_get() have also been checked to be OK: some callers invoke dm_get() under _minor_lock, some callers invoke it under _hash_lock, and dm_start_request() invoke it after increasing md->open_count. Cc: [email protected] Signed-off-by: Hou Tao <[email protected]> Signed-off-by: Mike Snitzer <[email protected]>
struct kobject *dm_kobject(struct mapped_device *md) { return &md->kobj_holder.kobj; }
struct kobject *dm_kobject(struct mapped_device *md) { return &md->kobj_holder.kobj; }
C
linux
0
CVE-2011-5321
https://www.cvedetails.com/cve/CVE-2011-5321/
null
https://github.com/torvalds/linux/commit/c290f8358acaeffd8e0c551ddcc24d1206143376
c290f8358acaeffd8e0c551ddcc24d1206143376
TTY: drop driver reference in tty_open fail path When tty_driver_lookup_tty fails in tty_open, we forget to drop a reference to the tty driver. This was added by commit 4a2b5fddd5 (Move tty lookup/reopen to caller). Fix that by adding tty_driver_kref_put to the fail path. I will refactor the code later. This is for the ease of backporting to stable. Introduced-in: v2.6.28-rc2 Signed-off-by: Jiri Slaby <[email protected]> Cc: stable <[email protected]> Cc: Alan Cox <[email protected]> Acked-by: Sukadev Bhattiprolu <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
static int tty_fasync(int fd, struct file *filp, int on) { int retval; tty_lock(); retval = __tty_fasync(fd, filp, on); tty_unlock(); return retval; }
static int tty_fasync(int fd, struct file *filp, int on) { int retval; tty_lock(); retval = __tty_fasync(fd, filp, on); tty_unlock(); return retval; }
C
linux
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 trace(struct kmem_cache *s, struct page *page, void *object, int alloc) { if (s->flags & SLAB_TRACE) { printk(KERN_INFO "TRACE %s %s 0x%p inuse=%d fp=0x%p\n", s->name, alloc ? "alloc" : "free", object, page->inuse, page->freelist); if (!alloc) print_section("Object", (void *)object, s->objsize); dump_stack(); } }
static void trace(struct kmem_cache *s, struct page *page, void *object, int alloc) { if (s->flags & SLAB_TRACE) { printk(KERN_INFO "TRACE %s %s 0x%p inuse=%d fp=0x%p\n", s->name, alloc ? "alloc" : "free", object, page->inuse, page->freelist); if (!alloc) print_section("Object", (void *)object, s->objsize); dump_stack(); } }
C
linux
0
CVE-2017-5508
https://www.cvedetails.com/cve/CVE-2017-5508/
CWE-119
https://github.com/ImageMagick/ImageMagick/commit/c073a7712d82476b5fbee74856c46b88af9c3175
c073a7712d82476b5fbee74856c46b88af9c3175
https://www.imagemagick.org/discourse-server/viewtopic.php?f=3&t=31161
static void TIFFUnmapBlob(thandle_t image,tdata_t base,toff_t size) { (void) image; (void) base; (void) size; }
static void TIFFUnmapBlob(thandle_t image,tdata_t base,toff_t size) { (void) image; (void) base; (void) size; }
C
ImageMagick
0
CVE-2013-0840
https://www.cvedetails.com/cve/CVE-2013-0840/
null
https://github.com/chromium/chromium/commit/7f48b71cb22bb2fc9fcec2013e9eaff55381a43d
7f48b71cb22bb2fc9fcec2013e9eaff55381a43d
Filter more incoming URLs in the CreateWindow path. BUG=170532 Review URL: https://chromiumcodereview.appspot.com/12036002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@178728 0039d316-1c4b-4281-b951-d872f2087c98
void RenderViewHostImpl::CreateNewFullscreenWidget(int route_id) { delegate_->CreateNewFullscreenWidget(route_id); }
void RenderViewHostImpl::CreateNewFullscreenWidget(int route_id) { delegate_->CreateNewFullscreenWidget(route_id); }
C
Chrome
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]>
int regulator_bulk_disable(int num_consumers, struct regulator_bulk_data *consumers) { int i; int ret, r; for (i = num_consumers - 1; i >= 0; --i) { ret = regulator_disable(consumers[i].consumer); if (ret != 0) goto err; } return 0; err: pr_err("Failed to disable %s: %d\n", consumers[i].supply, ret); for (++i; i < num_consumers; ++i) { r = regulator_enable(consumers[i].consumer); if (r != 0) pr_err("Failed to reename %s: %d\n", consumers[i].supply, r); } return ret; }
int regulator_bulk_disable(int num_consumers, struct regulator_bulk_data *consumers) { int i; int ret, r; for (i = num_consumers - 1; i >= 0; --i) { ret = regulator_disable(consumers[i].consumer); if (ret != 0) goto err; } return 0; err: pr_err("Failed to disable %s: %d\n", consumers[i].supply, ret); for (++i; i < num_consumers; ++i) { r = regulator_enable(consumers[i].consumer); if (r != 0) pr_err("Failed to reename %s: %d\n", consumers[i].supply, r); } return ret; }
C
linux
0
CVE-2013-2906
https://www.cvedetails.com/cve/CVE-2013-2906/
CWE-362
https://github.com/chromium/chromium/commit/603af455b5641671b18d7d7d166630341d71b63f
603af455b5641671b18d7d7d166630341d71b63f
Remove dependency of TranslateInfobarDelegate on profile This CL uses TranslateTabHelper instead of Profile and also cleans up some unused code and irrelevant dependencies. BUG=371845 Review URL: https://codereview.chromium.org/286973003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@270758 0039d316-1c4b-4281-b951-d872f2087c98
void TranslateInfoBarDelegate::ReportLanguageDetectionError() { TranslateManager* manager = TranslateTabHelper::GetManagerFromWebContents(GetWebContents()); if (!manager) return; manager->ReportLanguageDetectionError(); }
void TranslateInfoBarDelegate::ReportLanguageDetectionError() { TranslateManager* manager = TranslateTabHelper::GetManagerFromWebContents(GetWebContents()); if (!manager) return; manager->ReportLanguageDetectionError(); }
C
Chrome
0
null
null
null
https://github.com/chromium/chromium/commit/f1a142d29ad1dfaecd3b609051b476440289ec72
f1a142d29ad1dfaecd3b609051b476440289ec72
Fix print media page size by using the value we compute. BUG=82472 TEST=NONE (in bug) Review URL: http://codereview.chromium.org/8344016 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@106160 0039d316-1c4b-4281-b951-d872f2087c98
PrintWebViewHelper::PrintPreviewContext::GetPrintCanvasSize() const { DCHECK(IsRendering()); return prep_frame_view_->GetPrintCanvasSize(); }
PrintWebViewHelper::PrintPreviewContext::GetPrintCanvasSize() const { DCHECK(IsRendering()); return prep_frame_view_->GetPrintCanvasSize(); }
C
Chrome
0
CVE-2018-11595
https://www.cvedetails.com/cve/CVE-2018-11595/
CWE-119
https://github.com/espruino/Espruino/commit/0a7619875bf79877907205f6bee08465b89ff10b
0a7619875bf79877907205f6bee08465b89ff10b
Fix strncat/cpy bounding issues (fix #1425)
Pin jshGetPinFromString(const char *s) { if (((s[0]>='A' && s[0]<='I') || s[0]=='V') && s[1]) { int port = (s[0]=='V') ? JSH_PORTV : JSH_PORTA+s[0]-'A'; int pin = -1; if (s[1]>='0' && s[1]<='9') { if (!s[2]) { // D0-D9 pin = (s[1]-'0'); } else if (s[2]>='0' && s[2]<='9') { if (!s[3]) { pin = ((s[1]-'0')*10 + (s[2]-'0')); #ifdef LINUX } else if (!s[4] && s[3]>='0' && s[3]<='9') { pin = ((s[1]-'0')*100 + (s[2]-'0')*10 + (s[3]-'0')); #endif } } } if (pin>=0) { #ifdef PIN_NAMES_DIRECT int i; for (i=0;i<JSH_PIN_COUNT;i++) if ((pinInfo[i].port&JSH_PORT_MASK) == port && pinInfo[i].pin==pin) return (Pin)i; #else if (0) { #if JSH_PORTA_OFFSET!=-1 } else if (port == JSH_PORTA) { if (pin<JSH_PORTA_COUNT) return (Pin)(JSH_PORTA_OFFSET + pin); #endif #if JSH_PORTB_OFFSET!=-1 } else if (port == JSH_PORTB) { if (pin<JSH_PORTB_COUNT) return (Pin)(JSH_PORTB_OFFSET + pin); #endif #if JSH_PORTC_OFFSET!=-1 } else if (port == JSH_PORTC) { if (pin<JSH_PORTC_COUNT) return (Pin)(JSH_PORTC_OFFSET + pin); #endif #if JSH_PORTD_OFFSET!=-1 } else if (port == JSH_PORTD) { if (pin<JSH_PORTD_COUNT) return (Pin)(JSH_PORTD_OFFSET + pin); #endif #if JSH_PORTE_OFFSET!=-1 } else if (port == JSH_PORTE) { if (pin<JSH_PORTE_COUNT) return (Pin)(JSH_PORTE_OFFSET + pin); #endif #if JSH_PORTF_OFFSET!=-1 } else if (port == JSH_PORTF) { if (pin<JSH_PORTF_COUNT) return (Pin)(JSH_PORTF_OFFSET + pin); #endif #if JSH_PORTG_OFFSET!=-1 } else if (port == JSH_PORTG) { if (pin<JSH_PORTG_COUNT) return (Pin)(JSH_PORTG_OFFSET + pin); #endif #if JSH_PORTH_OFFSET!=-1 } else if (port == JSH_PORTH) { if (pin<JSH_PORTH_COUNT) return (Pin)(JSH_PORTH_OFFSET + pin); #endif #if JSH_PORTI_OFFSET!=-1 } else if (port == JSH_PORTI) { if (pin<JSH_PORTI_COUNT) return (Pin)(JSH_PORTI_OFFSET + pin); #endif #if JSH_PORTV_OFFSET!=-1 } else if (port == JSH_PORTV) { if (pin<JSH_PORTV_COUNT) return (Pin)(JSH_PORTV_OFFSET + pin); #endif } #endif } } return PIN_UNDEFINED; }
Pin jshGetPinFromString(const char *s) { if (((s[0]>='A' && s[0]<='I') || s[0]=='V') && s[1]) { int port = (s[0]=='V') ? JSH_PORTV : JSH_PORTA+s[0]-'A'; int pin = -1; if (s[1]>='0' && s[1]<='9') { if (!s[2]) { // D0-D9 pin = (s[1]-'0'); } else if (s[2]>='0' && s[2]<='9') { if (!s[3]) { pin = ((s[1]-'0')*10 + (s[2]-'0')); #ifdef LINUX } else if (!s[4] && s[3]>='0' && s[3]<='9') { pin = ((s[1]-'0')*100 + (s[2]-'0')*10 + (s[3]-'0')); #endif } } } if (pin>=0) { #ifdef PIN_NAMES_DIRECT int i; for (i=0;i<JSH_PIN_COUNT;i++) if ((pinInfo[i].port&JSH_PORT_MASK) == port && pinInfo[i].pin==pin) return (Pin)i; #else if (0) { #if JSH_PORTA_OFFSET!=-1 } else if (port == JSH_PORTA) { if (pin<JSH_PORTA_COUNT) return (Pin)(JSH_PORTA_OFFSET + pin); #endif #if JSH_PORTB_OFFSET!=-1 } else if (port == JSH_PORTB) { if (pin<JSH_PORTB_COUNT) return (Pin)(JSH_PORTB_OFFSET + pin); #endif #if JSH_PORTC_OFFSET!=-1 } else if (port == JSH_PORTC) { if (pin<JSH_PORTC_COUNT) return (Pin)(JSH_PORTC_OFFSET + pin); #endif #if JSH_PORTD_OFFSET!=-1 } else if (port == JSH_PORTD) { if (pin<JSH_PORTD_COUNT) return (Pin)(JSH_PORTD_OFFSET + pin); #endif #if JSH_PORTE_OFFSET!=-1 } else if (port == JSH_PORTE) { if (pin<JSH_PORTE_COUNT) return (Pin)(JSH_PORTE_OFFSET + pin); #endif #if JSH_PORTF_OFFSET!=-1 } else if (port == JSH_PORTF) { if (pin<JSH_PORTF_COUNT) return (Pin)(JSH_PORTF_OFFSET + pin); #endif #if JSH_PORTG_OFFSET!=-1 } else if (port == JSH_PORTG) { if (pin<JSH_PORTG_COUNT) return (Pin)(JSH_PORTG_OFFSET + pin); #endif #if JSH_PORTH_OFFSET!=-1 } else if (port == JSH_PORTH) { if (pin<JSH_PORTH_COUNT) return (Pin)(JSH_PORTH_OFFSET + pin); #endif #if JSH_PORTI_OFFSET!=-1 } else if (port == JSH_PORTI) { if (pin<JSH_PORTI_COUNT) return (Pin)(JSH_PORTI_OFFSET + pin); #endif #if JSH_PORTV_OFFSET!=-1 } else if (port == JSH_PORTV) { if (pin<JSH_PORTV_COUNT) return (Pin)(JSH_PORTV_OFFSET + pin); #endif } #endif } } return PIN_UNDEFINED; }
C
Espruino
0
CVE-2012-0036
https://www.cvedetails.com/cve/CVE-2012-0036/
CWE-89
https://github.com/bagder/curl/commit/75ca568fa1c19de4c5358fed246686de8467c238
75ca568fa1c19de4c5358fed246686de8467c238
URL sanitize: reject URLs containing bad data Protocols (IMAP, POP3 and SMTP) that use the path part of a URL in a decoded manner now use the new Curl_urldecode() function to reject URLs with embedded control codes (anything that is or decodes to a byte value less than 32). URLs containing such codes could easily otherwise be used to do harm and allow users to do unintended actions with otherwise innocent tools and applications. Like for example using a URL like pop3://pop3.example.com/1%0d%0aDELE%201 when the app wants a URL to get a mail and instead this would delete one. This flaw is considered a security vulnerability: CVE-2012-0036 Security advisory at: http://curl.haxx.se/docs/adv_20120124.html Reported by: Dan Fandrich
static int imap_getsock(struct connectdata *conn, curl_socket_t *socks, int numsocks) { return Curl_pp_getsock(&conn->proto.imapc.pp, socks, numsocks); }
static int imap_getsock(struct connectdata *conn, curl_socket_t *socks, int numsocks) { return Curl_pp_getsock(&conn->proto.imapc.pp, socks, numsocks); }
C
curl
0
CVE-2017-7375
https://www.cvedetails.com/cve/CVE-2017-7375/
CWE-611
https://android.googlesource.com/platform/external/libxml2/+/308396a55280f69ad4112d4f9892f4cbeff042aa
308396a55280f69ad4112d4f9892f4cbeff042aa
DO NOT MERGE: Add validation for eternal enities https://bugzilla.gnome.org/show_bug.cgi?id=780691 Bug: 36556310 Change-Id: I9450743e167c3c73af5e4071f3fc85e81d061648 (cherry picked from commit bef9af3d89d241bcb518c20cba6da2a2fd9ba049)
xmlParsePI(xmlParserCtxtPtr ctxt) { xmlChar *buf = NULL; size_t len = 0; size_t size = XML_PARSER_BUFFER_SIZE; int cur, l; const xmlChar *target; xmlParserInputState state; int count = 0; if ((RAW == '<') && (NXT(1) == '?')) { xmlParserInputPtr input = ctxt->input; state = ctxt->instate; ctxt->instate = XML_PARSER_PI; /* * this is a Processing Instruction. */ SKIP(2); SHRINK; /* * Parse the target name and check for special support like * namespace. */ target = xmlParsePITarget(ctxt); if (target != NULL) { if ((RAW == '?') && (NXT(1) == '>')) { if (input != ctxt->input) { xmlFatalErrMsg(ctxt, XML_ERR_ENTITY_BOUNDARY, "PI declaration doesn't start and stop in the same entity\n"); } SKIP(2); /* * SAX: PI detected. */ if ((ctxt->sax) && (!ctxt->disableSAX) && (ctxt->sax->processingInstruction != NULL)) ctxt->sax->processingInstruction(ctxt->userData, target, NULL); if (ctxt->instate != XML_PARSER_EOF) ctxt->instate = state; return; } buf = (xmlChar *) xmlMallocAtomic(size * sizeof(xmlChar)); if (buf == NULL) { xmlErrMemory(ctxt, NULL); ctxt->instate = state; return; } cur = CUR; if (!IS_BLANK(cur)) { xmlFatalErrMsgStr(ctxt, XML_ERR_SPACE_REQUIRED, "ParsePI: PI %s space expected\n", target); } SKIP_BLANKS; cur = CUR_CHAR(l); while (IS_CHAR(cur) && /* checked */ ((cur != '?') || (NXT(1) != '>'))) { if (len + 5 >= size) { xmlChar *tmp; size_t new_size = size * 2; tmp = (xmlChar *) xmlRealloc(buf, new_size); if (tmp == NULL) { xmlErrMemory(ctxt, NULL); xmlFree(buf); ctxt->instate = state; return; } buf = tmp; size = new_size; } count++; if (count > 50) { GROW; if (ctxt->instate == XML_PARSER_EOF) { xmlFree(buf); return; } count = 0; if ((len > XML_MAX_TEXT_LENGTH) && ((ctxt->options & XML_PARSE_HUGE) == 0)) { xmlFatalErrMsgStr(ctxt, XML_ERR_PI_NOT_FINISHED, "PI %s too big found", target); xmlFree(buf); ctxt->instate = state; return; } } COPY_BUF(l,buf,len,cur); NEXTL(l); cur = CUR_CHAR(l); if (cur == 0) { SHRINK; GROW; cur = CUR_CHAR(l); } } if ((len > XML_MAX_TEXT_LENGTH) && ((ctxt->options & XML_PARSE_HUGE) == 0)) { xmlFatalErrMsgStr(ctxt, XML_ERR_PI_NOT_FINISHED, "PI %s too big found", target); xmlFree(buf); ctxt->instate = state; return; } buf[len] = 0; if (cur != '?') { xmlFatalErrMsgStr(ctxt, XML_ERR_PI_NOT_FINISHED, "ParsePI: PI %s never end ...\n", target); } else { if (input != ctxt->input) { xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED, "PI declaration doesn't start and stop in the same entity\n"); } SKIP(2); #ifdef LIBXML_CATALOG_ENABLED if (((state == XML_PARSER_MISC) || (state == XML_PARSER_START)) && (xmlStrEqual(target, XML_CATALOG_PI))) { xmlCatalogAllow allow = xmlCatalogGetDefaults(); if ((allow == XML_CATA_ALLOW_DOCUMENT) || (allow == XML_CATA_ALLOW_ALL)) xmlParseCatalogPI(ctxt, buf); } #endif /* * SAX: PI detected. */ if ((ctxt->sax) && (!ctxt->disableSAX) && (ctxt->sax->processingInstruction != NULL)) ctxt->sax->processingInstruction(ctxt->userData, target, buf); } xmlFree(buf); } else { xmlFatalErr(ctxt, XML_ERR_PI_NOT_STARTED, NULL); } if (ctxt->instate != XML_PARSER_EOF) ctxt->instate = state; } }
xmlParsePI(xmlParserCtxtPtr ctxt) { xmlChar *buf = NULL; size_t len = 0; size_t size = XML_PARSER_BUFFER_SIZE; int cur, l; const xmlChar *target; xmlParserInputState state; int count = 0; if ((RAW == '<') && (NXT(1) == '?')) { xmlParserInputPtr input = ctxt->input; state = ctxt->instate; ctxt->instate = XML_PARSER_PI; /* * this is a Processing Instruction. */ SKIP(2); SHRINK; /* * Parse the target name and check for special support like * namespace. */ target = xmlParsePITarget(ctxt); if (target != NULL) { if ((RAW == '?') && (NXT(1) == '>')) { if (input != ctxt->input) { xmlFatalErrMsg(ctxt, XML_ERR_ENTITY_BOUNDARY, "PI declaration doesn't start and stop in the same entity\n"); } SKIP(2); /* * SAX: PI detected. */ if ((ctxt->sax) && (!ctxt->disableSAX) && (ctxt->sax->processingInstruction != NULL)) ctxt->sax->processingInstruction(ctxt->userData, target, NULL); if (ctxt->instate != XML_PARSER_EOF) ctxt->instate = state; return; } buf = (xmlChar *) xmlMallocAtomic(size * sizeof(xmlChar)); if (buf == NULL) { xmlErrMemory(ctxt, NULL); ctxt->instate = state; return; } cur = CUR; if (!IS_BLANK(cur)) { xmlFatalErrMsgStr(ctxt, XML_ERR_SPACE_REQUIRED, "ParsePI: PI %s space expected\n", target); } SKIP_BLANKS; cur = CUR_CHAR(l); while (IS_CHAR(cur) && /* checked */ ((cur != '?') || (NXT(1) != '>'))) { if (len + 5 >= size) { xmlChar *tmp; size_t new_size = size * 2; tmp = (xmlChar *) xmlRealloc(buf, new_size); if (tmp == NULL) { xmlErrMemory(ctxt, NULL); xmlFree(buf); ctxt->instate = state; return; } buf = tmp; size = new_size; } count++; if (count > 50) { GROW; if (ctxt->instate == XML_PARSER_EOF) { xmlFree(buf); return; } count = 0; if ((len > XML_MAX_TEXT_LENGTH) && ((ctxt->options & XML_PARSE_HUGE) == 0)) { xmlFatalErrMsgStr(ctxt, XML_ERR_PI_NOT_FINISHED, "PI %s too big found", target); xmlFree(buf); ctxt->instate = state; return; } } COPY_BUF(l,buf,len,cur); NEXTL(l); cur = CUR_CHAR(l); if (cur == 0) { SHRINK; GROW; cur = CUR_CHAR(l); } } if ((len > XML_MAX_TEXT_LENGTH) && ((ctxt->options & XML_PARSE_HUGE) == 0)) { xmlFatalErrMsgStr(ctxt, XML_ERR_PI_NOT_FINISHED, "PI %s too big found", target); xmlFree(buf); ctxt->instate = state; return; } buf[len] = 0; if (cur != '?') { xmlFatalErrMsgStr(ctxt, XML_ERR_PI_NOT_FINISHED, "ParsePI: PI %s never end ...\n", target); } else { if (input != ctxt->input) { xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED, "PI declaration doesn't start and stop in the same entity\n"); } SKIP(2); #ifdef LIBXML_CATALOG_ENABLED if (((state == XML_PARSER_MISC) || (state == XML_PARSER_START)) && (xmlStrEqual(target, XML_CATALOG_PI))) { xmlCatalogAllow allow = xmlCatalogGetDefaults(); if ((allow == XML_CATA_ALLOW_DOCUMENT) || (allow == XML_CATA_ALLOW_ALL)) xmlParseCatalogPI(ctxt, buf); } #endif /* * SAX: PI detected. */ if ((ctxt->sax) && (!ctxt->disableSAX) && (ctxt->sax->processingInstruction != NULL)) ctxt->sax->processingInstruction(ctxt->userData, target, buf); } xmlFree(buf); } else { xmlFatalErr(ctxt, XML_ERR_PI_NOT_STARTED, NULL); } if (ctxt->instate != XML_PARSER_EOF) ctxt->instate = state; } }
C
Android
0
CVE-2011-4621
https://www.cvedetails.com/cve/CVE-2011-4621/
null
https://github.com/torvalds/linux/commit/f26f9aff6aaf67e9a430d16c266f91b13a5bff64
f26f9aff6aaf67e9a430d16c266f91b13a5bff64
Sched: fix skip_clock_update optimization idle_balance() drops/retakes rq->lock, leaving the previous task vulnerable to set_tsk_need_resched(). Clear it after we return from balancing instead, and in setup_thread_stack() as well, so no successfully descheduled or never scheduled task has it set. Need resched confused the skip_clock_update logic, which assumes that the next call to update_rq_clock() will come nearly immediately after being set. Make the optimization robust against the waking a sleeper before it sucessfully deschedules case by checking that the current task has not been dequeued before setting the flag, since it is that useless clock update we're trying to save, and clear unconditionally in schedule() proper instead of conditionally in put_prev_task(). Signed-off-by: Mike Galbraith <[email protected]> Reported-by: Bjoern B. Brandenburg <[email protected]> Tested-by: Yong Zhang <[email protected]> Signed-off-by: Peter Zijlstra <[email protected]> Cc: [email protected] LKML-Reference: <[email protected]> Signed-off-by: Ingo Molnar <[email protected]>
interruptible_sleep_on_timeout(wait_queue_head_t *q, long timeout) { return sleep_on_common(q, TASK_INTERRUPTIBLE, timeout); }
interruptible_sleep_on_timeout(wait_queue_head_t *q, long timeout) { return sleep_on_common(q, TASK_INTERRUPTIBLE, timeout); }
C
linux
0
CVE-2016-7124
https://www.cvedetails.com/cve/CVE-2016-7124/
CWE-502
https://github.com/php/php-src/commit/20ce2fe8e3c211a42fee05a461a5881be9a8790e?w=1
20ce2fe8e3c211a42fee05a461a5881be9a8790e?w=1
Fix bug #72663 - destroy broken object when unserializing (cherry picked from commit 448c9be157f4147e121f1a2a524536c75c9c6059)
PHPAPI int php_var_unserialize_ex(UNSERIALIZE_PARAMETER) { var_entries *orig_var_entries = (*var_hash)->last; zend_long orig_used_slots = orig_var_entries ? orig_var_entries->used_slots : 0; int result; result = php_var_unserialize_internal(UNSERIALIZE_PASSTHRU); if (!result) { /* If the unserialization failed, mark all elements that have been added to var_hash * as NULL. This will forbid their use by other unserialize() calls in the same * unserialization context. */ var_entries *e = orig_var_entries; zend_long s = orig_used_slots; while (e) { for (; s < e->used_slots; s++) { e->data[s] = NULL; } e = e->next; s = 0; } } return result; }
PHPAPI int php_var_unserialize_ex(UNSERIALIZE_PARAMETER) { var_entries *orig_var_entries = (*var_hash)->last; zend_long orig_used_slots = orig_var_entries ? orig_var_entries->used_slots : 0; int result; result = php_var_unserialize_internal(UNSERIALIZE_PASSTHRU); if (!result) { /* If the unserialization failed, mark all elements that have been added to var_hash * as NULL. This will forbid their use by other unserialize() calls in the same * unserialization context. */ var_entries *e = orig_var_entries; zend_long s = orig_used_slots; while (e) { for (; s < e->used_slots; s++) { e->data[s] = NULL; } e = e->next; s = 0; } } return result; }
C
php-src
0
CVE-2015-8126
https://www.cvedetails.com/cve/CVE-2015-8126/
CWE-119
https://github.com/chromium/chromium/commit/7f3d85b096f66870a15b37c2f40b219b2e292693
7f3d85b096f66870a15b37c2f40b219b2e292693
third_party/libpng: update to 1.2.54 [email protected] BUG=560291 Review URL: https://codereview.chromium.org/1467263003 Cr-Commit-Position: refs/heads/master@{#362298}
png_set_crc_action(png_structp png_ptr, int crit_action, int ancil_action) { png_debug(1, "in png_set_crc_action"); if (png_ptr == NULL) return; /* Tell libpng how we react to CRC errors in critical chunks */ switch (crit_action) { case PNG_CRC_NO_CHANGE: /* Leave setting as is */ break; case PNG_CRC_WARN_USE: /* Warn/use data */ png_ptr->flags &= ~PNG_FLAG_CRC_CRITICAL_MASK; png_ptr->flags |= PNG_FLAG_CRC_CRITICAL_USE; break; case PNG_CRC_QUIET_USE: /* Quiet/use data */ png_ptr->flags &= ~PNG_FLAG_CRC_CRITICAL_MASK; png_ptr->flags |= PNG_FLAG_CRC_CRITICAL_USE | PNG_FLAG_CRC_CRITICAL_IGNORE; break; case PNG_CRC_WARN_DISCARD: /* Not a valid action for critical data */ png_warning(png_ptr, "Can't discard critical data on CRC error."); case PNG_CRC_ERROR_QUIT: /* Error/quit */ case PNG_CRC_DEFAULT: default: png_ptr->flags &= ~PNG_FLAG_CRC_CRITICAL_MASK; break; } /* Tell libpng how we react to CRC errors in ancillary chunks */ switch (ancil_action) { case PNG_CRC_NO_CHANGE: /* Leave setting as is */ break; case PNG_CRC_WARN_USE: /* Warn/use data */ png_ptr->flags &= ~PNG_FLAG_CRC_ANCILLARY_MASK; png_ptr->flags |= PNG_FLAG_CRC_ANCILLARY_USE; break; case PNG_CRC_QUIET_USE: /* Quiet/use data */ png_ptr->flags &= ~PNG_FLAG_CRC_ANCILLARY_MASK; png_ptr->flags |= PNG_FLAG_CRC_ANCILLARY_USE | PNG_FLAG_CRC_ANCILLARY_NOWARN; break; case PNG_CRC_ERROR_QUIT: /* Error/quit */ png_ptr->flags &= ~PNG_FLAG_CRC_ANCILLARY_MASK; png_ptr->flags |= PNG_FLAG_CRC_ANCILLARY_NOWARN; break; case PNG_CRC_WARN_DISCARD: /* Warn/discard data */ case PNG_CRC_DEFAULT: default: png_ptr->flags &= ~PNG_FLAG_CRC_ANCILLARY_MASK; break; } }
png_set_crc_action(png_structp png_ptr, int crit_action, int ancil_action) { png_debug(1, "in png_set_crc_action"); if (png_ptr == NULL) return; /* Tell libpng how we react to CRC errors in critical chunks */ switch (crit_action) { case PNG_CRC_NO_CHANGE: /* Leave setting as is */ break; case PNG_CRC_WARN_USE: /* Warn/use data */ png_ptr->flags &= ~PNG_FLAG_CRC_CRITICAL_MASK; png_ptr->flags |= PNG_FLAG_CRC_CRITICAL_USE; break; case PNG_CRC_QUIET_USE: /* Quiet/use data */ png_ptr->flags &= ~PNG_FLAG_CRC_CRITICAL_MASK; png_ptr->flags |= PNG_FLAG_CRC_CRITICAL_USE | PNG_FLAG_CRC_CRITICAL_IGNORE; break; case PNG_CRC_WARN_DISCARD: /* Not a valid action for critical data */ png_warning(png_ptr, "Can't discard critical data on CRC error."); case PNG_CRC_ERROR_QUIT: /* Error/quit */ case PNG_CRC_DEFAULT: default: png_ptr->flags &= ~PNG_FLAG_CRC_CRITICAL_MASK; break; } /* Tell libpng how we react to CRC errors in ancillary chunks */ switch (ancil_action) { case PNG_CRC_NO_CHANGE: /* Leave setting as is */ break; case PNG_CRC_WARN_USE: /* Warn/use data */ png_ptr->flags &= ~PNG_FLAG_CRC_ANCILLARY_MASK; png_ptr->flags |= PNG_FLAG_CRC_ANCILLARY_USE; break; case PNG_CRC_QUIET_USE: /* Quiet/use data */ png_ptr->flags &= ~PNG_FLAG_CRC_ANCILLARY_MASK; png_ptr->flags |= PNG_FLAG_CRC_ANCILLARY_USE | PNG_FLAG_CRC_ANCILLARY_NOWARN; break; case PNG_CRC_ERROR_QUIT: /* Error/quit */ png_ptr->flags &= ~PNG_FLAG_CRC_ANCILLARY_MASK; png_ptr->flags |= PNG_FLAG_CRC_ANCILLARY_NOWARN; break; case PNG_CRC_WARN_DISCARD: /* Warn/discard data */ case PNG_CRC_DEFAULT: default: png_ptr->flags &= ~PNG_FLAG_CRC_ANCILLARY_MASK; break; } }
C
Chrome
0
CVE-2018-16080
https://www.cvedetails.com/cve/CVE-2018-16080/
CWE-20
https://github.com/chromium/chromium/commit/c552cd7b8a0862f6b3c8c6a07f98bda3721101eb
c552cd7b8a0862f6b3c8c6a07f98bda3721101eb
Mac: turn popups into new tabs while in fullscreen. It's platform convention to show popups as new tabs while in non-HTML5 fullscreen. (Popups cause tabs to lose HTML5 fullscreen.) This was implemented for Cocoa in a BrowserWindow override, but it makes sense to just stick it into Browser and remove a ton of override code put in just to support this. BUG=858929, 868416 TEST=as in bugs Change-Id: I43471f242813ec1159d9c690bab73dab3e610b7d Reviewed-on: https://chromium-review.googlesource.com/1153455 Reviewed-by: Sidney San Martín <[email protected]> Commit-Queue: Avi Drissman <[email protected]> Cr-Commit-Position: refs/heads/master@{#578755}
TestBrowserWindow::~TestBrowserWindow() {}
TestBrowserWindow::~TestBrowserWindow() {}
C
Chrome
0
CVE-2019-5770
https://www.cvedetails.com/cve/CVE-2019-5770/
CWE-125
https://github.com/chromium/chromium/commit/5f8761dd073c4ddd3b5aea8d95a2717e7b6e36e5
5f8761dd073c4ddd3b5aea8d95a2717e7b6e36e5
Validate glClearBuffer*v function |buffer| param on the client side Otherwise we could read out-of-bounds even if an invalid |buffer| is passed in and in theory we should not read the buffer at all. BUG=908749 TEST=gl_tests in ASAN build [email protected] Change-Id: I94b69b56ce3358ff9bfc0e21f0618aec4371d1ec Reviewed-on: https://chromium-review.googlesource.com/c/1354571 Reviewed-by: Antoine Labour <[email protected]> Commit-Queue: Zhenyao Mo <[email protected]> Cr-Commit-Position: refs/heads/master@{#612023}
int GLES2Util::GLGetNumValuesReturned(int id) const { switch (id) { case GL_ACTIVE_TEXTURE: return 1; case GL_ALIASED_LINE_WIDTH_RANGE: return 2; case GL_ALIASED_POINT_SIZE_RANGE: return 2; case GL_ALPHA_BITS: return 1; case GL_ARRAY_BUFFER_BINDING: return 1; case GL_BLEND: return 1; case GL_BLEND_COLOR: return 4; case GL_BLEND_DST_ALPHA: return 1; case GL_BLEND_DST_RGB: return 1; case GL_BLEND_EQUATION_ALPHA: return 1; case GL_BLEND_EQUATION_RGB: return 1; case GL_BLEND_SRC_ALPHA: return 1; case GL_BLEND_SRC_RGB: return 1; case GL_BLUE_BITS: return 1; case GL_COLOR_CLEAR_VALUE: return 4; case GL_COLOR_WRITEMASK: return 4; case GL_COMPRESSED_TEXTURE_FORMATS: return num_compressed_texture_formats_; case GL_CULL_FACE: return 1; case GL_CULL_FACE_MODE: return 1; case GL_CURRENT_PROGRAM: return 1; case GL_DEPTH_BITS: return 1; case GL_DEPTH_CLEAR_VALUE: return 1; case GL_DEPTH_FUNC: return 1; case GL_DEPTH_RANGE: return 2; case GL_DEPTH_TEST: return 1; case GL_DEPTH_WRITEMASK: return 1; case GL_DITHER: return 1; case GL_ELEMENT_ARRAY_BUFFER_BINDING: return 1; case GL_FRAMEBUFFER_BINDING: return 1; case GL_FRONT_FACE: return 1; case GL_GENERATE_MIPMAP_HINT: return 1; case GL_GREEN_BITS: return 1; case GL_IMPLEMENTATION_COLOR_READ_FORMAT: return 1; case GL_IMPLEMENTATION_COLOR_READ_TYPE: return 1; case GL_LINE_WIDTH: return 1; case GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS: return 1; case GL_MAX_CUBE_MAP_TEXTURE_SIZE: return 1; case GL_MAX_FRAGMENT_UNIFORM_VECTORS: return 1; case GL_MAX_RENDERBUFFER_SIZE: return 1; case GL_MAX_TEXTURE_IMAGE_UNITS: return 1; case GL_MAX_TEXTURE_SIZE: return 1; case GL_MAX_VARYING_VECTORS: return 1; case GL_MAX_VERTEX_ATTRIBS: return 1; case GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS: return 1; case GL_MAX_VERTEX_UNIFORM_VECTORS: return 1; case GL_MAX_VIEWPORT_DIMS: return 2; case GL_NUM_COMPRESSED_TEXTURE_FORMATS: return 1; case GL_NUM_SHADER_BINARY_FORMATS: return 1; case GL_PACK_ALIGNMENT: return 1; case GL_POLYGON_OFFSET_FACTOR: return 1; case GL_POLYGON_OFFSET_FILL: return 1; case GL_POLYGON_OFFSET_UNITS: return 1; case GL_RED_BITS: return 1; case GL_RENDERBUFFER_BINDING: return 1; case GL_SAMPLE_BUFFERS: return 1; case GL_SAMPLE_COVERAGE_INVERT: return 1; case GL_SAMPLE_COVERAGE_VALUE: return 1; case GL_SAMPLES: return 1; case GL_SCISSOR_BOX: return 4; case GL_SCISSOR_TEST: return 1; case GL_SHADER_BINARY_FORMATS: return num_shader_binary_formats_; case GL_SHADER_COMPILER: return 1; case GL_STENCIL_BACK_FAIL: return 1; case GL_STENCIL_BACK_FUNC: return 1; case GL_STENCIL_BACK_PASS_DEPTH_FAIL: return 1; case GL_STENCIL_BACK_PASS_DEPTH_PASS: return 1; case GL_STENCIL_BACK_REF: return 1; case GL_STENCIL_BACK_VALUE_MASK: return 1; case GL_STENCIL_BACK_WRITEMASK: return 1; case GL_STENCIL_BITS: return 1; case GL_STENCIL_CLEAR_VALUE: return 1; case GL_STENCIL_FAIL: return 1; case GL_STENCIL_FUNC: return 1; case GL_STENCIL_PASS_DEPTH_FAIL: return 1; case GL_STENCIL_PASS_DEPTH_PASS: return 1; case GL_STENCIL_REF: return 1; case GL_STENCIL_TEST: return 1; case GL_STENCIL_VALUE_MASK: return 1; case GL_STENCIL_WRITEMASK: return 1; case GL_SUBPIXEL_BITS: return 1; case GL_TEXTURE_BINDING_2D: return 1; case GL_TEXTURE_BINDING_CUBE_MAP: return 1; case GL_TEXTURE_BINDING_EXTERNAL_OES: return 1; case GL_TEXTURE_BINDING_RECTANGLE_ARB: return 1; case GL_UNPACK_ALIGNMENT: return 1; case GL_VIEWPORT: return 4; case GL_COPY_READ_BUFFER_BINDING: return 1; case GL_COPY_WRITE_BUFFER_BINDING: return 1; case GL_MAX_3D_TEXTURE_SIZE: return 1; case GL_MAX_ARRAY_TEXTURE_LAYERS: return 1; case GL_MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS: return 1; case GL_MAX_COMBINED_UNIFORM_BLOCKS: return 1; case GL_MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS: return 1; case GL_MAX_ELEMENT_INDEX: return 1; case GL_MAX_ELEMENTS_INDICES: return 1; case GL_MAX_ELEMENTS_VERTICES: return 1; case GL_MAX_FRAGMENT_INPUT_COMPONENTS: return 1; case GL_MAX_FRAGMENT_UNIFORM_BLOCKS: return 1; case GL_MAX_FRAGMENT_UNIFORM_COMPONENTS: return 1; case GL_MAX_PROGRAM_TEXEL_OFFSET: return 1; case GL_MAX_SERVER_WAIT_TIMEOUT: return 1; case GL_MAX_TEXTURE_LOD_BIAS: return 1; case GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS: return 1; case GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS: return 1; case GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS: return 1; case GL_MAX_UNIFORM_BLOCK_SIZE: return 1; case GL_MAX_UNIFORM_BUFFER_BINDINGS: return 1; case GL_MAX_VARYING_COMPONENTS: return 1; case GL_MAX_VERTEX_OUTPUT_COMPONENTS: return 1; case GL_MAX_VERTEX_UNIFORM_BLOCKS: return 1; case GL_MAX_VERTEX_UNIFORM_COMPONENTS: return 1; case GL_MIN_PROGRAM_TEXEL_OFFSET: return 1; case GL_PIXEL_PACK_BUFFER_BINDING: return 1; case GL_PIXEL_UNPACK_BUFFER_BINDING: return 1; case GL_TRANSFORM_FEEDBACK_BUFFER_BINDING: return 1; case GL_TRANSFORM_FEEDBACK_BUFFER_MODE: return 1; case GL_TRANSFORM_FEEDBACK_BUFFER_SIZE: return 1; case GL_TRANSFORM_FEEDBACK_BUFFER_START: return 1; case GL_UNIFORM_BUFFER_BINDING: return 1; case GL_UNIFORM_BUFFER_SIZE: return 1; case GL_UNIFORM_BUFFER_START: return 1; case GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT: return 1; case GL_ATOMIC_COUNTER_BUFFER_BINDING: return 1; case GL_ATOMIC_COUNTER_BUFFER_SIZE: return 1; case GL_ATOMIC_COUNTER_BUFFER_START: return 1; case GL_MAX_ATOMIC_COUNTER_BUFFER_BINDINGS: return 1; case GL_MAX_SHADER_STORAGE_BUFFER_BINDINGS: return 1; case GL_SHADER_STORAGE_BUFFER_BINDING: return 1; case GL_SHADER_STORAGE_BUFFER_SIZE: return 1; case GL_SHADER_STORAGE_BUFFER_START: return 1; case GL_SHADER_STORAGE_BUFFER_OFFSET_ALIGNMENT: return 1; case GL_MAX_SAMPLES_EXT: return 1; case GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT: return 1; case GL_WINDOW_RECTANGLE_MODE_EXT: return 1; case GL_MAX_WINDOW_RECTANGLES_EXT: return 1; case GL_NUM_WINDOW_RECTANGLES_EXT: return 1; case GL_BUFFER_SIZE: return 1; case GL_BUFFER_USAGE: return 1; case GL_BUFFER_MAPPED: return 1; case GL_BUFFER_ACCESS_FLAGS: return 1; case GL_BUFFER_MAP_LENGTH: return 1; case GL_BUFFER_MAP_OFFSET: return 1; case GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE: return 1; case GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME: return 1; case GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL: return 1; case GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE: return 1; case GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_SAMPLES_EXT: return 1; case GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT: return 1; case GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE: return 1; case GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE: return 1; case GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE: return 1; case GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE: return 1; case GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE: return 1; case GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE: return 1; case GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE: return 1; case GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER: return 1; case GL_DELETE_STATUS: return 1; case GL_LINK_STATUS: return 1; case GL_VALIDATE_STATUS: return 1; case GL_INFO_LOG_LENGTH: return 1; case GL_ATTACHED_SHADERS: return 1; case GL_ACTIVE_ATTRIBUTES: return 1; case GL_ACTIVE_ATTRIBUTE_MAX_LENGTH: return 1; case GL_ACTIVE_UNIFORMS: return 1; case GL_ACTIVE_UNIFORM_MAX_LENGTH: return 1; case GL_RENDERBUFFER_WIDTH: return 1; case GL_RENDERBUFFER_HEIGHT: return 1; case GL_RENDERBUFFER_INTERNAL_FORMAT: return 1; case GL_RENDERBUFFER_RED_SIZE: return 1; case GL_RENDERBUFFER_GREEN_SIZE: return 1; case GL_RENDERBUFFER_BLUE_SIZE: return 1; case GL_RENDERBUFFER_ALPHA_SIZE: return 1; case GL_RENDERBUFFER_DEPTH_SIZE: return 1; case GL_RENDERBUFFER_STENCIL_SIZE: return 1; case GL_RENDERBUFFER_SAMPLES_EXT: return 1; case GL_SHADER_TYPE: return 1; case GL_COMPILE_STATUS: return 1; case GL_SHADER_SOURCE_LENGTH: return 1; case GL_TRANSLATED_SHADER_SOURCE_LENGTH_ANGLE: return 1; case GL_TEXTURE_MAG_FILTER: return 1; case GL_TEXTURE_MIN_FILTER: return 1; case GL_TEXTURE_WRAP_R: return 1; case GL_TEXTURE_WRAP_S: return 1; case GL_TEXTURE_WRAP_T: return 1; case GL_TEXTURE_COMPARE_FUNC: return 1; case GL_TEXTURE_COMPARE_MODE: return 1; case GL_TEXTURE_MAX_LOD: return 1; case GL_TEXTURE_MIN_LOD: return 1; case GL_TEXTURE_BASE_LEVEL: return 1; case GL_TEXTURE_MAX_LEVEL: return 1; case GL_TEXTURE_IMMUTABLE_FORMAT: return 1; case GL_TEXTURE_IMMUTABLE_LEVELS: return 1; case GL_TEXTURE_MAX_ANISOTROPY_EXT: return 1; case GL_TEXTURE_SWIZZLE_R: return 1; case GL_TEXTURE_SWIZZLE_G: return 1; case GL_TEXTURE_SWIZZLE_B: return 1; case GL_TEXTURE_SWIZZLE_A: return 1; case GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING: return 1; case GL_VERTEX_ATTRIB_ARRAY_ENABLED: return 1; case GL_VERTEX_ATTRIB_ARRAY_SIZE: return 1; case GL_VERTEX_ATTRIB_ARRAY_STRIDE: return 1; case GL_VERTEX_ATTRIB_ARRAY_TYPE: return 1; case GL_VERTEX_ATTRIB_ARRAY_NORMALIZED: return 1; case GL_CURRENT_VERTEX_ATTRIB: return 4; case GL_VERTEX_ATTRIB_ARRAY_INTEGER: return 1; case GL_VERTEX_ATTRIB_ARRAY_DIVISOR: return 1; case GL_OBJECT_TYPE: return 1; case GL_SYNC_STATUS: return 1; case GL_SYNC_CONDITION: return 1; case GL_SYNC_FLAGS: return 1; case GL_FRAGMENT_SHADER_DERIVATIVE_HINT_OES: return 1; case GL_BIND_GENERATES_RESOURCE_CHROMIUM: return 1; default: return 0; } }
int GLES2Util::GLGetNumValuesReturned(int id) const { switch (id) { case GL_ACTIVE_TEXTURE: return 1; case GL_ALIASED_LINE_WIDTH_RANGE: return 2; case GL_ALIASED_POINT_SIZE_RANGE: return 2; case GL_ALPHA_BITS: return 1; case GL_ARRAY_BUFFER_BINDING: return 1; case GL_BLEND: return 1; case GL_BLEND_COLOR: return 4; case GL_BLEND_DST_ALPHA: return 1; case GL_BLEND_DST_RGB: return 1; case GL_BLEND_EQUATION_ALPHA: return 1; case GL_BLEND_EQUATION_RGB: return 1; case GL_BLEND_SRC_ALPHA: return 1; case GL_BLEND_SRC_RGB: return 1; case GL_BLUE_BITS: return 1; case GL_COLOR_CLEAR_VALUE: return 4; case GL_COLOR_WRITEMASK: return 4; case GL_COMPRESSED_TEXTURE_FORMATS: return num_compressed_texture_formats_; case GL_CULL_FACE: return 1; case GL_CULL_FACE_MODE: return 1; case GL_CURRENT_PROGRAM: return 1; case GL_DEPTH_BITS: return 1; case GL_DEPTH_CLEAR_VALUE: return 1; case GL_DEPTH_FUNC: return 1; case GL_DEPTH_RANGE: return 2; case GL_DEPTH_TEST: return 1; case GL_DEPTH_WRITEMASK: return 1; case GL_DITHER: return 1; case GL_ELEMENT_ARRAY_BUFFER_BINDING: return 1; case GL_FRAMEBUFFER_BINDING: return 1; case GL_FRONT_FACE: return 1; case GL_GENERATE_MIPMAP_HINT: return 1; case GL_GREEN_BITS: return 1; case GL_IMPLEMENTATION_COLOR_READ_FORMAT: return 1; case GL_IMPLEMENTATION_COLOR_READ_TYPE: return 1; case GL_LINE_WIDTH: return 1; case GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS: return 1; case GL_MAX_CUBE_MAP_TEXTURE_SIZE: return 1; case GL_MAX_FRAGMENT_UNIFORM_VECTORS: return 1; case GL_MAX_RENDERBUFFER_SIZE: return 1; case GL_MAX_TEXTURE_IMAGE_UNITS: return 1; case GL_MAX_TEXTURE_SIZE: return 1; case GL_MAX_VARYING_VECTORS: return 1; case GL_MAX_VERTEX_ATTRIBS: return 1; case GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS: return 1; case GL_MAX_VERTEX_UNIFORM_VECTORS: return 1; case GL_MAX_VIEWPORT_DIMS: return 2; case GL_NUM_COMPRESSED_TEXTURE_FORMATS: return 1; case GL_NUM_SHADER_BINARY_FORMATS: return 1; case GL_PACK_ALIGNMENT: return 1; case GL_POLYGON_OFFSET_FACTOR: return 1; case GL_POLYGON_OFFSET_FILL: return 1; case GL_POLYGON_OFFSET_UNITS: return 1; case GL_RED_BITS: return 1; case GL_RENDERBUFFER_BINDING: return 1; case GL_SAMPLE_BUFFERS: return 1; case GL_SAMPLE_COVERAGE_INVERT: return 1; case GL_SAMPLE_COVERAGE_VALUE: return 1; case GL_SAMPLES: return 1; case GL_SCISSOR_BOX: return 4; case GL_SCISSOR_TEST: return 1; case GL_SHADER_BINARY_FORMATS: return num_shader_binary_formats_; case GL_SHADER_COMPILER: return 1; case GL_STENCIL_BACK_FAIL: return 1; case GL_STENCIL_BACK_FUNC: return 1; case GL_STENCIL_BACK_PASS_DEPTH_FAIL: return 1; case GL_STENCIL_BACK_PASS_DEPTH_PASS: return 1; case GL_STENCIL_BACK_REF: return 1; case GL_STENCIL_BACK_VALUE_MASK: return 1; case GL_STENCIL_BACK_WRITEMASK: return 1; case GL_STENCIL_BITS: return 1; case GL_STENCIL_CLEAR_VALUE: return 1; case GL_STENCIL_FAIL: return 1; case GL_STENCIL_FUNC: return 1; case GL_STENCIL_PASS_DEPTH_FAIL: return 1; case GL_STENCIL_PASS_DEPTH_PASS: return 1; case GL_STENCIL_REF: return 1; case GL_STENCIL_TEST: return 1; case GL_STENCIL_VALUE_MASK: return 1; case GL_STENCIL_WRITEMASK: return 1; case GL_SUBPIXEL_BITS: return 1; case GL_TEXTURE_BINDING_2D: return 1; case GL_TEXTURE_BINDING_CUBE_MAP: return 1; case GL_TEXTURE_BINDING_EXTERNAL_OES: return 1; case GL_TEXTURE_BINDING_RECTANGLE_ARB: return 1; case GL_UNPACK_ALIGNMENT: return 1; case GL_VIEWPORT: return 4; case GL_COPY_READ_BUFFER_BINDING: return 1; case GL_COPY_WRITE_BUFFER_BINDING: return 1; case GL_MAX_3D_TEXTURE_SIZE: return 1; case GL_MAX_ARRAY_TEXTURE_LAYERS: return 1; case GL_MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS: return 1; case GL_MAX_COMBINED_UNIFORM_BLOCKS: return 1; case GL_MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS: return 1; case GL_MAX_ELEMENT_INDEX: return 1; case GL_MAX_ELEMENTS_INDICES: return 1; case GL_MAX_ELEMENTS_VERTICES: return 1; case GL_MAX_FRAGMENT_INPUT_COMPONENTS: return 1; case GL_MAX_FRAGMENT_UNIFORM_BLOCKS: return 1; case GL_MAX_FRAGMENT_UNIFORM_COMPONENTS: return 1; case GL_MAX_PROGRAM_TEXEL_OFFSET: return 1; case GL_MAX_SERVER_WAIT_TIMEOUT: return 1; case GL_MAX_TEXTURE_LOD_BIAS: return 1; case GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS: return 1; case GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS: return 1; case GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS: return 1; case GL_MAX_UNIFORM_BLOCK_SIZE: return 1; case GL_MAX_UNIFORM_BUFFER_BINDINGS: return 1; case GL_MAX_VARYING_COMPONENTS: return 1; case GL_MAX_VERTEX_OUTPUT_COMPONENTS: return 1; case GL_MAX_VERTEX_UNIFORM_BLOCKS: return 1; case GL_MAX_VERTEX_UNIFORM_COMPONENTS: return 1; case GL_MIN_PROGRAM_TEXEL_OFFSET: return 1; case GL_PIXEL_PACK_BUFFER_BINDING: return 1; case GL_PIXEL_UNPACK_BUFFER_BINDING: return 1; case GL_TRANSFORM_FEEDBACK_BUFFER_BINDING: return 1; case GL_TRANSFORM_FEEDBACK_BUFFER_MODE: return 1; case GL_TRANSFORM_FEEDBACK_BUFFER_SIZE: return 1; case GL_TRANSFORM_FEEDBACK_BUFFER_START: return 1; case GL_UNIFORM_BUFFER_BINDING: return 1; case GL_UNIFORM_BUFFER_SIZE: return 1; case GL_UNIFORM_BUFFER_START: return 1; case GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT: return 1; case GL_ATOMIC_COUNTER_BUFFER_BINDING: return 1; case GL_ATOMIC_COUNTER_BUFFER_SIZE: return 1; case GL_ATOMIC_COUNTER_BUFFER_START: return 1; case GL_MAX_ATOMIC_COUNTER_BUFFER_BINDINGS: return 1; case GL_MAX_SHADER_STORAGE_BUFFER_BINDINGS: return 1; case GL_SHADER_STORAGE_BUFFER_BINDING: return 1; case GL_SHADER_STORAGE_BUFFER_SIZE: return 1; case GL_SHADER_STORAGE_BUFFER_START: return 1; case GL_SHADER_STORAGE_BUFFER_OFFSET_ALIGNMENT: return 1; case GL_MAX_SAMPLES_EXT: return 1; case GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT: return 1; case GL_WINDOW_RECTANGLE_MODE_EXT: return 1; case GL_MAX_WINDOW_RECTANGLES_EXT: return 1; case GL_NUM_WINDOW_RECTANGLES_EXT: return 1; case GL_BUFFER_SIZE: return 1; case GL_BUFFER_USAGE: return 1; case GL_BUFFER_MAPPED: return 1; case GL_BUFFER_ACCESS_FLAGS: return 1; case GL_BUFFER_MAP_LENGTH: return 1; case GL_BUFFER_MAP_OFFSET: return 1; case GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE: return 1; case GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME: return 1; case GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL: return 1; case GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE: return 1; case GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_SAMPLES_EXT: return 1; case GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT: return 1; case GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE: return 1; case GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE: return 1; case GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE: return 1; case GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE: return 1; case GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE: return 1; case GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE: return 1; case GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE: return 1; case GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER: return 1; case GL_DELETE_STATUS: return 1; case GL_LINK_STATUS: return 1; case GL_VALIDATE_STATUS: return 1; case GL_INFO_LOG_LENGTH: return 1; case GL_ATTACHED_SHADERS: return 1; case GL_ACTIVE_ATTRIBUTES: return 1; case GL_ACTIVE_ATTRIBUTE_MAX_LENGTH: return 1; case GL_ACTIVE_UNIFORMS: return 1; case GL_ACTIVE_UNIFORM_MAX_LENGTH: return 1; case GL_RENDERBUFFER_WIDTH: return 1; case GL_RENDERBUFFER_HEIGHT: return 1; case GL_RENDERBUFFER_INTERNAL_FORMAT: return 1; case GL_RENDERBUFFER_RED_SIZE: return 1; case GL_RENDERBUFFER_GREEN_SIZE: return 1; case GL_RENDERBUFFER_BLUE_SIZE: return 1; case GL_RENDERBUFFER_ALPHA_SIZE: return 1; case GL_RENDERBUFFER_DEPTH_SIZE: return 1; case GL_RENDERBUFFER_STENCIL_SIZE: return 1; case GL_RENDERBUFFER_SAMPLES_EXT: return 1; case GL_SHADER_TYPE: return 1; case GL_COMPILE_STATUS: return 1; case GL_SHADER_SOURCE_LENGTH: return 1; case GL_TRANSLATED_SHADER_SOURCE_LENGTH_ANGLE: return 1; case GL_TEXTURE_MAG_FILTER: return 1; case GL_TEXTURE_MIN_FILTER: return 1; case GL_TEXTURE_WRAP_R: return 1; case GL_TEXTURE_WRAP_S: return 1; case GL_TEXTURE_WRAP_T: return 1; case GL_TEXTURE_COMPARE_FUNC: return 1; case GL_TEXTURE_COMPARE_MODE: return 1; case GL_TEXTURE_MAX_LOD: return 1; case GL_TEXTURE_MIN_LOD: return 1; case GL_TEXTURE_BASE_LEVEL: return 1; case GL_TEXTURE_MAX_LEVEL: return 1; case GL_TEXTURE_IMMUTABLE_FORMAT: return 1; case GL_TEXTURE_IMMUTABLE_LEVELS: return 1; case GL_TEXTURE_MAX_ANISOTROPY_EXT: return 1; case GL_TEXTURE_SWIZZLE_R: return 1; case GL_TEXTURE_SWIZZLE_G: return 1; case GL_TEXTURE_SWIZZLE_B: return 1; case GL_TEXTURE_SWIZZLE_A: return 1; case GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING: return 1; case GL_VERTEX_ATTRIB_ARRAY_ENABLED: return 1; case GL_VERTEX_ATTRIB_ARRAY_SIZE: return 1; case GL_VERTEX_ATTRIB_ARRAY_STRIDE: return 1; case GL_VERTEX_ATTRIB_ARRAY_TYPE: return 1; case GL_VERTEX_ATTRIB_ARRAY_NORMALIZED: return 1; case GL_CURRENT_VERTEX_ATTRIB: return 4; case GL_VERTEX_ATTRIB_ARRAY_INTEGER: return 1; case GL_VERTEX_ATTRIB_ARRAY_DIVISOR: return 1; case GL_OBJECT_TYPE: return 1; case GL_SYNC_STATUS: return 1; case GL_SYNC_CONDITION: return 1; case GL_SYNC_FLAGS: return 1; case GL_FRAGMENT_SHADER_DERIVATIVE_HINT_OES: return 1; case GL_BIND_GENERATES_RESOURCE_CHROMIUM: return 1; default: return 0; } }
C
Chrome
0
CVE-2018-16435
https://www.cvedetails.com/cve/CVE-2018-16435/
CWE-190
https://github.com/mm2/Little-CMS/commit/768f70ca405cd3159d990e962d54456773bb8cf8
768f70ca405cd3159d990e962d54456773bb8cf8
Upgrade Visual studio 2017 15.8 - Upgrade to 15.8 - Add check on CGATS memory allocation (thanks to Quang Nguyen for pointing out this)
cmsBool Check(cmsIT8* it8, SYMBOL sy, const char* Err) { if (it8 -> sy != sy) return SynError(it8, NoMeta(Err)); return TRUE; }
cmsBool Check(cmsIT8* it8, SYMBOL sy, const char* Err) { if (it8 -> sy != sy) return SynError(it8, NoMeta(Err)); return TRUE; }
C
Little-CMS
0
CVE-2014-1700
https://www.cvedetails.com/cve/CVE-2014-1700/
CWE-399
https://github.com/chromium/chromium/commit/d926098e2e2be270c80a5ba25ab8a611b80b8556
d926098e2e2be270c80a5ba25ab8a611b80b8556
Connect WebUSB client interface to the devices app This provides a basic WebUSB client interface in content/renderer. Most of the interface is unimplemented, but this CL hooks up navigator.usb.getDevices() to the browser's Mojo devices app to enumerate available USB devices. BUG=492204 Review URL: https://codereview.chromium.org/1293253002 Cr-Commit-Position: refs/heads/master@{#344881}
void RenderFrameImpl::didCommitProvisionalLoad( blink::WebLocalFrame* frame, const blink::WebHistoryItem& item, blink::WebHistoryCommitType commit_type) { TRACE_EVENT2("navigation", "RenderFrameImpl::didCommitProvisionalLoad", "id", routing_id_, "url", GetLoadingUrl().possibly_invalid_spec()); DCHECK(!frame_ || frame_ == frame); DocumentState* document_state = DocumentState::FromDataSource(frame->dataSource()); NavigationStateImpl* navigation_state = static_cast<NavigationStateImpl*>(document_state->navigation_state()); if (proxy_routing_id_ != MSG_ROUTING_NONE) { RenderFrameProxy* proxy = RenderFrameProxy::FromRoutingID(proxy_routing_id_); CHECK(proxy); proxy->web_frame()->swap(frame_); proxy_routing_id_ = MSG_ROUTING_NONE; if (!is_subframe_) { CHECK(!render_view_->main_render_frame_); render_view_->main_render_frame_ = this; if (render_view_->is_swapped_out()) render_view_->SetSwappedOut(false); } } render_view_->SendUpdateState(); render_view_->history_controller()->UpdateForCommit( this, item, commit_type, navigation_state->WasWithinSamePage()); InternalDocumentStateData* internal_data = InternalDocumentStateData::FromDocumentState(document_state); if (document_state->commit_load_time().is_null()) document_state->set_commit_load_time(Time::Now()); if (internal_data->must_reset_scroll_and_scale_state()) { render_view_->webview()->resetScrollAndScaleState(); internal_data->set_must_reset_scroll_and_scale_state(false); } bool is_new_navigation = commit_type == blink::WebStandardCommit; if (is_new_navigation) { render_view_->page_id_ = render_view_->next_page_id_++; DCHECK_IMPLIES( navigation_state->common_params().should_replace_current_entry, render_view_->history_list_length_ > 0); if (GetLoadingUrl() != GURL(kSwappedOutURL) && !navigation_state->common_params().should_replace_current_entry) { render_view_->history_list_offset_++; if (render_view_->history_list_offset_ >= kMaxSessionHistoryEntries) render_view_->history_list_offset_ = kMaxSessionHistoryEntries - 1; render_view_->history_list_length_ = render_view_->history_list_offset_ + 1; } } else { const RequestNavigationParams& request_params = navigation_state->request_params(); if (request_params.nav_entry_id != 0 && !request_params.intended_as_new_entry) { render_view_->page_id_ = request_params.page_id; render_view_->history_list_offset_ = request_params.pending_history_list_offset; } } bool sent = Send( new FrameHostMsg_DidAssignPageId(routing_id_, render_view_->page_id_)); CHECK(sent); // http://crbug.com/407376 FOR_EACH_OBSERVER(RenderViewObserver, render_view_->observers_, DidCommitProvisionalLoad(frame, is_new_navigation)); FOR_EACH_OBSERVER( RenderFrameObserver, observers_, DidCommitProvisionalLoad(is_new_navigation, navigation_state->WasWithinSamePage())); if (!frame->parent()) { // Only for top frames. RenderThreadImpl* render_thread_impl = RenderThreadImpl::current(); if (render_thread_impl) { // Can be NULL in tests. render_thread_impl->histogram_customizer()-> RenderViewNavigatedToHost(GURL(GetLoadingUrl()).host(), RenderView::GetRenderViewCount()); } } navigation_state->set_request_committed(true); SendDidCommitProvisionalLoad(frame, commit_type, item); UpdateEncoding(frame, frame->view()->pageEncoding().utf8()); }
void RenderFrameImpl::didCommitProvisionalLoad( blink::WebLocalFrame* frame, const blink::WebHistoryItem& item, blink::WebHistoryCommitType commit_type) { TRACE_EVENT2("navigation", "RenderFrameImpl::didCommitProvisionalLoad", "id", routing_id_, "url", GetLoadingUrl().possibly_invalid_spec()); DCHECK(!frame_ || frame_ == frame); DocumentState* document_state = DocumentState::FromDataSource(frame->dataSource()); NavigationStateImpl* navigation_state = static_cast<NavigationStateImpl*>(document_state->navigation_state()); if (proxy_routing_id_ != MSG_ROUTING_NONE) { RenderFrameProxy* proxy = RenderFrameProxy::FromRoutingID(proxy_routing_id_); CHECK(proxy); proxy->web_frame()->swap(frame_); proxy_routing_id_ = MSG_ROUTING_NONE; if (!is_subframe_) { CHECK(!render_view_->main_render_frame_); render_view_->main_render_frame_ = this; if (render_view_->is_swapped_out()) render_view_->SetSwappedOut(false); } } render_view_->SendUpdateState(); render_view_->history_controller()->UpdateForCommit( this, item, commit_type, navigation_state->WasWithinSamePage()); InternalDocumentStateData* internal_data = InternalDocumentStateData::FromDocumentState(document_state); if (document_state->commit_load_time().is_null()) document_state->set_commit_load_time(Time::Now()); if (internal_data->must_reset_scroll_and_scale_state()) { render_view_->webview()->resetScrollAndScaleState(); internal_data->set_must_reset_scroll_and_scale_state(false); } bool is_new_navigation = commit_type == blink::WebStandardCommit; if (is_new_navigation) { render_view_->page_id_ = render_view_->next_page_id_++; DCHECK_IMPLIES( navigation_state->common_params().should_replace_current_entry, render_view_->history_list_length_ > 0); if (GetLoadingUrl() != GURL(kSwappedOutURL) && !navigation_state->common_params().should_replace_current_entry) { render_view_->history_list_offset_++; if (render_view_->history_list_offset_ >= kMaxSessionHistoryEntries) render_view_->history_list_offset_ = kMaxSessionHistoryEntries - 1; render_view_->history_list_length_ = render_view_->history_list_offset_ + 1; } } else { const RequestNavigationParams& request_params = navigation_state->request_params(); if (request_params.nav_entry_id != 0 && !request_params.intended_as_new_entry) { render_view_->page_id_ = request_params.page_id; render_view_->history_list_offset_ = request_params.pending_history_list_offset; } } bool sent = Send( new FrameHostMsg_DidAssignPageId(routing_id_, render_view_->page_id_)); CHECK(sent); // http://crbug.com/407376 FOR_EACH_OBSERVER(RenderViewObserver, render_view_->observers_, DidCommitProvisionalLoad(frame, is_new_navigation)); FOR_EACH_OBSERVER( RenderFrameObserver, observers_, DidCommitProvisionalLoad(is_new_navigation, navigation_state->WasWithinSamePage())); if (!frame->parent()) { // Only for top frames. RenderThreadImpl* render_thread_impl = RenderThreadImpl::current(); if (render_thread_impl) { // Can be NULL in tests. render_thread_impl->histogram_customizer()-> RenderViewNavigatedToHost(GURL(GetLoadingUrl()).host(), RenderView::GetRenderViewCount()); } } navigation_state->set_request_committed(true); SendDidCommitProvisionalLoad(frame, commit_type, item); UpdateEncoding(frame, frame->view()->pageEncoding().utf8()); }
C
Chrome
0
CVE-2016-6197
https://www.cvedetails.com/cve/CVE-2016-6197/
CWE-20
https://github.com/torvalds/linux/commit/11f3710417d026ea2f4fcf362d866342c5274185
11f3710417d026ea2f4fcf362d866342c5274185
ovl: verify upper dentry before unlink and rename Unlink and rename in overlayfs checked the upper dentry for staleness by verifying upper->d_parent against upperdir. However the dentry can go stale also by being unhashed, for example. Expand the verification to actually look up the name again (under parent lock) and check if it matches the upper dentry. This matches what the VFS does before passing the dentry to filesytem's unlink/rename methods, which excludes any inconsistency caused by overlayfs. Signed-off-by: Miklos Szeredi <[email protected]>
static int ovl_create(struct inode *dir, struct dentry *dentry, umode_t mode, bool excl) { return ovl_create_object(dentry, (mode & 07777) | S_IFREG, 0, NULL); }
static int ovl_create(struct inode *dir, struct dentry *dentry, umode_t mode, bool excl) { return ovl_create_object(dentry, (mode & 07777) | S_IFREG, 0, NULL); }
C
linux
0
null
null
null
https://github.com/chromium/chromium/commit/0d04639df7a3b2425c671ab08f68eb32b3d04cb1
0d04639df7a3b2425c671ab08f68eb32b3d04cb1
Fix crasher with autofill infobar. The "save credit card" information was deleted by the AutofillManager when the form is submitted but was still pointed to by the TabContents, causing a crasher when navigating. BUG=50428 TEST=See steps in 56238. Review URL: http://codereview.chromium.org/3466006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@60095 0039d316-1c4b-4281-b951-d872f2087c98
std::string TranslateManager::GetLanguageCode( const std::string& chrome_locale) { for (size_t i = 0; i < arraysize(kLocaleToCLDLanguages); ++i) { if (chrome_locale == kLocaleToCLDLanguages[i].locale_language) return kLocaleToCLDLanguages[i].cld_language; } return chrome_locale; }
std::string TranslateManager::GetLanguageCode( const std::string& chrome_locale) { for (size_t i = 0; i < arraysize(kLocaleToCLDLanguages); ++i) { if (chrome_locale == kLocaleToCLDLanguages[i].locale_language) return kLocaleToCLDLanguages[i].cld_language; } return chrome_locale; }
C
Chrome
0
CVE-2018-6111
https://www.cvedetails.com/cve/CVE-2018-6111/
CWE-20
https://github.com/chromium/chromium/commit/3c8e4852477d5b1e2da877808c998dc57db9460f
3c8e4852477d5b1e2da877808c998dc57db9460f
DevTools: speculative fix for crash in NetworkHandler::Disable This keeps BrowserContext* and StoragePartition* instead of RenderProcessHost* in an attemp to resolve UAF of RenderProcessHost upon closure of DevTools front-end. Bug: 801117, 783067, 780694 Change-Id: I6c2cca60cc0c29f0949d189cf918769059f80c1b Reviewed-on: https://chromium-review.googlesource.com/876657 Commit-Queue: Andrey Kosyakov <[email protected]> Reviewed-by: Dmitry Gozman <[email protected]> Cr-Commit-Position: refs/heads/master@{#531157}
void SharedWorkerDevToolsAgentHost::WorkerDestroyed() { DCHECK_NE(WORKER_TERMINATED, state_); DCHECK(worker_host_); state_ = WORKER_TERMINATED; for (auto* inspector : protocol::InspectorHandler::ForAgentHost(this)) inspector->TargetCrashed(); for (DevToolsSession* session : sessions()) session->SetRenderer(-1, nullptr); worker_host_ = nullptr; agent_ptr_.reset(); }
void SharedWorkerDevToolsAgentHost::WorkerDestroyed() { DCHECK_NE(WORKER_TERMINATED, state_); DCHECK(worker_host_); state_ = WORKER_TERMINATED; for (auto* inspector : protocol::InspectorHandler::ForAgentHost(this)) inspector->TargetCrashed(); for (DevToolsSession* session : sessions()) session->SetRenderer(nullptr, nullptr); worker_host_ = nullptr; agent_ptr_.reset(); }
C
Chrome
1
CVE-2016-10764
https://www.cvedetails.com/cve/CVE-2016-10764/
CWE-119
https://github.com/torvalds/linux/commit/193e87143c290ec16838f5368adc0e0bc94eb931
193e87143c290ec16838f5368adc0e0bc94eb931
mtd: spi-nor: Off by one in cqspi_setup_flash() There are CQSPI_MAX_CHIPSELECT elements in the ->f_pdata array so the > should be >=. Fixes: 140623410536 ('mtd: spi-nor: Add driver for Cadence Quad SPI Flash Controller') Signed-off-by: Dan Carpenter <[email protected]> Reviewed-by: Marek Vasut <[email protected]> Signed-off-by: Cyrille Pitchen <[email protected]>
static int cqspi_indirect_read_setup(struct spi_nor *nor, const unsigned int from_addr) { struct cqspi_flash_pdata *f_pdata = nor->priv; struct cqspi_st *cqspi = f_pdata->cqspi; void __iomem *reg_base = cqspi->iobase; unsigned int dummy_clk = 0; unsigned int reg; writel(from_addr, reg_base + CQSPI_REG_INDIRECTRDSTARTADDR); reg = nor->read_opcode << CQSPI_REG_RD_INSTR_OPCODE_LSB; reg |= cqspi_calc_rdreg(nor, nor->read_opcode); /* Setup dummy clock cycles */ dummy_clk = nor->read_dummy; if (dummy_clk > CQSPI_DUMMY_CLKS_MAX) dummy_clk = CQSPI_DUMMY_CLKS_MAX; if (dummy_clk / 8) { reg |= (1 << CQSPI_REG_RD_INSTR_MODE_EN_LSB); /* Set mode bits high to ensure chip doesn't enter XIP */ writel(0xFF, reg_base + CQSPI_REG_MODE_BIT); /* Need to subtract the mode byte (8 clocks). */ if (f_pdata->inst_width != CQSPI_INST_TYPE_QUAD) dummy_clk -= 8; if (dummy_clk) reg |= (dummy_clk & CQSPI_REG_RD_INSTR_DUMMY_MASK) << CQSPI_REG_RD_INSTR_DUMMY_LSB; } writel(reg, reg_base + CQSPI_REG_RD_INSTR); /* Set address width */ reg = readl(reg_base + CQSPI_REG_SIZE); reg &= ~CQSPI_REG_SIZE_ADDRESS_MASK; reg |= (nor->addr_width - 1); writel(reg, reg_base + CQSPI_REG_SIZE); return 0; }
static int cqspi_indirect_read_setup(struct spi_nor *nor, const unsigned int from_addr) { struct cqspi_flash_pdata *f_pdata = nor->priv; struct cqspi_st *cqspi = f_pdata->cqspi; void __iomem *reg_base = cqspi->iobase; unsigned int dummy_clk = 0; unsigned int reg; writel(from_addr, reg_base + CQSPI_REG_INDIRECTRDSTARTADDR); reg = nor->read_opcode << CQSPI_REG_RD_INSTR_OPCODE_LSB; reg |= cqspi_calc_rdreg(nor, nor->read_opcode); /* Setup dummy clock cycles */ dummy_clk = nor->read_dummy; if (dummy_clk > CQSPI_DUMMY_CLKS_MAX) dummy_clk = CQSPI_DUMMY_CLKS_MAX; if (dummy_clk / 8) { reg |= (1 << CQSPI_REG_RD_INSTR_MODE_EN_LSB); /* Set mode bits high to ensure chip doesn't enter XIP */ writel(0xFF, reg_base + CQSPI_REG_MODE_BIT); /* Need to subtract the mode byte (8 clocks). */ if (f_pdata->inst_width != CQSPI_INST_TYPE_QUAD) dummy_clk -= 8; if (dummy_clk) reg |= (dummy_clk & CQSPI_REG_RD_INSTR_DUMMY_MASK) << CQSPI_REG_RD_INSTR_DUMMY_LSB; } writel(reg, reg_base + CQSPI_REG_RD_INSTR); /* Set address width */ reg = readl(reg_base + CQSPI_REG_SIZE); reg &= ~CQSPI_REG_SIZE_ADDRESS_MASK; reg |= (nor->addr_width - 1); writel(reg, reg_base + CQSPI_REG_SIZE); return 0; }
C
linux
0
CVE-2009-3605
https://www.cvedetails.com/cve/CVE-2009-3605/
CWE-189
https://cgit.freedesktop.org/poppler/poppler/commit/?id=9cf2325fb22f812b31858e519411f57747d39bd8
9cf2325fb22f812b31858e519411f57747d39bd8
null
SplashFTFont::~SplashFTFont() { }
SplashFTFont::~SplashFTFont() { }
CPP
poppler
0
CVE-2011-2491
https://www.cvedetails.com/cve/CVE-2011-2491/
CWE-399
https://github.com/torvalds/linux/commit/0b760113a3a155269a3fba93a409c640031dd68f
0b760113a3a155269a3fba93a409c640031dd68f
NLM: Don't hang forever on NLM unlock requests If the NLM daemon is killed on the NFS server, we can currently end up hanging forever on an 'unlock' request, instead of aborting. Basically, if the rpcbind request fails, or the server keeps returning garbage, we really want to quit instead of retrying. Tested-by: Vasily Averin <[email protected]> Signed-off-by: Trond Myklebust <[email protected]> Cc: [email protected]
rpc_xdr_buf_init(struct xdr_buf *buf, void *start, size_t len) { buf->head[0].iov_base = start; buf->head[0].iov_len = len; buf->tail[0].iov_len = 0; buf->page_len = 0; buf->flags = 0; buf->len = 0; buf->buflen = len; }
rpc_xdr_buf_init(struct xdr_buf *buf, void *start, size_t len) { buf->head[0].iov_base = start; buf->head[0].iov_len = len; buf->tail[0].iov_len = 0; buf->page_len = 0; buf->flags = 0; buf->len = 0; buf->buflen = len; }
C
linux
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 int tun_set_coalesce(struct net_device *dev, struct ethtool_coalesce *ec) { struct tun_struct *tun = netdev_priv(dev); if (ec->rx_max_coalesced_frames > NAPI_POLL_WEIGHT) tun->rx_batched = NAPI_POLL_WEIGHT; else tun->rx_batched = ec->rx_max_coalesced_frames; return 0; }
static int tun_set_coalesce(struct net_device *dev, struct ethtool_coalesce *ec) { struct tun_struct *tun = netdev_priv(dev); if (ec->rx_max_coalesced_frames > NAPI_POLL_WEIGHT) tun->rx_batched = NAPI_POLL_WEIGHT; else tun->rx_batched = ec->rx_max_coalesced_frames; return 0; }
C
linux
0
CVE-2012-2862
https://www.cvedetails.com/cve/CVE-2012-2862/
CWE-399
https://github.com/chromium/chromium/commit/c4f40933f2cd7f975af63e56ea4cdcdc6c636f73
c4f40933f2cd7f975af63e56ea4cdcdc6c636f73
accelerators: Remove deprecated Accelerator ctor that takes booleans. BUG=128242 [email protected] Review URL: https://chromiumcodereview.appspot.com/10399085 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@137957 0039d316-1c4b-4281-b951-d872f2087c98
TestTarget() : accelerator_pressed_count_(0) { }
TestTarget() : accelerator_pressed_count_(0) { }
C
Chrome
0
CVE-2019-5822
https://www.cvedetails.com/cve/CVE-2019-5822/
CWE-284
https://github.com/chromium/chromium/commit/2f81d000fdb5331121cba7ff81dfaaec25b520a5
2f81d000fdb5331121cba7ff81dfaaec25b520a5
When turning a download into a navigation, navigate the right frame Code changes from Nate Chapin <[email protected]> Bug: 926105 Change-Id: I098599394e6ebe7d2fce5af838014297a337d294 Reviewed-on: https://chromium-review.googlesource.com/c/1454962 Reviewed-by: Camille Lamy <[email protected]> Commit-Queue: Jochen Eisinger <[email protected]> Cr-Commit-Position: refs/heads/master@{#629547}
ResourceDispatcherHostImpl::CreateResourceHandler( ResourceRequesterInfo* requester_info, net::URLRequest* request, const network::ResourceRequest& request_data, int route_id, int child_id, ResourceContext* resource_context, uint32_t url_loader_options, network::mojom::URLLoaderRequest mojo_request, network::mojom::URLLoaderClientPtr url_loader_client) { DCHECK(requester_info->IsRenderer() || requester_info->IsNavigationPreload() || requester_info->IsCertificateFetcherForSignedExchange()); std::unique_ptr<ResourceHandler> handler = std::make_unique<MojoAsyncResourceHandler>( request, this, std::move(mojo_request), std::move(url_loader_client), static_cast<ResourceType>(request_data.resource_type), url_loader_options); if (request_data.resource_type == RESOURCE_TYPE_PREFETCH) { auto detachable_handler = std::make_unique<DetachableResourceHandler>( request, base::TimeDelta::FromMilliseconds(kDefaultDetachableCancelDelayMs), std::move(handler)); handler = std::move(detachable_handler); } return AddStandardHandlers( request, static_cast<ResourceType>(request_data.resource_type), resource_context, request_data.fetch_request_mode, static_cast<blink::mojom::RequestContextType>( request_data.fetch_request_context_type), url_loader_options, requester_info->appcache_service(), child_id, route_id, std::move(handler)); }
ResourceDispatcherHostImpl::CreateResourceHandler( ResourceRequesterInfo* requester_info, net::URLRequest* request, const network::ResourceRequest& request_data, int route_id, int child_id, ResourceContext* resource_context, uint32_t url_loader_options, network::mojom::URLLoaderRequest mojo_request, network::mojom::URLLoaderClientPtr url_loader_client) { DCHECK(requester_info->IsRenderer() || requester_info->IsNavigationPreload() || requester_info->IsCertificateFetcherForSignedExchange()); std::unique_ptr<ResourceHandler> handler = std::make_unique<MojoAsyncResourceHandler>( request, this, std::move(mojo_request), std::move(url_loader_client), static_cast<ResourceType>(request_data.resource_type), url_loader_options); if (request_data.resource_type == RESOURCE_TYPE_PREFETCH) { auto detachable_handler = std::make_unique<DetachableResourceHandler>( request, base::TimeDelta::FromMilliseconds(kDefaultDetachableCancelDelayMs), std::move(handler)); handler = std::move(detachable_handler); } return AddStandardHandlers( request, static_cast<ResourceType>(request_data.resource_type), resource_context, request_data.fetch_request_mode, static_cast<blink::mojom::RequestContextType>( request_data.fetch_request_context_type), url_loader_options, requester_info->appcache_service(), child_id, route_id, std::move(handler)); }
C
Chrome
0
CVE-2014-9922
https://www.cvedetails.com/cve/CVE-2014-9922/
CWE-264
https://github.com/torvalds/linux/commit/69c433ed2ecd2d3264efd7afec4439524b319121
69c433ed2ecd2d3264efd7afec4439524b319121
fs: limit filesystem stacking depth Add a simple read-only counter to super_block that indicates how deep this is in the stack of filesystems. Previously ecryptfs was the only stackable filesystem and it explicitly disallowed multiple layers of itself. Overlayfs, however, can be stacked recursively and also may be stacked on top of ecryptfs or vice versa. To limit the kernel stack usage we must limit the depth of the filesystem stack. Initially the limit is set to 2. Signed-off-by: Miklos Szeredi <[email protected]>
static void ovl_dentry_release(struct dentry *dentry) { struct ovl_entry *oe = dentry->d_fsdata; if (oe) { dput(oe->__upperdentry); dput(oe->lowerdentry); kfree_rcu(oe, rcu); } }
static void ovl_dentry_release(struct dentry *dentry) { struct ovl_entry *oe = dentry->d_fsdata; if (oe) { dput(oe->__upperdentry); dput(oe->lowerdentry); kfree_rcu(oe, rcu); } }
C
linux
0
CVE-2011-2861
https://www.cvedetails.com/cve/CVE-2011-2861/
CWE-20
https://github.com/chromium/chromium/commit/8262245d384be025f13e2a5b3a03b7e5c98374ce
8262245d384be025f13e2a5b3a03b7e5c98374ce
DevTools: move DevToolsAgent/Client into content. BUG=84078 TEST= Review URL: http://codereview.chromium.org/7461019 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@93596 0039d316-1c4b-4281-b951-d872f2087c98
void RenderView::OnZoom(PageZoom::Function function) { if (!webview()) // Not sure if this can happen, but no harm in being safe. return; webview()->hidePopups(); double old_zoom_level = webview()->zoomLevel(); double zoom_level; if (function == PageZoom::RESET) { zoom_level = 0; } else if (static_cast<int>(old_zoom_level) == old_zoom_level) { zoom_level = old_zoom_level + function; } else { if ((old_zoom_level > 1 && function > 0) || (old_zoom_level < 1 && function < 0)) { zoom_level = static_cast<int>(old_zoom_level + function); } else { zoom_level = static_cast<int>(old_zoom_level); } } webview()->setZoomLevel(false, zoom_level); zoomLevelChanged(); }
void RenderView::OnZoom(PageZoom::Function function) { if (!webview()) // Not sure if this can happen, but no harm in being safe. return; webview()->hidePopups(); double old_zoom_level = webview()->zoomLevel(); double zoom_level; if (function == PageZoom::RESET) { zoom_level = 0; } else if (static_cast<int>(old_zoom_level) == old_zoom_level) { zoom_level = old_zoom_level + function; } else { if ((old_zoom_level > 1 && function > 0) || (old_zoom_level < 1 && function < 0)) { zoom_level = static_cast<int>(old_zoom_level + function); } else { zoom_level = static_cast<int>(old_zoom_level); } } webview()->setZoomLevel(false, zoom_level); zoomLevelChanged(); }
C
Chrome
0
CVE-2011-2849
https://www.cvedetails.com/cve/CVE-2011-2849/
null
https://github.com/chromium/chromium/commit/5dc90e57abcc7f0489e7ae09a3e687e9c6f4fad5
5dc90e57abcc7f0489e7ae09a3e687e9c6f4fad5
Use ScopedRunnableMethodFactory in WebSocketJob Don't post SendPending if it is already posted. BUG=89795 TEST=none Review URL: http://codereview.chromium.org/7488007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@93599 0039d316-1c4b-4281-b951-d872f2087c98
void WebSocketJob::Wakeup() { if (!waiting_) return; waiting_ = false; DCHECK(callback_); MessageLoopForIO::current()->PostTask( FROM_HERE, method_factory_.NewRunnableMethod(&WebSocketJob::RetryPendingIO)); }
void WebSocketJob::Wakeup() { if (!waiting_) return; waiting_ = false; DCHECK(callback_); MessageLoopForIO::current()->PostTask( FROM_HERE, NewRunnableMethod(this, &WebSocketJob::RetryPendingIO)); }
C
Chrome
1
CVE-2016-1698
https://www.cvedetails.com/cve/CVE-2016-1698/
CWE-200
https://github.com/chromium/chromium/commit/5fb2548448bd1b76a59d941b729d7a7f90d53bc8
5fb2548448bd1b76a59d941b729d7a7f90d53bc8
[Extensions] Finish freezing schema BUG=604901 BUG=603725 BUG=591164 Review URL: https://codereview.chromium.org/1906593002 Cr-Commit-Position: refs/heads/master@{#388945}
v8::Extension* SafeBuiltins::CreateV8Extension() { return new ExtensionImpl(); }
v8::Extension* SafeBuiltins::CreateV8Extension() { return new ExtensionImpl(); }
C
Chrome
0
CVE-2016-5199
https://www.cvedetails.com/cve/CVE-2016-5199/
CWE-119
https://github.com/chromium/chromium/commit/c995d4fe5e96f4d6d4a88b7867279b08e72d2579
c995d4fe5e96f4d6d4a88b7867279b08e72d2579
Move IsDataSaverEnabledByUser to be a static method and use it This method now officially becomes the source of truth that everything in the code base eventually calls into to determine whether or not DataSaver is enabled. Bug: 934399 Change-Id: Iae837b710ace8cc3101188f79d02cbc2d4f0fd93 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1537242 Reviewed-by: Joshua Pawlicki <[email protected]> Reviewed-by: Tarun Bansal <[email protected]> Commit-Queue: Robert Ogden <[email protected]> Cr-Commit-Position: refs/heads/master@{#643948}
void ChromeContentBrowserClient::GetAdditionalAllowedSchemesForFileSystem( std::vector<std::string>* additional_allowed_schemes) { ContentBrowserClient::GetAdditionalAllowedSchemesForFileSystem( additional_allowed_schemes); additional_allowed_schemes->push_back(content::kChromeDevToolsScheme); additional_allowed_schemes->push_back(content::kChromeUIScheme); for (size_t i = 0; i < extra_parts_.size(); ++i) { extra_parts_[i]->GetAdditionalAllowedSchemesForFileSystem( additional_allowed_schemes); } }
void ChromeContentBrowserClient::GetAdditionalAllowedSchemesForFileSystem( std::vector<std::string>* additional_allowed_schemes) { ContentBrowserClient::GetAdditionalAllowedSchemesForFileSystem( additional_allowed_schemes); additional_allowed_schemes->push_back(content::kChromeDevToolsScheme); additional_allowed_schemes->push_back(content::kChromeUIScheme); for (size_t i = 0; i < extra_parts_.size(); ++i) { extra_parts_[i]->GetAdditionalAllowedSchemesForFileSystem( additional_allowed_schemes); } }
C
Chrome
0
CVE-2015-1278
https://www.cvedetails.com/cve/CVE-2015-1278/
CWE-254
https://github.com/chromium/chromium/commit/784f56a9c97a838448dd23f9bdc7c05fe8e639b3
784f56a9c97a838448dd23f9bdc7c05fe8e639b3
Correctly reset FP in RFHI whenever origin changes Bug: 713364 Change-Id: Id8bb923750e20f3db6fc9358b1d44120513ac95f CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_site_isolation Change-Id: Id8bb923750e20f3db6fc9358b1d44120513ac95f Reviewed-on: https://chromium-review.googlesource.com/482380 Commit-Queue: Ian Clelland <[email protected]> Reviewed-by: Charles Reis <[email protected]> Cr-Commit-Position: refs/heads/master@{#466778}
const GURL& RenderFrameHostImpl::GetLastCommittedURL() { return last_committed_url(); }
const GURL& RenderFrameHostImpl::GetLastCommittedURL() { return last_committed_url(); }
C
Chrome
0
CVE-2011-4324
https://www.cvedetails.com/cve/CVE-2011-4324/
null
https://github.com/torvalds/linux/commit/dc0b027dfadfcb8a5504f7d8052754bf8d501ab9
dc0b027dfadfcb8a5504f7d8052754bf8d501ab9
NFSv4: Convert the open and close ops to use fmode Signed-off-by: Trond Myklebust <[email protected]>
static int can_open_cached(struct nfs4_state *state, int mode) static int can_open_cached(struct nfs4_state *state, fmode_t mode, int open_mode) { int ret = 0; if (open_mode & O_EXCL) goto out; switch (mode & (FMODE_READ|FMODE_WRITE)) { case FMODE_READ: ret |= test_bit(NFS_O_RDONLY_STATE, &state->flags) != 0; break; case FMODE_WRITE: ret |= test_bit(NFS_O_WRONLY_STATE, &state->flags) != 0; break; case FMODE_READ|FMODE_WRITE: ret |= test_bit(NFS_O_RDWR_STATE, &state->flags) != 0; } out: return ret; }
static int can_open_cached(struct nfs4_state *state, int mode) { int ret = 0; switch (mode & (FMODE_READ|FMODE_WRITE|O_EXCL)) { case FMODE_READ: ret |= test_bit(NFS_O_RDONLY_STATE, &state->flags) != 0; break; case FMODE_WRITE: ret |= test_bit(NFS_O_WRONLY_STATE, &state->flags) != 0; break; case FMODE_READ|FMODE_WRITE: ret |= test_bit(NFS_O_RDWR_STATE, &state->flags) != 0; } return ret; }
C
linux
1
CVE-2013-0886
https://www.cvedetails.com/cve/CVE-2013-0886/
null
https://github.com/chromium/chromium/commit/18d67244984a574ba2dd8779faabc0e3e34f4b76
18d67244984a574ba2dd8779faabc0e3e34f4b76
Implement TextureImageTransportSurface using texture mailbox This has a couple of advantages: - allow tearing down and recreating the UI parent context without losing the renderer contexts - do not require a context to be able to generate textures when creating the GLSurfaceHandle - clearer ownership semantics that potentially allows for more robust and easier lost context handling/thumbnailing/etc., since a texture is at any given time owned by either: UI parent, mailbox, or TextureImageTransportSurface - simplify frontbuffer protection logic; the frontbuffer textures are now owned by RWHV where they are refcounted The TextureImageTransportSurface informs RenderWidgetHostView of the mailbox names for the front- and backbuffer textures by associating them with a surface_handle (1 or 2) in the AcceleratedSurfaceNew message. During SwapBuffers() or PostSubBuffer() cycles, it then uses produceTextureCHROMIUM() and consumeTextureCHROMIUM() to transfer ownership between renderer and browser compositor. RWHV sends back the surface_handle of the buffer being returned with the Swap ACK (or 0 if no buffer is being returned in which case TextureImageTransportSurface will allocate a new texture - note that this could be used to simply keep textures for thumbnailing). BUG=154815,139616 [email protected] Review URL: https://chromiumcodereview.appspot.com/11194042 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@171569 0039d316-1c4b-4281-b951-d872f2087c98
void RenderWidgetHostViewAndroid::Destroy() { if (content_view_core_) { content_view_core_->RemoveLayer(layer_); content_view_core_ = NULL; } host_ = NULL; delete this; }
void RenderWidgetHostViewAndroid::Destroy() { if (content_view_core_) { content_view_core_->RemoveLayer(layer_); content_view_core_ = NULL; } host_ = NULL; delete this; }
C
Chrome
0
CVE-2016-1666
https://www.cvedetails.com/cve/CVE-2016-1666/
null
https://github.com/chromium/chromium/commit/8b10115b2410b4bde18e094ad9fb8c5056134c87
8b10115b2410b4bde18e094ad9fb8c5056134c87
Fix ChromeResourceDispatcherHostDelegateMirrorBrowserTest.MirrorRequestHeader with network service. The functionality worked, as part of converting DICE, however the test code didn't work since it depended on accessing the net objects directly. Switch the tests to use the EmbeddedTestServer, to better match production, which removes the dependency on net/. Also: -make GetFilePathWithReplacements replace strings in the mock headers if they're present -add a global to google_util to ignore ports; that way other tests can be converted without having to modify each callsite to google_util Bug: 881976 Change-Id: Ic52023495c1c98c1248025c11cdf37f433fef058 Reviewed-on: https://chromium-review.googlesource.com/c/1328142 Commit-Queue: John Abd-El-Malek <[email protected]> Reviewed-by: Ramin Halavati <[email protected]> Reviewed-by: Maks Orlovich <[email protected]> Reviewed-by: Peter Kasting <[email protected]> Cr-Commit-Position: refs/heads/master@{#607652}
int GetTimesStandardThrottlesAddedForURL(const GURL& url) { int count; base::RunLoop run_loop; base::PostTaskWithTraitsAndReply( FROM_HERE, {content::BrowserThread::IO}, base::BindOnce( &TestDispatcherHostDelegate::GetTimesStandardThrottlesAddedForURL, base::Unretained(dispatcher_host_delegate_.get()), url, &count), run_loop.QuitClosure()); run_loop.Run(); return count; }
int GetTimesStandardThrottlesAddedForURL(const GURL& url) { int count; base::RunLoop run_loop; base::PostTaskWithTraitsAndReply( FROM_HERE, {content::BrowserThread::IO}, base::BindOnce( &TestDispatcherHostDelegate::GetTimesStandardThrottlesAddedForURL, base::Unretained(dispatcher_host_delegate_.get()), url, &count), run_loop.QuitClosure()); run_loop.Run(); return count; }
C
Chrome
0
CVE-2014-4014
https://www.cvedetails.com/cve/CVE-2014-4014/
CWE-264
https://github.com/torvalds/linux/commit/23adbe12ef7d3d4195e80800ab36b37bee28cd03
23adbe12ef7d3d4195e80800ab36b37bee28cd03
fs,userns: Change inode_capable to capable_wrt_inode_uidgid The kernel has no concept of capabilities with respect to inodes; inodes exist independently of namespaces. For example, inode_capable(inode, CAP_LINUX_IMMUTABLE) would be nonsense. This patch changes inode_capable to check for uid and gid mappings and renames it to capable_wrt_inode_uidgid, which should make it more obvious what it does. Fixes CVE-2014-4014. Cc: Theodore Ts'o <[email protected]> Cc: Serge Hallyn <[email protected]> Cc: "Eric W. Biederman" <[email protected]> Cc: Dave Chinner <[email protected]> Cc: [email protected] Signed-off-by: Andy Lutomirski <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
int invalidate_inodes(struct super_block *sb, bool kill_dirty) { int busy = 0; struct inode *inode, *next; LIST_HEAD(dispose); spin_lock(&inode_sb_list_lock); list_for_each_entry_safe(inode, next, &sb->s_inodes, i_sb_list) { spin_lock(&inode->i_lock); if (inode->i_state & (I_NEW | I_FREEING | I_WILL_FREE)) { spin_unlock(&inode->i_lock); continue; } if (inode->i_state & I_DIRTY && !kill_dirty) { spin_unlock(&inode->i_lock); busy = 1; continue; } if (atomic_read(&inode->i_count)) { spin_unlock(&inode->i_lock); busy = 1; continue; } inode->i_state |= I_FREEING; inode_lru_list_del(inode); spin_unlock(&inode->i_lock); list_add(&inode->i_lru, &dispose); } spin_unlock(&inode_sb_list_lock); dispose_list(&dispose); return busy; }
int invalidate_inodes(struct super_block *sb, bool kill_dirty) { int busy = 0; struct inode *inode, *next; LIST_HEAD(dispose); spin_lock(&inode_sb_list_lock); list_for_each_entry_safe(inode, next, &sb->s_inodes, i_sb_list) { spin_lock(&inode->i_lock); if (inode->i_state & (I_NEW | I_FREEING | I_WILL_FREE)) { spin_unlock(&inode->i_lock); continue; } if (inode->i_state & I_DIRTY && !kill_dirty) { spin_unlock(&inode->i_lock); busy = 1; continue; } if (atomic_read(&inode->i_count)) { spin_unlock(&inode->i_lock); busy = 1; continue; } inode->i_state |= I_FREEING; inode_lru_list_del(inode); spin_unlock(&inode->i_lock); list_add(&inode->i_lru, &dispose); } spin_unlock(&inode_sb_list_lock); dispose_list(&dispose); return busy; }
C
linux
0
CVE-2010-1149
https://www.cvedetails.com/cve/CVE-2010-1149/
CWE-200
https://cgit.freedesktop.org/udisks/commit/?id=0fcc7cb3b66f23fac53ae08647aa0007a2bd56c4
0fcc7cb3b66f23fac53ae08647aa0007a2bd56c4
null
device_luks_lock (Device *device, char **options, DBusGMethodInvocation *context) { uid_t unlocked_by_uid; uid_t uid; Device *cleartext_device; const gchar *action_id; daemon_local_get_uid (device->priv->daemon, &uid, context); if (device->priv->id_usage == NULL || strcmp (device->priv->id_usage, "crypto") != 0) { throw_error (context, ERROR_FAILED, "Not a LUKS crypto device"); goto out; } cleartext_device = find_cleartext_device (device); if (cleartext_device == NULL) { throw_error (context, ERROR_FAILED, "Cleartext device is not unlocked"); goto out; } if (cleartext_device->priv->dm_name == NULL || strlen (cleartext_device->priv->dm_name) == 0) { throw_error (context, ERROR_FAILED, "Cannot determine device-mapper name"); goto out; } /* see if we (e.g. udisks) set up this clear text device */ if (!luks_get_uid_from_dm_name (cleartext_device->priv->dm_name, &unlocked_by_uid)) { /* nope.. so assume uid 0 set it up.. we still allow locking * the device... given enough privilege */ unlocked_by_uid = 0; } /* require authorization if unlocked by someone else */ action_id = NULL; if (unlocked_by_uid != uid) { action_id = "org.freedesktop.udisks.luks-lock-others"; } daemon_local_check_auth (device->priv->daemon, device, action_id, "LuksLock", TRUE, device_luks_lock_authorized_cb, context, 1, g_strdupv (options), g_strfreev); out: return TRUE; }
device_luks_lock (Device *device, char **options, DBusGMethodInvocation *context) { uid_t unlocked_by_uid; uid_t uid; Device *cleartext_device; const gchar *action_id; daemon_local_get_uid (device->priv->daemon, &uid, context); if (device->priv->id_usage == NULL || strcmp (device->priv->id_usage, "crypto") != 0) { throw_error (context, ERROR_FAILED, "Not a LUKS crypto device"); goto out; } cleartext_device = find_cleartext_device (device); if (cleartext_device == NULL) { throw_error (context, ERROR_FAILED, "Cleartext device is not unlocked"); goto out; } if (cleartext_device->priv->dm_name == NULL || strlen (cleartext_device->priv->dm_name) == 0) { throw_error (context, ERROR_FAILED, "Cannot determine device-mapper name"); goto out; } /* see if we (e.g. udisks) set up this clear text device */ if (!luks_get_uid_from_dm_name (cleartext_device->priv->dm_name, &unlocked_by_uid)) { /* nope.. so assume uid 0 set it up.. we still allow locking * the device... given enough privilege */ unlocked_by_uid = 0; } /* require authorization if unlocked by someone else */ action_id = NULL; if (unlocked_by_uid != uid) { action_id = "org.freedesktop.udisks.luks-lock-others"; } daemon_local_check_auth (device->priv->daemon, device, action_id, "LuksLock", TRUE, device_luks_lock_authorized_cb, context, 1, g_strdupv (options), g_strfreev); out: return TRUE; }
C
udisks
0
CVE-2014-7905
https://www.cvedetails.com/cve/CVE-2014-7905/
CWE-284
https://github.com/chromium/chromium/commit/0d77de2f5334b6d560487c5fd696178a3bfc3551
0d77de2f5334b6d560487c5fd696178a3bfc3551
Add ThreadChecker for Ozone X11 GPU. Ensure Ozone X11 tests the same thread constraints we have in Ozone GBM. BUG=none Review-Url: https://codereview.chromium.org/2366643002 Cr-Commit-Position: refs/heads/master@{#421817}
GLSurfaceEGLOzoneX11::~GLSurfaceEGLOzoneX11() { Destroy(); }
GLSurfaceEGLOzoneX11::~GLSurfaceEGLOzoneX11() { Destroy(); }
C
Chrome
0
CVE-2014-7822
https://www.cvedetails.com/cve/CVE-2014-7822/
CWE-264
https://github.com/torvalds/linux/commit/8d0207652cbe27d1f962050737848e5ad4671958
8d0207652cbe27d1f962050737848e5ad4671958
->splice_write() via ->write_iter() iter_file_splice_write() - a ->splice_write() instance that gathers the pipe buffers, builds a bio_vec-based iov_iter covering those and feeds it to ->write_iter(). A bunch of simple cases coverted to that... [AV: fixed the braino spotted by Cyrill] Signed-off-by: Al Viro <[email protected]>
static int get_iovec_page_array(const struct iovec __user *iov, unsigned int nr_vecs, struct page **pages, struct partial_page *partial, bool aligned, unsigned int pipe_buffers) { int buffers = 0, error = 0; while (nr_vecs) { unsigned long off, npages; struct iovec entry; void __user *base; size_t len; int i; error = -EFAULT; if (copy_from_user(&entry, iov, sizeof(entry))) break; base = entry.iov_base; len = entry.iov_len; /* * Sanity check this iovec. 0 read succeeds. */ error = 0; if (unlikely(!len)) break; error = -EFAULT; if (!access_ok(VERIFY_READ, base, len)) break; /* * Get this base offset and number of pages, then map * in the user pages. */ off = (unsigned long) base & ~PAGE_MASK; /* * If asked for alignment, the offset must be zero and the * length a multiple of the PAGE_SIZE. */ error = -EINVAL; if (aligned && (off || len & ~PAGE_MASK)) break; npages = (off + len + PAGE_SIZE - 1) >> PAGE_SHIFT; if (npages > pipe_buffers - buffers) npages = pipe_buffers - buffers; error = get_user_pages_fast((unsigned long)base, npages, 0, &pages[buffers]); if (unlikely(error <= 0)) break; /* * Fill this contiguous range into the partial page map. */ for (i = 0; i < error; i++) { const int plen = min_t(size_t, len, PAGE_SIZE - off); partial[buffers].offset = off; partial[buffers].len = plen; off = 0; len -= plen; buffers++; } /* * We didn't complete this iov, stop here since it probably * means we have to move some of this into a pipe to * be able to continue. */ if (len) break; /* * Don't continue if we mapped fewer pages than we asked for, * or if we mapped the max number of pages that we have * room for. */ if (error < npages || buffers == pipe_buffers) break; nr_vecs--; iov++; } if (buffers) return buffers; return error; }
static int get_iovec_page_array(const struct iovec __user *iov, unsigned int nr_vecs, struct page **pages, struct partial_page *partial, bool aligned, unsigned int pipe_buffers) { int buffers = 0, error = 0; while (nr_vecs) { unsigned long off, npages; struct iovec entry; void __user *base; size_t len; int i; error = -EFAULT; if (copy_from_user(&entry, iov, sizeof(entry))) break; base = entry.iov_base; len = entry.iov_len; /* * Sanity check this iovec. 0 read succeeds. */ error = 0; if (unlikely(!len)) break; error = -EFAULT; if (!access_ok(VERIFY_READ, base, len)) break; /* * Get this base offset and number of pages, then map * in the user pages. */ off = (unsigned long) base & ~PAGE_MASK; /* * If asked for alignment, the offset must be zero and the * length a multiple of the PAGE_SIZE. */ error = -EINVAL; if (aligned && (off || len & ~PAGE_MASK)) break; npages = (off + len + PAGE_SIZE - 1) >> PAGE_SHIFT; if (npages > pipe_buffers - buffers) npages = pipe_buffers - buffers; error = get_user_pages_fast((unsigned long)base, npages, 0, &pages[buffers]); if (unlikely(error <= 0)) break; /* * Fill this contiguous range into the partial page map. */ for (i = 0; i < error; i++) { const int plen = min_t(size_t, len, PAGE_SIZE - off); partial[buffers].offset = off; partial[buffers].len = plen; off = 0; len -= plen; buffers++; } /* * We didn't complete this iov, stop here since it probably * means we have to move some of this into a pipe to * be able to continue. */ if (len) break; /* * Don't continue if we mapped fewer pages than we asked for, * or if we mapped the max number of pages that we have * room for. */ if (error < npages || buffers == pipe_buffers) break; nr_vecs--; iov++; } if (buffers) return buffers; return error; }
C
linux
0
CVE-2012-2816
https://www.cvedetails.com/cve/CVE-2012-2816/
null
https://github.com/chromium/chromium/commit/cd0bd79d6ebdb72183e6f0833673464cc10b3600
cd0bd79d6ebdb72183e6f0833673464cc10b3600
Convert plugin and GPU process to brokered handle duplication. BUG=119250 Review URL: https://chromiumcodereview.appspot.com/9958034 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@132303 0039d316-1c4b-4281-b951-d872f2087c98
void GpuVideoDecodeAccelerator::OnDecode( base::SharedMemoryHandle handle, int32 id, int32 size) { DCHECK(video_decode_accelerator_.get()); video_decode_accelerator_->Decode(media::BitstreamBuffer(id, handle, size)); }
void GpuVideoDecodeAccelerator::OnDecode( base::SharedMemoryHandle handle, int32 id, int32 size) { DCHECK(video_decode_accelerator_.get()); video_decode_accelerator_->Decode(media::BitstreamBuffer(id, handle, size)); }
C
Chrome
0
CVE-2019-11810
https://www.cvedetails.com/cve/CVE-2019-11810/
CWE-476
https://github.com/torvalds/linux/commit/bcf3b67d16a4c8ffae0aa79de5853435e683945c
bcf3b67d16a4c8ffae0aa79de5853435e683945c
scsi: megaraid_sas: return error when create DMA pool failed when create DMA pool for cmd frames failed, we should return -ENOMEM, instead of 0. In some case in: megasas_init_adapter_fusion() -->megasas_alloc_cmds() -->megasas_create_frame_pool create DMA pool failed, --> megasas_free_cmds() [1] -->megasas_alloc_cmds_fusion() failed, then goto fail_alloc_cmds. -->megasas_free_cmds() [2] we will call megasas_free_cmds twice, [1] will kfree cmd_list, [2] will use cmd_list.it will cause a problem: Unable to handle kernel NULL pointer dereference at virtual address 00000000 pgd = ffffffc000f70000 [00000000] *pgd=0000001fbf893003, *pud=0000001fbf893003, *pmd=0000001fbf894003, *pte=006000006d000707 Internal error: Oops: 96000005 [#1] SMP Modules linked in: CPU: 18 PID: 1 Comm: swapper/0 Not tainted task: ffffffdfb9290000 ti: ffffffdfb923c000 task.ti: ffffffdfb923c000 PC is at megasas_free_cmds+0x30/0x70 LR is at megasas_free_cmds+0x24/0x70 ... Call trace: [<ffffffc0005b779c>] megasas_free_cmds+0x30/0x70 [<ffffffc0005bca74>] megasas_init_adapter_fusion+0x2f4/0x4d8 [<ffffffc0005b926c>] megasas_init_fw+0x2dc/0x760 [<ffffffc0005b9ab0>] megasas_probe_one+0x3c0/0xcd8 [<ffffffc0004a5abc>] local_pci_probe+0x4c/0xb4 [<ffffffc0004a5c40>] pci_device_probe+0x11c/0x14c [<ffffffc00053a5e4>] driver_probe_device+0x1ec/0x430 [<ffffffc00053a92c>] __driver_attach+0xa8/0xb0 [<ffffffc000538178>] bus_for_each_dev+0x74/0xc8 [<ffffffc000539e88>] driver_attach+0x28/0x34 [<ffffffc000539a18>] bus_add_driver+0x16c/0x248 [<ffffffc00053b234>] driver_register+0x6c/0x138 [<ffffffc0004a5350>] __pci_register_driver+0x5c/0x6c [<ffffffc000ce3868>] megasas_init+0xc0/0x1a8 [<ffffffc000082a58>] do_one_initcall+0xe8/0x1ec [<ffffffc000ca7be8>] kernel_init_freeable+0x1c8/0x284 [<ffffffc0008d90b8>] kernel_init+0x1c/0xe4 Signed-off-by: Jason Yan <[email protected]> Acked-by: Sumit Saxena <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
megasas_build_and_issue_cmd(struct megasas_instance *instance, struct scsi_cmnd *scmd) { struct megasas_cmd *cmd; u32 frame_count; cmd = megasas_get_cmd(instance); if (!cmd) return SCSI_MLQUEUE_HOST_BUSY; /* * Logical drive command */ if (megasas_cmd_type(scmd) == READ_WRITE_LDIO) frame_count = megasas_build_ldio(instance, scmd, cmd); else frame_count = megasas_build_dcdb(instance, scmd, cmd); if (!frame_count) goto out_return_cmd; cmd->scmd = scmd; scmd->SCp.ptr = (char *)cmd; /* * Issue the command to the FW */ atomic_inc(&instance->fw_outstanding); instance->instancet->fire_cmd(instance, cmd->frame_phys_addr, cmd->frame_count-1, instance->reg_set); return 0; out_return_cmd: megasas_return_cmd(instance, cmd); return SCSI_MLQUEUE_HOST_BUSY; }
megasas_build_and_issue_cmd(struct megasas_instance *instance, struct scsi_cmnd *scmd) { struct megasas_cmd *cmd; u32 frame_count; cmd = megasas_get_cmd(instance); if (!cmd) return SCSI_MLQUEUE_HOST_BUSY; /* * Logical drive command */ if (megasas_cmd_type(scmd) == READ_WRITE_LDIO) frame_count = megasas_build_ldio(instance, scmd, cmd); else frame_count = megasas_build_dcdb(instance, scmd, cmd); if (!frame_count) goto out_return_cmd; cmd->scmd = scmd; scmd->SCp.ptr = (char *)cmd; /* * Issue the command to the FW */ atomic_inc(&instance->fw_outstanding); instance->instancet->fire_cmd(instance, cmd->frame_phys_addr, cmd->frame_count-1, instance->reg_set); return 0; out_return_cmd: megasas_return_cmd(instance, cmd); return SCSI_MLQUEUE_HOST_BUSY; }
C
linux
0
CVE-2014-3179
https://www.cvedetails.com/cve/CVE-2014-3179/
null
https://github.com/chromium/chromium/commit/d800220da9f744779f1989e2092c88770adcd20a
d800220da9f744779f1989e2092c88770adcd20a
Remove blink::ReadableStream This CL removes two stable runtime enabled flags - ResponseConstructedWithReadableStream - ResponseBodyWithV8ExtraStream and related code including blink::ReadableStream. BUG=613435 Review-Url: https://codereview.chromium.org/2227403002 Cr-Commit-Position: refs/heads/master@{#411014}
ExecutionContext* getExecutionContext() { return getScriptState()->getExecutionContext(); }
ExecutionContext* getExecutionContext() { return getScriptState()->getExecutionContext(); }
C
Chrome
0
CVE-2014-9644
https://www.cvedetails.com/cve/CVE-2014-9644/
CWE-264
https://github.com/torvalds/linux/commit/4943ba16bbc2db05115707b3ff7b4874e9e3c560
4943ba16bbc2db05115707b3ff7b4874e9e3c560
crypto: include crypto- module prefix in template This adds the module loading prefix "crypto-" to the template lookup as well. For example, attempting to load 'vfat(blowfish)' via AF_ALG now correctly includes the "crypto-" prefix at every level, correctly rejecting "vfat": net-pf-38 algif-hash crypto-vfat(blowfish) crypto-vfat(blowfish)-all crypto-vfat Reported-by: Mathias Krause <[email protected]> Signed-off-by: Kees Cook <[email protected]> Acked-by: Mathias Krause <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
static void __gcm_hash_assoc_remain_done(struct aead_request *req, int err) { struct crypto_gcm_req_priv_ctx *pctx = crypto_gcm_reqctx(req); struct crypto_gcm_ghash_ctx *gctx = &pctx->ghash_ctx; crypto_completion_t compl; unsigned int remain = 0; if (!err && gctx->cryptlen) { remain = gcm_remain(gctx->cryptlen); compl = remain ? gcm_hash_crypt_done : gcm_hash_crypt_remain_done; err = gcm_hash_update(req, pctx, compl, gctx->src, gctx->cryptlen); if (err == -EINPROGRESS || err == -EBUSY) return; } if (remain) __gcm_hash_crypt_done(req, err); else __gcm_hash_crypt_remain_done(req, err); }
static void __gcm_hash_assoc_remain_done(struct aead_request *req, int err) { struct crypto_gcm_req_priv_ctx *pctx = crypto_gcm_reqctx(req); struct crypto_gcm_ghash_ctx *gctx = &pctx->ghash_ctx; crypto_completion_t compl; unsigned int remain = 0; if (!err && gctx->cryptlen) { remain = gcm_remain(gctx->cryptlen); compl = remain ? gcm_hash_crypt_done : gcm_hash_crypt_remain_done; err = gcm_hash_update(req, pctx, compl, gctx->src, gctx->cryptlen); if (err == -EINPROGRESS || err == -EBUSY) return; } if (remain) __gcm_hash_crypt_done(req, err); else __gcm_hash_crypt_remain_done(req, err); }
C
linux
0
CVE-2018-17206
https://www.cvedetails.com/cve/CVE-2018-17206/
null
https://github.com/openvswitch/ovs/commit/9237a63c47bd314b807cda0bd2216264e82edbe8
9237a63c47bd314b807cda0bd2216264e82edbe8
ofp-actions: Avoid buffer overread in BUNDLE action decoding. Reported-at: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=9052 Signed-off-by: Ben Pfaff <[email protected]> Acked-by: Justin Pettit <[email protected]>
ovs_instruction_type_from_ofpact_type(enum ofpact_type type) { switch (type) { case OFPACT_METER: return OVSINST_OFPIT13_METER; case OFPACT_CLEAR_ACTIONS: return OVSINST_OFPIT11_CLEAR_ACTIONS; case OFPACT_WRITE_ACTIONS: return OVSINST_OFPIT11_WRITE_ACTIONS; case OFPACT_WRITE_METADATA: return OVSINST_OFPIT11_WRITE_METADATA; case OFPACT_GOTO_TABLE: return OVSINST_OFPIT11_GOTO_TABLE; case OFPACT_OUTPUT: case OFPACT_GROUP: case OFPACT_CLONE: case OFPACT_CONTROLLER: case OFPACT_ENQUEUE: case OFPACT_OUTPUT_REG: case OFPACT_OUTPUT_TRUNC: case OFPACT_BUNDLE: case OFPACT_SET_VLAN_VID: case OFPACT_SET_VLAN_PCP: case OFPACT_STRIP_VLAN: case OFPACT_PUSH_VLAN: case OFPACT_SET_ETH_SRC: case OFPACT_SET_ETH_DST: case OFPACT_SET_IPV4_SRC: case OFPACT_SET_IPV4_DST: case OFPACT_SET_IP_DSCP: case OFPACT_SET_IP_ECN: case OFPACT_SET_IP_TTL: case OFPACT_SET_L4_SRC_PORT: case OFPACT_SET_L4_DST_PORT: case OFPACT_REG_MOVE: case OFPACT_SET_FIELD: case OFPACT_STACK_PUSH: case OFPACT_STACK_POP: case OFPACT_DEC_TTL: case OFPACT_SET_MPLS_LABEL: case OFPACT_SET_MPLS_TC: case OFPACT_SET_MPLS_TTL: case OFPACT_DEC_MPLS_TTL: case OFPACT_PUSH_MPLS: case OFPACT_POP_MPLS: case OFPACT_SET_TUNNEL: case OFPACT_SET_QUEUE: case OFPACT_POP_QUEUE: case OFPACT_FIN_TIMEOUT: case OFPACT_RESUBMIT: case OFPACT_LEARN: case OFPACT_CONJUNCTION: case OFPACT_MULTIPATH: case OFPACT_NOTE: case OFPACT_EXIT: case OFPACT_UNROLL_XLATE: case OFPACT_SAMPLE: case OFPACT_DEBUG_RECIRC: case OFPACT_CT: case OFPACT_CT_CLEAR: case OFPACT_NAT: default: return OVSINST_OFPIT11_APPLY_ACTIONS; } }
ovs_instruction_type_from_ofpact_type(enum ofpact_type type) { switch (type) { case OFPACT_METER: return OVSINST_OFPIT13_METER; case OFPACT_CLEAR_ACTIONS: return OVSINST_OFPIT11_CLEAR_ACTIONS; case OFPACT_WRITE_ACTIONS: return OVSINST_OFPIT11_WRITE_ACTIONS; case OFPACT_WRITE_METADATA: return OVSINST_OFPIT11_WRITE_METADATA; case OFPACT_GOTO_TABLE: return OVSINST_OFPIT11_GOTO_TABLE; case OFPACT_OUTPUT: case OFPACT_GROUP: case OFPACT_CLONE: case OFPACT_CONTROLLER: case OFPACT_ENQUEUE: case OFPACT_OUTPUT_REG: case OFPACT_OUTPUT_TRUNC: case OFPACT_BUNDLE: case OFPACT_SET_VLAN_VID: case OFPACT_SET_VLAN_PCP: case OFPACT_STRIP_VLAN: case OFPACT_PUSH_VLAN: case OFPACT_SET_ETH_SRC: case OFPACT_SET_ETH_DST: case OFPACT_SET_IPV4_SRC: case OFPACT_SET_IPV4_DST: case OFPACT_SET_IP_DSCP: case OFPACT_SET_IP_ECN: case OFPACT_SET_IP_TTL: case OFPACT_SET_L4_SRC_PORT: case OFPACT_SET_L4_DST_PORT: case OFPACT_REG_MOVE: case OFPACT_SET_FIELD: case OFPACT_STACK_PUSH: case OFPACT_STACK_POP: case OFPACT_DEC_TTL: case OFPACT_SET_MPLS_LABEL: case OFPACT_SET_MPLS_TC: case OFPACT_SET_MPLS_TTL: case OFPACT_DEC_MPLS_TTL: case OFPACT_PUSH_MPLS: case OFPACT_POP_MPLS: case OFPACT_SET_TUNNEL: case OFPACT_SET_QUEUE: case OFPACT_POP_QUEUE: case OFPACT_FIN_TIMEOUT: case OFPACT_RESUBMIT: case OFPACT_LEARN: case OFPACT_CONJUNCTION: case OFPACT_MULTIPATH: case OFPACT_NOTE: case OFPACT_EXIT: case OFPACT_UNROLL_XLATE: case OFPACT_SAMPLE: case OFPACT_DEBUG_RECIRC: case OFPACT_CT: case OFPACT_CT_CLEAR: case OFPACT_NAT: default: return OVSINST_OFPIT11_APPLY_ACTIONS; } }
C
ovs
0
CVE-2018-16078
https://www.cvedetails.com/cve/CVE-2018-16078/
null
https://github.com/chromium/chromium/commit/b025e82307a8490501bb030266cd955c391abcb7
b025e82307a8490501bb030266cd955c391abcb7
[AF] Don't simplify/dedupe suggestions for (partially) filled sections. Since Autofill does not fill field by field anymore, this simplifying and deduping of suggestions is not useful anymore. Bug: 858820 Cq-Include-Trybots: luci.chromium.try:ios-simulator-full-configs;master.tryserver.chromium.mac:ios-simulator-cronet Change-Id: I36f7cfe425a0bdbf5ba7503a3d96773b405cc19b Reviewed-on: https://chromium-review.googlesource.com/1128255 Reviewed-by: Roger McFarlane <[email protected]> Commit-Queue: Sebastien Seguin-Gagnon <[email protected]> Cr-Commit-Position: refs/heads/master@{#573315}
void VerifySubmitFormUkm(const ukm::TestAutoSetUkmRecorder& ukm_recorder, const FormData& form, AutofillMetrics::AutofillFormSubmittedState state, bool is_for_credit_card, const std::set<FormType>& form_types) { VerifyFormInteractionUkm( ukm_recorder, form, UkmFormSubmittedType::kEntryName, {{{UkmFormSubmittedType::kAutofillFormSubmittedStateName, state}, {UkmSuggestionFilledType::kMillisecondsSinceFormParsedName, 0}, {UkmFormSubmittedType::kIsForCreditCardName, is_for_credit_card}, {UkmFormSubmittedType::kFormTypesName, AutofillMetrics::FormTypesToBitVector(form_types)}, {UkmFormSubmittedType::kFormSignatureName, Collapse(CalculateFormSignature(form))}}}); }
void VerifySubmitFormUkm(const ukm::TestAutoSetUkmRecorder& ukm_recorder, const FormData& form, AutofillMetrics::AutofillFormSubmittedState state, bool is_for_credit_card, const std::set<FormType>& form_types) { VerifyFormInteractionUkm( ukm_recorder, form, UkmFormSubmittedType::kEntryName, {{{UkmFormSubmittedType::kAutofillFormSubmittedStateName, state}, {UkmSuggestionFilledType::kMillisecondsSinceFormParsedName, 0}, {UkmFormSubmittedType::kIsForCreditCardName, is_for_credit_card}, {UkmFormSubmittedType::kFormTypesName, AutofillMetrics::FormTypesToBitVector(form_types)}, {UkmFormSubmittedType::kFormSignatureName, Collapse(CalculateFormSignature(form))}}}); }
C
Chrome
0
CVE-2018-20456
https://www.cvedetails.com/cve/CVE-2018-20456/
CWE-125
https://github.com/radare/radare2/commit/9b46d38dd3c4de6048a488b655c7319f845af185
9b46d38dd3c4de6048a488b655c7319f845af185
Fix #12372 and #12373 - Crash in x86 assembler (#12380) 0 ,0,[bP-bL-bP-bL-bL-r-bL-bP-bL-bL- mov ,0,[ax+Bx-ax+Bx-ax+ax+Bx-ax+Bx-- leA ,0,[bP-bL-bL-bP-bL-bP-bL-60@bL- leA ,0,[bP-bL-r-bP-bL-bP-bL-60@bL- mov ,0,[ax+Bx-ax+Bx-ax+ax+Bx-ax+Bx--
static int oprep(RAsm *a, ut8 *data, const Opcode *op) { int l = 0; LookupTable *lt_ptr; int retval; if (!strcmp (op->mnemonic, "rep") || !strcmp (op->mnemonic, "repe") || !strcmp (op->mnemonic, "repz")) { data[l++] = 0xf3; } else if (!strcmp (op->mnemonic, "repne") || !strcmp (op->mnemonic, "repnz")) { data[l++] = 0xf2; } Opcode instr = {0}; parseOpcode (a, op->operands[0].rep_op, &instr); for (lt_ptr = oplookup; strcmp (lt_ptr->mnemonic, "null"); lt_ptr++) { if (!r_str_casecmp (instr.mnemonic, lt_ptr->mnemonic)) { if (lt_ptr->opcode > 0) { if (lt_ptr->only_x32 && a->bits == 64) { free (instr.mnemonic); return -1; } ut8 *ptr = (ut8 *)&lt_ptr->opcode; int i = 0; for (; i < lt_ptr->size; i++) { data[i + l] = ptr[lt_ptr->size - (i + 1)]; } free (instr.mnemonic); return l + lt_ptr->size; } else { if (lt_ptr->opdo) { data += l; if (instr.has_bnd) { data[l] = 0xf2; data++; } retval = lt_ptr->opdo (a, data, &instr); if (instr.has_bnd) { retval++; } return l + retval; } break; } } } free (instr.mnemonic); return -1; }
static int oprep(RAsm *a, ut8 *data, const Opcode *op) { int l = 0; LookupTable *lt_ptr; int retval; if (!strcmp (op->mnemonic, "rep") || !strcmp (op->mnemonic, "repe") || !strcmp (op->mnemonic, "repz")) { data[l++] = 0xf3; } else if (!strcmp (op->mnemonic, "repne") || !strcmp (op->mnemonic, "repnz")) { data[l++] = 0xf2; } Opcode instr = {0}; parseOpcode (a, op->operands[0].rep_op, &instr); for (lt_ptr = oplookup; strcmp (lt_ptr->mnemonic, "null"); lt_ptr++) { if (!r_str_casecmp (instr.mnemonic, lt_ptr->mnemonic)) { if (lt_ptr->opcode > 0) { if (lt_ptr->only_x32 && a->bits == 64) { free (instr.mnemonic); return -1; } ut8 *ptr = (ut8 *)&lt_ptr->opcode; int i = 0; for (; i < lt_ptr->size; i++) { data[i + l] = ptr[lt_ptr->size - (i + 1)]; } free (instr.mnemonic); return l + lt_ptr->size; } else { if (lt_ptr->opdo) { data += l; if (instr.has_bnd) { data[l] = 0xf2; data++; } retval = lt_ptr->opdo (a, data, &instr); if (instr.has_bnd) { retval++; } return l + retval; } break; } } } free (instr.mnemonic); return -1; }
C
radare2
0
CVE-2017-5042
https://www.cvedetails.com/cve/CVE-2017-5042/
CWE-311
https://github.com/chromium/chromium/commit/7cde8513c12a6e8ec5d1d1eb1cfd078d9adad3ef
7cde8513c12a6e8ec5d1d1eb1cfd078d9adad3ef
Revert "PageInfo: decouple safe browsing and TLS statii." This reverts commit ee95bc44021230127c7e6e9a8cf9d3820760f77c. Reason for revert: suspect causing unit_tests failure on Linux MSAN Tests: https://ci.chromium.org/p/chromium/builders/ci/Linux%20MSan%20Tests/17649 PageInfoBubbleViewTest.ChangingFlashSettingForSiteIsRemembered PageInfoBubbleViewTest.EnsureCloseCallback PageInfoBubbleViewTest.NotificationPermissionRevokeUkm PageInfoBubbleViewTest.OpenPageInfoBubbleAfterNavigationStart PageInfoBubbleViewTest.SetPermissionInfo PageInfoBubbleViewTest.SetPermissionInfoForUsbGuard PageInfoBubbleViewTest.SetPermissionInfoWithPolicyUsbDevices PageInfoBubbleViewTest.SetPermissionInfoWithUsbDevice PageInfoBubbleViewTest.SetPermissionInfoWithUserAndPolicyUsbDevices PageInfoBubbleViewTest.UpdatingSiteDataRetainsLayout https://logs.chromium.org/logs/chromium/buildbucket/cr-buildbucket.appspot.com/8909718923797040064/+/steps/unit_tests/0/logs/Deterministic_failure:_PageInfoBubbleViewTest.ChangingFlashSettingForSiteIsRemembered__status_CRASH_/0 [ RUN ] PageInfoBubbleViewTest.ChangingFlashSettingForSiteIsRemembered ==9056==WARNING: MemorySanitizer: use-of-uninitialized-value #0 0x561baaab15ec in PageInfoUI::GetSecurityDescription(PageInfoUI::IdentityInfo const&) const ./../../chrome/browser/ui/page_info/page_info_ui.cc:250:3 #1 0x561bab6a1548 in PageInfoBubbleView::SetIdentityInfo(PageInfoUI::IdentityInfo const&) ./../../chrome/browser/ui/views/page_info/page_info_bubble_view.cc:802:7 #2 0x561baaaab3bb in PageInfo::PresentSiteIdentity() ./../../chrome/browser/ui/page_info/page_info.cc:969:8 #3 0x561baaaa0a21 in PageInfo::PageInfo(PageInfoUI*, Profile*, TabSpecificContentSettings*, content::WebContents*, GURL const&, security_state::SecurityLevel, security_state::VisibleSecurityState const&) ./../../chrome/browser/ui/page_info/page_info.cc:344:3 #4 0x561bab69b6dd in PageInfoBubbleView::PageInfoBubbleView(views::View*, gfx::Rect const&, aura::Window*, Profile*, content::WebContents*, GURL const&, security_state::SecurityLevel, security_state::VisibleSecurityState const&, base::OnceCallback<void (views::Widget::ClosedReason, bool)>) ./../../chrome/browser/ui/views/page_info/page_info_bubble_view.cc:576:24 ... Original change's description: > PageInfo: decouple safe browsing and TLS statii. > > Previously, the Page Info bubble maintained a single variable to > identify all reasons that a page might have a non-standard status. This > lead to the display logic making assumptions about, for instance, the > validity of a certificate when the page was flagged by Safe Browsing. > > This CL separates out the Safe Browsing status from the site identity > status so that the page info bubble can inform the user that the site's > certificate is invalid, even if it's also flagged by Safe Browsing. > > Bug: 869925 > Change-Id: I34107225b4206c8f32771ccd75e9367668d0a72b > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1662537 > Reviewed-by: Mustafa Emre Acer <[email protected]> > Reviewed-by: Bret Sepulveda <[email protected]> > Auto-Submit: Joe DeBlasio <[email protected]> > Commit-Queue: Joe DeBlasio <[email protected]> > Cr-Commit-Position: refs/heads/master@{#671847} [email protected],[email protected],[email protected] Change-Id: I8be652952e7276bcc9266124693352e467159cc4 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: 869925 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1673985 Reviewed-by: Takashi Sakamoto <[email protected]> Commit-Queue: Takashi Sakamoto <[email protected]> Cr-Commit-Position: refs/heads/master@{#671932}
void PageInfo::ComputeUIInputs( const GURL& url, security_state::SecurityLevel security_level, const security_state::VisibleSecurityState& visible_security_state) { #if !defined(OS_ANDROID) DCHECK(!url.SchemeIs(content::kChromeUIScheme) && !url.SchemeIs(content::kChromeDevToolsScheme) && !url.SchemeIs(content::kViewSourceScheme) && !url.SchemeIs(content_settings::kExtensionScheme)); #endif bool is_chrome_ui_native_scheme = false; #if defined(OS_ANDROID) is_chrome_ui_native_scheme = url.SchemeIs(chrome::kChromeUINativeScheme); #endif security_level_ = security_level; if (url.SchemeIs(url::kAboutScheme)) { DCHECK_EQ(url::kAboutBlankURL, url.spec()); site_identity_status_ = SITE_IDENTITY_STATUS_NO_CERT; site_identity_details_ = l10n_util::GetStringUTF16(IDS_PAGE_INFO_SECURITY_TAB_INSECURE_IDENTITY); site_connection_status_ = SITE_CONNECTION_STATUS_UNENCRYPTED; site_connection_details_ = l10n_util::GetStringFUTF16( IDS_PAGE_INFO_SECURITY_TAB_NOT_ENCRYPTED_CONNECTION_TEXT, UTF8ToUTF16(url.spec())); return; } if (url.SchemeIs(content::kChromeUIScheme) || is_chrome_ui_native_scheme) { site_identity_status_ = SITE_IDENTITY_STATUS_INTERNAL_PAGE; site_identity_details_ = l10n_util::GetStringUTF16(IDS_PAGE_INFO_INTERNAL_PAGE); site_connection_status_ = SITE_CONNECTION_STATUS_INTERNAL_PAGE; return; } certificate_ = visible_security_state.certificate; if (visible_security_state.malicious_content_status != security_state::MALICIOUS_CONTENT_STATUS_NONE) { // The site has been flagged by Safe Browsing as dangerous. GetSiteIdentityByMaliciousContentStatus( visible_security_state.malicious_content_status, &site_identity_status_, &site_identity_details_); #if defined(FULL_SAFE_BROWSING) bool old_show_change_pw_buttons = show_change_password_buttons_; #endif show_change_password_buttons_ = (visible_security_state.malicious_content_status == security_state::MALICIOUS_CONTENT_STATUS_SIGN_IN_PASSWORD_REUSE || visible_security_state.malicious_content_status == security_state:: MALICIOUS_CONTENT_STATUS_ENTERPRISE_PASSWORD_REUSE); #if defined(FULL_SAFE_BROWSING) // Only record password reuse when adding the button, not on updates. if (show_change_password_buttons_ && !old_show_change_pw_buttons) { RecordPasswordReuseEvent(); } #endif } else if (certificate_ && (!net::IsCertStatusError(visible_security_state.cert_status) || net::IsCertStatusMinorError( visible_security_state.cert_status))) { if (security_level == security_state::SECURE_WITH_POLICY_INSTALLED_CERT) { #if defined(OS_CHROMEOS) site_identity_status_ = SITE_IDENTITY_STATUS_ADMIN_PROVIDED_CERT; site_identity_details_ = l10n_util::GetStringFUTF16( IDS_CERT_POLICY_PROVIDED_CERT_MESSAGE, UTF8ToUTF16(url.host())); #else DCHECK(false) << "Policy certificates exist only on ChromeOS"; #endif } else if (net::IsCertStatusMinorError( visible_security_state.cert_status)) { site_identity_status_ = SITE_IDENTITY_STATUS_CERT_REVOCATION_UNKNOWN; base::string16 issuer_name( UTF8ToUTF16(certificate_->issuer().GetDisplayName())); if (issuer_name.empty()) { issuer_name.assign(l10n_util::GetStringUTF16( IDS_PAGE_INFO_SECURITY_TAB_UNKNOWN_PARTY)); } site_identity_details_.assign(l10n_util::GetStringFUTF16( IDS_PAGE_INFO_SECURITY_TAB_SECURE_IDENTITY_VERIFIED, issuer_name)); site_identity_details_ += ASCIIToUTF16("\n\n"); if (visible_security_state.cert_status & net::CERT_STATUS_UNABLE_TO_CHECK_REVOCATION) { site_identity_details_ += l10n_util::GetStringUTF16( IDS_PAGE_INFO_SECURITY_TAB_UNABLE_TO_CHECK_REVOCATION); } else if (visible_security_state.cert_status & net::CERT_STATUS_NO_REVOCATION_MECHANISM) { site_identity_details_ += l10n_util::GetStringUTF16( IDS_PAGE_INFO_SECURITY_TAB_NO_REVOCATION_MECHANISM); } else { NOTREACHED() << "Need to specify string for this warning"; } } else { if (visible_security_state.cert_status & net::CERT_STATUS_IS_EV) { site_identity_status_ = SITE_IDENTITY_STATUS_EV_CERT; DCHECK(!certificate_->subject().organization_names.empty()); organization_name_ = UTF8ToUTF16(certificate_->subject().organization_names[0]); DCHECK(!certificate_->subject().locality_name.empty()); DCHECK(!certificate_->subject().country_name.empty()); site_identity_details_.assign(l10n_util::GetStringFUTF16( IDS_PAGE_INFO_SECURITY_TAB_SECURE_IDENTITY_EV_VERIFIED, organization_name_, UTF8ToUTF16(certificate_->subject().country_name))); } else { site_identity_status_ = SITE_IDENTITY_STATUS_CERT; base::string16 issuer_name( UTF8ToUTF16(certificate_->issuer().GetDisplayName())); if (issuer_name.empty()) { issuer_name.assign(l10n_util::GetStringUTF16( IDS_PAGE_INFO_SECURITY_TAB_UNKNOWN_PARTY)); } site_identity_details_.assign(l10n_util::GetStringFUTF16( IDS_PAGE_INFO_SECURITY_TAB_SECURE_IDENTITY_VERIFIED, issuer_name)); } if (security_state::IsSHA1InChain(visible_security_state)) { site_identity_status_ = SITE_IDENTITY_STATUS_DEPRECATED_SIGNATURE_ALGORITHM; site_identity_details_ += UTF8ToUTF16("\n\n") + l10n_util::GetStringUTF16( IDS_PAGE_INFO_SECURITY_TAB_DEPRECATED_SIGNATURE_ALGORITHM); } } } else { site_identity_details_.assign(l10n_util::GetStringUTF16( IDS_PAGE_INFO_SECURITY_TAB_INSECURE_IDENTITY)); if (!security_state::IsSchemeCryptographic(visible_security_state.url) || !visible_security_state.certificate) { site_identity_status_ = SITE_IDENTITY_STATUS_NO_CERT; } else { site_identity_status_ = SITE_IDENTITY_STATUS_ERROR; } const base::string16 bullet = UTF8ToUTF16("\n • "); std::vector<ssl_errors::ErrorInfo> errors; ssl_errors::ErrorInfo::GetErrorsForCertStatus( certificate_, visible_security_state.cert_status, url, &errors); for (size_t i = 0; i < errors.size(); ++i) { site_identity_details_ += bullet; site_identity_details_ += errors[i].short_description(); } if (visible_security_state.cert_status & net::CERT_STATUS_NON_UNIQUE_NAME) { site_identity_details_ += ASCIIToUTF16("\n\n"); site_identity_details_ += l10n_util::GetStringUTF16(IDS_PAGE_INFO_SECURITY_TAB_NON_UNIQUE_NAME); } } site_connection_status_ = SITE_CONNECTION_STATUS_UNKNOWN; base::string16 subject_name(GetSimpleSiteName(url)); if (subject_name.empty()) { subject_name.assign( l10n_util::GetStringUTF16(IDS_PAGE_INFO_SECURITY_TAB_UNKNOWN_PARTY)); } if (!visible_security_state.certificate || !security_state::IsSchemeCryptographic(visible_security_state.url)) { site_connection_status_ = SITE_CONNECTION_STATUS_UNENCRYPTED; site_connection_details_.assign(l10n_util::GetStringFUTF16( IDS_PAGE_INFO_SECURITY_TAB_NOT_ENCRYPTED_CONNECTION_TEXT, subject_name)); } else if (!visible_security_state.connection_info_initialized) { DCHECK_NE(security_level, security_state::NONE); site_connection_status_ = SITE_CONNECTION_STATUS_ENCRYPTED_ERROR; } else { site_connection_status_ = SITE_CONNECTION_STATUS_ENCRYPTED; if (net::ObsoleteSSLStatus( visible_security_state.connection_status, visible_security_state.peer_signature_algorithm) == net::OBSOLETE_SSL_NONE) { site_connection_details_.assign(l10n_util::GetStringFUTF16( IDS_PAGE_INFO_SECURITY_TAB_ENCRYPTED_CONNECTION_TEXT, subject_name)); } else { site_connection_details_.assign(l10n_util::GetStringFUTF16( IDS_PAGE_INFO_SECURITY_TAB_WEAK_ENCRYPTION_CONNECTION_TEXT, subject_name)); } ReportAnyInsecureContent(visible_security_state, &site_connection_status_, &site_connection_details_); } uint16_t cipher_suite = net::SSLConnectionStatusToCipherSuite( visible_security_state.connection_status); if (visible_security_state.connection_info_initialized && cipher_suite) { int ssl_version = net::SSLConnectionStatusToVersion( visible_security_state.connection_status); const char* ssl_version_str; net::SSLVersionToString(&ssl_version_str, ssl_version); site_connection_details_ += ASCIIToUTF16("\n\n"); site_connection_details_ += l10n_util::GetStringFUTF16( IDS_PAGE_INFO_SECURITY_TAB_SSL_VERSION, ASCIIToUTF16(ssl_version_str)); const char *key_exchange, *cipher, *mac; bool is_aead, is_tls13; net::SSLCipherSuiteToStrings(&key_exchange, &cipher, &mac, &is_aead, &is_tls13, cipher_suite); site_connection_details_ += ASCIIToUTF16("\n\n"); if (is_aead) { if (is_tls13) { key_exchange = SSL_get_curve_name(visible_security_state.key_exchange_group); if (!key_exchange) { NOTREACHED(); key_exchange = ""; } } site_connection_details_ += l10n_util::GetStringFUTF16( IDS_PAGE_INFO_SECURITY_TAB_ENCRYPTION_DETAILS_AEAD, ASCIIToUTF16(cipher), ASCIIToUTF16(key_exchange)); } else { site_connection_details_ += l10n_util::GetStringFUTF16( IDS_PAGE_INFO_SECURITY_TAB_ENCRYPTION_DETAILS, ASCIIToUTF16(cipher), ASCIIToUTF16(mac), ASCIIToUTF16(key_exchange)); } } ChromeSSLHostStateDelegate* delegate = ChromeSSLHostStateDelegateFactory::GetForProfile(profile_); DCHECK(delegate); // SSL host errors for this host in the past. show_ssl_decision_revoke_button_ = delegate->HasAllowException(url.host()); }
void PageInfo::ComputeUIInputs( const GURL& url, security_state::SecurityLevel security_level, const security_state::VisibleSecurityState& visible_security_state) { #if !defined(OS_ANDROID) DCHECK(!url.SchemeIs(content::kChromeUIScheme) && !url.SchemeIs(content::kChromeDevToolsScheme) && !url.SchemeIs(content::kViewSourceScheme) && !url.SchemeIs(content_settings::kExtensionScheme)); #endif bool is_chrome_ui_native_scheme = false; #if defined(OS_ANDROID) is_chrome_ui_native_scheme = url.SchemeIs(chrome::kChromeUINativeScheme); #endif security_level_ = security_level; if (url.SchemeIs(url::kAboutScheme)) { DCHECK_EQ(url::kAboutBlankURL, url.spec()); site_identity_status_ = SITE_IDENTITY_STATUS_NO_CERT; site_details_message_ = l10n_util::GetStringUTF16(IDS_PAGE_INFO_SECURITY_TAB_INSECURE_IDENTITY); site_connection_status_ = SITE_CONNECTION_STATUS_UNENCRYPTED; site_connection_details_ = l10n_util::GetStringFUTF16( IDS_PAGE_INFO_SECURITY_TAB_NOT_ENCRYPTED_CONNECTION_TEXT, UTF8ToUTF16(url.spec())); return; } if (url.SchemeIs(content::kChromeUIScheme) || is_chrome_ui_native_scheme) { site_identity_status_ = SITE_IDENTITY_STATUS_INTERNAL_PAGE; site_details_message_ = l10n_util::GetStringUTF16(IDS_PAGE_INFO_INTERNAL_PAGE); site_connection_status_ = SITE_CONNECTION_STATUS_INTERNAL_PAGE; return; } certificate_ = visible_security_state.certificate; if (certificate_ && (!net::IsCertStatusError(visible_security_state.cert_status) || net::IsCertStatusMinorError(visible_security_state.cert_status))) { if (security_level == security_state::SECURE_WITH_POLICY_INSTALLED_CERT) { #if defined(OS_CHROMEOS) site_identity_status_ = SITE_IDENTITY_STATUS_ADMIN_PROVIDED_CERT; site_details_message_ = l10n_util::GetStringFUTF16( IDS_CERT_POLICY_PROVIDED_CERT_MESSAGE, UTF8ToUTF16(url.host())); #else DCHECK(false) << "Policy certificates exist only on ChromeOS"; #endif } else if (net::IsCertStatusMinorError( visible_security_state.cert_status)) { site_identity_status_ = SITE_IDENTITY_STATUS_CERT_REVOCATION_UNKNOWN; base::string16 issuer_name( UTF8ToUTF16(certificate_->issuer().GetDisplayName())); if (issuer_name.empty()) { issuer_name.assign(l10n_util::GetStringUTF16( IDS_PAGE_INFO_SECURITY_TAB_UNKNOWN_PARTY)); } site_details_message_.assign(l10n_util::GetStringFUTF16( IDS_PAGE_INFO_SECURITY_TAB_SECURE_IDENTITY_VERIFIED, issuer_name)); site_details_message_ += ASCIIToUTF16("\n\n"); if (visible_security_state.cert_status & net::CERT_STATUS_UNABLE_TO_CHECK_REVOCATION) { site_details_message_ += l10n_util::GetStringUTF16( IDS_PAGE_INFO_SECURITY_TAB_UNABLE_TO_CHECK_REVOCATION); } else if (visible_security_state.cert_status & net::CERT_STATUS_NO_REVOCATION_MECHANISM) { site_details_message_ += l10n_util::GetStringUTF16( IDS_PAGE_INFO_SECURITY_TAB_NO_REVOCATION_MECHANISM); } else { NOTREACHED() << "Need to specify string for this warning"; } } else { if (visible_security_state.cert_status & net::CERT_STATUS_IS_EV) { site_identity_status_ = SITE_IDENTITY_STATUS_EV_CERT; DCHECK(!certificate_->subject().organization_names.empty()); organization_name_ = UTF8ToUTF16(certificate_->subject().organization_names[0]); DCHECK(!certificate_->subject().locality_name.empty()); DCHECK(!certificate_->subject().country_name.empty()); site_details_message_.assign(l10n_util::GetStringFUTF16( IDS_PAGE_INFO_SECURITY_TAB_SECURE_IDENTITY_EV_VERIFIED, organization_name_, UTF8ToUTF16(certificate_->subject().country_name))); } else { site_identity_status_ = SITE_IDENTITY_STATUS_CERT; base::string16 issuer_name( UTF8ToUTF16(certificate_->issuer().GetDisplayName())); if (issuer_name.empty()) { issuer_name.assign(l10n_util::GetStringUTF16( IDS_PAGE_INFO_SECURITY_TAB_UNKNOWN_PARTY)); } site_details_message_.assign(l10n_util::GetStringFUTF16( IDS_PAGE_INFO_SECURITY_TAB_SECURE_IDENTITY_VERIFIED, issuer_name)); } if (security_state::IsSHA1InChain(visible_security_state)) { site_identity_status_ = SITE_IDENTITY_STATUS_DEPRECATED_SIGNATURE_ALGORITHM; site_details_message_ += UTF8ToUTF16("\n\n") + l10n_util::GetStringUTF16( IDS_PAGE_INFO_SECURITY_TAB_DEPRECATED_SIGNATURE_ALGORITHM); } } } else { site_details_message_.assign(l10n_util::GetStringUTF16( IDS_PAGE_INFO_SECURITY_TAB_INSECURE_IDENTITY)); if (!security_state::IsSchemeCryptographic(visible_security_state.url) || !visible_security_state.certificate) { site_identity_status_ = SITE_IDENTITY_STATUS_NO_CERT; } else { site_identity_status_ = SITE_IDENTITY_STATUS_ERROR; } const base::string16 bullet = UTF8ToUTF16("\n • "); std::vector<ssl_errors::ErrorInfo> errors; ssl_errors::ErrorInfo::GetErrorsForCertStatus( certificate_, visible_security_state.cert_status, url, &errors); for (size_t i = 0; i < errors.size(); ++i) { site_details_message_ += bullet; site_details_message_ += errors[i].short_description(); } if (visible_security_state.cert_status & net::CERT_STATUS_NON_UNIQUE_NAME) { site_details_message_ += ASCIIToUTF16("\n\n"); site_details_message_ += l10n_util::GetStringUTF16(IDS_PAGE_INFO_SECURITY_TAB_NON_UNIQUE_NAME); } } if (visible_security_state.malicious_content_status != security_state::MALICIOUS_CONTENT_STATUS_NONE) { GetSafeBrowsingStatusByMaliciousContentStatus( visible_security_state.malicious_content_status, &safe_browsing_status_, &site_details_message_); #if defined(FULL_SAFE_BROWSING) bool old_show_change_pw_buttons = show_change_password_buttons_; #endif show_change_password_buttons_ = (visible_security_state.malicious_content_status == security_state::MALICIOUS_CONTENT_STATUS_SIGN_IN_PASSWORD_REUSE || visible_security_state.malicious_content_status == security_state:: MALICIOUS_CONTENT_STATUS_ENTERPRISE_PASSWORD_REUSE); #if defined(FULL_SAFE_BROWSING) if (show_change_password_buttons_ && !old_show_change_pw_buttons) { RecordPasswordReuseEvent(); } #endif } site_connection_status_ = SITE_CONNECTION_STATUS_UNKNOWN; base::string16 subject_name(GetSimpleSiteName(url)); if (subject_name.empty()) { subject_name.assign( l10n_util::GetStringUTF16(IDS_PAGE_INFO_SECURITY_TAB_UNKNOWN_PARTY)); } if (!visible_security_state.certificate || !security_state::IsSchemeCryptographic(visible_security_state.url)) { site_connection_status_ = SITE_CONNECTION_STATUS_UNENCRYPTED; site_connection_details_.assign(l10n_util::GetStringFUTF16( IDS_PAGE_INFO_SECURITY_TAB_NOT_ENCRYPTED_CONNECTION_TEXT, subject_name)); } else if (!visible_security_state.connection_info_initialized) { DCHECK_NE(security_level, security_state::NONE); site_connection_status_ = SITE_CONNECTION_STATUS_ENCRYPTED_ERROR; } else { site_connection_status_ = SITE_CONNECTION_STATUS_ENCRYPTED; if (net::ObsoleteSSLStatus( visible_security_state.connection_status, visible_security_state.peer_signature_algorithm) == net::OBSOLETE_SSL_NONE) { site_connection_details_.assign(l10n_util::GetStringFUTF16( IDS_PAGE_INFO_SECURITY_TAB_ENCRYPTED_CONNECTION_TEXT, subject_name)); } else { site_connection_details_.assign(l10n_util::GetStringFUTF16( IDS_PAGE_INFO_SECURITY_TAB_WEAK_ENCRYPTION_CONNECTION_TEXT, subject_name)); } ReportAnyInsecureContent(visible_security_state, &site_connection_status_, &site_connection_details_); } uint16_t cipher_suite = net::SSLConnectionStatusToCipherSuite( visible_security_state.connection_status); if (visible_security_state.connection_info_initialized && cipher_suite) { int ssl_version = net::SSLConnectionStatusToVersion( visible_security_state.connection_status); const char* ssl_version_str; net::SSLVersionToString(&ssl_version_str, ssl_version); site_connection_details_ += ASCIIToUTF16("\n\n"); site_connection_details_ += l10n_util::GetStringFUTF16( IDS_PAGE_INFO_SECURITY_TAB_SSL_VERSION, ASCIIToUTF16(ssl_version_str)); const char *key_exchange, *cipher, *mac; bool is_aead, is_tls13; net::SSLCipherSuiteToStrings(&key_exchange, &cipher, &mac, &is_aead, &is_tls13, cipher_suite); site_connection_details_ += ASCIIToUTF16("\n\n"); if (is_aead) { if (is_tls13) { key_exchange = SSL_get_curve_name(visible_security_state.key_exchange_group); if (!key_exchange) { NOTREACHED(); key_exchange = ""; } } site_connection_details_ += l10n_util::GetStringFUTF16( IDS_PAGE_INFO_SECURITY_TAB_ENCRYPTION_DETAILS_AEAD, ASCIIToUTF16(cipher), ASCIIToUTF16(key_exchange)); } else { site_connection_details_ += l10n_util::GetStringFUTF16( IDS_PAGE_INFO_SECURITY_TAB_ENCRYPTION_DETAILS, ASCIIToUTF16(cipher), ASCIIToUTF16(mac), ASCIIToUTF16(key_exchange)); } } ChromeSSLHostStateDelegate* delegate = ChromeSSLHostStateDelegateFactory::GetForProfile(profile_); DCHECK(delegate); show_ssl_decision_revoke_button_ = delegate->HasAllowException(url.host()) && visible_security_state.malicious_content_status == security_state::MALICIOUS_CONTENT_STATUS_NONE; }
C
Chrome
1
CVE-2013-6661
https://www.cvedetails.com/cve/CVE-2013-6661/
null
https://github.com/chromium/chromium/commit/23cbfc1d685fa7389e88588584e02786820d4d26
23cbfc1d685fa7389e88588584e02786820d4d26
Add the SandboxedDMGParser and wire it up to the DownloadProtectionService. BUG=496898,464083 [email protected], [email protected], [email protected], [email protected] Review URL: https://codereview.chromium.org/1299223006 . Cr-Commit-Position: refs/heads/master@{#344876}
void ExtractFileFeatures(const base::FilePath& file_path) { base::TimeTicks start_time = base::TimeTicks::Now(); binary_feature_extractor_->CheckSignature(file_path, &signature_info_); bool is_signed = (signature_info_.certificate_chain_size() > 0); if (is_signed) { DVLOG(2) << "Downloaded a signed binary: " << file_path.value(); } else { DVLOG(2) << "Downloaded an unsigned binary: " << file_path.value(); } UMA_HISTOGRAM_BOOLEAN("SBClientDownload.SignedBinaryDownload", is_signed); UMA_HISTOGRAM_TIMES("SBClientDownload.ExtractSignatureFeaturesTime", base::TimeTicks::Now() - start_time); start_time = base::TimeTicks::Now(); image_headers_.reset(new ClientDownloadRequest_ImageHeaders()); if (!binary_feature_extractor_->ExtractImageFeatures( file_path, BinaryFeatureExtractor::kDefaultOptions, image_headers_.get(), nullptr /* signed_data */)) { image_headers_.reset(); } UMA_HISTOGRAM_TIMES("SBClientDownload.ExtractImageHeadersTime", base::TimeTicks::Now() - start_time); OnFileFeatureExtractionDone(); }
void ExtractFileFeatures(const base::FilePath& file_path) { base::TimeTicks start_time = base::TimeTicks::Now(); binary_feature_extractor_->CheckSignature(file_path, &signature_info_); bool is_signed = (signature_info_.certificate_chain_size() > 0); if (is_signed) { DVLOG(2) << "Downloaded a signed binary: " << file_path.value(); } else { DVLOG(2) << "Downloaded an unsigned binary: " << file_path.value(); } UMA_HISTOGRAM_BOOLEAN("SBClientDownload.SignedBinaryDownload", is_signed); UMA_HISTOGRAM_TIMES("SBClientDownload.ExtractSignatureFeaturesTime", base::TimeTicks::Now() - start_time); start_time = base::TimeTicks::Now(); image_headers_.reset(new ClientDownloadRequest_ImageHeaders()); if (!binary_feature_extractor_->ExtractImageFeatures( file_path, BinaryFeatureExtractor::kDefaultOptions, image_headers_.get(), nullptr /* signed_data */)) { image_headers_.reset(); } UMA_HISTOGRAM_TIMES("SBClientDownload.ExtractImageHeadersTime", base::TimeTicks::Now() - start_time); OnFileFeatureExtractionDone(); }
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 dump_pagetable(unsigned long address) { pgd_t *base = __va(read_cr3()); pgd_t *pgd = &base[pgd_index(address)]; pmd_t *pmd; pte_t *pte; #ifdef CONFIG_X86_PAE printk("*pdpt = %016Lx ", pgd_val(*pgd)); if (!low_pfn(pgd_val(*pgd) >> PAGE_SHIFT) || !pgd_present(*pgd)) goto out; #endif pmd = pmd_offset(pud_offset(pgd, address), address); printk(KERN_CONT "*pde = %0*Lx ", sizeof(*pmd) * 2, (u64)pmd_val(*pmd)); /* * We must not directly access the pte in the highpte * case if the page table is located in highmem. * And let's rather not kmap-atomic the pte, just in case * it's allocated already: */ if (!low_pfn(pmd_pfn(*pmd)) || !pmd_present(*pmd) || pmd_large(*pmd)) goto out; pte = pte_offset_kernel(pmd, address); printk("*pte = %0*Lx ", sizeof(*pte) * 2, (u64)pte_val(*pte)); out: printk("\n"); }
static void dump_pagetable(unsigned long address) { pgd_t *base = __va(read_cr3()); pgd_t *pgd = &base[pgd_index(address)]; pmd_t *pmd; pte_t *pte; #ifdef CONFIG_X86_PAE printk("*pdpt = %016Lx ", pgd_val(*pgd)); if (!low_pfn(pgd_val(*pgd) >> PAGE_SHIFT) || !pgd_present(*pgd)) goto out; #endif pmd = pmd_offset(pud_offset(pgd, address), address); printk(KERN_CONT "*pde = %0*Lx ", sizeof(*pmd) * 2, (u64)pmd_val(*pmd)); /* * We must not directly access the pte in the highpte * case if the page table is located in highmem. * And let's rather not kmap-atomic the pte, just in case * it's allocated already: */ if (!low_pfn(pmd_pfn(*pmd)) || !pmd_present(*pmd) || pmd_large(*pmd)) goto out; pte = pte_offset_kernel(pmd, address); printk("*pte = %0*Lx ", sizeof(*pte) * 2, (u64)pte_val(*pte)); out: printk("\n"); }
C
linux
0
CVE-2015-1274
https://www.cvedetails.com/cve/CVE-2015-1274/
CWE-254
https://github.com/chromium/chromium/commit/d27468a832d5316884bd02f459cbf493697fd7e1
d27468a832d5316884bd02f459cbf493697fd7e1
Switch to equalIgnoringASCIICase throughout modules/accessibility BUG=627682 Review-Url: https://codereview.chromium.org/2793913007 Cr-Commit-Position: refs/heads/master@{#461858}
void AXLayoutObject::ariaLabelledbyElements(AXObjectVector& labelledby) const { accessibilityChildrenFromAttribute(aria_labelledbyAttr, labelledby); }
void AXLayoutObject::ariaLabelledbyElements(AXObjectVector& labelledby) const { accessibilityChildrenFromAttribute(aria_labelledbyAttr, labelledby); }
C
Chrome
0
CVE-2013-2128
https://www.cvedetails.com/cve/CVE-2013-2128/
CWE-119
https://github.com/torvalds/linux/commit/baff42ab1494528907bf4d5870359e31711746ae
baff42ab1494528907bf4d5870359e31711746ae
net: Fix oops from tcp_collapse() when using splice() tcp_read_sock() can have a eat skbs without immediately advancing copied_seq. This can cause a panic in tcp_collapse() if it is called as a result of the recv_actor dropping the socket lock. A userspace program that splices data from a socket to either another socket or to a file can trigger this bug. Signed-off-by: Steven J. Magnani <[email protected]> Signed-off-by: David S. Miller <[email protected]>
ssize_t tcp_sendpage(struct socket *sock, struct page *page, int offset, size_t size, int flags) { ssize_t res; struct sock *sk = sock->sk; if (!(sk->sk_route_caps & NETIF_F_SG) || !(sk->sk_route_caps & NETIF_F_ALL_CSUM)) return sock_no_sendpage(sock, page, offset, size, flags); lock_sock(sk); TCP_CHECK_TIMER(sk); res = do_tcp_sendpages(sk, &page, offset, size, flags); TCP_CHECK_TIMER(sk); release_sock(sk); return res; }
ssize_t tcp_sendpage(struct socket *sock, struct page *page, int offset, size_t size, int flags) { ssize_t res; struct sock *sk = sock->sk; if (!(sk->sk_route_caps & NETIF_F_SG) || !(sk->sk_route_caps & NETIF_F_ALL_CSUM)) return sock_no_sendpage(sock, page, offset, size, flags); lock_sock(sk); TCP_CHECK_TIMER(sk); res = do_tcp_sendpages(sk, &page, offset, size, flags); TCP_CHECK_TIMER(sk); release_sock(sk); return res; }
C
linux
0
CVE-2019-14980
https://www.cvedetails.com/cve/CVE-2019-14980/
CWE-416
https://github.com/ImageMagick/ImageMagick6/commit/614a257295bdcdeda347086761062ac7658b6830
614a257295bdcdeda347086761062ac7658b6830
https://github.com/ImageMagick/ImageMagick6/issues/43
MagickExport unsigned char *FileToBlob(const char *filename,const size_t extent, size_t *length,ExceptionInfo *exception) { int file; MagickBooleanType status; MagickOffsetType offset; register size_t i; ssize_t count; struct stat attributes; unsigned char *blob; void *map; assert(filename != (const char *) NULL); (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",filename); assert(exception != (ExceptionInfo *) NULL); *length=0; status=IsRightsAuthorized(PathPolicyDomain,ReadPolicyRights,filename); if (status == MagickFalse) { errno=EPERM; (void) ThrowMagickException(exception,GetMagickModule(),PolicyError, "NotAuthorized","`%s'",filename); return(NULL); } file=fileno(stdin); if (LocaleCompare(filename,"-") != 0) { status=GetPathAttributes(filename,&attributes); if ((status == MagickFalse) || (S_ISDIR(attributes.st_mode) != 0)) { ThrowFileException(exception,BlobError,"UnableToReadBlob",filename); return(NULL); } file=open_utf8(filename,O_RDONLY | O_BINARY,0); } if (file == -1) { ThrowFileException(exception,BlobError,"UnableToOpenFile",filename); return((unsigned char *) NULL); } offset=(MagickOffsetType) lseek(file,0,SEEK_END); count=0; if ((file == fileno(stdin)) || (offset < 0) || (offset != (MagickOffsetType) ((ssize_t) offset))) { size_t quantum; struct stat file_stats; /* Stream is not seekable. */ offset=(MagickOffsetType) lseek(file,0,SEEK_SET); quantum=(size_t) MagickMaxBufferExtent; if ((fstat(file,&file_stats) == 0) && (file_stats.st_size > 0)) quantum=(size_t) MagickMin(file_stats.st_size,MagickMaxBufferExtent); blob=(unsigned char *) AcquireQuantumMemory(quantum,sizeof(*blob)); for (i=0; blob != (unsigned char *) NULL; i+=count) { count=read(file,blob+i,quantum); if (count <= 0) { count=0; if (errno != EINTR) break; } if (~((size_t) i) < (quantum+1)) { blob=(unsigned char *) RelinquishMagickMemory(blob); break; } blob=(unsigned char *) ResizeQuantumMemory(blob,i+quantum+1, sizeof(*blob)); if ((size_t) (i+count) >= extent) break; } if (LocaleCompare(filename,"-") != 0) file=close(file); if (blob == (unsigned char *) NULL) { (void) ThrowMagickException(exception,GetMagickModule(), ResourceLimitError,"MemoryAllocationFailed","`%s'",filename); return((unsigned char *) NULL); } if (file == -1) { blob=(unsigned char *) RelinquishMagickMemory(blob); ThrowFileException(exception,BlobError,"UnableToReadBlob",filename); return((unsigned char *) NULL); } *length=(size_t) MagickMin(i+count,extent); blob[*length]='\0'; return(blob); } *length=(size_t) MagickMin(offset,(MagickOffsetType) MagickMin(extent,SSIZE_MAX)); blob=(unsigned char *) NULL; if (~(*length) >= (MaxTextExtent-1)) blob=(unsigned char *) AcquireQuantumMemory(*length+MaxTextExtent, sizeof(*blob)); if (blob == (unsigned char *) NULL) { file=close(file); (void) ThrowMagickException(exception,GetMagickModule(), ResourceLimitError,"MemoryAllocationFailed","`%s'",filename); return((unsigned char *) NULL); } map=MapBlob(file,ReadMode,0,*length); if (map != (unsigned char *) NULL) { (void) memcpy(blob,map,*length); (void) UnmapBlob(map,*length); } else { (void) lseek(file,0,SEEK_SET); for (i=0; i < *length; i+=count) { count=read(file,blob+i,MagickMin(*length-i,(size_t) SSIZE_MAX)); if (count <= 0) { count=0; if (errno != EINTR) break; } } if (i < *length) { file=close(file)-1; blob=(unsigned char *) RelinquishMagickMemory(blob); ThrowFileException(exception,BlobError,"UnableToReadBlob",filename); return((unsigned char *) NULL); } } blob[*length]='\0'; if (LocaleCompare(filename,"-") != 0) file=close(file); if (file == -1) { blob=(unsigned char *) RelinquishMagickMemory(blob); ThrowFileException(exception,BlobError,"UnableToReadBlob",filename); } return(blob); }
MagickExport unsigned char *FileToBlob(const char *filename,const size_t extent, size_t *length,ExceptionInfo *exception) { int file; MagickBooleanType status; MagickOffsetType offset; register size_t i; ssize_t count; struct stat attributes; unsigned char *blob; void *map; assert(filename != (const char *) NULL); (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",filename); assert(exception != (ExceptionInfo *) NULL); *length=0; status=IsRightsAuthorized(PathPolicyDomain,ReadPolicyRights,filename); if (status == MagickFalse) { errno=EPERM; (void) ThrowMagickException(exception,GetMagickModule(),PolicyError, "NotAuthorized","`%s'",filename); return(NULL); } file=fileno(stdin); if (LocaleCompare(filename,"-") != 0) { status=GetPathAttributes(filename,&attributes); if ((status == MagickFalse) || (S_ISDIR(attributes.st_mode) != 0)) { ThrowFileException(exception,BlobError,"UnableToReadBlob",filename); return(NULL); } file=open_utf8(filename,O_RDONLY | O_BINARY,0); } if (file == -1) { ThrowFileException(exception,BlobError,"UnableToOpenFile",filename); return((unsigned char *) NULL); } offset=(MagickOffsetType) lseek(file,0,SEEK_END); count=0; if ((file == fileno(stdin)) || (offset < 0) || (offset != (MagickOffsetType) ((ssize_t) offset))) { size_t quantum; struct stat file_stats; /* Stream is not seekable. */ offset=(MagickOffsetType) lseek(file,0,SEEK_SET); quantum=(size_t) MagickMaxBufferExtent; if ((fstat(file,&file_stats) == 0) && (file_stats.st_size > 0)) quantum=(size_t) MagickMin(file_stats.st_size,MagickMaxBufferExtent); blob=(unsigned char *) AcquireQuantumMemory(quantum,sizeof(*blob)); for (i=0; blob != (unsigned char *) NULL; i+=count) { count=read(file,blob+i,quantum); if (count <= 0) { count=0; if (errno != EINTR) break; } if (~((size_t) i) < (quantum+1)) { blob=(unsigned char *) RelinquishMagickMemory(blob); break; } blob=(unsigned char *) ResizeQuantumMemory(blob,i+quantum+1, sizeof(*blob)); if ((size_t) (i+count) >= extent) break; } if (LocaleCompare(filename,"-") != 0) file=close(file); if (blob == (unsigned char *) NULL) { (void) ThrowMagickException(exception,GetMagickModule(), ResourceLimitError,"MemoryAllocationFailed","`%s'",filename); return((unsigned char *) NULL); } if (file == -1) { blob=(unsigned char *) RelinquishMagickMemory(blob); ThrowFileException(exception,BlobError,"UnableToReadBlob",filename); return((unsigned char *) NULL); } *length=(size_t) MagickMin(i+count,extent); blob[*length]='\0'; return(blob); } *length=(size_t) MagickMin(offset,(MagickOffsetType) MagickMin(extent,SSIZE_MAX)); blob=(unsigned char *) NULL; if (~(*length) >= (MaxTextExtent-1)) blob=(unsigned char *) AcquireQuantumMemory(*length+MaxTextExtent, sizeof(*blob)); if (blob == (unsigned char *) NULL) { file=close(file); (void) ThrowMagickException(exception,GetMagickModule(), ResourceLimitError,"MemoryAllocationFailed","`%s'",filename); return((unsigned char *) NULL); } map=MapBlob(file,ReadMode,0,*length); if (map != (unsigned char *) NULL) { (void) memcpy(blob,map,*length); (void) UnmapBlob(map,*length); } else { (void) lseek(file,0,SEEK_SET); for (i=0; i < *length; i+=count) { count=read(file,blob+i,MagickMin(*length-i,(size_t) SSIZE_MAX)); if (count <= 0) { count=0; if (errno != EINTR) break; } } if (i < *length) { file=close(file)-1; blob=(unsigned char *) RelinquishMagickMemory(blob); ThrowFileException(exception,BlobError,"UnableToReadBlob",filename); return((unsigned char *) NULL); } } blob[*length]='\0'; if (LocaleCompare(filename,"-") != 0) file=close(file); if (file == -1) { blob=(unsigned char *) RelinquishMagickMemory(blob); ThrowFileException(exception,BlobError,"UnableToReadBlob",filename); } return(blob); }
C
ImageMagick6
0
CVE-2013-2925
https://www.cvedetails.com/cve/CVE-2013-2925/
CWE-399
https://github.com/chromium/chromium/commit/aa1a102f73565feeb1d121d0d6c9524bebcdd75f
aa1a102f73565feeb1d121d0d6c9524bebcdd75f
Don't dispatch events when XHR is set to sync mode Any of readystatechange, progress, abort, error, timeout and loadend event are not specified to be dispatched in sync mode in the latest spec. Just an exception corresponding to the failure is thrown. Clean up for readability done in this CL - factor out dispatchEventAndLoadEnd calling code - make didTimeout() private - give error handling methods more descriptive names - set m_exceptionCode in failure type specific methods -- Note that for didFailRedirectCheck, m_exceptionCode was not set in networkError(), but was set at the end of createRequest() This CL is prep for fixing crbug.com/292422 BUG=292422 Review URL: https://chromiumcodereview.appspot.com/24225002 git-svn-id: svn://svn.chromium.org/blink/trunk@158046 bbb929c8-8fbe-4397-9dbb-9b2b20218538
void XMLHttpRequest::createRequest(ExceptionState& es) { if (m_url.protocolIs("blob") && m_method != "GET") { es.throwDOMException(NetworkError, ExceptionMessages::failedToExecute("send", "XMLHttpRequest", "'GET' is the only method allowed for 'blob:' URLs.")); return; } bool uploadEvents = false; if (m_async) { m_progressEventThrottle.dispatchEvent(XMLHttpRequestProgressEvent::create(eventNames().loadstartEvent)); if (m_requestEntityBody && m_upload) { uploadEvents = m_upload->hasEventListeners(); m_upload->dispatchEvent(XMLHttpRequestProgressEvent::create(eventNames().loadstartEvent)); } } m_sameOriginRequest = securityOrigin()->canRequest(m_url); m_uploadEventsAllowed = m_sameOriginRequest || uploadEvents || !isSimpleCrossOriginAccessRequest(m_method, m_requestHeaders); ResourceRequest request(m_url); request.setHTTPMethod(m_method); request.setTargetType(ResourceRequest::TargetIsXHR); InspectorInstrumentation::willLoadXHR(scriptExecutionContext(), this, m_method, m_url, m_async, m_requestEntityBody ? m_requestEntityBody->deepCopy() : 0, m_requestHeaders, m_includeCredentials); if (m_requestEntityBody) { ASSERT(m_method != "GET"); ASSERT(m_method != "HEAD"); request.setHTTPBody(m_requestEntityBody.release()); } if (m_requestHeaders.size() > 0) request.addHTTPHeaderFields(m_requestHeaders); ThreadableLoaderOptions options; options.sendLoadCallbacks = SendCallbacks; options.sniffContent = DoNotSniffContent; options.preflightPolicy = uploadEvents ? ForcePreflight : ConsiderPreflight; options.allowCredentials = (m_sameOriginRequest || m_includeCredentials) ? AllowStoredCredentials : DoNotAllowStoredCredentials; options.credentialsRequested = m_includeCredentials ? ClientRequestedCredentials : ClientDidNotRequestCredentials; options.crossOriginRequestPolicy = UseAccessControl; options.securityOrigin = securityOrigin(); options.initiator = FetchInitiatorTypeNames::xmlhttprequest; options.contentSecurityPolicyEnforcement = ContentSecurityPolicy::shouldBypassMainWorld(scriptExecutionContext()) ? DoNotEnforceContentSecurityPolicy : EnforceConnectSrcDirective; options.mixedContentBlockingTreatment = TreatAsActiveContent; options.timeoutMilliseconds = m_timeoutMilliseconds; m_exceptionCode = 0; m_error = false; if (m_async) { if (m_upload) request.setReportUploadProgress(true); ASSERT(!m_loader); m_loader = ThreadableLoader::create(scriptExecutionContext(), this, request, options); if (m_loader) { ASSERT(!hasPendingActivity()); setPendingActivity(this); } } else { request.setPriority(ResourceLoadPriorityVeryHigh); InspectorInstrumentation::willLoadXHRSynchronously(scriptExecutionContext()); ThreadableLoader::loadResourceSynchronously(scriptExecutionContext(), request, *this, options); InspectorInstrumentation::didLoadXHRSynchronously(scriptExecutionContext()); } if (!m_exceptionCode && m_error) m_exceptionCode = NetworkError; if (m_exceptionCode) es.throwDOMException(m_exceptionCode); }
void XMLHttpRequest::createRequest(ExceptionState& es) { if (m_url.protocolIs("blob") && m_method != "GET") { es.throwDOMException(NetworkError, ExceptionMessages::failedToExecute("send", "XMLHttpRequest", "'GET' is the only method allowed for 'blob:' URLs.")); return; } bool uploadEvents = false; if (m_async) { m_progressEventThrottle.dispatchEvent(XMLHttpRequestProgressEvent::create(eventNames().loadstartEvent)); if (m_requestEntityBody && m_upload) { uploadEvents = m_upload->hasEventListeners(); m_upload->dispatchEvent(XMLHttpRequestProgressEvent::create(eventNames().loadstartEvent)); } } m_sameOriginRequest = securityOrigin()->canRequest(m_url); m_uploadEventsAllowed = m_sameOriginRequest || uploadEvents || !isSimpleCrossOriginAccessRequest(m_method, m_requestHeaders); ResourceRequest request(m_url); request.setHTTPMethod(m_method); request.setTargetType(ResourceRequest::TargetIsXHR); InspectorInstrumentation::willLoadXHR(scriptExecutionContext(), this, m_method, m_url, m_async, m_requestEntityBody ? m_requestEntityBody->deepCopy() : 0, m_requestHeaders, m_includeCredentials); if (m_requestEntityBody) { ASSERT(m_method != "GET"); ASSERT(m_method != "HEAD"); request.setHTTPBody(m_requestEntityBody.release()); } if (m_requestHeaders.size() > 0) request.addHTTPHeaderFields(m_requestHeaders); ThreadableLoaderOptions options; options.sendLoadCallbacks = SendCallbacks; options.sniffContent = DoNotSniffContent; options.preflightPolicy = uploadEvents ? ForcePreflight : ConsiderPreflight; options.allowCredentials = (m_sameOriginRequest || m_includeCredentials) ? AllowStoredCredentials : DoNotAllowStoredCredentials; options.credentialsRequested = m_includeCredentials ? ClientRequestedCredentials : ClientDidNotRequestCredentials; options.crossOriginRequestPolicy = UseAccessControl; options.securityOrigin = securityOrigin(); options.initiator = FetchInitiatorTypeNames::xmlhttprequest; options.contentSecurityPolicyEnforcement = ContentSecurityPolicy::shouldBypassMainWorld(scriptExecutionContext()) ? DoNotEnforceContentSecurityPolicy : EnforceConnectSrcDirective; options.mixedContentBlockingTreatment = TreatAsActiveContent; options.timeoutMilliseconds = m_timeoutMilliseconds; m_exceptionCode = 0; m_error = false; if (m_async) { if (m_upload) request.setReportUploadProgress(true); ASSERT(!m_loader); m_loader = ThreadableLoader::create(scriptExecutionContext(), this, request, options); if (m_loader) { ASSERT(!hasPendingActivity()); setPendingActivity(this); } } else { request.setPriority(ResourceLoadPriorityVeryHigh); InspectorInstrumentation::willLoadXHRSynchronously(scriptExecutionContext()); ThreadableLoader::loadResourceSynchronously(scriptExecutionContext(), request, *this, options); InspectorInstrumentation::didLoadXHRSynchronously(scriptExecutionContext()); } if (!m_exceptionCode && m_error) m_exceptionCode = NetworkError; if (m_exceptionCode) es.throwDOMException(m_exceptionCode); }
C
Chrome
0