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-2011-4131
https://www.cvedetails.com/cve/CVE-2011-4131/
CWE-189
https://github.com/torvalds/linux/commit/bf118a342f10dafe44b14451a1392c3254629a1f
bf118a342f10dafe44b14451a1392c3254629a1f
NFSv4: include bitmap in nfsv4 get acl data The NFSv4 bitmap size is unbounded: a server can return an arbitrary sized bitmap in an FATTR4_WORD0_ACL request. Replace using the nfs4_fattr_bitmap_maxsz as a guess to the maximum bitmask returned by a server with the inclusion of the bitmap (xdr length plus bitmasks) and the acl data xdr length to the (cached) acl page data. This is a general solution to commit e5012d1f "NFSv4.1: update nfs4_fattr_bitmap_maxsz" and fixes hitting a BUG_ON in xdr_shrink_bufhead when getting ACLs. Fix a bug in decode_getacl that returned -EINVAL on ACLs > page when getxattr was called with a NULL buffer, preventing ACL > PAGE_SIZE from being retrieved. Cc: stable@kernel.org Signed-off-by: Andy Adamson <andros@netapp.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
static int decode_attr_space_used(struct xdr_stream *xdr, uint32_t *bitmap, uint64_t *used) { __be32 *p; int ret = 0; *used = 0; if (unlikely(bitmap[1] & (FATTR4_WORD1_SPACE_USED - 1U))) return -EIO; if (likely(bitmap[1] & FATTR4_WORD1_SPACE_USED)) { p = xdr_inline_decode(xdr, 8); if (unlikely(!p)) goto out_overflow; xdr_decode_hyper(p, used); bitmap[1] &= ~FATTR4_WORD1_SPACE_USED; ret = NFS_ATTR_FATTR_SPACE_USED; } dprintk("%s: space used=%Lu\n", __func__, (unsigned long long)*used); return ret; out_overflow: print_overflow_msg(__func__, xdr); return -EIO; }
static int decode_attr_space_used(struct xdr_stream *xdr, uint32_t *bitmap, uint64_t *used) { __be32 *p; int ret = 0; *used = 0; if (unlikely(bitmap[1] & (FATTR4_WORD1_SPACE_USED - 1U))) return -EIO; if (likely(bitmap[1] & FATTR4_WORD1_SPACE_USED)) { p = xdr_inline_decode(xdr, 8); if (unlikely(!p)) goto out_overflow; xdr_decode_hyper(p, used); bitmap[1] &= ~FATTR4_WORD1_SPACE_USED; ret = NFS_ATTR_FATTR_SPACE_USED; } dprintk("%s: space used=%Lu\n", __func__, (unsigned long long)*used); return ret; out_overflow: print_overflow_msg(__func__, xdr); return -EIO; }
C
linux
0
CVE-2016-7532
https://www.cvedetails.com/cve/CVE-2016-7532/
CWE-125
https://github.com/ImageMagick/ImageMagick/commit/4f2c04ea6673863b87ac7f186cbb0d911f74085c
4f2c04ea6673863b87ac7f186cbb0d911f74085c
Added check for out of bounds read (https://github.com/ImageMagick/ImageMagick/issues/108).
static MagickBooleanType ReadPSDMergedImage(const ImageInfo *image_info, Image *image,const PSDInfo *psd_info,ExceptionInfo *exception) { MagickOffsetType *offsets; MagickBooleanType status; PSDCompressionType compression; register ssize_t i; compression=(PSDCompressionType) ReadBlobMSBShort(image); image->compression=ConvertPSDCompression(compression); if (compression != Raw && compression != RLE) { (void) ThrowMagickException(exception,GetMagickModule(), TypeWarning,"CompressionNotSupported","'%.20g'",(double) compression); return(MagickFalse); } offsets=(MagickOffsetType *) NULL; if (compression == RLE) { offsets=ReadPSDRLEOffsets(image,psd_info,image->rows*psd_info->channels); if (offsets == (MagickOffsetType *) NULL) ThrowBinaryException(ResourceLimitError,"MemoryAllocationFailed", image->filename); } status=MagickTrue; for (i=0; i < (ssize_t) psd_info->channels; i++) { if (compression == RLE) status=ReadPSDChannelRLE(image,psd_info,i,offsets+(i*image->rows), exception); else status=ReadPSDChannelRaw(image,psd_info->channels,i,exception); if (status != MagickFalse) status=SetImageProgress(image,LoadImagesTag,i,psd_info->channels); if (status == MagickFalse) break; } if ((status != MagickFalse) && (image->colorspace == CMYKColorspace)) status=NegateCMYK(image,exception); if (status != MagickFalse) status=CorrectPSDAlphaBlend(image_info,image,exception); if (offsets != (MagickOffsetType *) NULL) offsets=(MagickOffsetType *) RelinquishMagickMemory(offsets); return(status); }
static MagickBooleanType ReadPSDMergedImage(const ImageInfo *image_info, Image *image,const PSDInfo *psd_info,ExceptionInfo *exception) { MagickOffsetType *offsets; MagickBooleanType status; PSDCompressionType compression; register ssize_t i; compression=(PSDCompressionType) ReadBlobMSBShort(image); image->compression=ConvertPSDCompression(compression); if (compression != Raw && compression != RLE) { (void) ThrowMagickException(exception,GetMagickModule(), TypeWarning,"CompressionNotSupported","'%.20g'",(double) compression); return(MagickFalse); } offsets=(MagickOffsetType *) NULL; if (compression == RLE) { offsets=ReadPSDRLEOffsets(image,psd_info,image->rows*psd_info->channels); if (offsets == (MagickOffsetType *) NULL) ThrowBinaryException(ResourceLimitError,"MemoryAllocationFailed", image->filename); } status=MagickTrue; for (i=0; i < (ssize_t) psd_info->channels; i++) { if (compression == RLE) status=ReadPSDChannelRLE(image,psd_info,i,offsets+(i*image->rows), exception); else status=ReadPSDChannelRaw(image,psd_info->channels,i,exception); if (status != MagickFalse) status=SetImageProgress(image,LoadImagesTag,i,psd_info->channels); if (status == MagickFalse) break; } if ((status != MagickFalse) && (image->colorspace == CMYKColorspace)) status=NegateCMYK(image,exception); if (status != MagickFalse) status=CorrectPSDAlphaBlend(image_info,image,exception); if (offsets != (MagickOffsetType *) NULL) offsets=(MagickOffsetType *) RelinquishMagickMemory(offsets); return(status); }
C
ImageMagick
0
CVE-2018-13006
https://www.cvedetails.com/cve/CVE-2018-13006/
CWE-125
https://github.com/gpac/gpac/commit/bceb03fd2be95097a7b409ea59914f332fb6bc86
bceb03fd2be95097a7b409ea59914f332fb6bc86
fixed 2 possible heap overflows (inc. #1088)
GF_Err adkm_dump(GF_Box *a, FILE * trace) { GF_AdobeDRMKeyManagementSystemBox *ptr = (GF_AdobeDRMKeyManagementSystemBox *)a; if (!a) return GF_BAD_PARAM; gf_isom_box_dump_start(a, "AdobeDRMKeyManagementSystemBox", trace); fprintf(trace, ">\n"); if (ptr->header) gf_isom_box_dump((GF_Box *)ptr->header, trace); if (ptr->au_format) gf_isom_box_dump((GF_Box *)ptr->au_format, trace); gf_isom_box_dump_done("AdobeDRMKeyManagementSystemBox", a, trace); return GF_OK; }
GF_Err adkm_dump(GF_Box *a, FILE * trace) { GF_AdobeDRMKeyManagementSystemBox *ptr = (GF_AdobeDRMKeyManagementSystemBox *)a; if (!a) return GF_BAD_PARAM; gf_isom_box_dump_start(a, "AdobeDRMKeyManagementSystemBox", trace); fprintf(trace, ">\n"); if (ptr->header) gf_isom_box_dump((GF_Box *)ptr->header, trace); if (ptr->au_format) gf_isom_box_dump((GF_Box *)ptr->au_format, trace); gf_isom_box_dump_done("AdobeDRMKeyManagementSystemBox", a, trace); return GF_OK; }
C
gpac
0
CVE-2012-2896
https://www.cvedetails.com/cve/CVE-2012-2896/
CWE-189
https://github.com/chromium/chromium/commit/3aad1a37affb1ab70d1897f2b03eb8c077264984
3aad1a37affb1ab70d1897f2b03eb8c077264984
Fix SafeAdd and SafeMultiply BUG=145648,145544 Review URL: https://chromiumcodereview.appspot.com/10916165 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@155478 0039d316-1c4b-4281-b951-d872f2087c98
void GLES2DecoderImpl::DoGetShaderiv( GLuint shader, GLenum pname, GLint* params) { ShaderManager::ShaderInfo* info = GetShaderInfoNotProgram( shader, "glGetShaderiv"); if (!info) { return; } switch (pname) { case GL_SHADER_SOURCE_LENGTH: *params = info->source() ? info->source()->size() + 1 : 0; return; case GL_COMPILE_STATUS: *params = compile_shader_always_succeeds_ ? true : info->IsValid(); return; case GL_INFO_LOG_LENGTH: *params = info->log_info() ? info->log_info()->size() + 1 : 0; return; case GL_TRANSLATED_SHADER_SOURCE_LENGTH_ANGLE: ForceCompileShaderIfPending(info); *params = info->translated_source() ? info->translated_source()->size() + 1 : 0; return; default: break; } glGetShaderiv(info->service_id(), pname, params); }
void GLES2DecoderImpl::DoGetShaderiv( GLuint shader, GLenum pname, GLint* params) { ShaderManager::ShaderInfo* info = GetShaderInfoNotProgram( shader, "glGetShaderiv"); if (!info) { return; } switch (pname) { case GL_SHADER_SOURCE_LENGTH: *params = info->source() ? info->source()->size() + 1 : 0; return; case GL_COMPILE_STATUS: *params = compile_shader_always_succeeds_ ? true : info->IsValid(); return; case GL_INFO_LOG_LENGTH: *params = info->log_info() ? info->log_info()->size() + 1 : 0; return; case GL_TRANSLATED_SHADER_SOURCE_LENGTH_ANGLE: ForceCompileShaderIfPending(info); *params = info->translated_source() ? info->translated_source()->size() + 1 : 0; return; default: break; } glGetShaderiv(info->service_id(), pname, params); }
C
Chrome
0
CVE-2014-3191
https://www.cvedetails.com/cve/CVE-2014-3191/
CWE-416
https://github.com/chromium/chromium/commit/11a4cc4a6d6e665d9a118fada4b7c658d6f70d95
11a4cc4a6d6e665d9a118fada4b7c658d6f70d95
Defer call to updateWidgetPositions() outside of RenderLayerScrollableArea. updateWidgetPositions() can destroy the render tree, so it should never be called from inside RenderLayerScrollableArea. Leaving it there allows for the potential of use-after-free bugs. BUG=402407 R=vollick@chromium.org Review URL: https://codereview.chromium.org/490473003 git-svn-id: svn://svn.chromium.org/blink/trunk@180681 bbb929c8-8fbe-4397-9dbb-9b2b20218538
void FrameView::setContentsSize(const IntSize& size) { if (size == contentsSize()) return; ScrollView::setContentsSize(size); ScrollView::contentsResized(); Page* page = frame().page(); if (!page) return; updateScrollableAreaSet(); page->chrome().contentsSizeChanged(m_frame.get(), size); }
void FrameView::setContentsSize(const IntSize& size) { if (size == contentsSize()) return; ScrollView::setContentsSize(size); ScrollView::contentsResized(); Page* page = frame().page(); if (!page) return; updateScrollableAreaSet(); page->chrome().contentsSizeChanged(m_frame.get(), size); }
C
Chrome
0
CVE-2014-1713
https://www.cvedetails.com/cve/CVE-2014-1713/
CWE-399
https://github.com/chromium/chromium/commit/f85a87ec670ad0fce9d98d90c9a705b72a288154
f85a87ec670ad0fce9d98d90c9a705b72a288154
document.location bindings fix BUG=352374 R=jochen@chromium.org Review URL: https://codereview.chromium.org/196343011 git-svn-id: svn://svn.chromium.org/blink/trunk@169176 bbb929c8-8fbe-4397-9dbb-9b2b20218538
static void voidMethodElementArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) { if (UNLIKELY(info.Length() < 1)) { throwTypeError(ExceptionMessages::failedToExecute("voidMethodElementArg", "TestObjectPython", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate()); return; } TestObjectPython* imp = V8TestObjectPython::toNative(info.Holder()); V8TRYCATCH_VOID(Element*, elementArg, V8Element::toNativeWithTypeCheck(info.GetIsolate(), info[0])); imp->voidMethodElementArg(elementArg); }
static void voidMethodElementArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) { if (UNLIKELY(info.Length() < 1)) { throwTypeError(ExceptionMessages::failedToExecute("voidMethodElementArg", "TestObjectPython", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate()); return; } TestObjectPython* imp = V8TestObjectPython::toNative(info.Holder()); V8TRYCATCH_VOID(Element*, elementArg, V8Element::toNativeWithTypeCheck(info.GetIsolate(), info[0])); imp->voidMethodElementArg(elementArg); }
C
Chrome
0
CVE-2013-7010
https://www.cvedetails.com/cve/CVE-2013-7010/
CWE-189
https://github.com/FFmpeg/FFmpeg/commit/454a11a1c9c686c78aa97954306fb63453299760
454a11a1c9c686c78aa97954306fb63453299760
avcodec/dsputil: fix signedness in sizeof() comparissions Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
static int nsse8_c(void *v, uint8_t *s1, uint8_t *s2, int stride, int h){ MpegEncContext *c = v; int score1=0; int score2=0; int x,y; for(y=0; y<h; y++){ for(x=0; x<8; x++){ score1+= (s1[x ] - s2[x ])*(s1[x ] - s2[x ]); } if(y+1<h){ for(x=0; x<7; x++){ score2+= FFABS( s1[x ] - s1[x +stride] - s1[x+1] + s1[x+1+stride]) -FFABS( s2[x ] - s2[x +stride] - s2[x+1] + s2[x+1+stride]); } } s1+= stride; s2+= stride; } if(c) return score1 + FFABS(score2)*c->avctx->nsse_weight; else return score1 + FFABS(score2)*8; }
static int nsse8_c(void *v, uint8_t *s1, uint8_t *s2, int stride, int h){ MpegEncContext *c = v; int score1=0; int score2=0; int x,y; for(y=0; y<h; y++){ for(x=0; x<8; x++){ score1+= (s1[x ] - s2[x ])*(s1[x ] - s2[x ]); } if(y+1<h){ for(x=0; x<7; x++){ score2+= FFABS( s1[x ] - s1[x +stride] - s1[x+1] + s1[x+1+stride]) -FFABS( s2[x ] - s2[x +stride] - s2[x+1] + s2[x+1+stride]); } } s1+= stride; s2+= stride; } if(c) return score1 + FFABS(score2)*c->avctx->nsse_weight; else return score1 + FFABS(score2)*8; }
C
FFmpeg
0
CVE-2015-8374
https://www.cvedetails.com/cve/CVE-2015-8374/
CWE-200
https://github.com/torvalds/linux/commit/0305cd5f7fca85dae392b9ba85b116896eb7c1c7
0305cd5f7fca85dae392b9ba85b116896eb7c1c7
Btrfs: fix truncation of compressed and inlined extents When truncating a file to a smaller size which consists of an inline extent that is compressed, we did not discard (or made unusable) the data between the new file size and the old file size, wasting metadata space and allowing for the truncated data to be leaked and the data corruption/loss mentioned below. We were also not correctly decrementing the number of bytes used by the inode, we were setting it to zero, giving a wrong report for callers of the stat(2) syscall. The fsck tool also reported an error about a mismatch between the nbytes of the file versus the real space used by the file. Now because we weren't discarding the truncated region of the file, it was possible for a caller of the clone ioctl to actually read the data that was truncated, allowing for a security breach without requiring root access to the system, using only standard filesystem operations. The scenario is the following: 1) User A creates a file which consists of an inline and compressed extent with a size of 2000 bytes - the file is not accessible to any other users (no read, write or execution permission for anyone else); 2) The user truncates the file to a size of 1000 bytes; 3) User A makes the file world readable; 4) User B creates a file consisting of an inline extent of 2000 bytes; 5) User B issues a clone operation from user A's file into its own file (using a length argument of 0, clone the whole range); 6) User B now gets to see the 1000 bytes that user A truncated from its file before it made its file world readbale. User B also lost the bytes in the range [1000, 2000[ bytes from its own file, but that might be ok if his/her intention was reading stale data from user A that was never supposed to be public. Note that this contrasts with the case where we truncate a file from 2000 bytes to 1000 bytes and then truncate it back from 1000 to 2000 bytes. In this case reading any byte from the range [1000, 2000[ will return a value of 0x00, instead of the original data. This problem exists since the clone ioctl was added and happens both with and without my recent data loss and file corruption fixes for the clone ioctl (patch "Btrfs: fix file corruption and data loss after cloning inline extents"). So fix this by truncating the compressed inline extents as we do for the non-compressed case, which involves decompressing, if the data isn't already in the page cache, compressing the truncated version of the extent, writing the compressed content into the inline extent and then truncate it. The following test case for fstests reproduces the problem. In order for the test to pass both this fix and my previous fix for the clone ioctl that forbids cloning a smaller inline extent into a larger one, which is titled "Btrfs: fix file corruption and data loss after cloning inline extents", are needed. Without that other fix the test fails in a different way that does not leak the truncated data, instead part of destination file gets replaced with zeroes (because the destination file has a larger inline extent than the source). seq=`basename $0` seqres=$RESULT_DIR/$seq echo "QA output created by $seq" tmp=/tmp/$$ status=1 # failure is the default! trap "_cleanup; exit \$status" 0 1 2 3 15 _cleanup() { rm -f $tmp.* } # get standard environment, filters and checks . ./common/rc . ./common/filter # real QA test starts here _need_to_be_root _supported_fs btrfs _supported_os Linux _require_scratch _require_cloner rm -f $seqres.full _scratch_mkfs >>$seqres.full 2>&1 _scratch_mount "-o compress" # Create our test files. File foo is going to be the source of a clone operation # and consists of a single inline extent with an uncompressed size of 512 bytes, # while file bar consists of a single inline extent with an uncompressed size of # 256 bytes. For our test's purpose, it's important that file bar has an inline # extent with a size smaller than foo's inline extent. $XFS_IO_PROG -f -c "pwrite -S 0xa1 0 128" \ -c "pwrite -S 0x2a 128 384" \ $SCRATCH_MNT/foo | _filter_xfs_io $XFS_IO_PROG -f -c "pwrite -S 0xbb 0 256" $SCRATCH_MNT/bar | _filter_xfs_io # Now durably persist all metadata and data. We do this to make sure that we get # on disk an inline extent with a size of 512 bytes for file foo. sync # Now truncate our file foo to a smaller size. Because it consists of a # compressed and inline extent, btrfs did not shrink the inline extent to the # new size (if the extent was not compressed, btrfs would shrink it to 128 # bytes), it only updates the inode's i_size to 128 bytes. $XFS_IO_PROG -c "truncate 128" $SCRATCH_MNT/foo # Now clone foo's inline extent into bar. # This clone operation should fail with errno EOPNOTSUPP because the source # file consists only of an inline extent and the file's size is smaller than # the inline extent of the destination (128 bytes < 256 bytes). However the # clone ioctl was not prepared to deal with a file that has a size smaller # than the size of its inline extent (something that happens only for compressed # inline extents), resulting in copying the full inline extent from the source # file into the destination file. # # Note that btrfs' clone operation for inline extents consists of removing the # inline extent from the destination inode and copy the inline extent from the # source inode into the destination inode, meaning that if the destination # inode's inline extent is larger (N bytes) than the source inode's inline # extent (M bytes), some bytes (N - M bytes) will be lost from the destination # file. Btrfs could copy the source inline extent's data into the destination's # inline extent so that we would not lose any data, but that's currently not # done due to the complexity that would be needed to deal with such cases # (specially when one or both extents are compressed), returning EOPNOTSUPP, as # it's normally not a very common case to clone very small files (only case # where we get inline extents) and copying inline extents does not save any # space (unlike for normal, non-inlined extents). $CLONER_PROG -s 0 -d 0 -l 0 $SCRATCH_MNT/foo $SCRATCH_MNT/bar # Now because the above clone operation used to succeed, and due to foo's inline # extent not being shinked by the truncate operation, our file bar got the whole # inline extent copied from foo, making us lose the last 128 bytes from bar # which got replaced by the bytes in range [128, 256[ from foo before foo was # truncated - in other words, data loss from bar and being able to read old and # stale data from foo that should not be possible to read anymore through normal # filesystem operations. Contrast with the case where we truncate a file from a # size N to a smaller size M, truncate it back to size N and then read the range # [M, N[, we should always get the value 0x00 for all the bytes in that range. # We expected the clone operation to fail with errno EOPNOTSUPP and therefore # not modify our file's bar data/metadata. So its content should be 256 bytes # long with all bytes having the value 0xbb. # # Without the btrfs bug fix, the clone operation succeeded and resulted in # leaking truncated data from foo, the bytes that belonged to its range # [128, 256[, and losing data from bar in that same range. So reading the # file gave us the following content: # # 0000000 a1 a1 a1 a1 a1 a1 a1 a1 a1 a1 a1 a1 a1 a1 a1 a1 # * # 0000200 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a # * # 0000400 echo "File bar's content after the clone operation:" od -t x1 $SCRATCH_MNT/bar # Also because the foo's inline extent was not shrunk by the truncate # operation, btrfs' fsck, which is run by the fstests framework everytime a # test completes, failed reporting the following error: # # root 5 inode 257 errors 400, nbytes wrong status=0 exit Cc: stable@vger.kernel.org Signed-off-by: Filipe Manana <fdmanana@suse.com>
static int btrfs_submit_bio_hook(struct inode *inode, int rw, struct bio *bio, int mirror_num, unsigned long bio_flags, u64 bio_offset) { struct btrfs_root *root = BTRFS_I(inode)->root; int ret = 0; int skip_sum; int metadata = 0; int async = !atomic_read(&BTRFS_I(inode)->sync_writers); skip_sum = BTRFS_I(inode)->flags & BTRFS_INODE_NODATASUM; if (btrfs_is_free_space_inode(inode)) metadata = 2; if (!(rw & REQ_WRITE)) { ret = btrfs_bio_wq_end_io(root->fs_info, bio, metadata); if (ret) goto out; if (bio_flags & EXTENT_BIO_COMPRESSED) { ret = btrfs_submit_compressed_read(inode, bio, mirror_num, bio_flags); goto out; } else if (!skip_sum) { ret = btrfs_lookup_bio_sums(root, inode, bio, NULL); if (ret) goto out; } goto mapit; } else if (async && !skip_sum) { /* csum items have already been cloned */ if (root->root_key.objectid == BTRFS_DATA_RELOC_TREE_OBJECTID) goto mapit; /* we're doing a write, do the async checksumming */ ret = btrfs_wq_submit_bio(BTRFS_I(inode)->root->fs_info, inode, rw, bio, mirror_num, bio_flags, bio_offset, __btrfs_submit_bio_start, __btrfs_submit_bio_done); goto out; } else if (!skip_sum) { ret = btrfs_csum_one_bio(root, inode, bio, 0, 0); if (ret) goto out; } mapit: ret = btrfs_map_bio(root, rw, bio, mirror_num, 0); out: if (ret < 0) { bio->bi_error = ret; bio_endio(bio); } return ret; }
static int btrfs_submit_bio_hook(struct inode *inode, int rw, struct bio *bio, int mirror_num, unsigned long bio_flags, u64 bio_offset) { struct btrfs_root *root = BTRFS_I(inode)->root; int ret = 0; int skip_sum; int metadata = 0; int async = !atomic_read(&BTRFS_I(inode)->sync_writers); skip_sum = BTRFS_I(inode)->flags & BTRFS_INODE_NODATASUM; if (btrfs_is_free_space_inode(inode)) metadata = 2; if (!(rw & REQ_WRITE)) { ret = btrfs_bio_wq_end_io(root->fs_info, bio, metadata); if (ret) goto out; if (bio_flags & EXTENT_BIO_COMPRESSED) { ret = btrfs_submit_compressed_read(inode, bio, mirror_num, bio_flags); goto out; } else if (!skip_sum) { ret = btrfs_lookup_bio_sums(root, inode, bio, NULL); if (ret) goto out; } goto mapit; } else if (async && !skip_sum) { /* csum items have already been cloned */ if (root->root_key.objectid == BTRFS_DATA_RELOC_TREE_OBJECTID) goto mapit; /* we're doing a write, do the async checksumming */ ret = btrfs_wq_submit_bio(BTRFS_I(inode)->root->fs_info, inode, rw, bio, mirror_num, bio_flags, bio_offset, __btrfs_submit_bio_start, __btrfs_submit_bio_done); goto out; } else if (!skip_sum) { ret = btrfs_csum_one_bio(root, inode, bio, 0, 0); if (ret) goto out; } mapit: ret = btrfs_map_bio(root, rw, bio, mirror_num, 0); out: if (ret < 0) { bio->bi_error = ret; bio_endio(bio); } return ret; }
C
linux
0
CVE-2012-6540
https://www.cvedetails.com/cve/CVE-2012-6540/
CWE-200
https://github.com/torvalds/linux/commit/2d8a041b7bfe1097af21441cb77d6af95f4f4680
2d8a041b7bfe1097af21441cb77d6af95f4f4680
ipvs: fix info leak in getsockopt(IP_VS_SO_GET_TIMEOUT) If at least one of CONFIG_IP_VS_PROTO_TCP or CONFIG_IP_VS_PROTO_UDP is not set, __ip_vs_get_timeouts() does not fully initialize the structure that gets copied to userland and that for leaks up to 12 bytes of kernel stack. Add an explicit memset(0) before passing the structure to __ip_vs_get_timeouts() to avoid the info leak. Signed-off-by: Mathias Krause <minipli@googlemail.com> Cc: Wensong Zhang <wensong@linux-vs.org> Cc: Simon Horman <horms@verge.net.au> Cc: Julian Anastasov <ja@ssi.bg> Signed-off-by: David S. Miller <davem@davemloft.net>
int __net_init ip_vs_control_net_init_sysctl(struct net *net) { return 0; }
int __net_init ip_vs_control_net_init_sysctl(struct net *net) { return 0; }
C
linux
0
CVE-2018-12714
https://www.cvedetails.com/cve/CVE-2018-12714/
CWE-787
https://github.com/torvalds/linux/commit/81f9c4e4177d31ced6f52a89bb70e93bfb77ca03
81f9c4e4177d31ced6f52a89bb70e93bfb77ca03
Merge tag 'trace-v4.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace Pull tracing fixes from Steven Rostedt: "This contains a few fixes and a clean up. - a bad merge caused an "endif" to go in the wrong place in scripts/Makefile.build - softirq tracing fix for tracing that corrupts lockdep and causes a false splat - histogram documentation typo fixes - fix a bad memory reference when passing in no filter to the filter code - simplify code by using the swap macro instead of open coding the swap" * tag 'trace-v4.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace: tracing: Fix SKIP_STACK_VALIDATION=1 build due to bad merge with -mrecord-mcount tracing: Fix some errors in histogram documentation tracing: Use swap macro in update_max_tr softirq: Reorder trace_softirqs_on to prevent lockdep splat tracing: Check for no filter when processing event filters
int filter_assign_type(const char *type) { if (strstr(type, "__data_loc") && strstr(type, "char")) return FILTER_DYN_STRING; if (strchr(type, '[') && strstr(type, "char")) return FILTER_STATIC_STRING; return FILTER_OTHER; }
int filter_assign_type(const char *type) { if (strstr(type, "__data_loc") && strstr(type, "char")) return FILTER_DYN_STRING; if (strchr(type, '[') && strstr(type, "char")) return FILTER_STATIC_STRING; return FILTER_OTHER; }
C
linux
0
CVE-2015-3194
https://www.cvedetails.com/cve/CVE-2015-3194/
null
https://git.openssl.org/?p=openssl.git;a=commit;h=d8541d7e9e63bf5f343af24644046c8d96498c17
d8541d7e9e63bf5f343af24644046c8d96498c17
null
static int int_rsa_size(const EVP_PKEY *pkey) { return RSA_size(pkey->pkey.rsa); }
static int int_rsa_size(const EVP_PKEY *pkey) { return RSA_size(pkey->pkey.rsa); }
C
openssl
0
CVE-2016-7417
https://www.cvedetails.com/cve/CVE-2016-7417/
CWE-20
https://github.com/php/php-src/commit/ecb7f58a069be0dec4a6131b6351a761f808f22e?w=1
ecb7f58a069be0dec4a6131b6351a761f808f22e?w=1
Fix bug #73029 - Missing type check when unserializing SplArray
SPL_METHOD(Array, getFlags) { zval *object = getThis(); spl_array_object *intern = (spl_array_object*)zend_object_store_get_object(object TSRMLS_CC); if (zend_parse_parameters_none() == FAILURE) { return; } RETURN_LONG(intern->ar_flags & ~SPL_ARRAY_INT_MASK); }
SPL_METHOD(Array, getFlags) { zval *object = getThis(); spl_array_object *intern = (spl_array_object*)zend_object_store_get_object(object TSRMLS_CC); if (zend_parse_parameters_none() == FAILURE) { return; } RETURN_LONG(intern->ar_flags & ~SPL_ARRAY_INT_MASK); }
C
php-src
0
CVE-2017-9994
https://www.cvedetails.com/cve/CVE-2017-9994/
CWE-119
https://github.com/FFmpeg/FFmpeg/commit/6b5d3fb26fb4be48e4966e4b1d97c2165538d4ef
6b5d3fb26fb4be48e4966e4b1d97c2165538d4ef
avcodec/webp: Always set pix_fmt Fixes: out of array access Fixes: 1434/clusterfuzz-testcase-minimized-6314998085189632 Fixes: 1435/clusterfuzz-testcase-minimized-6483783723253760 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg Reviewed-by: "Ronald S. Bultje" <rsbultje@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
static av_always_inline void color_cache_put(ImageContext *img, uint32_t c) { uint32_t cache_idx = (0x1E35A7BD * c) >> (32 - img->color_cache_bits); img->color_cache[cache_idx] = c; }
static av_always_inline void color_cache_put(ImageContext *img, uint32_t c) { uint32_t cache_idx = (0x1E35A7BD * c) >> (32 - img->color_cache_bits); img->color_cache[cache_idx] = c; }
C
FFmpeg
0
CVE-2016-5219
https://www.cvedetails.com/cve/CVE-2016-5219/
CWE-416
https://github.com/chromium/chromium/commit/a4150b688a754d3d10d2ca385155b1c95d77d6ae
a4150b688a754d3d10d2ca385155b1c95d77d6ae
Add GL_PROGRAM_COMPLETION_QUERY_CHROMIUM This makes the query of GL_COMPLETION_STATUS_KHR to programs much cheaper by minimizing the round-trip to the GPU thread. Bug: 881152, 957001 Change-Id: Iadfa798af29225e752c710ca5c25f50b3dd3101a Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1586630 Commit-Queue: Kenneth Russell <kbr@chromium.org> Reviewed-by: Kentaro Hara <haraken@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Kenneth Russell <kbr@chromium.org> Cr-Commit-Position: refs/heads/master@{#657568}
void AppendStringToBuffer(std::vector<uint8_t>* data, const char* str, size_t len) { const base::CheckedNumeric<size_t> old_size = data->size(); data->resize((old_size + len).ValueOrDie()); memcpy(data->data() + old_size.ValueOrDie(), str, len); }
void AppendStringToBuffer(std::vector<uint8_t>* data, const char* str, size_t len) { const base::CheckedNumeric<size_t> old_size = data->size(); data->resize((old_size + len).ValueOrDie()); memcpy(data->data() + old_size.ValueOrDie(), str, len); }
C
Chrome
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 <efault@gmx.de> Reported-by: Bjoern B. Brandenburg <bbb.lst@gmail.com> Tested-by: Yong Zhang <yong.zhang0@gmail.com> Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: stable@kernel.org LKML-Reference: <1291802742.1417.9.camel@marge.simson.net> Signed-off-by: Ingo Molnar <mingo@elte.hu>
void account_steal_ticks(unsigned long ticks) { account_steal_time(jiffies_to_cputime(ticks)); }
void account_steal_ticks(unsigned long ticks) { account_steal_time(jiffies_to_cputime(ticks)); }
C
linux
0
CVE-2015-5232
https://www.cvedetails.com/cve/CVE-2015-5232/
CWE-362
https://github.com/01org/opa-fm/commit/c5759e7b76f5bf844be6c6641cc1b356bbc83869
c5759e7b76f5bf844be6c6641cc1b356bbc83869
Fix scripts and code that use well-known tmp files.
int sm_force_rebalance_toggle(p_fm_config_conx_hdlt hdl, fm_mgr_type_t mgr, int argc, char *argv[]) { fm_mgr_config_errno_t res; fm_msg_ret_code_t ret_code; if((res = fm_mgr_simple_query(hdl, FM_ACT_GET, FM_DT_SM_FORCE_REBALANCE_TOGGLE, mgr, 0, NULL, &ret_code)) != FM_CONF_OK) { fprintf(stderr, "sm_force_rebalance_toggle: Failed to retrieve data: \n" "\tError:(%d) %s \n\tRet code:(%d) %s\n", res, fm_mgr_get_error_str(res),ret_code, fm_mgr_get_resp_error_str(ret_code)); } else { printf("Successfully sent SM Force Rebalance control to local SM instance\n"); } return 0; }
int sm_force_rebalance_toggle(p_fm_config_conx_hdlt hdl, fm_mgr_type_t mgr, int argc, char *argv[]) { fm_mgr_config_errno_t res; fm_msg_ret_code_t ret_code; if((res = fm_mgr_simple_query(hdl, FM_ACT_GET, FM_DT_SM_FORCE_REBALANCE_TOGGLE, mgr, 0, NULL, &ret_code)) != FM_CONF_OK) { fprintf(stderr, "sm_force_rebalance_toggle: Failed to retrieve data: \n" "\tError:(%d) %s \n\tRet code:(%d) %s\n", res, fm_mgr_get_error_str(res),ret_code, fm_mgr_get_resp_error_str(ret_code)); } else { printf("Successfully sent SM Force Rebalance control to local SM instance\n"); } return 0; }
C
opa-ff
0
CVE-2017-7539
https://www.cvedetails.com/cve/CVE-2017-7539/
CWE-20
https://git.qemu.org/?p=qemu.git;a=commitdiff;h=ff82911cd3f69f028f2537825c9720ff78bc3f19
ff82911cd3f69f028f2537825c9720ff78bc3f19
null
int nbd_client(int fd) { int ret; int serrno; TRACE("Doing NBD loop"); ret = ioctl(fd, NBD_DO_IT); if (ret < 0 && errno == EPIPE) { /* NBD_DO_IT normally returns EPIPE when someone has disconnected * the socket via NBD_DISCONNECT. We do not want to return 1 in * that case. */ ret = 0; } serrno = errno; TRACE("NBD loop returned %d: %s", ret, strerror(serrno)); TRACE("Clearing NBD queue"); ioctl(fd, NBD_CLEAR_QUE); TRACE("Clearing NBD socket"); ioctl(fd, NBD_CLEAR_SOCK); errno = serrno; return ret; }
int nbd_client(int fd) { int ret; int serrno; TRACE("Doing NBD loop"); ret = ioctl(fd, NBD_DO_IT); if (ret < 0 && errno == EPIPE) { /* NBD_DO_IT normally returns EPIPE when someone has disconnected * the socket via NBD_DISCONNECT. We do not want to return 1 in * that case. */ ret = 0; } serrno = errno; TRACE("NBD loop returned %d: %s", ret, strerror(serrno)); TRACE("Clearing NBD queue"); ioctl(fd, NBD_CLEAR_QUE); TRACE("Clearing NBD socket"); ioctl(fd, NBD_CLEAR_SOCK); errno = serrno; return ret; }
C
qemu
0
CVE-2017-5023
https://www.cvedetails.com/cve/CVE-2017-5023/
CWE-476
https://github.com/chromium/chromium/commit/03c2e97746a2c471ae136b0c669f8d0c033fe168
03c2e97746a2c471ae136b0c669f8d0c033fe168
Convert DCHECKs to CHECKs for histogram types When a histogram is looked up by name, there is currently a DCHECK that verifies the type of the stored histogram matches the expected type. A mismatch represents a significant problem because the returned HistogramBase is cast to a Histogram in ValidateRangeChecksum, potentially causing a crash. This CL converts the DCHECK to a CHECK to prevent the possibility of type confusion in release builds. BUG=651443 R=isherman@chromium.org Review-Url: https://codereview.chromium.org/2381893003 Cr-Commit-Position: refs/heads/master@{#421929}
void Histogram::WriteAsciiBucketContext(const int64_t past, const Count current, const int64_t remaining, const uint32_t i, std::string* output) const { double scaled_sum = (past + current + remaining) / 100.0; WriteAsciiBucketValue(current, scaled_sum, output); if (0 < i) { double percentage = past / scaled_sum; StringAppendF(output, " {%3.1f%%}", percentage); } }
void Histogram::WriteAsciiBucketContext(const int64_t past, const Count current, const int64_t remaining, const uint32_t i, std::string* output) const { double scaled_sum = (past + current + remaining) / 100.0; WriteAsciiBucketValue(current, scaled_sum, output); if (0 < i) { double percentage = past / scaled_sum; StringAppendF(output, " {%3.1f%%}", percentage); } }
C
Chrome
0
CVE-2017-7865
https://www.cvedetails.com/cve/CVE-2017-7865/
CWE-787
https://github.com/FFmpeg/FFmpeg/commit/2080bc33717955a0e4268e738acf8c1eeddbf8cb
2080bc33717955a0e4268e738acf8c1eeddbf8cb
avcodec/utils: correct align value for interplay Fixes out of array access Fixes: 452/fuzz-1-ffmpeg_VIDEO_AV_CODEC_ID_INTERPLAY_VIDEO_fuzzer Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
static int unrefcount_frame(AVCodecInternal *avci, AVFrame *frame) { int ret; /* move the original frame to our backup */ av_frame_unref(avci->to_free); av_frame_move_ref(avci->to_free, frame); /* now copy everything except the AVBufferRefs back * note that we make a COPY of the side data, so calling av_frame_free() on * the caller's frame will work properly */ ret = av_frame_copy_props(frame, avci->to_free); if (ret < 0) return ret; memcpy(frame->data, avci->to_free->data, sizeof(frame->data)); memcpy(frame->linesize, avci->to_free->linesize, sizeof(frame->linesize)); if (avci->to_free->extended_data != avci->to_free->data) { int planes = av_frame_get_channels(avci->to_free); int size = planes * sizeof(*frame->extended_data); if (!size) { av_frame_unref(frame); return AVERROR_BUG; } frame->extended_data = av_malloc(size); if (!frame->extended_data) { av_frame_unref(frame); return AVERROR(ENOMEM); } memcpy(frame->extended_data, avci->to_free->extended_data, size); } else frame->extended_data = frame->data; frame->format = avci->to_free->format; frame->width = avci->to_free->width; frame->height = avci->to_free->height; frame->channel_layout = avci->to_free->channel_layout; frame->nb_samples = avci->to_free->nb_samples; av_frame_set_channels(frame, av_frame_get_channels(avci->to_free)); return 0; }
static int unrefcount_frame(AVCodecInternal *avci, AVFrame *frame) { int ret; /* move the original frame to our backup */ av_frame_unref(avci->to_free); av_frame_move_ref(avci->to_free, frame); /* now copy everything except the AVBufferRefs back * note that we make a COPY of the side data, so calling av_frame_free() on * the caller's frame will work properly */ ret = av_frame_copy_props(frame, avci->to_free); if (ret < 0) return ret; memcpy(frame->data, avci->to_free->data, sizeof(frame->data)); memcpy(frame->linesize, avci->to_free->linesize, sizeof(frame->linesize)); if (avci->to_free->extended_data != avci->to_free->data) { int planes = av_frame_get_channels(avci->to_free); int size = planes * sizeof(*frame->extended_data); if (!size) { av_frame_unref(frame); return AVERROR_BUG; } frame->extended_data = av_malloc(size); if (!frame->extended_data) { av_frame_unref(frame); return AVERROR(ENOMEM); } memcpy(frame->extended_data, avci->to_free->extended_data, size); } else frame->extended_data = frame->data; frame->format = avci->to_free->format; frame->width = avci->to_free->width; frame->height = avci->to_free->height; frame->channel_layout = avci->to_free->channel_layout; frame->nb_samples = avci->to_free->nb_samples; av_frame_set_channels(frame, av_frame_get_channels(avci->to_free)); return 0; }
C
FFmpeg
0
CVE-2016-10517
https://www.cvedetails.com/cve/CVE-2016-10517/
CWE-254
https://github.com/antirez/redis/commit/874804da0c014a7d704b3d285aa500098a931f50
874804da0c014a7d704b3d285aa500098a931f50
Security: Cross Protocol Scripting protection. This is an attempt at mitigating problems due to cross protocol scripting, an attack targeting services using line oriented protocols like Redis that can accept HTTP requests as valid protocol, by discarding the invalid parts and accepting the payloads sent, for example, via a POST request. For this to be effective, when we detect POST and Host: and terminate the connection asynchronously, the networking code was modified in order to never process further input. It was later verified that in a pipelined request containing a POST command, the successive commands are not executed.
void preventCommandPropagation(client *c) { c->flags |= CLIENT_PREVENT_PROP; }
void preventCommandPropagation(client *c) { c->flags |= CLIENT_PREVENT_PROP; }
C
redis
0
CVE-2012-5156
https://www.cvedetails.com/cve/CVE-2012-5156/
CWE-399
https://github.com/chromium/chromium/commit/b15c87071f906301bccc824ce013966ca93998c7
b15c87071f906301bccc824ce013966ca93998c7
Validate and report peer's PID to WorkerProcessIpcDelegate so it will be able to duplicate handles to and from the worker process. As a side effect WorkerProcessLauncher::Delegate is now responsible for retrieving the client's PID and deciding whether a launch failed due to a permanent error condition. BUG=134694 Review URL: https://chromiumcodereview.appspot.com/11143025 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@162778 0039d316-1c4b-4281-b951-d872f2087c98
WorkerProcessLauncherTest::WorkerProcessLauncherTest() : message_loop_(MessageLoop::TYPE_IO), client_pid_(GetCurrentProcessId()), permanent_error_(false) { }
WorkerProcessLauncherTest::WorkerProcessLauncherTest() : message_loop_(MessageLoop::TYPE_IO) { }
C
Chrome
1
CVE-2016-1683
https://www.cvedetails.com/cve/CVE-2016-1683/
CWE-119
https://github.com/chromium/chromium/commit/96dbafe288dbe2f0cc45fa3c39daf6d0c37acbab
96dbafe288dbe2f0cc45fa3c39daf6d0c37acbab
Roll libxslt to 891681e3e948f31732229f53cb6db7215f740fc7 BUG=583156,583171 Review URL: https://codereview.chromium.org/1853083002 Cr-Commit-Position: refs/heads/master@{#385338}
xsltGetSpecialNamespace(xsltTransformContextPtr ctxt, xmlNodePtr invocNode, const xmlChar *nsName, const xmlChar *nsPrefix, xmlNodePtr target) { xmlNsPtr ns; int prefixOccupied = 0; if ((ctxt == NULL) || (target == NULL) || (target->type != XML_ELEMENT_NODE)) return(NULL); /* * NOTE: Namespace exclusion and ns-aliasing is performed at * compilation-time in the refactored code; so this need not be done * here (it was in the old code). * NOTE: @invocNode was named @cur in the old code and was documented to * be an input node; since it was only used to anchor an error report * somewhere, we can safely change this to @invocNode, which now * will be the XSLT instruction (also a literal result element/attribute), * which was responsible for this call. */ /* * OPTIMIZE TODO: This all could be optimized by keeping track of * the ns-decls currently in-scope via a specialized context. */ if ((nsPrefix == NULL) && ((nsName == NULL) || (nsName[0] == 0))) { /* * NOTE: the "undeclaration" of the default namespace was * part of the logic of the old xsltGetSpecialNamespace() code, * so we'll keep that mechanism. * Related to the old code: bug #302020: */ /* * OPTIMIZE TODO: This all could be optimized by keeping track of * the ns-decls currently in-scope via a specialized context. */ /* * Search on the result element itself. */ if (target->nsDef != NULL) { ns = target->nsDef; do { if (ns->prefix == NULL) { if ((ns->href != NULL) && (ns->href[0] != 0)) { /* * Raise a namespace normalization error. */ xsltTransformError(ctxt, NULL, invocNode, "Namespace normalization error: Cannot undeclare " "the default namespace, since the default namespace " "'%s' is already declared on the result element " "'%s'.\n", ns->href, target->name); return(NULL); } else { /* * The default namespace was undeclared on the * result element. */ return(NULL); } break; } ns = ns->next; } while (ns != NULL); } if ((target->parent != NULL) && (target->parent->type == XML_ELEMENT_NODE)) { /* * The parent element is in no namespace, so assume * that there is no default namespace in scope. */ if (target->parent->ns == NULL) return(NULL); ns = xmlSearchNs(target->doc, target->parent, NULL); /* * Fine if there's no default ns is scope, or if the * default ns was undeclared. */ if ((ns == NULL) || (ns->href == NULL) || (ns->href[0] == 0)) return(NULL); /* * Undeclare the default namespace. */ xmlNewNs(target, BAD_CAST "", NULL); /* TODO: Check result */ return(NULL); } return(NULL); } /* * Handle the XML namespace. * QUESTION: Is this faster than using xmlStrEqual() anyway? */ if ((nsPrefix != NULL) && (nsPrefix[0] == 'x') && (nsPrefix[1] == 'm') && (nsPrefix[2] == 'l') && (nsPrefix[3] == 0)) { return(xmlSearchNs(target->doc, target, nsPrefix)); } /* * First: search on the result element itself. */ if (target->nsDef != NULL) { ns = target->nsDef; do { if ((ns->prefix == NULL) == (nsPrefix == NULL)) { if (ns->prefix == nsPrefix) { if (xmlStrEqual(ns->href, nsName)) return(ns); prefixOccupied = 1; break; } else if (xmlStrEqual(ns->prefix, nsPrefix)) { if (xmlStrEqual(ns->href, nsName)) return(ns); prefixOccupied = 1; break; } } ns = ns->next; } while (ns != NULL); } if (prefixOccupied) { /* * If the ns-prefix is occupied by an other ns-decl on the * result element, then this means: * 1) The desired prefix is shadowed * 2) There's no way around changing the prefix * * Try a desperate search for an in-scope ns-decl * with a matching ns-name before we use the last option, * which is to recreate the ns-decl with a modified prefix. */ ns = xmlSearchNsByHref(target->doc, target, nsName); if (ns != NULL) return(ns); /* * Fallback to changing the prefix. */ } else if ((target->parent != NULL) && (target->parent->type == XML_ELEMENT_NODE)) { /* * Try to find a matching ns-decl in the ancestor-axis. * * Check the common case: The parent element of the current * result element is in the same namespace (with an equal ns-prefix). */ if ((target->parent->ns != NULL) && ((target->parent->ns->prefix != NULL) == (nsPrefix != NULL))) { ns = target->parent->ns; if (nsPrefix == NULL) { if (xmlStrEqual(ns->href, nsName)) return(ns); } else if (xmlStrEqual(ns->prefix, nsPrefix) && xmlStrEqual(ns->href, nsName)) { return(ns); } } /* * Lookup the remaining in-scope namespaces. */ ns = xmlSearchNs(target->doc, target->parent, nsPrefix); if (ns != NULL) { if (xmlStrEqual(ns->href, nsName)) return(ns); /* * Now check for a nasty case: We need to ensure that the new * ns-decl won't shadow a prefix in-use by an existing attribute. * <foo xmlns:a="urn:test:a"> * <bar a:a="val-a"> * <xsl:attribute xmlns:a="urn:test:b" name="a:b"> * val-b</xsl:attribute> * </bar> * </foo> */ if (target->properties) { xmlAttrPtr attr = target->properties; do { if ((attr->ns) && xmlStrEqual(attr->ns->prefix, nsPrefix)) { /* * Bad, this prefix is already in use. * Since we'll change the prefix anyway, try * a search for a matching ns-decl based on the * namespace name. */ ns = xmlSearchNsByHref(target->doc, target, nsName); if (ns != NULL) return(ns); goto declare_new_prefix; } attr = attr->next; } while (attr != NULL); } } else { /* * Either no matching ns-prefix was found or the namespace is * shadowed. * Create a new ns-decl on the current result element. * * Hmm, we could also try to reuse an in-scope * namespace with a matching ns-name but a different * ns-prefix. * What has higher priority? * 1) If keeping the prefix: create a new ns-decl. * 2) If reusal: first lookup ns-names; then fallback * to creation of a new ns-decl. * REVISIT: this currently uses case 1) although * the old way was use xmlSearchNsByHref() and to let change * the prefix. */ #if 0 ns = xmlSearchNsByHref(target->doc, target, nsName); if (ns != NULL) return(ns); #endif } /* * Create the ns-decl on the current result element. */ ns = xmlNewNs(target, nsName, nsPrefix); /* TODO: check errors */ return(ns); } else { /* * This is either the root of the tree or something weird is going on. */ ns = xmlNewNs(target, nsName, nsPrefix); /* TODO: Check result */ return(ns); } declare_new_prefix: /* * Fallback: we need to generate a new prefix and declare the namespace * on the result element. */ { xmlChar pref[30]; int counter = 1; if (nsPrefix == NULL) { nsPrefix = BAD_CAST "ns"; } do { snprintf((char *) pref, 30, "%s_%d", nsPrefix, counter++); ns = xmlSearchNs(target->doc, target, BAD_CAST pref); if (counter > 1000) { xsltTransformError(ctxt, NULL, invocNode, "Internal error in xsltAcquireResultInScopeNs(): " "Failed to compute a unique ns-prefix for the " "generated element"); return(NULL); } } while (ns != NULL); ns = xmlNewNs(target, nsName, BAD_CAST pref); /* TODO: Check result */ return(ns); } return(NULL); }
xsltGetSpecialNamespace(xsltTransformContextPtr ctxt, xmlNodePtr invocNode, const xmlChar *nsName, const xmlChar *nsPrefix, xmlNodePtr target) { xmlNsPtr ns; int prefixOccupied = 0; if ((ctxt == NULL) || (target == NULL) || (target->type != XML_ELEMENT_NODE)) return(NULL); /* * NOTE: Namespace exclusion and ns-aliasing is performed at * compilation-time in the refactored code; so this need not be done * here (it was in the old code). * NOTE: @invocNode was named @cur in the old code and was documented to * be an input node; since it was only used to anchor an error report * somewhere, we can safely change this to @invocNode, which now * will be the XSLT instruction (also a literal result element/attribute), * which was responsible for this call. */ /* * OPTIMIZE TODO: This all could be optimized by keeping track of * the ns-decls currently in-scope via a specialized context. */ if ((nsPrefix == NULL) && ((nsName == NULL) || (nsName[0] == 0))) { /* * NOTE: the "undeclaration" of the default namespace was * part of the logic of the old xsltGetSpecialNamespace() code, * so we'll keep that mechanism. * Related to the old code: bug #302020: */ /* * OPTIMIZE TODO: This all could be optimized by keeping track of * the ns-decls currently in-scope via a specialized context. */ /* * Search on the result element itself. */ if (target->nsDef != NULL) { ns = target->nsDef; do { if (ns->prefix == NULL) { if ((ns->href != NULL) && (ns->href[0] != 0)) { /* * Raise a namespace normalization error. */ xsltTransformError(ctxt, NULL, invocNode, "Namespace normalization error: Cannot undeclare " "the default namespace, since the default namespace " "'%s' is already declared on the result element " "'%s'.\n", ns->href, target->name); return(NULL); } else { /* * The default namespace was undeclared on the * result element. */ return(NULL); } break; } ns = ns->next; } while (ns != NULL); } if ((target->parent != NULL) && (target->parent->type == XML_ELEMENT_NODE)) { /* * The parent element is in no namespace, so assume * that there is no default namespace in scope. */ if (target->parent->ns == NULL) return(NULL); ns = xmlSearchNs(target->doc, target->parent, NULL); /* * Fine if there's no default ns is scope, or if the * default ns was undeclared. */ if ((ns == NULL) || (ns->href == NULL) || (ns->href[0] == 0)) return(NULL); /* * Undeclare the default namespace. */ xmlNewNs(target, BAD_CAST "", NULL); /* TODO: Check result */ return(NULL); } return(NULL); } /* * Handle the XML namespace. * QUESTION: Is this faster than using xmlStrEqual() anyway? */ if ((nsPrefix != NULL) && (nsPrefix[0] == 'x') && (nsPrefix[1] == 'm') && (nsPrefix[2] == 'l') && (nsPrefix[3] == 0)) { return(xmlSearchNs(target->doc, target, nsPrefix)); } /* * First: search on the result element itself. */ if (target->nsDef != NULL) { ns = target->nsDef; do { if ((ns->prefix == NULL) == (nsPrefix == NULL)) { if (ns->prefix == nsPrefix) { if (xmlStrEqual(ns->href, nsName)) return(ns); prefixOccupied = 1; break; } else if (xmlStrEqual(ns->prefix, nsPrefix)) { if (xmlStrEqual(ns->href, nsName)) return(ns); prefixOccupied = 1; break; } } ns = ns->next; } while (ns != NULL); } if (prefixOccupied) { /* * If the ns-prefix is occupied by an other ns-decl on the * result element, then this means: * 1) The desired prefix is shadowed * 2) There's no way around changing the prefix * * Try a desperate search for an in-scope ns-decl * with a matching ns-name before we use the last option, * which is to recreate the ns-decl with a modified prefix. */ ns = xmlSearchNsByHref(target->doc, target, nsName); if (ns != NULL) return(ns); /* * Fallback to changing the prefix. */ } else if ((target->parent != NULL) && (target->parent->type == XML_ELEMENT_NODE)) { /* * Try to find a matching ns-decl in the ancestor-axis. * * Check the common case: The parent element of the current * result element is in the same namespace (with an equal ns-prefix). */ if ((target->parent->ns != NULL) && ((target->parent->ns->prefix != NULL) == (nsPrefix != NULL))) { ns = target->parent->ns; if (nsPrefix == NULL) { if (xmlStrEqual(ns->href, nsName)) return(ns); } else if (xmlStrEqual(ns->prefix, nsPrefix) && xmlStrEqual(ns->href, nsName)) { return(ns); } } /* * Lookup the remaining in-scope namespaces. */ ns = xmlSearchNs(target->doc, target->parent, nsPrefix); if (ns != NULL) { if (xmlStrEqual(ns->href, nsName)) return(ns); /* * Now check for a nasty case: We need to ensure that the new * ns-decl won't shadow a prefix in-use by an existing attribute. * <foo xmlns:a="urn:test:a"> * <bar a:a="val-a"> * <xsl:attribute xmlns:a="urn:test:b" name="a:b"> * val-b</xsl:attribute> * </bar> * </foo> */ if (target->properties) { xmlAttrPtr attr = target->properties; do { if ((attr->ns) && xmlStrEqual(attr->ns->prefix, nsPrefix)) { /* * Bad, this prefix is already in use. * Since we'll change the prefix anyway, try * a search for a matching ns-decl based on the * namespace name. */ ns = xmlSearchNsByHref(target->doc, target, nsName); if (ns != NULL) return(ns); goto declare_new_prefix; } attr = attr->next; } while (attr != NULL); } } else { /* * Either no matching ns-prefix was found or the namespace is * shadowed. * Create a new ns-decl on the current result element. * * Hmm, we could also try to reuse an in-scope * namespace with a matching ns-name but a different * ns-prefix. * What has higher priority? * 1) If keeping the prefix: create a new ns-decl. * 2) If reusal: first lookup ns-names; then fallback * to creation of a new ns-decl. * REVISIT: this currently uses case 1) although * the old way was use xmlSearchNsByHref() and to let change * the prefix. */ #if 0 ns = xmlSearchNsByHref(target->doc, target, nsName); if (ns != NULL) return(ns); #endif } /* * Create the ns-decl on the current result element. */ ns = xmlNewNs(target, nsName, nsPrefix); /* TODO: check errors */ return(ns); } else { /* * This is either the root of the tree or something weird is going on. */ ns = xmlNewNs(target, nsName, nsPrefix); /* TODO: Check result */ return(ns); } declare_new_prefix: /* * Fallback: we need to generate a new prefix and declare the namespace * on the result element. */ { xmlChar pref[30]; int counter = 1; if (nsPrefix == NULL) { nsPrefix = BAD_CAST "ns"; } do { snprintf((char *) pref, 30, "%s_%d", nsPrefix, counter++); ns = xmlSearchNs(target->doc, target, BAD_CAST pref); if (counter > 1000) { xsltTransformError(ctxt, NULL, invocNode, "Internal error in xsltAcquireResultInScopeNs(): " "Failed to compute a unique ns-prefix for the " "generated element"); return(NULL); } } while (ns != NULL); ns = xmlNewNs(target, nsName, BAD_CAST pref); /* TODO: Check result */ return(ns); } return(NULL); }
C
Chrome
0
CVE-2015-6791
https://www.cvedetails.com/cve/CVE-2015-6791/
null
https://github.com/chromium/chromium/commit/7e995b26a5a503adefc0ad40435f7e16a45434c2
7e995b26a5a503adefc0ad40435f7e16a45434c2
Add a fake DriveFS launcher client. Using DriveFS requires building and deploying ChromeOS. Add a client for the fake DriveFS launcher to allow the use of a real DriveFS from a ChromeOS chroot to be used with a target_os="chromeos" build of chrome. This connects to the fake DriveFS launcher using mojo over a unix domain socket named by a command-line flag, using the launcher to create DriveFS instances. Bug: 848126 Change-Id: I22dcca154d41bda196dd7c1782bb503f6bcba5b1 Reviewed-on: https://chromium-review.googlesource.com/1098434 Reviewed-by: Xiyuan Xia <xiyuan@chromium.org> Commit-Queue: Sam McNally <sammc@chromium.org> Cr-Commit-Position: refs/heads/master@{#567513}
identity::mojom::IdentityManager& DriveFsHost::GetIdentityManager() { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); if (!identity_manager_) { delegate_->GetConnector()->BindInterface( identity::mojom::kServiceName, mojo::MakeRequest(&identity_manager_)); } return *identity_manager_; }
identity::mojom::IdentityManager& DriveFsHost::GetIdentityManager() { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); if (!identity_manager_) { delegate_->GetConnector()->BindInterface( identity::mojom::kServiceName, mojo::MakeRequest(&identity_manager_)); } return *identity_manager_; }
C
Chrome
0
CVE-2017-5118
https://www.cvedetails.com/cve/CVE-2017-5118/
CWE-732
https://github.com/chromium/chromium/commit/0ab2412a104d2f235d7b9fe19d30ef605a410832
0ab2412a104d2f235d7b9fe19d30ef605a410832
Inherit CSP when we inherit the security origin This prevents attacks that use main window navigation to get out of the existing csp constraints such as the related bug Bug: 747847 Change-Id: I1e57b50da17f65d38088205b0a3c7c49ef2ae4d8 Reviewed-on: https://chromium-review.googlesource.com/592027 Reviewed-by: Mike West <mkwst@chromium.org> Commit-Queue: Andy Paicu <andypaicu@chromium.org> Cr-Commit-Position: refs/heads/master@{#492333}
const AtomicString& DocumentLoader::MimeType() const { if (writer_) return writer_->MimeType(); return response_.MimeType(); }
const AtomicString& DocumentLoader::MimeType() const { if (writer_) return writer_->MimeType(); return response_.MimeType(); }
C
Chrome
0
CVE-2018-17468
https://www.cvedetails.com/cve/CVE-2018-17468/
CWE-200
https://github.com/chromium/chromium/commit/5fe74f831fddb92afa5ddfe46490bb49f083132b
5fe74f831fddb92afa5ddfe46490bb49f083132b
Do not forward resource timing to parent frame after back-forward navigation LocalFrame has |should_send_resource_timing_info_to_parent_| flag not to send timing info to parent except for the first navigation. This flag is cleared when the first timing is sent to parent, however this does not happen if iframe's first navigation was by back-forward navigation. For such iframes, we shouldn't send timings to parent at all. Bug: 876822 Change-Id: I128b51a82ef278c439548afc8283ae63abdef5c5 Reviewed-on: https://chromium-review.googlesource.com/1186215 Reviewed-by: Kinuko Yasuda <kinuko@chromium.org> Commit-Queue: Kunihiko Sakamoto <ksakamoto@chromium.org> Cr-Commit-Position: refs/heads/master@{#585736}
bool WebLocalFrameImpl::IsCommandEnabled(const WebString& name) const { DCHECK(GetFrame()); return GetFrame()->GetEditor().IsCommandEnabled(name); }
bool WebLocalFrameImpl::IsCommandEnabled(const WebString& name) const { DCHECK(GetFrame()); return GetFrame()->GetEditor().IsCommandEnabled(name); }
C
Chrome
0
CVE-2014-3200
https://www.cvedetails.com/cve/CVE-2014-3200/
null
https://github.com/chromium/chromium/commit/c0947dabeaa10da67798c1bbc668dca4b280cad5
c0947dabeaa10da67798c1bbc668dca4b280cad5
[Contextual Search] Change "Now on Tap" to "Contextual Cards" BUG=644934 Review-Url: https://codereview.chromium.org/2361163003 Cr-Commit-Position: refs/heads/master@{#420899}
bool AboutInSettingsEnabled() { return SettingsWindowEnabled() && !base::CommandLine::ForCurrentProcess()->HasSwitch( ::switches::kDisableAboutInSettings); }
bool AboutInSettingsEnabled() { return SettingsWindowEnabled() && !base::CommandLine::ForCurrentProcess()->HasSwitch( ::switches::kDisableAboutInSettings); }
C
Chrome
0
CVE-2017-12168
https://www.cvedetails.com/cve/CVE-2017-12168/
CWE-617
https://github.com/torvalds/linux/commit/9e3f7a29694049edd728e2400ab57ad7553e5aa9
9e3f7a29694049edd728e2400ab57ad7553e5aa9
arm64: KVM: pmu: Fix AArch32 cycle counter access We're missing the handling code for the cycle counter accessed from a 32bit guest, leading to unexpected results. Cc: stable@vger.kernel.org # 4.6+ Signed-off-by: Wei Huang <wei@redhat.com> Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
static void dbg_to_reg(struct kvm_vcpu *vcpu, struct sys_reg_params *p, u64 *dbg_reg) { p->regval = *dbg_reg; if (p->is_32bit) p->regval &= 0xffffffffUL; }
static void dbg_to_reg(struct kvm_vcpu *vcpu, struct sys_reg_params *p, u64 *dbg_reg) { p->regval = *dbg_reg; if (p->is_32bit) p->regval &= 0xffffffffUL; }
C
linux
0
CVE-2016-3881
https://www.cvedetails.com/cve/CVE-2016-3881/
CWE-119
https://android.googlesource.com/platform/external/libvpx/+/4974dcbd0289a2530df2ee2a25b5f92775df80da
4974dcbd0289a2530df2ee2a25b5f92775df80da
DO NOT MERGE | libvpx: cherry-pick aa1c813 from upstream Description from upstream: vp9: Fix potential SEGV in decoder_peek_si_internal decoder_peek_si_internal could potentially read more bytes than what actually exists in the input buffer. We check for the buffer size to be at least 8, but we try to read up to 10 bytes in the worst case. A well crafted file could thus cause a segfault. Likely change that introduced this bug was: https://chromium-review.googlesource.com/#/c/70439 (git hash: 7c43fb6) Bug: 30013856 Change-Id: If556414cb5b82472d5673e045bc185cc57bb9af3 (cherry picked from commit bd57d587c2eb743c61b049add18f9fd72bf78c33)
static int frame_worker_hook(void *arg1, void *arg2) { FrameWorkerData *const frame_worker_data = (FrameWorkerData *)arg1; const uint8_t *data = frame_worker_data->data; (void)arg2; frame_worker_data->result = vp9_receive_compressed_data(frame_worker_data->pbi, frame_worker_data->data_size, &data); frame_worker_data->data_end = data; if (frame_worker_data->pbi->frame_parallel_decode) { if (frame_worker_data->result != 0 || frame_worker_data->data + frame_worker_data->data_size - 1 > data) { VPxWorker *const worker = frame_worker_data->pbi->frame_worker_owner; BufferPool *const pool = frame_worker_data->pbi->common.buffer_pool; vp9_frameworker_lock_stats(worker); frame_worker_data->frame_context_ready = 1; lock_buffer_pool(pool); frame_worker_data->pbi->cur_buf->buf.corrupted = 1; unlock_buffer_pool(pool); frame_worker_data->pbi->need_resync = 1; vp9_frameworker_signal_stats(worker); vp9_frameworker_unlock_stats(worker); return 0; } } else if (frame_worker_data->result != 0) { frame_worker_data->pbi->cur_buf->buf.corrupted = 1; frame_worker_data->pbi->need_resync = 1; } return !frame_worker_data->result; }
static int frame_worker_hook(void *arg1, void *arg2) { FrameWorkerData *const frame_worker_data = (FrameWorkerData *)arg1; const uint8_t *data = frame_worker_data->data; (void)arg2; frame_worker_data->result = vp9_receive_compressed_data(frame_worker_data->pbi, frame_worker_data->data_size, &data); frame_worker_data->data_end = data; if (frame_worker_data->pbi->frame_parallel_decode) { if (frame_worker_data->result != 0 || frame_worker_data->data + frame_worker_data->data_size - 1 > data) { VPxWorker *const worker = frame_worker_data->pbi->frame_worker_owner; BufferPool *const pool = frame_worker_data->pbi->common.buffer_pool; vp9_frameworker_lock_stats(worker); frame_worker_data->frame_context_ready = 1; lock_buffer_pool(pool); frame_worker_data->pbi->cur_buf->buf.corrupted = 1; unlock_buffer_pool(pool); frame_worker_data->pbi->need_resync = 1; vp9_frameworker_signal_stats(worker); vp9_frameworker_unlock_stats(worker); return 0; } } else if (frame_worker_data->result != 0) { frame_worker_data->pbi->cur_buf->buf.corrupted = 1; frame_worker_data->pbi->need_resync = 1; } return !frame_worker_data->result; }
C
Android
0
CVE-2013-2909
https://www.cvedetails.com/cve/CVE-2013-2909/
CWE-399
https://github.com/chromium/chromium/commit/248a92c21c20c14b5983680c50e1d8b73fc79a2f
248a92c21c20c14b5983680c50e1d8b73fc79a2f
Update containtingIsolate to go back all the way to top isolate from current root, rather than stopping at the first isolate it finds. This works because the current root is always updated with each isolate run. BUG=279277 Review URL: https://chromiumcodereview.appspot.com/23972003 git-svn-id: svn://svn.chromium.org/blink/trunk@157268 bbb929c8-8fbe-4397-9dbb-9b2b20218538
bool checkForFloatsFromLastLine() const { return m_checkForFloatsFromLastLine; }
bool checkForFloatsFromLastLine() const { return m_checkForFloatsFromLastLine; }
C
Chrome
0
CVE-2015-4116
https://www.cvedetails.com/cve/CVE-2015-4116/
null
https://git.php.net/?p=php-src.git;a=commit;h=1cbd25ca15383394ffa9ee8601c5de4c0f2f90e1
1cbd25ca15383394ffa9ee8601c5de4c0f2f90e1
null
SPL_METHOD(SplHeap, current) { spl_heap_object *intern = (spl_heap_object*)zend_object_store_get_object(getThis() TSRMLS_CC); zval *element = (zval *)intern->heap->elements[0]; if (zend_parse_parameters_none() == FAILURE) { return; } if (!intern->heap->count || !element) { RETURN_NULL(); } else { RETURN_ZVAL(element, 1, 0); } }
SPL_METHOD(SplHeap, current) { spl_heap_object *intern = (spl_heap_object*)zend_object_store_get_object(getThis() TSRMLS_CC); zval *element = (zval *)intern->heap->elements[0]; if (zend_parse_parameters_none() == FAILURE) { return; } if (!intern->heap->count || !element) { RETURN_NULL(); } else { RETURN_ZVAL(element, 1, 0); } }
C
php
0
CVE-2016-9388
https://www.cvedetails.com/cve/CVE-2016-9388/
null
https://github.com/mdadams/jasper/commit/411a4068f8c464e883358bf403a3e25158863823
411a4068f8c464e883358bf403a3e25158863823
Fixed a few bugs in the RAS encoder and decoder where errors were tested with assertions instead of being gracefully handled.
static int ras_putdata(jas_stream_t *out, ras_hdr_t *hdr, jas_image_t *image, int numcmpts, int *cmpts) { int ret; switch (hdr->type) { case RAS_TYPE_STD: ret = ras_putdatastd(out, hdr, image, numcmpts, cmpts); break; default: ret = -1; break; } return ret; }
static int ras_putdata(jas_stream_t *out, ras_hdr_t *hdr, jas_image_t *image, int numcmpts, int *cmpts) { int ret; switch (hdr->type) { case RAS_TYPE_STD: ret = ras_putdatastd(out, hdr, image, numcmpts, cmpts); break; default: ret = -1; break; } return ret; }
C
jasper
0
CVE-2013-4470
https://www.cvedetails.com/cve/CVE-2013-4470/
CWE-264
https://github.com/torvalds/linux/commit/e93b7d748be887cd7639b113ba7d7ef792a7efb9
e93b7d748be887cd7639b113ba7d7ef792a7efb9
ip_output: do skb ufo init for peeked non ufo skb as well Now, if user application does: sendto len<mtu flag MSG_MORE sendto len>mtu flag 0 The skb is not treated as fragmented one because it is not initialized that way. So move the initialization to fix this. introduced by: commit e89e9cf539a28df7d0eb1d0a545368e9920b34ac "[IPv4/IPv6]: UFO Scatter-gather approach" Signed-off-by: Jiri Pirko <jiri@resnulli.us> Acked-by: Hannes Frederic Sowa <hannes@stressinduktion.org> Signed-off-by: David S. Miller <davem@davemloft.net>
int ip_append_data(struct sock *sk, struct flowi4 *fl4, int getfrag(void *from, char *to, int offset, int len, int odd, struct sk_buff *skb), void *from, int length, int transhdrlen, struct ipcm_cookie *ipc, struct rtable **rtp, unsigned int flags) { struct inet_sock *inet = inet_sk(sk); int err; if (flags&MSG_PROBE) return 0; if (skb_queue_empty(&sk->sk_write_queue)) { err = ip_setup_cork(sk, &inet->cork.base, ipc, rtp); if (err) return err; } else { transhdrlen = 0; } return __ip_append_data(sk, fl4, &sk->sk_write_queue, &inet->cork.base, sk_page_frag(sk), getfrag, from, length, transhdrlen, flags); }
int ip_append_data(struct sock *sk, struct flowi4 *fl4, int getfrag(void *from, char *to, int offset, int len, int odd, struct sk_buff *skb), void *from, int length, int transhdrlen, struct ipcm_cookie *ipc, struct rtable **rtp, unsigned int flags) { struct inet_sock *inet = inet_sk(sk); int err; if (flags&MSG_PROBE) return 0; if (skb_queue_empty(&sk->sk_write_queue)) { err = ip_setup_cork(sk, &inet->cork.base, ipc, rtp); if (err) return err; } else { transhdrlen = 0; } return __ip_append_data(sk, fl4, &sk->sk_write_queue, &inet->cork.base, sk_page_frag(sk), getfrag, from, length, transhdrlen, flags); }
C
linux
0
CVE-2016-6213
https://www.cvedetails.com/cve/CVE-2016-6213/
CWE-400
https://github.com/torvalds/linux/commit/d29216842a85c7970c536108e093963f02714498
d29216842a85c7970c536108e093963f02714498
mnt: Add a per mount namespace limit on the number of mounts CAI Qian <caiqian@redhat.com> pointed out that the semantics of shared subtrees make it possible to create an exponentially increasing number of mounts in a mount namespace. mkdir /tmp/1 /tmp/2 mount --make-rshared / for i in $(seq 1 20) ; do mount --bind /tmp/1 /tmp/2 ; done Will create create 2^20 or 1048576 mounts, which is a practical problem as some people have managed to hit this by accident. As such CVE-2016-6213 was assigned. Ian Kent <raven@themaw.net> described the situation for autofs users as follows: > The number of mounts for direct mount maps is usually not very large because of > the way they are implemented, large direct mount maps can have performance > problems. There can be anywhere from a few (likely case a few hundred) to less > than 10000, plus mounts that have been triggered and not yet expired. > > Indirect mounts have one autofs mount at the root plus the number of mounts that > have been triggered and not yet expired. > > The number of autofs indirect map entries can range from a few to the common > case of several thousand and in rare cases up to between 30000 and 50000. I've > not heard of people with maps larger than 50000 entries. > > The larger the number of map entries the greater the possibility for a large > number of active mounts so it's not hard to expect cases of a 1000 or somewhat > more active mounts. So I am setting the default number of mounts allowed per mount namespace at 100,000. This is more than enough for any use case I know of, but small enough to quickly stop an exponential increase in mounts. Which should be perfect to catch misconfigurations and malfunctioning programs. For anyone who needs a higher limit this can be changed by writing to the new /proc/sys/fs/mount-max sysctl. Tested-by: CAI Qian <caiqian@redhat.com> Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
static void put_mountpoint(struct mountpoint *mp) { if (!--mp->m_count) { struct dentry *dentry = mp->m_dentry; BUG_ON(!hlist_empty(&mp->m_list)); spin_lock(&dentry->d_lock); dentry->d_flags &= ~DCACHE_MOUNTED; spin_unlock(&dentry->d_lock); hlist_del(&mp->m_hash); kfree(mp); } }
static void put_mountpoint(struct mountpoint *mp) { if (!--mp->m_count) { struct dentry *dentry = mp->m_dentry; BUG_ON(!hlist_empty(&mp->m_list)); spin_lock(&dentry->d_lock); dentry->d_flags &= ~DCACHE_MOUNTED; spin_unlock(&dentry->d_lock); hlist_del(&mp->m_hash); kfree(mp); } }
C
linux
0
CVE-2013-1943
https://www.cvedetails.com/cve/CVE-2013-1943/
CWE-20
https://github.com/torvalds/linux/commit/fa3d315a4ce2c0891cdde262562e710d95fba19e
fa3d315a4ce2c0891cdde262562e710d95fba19e
KVM: Validate userspace_addr of memslot when registered This way, we can avoid checking the user space address many times when we read the guest memory. Although we can do the same for write if we check which slots are writable, we do not care write now: reading the guest memory happens more often than writing. [avi: change VERIFY_READ to VERIFY_WRITE] Signed-off-by: Takuya Yoshikawa <yoshikawa.takuya@oss.ntt.co.jp> Signed-off-by: Avi Kivity <avi@redhat.com>
int __kvm_set_memory_region(struct kvm *kvm, struct kvm_userspace_memory_region *mem, int user_alloc) { int r; gfn_t base_gfn; unsigned long npages; unsigned long i; struct kvm_memory_slot *memslot; struct kvm_memory_slot old, new; struct kvm_memslots *slots, *old_memslots; r = -EINVAL; /* General sanity checks */ if (mem->memory_size & (PAGE_SIZE - 1)) goto out; if (mem->guest_phys_addr & (PAGE_SIZE - 1)) goto out; /* We can read the guest memory with __xxx_user() later on. */ if (user_alloc && ((mem->userspace_addr & (PAGE_SIZE - 1)) || !access_ok(VERIFY_WRITE, mem->userspace_addr, mem->memory_size))) goto out; if (mem->slot >= KVM_MEMORY_SLOTS + KVM_PRIVATE_MEM_SLOTS) goto out; if (mem->guest_phys_addr + mem->memory_size < mem->guest_phys_addr) goto out; memslot = &kvm->memslots->memslots[mem->slot]; base_gfn = mem->guest_phys_addr >> PAGE_SHIFT; npages = mem->memory_size >> PAGE_SHIFT; r = -EINVAL; if (npages > KVM_MEM_MAX_NR_PAGES) goto out; if (!npages) mem->flags &= ~KVM_MEM_LOG_DIRTY_PAGES; new = old = *memslot; new.id = mem->slot; new.base_gfn = base_gfn; new.npages = npages; new.flags = mem->flags; /* Disallow changing a memory slot's size. */ r = -EINVAL; if (npages && old.npages && npages != old.npages) goto out_free; /* Check for overlaps */ r = -EEXIST; for (i = 0; i < KVM_MEMORY_SLOTS; ++i) { struct kvm_memory_slot *s = &kvm->memslots->memslots[i]; if (s == memslot || !s->npages) continue; if (!((base_gfn + npages <= s->base_gfn) || (base_gfn >= s->base_gfn + s->npages))) goto out_free; } /* Free page dirty bitmap if unneeded */ if (!(new.flags & KVM_MEM_LOG_DIRTY_PAGES)) new.dirty_bitmap = NULL; r = -ENOMEM; /* Allocate if a slot is being created */ #ifndef CONFIG_S390 if (npages && !new.rmap) { new.rmap = vzalloc(npages * sizeof(*new.rmap)); if (!new.rmap) goto out_free; new.user_alloc = user_alloc; new.userspace_addr = mem->userspace_addr; } if (!npages) goto skip_lpage; for (i = 0; i < KVM_NR_PAGE_SIZES - 1; ++i) { unsigned long ugfn; unsigned long j; int lpages; int level = i + 2; /* Avoid unused variable warning if no large pages */ (void)level; if (new.lpage_info[i]) continue; lpages = 1 + ((base_gfn + npages - 1) >> KVM_HPAGE_GFN_SHIFT(level)); lpages -= base_gfn >> KVM_HPAGE_GFN_SHIFT(level); new.lpage_info[i] = vzalloc(lpages * sizeof(*new.lpage_info[i])); if (!new.lpage_info[i]) goto out_free; if (base_gfn & (KVM_PAGES_PER_HPAGE(level) - 1)) new.lpage_info[i][0].write_count = 1; if ((base_gfn+npages) & (KVM_PAGES_PER_HPAGE(level) - 1)) new.lpage_info[i][lpages - 1].write_count = 1; ugfn = new.userspace_addr >> PAGE_SHIFT; /* * If the gfn and userspace address are not aligned wrt each * other, or if explicitly asked to, disable large page * support for this slot */ if ((base_gfn ^ ugfn) & (KVM_PAGES_PER_HPAGE(level) - 1) || !largepages_enabled) for (j = 0; j < lpages; ++j) new.lpage_info[i][j].write_count = 1; } skip_lpage: /* Allocate page dirty bitmap if needed */ if ((new.flags & KVM_MEM_LOG_DIRTY_PAGES) && !new.dirty_bitmap) { if (kvm_create_dirty_bitmap(&new) < 0) goto out_free; /* destroy any largepage mappings for dirty tracking */ } #else /* not defined CONFIG_S390 */ new.user_alloc = user_alloc; if (user_alloc) new.userspace_addr = mem->userspace_addr; #endif /* not defined CONFIG_S390 */ if (!npages) { r = -ENOMEM; slots = kzalloc(sizeof(struct kvm_memslots), GFP_KERNEL); if (!slots) goto out_free; memcpy(slots, kvm->memslots, sizeof(struct kvm_memslots)); if (mem->slot >= slots->nmemslots) slots->nmemslots = mem->slot + 1; slots->generation++; slots->memslots[mem->slot].flags |= KVM_MEMSLOT_INVALID; old_memslots = kvm->memslots; rcu_assign_pointer(kvm->memslots, slots); synchronize_srcu_expedited(&kvm->srcu); /* From this point no new shadow pages pointing to a deleted * memslot will be created. * * validation of sp->gfn happens in: * - gfn_to_hva (kvm_read_guest, gfn_to_pfn) * - kvm_is_visible_gfn (mmu_check_roots) */ kvm_arch_flush_shadow(kvm); kfree(old_memslots); } r = kvm_arch_prepare_memory_region(kvm, &new, old, mem, user_alloc); if (r) goto out_free; /* map the pages in iommu page table */ if (npages) { r = kvm_iommu_map_pages(kvm, &new); if (r) goto out_free; } r = -ENOMEM; slots = kzalloc(sizeof(struct kvm_memslots), GFP_KERNEL); if (!slots) goto out_free; memcpy(slots, kvm->memslots, sizeof(struct kvm_memslots)); if (mem->slot >= slots->nmemslots) slots->nmemslots = mem->slot + 1; slots->generation++; /* actual memory is freed via old in kvm_free_physmem_slot below */ if (!npages) { new.rmap = NULL; new.dirty_bitmap = NULL; for (i = 0; i < KVM_NR_PAGE_SIZES - 1; ++i) new.lpage_info[i] = NULL; } slots->memslots[mem->slot] = new; old_memslots = kvm->memslots; rcu_assign_pointer(kvm->memslots, slots); synchronize_srcu_expedited(&kvm->srcu); kvm_arch_commit_memory_region(kvm, mem, old, user_alloc); kvm_free_physmem_slot(&old, &new); kfree(old_memslots); return 0; out_free: kvm_free_physmem_slot(&new, &old); out: return r; }
int __kvm_set_memory_region(struct kvm *kvm, struct kvm_userspace_memory_region *mem, int user_alloc) { int r; gfn_t base_gfn; unsigned long npages; unsigned long i; struct kvm_memory_slot *memslot; struct kvm_memory_slot old, new; struct kvm_memslots *slots, *old_memslots; r = -EINVAL; /* General sanity checks */ if (mem->memory_size & (PAGE_SIZE - 1)) goto out; if (mem->guest_phys_addr & (PAGE_SIZE - 1)) goto out; if (user_alloc && (mem->userspace_addr & (PAGE_SIZE - 1))) goto out; if (mem->slot >= KVM_MEMORY_SLOTS + KVM_PRIVATE_MEM_SLOTS) goto out; if (mem->guest_phys_addr + mem->memory_size < mem->guest_phys_addr) goto out; memslot = &kvm->memslots->memslots[mem->slot]; base_gfn = mem->guest_phys_addr >> PAGE_SHIFT; npages = mem->memory_size >> PAGE_SHIFT; r = -EINVAL; if (npages > KVM_MEM_MAX_NR_PAGES) goto out; if (!npages) mem->flags &= ~KVM_MEM_LOG_DIRTY_PAGES; new = old = *memslot; new.id = mem->slot; new.base_gfn = base_gfn; new.npages = npages; new.flags = mem->flags; /* Disallow changing a memory slot's size. */ r = -EINVAL; if (npages && old.npages && npages != old.npages) goto out_free; /* Check for overlaps */ r = -EEXIST; for (i = 0; i < KVM_MEMORY_SLOTS; ++i) { struct kvm_memory_slot *s = &kvm->memslots->memslots[i]; if (s == memslot || !s->npages) continue; if (!((base_gfn + npages <= s->base_gfn) || (base_gfn >= s->base_gfn + s->npages))) goto out_free; } /* Free page dirty bitmap if unneeded */ if (!(new.flags & KVM_MEM_LOG_DIRTY_PAGES)) new.dirty_bitmap = NULL; r = -ENOMEM; /* Allocate if a slot is being created */ #ifndef CONFIG_S390 if (npages && !new.rmap) { new.rmap = vzalloc(npages * sizeof(*new.rmap)); if (!new.rmap) goto out_free; new.user_alloc = user_alloc; new.userspace_addr = mem->userspace_addr; } if (!npages) goto skip_lpage; for (i = 0; i < KVM_NR_PAGE_SIZES - 1; ++i) { unsigned long ugfn; unsigned long j; int lpages; int level = i + 2; /* Avoid unused variable warning if no large pages */ (void)level; if (new.lpage_info[i]) continue; lpages = 1 + ((base_gfn + npages - 1) >> KVM_HPAGE_GFN_SHIFT(level)); lpages -= base_gfn >> KVM_HPAGE_GFN_SHIFT(level); new.lpage_info[i] = vzalloc(lpages * sizeof(*new.lpage_info[i])); if (!new.lpage_info[i]) goto out_free; if (base_gfn & (KVM_PAGES_PER_HPAGE(level) - 1)) new.lpage_info[i][0].write_count = 1; if ((base_gfn+npages) & (KVM_PAGES_PER_HPAGE(level) - 1)) new.lpage_info[i][lpages - 1].write_count = 1; ugfn = new.userspace_addr >> PAGE_SHIFT; /* * If the gfn and userspace address are not aligned wrt each * other, or if explicitly asked to, disable large page * support for this slot */ if ((base_gfn ^ ugfn) & (KVM_PAGES_PER_HPAGE(level) - 1) || !largepages_enabled) for (j = 0; j < lpages; ++j) new.lpage_info[i][j].write_count = 1; } skip_lpage: /* Allocate page dirty bitmap if needed */ if ((new.flags & KVM_MEM_LOG_DIRTY_PAGES) && !new.dirty_bitmap) { if (kvm_create_dirty_bitmap(&new) < 0) goto out_free; /* destroy any largepage mappings for dirty tracking */ } #else /* not defined CONFIG_S390 */ new.user_alloc = user_alloc; if (user_alloc) new.userspace_addr = mem->userspace_addr; #endif /* not defined CONFIG_S390 */ if (!npages) { r = -ENOMEM; slots = kzalloc(sizeof(struct kvm_memslots), GFP_KERNEL); if (!slots) goto out_free; memcpy(slots, kvm->memslots, sizeof(struct kvm_memslots)); if (mem->slot >= slots->nmemslots) slots->nmemslots = mem->slot + 1; slots->generation++; slots->memslots[mem->slot].flags |= KVM_MEMSLOT_INVALID; old_memslots = kvm->memslots; rcu_assign_pointer(kvm->memslots, slots); synchronize_srcu_expedited(&kvm->srcu); /* From this point no new shadow pages pointing to a deleted * memslot will be created. * * validation of sp->gfn happens in: * - gfn_to_hva (kvm_read_guest, gfn_to_pfn) * - kvm_is_visible_gfn (mmu_check_roots) */ kvm_arch_flush_shadow(kvm); kfree(old_memslots); } r = kvm_arch_prepare_memory_region(kvm, &new, old, mem, user_alloc); if (r) goto out_free; /* map the pages in iommu page table */ if (npages) { r = kvm_iommu_map_pages(kvm, &new); if (r) goto out_free; } r = -ENOMEM; slots = kzalloc(sizeof(struct kvm_memslots), GFP_KERNEL); if (!slots) goto out_free; memcpy(slots, kvm->memslots, sizeof(struct kvm_memslots)); if (mem->slot >= slots->nmemslots) slots->nmemslots = mem->slot + 1; slots->generation++; /* actual memory is freed via old in kvm_free_physmem_slot below */ if (!npages) { new.rmap = NULL; new.dirty_bitmap = NULL; for (i = 0; i < KVM_NR_PAGE_SIZES - 1; ++i) new.lpage_info[i] = NULL; } slots->memslots[mem->slot] = new; old_memslots = kvm->memslots; rcu_assign_pointer(kvm->memslots, slots); synchronize_srcu_expedited(&kvm->srcu); kvm_arch_commit_memory_region(kvm, mem, old, user_alloc); kvm_free_physmem_slot(&old, &new); kfree(old_memslots); return 0; out_free: kvm_free_physmem_slot(&new, &old); out: return r; }
C
linux
1
CVE-2016-2548
https://www.cvedetails.com/cve/CVE-2016-2548/
CWE-20
https://github.com/torvalds/linux/commit/b5a663aa426f4884c71cd8580adae73f33570f0d
b5a663aa426f4884c71cd8580adae73f33570f0d
ALSA: timer: Harden slave timer list handling A slave timer instance might be still accessible in a racy way while operating the master instance as it lacks of locking. Since the master operation is mostly protected with timer->lock, we should cope with it while changing the slave instance, too. Also, some linked lists (active_list and ack_list) of slave instances aren't unlinked immediately at stopping or closing, and this may lead to unexpected accesses. This patch tries to address these issues. It adds spin lock of timer->lock (either from master or slave, which is equivalent) in a few places. For avoiding a deadlock, we ensure that the global slave_active_lock is always locked at first before each timer lock. Also, ack and active_list of slave instances are properly unlinked at snd_timer_stop() and snd_timer_close(). Last but not least, remove the superfluous call of _snd_timer_stop() at removing slave links. This is a noop, and calling it may confuse readers wrt locking. Further cleanup will follow in a later patch. Actually we've got reports of use-after-free by syzkaller fuzzer, and this hopefully fixes these issues. Reported-by: Dmitry Vyukov <dvyukov@google.com> Cc: <stable@vger.kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
static void snd_timer_tasklet(unsigned long arg) { struct snd_timer *timer = (struct snd_timer *) arg; struct snd_timer_instance *ti; struct list_head *p; unsigned long resolution, ticks; unsigned long flags; spin_lock_irqsave(&timer->lock, flags); /* now process all callbacks */ while (!list_empty(&timer->sack_list_head)) { p = timer->sack_list_head.next; /* get first item */ ti = list_entry(p, struct snd_timer_instance, ack_list); /* remove from ack_list and make empty */ list_del_init(p); ticks = ti->pticks; ti->pticks = 0; resolution = ti->resolution; ti->flags |= SNDRV_TIMER_IFLG_CALLBACK; spin_unlock(&timer->lock); if (ti->callback) ti->callback(ti, resolution, ticks); spin_lock(&timer->lock); ti->flags &= ~SNDRV_TIMER_IFLG_CALLBACK; } spin_unlock_irqrestore(&timer->lock, flags); }
static void snd_timer_tasklet(unsigned long arg) { struct snd_timer *timer = (struct snd_timer *) arg; struct snd_timer_instance *ti; struct list_head *p; unsigned long resolution, ticks; unsigned long flags; spin_lock_irqsave(&timer->lock, flags); /* now process all callbacks */ while (!list_empty(&timer->sack_list_head)) { p = timer->sack_list_head.next; /* get first item */ ti = list_entry(p, struct snd_timer_instance, ack_list); /* remove from ack_list and make empty */ list_del_init(p); ticks = ti->pticks; ti->pticks = 0; resolution = ti->resolution; ti->flags |= SNDRV_TIMER_IFLG_CALLBACK; spin_unlock(&timer->lock); if (ti->callback) ti->callback(ti, resolution, ticks); spin_lock(&timer->lock); ti->flags &= ~SNDRV_TIMER_IFLG_CALLBACK; } spin_unlock_irqrestore(&timer->lock, flags); }
C
linux
0
CVE-2015-1271
https://www.cvedetails.com/cve/CVE-2015-1271/
CWE-119
https://github.com/chromium/chromium/commit/74fce5949bdf05a92c2bc0bd98e6e3e977c55376
74fce5949bdf05a92c2bc0bd98e6e3e977c55376
Fixed volume slider element event handling MediaControlVolumeSliderElement::defaultEventHandler has making redundant calls to setVolume() & setMuted() on mouse activity. E.g. if a mouse click changed the slider position, the above calls were made 4 times, once for each of these events: mousedown, input, mouseup, DOMActive, click. This crack got exposed when PointerEvents are enabled by default on M55, adding pointermove, pointerdown & pointerup to the list. This CL fixes the code to trigger the calls to setVolume() & setMuted() only when the slider position is changed. Also added pointer events to certain lists of mouse events in the code. BUG=677900 Review-Url: https://codereview.chromium.org/2622273003 Cr-Commit-Position: refs/heads/master@{#446032}
const AtomicString& MediaControlCastButtonElement::shadowPseudoId() const { DEFINE_STATIC_LOCAL(AtomicString, id_nonOverlay, ("-internal-media-controls-cast-button")); DEFINE_STATIC_LOCAL(AtomicString, id_overlay, ("-internal-media-controls-overlay-cast-button")); return m_isOverlayButton ? id_overlay : id_nonOverlay; }
const AtomicString& MediaControlCastButtonElement::shadowPseudoId() const { DEFINE_STATIC_LOCAL(AtomicString, id_nonOverlay, ("-internal-media-controls-cast-button")); DEFINE_STATIC_LOCAL(AtomicString, id_overlay, ("-internal-media-controls-overlay-cast-button")); return m_isOverlayButton ? id_overlay : id_nonOverlay; }
C
Chrome
0
CVE-2016-3839
https://www.cvedetails.com/cve/CVE-2016-3839/
CWE-284
https://android.googlesource.com/platform/system/bt/+/472271b153c5dc53c28beac55480a8d8434b2d5c
472271b153c5dc53c28beac55480a8d8434b2d5c
DO NOT MERGE Fix potential DoS caused by delivering signal to BT process Bug: 28885210 Change-Id: I63866d894bfca47464d6e42e3fb0357c4f94d360 Conflicts: btif/co/bta_hh_co.c btif/src/btif_core.c Merge conflict resolution of ag/1161415 (referencing ag/1164670) - Directly into mnc-mr2-release
reactor_t *reactor_new(void) { reactor_t *ret = (reactor_t *)osi_calloc(sizeof(reactor_t)); if (!ret) return NULL; ret->epoll_fd = INVALID_FD; ret->event_fd = INVALID_FD; ret->epoll_fd = epoll_create(MAX_EVENTS); if (ret->epoll_fd == INVALID_FD) { LOG_ERROR("%s unable to create epoll instance: %s", __func__, strerror(errno)); goto error; } ret->event_fd = eventfd(0, 0); if (ret->event_fd == INVALID_FD) { LOG_ERROR("%s unable to create eventfd: %s", __func__, strerror(errno)); goto error; } pthread_mutex_init(&ret->list_lock, NULL); ret->invalidation_list = list_new(NULL); if (!ret->invalidation_list) { LOG_ERROR("%s unable to allocate object invalidation list.", __func__); goto error; } struct epoll_event event; memset(&event, 0, sizeof(event)); event.events = EPOLLIN; event.data.ptr = NULL; if (epoll_ctl(ret->epoll_fd, EPOLL_CTL_ADD, ret->event_fd, &event) == -1) { LOG_ERROR("%s unable to register eventfd with epoll set: %s", __func__, strerror(errno)); goto error; } return ret; error:; reactor_free(ret); return NULL; }
reactor_t *reactor_new(void) { reactor_t *ret = (reactor_t *)osi_calloc(sizeof(reactor_t)); if (!ret) return NULL; ret->epoll_fd = INVALID_FD; ret->event_fd = INVALID_FD; ret->epoll_fd = epoll_create(MAX_EVENTS); if (ret->epoll_fd == INVALID_FD) { LOG_ERROR("%s unable to create epoll instance: %s", __func__, strerror(errno)); goto error; } ret->event_fd = eventfd(0, 0); if (ret->event_fd == INVALID_FD) { LOG_ERROR("%s unable to create eventfd: %s", __func__, strerror(errno)); goto error; } pthread_mutex_init(&ret->list_lock, NULL); ret->invalidation_list = list_new(NULL); if (!ret->invalidation_list) { LOG_ERROR("%s unable to allocate object invalidation list.", __func__); goto error; } struct epoll_event event; memset(&event, 0, sizeof(event)); event.events = EPOLLIN; event.data.ptr = NULL; if (epoll_ctl(ret->epoll_fd, EPOLL_CTL_ADD, ret->event_fd, &event) == -1) { LOG_ERROR("%s unable to register eventfd with epoll set: %s", __func__, strerror(errno)); goto error; } return ret; error:; reactor_free(ret); return NULL; }
C
Android
0
CVE-2014-9665
https://www.cvedetails.com/cve/CVE-2014-9665/
CWE-119
https://git.savannah.gnu.org/cgit/freetype/freetype2.git/commit/?id=b3500af717010137046ec4076d1e1c0641e33727
b3500af717010137046ec4076d1e1c0641e33727
null
ftc_snode_new( FTC_Node *ftcpsnode, FT_Pointer ftcgquery, FTC_Cache cache ) { FTC_SNode *psnode = (FTC_SNode*)ftcpsnode; FTC_GQuery gquery = (FTC_GQuery)ftcgquery; return FTC_SNode_New( psnode, gquery, cache ); }
ftc_snode_new( FTC_Node *ftcpsnode, FT_Pointer ftcgquery, FTC_Cache cache ) { FTC_SNode *psnode = (FTC_SNode*)ftcpsnode; FTC_GQuery gquery = (FTC_GQuery)ftcgquery; return FTC_SNode_New( psnode, gquery, cache ); }
C
savannah
0
CVE-2016-4998
https://www.cvedetails.com/cve/CVE-2016-4998/
CWE-119
https://github.com/torvalds/linux/commit/6e94e0cfb0887e4013b3b930fa6ab1fe6bb6ba91
6e94e0cfb0887e4013b3b930fa6ab1fe6bb6ba91
netfilter: x_tables: make sure e->next_offset covers remaining blob size Otherwise this function may read data beyond the ruleset blob. Signed-off-by: Florian Westphal <fw@strlen.de> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
ip_checkentry(const struct ipt_ip *ip) { if (ip->flags & ~IPT_F_MASK) { duprintf("Unknown flag bits set: %08X\n", ip->flags & ~IPT_F_MASK); return false; } if (ip->invflags & ~IPT_INV_MASK) { duprintf("Unknown invflag bits set: %08X\n", ip->invflags & ~IPT_INV_MASK); return false; } return true; }
ip_checkentry(const struct ipt_ip *ip) { if (ip->flags & ~IPT_F_MASK) { duprintf("Unknown flag bits set: %08X\n", ip->flags & ~IPT_F_MASK); return false; } if (ip->invflags & ~IPT_INV_MASK) { duprintf("Unknown invflag bits set: %08X\n", ip->invflags & ~IPT_INV_MASK); return false; } return true; }
C
linux
0
CVE-2011-2840
https://www.cvedetails.com/cve/CVE-2011-2840/
CWE-20
https://github.com/chromium/chromium/commit/2db5a2048dfcacfe5ad4311c2b1e435c4c67febc
2db5a2048dfcacfe5ad4311c2b1e435c4c67febc
chromeos: fix bug where "aw snap" page replaces first tab if it was a NTP when closing window with > 1 tab. BUG=chromium-os:12088 TEST=verify bug per bug report. Review URL: http://codereview.chromium.org/6882058 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@83031 0039d316-1c4b-4281-b951-d872f2087c98
virtual void Observe(NotificationType type, const NotificationSource& source, const NotificationDetails& details) { TabContentsWrapper* tab_to_delete = tab_to_delete_; tab_to_delete_ = NULL; delete tab_to_delete; }
virtual void Observe(NotificationType type, const NotificationSource& source, const NotificationDetails& details) { TabContentsWrapper* tab_to_delete = tab_to_delete_; tab_to_delete_ = NULL; delete tab_to_delete; }
C
Chrome
0
CVE-2017-5130
https://www.cvedetails.com/cve/CVE-2017-5130/
CWE-787
https://github.com/chromium/chromium/commit/ce1446c00f0fd8f5a3b00727421be2124cb7370f
ce1446c00f0fd8f5a3b00727421be2124cb7370f
Roll libxml to 3939178e4cb797417ff033b1e04ab4b038e224d9 Removes a few patches fixed upstream: https://git.gnome.org/browse/libxml2/commit/?id=e26630548e7d138d2c560844c43820b6767251e3 https://git.gnome.org/browse/libxml2/commit/?id=94691dc884d1a8ada39f073408b4bb92fe7fe882 Stops using the NOXXE flag which was reverted upstream: https://git.gnome.org/browse/libxml2/commit/?id=030b1f7a27c22f9237eddca49ec5e620b6258d7d Changes the patch to uri.c to not add limits.h, which is included upstream. Bug: 722079 Change-Id: I4b8449ed33f95de23c54c2cde99970c2df2781ac Reviewed-on: https://chromium-review.googlesource.com/535233 Reviewed-by: Scott Graham <scottmg@chromium.org> Commit-Queue: Dominic Cooney <dominicc@chromium.org> Cr-Commit-Position: refs/heads/master@{#480755}
bool XmlReader::LoadFile(const std::string& file_path) { const int kParseOptions = XML_PARSE_RECOVER | // recover on errors XML_PARSE_NONET; // forbid network access reader_ = xmlReaderForFile(file_path.c_str(), NULL, kParseOptions); return reader_ != NULL; }
bool XmlReader::LoadFile(const std::string& file_path) { const int kParseOptions = XML_PARSE_RECOVER | // recover on errors XML_PARSE_NONET | // forbid network access XML_PARSE_NOXXE; // no external entities reader_ = xmlReaderForFile(file_path.c_str(), NULL, kParseOptions); return reader_ != NULL; }
C
Chrome
1
CVE-2016-2449
https://www.cvedetails.com/cve/CVE-2016-2449/
CWE-264
https://android.googlesource.com/platform/frameworks/av/+/b04aee833c5cfb6b31b8558350feb14bb1a0f353
b04aee833c5cfb6b31b8558350feb14bb1a0f353
Camera3Device: Validate template ID Validate template ID before creating a default request. Bug: 26866110 Bug: 27568958 Change-Id: Ifda457024f1d5c2b1382f189c1a8d5fda852d30d
status_t Camera3Device::addDummyStreamLocked() { ATRACE_CALL(); status_t res; if (mDummyStreamId != NO_STREAM) { SET_ERR_L("%s: Camera %d: A dummy stream already exists!", __FUNCTION__, mId); return INVALID_OPERATION; } ALOGV("%s: Camera %d: Adding a dummy stream", __FUNCTION__, mId); sp<Camera3OutputStreamInterface> dummyStream = new Camera3DummyStream(mNextStreamId); res = mOutputStreams.add(mNextStreamId, dummyStream); if (res < 0) { SET_ERR_L("Can't add dummy stream to set: %s (%d)", strerror(-res), res); return res; } mDummyStreamId = mNextStreamId; mNextStreamId++; return OK; }
status_t Camera3Device::addDummyStreamLocked() { ATRACE_CALL(); status_t res; if (mDummyStreamId != NO_STREAM) { SET_ERR_L("%s: Camera %d: A dummy stream already exists!", __FUNCTION__, mId); return INVALID_OPERATION; } ALOGV("%s: Camera %d: Adding a dummy stream", __FUNCTION__, mId); sp<Camera3OutputStreamInterface> dummyStream = new Camera3DummyStream(mNextStreamId); res = mOutputStreams.add(mNextStreamId, dummyStream); if (res < 0) { SET_ERR_L("Can't add dummy stream to set: %s (%d)", strerror(-res), res); return res; } mDummyStreamId = mNextStreamId; mNextStreamId++; return OK; }
C
Android
0
CVE-2015-7990
https://www.cvedetails.com/cve/CVE-2015-7990/
CWE-362
https://github.com/torvalds/linux/commit/8c7188b23474cca017b3ef354c4a58456f68303a
8c7188b23474cca017b3ef354c4a58456f68303a
RDS: fix race condition when sending a message on unbound socket Sasha's found a NULL pointer dereference in the RDS connection code when sending a message to an apparently unbound socket. The problem is caused by the code checking if the socket is bound in rds_sendmsg(), which checks the rs_bound_addr field without taking a lock on the socket. This opens a race where rs_bound_addr is temporarily set but where the transport is not in rds_bind(), leading to a NULL pointer dereference when trying to dereference 'trans' in __rds_conn_create(). Vegard wrote a reproducer for this issue, so kindly ask him to share if you're interested. I cannot reproduce the NULL pointer dereference using Vegard's reproducer with this patch, whereas I could without. Complete earlier incomplete fix to CVE-2015-6937: 74e98eb08588 ("RDS: verify the underlying transport exists before creating a connection") Cc: David S. Miller <davem@davemloft.net> Cc: stable@vger.kernel.org Reviewed-by: Vegard Nossum <vegard.nossum@oracle.com> Reviewed-by: Sasha Levin <sasha.levin@oracle.com> Acked-by: Santosh Shilimkar <santosh.shilimkar@oracle.com> Signed-off-by: Quentin Casasnovas <quentin.casasnovas@oracle.com> Signed-off-by: David S. Miller <davem@davemloft.net>
__rds_send_complete(struct rds_sock *rs, struct rds_message *rm, int status) { struct rm_rdma_op *ro; struct rm_atomic_op *ao; ro = &rm->rdma; if (ro->op_active && ro->op_notify && ro->op_notifier) { ro->op_notifier->n_status = status; list_add_tail(&ro->op_notifier->n_list, &rs->rs_notify_queue); ro->op_notifier = NULL; } ao = &rm->atomic; if (ao->op_active && ao->op_notify && ao->op_notifier) { ao->op_notifier->n_status = status; list_add_tail(&ao->op_notifier->n_list, &rs->rs_notify_queue); ao->op_notifier = NULL; } /* No need to wake the app - caller does this */ }
__rds_send_complete(struct rds_sock *rs, struct rds_message *rm, int status) { struct rm_rdma_op *ro; struct rm_atomic_op *ao; ro = &rm->rdma; if (ro->op_active && ro->op_notify && ro->op_notifier) { ro->op_notifier->n_status = status; list_add_tail(&ro->op_notifier->n_list, &rs->rs_notify_queue); ro->op_notifier = NULL; } ao = &rm->atomic; if (ao->op_active && ao->op_notify && ao->op_notifier) { ao->op_notifier->n_status = status; list_add_tail(&ao->op_notifier->n_list, &rs->rs_notify_queue); ao->op_notifier = NULL; } /* No need to wake the app - caller does this */ }
C
linux
0
CVE-2014-5472
https://www.cvedetails.com/cve/CVE-2014-5472/
CWE-20
https://github.com/torvalds/linux/commit/410dd3cf4c9b36f27ed4542ee18b1af5e68645a4
410dd3cf4c9b36f27ed4542ee18b1af5e68645a4
isofs: Fix unbounded recursion when processing relocated directories We did not check relocated directory in any way when processing Rock Ridge 'CL' tag. Thus a corrupted isofs image can possibly have a CL entry pointing to another CL entry leading to possibly unbounded recursion in kernel code and thus stack overflow or deadlocks (if there is a loop created from CL entries). Fix the problem by not allowing CL entry to point to a directory entry with CL entry (such use makes no good sense anyway) and by checking whether CL entry doesn't point to itself. CC: stable@vger.kernel.org Reported-by: Chris Evans <cevans@google.com> Signed-off-by: Jan Kara <jack@suse.cz>
isofs_dentry_cmp(const struct dentry *parent, const struct dentry *dentry, unsigned int len, const char *str, const struct qstr *name) { return isofs_dentry_cmp_common(len, str, name, 0, 0); }
isofs_dentry_cmp(const struct dentry *parent, const struct dentry *dentry, unsigned int len, const char *str, const struct qstr *name) { return isofs_dentry_cmp_common(len, str, name, 0, 0); }
C
linux
0
CVE-2013-2916
https://www.cvedetails.com/cve/CVE-2013-2916/
null
https://github.com/chromium/chromium/commit/47a054e9ad826421b789097d82b44c102ab6ac97
47a054e9ad826421b789097d82b44c102ab6ac97
Don't wait to notify client of spoof attempt if a modal dialog is created. BUG=281256 TEST=See bug for repro steps. Review URL: https://chromiumcodereview.appspot.com/23620020 git-svn-id: svn://svn.chromium.org/blink/trunk@157196 bbb929c8-8fbe-4397-9dbb-9b2b20218538
void FrameLoader::updateForSameDocumentNavigation(const KURL& newURL, SameDocumentNavigationSource sameDocumentNavigationSource, PassRefPtr<SerializedScriptValue> data, const String& title, UpdateBackForwardListPolicy updateBackForwardList) { KURL oldURL = m_frame->document()->url(); m_frame->document()->setURL(newURL); setOutgoingReferrer(newURL); documentLoader()->replaceRequestURLForSameDocumentNavigation(newURL); if (updateBackForwardList == UpdateBackForwardList) history()->updateBackForwardListForFragmentScroll(); if (sameDocumentNavigationSource == SameDocumentNavigationDefault) history()->updateForSameDocumentNavigation(); else if (sameDocumentNavigationSource == SameDocumentNavigationPushState) history()->pushState(data, title, newURL.string()); else if (sameDocumentNavigationSource == SameDocumentNavigationReplaceState) history()->replaceState(data, title, newURL.string()); else ASSERT_NOT_REACHED(); if (m_frame->document()->loadEventFinished()) m_client->postProgressStartedNotification(); m_documentLoader->clearRedirectChain(); if (m_documentLoader->isClientRedirect()) m_documentLoader->appendRedirect(oldURL); m_documentLoader->appendRedirect(newURL); m_client->dispatchDidNavigateWithinPage(); m_client->dispatchDidReceiveTitle(m_frame->document()->title()); if (m_frame->document()->loadEventFinished()) m_client->postProgressFinishedNotification(); }
void FrameLoader::updateForSameDocumentNavigation(const KURL& newURL, SameDocumentNavigationSource sameDocumentNavigationSource, PassRefPtr<SerializedScriptValue> data, const String& title, UpdateBackForwardListPolicy updateBackForwardList) { KURL oldURL = m_frame->document()->url(); m_frame->document()->setURL(newURL); setOutgoingReferrer(newURL); documentLoader()->replaceRequestURLForSameDocumentNavigation(newURL); if (updateBackForwardList == UpdateBackForwardList) history()->updateBackForwardListForFragmentScroll(); if (sameDocumentNavigationSource == SameDocumentNavigationDefault) history()->updateForSameDocumentNavigation(); else if (sameDocumentNavigationSource == SameDocumentNavigationPushState) history()->pushState(data, title, newURL.string()); else if (sameDocumentNavigationSource == SameDocumentNavigationReplaceState) history()->replaceState(data, title, newURL.string()); else ASSERT_NOT_REACHED(); if (m_frame->document()->loadEventFinished()) m_client->postProgressStartedNotification(); m_documentLoader->clearRedirectChain(); if (m_documentLoader->isClientRedirect()) m_documentLoader->appendRedirect(oldURL); m_documentLoader->appendRedirect(newURL); m_client->dispatchDidNavigateWithinPage(); m_client->dispatchDidReceiveTitle(m_frame->document()->title()); if (m_frame->document()->loadEventFinished()) m_client->postProgressFinishedNotification(); }
C
Chrome
0
null
null
null
https://github.com/chromium/chromium/commit/0c4225d1e9b23e7071bbf47ada310a9a7e5661a3
0c4225d1e9b23e7071bbf47ada310a9a7e5661a3
2011-07-01 Oliver Hunt <oliver@apple.com> IE Web Workers demo crashes in JSC::SlotVisitor::visitChildren() https://bugs.webkit.org/show_bug.cgi?id=63732 Reviewed by Gavin Barraclough. Initialise the memory at the head of the new storage so that GC is safe if triggered by reportExtraMemoryCost. * runtime/JSArray.cpp: (JSC::JSArray::increaseVectorPrefixLength): git-svn-id: svn://svn.chromium.org/blink/trunk@90282 bbb929c8-8fbe-4397-9dbb-9b2b20218538
static int compareNumbersForQSort(const void* a, const void* b) { double da = static_cast<const JSValue*>(a)->uncheckedGetNumber(); double db = static_cast<const JSValue*>(b)->uncheckedGetNumber(); return (da > db) - (da < db); }
static int compareNumbersForQSort(const void* a, const void* b) { double da = static_cast<const JSValue*>(a)->uncheckedGetNumber(); double db = static_cast<const JSValue*>(b)->uncheckedGetNumber(); return (da > db) - (da < db); }
C
Chrome
0
CVE-2012-2875
https://www.cvedetails.com/cve/CVE-2012-2875/
null
https://github.com/chromium/chromium/commit/d345af9ed62ee5f431be327967f41c3cc3fe936a
d345af9ed62ee5f431be327967f41c3cc3fe936a
[BlackBerry] Adapt to new BlackBerry::Platform::TouchPoint API https://bugs.webkit.org/show_bug.cgi?id=105143 RIM PR 171941 Reviewed by Rob Buis. Internally reviewed by George Staikos. Source/WebCore: TouchPoint instances now provide document coordinates for the viewport and content position of the touch event. The pixel coordinates stored in the TouchPoint should no longer be needed in WebKit. Also adapt to new method names and encapsulation of TouchPoint data members. No change in behavior, no new tests. * platform/blackberry/PlatformTouchPointBlackBerry.cpp: (WebCore::PlatformTouchPoint::PlatformTouchPoint): Source/WebKit/blackberry: TouchPoint instances now provide document coordinates for the viewport and content position of the touch event. The pixel coordinates stored in the TouchPoint should no longer be needed in WebKit. One exception is when passing events to a full screen plugin. Also adapt to new method names and encapsulation of TouchPoint data members. * Api/WebPage.cpp: (BlackBerry::WebKit::WebPage::touchEvent): (BlackBerry::WebKit::WebPage::touchPointAsMouseEvent): (BlackBerry::WebKit::WebPagePrivate::dispatchTouchEventToFullScreenPlugin): (BlackBerry::WebKit::WebPagePrivate::dispatchTouchPointAsMouseEventToFullScreenPlugin): * WebKitSupport/InputHandler.cpp: (BlackBerry::WebKit::InputHandler::shouldRequestSpellCheckingOptionsForPoint): * WebKitSupport/InputHandler.h: (InputHandler): * WebKitSupport/TouchEventHandler.cpp: (BlackBerry::WebKit::TouchEventHandler::doFatFingers): (BlackBerry::WebKit::TouchEventHandler::handleTouchPoint): * WebKitSupport/TouchEventHandler.h: (TouchEventHandler): Tools: Adapt to new method names and encapsulation of TouchPoint data members. * DumpRenderTree/blackberry/EventSender.cpp: (addTouchPointCallback): (updateTouchPointCallback): (touchEndCallback): (releaseTouchPointCallback): (sendTouchEvent): git-svn-id: svn://svn.chromium.org/blink/trunk@137880 bbb929c8-8fbe-4397-9dbb-9b2b20218538
static JSValueRef updateTouchPointCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) { if (argumentCount < 3) return JSValueMakeUndefined(context); int index = static_cast<int>(JSValueToNumber(context, arguments[0], exception)); ASSERT(!exception || !*exception); int x = static_cast<int>(JSValueToNumber(context, arguments[1], exception)); ASSERT(!exception || !*exception); int y = static_cast<int>(JSValueToNumber(context, arguments[2], exception)); ASSERT(!exception || !*exception); if (index < 0 || index >= (int)touches.size()) return JSValueMakeUndefined(context); BlackBerry::Platform::TouchPoint& touch = touches[index]; // pixelViewportPosition is unused in the WebKit layer IntPoint pos(x, y); // Unfortunately we don't know the scroll position at this point, so use pos for the content position too. // This assumes scroll position is 0,0 touch.populateDocumentPosition(pos, pos); touch.setScreenPosition(pos); touch.updateState(BlackBerry::Platform::TouchPoint::TouchMoved); return JSValueMakeUndefined(context); }
static JSValueRef updateTouchPointCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) { if (argumentCount < 3) return JSValueMakeUndefined(context); int index = static_cast<int>(JSValueToNumber(context, arguments[0], exception)); ASSERT(!exception || !*exception); int x = static_cast<int>(JSValueToNumber(context, arguments[1], exception)); ASSERT(!exception || !*exception); int y = static_cast<int>(JSValueToNumber(context, arguments[2], exception)); ASSERT(!exception || !*exception); if (index < 0 || index >= (int)touches.size()) return JSValueMakeUndefined(context); BlackBerry::Platform::TouchPoint& touch = touches[index]; IntPoint pos(x, y); touch.m_pos = pos; touch.m_screenPos = pos; touch.m_state = BlackBerry::Platform::TouchPoint::TouchMoved; return JSValueMakeUndefined(context); }
C
Chrome
1
CVE-2016-1675
https://www.cvedetails.com/cve/CVE-2016-1675/
CWE-284
https://github.com/chromium/chromium/commit/b276d0570cc816bfe25b431f2ee9bc265a6ad478
b276d0570cc816bfe25b431f2ee9bc265a6ad478
Fix one implicit 64-bit -> 32-bit implicit conversion in a PPAPI test. ../../ppapi/tests/test_url_loader.cc:877:11: warning: implicit conversion loses integer precision: 'int64_t' (aka 'long long') to 'int32_t' (aka 'int') [-Wshorten-64-to-32] total_bytes_to_be_received); ^~~~~~~~~~~~~~~~~~~~~~~~~~ BUG=879657 Change-Id: I152f456368131fe7a2891ff0c97bf83f26ef0906 Reviewed-on: https://chromium-review.googlesource.com/c/1220173 Commit-Queue: Raymes Khoury <raymes@chromium.org> Reviewed-by: Raymes Khoury <raymes@chromium.org> Cr-Commit-Position: refs/heads/master@{#600182}
std::string TestURLLoader::TestTrustedJavascriptURLRestriction() { pp::URLRequestInfo request(instance_); request.SetURL("javascript:foo = bar"); int32_t rv = OpenTrusted(request, NULL); if (rv == PP_ERROR_NOACCESS) return ReportError( "Trusted Javascript URL request", rv); PASS(); }
std::string TestURLLoader::TestTrustedJavascriptURLRestriction() { pp::URLRequestInfo request(instance_); request.SetURL("javascript:foo = bar"); int32_t rv = OpenTrusted(request, NULL); if (rv == PP_ERROR_NOACCESS) return ReportError( "Trusted Javascript URL request", rv); PASS(); }
C
Chrome
0
CVE-2011-2918
https://www.cvedetails.com/cve/CVE-2011-2918/
CWE-399
https://github.com/torvalds/linux/commit/a8b0ca17b80e92faab46ee7179ba9e99ccb61233
a8b0ca17b80e92faab46ee7179ba9e99ccb61233
perf: Remove the nmi parameter from the swevent and overflow interface The nmi parameter indicated if we could do wakeups from the current context, if not, we would set some state and self-IPI and let the resulting interrupt do the wakeup. For the various event classes: - hardware: nmi=0; PMI is in fact an NMI or we run irq_work_run from the PMI-tail (ARM etc.) - tracepoint: nmi=0; since tracepoint could be from NMI context. - software: nmi=[0,1]; some, like the schedule thing cannot perform wakeups, and hence need 0. As one can see, there is very little nmi=1 usage, and the down-side of not using it is that on some platforms some software events can have a jiffy delay in wakeup (when arch_irq_work_raise isn't implemented). The up-side however is that we can remove the nmi parameter and save a bunch of conditionals in fast paths. Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Michael Cree <mcree@orcon.net.nz> Cc: Will Deacon <will.deacon@arm.com> Cc: Deng-Cheng Zhu <dengcheng.zhu@gmail.com> Cc: Anton Blanchard <anton@samba.org> Cc: Eric B Munson <emunson@mgebm.net> Cc: Heiko Carstens <heiko.carstens@de.ibm.com> Cc: Paul Mundt <lethal@linux-sh.org> Cc: David S. Miller <davem@davemloft.net> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Jason Wessel <jason.wessel@windriver.com> Cc: Don Zickus <dzickus@redhat.com> Link: http://lkml.kernel.org/n/tip-agjev8eu666tvknpb3iaj0fg@git.kernel.org Signed-off-by: Ingo Molnar <mingo@elte.hu>
static int task_clock_event_add(struct perf_event *event, int flags) { if (flags & PERF_EF_START) task_clock_event_start(event, flags); return 0; }
static int task_clock_event_add(struct perf_event *event, int flags) { if (flags & PERF_EF_START) task_clock_event_start(event, flags); return 0; }
C
linux
0
CVE-2011-4930
https://www.cvedetails.com/cve/CVE-2011-4930/
CWE-134
https://htcondor-git.cs.wisc.edu/?p=condor.git;a=commitdiff;h=5e5571d1a431eb3c61977b6dd6ec90186ef79867
5e5571d1a431eb3c61977b6dd6ec90186ef79867
null
LoadCredentialList () { CredentialWrapper * pCred; if (!credentials.IsEmpty()) { credentials.Rewind(); while (credentials.Next(pCred)) { credentials.DeleteCurrent(); delete pCred; } } credentials.Rewind(); classad::ClassAdXMLParser parser; char buff[50000]; priv_state priv = set_root_priv(); FILE * fp = safe_fopen_wrapper(cred_index_file, "r"); if (!fp) { dprintf (D_FULLDEBUG, "Credential database %s does not exist!\n", cred_index_file); set_priv (priv); return TRUE; } while (fgets(buff, 50000, fp)) { if ((buff[0] == '\n') || (buff[0] == '\r')) { continue; } classad::ClassAd * classad = parser.ParseClassAd (buff); int type=0; if ((!classad) || (!classad->EvaluateAttrInt ("Type", type))) { dprintf (D_ALWAYS, "Invalid classad %s\n", buff); set_priv (priv); fclose (fp); return FALSE; } if (type == X509_CREDENTIAL_TYPE) { pCred = new X509CredentialWrapper (*classad); credentials.Append (pCred); } else { dprintf (D_ALWAYS, "Invalid type %d\n",type); } } fclose (fp); set_priv (priv); return TRUE; }
LoadCredentialList () { CredentialWrapper * pCred; if (!credentials.IsEmpty()) { credentials.Rewind(); while (credentials.Next(pCred)) { credentials.DeleteCurrent(); delete pCred; } } credentials.Rewind(); classad::ClassAdXMLParser parser; char buff[50000]; priv_state priv = set_root_priv(); FILE * fp = safe_fopen_wrapper(cred_index_file, "r"); if (!fp) { dprintf (D_FULLDEBUG, "Credential database %s does not exist!\n", cred_index_file); set_priv (priv); return TRUE; } while (fgets(buff, 50000, fp)) { if ((buff[0] == '\n') || (buff[0] == '\r')) { continue; } classad::ClassAd * classad = parser.ParseClassAd (buff); int type=0; if ((!classad) || (!classad->EvaluateAttrInt ("Type", type))) { dprintf (D_ALWAYS, "Invalid classad %s\n", buff); set_priv (priv); fclose (fp); return FALSE; } if (type == X509_CREDENTIAL_TYPE) { pCred = new X509CredentialWrapper (*classad); credentials.Append (pCred); } else { dprintf (D_ALWAYS, "Invalid type %d\n",type); } } fclose (fp); set_priv (priv); return TRUE; }
CPP
htcondor
0
CVE-2013-2908
https://www.cvedetails.com/cve/CVE-2013-2908/
null
https://github.com/chromium/chromium/commit/7edf2c655761e7505950013e62c89e3bd2f7e6dc
7edf2c655761e7505950013e62c89e3bd2f7e6dc
Call didAccessInitialDocument when javascript: URLs are used. BUG=265221 TEST=See bug for repro. Review URL: https://chromiumcodereview.appspot.com/22572004 git-svn-id: svn://svn.chromium.org/blink/trunk@155790 bbb929c8-8fbe-4397-9dbb-9b2b20218538
void ScriptController::bindToWindowObject(Frame* frame, const String& key, NPObject* object) { v8::HandleScope handleScope(m_isolate); v8::Handle<v8::Context> v8Context = ScriptController::mainWorldContext(frame); if (v8Context.IsEmpty()) return; v8::Context::Scope scope(v8Context); v8::Handle<v8::Object> value = createV8ObjectForNPObject(object, 0); v8::Handle<v8::Object> global = v8Context->Global(); global->Set(v8String(key, m_isolate), value); }
void ScriptController::bindToWindowObject(Frame* frame, const String& key, NPObject* object) { v8::HandleScope handleScope(m_isolate); v8::Handle<v8::Context> v8Context = ScriptController::mainWorldContext(frame); if (v8Context.IsEmpty()) return; v8::Context::Scope scope(v8Context); v8::Handle<v8::Object> value = createV8ObjectForNPObject(object, 0); v8::Handle<v8::Object> global = v8Context->Global(); global->Set(v8String(key, m_isolate), value); }
C
Chrome
0
CVE-2017-5112
https://www.cvedetails.com/cve/CVE-2017-5112/
CWE-119
https://github.com/chromium/chromium/commit/f6ac1dba5e36f338a490752a2cbef3339096d9fe
f6ac1dba5e36f338a490752a2cbef3339096d9fe
Reset ES3 pixel pack parameters and PIXEL_PACK_BUFFER binding in DrawingBuffer before ReadPixels() and recover them later. BUG=740603 TEST=new conformance test R=kbr@chromium.org,piman@chromium.org Change-Id: I3ea54c6cc34f34e249f7c8b9f792d93c5e1958f4 Reviewed-on: https://chromium-review.googlesource.com/570840 Reviewed-by: Antoine Labour <piman@chromium.org> Reviewed-by: Kenneth Russell <kbr@chromium.org> Commit-Queue: Zhenyao Mo <zmo@chromium.org> Cr-Commit-Position: refs/heads/master@{#486518}
void WebGLRenderingContextBase::stencilMaskSeparate(GLenum face, GLuint mask) { if (isContextLost()) return; switch (face) { case GL_FRONT_AND_BACK: stencil_mask_ = mask; stencil_mask_back_ = mask; break; case GL_FRONT: stencil_mask_ = mask; break; case GL_BACK: stencil_mask_back_ = mask; break; default: SynthesizeGLError(GL_INVALID_ENUM, "stencilMaskSeparate", "invalid face"); return; } ContextGL()->StencilMaskSeparate(face, mask); }
void WebGLRenderingContextBase::stencilMaskSeparate(GLenum face, GLuint mask) { if (isContextLost()) return; switch (face) { case GL_FRONT_AND_BACK: stencil_mask_ = mask; stencil_mask_back_ = mask; break; case GL_FRONT: stencil_mask_ = mask; break; case GL_BACK: stencil_mask_back_ = mask; break; default: SynthesizeGLError(GL_INVALID_ENUM, "stencilMaskSeparate", "invalid face"); return; } ContextGL()->StencilMaskSeparate(face, mask); }
C
Chrome
0
CVE-2016-6699
https://www.cvedetails.com/cve/CVE-2016-6699/
CWE-119
https://android.googlesource.com/platform/frameworks/av/+/3b1c9f692c4d4b7a683c2b358fc89e831a641b88
3b1c9f692c4d4b7a683c2b358fc89e831a641b88
Fix free-after-use for MediaHTTP fix free-after-use when we reconnect to an HTTP media source. Change-Id: I96da5a79f5382409a545f8b4e22a24523f287464 Tests: compilation and eyeballs Bug: 31373622 (cherry picked from commit dd81e1592ffa77812998b05761eb840b70fed121)
sp<DecryptHandle> MediaHTTP::DrmInitialization(const char* mime) { if (mDrmManagerClient == NULL) { mDrmManagerClient = new DrmManagerClient(); } if (mDrmManagerClient == NULL) { return NULL; } if (mDecryptHandle == NULL) { mDecryptHandle = mDrmManagerClient->openDecryptSession( String8(mLastURI.c_str()), mime); } if (mDecryptHandle == NULL) { delete mDrmManagerClient; mDrmManagerClient = NULL; } return mDecryptHandle; }
sp<DecryptHandle> MediaHTTP::DrmInitialization(const char* mime) { if (mDrmManagerClient == NULL) { mDrmManagerClient = new DrmManagerClient(); } if (mDrmManagerClient == NULL) { return NULL; } if (mDecryptHandle == NULL) { mDecryptHandle = mDrmManagerClient->openDecryptSession( String8(mLastURI.c_str()), mime); } if (mDecryptHandle == NULL) { delete mDrmManagerClient; mDrmManagerClient = NULL; } return mDecryptHandle; }
C
Android
0
CVE-2013-2906
https://www.cvedetails.com/cve/CVE-2013-2906/
CWE-362
https://github.com/chromium/chromium/commit/c4a4dfb26615b5ef5e9dcc730ef43f70ce9202e2
c4a4dfb26615b5ef5e9dcc730ef43f70ce9202e2
Suspend shared timers while blockingly closing databases BUG=388771 R=michaeln@chromium.org Review URL: https://codereview.chromium.org/409863002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@284785 0039d316-1c4b-4281-b951-d872f2087c98
RenderThreadImpl::GetPeerConnectionDependencyFactory() { return peer_connection_factory_.get(); }
RenderThreadImpl::GetPeerConnectionDependencyFactory() { return peer_connection_factory_.get(); }
C
Chrome
0
CVE-2016-1583
https://www.cvedetails.com/cve/CVE-2016-1583/
CWE-119
https://github.com/torvalds/linux/commit/f5364c150aa645b3d7daa21b5c0b9feaa1c9cd6d
f5364c150aa645b3d7daa21b5c0b9feaa1c9cd6d
Merge branch 'stacking-fixes' (vfs stacking fixes from Jann) Merge filesystem stacking fixes from Jann Horn. * emailed patches from Jann Horn <jannh@google.com>: sched: panic on corrupted stack end ecryptfs: forbid opening files without mmap handler proc: prevent stacking filesystems on top
asmlinkage __visible void __sched notrace preempt_schedule(void) { /* * If there is a non-zero preempt_count or interrupts are disabled, * we do not want to preempt the current task. Just return.. */ if (likely(!preemptible())) return; preempt_schedule_common(); }
asmlinkage __visible void __sched notrace preempt_schedule(void) { /* * If there is a non-zero preempt_count or interrupts are disabled, * we do not want to preempt the current task. Just return.. */ if (likely(!preemptible())) return; preempt_schedule_common(); }
C
linux
0
CVE-2016-7969
https://www.cvedetails.com/cve/CVE-2016-7969/
CWE-125
https://github.com/libass/libass/pull/240/commits/b72b283b936a600c730e00875d7d067bded3fc26
b72b283b936a600c730e00875d7d067bded3fc26
Fix line wrapping mode 0/3 bugs This fixes two separate bugs: a) Don't move a linebreak into the first symbol. This results in a empty line at the front, which does not help to equalize line lengths at all. b) When moving a linebreak into a symbol that already is a break, the number of lines must be decremented. Otherwise, uninitialized memory is possibly used for later layout operations. Found by fuzzer test case id:000085,sig:11,src:003377+003350,op:splice,rep:8.
fix_glyph_scaling(ASS_Renderer *priv, GlyphInfo *glyph) { double ft_size; if (priv->settings.hinting == ASS_HINTING_NONE) { ft_size = 256.0; } else { ft_size = glyph->scale_y * glyph->font_size; } glyph->scale_x = glyph->scale_x * glyph->font_size / ft_size; glyph->scale_y = glyph->scale_y * glyph->font_size / ft_size; glyph->font_size = ft_size; }
fix_glyph_scaling(ASS_Renderer *priv, GlyphInfo *glyph) { double ft_size; if (priv->settings.hinting == ASS_HINTING_NONE) { ft_size = 256.0; } else { ft_size = glyph->scale_y * glyph->font_size; } glyph->scale_x = glyph->scale_x * glyph->font_size / ft_size; glyph->scale_y = glyph->scale_y * glyph->font_size / ft_size; glyph->font_size = ft_size; }
C
libass
0
CVE-2011-2517
https://www.cvedetails.com/cve/CVE-2011-2517/
CWE-119
https://github.com/torvalds/linux/commit/208c72f4fe44fe09577e7975ba0e7fa0278f3d03
208c72f4fe44fe09577e7975ba0e7fa0278f3d03
nl80211: fix check for valid SSID size in scan operations In both trigger_scan and sched_scan operations, we were checking for the SSID length before assigning the value correctly. Since the memory was just kzalloc'ed, the check was always failing and SSID with over 32 characters were allowed to go through. This was causing a buffer overflow when copying the actual SSID to the proper place. This bug has been there since 2.6.29-rc4. Cc: stable@kernel.org Signed-off-by: Luciano Coelho <coelho@ti.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
void nl80211_exit(void) { netlink_unregister_notifier(&nl80211_netlink_notifier); genl_unregister_family(&nl80211_fam); }
void nl80211_exit(void) { netlink_unregister_notifier(&nl80211_netlink_notifier); genl_unregister_family(&nl80211_fam); }
C
linux
0
CVE-2016-3751
https://www.cvedetails.com/cve/CVE-2016-3751/
null
https://android.googlesource.com/platform/external/libpng/+/9d4853418ab2f754c2b63e091c29c5529b8b86ca
9d4853418ab2f754c2b63e091c29c5529b8b86ca
DO NOT MERGE Update libpng to 1.6.20 BUG:23265085 Change-Id: I85199805636d771f3597b691b63bc0bf46084833 (cherry picked from commit bbe98b40cda082024b669fa508931042eed18f82)
find_insert(png_const_charp what, png_charp param) { png_uint_32 chunk = 0; png_charp parameter_list[1024]; int i, nparams; /* Assemble the chunk name */ for (i=0; i<4; ++i) { char ch = what[i]; if ((ch >= 65 && ch <= 90) || (ch >= 97 && ch <= 122)) chunk = (chunk << 8) + what[i]; else break; } if (i < 4 || what[4] != 0) { fprintf(stderr, "makepng --insert \"%s\": invalid chunk name\n", what); exit(1); } /* Assemble the parameter list. */ nparams = find_parameters(what, param, parameter_list, 1024); # define CHUNK(a,b,c,d) (((a)<<24)+((b)<<16)+((c)<<8)+(d)) switch (chunk) { case CHUNK(105,67,67,80): /* iCCP */ if (nparams == 2) return make_insert(what, insert_iCCP, nparams, parameter_list); break; case CHUNK(116,69,88,116): /* tEXt */ if (nparams == 2) return make_insert(what, insert_tEXt, nparams, parameter_list); break; case CHUNK(122,84,88,116): /* zTXt */ if (nparams == 2) return make_insert(what, insert_zTXt, nparams, parameter_list); break; case CHUNK(105,84,88,116): /* iTXt */ if (nparams == 4) return make_insert(what, insert_iTXt, nparams, parameter_list); break; case CHUNK(104,73,83,84): /* hIST */ if (nparams <= 256) return make_insert(what, insert_hIST, nparams, parameter_list); break; case CHUNK(115,66,73,84): /* sBIT */ if (nparams <= 4) return make_insert(what, insert_sBIT, nparams, parameter_list); break; #if 0 case CHUNK(115,80,76,84): /* sPLT */ return make_insert(what, insert_sPLT, nparams, parameter_list); #endif default: fprintf(stderr, "makepng --insert \"%s\": unrecognized chunk name\n", what); exit(1); } bad_parameter_count(what, nparams); return NULL; }
find_insert(png_const_charp what, png_charp param) { png_uint_32 chunk = 0; png_charp parameter_list[1024]; int i, nparams; /* Assemble the chunk name */ for (i=0; i<4; ++i) { char ch = what[i]; if ((ch >= 65 && ch <= 90) || (ch >= 97 && ch <= 122)) chunk = (chunk << 8) + what[i]; else break; } if (i < 4 || what[4] != 0) { fprintf(stderr, "makepng --insert \"%s\": invalid chunk name\n", what); exit(1); } /* Assemble the parameter list. */ nparams = find_parameters(what, param, parameter_list, 1024); # define CHUNK(a,b,c,d) (((a)<<24)+((b)<<16)+((c)<<8)+(d)) switch (chunk) { case CHUNK(105,67,67,80): /* iCCP */ if (nparams == 2) return make_insert(what, insert_iCCP, nparams, parameter_list); break; case CHUNK(116,69,88,116): /* tEXt */ if (nparams == 2) return make_insert(what, insert_tEXt, nparams, parameter_list); break; case CHUNK(122,84,88,116): /* zTXt */ if (nparams == 2) return make_insert(what, insert_zTXt, nparams, parameter_list); break; case CHUNK(105,84,88,116): /* iTXt */ if (nparams == 4) return make_insert(what, insert_iTXt, nparams, parameter_list); break; case CHUNK(104,73,83,84): /* hIST */ if (nparams <= 256) return make_insert(what, insert_hIST, nparams, parameter_list); break; #if 0 case CHUNK(115,80,76,84): /* sPLT */ return make_insert(what, insert_sPLT, nparams, parameter_list); #endif default: fprintf(stderr, "makepng --insert \"%s\": unrecognized chunk name\n", what); exit(1); } bad_parameter_count(what, nparams); return NULL; }
C
Android
1
CVE-2016-1696
https://www.cvedetails.com/cve/CVE-2016-1696/
CWE-284
https://github.com/chromium/chromium/commit/c0569cc04741cccf6548c2169fcc1609d958523f
c0569cc04741cccf6548c2169fcc1609d958523f
[Extensions] Expand bindings access checks BUG=601149 BUG=601073 Review URL: https://codereview.chromium.org/1866103002 Cr-Commit-Position: refs/heads/master@{#387710}
void WebstoreBindings::Install( const v8::FunctionCallbackInfo<v8::Value>& args) { content::RenderFrame* render_frame = context()->GetRenderFrame(); if (!render_frame) return; int listener_mask = 0; CHECK(args[0]->IsBoolean()); if (args[0]->BooleanValue()) listener_mask |= api::webstore::INSTALL_STAGE_LISTENER; CHECK(args[1]->IsBoolean()); if (args[1]->BooleanValue()) listener_mask |= api::webstore::DOWNLOAD_PROGRESS_LISTENER; std::string preferred_store_link_url; if (!args[2]->IsUndefined()) { CHECK(args[2]->IsString()); preferred_store_link_url = std::string(*v8::String::Utf8Value(args[2])); } std::string webstore_item_id; std::string error; blink::WebLocalFrame* frame = context()->web_frame(); if (!GetWebstoreItemIdFromFrame( frame, preferred_store_link_url, &webstore_item_id, &error)) { args.GetIsolate()->ThrowException( v8::String::NewFromUtf8(args.GetIsolate(), error.c_str())); return; } int install_id = g_next_install_id++; Send(new ExtensionHostMsg_InlineWebstoreInstall( render_frame->GetRoutingID(), install_id, GetRoutingID(), webstore_item_id, frame->document().url(), listener_mask)); args.GetReturnValue().Set(static_cast<int32_t>(install_id)); }
void WebstoreBindings::Install( const v8::FunctionCallbackInfo<v8::Value>& args) { content::RenderFrame* render_frame = context()->GetRenderFrame(); if (!render_frame) return; int listener_mask = 0; CHECK(args[0]->IsBoolean()); if (args[0]->BooleanValue()) listener_mask |= api::webstore::INSTALL_STAGE_LISTENER; CHECK(args[1]->IsBoolean()); if (args[1]->BooleanValue()) listener_mask |= api::webstore::DOWNLOAD_PROGRESS_LISTENER; std::string preferred_store_link_url; if (!args[2]->IsUndefined()) { CHECK(args[2]->IsString()); preferred_store_link_url = std::string(*v8::String::Utf8Value(args[2])); } std::string webstore_item_id; std::string error; blink::WebLocalFrame* frame = context()->web_frame(); if (!GetWebstoreItemIdFromFrame( frame, preferred_store_link_url, &webstore_item_id, &error)) { args.GetIsolate()->ThrowException( v8::String::NewFromUtf8(args.GetIsolate(), error.c_str())); return; } int install_id = g_next_install_id++; Send(new ExtensionHostMsg_InlineWebstoreInstall( render_frame->GetRoutingID(), install_id, GetRoutingID(), webstore_item_id, frame->document().url(), listener_mask)); args.GetReturnValue().Set(static_cast<int32_t>(install_id)); }
C
Chrome
0
CVE-2015-3636
https://www.cvedetails.com/cve/CVE-2015-3636/
null
https://github.com/torvalds/linux/commit/a134f083e79fb4c3d0a925691e732c56911b4326
a134f083e79fb4c3d0a925691e732c56911b4326
ipv4: Missing sk_nulls_node_init() in ping_unhash(). If we don't do that, then the poison value is left in the ->pprev backlink. This can cause crashes if we do a disconnect, followed by a connect(). Tested-by: Linus Torvalds <torvalds@linux-foundation.org> Reported-by: Wen Xu <hotdog3645@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
bool ping_rcv(struct sk_buff *skb) { struct sock *sk; struct net *net = dev_net(skb->dev); struct icmphdr *icmph = icmp_hdr(skb); /* We assume the packet has already been checked by icmp_rcv */ pr_debug("ping_rcv(skb=%p,id=%04x,seq=%04x)\n", skb, ntohs(icmph->un.echo.id), ntohs(icmph->un.echo.sequence)); /* Push ICMP header back */ skb_push(skb, skb->data - (u8 *)icmph); sk = ping_lookup(net, skb, ntohs(icmph->un.echo.id)); if (sk) { struct sk_buff *skb2 = skb_clone(skb, GFP_ATOMIC); pr_debug("rcv on socket %p\n", sk); if (skb2) ping_queue_rcv_skb(sk, skb2); sock_put(sk); return true; } pr_debug("no socket, dropping\n"); return false; }
bool ping_rcv(struct sk_buff *skb) { struct sock *sk; struct net *net = dev_net(skb->dev); struct icmphdr *icmph = icmp_hdr(skb); /* We assume the packet has already been checked by icmp_rcv */ pr_debug("ping_rcv(skb=%p,id=%04x,seq=%04x)\n", skb, ntohs(icmph->un.echo.id), ntohs(icmph->un.echo.sequence)); /* Push ICMP header back */ skb_push(skb, skb->data - (u8 *)icmph); sk = ping_lookup(net, skb, ntohs(icmph->un.echo.id)); if (sk) { struct sk_buff *skb2 = skb_clone(skb, GFP_ATOMIC); pr_debug("rcv on socket %p\n", sk); if (skb2) ping_queue_rcv_skb(sk, skb2); sock_put(sk); return true; } pr_debug("no socket, dropping\n"); return false; }
C
linux
0
CVE-2012-0045
https://www.cvedetails.com/cve/CVE-2012-0045/
null
https://github.com/torvalds/linux/commit/c2226fc9e87ba3da060e47333657cd6616652b84
c2226fc9e87ba3da060e47333657cd6616652b84
KVM: x86: fix missing checks in syscall emulation On hosts without this patch, 32bit guests will crash (and 64bit guests may behave in a wrong way) for example by simply executing following nasm-demo-application: [bits 32] global _start SECTION .text _start: syscall (I tested it with winxp and linux - both always crashed) Disassembly of section .text: 00000000 <_start>: 0: 0f 05 syscall The reason seems a missing "invalid opcode"-trap (int6) for the syscall opcode "0f05", which is not available on Intel CPUs within non-longmodes, as also on some AMD CPUs within legacy-mode. (depending on CPU vendor, MSR_EFER and cpuid) Because previous mentioned OSs may not engage corresponding syscall target-registers (STAR, LSTAR, CSTAR), they remain NULL and (non trapping) syscalls are leading to multiple faults and finally crashs. Depending on the architecture (AMD or Intel) pretended by guests, various checks according to vendor's documentation are implemented to overcome the current issue and behave like the CPUs physical counterparts. [mtosatti: cleanup/beautify code] Signed-off-by: Stephan Baerwolf <stephan.baerwolf@tu-ilmenau.de> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
static void save_state_to_tss32(struct x86_emulate_ctxt *ctxt, struct tss_segment_32 *tss) { tss->cr3 = ctxt->ops->get_cr(ctxt, 3); tss->eip = ctxt->_eip; tss->eflags = ctxt->eflags; tss->eax = ctxt->regs[VCPU_REGS_RAX]; tss->ecx = ctxt->regs[VCPU_REGS_RCX]; tss->edx = ctxt->regs[VCPU_REGS_RDX]; tss->ebx = ctxt->regs[VCPU_REGS_RBX]; tss->esp = ctxt->regs[VCPU_REGS_RSP]; tss->ebp = ctxt->regs[VCPU_REGS_RBP]; tss->esi = ctxt->regs[VCPU_REGS_RSI]; tss->edi = ctxt->regs[VCPU_REGS_RDI]; tss->es = get_segment_selector(ctxt, VCPU_SREG_ES); tss->cs = get_segment_selector(ctxt, VCPU_SREG_CS); tss->ss = get_segment_selector(ctxt, VCPU_SREG_SS); tss->ds = get_segment_selector(ctxt, VCPU_SREG_DS); tss->fs = get_segment_selector(ctxt, VCPU_SREG_FS); tss->gs = get_segment_selector(ctxt, VCPU_SREG_GS); tss->ldt_selector = get_segment_selector(ctxt, VCPU_SREG_LDTR); }
static void save_state_to_tss32(struct x86_emulate_ctxt *ctxt, struct tss_segment_32 *tss) { tss->cr3 = ctxt->ops->get_cr(ctxt, 3); tss->eip = ctxt->_eip; tss->eflags = ctxt->eflags; tss->eax = ctxt->regs[VCPU_REGS_RAX]; tss->ecx = ctxt->regs[VCPU_REGS_RCX]; tss->edx = ctxt->regs[VCPU_REGS_RDX]; tss->ebx = ctxt->regs[VCPU_REGS_RBX]; tss->esp = ctxt->regs[VCPU_REGS_RSP]; tss->ebp = ctxt->regs[VCPU_REGS_RBP]; tss->esi = ctxt->regs[VCPU_REGS_RSI]; tss->edi = ctxt->regs[VCPU_REGS_RDI]; tss->es = get_segment_selector(ctxt, VCPU_SREG_ES); tss->cs = get_segment_selector(ctxt, VCPU_SREG_CS); tss->ss = get_segment_selector(ctxt, VCPU_SREG_SS); tss->ds = get_segment_selector(ctxt, VCPU_SREG_DS); tss->fs = get_segment_selector(ctxt, VCPU_SREG_FS); tss->gs = get_segment_selector(ctxt, VCPU_SREG_GS); tss->ldt_selector = get_segment_selector(ctxt, VCPU_SREG_LDTR); }
C
linux
0
CVE-2016-6327
https://www.cvedetails.com/cve/CVE-2016-6327/
CWE-476
https://github.com/torvalds/linux/commit/51093254bf879bc9ce96590400a87897c7498463
51093254bf879bc9ce96590400a87897c7498463
IB/srpt: Simplify srpt_handle_tsk_mgmt() Let the target core check task existence instead of the SRP target driver. Additionally, let the target core check the validity of the task management request instead of the ib_srpt driver. This patch fixes the following kernel crash: BUG: unable to handle kernel NULL pointer dereference at 0000000000000001 IP: [<ffffffffa0565f37>] srpt_handle_new_iu+0x6d7/0x790 [ib_srpt] Oops: 0002 [#1] SMP Call Trace: [<ffffffffa05660ce>] srpt_process_completion+0xde/0x570 [ib_srpt] [<ffffffffa056669f>] srpt_compl_thread+0x13f/0x160 [ib_srpt] [<ffffffff8109726f>] kthread+0xcf/0xe0 [<ffffffff81613cfc>] ret_from_fork+0x7c/0xb0 Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com> Fixes: 3e4f574857ee ("ib_srpt: Convert TMR path to target_submit_tmr") Tested-by: Alex Estrin <alex.estrin@intel.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Cc: Nicholas Bellinger <nab@linux-iscsi.org> Cc: Sagi Grimberg <sagig@mellanox.com> Cc: stable <stable@vger.kernel.org> Signed-off-by: Doug Ledford <dledford@redhat.com>
static int srpt_write_pending_status(struct se_cmd *se_cmd) { struct srpt_send_ioctx *ioctx; ioctx = container_of(se_cmd, struct srpt_send_ioctx, cmd); return srpt_get_cmd_state(ioctx) == SRPT_STATE_NEED_DATA; }
static int srpt_write_pending_status(struct se_cmd *se_cmd) { struct srpt_send_ioctx *ioctx; ioctx = container_of(se_cmd, struct srpt_send_ioctx, cmd); return srpt_get_cmd_state(ioctx) == SRPT_STATE_NEED_DATA; }
C
linux
0
null
null
null
https://github.com/chromium/chromium/commit/3a353ebdb7753a3fbeb401c4c0e0f3358ccbb90b
3a353ebdb7753a3fbeb401c4c0e0f3358ccbb90b
Support pausing media when a context is frozen. Media is resumed when the context is unpaused. This feature will be used for bfcache and pausing iframes feature policy. BUG=907125 Change-Id: Ic3925ea1a4544242b7bf0b9ad8c9cb9f63976bbd Reviewed-on: https://chromium-review.googlesource.com/c/1410126 Commit-Queue: Dave Tapuska <dtapuska@chromium.org> Reviewed-by: Kentaro Hara <haraken@chromium.org> Reviewed-by: Mounir Lamouri <mlamouri@chromium.org> Cr-Commit-Position: refs/heads/master@{#623319}
MediaControls* HTMLMediaElement::GetMediaControls() const { return media_controls_; }
MediaControls* HTMLMediaElement::GetMediaControls() const { return media_controls_; }
C
Chrome
0
CVE-2014-1738
https://www.cvedetails.com/cve/CVE-2014-1738/
CWE-264
https://github.com/torvalds/linux/commit/2145e15e0557a01b9195d1c7199a1b92cb9be81f
2145e15e0557a01b9195d1c7199a1b92cb9be81f
floppy: don't write kernel-only members to FDRAWCMD ioctl output Do not leak kernel-only floppy_raw_cmd structure members to userspace. This includes the linked-list pointer and the pointer to the allocated DMA space. Signed-off-by: Matthew Daley <mattd@bugfuzz.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
static int get_floppy_geometry(int drive, int type, struct floppy_struct **g) { if (type) *g = &floppy_type[type]; else { if (lock_fdc(drive, false)) return -EINTR; if (poll_drive(false, 0) == -EINTR) return -EINTR; process_fd_request(); *g = current_type[drive]; } if (!*g) return -ENODEV; return 0; }
static int get_floppy_geometry(int drive, int type, struct floppy_struct **g) { if (type) *g = &floppy_type[type]; else { if (lock_fdc(drive, false)) return -EINTR; if (poll_drive(false, 0) == -EINTR) return -EINTR; process_fd_request(); *g = current_type[drive]; } if (!*g) return -ENODEV; return 0; }
C
linux
0
CVE-2015-6763
https://www.cvedetails.com/cve/CVE-2015-6763/
null
https://github.com/chromium/chromium/commit/f1574f25e1402e748bf2bd7e28ce3dd96ceb1ca4
f1574f25e1402e748bf2bd7e28ce3dd96ceb1ca4
MacViews: Enable secure text input for password Textfields. In Cocoa the NSTextInputContext automatically enables secure text input when activated and it's in the secure text entry mode. RenderWidgetHostViewMac did the similar thing for ages following the WebKit example. views::Textfield needs to do the same thing in a fashion that's sycnrhonized with RenderWidgetHostViewMac, otherwise the race conditions are possible when the Textfield gets focus, activates the secure text input mode and the RWHVM loses focus immediately afterwards and disables the secure text input instead of leaving it in the enabled state. BUG=818133,677220 Change-Id: I6db6c4b59e4a1a72cbb7f8c7056f71b04a3df08b Reviewed-on: https://chromium-review.googlesource.com/943064 Commit-Queue: Michail Pishchagin <mblsha@yandex-team.ru> Reviewed-by: Pavel Feldman <pfeldman@chromium.org> Reviewed-by: Avi Drissman <avi@chromium.org> Reviewed-by: Peter Kasting <pkasting@chromium.org> Cr-Commit-Position: refs/heads/master@{#542517}
unsigned HTMLInputElement::selectionStartForBinding( bool& is_null, ExceptionState& exception_state) const { if (!input_type_->SupportsSelectionAPI()) { is_null = true; return 0; } return TextControlElement::selectionStart(); }
unsigned HTMLInputElement::selectionStartForBinding( bool& is_null, ExceptionState& exception_state) const { if (!input_type_->SupportsSelectionAPI()) { is_null = true; return 0; } return TextControlElement::selectionStart(); }
C
Chrome
0
null
null
null
https://github.com/chromium/chromium/commit/f2f703241635fa96fa630b83afcc9a330cc21b7e
f2f703241635fa96fa630b83afcc9a330cc21b7e
CrOS Shelf: Get rid of 'split view' mode for shelf background In the new UI, "maximized" and "split view" are treated the same in specs, so there is no more need for a separate "split view" mode. This folds it into the "maximized" mode. Note that the only thing that _seems_ different in shelf_background_animator is ShelfBackgroundAnimator::kMaxAlpha (255) vs kShelfTranslucentMaximizedWindow (254), which should be virtually impossible to distinguish. This CL therefore does not have any visual effect (and doesn't directly fix the linked bug, but is relevant). Bug: 899289 Change-Id: I60947338176ac15ca016b1ba4edf13d16362cb24 Reviewed-on: https://chromium-review.googlesource.com/c/1469741 Commit-Queue: Xiyuan Xia <xiyuan@chromium.org> Reviewed-by: Xiyuan Xia <xiyuan@chromium.org> Auto-Submit: Manu Cornet <manucornet@chromium.org> Cr-Commit-Position: refs/heads/master@{#631752}
void ShelfWidget::DelegateView::UpdateShelfBackground(SkColor color) { opaque_background_.SetColor(color); UpdateOpaqueBackground(); }
void ShelfWidget::DelegateView::UpdateShelfBackground(SkColor color) { opaque_background_.SetColor(color); UpdateOpaqueBackground(); }
C
Chrome
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 <avekceeb@gmail.com> Cc: Jason Wang <jasowang@redhat.com> Cc: "Michael S. Tsirkin" <mst@redhat.com> Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
static void tun_net_uninit(struct net_device *dev) { tun_detach_all(dev); }
static void tun_net_uninit(struct net_device *dev) { tun_detach_all(dev); }
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 <efault@gmx.de> Reported-by: Bjoern B. Brandenburg <bbb.lst@gmail.com> Tested-by: Yong Zhang <yong.zhang0@gmail.com> Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: stable@kernel.org LKML-Reference: <1291802742.1417.9.camel@marge.simson.net> Signed-off-by: Ingo Molnar <mingo@elte.hu>
void __sched io_schedule(void) { struct rq *rq = raw_rq(); delayacct_blkio_start(); atomic_inc(&rq->nr_iowait); current->in_iowait = 1; schedule(); current->in_iowait = 0; atomic_dec(&rq->nr_iowait); delayacct_blkio_end(); }
void __sched io_schedule(void) { struct rq *rq = raw_rq(); delayacct_blkio_start(); atomic_inc(&rq->nr_iowait); current->in_iowait = 1; schedule(); current->in_iowait = 0; atomic_dec(&rq->nr_iowait); delayacct_blkio_end(); }
C
linux
0
CVE-2017-5112
https://www.cvedetails.com/cve/CVE-2017-5112/
CWE-119
https://github.com/chromium/chromium/commit/f6ac1dba5e36f338a490752a2cbef3339096d9fe
f6ac1dba5e36f338a490752a2cbef3339096d9fe
Reset ES3 pixel pack parameters and PIXEL_PACK_BUFFER binding in DrawingBuffer before ReadPixels() and recover them later. BUG=740603 TEST=new conformance test R=kbr@chromium.org,piman@chromium.org Change-Id: I3ea54c6cc34f34e249f7c8b9f792d93c5e1958f4 Reviewed-on: https://chromium-review.googlesource.com/570840 Reviewed-by: Antoine Labour <piman@chromium.org> Reviewed-by: Kenneth Russell <kbr@chromium.org> Commit-Queue: Zhenyao Mo <zmo@chromium.org> Cr-Commit-Position: refs/heads/master@{#486518}
void WebGLRenderingContextBase::vertexAttrib2fv(GLuint index, const Vector<GLfloat>& v) { if (isContextLost()) return; if (v.size() < 2) { SynthesizeGLError(GL_INVALID_VALUE, "vertexAttrib2fv", "invalid array"); return; } ContextGL()->VertexAttrib2fv(index, v.data()); SetVertexAttribType(index, kFloat32ArrayType); }
void WebGLRenderingContextBase::vertexAttrib2fv(GLuint index, const Vector<GLfloat>& v) { if (isContextLost()) return; if (v.size() < 2) { SynthesizeGLError(GL_INVALID_VALUE, "vertexAttrib2fv", "invalid array"); return; } ContextGL()->VertexAttrib2fv(index, v.data()); SetVertexAttribType(index, kFloat32ArrayType); }
C
Chrome
0
CVE-2011-4112
https://www.cvedetails.com/cve/CVE-2011-4112/
CWE-264
https://github.com/torvalds/linux/commit/550fd08c2cebad61c548def135f67aba284c6162
550fd08c2cebad61c548def135f67aba284c6162
net: Audit drivers to identify those needing IFF_TX_SKB_SHARING cleared After the last patch, We are left in a state in which only drivers calling ether_setup have IFF_TX_SKB_SHARING set (we assume that drivers touching real hardware call ether_setup for their net_devices and don't hold any state in their skbs. There are a handful of drivers that violate this assumption of course, and need to be fixed up. This patch identifies those drivers, and marks them as not being able to support the safe transmission of skbs by clearning the IFF_TX_SKB_SHARING flag in priv_flags Signed-off-by: Neil Horman <nhorman@tuxdriver.com> CC: Karsten Keil <isdn@linux-pingi.de> CC: "David S. Miller" <davem@davemloft.net> CC: Jay Vosburgh <fubar@us.ibm.com> CC: Andy Gospodarek <andy@greyhouse.net> CC: Patrick McHardy <kaber@trash.net> CC: Krzysztof Halasa <khc@pm.waw.pl> CC: "John W. Linville" <linville@tuxdriver.com> CC: Greg Kroah-Hartman <gregkh@suse.de> CC: Marcel Holtmann <marcel@holtmann.org> CC: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: David S. Miller <davem@davemloft.net>
ar6000_channelList_rx(void *devt, s8 numChan, u16 *chanList) { struct ar6_softc *ar = (struct ar6_softc *)devt; memcpy(ar->arChannelList, chanList, numChan * sizeof (u16)); ar->arNumChannels = numChan; wake_up(&arEvent); }
ar6000_channelList_rx(void *devt, s8 numChan, u16 *chanList) { struct ar6_softc *ar = (struct ar6_softc *)devt; memcpy(ar->arChannelList, chanList, numChan * sizeof (u16)); ar->arNumChannels = numChan; wake_up(&arEvent); }
C
linux
0
CVE-2018-12714
https://www.cvedetails.com/cve/CVE-2018-12714/
CWE-787
https://github.com/torvalds/linux/commit/81f9c4e4177d31ced6f52a89bb70e93bfb77ca03
81f9c4e4177d31ced6f52a89bb70e93bfb77ca03
Merge tag 'trace-v4.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace Pull tracing fixes from Steven Rostedt: "This contains a few fixes and a clean up. - a bad merge caused an "endif" to go in the wrong place in scripts/Makefile.build - softirq tracing fix for tracing that corrupts lockdep and causes a false splat - histogram documentation typo fixes - fix a bad memory reference when passing in no filter to the filter code - simplify code by using the swap macro instead of open coding the swap" * tag 'trace-v4.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace: tracing: Fix SKIP_STACK_VALIDATION=1 build due to bad merge with -mrecord-mcount tracing: Fix some errors in histogram documentation tracing: Use swap macro in update_max_tr softirq: Reorder trace_softirqs_on to prevent lockdep splat tracing: Check for no filter when processing event filters
predicate_parse(const char *str, int nr_parens, int nr_preds, parse_pred_fn parse_pred, void *data, struct filter_parse_error *pe) { struct prog_entry *prog_stack; struct prog_entry *prog; const char *ptr = str; char *inverts = NULL; int *op_stack; int *top; int invert = 0; int ret = -ENOMEM; int len; int N = 0; int i; nr_preds += 2; /* For TRUE and FALSE */ op_stack = kmalloc_array(nr_parens, sizeof(*op_stack), GFP_KERNEL); if (!op_stack) return ERR_PTR(-ENOMEM); prog_stack = kmalloc_array(nr_preds, sizeof(*prog_stack), GFP_KERNEL); if (!prog_stack) { parse_error(pe, -ENOMEM, 0); goto out_free; } inverts = kmalloc_array(nr_preds, sizeof(*inverts), GFP_KERNEL); if (!inverts) { parse_error(pe, -ENOMEM, 0); goto out_free; } top = op_stack; prog = prog_stack; *top = 0; /* First pass */ while (*ptr) { /* #1 */ const char *next = ptr++; if (isspace(*next)) continue; switch (*next) { case '(': /* #2 */ if (top - op_stack > nr_parens) return ERR_PTR(-EINVAL); *(++top) = invert; continue; case '!': /* #3 */ if (!is_not(next)) break; invert = !invert; continue; } if (N >= nr_preds) { parse_error(pe, FILT_ERR_TOO_MANY_PREDS, next - str); goto out_free; } inverts[N] = invert; /* #4 */ prog[N].target = N-1; len = parse_pred(next, data, ptr - str, pe, &prog[N].pred); if (len < 0) { ret = len; goto out_free; } ptr = next + len; N++; ret = -1; while (1) { /* #5 */ next = ptr++; if (isspace(*next)) continue; switch (*next) { case ')': case '\0': break; case '&': case '|': if (next[1] == next[0]) { ptr++; break; } default: parse_error(pe, FILT_ERR_TOO_MANY_PREDS, next - str); goto out_free; } invert = *top & INVERT; if (*top & PROCESS_AND) { /* #7 */ update_preds(prog, N - 1, invert); *top &= ~PROCESS_AND; } if (*next == '&') { /* #8 */ *top |= PROCESS_AND; break; } if (*top & PROCESS_OR) { /* #9 */ update_preds(prog, N - 1, !invert); *top &= ~PROCESS_OR; } if (*next == '|') { /* #10 */ *top |= PROCESS_OR; break; } if (!*next) /* #11 */ goto out; if (top == op_stack) { ret = -1; /* Too few '(' */ parse_error(pe, FILT_ERR_TOO_MANY_CLOSE, ptr - str); goto out_free; } top--; /* #12 */ } } out: if (top != op_stack) { /* Too many '(' */ parse_error(pe, FILT_ERR_TOO_MANY_OPEN, ptr - str); goto out_free; } if (!N) { /* No program? */ ret = -EINVAL; parse_error(pe, FILT_ERR_NO_FILTER, ptr - str); goto out_free; } prog[N].pred = NULL; /* #13 */ prog[N].target = 1; /* TRUE */ prog[N+1].pred = NULL; prog[N+1].target = 0; /* FALSE */ prog[N-1].target = N; prog[N-1].when_to_branch = false; /* Second Pass */ for (i = N-1 ; i--; ) { int target = prog[i].target; if (prog[i].when_to_branch == prog[target].when_to_branch) prog[i].target = prog[target].target; } /* Third Pass */ for (i = 0; i < N; i++) { invert = inverts[i] ^ prog[i].when_to_branch; prog[i].when_to_branch = invert; /* Make sure the program always moves forward */ if (WARN_ON(prog[i].target <= i)) { ret = -EINVAL; goto out_free; } } return prog; out_free: kfree(op_stack); kfree(prog_stack); kfree(inverts); return ERR_PTR(ret); }
predicate_parse(const char *str, int nr_parens, int nr_preds, parse_pred_fn parse_pred, void *data, struct filter_parse_error *pe) { struct prog_entry *prog_stack; struct prog_entry *prog; const char *ptr = str; char *inverts = NULL; int *op_stack; int *top; int invert = 0; int ret = -ENOMEM; int len; int N = 0; int i; nr_preds += 2; /* For TRUE and FALSE */ op_stack = kmalloc_array(nr_parens, sizeof(*op_stack), GFP_KERNEL); if (!op_stack) return ERR_PTR(-ENOMEM); prog_stack = kmalloc_array(nr_preds, sizeof(*prog_stack), GFP_KERNEL); if (!prog_stack) { parse_error(pe, -ENOMEM, 0); goto out_free; } inverts = kmalloc_array(nr_preds, sizeof(*inverts), GFP_KERNEL); if (!inverts) { parse_error(pe, -ENOMEM, 0); goto out_free; } top = op_stack; prog = prog_stack; *top = 0; /* First pass */ while (*ptr) { /* #1 */ const char *next = ptr++; if (isspace(*next)) continue; switch (*next) { case '(': /* #2 */ if (top - op_stack > nr_parens) return ERR_PTR(-EINVAL); *(++top) = invert; continue; case '!': /* #3 */ if (!is_not(next)) break; invert = !invert; continue; } if (N >= nr_preds) { parse_error(pe, FILT_ERR_TOO_MANY_PREDS, next - str); goto out_free; } inverts[N] = invert; /* #4 */ prog[N].target = N-1; len = parse_pred(next, data, ptr - str, pe, &prog[N].pred); if (len < 0) { ret = len; goto out_free; } ptr = next + len; N++; ret = -1; while (1) { /* #5 */ next = ptr++; if (isspace(*next)) continue; switch (*next) { case ')': case '\0': break; case '&': case '|': if (next[1] == next[0]) { ptr++; break; } default: parse_error(pe, FILT_ERR_TOO_MANY_PREDS, next - str); goto out_free; } invert = *top & INVERT; if (*top & PROCESS_AND) { /* #7 */ update_preds(prog, N - 1, invert); *top &= ~PROCESS_AND; } if (*next == '&') { /* #8 */ *top |= PROCESS_AND; break; } if (*top & PROCESS_OR) { /* #9 */ update_preds(prog, N - 1, !invert); *top &= ~PROCESS_OR; } if (*next == '|') { /* #10 */ *top |= PROCESS_OR; break; } if (!*next) /* #11 */ goto out; if (top == op_stack) { ret = -1; /* Too few '(' */ parse_error(pe, FILT_ERR_TOO_MANY_CLOSE, ptr - str); goto out_free; } top--; /* #12 */ } } out: if (top != op_stack) { /* Too many '(' */ parse_error(pe, FILT_ERR_TOO_MANY_OPEN, ptr - str); goto out_free; } prog[N].pred = NULL; /* #13 */ prog[N].target = 1; /* TRUE */ prog[N+1].pred = NULL; prog[N+1].target = 0; /* FALSE */ prog[N-1].target = N; prog[N-1].when_to_branch = false; /* Second Pass */ for (i = N-1 ; i--; ) { int target = prog[i].target; if (prog[i].when_to_branch == prog[target].when_to_branch) prog[i].target = prog[target].target; } /* Third Pass */ for (i = 0; i < N; i++) { invert = inverts[i] ^ prog[i].when_to_branch; prog[i].when_to_branch = invert; /* Make sure the program always moves forward */ if (WARN_ON(prog[i].target <= i)) { ret = -EINVAL; goto out_free; } } return prog; out_free: kfree(op_stack); kfree(prog_stack); kfree(inverts); return ERR_PTR(ret); }
C
linux
1
CVE-2017-12154
https://www.cvedetails.com/cve/CVE-2017-12154/
null
https://github.com/torvalds/linux/commit/51aa68e7d57e3217192d88ce90fd5b8ef29ec94f
51aa68e7d57e3217192d88ce90fd5b8ef29ec94f
kvm: nVMX: Don't allow L2 to access the hardware CR8 If L1 does not specify the "use TPR shadow" VM-execution control in vmcs12, then L0 must specify the "CR8-load exiting" and "CR8-store exiting" VM-execution controls in vmcs02. Failure to do so will give the L2 VM unrestricted read/write access to the hardware CR8. This fixes CVE-2017-12154. Signed-off-by: Jim Mattson <jmattson@google.com> Reviewed-by: David Hildenbrand <david@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
static bool vmx_get_nmi_mask(struct kvm_vcpu *vcpu) { struct vcpu_vmx *vmx = to_vmx(vcpu); bool masked; if (vmx->loaded_vmcs->nmi_known_unmasked) return false; masked = vmcs_read32(GUEST_INTERRUPTIBILITY_INFO) & GUEST_INTR_STATE_NMI; vmx->loaded_vmcs->nmi_known_unmasked = !masked; return masked; }
static bool vmx_get_nmi_mask(struct kvm_vcpu *vcpu) { struct vcpu_vmx *vmx = to_vmx(vcpu); bool masked; if (vmx->loaded_vmcs->nmi_known_unmasked) return false; masked = vmcs_read32(GUEST_INTERRUPTIBILITY_INFO) & GUEST_INTR_STATE_NMI; vmx->loaded_vmcs->nmi_known_unmasked = !masked; return masked; }
C
linux
0
CVE-2013-0889
https://www.cvedetails.com/cve/CVE-2013-0889/
CWE-264
https://github.com/chromium/chromium/commit/1538367452b549d929aabb13d54c85ab99f65cd3
1538367452b549d929aabb13d54c85ab99f65cd3
For "Dangerous" file type, no user gesture will bypass the download warning. BUG=170569 Review URL: https://codereview.chromium.org/12039015 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@178072 0039d316-1c4b-4281-b951-d872f2087c98
GetAlternativeWebContentsToNotifyForDownload() { #if defined(OS_ANDROID) return NULL; #else Browser* last_active = chrome::FindLastActiveWithProfile(profile_, chrome::GetActiveDesktop()); return last_active ? chrome::GetActiveWebContents(last_active) : NULL; #endif }
GetAlternativeWebContentsToNotifyForDownload() { #if defined(OS_ANDROID) return NULL; #else Browser* last_active = chrome::FindLastActiveWithProfile(profile_, chrome::GetActiveDesktop()); return last_active ? chrome::GetActiveWebContents(last_active) : NULL; #endif }
C
Chrome
0
CVE-2018-6110
https://www.cvedetails.com/cve/CVE-2018-6110/
null
https://github.com/chromium/chromium/commit/9afc491d6d64d54bf01f526abcc3d8344d90fa42
9afc491d6d64d54bf01f526abcc3d8344d90fa42
Revert "Don't sniff HTML from documents delivered via the file protocol" This reverts commit 3519e867dc606437f804561f889d7ed95b95876a. Reason for revert: crbug.com/786150. Application compatibility for Android WebView applications means we need to allow sniffing on that platform. Original change's description: > Don't sniff HTML from documents delivered via the file protocol > > To reduce attack surface, Chrome should not MIME-sniff to text/html for > any document delivered via the file protocol. This change only impacts > the file protocol (documents served via HTTP/HTTPS/etc are unaffected). > > Bug: 777737 > Cq-Include-Trybots: master.tryserver.chromium.android:android_cronet_tester;master.tryserver.chromium.mac:ios-simulator-cronet > Change-Id: I7086454356b8d2d092be9e1bca0f5ff6dd3b62c0 > Reviewed-on: https://chromium-review.googlesource.com/751402 > Reviewed-by: Ben Wells <benwells@chromium.org> > Reviewed-by: Sylvain Defresne <sdefresne@chromium.org> > Reviewed-by: Achuith Bhandarkar <achuith@chromium.org> > Reviewed-by: Asanka Herath <asanka@chromium.org> > Reviewed-by: Matt Menke <mmenke@chromium.org> > Commit-Queue: Eric Lawrence <elawrence@chromium.org> > Cr-Commit-Position: refs/heads/master@{#514372} TBR=achuith@chromium.org,benwells@chromium.org,mmenke@chromium.org,sdefresne@chromium.org,asanka@chromium.org,elawrence@chromium.org # Not skipping CQ checks because original CL landed > 1 day ago. Bug: 777737 Change-Id: I864ae060ce3277d41ea257ae75e0b80c51f3ea98 Cq-Include-Trybots: master.tryserver.chromium.android:android_cronet_tester;master.tryserver.chromium.mac:ios-simulator-cronet Reviewed-on: https://chromium-review.googlesource.com/790790 Reviewed-by: Eric Lawrence <elawrence@chromium.org> Reviewed-by: Matt Menke <mmenke@chromium.org> Commit-Queue: Eric Lawrence <elawrence@chromium.org> Cr-Commit-Position: refs/heads/master@{#519347}
static bool SniffXML(const char* content, size_t size, bool* have_enough_content, std::string* result) { *have_enough_content &= TruncateSize(300, &size); const char* pos = content; const char* const end = content + size; const int kMaxTagIterations = 5; for (int i = 0; i < kMaxTagIterations && pos < end; ++i) { pos = reinterpret_cast<const char*>(memchr(pos, '<', end - pos)); if (!pos) return false; static const char kXmlPrefix[] = "<?xml"; static const size_t kXmlPrefixLength = arraysize(kXmlPrefix) - 1; static const char kDocTypePrefix[] = "<!DOCTYPE"; static const size_t kDocTypePrefixLength = arraysize(kDocTypePrefix) - 1; if ((pos + kXmlPrefixLength <= end) && base::EqualsCaseInsensitiveASCII( base::StringPiece(pos, kXmlPrefixLength), base::StringPiece(kXmlPrefix, kXmlPrefixLength))) { ++pos; continue; } else if ((pos + kDocTypePrefixLength <= end) && base::EqualsCaseInsensitiveASCII( base::StringPiece(pos, kDocTypePrefixLength), base::StringPiece(kDocTypePrefix, kDocTypePrefixLength))) { ++pos; continue; } if (CheckForMagicNumbers(pos, end - pos, kMagicXML, arraysize(kMagicXML), result)) return true; return true; } return pos < end; }
static bool SniffXML(const char* content, size_t size, bool* have_enough_content, std::string* result) { *have_enough_content &= TruncateSize(300, &size); const char* pos = content; const char* const end = content + size; const int kMaxTagIterations = 5; for (int i = 0; i < kMaxTagIterations && pos < end; ++i) { pos = reinterpret_cast<const char*>(memchr(pos, '<', end - pos)); if (!pos) return false; static const char kXmlPrefix[] = "<?xml"; static const size_t kXmlPrefixLength = arraysize(kXmlPrefix) - 1; static const char kDocTypePrefix[] = "<!DOCTYPE"; static const size_t kDocTypePrefixLength = arraysize(kDocTypePrefix) - 1; if ((pos + kXmlPrefixLength <= end) && base::EqualsCaseInsensitiveASCII( base::StringPiece(pos, kXmlPrefixLength), base::StringPiece(kXmlPrefix, kXmlPrefixLength))) { ++pos; continue; } else if ((pos + kDocTypePrefixLength <= end) && base::EqualsCaseInsensitiveASCII( base::StringPiece(pos, kDocTypePrefixLength), base::StringPiece(kDocTypePrefix, kDocTypePrefixLength))) { ++pos; continue; } if (CheckForMagicNumbers(pos, end - pos, kMagicXML, arraysize(kMagicXML), result)) return true; return true; } return pos < end; }
C
Chrome
0
CVE-2017-9727
https://www.cvedetails.com/cve/CVE-2017-9727/
CWE-125
http://git.ghostscript.com/?p=ghostpdl.git;a=commit;h=937ccd17ac65935633b2ebc06cb7089b91e17e6b
937ccd17ac65935633b2ebc06cb7089b91e17e6b
null
ENUM_PTRS_WITH(gx_ttfReader_enum_ptrs, gx_ttfReader *mptr) { /* The fields 'pfont' and 'glyph_data' may contain pointers from global to local memory ( see a comment in gxttfb.h). They must be NULL when a garbager is invoked. Due to that we don't enumerate and don't relocate them. */ DISCARD(mptr); return 0; }
ENUM_PTRS_WITH(gx_ttfReader_enum_ptrs, gx_ttfReader *mptr) { /* The fields 'pfont' and 'glyph_data' may contain pointers from global to local memory ( see a comment in gxttfb.h). They must be NULL when a garbager is invoked. Due to that we don't enumerate and don't relocate them. */ DISCARD(mptr); return 0; }
C
ghostscript
0
CVE-2017-14166
https://www.cvedetails.com/cve/CVE-2017-14166/
CWE-125
https://github.com/libarchive/libarchive/commit/fa7438a0ff4033e4741c807394a9af6207940d71
fa7438a0ff4033e4741c807394a9af6207940d71
Do something sensible for empty strings to make fuzzers happy.
xar_bid(struct archive_read *a, int best_bid) { const unsigned char *b; int bid; (void)best_bid; /* UNUSED */ b = __archive_read_ahead(a, HEADER_SIZE, NULL); if (b == NULL) return (-1); bid = 0; /* * Verify magic code */ if (archive_be32dec(b) != HEADER_MAGIC) return (0); bid += 32; /* * Verify header size */ if (archive_be16dec(b+4) != HEADER_SIZE) return (0); bid += 16; /* * Verify header version */ if (archive_be16dec(b+6) != HEADER_VERSION) return (0); bid += 16; /* * Verify type of checksum */ switch (archive_be32dec(b+24)) { case CKSUM_NONE: case CKSUM_SHA1: case CKSUM_MD5: bid += 32; break; default: return (0); } return (bid); }
xar_bid(struct archive_read *a, int best_bid) { const unsigned char *b; int bid; (void)best_bid; /* UNUSED */ b = __archive_read_ahead(a, HEADER_SIZE, NULL); if (b == NULL) return (-1); bid = 0; /* * Verify magic code */ if (archive_be32dec(b) != HEADER_MAGIC) return (0); bid += 32; /* * Verify header size */ if (archive_be16dec(b+4) != HEADER_SIZE) return (0); bid += 16; /* * Verify header version */ if (archive_be16dec(b+6) != HEADER_VERSION) return (0); bid += 16; /* * Verify type of checksum */ switch (archive_be32dec(b+24)) { case CKSUM_NONE: case CKSUM_SHA1: case CKSUM_MD5: bid += 32; break; default: return (0); } return (bid); }
C
libarchive
0
CVE-2012-5150
https://www.cvedetails.com/cve/CVE-2012-5150/
CWE-399
https://github.com/chromium/chromium/commit/8ea3a5c06218fa42d25c3aa0a4ab57153e178523
8ea3a5c06218fa42d25c3aa0a4ab57153e178523
Delete apparently unused geolocation declarations and include. BUG=336263 Review URL: https://codereview.chromium.org/139743014 git-svn-id: svn://svn.chromium.org/blink/trunk@165601 bbb929c8-8fbe-4397-9dbb-9b2b20218538
void ChromeClientImpl::scheduleAnimation() { m_webView->scheduleAnimation(); }
void ChromeClientImpl::scheduleAnimation() { m_webView->scheduleAnimation(); }
C
Chrome
0
CVE-2015-7513
https://www.cvedetails.com/cve/CVE-2015-7513/
null
https://github.com/torvalds/linux/commit/0185604c2d82c560dab2f2933a18f797e74ab5a8
0185604c2d82c560dab2f2933a18f797e74ab5a8
KVM: x86: Reload pit counters for all channels when restoring state Currently if userspace restores the pit counters with a count of 0 on channels 1 or 2 and the guest attempts to read the count on those channels, then KVM will perform a mod of 0 and crash. This will ensure that 0 values are converted to 65536 as per the spec. This is CVE-2015-7513. Signed-off-by: Andy Honig <ahonig@google.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
static void kvm_smm_changed(struct kvm_vcpu *vcpu) { if (!(vcpu->arch.hflags & HF_SMM_MASK)) { /* This is a good place to trace that we are exiting SMM. */ trace_kvm_enter_smm(vcpu->vcpu_id, vcpu->arch.smbase, false); if (unlikely(vcpu->arch.smi_pending)) { kvm_make_request(KVM_REQ_SMI, vcpu); vcpu->arch.smi_pending = 0; } else { /* Process a latched INIT, if any. */ kvm_make_request(KVM_REQ_EVENT, vcpu); } } kvm_mmu_reset_context(vcpu); }
static void kvm_smm_changed(struct kvm_vcpu *vcpu) { if (!(vcpu->arch.hflags & HF_SMM_MASK)) { /* This is a good place to trace that we are exiting SMM. */ trace_kvm_enter_smm(vcpu->vcpu_id, vcpu->arch.smbase, false); if (unlikely(vcpu->arch.smi_pending)) { kvm_make_request(KVM_REQ_SMI, vcpu); vcpu->arch.smi_pending = 0; } else { /* Process a latched INIT, if any. */ kvm_make_request(KVM_REQ_EVENT, vcpu); } } kvm_mmu_reset_context(vcpu); }
C
linux
0
CVE-2015-1274
https://www.cvedetails.com/cve/CVE-2015-1274/
CWE-254
https://github.com/chromium/chromium/commit/d27468a832d5316884bd02f459cbf493697fd7e1
d27468a832d5316884bd02f459cbf493697fd7e1
Switch to equalIgnoringASCIICase throughout modules/accessibility BUG=627682 Review-Url: https://codereview.chromium.org/2793913007 Cr-Commit-Position: refs/heads/master@{#461858}
bool AXNodeObject::isReadOnly() const { Node* node = this->getNode(); if (!node) return true; if (isHTMLTextAreaElement(*node)) return toHTMLTextAreaElement(*node).isReadOnly(); if (isHTMLInputElement(*node)) { HTMLInputElement& input = toHTMLInputElement(*node); if (input.isTextField()) return input.isReadOnly(); } return !hasEditableStyle(*node); }
bool AXNodeObject::isReadOnly() const { Node* node = this->getNode(); if (!node) return true; if (isHTMLTextAreaElement(*node)) return toHTMLTextAreaElement(*node).isReadOnly(); if (isHTMLInputElement(*node)) { HTMLInputElement& input = toHTMLInputElement(*node); if (input.isTextField()) return input.isReadOnly(); } return !hasEditableStyle(*node); }
C
Chrome
0
CVE-2018-6196
https://www.cvedetails.com/cve/CVE-2018-6196/
CWE-835
https://github.com/tats/w3m/commit/8354763b90490d4105695df52674d0fcef823e92
8354763b90490d4105695df52674d0fcef823e92
Prevent negative indent value in feed_table_block_tag() Bug-Debian: https://github.com/tats/w3m/issues/88
setwidth0(struct table *t, struct table_mode *mode) { int w; int width = t->tabcontentssize; struct table_cell *cell = &t->cell; if (t->col < 0) return -1; if (t->tabwidth[t->col] < 0) return -1; check_row(t, t->row); if (t->linfo.prev_spaces > 0) width -= t->linfo.prev_spaces; w = table_colspan(t, t->row, t->col); if (w == 1) { if (t->tabwidth[t->col] < width) t->tabwidth[t->col] = width; } else if (cell->icell >= 0) { if (cell->width[cell->icell] < width) cell->width[cell->icell] = width; } return width; }
setwidth0(struct table *t, struct table_mode *mode) { int w; int width = t->tabcontentssize; struct table_cell *cell = &t->cell; if (t->col < 0) return -1; if (t->tabwidth[t->col] < 0) return -1; check_row(t, t->row); if (t->linfo.prev_spaces > 0) width -= t->linfo.prev_spaces; w = table_colspan(t, t->row, t->col); if (w == 1) { if (t->tabwidth[t->col] < width) t->tabwidth[t->col] = width; } else if (cell->icell >= 0) { if (cell->width[cell->icell] < width) cell->width[cell->icell] = width; } return width; }
C
w3m
0
CVE-2017-15395
https://www.cvedetails.com/cve/CVE-2017-15395/
CWE-416
https://github.com/chromium/chromium/commit/84ca1ee18bbc32f3cb035d071e8271e064dfd4d7
84ca1ee18bbc32f3cb035d071e8271e064dfd4d7
Convert MediaTrackConstraints to a ScriptValue IDLDictionaries such as MediaTrackConstraints should not be stored on the heap which would happen when binding one as a parameter to a callback. This change converts the object to a ScriptValue ahead of time. This is fine because the value will be passed to a ScriptPromiseResolver that will converted it to a V8 value if it isn't already. Bug: 759457 Change-Id: I3009a0f7711cc264aeaae07a36c18a6db8c915c8 Reviewed-on: https://chromium-review.googlesource.com/701358 Reviewed-by: Kentaro Hara <haraken@chromium.org> Commit-Queue: Reilly Grant <reillyg@chromium.org> Cr-Commit-Position: refs/heads/master@{#507177}
ScriptPromise ImageCapture::grabFrame(ScriptState* script_state) { ScriptPromiseResolver* resolver = ScriptPromiseResolver::Create(script_state); ScriptPromise promise = resolver->Promise(); if (TrackIsInactive(*stream_track_)) { resolver->Reject(DOMException::Create( kInvalidStateError, "The associated Track is in an invalid state.")); return promise; } if (!frame_grabber_) { frame_grabber_ = Platform::Current()->CreateImageCaptureFrameGrabber(); } if (!frame_grabber_) { resolver->Reject(DOMException::Create( kUnknownError, "Couldn't create platform resources")); return promise; } WebMediaStreamTrack track(stream_track_->Component()); frame_grabber_->GrabFrame( &track, new CallbackPromiseAdapter<ImageBitmap, void>(resolver)); return promise; }
ScriptPromise ImageCapture::grabFrame(ScriptState* script_state) { ScriptPromiseResolver* resolver = ScriptPromiseResolver::Create(script_state); ScriptPromise promise = resolver->Promise(); if (TrackIsInactive(*stream_track_)) { resolver->Reject(DOMException::Create( kInvalidStateError, "The associated Track is in an invalid state.")); return promise; } if (!frame_grabber_) { frame_grabber_ = Platform::Current()->CreateImageCaptureFrameGrabber(); } if (!frame_grabber_) { resolver->Reject(DOMException::Create( kUnknownError, "Couldn't create platform resources")); return promise; } WebMediaStreamTrack track(stream_track_->Component()); frame_grabber_->GrabFrame( &track, new CallbackPromiseAdapter<ImageBitmap, void>(resolver)); return promise; }
C
Chrome
0
CVE-2015-8839
https://www.cvedetails.com/cve/CVE-2015-8839/
CWE-362
https://github.com/torvalds/linux/commit/ea3d7209ca01da209cda6f0dea8be9cc4b7a933b
ea3d7209ca01da209cda6f0dea8be9cc4b7a933b
ext4: fix races between page faults and hole punching Currently, page faults and hole punching are completely unsynchronized. This can result in page fault faulting in a page into a range that we are punching after truncate_pagecache_range() has been called and thus we can end up with a page mapped to disk blocks that will be shortly freed. Filesystem corruption will shortly follow. Note that the same race is avoided for truncate by checking page fault offset against i_size but there isn't similar mechanism available for punching holes. Fix the problem by creating new rw semaphore i_mmap_sem in inode and grab it for writing over truncate, hole punching, and other functions removing blocks from extent tree and for read over page faults. We cannot easily use i_data_sem for this since that ranks below transaction start and we need something ranking above it so that it can be held over the whole truncate / hole punching operation. Also remove various workarounds we had in the code to reduce race window when page fault could have created pages with stale mapping information. Signed-off-by: Jan Kara <jack@suse.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
static sector_t ext4_bmap(struct address_space *mapping, sector_t block) { struct inode *inode = mapping->host; journal_t *journal; int err; /* * We can get here for an inline file via the FIBMAP ioctl */ if (ext4_has_inline_data(inode)) return 0; if (mapping_tagged(mapping, PAGECACHE_TAG_DIRTY) && test_opt(inode->i_sb, DELALLOC)) { /* * With delalloc we want to sync the file * so that we can make sure we allocate * blocks for file */ filemap_write_and_wait(mapping); } if (EXT4_JOURNAL(inode) && ext4_test_inode_state(inode, EXT4_STATE_JDATA)) { /* * This is a REALLY heavyweight approach, but the use of * bmap on dirty files is expected to be extremely rare: * only if we run lilo or swapon on a freshly made file * do we expect this to happen. * * (bmap requires CAP_SYS_RAWIO so this does not * represent an unprivileged user DOS attack --- we'd be * in trouble if mortal users could trigger this path at * will.) * * NB. EXT4_STATE_JDATA is not set on files other than * regular files. If somebody wants to bmap a directory * or symlink and gets confused because the buffer * hasn't yet been flushed to disk, they deserve * everything they get. */ ext4_clear_inode_state(inode, EXT4_STATE_JDATA); journal = EXT4_JOURNAL(inode); jbd2_journal_lock_updates(journal); err = jbd2_journal_flush(journal); jbd2_journal_unlock_updates(journal); if (err) return 0; } return generic_block_bmap(mapping, block, ext4_get_block); }
static sector_t ext4_bmap(struct address_space *mapping, sector_t block) { struct inode *inode = mapping->host; journal_t *journal; int err; /* * We can get here for an inline file via the FIBMAP ioctl */ if (ext4_has_inline_data(inode)) return 0; if (mapping_tagged(mapping, PAGECACHE_TAG_DIRTY) && test_opt(inode->i_sb, DELALLOC)) { /* * With delalloc we want to sync the file * so that we can make sure we allocate * blocks for file */ filemap_write_and_wait(mapping); } if (EXT4_JOURNAL(inode) && ext4_test_inode_state(inode, EXT4_STATE_JDATA)) { /* * This is a REALLY heavyweight approach, but the use of * bmap on dirty files is expected to be extremely rare: * only if we run lilo or swapon on a freshly made file * do we expect this to happen. * * (bmap requires CAP_SYS_RAWIO so this does not * represent an unprivileged user DOS attack --- we'd be * in trouble if mortal users could trigger this path at * will.) * * NB. EXT4_STATE_JDATA is not set on files other than * regular files. If somebody wants to bmap a directory * or symlink and gets confused because the buffer * hasn't yet been flushed to disk, they deserve * everything they get. */ ext4_clear_inode_state(inode, EXT4_STATE_JDATA); journal = EXT4_JOURNAL(inode); jbd2_journal_lock_updates(journal); err = jbd2_journal_flush(journal); jbd2_journal_unlock_updates(journal); if (err) return 0; } return generic_block_bmap(mapping, block, ext4_get_block); }
C
linux
0
CVE-2016-5219
https://www.cvedetails.com/cve/CVE-2016-5219/
CWE-416
https://github.com/chromium/chromium/commit/a4150b688a754d3d10d2ca385155b1c95d77d6ae
a4150b688a754d3d10d2ca385155b1c95d77d6ae
Add GL_PROGRAM_COMPLETION_QUERY_CHROMIUM This makes the query of GL_COMPLETION_STATUS_KHR to programs much cheaper by minimizing the round-trip to the GPU thread. Bug: 881152, 957001 Change-Id: Iadfa798af29225e752c710ca5c25f50b3dd3101a Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1586630 Commit-Queue: Kenneth Russell <kbr@chromium.org> Reviewed-by: Kentaro Hara <haraken@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Kenneth Russell <kbr@chromium.org> Cr-Commit-Position: refs/heads/master@{#657568}
bool GLES2DecoderImpl::InitializeSRGBConverter( const char* function_name) { if (!srgb_converter_.get()) { LOCAL_COPY_REAL_GL_ERRORS_TO_WRAPPER(function_name); srgb_converter_.reset( new SRGBConverter(feature_info_.get())); srgb_converter_->InitializeSRGBConverter(this); if (LOCAL_PEEK_GL_ERROR(function_name) != GL_NO_ERROR) { return false; } } return true; }
bool GLES2DecoderImpl::InitializeSRGBConverter( const char* function_name) { if (!srgb_converter_.get()) { LOCAL_COPY_REAL_GL_ERRORS_TO_WRAPPER(function_name); srgb_converter_.reset( new SRGBConverter(feature_info_.get())); srgb_converter_->InitializeSRGBConverter(this); if (LOCAL_PEEK_GL_ERROR(function_name) != GL_NO_ERROR) { return false; } } return true; }
C
Chrome
0
CVE-2012-2875
https://www.cvedetails.com/cve/CVE-2012-2875/
null
https://github.com/chromium/chromium/commit/3ea4ba8af75eb37860c15d02af94f272e5bbc235
3ea4ba8af75eb37860c15d02af94f272e5bbc235
Crash fix in fileapi::FileSystemOperation::DidGetUsageAndQuotaAndRunTask https://chromiumcodereview.appspot.com/10008047 introduced delete-with-inflight-tasks in Write sequence but I failed to convert this callback to use WeakPtr(). BUG=128178 TEST=manual test Review URL: https://chromiumcodereview.appspot.com/10408006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@137635 0039d316-1c4b-4281-b951-d872f2087c98
void FileSystemOperation::DidTouchFile(const StatusCallback& callback, base::PlatformFileError rv) { callback.Run(rv); }
void FileSystemOperation::DidTouchFile(const StatusCallback& callback, base::PlatformFileError rv) { callback.Run(rv); }
C
Chrome
0
CVE-2011-3055
https://www.cvedetails.com/cve/CVE-2011-3055/
null
https://github.com/chromium/chromium/commit/e9372a1bfd3588a80fcf49aa07321f0971dd6091
e9372a1bfd3588a80fcf49aa07321f0971dd6091
[V8] Pass Isolate to throwNotEnoughArgumentsError() https://bugs.webkit.org/show_bug.cgi?id=86983 Reviewed by Adam Barth. The objective is to pass Isolate around in V8 bindings. This patch passes Isolate to throwNotEnoughArgumentsError(). No tests. No change in behavior. * bindings/scripts/CodeGeneratorV8.pm: (GenerateArgumentsCountCheck): (GenerateEventConstructorCallback): * bindings/scripts/test/V8/V8Float64Array.cpp: (WebCore::Float64ArrayV8Internal::fooCallback): * bindings/scripts/test/V8/V8TestActiveDOMObject.cpp: (WebCore::TestActiveDOMObjectV8Internal::excitingFunctionCallback): (WebCore::TestActiveDOMObjectV8Internal::postMessageCallback): * bindings/scripts/test/V8/V8TestCustomNamedGetter.cpp: (WebCore::TestCustomNamedGetterV8Internal::anotherFunctionCallback): * bindings/scripts/test/V8/V8TestEventConstructor.cpp: (WebCore::V8TestEventConstructor::constructorCallback): * bindings/scripts/test/V8/V8TestEventTarget.cpp: (WebCore::TestEventTargetV8Internal::itemCallback): (WebCore::TestEventTargetV8Internal::dispatchEventCallback): * bindings/scripts/test/V8/V8TestInterface.cpp: (WebCore::TestInterfaceV8Internal::supplementalMethod2Callback): (WebCore::V8TestInterface::constructorCallback): * bindings/scripts/test/V8/V8TestMediaQueryListListener.cpp: (WebCore::TestMediaQueryListListenerV8Internal::methodCallback): * bindings/scripts/test/V8/V8TestNamedConstructor.cpp: (WebCore::V8TestNamedConstructorConstructorCallback): * bindings/scripts/test/V8/V8TestObj.cpp: (WebCore::TestObjV8Internal::voidMethodWithArgsCallback): (WebCore::TestObjV8Internal::intMethodWithArgsCallback): (WebCore::TestObjV8Internal::objMethodWithArgsCallback): (WebCore::TestObjV8Internal::methodWithSequenceArgCallback): (WebCore::TestObjV8Internal::methodReturningSequenceCallback): (WebCore::TestObjV8Internal::methodThatRequiresAllArgsAndThrowsCallback): (WebCore::TestObjV8Internal::serializedValueCallback): (WebCore::TestObjV8Internal::idbKeyCallback): (WebCore::TestObjV8Internal::optionsObjectCallback): (WebCore::TestObjV8Internal::methodWithNonOptionalArgAndOptionalArgCallback): (WebCore::TestObjV8Internal::methodWithNonOptionalArgAndTwoOptionalArgsCallback): (WebCore::TestObjV8Internal::methodWithCallbackArgCallback): (WebCore::TestObjV8Internal::methodWithNonCallbackArgAndCallbackArgCallback): (WebCore::TestObjV8Internal::overloadedMethod1Callback): (WebCore::TestObjV8Internal::overloadedMethod2Callback): (WebCore::TestObjV8Internal::overloadedMethod3Callback): (WebCore::TestObjV8Internal::overloadedMethod4Callback): (WebCore::TestObjV8Internal::overloadedMethod5Callback): (WebCore::TestObjV8Internal::overloadedMethod6Callback): (WebCore::TestObjV8Internal::overloadedMethod7Callback): (WebCore::TestObjV8Internal::overloadedMethod11Callback): (WebCore::TestObjV8Internal::overloadedMethod12Callback): (WebCore::TestObjV8Internal::enabledAtRuntimeMethod1Callback): (WebCore::TestObjV8Internal::enabledAtRuntimeMethod2Callback): (WebCore::TestObjV8Internal::convert1Callback): (WebCore::TestObjV8Internal::convert2Callback): (WebCore::TestObjV8Internal::convert3Callback): (WebCore::TestObjV8Internal::convert4Callback): (WebCore::TestObjV8Internal::convert5Callback): (WebCore::TestObjV8Internal::strictFunctionCallback): (WebCore::V8TestObj::constructorCallback): * bindings/scripts/test/V8/V8TestSerializedScriptValueInterface.cpp: (WebCore::TestSerializedScriptValueInterfaceV8Internal::acceptTransferListCallback): (WebCore::V8TestSerializedScriptValueInterface::constructorCallback): * bindings/v8/ScriptController.cpp: (WebCore::setValueAndClosePopupCallback): * bindings/v8/V8Proxy.cpp: (WebCore::V8Proxy::throwNotEnoughArgumentsError): * bindings/v8/V8Proxy.h: (V8Proxy): * bindings/v8/custom/V8AudioContextCustom.cpp: (WebCore::V8AudioContext::constructorCallback): * bindings/v8/custom/V8DataViewCustom.cpp: (WebCore::V8DataView::getInt8Callback): (WebCore::V8DataView::getUint8Callback): (WebCore::V8DataView::setInt8Callback): (WebCore::V8DataView::setUint8Callback): * bindings/v8/custom/V8DirectoryEntryCustom.cpp: (WebCore::V8DirectoryEntry::getDirectoryCallback): (WebCore::V8DirectoryEntry::getFileCallback): * bindings/v8/custom/V8IntentConstructor.cpp: (WebCore::V8Intent::constructorCallback): * bindings/v8/custom/V8SVGLengthCustom.cpp: (WebCore::V8SVGLength::convertToSpecifiedUnitsCallback): * bindings/v8/custom/V8WebGLRenderingContextCustom.cpp: (WebCore::getObjectParameter): (WebCore::V8WebGLRenderingContext::getAttachedShadersCallback): (WebCore::V8WebGLRenderingContext::getExtensionCallback): (WebCore::V8WebGLRenderingContext::getFramebufferAttachmentParameterCallback): (WebCore::V8WebGLRenderingContext::getParameterCallback): (WebCore::V8WebGLRenderingContext::getProgramParameterCallback): (WebCore::V8WebGLRenderingContext::getShaderParameterCallback): (WebCore::V8WebGLRenderingContext::getUniformCallback): (WebCore::vertexAttribAndUniformHelperf): (WebCore::uniformHelperi): (WebCore::uniformMatrixHelper): * bindings/v8/custom/V8WebKitMutationObserverCustom.cpp: (WebCore::V8WebKitMutationObserver::constructorCallback): (WebCore::V8WebKitMutationObserver::observeCallback): * bindings/v8/custom/V8WebSocketCustom.cpp: (WebCore::V8WebSocket::constructorCallback): (WebCore::V8WebSocket::sendCallback): * bindings/v8/custom/V8XMLHttpRequestCustom.cpp: (WebCore::V8XMLHttpRequest::openCallback): git-svn-id: svn://svn.chromium.org/blink/trunk@117736 bbb929c8-8fbe-4397-9dbb-9b2b20218538
static v8::Handle<v8::Value> stringAttrWithGetterExceptionAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info) { INC_STATS("DOM.TestObj.stringAttrWithGetterException._get"); TestObj* imp = V8TestObj::toNative(info.Holder()); ExceptionCode ec = 0; String v = imp->stringAttrWithGetterException(ec); if (UNLIKELY(ec)) { V8Proxy::setDOMException(ec, info.GetIsolate()); return v8::Handle<v8::Value>(); } return v8String(v, info.GetIsolate()); }
static v8::Handle<v8::Value> stringAttrWithGetterExceptionAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info) { INC_STATS("DOM.TestObj.stringAttrWithGetterException._get"); TestObj* imp = V8TestObj::toNative(info.Holder()); ExceptionCode ec = 0; String v = imp->stringAttrWithGetterException(ec); if (UNLIKELY(ec)) { V8Proxy::setDOMException(ec, info.GetIsolate()); return v8::Handle<v8::Value>(); } return v8String(v, info.GetIsolate()); }
C
Chrome
0
CVE-2016-5696
https://www.cvedetails.com/cve/CVE-2016-5696/
CWE-200
https://github.com/torvalds/linux/commit/75ff39ccc1bd5d3c455b6822ab09e533c551f758
75ff39ccc1bd5d3c455b6822ab09e533c551f758
tcp: make challenge acks less predictable Yue Cao claims that current host rate limiting of challenge ACKS (RFC 5961) could leak enough information to allow a patient attacker to hijack TCP sessions. He will soon provide details in an academic paper. This patch increases the default limit from 100 to 1000, and adds some randomization so that the attacker can no longer hijack sessions without spending a considerable amount of probes. Based on initial analysis and patch from Linus. Note that we also have per socket rate limiting, so it is tempting to remove the host limit in the future. v2: randomize the count of challenge acks per second, not the period. Fixes: 282f23c6ee34 ("tcp: implement RFC 5961 3.2") Reported-by: Yue Cao <ycao009@ucr.edu> Signed-off-by: Eric Dumazet <edumazet@google.com> Suggested-by: Linus Torvalds <torvalds@linux-foundation.org> Cc: Yuchung Cheng <ycheng@google.com> Cc: Neal Cardwell <ncardwell@google.com> Acked-by: Neal Cardwell <ncardwell@google.com> Acked-by: Yuchung Cheng <ycheng@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
static void tcp_dsack_seen(struct tcp_sock *tp) { tp->rx_opt.sack_ok |= TCP_DSACK_SEEN; }
static void tcp_dsack_seen(struct tcp_sock *tp) { tp->rx_opt.sack_ok |= TCP_DSACK_SEEN; }
C
linux
0
CVE-2012-2890
https://www.cvedetails.com/cve/CVE-2012-2890/
CWE-399
https://github.com/chromium/chromium/commit/eb4bcacd683a68534bbe2e4d8d6eeafafc7f57ba
eb4bcacd683a68534bbe2e4d8d6eeafafc7f57ba
Make chrome.appWindow.create() provide access to the child window at a predictable time. When you first create a window with chrome.appWindow.create(), it won't have loaded any resources. So, at create time, you are guaranteed that: child_window.location.href == 'about:blank' child_window.document.documentElement.outerHTML == '<html><head></head><body></body></html>' This is in line with the behaviour of window.open(). BUG=131735 TEST=browser_tests:PlatformAppBrowserTest.WindowsApi Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=144072 Review URL: https://chromiumcodereview.appspot.com/10644006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@144356 0039d316-1c4b-4281-b951-d872f2087c98
void ResourceDispatcherHostImpl::SetAllowCrossOriginAuthPrompt(bool value) { allow_cross_origin_auth_prompt_ = value; }
void ResourceDispatcherHostImpl::SetAllowCrossOriginAuthPrompt(bool value) { allow_cross_origin_auth_prompt_ = value; }
C
Chrome
0
CVE-2013-0281
https://www.cvedetails.com/cve/CVE-2013-0281/
CWE-399
https://github.com/ClusterLabs/pacemaker/commit/564f7cc2a51dcd2f28ab12a13394f31be5aa3c93
564f7cc2a51dcd2f28ab12a13394f31be5aa3c93
High: core: Internal tls api improvements for reuse with future LRMD tls backend.
init_remote_listener(int port, gboolean encrypted) { int rc; int *ssock = NULL; struct sockaddr_in saddr; int optval; static struct mainloop_fd_callbacks remote_listen_fd_callbacks = { .dispatch = cib_remote_listen, .destroy = remote_connection_destroy, }; if (port <= 0) { /* dont start it */ return 0; } if (encrypted) { #ifndef HAVE_GNUTLS_GNUTLS_H crm_warn("TLS support is not available"); return 0; #else crm_notice("Starting a tls listener on port %d.", port); gnutls_global_init(); /* gnutls_global_set_log_level (10); */ gnutls_global_set_log_function(debug_log); gnutls_dh_params_init(&dh_params); gnutls_dh_params_generate2(dh_params, DH_BITS); gnutls_anon_allocate_server_credentials(&anon_cred_s); gnutls_anon_set_server_dh_params(anon_cred_s, dh_params); #endif } else { crm_warn("Starting a plain_text listener on port %d.", port); } #ifndef HAVE_PAM crm_warn("PAM is _not_ enabled!"); #endif /* create server socket */ ssock = malloc(sizeof(int)); *ssock = socket(AF_INET, SOCK_STREAM, 0); if (*ssock == -1) { crm_perror(LOG_ERR, "Can not create server socket." ERROR_SUFFIX); free(ssock); return -1; } /* reuse address */ optval = 1; rc = setsockopt(*ssock, SOL_SOCKET, SO_REUSEADDR, &optval, sizeof(optval)); if(rc < 0) { crm_perror(LOG_INFO, "Couldn't allow the reuse of local addresses by our remote listener"); } /* bind server socket */ memset(&saddr, '\0', sizeof(saddr)); saddr.sin_family = AF_INET; saddr.sin_addr.s_addr = INADDR_ANY; saddr.sin_port = htons(port); if (bind(*ssock, (struct sockaddr *)&saddr, sizeof(saddr)) == -1) { crm_perror(LOG_ERR, "Can not bind server socket." ERROR_SUFFIX); close(*ssock); free(ssock); return -2; } if (listen(*ssock, 10) == -1) { crm_perror(LOG_ERR, "Can not start listen." ERROR_SUFFIX); close(*ssock); free(ssock); return -3; } mainloop_add_fd("cib-remote", G_PRIORITY_DEFAULT, *ssock, ssock, &remote_listen_fd_callbacks); return *ssock; }
init_remote_listener(int port, gboolean encrypted) { int rc; int *ssock = NULL; struct sockaddr_in saddr; int optval; static struct mainloop_fd_callbacks remote_listen_fd_callbacks = { .dispatch = cib_remote_listen, .destroy = remote_connection_destroy, }; if (port <= 0) { /* dont start it */ return 0; } if (encrypted) { #ifndef HAVE_GNUTLS_GNUTLS_H crm_warn("TLS support is not available"); return 0; #else crm_notice("Starting a tls listener on port %d.", port); gnutls_global_init(); /* gnutls_global_set_log_level (10); */ gnutls_global_set_log_function(debug_log); gnutls_dh_params_init(&dh_params); gnutls_dh_params_generate2(dh_params, DH_BITS); gnutls_anon_allocate_server_credentials(&anon_cred_s); gnutls_anon_set_server_dh_params(anon_cred_s, dh_params); #endif } else { crm_warn("Starting a plain_text listener on port %d.", port); } #ifndef HAVE_PAM crm_warn("PAM is _not_ enabled!"); #endif /* create server socket */ ssock = malloc(sizeof(int)); *ssock = socket(AF_INET, SOCK_STREAM, 0); if (*ssock == -1) { crm_perror(LOG_ERR, "Can not create server socket." ERROR_SUFFIX); free(ssock); return -1; } /* reuse address */ optval = 1; rc = setsockopt(*ssock, SOL_SOCKET, SO_REUSEADDR, &optval, sizeof(optval)); if(rc < 0) { crm_perror(LOG_INFO, "Couldn't allow the reuse of local addresses by our remote listener"); } /* bind server socket */ memset(&saddr, '\0', sizeof(saddr)); saddr.sin_family = AF_INET; saddr.sin_addr.s_addr = INADDR_ANY; saddr.sin_port = htons(port); if (bind(*ssock, (struct sockaddr *)&saddr, sizeof(saddr)) == -1) { crm_perror(LOG_ERR, "Can not bind server socket." ERROR_SUFFIX); close(*ssock); free(ssock); return -2; } if (listen(*ssock, 10) == -1) { crm_perror(LOG_ERR, "Can not start listen." ERROR_SUFFIX); close(*ssock); free(ssock); return -3; } mainloop_add_fd("cib-remote", G_PRIORITY_DEFAULT, *ssock, ssock, &remote_listen_fd_callbacks); return *ssock; }
C
pacemaker
1
CVE-2016-1908
https://www.cvedetails.com/cve/CVE-2016-1908/
CWE-254
https://anongit.mindrot.org/openssh.git/commit/?id=ed4ce82dbfa8a3a3c8ea6fa0db113c71e234416c
ed4ce82dbfa8a3a3c8ea6fa0db113c71e234416c
null
mux_session_confirm(int id, int success, void *arg) { struct mux_session_confirm_ctx *cctx = arg; const char *display; Channel *c, *cc; int i; Buffer reply; if (cctx == NULL) fatal("%s: cctx == NULL", __func__); if ((c = channel_by_id(id)) == NULL) fatal("%s: no channel for id %d", __func__, id); if ((cc = channel_by_id(c->ctl_chan)) == NULL) fatal("%s: channel %d lacks control channel %d", __func__, id, c->ctl_chan); if (!success) { debug3("%s: sending failure reply", __func__); /* prepare reply */ buffer_init(&reply); buffer_put_int(&reply, MUX_S_FAILURE); buffer_put_int(&reply, cctx->rid); buffer_put_cstring(&reply, "Session open refused by peer"); goto done; } display = getenv("DISPLAY"); if (cctx->want_x_fwd && options.forward_x11 && display != NULL) { char *proto, *data; /* Get reasonable local authentication information. */ if (client_x11_get_proto(display, options.xauth_location, options.forward_x11_trusted, options.forward_x11_timeout, &proto, &data) == 0) { /* Request forwarding with authentication spoofing. */ debug("Requesting X11 forwarding with authentication " "spoofing."); x11_request_forwarding_with_spoofing(id, display, proto, data, 1); /* XXX exit_on_forward_failure */ client_expect_confirm(id, "X11 forwarding", CONFIRM_WARN); } } if (cctx->want_agent_fwd && options.forward_agent) { packet_send(); } client_session2_setup(id, cctx->want_tty, cctx->want_subsys, cctx->term, &cctx->tio, c->rfd, &cctx->cmd, cctx->env); debug3("%s: sending success reply", __func__); /* prepare reply */ buffer_init(&reply); buffer_put_int(&reply, MUX_S_SESSION_OPENED); buffer_put_int(&reply, cctx->rid); buffer_put_int(&reply, c->self); done: /* Send reply */ buffer_put_string(&cc->output, buffer_ptr(&reply), buffer_len(&reply)); buffer_free(&reply); if (cc->mux_pause <= 0) fatal("%s: mux_pause %d", __func__, cc->mux_pause); cc->mux_pause = 0; /* start processing messages again */ c->open_confirm_ctx = NULL; buffer_free(&cctx->cmd); free(cctx->term); if (cctx->env != NULL) { for (i = 0; cctx->env[i] != NULL; i++) free(cctx->env[i]); free(cctx->env); } free(cctx); }
mux_session_confirm(int id, int success, void *arg) { struct mux_session_confirm_ctx *cctx = arg; const char *display; Channel *c, *cc; int i; Buffer reply; if (cctx == NULL) fatal("%s: cctx == NULL", __func__); if ((c = channel_by_id(id)) == NULL) fatal("%s: no channel for id %d", __func__, id); if ((cc = channel_by_id(c->ctl_chan)) == NULL) fatal("%s: channel %d lacks control channel %d", __func__, id, c->ctl_chan); if (!success) { debug3("%s: sending failure reply", __func__); /* prepare reply */ buffer_init(&reply); buffer_put_int(&reply, MUX_S_FAILURE); buffer_put_int(&reply, cctx->rid); buffer_put_cstring(&reply, "Session open refused by peer"); goto done; } display = getenv("DISPLAY"); if (cctx->want_x_fwd && options.forward_x11 && display != NULL) { char *proto, *data; /* Get reasonable local authentication information. */ client_x11_get_proto(display, options.xauth_location, options.forward_x11_trusted, options.forward_x11_timeout, &proto, &data); /* Request forwarding with authentication spoofing. */ debug("Requesting X11 forwarding with authentication " "spoofing."); x11_request_forwarding_with_spoofing(id, display, proto, data, 1); client_expect_confirm(id, "X11 forwarding", CONFIRM_WARN); /* XXX exit_on_forward_failure */ } if (cctx->want_agent_fwd && options.forward_agent) { packet_send(); } client_session2_setup(id, cctx->want_tty, cctx->want_subsys, cctx->term, &cctx->tio, c->rfd, &cctx->cmd, cctx->env); debug3("%s: sending success reply", __func__); /* prepare reply */ buffer_init(&reply); buffer_put_int(&reply, MUX_S_SESSION_OPENED); buffer_put_int(&reply, cctx->rid); buffer_put_int(&reply, c->self); done: /* Send reply */ buffer_put_string(&cc->output, buffer_ptr(&reply), buffer_len(&reply)); buffer_free(&reply); if (cc->mux_pause <= 0) fatal("%s: mux_pause %d", __func__, cc->mux_pause); cc->mux_pause = 0; /* start processing messages again */ c->open_confirm_ctx = NULL; buffer_free(&cctx->cmd); free(cctx->term); if (cctx->env != NULL) { for (i = 0; cctx->env[i] != NULL; i++) free(cctx->env[i]); free(cctx->env); } free(cctx); }
C
mindrot
1
CVE-2013-4160
https://www.cvedetails.com/cve/CVE-2013-4160/
null
https://github.com/mm2/Little-CMS/commit/91c2db7f2559be504211b283bc3a2c631d6f06d9
91c2db7f2559be504211b283bc3a2c631d6f06d9
Non happy-path fixes
cmsBool CMSEXPORT cmsMLUtranslationsCodes(const cmsMLU* mlu, cmsUInt32Number idx, char LanguageCode[3], char CountryCode[3]) { _cmsMLUentry *entry; if (mlu == NULL) return FALSE; if (idx >= (cmsUInt32Number) mlu->UsedEntries) return FALSE; entry = &mlu->Entries[idx]; *(cmsUInt16Number *)LanguageCode = _cmsAdjustEndianess16(entry->Language); *(cmsUInt16Number *)CountryCode = _cmsAdjustEndianess16(entry->Country); return TRUE; }
cmsBool CMSEXPORT cmsMLUtranslationsCodes(const cmsMLU* mlu, cmsUInt32Number idx, char LanguageCode[3], char CountryCode[3]) { _cmsMLUentry *entry; if (mlu == NULL) return FALSE; if (idx >= (cmsUInt32Number) mlu->UsedEntries) return FALSE; entry = &mlu->Entries[idx]; *(cmsUInt16Number *)LanguageCode = _cmsAdjustEndianess16(entry->Language); *(cmsUInt16Number *)CountryCode = _cmsAdjustEndianess16(entry->Country); return TRUE; }
C
Little-CMS
0
CVE-2012-2890
https://www.cvedetails.com/cve/CVE-2012-2890/
CWE-399
https://github.com/chromium/chromium/commit/eb4bcacd683a68534bbe2e4d8d6eeafafc7f57ba
eb4bcacd683a68534bbe2e4d8d6eeafafc7f57ba
Make chrome.appWindow.create() provide access to the child window at a predictable time. When you first create a window with chrome.appWindow.create(), it won't have loaded any resources. So, at create time, you are guaranteed that: child_window.location.href == 'about:blank' child_window.document.documentElement.outerHTML == '<html><head></head><body></body></html>' This is in line with the behaviour of window.open(). BUG=131735 TEST=browser_tests:PlatformAppBrowserTest.WindowsApi Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=144072 Review URL: https://chromiumcodereview.appspot.com/10644006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@144356 0039d316-1c4b-4281-b951-d872f2087c98
void ResourceDispatcherHostImpl::OnUserGesture(WebContentsImpl* contents) { last_user_gesture_time_ = TimeTicks::Now(); }
void ResourceDispatcherHostImpl::OnUserGesture(WebContentsImpl* contents) { last_user_gesture_time_ = TimeTicks::Now(); }
C
Chrome
0
CVE-2015-6761
https://www.cvedetails.com/cve/CVE-2015-6761/
CWE-362
https://github.com/chromium/chromium/commit/fd506b0ac6c7846ae45b5034044fe85c28ee68ac
fd506b0ac6c7846ae45b5034044fe85c28ee68ac
Fix detach with open()ed document leaving parent loading indefinitely Change-Id: I26c2a054b9f1e5eb076acd677e1223058825f6d6 Bug: 803416 Test: fast/loader/document-open-iframe-then-detach.html Change-Id: I26c2a054b9f1e5eb076acd677e1223058825f6d6 Reviewed-on: https://chromium-review.googlesource.com/887298 Reviewed-by: Mike West <mkwst@chromium.org> Commit-Queue: Nate Chapin <japhet@chromium.org> Cr-Commit-Position: refs/heads/master@{#532967}
void DocumentLoader::SetHistoryItemStateForCommit( HistoryItem* old_item, FrameLoadType load_type, HistoryNavigationType navigation_type) { if (!history_item_ || !IsBackForwardLoadType(load_type)) history_item_ = HistoryItem::Create(); history_item_->SetURL(UrlForHistory()); history_item_->SetReferrer(SecurityPolicy::GenerateReferrer( request_.GetReferrerPolicy(), history_item_->Url(), request_.HttpReferrer())); history_item_->SetFormInfoFromRequest(request_); if (!old_item || IsBackForwardLoadType(load_type)) return; HistoryCommitType history_commit_type = LoadTypeToCommitType(load_type); if (navigation_type == HistoryNavigationType::kDifferentDocument && (history_commit_type != kHistoryInertCommit || !EqualIgnoringFragmentIdentifier(old_item->Url(), history_item_->Url()))) return; history_item_->SetDocumentSequenceNumber(old_item->DocumentSequenceNumber()); history_item_->CopyViewStateFrom(old_item); history_item_->SetScrollRestorationType(old_item->ScrollRestorationType()); if (history_commit_type == kHistoryInertCommit && (navigation_type == HistoryNavigationType::kHistoryApi || old_item->Url() == history_item_->Url())) { history_item_->SetStateObject(old_item->StateObject()); history_item_->SetItemSequenceNumber(old_item->ItemSequenceNumber()); } }
void DocumentLoader::SetHistoryItemStateForCommit( HistoryItem* old_item, FrameLoadType load_type, HistoryNavigationType navigation_type) { if (!history_item_ || !IsBackForwardLoadType(load_type)) history_item_ = HistoryItem::Create(); history_item_->SetURL(UrlForHistory()); history_item_->SetReferrer(SecurityPolicy::GenerateReferrer( request_.GetReferrerPolicy(), history_item_->Url(), request_.HttpReferrer())); history_item_->SetFormInfoFromRequest(request_); if (!old_item || IsBackForwardLoadType(load_type)) return; HistoryCommitType history_commit_type = LoadTypeToCommitType(load_type); if (navigation_type == HistoryNavigationType::kDifferentDocument && (history_commit_type != kHistoryInertCommit || !EqualIgnoringFragmentIdentifier(old_item->Url(), history_item_->Url()))) return; history_item_->SetDocumentSequenceNumber(old_item->DocumentSequenceNumber()); history_item_->CopyViewStateFrom(old_item); history_item_->SetScrollRestorationType(old_item->ScrollRestorationType()); if (history_commit_type == kHistoryInertCommit && (navigation_type == HistoryNavigationType::kHistoryApi || old_item->Url() == history_item_->Url())) { history_item_->SetStateObject(old_item->StateObject()); history_item_->SetItemSequenceNumber(old_item->ItemSequenceNumber()); } }
C
Chrome
0
CVE-2013-2168
https://www.cvedetails.com/cve/CVE-2013-2168/
CWE-20
https://cgit.freedesktop.org/dbus/dbus/commit/?id=954d75b2b64e4799f360d2a6bf9cff6d9fee37e7
954d75b2b64e4799f360d2a6bf9cff6d9fee37e7
null
_dbus_fd_set_close_on_exec (intptr_t handle) { if ( !SetHandleInformation( (HANDLE) handle, HANDLE_FLAG_INHERIT | HANDLE_FLAG_PROTECT_FROM_CLOSE, 0 /*disable both flags*/ ) ) { _dbus_win_warn_win_error ("Disabling socket handle inheritance failed:", GetLastError()); } }
_dbus_fd_set_close_on_exec (intptr_t handle) { if ( !SetHandleInformation( (HANDLE) handle, HANDLE_FLAG_INHERIT | HANDLE_FLAG_PROTECT_FROM_CLOSE, 0 /*disable both flags*/ ) ) { _dbus_win_warn_win_error ("Disabling socket handle inheritance failed:", GetLastError()); } }
C
dbus
0
CVE-2011-1292
https://www.cvedetails.com/cve/CVE-2011-1292/
CWE-399
https://github.com/chromium/chromium/commit/5f372f899b8709dac700710b5f0f90959dcf9ecb
5f372f899b8709dac700710b5f0f90959dcf9ecb
Add support for autofill server experiments BUG=none TEST=unit_tests --gtest_filter=AutoFillMetricsTest.QualityMetricsWithExperimentId:AutoFillQueryXmlParserTest.ParseExperimentId Review URL: http://codereview.chromium.org/6260027 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@73216 0039d316-1c4b-4281-b951-d872f2087c98
AutoFillMetrics::~AutoFillMetrics() { }
AutoFillMetrics::~AutoFillMetrics() { }
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 <mustaq@chromium.org> Reviewed-by: Daniel Cheng <dcheng@chromium.org> Cr-Commit-Position: refs/heads/master@{#536728}
String HTMLFormElement::action() const { Document& document = GetDocument(); KURL action_url = document.CompleteURL(attributes_.Action().IsEmpty() ? document.Url().GetString() : attributes_.Action()); return action_url.GetString(); }
String HTMLFormElement::action() const { Document& document = GetDocument(); KURL action_url = document.CompleteURL(attributes_.Action().IsEmpty() ? document.Url().GetString() : attributes_.Action()); return action_url.GetString(); }
C
Chrome
0
CVE-2013-6381
https://www.cvedetails.com/cve/CVE-2013-6381/
CWE-119
https://github.com/torvalds/linux/commit/6fb392b1a63ae36c31f62bc3fc8630b49d602b62
6fb392b1a63ae36c31f62bc3fc8630b49d602b62
qeth: avoid buffer overflow in snmp ioctl Check user-defined length in snmp ioctl request and allow request only if it fits into a qeth command buffer. Signed-off-by: Ursula Braun <ursula.braun@de.ibm.com> Signed-off-by: Frank Blaschka <frank.blaschka@de.ibm.com> Reviewed-by: Heiko Carstens <heicars2@linux.vnet.ibm.com> Reported-by: Nico Golde <nico@ngolde.de> Reported-by: Fabian Yamaguchi <fabs@goesec.de> Cc: <stable@vger.kernel.org> Signed-off-by: David S. Miller <davem@davemloft.net>
static void qeth_free_qdio_buffers(struct qeth_card *card) { int i, j; if (atomic_xchg(&card->qdio.state, QETH_QDIO_UNINITIALIZED) == QETH_QDIO_UNINITIALIZED) return; qeth_free_cq(card); cancel_delayed_work_sync(&card->buffer_reclaim_work); for (j = 0; j < QDIO_MAX_BUFFERS_PER_Q; ++j) { if (card->qdio.in_q->bufs[j].rx_skb) dev_kfree_skb_any(card->qdio.in_q->bufs[j].rx_skb); } kfree(card->qdio.in_q); card->qdio.in_q = NULL; /* inbound buffer pool */ qeth_free_buffer_pool(card); /* free outbound qdio_qs */ if (card->qdio.out_qs) { for (i = 0; i < card->qdio.no_out_queues; ++i) { qeth_clear_outq_buffers(card->qdio.out_qs[i], 1); kfree(card->qdio.out_qs[i]); } kfree(card->qdio.out_qs); card->qdio.out_qs = NULL; } }
static void qeth_free_qdio_buffers(struct qeth_card *card) { int i, j; if (atomic_xchg(&card->qdio.state, QETH_QDIO_UNINITIALIZED) == QETH_QDIO_UNINITIALIZED) return; qeth_free_cq(card); cancel_delayed_work_sync(&card->buffer_reclaim_work); for (j = 0; j < QDIO_MAX_BUFFERS_PER_Q; ++j) { if (card->qdio.in_q->bufs[j].rx_skb) dev_kfree_skb_any(card->qdio.in_q->bufs[j].rx_skb); } kfree(card->qdio.in_q); card->qdio.in_q = NULL; /* inbound buffer pool */ qeth_free_buffer_pool(card); /* free outbound qdio_qs */ if (card->qdio.out_qs) { for (i = 0; i < card->qdio.no_out_queues; ++i) { qeth_clear_outq_buffers(card->qdio.out_qs[i], 1); kfree(card->qdio.out_qs[i]); } kfree(card->qdio.out_qs); card->qdio.out_qs = NULL; } }
C
linux
0
CVE-2013-0889
https://www.cvedetails.com/cve/CVE-2013-0889/
CWE-264
https://github.com/chromium/chromium/commit/1538367452b549d929aabb13d54c85ab99f65cd3
1538367452b549d929aabb13d54c85ab99f65cd3
For "Dangerous" file type, no user gesture will bypass the download warning. BUG=170569 Review URL: https://codereview.chromium.org/12039015 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@178072 0039d316-1c4b-4281-b951-d872f2087c98
void ChromeDownloadManagerDelegate::CheckVisitedReferrerBeforeDone( int32 download_id, const content::DownloadTargetCallback& callback, content::DownloadDangerType danger_type, bool visited_referrer_before) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); DownloadItem* download = download_manager_->GetDownload(download_id); if (!download || (download->GetState() != DownloadItem::IN_PROGRESS)) return; bool should_prompt = (download->GetTargetDisposition() == DownloadItem::TARGET_DISPOSITION_PROMPT); bool is_forced_path = !download->GetForcedFilePath().empty(); FilePath suggested_path; if (!is_forced_path) { FilePath generated_name; GenerateFileNameFromRequest( *download, &generated_name, profile_->GetPrefs()->GetString(prefs::kDefaultCharset)); if (download_prefs_->PromptForDownload()) { if (!download_crx_util::IsExtensionDownload(*download) && !ShouldOpenFileBasedOnExtension(generated_name)) should_prompt = true; } if (download_prefs_->IsDownloadPathManaged()) should_prompt = false; FilePath target_directory; if (should_prompt && !last_download_path_.empty()) target_directory = last_download_path_; else target_directory = download_prefs_->DownloadPath(); suggested_path = target_directory.Append(generated_name); } else { DCHECK(!should_prompt); suggested_path = download->GetForcedFilePath(); } if (ShouldOpenWithWebIntents(download)) { download->SetDisplayName(suggested_path.BaseName()); suggested_path = suggested_path.AddExtension(kWebIntentsFileExtension); } if (danger_type == content::DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS) { if (!should_prompt && !is_forced_path && IsDangerousFile(*download, suggested_path, visited_referrer_before)) { danger_type = content::DOWNLOAD_DANGER_TYPE_DANGEROUS_FILE; } #if defined(FULL_SAFE_BROWSING) DownloadProtectionService* service = GetDownloadProtectionService(); if (service && service->enabled()) { DownloadProtectionService::DownloadInfo info = DownloadProtectionService::DownloadInfo::FromDownloadItem(*download); info.target_file = suggested_path; if (service->IsSupportedDownload(info)) danger_type = content::DOWNLOAD_DANGER_TYPE_MAYBE_DANGEROUS_CONTENT; } #endif } else { DCHECK_EQ(content::DOWNLOAD_DANGER_TYPE_DANGEROUS_URL, danger_type); } #if defined (OS_CHROMEOS) drive::DriveDownloadObserver::SubstituteDriveDownloadPath( profile_, suggested_path, download, base::Bind( &ChromeDownloadManagerDelegate::SubstituteDriveDownloadPathCallback, this, download->GetId(), callback, should_prompt, is_forced_path, danger_type)); #else GetReservedPath( *download, suggested_path, download_prefs_->DownloadPath(), !is_forced_path, base::Bind(&ChromeDownloadManagerDelegate::OnPathReservationAvailable, this, download->GetId(), callback, should_prompt, danger_type)); #endif }
void ChromeDownloadManagerDelegate::CheckVisitedReferrerBeforeDone( int32 download_id, const content::DownloadTargetCallback& callback, content::DownloadDangerType danger_type, bool visited_referrer_before) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); DownloadItem* download = download_manager_->GetDownload(download_id); if (!download || (download->GetState() != DownloadItem::IN_PROGRESS)) return; bool should_prompt = (download->GetTargetDisposition() == DownloadItem::TARGET_DISPOSITION_PROMPT); bool is_forced_path = !download->GetForcedFilePath().empty(); FilePath suggested_path; if (!is_forced_path) { FilePath generated_name; GenerateFileNameFromRequest( *download, &generated_name, profile_->GetPrefs()->GetString(prefs::kDefaultCharset)); if (download_prefs_->PromptForDownload()) { if (!download_crx_util::IsExtensionDownload(*download) && !ShouldOpenFileBasedOnExtension(generated_name)) should_prompt = true; } if (download_prefs_->IsDownloadPathManaged()) should_prompt = false; FilePath target_directory; if (should_prompt && !last_download_path_.empty()) target_directory = last_download_path_; else target_directory = download_prefs_->DownloadPath(); suggested_path = target_directory.Append(generated_name); } else { DCHECK(!should_prompt); suggested_path = download->GetForcedFilePath(); } if (ShouldOpenWithWebIntents(download)) { download->SetDisplayName(suggested_path.BaseName()); suggested_path = suggested_path.AddExtension(kWebIntentsFileExtension); } if (danger_type == content::DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS) { if (!should_prompt && !is_forced_path && IsDangerousFile(*download, suggested_path, visited_referrer_before)) { danger_type = content::DOWNLOAD_DANGER_TYPE_DANGEROUS_FILE; } #if defined(FULL_SAFE_BROWSING) DownloadProtectionService* service = GetDownloadProtectionService(); if (service && service->enabled()) { DownloadProtectionService::DownloadInfo info = DownloadProtectionService::DownloadInfo::FromDownloadItem(*download); info.target_file = suggested_path; if (service->IsSupportedDownload(info)) danger_type = content::DOWNLOAD_DANGER_TYPE_MAYBE_DANGEROUS_CONTENT; } #endif } else { DCHECK_EQ(content::DOWNLOAD_DANGER_TYPE_DANGEROUS_URL, danger_type); } #if defined (OS_CHROMEOS) drive::DriveDownloadObserver::SubstituteDriveDownloadPath( profile_, suggested_path, download, base::Bind( &ChromeDownloadManagerDelegate::SubstituteDriveDownloadPathCallback, this, download->GetId(), callback, should_prompt, is_forced_path, danger_type)); #else GetReservedPath( *download, suggested_path, download_prefs_->DownloadPath(), !is_forced_path, base::Bind(&ChromeDownloadManagerDelegate::OnPathReservationAvailable, this, download->GetId(), callback, should_prompt, danger_type)); #endif }
C
Chrome
0
CVE-2011-3097
https://www.cvedetails.com/cve/CVE-2011-3097/
CWE-20
https://github.com/chromium/chromium/commit/027429ee5abe6e2fb5e3b2b4542f0a6fe0dbc12d
027429ee5abe6e2fb5e3b2b4542f0a6fe0dbc12d
Metrics for measuring how much overhead reading compressed content states adds. BUG=104293 TEST=NONE Review URL: https://chromiumcodereview.appspot.com/9426039 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@123733 0039d316-1c4b-4281-b951-d872f2087c98
void SessionService::SetWindowBounds(const SessionID& window_id, const gfx::Rect& bounds, ui::WindowShowState show_state) { if (!ShouldTrackChangesToWindow(window_id)) return; ScheduleCommand(CreateSetWindowBoundsCommand(window_id, bounds, show_state)); }
void SessionService::SetWindowBounds(const SessionID& window_id, const gfx::Rect& bounds, ui::WindowShowState show_state) { if (!ShouldTrackChangesToWindow(window_id)) return; ScheduleCommand(CreateSetWindowBoundsCommand(window_id, bounds, show_state)); }
C
Chrome
0
CVE-2017-16939
https://www.cvedetails.com/cve/CVE-2017-16939/
CWE-416
https://github.com/torvalds/linux/commit/1137b5e2529a8f5ca8ee709288ecba3e68044df2
1137b5e2529a8f5ca8ee709288ecba3e68044df2
ipsec: Fix aborted xfrm policy dump crash An independent security researcher, Mohamed Ghannam, has reported this vulnerability to Beyond Security's SecuriTeam Secure Disclosure program. The xfrm_dump_policy_done function expects xfrm_dump_policy to have been called at least once or it will crash. This can be triggered if a dump fails because the target socket's receive buffer is full. This patch fixes it by using the cb->start mechanism to ensure that the initialisation is always done regardless of the buffer situation. Fixes: 12a169e7d8f4 ("ipsec: Put dumpers on the dump list") Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
static int xfrm_do_migrate(struct sk_buff *skb, struct nlmsghdr *nlh, struct nlattr **attrs) { struct xfrm_userpolicy_id *pi = nlmsg_data(nlh); struct xfrm_migrate m[XFRM_MAX_DEPTH]; struct xfrm_kmaddress km, *kmp; u8 type; int err; int n = 0; struct net *net = sock_net(skb->sk); struct xfrm_encap_tmpl *encap = NULL; if (attrs[XFRMA_MIGRATE] == NULL) return -EINVAL; kmp = attrs[XFRMA_KMADDRESS] ? &km : NULL; err = copy_from_user_policy_type(&type, attrs); if (err) return err; err = copy_from_user_migrate((struct xfrm_migrate *)m, kmp, attrs, &n); if (err) return err; if (!n) return 0; if (attrs[XFRMA_ENCAP]) { encap = kmemdup(nla_data(attrs[XFRMA_ENCAP]), sizeof(*encap), GFP_KERNEL); if (!encap) return 0; } err = xfrm_migrate(&pi->sel, pi->dir, type, m, n, kmp, net, encap); kfree(encap); return err; }
static int xfrm_do_migrate(struct sk_buff *skb, struct nlmsghdr *nlh, struct nlattr **attrs) { struct xfrm_userpolicy_id *pi = nlmsg_data(nlh); struct xfrm_migrate m[XFRM_MAX_DEPTH]; struct xfrm_kmaddress km, *kmp; u8 type; int err; int n = 0; struct net *net = sock_net(skb->sk); struct xfrm_encap_tmpl *encap = NULL; if (attrs[XFRMA_MIGRATE] == NULL) return -EINVAL; kmp = attrs[XFRMA_KMADDRESS] ? &km : NULL; err = copy_from_user_policy_type(&type, attrs); if (err) return err; err = copy_from_user_migrate((struct xfrm_migrate *)m, kmp, attrs, &n); if (err) return err; if (!n) return 0; if (attrs[XFRMA_ENCAP]) { encap = kmemdup(nla_data(attrs[XFRMA_ENCAP]), sizeof(*encap), GFP_KERNEL); if (!encap) return 0; } err = xfrm_migrate(&pi->sel, pi->dir, type, m, n, kmp, net, encap); kfree(encap); return err; }
C
linux
0
CVE-2016-4303
https://www.cvedetails.com/cve/CVE-2016-4303/
CWE-119
https://github.com/esnet/iperf/commit/91f2fa59e8ed80dfbf400add0164ee0e508e412a
91f2fa59e8ed80dfbf400add0164ee0e508e412a
Fix a buffer overflow / heap corruption issue that could occur if a malformed JSON string was passed on the control channel. This issue, present in the cJSON library, was already fixed upstream, so was addressed here in iperf3 by importing a newer version of cJSON (plus local ESnet modifications). Discovered and reported by Dave McDaniel, Cisco Talos. Based on a patch by @dopheide-esnet, with input from @DaveGamble. Cross-references: TALOS-CAN-0164, ESNET-SECADV-2016-0001, CVE-2016-4303 (cherry picked from commit ed94082be27d971a5e1b08b666e2c217cf470a40) Signed-off-by: Bruce A. Mah <bmah@es.net>
iperf_set_test_one_off(struct iperf_test *ipt, int one_off) { ipt->one_off = one_off; }
iperf_set_test_one_off(struct iperf_test *ipt, int one_off) { ipt->one_off = one_off; }
C
iperf
0