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-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 free_duplicate_context(MpegEncContext *s) { if (!s) return; av_freep(&s->sc.edge_emu_buffer); av_freep(&s->me.scratchpad); s->me.temp = s->sc.rd_scratchpad = s->sc.b_scratchpad = s->sc.obmc_scratchpad = NULL; av_freep(&s->dct_error_sum); av_freep(&s->me.map); av_freep(&s->me.score_map); av_freep(&s->blocks); av_freep(&s->block32); av_freep(&s->ac_val_base); s->block = NULL; }
static void free_duplicate_context(MpegEncContext *s) { if (!s) return; av_freep(&s->sc.edge_emu_buffer); av_freep(&s->me.scratchpad); s->me.temp = s->sc.rd_scratchpad = s->sc.b_scratchpad = s->sc.obmc_scratchpad = NULL; av_freep(&s->dct_error_sum); av_freep(&s->me.map); av_freep(&s->me.score_map); av_freep(&s->blocks); av_freep(&s->block32); av_freep(&s->ac_val_base); s->block = NULL; }
C
FFmpeg
0
CVE-2017-6430
https://www.cvedetails.com/cve/CVE-2017-6430/
CWE-125
https://github.com/LocutusOfBorg/ettercap/commit/626dc56686f15f2dda13c48f78c2a666cb6d8506
626dc56686f15f2dda13c48f78c2a666cb6d8506
Exit gracefully in case of corrupted filters (Closes issue #782)
void ef_debug(u_char level, const char *message, ...) { va_list ap; /* if not in debug don't print anything */ if (EF_GBL_OPTIONS->debug < level) return; /* print the message */ va_start(ap, message); vfprintf (stderr, message, ap); fflush(stderr); va_end(ap); }
void ef_debug(u_char level, const char *message, ...) { va_list ap; /* if not in debug don't print anything */ if (EF_GBL_OPTIONS->debug < level) return; /* print the message */ va_start(ap, message); vfprintf (stderr, message, ap); fflush(stderr); va_end(ap); }
C
ettercap
0
CVE-2016-8633
https://www.cvedetails.com/cve/CVE-2016-8633/
CWE-119
https://github.com/torvalds/linux/commit/667121ace9dbafb368618dbabcf07901c962ddac
667121ace9dbafb368618dbabcf07901c962ddac
firewire: net: guard against rx buffer overflows The IP-over-1394 driver firewire-net lacked input validation when handling incoming fragmented datagrams. A maliciously formed fragment with a respectively large datagram_offset would cause a memcpy past the datagram buffer. So, drop any packets carrying a fragment with offset + length larger than datagram_size. In addition, ensure that - GASP header, unfragmented encapsulation header, or fragment encapsulation header actually exists before we access it, - the encapsulated datagram or fragment is of nonzero size. Reported-by: Eyal Itkin <[email protected]> Reviewed-by: Eyal Itkin <[email protected]> Fixes: CVE 2016-8633 Cc: [email protected] Signed-off-by: Stefan Richter <[email protected]>
static void fwnet_pd_delete(struct fwnet_partial_datagram *old) { struct fwnet_fragment_info *fi, *n; list_for_each_entry_safe(fi, n, &old->fi_list, fi_link) kfree(fi); list_del(&old->pd_link); dev_kfree_skb_any(old->skb); kfree(old); }
static void fwnet_pd_delete(struct fwnet_partial_datagram *old) { struct fwnet_fragment_info *fi, *n; list_for_each_entry_safe(fi, n, &old->fi_list, fi_link) kfree(fi); list_del(&old->pd_link); dev_kfree_skb_any(old->skb); kfree(old); }
C
linux
0
CVE-2016-2464
https://www.cvedetails.com/cve/CVE-2016-2464/
CWE-20
https://android.googlesource.com/platform/external/libvpx/+/cc274e2abe8b2a6698a5c47d8aa4bb45f1f9538d
cc274e2abe8b2a6698a5c47d8aa4bb45f1f9538d
external/libvpx/libwebm: Update snapshot Update libwebm snapshot. This update contains security fixes from upstream. Upstream git hash: 229f49347d19b0ca0941e072b199a242ef6c5f2b BUG=23167726 Change-Id: Id3e140e7b31ae11294724b1ecfe2e9c83b4d4207 (cherry picked from commit d0281a15b3c6bd91756e453cc9398c5ef412d99a)
int SeekHead::GetVoidElementCount() const { return m_void_element_count; }
int SeekHead::GetVoidElementCount() const { return m_void_element_count; }
C
Android
0
CVE-2017-11144
https://www.cvedetails.com/cve/CVE-2017-11144/
CWE-754
https://git.php.net/?p=php-src.git;a=commit;h=73cabfedf519298e1a11192699f44d53c529315e
73cabfedf519298e1a11192699f44d53c529315e
null
static X509 * php_openssl_x509_from_zval(zval * val, int makeresource, zend_resource **resourceval) { X509 *cert = NULL; if (resourceval) { *resourceval = NULL; } if (Z_TYPE_P(val) == IS_RESOURCE) { /* is it an x509 resource ? */ void * what; zend_resource *res = Z_RES_P(val); what = zend_fetch_resource(res, "OpenSSL X.509", le_x509); if (!what) { return NULL; } /* this is so callers can decide if they should free the X509 */ if (resourceval) { *resourceval = res; Z_ADDREF_P(val); } return (X509*)what; } if (!(Z_TYPE_P(val) == IS_STRING || Z_TYPE_P(val) == IS_OBJECT)) { return NULL; } /* force it to be a string and check if it refers to a file */ convert_to_string_ex(val); if (Z_STRLEN_P(val) > 7 && memcmp(Z_STRVAL_P(val), "file://", sizeof("file://") - 1) == 0) { /* read cert from the named file */ BIO *in; if (php_openssl_open_base_dir_chk(Z_STRVAL_P(val) + (sizeof("file://") - 1))) { return NULL; } in = BIO_new_file(Z_STRVAL_P(val) + (sizeof("file://") - 1), "r"); if (in == NULL) { return NULL; } cert = PEM_read_bio_X509(in, NULL, NULL, NULL); BIO_free(in); } else { BIO *in; in = BIO_new_mem_buf(Z_STRVAL_P(val), (int)Z_STRLEN_P(val)); if (in == NULL) { return NULL; } #ifdef TYPEDEF_D2I_OF cert = (X509 *) PEM_ASN1_read_bio((d2i_of_void *)d2i_X509, PEM_STRING_X509, in, NULL, NULL, NULL); #else cert = (X509 *) PEM_ASN1_read_bio((char *(*)())d2i_X509, PEM_STRING_X509, in, NULL, NULL, NULL); #endif BIO_free(in); } if (cert && makeresource && resourceval) { *resourceval = zend_register_resource(cert, le_x509); } return cert; }
static X509 * php_openssl_x509_from_zval(zval * val, int makeresource, zend_resource **resourceval) { X509 *cert = NULL; if (resourceval) { *resourceval = NULL; } if (Z_TYPE_P(val) == IS_RESOURCE) { /* is it an x509 resource ? */ void * what; zend_resource *res = Z_RES_P(val); what = zend_fetch_resource(res, "OpenSSL X.509", le_x509); if (!what) { return NULL; } /* this is so callers can decide if they should free the X509 */ if (resourceval) { *resourceval = res; Z_ADDREF_P(val); } return (X509*)what; } if (!(Z_TYPE_P(val) == IS_STRING || Z_TYPE_P(val) == IS_OBJECT)) { return NULL; } /* force it to be a string and check if it refers to a file */ convert_to_string_ex(val); if (Z_STRLEN_P(val) > 7 && memcmp(Z_STRVAL_P(val), "file://", sizeof("file://") - 1) == 0) { /* read cert from the named file */ BIO *in; if (php_openssl_open_base_dir_chk(Z_STRVAL_P(val) + (sizeof("file://") - 1))) { return NULL; } in = BIO_new_file(Z_STRVAL_P(val) + (sizeof("file://") - 1), "r"); if (in == NULL) { return NULL; } cert = PEM_read_bio_X509(in, NULL, NULL, NULL); BIO_free(in); } else { BIO *in; in = BIO_new_mem_buf(Z_STRVAL_P(val), (int)Z_STRLEN_P(val)); if (in == NULL) { return NULL; } #ifdef TYPEDEF_D2I_OF cert = (X509 *) PEM_ASN1_read_bio((d2i_of_void *)d2i_X509, PEM_STRING_X509, in, NULL, NULL, NULL); #else cert = (X509 *) PEM_ASN1_read_bio((char *(*)())d2i_X509, PEM_STRING_X509, in, NULL, NULL, NULL); #endif BIO_free(in); } if (cert && makeresource && resourceval) { *resourceval = zend_register_resource(cert, le_x509); } return cert; }
C
php
0
CVE-2016-6198
https://www.cvedetails.com/cve/CVE-2016-6198/
CWE-284
https://github.com/torvalds/linux/commit/9409e22acdfc9153f88d9b1ed2bd2a5b34d2d3ca
9409e22acdfc9153f88d9b1ed2bd2a5b34d2d3ca
vfs: rename: check backing inode being equal If a file is renamed to a hardlink of itself POSIX specifies that rename(2) should do nothing and return success. This condition is checked in vfs_rename(). However it won't detect hard links on overlayfs where these are given separate inodes on the overlayfs layer. Overlayfs itself detects this condition and returns success without doing anything, but then vfs_rename() will proceed as if this was a successful rename (detach_mounts(), d_move()). The correct thing to do is to detect this condition before even calling into overlayfs. This patch does this by calling vfs_select_inode() to get the underlying inodes. Signed-off-by: Miklos Szeredi <[email protected]> Cc: <[email protected]> # v4.2+
struct dentry *lookup_one_len_unlocked(const char *name, struct dentry *base, int len) { struct qstr this; unsigned int c; int err; struct dentry *ret; this.name = name; this.len = len; this.hash = full_name_hash(name, len); if (!len) return ERR_PTR(-EACCES); if (unlikely(name[0] == '.')) { if (len < 2 || (len == 2 && name[1] == '.')) return ERR_PTR(-EACCES); } while (len--) { c = *(const unsigned char *)name++; if (c == '/' || c == '\0') return ERR_PTR(-EACCES); } /* * See if the low-level filesystem might want * to use its own hash.. */ if (base->d_flags & DCACHE_OP_HASH) { int err = base->d_op->d_hash(base, &this); if (err < 0) return ERR_PTR(err); } err = inode_permission(base->d_inode, MAY_EXEC); if (err) return ERR_PTR(err); ret = lookup_dcache(&this, base, 0); if (!ret) ret = lookup_slow(&this, base, 0); return ret; }
struct dentry *lookup_one_len_unlocked(const char *name, struct dentry *base, int len) { struct qstr this; unsigned int c; int err; struct dentry *ret; this.name = name; this.len = len; this.hash = full_name_hash(name, len); if (!len) return ERR_PTR(-EACCES); if (unlikely(name[0] == '.')) { if (len < 2 || (len == 2 && name[1] == '.')) return ERR_PTR(-EACCES); } while (len--) { c = *(const unsigned char *)name++; if (c == '/' || c == '\0') return ERR_PTR(-EACCES); } /* * See if the low-level filesystem might want * to use its own hash.. */ if (base->d_flags & DCACHE_OP_HASH) { int err = base->d_op->d_hash(base, &this); if (err < 0) return ERR_PTR(err); } err = inode_permission(base->d_inode, MAY_EXEC); if (err) return ERR_PTR(err); ret = lookup_dcache(&this, base, 0); if (!ret) ret = lookup_slow(&this, base, 0); return ret; }
C
linux
0
null
null
null
https://github.com/chromium/chromium/commit/ea994548ed483e234a6fadd0cbdfa10d58b75cef
ea994548ed483e234a6fadd0cbdfa10d58b75cef
Fix integer overflow in software compositor Ensure that the size mapped from the renderer process for the software frame is not less than expected due to integer overflow. BUG=348332 Review URL: https://codereview.chromium.org/196283018 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@257417 0039d316-1c4b-4281-b951-d872f2087c98
void SoftwareFrameManager::DiscardCurrentFrame() { if (!HasCurrentFrame()) return; current_frame_ = NULL; RendererFrameManager::GetInstance()->RemoveFrame(this); }
void SoftwareFrameManager::DiscardCurrentFrame() { if (!HasCurrentFrame()) return; current_frame_ = NULL; RendererFrameManager::GetInstance()->RemoveFrame(this); }
C
Chrome
0
CVE-2016-3835
https://www.cvedetails.com/cve/CVE-2016-3835/
CWE-200
https://android.googlesource.com/platform/hardware/qcom/media/+/7558d03e6498e970b761aa44fff6b2c659202d95
7558d03e6498e970b761aa44fff6b2c659202d95
DO NOT MERGE mm-video-v4l2: venc: add checks before accessing heap pointers Heap pointers do not point to user virtual addresses in case of secure session. Set them to NULL and add checks to avoid accesing them Bug: 28815329 Bug: 28920116 Change-Id: I94fd5808e753b58654d65e175d3857ef46ffba26
omx_venc::~omx_venc() { get_syntaxhdr_enable = false; }
omx_venc::~omx_venc() { get_syntaxhdr_enable = false; }
C
Android
0
CVE-2014-3172
https://www.cvedetails.com/cve/CVE-2014-3172/
CWE-264
https://github.com/chromium/chromium/commit/684a212a93141908bcc10f4bc57f3edb53d2d21f
684a212a93141908bcc10f4bc57f3edb53d2d21f
Have the Debugger extension api check that it has access to the tab Check PermissionsData::CanAccessTab() prior to attaching the debugger. BUG=367567 Review URL: https://codereview.chromium.org/352523003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@280354 0039d316-1c4b-4281-b951-d872f2087c98
scoped_refptr<const PermissionSet> PermissionsData::GetTabSpecificPermissions( int tab_id) const { base::AutoLock auto_lock(runtime_lock_); CHECK_GE(tab_id, 0); TabPermissionsMap::const_iterator iter = tab_specific_permissions_.find(tab_id); return (iter != tab_specific_permissions_.end()) ? iter->second : NULL; }
scoped_refptr<const PermissionSet> PermissionsData::GetTabSpecificPermissions( int tab_id) const { base::AutoLock auto_lock(runtime_lock_); CHECK_GE(tab_id, 0); TabPermissionsMap::const_iterator iter = tab_specific_permissions_.find(tab_id); return (iter != tab_specific_permissions_.end()) ? iter->second : NULL; }
C
Chrome
0
CVE-2014-9644
https://www.cvedetails.com/cve/CVE-2014-9644/
CWE-264
https://github.com/torvalds/linux/commit/4943ba16bbc2db05115707b3ff7b4874e9e3c560
4943ba16bbc2db05115707b3ff7b4874e9e3c560
crypto: include crypto- module prefix in template This adds the module loading prefix "crypto-" to the template lookup as well. For example, attempting to load 'vfat(blowfish)' via AF_ALG now correctly includes the "crypto-" prefix at every level, correctly rejecting "vfat": net-pf-38 algif-hash crypto-vfat(blowfish) crypto-vfat(blowfish)-all crypto-vfat Reported-by: Mathias Krause <[email protected]> Signed-off-by: Kees Cook <[email protected]> Acked-by: Mathias Krause <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
static void pcrypt_aead_enc(struct padata_priv *padata) { struct pcrypt_request *preq = pcrypt_padata_request(padata); struct aead_request *req = pcrypt_request_ctx(preq); padata->info = crypto_aead_encrypt(req); if (padata->info == -EINPROGRESS) return; padata_do_serial(padata); }
static void pcrypt_aead_enc(struct padata_priv *padata) { struct pcrypt_request *preq = pcrypt_padata_request(padata); struct aead_request *req = pcrypt_request_ctx(preq); padata->info = crypto_aead_encrypt(req); if (padata->info == -EINPROGRESS) return; padata_do_serial(padata); }
C
linux
0
CVE-2015-8324
https://www.cvedetails.com/cve/CVE-2015-8324/
null
https://github.com/torvalds/linux/commit/744692dc059845b2a3022119871846e74d4f6e11
744692dc059845b2a3022119871846e74d4f6e11
ext4: use ext4_get_block_write in buffer write Allocate uninitialized extent before ext4 buffer write and convert the extent to initialized after io completes. The purpose is to make sure an extent can only be marked initialized after it has been written with new data so we can safely drop the i_mutex lock in ext4 DIO read without exposing stale data. This helps to improve multi-thread DIO read performance on high-speed disks. Skip the nobh and data=journal mount cases to make things simple for now. Signed-off-by: Jiaying Zhang <[email protected]> Signed-off-by: "Theodore Ts'o" <[email protected]>
static inline int ext4_begin_ordered_truncate(struct inode *inode, loff_t new_size) { return jbd2_journal_begin_ordered_truncate( EXT4_SB(inode->i_sb)->s_journal, &EXT4_I(inode)->jinode, new_size); }
static inline int ext4_begin_ordered_truncate(struct inode *inode, loff_t new_size) { return jbd2_journal_begin_ordered_truncate( EXT4_SB(inode->i_sb)->s_journal, &EXT4_I(inode)->jinode, new_size); }
C
linux
0
CVE-2016-1654
https://www.cvedetails.com/cve/CVE-2016-1654/
CWE-20
https://github.com/chromium/chromium/commit/8355de453bb4014b74b2db5d7ca38c5664d65d83
8355de453bb4014b74b2db5d7ca38c5664d65d83
Use an opaque URL rather than an empty URL for request's site for cookies. Apparently this makes a big difference to the cookie settings backend. Bug: 881715 Change-Id: Id87fa0c6a858bae6a3f8fff4d6af3f974b00d5e4 Reviewed-on: https://chromium-review.googlesource.com/1212846 Commit-Queue: Mike West <[email protected]> Reviewed-by: Camille Lamy <[email protected]> Cr-Commit-Position: refs/heads/master@{#589512}
mojom::NavigationClient* NavigationRequest::GetCommitNavigationClient() { if (commit_navigation_client_ && commit_navigation_client_.is_bound()) return commit_navigation_client_.get(); return nullptr; }
mojom::NavigationClient* NavigationRequest::GetCommitNavigationClient() { if (commit_navigation_client_ && commit_navigation_client_.is_bound()) return commit_navigation_client_.get(); return nullptr; }
C
Chrome
0
CVE-2013-1767
https://www.cvedetails.com/cve/CVE-2013-1767/
CWE-399
https://github.com/torvalds/linux/commit/5f00110f7273f9ff04ac69a5f85bb535a4fd0987
5f00110f7273f9ff04ac69a5f85bb535a4fd0987
tmpfs: fix use-after-free of mempolicy object The tmpfs remount logic preserves filesystem mempolicy if the mpol=M option is not specified in the remount request. A new policy can be specified if mpol=M is given. Before this patch remounting an mpol bound tmpfs without specifying mpol= mount option in the remount request would set the filesystem's mempolicy object to a freed mempolicy object. To reproduce the problem boot a DEBUG_PAGEALLOC kernel and run: # mkdir /tmp/x # mount -t tmpfs -o size=100M,mpol=interleave nodev /tmp/x # grep /tmp/x /proc/mounts nodev /tmp/x tmpfs rw,relatime,size=102400k,mpol=interleave:0-3 0 0 # mount -o remount,size=200M nodev /tmp/x # grep /tmp/x /proc/mounts nodev /tmp/x tmpfs rw,relatime,size=204800k,mpol=??? 0 0 # note ? garbage in mpol=... output above # dd if=/dev/zero of=/tmp/x/f count=1 # panic here Panic: BUG: unable to handle kernel NULL pointer dereference at (null) IP: [< (null)>] (null) [...] Oops: 0010 [#1] SMP DEBUG_PAGEALLOC Call Trace: mpol_shared_policy_init+0xa5/0x160 shmem_get_inode+0x209/0x270 shmem_mknod+0x3e/0xf0 shmem_create+0x18/0x20 vfs_create+0xb5/0x130 do_last+0x9a1/0xea0 path_openat+0xb3/0x4d0 do_filp_open+0x42/0xa0 do_sys_open+0xfe/0x1e0 compat_sys_open+0x1b/0x20 cstar_dispatch+0x7/0x1f Non-debug kernels will not crash immediately because referencing the dangling mpol will not cause a fault. Instead the filesystem will reference a freed mempolicy object, which will cause unpredictable behavior. The problem boils down to a dropped mpol reference below if shmem_parse_options() does not allocate a new mpol: config = *sbinfo shmem_parse_options(data, &config, true) mpol_put(sbinfo->mpol) sbinfo->mpol = config.mpol /* BUG: saves unreferenced mpol */ This patch avoids the crash by not releasing the mempolicy if shmem_parse_options() doesn't create a new mpol. How far back does this issue go? I see it in both 2.6.36 and 3.3. I did not look back further. Signed-off-by: Greg Thelen <[email protected]> Acked-by: Hugh Dickins <[email protected]> Cc: <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
int shmem_lock(struct file *file, int lock, struct user_struct *user) { struct inode *inode = file->f_path.dentry->d_inode; struct shmem_inode_info *info = SHMEM_I(inode); int retval = -ENOMEM; spin_lock(&info->lock); if (lock && !(info->flags & VM_LOCKED)) { if (!user_shm_lock(inode->i_size, user)) goto out_nomem; info->flags |= VM_LOCKED; mapping_set_unevictable(file->f_mapping); } if (!lock && (info->flags & VM_LOCKED) && user) { user_shm_unlock(inode->i_size, user); info->flags &= ~VM_LOCKED; mapping_clear_unevictable(file->f_mapping); } retval = 0; out_nomem: spin_unlock(&info->lock); return retval; }
int shmem_lock(struct file *file, int lock, struct user_struct *user) { struct inode *inode = file->f_path.dentry->d_inode; struct shmem_inode_info *info = SHMEM_I(inode); int retval = -ENOMEM; spin_lock(&info->lock); if (lock && !(info->flags & VM_LOCKED)) { if (!user_shm_lock(inode->i_size, user)) goto out_nomem; info->flags |= VM_LOCKED; mapping_set_unevictable(file->f_mapping); } if (!lock && (info->flags & VM_LOCKED) && user) { user_shm_unlock(inode->i_size, user); info->flags &= ~VM_LOCKED; mapping_clear_unevictable(file->f_mapping); } retval = 0; out_nomem: spin_unlock(&info->lock); return retval; }
C
linux
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]>
static int may_open(const struct path *path, int acc_mode, int flag) { struct dentry *dentry = path->dentry; struct inode *inode = dentry->d_inode; int error; if (!inode) return -ENOENT; switch (inode->i_mode & S_IFMT) { case S_IFLNK: return -ELOOP; case S_IFDIR: if (acc_mode & MAY_WRITE) return -EISDIR; break; case S_IFBLK: case S_IFCHR: if (!may_open_dev(path)) return -EACCES; /*FALLTHRU*/ case S_IFIFO: case S_IFSOCK: flag &= ~O_TRUNC; break; } error = inode_permission(inode, MAY_OPEN | acc_mode); if (error) return error; /* * An append-only file must be opened in append mode for writing. */ if (IS_APPEND(inode)) { if ((flag & O_ACCMODE) != O_RDONLY && !(flag & O_APPEND)) return -EPERM; if (flag & O_TRUNC) return -EPERM; } /* O_NOATIME can only be set by the owner or superuser */ if (flag & O_NOATIME && !inode_owner_or_capable(inode)) return -EPERM; return 0; }
static int may_open(const struct path *path, int acc_mode, int flag) { struct dentry *dentry = path->dentry; struct inode *inode = dentry->d_inode; int error; if (!inode) return -ENOENT; switch (inode->i_mode & S_IFMT) { case S_IFLNK: return -ELOOP; case S_IFDIR: if (acc_mode & MAY_WRITE) return -EISDIR; break; case S_IFBLK: case S_IFCHR: if (!may_open_dev(path)) return -EACCES; /*FALLTHRU*/ case S_IFIFO: case S_IFSOCK: flag &= ~O_TRUNC; break; } error = inode_permission(inode, MAY_OPEN | acc_mode); if (error) return error; /* * An append-only file must be opened in append mode for writing. */ if (IS_APPEND(inode)) { if ((flag & O_ACCMODE) != O_RDONLY && !(flag & O_APPEND)) return -EPERM; if (flag & O_TRUNC) return -EPERM; } /* O_NOATIME can only be set by the owner or superuser */ if (flag & O_NOATIME && !inode_owner_or_capable(inode)) return -EPERM; return 0; }
C
linux
0
CVE-2015-8104
https://www.cvedetails.com/cve/CVE-2015-8104/
CWE-399
https://github.com/torvalds/linux/commit/cbdb967af3d54993f5814f1cee0ed311a055377d
cbdb967af3d54993f5814f1cee0ed311a055377d
KVM: svm: unconditionally intercept #DB This is needed to avoid the possibility that the guest triggers an infinite stream of #DB exceptions (CVE-2015-8104). VMX is not affected: because it does not save DR6 in the VMCS, it already intercepts #DB unconditionally. Reported-by: Jan Beulich <[email protected]> Cc: [email protected] Signed-off-by: Paolo Bonzini <[email protected]>
static int invlpga_interception(struct vcpu_svm *svm) { struct kvm_vcpu *vcpu = &svm->vcpu; trace_kvm_invlpga(svm->vmcb->save.rip, kvm_register_read(&svm->vcpu, VCPU_REGS_RCX), kvm_register_read(&svm->vcpu, VCPU_REGS_RAX)); /* Let's treat INVLPGA the same as INVLPG (can be optimized!) */ kvm_mmu_invlpg(vcpu, kvm_register_read(&svm->vcpu, VCPU_REGS_RAX)); svm->next_rip = kvm_rip_read(&svm->vcpu) + 3; skip_emulated_instruction(&svm->vcpu); return 1; }
static int invlpga_interception(struct vcpu_svm *svm) { struct kvm_vcpu *vcpu = &svm->vcpu; trace_kvm_invlpga(svm->vmcb->save.rip, kvm_register_read(&svm->vcpu, VCPU_REGS_RCX), kvm_register_read(&svm->vcpu, VCPU_REGS_RAX)); /* Let's treat INVLPGA the same as INVLPG (can be optimized!) */ kvm_mmu_invlpg(vcpu, kvm_register_read(&svm->vcpu, VCPU_REGS_RAX)); svm->next_rip = kvm_rip_read(&svm->vcpu) + 3; skip_emulated_instruction(&svm->vcpu); return 1; }
C
linux
0
CVE-2017-7376
https://www.cvedetails.com/cve/CVE-2017-7376/
CWE-119
https://android.googlesource.com/platform/external/libxml2/+/51e0cb2e5ec18eaf6fb331bc573ff27b743898f4
51e0cb2e5ec18eaf6fb331bc573ff27b743898f4
DO NOT MERGE: Use correct limit for port values no upstream report yet, add it here when we have it issue found & patch by nmehta@ Bug: 36555370 Change-Id: Ibf1efea554b95f514e23e939363d608021de4614 (cherry picked from commit b62884fb49fe92081e414966d9b5fe58250ae53c)
xmlParse3986Host(xmlURIPtr uri, const char **str) { const char *cur = *str; const char *host; host = cur; /* * IPv6 and future adressing scheme are enclosed between brackets */ if (*cur == '[') { cur++; while ((*cur != ']') && (*cur != 0)) cur++; if (*cur != ']') return(1); cur++; goto found; } /* * try to parse an IPv4 */ if (ISA_DIGIT(cur)) { if (xmlParse3986DecOctet(&cur) != 0) goto not_ipv4; if (*cur != '.') goto not_ipv4; cur++; if (xmlParse3986DecOctet(&cur) != 0) goto not_ipv4; if (*cur != '.') goto not_ipv4; if (xmlParse3986DecOctet(&cur) != 0) goto not_ipv4; if (*cur != '.') goto not_ipv4; if (xmlParse3986DecOctet(&cur) != 0) goto not_ipv4; goto found; not_ipv4: cur = *str; } /* * then this should be a hostname which can be empty */ while (ISA_UNRESERVED(cur) || ISA_PCT_ENCODED(cur) || ISA_SUB_DELIM(cur)) NEXT(cur); found: if (uri != NULL) { if (uri->authority != NULL) xmlFree(uri->authority); uri->authority = NULL; if (uri->server != NULL) xmlFree(uri->server); if (cur != host) { if (uri->cleanup & 2) uri->server = STRNDUP(host, cur - host); else uri->server = xmlURIUnescapeString(host, cur - host, NULL); } else uri->server = NULL; } *str = cur; return(0); }
xmlParse3986Host(xmlURIPtr uri, const char **str) { const char *cur = *str; const char *host; host = cur; /* * IPv6 and future adressing scheme are enclosed between brackets */ if (*cur == '[') { cur++; while ((*cur != ']') && (*cur != 0)) cur++; if (*cur != ']') return(1); cur++; goto found; } /* * try to parse an IPv4 */ if (ISA_DIGIT(cur)) { if (xmlParse3986DecOctet(&cur) != 0) goto not_ipv4; if (*cur != '.') goto not_ipv4; cur++; if (xmlParse3986DecOctet(&cur) != 0) goto not_ipv4; if (*cur != '.') goto not_ipv4; if (xmlParse3986DecOctet(&cur) != 0) goto not_ipv4; if (*cur != '.') goto not_ipv4; if (xmlParse3986DecOctet(&cur) != 0) goto not_ipv4; goto found; not_ipv4: cur = *str; } /* * then this should be a hostname which can be empty */ while (ISA_UNRESERVED(cur) || ISA_PCT_ENCODED(cur) || ISA_SUB_DELIM(cur)) NEXT(cur); found: if (uri != NULL) { if (uri->authority != NULL) xmlFree(uri->authority); uri->authority = NULL; if (uri->server != NULL) xmlFree(uri->server); if (cur != host) { if (uri->cleanup & 2) uri->server = STRNDUP(host, cur - host); else uri->server = xmlURIUnescapeString(host, cur - host, NULL); } else uri->server = NULL; } *str = cur; return(0); }
C
Android
0
CVE-2019-5788
https://www.cvedetails.com/cve/CVE-2019-5788/
CWE-190
https://github.com/chromium/chromium/commit/b38064dbb21aaf32151073dcb7d594b240c68f73
b38064dbb21aaf32151073dcb7d594b240c68f73
[FileSystem] Harden against overflows of OperationID a bit better. Rather than having a UAF when OperationID overflows instead overwrite the old operation with the new one. Can still cause weirdness, but at least won't result in UAF. Also update OperationID to uint64_t to make sure we don't overflow to begin with. Bug: 925864 Change-Id: Ifdf3fa0935ab5ea8802d91bba39601f02b0dbdc9 Reviewed-on: https://chromium-review.googlesource.com/c/1441498 Commit-Queue: Marijn Kruisselbrink <[email protected]> Reviewed-by: Victor Costan <[email protected]> Cr-Commit-Position: refs/heads/master@{#627115}
void FileSystemOperationRunner::DidOpenFile( const OperationID id, OpenFileCallback callback, base::File file, base::OnceClosure on_close_callback) { if (is_beginning_operation_) { finished_operations_.insert(id); base::ThreadTaskRunnerHandle::Get()->PostTask( FROM_HERE, base::BindOnce(&FileSystemOperationRunner::DidOpenFile, weak_ptr_, id, std::move(callback), std::move(file), std::move(on_close_callback))); return; } std::move(callback).Run(std::move(file), std::move(on_close_callback)); FinishOperation(id); }
void FileSystemOperationRunner::DidOpenFile( const OperationID id, OpenFileCallback callback, base::File file, base::OnceClosure on_close_callback) { if (is_beginning_operation_) { finished_operations_.insert(id); base::ThreadTaskRunnerHandle::Get()->PostTask( FROM_HERE, base::BindOnce(&FileSystemOperationRunner::DidOpenFile, weak_ptr_, id, std::move(callback), std::move(file), std::move(on_close_callback))); return; } std::move(callback).Run(std::move(file), std::move(on_close_callback)); FinishOperation(id); }
C
Chrome
0
CVE-2011-3209
https://www.cvedetails.com/cve/CVE-2011-3209/
CWE-189
https://github.com/torvalds/linux/commit/f8bd2258e2d520dff28c855658bd24bdafb5102d
f8bd2258e2d520dff28c855658bd24bdafb5102d
remove div_long_long_rem x86 is the only arch right now, which provides an optimized for div_long_long_rem and it has the downside that one has to be very careful that the divide doesn't overflow. The API is a little akward, as the arguments for the unsigned divide are signed. The signed version also doesn't handle a negative divisor and produces worse code on 64bit archs. There is little incentive to keep this API alive, so this converts the few users to the new API. Signed-off-by: Roman Zippel <[email protected]> Cc: Ralf Baechle <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Thomas Gleixner <[email protected]> Cc: john stultz <[email protected]> Cc: Christoph Lameter <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
int do_sys_settimeofday(struct timespec *tv, struct timezone *tz) { static int firsttime = 1; int error = 0; if (tv && !timespec_valid(tv)) return -EINVAL; error = security_settime(tv, tz); if (error) return error; if (tz) { /* SMP safe, global irq locking makes it work. */ sys_tz = *tz; update_vsyscall_tz(); if (firsttime) { firsttime = 0; if (!tv) warp_clock(); } } if (tv) { /* SMP safe, again the code in arch/foo/time.c should * globally block out interrupts when it runs. */ return do_settimeofday(tv); } return 0; }
int do_sys_settimeofday(struct timespec *tv, struct timezone *tz) { static int firsttime = 1; int error = 0; if (tv && !timespec_valid(tv)) return -EINVAL; error = security_settime(tv, tz); if (error) return error; if (tz) { /* SMP safe, global irq locking makes it work. */ sys_tz = *tz; update_vsyscall_tz(); if (firsttime) { firsttime = 0; if (!tv) warp_clock(); } } if (tv) { /* SMP safe, again the code in arch/foo/time.c should * globally block out interrupts when it runs. */ return do_settimeofday(tv); } return 0; }
C
linux
0
CVE-2011-4621
https://www.cvedetails.com/cve/CVE-2011-4621/
null
https://github.com/torvalds/linux/commit/f26f9aff6aaf67e9a430d16c266f91b13a5bff64
f26f9aff6aaf67e9a430d16c266f91b13a5bff64
Sched: fix skip_clock_update optimization idle_balance() drops/retakes rq->lock, leaving the previous task vulnerable to set_tsk_need_resched(). Clear it after we return from balancing instead, and in setup_thread_stack() as well, so no successfully descheduled or never scheduled task has it set. Need resched confused the skip_clock_update logic, which assumes that the next call to update_rq_clock() will come nearly immediately after being set. Make the optimization robust against the waking a sleeper before it sucessfully deschedules case by checking that the current task has not been dequeued before setting the flag, since it is that useless clock update we're trying to save, and clear unconditionally in schedule() proper instead of conditionally in put_prev_task(). Signed-off-by: Mike Galbraith <[email protected]> Reported-by: Bjoern B. Brandenburg <[email protected]> Tested-by: Yong Zhang <[email protected]> Signed-off-by: Peter Zijlstra <[email protected]> Cc: [email protected] LKML-Reference: <[email protected]> Signed-off-by: Ingo Molnar <[email protected]>
static ssize_t sched_power_savings_store(const char *buf, size_t count, int smt) { unsigned int level = 0; if (sscanf(buf, "%u", &level) != 1) return -EINVAL; /* * level is always be positive so don't check for * level < POWERSAVINGS_BALANCE_NONE which is 0 * What happens on 0 or 1 byte write, * need to check for count as well? */ if (level >= MAX_POWERSAVINGS_BALANCE_LEVELS) return -EINVAL; if (smt) sched_smt_power_savings = level; else sched_mc_power_savings = level; arch_reinit_sched_domains(); return count; }
static ssize_t sched_power_savings_store(const char *buf, size_t count, int smt) { unsigned int level = 0; if (sscanf(buf, "%u", &level) != 1) return -EINVAL; /* * level is always be positive so don't check for * level < POWERSAVINGS_BALANCE_NONE which is 0 * What happens on 0 or 1 byte write, * need to check for count as well? */ if (level >= MAX_POWERSAVINGS_BALANCE_LEVELS) return -EINVAL; if (smt) sched_smt_power_savings = level; else sched_mc_power_savings = level; arch_reinit_sched_domains(); return count; }
C
linux
0
CVE-2012-2313
https://www.cvedetails.com/cve/CVE-2012-2313/
CWE-264
https://github.com/torvalds/linux/commit/1bb57e940e1958e40d51f2078f50c3a96a9b2d75
1bb57e940e1958e40d51f2078f50c3a96a9b2d75
dl2k: Clean up rio_ioctl The dl2k driver's rio_ioctl call has a few issues: - No permissions checking - Implements SIOCGMIIREG and SIOCGMIIREG using the SIOCDEVPRIVATE numbers - Has a few ioctls that may have been used for debugging at one point but have no place in the kernel proper. This patch removes all but the MII ioctls, renumbers them to use the standard ones, and adds the proper permission check for SIOCSMIIREG. We can also get rid of the dl2k-specific struct mii_data in favor of the generic struct mii_ioctl_data. Since we have the phyid on hand, we can add the SIOCGMIIPHY ioctl too. Most of the MII code for the driver could probably be converted to use the generic MII library but I don't have a device to test the results. Reported-by: Stephan Mueller <[email protected]> Signed-off-by: Jeff Mahoney <[email protected]> Signed-off-by: David S. Miller <[email protected]>
mii_send_bits (struct net_device *dev, u32 data, int len) { int i; for (i = len - 1; i >= 0; i--) { mii_sendbit (dev, data & (1 << i)); } }
mii_send_bits (struct net_device *dev, u32 data, int len) { int i; for (i = len - 1; i >= 0; i--) { mii_sendbit (dev, data & (1 << i)); } }
C
linux
0
CVE-2011-2803
https://www.cvedetails.com/cve/CVE-2011-2803/
CWE-119
https://github.com/chromium/chromium/commit/48f2ec5c24570c9b96bb2798a9ffe956117c5066
48f2ec5c24570c9b96bb2798a9ffe956117c5066
Add OVERRIDE to ui::TreeModelObserver overridden methods. BUG=None TEST=None [email protected] Review URL: http://codereview.chromium.org/7046093 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@88827 0039d316-1c4b-4281-b951-d872f2087c98
void TreeView::CancelEdit() { DCHECK(tree_view_); TreeView_EndEditLabelNow(tree_view_, TRUE); }
void TreeView::CancelEdit() { DCHECK(tree_view_); TreeView_EndEditLabelNow(tree_view_, TRUE); }
C
Chrome
0
CVE-2011-2853
https://www.cvedetails.com/cve/CVE-2011-2853/
CWE-399
https://github.com/chromium/chromium/commit/d82e91c46938520466e9d7c695e0bc638fc70970
d82e91c46938520466e9d7c695e0bc638fc70970
Fixed brekage when PureViews are enable but Desktop is not [email protected] BUG=none TEST=chrome starts with --use-pure-views with touchui Review URL: http://codereview.chromium.org/7210037 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@91197 0039d316-1c4b-4281-b951-d872f2087c98
gboolean BrowserFrameGtk::OnWindowStateEvent(GtkWidget* widget, GdkEventWindowState* event) { bool was_full_screen = IsFullscreen(); gboolean result = views::NativeWidgetGtk::OnWindowStateEvent(widget, event); if ((!IsVisible() || IsMinimized()) && browser_view_->GetStatusBubble()) { browser_view_->GetStatusBubble()->Hide(); } if (was_full_screen != IsFullscreen()) browser_view_->FullScreenStateChanged(); return result; }
gboolean BrowserFrameGtk::OnWindowStateEvent(GtkWidget* widget, GdkEventWindowState* event) { bool was_full_screen = IsFullscreen(); gboolean result = views::NativeWidgetGtk::OnWindowStateEvent(widget, event); if ((!IsVisible() || IsMinimized()) && browser_view_->GetStatusBubble()) { browser_view_->GetStatusBubble()->Hide(); } if (was_full_screen != IsFullscreen()) browser_view_->FullScreenStateChanged(); return result; }
C
Chrome
0
null
null
null
https://github.com/chromium/chromium/commit/7480de4954fe0ea90dd9e49c4f583f6ea321a55b
7480de4954fe0ea90dd9e49c4f583f6ea321a55b
GTK: allow bookmark manager to MOVE as well as COPY. BUG=41601 TEST=manual Review URL: http://codereview.chromium.org/1610035 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@44955 0039d316-1c4b-4281-b951-d872f2087c98
CustomDrag::CustomDrag(SkBitmap* icon, int code_mask, GdkDragAction action) : drag_widget_(gtk_invisible_new()), pixbuf_(icon ? gfx::GdkPixbufFromSkBitmap(icon) : NULL) { g_object_ref_sink(drag_widget_); g_signal_connect(drag_widget_, "drag-data-get", G_CALLBACK(OnDragDataGetThunk), this); g_signal_connect(drag_widget_, "drag-begin", G_CALLBACK(OnDragBeginThunk), this); g_signal_connect(drag_widget_, "drag-end", G_CALLBACK(OnDragEndThunk), this); GtkTargetList* list = gtk_dnd_util::GetTargetListFromCodeMask(code_mask); GdkEvent* event = gtk_get_current_event(); gtk_drag_begin(drag_widget_, list, action, 1, event); if (event) gdk_event_free(event); gtk_target_list_unref(list); }
CustomDrag::CustomDrag(SkBitmap* icon, int code_mask, GdkDragAction action) : drag_widget_(gtk_invisible_new()), pixbuf_(icon ? gfx::GdkPixbufFromSkBitmap(icon) : NULL) { g_object_ref_sink(drag_widget_); g_signal_connect(drag_widget_, "drag-data-get", G_CALLBACK(OnDragDataGetThunk), this); g_signal_connect(drag_widget_, "drag-begin", G_CALLBACK(OnDragBeginThunk), this); g_signal_connect(drag_widget_, "drag-end", G_CALLBACK(OnDragEndThunk), this); GtkTargetList* list = gtk_dnd_util::GetTargetListFromCodeMask(code_mask); GdkEvent* event = gtk_get_current_event(); gtk_drag_begin(drag_widget_, list, action, 1, event); if (event) gdk_event_free(event); gtk_target_list_unref(list); }
C
Chrome
0
CVE-2018-17471
https://www.cvedetails.com/cve/CVE-2018-17471/
CWE-20
https://github.com/chromium/chromium/commit/d18c519758c2e6043f0e1f00e2b69a55b3d7997f
d18c519758c2e6043f0e1f00e2b69a55b3d7997f
Security drop fullscreen for any nested WebContents level. This relands 3dcaec6e30feebefc11e with a fix to the test. BUG=873080 TEST=as in bug Change-Id: Ie68b197fc6b92447e9633f233354a68fefcf20c7 Reviewed-on: https://chromium-review.googlesource.com/1175925 Reviewed-by: Sidney San Martín <[email protected]> Commit-Queue: Avi Drissman <[email protected]> Cr-Commit-Position: refs/heads/master@{#583335}
void Wait() { if (!found_value_) run_loop_.Run(); }
void Wait() { if (!found_value_) run_loop_.Run(); }
C
Chrome
0
CVE-2010-1155
https://www.cvedetails.com/cve/CVE-2010-1155/
CWE-20
https://github.com/ensc/irssi-proxy/commit/85bbc05b21678e80423815d2ef1dfe26208491ab
85bbc05b21678e80423815d2ef1dfe26208491ab
Check if an SSL certificate matches the hostname of the server we are connecting to git-svn-id: http://svn.irssi.org/repos/irssi/trunk@5104 dbcabf3a-b0e7-0310-adc4-f8d773084564
GIOChannel *net_connect_ip_ssl(IPADDR *ip, int port, IPADDR *my_ip, const char *cert, const char *pkey, const char *cafile, const char *capath, gboolean verify) GIOChannel *net_connect_ip_ssl(IPADDR *ip, int port, const char* hostname, IPADDR *my_ip, const char *cert, const char *pkey, const char *cafile, const char *capath, gboolean verify) { GIOChannel *handle, *ssl_handle; handle = net_connect_ip(ip, port, my_ip); if (handle == NULL) return NULL; ssl_handle = irssi_ssl_get_iochannel(handle, hostname, cert, pkey, cafile, capath, verify); if (ssl_handle == NULL) g_io_channel_unref(handle); return ssl_handle; }
GIOChannel *net_connect_ip_ssl(IPADDR *ip, int port, IPADDR *my_ip, const char *cert, const char *pkey, const char *cafile, const char *capath, gboolean verify) { GIOChannel *handle, *ssl_handle; handle = net_connect_ip(ip, port, my_ip); if (handle == NULL) return NULL; ssl_handle = irssi_ssl_get_iochannel(handle, cert, pkey, cafile, capath, verify); if (ssl_handle == NULL) g_io_channel_unref(handle); return ssl_handle; }
C
irssi-proxy
1
CVE-2018-19044
https://www.cvedetails.com/cve/CVE-2018-19044/
CWE-59
https://github.com/acassen/keepalived/commit/04f2d32871bb3b11d7dc024039952f2fe2750306
04f2d32871bb3b11d7dc024039952f2fe2750306
When opening files for write, ensure they aren't symbolic links Issue #1048 identified that if, for example, a non privileged user created a symbolic link from /etc/keepalvied.data to /etc/passwd, writing to /etc/keepalived.data (which could be invoked via DBus) would cause /etc/passwd to be overwritten. This commit stops keepalived writing to pathnames where the ultimate component is a symbolic link, by setting O_NOFOLLOW whenever opening a file for writing. This might break some setups, where, for example, /etc/keepalived.data was a symbolic link to /home/fred/keepalived.data. If this was the case, instead create a symbolic link from /home/fred/keepalived.data to /tmp/keepalived.data, so that the file is still accessible via /home/fred/keepalived.data. There doesn't appear to be a way around this backward incompatibility, since even checking if the pathname is a symbolic link prior to opening for writing would create a race condition. Signed-off-by: Quentin Armitage <[email protected]>
vrrp_garp_refresh_handler(vector_t *strvec) { vrrp_t *vrrp = LIST_TAIL_DATA(vrrp_data->vrrp); unsigned refresh; if (!read_unsigned_strvec(strvec, 1, &refresh, 0, UINT_MAX, true)) { report_config_error(CONFIG_GENERAL_ERROR, "(%s): Invalid garp_master_refresh '%s' - ignoring", vrrp->iname, FMT_STR_VSLOT(strvec, 1)); vrrp->garp_refresh.tv_sec = 0; } else vrrp->garp_refresh.tv_sec = refresh; vrrp->garp_refresh.tv_usec = 0; }
vrrp_garp_refresh_handler(vector_t *strvec) { vrrp_t *vrrp = LIST_TAIL_DATA(vrrp_data->vrrp); unsigned refresh; if (!read_unsigned_strvec(strvec, 1, &refresh, 0, UINT_MAX, true)) { report_config_error(CONFIG_GENERAL_ERROR, "(%s): Invalid garp_master_refresh '%s' - ignoring", vrrp->iname, FMT_STR_VSLOT(strvec, 1)); vrrp->garp_refresh.tv_sec = 0; } else vrrp->garp_refresh.tv_sec = refresh; vrrp->garp_refresh.tv_usec = 0; }
C
keepalived
0
CVE-2015-3842
https://www.cvedetails.com/cve/CVE-2015-3842/
CWE-119
https://android.googlesource.com/platform/frameworks/av/+/aeea52da00d210587fb3ed895de3d5f2e0264c88
aeea52da00d210587fb3ed895de3d5f2e0264c88
audio effects: fix heap overflow Check consistency of effect command reply sizes before copying to reply address. Also add null pointer check on reply size. Also remove unused parameter warning. Bug: 21953516. Change-Id: I4cf00c12eaed696af28f3b7613f7e36f47a160c4 (cherry picked from commit 0f714a464d2425afe00d6450535e763131b40844)
uint32_t VirtualizerGetStrength(EffectContext *pContext){ LVM_ControlParams_t ActiveParams; /* Current control Parameters */ LVM_ReturnStatus_en LvmStatus = LVM_SUCCESS; /* Function call status */ LvmStatus = LVM_GetControlParameters(pContext->pBundledContext->hInstance, &ActiveParams); LVM_ERROR_CHECK(LvmStatus, "LVM_GetControlParameters", "VirtualizerGetStrength") if(LvmStatus != LVM_SUCCESS) return -EINVAL; return pContext->pBundledContext->VirtStrengthSaved; } /* end getStrength */
uint32_t VirtualizerGetStrength(EffectContext *pContext){ LVM_ControlParams_t ActiveParams; /* Current control Parameters */ LVM_ReturnStatus_en LvmStatus = LVM_SUCCESS; /* Function call status */ LvmStatus = LVM_GetControlParameters(pContext->pBundledContext->hInstance, &ActiveParams); LVM_ERROR_CHECK(LvmStatus, "LVM_GetControlParameters", "VirtualizerGetStrength") if(LvmStatus != LVM_SUCCESS) return -EINVAL; return pContext->pBundledContext->VirtStrengthSaved; } /* end getStrength */
C
Android
0
CVE-2016-1671
https://www.cvedetails.com/cve/CVE-2016-1671/
CWE-22
https://github.com/chromium/chromium/commit/9cfe470d793da6e09b966d435c8fa2ba1625d5fe
9cfe470d793da6e09b966d435c8fa2ba1625d5fe
[base] Make dynamic container to static span conversion explicit This change disallows implicit conversions from dynamic containers to static spans. This conversion can cause CHECK failures, and thus should be done carefully. Requiring explicit construction makes it more obvious when this happens. To aid usability, appropriate base::make_span<size_t> overloads are added. Bug: 877931 Change-Id: Id9f526bc57bfd30a52d14df827b0445ca087381d Reviewed-on: https://chromium-review.googlesource.com/1189985 Reviewed-by: Ryan Sleevi <[email protected]> Reviewed-by: Balazs Engedy <[email protected]> Reviewed-by: Daniel Cheng <[email protected]> Commit-Queue: Jan Wilken Dörrie <[email protected]> Cr-Commit-Position: refs/heads/master@{#586657}
void GenerateNtlmResponseV1WithSessionSecurity( const base::string16& password, base::span<const uint8_t, kChallengeLen> server_challenge, base::span<const uint8_t, kChallengeLen> client_challenge, base::span<uint8_t, kResponseLenV1> ntlm_response) { uint8_t ntlm_hash[kNtlmHashLen]; GenerateNtlmHashV1(password, ntlm_hash); uint8_t session_hash[kNtlmHashLen]; GenerateSessionHashV1WithSessionSecurity(server_challenge, client_challenge, session_hash); GenerateResponseDesl( ntlm_hash, base::make_span(session_hash).subspan<0, kChallengeLen>(), ntlm_response); }
void GenerateNtlmResponseV1WithSessionSecurity( const base::string16& password, base::span<const uint8_t, kChallengeLen> server_challenge, base::span<const uint8_t, kChallengeLen> client_challenge, base::span<uint8_t, kResponseLenV1> ntlm_response) { uint8_t ntlm_hash[kNtlmHashLen]; GenerateNtlmHashV1(password, ntlm_hash); uint8_t session_hash[kNtlmHashLen]; GenerateSessionHashV1WithSessionSecurity(server_challenge, client_challenge, session_hash); GenerateResponseDesl( ntlm_hash, base::make_span(session_hash).subspan<0, kChallengeLen>(), ntlm_response); }
C
Chrome
0
CVE-2017-18202
https://www.cvedetails.com/cve/CVE-2017-18202/
CWE-416
https://github.com/torvalds/linux/commit/687cb0884a714ff484d038e9190edc874edcf146
687cb0884a714ff484d038e9190edc874edcf146
mm, oom_reaper: gather each vma to prevent leaking TLB entry tlb_gather_mmu(&tlb, mm, 0, -1) means gathering the whole virtual memory space. In this case, tlb->fullmm is true. Some archs like arm64 doesn't flush TLB when tlb->fullmm is true: commit 5a7862e83000 ("arm64: tlbflush: avoid flushing when fullmm == 1"). Which causes leaking of tlb entries. Will clarifies his patch: "Basically, we tag each address space with an ASID (PCID on x86) which is resident in the TLB. This means we can elide TLB invalidation when pulling down a full mm because we won't ever assign that ASID to another mm without doing TLB invalidation elsewhere (which actually just nukes the whole TLB). I think that means that we could potentially not fault on a kernel uaccess, because we could hit in the TLB" There could be a window between complete_signal() sending IPI to other cores and all threads sharing this mm are really kicked off from cores. In this window, the oom reaper may calls tlb_flush_mmu_tlbonly() to flush TLB then frees pages. However, due to the above problem, the TLB entries are not really flushed on arm64. Other threads are possible to access these pages through TLB entries. Moreover, a copy_to_user() can also write to these pages without generating page fault, causes use-after-free bugs. This patch gathers each vma instead of gathering full vm space. In this case tlb->fullmm is not true. The behavior of oom reaper become similar to munmapping before do_exit, which should be safe for all archs. Link: http://lkml.kernel.org/r/[email protected] Fixes: aac453635549 ("mm, oom: introduce oom reaper") Signed-off-by: Wang Nan <[email protected]> Acked-by: Michal Hocko <[email protected]> Acked-by: David Rientjes <[email protected]> Cc: Minchan Kim <[email protected]> Cc: Will Deacon <[email protected]> Cc: Bob Liu <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Roman Gushchin <[email protected]> Cc: Konstantin Khlebnikov <[email protected]> Cc: Andrea Arcangeli <[email protected]> Cc: <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
static void oom_kill_process(struct oom_control *oc, const char *message) { struct task_struct *p = oc->chosen; unsigned int points = oc->chosen_points; struct task_struct *victim = p; struct task_struct *child; struct task_struct *t; struct mm_struct *mm; unsigned int victim_points = 0; static DEFINE_RATELIMIT_STATE(oom_rs, DEFAULT_RATELIMIT_INTERVAL, DEFAULT_RATELIMIT_BURST); bool can_oom_reap = true; /* * If the task is already exiting, don't alarm the sysadmin or kill * its children or threads, just give it access to memory reserves * so it can die quickly */ task_lock(p); if (task_will_free_mem(p)) { mark_oom_victim(p); wake_oom_reaper(p); task_unlock(p); put_task_struct(p); return; } task_unlock(p); if (__ratelimit(&oom_rs)) dump_header(oc, p); pr_err("%s: Kill process %d (%s) score %u or sacrifice child\n", message, task_pid_nr(p), p->comm, points); /* * If any of p's children has a different mm and is eligible for kill, * the one with the highest oom_badness() score is sacrificed for its * parent. This attempts to lose the minimal amount of work done while * still freeing memory. */ read_lock(&tasklist_lock); for_each_thread(p, t) { list_for_each_entry(child, &t->children, sibling) { unsigned int child_points; if (process_shares_mm(child, p->mm)) continue; /* * oom_badness() returns 0 if the thread is unkillable */ child_points = oom_badness(child, oc->memcg, oc->nodemask, oc->totalpages); if (child_points > victim_points) { put_task_struct(victim); victim = child; victim_points = child_points; get_task_struct(victim); } } } read_unlock(&tasklist_lock); p = find_lock_task_mm(victim); if (!p) { put_task_struct(victim); return; } else if (victim != p) { get_task_struct(p); put_task_struct(victim); victim = p; } /* Get a reference to safely compare mm after task_unlock(victim) */ mm = victim->mm; mmgrab(mm); /* Raise event before sending signal: task reaper must see this */ count_vm_event(OOM_KILL); count_memcg_event_mm(mm, OOM_KILL); /* * We should send SIGKILL before granting access to memory reserves * in order to prevent the OOM victim from depleting the memory * reserves from the user space under its control. */ do_send_sig_info(SIGKILL, SEND_SIG_FORCED, victim, true); mark_oom_victim(victim); pr_err("Killed process %d (%s) total-vm:%lukB, anon-rss:%lukB, file-rss:%lukB, shmem-rss:%lukB\n", task_pid_nr(victim), victim->comm, K(victim->mm->total_vm), K(get_mm_counter(victim->mm, MM_ANONPAGES)), K(get_mm_counter(victim->mm, MM_FILEPAGES)), K(get_mm_counter(victim->mm, MM_SHMEMPAGES))); task_unlock(victim); /* * Kill all user processes sharing victim->mm in other thread groups, if * any. They don't get access to memory reserves, though, to avoid * depletion of all memory. This prevents mm->mmap_sem livelock when an * oom killed thread cannot exit because it requires the semaphore and * its contended by another thread trying to allocate memory itself. * That thread will now get access to memory reserves since it has a * pending fatal signal. */ rcu_read_lock(); for_each_process(p) { if (!process_shares_mm(p, mm)) continue; if (same_thread_group(p, victim)) continue; if (is_global_init(p)) { can_oom_reap = false; set_bit(MMF_OOM_SKIP, &mm->flags); pr_info("oom killer %d (%s) has mm pinned by %d (%s)\n", task_pid_nr(victim), victim->comm, task_pid_nr(p), p->comm); continue; } /* * No use_mm() user needs to read from the userspace so we are * ok to reap it. */ if (unlikely(p->flags & PF_KTHREAD)) continue; do_send_sig_info(SIGKILL, SEND_SIG_FORCED, p, true); } rcu_read_unlock(); if (can_oom_reap) wake_oom_reaper(victim); mmdrop(mm); put_task_struct(victim); }
static void oom_kill_process(struct oom_control *oc, const char *message) { struct task_struct *p = oc->chosen; unsigned int points = oc->chosen_points; struct task_struct *victim = p; struct task_struct *child; struct task_struct *t; struct mm_struct *mm; unsigned int victim_points = 0; static DEFINE_RATELIMIT_STATE(oom_rs, DEFAULT_RATELIMIT_INTERVAL, DEFAULT_RATELIMIT_BURST); bool can_oom_reap = true; /* * If the task is already exiting, don't alarm the sysadmin or kill * its children or threads, just give it access to memory reserves * so it can die quickly */ task_lock(p); if (task_will_free_mem(p)) { mark_oom_victim(p); wake_oom_reaper(p); task_unlock(p); put_task_struct(p); return; } task_unlock(p); if (__ratelimit(&oom_rs)) dump_header(oc, p); pr_err("%s: Kill process %d (%s) score %u or sacrifice child\n", message, task_pid_nr(p), p->comm, points); /* * If any of p's children has a different mm and is eligible for kill, * the one with the highest oom_badness() score is sacrificed for its * parent. This attempts to lose the minimal amount of work done while * still freeing memory. */ read_lock(&tasklist_lock); for_each_thread(p, t) { list_for_each_entry(child, &t->children, sibling) { unsigned int child_points; if (process_shares_mm(child, p->mm)) continue; /* * oom_badness() returns 0 if the thread is unkillable */ child_points = oom_badness(child, oc->memcg, oc->nodemask, oc->totalpages); if (child_points > victim_points) { put_task_struct(victim); victim = child; victim_points = child_points; get_task_struct(victim); } } } read_unlock(&tasklist_lock); p = find_lock_task_mm(victim); if (!p) { put_task_struct(victim); return; } else if (victim != p) { get_task_struct(p); put_task_struct(victim); victim = p; } /* Get a reference to safely compare mm after task_unlock(victim) */ mm = victim->mm; mmgrab(mm); /* Raise event before sending signal: task reaper must see this */ count_vm_event(OOM_KILL); count_memcg_event_mm(mm, OOM_KILL); /* * We should send SIGKILL before granting access to memory reserves * in order to prevent the OOM victim from depleting the memory * reserves from the user space under its control. */ do_send_sig_info(SIGKILL, SEND_SIG_FORCED, victim, true); mark_oom_victim(victim); pr_err("Killed process %d (%s) total-vm:%lukB, anon-rss:%lukB, file-rss:%lukB, shmem-rss:%lukB\n", task_pid_nr(victim), victim->comm, K(victim->mm->total_vm), K(get_mm_counter(victim->mm, MM_ANONPAGES)), K(get_mm_counter(victim->mm, MM_FILEPAGES)), K(get_mm_counter(victim->mm, MM_SHMEMPAGES))); task_unlock(victim); /* * Kill all user processes sharing victim->mm in other thread groups, if * any. They don't get access to memory reserves, though, to avoid * depletion of all memory. This prevents mm->mmap_sem livelock when an * oom killed thread cannot exit because it requires the semaphore and * its contended by another thread trying to allocate memory itself. * That thread will now get access to memory reserves since it has a * pending fatal signal. */ rcu_read_lock(); for_each_process(p) { if (!process_shares_mm(p, mm)) continue; if (same_thread_group(p, victim)) continue; if (is_global_init(p)) { can_oom_reap = false; set_bit(MMF_OOM_SKIP, &mm->flags); pr_info("oom killer %d (%s) has mm pinned by %d (%s)\n", task_pid_nr(victim), victim->comm, task_pid_nr(p), p->comm); continue; } /* * No use_mm() user needs to read from the userspace so we are * ok to reap it. */ if (unlikely(p->flags & PF_KTHREAD)) continue; do_send_sig_info(SIGKILL, SEND_SIG_FORCED, p, true); } rcu_read_unlock(); if (can_oom_reap) wake_oom_reaper(victim); mmdrop(mm); put_task_struct(victim); }
C
linux
0
CVE-2019-5810
https://www.cvedetails.com/cve/CVE-2019-5810/
CWE-200
https://github.com/chromium/chromium/commit/0bd10e13a008389ec14bbe7cc95f17d82ea151c1
0bd10e13a008389ec14bbe7cc95f17d82ea151c1
[autofill] Pin preview font-family to a system font Bug: 916838 Change-Id: I4e874105262f2e15a11a7a18a7afd204e5827400 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1423109 Reviewed-by: Fabio Tirelo <[email protected]> Reviewed-by: Koji Ishii <[email protected]> Commit-Queue: Roger McFarlane <[email protected]> Cr-Commit-Position: refs/heads/master@{#640884}
static WebString GetSuggestedValueWrapper(WebFormControlElement element) { if (element.FormControlType() == "textarea") return element.To<WebFormControlElement>().SuggestedValue(); if (element.FormControlType() == "select-one") return element.To<WebSelectElement>().SuggestedValue(); return element.To<WebInputElement>().SuggestedValue(); }
static WebString GetSuggestedValueWrapper(WebFormControlElement element) { if (element.FormControlType() == "textarea") return element.To<WebFormControlElement>().SuggestedValue(); if (element.FormControlType() == "select-one") return element.To<WebSelectElement>().SuggestedValue(); return element.To<WebInputElement>().SuggestedValue(); }
C
Chrome
0
CVE-2013-0838
https://www.cvedetails.com/cve/CVE-2013-0838/
CWE-264
https://github.com/chromium/chromium/commit/0bd1a6ddb5fb23dfea3e72d60e5e8df4cf5826bc
0bd1a6ddb5fb23dfea3e72d60e5e8df4cf5826bc
Make shared memory segments writable only by their rightful owners. BUG=143859 TEST=Chrome's UI still works on Linux and Chrome OS Review URL: https://chromiumcodereview.appspot.com/10854242 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@158289 0039d316-1c4b-4281-b951-d872f2087c98
static XSyncHandler* GetInstance() { return Singleton<XSyncHandler>::get(); }
static XSyncHandler* GetInstance() { return Singleton<XSyncHandler>::get(); }
C
Chrome
0
CVE-2015-4036
https://www.cvedetails.com/cve/CVE-2015-4036/
CWE-119
https://github.com/torvalds/linux/commit/59c816c1f24df0204e01851431d3bab3eb76719c
59c816c1f24df0204e01851431d3bab3eb76719c
vhost/scsi: potential memory corruption This code in vhost_scsi_make_tpg() is confusing because we limit "tpgt" to UINT_MAX but the data type of "tpg->tport_tpgt" and that is a u16. I looked at the context and it turns out that in vhost_scsi_set_endpoint(), "tpg->tport_tpgt" is used as an offset into the vs_tpg[] array which has VHOST_SCSI_MAX_TARGET (256) elements so anything higher than 255 then it is invalid. I have made that the limit now. In vhost_scsi_send_evt() we mask away values higher than 255, but now that the limit has changed, we don't need the mask. Signed-off-by: Dan Carpenter <[email protected]> Signed-off-by: Nicholas Bellinger <[email protected]>
vhost_scsi_wwn_show_attr_version(struct target_fabric_configfs *tf, char *page) { return sprintf(page, "TCM_VHOST fabric module %s on %s/%s" "on "UTS_RELEASE"\n", VHOST_SCSI_VERSION, utsname()->sysname, utsname()->machine); }
vhost_scsi_wwn_show_attr_version(struct target_fabric_configfs *tf, char *page) { return sprintf(page, "TCM_VHOST fabric module %s on %s/%s" "on "UTS_RELEASE"\n", VHOST_SCSI_VERSION, utsname()->sysname, utsname()->machine); }
C
linux
0
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]>
static size_t copy_page_to_iter_pipe(struct page *page, size_t offset, size_t bytes, struct iov_iter *i) { struct pipe_inode_info *pipe = i->pipe; struct pipe_buffer *buf; size_t off; int idx; if (unlikely(bytes > i->count)) bytes = i->count; if (unlikely(!bytes)) return 0; if (!sanity(i)) return 0; off = i->iov_offset; idx = i->idx; buf = &pipe->bufs[idx]; if (off) { if (offset == off && buf->page == page) { /* merge with the last one */ buf->len += bytes; i->iov_offset += bytes; goto out; } idx = next_idx(idx, pipe); buf = &pipe->bufs[idx]; } if (idx == pipe->curbuf && pipe->nrbufs) return 0; pipe->nrbufs++; buf->ops = &page_cache_pipe_buf_ops; get_page(buf->page = page); buf->offset = offset; buf->len = bytes; i->iov_offset = offset + bytes; i->idx = idx; out: i->count -= bytes; return bytes; }
static size_t copy_page_to_iter_pipe(struct page *page, size_t offset, size_t bytes, struct iov_iter *i) { struct pipe_inode_info *pipe = i->pipe; struct pipe_buffer *buf; size_t off; int idx; if (unlikely(bytes > i->count)) bytes = i->count; if (unlikely(!bytes)) return 0; if (!sanity(i)) return 0; off = i->iov_offset; idx = i->idx; buf = &pipe->bufs[idx]; if (off) { if (offset == off && buf->page == page) { /* merge with the last one */ buf->len += bytes; i->iov_offset += bytes; goto out; } idx = next_idx(idx, pipe); buf = &pipe->bufs[idx]; } if (idx == pipe->curbuf && pipe->nrbufs) return 0; pipe->nrbufs++; buf->ops = &page_cache_pipe_buf_ops; get_page(buf->page = page); buf->offset = offset; buf->len = bytes; i->iov_offset = offset + bytes; i->idx = idx; out: i->count -= bytes; return bytes; }
C
linux
0
CVE-2016-5158
https://www.cvedetails.com/cve/CVE-2016-5158/
CWE-190
https://github.com/chromium/chromium/commit/6a310d99a741f9ba5e4e537c5ec49d3adbe5876f
6a310d99a741f9ba5e4e537c5ec49d3adbe5876f
Position info (item n of m) incorrect if hidden focusable items in list Bug: 836997 Change-Id: I971fa7076f72d51829b36af8e379260d48ca25ec Reviewed-on: https://chromium-review.googlesource.com/c/1450235 Commit-Queue: Aaron Leventhal <[email protected]> Reviewed-by: Nektarios Paisios <[email protected]> Cr-Commit-Position: refs/heads/master@{#628890}
void RunRegressionTest(const base::FilePath::CharType* file_path) { base::FilePath test_path = GetTestFilePath("accessibility", "regression"); base::FilePath test_file = test_path.Append(base::FilePath(file_path)); RunTest(test_file, "accessibility/regression"); }
void RunRegressionTest(const base::FilePath::CharType* file_path) { base::FilePath test_path = GetTestFilePath("accessibility", "regression"); base::FilePath test_file = test_path.Append(base::FilePath(file_path)); RunTest(test_file, "accessibility/regression"); }
C
Chrome
0
CVE-2018-6061
https://www.cvedetails.com/cve/CVE-2018-6061/
CWE-362
https://github.com/chromium/chromium/commit/70340ce072cee8a0bdcddb5f312d32567b2269f6
70340ce072cee8a0bdcddb5f312d32567b2269f6
vaapi vda: Delete owned objects on worker thread in Cleanup() This CL adds a SEQUENCE_CHECKER to Vaapi*Accelerator classes, and posts the destruction of those objects to the appropriate thread on Cleanup(). Also makes {H264,VP8,VP9}Picture RefCountedThreadSafe, see miu@ comment in https://chromium-review.googlesource.com/c/chromium/src/+/794091#message-a64bed985cfaf8a19499a517bb110a7ce581dc0f TEST=play back VP9/VP8/H264 w/ simplechrome on soraka, Release build unstripped, let video play for a few seconds then navigate back; no crashes. Unittests as before: video_decode_accelerator_unittest --test_video_data=test-25fps.vp9:320:240:250:250:35:150:12 video_decode_accelerator_unittest --test_video_data=test-25fps.vp8:320:240:250:250:35:150:11 video_decode_accelerator_unittest --test_video_data=test-25fps.h264:320:240:250:258:35:150:1 Bug: 789160 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: I7d96aaf89c92bf46f00c8b8b36798e057a842ed2 Reviewed-on: https://chromium-review.googlesource.com/794091 Reviewed-by: Pawel Osciak <[email protected]> Commit-Queue: Miguel Casas <[email protected]> Cr-Commit-Position: refs/heads/master@{#523372}
VaapiVideoDecodeAccelerator::VaapiH264Accelerator::VaapiH264Accelerator( VaapiVideoDecodeAccelerator* vaapi_dec, VaapiWrapper* vaapi_wrapper) : vaapi_wrapper_(vaapi_wrapper), vaapi_dec_(vaapi_dec) { DCHECK(vaapi_wrapper_); DCHECK(vaapi_dec_); DETACH_FROM_SEQUENCE(sequence_checker_); }
VaapiVideoDecodeAccelerator::VaapiH264Accelerator::VaapiH264Accelerator( VaapiVideoDecodeAccelerator* vaapi_dec, VaapiWrapper* vaapi_wrapper) : vaapi_wrapper_(vaapi_wrapper), vaapi_dec_(vaapi_dec) { DCHECK(vaapi_wrapper_); DCHECK(vaapi_dec_); }
C
Chrome
1
CVE-2015-5289
https://www.cvedetails.com/cve/CVE-2015-5289/
CWE-119
https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=08fa47c4850cea32c3116665975bca219fbf2fe6
08fa47c4850cea32c3116665975bca219fbf2fe6
null
add_indent(StringInfo out, bool indent, int level) { if (indent) { int i; appendStringInfoCharMacro(out, '\n'); for (i = 0; i < level; i++) appendBinaryStringInfo(out, " ", 4); } }
add_indent(StringInfo out, bool indent, int level) { if (indent) { int i; appendStringInfoCharMacro(out, '\n'); for (i = 0; i < level; i++) appendBinaryStringInfo(out, " ", 4); } }
C
postgresql
0
CVE-2019-5892
https://www.cvedetails.com/cve/CVE-2019-5892/
null
https://github.com/FRRouting/frr/commit/943d595a018e69b550db08cccba1d0778a86705a
943d595a018e69b550db08cccba1d0778a86705a
bgpd: don't use BGP_ATTR_VNC(255) unless ENABLE_BGP_VNC_ATTR is defined Signed-off-by: Lou Berger <[email protected]>
static bool cluster_hash_cmp(const void *p1, const void *p2) { const struct cluster_list *cluster1 = p1; const struct cluster_list *cluster2 = p2; return (cluster1->length == cluster2->length && memcmp(cluster1->list, cluster2->list, cluster1->length) == 0); }
static bool cluster_hash_cmp(const void *p1, const void *p2) { const struct cluster_list *cluster1 = p1; const struct cluster_list *cluster2 = p2; return (cluster1->length == cluster2->length && memcmp(cluster1->list, cluster2->list, cluster1->length) == 0); }
C
frr
0
CVE-2018-18349
https://www.cvedetails.com/cve/CVE-2018-18349/
CWE-732
https://github.com/chromium/chromium/commit/5f8671e7667b8b133bd3664100012a3906e92d65
5f8671e7667b8b133bd3664100012a3906e92d65
Add a check for disallowing remote frame navigations to local resources. Previously, RemoteFrame navigations did not perform any renderer-side checks and relied solely on the browser-side logic to block disallowed navigations via mechanisms like FilterURL. This means that blocked remote frame navigations were silently navigated to about:blank without any console error message. This CL adds a CanDisplay check to the remote navigation path to match an equivalent check done for local frame navigations. This way, the renderer can consistently block disallowed navigations in both cases and output an error message. Bug: 894399 Change-Id: I172f68f77c1676f6ca0172d2a6c78f7edc0e3b7a Reviewed-on: https://chromium-review.googlesource.com/c/1282390 Reviewed-by: Charlie Reis <[email protected]> Reviewed-by: Nate Chapin <[email protected]> Commit-Queue: Alex Moshchuk <[email protected]> Cr-Commit-Position: refs/heads/master@{#601022}
void OnShowCreatedWindow(int pending_widget_routing_id, WindowOpenDisposition disposition, const gfx::Rect& initial_rect, bool user_gesture) { base::PostTaskWithTraits( FROM_HERE, {content::BrowserThread::UI}, base::BindOnce(&PendingWidgetMessageFilter::OnReceivedRoutingIDOnUI, this, pending_widget_routing_id)); }
void OnShowCreatedWindow(int pending_widget_routing_id, WindowOpenDisposition disposition, const gfx::Rect& initial_rect, bool user_gesture) { base::PostTaskWithTraits( FROM_HERE, {content::BrowserThread::UI}, base::BindOnce(&PendingWidgetMessageFilter::OnReceivedRoutingIDOnUI, this, pending_widget_routing_id)); }
C
Chrome
0
CVE-2017-15924
https://www.cvedetails.com/cve/CVE-2017-15924/
CWE-78
https://github.com/shadowsocks/shadowsocks-libev/commit/c67d275803dc6ea22c558d06b1f7ba9f94cd8de3
c67d275803dc6ea22c558d06b1f7ba9f94cd8de3
Fix #1734
signal_cb(EV_P_ ev_signal *w, int revents) { if (revents & EV_SIGNAL) { switch (w->signum) { case SIGINT: case SIGTERM: ev_unloop(EV_A_ EVUNLOOP_ALL); } } }
signal_cb(EV_P_ ev_signal *w, int revents) { if (revents & EV_SIGNAL) { switch (w->signum) { case SIGINT: case SIGTERM: ev_unloop(EV_A_ EVUNLOOP_ALL); } } }
C
shadowsocks-libev
0
CVE-2018-19497
https://www.cvedetails.com/cve/CVE-2018-19497/
CWE-125
https://github.com/sleuthkit/sleuthkit/commit/bc04aa017c0bd297de8a3b7fc40ffc6ddddbb95d
bc04aa017c0bd297de8a3b7fc40ffc6ddddbb95d
Merge pull request #1374 from JordyZomer/develop Fix CVE-2018-19497.
hfs_block_is_alloc(HFS_INFO * hfs, TSK_DADDR_T a_addr) { TSK_FS_INFO *fs = &(hfs->fs_info); TSK_OFF_T b; size_t b2; if (hfs->blockmap_file == NULL) { if ((hfs->blockmap_file = tsk_fs_file_open_meta(fs, NULL, HFS_ALLOCATION_FILE_ID)) == NULL) { tsk_error_errstr2_concat(" - Loading blockmap file"); return -1; } /* cache the data attribute */ hfs->blockmap_attr = tsk_fs_attrlist_get(hfs->blockmap_file->meta->attr, TSK_FS_ATTR_TYPE_DEFAULT); if (!hfs->blockmap_attr) { tsk_error_errstr2_concat (" - Data Attribute not found in Blockmap File"); return -1; } hfs->blockmap_cache_start = -1; hfs->blockmap_cache_len = 0; } b = (TSK_OFF_T) a_addr / 8; if (b > hfs->blockmap_file->meta->size) { tsk_error_set_errno(TSK_ERR_FS_CORRUPT); tsk_error_set_errstr("hfs_block_is_alloc: block %" PRIuDADDR " is too large for bitmap (%" PRIuOFF ")", a_addr, hfs->blockmap_file->meta->size); return -1; } if ((hfs->blockmap_cache_start == -1) || (hfs->blockmap_cache_start > b) || (hfs->blockmap_cache_start + hfs->blockmap_cache_len <= (size_t) b)) { ssize_t cnt = tsk_fs_attr_read(hfs->blockmap_attr, b, hfs->blockmap_cache, sizeof(hfs->blockmap_cache), 0); if (cnt < 1) { tsk_error_set_errstr2 ("hfs_block_is_alloc: Error reading block bitmap at offset %" PRIuOFF, b); return -1; } hfs->blockmap_cache_start = b; hfs->blockmap_cache_len = cnt; } b2 = (size_t) (b - hfs->blockmap_cache_start); return (hfs->blockmap_cache[b2] & (1 << (7 - (a_addr % 8)))) != 0; }
hfs_block_is_alloc(HFS_INFO * hfs, TSK_DADDR_T a_addr) { TSK_FS_INFO *fs = &(hfs->fs_info); TSK_OFF_T b; size_t b2; if (hfs->blockmap_file == NULL) { if ((hfs->blockmap_file = tsk_fs_file_open_meta(fs, NULL, HFS_ALLOCATION_FILE_ID)) == NULL) { tsk_error_errstr2_concat(" - Loading blockmap file"); return -1; } /* cache the data attribute */ hfs->blockmap_attr = tsk_fs_attrlist_get(hfs->blockmap_file->meta->attr, TSK_FS_ATTR_TYPE_DEFAULT); if (!hfs->blockmap_attr) { tsk_error_errstr2_concat (" - Data Attribute not found in Blockmap File"); return -1; } hfs->blockmap_cache_start = -1; hfs->blockmap_cache_len = 0; } b = (TSK_OFF_T) a_addr / 8; if (b > hfs->blockmap_file->meta->size) { tsk_error_set_errno(TSK_ERR_FS_CORRUPT); tsk_error_set_errstr("hfs_block_is_alloc: block %" PRIuDADDR " is too large for bitmap (%" PRIuOFF ")", a_addr, hfs->blockmap_file->meta->size); return -1; } if ((hfs->blockmap_cache_start == -1) || (hfs->blockmap_cache_start > b) || (hfs->blockmap_cache_start + hfs->blockmap_cache_len <= (size_t) b)) { ssize_t cnt = tsk_fs_attr_read(hfs->blockmap_attr, b, hfs->blockmap_cache, sizeof(hfs->blockmap_cache), 0); if (cnt < 1) { tsk_error_set_errstr2 ("hfs_block_is_alloc: Error reading block bitmap at offset %" PRIuOFF, b); return -1; } hfs->blockmap_cache_start = b; hfs->blockmap_cache_len = cnt; } b2 = (size_t) (b - hfs->blockmap_cache_start); return (hfs->blockmap_cache[b2] & (1 << (7 - (a_addr % 8)))) != 0; }
C
sleuthkit
0
CVE-2017-14604
https://www.cvedetails.com/cve/CVE-2017-14604/
CWE-20
https://github.com/GNOME/nautilus/commit/1630f53481f445ada0a455e9979236d31a8d3bb0
1630f53481f445ada0a455e9979236d31a8d3bb0
mime-actions: use file metadata for trusting desktop files Currently we only trust desktop files that have the executable bit set, and don't replace the displayed icon or the displayed name until it's trusted, which prevents for running random programs by a malicious desktop file. However, the executable permission is preserved if the desktop file comes from a compressed file. To prevent this, add a metadata::trusted metadata to the file once the user acknowledges the file as trusted. This adds metadata to the file, which cannot be added unless it has access to the computer. Also remove the SHEBANG "trusted" content we were putting inside the desktop file, since that doesn't add more security since it can come with the file itself. https://bugzilla.gnome.org/show_bug.cgi?id=777991
list_mime_enum_callback (GObject *source_object, GAsyncResult *res, gpointer user_data) { MimeListState *state; GFileEnumerator *enumerator; NautilusDirectory *directory; GError *error; state = user_data; if (g_cancellable_is_cancelled (state->cancellable)) { /* Operation was cancelled. Bail out */ directory = state->directory; directory->details->mime_list_in_progress = NULL; async_job_end (directory, "MIME list"); nautilus_directory_async_state_changed (directory); mime_list_state_free (state); return; } error = NULL; enumerator = g_file_enumerate_children_finish (G_FILE (source_object), res, &error); if (enumerator == NULL) { mime_list_done (state, FALSE); g_error_free (error); mime_list_state_free (state); return; } else { state->enumerator = enumerator; g_file_enumerator_next_files_async (state->enumerator, DIRECTORY_LOAD_ITEMS_PER_CALLBACK, G_PRIORITY_DEFAULT, state->cancellable, mime_list_callback, state); } }
list_mime_enum_callback (GObject *source_object, GAsyncResult *res, gpointer user_data) { MimeListState *state; GFileEnumerator *enumerator; NautilusDirectory *directory; GError *error; state = user_data; if (g_cancellable_is_cancelled (state->cancellable)) { /* Operation was cancelled. Bail out */ directory = state->directory; directory->details->mime_list_in_progress = NULL; async_job_end (directory, "MIME list"); nautilus_directory_async_state_changed (directory); mime_list_state_free (state); return; } error = NULL; enumerator = g_file_enumerate_children_finish (G_FILE (source_object), res, &error); if (enumerator == NULL) { mime_list_done (state, FALSE); g_error_free (error); mime_list_state_free (state); return; } else { state->enumerator = enumerator; g_file_enumerator_next_files_async (state->enumerator, DIRECTORY_LOAD_ITEMS_PER_CALLBACK, G_PRIORITY_DEFAULT, state->cancellable, mime_list_callback, state); } }
C
nautilus
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}
GLES2Implementation::~GLES2Implementation() { WaitForCmd(); query_tracker_.reset(); if (support_client_side_arrays_ && reserved_ids_[0]) { DeleteBuffers(base::size(reserved_ids_), &reserved_ids_[0]); } ClearMappedBufferRangeMap(); share_group_->FreeContext(this); buffer_tracker_.reset(); readback_buffer_shadow_tracker_.reset(); WaitForCmd(); }
GLES2Implementation::~GLES2Implementation() { WaitForCmd(); query_tracker_.reset(); if (support_client_side_arrays_ && reserved_ids_[0]) { DeleteBuffers(base::size(reserved_ids_), &reserved_ids_[0]); } ClearMappedBufferRangeMap(); share_group_->FreeContext(this); buffer_tracker_.reset(); readback_buffer_shadow_tracker_.reset(); WaitForCmd(); }
C
Chrome
0
CVE-2016-1678
https://www.cvedetails.com/cve/CVE-2016-1678/
CWE-119
https://github.com/chromium/chromium/commit/1f5ad409dbf5334523931df37598ea49e9849c87
1f5ad409dbf5334523931df37598ea49e9849c87
Allow origin lock for WebUI pages. Returning true for WebUI pages in DoesSiteRequireDedicatedProcess helps to keep enforcing a SiteInstance swap during chrome://foo -> chrome://bar navigation, even after relaxing BrowsingInstance::GetSiteInstanceForURL to consider RPH::IsSuitableHost (see https://crrev.com/c/783470 for that fixes process sharing in isolated(b(c),d(c)) scenario). I've manually tested this CL by visiting the following URLs: - chrome://welcome/ - chrome://settings - chrome://extensions - chrome://history - chrome://help and chrome://chrome (both redirect to chrome://settings/help) Bug: 510588, 847127 Change-Id: I55073bce00f32cb8bc5c1c91034438ff9a3f8971 Reviewed-on: https://chromium-review.googlesource.com/1237392 Commit-Queue: Łukasz Anforowicz <[email protected]> Reviewed-by: François Doray <[email protected]> Reviewed-by: Nasko Oskov <[email protected]> Reviewed-by: Avi Drissman <[email protected]> Cr-Commit-Position: refs/heads/master@{#595259}
GURL SiteInstance::GetSiteForURL(BrowserContext* browser_context, const GURL& url) { return SiteInstanceImpl::GetSiteForURL(browser_context, url, true /* should_use_effective_urls */); }
GURL SiteInstance::GetSiteForURL(BrowserContext* browser_context, const GURL& url) { return SiteInstanceImpl::GetSiteForURL(browser_context, url, true /* should_use_effective_urls */); }
C
Chrome
0
CVE-2011-3191
https://www.cvedetails.com/cve/CVE-2011-3191/
CWE-189
https://github.com/torvalds/linux/commit/9438fabb73eb48055b58b89fc51e0bc4db22fabd
9438fabb73eb48055b58b89fc51e0bc4db22fabd
cifs: fix possible memory corruption in CIFSFindNext The name_len variable in CIFSFindNext is a signed int that gets set to the resume_name_len in the cifs_search_info. The resume_name_len however is unsigned and for some infolevels is populated directly from a 32 bit value sent by the server. If the server sends a very large value for this, then that value could look negative when converted to a signed int. That would make that value pass the PATH_MAX check later in CIFSFindNext. The name_len would then be used as a length value for a memcpy. It would then be treated as unsigned again, and the memcpy scribbles over a ton of memory. Fix this by making the name_len an unsigned value in CIFSFindNext. Cc: <[email protected]> Reported-by: Darren Lavender <[email protected]> Signed-off-by: Jeff Layton <[email protected]> Signed-off-by: Steve French <[email protected]>
cifs_writedata_release(struct kref *refcount) { struct cifs_writedata *wdata = container_of(refcount, struct cifs_writedata, refcount); if (wdata->cfile) cifsFileInfo_put(wdata->cfile); kfree(wdata); }
cifs_writedata_release(struct kref *refcount) { struct cifs_writedata *wdata = container_of(refcount, struct cifs_writedata, refcount); if (wdata->cfile) cifsFileInfo_put(wdata->cfile); kfree(wdata); }
C
linux
0
CVE-2017-14230
https://www.cvedetails.com/cve/CVE-2017-14230/
CWE-20
https://github.com/cyrusimap/cyrus-imapd/commit/6bd33275368edfa71ae117de895488584678ac79
6bd33275368edfa71ae117de895488584678ac79
mboxlist: fix uninitialised memory use where pattern is "Other Users"
EXPORTED char *mboxlist_find_specialuse(const char *use, const char *userid) { /* \\Inbox is magical */ if (!strcasecmp(use, "\\Inbox")) return mboxname_user_mbox(userid, NULL); struct _find_specialuse_data rock = { use, userid, NULL }; mboxlist_usermboxtree(userid, _find_specialuse, &rock, MBOXTREE_SKIP_ROOT); return rock.mboxname; }
EXPORTED char *mboxlist_find_specialuse(const char *use, const char *userid) { /* \\Inbox is magical */ if (!strcasecmp(use, "\\Inbox")) return mboxname_user_mbox(userid, NULL); struct _find_specialuse_data rock = { use, userid, NULL }; mboxlist_usermboxtree(userid, _find_specialuse, &rock, MBOXTREE_SKIP_ROOT); return rock.mboxname; }
C
cyrus-imapd
0
CVE-2017-9375
https://www.cvedetails.com/cve/CVE-2017-9375/
CWE-835
https://git.qemu.org/?p=qemu.git;a=commit;h=96d87bdda3919bb16f754b3d3fd1227e1f38f13c
96d87bdda3919bb16f754b3d3fd1227e1f38f13c
null
static uint32_t rotl(uint32_t v, unsigned count) { count &= 31; return (v << count) | (v >> (32 - count)); }
static uint32_t rotl(uint32_t v, unsigned count) { count &= 31; return (v << count) | (v >> (32 - count)); }
C
qemu
0
CVE-2016-1667
https://www.cvedetails.com/cve/CVE-2016-1667/
CWE-284
https://github.com/chromium/chromium/commit/350f7d4b2c76950c8e7271284de84a9756b796e1
350f7d4b2c76950c8e7271284de84a9756b796e1
P2PQuicStream write functionality. This adds the P2PQuicStream::WriteData function and adds tests. It also adds the concept of a write buffered amount, enforcing this at the P2PQuicStreamImpl. Bug: 874296 Change-Id: Id02c8aa8d5368a87bb24a2e50dab5ef94bcae131 Reviewed-on: https://chromium-review.googlesource.com/c/1315534 Commit-Queue: Seth Hampson <[email protected]> Reviewed-by: Henrik Boström <[email protected]> Cr-Commit-Position: refs/heads/master@{#605766}
P2PQuicTransportTest() {}
P2PQuicTransportTest() {}
C
Chrome
0
CVE-2014-6418
https://www.cvedetails.com/cve/CVE-2014-6418/
CWE-399
https://github.com/torvalds/linux/commit/c27a3e4d667fdcad3db7b104f75659478e0c68d8
c27a3e4d667fdcad3db7b104f75659478e0c68d8
libceph: do not hard code max auth ticket len We hard code cephx auth ticket buffer size to 256 bytes. This isn't enough for any moderate setups and, in case tickets themselves are not encrypted, leads to buffer overflows (ceph_x_decrypt() errors out, but ceph_decode_copy() doesn't - it's just a memcpy() wrapper). Since the buffer is allocated dynamically anyway, allocated it a bit later, at the point where we know how much is going to be needed. Fixes: http://tracker.ceph.com/issues/8979 Cc: [email protected] Signed-off-by: Ilya Dryomov <[email protected]> Reviewed-by: Sage Weil <[email protected]>
static void ceph_x_reset(struct ceph_auth_client *ac) { struct ceph_x_info *xi = ac->private; dout("reset\n"); xi->starting = true; xi->server_challenge = 0; }
static void ceph_x_reset(struct ceph_auth_client *ac) { struct ceph_x_info *xi = ac->private; dout("reset\n"); xi->starting = true; xi->server_challenge = 0; }
C
linux
0
CVE-2014-9425
https://www.cvedetails.com/cve/CVE-2014-9425/
null
https://git.php.net/?p=php-src.git;a=commit;h=fbf3a6bc1abcc8a5b5226b0ad9464c37f11ddbd6
fbf3a6bc1abcc8a5b5226b0ad9464c37f11ddbd6
null
ZEND_API void zend_ts_hash_copy_to_hash(HashTable *target, TsHashTable *source, copy_ctor_func_t pCopyConstructor, void *tmp, uint size) { begin_read(source); zend_hash_copy(target, TS_HASH(source), pCopyConstructor, tmp, size); end_read(source); }
ZEND_API void zend_ts_hash_copy_to_hash(HashTable *target, TsHashTable *source, copy_ctor_func_t pCopyConstructor, void *tmp, uint size) { begin_read(source); zend_hash_copy(target, TS_HASH(source), pCopyConstructor, tmp, size); end_read(source); }
C
php
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::ContinueDrag(GdkDragContext* context) { if (drag_controller_.get()) drag_controller_->Drag(); }
void TabStripGtk::ContinueDrag(GdkDragContext* context) { if (drag_controller_.get()) drag_controller_->Drag(); }
C
Chrome
0
CVE-2018-6171
https://www.cvedetails.com/cve/CVE-2018-6171/
CWE-416
https://github.com/chromium/chromium/commit/c5c6320f80159dc41dffc3cfbf0298925c7dcf1b
c5c6320f80159dc41dffc3cfbf0298925c7dcf1b
chrome.bluetoothSocket: Fix regression in send() In https://crrev.com/c/997098, params_ was changed to a local variable, but it needs to last longer than that since net::WrappedIOBuffer may use the data after the local variable goes out of scope. This CL changed it back to be an instance variable. Bug: 851799 Change-Id: I392f8acaef4c6473d6ea4fbee7209445aa09112e Reviewed-on: https://chromium-review.googlesource.com/1103676 Reviewed-by: Toni Barzic <[email protected]> Commit-Queue: Sonny Sasaka <[email protected]> Cr-Commit-Position: refs/heads/master@{#568137}
bool BluetoothSocketAbstractConnectFunction::PreRunValidation( std::string* error) { DCHECK_CURRENTLY_ON(BrowserThread::UI); if (!BluetoothSocketAsyncApiFunction::PreRunValidation(error)) return false; params_ = bluetooth_socket::Connect::Params::Create(*args_); EXTENSION_FUNCTION_PRERUN_VALIDATE(params_.get()); socket_event_dispatcher_ = GetSocketEventDispatcher(browser_context()); return socket_event_dispatcher_ != nullptr; }
bool BluetoothSocketAbstractConnectFunction::PreRunValidation( std::string* error) { DCHECK_CURRENTLY_ON(BrowserThread::UI); if (!BluetoothSocketAsyncApiFunction::PreRunValidation(error)) return false; params_ = bluetooth_socket::Connect::Params::Create(*args_); EXTENSION_FUNCTION_PRERUN_VALIDATE(params_.get()); socket_event_dispatcher_ = GetSocketEventDispatcher(browser_context()); return socket_event_dispatcher_ != nullptr; }
C
Chrome
0
CVE-2018-12322
https://www.cvedetails.com/cve/CVE-2018-12322/
CWE-125
https://github.com/radare/radare2/commit/bbb4af56003c1afdad67af0c4339267ca38b1017
bbb4af56003c1afdad67af0c4339267ca38b1017
Fix #10294 - crash in r2_hoobr__6502_op
static int esil_6502_init (RAnalEsil *esil) { if (esil->anal && esil->anal->reg) { //initial values r_reg_set_value (esil->anal->reg, r_reg_get (esil->anal->reg, "pc", -1), 0x0000); r_reg_set_value (esil->anal->reg, r_reg_get (esil->anal->reg, "sp", -1), 0xff); r_reg_set_value (esil->anal->reg, r_reg_get (esil->anal->reg, "a", -1), 0x00); r_reg_set_value (esil->anal->reg, r_reg_get (esil->anal->reg, "x", -1), 0x00); r_reg_set_value (esil->anal->reg, r_reg_get (esil->anal->reg, "y", -1), 0x00); r_reg_set_value (esil->anal->reg, r_reg_get (esil->anal->reg, "flags", -1), 0x00); } return true; }
static int esil_6502_init (RAnalEsil *esil) { if (esil->anal && esil->anal->reg) { //initial values r_reg_set_value (esil->anal->reg, r_reg_get (esil->anal->reg, "pc", -1), 0x0000); r_reg_set_value (esil->anal->reg, r_reg_get (esil->anal->reg, "sp", -1), 0xff); r_reg_set_value (esil->anal->reg, r_reg_get (esil->anal->reg, "a", -1), 0x00); r_reg_set_value (esil->anal->reg, r_reg_get (esil->anal->reg, "x", -1), 0x00); r_reg_set_value (esil->anal->reg, r_reg_get (esil->anal->reg, "y", -1), 0x00); r_reg_set_value (esil->anal->reg, r_reg_get (esil->anal->reg, "flags", -1), 0x00); } return true; }
C
radare2
0
CVE-2018-7191
https://www.cvedetails.com/cve/CVE-2018-7191/
CWE-476
https://github.com/torvalds/linux/commit/0ad646c81b2182f7fa67ec0c8c825e0ee165696d
0ad646c81b2182f7fa67ec0c8c825e0ee165696d
tun: call dev_get_valid_name() before register_netdevice() register_netdevice() could fail early when we have an invalid dev name, in which case ->ndo_uninit() is not called. For tun device, this is a problem because a timer etc. are already initialized and it expects ->ndo_uninit() to clean them up. We could move these initializations into a ->ndo_init() so that register_netdevice() knows better, however this is still complicated due to the logic in tun_detach(). Therefore, I choose to just call dev_get_valid_name() before register_netdevice(), which is quicker and much easier to audit. And for this specific case, it is already enough. Fixes: 96442e42429e ("tuntap: choose the txq based on rxq") Reported-by: Dmitry Alexeev <[email protected]> Cc: Jason Wang <[email protected]> Cc: "Michael S. Tsirkin" <[email protected]> Signed-off-by: Cong Wang <[email protected]> Signed-off-by: David S. Miller <[email protected]>
static void tun_detach(struct tun_file *tfile, bool clean) { rtnl_lock(); __tun_detach(tfile, clean); rtnl_unlock(); }
static void tun_detach(struct tun_file *tfile, bool clean) { rtnl_lock(); __tun_detach(tfile, clean); rtnl_unlock(); }
C
linux
0
CVE-2017-5019
https://www.cvedetails.com/cve/CVE-2017-5019/
CWE-416
https://github.com/chromium/chromium/commit/f03ea5a5c2ff26e239dfd23e263b15da2d9cee93
f03ea5a5c2ff26e239dfd23e263b15da2d9cee93
Convert FrameHostMsg_DidAddMessageToConsole to Mojo. Note: Since this required changing the test RenderViewImplTest.DispatchBeforeUnloadCanDetachFrame, I manually re-introduced https://crbug.com/666714 locally (the bug the test was added for), and reran the test to confirm that it still covers the bug. Bug: 786836 Change-Id: I110668fa6f0f261fd2ac36bb91a8d8b31c99f4f1 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1526270 Commit-Queue: Lowell Manners <[email protected]> Reviewed-by: Daniel Cheng <[email protected]> Reviewed-by: Camille Lamy <[email protected]> Cr-Commit-Position: refs/heads/master@{#653137}
void ServiceWorkerContextCore::RemoveLiveVersion(int64_t id) { if (live_versions_[id]->running_status() != EmbeddedWorkerStatus::STOPPED) { observer_list_->Notify( FROM_HERE, &ServiceWorkerContextCoreObserver::OnRunningStateChanged, id, EmbeddedWorkerStatus::STOPPED); } live_versions_.erase(id); }
void ServiceWorkerContextCore::RemoveLiveVersion(int64_t id) { if (live_versions_[id]->running_status() != EmbeddedWorkerStatus::STOPPED) { observer_list_->Notify( FROM_HERE, &ServiceWorkerContextCoreObserver::OnRunningStateChanged, id, EmbeddedWorkerStatus::STOPPED); } live_versions_.erase(id); }
C
Chrome
0
CVE-2018-20843
https://www.cvedetails.com/cve/CVE-2018-20843/
CWE-611
https://github.com/libexpat/libexpat/pull/262/commits/11f8838bf99ea0a6f0b76f9760c43704d00c4ff6
11f8838bf99ea0a6f0b76f9760c43704d00c4ff6
xmlparse.c: Fix extraction of namespace prefix from XML name (#186)
externalEntityInitProcessor2(XML_Parser parser, const char *start, const char *end, const char **endPtr) { const char *next = start; /* XmlContentTok doesn't always set the last arg */ int tok = XmlContentTok(parser->m_encoding, start, end, &next); switch (tok) { case XML_TOK_BOM: /* If we are at the end of the buffer, this would cause the next stage, i.e. externalEntityInitProcessor3, to pass control directly to doContent (by detecting XML_TOK_NONE) without processing any xml text declaration - causing the error XML_ERROR_MISPLACED_XML_PI in doContent. */ if (next == end && !parser->m_parsingStatus.finalBuffer) { *endPtr = next; return XML_ERROR_NONE; } start = next; break; case XML_TOK_PARTIAL: if (!parser->m_parsingStatus.finalBuffer) { *endPtr = start; return XML_ERROR_NONE; } parser->m_eventPtr = start; return XML_ERROR_UNCLOSED_TOKEN; case XML_TOK_PARTIAL_CHAR: if (!parser->m_parsingStatus.finalBuffer) { *endPtr = start; return XML_ERROR_NONE; } parser->m_eventPtr = start; return XML_ERROR_PARTIAL_CHAR; } parser->m_processor = externalEntityInitProcessor3; return externalEntityInitProcessor3(parser, start, end, endPtr); }
externalEntityInitProcessor2(XML_Parser parser, const char *start, const char *end, const char **endPtr) { const char *next = start; /* XmlContentTok doesn't always set the last arg */ int tok = XmlContentTok(parser->m_encoding, start, end, &next); switch (tok) { case XML_TOK_BOM: /* If we are at the end of the buffer, this would cause the next stage, i.e. externalEntityInitProcessor3, to pass control directly to doContent (by detecting XML_TOK_NONE) without processing any xml text declaration - causing the error XML_ERROR_MISPLACED_XML_PI in doContent. */ if (next == end && !parser->m_parsingStatus.finalBuffer) { *endPtr = next; return XML_ERROR_NONE; } start = next; break; case XML_TOK_PARTIAL: if (!parser->m_parsingStatus.finalBuffer) { *endPtr = start; return XML_ERROR_NONE; } parser->m_eventPtr = start; return XML_ERROR_UNCLOSED_TOKEN; case XML_TOK_PARTIAL_CHAR: if (!parser->m_parsingStatus.finalBuffer) { *endPtr = start; return XML_ERROR_NONE; } parser->m_eventPtr = start; return XML_ERROR_PARTIAL_CHAR; } parser->m_processor = externalEntityInitProcessor3; return externalEntityInitProcessor3(parser, start, end, endPtr); }
C
libexpat
0
CVE-2015-1278
https://www.cvedetails.com/cve/CVE-2015-1278/
CWE-254
https://github.com/chromium/chromium/commit/784f56a9c97a838448dd23f9bdc7c05fe8e639b3
784f56a9c97a838448dd23f9bdc7c05fe8e639b3
Correctly reset FP in RFHI whenever origin changes Bug: 713364 Change-Id: Id8bb923750e20f3db6fc9358b1d44120513ac95f CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_site_isolation Change-Id: Id8bb923750e20f3db6fc9358b1d44120513ac95f Reviewed-on: https://chromium-review.googlesource.com/482380 Commit-Queue: Ian Clelland <[email protected]> Reviewed-by: Charles Reis <[email protected]> Cr-Commit-Position: refs/heads/master@{#466778}
void NavigatorImpl::DiscardPendingEntryIfNeeded(NavigationHandleImpl* handle) { NavigationEntry* pending_entry = controller_->GetPendingEntry(); bool pending_matches_fail_msg = handle && pending_entry && handle->pending_nav_entry_id() == pending_entry->GetUniqueID(); if (!pending_matches_fail_msg) return; bool should_preserve_entry = controller_->IsUnmodifiedBlankTab() || delegate_->ShouldPreserveAbortedURLs(); if (pending_entry != controller_->GetVisibleEntry() || !should_preserve_entry) { controller_->DiscardPendingEntry(true); controller_->delegate()->NotifyNavigationStateChanged(INVALIDATE_TYPE_URL); } }
void NavigatorImpl::DiscardPendingEntryIfNeeded(NavigationHandleImpl* handle) { NavigationEntry* pending_entry = controller_->GetPendingEntry(); bool pending_matches_fail_msg = handle && pending_entry && handle->pending_nav_entry_id() == pending_entry->GetUniqueID(); if (!pending_matches_fail_msg) return; bool should_preserve_entry = controller_->IsUnmodifiedBlankTab() || delegate_->ShouldPreserveAbortedURLs(); if (pending_entry != controller_->GetVisibleEntry() || !should_preserve_entry) { controller_->DiscardPendingEntry(true); controller_->delegate()->NotifyNavigationStateChanged(INVALIDATE_TYPE_URL); } }
C
Chrome
0
CVE-2016-6490
https://www.cvedetails.com/cve/CVE-2016-6490/
CWE-20
https://git.qemu.org/?p=qemu.git;a=commit;h=1e7aed70144b4673fc26e73062064b6724795e5f
1e7aed70144b4673fc26e73062064b6724795e5f
null
void virtio_config_writew(VirtIODevice *vdev, uint32_t addr, uint32_t data) { VirtioDeviceClass *k = VIRTIO_DEVICE_GET_CLASS(vdev); uint16_t val = data; if (addr + sizeof(val) > vdev->config_len) { return; } stw_p(vdev->config + addr, val); if (k->set_config) { k->set_config(vdev, vdev->config); } }
void virtio_config_writew(VirtIODevice *vdev, uint32_t addr, uint32_t data) { VirtioDeviceClass *k = VIRTIO_DEVICE_GET_CLASS(vdev); uint16_t val = data; if (addr + sizeof(val) > vdev->config_len) { return; } stw_p(vdev->config + addr, val); if (k->set_config) { k->set_config(vdev, vdev->config); } }
C
qemu
0
CVE-2012-2375
https://www.cvedetails.com/cve/CVE-2012-2375/
CWE-189
https://github.com/torvalds/linux/commit/20e0fa98b751facf9a1101edaefbc19c82616a68
20e0fa98b751facf9a1101edaefbc19c82616a68
Fix length of buffer copied in __nfs4_get_acl_uncached _copy_from_pages() used to copy data from the temporary buffer to the user passed buffer is passed the wrong size parameter when copying data. res.acl_len contains both the bitmap and acl lenghts while acl_len contains the acl length after adjusting for the bitmap size. Signed-off-by: Sachin Prabhu <[email protected]> Signed-off-by: Trond Myklebust <[email protected]>
static int _nfs4_proc_secinfo(struct inode *dir, const struct qstr *name, struct nfs4_secinfo_flavors *flavors) { int status; struct nfs4_secinfo_arg args = { .dir_fh = NFS_FH(dir), .name = name, }; struct nfs4_secinfo_res res = { .flavors = flavors, }; struct rpc_message msg = { .rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_SECINFO], .rpc_argp = &args, .rpc_resp = &res, }; dprintk("NFS call secinfo %s\n", name->name); status = nfs4_call_sync(NFS_SERVER(dir)->client, NFS_SERVER(dir), &msg, &args.seq_args, &res.seq_res, 0); dprintk("NFS reply secinfo: %d\n", status); return status; }
static int _nfs4_proc_secinfo(struct inode *dir, const struct qstr *name, struct nfs4_secinfo_flavors *flavors) { int status; struct nfs4_secinfo_arg args = { .dir_fh = NFS_FH(dir), .name = name, }; struct nfs4_secinfo_res res = { .flavors = flavors, }; struct rpc_message msg = { .rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_SECINFO], .rpc_argp = &args, .rpc_resp = &res, }; dprintk("NFS call secinfo %s\n", name->name); status = nfs4_call_sync(NFS_SERVER(dir)->client, NFS_SERVER(dir), &msg, &args.seq_args, &res.seq_res, 0); dprintk("NFS reply secinfo: %d\n", status); return status; }
C
linux
0
CVE-2016-9137
https://www.cvedetails.com/cve/CVE-2016-9137/
CWE-416
https://git.php.net/?p=php-src.git;a=commit;h=0e6fe3a4c96be2d3e88389a5776f878021b4c59f
0e6fe3a4c96be2d3e88389a5776f878021b4c59f
null
ZEND_API void zend_update_property_double(zend_class_entry *scope, zval *object, const char *name, int name_length, double value TSRMLS_DC) /* {{{ */ { zval *tmp; ALLOC_ZVAL(tmp); Z_UNSET_ISREF_P(tmp); Z_SET_REFCOUNT_P(tmp, 0); ZVAL_DOUBLE(tmp, value); zend_update_property(scope, object, name, name_length, tmp TSRMLS_CC); } /* }}} */
ZEND_API void zend_update_property_double(zend_class_entry *scope, zval *object, const char *name, int name_length, double value TSRMLS_DC) /* {{{ */ { zval *tmp; ALLOC_ZVAL(tmp); Z_UNSET_ISREF_P(tmp); Z_SET_REFCOUNT_P(tmp, 0); ZVAL_DOUBLE(tmp, value); zend_update_property(scope, object, name, name_length, tmp TSRMLS_CC); } /* }}} */
C
php
0
CVE-2014-3160
https://www.cvedetails.com/cve/CVE-2014-3160/
CWE-264
https://github.com/chromium/chromium/commit/ee281f7cac9df44fe241a37f188b28be8845ded0
ee281f7cac9df44fe241a37f188b28be8845ded0
Enforce SVG image security rules SVG images have unique security rules that prevent them from loading any external resources. This patch enforces these rules in ResourceFetcher::canRequest for all non-data-uri resources. This locks down our SVG resource handling and fixes two security bugs. In the case of SVG images that reference other images, we had a bug where a cached subresource would be used directly from the cache. This has been fixed because the canRequest check occurs before we use cached resources. In the case of SVG images that use CSS imports, we had a bug where imports were blindly requested. This has been fixed by stopping all non-data-uri requests in SVG images. With this patch we now match Gecko's behavior on both testcases. BUG=380885, 382296 Review URL: https://codereview.chromium.org/320763002 git-svn-id: svn://svn.chromium.org/blink/trunk@176084 bbb929c8-8fbe-4397-9dbb-9b2b20218538
bool ResourceFetcher::isPreloaded(const String& urlString) const { const KURL& url = m_document->completeURL(urlString); if (m_preloads) { ListHashSet<Resource*>::iterator end = m_preloads->end(); for (ListHashSet<Resource*>::iterator it = m_preloads->begin(); it != end; ++it) { Resource* resource = *it; if (resource->url() == url) return true; } } return false; }
bool ResourceFetcher::isPreloaded(const String& urlString) const { const KURL& url = m_document->completeURL(urlString); if (m_preloads) { ListHashSet<Resource*>::iterator end = m_preloads->end(); for (ListHashSet<Resource*>::iterator it = m_preloads->begin(); it != end; ++it) { Resource* resource = *it; if (resource->url() == url) return true; } } return false; }
C
Chrome
0
null
null
null
https://github.com/chromium/chromium/commit/d30a8bd191f17b61938fc87890bffc80049b0774
d30a8bd191f17b61938fc87890bffc80049b0774
[Extensions] Rework inline installation observation Instead of observing through the WebstoreAPI, observe directly in the TabHelper. This is a great deal less code, more direct, and also fixes a lifetime issue with the TabHelper being deleted before the inline installation completes. BUG=613949 Review-Url: https://codereview.chromium.org/2103663002 Cr-Commit-Position: refs/heads/master@{#403188}
void TabHelper::OnInlineWebstoreInstall(content::RenderFrameHost* host, int install_id, int return_route_id, const std::string& webstore_item_id, const GURL& requestor_url, int listeners_mask) { if ((listeners_mask & ~(api::webstore::INSTALL_STAGE_LISTENER | api::webstore::DOWNLOAD_PROGRESS_LISTENER)) != 0 || requestor_url.is_empty()) { NOTREACHED(); return; } if (pending_inline_installations_.count(webstore_item_id) != 0) { Send(new ExtensionMsg_InlineWebstoreInstallResponse( return_route_id, install_id, false, webstore_install::kInstallInProgressError, webstore_install::INSTALL_IN_PROGRESS)); return; } pending_inline_installations_.insert(webstore_item_id); ExtensionRegistry* registry = ExtensionRegistry::Get(profile_); if (registry->disabled_extensions().Contains(webstore_item_id) && (ExtensionPrefs::Get(profile_)->GetDisableReasons(webstore_item_id) & Extension::DISABLE_PERMISSIONS_INCREASE) != 0) { extension_reenabler_.reset(); extension_reenabler_ = ExtensionReenabler::PromptForReenable( registry->disabled_extensions().GetByID(webstore_item_id), profile_, web_contents(), requestor_url, base::Bind(&TabHelper::OnReenableComplete, weak_ptr_factory_.GetWeakPtr(), install_id, return_route_id, webstore_item_id)); } else { bool observe_download_progress = (listeners_mask & api::webstore::DOWNLOAD_PROGRESS_LISTENER) != 0; bool observe_install_stage = (listeners_mask & api::webstore::INSTALL_STAGE_LISTENER) != 0; if (observe_install_stage || observe_download_progress) { DCHECK_EQ(0u, install_observers_.count(webstore_item_id)); install_observers_[webstore_item_id] = base::MakeUnique<InlineInstallObserver>( this, web_contents()->GetBrowserContext(), return_route_id, webstore_item_id, observe_download_progress, observe_install_stage); } WebstoreStandaloneInstaller::Callback callback = base::Bind( &TabHelper::OnInlineInstallComplete, weak_ptr_factory_.GetWeakPtr(), install_id, return_route_id, webstore_item_id); scoped_refptr<WebstoreInlineInstaller> installer( webstore_inline_installer_factory_->CreateInstaller( web_contents(), host, webstore_item_id, requestor_url, callback)); installer->BeginInstall(); } }
void TabHelper::OnInlineWebstoreInstall(content::RenderFrameHost* host, int install_id, int return_route_id, const std::string& webstore_item_id, const GURL& requestor_url, int listeners_mask) { if ((listeners_mask & ~(api::webstore::INSTALL_STAGE_LISTENER | api::webstore::DOWNLOAD_PROGRESS_LISTENER)) != 0 || requestor_url.is_empty()) { NOTREACHED(); return; } ExtensionRegistry* registry = ExtensionRegistry::Get(profile_); if (registry->disabled_extensions().Contains(webstore_item_id) && (ExtensionPrefs::Get(profile_)->GetDisableReasons(webstore_item_id) & Extension::DISABLE_PERMISSIONS_INCREASE) != 0) { extension_reenabler_.reset(); extension_reenabler_ = ExtensionReenabler::PromptForReenable( registry->disabled_extensions().GetByID(webstore_item_id), profile_, web_contents(), requestor_url, base::Bind(&TabHelper::OnReenableComplete, weak_ptr_factory_.GetWeakPtr(), install_id, return_route_id)); } else { WebstoreAPI::Get(profile_)->OnInlineInstallStart( return_route_id, this, webstore_item_id, listeners_mask); WebstoreStandaloneInstaller::Callback callback = base::Bind(&TabHelper::OnInlineInstallComplete, base::Unretained(this), install_id, return_route_id); scoped_refptr<WebstoreInlineInstaller> installer( webstore_inline_installer_factory_->CreateInstaller( web_contents(), host, webstore_item_id, requestor_url, callback)); installer->BeginInstall(); } }
C
Chrome
1
CVE-2016-3910
https://www.cvedetails.com/cve/CVE-2016-3910/
CWE-264
https://android.googlesource.com/platform/frameworks/av/+/035cb12f392860113dce96116a5150e2fde6f0cc
035cb12f392860113dce96116a5150e2fde6f0cc
soundtrigger: add size check on sound model and recogntion data Bug: 30148546 Change-Id: I082f535a853c96571887eeea37c6d41ecee7d8c0 (cherry picked from commit bb00d8f139ff51336ab3c810d35685003949bcf8) (cherry picked from commit ef0c91518446e65533ca8bab6726a845f27c73fd)
void SoundTriggerHwService::Module::detach() { ALOGV("detach()"); if (!captureHotwordAllowed()) { return; } { AutoMutex lock(mLock); for (size_t i = 0; i < mModels.size(); i++) { sp<Model> model = mModels.valueAt(i); ALOGV("detach() unloading model %d", model->mHandle); if (model->mState == Model::STATE_ACTIVE) { mHwDevice->stop_recognition(mHwDevice, model->mHandle); } mHwDevice->unload_sound_model(mHwDevice, model->mHandle); } mModels.clear(); } if (mClient != 0) { IInterface::asBinder(mClient)->unlinkToDeath(this); } sp<SoundTriggerHwService> service = mService.promote(); if (service == 0) { return; } service->detachModule(this); }
void SoundTriggerHwService::Module::detach() { ALOGV("detach()"); if (!captureHotwordAllowed()) { return; } { AutoMutex lock(mLock); for (size_t i = 0; i < mModels.size(); i++) { sp<Model> model = mModels.valueAt(i); ALOGV("detach() unloading model %d", model->mHandle); if (model->mState == Model::STATE_ACTIVE) { mHwDevice->stop_recognition(mHwDevice, model->mHandle); } mHwDevice->unload_sound_model(mHwDevice, model->mHandle); } mModels.clear(); } if (mClient != 0) { IInterface::asBinder(mClient)->unlinkToDeath(this); } sp<SoundTriggerHwService> service = mService.promote(); if (service == 0) { return; } service->detachModule(this); }
C
Android
0
CVE-2017-9059
https://www.cvedetails.com/cve/CVE-2017-9059/
CWE-404
https://github.com/torvalds/linux/commit/c70422f760c120480fee4de6c38804c72aa26bc1
c70422f760c120480fee4de6c38804c72aa26bc1
Merge tag 'nfsd-4.12' of git://linux-nfs.org/~bfields/linux Pull nfsd updates from Bruce Fields: "Another RDMA update from Chuck Lever, and a bunch of miscellaneous bugfixes" * tag 'nfsd-4.12' of git://linux-nfs.org/~bfields/linux: (26 commits) nfsd: Fix up the "supattr_exclcreat" attributes nfsd: encoders mustn't use unitialized values in error cases nfsd: fix undefined behavior in nfsd4_layout_verify lockd: fix lockd shutdown race NFSv4: Fix callback server shutdown SUNRPC: Refactor svc_set_num_threads() NFSv4.x/callback: Create the callback service through svc_create_pooled lockd: remove redundant check on block svcrdma: Clean out old XDR encoders svcrdma: Remove the req_map cache svcrdma: Remove unused RDMA Write completion handler svcrdma: Reduce size of sge array in struct svc_rdma_op_ctxt svcrdma: Clean up RPC-over-RDMA backchannel reply processing svcrdma: Report Write/Reply chunk overruns svcrdma: Clean up RDMA_ERROR path svcrdma: Use rdma_rw API in RPC reply path svcrdma: Introduce local rdma_rw API helpers svcrdma: Clean up svc_rdma_get_inv_rkey() svcrdma: Add helper to save pages under I/O svcrdma: Eliminate RPCRDMA_SQ_DEPTH_MULT ...
static inline u32 nfsd4_rename_rsize(struct svc_rqst *rqstp, struct nfsd4_op *op) { return (op_encode_hdr_size + op_encode_change_info_maxsz + op_encode_change_info_maxsz) * sizeof(__be32); }
static inline u32 nfsd4_rename_rsize(struct svc_rqst *rqstp, struct nfsd4_op *op) { return (op_encode_hdr_size + op_encode_change_info_maxsz + op_encode_change_info_maxsz) * sizeof(__be32); }
C
linux
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
error::Error GLES2DecoderImpl::HandleGenSharedIdsCHROMIUM( uint32 immediate_data_size, const cmds::GenSharedIdsCHROMIUM& c) { GLuint namespace_id = static_cast<GLuint>(c.namespace_id); GLuint id_offset = static_cast<GLuint>(c.id_offset); GLsizei n = static_cast<GLsizei>(c.n); uint32 data_size; if (!SafeMultiplyUint32(n, sizeof(GLuint), &data_size)) { return error::kOutOfBounds; } GLuint* ids = GetSharedMemoryAs<GLuint*>( c.ids_shm_id, c.ids_shm_offset, data_size); if (n < 0) { LOCAL_SET_GL_ERROR(GL_INVALID_VALUE, "GenSharedIdsCHROMIUM", "n < 0"); return error::kNoError; } if (ids == NULL) { return error::kOutOfBounds; } DoGenSharedIdsCHROMIUM(namespace_id, id_offset, n, ids); return error::kNoError; }
error::Error GLES2DecoderImpl::HandleGenSharedIdsCHROMIUM( uint32 immediate_data_size, const cmds::GenSharedIdsCHROMIUM& c) { GLuint namespace_id = static_cast<GLuint>(c.namespace_id); GLuint id_offset = static_cast<GLuint>(c.id_offset); GLsizei n = static_cast<GLsizei>(c.n); uint32 data_size; if (!SafeMultiplyUint32(n, sizeof(GLuint), &data_size)) { return error::kOutOfBounds; } GLuint* ids = GetSharedMemoryAs<GLuint*>( c.ids_shm_id, c.ids_shm_offset, data_size); if (n < 0) { LOCAL_SET_GL_ERROR(GL_INVALID_VALUE, "GenSharedIdsCHROMIUM", "n < 0"); return error::kNoError; } if (ids == NULL) { return error::kOutOfBounds; } DoGenSharedIdsCHROMIUM(namespace_id, id_offset, n, ids); return error::kNoError; }
C
Chrome
0
CVE-2007-6761
https://www.cvedetails.com/cve/CVE-2007-6761/
CWE-119
https://github.com/torvalds/linux/commit/0b29669c065f60501e7289e1950fa2a618962358
0b29669c065f60501e7289e1950fa2a618962358
V4L/DVB (6751): V4L: Memory leak! Fix count in videobuf-vmalloc mmap This is pretty serious bug. map->count is never initialized after the call to kmalloc making the count start at some random trash value. The end result is leaking videobufs. Also, fix up the debug statements to print unsigned values. Pushed to http://ifup.org/hg/v4l-dvb too Signed-off-by: Brandon Philips <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
static int __videobuf_iolock (struct videobuf_queue* q, struct videobuf_buffer *vb, struct v4l2_framebuffer *fbuf) { int pages; struct videbuf_vmalloc_memory *mem=vb->priv; BUG_ON(!mem); MAGIC_CHECK(mem->magic,MAGIC_VMAL_MEM); pages = PAGE_ALIGN(vb->size) >> PAGE_SHIFT; /* Currently, doesn't support V4L2_MEMORY_OVERLAY */ if ((vb->memory != V4L2_MEMORY_MMAP) && (vb->memory != V4L2_MEMORY_USERPTR) ) { printk(KERN_ERR "Method currently unsupported.\n"); return -EINVAL; } /* FIXME: should be tested with kernel mmap mem */ mem->vmalloc=vmalloc_user (PAGE_ALIGN(vb->size)); if (NULL == mem->vmalloc) { printk(KERN_ERR "vmalloc (%d pages) failed\n",pages); return -ENOMEM; } dprintk(1,"vmalloc is at addr 0x%08lx, size=%d\n", (unsigned long)mem->vmalloc, pages << PAGE_SHIFT); /* It seems that some kernel versions need to do remap *after* the mmap() call */ if (mem->vma) { int retval=remap_vmalloc_range(mem->vma, mem->vmalloc,0); kfree(mem->vma); mem->vma=NULL; if (retval<0) { dprintk(1,"mmap app bug: remap_vmalloc_range area %p error %d\n", mem->vmalloc,retval); return retval; } } return 0; }
static int __videobuf_iolock (struct videobuf_queue* q, struct videobuf_buffer *vb, struct v4l2_framebuffer *fbuf) { int pages; struct videbuf_vmalloc_memory *mem=vb->priv; BUG_ON(!mem); MAGIC_CHECK(mem->magic,MAGIC_VMAL_MEM); pages = PAGE_ALIGN(vb->size) >> PAGE_SHIFT; /* Currently, doesn't support V4L2_MEMORY_OVERLAY */ if ((vb->memory != V4L2_MEMORY_MMAP) && (vb->memory != V4L2_MEMORY_USERPTR) ) { printk(KERN_ERR "Method currently unsupported.\n"); return -EINVAL; } /* FIXME: should be tested with kernel mmap mem */ mem->vmalloc=vmalloc_user (PAGE_ALIGN(vb->size)); if (NULL == mem->vmalloc) { printk(KERN_ERR "vmalloc (%d pages) failed\n",pages); return -ENOMEM; } dprintk(1,"vmalloc is at addr 0x%08lx, size=%d\n", (unsigned long)mem->vmalloc, pages << PAGE_SHIFT); /* It seems that some kernel versions need to do remap *after* the mmap() call */ if (mem->vma) { int retval=remap_vmalloc_range(mem->vma, mem->vmalloc,0); kfree(mem->vma); mem->vma=NULL; if (retval<0) { dprintk(1,"mmap app bug: remap_vmalloc_range area %p error %d\n", mem->vmalloc,retval); return retval; } } return 0; }
C
linux
0
CVE-2018-15863
https://www.cvedetails.com/cve/CVE-2018-15863/
CWE-476
https://github.com/xkbcommon/libxkbcommon/commit/96df3106d49438e442510c59acad306e94f3db4d
96df3106d49438e442510c59acad306e94f3db4d
xkbcomp: Don't crash on no-op modmask expressions If we have an expression of the form 'l1' in an interp section, we unconditionally try to dereference its args, even if it has none. Signed-off-by: Daniel Stone <[email protected]>
HandleLedMapDef(CompatInfo *info, LedMapDef *def, enum merge_mode merge) { LedInfo ledi; VarDef *var; bool ok; if (def->merge != MERGE_DEFAULT) merge = def->merge; ledi = info->default_led; ledi.merge = merge; ledi.led.name = def->name; ok = true; for (var = def->body; var != NULL; var = (VarDef *) var->common.next) { const char *elem, *field; ExprDef *arrayNdx; if (!ExprResolveLhs(info->ctx, var->name, &elem, &field, &arrayNdx)) { ok = false; continue; } if (elem) { log_err(info->ctx, "Cannot set defaults for \"%s\" element in indicator map; " "Assignment to %s.%s ignored\n", elem, elem, field); ok = false; } else { ok = SetLedMapField(info, &ledi, field, arrayNdx, var->value) && ok; } } if (ok) return AddLedMap(info, &ledi, true); return false; }
HandleLedMapDef(CompatInfo *info, LedMapDef *def, enum merge_mode merge) { LedInfo ledi; VarDef *var; bool ok; if (def->merge != MERGE_DEFAULT) merge = def->merge; ledi = info->default_led; ledi.merge = merge; ledi.led.name = def->name; ok = true; for (var = def->body; var != NULL; var = (VarDef *) var->common.next) { const char *elem, *field; ExprDef *arrayNdx; if (!ExprResolveLhs(info->ctx, var->name, &elem, &field, &arrayNdx)) { ok = false; continue; } if (elem) { log_err(info->ctx, "Cannot set defaults for \"%s\" element in indicator map; " "Assignment to %s.%s ignored\n", elem, elem, field); ok = false; } else { ok = SetLedMapField(info, &ledi, field, arrayNdx, var->value) && ok; } } if (ok) return AddLedMap(info, &ledi, true); return false; }
C
libxkbcommon
0
CVE-2016-7144
https://www.cvedetails.com/cve/CVE-2016-7144/
CWE-287
https://github.com/unrealircd/unrealircd/commit/f473e355e1dc422c4f019dbf86bc50ba1a34a766
f473e355e1dc422c4f019dbf86bc50ba1a34a766
Fix AUTHENTICATE bug
CMD_FUNC(m_sasl) { if (!SASL_SERVER || MyClient(sptr) || (parc < 4) || !parv[4]) return 0; if (!stricmp(parv[1], me.name)) { aClient *target_p; /* is the PUID valid? */ if ((target_p = decode_puid(parv[2])) == NULL) return 0; if (target_p->user == NULL) make_user(target_p); /* reject if another SASL agent is answering */ if (*target_p->local->sasl_agent && stricmp(sptr->name, target_p->local->sasl_agent)) return 0; else strlcpy(target_p->local->sasl_agent, sptr->name, sizeof(target_p->local->sasl_agent)); if (*parv[3] == 'C') sendto_one(target_p, "AUTHENTICATE %s", parv[4]); else if (*parv[3] == 'D') { if (*parv[4] == 'F') sendto_one(target_p, err_str(ERR_SASLFAIL), me.name, BadPtr(target_p->name) ? "*" : target_p->name); else if (*parv[4] == 'S') { target_p->local->sasl_complete++; sendto_one(target_p, err_str(RPL_SASLSUCCESS), me.name, BadPtr(target_p->name) ? "*" : target_p->name); } *target_p->local->sasl_agent = '\0'; } else if (*parv[3] == 'M') sendto_one(target_p, err_str(RPL_SASLMECHS), me.name, BadPtr(target_p->name) ? "*" : target_p->name, parv[4]); return 0; } /* not for us; propagate. */ sendto_server(cptr, 0, 0, ":%s SASL %s %s %c %s %s", sptr->name, parv[1], parv[2], *parv[3], parv[4], parc > 5 ? parv[5] : ""); return 0; }
CMD_FUNC(m_sasl) { if (!SASL_SERVER || MyClient(sptr) || (parc < 4) || !parv[4]) return 0; if (!stricmp(parv[1], me.name)) { aClient *target_p; /* is the PUID valid? */ if ((target_p = decode_puid(parv[2])) == NULL) return 0; if (target_p->user == NULL) make_user(target_p); /* reject if another SASL agent is answering */ if (*target_p->local->sasl_agent && stricmp(sptr->name, target_p->local->sasl_agent)) return 0; else strlcpy(target_p->local->sasl_agent, sptr->name, sizeof(target_p->local->sasl_agent)); if (*parv[3] == 'C') sendto_one(target_p, "AUTHENTICATE %s", parv[4]); else if (*parv[3] == 'D') { if (*parv[4] == 'F') sendto_one(target_p, err_str(ERR_SASLFAIL), me.name, BadPtr(target_p->name) ? "*" : target_p->name); else if (*parv[4] == 'S') { target_p->local->sasl_complete++; sendto_one(target_p, err_str(RPL_SASLSUCCESS), me.name, BadPtr(target_p->name) ? "*" : target_p->name); } *target_p->local->sasl_agent = '\0'; } else if (*parv[3] == 'M') sendto_one(target_p, err_str(RPL_SASLMECHS), me.name, BadPtr(target_p->name) ? "*" : target_p->name, parv[4]); return 0; } /* not for us; propagate. */ sendto_server(cptr, 0, 0, ":%s SASL %s %s %c %s %s", sptr->name, parv[1], parv[2], *parv[3], parv[4], parc > 5 ? parv[5] : ""); return 0; }
C
unrealircd
0
CVE-2017-16931
https://www.cvedetails.com/cve/CVE-2017-16931/
CWE-119
https://github.com/GNOME/libxml2/commit/e26630548e7d138d2c560844c43820b6767251e3
e26630548e7d138d2c560844c43820b6767251e3
Fix handling of parameter-entity references There were two bugs where parameter-entity references could lead to an unexpected change of the input buffer in xmlParseNameComplex and xmlDictLookup being called with an invalid pointer. Percent sign in DTD Names ========================= The NEXTL macro used to call xmlParserHandlePEReference. When parsing "complex" names inside the DTD, this could result in entity expansion which created a new input buffer. The fix is to simply remove the call to xmlParserHandlePEReference from the NEXTL macro. This is safe because no users of the macro require expansion of parameter entities. - xmlParseNameComplex - xmlParseNCNameComplex - xmlParseNmtoken The percent sign is not allowed in names, which are grammatical tokens. - xmlParseEntityValue Parameter-entity references in entity values are expanded but this happens in a separate step in this function. - xmlParseSystemLiteral Parameter-entity references are ignored in the system literal. - xmlParseAttValueComplex - xmlParseCharDataComplex - xmlParseCommentComplex - xmlParsePI - xmlParseCDSect Parameter-entity references are ignored outside the DTD. - xmlLoadEntityContent This function is only called from xmlStringLenDecodeEntities and entities are replaced in a separate step immediately after the function call. This bug could also be triggered with an internal subset and double entity expansion. This fixes bug 766956 initially reported by Wei Lei and independently by Chromium's ClusterFuzz, Hanno Böck, and Marco Grassi. Thanks to everyone involved. xmlParseNameComplex with XML_PARSE_OLD10 ======================================== When parsing Names inside an expanded parameter entity with the XML_PARSE_OLD10 option, xmlParseNameComplex would call xmlGROW via the GROW macro if the input buffer was exhausted. At the end of the parameter entity's replacement text, this function would then call xmlPopInput which invalidated the input buffer. There should be no need to invoke GROW in this situation because the buffer is grown periodically every XML_PARSER_CHUNK_SIZE characters and, at least for UTF-8, in xmlCurrentChar. This also matches the code path executed when XML_PARSE_OLD10 is not set. This fixes bugs 781205 (CVE-2017-9049) and 781361 (CVE-2017-9050). Thanks to Marcel Böhme and Thuan Pham for the report. Additional hardening ==================== A separate check was added in xmlParseNameComplex to validate the buffer size.
c14nRunTest(const char* xml_filename, int with_comments, int mode, const char* xpath_filename, const char *ns_filename, const char* result_file) { xmlDocPtr doc; xmlXPathObjectPtr xpath = NULL; xmlChar *result = NULL; int ret; xmlChar **inclusive_namespaces = NULL; const char *nslist = NULL; int nssize; /* * build an XML tree from a the file; we need to add default * attributes and resolve all character and entities references */ xmlLoadExtDtdDefaultValue = XML_DETECT_IDS | XML_COMPLETE_ATTRS; xmlSubstituteEntitiesDefault(1); doc = xmlReadFile(xml_filename, NULL, XML_PARSE_DTDATTR | XML_PARSE_NOENT); if (doc == NULL) { fprintf(stderr, "Error: unable to parse file \"%s\"\n", xml_filename); return(-1); } /* * Check the document is of the right kind */ if(xmlDocGetRootElement(doc) == NULL) { fprintf(stderr,"Error: empty document for file \"%s\"\n", xml_filename); xmlFreeDoc(doc); return(-1); } /* * load xpath file if specified */ if(xpath_filename) { xpath = load_xpath_expr(doc, xpath_filename); if(xpath == NULL) { fprintf(stderr,"Error: unable to evaluate xpath expression\n"); xmlFreeDoc(doc); return(-1); } } if (ns_filename != NULL) { if (loadMem(ns_filename, &nslist, &nssize)) { fprintf(stderr,"Error: unable to evaluate xpath expression\n"); if(xpath != NULL) xmlXPathFreeObject(xpath); xmlFreeDoc(doc); return(-1); } inclusive_namespaces = parse_list((xmlChar *) nslist); } /* * Canonical form */ /* fprintf(stderr,"File \"%s\" loaded: start canonization\n", xml_filename); */ ret = xmlC14NDocDumpMemory(doc, (xpath) ? xpath->nodesetval : NULL, mode, inclusive_namespaces, with_comments, &result); if (ret >= 0) { if(result != NULL) { if (compareFileMem(result_file, (const char *) result, ret)) { fprintf(stderr, "Result mismatch for %s\n", xml_filename); fprintf(stderr, "RESULT:\n%s\n", (const char*)result); ret = -1; } } } else { fprintf(stderr,"Error: failed to canonicalize XML file \"%s\" (ret=%d)\n", xml_filename, ret); ret = -1; } /* * Cleanup */ if (result != NULL) xmlFree(result); if(xpath != NULL) xmlXPathFreeObject(xpath); if (inclusive_namespaces != NULL) xmlFree(inclusive_namespaces); if (nslist != NULL) free((char *) nslist); xmlFreeDoc(doc); return(ret); }
c14nRunTest(const char* xml_filename, int with_comments, int mode, const char* xpath_filename, const char *ns_filename, const char* result_file) { xmlDocPtr doc; xmlXPathObjectPtr xpath = NULL; xmlChar *result = NULL; int ret; xmlChar **inclusive_namespaces = NULL; const char *nslist = NULL; int nssize; /* * build an XML tree from a the file; we need to add default * attributes and resolve all character and entities references */ xmlLoadExtDtdDefaultValue = XML_DETECT_IDS | XML_COMPLETE_ATTRS; xmlSubstituteEntitiesDefault(1); doc = xmlReadFile(xml_filename, NULL, XML_PARSE_DTDATTR | XML_PARSE_NOENT); if (doc == NULL) { fprintf(stderr, "Error: unable to parse file \"%s\"\n", xml_filename); return(-1); } /* * Check the document is of the right kind */ if(xmlDocGetRootElement(doc) == NULL) { fprintf(stderr,"Error: empty document for file \"%s\"\n", xml_filename); xmlFreeDoc(doc); return(-1); } /* * load xpath file if specified */ if(xpath_filename) { xpath = load_xpath_expr(doc, xpath_filename); if(xpath == NULL) { fprintf(stderr,"Error: unable to evaluate xpath expression\n"); xmlFreeDoc(doc); return(-1); } } if (ns_filename != NULL) { if (loadMem(ns_filename, &nslist, &nssize)) { fprintf(stderr,"Error: unable to evaluate xpath expression\n"); if(xpath != NULL) xmlXPathFreeObject(xpath); xmlFreeDoc(doc); return(-1); } inclusive_namespaces = parse_list((xmlChar *) nslist); } /* * Canonical form */ /* fprintf(stderr,"File \"%s\" loaded: start canonization\n", xml_filename); */ ret = xmlC14NDocDumpMemory(doc, (xpath) ? xpath->nodesetval : NULL, mode, inclusive_namespaces, with_comments, &result); if (ret >= 0) { if(result != NULL) { if (compareFileMem(result_file, (const char *) result, ret)) { fprintf(stderr, "Result mismatch for %s\n", xml_filename); fprintf(stderr, "RESULT:\n%s\n", (const char*)result); ret = -1; } } } else { fprintf(stderr,"Error: failed to canonicalize XML file \"%s\" (ret=%d)\n", xml_filename, ret); ret = -1; } /* * Cleanup */ if (result != NULL) xmlFree(result); if(xpath != NULL) xmlXPathFreeObject(xpath); if (inclusive_namespaces != NULL) xmlFree(inclusive_namespaces); if (nslist != NULL) free((char *) nslist); xmlFreeDoc(doc); return(ret); }
C
libxml2
0
CVE-2013-6621
https://www.cvedetails.com/cve/CVE-2013-6621/
CWE-399
https://github.com/chromium/chromium/commit/4039d2fcaab746b6c20017ba9bb51c3a2403a76c
4039d2fcaab746b6c20017ba9bb51c3a2403a76c
Add logging to figure out which IPC we're failing to deserialize in RenderFrame. BUG=369553 [email protected] Review URL: https://codereview.chromium.org/263833020 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@268565 0039d316-1c4b-4281-b951-d872f2087c98
void RenderFrameImpl::willReleaseScriptContext(blink::WebLocalFrame* frame, v8::Handle<v8::Context> context, int world_id) { DCHECK(!frame_ || frame_ == frame); FOR_EACH_OBSERVER(RenderFrameObserver, observers_, WillReleaseScriptContext(context, world_id)); }
void RenderFrameImpl::willReleaseScriptContext(blink::WebLocalFrame* frame, v8::Handle<v8::Context> context, int world_id) { DCHECK(!frame_ || frame_ == frame); FOR_EACH_OBSERVER(RenderFrameObserver, observers_, WillReleaseScriptContext(context, world_id)); }
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::HandleGetProgramInfoLog( uint32 immediate_data_size, const gles2::GetProgramInfoLog& c) { GLuint program = c.program; uint32 bucket_id = static_cast<uint32>(c.bucket_id); Bucket* bucket = CreateBucket(bucket_id); ProgramManager::ProgramInfo* info = GetProgramInfoNotShader( program, "glGetProgramInfoLog"); if (!info || !info->log_info()) { bucket->SetFromString(""); return error::kNoError; } bucket->SetFromString(info->log_info()->c_str()); return error::kNoError; }
error::Error GLES2DecoderImpl::HandleGetProgramInfoLog( uint32 immediate_data_size, const gles2::GetProgramInfoLog& c) { GLuint program = c.program; uint32 bucket_id = static_cast<uint32>(c.bucket_id); Bucket* bucket = CreateBucket(bucket_id); ProgramManager::ProgramInfo* info = GetProgramInfoNotShader( program, "glGetProgramInfoLog"); if (!info || !info->log_info()) { bucket->SetFromString(""); return error::kNoError; } bucket->SetFromString(info->log_info()->c_str()); return error::kNoError; }
C
Chrome
0
CVE-2018-9490
https://www.cvedetails.com/cve/CVE-2018-9490/
CWE-704
https://android.googlesource.com/platform/external/v8/+/a24543157ae2cdd25da43e20f4e48a07481e6ceb
a24543157ae2cdd25da43e20f4e48a07481e6ceb
Backport: Fix Object.entries/values with changing elements Bug: 111274046 Test: m -j proxy_resolver_v8_unittest && adb sync && adb shell \ /data/nativetest64/proxy_resolver_v8_unittest/proxy_resolver_v8_unittest Change-Id: I705fc512cc5837e9364ed187559cc75d079aa5cb (cherry picked from commit d8be9a10287afed07705ac8af027d6a46d4def99)
static bool HasAccessorsImpl(JSObject* holder, FixedArrayBase* backing_store) { FixedArray* parameter_map = FixedArray::cast(backing_store); FixedArrayBase* arguments = FixedArrayBase::cast(parameter_map->get(1)); return ArgumentsAccessor::HasAccessorsImpl(holder, arguments); }
static bool HasAccessorsImpl(JSObject* holder, FixedArrayBase* backing_store) { FixedArray* parameter_map = FixedArray::cast(backing_store); FixedArrayBase* arguments = FixedArrayBase::cast(parameter_map->get(1)); return ArgumentsAccessor::HasAccessorsImpl(holder, arguments); }
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
error::Error GLES2DecoderImpl::DoDrawArrays( const char* function_name, bool instanced, GLenum mode, GLint first, GLsizei count, GLsizei primcount) { error::Error error = WillAccessBoundFramebufferForDraw(); if (error != error::kNoError) return error; if (!validators_->draw_mode.IsValid(mode)) { LOCAL_SET_GL_ERROR_INVALID_ENUM(function_name, mode, "mode"); return error::kNoError; } if (count < 0) { LOCAL_SET_GL_ERROR(GL_INVALID_VALUE, function_name, "count < 0"); return error::kNoError; } if (primcount < 0) { LOCAL_SET_GL_ERROR(GL_INVALID_VALUE, function_name, "primcount < 0"); return error::kNoError; } if (!CheckBoundFramebuffersValid(function_name)) { return error::kNoError; } if (first < 0) { LOCAL_SET_GL_ERROR(GL_INVALID_VALUE, function_name, "first < 0"); return error::kNoError; } if (count == 0 || (instanced && primcount == 0)) { LOCAL_RENDER_WARNING("Render count or primcount is 0."); return error::kNoError; } GLuint max_vertex_accessed = first + count - 1; if (IsDrawValid(function_name, max_vertex_accessed, primcount)) { if (!ClearUnclearedTextures()) { LOCAL_SET_GL_ERROR(GL_INVALID_VALUE, function_name, "out of memory"); return error::kNoError; } bool simulated_attrib_0 = false; if (!SimulateAttrib0( function_name, max_vertex_accessed, &simulated_attrib_0)) { return error::kNoError; } bool simulated_fixed_attribs = false; if (SimulateFixedAttribs( function_name, max_vertex_accessed, &simulated_fixed_attribs, primcount)) { bool textures_set = !PrepareTexturesForRender(); ApplyDirtyState(); ScopedRenderTo do_render(framebuffer_state_.bound_draw_framebuffer.get()); if (!instanced) { glDrawArrays(mode, first, count); } else { glDrawArraysInstancedANGLE(mode, first, count, primcount); } ProcessPendingQueries(); if (textures_set) { RestoreStateForTextures(); } if (simulated_fixed_attribs) { RestoreStateForSimulatedFixedAttribs(); } } if (simulated_attrib_0) { RestoreStateForAttrib(0, false); } } return error::kNoError; }
error::Error GLES2DecoderImpl::DoDrawArrays( const char* function_name, bool instanced, GLenum mode, GLint first, GLsizei count, GLsizei primcount) { error::Error error = WillAccessBoundFramebufferForDraw(); if (error != error::kNoError) return error; if (!validators_->draw_mode.IsValid(mode)) { LOCAL_SET_GL_ERROR_INVALID_ENUM(function_name, mode, "mode"); return error::kNoError; } if (count < 0) { LOCAL_SET_GL_ERROR(GL_INVALID_VALUE, function_name, "count < 0"); return error::kNoError; } if (primcount < 0) { LOCAL_SET_GL_ERROR(GL_INVALID_VALUE, function_name, "primcount < 0"); return error::kNoError; } if (!CheckBoundFramebuffersValid(function_name)) { return error::kNoError; } if (first < 0) { LOCAL_SET_GL_ERROR(GL_INVALID_VALUE, function_name, "first < 0"); return error::kNoError; } if (count == 0 || (instanced && primcount == 0)) { LOCAL_RENDER_WARNING("Render count or primcount is 0."); return error::kNoError; } GLuint max_vertex_accessed = first + count - 1; if (IsDrawValid(function_name, max_vertex_accessed, primcount)) { if (!ClearUnclearedTextures()) { LOCAL_SET_GL_ERROR(GL_INVALID_VALUE, function_name, "out of memory"); return error::kNoError; } bool simulated_attrib_0 = false; if (!SimulateAttrib0( function_name, max_vertex_accessed, &simulated_attrib_0)) { return error::kNoError; } bool simulated_fixed_attribs = false; if (SimulateFixedAttribs( function_name, max_vertex_accessed, &simulated_fixed_attribs, primcount)) { bool textures_set = !PrepareTexturesForRender(); ApplyDirtyState(); ScopedRenderTo do_render(framebuffer_state_.bound_draw_framebuffer.get()); if (!instanced) { glDrawArrays(mode, first, count); } else { glDrawArraysInstancedANGLE(mode, first, count, primcount); } ProcessPendingQueries(); if (textures_set) { RestoreStateForTextures(); } if (simulated_fixed_attribs) { RestoreStateForSimulatedFixedAttribs(); } } if (simulated_attrib_0) { RestoreStateForAttrib(0, false); } } return error::kNoError; }
C
Chrome
0
CVE-2018-6111
https://www.cvedetails.com/cve/CVE-2018-6111/
CWE-20
https://github.com/chromium/chromium/commit/3c8e4852477d5b1e2da877808c998dc57db9460f
3c8e4852477d5b1e2da877808c998dc57db9460f
DevTools: speculative fix for crash in NetworkHandler::Disable This keeps BrowserContext* and StoragePartition* instead of RenderProcessHost* in an attemp to resolve UAF of RenderProcessHost upon closure of DevTools front-end. Bug: 801117, 783067, 780694 Change-Id: I6c2cca60cc0c29f0949d189cf918769059f80c1b Reviewed-on: https://chromium-review.googlesource.com/876657 Commit-Queue: Andrey Kosyakov <[email protected]> Reviewed-by: Dmitry Gozman <[email protected]> Cr-Commit-Position: refs/heads/master@{#531157}
InspectorHandler::~InspectorHandler() { }
InspectorHandler::~InspectorHandler() { }
C
Chrome
0
null
null
null
https://github.com/chromium/chromium/commit/820957a3386e960334be3b93b48636e749d38ea3
820957a3386e960334be3b93b48636e749d38ea3
Make WebContentsDelegate::OpenColorChooser return NULL on failure Changing WebContentsDelegate::OpenColorChooser to return NULL on failure so we don't put the same ColorChooser into two scoped_ptrs(WebContentsImpl::color_chooser_) BUG=331790 Review URL: https://codereview.chromium.org/128053002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@244710 0039d316-1c4b-4281-b951-d872f2087c98
bool ForEachFrameInternal( const base::Callback<void(RenderFrameHost*)>& on_frame, FrameTreeNode* node) { on_frame.Run(node->current_frame_host()); return true; }
bool ForEachFrameInternal( const base::Callback<void(RenderFrameHost*)>& on_frame, FrameTreeNode* node) { on_frame.Run(node->current_frame_host()); return true; }
C
Chrome
0
CVE-2019-15922
https://www.cvedetails.com/cve/CVE-2019-15922/
CWE-476
https://github.com/torvalds/linux/commit/58ccd2d31e502c37e108b285bf3d343eb00c235b
58ccd2d31e502c37e108b285bf3d343eb00c235b
paride/pf: Fix potential NULL pointer dereference Syzkaller report this: pf: pf version 1.04, major 47, cluster 64, nice 0 pf: No ATAPI disk detected kasan: CONFIG_KASAN_INLINE enabled kasan: GPF could be caused by NULL-ptr deref or user memory access general protection fault: 0000 [#1] SMP KASAN PTI CPU: 0 PID: 9887 Comm: syz-executor.0 Tainted: G C 5.1.0-rc3+ #8 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.10.2-1ubuntu1 04/01/2014 RIP: 0010:pf_init+0x7af/0x1000 [pf] Code: 46 77 d2 48 89 d8 48 c1 e8 03 80 3c 28 00 74 08 48 89 df e8 03 25 a6 d2 4c 8b 23 49 8d bc 24 80 05 00 00 48 89 f8 48 c1 e8 03 <80> 3c 28 00 74 05 e8 e6 24 a6 d2 49 8b bc 24 80 05 00 00 e8 79 34 RSP: 0018:ffff8881abcbf998 EFLAGS: 00010202 RAX: 00000000000000b0 RBX: ffffffffc1e4a8a8 RCX: ffffffffaec50788 RDX: 0000000000039b10 RSI: ffffc9000153c000 RDI: 0000000000000580 RBP: dffffc0000000000 R08: ffffed103ee44e59 R09: ffffed103ee44e59 R10: 0000000000000001 R11: ffffed103ee44e58 R12: 0000000000000000 R13: ffffffffc1e4b028 R14: 0000000000000000 R15: 0000000000000020 FS: 00007f1b78a91700(0000) GS:ffff8881f7200000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007f6d72b207f8 CR3: 00000001d5790004 CR4: 00000000007606f0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 PKRU: 55555554 Call Trace: ? 0xffffffffc1e50000 do_one_initcall+0xbc/0x47d init/main.c:901 do_init_module+0x1b5/0x547 kernel/module.c:3456 load_module+0x6405/0x8c10 kernel/module.c:3804 __do_sys_finit_module+0x162/0x190 kernel/module.c:3898 do_syscall_64+0x9f/0x450 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x462e99 Code: f7 d8 64 89 02 b8 ff ff ff ff c3 66 0f 1f 44 00 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 bc ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f1b78a90c58 EFLAGS: 00000246 ORIG_RAX: 0000000000000139 RAX: ffffffffffffffda RBX: 000000000073bf00 RCX: 0000000000462e99 RDX: 0000000000000000 RSI: 0000000020000180 RDI: 0000000000000003 RBP: 00007f1b78a90c70 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00007f1b78a916bc R13: 00000000004bcefa R14: 00000000006f6fb0 R15: 0000000000000004 Modules linked in: pf(+) paride gpio_tps65218 tps65218 i2c_cht_wc ati_remote dc395x act_meta_skbtcindex act_ife ife ecdh_generic rc_xbox_dvd sky81452_regulator v4l2_fwnode leds_blinkm snd_usb_hiface comedi(C) aes_ti slhc cfi_cmdset_0020 mtd cfi_util sx8654 mdio_gpio of_mdio fixed_phy mdio_bitbang libphy alcor_pci matrix_keymap hid_uclogic usbhid scsi_transport_fc videobuf2_v4l2 videobuf2_dma_sg snd_soc_pcm179x_spi snd_soc_pcm179x_codec i2c_demux_pinctrl mdev snd_indigodj isl6405 mii enc28j60 cmac adt7316_i2c(C) adt7316(C) fmc_trivial fmc nf_reject_ipv4 authenc rc_dtt200u rtc_ds1672 dvb_usb_dibusb_mc dvb_usb_dibusb_mc_common dib3000mc dibx000_common dvb_usb_dibusb_common dvb_usb dvb_core videobuf2_common videobuf2_vmalloc videobuf2_memops regulator_haptic adf7242 mac802154 ieee802154 s5h1409 da9034_ts snd_intel8x0m wmi cx24120 usbcore sdhci_cadence sdhci_pltfm sdhci mmc_core joydev i2c_algo_bit scsi_transport_iscsi iscsi_boot_sysfs ves1820 lockd grace nfs_acl auth_rpcgss sunrp c ip_vs snd_soc_adau7002 snd_cs4281 snd_rawmidi gameport snd_opl3_lib snd_seq_device snd_hwdep snd_ac97_codec ad7418 hid_primax hid snd_soc_cs4265 snd_soc_core snd_pcm_dmaengine snd_pcm snd_timer ac97_bus snd_compress snd soundcore ti_adc108s102 eeprom_93cx6 i2c_algo_pca mlxreg_hotplug st_pressure st_sensors industrialio_triggered_buffer kfifo_buf industrialio v4l2_common videodev media snd_soc_adau_utils rc_pinnacle_grey rc_core pps_gpio leds_lm3692x nandcore ledtrig_pattern iptable_security iptable_raw iptable_mangle iptable_nat nf_nat nf_conntrack nf_defrag_ipv6 nf_defrag_ipv4 iptable_filter bpfilter ip6_vti ip_vti ip_gre ipip sit tunnel4 ip_tunnel hsr veth netdevsim vxcan batman_adv cfg80211 rfkill chnl_net caif nlmon dummy team bonding vcan bridge stp llc ip6_gre gre ip6_tunnel tunnel6 tun mousedev ppdev tpm kvm_intel kvm irqbypass crct10dif_pclmul crc32_pclmul crc32c_intel ghash_clmulni_intel aesni_intel ide_pci_generic aes_x86_64 piix crypto_simd input_leds psmouse cryp td glue_helper ide_core intel_agp serio_raw intel_gtt agpgart ata_generic i2c_piix4 pata_acpi parport_pc parport rtc_cmos floppy sch_fq_codel ip_tables x_tables sha1_ssse3 sha1_generic ipv6 [last unloaded: paride] Dumping ftrace buffer: (ftrace buffer empty) ---[ end trace 7a818cf5f210d79e ]--- If alloc_disk fails in pf_init_units, pf->disk will be NULL, however in pf_detect and pf_exit, it's not check this before free.It may result a NULL pointer dereference. Also when register_blkdev failed, blk_cleanup_queue() and blk_mq_free_tag_set() should be called to free resources. Reported-by: Hulk Robot <[email protected]> Fixes: 6ce59025f118 ("paride/pf: cleanup queues when detection fails") Signed-off-by: YueHaibing <[email protected]> Signed-off-by: Jens Axboe <[email protected]>
static inline int status_reg(struct pf_unit *pf) { return pi_read_regr(pf->pi, 1, 6); }
static inline int status_reg(struct pf_unit *pf) { return pi_read_regr(pf->pi, 1, 6); }
C
linux
0
CVE-2015-3215
https://www.cvedetails.com/cve/CVE-2015-3215/
CWE-20
https://github.com/YanVugenfirer/kvm-guest-drivers-windows/commit/fbfa4d1083ea84c5429992ca3e996d7d4fbc8238
fbfa4d1083ea84c5429992ca3e996d7d4fbc8238
NetKVM: BZ#1169718: More rigoruous testing of incoming packet Signed-off-by: Joseph Hindin <[email protected]>
static void DumpVirtIOFeatures(PPARANDIS_ADAPTER pContext) { static const struct { ULONG bitmask; PCHAR Name; } Features[] = { {VIRTIO_NET_F_CSUM, "VIRTIO_NET_F_CSUM" }, {VIRTIO_NET_F_GUEST_CSUM, "VIRTIO_NET_F_GUEST_CSUM" }, {VIRTIO_NET_F_MAC, "VIRTIO_NET_F_MAC" }, {VIRTIO_NET_F_GSO, "VIRTIO_NET_F_GSO" }, {VIRTIO_NET_F_GUEST_TSO4, "VIRTIO_NET_F_GUEST_TSO4"}, {VIRTIO_NET_F_GUEST_TSO6, "VIRTIO_NET_F_GUEST_TSO6"}, {VIRTIO_NET_F_GUEST_ECN, "VIRTIO_NET_F_GUEST_ECN"}, {VIRTIO_NET_F_GUEST_UFO, "VIRTIO_NET_F_GUEST_UFO"}, {VIRTIO_NET_F_HOST_TSO4, "VIRTIO_NET_F_HOST_TSO4"}, {VIRTIO_NET_F_HOST_TSO6, "VIRTIO_NET_F_HOST_TSO6"}, {VIRTIO_NET_F_HOST_ECN, "VIRTIO_NET_F_HOST_ECN"}, {VIRTIO_NET_F_HOST_UFO, "VIRTIO_NET_F_HOST_UFO"}, {VIRTIO_NET_F_MRG_RXBUF, "VIRTIO_NET_F_MRG_RXBUF"}, {VIRTIO_NET_F_STATUS, "VIRTIO_NET_F_STATUS"}, {VIRTIO_NET_F_CTRL_VQ, "VIRTIO_NET_F_CTRL_VQ"}, {VIRTIO_NET_F_CTRL_RX, "VIRTIO_NET_F_CTRL_RX"}, {VIRTIO_NET_F_CTRL_VLAN, "VIRTIO_NET_F_CTRL_VLAN"}, {VIRTIO_NET_F_CTRL_RX_EXTRA, "VIRTIO_NET_F_CTRL_RX_EXTRA"}, {VIRTIO_NET_F_CTRL_MAC_ADDR, "VIRTIO_NET_F_CTRL_MAC_ADDR"}, {VIRTIO_F_INDIRECT, "VIRTIO_F_INDIRECT"}, {VIRTIO_F_ANY_LAYOUT, "VIRTIO_F_ANY_LAYOUT"}, { VIRTIO_RING_F_EVENT_IDX, "VIRTIO_RING_F_EVENT_IDX" }, }; UINT i; for (i = 0; i < sizeof(Features)/sizeof(Features[0]); ++i) { if (VirtIOIsFeatureEnabled(pContext->u32HostFeatures, Features[i].bitmask)) { DPrintf(0, ("VirtIO Host Feature %s\n", Features[i].Name)); } } }
static void DumpVirtIOFeatures(PPARANDIS_ADAPTER pContext) { static const struct { ULONG bitmask; PCHAR Name; } Features[] = { {VIRTIO_NET_F_CSUM, "VIRTIO_NET_F_CSUM" }, {VIRTIO_NET_F_GUEST_CSUM, "VIRTIO_NET_F_GUEST_CSUM" }, {VIRTIO_NET_F_MAC, "VIRTIO_NET_F_MAC" }, {VIRTIO_NET_F_GSO, "VIRTIO_NET_F_GSO" }, {VIRTIO_NET_F_GUEST_TSO4, "VIRTIO_NET_F_GUEST_TSO4"}, {VIRTIO_NET_F_GUEST_TSO6, "VIRTIO_NET_F_GUEST_TSO6"}, {VIRTIO_NET_F_GUEST_ECN, "VIRTIO_NET_F_GUEST_ECN"}, {VIRTIO_NET_F_GUEST_UFO, "VIRTIO_NET_F_GUEST_UFO"}, {VIRTIO_NET_F_HOST_TSO4, "VIRTIO_NET_F_HOST_TSO4"}, {VIRTIO_NET_F_HOST_TSO6, "VIRTIO_NET_F_HOST_TSO6"}, {VIRTIO_NET_F_HOST_ECN, "VIRTIO_NET_F_HOST_ECN"}, {VIRTIO_NET_F_HOST_UFO, "VIRTIO_NET_F_HOST_UFO"}, {VIRTIO_NET_F_MRG_RXBUF, "VIRTIO_NET_F_MRG_RXBUF"}, {VIRTIO_NET_F_STATUS, "VIRTIO_NET_F_STATUS"}, {VIRTIO_NET_F_CTRL_VQ, "VIRTIO_NET_F_CTRL_VQ"}, {VIRTIO_NET_F_CTRL_RX, "VIRTIO_NET_F_CTRL_RX"}, {VIRTIO_NET_F_CTRL_VLAN, "VIRTIO_NET_F_CTRL_VLAN"}, {VIRTIO_NET_F_CTRL_RX_EXTRA, "VIRTIO_NET_F_CTRL_RX_EXTRA"}, {VIRTIO_NET_F_CTRL_MAC_ADDR, "VIRTIO_NET_F_CTRL_MAC_ADDR"}, {VIRTIO_F_INDIRECT, "VIRTIO_F_INDIRECT"}, {VIRTIO_F_ANY_LAYOUT, "VIRTIO_F_ANY_LAYOUT"}, { VIRTIO_RING_F_EVENT_IDX, "VIRTIO_RING_F_EVENT_IDX" }, }; UINT i; for (i = 0; i < sizeof(Features)/sizeof(Features[0]); ++i) { if (VirtIOIsFeatureEnabled(pContext->u32HostFeatures, Features[i].bitmask)) { DPrintf(0, ("VirtIO Host Feature %s\n", Features[i].Name)); } } }
C
kvm-guest-drivers-windows
0
CVE-2018-10184
https://www.cvedetails.com/cve/CVE-2018-10184/
CWE-119
https://git.haproxy.org/?p=haproxy.git;a=commit;h=3f0e1ec70173593f4c2b3681b26c04a4ed5fc588
3f0e1ec70173593f4c2b3681b26c04a4ed5fc588
null
static inline __maybe_unused int h2_get_frame_hdr(struct buffer *b, struct h2_fh *h) { int ret; ret = h2_peek_frame_hdr(b, h); if (ret > 0) h2_skip_frame_hdr(b); return ret; }
static inline __maybe_unused int h2_get_frame_hdr(struct buffer *b, struct h2_fh *h) { int ret; ret = h2_peek_frame_hdr(b, h); if (ret > 0) h2_skip_frame_hdr(b); return ret; }
C
haproxy
0
CVE-2012-2895
https://www.cvedetails.com/cve/CVE-2012-2895/
CWE-119
https://github.com/chromium/chromium/commit/16dcd30c215801941d9890859fd79a234128fc3e
16dcd30c215801941d9890859fd79a234128fc3e
Refactors to simplify rename pathway in DownloadFileManager. This is https://chromiumcodereview.appspot.com/10668004 / r144817 (reverted due to CrOS failure) with the completion logic moved to after the auto-opening. The tests that test the auto-opening (for web store install) were waiting for download completion to check install, and hence were failing when completion was moved earlier. Doing this right would probably require another state (OPENED). BUG=123998 BUG-134930 [email protected] Review URL: https://chromiumcodereview.appspot.com/10701040 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@145157 0039d316-1c4b-4281-b951-d872f2087c98
void DownloadItemImpl::SetExternalData( const void* key, DownloadItem::ExternalData* data) { std::map<const void*, ExternalData*>::iterator it = external_data_map_.find(key); if (it == external_data_map_.end()) { external_data_map_[key] = data; } else if (it->second != data) { delete it->second; it->second = data; } }
void DownloadItemImpl::SetExternalData( const void* key, DownloadItem::ExternalData* data) { std::map<const void*, ExternalData*>::iterator it = external_data_map_.find(key); if (it == external_data_map_.end()) { external_data_map_[key] = data; } else if (it->second != data) { delete it->second; it->second = data; } }
C
Chrome
0
CVE-2019-11338
https://www.cvedetails.com/cve/CVE-2019-11338/
CWE-476
https://github.com/FFmpeg/FFmpeg/commit/54655623a82632e7624714d7b2a3e039dc5faa7e
54655623a82632e7624714d7b2a3e039dc5faa7e
avcodec/hevcdec: Avoid only partly skiping duplicate first slices Fixes: NULL pointer dereference and out of array access Fixes: 13871/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_HEVC_fuzzer-5746167087890432 Fixes: 13845/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_HEVC_fuzzer-5650370728034304 This also fixes the return code for explode mode Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Reviewed-by: James Almer <[email protected]> Signed-off-by: Michael Niedermayer <[email protected]>
static int hls_coding_quadtree(HEVCContext *s, int x0, int y0, int log2_cb_size, int cb_depth) { HEVCLocalContext *lc = s->HEVClc; const int cb_size = 1 << log2_cb_size; int ret; int split_cu; lc->ct_depth = cb_depth; if (x0 + cb_size <= s->ps.sps->width && y0 + cb_size <= s->ps.sps->height && log2_cb_size > s->ps.sps->log2_min_cb_size) { split_cu = ff_hevc_split_coding_unit_flag_decode(s, cb_depth, x0, y0); } else { split_cu = (log2_cb_size > s->ps.sps->log2_min_cb_size); } if (s->ps.pps->cu_qp_delta_enabled_flag && log2_cb_size >= s->ps.sps->log2_ctb_size - s->ps.pps->diff_cu_qp_delta_depth) { lc->tu.is_cu_qp_delta_coded = 0; lc->tu.cu_qp_delta = 0; } if (s->sh.cu_chroma_qp_offset_enabled_flag && log2_cb_size >= s->ps.sps->log2_ctb_size - s->ps.pps->diff_cu_chroma_qp_offset_depth) { lc->tu.is_cu_chroma_qp_offset_coded = 0; } if (split_cu) { int qp_block_mask = (1<<(s->ps.sps->log2_ctb_size - s->ps.pps->diff_cu_qp_delta_depth)) - 1; const int cb_size_split = cb_size >> 1; const int x1 = x0 + cb_size_split; const int y1 = y0 + cb_size_split; int more_data = 0; more_data = hls_coding_quadtree(s, x0, y0, log2_cb_size - 1, cb_depth + 1); if (more_data < 0) return more_data; if (more_data && x1 < s->ps.sps->width) { more_data = hls_coding_quadtree(s, x1, y0, log2_cb_size - 1, cb_depth + 1); if (more_data < 0) return more_data; } if (more_data && y1 < s->ps.sps->height) { more_data = hls_coding_quadtree(s, x0, y1, log2_cb_size - 1, cb_depth + 1); if (more_data < 0) return more_data; } if (more_data && x1 < s->ps.sps->width && y1 < s->ps.sps->height) { more_data = hls_coding_quadtree(s, x1, y1, log2_cb_size - 1, cb_depth + 1); if (more_data < 0) return more_data; } if(((x0 + (1<<log2_cb_size)) & qp_block_mask) == 0 && ((y0 + (1<<log2_cb_size)) & qp_block_mask) == 0) lc->qPy_pred = lc->qp_y; if (more_data) return ((x1 + cb_size_split) < s->ps.sps->width || (y1 + cb_size_split) < s->ps.sps->height); else return 0; } else { ret = hls_coding_unit(s, x0, y0, log2_cb_size); if (ret < 0) return ret; if ((!((x0 + cb_size) % (1 << (s->ps.sps->log2_ctb_size))) || (x0 + cb_size >= s->ps.sps->width)) && (!((y0 + cb_size) % (1 << (s->ps.sps->log2_ctb_size))) || (y0 + cb_size >= s->ps.sps->height))) { int end_of_slice_flag = ff_hevc_end_of_slice_flag_decode(s); return !end_of_slice_flag; } else { return 1; } } return 0; }
static int hls_coding_quadtree(HEVCContext *s, int x0, int y0, int log2_cb_size, int cb_depth) { HEVCLocalContext *lc = s->HEVClc; const int cb_size = 1 << log2_cb_size; int ret; int split_cu; lc->ct_depth = cb_depth; if (x0 + cb_size <= s->ps.sps->width && y0 + cb_size <= s->ps.sps->height && log2_cb_size > s->ps.sps->log2_min_cb_size) { split_cu = ff_hevc_split_coding_unit_flag_decode(s, cb_depth, x0, y0); } else { split_cu = (log2_cb_size > s->ps.sps->log2_min_cb_size); } if (s->ps.pps->cu_qp_delta_enabled_flag && log2_cb_size >= s->ps.sps->log2_ctb_size - s->ps.pps->diff_cu_qp_delta_depth) { lc->tu.is_cu_qp_delta_coded = 0; lc->tu.cu_qp_delta = 0; } if (s->sh.cu_chroma_qp_offset_enabled_flag && log2_cb_size >= s->ps.sps->log2_ctb_size - s->ps.pps->diff_cu_chroma_qp_offset_depth) { lc->tu.is_cu_chroma_qp_offset_coded = 0; } if (split_cu) { int qp_block_mask = (1<<(s->ps.sps->log2_ctb_size - s->ps.pps->diff_cu_qp_delta_depth)) - 1; const int cb_size_split = cb_size >> 1; const int x1 = x0 + cb_size_split; const int y1 = y0 + cb_size_split; int more_data = 0; more_data = hls_coding_quadtree(s, x0, y0, log2_cb_size - 1, cb_depth + 1); if (more_data < 0) return more_data; if (more_data && x1 < s->ps.sps->width) { more_data = hls_coding_quadtree(s, x1, y0, log2_cb_size - 1, cb_depth + 1); if (more_data < 0) return more_data; } if (more_data && y1 < s->ps.sps->height) { more_data = hls_coding_quadtree(s, x0, y1, log2_cb_size - 1, cb_depth + 1); if (more_data < 0) return more_data; } if (more_data && x1 < s->ps.sps->width && y1 < s->ps.sps->height) { more_data = hls_coding_quadtree(s, x1, y1, log2_cb_size - 1, cb_depth + 1); if (more_data < 0) return more_data; } if(((x0 + (1<<log2_cb_size)) & qp_block_mask) == 0 && ((y0 + (1<<log2_cb_size)) & qp_block_mask) == 0) lc->qPy_pred = lc->qp_y; if (more_data) return ((x1 + cb_size_split) < s->ps.sps->width || (y1 + cb_size_split) < s->ps.sps->height); else return 0; } else { ret = hls_coding_unit(s, x0, y0, log2_cb_size); if (ret < 0) return ret; if ((!((x0 + cb_size) % (1 << (s->ps.sps->log2_ctb_size))) || (x0 + cb_size >= s->ps.sps->width)) && (!((y0 + cb_size) % (1 << (s->ps.sps->log2_ctb_size))) || (y0 + cb_size >= s->ps.sps->height))) { int end_of_slice_flag = ff_hevc_end_of_slice_flag_decode(s); return !end_of_slice_flag; } else { return 1; } } return 0; }
C
FFmpeg
0
CVE-2009-3605
https://www.cvedetails.com/cve/CVE-2009-3605/
CWE-189
https://cgit.freedesktop.org/poppler/poppler/commit/?id=7b2d314a61fd0e12f47c62996cb49ec0d1ba747a
7b2d314a61fd0e12f47c62996cb49ec0d1ba747a
null
GfxAxialShading::~GfxAxialShading() { int i; for (i = 0; i < nFuncs; ++i) { delete funcs[i]; } }
GfxAxialShading::~GfxAxialShading() { int i; for (i = 0; i < nFuncs; ++i) { delete funcs[i]; } }
CPP
poppler
0
null
null
null
https://github.com/chromium/chromium/commit/aac449e7154720b895ff1e7f3497c2ce95ae1a5a
aac449e7154720b895ff1e7f3497c2ce95ae1a5a
POSIX: make sure that we never pass directory descriptors into the sandbox. BUG=43304 http://codereview.chromium.org/2733011/show git-svn-id: svn://svn.chromium.org/chrome/trunk/src@49446 0039d316-1c4b-4281-b951-d872f2087c98
void HandleLocaltime(int fd, const Pickle& pickle, void* iter, std::vector<int>& fds) { std::string time_string; if (!pickle.ReadString(&iter, &time_string) || time_string.size() != sizeof(time_t)) { return; } time_t time; memcpy(&time, time_string.data(), sizeof(time)); const struct tm* expanded_time = localtime(&time); std::string result_string; const char* time_zone_string = ""; if (expanded_time != NULL) { result_string = std::string(reinterpret_cast<const char*>(expanded_time), sizeof(struct tm)); time_zone_string = expanded_time->tm_zone; } Pickle reply; reply.WriteString(result_string); reply.WriteString(time_zone_string); SendRendererReply(fds, reply, -1); }
void HandleLocaltime(int fd, const Pickle& pickle, void* iter, std::vector<int>& fds) { std::string time_string; if (!pickle.ReadString(&iter, &time_string) || time_string.size() != sizeof(time_t)) { return; } time_t time; memcpy(&time, time_string.data(), sizeof(time)); const struct tm* expanded_time = localtime(&time); std::string result_string; const char* time_zone_string = ""; if (expanded_time != NULL) { result_string = std::string(reinterpret_cast<const char*>(expanded_time), sizeof(struct tm)); time_zone_string = expanded_time->tm_zone; } Pickle reply; reply.WriteString(result_string); reply.WriteString(time_zone_string); SendRendererReply(fds, reply, -1); }
C
Chrome
0
CVE-2011-2789
https://www.cvedetails.com/cve/CVE-2011-2789/
CWE-399
https://github.com/chromium/chromium/commit/55ef04e135edaa9abfbf3647634b11ed57dc49e9
55ef04e135edaa9abfbf3647634b11ed57dc49e9
Maintain a map of all resources in the resource tracker and clear instance back pointers when needed, BUG=85808 Review URL: http://codereview.chromium.org/7196001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@89746 0039d316-1c4b-4281-b951-d872f2087c98
PP_Resource PPB_URLLoader_Impl::Create(PP_Instance pp_instance) { PluginInstance* instance = ResourceTracker::Get()->GetInstance(pp_instance); if (!instance) return 0; PPB_URLLoader_Impl* loader = new PPB_URLLoader_Impl(instance, false); return loader->GetReference(); }
PP_Resource PPB_URLLoader_Impl::Create(PP_Instance pp_instance) { PluginInstance* instance = ResourceTracker::Get()->GetInstance(pp_instance); if (!instance) return 0; PPB_URLLoader_Impl* loader = new PPB_URLLoader_Impl(instance, false); return loader->GetReference(); }
C
Chrome
0
CVE-2018-1000127
https://www.cvedetails.com/cve/CVE-2018-1000127/
CWE-190
https://github.com/memcached/memcached/commit/a8c4a82787b8b6c256d61bd5c42fb7f92d1bae00
a8c4a82787b8b6c256d61bd5c42fb7f92d1bae00
Don't overflow item refcount on get Counts as a miss if the refcount is too high. ASCII multigets are the only time refcounts can be held for so long. doing a dirty read of refcount. is aligned. trying to avoid adding an extra refcount branch for all calls of item_get due to performance. might be able to move it in there after logging refactoring simplifies some of the branches.
static int ensure_iov_space(conn *c) { assert(c != NULL); if (c->iovused >= c->iovsize) { int i, iovnum; struct iovec *new_iov = (struct iovec *)realloc(c->iov, (c->iovsize * 2) * sizeof(struct iovec)); if (! new_iov) { STATS_LOCK(); stats.malloc_fails++; STATS_UNLOCK(); return -1; } c->iov = new_iov; c->iovsize *= 2; /* Point all the msghdr structures at the new list. */ for (i = 0, iovnum = 0; i < c->msgused; i++) { c->msglist[i].msg_iov = &c->iov[iovnum]; iovnum += c->msglist[i].msg_iovlen; } } return 0; }
static int ensure_iov_space(conn *c) { assert(c != NULL); if (c->iovused >= c->iovsize) { int i, iovnum; struct iovec *new_iov = (struct iovec *)realloc(c->iov, (c->iovsize * 2) * sizeof(struct iovec)); if (! new_iov) { STATS_LOCK(); stats.malloc_fails++; STATS_UNLOCK(); return -1; } c->iov = new_iov; c->iovsize *= 2; /* Point all the msghdr structures at the new list. */ for (i = 0, iovnum = 0; i < c->msgused; i++) { c->msglist[i].msg_iov = &c->iov[iovnum]; iovnum += c->msglist[i].msg_iovlen; } } return 0; }
C
memcached
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
static void curl_free_post(void **post) { curl_formfree((struct HttpPost *)*post); }
static void curl_free_post(void **post) { curl_formfree((struct HttpPost *)*post); }
C
php
0
null
null
null
https://github.com/chromium/chromium/commit/8353baf8d1504dbdd4ad7584ff2466de657521cd
8353baf8d1504dbdd4ad7584ff2466de657521cd
Remove WebFrame::canHaveSecureChild To simplify the public API, ServiceWorkerNetworkProvider can do the parent walk itself. Follow-up to https://crrev.com/ad1850962644e19. BUG=607543 Review-Url: https://codereview.chromium.org/2082493002 Cr-Commit-Position: refs/heads/master@{#400896}
void WebFrame::setParent(WebFrame* parent) { m_parent = parent; }
void WebFrame::setParent(WebFrame* parent) { m_parent = parent; }
C
Chrome
0
CVE-2018-18352
https://www.cvedetails.com/cve/CVE-2018-18352/
CWE-732
https://github.com/chromium/chromium/commit/a9cbaa7a40e2b2723cfc2f266c42f4980038a949
a9cbaa7a40e2b2723cfc2f266c42f4980038a949
Simplify "WouldTaintOrigin" concept in media/blink Currently WebMediaPlayer has three predicates: - DidGetOpaqueResponseFromServiceWorker - HasSingleSecurityOrigin - DidPassCORSAccessCheck . These are used to determine whether the response body is available for scripts. They are known to be confusing, and actually MediaElementAudioSourceHandler::WouldTaintOrigin misuses them. This CL merges the three predicates to one, WouldTaintOrigin, to remove the confusion. Now the "response type" concept is available and we don't need a custom CORS check, so this CL removes BaseAudioContext::WouldTaintOrigin. This CL also renames URLData::has_opaque_data_ and its (direct and indirect) data accessors to match the spec. Bug: 849942, 875153 Change-Id: I6acf50169d7445c4ff614e80ac606f79ee577d2a Reviewed-on: https://chromium-review.googlesource.com/c/1238098 Reviewed-by: Fredrik Hubinette <[email protected]> Reviewed-by: Kinuko Yasuda <[email protected]> Reviewed-by: Raymond Toy <[email protected]> Commit-Queue: Yutaka Hirano <[email protected]> Cr-Commit-Position: refs/heads/master@{#598258}
void MediaElementAudioSourceHandler::lock() { process_lock_.lock(); }
void MediaElementAudioSourceHandler::lock() { process_lock_.lock(); }
C
Chrome
0
CVE-2009-3605
https://www.cvedetails.com/cve/CVE-2009-3605/
CWE-189
https://cgit.freedesktop.org/poppler/poppler/commit/?id=7b2d314a61fd0e12f47c62996cb49ec0d1ba747a
7b2d314a61fd0e12f47c62996cb49ec0d1ba747a
null
void CairoImageOutputDev::saveImage(CairoImage *image) { if (numImages >= size) { size += 16; images = (CairoImage **) greallocn (images, size, sizeof (CairoImage *)); } images[numImages++] = image; }
void CairoImageOutputDev::saveImage(CairoImage *image) { if (numImages >= size) { size += 16; images = (CairoImage **) greallocn (images, size, sizeof (CairoImage *)); } images[numImages++] = image; }
CPP
poppler
0
CVE-2012-2816
https://www.cvedetails.com/cve/CVE-2012-2816/
null
https://github.com/chromium/chromium/commit/cd0bd79d6ebdb72183e6f0833673464cc10b3600
cd0bd79d6ebdb72183e6f0833673464cc10b3600
Convert plugin and GPU process to brokered handle duplication. BUG=119250 Review URL: https://chromiumcodereview.appspot.com/9958034 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@132303 0039d316-1c4b-4281-b951-d872f2087c98
void RenderingHelper::PlatformInitialize() { CHECK(x_display_ = base::MessagePumpForUI::GetDefaultXDisplay()); }
void RenderingHelper::PlatformInitialize() { CHECK(x_display_ = base::MessagePumpForUI::GetDefaultXDisplay()); }
C
Chrome
0
CVE-2013-2885
https://www.cvedetails.com/cve/CVE-2013-2885/
CWE-399
https://github.com/chromium/chromium/commit/79cfdeb5fbe79fa2604d37fba467f371cb436bc3
79cfdeb5fbe79fa2604d37fba467f371cb436bc3
Fix reentrance of BaseMultipleFieldsDateAndTimeInputType::destroyShadowSubtree. destroyShadowSubtree could dispatch 'blur' event unexpectedly because element()->focused() had incorrect information. We make sure it has correct information by checking if the UA shadow root contains the focused element. BUG=257353 Review URL: https://chromiumcodereview.appspot.com/19067004 git-svn-id: svn://svn.chromium.org/blink/trunk@154086 bbb929c8-8fbe-4397-9dbb-9b2b20218538
void BaseMultipleFieldsDateAndTimeInputType::spinButtonStepDown() { if (DateTimeEditElement* edit = dateTimeEditElement()) edit->stepDown(); }
void BaseMultipleFieldsDateAndTimeInputType::spinButtonStepDown() { if (DateTimeEditElement* edit = dateTimeEditElement()) edit->stepDown(); }
C
Chrome
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]>
encode_ofpact(const struct ofpact *a, enum ofp_version ofp_version, struct ofpbuf *out) { switch (a->type) { #define OFPACT(ENUM, STRUCT, MEMBER, NAME) \ case OFPACT_##ENUM: \ encode_##ENUM(ofpact_get_##ENUM(a), ofp_version, out); \ return; OFPACTS #undef OFPACT default: OVS_NOT_REACHED(); } }
encode_ofpact(const struct ofpact *a, enum ofp_version ofp_version, struct ofpbuf *out) { switch (a->type) { #define OFPACT(ENUM, STRUCT, MEMBER, NAME) \ case OFPACT_##ENUM: \ encode_##ENUM(ofpact_get_##ENUM(a), ofp_version, out); \ return; OFPACTS #undef OFPACT default: OVS_NOT_REACHED(); } }
C
ovs
0
CVE-2015-4643
https://www.cvedetails.com/cve/CVE-2015-4643/
CWE-119
https://git.php.net/?p=php-src.git;a=commit;h=0765623d6991b62ffcd93ddb6be8a5203a2fa7e2
0765623d6991b62ffcd93ddb6be8a5203a2fa7e2
null
ftp_mkdir(ftpbuf_t *ftp, const char *dir) { char *mkd, *end; if (ftp == NULL) { return NULL; } if (!ftp_putcmd(ftp, "MKD", dir)) { return NULL; } if (!ftp_getresp(ftp) || ftp->resp != 257) { return NULL; } /* copy out the dir from response */ if ((mkd = strchr(ftp->inbuf, '"')) == NULL) { mkd = estrdup(dir); return mkd; } if ((end = strrchr(++mkd, '"')) == NULL) { return NULL; } *end = 0; mkd = estrdup(mkd); *end = '"'; return mkd; }
ftp_mkdir(ftpbuf_t *ftp, const char *dir) { char *mkd, *end; if (ftp == NULL) { return NULL; } if (!ftp_putcmd(ftp, "MKD", dir)) { return NULL; } if (!ftp_getresp(ftp) || ftp->resp != 257) { return NULL; } /* copy out the dir from response */ if ((mkd = strchr(ftp->inbuf, '"')) == NULL) { mkd = estrdup(dir); return mkd; } if ((end = strrchr(++mkd, '"')) == NULL) { return NULL; } *end = 0; mkd = estrdup(mkd); *end = '"'; return mkd; }
C
php
0
null
null
null
https://github.com/chromium/chromium/commit/3b7ff00418c0e7593d42e5648ba39397e23fe2f9
3b7ff00418c0e7593d42e5648ba39397e23fe2f9
sync: ensure sync init path doesn't block on CheckTime The call to RequestEarlyExit (which calls Abort) only happens if the SyncBackendHost has received the initialization callback from the SyncManager. But during init, the SyncManager could make a call to CheckTime, meaning that call would never be aborted. This patch makes sure to cover that case. BUG=93829 TEST=None at the moment :( Review URL: http://codereview.chromium.org/7862011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@100543 0039d316-1c4b-4281-b951-d872f2087c98
void SyncManager::RequestCleanupDisabledTypes() { if (data_->scheduler()) data_->scheduler()->ScheduleCleanupDisabledTypes(); }
void SyncManager::RequestCleanupDisabledTypes() { if (data_->scheduler()) data_->scheduler()->ScheduleCleanupDisabledTypes(); }
C
Chrome
0
CVE-2018-14395
https://www.cvedetails.com/cve/CVE-2018-14395/
CWE-369
https://github.com/FFmpeg/FFmpeg/commit/fa19fbcf712a6a6cc5a5cfdc3254a97b9bce6582
fa19fbcf712a6a6cc5a5cfdc3254a97b9bce6582
avformat/movenc: Write version 2 of audio atom if channels is not known The version 1 needs the channel count and would divide by 0 Fixes: division by 0 Fixes: fpe_movenc.c_1108_1.ogg Fixes: fpe_movenc.c_1108_2.ogg Fixes: fpe_movenc.c_1108_3.wav Found-by: #CHEN HONGXU# <[email protected]> Signed-off-by: Michael Niedermayer <[email protected]>
static int mov_write_dvc1_structs(MOVTrack *track, uint8_t *buf) { uint8_t *unescaped; const uint8_t *start, *next, *end = track->vos_data + track->vos_len; int unescaped_size, seq_found = 0; int level = 0, interlace = 0; int packet_seq = track->vc1_info.packet_seq; int packet_entry = track->vc1_info.packet_entry; int slices = track->vc1_info.slices; PutBitContext pbc; if (track->start_dts == AV_NOPTS_VALUE) { /* No packets written yet, vc1_info isn't authoritative yet. */ /* Assume inline sequence and entry headers. */ packet_seq = packet_entry = 1; av_log(NULL, AV_LOG_WARNING, "moov atom written before any packets, unable to write correct " "dvc1 atom. Set the delay_moov flag to fix this.\n"); } unescaped = av_mallocz(track->vos_len + AV_INPUT_BUFFER_PADDING_SIZE); if (!unescaped) return AVERROR(ENOMEM); start = find_next_marker(track->vos_data, end); for (next = start; next < end; start = next) { GetBitContext gb; int size; next = find_next_marker(start + 4, end); size = next - start - 4; if (size <= 0) continue; unescaped_size = vc1_unescape_buffer(start + 4, size, unescaped); init_get_bits(&gb, unescaped, 8 * unescaped_size); if (AV_RB32(start) == VC1_CODE_SEQHDR) { int profile = get_bits(&gb, 2); if (profile != PROFILE_ADVANCED) { av_free(unescaped); return AVERROR(ENOSYS); } seq_found = 1; level = get_bits(&gb, 3); /* chromaformat, frmrtq_postproc, bitrtq_postproc, postprocflag, * width, height */ skip_bits_long(&gb, 2 + 3 + 5 + 1 + 2*12); skip_bits(&gb, 1); /* broadcast */ interlace = get_bits1(&gb); skip_bits(&gb, 4); /* tfcntrflag, finterpflag, reserved, psf */ } } if (!seq_found) { av_free(unescaped); return AVERROR(ENOSYS); } init_put_bits(&pbc, buf, 7); /* VC1DecSpecStruc */ put_bits(&pbc, 4, 12); /* profile - advanced */ put_bits(&pbc, 3, level); put_bits(&pbc, 1, 0); /* reserved */ /* VC1AdvDecSpecStruc */ put_bits(&pbc, 3, level); put_bits(&pbc, 1, 0); /* cbr */ put_bits(&pbc, 6, 0); /* reserved */ put_bits(&pbc, 1, !interlace); /* no interlace */ put_bits(&pbc, 1, !packet_seq); /* no multiple seq */ put_bits(&pbc, 1, !packet_entry); /* no multiple entry */ put_bits(&pbc, 1, !slices); /* no slice code */ put_bits(&pbc, 1, 0); /* no bframe */ put_bits(&pbc, 1, 0); /* reserved */ /* framerate */ if (track->st->avg_frame_rate.num > 0 && track->st->avg_frame_rate.den > 0) put_bits32(&pbc, track->st->avg_frame_rate.num / track->st->avg_frame_rate.den); else put_bits32(&pbc, 0xffffffff); flush_put_bits(&pbc); av_free(unescaped); return 0; }
static int mov_write_dvc1_structs(MOVTrack *track, uint8_t *buf) { uint8_t *unescaped; const uint8_t *start, *next, *end = track->vos_data + track->vos_len; int unescaped_size, seq_found = 0; int level = 0, interlace = 0; int packet_seq = track->vc1_info.packet_seq; int packet_entry = track->vc1_info.packet_entry; int slices = track->vc1_info.slices; PutBitContext pbc; if (track->start_dts == AV_NOPTS_VALUE) { /* No packets written yet, vc1_info isn't authoritative yet. */ /* Assume inline sequence and entry headers. */ packet_seq = packet_entry = 1; av_log(NULL, AV_LOG_WARNING, "moov atom written before any packets, unable to write correct " "dvc1 atom. Set the delay_moov flag to fix this.\n"); } unescaped = av_mallocz(track->vos_len + AV_INPUT_BUFFER_PADDING_SIZE); if (!unescaped) return AVERROR(ENOMEM); start = find_next_marker(track->vos_data, end); for (next = start; next < end; start = next) { GetBitContext gb; int size; next = find_next_marker(start + 4, end); size = next - start - 4; if (size <= 0) continue; unescaped_size = vc1_unescape_buffer(start + 4, size, unescaped); init_get_bits(&gb, unescaped, 8 * unescaped_size); if (AV_RB32(start) == VC1_CODE_SEQHDR) { int profile = get_bits(&gb, 2); if (profile != PROFILE_ADVANCED) { av_free(unescaped); return AVERROR(ENOSYS); } seq_found = 1; level = get_bits(&gb, 3); /* chromaformat, frmrtq_postproc, bitrtq_postproc, postprocflag, * width, height */ skip_bits_long(&gb, 2 + 3 + 5 + 1 + 2*12); skip_bits(&gb, 1); /* broadcast */ interlace = get_bits1(&gb); skip_bits(&gb, 4); /* tfcntrflag, finterpflag, reserved, psf */ } } if (!seq_found) { av_free(unescaped); return AVERROR(ENOSYS); } init_put_bits(&pbc, buf, 7); /* VC1DecSpecStruc */ put_bits(&pbc, 4, 12); /* profile - advanced */ put_bits(&pbc, 3, level); put_bits(&pbc, 1, 0); /* reserved */ /* VC1AdvDecSpecStruc */ put_bits(&pbc, 3, level); put_bits(&pbc, 1, 0); /* cbr */ put_bits(&pbc, 6, 0); /* reserved */ put_bits(&pbc, 1, !interlace); /* no interlace */ put_bits(&pbc, 1, !packet_seq); /* no multiple seq */ put_bits(&pbc, 1, !packet_entry); /* no multiple entry */ put_bits(&pbc, 1, !slices); /* no slice code */ put_bits(&pbc, 1, 0); /* no bframe */ put_bits(&pbc, 1, 0); /* reserved */ /* framerate */ if (track->st->avg_frame_rate.num > 0 && track->st->avg_frame_rate.den > 0) put_bits32(&pbc, track->st->avg_frame_rate.num / track->st->avg_frame_rate.den); else put_bits32(&pbc, 0xffffffff); flush_put_bits(&pbc); av_free(unescaped); return 0; }
C
FFmpeg
0
CVE-2011-2858
https://www.cvedetails.com/cve/CVE-2011-2858/
CWE-119
https://github.com/chromium/chromium/commit/c13e1da62b5f5f0e6fe8c1f769a5a28415415244
c13e1da62b5f5f0e6fe8c1f769a5a28415415244
Revert "Revert 100494 - Fix bug in SimulateAttrib0.""" TEST=none BUG=95625 [email protected] Review URL: http://codereview.chromium.org/7796016 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@100507 0039d316-1c4b-4281-b951-d872f2087c98
void GLES2DecoderImpl::DoVertexAttrib1fv(GLuint index, const GLfloat* v) { VertexAttribManager::VertexAttribInfo* info = vertex_attrib_manager_.GetVertexAttribInfo(index); if (!info) { SetGLError(GL_INVALID_VALUE, "glVertexAttrib1fv: index out of range"); return; } VertexAttribManager::VertexAttribInfo::Vec4 value; value.v[0] = v[0]; value.v[1] = 0.0f; value.v[2] = 0.0f; value.v[3] = 1.0f; info->set_value(value); glVertexAttrib1fv(index, v); }
void GLES2DecoderImpl::DoVertexAttrib1fv(GLuint index, const GLfloat* v) { VertexAttribManager::VertexAttribInfo* info = vertex_attrib_manager_.GetVertexAttribInfo(index); if (!info) { SetGLError(GL_INVALID_VALUE, "glVertexAttrib1fv: index out of range"); return; } VertexAttribManager::VertexAttribInfo::Vec4 value; value.v[0] = v[0]; value.v[1] = 0.0f; value.v[2] = 0.0f; value.v[3] = 1.0f; info->set_value(value); glVertexAttrib1fv(index, v); }
C
Chrome
0
CVE-2012-2136
https://www.cvedetails.com/cve/CVE-2012-2136/
CWE-20
https://github.com/torvalds/linux/commit/cc9b17ad29ecaa20bfe426a8d4dbfb94b13ff1cc
cc9b17ad29ecaa20bfe426a8d4dbfb94b13ff1cc
net: sock: validate data_len before allocating skb in sock_alloc_send_pskb() We need to validate the number of pages consumed by data_len, otherwise frags array could be overflowed by userspace. So this patch validate data_len and return -EMSGSIZE when data_len may occupies more frags than MAX_SKB_FRAGS. Signed-off-by: Jason Wang <[email protected]> Signed-off-by: David S. Miller <[email protected]>
static int proto_seq_show(struct seq_file *seq, void *v) { if (v == &proto_list) seq_printf(seq, "%-9s %-4s %-8s %-6s %-5s %-7s %-4s %-10s %s", "protocol", "size", "sockets", "memory", "press", "maxhdr", "slab", "module", "cl co di ac io in de sh ss gs se re sp bi br ha uh gp em\n"); else proto_seq_printf(seq, list_entry(v, struct proto, node)); return 0; }
static int proto_seq_show(struct seq_file *seq, void *v) { if (v == &proto_list) seq_printf(seq, "%-9s %-4s %-8s %-6s %-5s %-7s %-4s %-10s %s", "protocol", "size", "sockets", "memory", "press", "maxhdr", "slab", "module", "cl co di ac io in de sh ss gs se re sp bi br ha uh gp em\n"); else proto_seq_printf(seq, list_entry(v, struct proto, node)); return 0; }
C
linux
0
CVE-2017-15951
https://www.cvedetails.com/cve/CVE-2017-15951/
CWE-20
https://github.com/torvalds/linux/commit/363b02dab09b3226f3bd1420dad9c72b79a42a76
363b02dab09b3226f3bd1420dad9c72b79a42a76
KEYS: Fix race between updating and finding a negative key Consolidate KEY_FLAG_INSTANTIATED, KEY_FLAG_NEGATIVE and the rejection error into one field such that: (1) The instantiation state can be modified/read atomically. (2) The error can be accessed atomically with the state. (3) The error isn't stored unioned with the payload pointers. This deals with the problem that the state is spread over three different objects (two bits and a separate variable) and reading or updating them atomically isn't practical, given that not only can uninstantiated keys change into instantiated or rejected keys, but rejected keys can also turn into instantiated keys - and someone accessing the key might not be using any locking. The main side effect of this problem is that what was held in the payload may change, depending on the state. For instance, you might observe the key to be in the rejected state. You then read the cached error, but if the key semaphore wasn't locked, the key might've become instantiated between the two reads - and you might now have something in hand that isn't actually an error code. The state is now KEY_IS_UNINSTANTIATED, KEY_IS_POSITIVE or a negative error code if the key is negatively instantiated. The key_is_instantiated() function is replaced with key_is_positive() to avoid confusion as negative keys are also 'instantiated'. Additionally, barriering is included: (1) Order payload-set before state-set during instantiation. (2) Order state-read before payload-read when using the key. Further separate barriering is necessary if RCU is being used to access the payload content after reading the payload pointers. Fixes: 146aa8b1453b ("KEYS: Merge the type-specific data with the payload data") Cc: [email protected] # v4.4+ Reported-by: Eric Biggers <[email protected]> Signed-off-by: David Howells <[email protected]> Reviewed-by: Eric Biggers <[email protected]>
int key_update(key_ref_t key_ref, const void *payload, size_t plen) { struct key_preparsed_payload prep; struct key *key = key_ref_to_ptr(key_ref); int ret; key_check(key); /* the key must be writable */ ret = key_permission(key_ref, KEY_NEED_WRITE); if (ret < 0) return ret; /* attempt to update it if supported */ if (!key->type->update) return -EOPNOTSUPP; memset(&prep, 0, sizeof(prep)); prep.data = payload; prep.datalen = plen; prep.quotalen = key->type->def_datalen; prep.expiry = TIME_T_MAX; if (key->type->preparse) { ret = key->type->preparse(&prep); if (ret < 0) goto error; } down_write(&key->sem); ret = key->type->update(key, &prep); if (ret == 0) /* Updating a negative key positively instantiates it */ mark_key_instantiated(key, 0); up_write(&key->sem); error: if (key->type->preparse) key->type->free_preparse(&prep); return ret; }
int key_update(key_ref_t key_ref, const void *payload, size_t plen) { struct key_preparsed_payload prep; struct key *key = key_ref_to_ptr(key_ref); int ret; key_check(key); /* the key must be writable */ ret = key_permission(key_ref, KEY_NEED_WRITE); if (ret < 0) return ret; /* attempt to update it if supported */ if (!key->type->update) return -EOPNOTSUPP; memset(&prep, 0, sizeof(prep)); prep.data = payload; prep.datalen = plen; prep.quotalen = key->type->def_datalen; prep.expiry = TIME_T_MAX; if (key->type->preparse) { ret = key->type->preparse(&prep); if (ret < 0) goto error; } down_write(&key->sem); ret = key->type->update(key, &prep); if (ret == 0) /* updating a negative key instantiates it */ clear_bit(KEY_FLAG_NEGATIVE, &key->flags); up_write(&key->sem); error: if (key->type->preparse) key->type->free_preparse(&prep); return ret; }
C
linux
1
CVE-2013-2015
https://www.cvedetails.com/cve/CVE-2013-2015/
CWE-399
https://github.com/torvalds/linux/commit/0e9a9a1ad619e7e987815d20262d36a2f95717ca
0e9a9a1ad619e7e987815d20262d36a2f95717ca
ext4: avoid hang when mounting non-journal filesystems with orphan list When trying to mount a file system which does not contain a journal, but which does have a orphan list containing an inode which needs to be truncated, the mount call with hang forever in ext4_orphan_cleanup() because ext4_orphan_del() will return immediately without removing the inode from the orphan list, leading to an uninterruptible loop in kernel code which will busy out one of the CPU's on the system. This can be trivially reproduced by trying to mount the file system found in tests/f_orphan_extents_inode/image.gz from the e2fsprogs source tree. If a malicious user were to put this on a USB stick, and mount it on a Linux desktop which has automatic mounts enabled, this could be considered a potential denial of service attack. (Not a big deal in practice, but professional paranoids worry about such things, and have even been known to allocate CVE numbers for such problems.) Signed-off-by: "Theodore Ts'o" <[email protected]> Reviewed-by: Zheng Liu <[email protected]> Cc: [email protected]
static struct buffer_head *ext4_append(handle_t *handle, struct inode *inode, ext4_lblk_t *block, int *err) { struct buffer_head *bh; if (unlikely(EXT4_SB(inode->i_sb)->s_max_dir_size_kb && ((inode->i_size >> 10) >= EXT4_SB(inode->i_sb)->s_max_dir_size_kb))) { *err = -ENOSPC; return NULL; } *block = inode->i_size >> inode->i_sb->s_blocksize_bits; bh = ext4_bread(handle, inode, *block, 1, err); if (bh) { inode->i_size += inode->i_sb->s_blocksize; EXT4_I(inode)->i_disksize = inode->i_size; *err = ext4_journal_get_write_access(handle, bh); if (*err) { brelse(bh); bh = NULL; } } if (!bh && !(*err)) { *err = -EIO; ext4_error(inode->i_sb, "Directory hole detected on inode %lu\n", inode->i_ino); } return bh; }
static struct buffer_head *ext4_append(handle_t *handle, struct inode *inode, ext4_lblk_t *block, int *err) { struct buffer_head *bh; if (unlikely(EXT4_SB(inode->i_sb)->s_max_dir_size_kb && ((inode->i_size >> 10) >= EXT4_SB(inode->i_sb)->s_max_dir_size_kb))) { *err = -ENOSPC; return NULL; } *block = inode->i_size >> inode->i_sb->s_blocksize_bits; bh = ext4_bread(handle, inode, *block, 1, err); if (bh) { inode->i_size += inode->i_sb->s_blocksize; EXT4_I(inode)->i_disksize = inode->i_size; *err = ext4_journal_get_write_access(handle, bh); if (*err) { brelse(bh); bh = NULL; } } if (!bh && !(*err)) { *err = -EIO; ext4_error(inode->i_sb, "Directory hole detected on inode %lu\n", inode->i_ino); } return bh; }
C
linux
0
CVE-2017-5014
https://www.cvedetails.com/cve/CVE-2017-5014/
CWE-119
https://github.com/chromium/chromium/commit/35eb28748d45b87695a69eceffaff73a0be476af
35eb28748d45b87695a69eceffaff73a0be476af
Remove unused histograms from the background loader offliner. Bug: 975512 Change-Id: I87b0a91bed60e3a9e8a1fd9ae9b18cac27a0859f Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1683361 Reviewed-by: Cathy Li <[email protected]> Reviewed-by: Steven Holte <[email protected]> Commit-Queue: Peter Williamson <[email protected]> Cr-Commit-Position: refs/heads/master@{#675332}
base::Callback<void(bool)> const can_download_callback() { return base::Bind(&BackgroundLoaderOfflinerTest::OnCanDownload, base::Unretained(this)); }
base::Callback<void(bool)> const can_download_callback() { return base::Bind(&BackgroundLoaderOfflinerTest::OnCanDownload, base::Unretained(this)); }
C
Chrome
0
CVE-2019-5790
https://www.cvedetails.com/cve/CVE-2019-5790/
CWE-190
https://github.com/chromium/chromium/commit/88fcb3a6899d77b64195423333ad81a00803f997
88fcb3a6899d77b64195423333ad81a00803f997
Move user activation check to RemoteFrame::Navigate's callers. Currently RemoteFrame::Navigate is the user of Frame::HasTransientUserActivation that passes a RemoteFrame*, and it seems wrong because the user activation (user gesture) needed by the navigation should belong to the LocalFrame that initiated the navigation. Follow-up CLs after this one will update UserActivation code in Frame to take a LocalFrame* instead of a Frame*, and get rid of redundant IPCs. Bug: 811414 Change-Id: I771c1694043edb54374a44213d16715d9c7da704 Reviewed-on: https://chromium-review.googlesource.com/914736 Commit-Queue: Mustaq Ahmed <[email protected]> Reviewed-by: Daniel Cheng <[email protected]> Cr-Commit-Position: refs/heads/master@{#536728}
bool HTMLFormElement::reportValidity() { return ValidateInteractively(); }
bool HTMLFormElement::reportValidity() { return ValidateInteractively(); }
C
Chrome
0
CVE-2016-9137
https://www.cvedetails.com/cve/CVE-2016-9137/
CWE-416
https://git.php.net/?p=php-src.git;a=commit;h=0e6fe3a4c96be2d3e88389a5776f878021b4c59f
0e6fe3a4c96be2d3e88389a5776f878021b4c59f
null
ZEND_API int zend_declare_property_bool(zend_class_entry *ce, const char *name, int name_length, long value, int access_type TSRMLS_DC) /* {{{ */ { zval *property; if (ce->type & ZEND_INTERNAL_CLASS) { ALLOC_PERMANENT_ZVAL(property); } else { ALLOC_ZVAL(property); } INIT_PZVAL(property); ZVAL_BOOL(property, value); return zend_declare_property(ce, name, name_length, property, access_type TSRMLS_CC); } /* }}} */
ZEND_API int zend_declare_property_bool(zend_class_entry *ce, const char *name, int name_length, long value, int access_type TSRMLS_DC) /* {{{ */ { zval *property; if (ce->type & ZEND_INTERNAL_CLASS) { ALLOC_PERMANENT_ZVAL(property); } else { ALLOC_ZVAL(property); } INIT_PZVAL(property); ZVAL_BOOL(property, value); return zend_declare_property(ce, name, name_length, property, access_type TSRMLS_CC); } /* }}} */
C
php
0