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
null
null
null
https://github.com/chromium/chromium/commit/fc790462b4f248712bbc8c3734664dd6b05f80f2
fc790462b4f248712bbc8c3734664dd6b05f80f2
Set the job name for the print job on the Mac. BUG=http://crbug.com/29188 TEST=as in bug Review URL: http://codereview.chromium.org/1997016 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@47056 0039d316-1c4b-4281-b951-d872f2087c98
ChromeURLRequestContext* ResourceMessageFilter::GetRequestContextForURL( const GURL& url) { DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO)); URLRequestContextGetter* context_getter = url.SchemeIs(chrome::kExtensionScheme) ? extensions_request_context_ : request_context_; return static_cast<ChromeURLRequestContext*>( context_getter->GetURLRequestContext()); }
ChromeURLRequestContext* ResourceMessageFilter::GetRequestContextForURL( const GURL& url) { DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO)); URLRequestContextGetter* context_getter = url.SchemeIs(chrome::kExtensionScheme) ? extensions_request_context_ : request_context_; return static_cast<ChromeURLRequestContext*>( context_getter->GetURLRequestContext()); }
C
Chrome
0
CVE-2017-9059
https://www.cvedetails.com/cve/CVE-2017-9059/
CWE-404
https://github.com/torvalds/linux/commit/c70422f760c120480fee4de6c38804c72aa26bc1
c70422f760c120480fee4de6c38804c72aa26bc1
Merge tag 'nfsd-4.12' of git://linux-nfs.org/~bfields/linux Pull nfsd updates from Bruce Fields: "Another RDMA update from Chuck Lever, and a bunch of miscellaneous bugfixes" * tag 'nfsd-4.12' of git://linux-nfs.org/~bfields/linux: (26 commits) nfsd: Fix up the "supattr_exclcreat" attributes nfsd: encoders mustn't use unitialized values in error cases nfsd: fix undefined behavior in nfsd4_layout_verify lockd: fix lockd shutdown race NFSv4: Fix callback server shutdown SUNRPC: Refactor svc_set_num_threads() NFSv4.x/callback: Create the callback service through svc_create_pooled lockd: remove redundant check on block svcrdma: Clean out old XDR encoders svcrdma: Remove the req_map cache svcrdma: Remove unused RDMA Write completion handler svcrdma: Reduce size of sge array in struct svc_rdma_op_ctxt svcrdma: Clean up RPC-over-RDMA backchannel reply processing svcrdma: Report Write/Reply chunk overruns svcrdma: Clean up RDMA_ERROR path svcrdma: Use rdma_rw API in RPC reply path svcrdma: Introduce local rdma_rw API helpers svcrdma: Clean up svc_rdma_get_inv_rkey() svcrdma: Add helper to save pages under I/O svcrdma: Eliminate RPCRDMA_SQ_DEPTH_MULT ...
nfsd4_encode_exchange_id(struct nfsd4_compoundres *resp, __be32 nfserr, struct nfsd4_exchange_id *exid) { struct xdr_stream *xdr = &resp->xdr; __be32 *p; char *major_id; char *server_scope; int major_id_sz; int server_scope_sz; int status = 0; uint64_t minor_id = 0; if (nfserr) return nfserr; major_id = utsname()->nodename; major_id_sz = strlen(major_id); server_scope = utsname()->nodename; server_scope_sz = strlen(server_scope); p = xdr_reserve_space(xdr, 8 /* eir_clientid */ + 4 /* eir_sequenceid */ + 4 /* eir_flags */ + 4 /* spr_how */); if (!p) return nfserr_resource; p = xdr_encode_opaque_fixed(p, &exid->clientid, 8); *p++ = cpu_to_be32(exid->seqid); *p++ = cpu_to_be32(exid->flags); *p++ = cpu_to_be32(exid->spa_how); switch (exid->spa_how) { case SP4_NONE: break; case SP4_MACH_CRED: /* spo_must_enforce bitmap: */ status = nfsd4_encode_bitmap(xdr, exid->spo_must_enforce[0], exid->spo_must_enforce[1], exid->spo_must_enforce[2]); if (status) goto out; /* spo_must_allow bitmap: */ status = nfsd4_encode_bitmap(xdr, exid->spo_must_allow[0], exid->spo_must_allow[1], exid->spo_must_allow[2]); if (status) goto out; break; default: WARN_ON_ONCE(1); } p = xdr_reserve_space(xdr, 8 /* so_minor_id */ + 4 /* so_major_id.len */ + (XDR_QUADLEN(major_id_sz) * 4) + 4 /* eir_server_scope.len */ + (XDR_QUADLEN(server_scope_sz) * 4) + 4 /* eir_server_impl_id.count (0) */); if (!p) return nfserr_resource; /* The server_owner struct */ p = xdr_encode_hyper(p, minor_id); /* Minor id */ /* major id */ p = xdr_encode_opaque(p, major_id, major_id_sz); /* Server scope */ p = xdr_encode_opaque(p, server_scope, server_scope_sz); /* Implementation id */ *p++ = cpu_to_be32(0); /* zero length nfs_impl_id4 array */ return 0; out: return status; }
nfsd4_encode_exchange_id(struct nfsd4_compoundres *resp, __be32 nfserr, struct nfsd4_exchange_id *exid) { struct xdr_stream *xdr = &resp->xdr; __be32 *p; char *major_id; char *server_scope; int major_id_sz; int server_scope_sz; int status = 0; uint64_t minor_id = 0; if (nfserr) return nfserr; major_id = utsname()->nodename; major_id_sz = strlen(major_id); server_scope = utsname()->nodename; server_scope_sz = strlen(server_scope); p = xdr_reserve_space(xdr, 8 /* eir_clientid */ + 4 /* eir_sequenceid */ + 4 /* eir_flags */ + 4 /* spr_how */); if (!p) return nfserr_resource; p = xdr_encode_opaque_fixed(p, &exid->clientid, 8); *p++ = cpu_to_be32(exid->seqid); *p++ = cpu_to_be32(exid->flags); *p++ = cpu_to_be32(exid->spa_how); switch (exid->spa_how) { case SP4_NONE: break; case SP4_MACH_CRED: /* spo_must_enforce bitmap: */ status = nfsd4_encode_bitmap(xdr, exid->spo_must_enforce[0], exid->spo_must_enforce[1], exid->spo_must_enforce[2]); if (status) goto out; /* spo_must_allow bitmap: */ status = nfsd4_encode_bitmap(xdr, exid->spo_must_allow[0], exid->spo_must_allow[1], exid->spo_must_allow[2]); if (status) goto out; break; default: WARN_ON_ONCE(1); } p = xdr_reserve_space(xdr, 8 /* so_minor_id */ + 4 /* so_major_id.len */ + (XDR_QUADLEN(major_id_sz) * 4) + 4 /* eir_server_scope.len */ + (XDR_QUADLEN(server_scope_sz) * 4) + 4 /* eir_server_impl_id.count (0) */); if (!p) return nfserr_resource; /* The server_owner struct */ p = xdr_encode_hyper(p, minor_id); /* Minor id */ /* major id */ p = xdr_encode_opaque(p, major_id, major_id_sz); /* Server scope */ p = xdr_encode_opaque(p, server_scope, server_scope_sz); /* Implementation id */ *p++ = cpu_to_be32(0); /* zero length nfs_impl_id4 array */ return 0; out: return status; }
C
linux
0
CVE-2017-11447
https://www.cvedetails.com/cve/CVE-2017-11447/
CWE-772
https://github.com/ImageMagick/ImageMagick/commit/8c10b9247509c0484b55330458846115131ec2ae
8c10b9247509c0484b55330458846115131ec2ae
Fixed potential memory leak.
static Image *ReadSCREENSHOTImage(const ImageInfo *image_info, ExceptionInfo *exception) { Image *image; assert(image_info->signature == MagickSignature); if (image_info->debug != MagickFalse) (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s", image_info->filename); assert(exception != (ExceptionInfo *) NULL); assert(exception->signature == MagickSignature); image=(Image *) NULL; #if defined(MAGICKCORE_WINGDI32_DELEGATE) { BITMAPINFO bmi; DISPLAY_DEVICE device; HBITMAP bitmap, bitmapOld; HDC bitmapDC, hDC; Image *screen; int i; MagickBooleanType status; register PixelPacket *q; register ssize_t x; RGBTRIPLE *p; ssize_t y; assert(image_info != (const ImageInfo *) NULL); i=0; device.cb = sizeof(device); image=(Image *) NULL; while(EnumDisplayDevices(NULL,i,&device,0) && ++i) { if ((device.StateFlags & DISPLAY_DEVICE_ACTIVE) != DISPLAY_DEVICE_ACTIVE) continue; hDC=CreateDC(device.DeviceName,device.DeviceName,NULL,NULL); if (hDC == (HDC) NULL) ThrowReaderException(CoderError,"UnableToCreateDC"); screen=AcquireImage(image_info); screen->columns=(size_t) GetDeviceCaps(hDC,HORZRES); screen->rows=(size_t) GetDeviceCaps(hDC,VERTRES); screen->storage_class=DirectClass; if (image == (Image *) NULL) image=screen; else AppendImageToList(&image,screen); status=SetImageExtent(screen,screen->columns,screen->rows); if (status == MagickFalse) { InheritException(exception,&image->exception); return(DestroyImageList(image)); } bitmapDC=CreateCompatibleDC(hDC); if (bitmapDC == (HDC) NULL) { DeleteDC(hDC); ThrowReaderException(CoderError,"UnableToCreateDC"); } (void) ResetMagickMemory(&bmi,0,sizeof(BITMAPINFO)); bmi.bmiHeader.biSize=sizeof(BITMAPINFOHEADER); bmi.bmiHeader.biWidth=(LONG) screen->columns; bmi.bmiHeader.biHeight=(-1)*(LONG) screen->rows; bmi.bmiHeader.biPlanes=1; bmi.bmiHeader.biBitCount=24; bmi.bmiHeader.biCompression=BI_RGB; bitmap=CreateDIBSection(hDC,&bmi,DIB_RGB_COLORS,(void **) &p,NULL,0); if (bitmap == (HBITMAP) NULL) { DeleteDC(hDC); DeleteDC(bitmapDC); ThrowReaderException(CoderError,"UnableToCreateBitmap"); } bitmapOld=(HBITMAP) SelectObject(bitmapDC,bitmap); if (bitmapOld == (HBITMAP) NULL) { DeleteDC(hDC); DeleteDC(bitmapDC); DeleteObject(bitmap); ThrowReaderException(CoderError,"UnableToCreateBitmap"); } BitBlt(bitmapDC,0,0,(int) screen->columns,(int) screen->rows,hDC,0,0, SRCCOPY); (void) SelectObject(bitmapDC,bitmapOld); for (y=0; y < (ssize_t) screen->rows; y++) { q=QueueAuthenticPixels(screen,0,y,screen->columns,1,exception); if (q == (PixelPacket *) NULL) break; for (x=0; x < (ssize_t) screen->columns; x++) { SetPixelRed(q,ScaleCharToQuantum(p->rgbtRed)); SetPixelGreen(q,ScaleCharToQuantum(p->rgbtGreen)); SetPixelBlue(q,ScaleCharToQuantum(p->rgbtBlue)); SetPixelOpacity(q,OpaqueOpacity); p++; q++; } if (SyncAuthenticPixels(screen,exception) == MagickFalse) break; } DeleteDC(hDC); DeleteDC(bitmapDC); DeleteObject(bitmap); } } #elif defined(MAGICKCORE_X11_DELEGATE) { const char *option; XImportInfo ximage_info; (void) exception; XGetImportInfo(&ximage_info); option=GetImageOption(image_info,"x:screen"); if (option != (const char *) NULL) ximage_info.screen=IsMagickTrue(option); option=GetImageOption(image_info,"x:silent"); if (option != (const char *) NULL) ximage_info.silent=IsMagickTrue(option); image=XImportImage(image_info,&ximage_info); } #endif return(image); }
static Image *ReadSCREENSHOTImage(const ImageInfo *image_info, ExceptionInfo *exception) { Image *image; assert(image_info->signature == MagickSignature); if (image_info->debug != MagickFalse) (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s", image_info->filename); assert(exception != (ExceptionInfo *) NULL); assert(exception->signature == MagickSignature); image=(Image *) NULL; #if defined(MAGICKCORE_WINGDI32_DELEGATE) { BITMAPINFO bmi; DISPLAY_DEVICE device; HBITMAP bitmap, bitmapOld; HDC bitmapDC, hDC; Image *screen; int i; MagickBooleanType status; register PixelPacket *q; register ssize_t x; RGBTRIPLE *p; ssize_t y; assert(image_info != (const ImageInfo *) NULL); i=0; device.cb = sizeof(device); image=(Image *) NULL; while(EnumDisplayDevices(NULL,i,&device,0) && ++i) { if ((device.StateFlags & DISPLAY_DEVICE_ACTIVE) != DISPLAY_DEVICE_ACTIVE) continue; hDC=CreateDC(device.DeviceName,device.DeviceName,NULL,NULL); if (hDC == (HDC) NULL) ThrowReaderException(CoderError,"UnableToCreateDC"); screen=AcquireImage(image_info); screen->columns=(size_t) GetDeviceCaps(hDC,HORZRES); screen->rows=(size_t) GetDeviceCaps(hDC,VERTRES); screen->storage_class=DirectClass; status=SetImageExtent(screen,screen->columns,screen->rows); if (status == MagickFalse) { InheritException(exception,&image->exception); return(DestroyImageList(image)); } if (image == (Image *) NULL) image=screen; else AppendImageToList(&image,screen); bitmapDC=CreateCompatibleDC(hDC); if (bitmapDC == (HDC) NULL) { DeleteDC(hDC); ThrowReaderException(CoderError,"UnableToCreateDC"); } (void) ResetMagickMemory(&bmi,0,sizeof(BITMAPINFO)); bmi.bmiHeader.biSize=sizeof(BITMAPINFOHEADER); bmi.bmiHeader.biWidth=(LONG) screen->columns; bmi.bmiHeader.biHeight=(-1)*(LONG) screen->rows; bmi.bmiHeader.biPlanes=1; bmi.bmiHeader.biBitCount=24; bmi.bmiHeader.biCompression=BI_RGB; bitmap=CreateDIBSection(hDC,&bmi,DIB_RGB_COLORS,(void **) &p,NULL,0); if (bitmap == (HBITMAP) NULL) { DeleteDC(hDC); DeleteDC(bitmapDC); ThrowReaderException(CoderError,"UnableToCreateBitmap"); } bitmapOld=(HBITMAP) SelectObject(bitmapDC,bitmap); if (bitmapOld == (HBITMAP) NULL) { DeleteDC(hDC); DeleteDC(bitmapDC); DeleteObject(bitmap); ThrowReaderException(CoderError,"UnableToCreateBitmap"); } BitBlt(bitmapDC,0,0,(int) screen->columns,(int) screen->rows,hDC,0,0, SRCCOPY); (void) SelectObject(bitmapDC,bitmapOld); for (y=0; y < (ssize_t) screen->rows; y++) { q=QueueAuthenticPixels(screen,0,y,screen->columns,1,exception); if (q == (PixelPacket *) NULL) break; for (x=0; x < (ssize_t) screen->columns; x++) { SetPixelRed(q,ScaleCharToQuantum(p->rgbtRed)); SetPixelGreen(q,ScaleCharToQuantum(p->rgbtGreen)); SetPixelBlue(q,ScaleCharToQuantum(p->rgbtBlue)); SetPixelOpacity(q,OpaqueOpacity); p++; q++; } if (SyncAuthenticPixels(screen,exception) == MagickFalse) break; } DeleteDC(hDC); DeleteDC(bitmapDC); DeleteObject(bitmap); } } #elif defined(MAGICKCORE_X11_DELEGATE) { const char *option; XImportInfo ximage_info; (void) exception; XGetImportInfo(&ximage_info); option=GetImageOption(image_info,"x:screen"); if (option != (const char *) NULL) ximage_info.screen=IsMagickTrue(option); option=GetImageOption(image_info,"x:silent"); if (option != (const char *) NULL) ximage_info.silent=IsMagickTrue(option); image=XImportImage(image_info,&ximage_info); } #endif return(image); }
C
ImageMagick
1
CVE-2016-1621
https://www.cvedetails.com/cve/CVE-2016-1621/
CWE-119
https://android.googlesource.com/platform/external/libvpx/+/5a9753fca56f0eeb9f61e342b2fccffc364f9426
5a9753fca56f0eeb9f61e342b2fccffc364f9426
Merge Conflict Fix CL to lmp-mr1-release for ag/849478 DO NOT MERGE - libvpx: Pull from upstream Current HEAD: 7105df53d7dc13d5e575bc8df714ec8d1da36b06 BUG=23452792 Change-Id: Ic78176fc369e0bacc71d423e0e2e6075d004aaec
vpx_codec_err_t DecodeOneFrame() { const vpx_codec_err_t res = decoder_->DecodeFrame(video_->cxdata(), video_->frame_size()); CheckDecodedFrames(); if (res == VPX_CODEC_OK) video_->Next(); return res; }
vpx_codec_err_t DecodeOneFrame() { const vpx_codec_err_t res = decoder_->DecodeFrame(video_->cxdata(), video_->frame_size()); CheckDecodedFrames(); if (res == VPX_CODEC_OK) video_->Next(); return res; }
C
Android
0
CVE-2013-2874
https://www.cvedetails.com/cve/CVE-2013-2874/
CWE-264
https://github.com/chromium/chromium/commit/c0da7c1c6e9ffe5006e146b6426f987238d4bf2e
c0da7c1c6e9ffe5006e146b6426f987238d4bf2e
DevTools: handle devtools renderer unresponsiveness during beforeunload event interception This patch fixes the crash which happenes under the following conditions: 1. DevTools window is in undocked state 2. DevTools renderer is unresponsive 3. User attempts to close inspected page BUG=322380 Review URL: https://codereview.chromium.org/84883002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@237611 0039d316-1c4b-4281-b951-d872f2087c98
DevToolsWindow* OpenDevToolWindowOnWebContents( content::WebContents* contents) { content::WindowedNotificationObserver observer( content::NOTIFICATION_LOAD_STOP, content::NotificationService::AllSources()); DevToolsWindow* window = DevToolsWindow::OpenDevToolsWindow( contents->GetRenderViewHost()); observer.Wait(); return window; }
DevToolsWindow* OpenDevToolWindowOnWebContents( content::WebContents* contents) { content::WindowedNotificationObserver observer( content::NOTIFICATION_LOAD_STOP, content::NotificationService::AllSources()); DevToolsWindow* window = DevToolsWindow::OpenDevToolsWindow( contents->GetRenderViewHost()); observer.Wait(); return window; }
C
Chrome
0
CVE-2016-7097
https://www.cvedetails.com/cve/CVE-2016-7097/
CWE-285
https://github.com/torvalds/linux/commit/073931017b49d9458aa351605b43a7e34598caef
073931017b49d9458aa351605b43a7e34598caef
posix_acl: Clear SGID bit when setting file permissions When file permissions are modified via chmod(2) and the user is not in the owning group or capable of CAP_FSETID, the setgid bit is cleared in inode_change_ok(). Setting a POSIX ACL via setxattr(2) sets the file permissions as well as the new ACL, but doesn't clear the setgid bit in a similar way; this allows to bypass the check in chmod(2). Fix that. References: CVE-2016-7097 Reviewed-by: Christoph Hellwig <[email protected]> Reviewed-by: Jeff Layton <[email protected]> Signed-off-by: Jan Kara <[email protected]> Signed-off-by: Andreas Gruenbacher <[email protected]>
__xfs_set_acl(struct inode *inode, int type, struct posix_acl *acl) { struct xfs_inode *ip = XFS_I(inode); unsigned char *ea_name; int error; switch (type) { case ACL_TYPE_ACCESS: ea_name = SGI_ACL_FILE; break; case ACL_TYPE_DEFAULT: if (!S_ISDIR(inode->i_mode)) return acl ? -EACCES : 0; ea_name = SGI_ACL_DEFAULT; break; default: return -EINVAL; } if (acl) { struct xfs_acl *xfs_acl; int len = XFS_ACL_MAX_SIZE(ip->i_mount); xfs_acl = kmem_zalloc_large(len, KM_SLEEP); if (!xfs_acl) return -ENOMEM; xfs_acl_to_disk(xfs_acl, acl); /* subtract away the unused acl entries */ len -= sizeof(struct xfs_acl_entry) * (XFS_ACL_MAX_ENTRIES(ip->i_mount) - acl->a_count); error = xfs_attr_set(ip, ea_name, (unsigned char *)xfs_acl, len, ATTR_ROOT); kmem_free(xfs_acl); } else { /* * A NULL ACL argument means we want to remove the ACL. */ error = xfs_attr_remove(ip, ea_name, ATTR_ROOT); /* * If the attribute didn't exist to start with that's fine. */ if (error == -ENOATTR) error = 0; } if (!error) set_cached_acl(inode, type, acl); return error; }
__xfs_set_acl(struct inode *inode, int type, struct posix_acl *acl) { struct xfs_inode *ip = XFS_I(inode); unsigned char *ea_name; int error; switch (type) { case ACL_TYPE_ACCESS: ea_name = SGI_ACL_FILE; break; case ACL_TYPE_DEFAULT: if (!S_ISDIR(inode->i_mode)) return acl ? -EACCES : 0; ea_name = SGI_ACL_DEFAULT; break; default: return -EINVAL; } if (acl) { struct xfs_acl *xfs_acl; int len = XFS_ACL_MAX_SIZE(ip->i_mount); xfs_acl = kmem_zalloc_large(len, KM_SLEEP); if (!xfs_acl) return -ENOMEM; xfs_acl_to_disk(xfs_acl, acl); /* subtract away the unused acl entries */ len -= sizeof(struct xfs_acl_entry) * (XFS_ACL_MAX_ENTRIES(ip->i_mount) - acl->a_count); error = xfs_attr_set(ip, ea_name, (unsigned char *)xfs_acl, len, ATTR_ROOT); kmem_free(xfs_acl); } else { /* * A NULL ACL argument means we want to remove the ACL. */ error = xfs_attr_remove(ip, ea_name, ATTR_ROOT); /* * If the attribute didn't exist to start with that's fine. */ if (error == -ENOATTR) error = 0; } if (!error) set_cached_acl(inode, type, acl); return error; }
C
linux
0
CVE-2018-6135
https://www.cvedetails.com/cve/CVE-2018-6135/
null
https://github.com/chromium/chromium/commit/2ccbb407dccc976ae4bdbaa5ff2f777f4eb0723b
2ccbb407dccc976ae4bdbaa5ff2f777f4eb0723b
Force a flush of drawing to the widget when a dialog is shown. BUG=823353 TEST=as in bug Change-Id: I5da777068fc29c5638ef02d50e59d5d7b2729260 Reviewed-on: https://chromium-review.googlesource.com/971661 Reviewed-by: Ken Buchanan <[email protected]> Commit-Queue: Avi Drissman <[email protected]> Cr-Commit-Position: refs/heads/master@{#544518}
void WebContentsImpl::WasShown() { const Visibility previous_visibility = GetVisibility(); controller_.SetActive(true); if (auto* view = GetRenderWidgetHostView()) { view->Show(); #if defined(OS_MACOSX) view->SetActive(true); #endif } if (!ShowingInterstitialPage()) SetVisibilityForChildViews(true); SendPageMessage(new PageMsg_WasShown(MSG_ROUTING_NONE)); last_active_time_ = base::TimeTicks::Now(); should_normally_be_visible_ = true; NotifyVisibilityChanged(previous_visibility); }
void WebContentsImpl::WasShown() { const Visibility previous_visibility = GetVisibility(); controller_.SetActive(true); if (auto* view = GetRenderWidgetHostView()) { view->Show(); #if defined(OS_MACOSX) view->SetActive(true); #endif } if (!ShowingInterstitialPage()) SetVisibilityForChildViews(true); SendPageMessage(new PageMsg_WasShown(MSG_ROUTING_NONE)); last_active_time_ = base::TimeTicks::Now(); should_normally_be_visible_ = true; NotifyVisibilityChanged(previous_visibility); }
C
Chrome
0
CVE-2017-5044
https://www.cvedetails.com/cve/CVE-2017-5044/
CWE-119
https://github.com/chromium/chromium/commit/62154472bd2c43e1790dd1bd8a527c1db9118d88
62154472bd2c43e1790dd1bd8a527c1db9118d88
bluetooth: Implement getAvailability() This change implements the getAvailability() method for navigator.bluetooth as defined in the specification. Bug: 707640 Change-Id: I9e9b3e7f8ea7f259e975f71cb6d9570e5f04b479 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1651516 Reviewed-by: Chris Harrelson <[email protected]> Reviewed-by: Giovanni Ortuño Urquidi <[email protected]> Reviewed-by: Kinuko Yasuda <[email protected]> Commit-Queue: Ovidio de Jesús Ruiz-Henríquez <[email protected]> Auto-Submit: Ovidio de Jesús Ruiz-Henríquez <[email protected]> Cr-Commit-Position: refs/heads/master@{#688987}
void FakeCentral::GetLastWrittenDescriptorValue( const std::string& descriptor_id, const std::string& characteristic_id, const std::string& service_id, const std::string& peripheral_address, GetLastWrittenDescriptorValueCallback callback) { FakeRemoteGattDescriptor* fake_remote_gatt_descriptor = GetFakeRemoteGattDescriptor(peripheral_address, service_id, characteristic_id, descriptor_id); if (!fake_remote_gatt_descriptor) { std::move(callback).Run(false, base::nullopt); } std::move(callback).Run(true, fake_remote_gatt_descriptor->last_written_value()); }
void FakeCentral::GetLastWrittenDescriptorValue( const std::string& descriptor_id, const std::string& characteristic_id, const std::string& service_id, const std::string& peripheral_address, GetLastWrittenDescriptorValueCallback callback) { FakeRemoteGattDescriptor* fake_remote_gatt_descriptor = GetFakeRemoteGattDescriptor(peripheral_address, service_id, characteristic_id, descriptor_id); if (!fake_remote_gatt_descriptor) { std::move(callback).Run(false, base::nullopt); } std::move(callback).Run(true, fake_remote_gatt_descriptor->last_written_value()); }
C
Chrome
0
CVE-2013-2635
https://www.cvedetails.com/cve/CVE-2013-2635/
CWE-399
https://github.com/torvalds/linux/commit/84d73cd3fb142bf1298a8c13fd4ca50fd2432372
84d73cd3fb142bf1298a8c13fd4ca50fd2432372
rtnl: fix info leak on RTM_GETLINK request for VF devices Initialize the mac address buffer with 0 as the driver specific function will probably not fill the whole buffer. In fact, all in-kernel drivers fill only ETH_ALEN of the MAX_ADDR_LEN bytes, i.e. 6 of the 32 possible bytes. Therefore we currently leak 26 bytes of stack memory to userland via the netlink interface. Signed-off-by: Mathias Krause <[email protected]> Signed-off-by: David S. Miller <[email protected]>
static int rtnl_port_self_fill(struct sk_buff *skb, struct net_device *dev) { struct nlattr *port_self; int err; port_self = nla_nest_start(skb, IFLA_PORT_SELF); if (!port_self) return -EMSGSIZE; err = dev->netdev_ops->ndo_get_vf_port(dev, PORT_SELF_VF, skb); if (err) { nla_nest_cancel(skb, port_self); return (err == -EMSGSIZE) ? err : 0; } nla_nest_end(skb, port_self); return 0; }
static int rtnl_port_self_fill(struct sk_buff *skb, struct net_device *dev) { struct nlattr *port_self; int err; port_self = nla_nest_start(skb, IFLA_PORT_SELF); if (!port_self) return -EMSGSIZE; err = dev->netdev_ops->ndo_get_vf_port(dev, PORT_SELF_VF, skb); if (err) { nla_nest_cancel(skb, port_self); return (err == -EMSGSIZE) ? err : 0; } nla_nest_end(skb, port_self); return 0; }
C
linux
0
CVE-2018-1000039
https://www.cvedetails.com/cve/CVE-2018-1000039/
CWE-416
http://git.ghostscript.com/?p=mupdf.git;a=commitdiff;h=f597300439e62f5e921f0d7b1e880b5c1a1f1607;hp=093fc3b098dc5fadef5d8ad4b225db9fb124758b
f597300439e62f5e921f0d7b1e880b5c1a1f1607
null
move_to_root(cmap_splay *tree, unsigned int x) { if (x == EMPTY) return; do { unsigned int z, zp; unsigned int y = tree[x].parent; if (y == EMPTY) break; z = tree[y].parent; if (z == EMPTY) { /* Case 3 */ tree[x].parent = EMPTY; tree[y].parent = x; if (tree[y].left == x) { /* Case 3 */ tree[y].left = tree[x].right; if (tree[y].left != EMPTY) tree[tree[y].left].parent = y; tree[x].right = y; } else { /* Case 3 - reflected */ assert(tree[y].right == x); tree[y].right = tree[x].left; if (tree[y].right != EMPTY) tree[tree[y].right].parent = y; tree[x].left = y; } break; } zp = tree[z].parent; tree[x].parent = zp; if (zp != EMPTY) { if (tree[zp].left == z) tree[zp].left = x; else { assert(tree[zp].right == z); tree[zp].right = x; } } tree[y].parent = x; if (tree[y].left == x) { tree[y].left = tree[x].right; if (tree[y].left != EMPTY) tree[tree[y].left].parent = y; tree[x].right = y; if (tree[z].left == y) { /* Case 1 */ tree[z].parent = y; tree[z].left = tree[y].right; if (tree[z].left != EMPTY) tree[tree[z].left].parent = z; tree[y].right = z; } else { /* Case 2 - reflected */ assert(tree[z].right == y); tree[z].parent = x; tree[z].right = tree[x].left; if (tree[z].right != EMPTY) tree[tree[z].right].parent = z; tree[x].left = z; } } else { assert(tree[y].right == x); tree[y].right = tree[x].left; if (tree[y].right != EMPTY) tree[tree[y].right].parent = y; tree[x].left = y; if (tree[z].left == y) { /* Case 2 */ tree[z].parent = x; tree[z].left = tree[x].right; if (tree[z].left != EMPTY) tree[tree[z].left].parent = z; tree[x].right = z; } else { /* Case 1 - reflected */ assert(tree[z].right == y); tree[z].parent = y; tree[z].right = tree[y].left; if (tree[z].right != EMPTY) tree[tree[z].right].parent = z; tree[y].left = z; } } } while (1); }
move_to_root(cmap_splay *tree, unsigned int x) { if (x == EMPTY) return; do { unsigned int z, zp; unsigned int y = tree[x].parent; if (y == EMPTY) break; z = tree[y].parent; if (z == EMPTY) { /* Case 3 */ tree[x].parent = EMPTY; tree[y].parent = x; if (tree[y].left == x) { /* Case 3 */ tree[y].left = tree[x].right; if (tree[y].left != EMPTY) tree[tree[y].left].parent = y; tree[x].right = y; } else { /* Case 3 - reflected */ assert(tree[y].right == x); tree[y].right = tree[x].left; if (tree[y].right != EMPTY) tree[tree[y].right].parent = y; tree[x].left = y; } break; } zp = tree[z].parent; tree[x].parent = zp; if (zp != EMPTY) { if (tree[zp].left == z) tree[zp].left = x; else { assert(tree[zp].right == z); tree[zp].right = x; } } tree[y].parent = x; if (tree[y].left == x) { tree[y].left = tree[x].right; if (tree[y].left != EMPTY) tree[tree[y].left].parent = y; tree[x].right = y; if (tree[z].left == y) { /* Case 1 */ tree[z].parent = y; tree[z].left = tree[y].right; if (tree[z].left != EMPTY) tree[tree[z].left].parent = z; tree[y].right = z; } else { /* Case 2 - reflected */ assert(tree[z].right == y); tree[z].parent = x; tree[z].right = tree[x].left; if (tree[z].right != EMPTY) tree[tree[z].right].parent = z; tree[x].left = z; } } else { assert(tree[y].right == x); tree[y].right = tree[x].left; if (tree[y].right != EMPTY) tree[tree[y].right].parent = y; tree[x].left = y; if (tree[z].left == y) { /* Case 2 */ tree[z].parent = x; tree[z].left = tree[x].right; if (tree[z].left != EMPTY) tree[tree[z].left].parent = z; tree[x].right = z; } else { /* Case 1 - reflected */ assert(tree[z].right == y); tree[z].parent = y; tree[z].right = tree[y].left; if (tree[z].right != EMPTY) tree[tree[z].right].parent = z; tree[y].left = z; } } } while (1); }
C
ghostscript
0
CVE-2017-5035
https://www.cvedetails.com/cve/CVE-2017-5035/
CWE-362
https://github.com/chromium/chromium/commit/c32cd2069ae8062b52e5b7b1faf5936bd71a583a
c32cd2069ae8062b52e5b7b1faf5936bd71a583a
Add DumpWithoutCrashing in RendererDidNavigateToExistingPage This is intended to be reverted after investigating the linked bug. BUG=688425 CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_site_isolation Review-Url: https://codereview.chromium.org/2701523004 Cr-Commit-Position: refs/heads/master@{#450900}
void NavigationControllerImpl::CancelPendingReload() { DCHECK(pending_reload_ != ReloadType::NONE); pending_reload_ = ReloadType::NONE; }
void NavigationControllerImpl::CancelPendingReload() { DCHECK(pending_reload_ != ReloadType::NONE); pending_reload_ = ReloadType::NONE; }
C
Chrome
0
CVE-2017-6386
https://www.cvedetails.com/cve/CVE-2017-6386/
CWE-772
https://cgit.freedesktop.org/virglrenderer/commit/?id=737c3350850ca4dbc5633b3bdb4118176ce59920
737c3350850ca4dbc5633b3bdb4118176ce59920
null
int vrend_create_shader(struct vrend_context *ctx, uint32_t handle, const struct pipe_stream_output_info *so_info, const char *shd_text, uint32_t offlen, uint32_t num_tokens, uint32_t type, uint32_t pkt_length) { struct vrend_shader_selector *sel = NULL; int ret_handle; bool new_shader = true, long_shader = false; bool finished = false; int ret; if (type > PIPE_SHADER_GEOMETRY) return EINVAL; if (offlen & VIRGL_OBJ_SHADER_OFFSET_CONT) new_shader = false; else if (((offlen + 3) / 4) > pkt_length) long_shader = true; /* if we have an in progress one - don't allow a new shader of that type or a different handle. */ if (ctx->sub->long_shader_in_progress_handle[type]) { if (new_shader == true) return EINVAL; if (handle != ctx->sub->long_shader_in_progress_handle[type]) return EINVAL; } if (new_shader) { sel = vrend_create_shader_state(ctx, so_info, type); if (sel == NULL) return ENOMEM; if (long_shader) { sel->buf_len = ((offlen + 3) / 4) * 4; /* round up buffer size */ sel->tmp_buf = malloc(sel->buf_len); if (!sel->tmp_buf) { ret = ENOMEM; goto error; } memcpy(sel->tmp_buf, shd_text, pkt_length * 4); sel->buf_offset = pkt_length * 4; ctx->sub->long_shader_in_progress_handle[type] = handle; } else finished = true; } else { sel = vrend_object_lookup(ctx->sub->object_hash, handle, VIRGL_OBJECT_SHADER); if (!sel) { fprintf(stderr, "got continuation without original shader %d\n", handle); ret = EINVAL; goto error; } offlen &= ~VIRGL_OBJ_SHADER_OFFSET_CONT; if (offlen != sel->buf_offset) { fprintf(stderr, "Got mismatched shader continuation %d vs %d\n", offlen, sel->buf_offset); ret = EINVAL; goto error; } /*make sure no overflow */ if (pkt_length * 4 < pkt_length || pkt_length * 4 + sel->buf_offset < pkt_length * 4 || pkt_length * 4 + sel->buf_offset < sel->buf_offset) { ret = EINVAL; goto error; } if ((pkt_length * 4 + sel->buf_offset) > sel->buf_len) { fprintf(stderr, "Got too large shader continuation %d vs %d\n", pkt_length * 4 + sel->buf_offset, sel->buf_len); ret = EINVAL; goto error; } memcpy(sel->tmp_buf + sel->buf_offset, shd_text, pkt_length * 4); sel->buf_offset += pkt_length * 4; if (sel->buf_offset >= sel->buf_len) { finished = true; shd_text = sel->tmp_buf; } } if (finished) { struct tgsi_token *tokens; tokens = calloc(num_tokens + 10, sizeof(struct tgsi_token)); if (!tokens) { ret = ENOMEM; goto error; } if (vrend_dump_shaders) fprintf(stderr,"shader\n%s\n", shd_text); if (!tgsi_text_translate((const char *)shd_text, tokens, num_tokens + 10)) { free(tokens); ret = EINVAL; goto error; } if (vrend_finish_shader(ctx, sel, tokens)) { free(tokens); ret = EINVAL; goto error; } else { free(sel->tmp_buf); sel->tmp_buf = NULL; } free(tokens); ctx->sub->long_shader_in_progress_handle[type] = 0; } if (new_shader) { ret_handle = vrend_renderer_object_insert(ctx, sel, sizeof(*sel), handle, VIRGL_OBJECT_SHADER); if (ret_handle == 0) { ret = ENOMEM; goto error; } } return 0; error: if (new_shader) vrend_destroy_shader_selector(sel); else vrend_renderer_object_destroy(ctx, handle); return ret; }
int vrend_create_shader(struct vrend_context *ctx, uint32_t handle, const struct pipe_stream_output_info *so_info, const char *shd_text, uint32_t offlen, uint32_t num_tokens, uint32_t type, uint32_t pkt_length) { struct vrend_shader_selector *sel = NULL; int ret_handle; bool new_shader = true, long_shader = false; bool finished = false; int ret; if (type > PIPE_SHADER_GEOMETRY) return EINVAL; if (offlen & VIRGL_OBJ_SHADER_OFFSET_CONT) new_shader = false; else if (((offlen + 3) / 4) > pkt_length) long_shader = true; /* if we have an in progress one - don't allow a new shader of that type or a different handle. */ if (ctx->sub->long_shader_in_progress_handle[type]) { if (new_shader == true) return EINVAL; if (handle != ctx->sub->long_shader_in_progress_handle[type]) return EINVAL; } if (new_shader) { sel = vrend_create_shader_state(ctx, so_info, type); if (sel == NULL) return ENOMEM; if (long_shader) { sel->buf_len = ((offlen + 3) / 4) * 4; /* round up buffer size */ sel->tmp_buf = malloc(sel->buf_len); if (!sel->tmp_buf) { ret = ENOMEM; goto error; } memcpy(sel->tmp_buf, shd_text, pkt_length * 4); sel->buf_offset = pkt_length * 4; ctx->sub->long_shader_in_progress_handle[type] = handle; } else finished = true; } else { sel = vrend_object_lookup(ctx->sub->object_hash, handle, VIRGL_OBJECT_SHADER); if (!sel) { fprintf(stderr, "got continuation without original shader %d\n", handle); ret = EINVAL; goto error; } offlen &= ~VIRGL_OBJ_SHADER_OFFSET_CONT; if (offlen != sel->buf_offset) { fprintf(stderr, "Got mismatched shader continuation %d vs %d\n", offlen, sel->buf_offset); ret = EINVAL; goto error; } /*make sure no overflow */ if (pkt_length * 4 < pkt_length || pkt_length * 4 + sel->buf_offset < pkt_length * 4 || pkt_length * 4 + sel->buf_offset < sel->buf_offset) { ret = EINVAL; goto error; } if ((pkt_length * 4 + sel->buf_offset) > sel->buf_len) { fprintf(stderr, "Got too large shader continuation %d vs %d\n", pkt_length * 4 + sel->buf_offset, sel->buf_len); ret = EINVAL; goto error; } memcpy(sel->tmp_buf + sel->buf_offset, shd_text, pkt_length * 4); sel->buf_offset += pkt_length * 4; if (sel->buf_offset >= sel->buf_len) { finished = true; shd_text = sel->tmp_buf; } } if (finished) { struct tgsi_token *tokens; tokens = calloc(num_tokens + 10, sizeof(struct tgsi_token)); if (!tokens) { ret = ENOMEM; goto error; } if (vrend_dump_shaders) fprintf(stderr,"shader\n%s\n", shd_text); if (!tgsi_text_translate((const char *)shd_text, tokens, num_tokens + 10)) { free(tokens); ret = EINVAL; goto error; } if (vrend_finish_shader(ctx, sel, tokens)) { free(tokens); ret = EINVAL; goto error; } else { free(sel->tmp_buf); sel->tmp_buf = NULL; } free(tokens); ctx->sub->long_shader_in_progress_handle[type] = 0; } if (new_shader) { ret_handle = vrend_renderer_object_insert(ctx, sel, sizeof(*sel), handle, VIRGL_OBJECT_SHADER); if (ret_handle == 0) { ret = ENOMEM; goto error; } } return 0; error: if (new_shader) vrend_destroy_shader_selector(sel); else vrend_renderer_object_destroy(ctx, handle); return ret; }
C
virglrenderer
0
CVE-2011-3209
https://www.cvedetails.com/cve/CVE-2011-3209/
CWE-189
https://github.com/torvalds/linux/commit/f8bd2258e2d520dff28c855658bd24bdafb5102d
f8bd2258e2d520dff28c855658bd24bdafb5102d
remove div_long_long_rem x86 is the only arch right now, which provides an optimized for div_long_long_rem and it has the downside that one has to be very careful that the divide doesn't overflow. The API is a little akward, as the arguments for the unsigned divide are signed. The signed version also doesn't handle a negative divisor and produces worse code on 64bit archs. There is little incentive to keep this API alive, so this converts the few users to the new API. Signed-off-by: Roman Zippel <[email protected]> Cc: Ralf Baechle <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Thomas Gleixner <[email protected]> Cc: john stultz <[email protected]> Cc: Christoph Lameter <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
static void init_object(struct kmem_cache *s, void *object, int active) { u8 *p = object; if (s->flags & __OBJECT_POISON) { memset(p, POISON_FREE, s->objsize - 1); p[s->objsize - 1] = POISON_END; } if (s->flags & SLAB_RED_ZONE) memset(p + s->objsize, active ? SLUB_RED_ACTIVE : SLUB_RED_INACTIVE, s->inuse - s->objsize); }
static void init_object(struct kmem_cache *s, void *object, int active) { u8 *p = object; if (s->flags & __OBJECT_POISON) { memset(p, POISON_FREE, s->objsize - 1); p[s->objsize - 1] = POISON_END; } if (s->flags & SLAB_RED_ZONE) memset(p + s->objsize, active ? SLUB_RED_ACTIVE : SLUB_RED_INACTIVE, s->inuse - s->objsize); }
C
linux
0
CVE-2013-4282
https://www.cvedetails.com/cve/CVE-2013-4282/
CWE-119
https://cgit.freedesktop.org/spice/spice/commit/?id=8af619009660b24e0b41ad26b30289eea288fcc2
8af619009660b24e0b41ad26b30289eea288fcc2
null
static ssize_t stream_ssl_read_cb(RedsStream *s, void *buf, size_t size) { int return_code; SPICE_GNUC_UNUSED int ssl_error; return_code = SSL_read(s->ssl, buf, size); if (return_code < 0) { ssl_error = SSL_get_error(s->ssl, return_code); } return return_code; }
static ssize_t stream_ssl_read_cb(RedsStream *s, void *buf, size_t size) { int return_code; SPICE_GNUC_UNUSED int ssl_error; return_code = SSL_read(s->ssl, buf, size); if (return_code < 0) { ssl_error = SSL_get_error(s->ssl, return_code); } return return_code; }
C
spice
0
CVE-2018-6074
https://www.cvedetails.com/cve/CVE-2018-6074/
CWE-20
https://github.com/chromium/chromium/commit/c59ad14fc61393a50b2ca3e89c7ecaba7028c4c4
c59ad14fc61393a50b2ca3e89c7ecaba7028c4c4
DevTools: allow styling the page number element when printing over the protocol. Bug: none Change-Id: I13e6afbd86a7c6bcdedbf0645183194b9de7cfb4 Reviewed-on: https://chromium-review.googlesource.com/809759 Commit-Queue: Pavel Feldman <[email protected]> Reviewed-by: Lei Zhang <[email protected]> Reviewed-by: Tom Sepez <[email protected]> Reviewed-by: Jianzhou Feng <[email protected]> Cr-Commit-Position: refs/heads/master@{#523966}
void HeadlessPrintManager::OnShowInvalidPrinterSettingsError() { ReleaseJob(INVALID_PRINTER_SETTINGS); }
void HeadlessPrintManager::OnShowInvalidPrinterSettingsError() { ReleaseJob(INVALID_PRINTER_SETTINGS); }
C
Chrome
0
CVE-2011-3896
https://www.cvedetails.com/cve/CVE-2011-3896/
CWE-119
https://github.com/chromium/chromium/commit/5925dff83699508b5e2735afb0297dfb310e159d
5925dff83699508b5e2735afb0297dfb310e159d
Implement a bubble that appears at the top of the screen when a tab enters fullscreen mode via webkitRequestFullScreen(), telling the user how to exit fullscreen. This is implemented as an NSView rather than an NSWindow because the floating chrome that appears in presentation mode should overlap the bubble. Content-initiated fullscreen mode makes use of 'presentation mode' on the Mac: the mode in which the UI is hidden, accessible by moving the cursor to the top of the screen. On Snow Leopard, this mode is synonymous with fullscreen mode. On Lion, however, fullscreen mode does not imply presentation mode: in non-presentation fullscreen mode, the chrome is permanently shown. It is possible to switch between presentation mode and fullscreen mode using the presentation mode UI control. When a tab initiates fullscreen mode on Lion, we enter presentation mode if not in presentation mode already. When the user exits fullscreen mode using Chrome UI (i.e. keyboard shortcuts, menu items, buttons, switching tabs, etc.) we return the user to the mode they were in before the tab entered fullscreen. BUG=14471 TEST=Enter fullscreen mode using webkitRequestFullScreen. You should see a bubble pop down from the top of the screen. Need to test the Lion logic somehow, with no Lion trybots. BUG=96883 Original review http://codereview.chromium.org/7890056/ TBR=thakis Review URL: http://codereview.chromium.org/7920024 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@101624 0039d316-1c4b-4281-b951-d872f2087c98
int closing_count() const { return closing_count_; }
int closing_count() const { return closing_count_; }
C
Chrome
0
null
null
null
https://github.com/chromium/chromium/commit/181c7400b2bf50ba02ac77149749fb419b4d4797
181c7400b2bf50ba02ac77149749fb419b4d4797
gpu: Use GetUniformSetup computed result size. [email protected] BUG=468936 Review URL: https://codereview.chromium.org/1016193003 Cr-Commit-Position: refs/heads/master@{#321489}
void GLES2DecoderImpl::DoSwapBuffers() { bool is_offscreen = !!offscreen_target_frame_buffer_.get(); int this_frame_number = frame_number_++; TRACE_EVENT_INSTANT2("test_gpu", "SwapBuffersLatency", TRACE_EVENT_SCOPE_THREAD, "GLImpl", static_cast<int>(gfx::GetGLImplementation()), "width", (is_offscreen ? offscreen_size_.width() : surface_->GetSize().width())); TRACE_EVENT2("gpu", "GLES2DecoderImpl::DoSwapBuffers", "offscreen", is_offscreen, "frame", this_frame_number); { TRACE_EVENT_SYNTHETIC_DELAY("gpu.PresentingFrame"); } ScopedGPUTrace scoped_gpu_trace(gpu_tracer_.get(), kTraceDecoder, "gpu_toplevel", "SwapBuffer"); bool is_tracing; TRACE_EVENT_CATEGORY_GROUP_ENABLED(TRACE_DISABLED_BY_DEFAULT("gpu.debug"), &is_tracing); if (is_tracing) { ScopedFrameBufferBinder binder(this, GetBackbufferServiceId()); gpu_state_tracer_->TakeSnapshotWithCurrentFramebuffer( is_offscreen ? offscreen_size_ : surface_->GetSize()); } if (is_offscreen) { TRACE_EVENT2("gpu", "Offscreen", "width", offscreen_size_.width(), "height", offscreen_size_.height()); if (offscreen_size_ != offscreen_saved_color_texture_->size()) { if (workarounds().needs_offscreen_buffer_workaround) { offscreen_saved_frame_buffer_->Create(); glFinish(); } DCHECK(offscreen_saved_color_format_); offscreen_saved_color_texture_->AllocateStorage( offscreen_size_, offscreen_saved_color_format_, false); offscreen_saved_frame_buffer_->AttachRenderTexture( offscreen_saved_color_texture_.get()); if (offscreen_size_.width() != 0 && offscreen_size_.height() != 0) { if (offscreen_saved_frame_buffer_->CheckStatus() != GL_FRAMEBUFFER_COMPLETE) { LOG(ERROR) << "GLES2DecoderImpl::ResizeOffscreenFrameBuffer failed " << "because offscreen saved FBO was incomplete."; LoseContext(GL_UNKNOWN_CONTEXT_RESET_ARB); return; } { ScopedFrameBufferBinder binder(this, offscreen_saved_frame_buffer_->id()); glClearColor(0, 0, 0, 0); state_.SetDeviceColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE); state_.SetDeviceCapabilityState(GL_SCISSOR_TEST, false); glClear(GL_COLOR_BUFFER_BIT); RestoreClearState(); } } UpdateParentTextureInfo(); } if (offscreen_size_.width() == 0 || offscreen_size_.height() == 0) return; ScopedGLErrorSuppressor suppressor( "GLES2DecoderImpl::DoSwapBuffers", GetErrorState()); if (IsOffscreenBufferMultisampled()) { ScopedResolvedFrameBufferBinder binder(this, true, false); } else { ScopedFrameBufferBinder binder(this, offscreen_target_frame_buffer_->id()); if (offscreen_target_buffer_preserved_) { offscreen_saved_color_texture_->Copy( offscreen_saved_color_texture_->size(), offscreen_saved_color_format_); } else { if (!!offscreen_saved_color_texture_info_.get()) offscreen_saved_color_texture_info_->texture()-> SetServiceId(offscreen_target_color_texture_->id()); offscreen_saved_color_texture_.swap(offscreen_target_color_texture_); offscreen_target_frame_buffer_->AttachRenderTexture( offscreen_target_color_texture_.get()); } if (!feature_info_->gl_version_info().is_angle) glFlush(); } } else { if (!surface_->SwapBuffers()) { LOG(ERROR) << "Context lost because SwapBuffers failed."; LoseContext(GL_UNKNOWN_CONTEXT_RESET_ARB); } } ExitCommandProcessingEarly(); }
void GLES2DecoderImpl::DoSwapBuffers() { bool is_offscreen = !!offscreen_target_frame_buffer_.get(); int this_frame_number = frame_number_++; TRACE_EVENT_INSTANT2("test_gpu", "SwapBuffersLatency", TRACE_EVENT_SCOPE_THREAD, "GLImpl", static_cast<int>(gfx::GetGLImplementation()), "width", (is_offscreen ? offscreen_size_.width() : surface_->GetSize().width())); TRACE_EVENT2("gpu", "GLES2DecoderImpl::DoSwapBuffers", "offscreen", is_offscreen, "frame", this_frame_number); { TRACE_EVENT_SYNTHETIC_DELAY("gpu.PresentingFrame"); } ScopedGPUTrace scoped_gpu_trace(gpu_tracer_.get(), kTraceDecoder, "gpu_toplevel", "SwapBuffer"); bool is_tracing; TRACE_EVENT_CATEGORY_GROUP_ENABLED(TRACE_DISABLED_BY_DEFAULT("gpu.debug"), &is_tracing); if (is_tracing) { ScopedFrameBufferBinder binder(this, GetBackbufferServiceId()); gpu_state_tracer_->TakeSnapshotWithCurrentFramebuffer( is_offscreen ? offscreen_size_ : surface_->GetSize()); } if (is_offscreen) { TRACE_EVENT2("gpu", "Offscreen", "width", offscreen_size_.width(), "height", offscreen_size_.height()); if (offscreen_size_ != offscreen_saved_color_texture_->size()) { if (workarounds().needs_offscreen_buffer_workaround) { offscreen_saved_frame_buffer_->Create(); glFinish(); } DCHECK(offscreen_saved_color_format_); offscreen_saved_color_texture_->AllocateStorage( offscreen_size_, offscreen_saved_color_format_, false); offscreen_saved_frame_buffer_->AttachRenderTexture( offscreen_saved_color_texture_.get()); if (offscreen_size_.width() != 0 && offscreen_size_.height() != 0) { if (offscreen_saved_frame_buffer_->CheckStatus() != GL_FRAMEBUFFER_COMPLETE) { LOG(ERROR) << "GLES2DecoderImpl::ResizeOffscreenFrameBuffer failed " << "because offscreen saved FBO was incomplete."; LoseContext(GL_UNKNOWN_CONTEXT_RESET_ARB); return; } { ScopedFrameBufferBinder binder(this, offscreen_saved_frame_buffer_->id()); glClearColor(0, 0, 0, 0); state_.SetDeviceColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE); state_.SetDeviceCapabilityState(GL_SCISSOR_TEST, false); glClear(GL_COLOR_BUFFER_BIT); RestoreClearState(); } } UpdateParentTextureInfo(); } if (offscreen_size_.width() == 0 || offscreen_size_.height() == 0) return; ScopedGLErrorSuppressor suppressor( "GLES2DecoderImpl::DoSwapBuffers", GetErrorState()); if (IsOffscreenBufferMultisampled()) { ScopedResolvedFrameBufferBinder binder(this, true, false); } else { ScopedFrameBufferBinder binder(this, offscreen_target_frame_buffer_->id()); if (offscreen_target_buffer_preserved_) { offscreen_saved_color_texture_->Copy( offscreen_saved_color_texture_->size(), offscreen_saved_color_format_); } else { if (!!offscreen_saved_color_texture_info_.get()) offscreen_saved_color_texture_info_->texture()-> SetServiceId(offscreen_target_color_texture_->id()); offscreen_saved_color_texture_.swap(offscreen_target_color_texture_); offscreen_target_frame_buffer_->AttachRenderTexture( offscreen_target_color_texture_.get()); } if (!feature_info_->gl_version_info().is_angle) glFlush(); } } else { if (!surface_->SwapBuffers()) { LOG(ERROR) << "Context lost because SwapBuffers failed."; LoseContext(GL_UNKNOWN_CONTEXT_RESET_ARB); } } ExitCommandProcessingEarly(); }
C
Chrome
0
CVE-2013-2915
https://www.cvedetails.com/cve/CVE-2013-2915/
null
https://github.com/chromium/chromium/commit/b12eb22a27110f49a2ad54b9e4ffd0ccb6cf9ce9
b12eb22a27110f49a2ad54b9e4ffd0ccb6cf9ce9
Delete unneeded pending entries in DidFailProvisionalLoad to prevent a spoof. BUG=280512 BUG=278899 TEST=See bug for repro steps. Review URL: https://chromiumcodereview.appspot.com/23978003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@222146 0039d316-1c4b-4281-b951-d872f2087c98
void NavigationControllerImpl::SetScreenshotManager( WebContentsScreenshotManager* manager) { screenshot_manager_.reset(manager ? manager : new WebContentsScreenshotManager(this)); }
void NavigationControllerImpl::SetScreenshotManager( WebContentsScreenshotManager* manager) { screenshot_manager_.reset(manager ? manager : new WebContentsScreenshotManager(this)); }
C
Chrome
0
CVE-2018-6076
https://www.cvedetails.com/cve/CVE-2018-6076/
CWE-79
https://github.com/chromium/chromium/commit/f8f6ed59949be4451ee2f5443d8a313f102fde60
f8f6ed59949be4451ee2f5443d8a313f102fde60
Percent-encode UTF8 characters in URL fragment identifiers. This brings us into line with Firefox, Safari, and the spec. Bug: 758523 Change-Id: I7e354ab441222d9fd08e45f0e70f91ad4e35fafe Reviewed-on: https://chromium-review.googlesource.com/668363 Commit-Queue: Mike West <[email protected]> Reviewed-by: Jochen Eisinger <[email protected]> Reviewed-by: Andy Paicu <[email protected]> Cr-Commit-Position: refs/heads/master@{#507481}
const char* RemoveURLWhitespace(const char* input, int input_len, CanonOutputT<char>* buffer, int* output_len, bool* potentially_dangling_markup) { return DoRemoveURLWhitespace(input, input_len, buffer, output_len, potentially_dangling_markup); }
const char* RemoveURLWhitespace(const char* input, int input_len, CanonOutputT<char>* buffer, int* output_len, bool* potentially_dangling_markup) { return DoRemoveURLWhitespace(input, input_len, buffer, output_len, potentially_dangling_markup); }
C
Chrome
0
CVE-2015-1278
https://www.cvedetails.com/cve/CVE-2015-1278/
CWE-254
https://github.com/chromium/chromium/commit/784f56a9c97a838448dd23f9bdc7c05fe8e639b3
784f56a9c97a838448dd23f9bdc7c05fe8e639b3
Correctly reset FP in RFHI whenever origin changes Bug: 713364 Change-Id: Id8bb923750e20f3db6fc9358b1d44120513ac95f CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_site_isolation Change-Id: Id8bb923750e20f3db6fc9358b1d44120513ac95f Reviewed-on: https://chromium-review.googlesource.com/482380 Commit-Queue: Ian Clelland <[email protected]> Reviewed-by: Charles Reis <[email protected]> Cr-Commit-Position: refs/heads/master@{#466778}
void TestRenderWidgetHostView::UnlockMouse() { }
void TestRenderWidgetHostView::UnlockMouse() { }
C
Chrome
0
CVE-2018-17204
https://www.cvedetails.com/cve/CVE-2018-17204/
CWE-617
https://github.com/openvswitch/ovs/commit/4af6da3b275b764b1afe194df6499b33d2bf4cde
4af6da3b275b764b1afe194df6499b33d2bf4cde
ofp-group: Don't assert-fail decoding bad OF1.5 group mod type or command. When decoding a group mod, the current code validates the group type and command after the whole group mod has been decoded. The OF1.5 decoder, however, tries to use the type and command earlier, when it might still be invalid. This caused an assertion failure (via OVS_NOT_REACHED). This commit fixes the problem. ovs-vswitchd does not enable support for OpenFlow 1.5 by default. Reported-at: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=9249 Signed-off-by: Ben Pfaff <[email protected]> Reviewed-by: Yifeng Sun <[email protected]>
ofputil_ipfix_stats_from_nx(struct ofputil_ipfix_stats *is, const struct nx_ipfix_stats_reply *reply) { is->collector_set_id = ntohl(reply->collector_set_id); is->total_flows = ntohll(reply->total_flows); is->current_flows = ntohll(reply->current_flows); is->pkts = ntohll(reply->pkts); is->ipv4_pkts = ntohll(reply->ipv4_pkts); is->ipv6_pkts = ntohll(reply->ipv6_pkts); is->error_pkts = ntohll(reply->error_pkts); is->ipv4_error_pkts = ntohll(reply->ipv4_error_pkts); is->ipv6_error_pkts = ntohll(reply->ipv6_error_pkts); is->tx_pkts = ntohll(reply->tx_pkts); is->tx_errors = ntohll(reply->tx_errors); return 0; }
ofputil_ipfix_stats_from_nx(struct ofputil_ipfix_stats *is, const struct nx_ipfix_stats_reply *reply) { is->collector_set_id = ntohl(reply->collector_set_id); is->total_flows = ntohll(reply->total_flows); is->current_flows = ntohll(reply->current_flows); is->pkts = ntohll(reply->pkts); is->ipv4_pkts = ntohll(reply->ipv4_pkts); is->ipv6_pkts = ntohll(reply->ipv6_pkts); is->error_pkts = ntohll(reply->error_pkts); is->ipv4_error_pkts = ntohll(reply->ipv4_error_pkts); is->ipv6_error_pkts = ntohll(reply->ipv6_error_pkts); is->tx_pkts = ntohll(reply->tx_pkts); is->tx_errors = ntohll(reply->tx_errors); return 0; }
C
ovs
0
CVE-2011-2858
https://www.cvedetails.com/cve/CVE-2011-2858/
CWE-119
https://github.com/chromium/chromium/commit/c13e1da62b5f5f0e6fe8c1f769a5a28415415244
c13e1da62b5f5f0e6fe8c1f769a5a28415415244
Revert "Revert 100494 - Fix bug in SimulateAttrib0.""" TEST=none BUG=95625 [email protected] Review URL: http://codereview.chromium.org/7796016 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@100507 0039d316-1c4b-4281-b951-d872f2087c98
void GLES2DecoderImpl::ClearUnclearedRenderbuffers( GLenum target, FramebufferManager::FramebufferInfo* info) { if (target == GL_READ_FRAMEBUFFER_EXT) { } GLbitfield clear_bits = 0; if (info->HasUnclearedAttachment(GL_COLOR_ATTACHMENT0)) { glClearColor( 0, 0, 0, (GLES2Util::GetChannelsForFormat( info->GetColorAttachmentFormat()) & 0x0008) != 0 ? 0 : 1); glColorMask(true, true, true, true); clear_bits |= GL_COLOR_BUFFER_BIT; } if (info->HasUnclearedAttachment(GL_STENCIL_ATTACHMENT) || info->HasUnclearedAttachment(GL_DEPTH_STENCIL_ATTACHMENT)) { glClearStencil(0); glStencilMask(-1); clear_bits |= GL_STENCIL_BUFFER_BIT; } if (info->HasUnclearedAttachment(GL_DEPTH_ATTACHMENT) || info->HasUnclearedAttachment(GL_DEPTH_STENCIL_ATTACHMENT)) { glClearDepth(1.0f); glDepthMask(true); clear_bits |= GL_DEPTH_BUFFER_BIT; } glDisable(GL_SCISSOR_TEST); glClear(clear_bits); info->MarkAttachedRenderbuffersAsCleared(); RestoreClearState(); if (target == GL_READ_FRAMEBUFFER_EXT) { } }
void GLES2DecoderImpl::ClearUnclearedRenderbuffers( GLenum target, FramebufferManager::FramebufferInfo* info) { if (target == GL_READ_FRAMEBUFFER_EXT) { } GLbitfield clear_bits = 0; if (info->HasUnclearedAttachment(GL_COLOR_ATTACHMENT0)) { glClearColor( 0, 0, 0, (GLES2Util::GetChannelsForFormat( info->GetColorAttachmentFormat()) & 0x0008) != 0 ? 0 : 1); glColorMask(true, true, true, true); clear_bits |= GL_COLOR_BUFFER_BIT; } if (info->HasUnclearedAttachment(GL_STENCIL_ATTACHMENT) || info->HasUnclearedAttachment(GL_DEPTH_STENCIL_ATTACHMENT)) { glClearStencil(0); glStencilMask(-1); clear_bits |= GL_STENCIL_BUFFER_BIT; } if (info->HasUnclearedAttachment(GL_DEPTH_ATTACHMENT) || info->HasUnclearedAttachment(GL_DEPTH_STENCIL_ATTACHMENT)) { glClearDepth(1.0f); glDepthMask(true); clear_bits |= GL_DEPTH_BUFFER_BIT; } glDisable(GL_SCISSOR_TEST); glClear(clear_bits); info->MarkAttachedRenderbuffersAsCleared(); RestoreClearState(); if (target == GL_READ_FRAMEBUFFER_EXT) { } }
C
Chrome
0
CVE-2017-0592
https://www.cvedetails.com/cve/CVE-2017-0592/
CWE-119
https://android.googlesource.com/platform/frameworks/av/+/acc192347665943ca674acf117e4f74a88436922
acc192347665943ca674acf117e4f74a88436922
FLACExtractor: copy protect mWriteBuffer Bug: 30895578 Change-Id: I4cba36bbe3502678210e5925181683df9726b431
FLACParser::FLACParser( const sp<DataSource> &dataSource, const sp<MetaData> &fileMetadata, const sp<MetaData> &trackMetadata) : mDataSource(dataSource), mFileMetadata(fileMetadata), mTrackMetadata(trackMetadata), mInitCheck(false), mMaxBufferSize(0), mGroup(NULL), mCopy(copyTrespass), mDecoder(NULL), mCurrentPos(0LL), mEOF(false), mStreamInfoValid(false), mWriteRequested(false), mWriteCompleted(false), mErrorStatus((FLAC__StreamDecoderErrorStatus) -1) { ALOGV("FLACParser::FLACParser"); memset(&mStreamInfo, 0, sizeof(mStreamInfo)); memset(&mWriteHeader, 0, sizeof(mWriteHeader)); mInitCheck = init(); }
FLACParser::FLACParser( const sp<DataSource> &dataSource, const sp<MetaData> &fileMetadata, const sp<MetaData> &trackMetadata) : mDataSource(dataSource), mFileMetadata(fileMetadata), mTrackMetadata(trackMetadata), mInitCheck(false), mMaxBufferSize(0), mGroup(NULL), mCopy(copyTrespass), mDecoder(NULL), mCurrentPos(0LL), mEOF(false), mStreamInfoValid(false), mWriteRequested(false), mWriteCompleted(false), mWriteBuffer(NULL), mErrorStatus((FLAC__StreamDecoderErrorStatus) -1) { ALOGV("FLACParser::FLACParser"); memset(&mStreamInfo, 0, sizeof(mStreamInfo)); memset(&mWriteHeader, 0, sizeof(mWriteHeader)); mInitCheck = init(); }
C
Android
1
CVE-2018-16427
https://www.cvedetails.com/cve/CVE-2018-16427/
CWE-125
https://github.com/OpenSC/OpenSC/pull/1447/commits/8fe377e93b4b56060e5bbfb6f3142ceaeca744fa
8fe377e93b4b56060e5bbfb6f3142ceaeca744fa
fixed out of bounds reads Thanks to Eric Sesterhenn from X41 D-SEC GmbH for reporting and suggesting security fixes.
auth_pin_reset(struct sc_card *card, unsigned int type, struct sc_pin_cmd_data *data, int *tries_left) { int rv; LOG_FUNC_CALLED(card->ctx); /* Oberthur unblock style: PUK value is a SOPIN */ rv = auth_pin_reset_oberthur_style(card, SC_AC_CHV, data, tries_left); LOG_TEST_RET(card->ctx, rv, "Oberthur style 'PIN RESET' failed"); LOG_FUNC_RETURN(card->ctx, rv); }
auth_pin_reset(struct sc_card *card, unsigned int type, struct sc_pin_cmd_data *data, int *tries_left) { int rv; LOG_FUNC_CALLED(card->ctx); /* Oberthur unblock style: PUK value is a SOPIN */ rv = auth_pin_reset_oberthur_style(card, SC_AC_CHV, data, tries_left); LOG_TEST_RET(card->ctx, rv, "Oberthur style 'PIN RESET' failed"); LOG_FUNC_RETURN(card->ctx, rv); }
C
OpenSC
0
CVE-2014-2739
https://www.cvedetails.com/cve/CVE-2014-2739/
CWE-20
https://github.com/torvalds/linux/commit/b2853fd6c2d0f383dbdf7427e263eb576a633867
b2853fd6c2d0f383dbdf7427e263eb576a633867
IB/core: Don't resolve passive side RoCE L2 address in CMA REQ handler The code that resolves the passive side source MAC within the rdma_cm connection request handler was both redundant and buggy, so remove it. It was redundant since later, when an RC QP is modified to RTR state, the resolution will take place in the ib_core module. It was buggy because this callback also deals with UD SIDR exchange, for which we incorrectly looked at the REQ member of the CM event and dereferenced a random value. Fixes: dd5f03beb4f7 ("IB/core: Ethernet L2 attributes in verbs/cm structures") Signed-off-by: Moni Shoua <[email protected]> Signed-off-by: Or Gerlitz <[email protected]> Signed-off-by: Roland Dreier <[email protected]>
static int cm_migrate(struct ib_cm_id *cm_id) { struct cm_id_private *cm_id_priv; unsigned long flags; int ret = 0; cm_id_priv = container_of(cm_id, struct cm_id_private, id); spin_lock_irqsave(&cm_id_priv->lock, flags); if (cm_id->state == IB_CM_ESTABLISHED && (cm_id->lap_state == IB_CM_LAP_UNINIT || cm_id->lap_state == IB_CM_LAP_IDLE)) { cm_id->lap_state = IB_CM_LAP_IDLE; cm_id_priv->av = cm_id_priv->alt_av; } else ret = -EINVAL; spin_unlock_irqrestore(&cm_id_priv->lock, flags); return ret; }
static int cm_migrate(struct ib_cm_id *cm_id) { struct cm_id_private *cm_id_priv; unsigned long flags; int ret = 0; cm_id_priv = container_of(cm_id, struct cm_id_private, id); spin_lock_irqsave(&cm_id_priv->lock, flags); if (cm_id->state == IB_CM_ESTABLISHED && (cm_id->lap_state == IB_CM_LAP_UNINIT || cm_id->lap_state == IB_CM_LAP_IDLE)) { cm_id->lap_state = IB_CM_LAP_IDLE; cm_id_priv->av = cm_id_priv->alt_av; } else ret = -EINVAL; spin_unlock_irqrestore(&cm_id_priv->lock, flags); return ret; }
C
linux
0
CVE-2019-13106
https://www.cvedetails.com/cve/CVE-2019-13106/
CWE-787
https://github.com/u-boot/u-boot/commits/master
master
Merge branch '2020-01-22-master-imports' - Re-add U8500 platform support - Add bcm968360bg support - Assorted Keymile fixes - Other assorted bugfixes
ulong post_word_load(void) { void* addr = (void *) (gd->ram_size - BOOTCOUNT_ADDR + POST_WORD_OFF); return in_le32(addr); }
ulong post_word_load(void) { void* addr = (void *) (gd->ram_size - BOOTCOUNT_ADDR + POST_WORD_OFF); return in_le32(addr); }
C
u-boot
0
CVE-2014-9940
https://www.cvedetails.com/cve/CVE-2014-9940/
CWE-416
https://github.com/torvalds/linux/commit/60a2362f769cf549dc466134efe71c8bf9fbaaba
60a2362f769cf549dc466134efe71c8bf9fbaaba
regulator: core: Fix regualtor_ena_gpio_free not to access pin after freeing After freeing pin from regulator_ena_gpio_free, loop can access the pin. So this patch fixes not to access pin after freeing. Signed-off-by: Seung-Woo Kim <[email protected]> Signed-off-by: Mark Brown <[email protected]>
static ssize_t type_show(struct device *dev, struct device_attribute *attr, char *buf) { struct regulator_dev *rdev = dev_get_drvdata(dev); switch (rdev->desc->type) { case REGULATOR_VOLTAGE: return sprintf(buf, "voltage\n"); case REGULATOR_CURRENT: return sprintf(buf, "current\n"); } return sprintf(buf, "unknown\n"); }
static ssize_t type_show(struct device *dev, struct device_attribute *attr, char *buf) { struct regulator_dev *rdev = dev_get_drvdata(dev); switch (rdev->desc->type) { case REGULATOR_VOLTAGE: return sprintf(buf, "voltage\n"); case REGULATOR_CURRENT: return sprintf(buf, "current\n"); } return sprintf(buf, "unknown\n"); }
C
linux
0
CVE-2016-3835
https://www.cvedetails.com/cve/CVE-2016-3835/
CWE-200
https://android.googlesource.com/platform/hardware/qcom/media/+/7558d03e6498e970b761aa44fff6b2c659202d95
7558d03e6498e970b761aa44fff6b2c659202d95
DO NOT MERGE mm-video-v4l2: venc: add checks before accessing heap pointers Heap pointers do not point to user virtual addresses in case of secure session. Set them to NULL and add checks to avoid accesing them Bug: 28815329 Bug: 28920116 Change-Id: I94fd5808e753b58654d65e175d3857ef46ffba26
OMX_U32 omx_venc::dev_set_message_thread_id(pthread_t tid) { return handle->venc_set_message_thread_id(tid); }
OMX_U32 omx_venc::dev_set_message_thread_id(pthread_t tid) { return handle->venc_set_message_thread_id(tid); }
C
Android
0
null
null
null
https://github.com/chromium/chromium/commit/93dd81929416a0170935e6eeac03d10aed60df18
93dd81929416a0170935e6eeac03d10aed60df18
Implement NPN_RemoveProperty https://bugs.webkit.org/show_bug.cgi?id=43315 Reviewed by Sam Weinig. WebKit2: * WebProcess/Plugins/NPJSObject.cpp: (WebKit::NPJSObject::removeProperty): Try to remove the property. (WebKit::NPJSObject::npClass): Add NP_RemoveProperty. (WebKit::NPJSObject::NP_RemoveProperty): Call NPJSObject::removeProperty. * WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp: (WebKit::NPN_RemoveProperty): Call the NPClass::removeProperty function. WebKitTools: * DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj: Add NPRuntimeRemoveProperty.cpp * DumpRenderTree/TestNetscapePlugIn/PluginTest.cpp: (PluginTest::NPN_GetStringIdentifier): (PluginTest::NPN_GetIntIdentifier): (PluginTest::NPN_RemoveProperty): Add NPN_ helpers. * DumpRenderTree/TestNetscapePlugIn/PluginTest.h: Support more NPClass functions. * DumpRenderTree/TestNetscapePlugIn/Tests/NPRuntimeRemoveProperty.cpp: Added. (NPRuntimeRemoveProperty::NPRuntimeRemoveProperty): Test for NPN_RemoveProperty. (NPRuntimeRemoveProperty::TestObject::hasMethod): (NPRuntimeRemoveProperty::TestObject::invoke): Add a testRemoveProperty method. (NPRuntimeRemoveProperty::NPP_GetValue): Return the test object. * DumpRenderTree/TestNetscapePlugIn/win/TestNetscapePlugin.vcproj: * DumpRenderTree/qt/TestNetscapePlugin/TestNetscapePlugin.pro: * GNUmakefile.am: Add NPRuntimeRemoveProperty.cpp LayoutTests: Add a test for NPN_RemoveProperty. * plugins/npruntime/remove-property-expected.txt: Added. * plugins/npruntime/remove-property.html: Added. git-svn-id: svn://svn.chromium.org/blink/trunk@64444 bbb929c8-8fbe-4397-9dbb-9b2b20218538
static bool NPN_Invoke(NPP, NPObject *npObject, NPIdentifier methodName, const NPVariant* arguments, uint32_t argumentCount, NPVariant* result) { if (npObject->_class->invoke) return npObject->_class->invoke(npObject, methodName, arguments, argumentCount, result); return false; }
static bool NPN_Invoke(NPP, NPObject *npObject, NPIdentifier methodName, const NPVariant* arguments, uint32_t argumentCount, NPVariant* result) { if (npObject->_class->invoke) return npObject->_class->invoke(npObject, methodName, arguments, argumentCount, result); return false; }
C
Chrome
0
CVE-2011-3363
https://www.cvedetails.com/cve/CVE-2011-3363/
CWE-20
https://github.com/torvalds/linux/commit/70945643722ffeac779d2529a348f99567fa5c33
70945643722ffeac779d2529a348f99567fa5c33
cifs: always do is_path_accessible check in cifs_mount Currently, we skip doing the is_path_accessible check in cifs_mount if there is no prefixpath. I have a report of at least one server however that allows a TREE_CONNECT to a share that has a DFS referral at its root. The reporter in this case was using a UNC that had no prefixpath, so the is_path_accessible check was not triggered and the box later hit a BUG() because we were chasing a DFS referral on the root dentry for the mount. This patch fixes this by removing the check for a zero-length prefixpath. That should make the is_path_accessible check be done in this situation and should allow the client to chase the DFS referral at mount time instead. Cc: [email protected] Reported-and-Tested-by: Yogesh Sharma <[email protected]> Signed-off-by: Jeff Layton <[email protected]> Signed-off-by: Steve French <[email protected]>
tlink_rb_search(struct rb_root *root, uid_t uid) { struct rb_node *node = root->rb_node; struct tcon_link *tlink; while (node) { tlink = rb_entry(node, struct tcon_link, tl_rbnode); if (tlink->tl_uid > uid) node = node->rb_left; else if (tlink->tl_uid < uid) node = node->rb_right; else return tlink; } return NULL; }
tlink_rb_search(struct rb_root *root, uid_t uid) { struct rb_node *node = root->rb_node; struct tcon_link *tlink; while (node) { tlink = rb_entry(node, struct tcon_link, tl_rbnode); if (tlink->tl_uid > uid) node = node->rb_left; else if (tlink->tl_uid < uid) node = node->rb_right; else return tlink; } return NULL; }
C
linux
0
CVE-2015-1791
https://www.cvedetails.com/cve/CVE-2015-1791/
CWE-362
https://github.com/openssl/openssl/commit/98ece4eebfb6cd45cc8d550c6ac0022965071afc
98ece4eebfb6cd45cc8d550c6ac0022965071afc
Fix race condition in NewSessionTicket If a NewSessionTicket is received by a multi-threaded client when attempting to reuse a previous ticket then a race condition can occur potentially leading to a double free of the ticket data. CVE-2015-1791 This also fixes RT#3808 where a session ID is changed for a session already in the client session cache. Since the session ID is the key to the cache this breaks the cache access. Parts of this patch were inspired by this Akamai change: https://github.com/akamai/openssl/commit/c0bf69a791239ceec64509f9f19fcafb2461b0d3 Reviewed-by: Rich Salz <[email protected]>
int ssl3_send_client_verify(SSL *s) { unsigned char *p; unsigned char data[MD5_DIGEST_LENGTH + SHA_DIGEST_LENGTH]; EVP_PKEY *pkey; EVP_PKEY_CTX *pctx = NULL; EVP_MD_CTX mctx; unsigned u = 0; unsigned long n; int j; EVP_MD_CTX_init(&mctx); if (s->state == SSL3_ST_CW_CERT_VRFY_A) { p = ssl_handshake_start(s); pkey = s->cert->key->privatekey; /* Create context from key and test if sha1 is allowed as digest */ pctx = EVP_PKEY_CTX_new(pkey, NULL); EVP_PKEY_sign_init(pctx); if (EVP_PKEY_CTX_set_signature_md(pctx, EVP_sha1()) > 0) { if (!SSL_USE_SIGALGS(s)) s->method->ssl3_enc->cert_verify_mac(s, NID_sha1, &(data [MD5_DIGEST_LENGTH])); } else { ERR_clear_error(); } /* * For TLS v1.2 send signature algorithm and signature using agreed * digest and cached handshake records. */ if (SSL_USE_SIGALGS(s)) { long hdatalen = 0; void *hdata; const EVP_MD *md = s->s3->tmp.md[s->cert->key - s->cert->pkeys]; hdatalen = BIO_get_mem_data(s->s3->handshake_buffer, &hdata); if (hdatalen <= 0 || !tls12_get_sigandhash(p, pkey, md)) { SSLerr(SSL_F_SSL3_SEND_CLIENT_VERIFY, ERR_R_INTERNAL_ERROR); goto err; } p += 2; #ifdef SSL_DEBUG fprintf(stderr, "Using TLS 1.2 with client alg %s\n", EVP_MD_name(md)); #endif if (!EVP_SignInit_ex(&mctx, md, NULL) || !EVP_SignUpdate(&mctx, hdata, hdatalen) || !EVP_SignFinal(&mctx, p + 2, &u, pkey)) { SSLerr(SSL_F_SSL3_SEND_CLIENT_VERIFY, ERR_R_EVP_LIB); goto err; } s2n(u, p); n = u + 4; /* * For extended master secret we've already digested cached * records. */ if (s->session->flags & SSL_SESS_FLAG_EXTMS) { BIO_free(s->s3->handshake_buffer); s->s3->handshake_buffer = NULL; s->s3->flags &= ~TLS1_FLAGS_KEEP_HANDSHAKE; } else if (!ssl3_digest_cached_records(s)) goto err; } else #ifndef OPENSSL_NO_RSA if (pkey->type == EVP_PKEY_RSA) { s->method->ssl3_enc->cert_verify_mac(s, NID_md5, &(data[0])); if (RSA_sign(NID_md5_sha1, data, MD5_DIGEST_LENGTH + SHA_DIGEST_LENGTH, &(p[2]), &u, pkey->pkey.rsa) <= 0) { SSLerr(SSL_F_SSL3_SEND_CLIENT_VERIFY, ERR_R_RSA_LIB); goto err; } s2n(u, p); n = u + 2; } else #endif #ifndef OPENSSL_NO_DSA if (pkey->type == EVP_PKEY_DSA) { if (!DSA_sign(pkey->save_type, &(data[MD5_DIGEST_LENGTH]), SHA_DIGEST_LENGTH, &(p[2]), (unsigned int *)&j, pkey->pkey.dsa)) { SSLerr(SSL_F_SSL3_SEND_CLIENT_VERIFY, ERR_R_DSA_LIB); goto err; } s2n(j, p); n = j + 2; } else #endif #ifndef OPENSSL_NO_EC if (pkey->type == EVP_PKEY_EC) { if (!ECDSA_sign(pkey->save_type, &(data[MD5_DIGEST_LENGTH]), SHA_DIGEST_LENGTH, &(p[2]), (unsigned int *)&j, pkey->pkey.ec)) { SSLerr(SSL_F_SSL3_SEND_CLIENT_VERIFY, ERR_R_ECDSA_LIB); goto err; } s2n(j, p); n = j + 2; } else #endif if (pkey->type == NID_id_GostR3410_94 || pkey->type == NID_id_GostR3410_2001) { unsigned char signbuf[64]; int i; size_t sigsize = 64; s->method->ssl3_enc->cert_verify_mac(s, NID_id_GostR3411_94, data); if (EVP_PKEY_sign(pctx, signbuf, &sigsize, data, 32) <= 0) { SSLerr(SSL_F_SSL3_SEND_CLIENT_VERIFY, ERR_R_INTERNAL_ERROR); goto err; } for (i = 63, j = 0; i >= 0; j++, i--) { p[2 + j] = signbuf[i]; } s2n(j, p); n = j + 2; } else { SSLerr(SSL_F_SSL3_SEND_CLIENT_VERIFY, ERR_R_INTERNAL_ERROR); goto err; } if (!ssl_set_handshake_header(s, SSL3_MT_CERTIFICATE_VERIFY, n)) { SSLerr(SSL_F_SSL3_SEND_CLIENT_VERIFY, ERR_R_INTERNAL_ERROR); goto err; } s->state = SSL3_ST_CW_CERT_VRFY_B; } EVP_MD_CTX_cleanup(&mctx); EVP_PKEY_CTX_free(pctx); return ssl_do_write(s); err: EVP_MD_CTX_cleanup(&mctx); EVP_PKEY_CTX_free(pctx); s->state = SSL_ST_ERR; return (-1); }
int ssl3_send_client_verify(SSL *s) { unsigned char *p; unsigned char data[MD5_DIGEST_LENGTH + SHA_DIGEST_LENGTH]; EVP_PKEY *pkey; EVP_PKEY_CTX *pctx = NULL; EVP_MD_CTX mctx; unsigned u = 0; unsigned long n; int j; EVP_MD_CTX_init(&mctx); if (s->state == SSL3_ST_CW_CERT_VRFY_A) { p = ssl_handshake_start(s); pkey = s->cert->key->privatekey; /* Create context from key and test if sha1 is allowed as digest */ pctx = EVP_PKEY_CTX_new(pkey, NULL); EVP_PKEY_sign_init(pctx); if (EVP_PKEY_CTX_set_signature_md(pctx, EVP_sha1()) > 0) { if (!SSL_USE_SIGALGS(s)) s->method->ssl3_enc->cert_verify_mac(s, NID_sha1, &(data [MD5_DIGEST_LENGTH])); } else { ERR_clear_error(); } /* * For TLS v1.2 send signature algorithm and signature using agreed * digest and cached handshake records. */ if (SSL_USE_SIGALGS(s)) { long hdatalen = 0; void *hdata; const EVP_MD *md = s->s3->tmp.md[s->cert->key - s->cert->pkeys]; hdatalen = BIO_get_mem_data(s->s3->handshake_buffer, &hdata); if (hdatalen <= 0 || !tls12_get_sigandhash(p, pkey, md)) { SSLerr(SSL_F_SSL3_SEND_CLIENT_VERIFY, ERR_R_INTERNAL_ERROR); goto err; } p += 2; #ifdef SSL_DEBUG fprintf(stderr, "Using TLS 1.2 with client alg %s\n", EVP_MD_name(md)); #endif if (!EVP_SignInit_ex(&mctx, md, NULL) || !EVP_SignUpdate(&mctx, hdata, hdatalen) || !EVP_SignFinal(&mctx, p + 2, &u, pkey)) { SSLerr(SSL_F_SSL3_SEND_CLIENT_VERIFY, ERR_R_EVP_LIB); goto err; } s2n(u, p); n = u + 4; /* * For extended master secret we've already digested cached * records. */ if (s->session->flags & SSL_SESS_FLAG_EXTMS) { BIO_free(s->s3->handshake_buffer); s->s3->handshake_buffer = NULL; s->s3->flags &= ~TLS1_FLAGS_KEEP_HANDSHAKE; } else if (!ssl3_digest_cached_records(s)) goto err; } else #ifndef OPENSSL_NO_RSA if (pkey->type == EVP_PKEY_RSA) { s->method->ssl3_enc->cert_verify_mac(s, NID_md5, &(data[0])); if (RSA_sign(NID_md5_sha1, data, MD5_DIGEST_LENGTH + SHA_DIGEST_LENGTH, &(p[2]), &u, pkey->pkey.rsa) <= 0) { SSLerr(SSL_F_SSL3_SEND_CLIENT_VERIFY, ERR_R_RSA_LIB); goto err; } s2n(u, p); n = u + 2; } else #endif #ifndef OPENSSL_NO_DSA if (pkey->type == EVP_PKEY_DSA) { if (!DSA_sign(pkey->save_type, &(data[MD5_DIGEST_LENGTH]), SHA_DIGEST_LENGTH, &(p[2]), (unsigned int *)&j, pkey->pkey.dsa)) { SSLerr(SSL_F_SSL3_SEND_CLIENT_VERIFY, ERR_R_DSA_LIB); goto err; } s2n(j, p); n = j + 2; } else #endif #ifndef OPENSSL_NO_EC if (pkey->type == EVP_PKEY_EC) { if (!ECDSA_sign(pkey->save_type, &(data[MD5_DIGEST_LENGTH]), SHA_DIGEST_LENGTH, &(p[2]), (unsigned int *)&j, pkey->pkey.ec)) { SSLerr(SSL_F_SSL3_SEND_CLIENT_VERIFY, ERR_R_ECDSA_LIB); goto err; } s2n(j, p); n = j + 2; } else #endif if (pkey->type == NID_id_GostR3410_94 || pkey->type == NID_id_GostR3410_2001) { unsigned char signbuf[64]; int i; size_t sigsize = 64; s->method->ssl3_enc->cert_verify_mac(s, NID_id_GostR3411_94, data); if (EVP_PKEY_sign(pctx, signbuf, &sigsize, data, 32) <= 0) { SSLerr(SSL_F_SSL3_SEND_CLIENT_VERIFY, ERR_R_INTERNAL_ERROR); goto err; } for (i = 63, j = 0; i >= 0; j++, i--) { p[2 + j] = signbuf[i]; } s2n(j, p); n = j + 2; } else { SSLerr(SSL_F_SSL3_SEND_CLIENT_VERIFY, ERR_R_INTERNAL_ERROR); goto err; } if (!ssl_set_handshake_header(s, SSL3_MT_CERTIFICATE_VERIFY, n)) { SSLerr(SSL_F_SSL3_SEND_CLIENT_VERIFY, ERR_R_INTERNAL_ERROR); goto err; } s->state = SSL3_ST_CW_CERT_VRFY_B; } EVP_MD_CTX_cleanup(&mctx); EVP_PKEY_CTX_free(pctx); return ssl_do_write(s); err: EVP_MD_CTX_cleanup(&mctx); EVP_PKEY_CTX_free(pctx); s->state = SSL_ST_ERR; return (-1); }
C
openssl
0
CVE-2010-3702
https://www.cvedetails.com/cve/CVE-2010-3702/
CWE-20
https://cgit.freedesktop.org/poppler/poppler/commit/?id=e853106b58d6b4b0467dbd6436c9bb1cfbd372cf
e853106b58d6b4b0467dbd6436c9bb1cfbd372cf
null
GfxResources::GfxResources(XRef *xref, Dict *resDict, GfxResources *nextA) : gStateCache(2, xref) { Object obj1, obj2; Ref r; if (resDict) { fonts = NULL; resDict->lookupNF("Font", &obj1); if (obj1.isRef()) { obj1.fetch(xref, &obj2); if (obj2.isDict()) { r = obj1.getRef(); fonts = new GfxFontDict(xref, &r, obj2.getDict()); } obj2.free(); } else if (obj1.isDict()) { fonts = new GfxFontDict(xref, NULL, obj1.getDict()); } obj1.free(); resDict->lookup("XObject", &xObjDict); resDict->lookup("ColorSpace", &colorSpaceDict); resDict->lookup("Pattern", &patternDict); resDict->lookup("Shading", &shadingDict); resDict->lookup("ExtGState", &gStateDict); resDict->lookup("Properties", &propertiesDict); } else { fonts = NULL; xObjDict.initNull(); colorSpaceDict.initNull(); patternDict.initNull(); shadingDict.initNull(); gStateDict.initNull(); propertiesDict.initNull(); } next = nextA; }
GfxResources::GfxResources(XRef *xref, Dict *resDict, GfxResources *nextA) : gStateCache(2, xref) { Object obj1, obj2; Ref r; if (resDict) { fonts = NULL; resDict->lookupNF("Font", &obj1); if (obj1.isRef()) { obj1.fetch(xref, &obj2); if (obj2.isDict()) { r = obj1.getRef(); fonts = new GfxFontDict(xref, &r, obj2.getDict()); } obj2.free(); } else if (obj1.isDict()) { fonts = new GfxFontDict(xref, NULL, obj1.getDict()); } obj1.free(); resDict->lookup("XObject", &xObjDict); resDict->lookup("ColorSpace", &colorSpaceDict); resDict->lookup("Pattern", &patternDict); resDict->lookup("Shading", &shadingDict); resDict->lookup("ExtGState", &gStateDict); resDict->lookup("Properties", &propertiesDict); } else { fonts = NULL; xObjDict.initNull(); colorSpaceDict.initNull(); patternDict.initNull(); shadingDict.initNull(); gStateDict.initNull(); propertiesDict.initNull(); } next = nextA; }
CPP
poppler
0
CVE-2014-1444
https://www.cvedetails.com/cve/CVE-2014-1444/
CWE-399
https://github.com/torvalds/linux/commit/96b340406724d87e4621284ebac5e059d67b2194
96b340406724d87e4621284ebac5e059d67b2194
farsync: fix info leak in ioctl The fst_get_iface() code fails to initialize the two padding bytes of struct sync_serial_settings after the ->loopback member. Add an explicit memset(0) before filling the structure to avoid the info leak. Signed-off-by: Dan Carpenter <[email protected]> Signed-off-by: David S. Miller <[email protected]>
fst_clear_intr(struct fst_card_info *card) { if (card->family == FST_FAMILY_TXU) { (void) readb(card->ctlmem); } else { /* Poke the appropriate PLX chip register (same as enabling interrupts) */ outw(0x0543, card->pci_conf + INTCSR_9052); } }
fst_clear_intr(struct fst_card_info *card) { if (card->family == FST_FAMILY_TXU) { (void) readb(card->ctlmem); } else { /* Poke the appropriate PLX chip register (same as enabling interrupts) */ outw(0x0543, card->pci_conf + INTCSR_9052); } }
C
linux
0
CVE-2011-3084
https://www.cvedetails.com/cve/CVE-2011-3084/
CWE-264
https://github.com/chromium/chromium/commit/744c2a2d90c3c9a33c818e1ea4b7ccb5010663a0
744c2a2d90c3c9a33c818e1ea4b7ccb5010663a0
Allow browser to handle all WebUI navigations. BUG=113496 TEST="Google Dashboard" link in Sync settings loads in new process. Review URL: http://codereview.chromium.org/9663045 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@126949 0039d316-1c4b-4281-b951-d872f2087c98
ChromeWebUIControllerFactory::~ChromeWebUIControllerFactory() { }
ChromeWebUIControllerFactory::~ChromeWebUIControllerFactory() { }
C
Chrome
0
CVE-2013-0891
https://www.cvedetails.com/cve/CVE-2013-0891/
CWE-189
https://github.com/chromium/chromium/commit/58936737b65052775b67b1409b87edbbbc09f72b
58936737b65052775b67b1409b87edbbbc09f72b
Avoid integer overflows in BlobURLRequestJob. BUG=169685 Review URL: https://chromiumcodereview.appspot.com/12047012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@179154 0039d316-1c4b-4281-b951-d872f2087c98
int BlobURLRequestJob::ComputeBytesToRead() const { int64 current_item_length = item_length_list_[current_item_index_]; int64 item_remaining = current_item_length - current_item_offset_; int64 buf_remaining = read_buf_->BytesRemaining(); int64 max_remaining = std::numeric_limits<int>::max(); int64 min = std::min(std::min(std::min(item_remaining, buf_remaining), remaining_bytes_), max_remaining); return static_cast<int>(min); }
int BlobURLRequestJob::ComputeBytesToRead() const { int64 current_item_remaining_bytes = item_length_list_[current_item_index_] - current_item_offset_; int64 remaining_bytes = std::min(current_item_remaining_bytes, remaining_bytes_); return static_cast<int>(std::min( static_cast<int64>(read_buf_->BytesRemaining()), remaining_bytes)); }
C
Chrome
1
CVE-2016-5216
https://www.cvedetails.com/cve/CVE-2016-5216/
CWE-416
https://github.com/chromium/chromium/commit/bf6a6765d44b09c64b8c75d749efb84742a250e7
bf6a6765d44b09c64b8c75d749efb84742a250e7
[pdf] Defer page unloading in JS callback. One of the callbacks from PDFium JavaScript into the embedder is to get the current page number. In Chromium, this will trigger a call to CalculateMostVisiblePage that method will determine the visible pages and unload any non-visible pages. But, if the originating JS is on a non-visible page we'll delete the page and annotations associated with that page. This will cause issues as we are currently working with those objects when the JavaScript returns. This Cl defers the page unloading triggered by getting the most visible page until the next event is handled by the Chromium embedder. BUG=chromium:653090 Review-Url: https://codereview.chromium.org/2418533002 Cr-Commit-Position: refs/heads/master@{#424781}
void PDFiumEngine::SearchUsingICU(const base::string16& term, bool case_sensitive, bool first_search, int character_to_start_searching_from, int current_page) { base::string16 page_text; int text_length = pages_[current_page]->GetCharCount(); if (character_to_start_searching_from) { text_length -= character_to_start_searching_from; } else if (!first_search && last_character_index_to_search_ != -1 && current_page == last_page_to_search_) { text_length = last_character_index_to_search_; } if (text_length <= 0) return; PDFiumAPIStringBufferAdapter<base::string16> api_string_adapter(&page_text, text_length, false); unsigned short* data = reinterpret_cast<unsigned short*>(api_string_adapter.GetData()); int written = FPDFText_GetText(pages_[current_page]->GetTextPage(), character_to_start_searching_from, text_length, data); api_string_adapter.Close(written); std::vector<PDFEngine::Client::SearchStringResult> results; client_->SearchString( page_text.c_str(), term.c_str(), case_sensitive, &results); for (const auto& result : results) { int temp_start = result.start_index + character_to_start_searching_from; int start = FPDFText_GetCharIndexFromTextIndex( pages_[current_page]->GetTextPage(), temp_start); int end = FPDFText_GetCharIndexFromTextIndex( pages_[current_page]->GetTextPage(), temp_start + result.length); AddFindResult(PDFiumRange(pages_[current_page], start, end - start)); } }
void PDFiumEngine::SearchUsingICU(const base::string16& term, bool case_sensitive, bool first_search, int character_to_start_searching_from, int current_page) { base::string16 page_text; int text_length = pages_[current_page]->GetCharCount(); if (character_to_start_searching_from) { text_length -= character_to_start_searching_from; } else if (!first_search && last_character_index_to_search_ != -1 && current_page == last_page_to_search_) { text_length = last_character_index_to_search_; } if (text_length <= 0) return; PDFiumAPIStringBufferAdapter<base::string16> api_string_adapter(&page_text, text_length, false); unsigned short* data = reinterpret_cast<unsigned short*>(api_string_adapter.GetData()); int written = FPDFText_GetText(pages_[current_page]->GetTextPage(), character_to_start_searching_from, text_length, data); api_string_adapter.Close(written); std::vector<PDFEngine::Client::SearchStringResult> results; client_->SearchString( page_text.c_str(), term.c_str(), case_sensitive, &results); for (const auto& result : results) { int temp_start = result.start_index + character_to_start_searching_from; int start = FPDFText_GetCharIndexFromTextIndex( pages_[current_page]->GetTextPage(), temp_start); int end = FPDFText_GetCharIndexFromTextIndex( pages_[current_page]->GetTextPage(), temp_start + result.length); AddFindResult(PDFiumRange(pages_[current_page], start, end - start)); } }
C
Chrome
0
CVE-2019-13225
https://www.cvedetails.com/cve/CVE-2019-13225/
CWE-476
https://github.com/kkos/oniguruma/commit/c509265c5f6ae7264f7b8a8aae1cfa5fc59d108c
c509265c5f6ae7264f7b8a8aae1cfa5fc59d108c
Fix CVE-2019-13225: problem in converting if-then-else pattern to bytecode.
extern void onig_add_end_call(void (*func)(void)) { EndCallListItemType* item; item = (EndCallListItemType* )xmalloc(sizeof(*item)); if (item == 0) return ; item->next = EndCallTop; item->func = func; EndCallTop = item; }
extern void onig_add_end_call(void (*func)(void)) { EndCallListItemType* item; item = (EndCallListItemType* )xmalloc(sizeof(*item)); if (item == 0) return ; item->next = EndCallTop; item->func = func; EndCallTop = item; }
C
oniguruma
0
CVE-2016-5350
https://www.cvedetails.com/cve/CVE-2016-5350/
CWE-399
https://github.com/wireshark/wireshark/commit/b4d16b4495b732888e12baf5b8a7e9bf2665e22b
b4d16b4495b732888e12baf5b8a7e9bf2665e22b
SPOOLSS: Try to avoid an infinite loop. Use tvb_reported_length_remaining in dissect_spoolss_uint16uni. Make sure our offset always increments in dissect_spoolss_keybuffer. Change-Id: I7017c9685bb2fa27161d80a03b8fca4ef630e793 Reviewed-on: https://code.wireshark.org/review/14687 Reviewed-by: Gerald Combs <[email protected]> Petri-Dish: Gerald Combs <[email protected]> Tested-by: Petri Dish Buildbot <[email protected]> Reviewed-by: Michael Mann <[email protected]>
dissect_spoolss_keybuffer(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, dcerpc_info *di, guint8 *drep) { guint32 size; int end_offset; if (di->conformant_run) return offset; /* Dissect size and data */ offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, di, drep, hf_keybuffer_size, &size); end_offset = offset + (size*2); if (end_offset < offset) { /* * Overflow - make the end offset one past the end of * the packet data, so we throw an exception (as the * size is almost certainly too big). */ end_offset = tvb_reported_length_remaining(tvb, offset) + 1; } while (offset > 0 && offset < end_offset) { offset = dissect_spoolss_uint16uni( tvb, offset, pinfo, tree, drep, NULL, hf_keybuffer); } return offset; }
dissect_spoolss_keybuffer(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, dcerpc_info *di, guint8 *drep) { guint32 size; int end_offset; if (di->conformant_run) return offset; /* Dissect size and data */ offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, di, drep, hf_keybuffer_size, &size); end_offset = offset + (size*2); if (end_offset < offset) { /* * Overflow - make the end offset one past the end of * the packet data, so we throw an exception (as the * size is almost certainly too big). */ end_offset = tvb_reported_length_remaining(tvb, offset) + 1; } while (offset < end_offset) offset = dissect_spoolss_uint16uni( tvb, offset, pinfo, tree, drep, NULL, hf_keybuffer); return offset; }
C
wireshark
1
CVE-2011-1080
https://www.cvedetails.com/cve/CVE-2011-1080/
CWE-20
https://github.com/torvalds/linux/commit/d846f71195d57b0bbb143382647c2c6638b04c5a
d846f71195d57b0bbb143382647c2c6638b04c5a
bridge: netfilter: fix information leak Struct tmp is copied from userspace. It is not checked whether the "name" field is NULL terminated. This may lead to buffer overflow and passing contents of kernel stack as a module name to try_then_request_module() and, consequently, to modprobe commandline. It would be seen by all userspace processes. Signed-off-by: Vasiliy Kulikov <[email protected]> Signed-off-by: Patrick McHardy <[email protected]>
static int copy_counters_to_user(struct ebt_table *t, const struct ebt_counter *oldcounters, void __user *user, unsigned int num_counters, unsigned int nentries) { struct ebt_counter *counterstmp; int ret = 0; /* userspace might not need the counters */ if (num_counters == 0) return 0; if (num_counters != nentries) { BUGPRINT("Num_counters wrong\n"); return -EINVAL; } counterstmp = vmalloc(nentries * sizeof(*counterstmp)); if (!counterstmp) return -ENOMEM; write_lock_bh(&t->lock); get_counters(oldcounters, counterstmp, nentries); write_unlock_bh(&t->lock); if (copy_to_user(user, counterstmp, nentries * sizeof(struct ebt_counter))) ret = -EFAULT; vfree(counterstmp); return ret; }
static int copy_counters_to_user(struct ebt_table *t, const struct ebt_counter *oldcounters, void __user *user, unsigned int num_counters, unsigned int nentries) { struct ebt_counter *counterstmp; int ret = 0; /* userspace might not need the counters */ if (num_counters == 0) return 0; if (num_counters != nentries) { BUGPRINT("Num_counters wrong\n"); return -EINVAL; } counterstmp = vmalloc(nentries * sizeof(*counterstmp)); if (!counterstmp) return -ENOMEM; write_lock_bh(&t->lock); get_counters(oldcounters, counterstmp, nentries); write_unlock_bh(&t->lock); if (copy_to_user(user, counterstmp, nentries * sizeof(struct ebt_counter))) ret = -EFAULT; vfree(counterstmp); return ret; }
C
linux
0
CVE-2012-3552
https://www.cvedetails.com/cve/CVE-2012-3552/
CWE-362
https://github.com/torvalds/linux/commit/f6d8bd051c391c1c0458a30b2a7abcd939329259
f6d8bd051c391c1c0458a30b2a7abcd939329259
inet: add RCU protection to inet->opt We lack proper synchronization to manipulate inet->opt ip_options Problem is ip_make_skb() calls ip_setup_cork() and ip_setup_cork() possibly makes a copy of ipc->opt (struct ip_options), without any protection against another thread manipulating inet->opt. Another thread can change inet->opt pointer and free old one under us. Use RCU to protect inet->opt (changed to inet->inet_opt). Instead of handling atomic refcounts, just copy ip_options when necessary, to avoid cache line dirtying. We cant insert an rcu_head in struct ip_options since its included in skb->cb[], so this patch is large because I had to introduce a new ip_options_rcu structure. Signed-off-by: Eric Dumazet <[email protected]> Cc: Herbert Xu <[email protected]> Signed-off-by: David S. Miller <[email protected]>
static int __init dccp_v4_init(void) { int err = proto_register(&dccp_v4_prot, 1); if (err != 0) goto out; err = inet_add_protocol(&dccp_v4_protocol, IPPROTO_DCCP); if (err != 0) goto out_proto_unregister; inet_register_protosw(&dccp_v4_protosw); err = register_pernet_subsys(&dccp_v4_ops); if (err) goto out_destroy_ctl_sock; out: return err; out_destroy_ctl_sock: inet_unregister_protosw(&dccp_v4_protosw); inet_del_protocol(&dccp_v4_protocol, IPPROTO_DCCP); out_proto_unregister: proto_unregister(&dccp_v4_prot); goto out; }
static int __init dccp_v4_init(void) { int err = proto_register(&dccp_v4_prot, 1); if (err != 0) goto out; err = inet_add_protocol(&dccp_v4_protocol, IPPROTO_DCCP); if (err != 0) goto out_proto_unregister; inet_register_protosw(&dccp_v4_protosw); err = register_pernet_subsys(&dccp_v4_ops); if (err) goto out_destroy_ctl_sock; out: return err; out_destroy_ctl_sock: inet_unregister_protosw(&dccp_v4_protosw); inet_del_protocol(&dccp_v4_protocol, IPPROTO_DCCP); out_proto_unregister: proto_unregister(&dccp_v4_prot); goto out; }
C
linux
0
CVE-2009-3605
https://www.cvedetails.com/cve/CVE-2009-3605/
CWE-189
https://cgit.freedesktop.org/poppler/poppler/commit/?id=7b2d314a61fd0e12f47c62996cb49ec0d1ba747a
7b2d314a61fd0e12f47c62996cb49ec0d1ba747a
null
GfxColorSpace *GfxCalRGBColorSpace::copy() { GfxCalRGBColorSpace *cs; int i; cs = new GfxCalRGBColorSpace(); cs->whiteX = whiteX; cs->whiteY = whiteY; cs->whiteZ = whiteZ; cs->blackX = blackX; cs->blackY = blackY; cs->blackZ = blackZ; cs->gammaR = gammaR; cs->gammaG = gammaG; cs->gammaB = gammaB; for (i = 0; i < 9; ++i) { cs->mat[i] = mat[i]; } return cs; }
GfxColorSpace *GfxCalRGBColorSpace::copy() { GfxCalRGBColorSpace *cs; int i; cs = new GfxCalRGBColorSpace(); cs->whiteX = whiteX; cs->whiteY = whiteY; cs->whiteZ = whiteZ; cs->blackX = blackX; cs->blackY = blackY; cs->blackZ = blackZ; cs->gammaR = gammaR; cs->gammaG = gammaG; cs->gammaB = gammaB; for (i = 0; i < 9; ++i) { cs->mat[i] = mat[i]; } return cs; }
CPP
poppler
0
CVE-2016-10133
https://www.cvedetails.com/cve/CVE-2016-10133/
CWE-119
http://git.ghostscript.com/?p=mujs.git;a=commit;h=77ab465f1c394bb77f00966cd950650f3f53cb24
77ab465f1c394bb77f00966cd950650f3f53cb24
null
void js_free(js_State *J, void *ptr) { J->alloc(J->actx, ptr, 0); }
void js_free(js_State *J, void *ptr) { J->alloc(J->actx, ptr, 0); }
C
ghostscript
0
CVE-2011-2799
https://www.cvedetails.com/cve/CVE-2011-2799/
CWE-399
https://github.com/chromium/chromium/commit/5a2de6455f565783c73e53eae2c8b953e7d48520
5a2de6455f565783c73e53eae2c8b953e7d48520
2011-06-02 Joone Hur <[email protected]> Reviewed by Martin Robinson. [GTK] Only load dictionaries if spell check is enabled https://bugs.webkit.org/show_bug.cgi?id=32879 We don't need to call enchant if enable-spell-checking is false. * webkit/webkitwebview.cpp: (webkit_web_view_update_settings): Skip loading dictionaries when enable-spell-checking is false. (webkit_web_view_settings_notify): Ditto. git-svn-id: svn://svn.chromium.org/blink/trunk@87925 bbb929c8-8fbe-4397-9dbb-9b2b20218538
void webkit_web_view_load_string(WebKitWebView* webView, const gchar* content, const gchar* mimeType, const gchar* encoding, const gchar* baseUri) { g_return_if_fail(WEBKIT_IS_WEB_VIEW(webView)); g_return_if_fail(content); WebKitWebFrame* frame = webView->priv->mainFrame; webkit_web_frame_load_string(frame, content, mimeType, encoding, baseUri); }
void webkit_web_view_load_string(WebKitWebView* webView, const gchar* content, const gchar* mimeType, const gchar* encoding, const gchar* baseUri) { g_return_if_fail(WEBKIT_IS_WEB_VIEW(webView)); g_return_if_fail(content); WebKitWebFrame* frame = webView->priv->mainFrame; webkit_web_frame_load_string(frame, content, mimeType, encoding, baseUri); }
C
Chrome
0
CVE-2015-6787
https://www.cvedetails.com/cve/CVE-2015-6787/
null
https://github.com/chromium/chromium/commit/f911e11e7f6b5c0d6f5ee694a9871de6619889f7
f911e11e7f6b5c0d6f5ee694a9871de6619889f7
Reland "[CI] Make paint property nodes non-ref-counted" This reverts commit 887383b30842d9d9006e11bb6932660a3cb5b1b7. Reason for revert: Retry in M69. Original change's description: > Revert "[CI] Make paint property nodes non-ref-counted" > > This reverts commit 70fc0b018c9517558b7aa2be00edf2debb449123. > > Reason for revert: Caused bugs found by clusterfuzz > > Original change's description: > > [CI] Make paint property nodes non-ref-counted > > > > Now all paint property nodes are owned by ObjectPaintProperties > > (and LocalFrameView temporarily before removing non-RLS mode). > > Others just use raw pointers or references. > > > > Bug: 833496 > > Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2 > > Change-Id: I2d544fe153bb94698623248748df63c8aa2081ae > > Reviewed-on: https://chromium-review.googlesource.com/1031101 > > Reviewed-by: Tien-Ren Chen <[email protected]> > > Commit-Queue: Xianzhu Wang <[email protected]> > > Cr-Commit-Position: refs/heads/master@{#554626} > > [email protected],[email protected],[email protected] > > Change-Id: I02bb50d6744cb81a797246a0116b677e80a3c69f > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: 833496,837932,837943 > Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2 > Reviewed-on: https://chromium-review.googlesource.com/1034292 > Reviewed-by: Xianzhu Wang <[email protected]> > Commit-Queue: Xianzhu Wang <[email protected]> > Cr-Commit-Position: refs/heads/master@{#554653} [email protected],[email protected],[email protected] # Not skipping CQ checks because original CL landed > 1 day ago. Bug: 833496, 837932, 837943 Change-Id: I0b4ef70db1f1f211ba97c30d617225355c750992 Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2 Reviewed-on: https://chromium-review.googlesource.com/1083491 Commit-Queue: Xianzhu Wang <[email protected]> Reviewed-by: Xianzhu Wang <[email protected]> Cr-Commit-Position: refs/heads/master@{#563930}
void ConversionContext::SwitchToChunkState(const PaintChunk& chunk) { chunk_to_layer_mapper_.SwitchToChunk(chunk); const auto& chunk_state = chunk.properties; SwitchToEffect(chunk_state.Effect()); SwitchToClip(chunk_state.Clip()); SwitchToTransform(chunk_state.Transform()); }
void ConversionContext::SwitchToChunkState(const PaintChunk& chunk) { chunk_to_layer_mapper_.SwitchToChunk(chunk); const auto& chunk_state = chunk.properties; SwitchToEffect(chunk_state.Effect()); SwitchToClip(chunk_state.Clip()); SwitchToTransform(chunk_state.Transform()); }
C
Chrome
0
null
null
null
https://github.com/chromium/chromium/commit/d1a59e4e845a01d7d7b80ef184b672752a9eae4d
d1a59e4e845a01d7d7b80ef184b672752a9eae4d
Fixing cross-process postMessage replies on more than two iterations. When two frames are replying to each other using event.source across processes, after the first two replies, things break down. The root cause is that in RenderViewImpl::GetFrameByMappedID, the lookup was incorrect. It is now properly searching for the remote frame id and returning the local one. BUG=153445 Review URL: https://chromiumcodereview.appspot.com/11040015 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@159924 0039d316-1c4b-4281-b951-d872f2087c98
void RenderViewImpl::show(WebNavigationPolicy policy) { DCHECK(!did_show_) << "received extraneous Show call"; DCHECK(opener_id_ != MSG_ROUTING_NONE); if (did_show_) return; did_show_ = true; if (content::GetContentClient()->renderer()->AllowPopup(creator_url_)) opened_by_user_gesture_ = true; if (!opened_by_user_gesture_) { if (policy != WebKit::WebNavigationPolicyNewBackgroundTab) policy = WebKit::WebNavigationPolicyNewPopup; } Send(new ViewHostMsg_ShowView(opener_id_, routing_id_, NavigationPolicyToDisposition(policy), initial_pos_, opened_by_user_gesture_)); SetPendingWindowRect(initial_pos_); }
void RenderViewImpl::show(WebNavigationPolicy policy) { DCHECK(!did_show_) << "received extraneous Show call"; DCHECK(opener_id_ != MSG_ROUTING_NONE); if (did_show_) return; did_show_ = true; if (content::GetContentClient()->renderer()->AllowPopup(creator_url_)) opened_by_user_gesture_ = true; if (!opened_by_user_gesture_) { if (policy != WebKit::WebNavigationPolicyNewBackgroundTab) policy = WebKit::WebNavigationPolicyNewPopup; } Send(new ViewHostMsg_ShowView(opener_id_, routing_id_, NavigationPolicyToDisposition(policy), initial_pos_, opened_by_user_gesture_)); SetPendingWindowRect(initial_pos_); }
C
Chrome
0
CVE-2012-1601
https://www.cvedetails.com/cve/CVE-2012-1601/
CWE-399
https://github.com/torvalds/linux/commit/9c895160d25a76c21b65bad141b08e8d4f99afef
9c895160d25a76c21b65bad141b08e8d4f99afef
KVM: Ensure all vcpus are consistent with in-kernel irqchip settings (cherry picked from commit 3e515705a1f46beb1c942bb8043c16f8ac7b1e9e) If some vcpus are created before KVM_CREATE_IRQCHIP, then irqchip_in_kernel() and vcpu->arch.apic will be inconsistent, leading to potential NULL pointer dereferences. Fix by: - ensuring that no vcpus are installed when KVM_CREATE_IRQCHIP is called - ensuring that a vcpu has an apic if it is installed after KVM_CREATE_IRQCHIP This is somewhat long winded because vcpu->arch.apic is created without kvm->lock held. Based on earlier patch by Michael Ellerman. Signed-off-by: Michael Ellerman <[email protected]> Signed-off-by: Avi Kivity <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
void kvm_propagate_fault(struct kvm_vcpu *vcpu, struct x86_exception *fault) { if (mmu_is_nested(vcpu) && !fault->nested_page_fault) vcpu->arch.nested_mmu.inject_page_fault(vcpu, fault); else vcpu->arch.mmu.inject_page_fault(vcpu, fault); }
void kvm_propagate_fault(struct kvm_vcpu *vcpu, struct x86_exception *fault) { if (mmu_is_nested(vcpu) && !fault->nested_page_fault) vcpu->arch.nested_mmu.inject_page_fault(vcpu, fault); else vcpu->arch.mmu.inject_page_fault(vcpu, fault); }
C
linux
0
null
null
null
https://github.com/chromium/chromium/commit/a1f6ba4c1c488be710013f8548ff5513b32a7f3b
a1f6ba4c1c488be710013f8548ff5513b32a7f3b
Define DEBUG_GL_COMMANDS only in debug builds. https://bugs.webkit.org/show_bug.cgi?id=74083 Reviewed by Noam Rosenthal. No tests added as this change does not affect functionality. * platform/graphics/opengl/TextureMapperGL.cpp: git-svn-id: svn://svn.chromium.org/blink/trunk@102359 bbb929c8-8fbe-4397-9dbb-9b2b20218538
void TextureMapperGL::bindSurface(BitmapTexture *surfacePointer) { BitmapTextureGL* surface = static_cast<BitmapTextureGL*>(surfacePointer); if (!surface) { GL_CMD(glBindFramebuffer(GL_FRAMEBUFFER, 0)) data().projectionMatrix = createProjectionMatrix(viewportSize(), true).multiply(transform()); GL_CMD(glStencilFunc(data().globalGLData.stencilIndex > 1 ? GL_EQUAL : GL_ALWAYS, data().globalGLData.stencilIndex - 1, data().globalGLData.stencilIndex - 1)) GL_CMD(glStencilOp(GL_KEEP, GL_KEEP, GL_KEEP)) GL_CMD(glViewport(0, 0, viewportSize().width(), viewportSize().height())) return; } surface->bind(); }
void TextureMapperGL::bindSurface(BitmapTexture *surfacePointer) { BitmapTextureGL* surface = static_cast<BitmapTextureGL*>(surfacePointer); if (!surface) { GL_CMD(glBindFramebuffer(GL_FRAMEBUFFER, 0)) data().projectionMatrix = createProjectionMatrix(viewportSize(), true).multiply(transform()); GL_CMD(glStencilFunc(data().globalGLData.stencilIndex > 1 ? GL_EQUAL : GL_ALWAYS, data().globalGLData.stencilIndex - 1, data().globalGLData.stencilIndex - 1)) GL_CMD(glStencilOp(GL_KEEP, GL_KEEP, GL_KEEP)) GL_CMD(glViewport(0, 0, viewportSize().width(), viewportSize().height())) return; } surface->bind(); }
C
Chrome
0
CVE-2016-0823
https://www.cvedetails.com/cve/CVE-2016-0823/
CWE-200
https://github.com/torvalds/linux/commit/ab676b7d6fbf4b294bf198fb27ade5b0e865c7ce
ab676b7d6fbf4b294bf198fb27ade5b0e865c7ce
pagemap: do not leak physical addresses to non-privileged userspace As pointed by recent post[1] on exploiting DRAM physical imperfection, /proc/PID/pagemap exposes sensitive information which can be used to do attacks. This disallows anybody without CAP_SYS_ADMIN to read the pagemap. [1] http://googleprojectzero.blogspot.com/2015/03/exploiting-dram-rowhammer-bug-to-gain.html [ Eventually we might want to do anything more finegrained, but for now this is the simple model. - Linus ] Signed-off-by: Kirill A. Shutemov <[email protected]> Acked-by: Konstantin Khlebnikov <[email protected]> Acked-by: Andy Lutomirski <[email protected]> Cc: Pavel Emelyanov <[email protected]> Cc: Andrew Morton <[email protected]> Cc: Mark Seaborn <[email protected]> Cc: [email protected] Signed-off-by: Linus Torvalds <[email protected]>
static void release_task_mempolicy(struct proc_maps_private *priv) { mpol_put(priv->task_mempolicy); }
static void release_task_mempolicy(struct proc_maps_private *priv) { mpol_put(priv->task_mempolicy); }
C
linux
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.
snmp_input(int operation, netsnmp_session * session, int reqid, netsnmp_pdu * pdu, void *magic) { return 1; }
snmp_input(int operation, netsnmp_session * session, int reqid, netsnmp_pdu * pdu, void *magic) { return 1; }
C
pacemaker
0
CVE-2011-3053
https://www.cvedetails.com/cve/CVE-2011-3053/
CWE-399
https://github.com/chromium/chromium/commit/c442b3eda2f1fdd4d1d4864c34c43cbaf223acae
c442b3eda2f1fdd4d1d4864c34c43cbaf223acae
chromeos: Move audio, power, and UI files into subdirs. This moves more files from chrome/browser/chromeos/ into subdirectories. BUG=chromium-os:22896 TEST=did chrome os builds both with and without aura TBR=sky Review URL: http://codereview.chromium.org/9125006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@116746 0039d316-1c4b-4281-b951-d872f2087c98
void TestingAutomationProvider::CaptureProfilePhoto( Browser* browser, DictionaryValue* args, IPC::Message* reply_message) { chromeos::TakePhotoDialog* take_photo_dialog = new chromeos::TakePhotoDialog(NULL); take_photo_dialog->AddObserver(new PhotoCaptureObserver( this, reply_message)); views::Widget* window = browser::CreateViewsWindow( browser->window()->GetNativeHandle(), take_photo_dialog, STYLE_GENERIC); window->SetAlwaysOnTop(true); window->Show(); }
void TestingAutomationProvider::CaptureProfilePhoto( Browser* browser, DictionaryValue* args, IPC::Message* reply_message) { chromeos::TakePhotoDialog* take_photo_dialog = new chromeos::TakePhotoDialog(NULL); take_photo_dialog->AddObserver(new PhotoCaptureObserver( this, reply_message)); views::Widget* window = browser::CreateViewsWindow( browser->window()->GetNativeHandle(), take_photo_dialog, STYLE_GENERIC); window->SetAlwaysOnTop(true); window->Show(); }
C
Chrome
0
CVE-2017-9798
https://www.cvedetails.com/cve/CVE-2017-9798/
CWE-416
https://github.com/apache/httpd/commit/29afdd2550b3d30a8defece2b95ae81edcf66ac9
29afdd2550b3d30a8defece2b95ae81edcf66ac9
core: Disallow Methods' registration at run time (.htaccess), they may be used only if registered at init time (httpd.conf). Calling ap_method_register() in children processes is not the right scope since it won't be shared for all requests. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1807655 13f79535-47bb-0310-9956-ffa450edef68
AP_DECLARE(void) ap_set_document_root(request_rec *r, const char *document_root) { core_request_config *conf = ap_get_core_module_config(r->request_config); conf->document_root = document_root; }
AP_DECLARE(void) ap_set_document_root(request_rec *r, const char *document_root) { core_request_config *conf = ap_get_core_module_config(r->request_config); conf->document_root = document_root; }
C
httpd
0
CVE-2016-4951
https://www.cvedetails.com/cve/CVE-2016-4951/
null
https://github.com/torvalds/linux/commit/45e093ae2830cd1264677d47ff9a95a71f5d9f9c
45e093ae2830cd1264677d47ff9a95a71f5d9f9c
tipc: check nl sock before parsing nested attributes Make sure the socket for which the user is listing publication exists before parsing the socket netlink attributes. Prior to this patch a call without any socket caused a NULL pointer dereference in tipc_nl_publ_dump(). Tested-and-reported-by: Baozeng Ding <[email protected]> Signed-off-by: Richard Alpe <[email protected]> Acked-by: Jon Maloy <[email protected]> Signed-off-by: David S. Miller <[email protected]>
static int tipc_setsockopt(struct socket *sock, int lvl, int opt, char __user *ov, unsigned int ol) { struct sock *sk = sock->sk; struct tipc_sock *tsk = tipc_sk(sk); u32 value; int res; if ((lvl == IPPROTO_TCP) && (sock->type == SOCK_STREAM)) return 0; if (lvl != SOL_TIPC) return -ENOPROTOOPT; if (ol < sizeof(value)) return -EINVAL; res = get_user(value, (u32 __user *)ov); if (res) return res; lock_sock(sk); switch (opt) { case TIPC_IMPORTANCE: res = tsk_set_importance(tsk, value); break; case TIPC_SRC_DROPPABLE: if (sock->type != SOCK_STREAM) tsk_set_unreliable(tsk, value); else res = -ENOPROTOOPT; break; case TIPC_DEST_DROPPABLE: tsk_set_unreturnable(tsk, value); break; case TIPC_CONN_TIMEOUT: tipc_sk(sk)->conn_timeout = value; /* no need to set "res", since already 0 at this point */ break; default: res = -EINVAL; } release_sock(sk); return res; }
static int tipc_setsockopt(struct socket *sock, int lvl, int opt, char __user *ov, unsigned int ol) { struct sock *sk = sock->sk; struct tipc_sock *tsk = tipc_sk(sk); u32 value; int res; if ((lvl == IPPROTO_TCP) && (sock->type == SOCK_STREAM)) return 0; if (lvl != SOL_TIPC) return -ENOPROTOOPT; if (ol < sizeof(value)) return -EINVAL; res = get_user(value, (u32 __user *)ov); if (res) return res; lock_sock(sk); switch (opt) { case TIPC_IMPORTANCE: res = tsk_set_importance(tsk, value); break; case TIPC_SRC_DROPPABLE: if (sock->type != SOCK_STREAM) tsk_set_unreliable(tsk, value); else res = -ENOPROTOOPT; break; case TIPC_DEST_DROPPABLE: tsk_set_unreturnable(tsk, value); break; case TIPC_CONN_TIMEOUT: tipc_sk(sk)->conn_timeout = value; /* no need to set "res", since already 0 at this point */ break; default: res = -EINVAL; } release_sock(sk); return res; }
C
linux
0
CVE-2013-4591
https://www.cvedetails.com/cve/CVE-2013-4591/
CWE-119
https://github.com/torvalds/linux/commit/7d3e91a89b7adbc2831334def9e494dd9892f9af
7d3e91a89b7adbc2831334def9e494dd9892f9af
NFSv4: Check for buffer length in __nfs4_get_acl_uncached Commit 1f1ea6c "NFSv4: Fix buffer overflow checking in __nfs4_get_acl_uncached" accidently dropped the checking for too small result buffer length. If someone uses getxattr on "system.nfs4_acl" on an NFSv4 mount supporting ACLs, the ACL has not been cached and the buffer suplied is too short, we still copy the complete ACL, resulting in kernel and user space memory corruption. Signed-off-by: Sven Wegener <[email protected]> Cc: [email protected] Signed-off-by: Trond Myklebust <[email protected]>
static struct nfs4_createdata *nfs4_alloc_createdata(struct inode *dir, struct qstr *name, struct iattr *sattr, u32 ftype) { struct nfs4_createdata *data; data = kzalloc(sizeof(*data), GFP_KERNEL); if (data != NULL) { struct nfs_server *server = NFS_SERVER(dir); data->msg.rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_CREATE]; data->msg.rpc_argp = &data->arg; data->msg.rpc_resp = &data->res; data->arg.dir_fh = NFS_FH(dir); data->arg.server = server; data->arg.name = name; data->arg.attrs = sattr; data->arg.ftype = ftype; data->arg.bitmask = server->attr_bitmask; data->res.server = server; data->res.fh = &data->fh; data->res.fattr = &data->fattr; nfs_fattr_init(data->res.fattr); } return data; }
static struct nfs4_createdata *nfs4_alloc_createdata(struct inode *dir, struct qstr *name, struct iattr *sattr, u32 ftype) { struct nfs4_createdata *data; data = kzalloc(sizeof(*data), GFP_KERNEL); if (data != NULL) { struct nfs_server *server = NFS_SERVER(dir); data->msg.rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_CREATE]; data->msg.rpc_argp = &data->arg; data->msg.rpc_resp = &data->res; data->arg.dir_fh = NFS_FH(dir); data->arg.server = server; data->arg.name = name; data->arg.attrs = sattr; data->arg.ftype = ftype; data->arg.bitmask = server->attr_bitmask; data->res.server = server; data->res.fh = &data->fh; data->res.fattr = &data->fattr; nfs_fattr_init(data->res.fattr); } return data; }
C
linux
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
Render_Gray_Glyph( RAS_ARG ) { Long pixel_width; FT_Error error; Set_High_Precision( RAS_VARS ras.outline.flags & FT_OUTLINE_HIGH_PRECISION ); ras.scale_shift = ras.precision_shift + 1; if ( ras.outline.flags & FT_OUTLINE_IGNORE_DROPOUTS ) ras.dropOutControl = 2; else { if ( ras.outline.flags & FT_OUTLINE_SMART_DROPOUTS ) ras.dropOutControl = 4; else ras.dropOutControl = 0; if ( !( ras.outline.flags & FT_OUTLINE_INCLUDE_STUBS ) ) ras.dropOutControl += 1; } ras.second_pass = !( ras.outline.flags & FT_OUTLINE_SINGLE_PASS ); /* Vertical Sweep */ ras.band_top = 0; ras.band_stack[0].y_min = 0; ras.band_stack[0].y_max = 2 * ras.target.rows - 1; ras.bWidth = ras.gray_width; pixel_width = 2 * ( ( ras.target.width + 3 ) >> 2 ); if ( ras.bWidth > pixel_width ) ras.bWidth = pixel_width; ras.bWidth = ras.bWidth * 8; ras.bTarget = (Byte*)ras.gray_lines; ras.gTarget = (Byte*)ras.target.buffer; ras.Proc_Sweep_Init = Vertical_Gray_Sweep_Init; ras.Proc_Sweep_Span = Vertical_Sweep_Span; ras.Proc_Sweep_Drop = Vertical_Sweep_Drop; ras.Proc_Sweep_Step = Vertical_Gray_Sweep_Step; error = Render_Single_Pass( RAS_VARS 0 ); if ( error ) return error; /* Horizontal Sweep */ if ( ras.second_pass && ras.dropOutControl != 2 ) { ras.Proc_Sweep_Init = Horizontal_Sweep_Init; ras.Proc_Sweep_Span = Horizontal_Gray_Sweep_Span; ras.Proc_Sweep_Drop = Horizontal_Gray_Sweep_Drop; ras.Proc_Sweep_Step = Horizontal_Sweep_Step; ras.band_top = 0; ras.band_stack[0].y_min = 0; ras.band_stack[0].y_max = ras.target.width * 2 - 1; error = Render_Single_Pass( RAS_VARS 1 ); if ( error ) return error; } return Raster_Err_None; }
Render_Gray_Glyph( RAS_ARG ) { Long pixel_width; FT_Error error; Set_High_Precision( RAS_VARS ras.outline.flags & FT_OUTLINE_HIGH_PRECISION ); ras.scale_shift = ras.precision_shift + 1; if ( ras.outline.flags & FT_OUTLINE_IGNORE_DROPOUTS ) ras.dropOutControl = 2; else { if ( ras.outline.flags & FT_OUTLINE_SMART_DROPOUTS ) ras.dropOutControl = 4; else ras.dropOutControl = 0; if ( !( ras.outline.flags & FT_OUTLINE_INCLUDE_STUBS ) ) ras.dropOutControl += 1; } ras.second_pass = !( ras.outline.flags & FT_OUTLINE_SINGLE_PASS ); /* Vertical Sweep */ ras.band_top = 0; ras.band_stack[0].y_min = 0; ras.band_stack[0].y_max = 2 * ras.target.rows - 1; ras.bWidth = ras.gray_width; pixel_width = 2 * ( ( ras.target.width + 3 ) >> 2 ); if ( ras.bWidth > pixel_width ) ras.bWidth = pixel_width; ras.bWidth = ras.bWidth * 8; ras.bTarget = (Byte*)ras.gray_lines; ras.gTarget = (Byte*)ras.target.buffer; ras.Proc_Sweep_Init = Vertical_Gray_Sweep_Init; ras.Proc_Sweep_Span = Vertical_Sweep_Span; ras.Proc_Sweep_Drop = Vertical_Sweep_Drop; ras.Proc_Sweep_Step = Vertical_Gray_Sweep_Step; error = Render_Single_Pass( RAS_VARS 0 ); if ( error ) return error; /* Horizontal Sweep */ if ( ras.second_pass && ras.dropOutControl != 2 ) { ras.Proc_Sweep_Init = Horizontal_Sweep_Init; ras.Proc_Sweep_Span = Horizontal_Gray_Sweep_Span; ras.Proc_Sweep_Drop = Horizontal_Gray_Sweep_Drop; ras.Proc_Sweep_Step = Horizontal_Sweep_Step; ras.band_top = 0; ras.band_stack[0].y_min = 0; ras.band_stack[0].y_max = ras.target.width * 2 - 1; error = Render_Single_Pass( RAS_VARS 1 ); if ( error ) return error; } return Raster_Err_None; }
C
savannah
0
CVE-2016-5735
https://www.cvedetails.com/cve/CVE-2016-5735/
CWE-190
https://github.com/pornel/pngquant/commit/b7c217680cda02dddced245d237ebe8c383be285
b7c217680cda02dddced245d237ebe8c383be285
Fix integer overflow in rwpng.h (CVE-2016-5735) Reported by Choi Jaeseung Found with Sparrow (http://ropas.snu.ac.kr/sparrow)
static void rwpng_error_handler(png_structp png_ptr, png_const_charp msg) { rwpng_png_image *mainprog_ptr; /* This function, aside from the extra step of retrieving the "error * pointer" (below) and the fact that it exists within the application * rather than within libpng, is essentially identical to libpng's * default error handler. The second point is critical: since both * setjmp() and longjmp() are called from the same code, they are * guaranteed to have compatible notions of how big a jmp_buf is, * regardless of whether _BSD_SOURCE or anything else has (or has not) * been defined. */ fprintf(stderr, " error: %s (libpng failed)\n", msg); fflush(stderr); mainprog_ptr = png_get_error_ptr(png_ptr); if (mainprog_ptr == NULL) abort(); longjmp(mainprog_ptr->jmpbuf, 1); }
static void rwpng_error_handler(png_structp png_ptr, png_const_charp msg) { rwpng_png_image *mainprog_ptr; /* This function, aside from the extra step of retrieving the "error * pointer" (below) and the fact that it exists within the application * rather than within libpng, is essentially identical to libpng's * default error handler. The second point is critical: since both * setjmp() and longjmp() are called from the same code, they are * guaranteed to have compatible notions of how big a jmp_buf is, * regardless of whether _BSD_SOURCE or anything else has (or has not) * been defined. */ fprintf(stderr, " error: %s (libpng failed)\n", msg); fflush(stderr); mainprog_ptr = png_get_error_ptr(png_ptr); if (mainprog_ptr == NULL) abort(); longjmp(mainprog_ptr->jmpbuf, 1); }
C
pngquant
0
CVE-2017-7645
https://www.cvedetails.com/cve/CVE-2017-7645/
CWE-20
https://github.com/torvalds/linux/commit/e6838a29ecb484c97e4efef9429643b9851fba6e
e6838a29ecb484c97e4efef9429643b9851fba6e
nfsd: check for oversized NFSv2/v3 arguments A client can append random data to the end of an NFSv2 or NFSv3 RPC call without our complaining; we'll just stop parsing at the end of the expected data and ignore the rest. Encoded arguments and replies are stored together in an array of pages, and if a call is too large it could leave inadequate space for the reply. This is normally OK because NFS RPC's typically have either short arguments and long replies (like READ) or long arguments and short replies (like WRITE). But a client that sends an incorrectly long reply can violate those assumptions. This was observed to cause crashes. Also, several operations increment rq_next_page in the decode routine before checking the argument size, which can leave rq_next_page pointing well past the end of the page array, causing trouble later in svc_free_pages. So, following a suggestion from Neil Brown, add a central check to enforce our expectation that no NFSv2/v3 call has both a large call and a large reply. As followup we may also want to rewrite the encoding routines to check more carefully that they aren't running off the end of the page array. We may also consider rejecting calls that have any extra garbage appended. That would be safer, and within our rights by spec, but given the age of our server and the NFS protocol, and the fact that we've never enforced this before, we may need to balance that against the possibility of breaking some oddball client. Reported-by: Tuomas Haanpää <[email protected]> Reported-by: Ari Kauppi <[email protected]> Cc: [email protected] Reviewed-by: NeilBrown <[email protected]> Signed-off-by: J. Bruce Fields <[email protected]>
static bool nfsd_needs_lockd(void) { #if defined(CONFIG_NFSD_V3) return (nfsd_versions[2] != NULL) || (nfsd_versions[3] != NULL); #else return (nfsd_versions[2] != NULL); #endif }
static bool nfsd_needs_lockd(void) { #if defined(CONFIG_NFSD_V3) return (nfsd_versions[2] != NULL) || (nfsd_versions[3] != NULL); #else return (nfsd_versions[2] != NULL); #endif }
C
linux
0
CVE-2017-10971
https://www.cvedetails.com/cve/CVE-2017-10971/
CWE-119
https://cgit.freedesktop.org/xorg/xserver/commit/?id=215f894965df5fb0bb45b107d84524e700d2073c
215f894965df5fb0bb45b107d84524e700d2073c
null
SetClientPointer(ClientPtr client, DeviceIntPtr device) { int rc = XaceHook(XACE_DEVICE_ACCESS, client, device, DixUseAccess); if (rc != Success) return rc; if (!IsMaster(device)) { ErrorF("[dix] Need master device for ClientPointer. This is a bug.\n"); return BadDevice; } else if (!device->spriteInfo->spriteOwner) { ErrorF("[dix] Device %d does not have a sprite. " "Cannot be ClientPointer\n", device->id); return BadDevice; } client->clientPtr = device; return Success; }
SetClientPointer(ClientPtr client, DeviceIntPtr device) { int rc = XaceHook(XACE_DEVICE_ACCESS, client, device, DixUseAccess); if (rc != Success) return rc; if (!IsMaster(device)) { ErrorF("[dix] Need master device for ClientPointer. This is a bug.\n"); return BadDevice; } else if (!device->spriteInfo->spriteOwner) { ErrorF("[dix] Device %d does not have a sprite. " "Cannot be ClientPointer\n", device->id); return BadDevice; } client->clientPtr = device; return Success; }
C
xserver
0
CVE-2016-4485
https://www.cvedetails.com/cve/CVE-2016-4485/
CWE-200
https://github.com/torvalds/linux/commit/b8670c09f37bdf2847cc44f36511a53afc6161fd
b8670c09f37bdf2847cc44f36511a53afc6161fd
net: fix infoleak in llc The stack object “info” has a total size of 12 bytes. Its last byte is padding which is not initialized and leaked via “put_cmsg”. Signed-off-by: Kangjie Lu <[email protected]> Signed-off-by: David S. Miller <[email protected]>
static int llc_wait_data(struct sock *sk, long timeo) { int rc; while (1) { /* * POSIX 1003.1g mandates this order. */ rc = sock_error(sk); if (rc) break; rc = 0; if (sk->sk_shutdown & RCV_SHUTDOWN) break; rc = -EAGAIN; if (!timeo) break; rc = sock_intr_errno(timeo); if (signal_pending(current)) break; rc = 0; if (sk_wait_data(sk, &timeo, NULL)) break; } return rc; }
static int llc_wait_data(struct sock *sk, long timeo) { int rc; while (1) { /* * POSIX 1003.1g mandates this order. */ rc = sock_error(sk); if (rc) break; rc = 0; if (sk->sk_shutdown & RCV_SHUTDOWN) break; rc = -EAGAIN; if (!timeo) break; rc = sock_intr_errno(timeo); if (signal_pending(current)) break; rc = 0; if (sk_wait_data(sk, &timeo, NULL)) break; } return rc; }
C
linux
0
CVE-2017-18187
https://www.cvedetails.com/cve/CVE-2017-18187/
CWE-190
https://github.com/ARMmbed/mbedtls/commit/83c9f495ffe70c7dd280b41fdfd4881485a3bc28
83c9f495ffe70c7dd280b41fdfd4881485a3bc28
Prevent bounds check bypass through overflow in PSK identity parsing The check `if( *p + n > end )` in `ssl_parse_client_psk_identity` is unsafe because `*p + n` might overflow, thus bypassing the check. As `n` is a user-specified value up to 65K, this is relevant if the library happens to be located in the last 65K of virtual memory. This commit replaces the check by a safe version.
static void ssl_write_alpn_ext( mbedtls_ssl_context *ssl, unsigned char *buf, size_t *olen ) { if( ssl->alpn_chosen == NULL ) { *olen = 0; return; } MBEDTLS_SSL_DEBUG_MSG( 3, ( "server hello, adding alpn extension" ) ); /* * 0 . 1 ext identifier * 2 . 3 ext length * 4 . 5 protocol list length * 6 . 6 protocol name length * 7 . 7+n protocol name */ buf[0] = (unsigned char)( ( MBEDTLS_TLS_EXT_ALPN >> 8 ) & 0xFF ); buf[1] = (unsigned char)( ( MBEDTLS_TLS_EXT_ALPN ) & 0xFF ); *olen = 7 + strlen( ssl->alpn_chosen ); buf[2] = (unsigned char)( ( ( *olen - 4 ) >> 8 ) & 0xFF ); buf[3] = (unsigned char)( ( ( *olen - 4 ) ) & 0xFF ); buf[4] = (unsigned char)( ( ( *olen - 6 ) >> 8 ) & 0xFF ); buf[5] = (unsigned char)( ( ( *olen - 6 ) ) & 0xFF ); buf[6] = (unsigned char)( ( ( *olen - 7 ) ) & 0xFF ); memcpy( buf + 7, ssl->alpn_chosen, *olen - 7 ); }
static void ssl_write_alpn_ext( mbedtls_ssl_context *ssl, unsigned char *buf, size_t *olen ) { if( ssl->alpn_chosen == NULL ) { *olen = 0; return; } MBEDTLS_SSL_DEBUG_MSG( 3, ( "server hello, adding alpn extension" ) ); /* * 0 . 1 ext identifier * 2 . 3 ext length * 4 . 5 protocol list length * 6 . 6 protocol name length * 7 . 7+n protocol name */ buf[0] = (unsigned char)( ( MBEDTLS_TLS_EXT_ALPN >> 8 ) & 0xFF ); buf[1] = (unsigned char)( ( MBEDTLS_TLS_EXT_ALPN ) & 0xFF ); *olen = 7 + strlen( ssl->alpn_chosen ); buf[2] = (unsigned char)( ( ( *olen - 4 ) >> 8 ) & 0xFF ); buf[3] = (unsigned char)( ( ( *olen - 4 ) ) & 0xFF ); buf[4] = (unsigned char)( ( ( *olen - 6 ) >> 8 ) & 0xFF ); buf[5] = (unsigned char)( ( ( *olen - 6 ) ) & 0xFF ); buf[6] = (unsigned char)( ( ( *olen - 7 ) ) & 0xFF ); memcpy( buf + 7, ssl->alpn_chosen, *olen - 7 ); }
C
mbedtls
0
CVE-2014-0182
https://www.cvedetails.com/cve/CVE-2014-0182/
CWE-119
https://git.qemu.org/?p=qemu.git;a=commitdiff;h=a890a2f9137ac3cf5b607649e66a6f3a5512d8dc
a890a2f9137ac3cf5b607649e66a6f3a5512d8dc
null
static inline void vring_used_idx_set(VirtQueue *vq, uint16_t val) { hwaddr pa; pa = vq->vring.used + offsetof(VRingUsed, idx); stw_phys(&address_space_memory, pa, val); }
static inline void vring_used_idx_set(VirtQueue *vq, uint16_t val) { hwaddr pa; pa = vq->vring.used + offsetof(VRingUsed, idx); stw_phys(&address_space_memory, pa, val); }
C
qemu
0
CVE-2013-7421
https://www.cvedetails.com/cve/CVE-2013-7421/
CWE-264
https://github.com/torvalds/linux/commit/5d26a105b5a73e5635eae0629b42fa0a90e07b7b
5d26a105b5a73e5635eae0629b42fa0a90e07b7b
crypto: prefix module autoloading with "crypto-" This prefixes all crypto module loading with "crypto-" so we never run the risk of exposing module auto-loading to userspace via a crypto API, as demonstrated by Mathias Krause: https://lkml.org/lkml/2013/3/4/70 Signed-off-by: Kees Cook <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
static unsigned int __cbc_encrypt(struct blkcipher_desc *desc, struct blkcipher_walk *walk) { struct bf_ctx *ctx = crypto_blkcipher_ctx(desc->tfm); unsigned int bsize = BF_BLOCK_SIZE; unsigned int nbytes = walk->nbytes; u64 *src = (u64 *)walk->src.virt.addr; u64 *dst = (u64 *)walk->dst.virt.addr; u64 *iv = (u64 *)walk->iv; do { *dst = *src ^ *iv; blowfish_enc_blk(ctx, (u8 *)dst, (u8 *)dst); iv = dst; src += 1; dst += 1; nbytes -= bsize; } while (nbytes >= bsize); *(u64 *)walk->iv = *iv; return nbytes; }
static unsigned int __cbc_encrypt(struct blkcipher_desc *desc, struct blkcipher_walk *walk) { struct bf_ctx *ctx = crypto_blkcipher_ctx(desc->tfm); unsigned int bsize = BF_BLOCK_SIZE; unsigned int nbytes = walk->nbytes; u64 *src = (u64 *)walk->src.virt.addr; u64 *dst = (u64 *)walk->dst.virt.addr; u64 *iv = (u64 *)walk->iv; do { *dst = *src ^ *iv; blowfish_enc_blk(ctx, (u8 *)dst, (u8 *)dst); iv = dst; src += 1; dst += 1; nbytes -= bsize; } while (nbytes >= bsize); *(u64 *)walk->iv = *iv; return nbytes; }
C
linux
0
CVE-2018-18445
https://www.cvedetails.com/cve/CVE-2018-18445/
CWE-125
https://github.com/torvalds/linux/commit/b799207e1e1816b09e7a5920fbb2d5fcf6edd681
b799207e1e1816b09e7a5920fbb2d5fcf6edd681
bpf: 32-bit RSH verification must truncate input before the ALU op When I wrote commit 468f6eafa6c4 ("bpf: fix 32-bit ALU op verification"), I assumed that, in order to emulate 64-bit arithmetic with 32-bit logic, it is sufficient to just truncate the output to 32 bits; and so I just moved the register size coercion that used to be at the start of the function to the end of the function. That assumption is true for almost every op, but not for 32-bit right shifts, because those can propagate information towards the least significant bit. Fix it by always truncating inputs for 32-bit ops to 32 bits. Also get rid of the coerce_reg_to_size() after the ALU op, since that has no effect. Fixes: 468f6eafa6c4 ("bpf: fix 32-bit ALU op verification") Acked-by: Daniel Borkmann <[email protected]> Signed-off-by: Jann Horn <[email protected]> Signed-off-by: Daniel Borkmann <[email protected]>
static int find_subprog(struct bpf_verifier_env *env, int off) { struct bpf_subprog_info *p; p = bsearch(&off, env->subprog_info, env->subprog_cnt, sizeof(env->subprog_info[0]), cmp_subprogs); if (!p) return -ENOENT; return p - env->subprog_info; }
static int find_subprog(struct bpf_verifier_env *env, int off) { struct bpf_subprog_info *p; p = bsearch(&off, env->subprog_info, env->subprog_cnt, sizeof(env->subprog_info[0]), cmp_subprogs); if (!p) return -ENOENT; return p - env->subprog_info; }
C
linux
0
CVE-2016-1641
https://www.cvedetails.com/cve/CVE-2016-1641/
null
https://github.com/chromium/chromium/commit/75ca8ffd7bd7c58ace1144df05e1307d8d707662
75ca8ffd7bd7c58ace1144df05e1307d8d707662
Don't call WebContents::DownloadImage() callback if the WebContents were deleted BUG=583718 Review URL: https://codereview.chromium.org/1685343004 Cr-Commit-Position: refs/heads/master@{#375700}
WebUI* WebContentsImpl::CreateWebUI(const GURL& url, const std::string& frame_name) { WebUIImpl* web_ui = new WebUIImpl(this, frame_name); WebUIController* controller = WebUIControllerFactoryRegistry::GetInstance()-> CreateWebUIControllerForURL(web_ui, url); if (controller) { web_ui->AddMessageHandler(new GenericHandler()); web_ui->SetController(controller); return web_ui; } delete web_ui; return NULL; }
WebUI* WebContentsImpl::CreateWebUI(const GURL& url, const std::string& frame_name) { WebUIImpl* web_ui = new WebUIImpl(this, frame_name); WebUIController* controller = WebUIControllerFactoryRegistry::GetInstance()-> CreateWebUIControllerForURL(web_ui, url); if (controller) { web_ui->AddMessageHandler(new GenericHandler()); web_ui->SetController(controller); return web_ui; } delete web_ui; return NULL; }
C
Chrome
0
CVE-2016-8666
https://www.cvedetails.com/cve/CVE-2016-8666/
CWE-400
https://github.com/torvalds/linux/commit/fac8e0f579695a3ecbc4d3cac369139d7f819971
fac8e0f579695a3ecbc4d3cac369139d7f819971
tunnels: Don't apply GRO to multiple layers of encapsulation. When drivers express support for TSO of encapsulated packets, they only mean that they can do it for one layer of encapsulation. Supporting additional levels would mean updating, at a minimum, more IP length fields and they are unaware of this. No encapsulation device expresses support for handling offloaded encapsulated packets, so we won't generate these types of frames in the transmit path. However, GRO doesn't have a check for multiple levels of encapsulation and will attempt to build them. UDP tunnel GRO actually does prevent this situation but it only handles multiple UDP tunnels stacked on top of each other. This generalizes that solution to prevent any kind of tunnel stacking that would cause problems. Fixes: bf5a755f ("net-gre-gro: Add GRE support to the GRO stack") Signed-off-by: Jesse Gross <[email protected]> Signed-off-by: David S. Miller <[email protected]>
static int rps_ipi_queued(struct softnet_data *sd) { #ifdef CONFIG_RPS struct softnet_data *mysd = this_cpu_ptr(&softnet_data); if (sd != mysd) { sd->rps_ipi_next = mysd->rps_ipi_list; mysd->rps_ipi_list = sd; __raise_softirq_irqoff(NET_RX_SOFTIRQ); return 1; } #endif /* CONFIG_RPS */ return 0; }
static int rps_ipi_queued(struct softnet_data *sd) { #ifdef CONFIG_RPS struct softnet_data *mysd = this_cpu_ptr(&softnet_data); if (sd != mysd) { sd->rps_ipi_next = mysd->rps_ipi_list; mysd->rps_ipi_list = sd; __raise_softirq_irqoff(NET_RX_SOFTIRQ); return 1; } #endif /* CONFIG_RPS */ return 0; }
C
linux
0
CVE-2016-2440
https://www.cvedetails.com/cve/CVE-2016-2440/
CWE-264
https://android.googlesource.com/platform/frameworks/native/+/a59b827869a2ea04022dd225007f29af8d61837a
a59b827869a2ea04022dd225007f29af8d61837a
Fix issue #27252896: Security Vulnerability -- weak binder Sending transaction to freed BBinder through weak handle can cause use of a (mostly) freed object. We need to try to safely promote to a strong reference first. Change-Id: Ic9c6940fa824980472e94ed2dfeca52a6b0fd342 (cherry picked from commit c11146106f94e07016e8e26e4f8628f9a0c73199)
int IPCThreadState::setupPolling(int* fd) { if (mProcess->mDriverFD <= 0) { return -EBADF; } mOut.writeInt32(BC_ENTER_LOOPER); *fd = mProcess->mDriverFD; return 0; }
int IPCThreadState::setupPolling(int* fd) { if (mProcess->mDriverFD <= 0) { return -EBADF; } mOut.writeInt32(BC_ENTER_LOOPER); *fd = mProcess->mDriverFD; return 0; }
C
Android
0
null
null
null
https://github.com/chromium/chromium/commit/181c7400b2bf50ba02ac77149749fb419b4d4797
181c7400b2bf50ba02ac77149749fb419b4d4797
gpu: Use GetUniformSetup computed result size. [email protected] BUG=468936 Review URL: https://codereview.chromium.org/1016193003 Cr-Commit-Position: refs/heads/master@{#321489}
bool GLES2DecoderImpl::CheckUniformForApiType( const Program::UniformInfo* info, const char* function_name, Program::UniformApiType api_type) { DCHECK(info); if ((api_type & info->accepts_api_type) == 0) { LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION, function_name, "wrong uniform function for type"); return false; } return true; }
bool GLES2DecoderImpl::CheckUniformForApiType( const Program::UniformInfo* info, const char* function_name, Program::UniformApiType api_type) { DCHECK(info); if ((api_type & info->accepts_api_type) == 0) { LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION, function_name, "wrong uniform function for type"); return false; } return true; }
C
Chrome
0
CVE-2017-14604
https://www.cvedetails.com/cve/CVE-2017-14604/
CWE-20
https://github.com/GNOME/nautilus/commit/1630f53481f445ada0a455e9979236d31a8d3bb0
1630f53481f445ada0a455e9979236d31a8d3bb0
mime-actions: use file metadata for trusting desktop files Currently we only trust desktop files that have the executable bit set, and don't replace the displayed icon or the displayed name until it's trusted, which prevents for running random programs by a malicious desktop file. However, the executable permission is preserved if the desktop file comes from a compressed file. To prevent this, add a metadata::trusted metadata to the file once the user acknowledges the file as trusted. This adds metadata to the file, which cannot be added unless it has access to the computer. Also remove the SHEBANG "trusted" content we were putting inside the desktop file, since that doesn't add more security since it can come with the file itself. https://bugzilla.gnome.org/show_bug.cgi?id=777991
cancel_file_info_for_file (NautilusDirectory *directory, NautilusFile *file) { if (directory->details->get_info_file == file) { file_info_cancel (directory); } }
cancel_file_info_for_file (NautilusDirectory *directory, NautilusFile *file) { if (directory->details->get_info_file == file) { file_info_cancel (directory); } }
C
nautilus
0
CVE-2017-18216
https://www.cvedetails.com/cve/CVE-2017-18216/
CWE-476
https://github.com/torvalds/linux/commit/853bc26a7ea39e354b9f8889ae7ad1492ffa28d2
853bc26a7ea39e354b9f8889ae7ad1492ffa28d2
ocfs2: subsystem.su_mutex is required while accessing the item->ci_parent The subsystem.su_mutex is required while accessing the item->ci_parent, otherwise, NULL pointer dereference to the item->ci_parent will be triggered in the following situation: add node delete node sys_write vfs_write configfs_write_file o2nm_node_store o2nm_node_local_write do_rmdir vfs_rmdir configfs_rmdir mutex_lock(&subsys->su_mutex); unlink_obj item->ci_group = NULL; item->ci_parent = NULL; to_o2nm_cluster_from_node node->nd_item.ci_parent->ci_parent BUG since of NULL pointer dereference to nd_item.ci_parent Moreover, the o2nm_cluster also should be protected by the subsystem.su_mutex. [[email protected]: v2] Link: http://lkml.kernel.org/r/[email protected] Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Alex Chen <[email protected]> Reviewed-by: Jun Piao <[email protected]> Reviewed-by: Joseph Qi <[email protected]> Cc: Mark Fasheh <[email protected]> Cc: Joel Becker <[email protected]> Cc: Junxiao Bi <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
void o2nm_undepend_this_node(void) { struct o2nm_node *local_node; local_node = o2nm_get_node_by_num(o2nm_this_node()); BUG_ON(!local_node); o2nm_undepend_item(&local_node->nd_item); o2nm_node_put(local_node); }
void o2nm_undepend_this_node(void) { struct o2nm_node *local_node; local_node = o2nm_get_node_by_num(o2nm_this_node()); BUG_ON(!local_node); o2nm_undepend_item(&local_node->nd_item); o2nm_node_put(local_node); }
C
linux
0
CVE-2018-14357
https://www.cvedetails.com/cve/CVE-2018-14357/
CWE-77
https://github.com/neomutt/neomutt/commit/e52393740334443ae0206cab2d7caef381646725
e52393740334443ae0206cab2d7caef381646725
quote imap strings more carefully Co-authored-by: JerikoOne <[email protected]>
static void cmd_parse_myrights(struct ImapData *idata, const char *s) { mutt_debug(2, "Handling MYRIGHTS\n"); s = imap_next_word((char *) s); s = imap_next_word((char *) s); /* zero out current rights set */ memset(idata->ctx->rights, 0, sizeof(idata->ctx->rights)); while (*s && !isspace((unsigned char) *s)) { switch (*s) { case 'a': mutt_bit_set(idata->ctx->rights, MUTT_ACL_ADMIN); break; case 'e': mutt_bit_set(idata->ctx->rights, MUTT_ACL_EXPUNGE); break; case 'i': mutt_bit_set(idata->ctx->rights, MUTT_ACL_INSERT); break; case 'k': mutt_bit_set(idata->ctx->rights, MUTT_ACL_CREATE); break; case 'l': mutt_bit_set(idata->ctx->rights, MUTT_ACL_LOOKUP); break; case 'p': mutt_bit_set(idata->ctx->rights, MUTT_ACL_POST); break; case 'r': mutt_bit_set(idata->ctx->rights, MUTT_ACL_READ); break; case 's': mutt_bit_set(idata->ctx->rights, MUTT_ACL_SEEN); break; case 't': mutt_bit_set(idata->ctx->rights, MUTT_ACL_DELETE); break; case 'w': mutt_bit_set(idata->ctx->rights, MUTT_ACL_WRITE); break; case 'x': mutt_bit_set(idata->ctx->rights, MUTT_ACL_DELMX); break; /* obsolete rights */ case 'c': mutt_bit_set(idata->ctx->rights, MUTT_ACL_CREATE); mutt_bit_set(idata->ctx->rights, MUTT_ACL_DELMX); break; case 'd': mutt_bit_set(idata->ctx->rights, MUTT_ACL_DELETE); mutt_bit_set(idata->ctx->rights, MUTT_ACL_EXPUNGE); break; default: mutt_debug(1, "Unknown right: %c\n", *s); } s++; } }
static void cmd_parse_myrights(struct ImapData *idata, const char *s) { mutt_debug(2, "Handling MYRIGHTS\n"); s = imap_next_word((char *) s); s = imap_next_word((char *) s); /* zero out current rights set */ memset(idata->ctx->rights, 0, sizeof(idata->ctx->rights)); while (*s && !isspace((unsigned char) *s)) { switch (*s) { case 'a': mutt_bit_set(idata->ctx->rights, MUTT_ACL_ADMIN); break; case 'e': mutt_bit_set(idata->ctx->rights, MUTT_ACL_EXPUNGE); break; case 'i': mutt_bit_set(idata->ctx->rights, MUTT_ACL_INSERT); break; case 'k': mutt_bit_set(idata->ctx->rights, MUTT_ACL_CREATE); break; case 'l': mutt_bit_set(idata->ctx->rights, MUTT_ACL_LOOKUP); break; case 'p': mutt_bit_set(idata->ctx->rights, MUTT_ACL_POST); break; case 'r': mutt_bit_set(idata->ctx->rights, MUTT_ACL_READ); break; case 's': mutt_bit_set(idata->ctx->rights, MUTT_ACL_SEEN); break; case 't': mutt_bit_set(idata->ctx->rights, MUTT_ACL_DELETE); break; case 'w': mutt_bit_set(idata->ctx->rights, MUTT_ACL_WRITE); break; case 'x': mutt_bit_set(idata->ctx->rights, MUTT_ACL_DELMX); break; /* obsolete rights */ case 'c': mutt_bit_set(idata->ctx->rights, MUTT_ACL_CREATE); mutt_bit_set(idata->ctx->rights, MUTT_ACL_DELMX); break; case 'd': mutt_bit_set(idata->ctx->rights, MUTT_ACL_DELETE); mutt_bit_set(idata->ctx->rights, MUTT_ACL_EXPUNGE); break; default: mutt_debug(1, "Unknown right: %c\n", *s); } s++; } }
C
neomutt
0
CVE-2017-15423
https://www.cvedetails.com/cve/CVE-2017-15423/
CWE-310
https://github.com/chromium/chromium/commit/a263d1cf62a9c75be6aaafdec88aacfcef1e8fd2
a263d1cf62a9c75be6aaafdec88aacfcef1e8fd2
Roll src/third_party/boringssl/src 664e99a64..696c13bd6 https://boringssl.googlesource.com/boringssl/+log/664e99a6486c293728097c661332f92bf2d847c6..696c13bd6ab78011adfe7b775519c8b7cc82b604 BUG=778101 Change-Id: I8dda4f3db952597148e3c7937319584698d00e1c Reviewed-on: https://chromium-review.googlesource.com/747941 Reviewed-by: Avi Drissman <[email protected]> Reviewed-by: David Benjamin <[email protected]> Commit-Queue: Steven Valdez <[email protected]> Cr-Commit-Position: refs/heads/master@{#513774}
RenderThreadImpl::render_frame_message_filter() { if (!render_frame_message_filter_) GetChannel()->GetRemoteAssociatedInterface(&render_frame_message_filter_); return render_frame_message_filter_.get(); }
RenderThreadImpl::render_frame_message_filter() { if (!render_frame_message_filter_) GetChannel()->GetRemoteAssociatedInterface(&render_frame_message_filter_); return render_frame_message_filter_.get(); }
C
Chrome
0
CVE-2016-1665
https://www.cvedetails.com/cve/CVE-2016-1665/
CWE-20
https://github.com/chromium/chromium/commit/282f53ffdc3b1902da86f6a0791af736837efbf8
282f53ffdc3b1902da86f6a0791af736837efbf8
[signin] Add metrics to track the source for refresh token updated events This CL add a source for update and revoke credentials operations. It then surfaces the source in the chrome://signin-internals page. This CL also records the following histograms that track refresh token events: * Signin.RefreshTokenUpdated.ToValidToken.Source * Signin.RefreshTokenUpdated.ToInvalidToken.Source * Signin.RefreshTokenRevoked.Source These histograms are needed to validate the assumptions of how often tokens are revoked by the browser and the sources for the token revocations. Bug: 896182 Change-Id: I2fcab80ee8e5699708e695bc3289fa6d34859a90 Reviewed-on: https://chromium-review.googlesource.com/c/1286464 Reviewed-by: Jochen Eisinger <[email protected]> Reviewed-by: David Roger <[email protected]> Reviewed-by: Ilya Sherman <[email protected]> Commit-Queue: Mihai Sardarescu <[email protected]> Cr-Commit-Position: refs/heads/master@{#606181}
void PeopleHandler::UpdateSyncStatus() { FireWebUIListener("sync-status-changed", *GetSyncStatusDictionary()); }
void PeopleHandler::UpdateSyncStatus() { FireWebUIListener("sync-status-changed", *GetSyncStatusDictionary()); }
C
Chrome
0
CVE-2015-8746
https://www.cvedetails.com/cve/CVE-2015-8746/
null
https://github.com/torvalds/linux/commit/18e3b739fdc826481c6a1335ce0c5b19b3d415da
18e3b739fdc826481c6a1335ce0c5b19b3d415da
NFS: Fix a NULL pointer dereference of migration recovery ops for v4.2 client ---Steps to Reproduce-- <nfs-server> # cat /etc/exports /nfs/referal *(rw,insecure,no_subtree_check,no_root_squash,crossmnt) /nfs/old *(ro,insecure,subtree_check,root_squash,crossmnt) <nfs-client> # mount -t nfs nfs-server:/nfs/ /mnt/ # ll /mnt/*/ <nfs-server> # cat /etc/exports /nfs/referal *(rw,insecure,no_subtree_check,no_root_squash,crossmnt,refer=/nfs/old/@nfs-server) /nfs/old *(ro,insecure,subtree_check,root_squash,crossmnt) # service nfs restart <nfs-client> # ll /mnt/*/ --->>>>> oops here [ 5123.102925] BUG: unable to handle kernel NULL pointer dereference at (null) [ 5123.103363] IP: [<ffffffffa03ed38b>] nfs4_proc_get_locations+0x9b/0x120 [nfsv4] [ 5123.103752] PGD 587b9067 PUD 3cbf5067 PMD 0 [ 5123.104131] Oops: 0000 [#1] [ 5123.104529] Modules linked in: nfsv4(OE) nfs(OE) fscache(E) nfsd(OE) xfs libcrc32c iscsi_tcp libiscsi_tcp libiscsi scsi_transport_iscsi coretemp crct10dif_pclmul crc32_pclmul crc32c_intel ghash_clmulni_intel ppdev vmw_balloon parport_pc parport i2c_piix4 shpchp auth_rpcgss nfs_acl vmw_vmci lockd grace sunrpc vmwgfx drm_kms_helper ttm drm mptspi serio_raw scsi_transport_spi e1000 mptscsih mptbase ata_generic pata_acpi [last unloaded: nfsd] [ 5123.105887] CPU: 0 PID: 15853 Comm: ::1-manager Tainted: G OE 4.2.0-rc6+ #214 [ 5123.106358] Hardware name: VMware, Inc. VMware Virtual Platform/440BX Desktop Reference Platform, BIOS 6.00 05/20/2014 [ 5123.106860] task: ffff88007620f300 ti: ffff88005877c000 task.ti: ffff88005877c000 [ 5123.107363] RIP: 0010:[<ffffffffa03ed38b>] [<ffffffffa03ed38b>] nfs4_proc_get_locations+0x9b/0x120 [nfsv4] [ 5123.107909] RSP: 0018:ffff88005877fdb8 EFLAGS: 00010246 [ 5123.108435] RAX: ffff880053f3bc00 RBX: ffff88006ce6c908 RCX: ffff880053a0d240 [ 5123.108968] RDX: ffffea0000e6d940 RSI: ffff8800399a0000 RDI: ffff88006ce6c908 [ 5123.109503] RBP: ffff88005877fe28 R08: ffffffff81c708a0 R09: 0000000000000000 [ 5123.110045] R10: 00000000000001a2 R11: ffff88003ba7f5c8 R12: ffff880054c55800 [ 5123.110618] R13: 0000000000000000 R14: ffff880053a0d240 R15: ffff880053a0d240 [ 5123.111169] FS: 0000000000000000(0000) GS:ffffffff81c27000(0000) knlGS:0000000000000000 [ 5123.111726] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 5123.112286] CR2: 0000000000000000 CR3: 0000000054cac000 CR4: 00000000001406f0 [ 5123.112888] Stack: [ 5123.113458] ffffea0000e6d940 ffff8800399a0000 00000000000167d0 0000000000000000 [ 5123.114049] 0000000000000000 0000000000000000 0000000000000000 00000000a7ec82c6 [ 5123.114662] ffff88005877fe18 ffffea0000e6d940 ffff8800399a0000 ffff880054c55800 [ 5123.115264] Call Trace: [ 5123.115868] [<ffffffffa03fb44b>] nfs4_try_migration+0xbb/0x220 [nfsv4] [ 5123.116487] [<ffffffffa03fcb3b>] nfs4_run_state_manager+0x4ab/0x7b0 [nfsv4] [ 5123.117104] [<ffffffffa03fc690>] ? nfs4_do_reclaim+0x510/0x510 [nfsv4] [ 5123.117813] [<ffffffff810a4527>] kthread+0xd7/0xf0 [ 5123.118456] [<ffffffff810a4450>] ? kthread_worker_fn+0x160/0x160 [ 5123.119108] [<ffffffff816d9cdf>] ret_from_fork+0x3f/0x70 [ 5123.119723] [<ffffffff810a4450>] ? kthread_worker_fn+0x160/0x160 [ 5123.120329] Code: 4c 8b 6a 58 74 17 eb 52 48 8d 55 a8 89 c6 4c 89 e7 e8 4a b5 ff ff 8b 45 b0 85 c0 74 1c 4c 89 f9 48 8b 55 90 48 8b 75 98 48 89 df <41> ff 55 00 3d e8 d8 ff ff 41 89 c6 74 cf 48 8b 4d c8 65 48 33 [ 5123.121643] RIP [<ffffffffa03ed38b>] nfs4_proc_get_locations+0x9b/0x120 [nfsv4] [ 5123.122308] RSP <ffff88005877fdb8> [ 5123.122942] CR2: 0000000000000000 Fixes: ec011fe847 ("NFS: Introduce a vector of migration recovery ops") Cc: [email protected] # v3.13+ Signed-off-by: Kinglong Mee <[email protected]> Signed-off-by: Trond Myklebust <[email protected]>
static int nfs4_do_find_root_sec(struct nfs_server *server, struct nfs_fh *fhandle, struct nfs_fsinfo *info) { int mv = server->nfs_client->cl_minorversion; return nfs_v4_minor_ops[mv]->find_root_sec(server, fhandle, info); }
static int nfs4_do_find_root_sec(struct nfs_server *server, struct nfs_fh *fhandle, struct nfs_fsinfo *info) { int mv = server->nfs_client->cl_minorversion; return nfs_v4_minor_ops[mv]->find_root_sec(server, fhandle, info); }
C
linux
0
CVE-2019-11338
https://www.cvedetails.com/cve/CVE-2019-11338/
CWE-476
https://github.com/FFmpeg/FFmpeg/commit/54655623a82632e7624714d7b2a3e039dc5faa7e
54655623a82632e7624714d7b2a3e039dc5faa7e
avcodec/hevcdec: Avoid only partly skiping duplicate first slices Fixes: NULL pointer dereference and out of array access Fixes: 13871/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_HEVC_fuzzer-5746167087890432 Fixes: 13845/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_HEVC_fuzzer-5650370728034304 This also fixes the return code for explode mode Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Reviewed-by: James Almer <[email protected]> Signed-off-by: Michael Niedermayer <[email protected]>
static void set_deblocking_bypass(HEVCContext *s, int x0, int y0, int log2_cb_size) { int cb_size = 1 << log2_cb_size; int log2_min_pu_size = s->ps.sps->log2_min_pu_size; int min_pu_width = s->ps.sps->min_pu_width; int x_end = FFMIN(x0 + cb_size, s->ps.sps->width); int y_end = FFMIN(y0 + cb_size, s->ps.sps->height); int i, j; for (j = (y0 >> log2_min_pu_size); j < (y_end >> log2_min_pu_size); j++) for (i = (x0 >> log2_min_pu_size); i < (x_end >> log2_min_pu_size); i++) s->is_pcm[i + j * min_pu_width] = 2; }
static void set_deblocking_bypass(HEVCContext *s, int x0, int y0, int log2_cb_size) { int cb_size = 1 << log2_cb_size; int log2_min_pu_size = s->ps.sps->log2_min_pu_size; int min_pu_width = s->ps.sps->min_pu_width; int x_end = FFMIN(x0 + cb_size, s->ps.sps->width); int y_end = FFMIN(y0 + cb_size, s->ps.sps->height); int i, j; for (j = (y0 >> log2_min_pu_size); j < (y_end >> log2_min_pu_size); j++) for (i = (x0 >> log2_min_pu_size); i < (x_end >> log2_min_pu_size); i++) s->is_pcm[i + j * min_pu_width] = 2; }
C
FFmpeg
0
CVE-2018-6111
https://www.cvedetails.com/cve/CVE-2018-6111/
CWE-20
https://github.com/chromium/chromium/commit/3c8e4852477d5b1e2da877808c998dc57db9460f
3c8e4852477d5b1e2da877808c998dc57db9460f
DevTools: speculative fix for crash in NetworkHandler::Disable This keeps BrowserContext* and StoragePartition* instead of RenderProcessHost* in an attemp to resolve UAF of RenderProcessHost upon closure of DevTools front-end. Bug: 801117, 783067, 780694 Change-Id: I6c2cca60cc0c29f0949d189cf918769059f80c1b Reviewed-on: https://chromium-review.googlesource.com/876657 Commit-Queue: Andrey Kosyakov <[email protected]> Reviewed-by: Dmitry Gozman <[email protected]> Cr-Commit-Position: refs/heads/master@{#531157}
void InputHandler::SynthesizeTapGesture( double x, double y, Maybe<int> duration, Maybe<int> tap_count, Maybe<std::string> gesture_source_type, std::unique_ptr<SynthesizeTapGestureCallback> callback) { if (!host_ || !host_->GetRenderWidgetHost()) { callback->sendFailure(Response::InternalError()); return; } SyntheticTapGestureParams gesture_params; const int kDefaultDuration = 50; const int kDefaultTapCount = 1; gesture_params.position = CssPixelsToPointF(x, y, page_scale_factor_); if (!PointIsWithinContents(gesture_params.position)) { callback->sendFailure(Response::InvalidParams("Position out of bounds")); return; } gesture_params.duration_ms = duration.fromMaybe(kDefaultDuration); if (!StringToGestureSourceType( std::move(gesture_source_type), gesture_params.gesture_source_type)) { callback->sendFailure( Response::InvalidParams("Unknown gestureSourceType")); return; } int count = tap_count.fromMaybe(kDefaultTapCount); if (!count) { callback->sendSuccess(); return; } TapGestureResponse* response = new TapGestureResponse(std::move(callback), count); for (int i = 0; i < count; i++) { host_->GetRenderWidgetHost()->QueueSyntheticGesture( SyntheticGesture::Create(gesture_params), base::BindOnce(&TapGestureResponse::OnGestureResult, base::Unretained(response))); } }
void InputHandler::SynthesizeTapGesture( double x, double y, Maybe<int> duration, Maybe<int> tap_count, Maybe<std::string> gesture_source_type, std::unique_ptr<SynthesizeTapGestureCallback> callback) { if (!host_ || !host_->GetRenderWidgetHost()) { callback->sendFailure(Response::InternalError()); return; } SyntheticTapGestureParams gesture_params; const int kDefaultDuration = 50; const int kDefaultTapCount = 1; gesture_params.position = CssPixelsToPointF(x, y, page_scale_factor_); if (!PointIsWithinContents(gesture_params.position)) { callback->sendFailure(Response::InvalidParams("Position out of bounds")); return; } gesture_params.duration_ms = duration.fromMaybe(kDefaultDuration); if (!StringToGestureSourceType( std::move(gesture_source_type), gesture_params.gesture_source_type)) { callback->sendFailure( Response::InvalidParams("Unknown gestureSourceType")); return; } int count = tap_count.fromMaybe(kDefaultTapCount); if (!count) { callback->sendSuccess(); return; } TapGestureResponse* response = new TapGestureResponse(std::move(callback), count); for (int i = 0; i < count; i++) { host_->GetRenderWidgetHost()->QueueSyntheticGesture( SyntheticGesture::Create(gesture_params), base::BindOnce(&TapGestureResponse::OnGestureResult, base::Unretained(response))); } }
C
Chrome
0
CVE-2018-6051
https://www.cvedetails.com/cve/CVE-2018-6051/
CWE-79
https://github.com/chromium/chromium/commit/0da6dcdbe8e34740133773d20cc466b89d399d0a
0da6dcdbe8e34740133773d20cc466b89d399d0a
Restrict the xss audit report URL to same origin BUG=441275 [email protected],[email protected] Change-Id: I27bc8e251b9ad962c3b4fdebf084a2b9152f915d Reviewed-on: https://chromium-review.googlesource.com/768367 Reviewed-by: Tom Sepez <[email protected]> Reviewed-by: Mike West <[email protected]> Commit-Queue: Jochen Eisinger <[email protected]> Cr-Commit-Position: refs/heads/master@{#516666}
static bool StartsMultiLineCommentAt(const String& string, size_t start) { return (start + 1 < string.length() && string[start] == '/' && string[start + 1] == '*'); }
static bool StartsMultiLineCommentAt(const String& string, size_t start) { return (start + 1 < string.length() && string[start] == '/' && string[start + 1] == '*'); }
C
Chrome
0
null
null
null
https://github.com/chromium/chromium/commit/aac449e7154720b895ff1e7f3497c2ce95ae1a5a
aac449e7154720b895ff1e7f3497c2ce95ae1a5a
POSIX: make sure that we never pass directory descriptors into the sandbox. BUG=43304 http://codereview.chromium.org/2733011/show git-svn-id: svn://svn.chromium.org/chrome/trunk/src@49446 0039d316-1c4b-4281-b951-d872f2087c98
void HandleFontOpenRequest(int fd, const Pickle& pickle, void* iter, std::vector<int>& fds) { uint32_t fileid; if (!pickle.ReadUInt32(&iter, &fileid)) return; const int result_fd = font_config_->Open(fileid); Pickle reply; if (result_fd == -1) { reply.WriteBool(false); } else { reply.WriteBool(true); } SendRendererReply(fds, reply, result_fd); if (result_fd >= 0) close(result_fd); }
void HandleFontOpenRequest(int fd, const Pickle& pickle, void* iter, std::vector<int>& fds) { uint32_t fileid; if (!pickle.ReadUInt32(&iter, &fileid)) return; const int result_fd = font_config_->Open(fileid); Pickle reply; if (result_fd == -1) { reply.WriteBool(false); } else { reply.WriteBool(true); } SendRendererReply(fds, reply, result_fd); if (result_fd >= 0) close(result_fd); }
C
Chrome
0
CVE-2013-4247
https://www.cvedetails.com/cve/CVE-2013-4247/
CWE-189
https://github.com/torvalds/linux/commit/1fc29bacedeabb278080e31bb9c1ecb49f143c3b
1fc29bacedeabb278080e31bb9c1ecb49f143c3b
cifs: fix off-by-one bug in build_unc_path_to_root commit 839db3d10a (cifs: fix up handling of prefixpath= option) changed the code such that the vol->prepath no longer contained a leading delimiter and then fixed up the places that accessed that field to account for that change. One spot in build_unc_path_to_root was missed however. When doing the pointer addition on pos, that patch failed to account for the fact that we had already incremented "pos" by one when adding the length of the prepath. This caused a buffer overrun by one byte. This patch fixes the problem by correcting the handling of "pos". Cc: <[email protected]> # v3.8+ Reported-by: Marcus Moeller <[email protected]> Reported-by: Ken Fallon <[email protected]> Signed-off-by: Jeff Layton <[email protected]> Signed-off-by: Steve French <[email protected]>
static int cifs_parse_security_flavors(char *value, struct smb_vol *vol) { substring_t args[MAX_OPT_ARGS]; switch (match_token(value, cifs_secflavor_tokens, args)) { case Opt_sec_krb5: vol->secFlg |= CIFSSEC_MAY_KRB5 | CIFSSEC_MAY_SIGN; break; case Opt_sec_krb5i: vol->secFlg |= CIFSSEC_MAY_KRB5 | CIFSSEC_MUST_SIGN; break; case Opt_sec_krb5p: /* vol->secFlg |= CIFSSEC_MUST_SEAL | CIFSSEC_MAY_KRB5; */ cifs_dbg(VFS, "Krb5 cifs privacy not supported\n"); break; case Opt_sec_ntlmssp: vol->secFlg |= CIFSSEC_MAY_NTLMSSP; break; case Opt_sec_ntlmsspi: vol->secFlg |= CIFSSEC_MAY_NTLMSSP | CIFSSEC_MUST_SIGN; break; case Opt_ntlm: /* ntlm is default so can be turned off too */ vol->secFlg |= CIFSSEC_MAY_NTLM; break; case Opt_sec_ntlmi: vol->secFlg |= CIFSSEC_MAY_NTLM | CIFSSEC_MUST_SIGN; break; case Opt_sec_ntlmv2: vol->secFlg |= CIFSSEC_MAY_NTLMV2; break; case Opt_sec_ntlmv2i: vol->secFlg |= CIFSSEC_MAY_NTLMV2 | CIFSSEC_MUST_SIGN; break; #ifdef CONFIG_CIFS_WEAK_PW_HASH case Opt_sec_lanman: vol->secFlg |= CIFSSEC_MAY_LANMAN; break; #endif case Opt_sec_none: vol->nullauth = 1; vol->secFlg |= CIFSSEC_MAY_NTLM; break; default: cifs_dbg(VFS, "bad security option: %s\n", value); return 1; } return 0; }
static int cifs_parse_security_flavors(char *value, struct smb_vol *vol) { substring_t args[MAX_OPT_ARGS]; switch (match_token(value, cifs_secflavor_tokens, args)) { case Opt_sec_krb5: vol->secFlg |= CIFSSEC_MAY_KRB5 | CIFSSEC_MAY_SIGN; break; case Opt_sec_krb5i: vol->secFlg |= CIFSSEC_MAY_KRB5 | CIFSSEC_MUST_SIGN; break; case Opt_sec_krb5p: /* vol->secFlg |= CIFSSEC_MUST_SEAL | CIFSSEC_MAY_KRB5; */ cifs_dbg(VFS, "Krb5 cifs privacy not supported\n"); break; case Opt_sec_ntlmssp: vol->secFlg |= CIFSSEC_MAY_NTLMSSP; break; case Opt_sec_ntlmsspi: vol->secFlg |= CIFSSEC_MAY_NTLMSSP | CIFSSEC_MUST_SIGN; break; case Opt_ntlm: /* ntlm is default so can be turned off too */ vol->secFlg |= CIFSSEC_MAY_NTLM; break; case Opt_sec_ntlmi: vol->secFlg |= CIFSSEC_MAY_NTLM | CIFSSEC_MUST_SIGN; break; case Opt_sec_ntlmv2: vol->secFlg |= CIFSSEC_MAY_NTLMV2; break; case Opt_sec_ntlmv2i: vol->secFlg |= CIFSSEC_MAY_NTLMV2 | CIFSSEC_MUST_SIGN; break; #ifdef CONFIG_CIFS_WEAK_PW_HASH case Opt_sec_lanman: vol->secFlg |= CIFSSEC_MAY_LANMAN; break; #endif case Opt_sec_none: vol->nullauth = 1; vol->secFlg |= CIFSSEC_MAY_NTLM; break; default: cifs_dbg(VFS, "bad security option: %s\n", value); return 1; } return 0; }
C
linux
0
CVE-2011-2349
https://www.cvedetails.com/cve/CVE-2011-2349/
CWE-399
https://github.com/chromium/chromium/commit/e755d9faf5c7d75a8ea290892cb1b5cc07c412ec
e755d9faf5c7d75a8ea290892cb1b5cc07c412ec
cros: The next 100 clang plugin errors. BUG=none TEST=none TBR=dpolukhin Review URL: http://codereview.chromium.org/7022008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@85418 0039d316-1c4b-4281-b951-d872f2087c98
bool HandleContextMenu(const ContextMenuParams& params) { return true; }
bool HandleContextMenu(const ContextMenuParams& params) { return true; }
C
Chrome
0
CVE-2016-10746
https://www.cvedetails.com/cve/CVE-2016-10746/
CWE-254
https://github.com/libvirt/libvirt/commit/506e9d6c2d4baaf580d489fff0690c0ff2ff588f
506e9d6c2d4baaf580d489fff0690c0ff2ff588f
virDomainGetTime: Deny on RO connections We have a policy that if API may end up talking to a guest agent it should require RW connection. We don't obey the rule in virDomainGetTime(). Signed-off-by: Michal Privoznik <[email protected]>
virDomainSendProcessSignal(virDomainPtr domain, long long pid_value, unsigned int signum, unsigned int flags) { virConnectPtr conn; VIR_DOMAIN_DEBUG(domain, "pid=%lld, signum=%u flags=%x", pid_value, signum, flags); virResetLastError(); virCheckDomainReturn(domain, -1); conn = domain->conn; virCheckNonZeroArgGoto(pid_value, error); virCheckReadOnlyGoto(conn->flags, error); if (conn->driver->domainSendProcessSignal) { int ret; ret = conn->driver->domainSendProcessSignal(domain, pid_value, signum, flags); if (ret < 0) goto error; return ret; } virReportUnsupportedError(); error: virDispatchError(domain->conn); return -1; }
virDomainSendProcessSignal(virDomainPtr domain, long long pid_value, unsigned int signum, unsigned int flags) { virConnectPtr conn; VIR_DOMAIN_DEBUG(domain, "pid=%lld, signum=%u flags=%x", pid_value, signum, flags); virResetLastError(); virCheckDomainReturn(domain, -1); conn = domain->conn; virCheckNonZeroArgGoto(pid_value, error); virCheckReadOnlyGoto(conn->flags, error); if (conn->driver->domainSendProcessSignal) { int ret; ret = conn->driver->domainSendProcessSignal(domain, pid_value, signum, flags); if (ret < 0) goto error; return ret; } virReportUnsupportedError(); error: virDispatchError(domain->conn); return -1; }
C
libvirt
0
CVE-2016-4300
https://www.cvedetails.com/cve/CVE-2016-4300/
CWE-190
https://github.com/libarchive/libarchive/commit/e79ef306afe332faf22e9b442a2c6b59cb175573
e79ef306afe332faf22e9b442a2c6b59cb175573
Issue #718: Fix TALOS-CAN-152 If a 7-Zip archive declares a rediculously large number of substreams, it can overflow an internal counter, leading a subsequent memory allocation to be too small for the substream data. Thanks to the Open Source and Threat Intelligence project at Cisco for reporting this issue.
seek_pack(struct archive_read *a) { struct _7zip *zip = (struct _7zip *)a->format->data; int64_t pack_offset; if (zip->pack_stream_remaining <= 0) { archive_set_error(&(a->archive), ARCHIVE_ERRNO_MISC, "Damaged 7-Zip archive"); return (ARCHIVE_FATAL); } zip->pack_stream_inbytes_remaining = zip->si.pi.sizes[zip->pack_stream_index]; pack_offset = zip->si.pi.positions[zip->pack_stream_index]; if (zip->stream_offset != pack_offset) { if (0 > __archive_read_seek(a, pack_offset + zip->seek_base, SEEK_SET)) return (ARCHIVE_FATAL); zip->stream_offset = pack_offset; } zip->pack_stream_index++; zip->pack_stream_remaining--; return (ARCHIVE_OK); }
seek_pack(struct archive_read *a) { struct _7zip *zip = (struct _7zip *)a->format->data; int64_t pack_offset; if (zip->pack_stream_remaining <= 0) { archive_set_error(&(a->archive), ARCHIVE_ERRNO_MISC, "Damaged 7-Zip archive"); return (ARCHIVE_FATAL); } zip->pack_stream_inbytes_remaining = zip->si.pi.sizes[zip->pack_stream_index]; pack_offset = zip->si.pi.positions[zip->pack_stream_index]; if (zip->stream_offset != pack_offset) { if (0 > __archive_read_seek(a, pack_offset + zip->seek_base, SEEK_SET)) return (ARCHIVE_FATAL); zip->stream_offset = pack_offset; } zip->pack_stream_index++; zip->pack_stream_remaining--; return (ARCHIVE_OK); }
C
libarchive
0
CVE-2017-5120
https://www.cvedetails.com/cve/CVE-2017-5120/
null
https://github.com/chromium/chromium/commit/b7277af490d28ac7f802c015bb0ff31395768556
b7277af490d28ac7f802c015bb0ff31395768556
bindings: Support "attribute FrozenArray<T>?" Adds a quick hack to support a case of "attribute FrozenArray<T>?". Bug: 1028047 Change-Id: Ib3cecc4beb6bcc0fb0dbc667aca595454cc90c86 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1933866 Reviewed-by: Hitoshi Yoshida <[email protected]> Commit-Queue: Yuki Shiino <[email protected]> Cr-Commit-Position: refs/heads/master@{#718676}
static void ActivityLoggingAccessForAllWorldsMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) { TestObject* impl = V8TestObject::ToImpl(info.Holder()); impl->activityLoggingAccessForAllWorldsMethod(); }
static void ActivityLoggingAccessForAllWorldsMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) { TestObject* impl = V8TestObject::ToImpl(info.Holder()); impl->activityLoggingAccessForAllWorldsMethod(); }
C
Chrome
0
CVE-2017-7526
https://www.cvedetails.com/cve/CVE-2017-7526/
CWE-310
https://git.gnupg.org/cgi-bin/gitweb.cgi?p=libgcrypt.git;a=commit;h=8725c99ffa41778f382ca97233183bcd687bb0ce
8725c99ffa41778f382ca97233183bcd687bb0ce
null
rsa_check_secret_key (gcry_sexp_t keyparms) { gcry_err_code_t rc; RSA_secret_key sk = {NULL, NULL, NULL, NULL, NULL, NULL}; /* To check the key we need the optional parameters. */ rc = sexp_extract_param (keyparms, NULL, "nedpqu", &sk.n, &sk.e, &sk.d, &sk.p, &sk.q, &sk.u, NULL); if (rc) goto leave; if (!check_secret_key (&sk)) rc = GPG_ERR_BAD_SECKEY; leave: _gcry_mpi_release (sk.n); _gcry_mpi_release (sk.e); _gcry_mpi_release (sk.d); _gcry_mpi_release (sk.p); _gcry_mpi_release (sk.q); _gcry_mpi_release (sk.u); if (DBG_CIPHER) log_debug ("rsa_testkey => %s\n", gpg_strerror (rc)); return rc; }
rsa_check_secret_key (gcry_sexp_t keyparms) { gcry_err_code_t rc; RSA_secret_key sk = {NULL, NULL, NULL, NULL, NULL, NULL}; /* To check the key we need the optional parameters. */ rc = sexp_extract_param (keyparms, NULL, "nedpqu", &sk.n, &sk.e, &sk.d, &sk.p, &sk.q, &sk.u, NULL); if (rc) goto leave; if (!check_secret_key (&sk)) rc = GPG_ERR_BAD_SECKEY; leave: _gcry_mpi_release (sk.n); _gcry_mpi_release (sk.e); _gcry_mpi_release (sk.d); _gcry_mpi_release (sk.p); _gcry_mpi_release (sk.q); _gcry_mpi_release (sk.u); if (DBG_CIPHER) log_debug ("rsa_testkey => %s\n", gpg_strerror (rc)); return rc; }
C
gnupg
0
CVE-2016-0823
https://www.cvedetails.com/cve/CVE-2016-0823/
CWE-200
https://github.com/torvalds/linux/commit/ab676b7d6fbf4b294bf198fb27ade5b0e865c7ce
ab676b7d6fbf4b294bf198fb27ade5b0e865c7ce
pagemap: do not leak physical addresses to non-privileged userspace As pointed by recent post[1] on exploiting DRAM physical imperfection, /proc/PID/pagemap exposes sensitive information which can be used to do attacks. This disallows anybody without CAP_SYS_ADMIN to read the pagemap. [1] http://googleprojectzero.blogspot.com/2015/03/exploiting-dram-rowhammer-bug-to-gain.html [ Eventually we might want to do anything more finegrained, but for now this is the simple model. - Linus ] Signed-off-by: Kirill A. Shutemov <[email protected]> Acked-by: Konstantin Khlebnikov <[email protected]> Acked-by: Andy Lutomirski <[email protected]> Cc: Pavel Emelyanov <[email protected]> Cc: Andrew Morton <[email protected]> Cc: Mark Seaborn <[email protected]> Cc: [email protected] Signed-off-by: Linus Torvalds <[email protected]>
static ssize_t clear_refs_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos) { struct task_struct *task; char buffer[PROC_NUMBUF]; struct mm_struct *mm; struct vm_area_struct *vma; enum clear_refs_types type; int itype; int rv; memset(buffer, 0, sizeof(buffer)); if (count > sizeof(buffer) - 1) count = sizeof(buffer) - 1; if (copy_from_user(buffer, buf, count)) return -EFAULT; rv = kstrtoint(strstrip(buffer), 10, &itype); if (rv < 0) return rv; type = (enum clear_refs_types)itype; if (type < CLEAR_REFS_ALL || type >= CLEAR_REFS_LAST) return -EINVAL; if (type == CLEAR_REFS_SOFT_DIRTY) { soft_dirty_cleared = true; pr_warn_once("The pagemap bits 55-60 has changed their meaning!" " See the linux/Documentation/vm/pagemap.txt for " "details.\n"); } task = get_proc_task(file_inode(file)); if (!task) return -ESRCH; mm = get_task_mm(task); if (mm) { struct clear_refs_private cp = { .type = type, }; struct mm_walk clear_refs_walk = { .pmd_entry = clear_refs_pte_range, .test_walk = clear_refs_test_walk, .mm = mm, .private = &cp, }; if (type == CLEAR_REFS_MM_HIWATER_RSS) { /* * Writing 5 to /proc/pid/clear_refs resets the peak * resident set size to this mm's current rss value. */ down_write(&mm->mmap_sem); reset_mm_hiwater_rss(mm); up_write(&mm->mmap_sem); goto out_mm; } down_read(&mm->mmap_sem); if (type == CLEAR_REFS_SOFT_DIRTY) { for (vma = mm->mmap; vma; vma = vma->vm_next) { if (!(vma->vm_flags & VM_SOFTDIRTY)) continue; up_read(&mm->mmap_sem); down_write(&mm->mmap_sem); for (vma = mm->mmap; vma; vma = vma->vm_next) { vma->vm_flags &= ~VM_SOFTDIRTY; vma_set_page_prot(vma); } downgrade_write(&mm->mmap_sem); break; } mmu_notifier_invalidate_range_start(mm, 0, -1); } walk_page_range(0, ~0UL, &clear_refs_walk); if (type == CLEAR_REFS_SOFT_DIRTY) mmu_notifier_invalidate_range_end(mm, 0, -1); flush_tlb_mm(mm); up_read(&mm->mmap_sem); out_mm: mmput(mm); } put_task_struct(task); return count; }
static ssize_t clear_refs_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos) { struct task_struct *task; char buffer[PROC_NUMBUF]; struct mm_struct *mm; struct vm_area_struct *vma; enum clear_refs_types type; int itype; int rv; memset(buffer, 0, sizeof(buffer)); if (count > sizeof(buffer) - 1) count = sizeof(buffer) - 1; if (copy_from_user(buffer, buf, count)) return -EFAULT; rv = kstrtoint(strstrip(buffer), 10, &itype); if (rv < 0) return rv; type = (enum clear_refs_types)itype; if (type < CLEAR_REFS_ALL || type >= CLEAR_REFS_LAST) return -EINVAL; if (type == CLEAR_REFS_SOFT_DIRTY) { soft_dirty_cleared = true; pr_warn_once("The pagemap bits 55-60 has changed their meaning!" " See the linux/Documentation/vm/pagemap.txt for " "details.\n"); } task = get_proc_task(file_inode(file)); if (!task) return -ESRCH; mm = get_task_mm(task); if (mm) { struct clear_refs_private cp = { .type = type, }; struct mm_walk clear_refs_walk = { .pmd_entry = clear_refs_pte_range, .test_walk = clear_refs_test_walk, .mm = mm, .private = &cp, }; if (type == CLEAR_REFS_MM_HIWATER_RSS) { /* * Writing 5 to /proc/pid/clear_refs resets the peak * resident set size to this mm's current rss value. */ down_write(&mm->mmap_sem); reset_mm_hiwater_rss(mm); up_write(&mm->mmap_sem); goto out_mm; } down_read(&mm->mmap_sem); if (type == CLEAR_REFS_SOFT_DIRTY) { for (vma = mm->mmap; vma; vma = vma->vm_next) { if (!(vma->vm_flags & VM_SOFTDIRTY)) continue; up_read(&mm->mmap_sem); down_write(&mm->mmap_sem); for (vma = mm->mmap; vma; vma = vma->vm_next) { vma->vm_flags &= ~VM_SOFTDIRTY; vma_set_page_prot(vma); } downgrade_write(&mm->mmap_sem); break; } mmu_notifier_invalidate_range_start(mm, 0, -1); } walk_page_range(0, ~0UL, &clear_refs_walk); if (type == CLEAR_REFS_SOFT_DIRTY) mmu_notifier_invalidate_range_end(mm, 0, -1); flush_tlb_mm(mm); up_read(&mm->mmap_sem); out_mm: mmput(mm); } put_task_struct(task); return count; }
C
linux
0
CVE-2018-14357
https://www.cvedetails.com/cve/CVE-2018-14357/
CWE-77
https://github.com/neomutt/neomutt/commit/e52393740334443ae0206cab2d7caef381646725
e52393740334443ae0206cab2d7caef381646725
quote imap strings more carefully Co-authored-by: JerikoOne <[email protected]>
void imap_expunge_mailbox(struct ImapData *idata) { struct Header *h = NULL; int cacheno; short old_sort; #ifdef USE_HCACHE idata->hcache = imap_hcache_open(idata, NULL); #endif old_sort = Sort; Sort = SORT_ORDER; mutt_sort_headers(idata->ctx, 0); for (int i = 0; i < idata->ctx->msgcount; i++) { h = idata->ctx->hdrs[i]; if (h->index == INT_MAX) { mutt_debug(2, "Expunging message UID %u.\n", HEADER_DATA(h)->uid); h->active = false; idata->ctx->size -= h->content->length; imap_cache_del(idata, h); #ifdef USE_HCACHE imap_hcache_del(idata, HEADER_DATA(h)->uid); #endif /* free cached body from disk, if necessary */ cacheno = HEADER_DATA(h)->uid % IMAP_CACHE_LEN; if (idata->cache[cacheno].uid == HEADER_DATA(h)->uid && idata->cache[cacheno].path) { unlink(idata->cache[cacheno].path); FREE(&idata->cache[cacheno].path); } mutt_hash_int_delete(idata->uid_hash, HEADER_DATA(h)->uid, h); imap_free_header_data((struct ImapHeaderData **) &h->data); } else { h->index = i; /* NeoMutt has several places where it turns off h->active as a * hack. For example to avoid FLAG updates, or to exclude from * imap_exec_msgset. * * Unfortunately, when a reopen is allowed and the IMAP_EXPUNGE_PENDING * flag becomes set (e.g. a flag update to a modified header), * this function will be called by imap_cmd_finish(). * * The mx_update_tables() will free and remove these "inactive" headers, * despite that an EXPUNGE was not received for them. * This would result in memory leaks and segfaults due to dangling * pointers in the msn_index and uid_hash. * * So this is another hack to work around the hacks. We don't want to * remove the messages, so make sure active is on. */ h->active = true; } } #ifdef USE_HCACHE imap_hcache_close(idata); #endif /* We may be called on to expunge at any time. We can't rely on the caller * to always know to rethread */ mx_update_tables(idata->ctx, false); Sort = old_sort; mutt_sort_headers(idata->ctx, 1); }
void imap_expunge_mailbox(struct ImapData *idata) { struct Header *h = NULL; int cacheno; short old_sort; #ifdef USE_HCACHE idata->hcache = imap_hcache_open(idata, NULL); #endif old_sort = Sort; Sort = SORT_ORDER; mutt_sort_headers(idata->ctx, 0); for (int i = 0; i < idata->ctx->msgcount; i++) { h = idata->ctx->hdrs[i]; if (h->index == INT_MAX) { mutt_debug(2, "Expunging message UID %u.\n", HEADER_DATA(h)->uid); h->active = false; idata->ctx->size -= h->content->length; imap_cache_del(idata, h); #ifdef USE_HCACHE imap_hcache_del(idata, HEADER_DATA(h)->uid); #endif /* free cached body from disk, if necessary */ cacheno = HEADER_DATA(h)->uid % IMAP_CACHE_LEN; if (idata->cache[cacheno].uid == HEADER_DATA(h)->uid && idata->cache[cacheno].path) { unlink(idata->cache[cacheno].path); FREE(&idata->cache[cacheno].path); } mutt_hash_int_delete(idata->uid_hash, HEADER_DATA(h)->uid, h); imap_free_header_data((struct ImapHeaderData **) &h->data); } else { h->index = i; /* NeoMutt has several places where it turns off h->active as a * hack. For example to avoid FLAG updates, or to exclude from * imap_exec_msgset. * * Unfortunately, when a reopen is allowed and the IMAP_EXPUNGE_PENDING * flag becomes set (e.g. a flag update to a modified header), * this function will be called by imap_cmd_finish(). * * The mx_update_tables() will free and remove these "inactive" headers, * despite that an EXPUNGE was not received for them. * This would result in memory leaks and segfaults due to dangling * pointers in the msn_index and uid_hash. * * So this is another hack to work around the hacks. We don't want to * remove the messages, so make sure active is on. */ h->active = true; } } #ifdef USE_HCACHE imap_hcache_close(idata); #endif /* We may be called on to expunge at any time. We can't rely on the caller * to always know to rethread */ mx_update_tables(idata->ctx, false); Sort = old_sort; mutt_sort_headers(idata->ctx, 1); }
C
neomutt
0
null
null
null
https://github.com/chromium/chromium/commit/3c1864079c441ea2e08f882acaaf441f78a6de3d
3c1864079c441ea2e08f882acaaf441f78a6de3d
REGRESSION(r93902): Can't open external links on gmail https://bugs.webkit.org/show_bug.cgi?id=67234 <rdar://problem/10053636> Reviewed by Alexey Proskuryakov. * Shared/cf/ArgumentCodersCF.cpp: (CoreIPC::decode): If we encounter an empty URL string, create an empty url by using NSURL, just like we do in WebCore when converting an empty KURL to an NSURL. * WebKit2.xcodeproj/project.pbxproj: Compile ArgumentCodersCF.cpp as Objective-C++ for now. git-svn-id: svn://svn.chromium.org/blink/trunk@94246 bbb929c8-8fbe-4397-9dbb-9b2b20218538
void encode(ArgumentEncoder* encoder, CFTypeRef typeRef) { CFType type = typeFromCFTypeRef(typeRef); encoder->encodeEnum(type); switch (type) { case CFArray: encode(encoder, static_cast<CFArrayRef>(typeRef)); return; case CFBoolean: encode(encoder, static_cast<CFBooleanRef>(typeRef)); return; case CFData: encode(encoder, static_cast<CFDataRef>(typeRef)); return; case CFDate: encode(encoder, static_cast<CFDateRef>(typeRef)); return; case CFDictionary: encode(encoder, static_cast<CFDictionaryRef>(typeRef)); return; case CFNull: return; case CFNumber: encode(encoder, static_cast<CFNumberRef>(typeRef)); return; case CFString: encode(encoder, static_cast<CFStringRef>(typeRef)); return; case CFURL: encode(encoder, static_cast<CFURLRef>(typeRef)); return; #if PLATFORM(MAC) case SecCertificate: encode(encoder, (SecCertificateRef)typeRef); return; case SecKeychainItem: encode(encoder, (SecKeychainItemRef)typeRef); return; #endif case Null: return; case Unknown: break; } ASSERT_NOT_REACHED(); }
void encode(ArgumentEncoder* encoder, CFTypeRef typeRef) { CFType type = typeFromCFTypeRef(typeRef); encoder->encodeEnum(type); switch (type) { case CFArray: encode(encoder, static_cast<CFArrayRef>(typeRef)); return; case CFBoolean: encode(encoder, static_cast<CFBooleanRef>(typeRef)); return; case CFData: encode(encoder, static_cast<CFDataRef>(typeRef)); return; case CFDate: encode(encoder, static_cast<CFDateRef>(typeRef)); return; case CFDictionary: encode(encoder, static_cast<CFDictionaryRef>(typeRef)); return; case CFNull: return; case CFNumber: encode(encoder, static_cast<CFNumberRef>(typeRef)); return; case CFString: encode(encoder, static_cast<CFStringRef>(typeRef)); return; case CFURL: encode(encoder, static_cast<CFURLRef>(typeRef)); return; #if PLATFORM(MAC) case SecCertificate: encode(encoder, (SecCertificateRef)typeRef); return; case SecKeychainItem: encode(encoder, (SecKeychainItemRef)typeRef); return; #endif case Null: return; case Unknown: break; } ASSERT_NOT_REACHED(); }
C
Chrome
0
CVE-2012-5375
https://www.cvedetails.com/cve/CVE-2012-5375/
CWE-310
https://github.com/torvalds/linux/commit/9c52057c698fb96f8f07e7a4bcf4801a092bda89
9c52057c698fb96f8f07e7a4bcf4801a092bda89
Btrfs: fix hash overflow handling The handling for directory crc hash overflows was fairly obscure, split_leaf returns EOVERFLOW when we try to extend the item and that is supposed to bubble up to userland. For a while it did so, but along the way we added better handling of errors and forced the FS readonly if we hit IO errors during the directory insertion. Along the way, we started testing only for EEXIST and the EOVERFLOW case was dropped. The end result is that we may force the FS readonly if we catch a directory hash bucket overflow. This fixes a few problem spots. First I add tests for EOVERFLOW in the places where we can safely just return the error up the chain. btrfs_rename is harder though, because it tries to insert the new directory item only after it has already unlinked anything the rename was going to overwrite. Rather than adding very complex logic, I added a helper to test for the hash overflow case early while it is still safe to bail out. Snapshot and subvolume creation had a similar problem, so they are using the new helper now too. Signed-off-by: Chris Mason <[email protected]> Reported-by: Pascal Junod <[email protected]>
static long btrfs_ioctl_add_dev(struct btrfs_root *root, void __user *arg) { struct btrfs_ioctl_vol_args *vol_args; int ret; if (!capable(CAP_SYS_ADMIN)) return -EPERM; if (atomic_xchg(&root->fs_info->mutually_exclusive_operation_running, 1)) { pr_info("btrfs: dev add/delete/balance/replace/resize operation in progress\n"); return -EINPROGRESS; } mutex_lock(&root->fs_info->volume_mutex); vol_args = memdup_user(arg, sizeof(*vol_args)); if (IS_ERR(vol_args)) { ret = PTR_ERR(vol_args); goto out; } vol_args->name[BTRFS_PATH_NAME_MAX] = '\0'; ret = btrfs_init_new_device(root, vol_args->name); kfree(vol_args); out: mutex_unlock(&root->fs_info->volume_mutex); atomic_set(&root->fs_info->mutually_exclusive_operation_running, 0); return ret; }
static long btrfs_ioctl_add_dev(struct btrfs_root *root, void __user *arg) { struct btrfs_ioctl_vol_args *vol_args; int ret; if (!capable(CAP_SYS_ADMIN)) return -EPERM; if (atomic_xchg(&root->fs_info->mutually_exclusive_operation_running, 1)) { pr_info("btrfs: dev add/delete/balance/replace/resize operation in progress\n"); return -EINPROGRESS; } mutex_lock(&root->fs_info->volume_mutex); vol_args = memdup_user(arg, sizeof(*vol_args)); if (IS_ERR(vol_args)) { ret = PTR_ERR(vol_args); goto out; } vol_args->name[BTRFS_PATH_NAME_MAX] = '\0'; ret = btrfs_init_new_device(root, vol_args->name); kfree(vol_args); out: mutex_unlock(&root->fs_info->volume_mutex); atomic_set(&root->fs_info->mutually_exclusive_operation_running, 0); return ret; }
C
linux
0
CVE-2014-4344
https://www.cvedetails.com/cve/CVE-2014-4344/
CWE-476
https://github.com/krb5/krb5/commit/a7886f0ed1277c69142b14a2c6629175a6331edc
a7886f0ed1277c69142b14a2c6629175a6331edc
Fix null deref in SPNEGO acceptor [CVE-2014-4344] When processing a continuation token, acc_ctx_cont was dereferencing the initial byte of the token without checking the length. This could result in a null dereference. CVE-2014-4344: In MIT krb5 1.5 and newer, an unauthenticated or partially authenticated remote attacker can cause a NULL dereference and application crash during a SPNEGO negotiation by sending an empty token as the second or later context token from initiator to acceptor. The attacker must provide at least one valid context token in the security context negotiation before sending the empty token. This can be done by an unauthenticated attacker by forcing SPNEGO to renegotiate the underlying mechanism, or by using IAKERB to wrap an unauthenticated AS-REQ as the first token. CVSSv2 Vector: AV:N/AC:L/Au:N/C:N/I:N/A:C/E:POC/RL:OF/RC:C [[email protected]: CVE summary, CVSSv2 vector] (cherry picked from commit 524688ce87a15fc75f87efc8c039ba4c7d5c197b) ticket: 7970 version_fixed: 1.12.2 status: resolved
static int gss_spnegomechglue_init(void) { struct gss_mech_config mech_spnego; memset(&mech_spnego, 0, sizeof(mech_spnego)); mech_spnego.mech = &spnego_mechanism; mech_spnego.mechNameStr = "spnego"; mech_spnego.mech_type = GSS_C_NO_OID; return gssint_register_mechinfo(&mech_spnego); }
static int gss_spnegomechglue_init(void) { struct gss_mech_config mech_spnego; memset(&mech_spnego, 0, sizeof(mech_spnego)); mech_spnego.mech = &spnego_mechanism; mech_spnego.mechNameStr = "spnego"; mech_spnego.mech_type = GSS_C_NO_OID; return gssint_register_mechinfo(&mech_spnego); }
C
krb5
0
CVE-2015-3835
https://www.cvedetails.com/cve/CVE-2015-3835/
CWE-119
https://android.googlesource.com/platform/frameworks/av/+/3cb1b6944e776863aea316e25fdc16d7f9962902
3cb1b6944e776863aea316e25fdc16d7f9962902
IOMX: Enable buffer ptr to buffer id translation for arm32 Bug: 20634516 Change-Id: Iac9eac3cb251eccd9bbad5df7421a07edc21da0c (cherry picked from commit 2d6b6601743c3c6960c6511a2cb774ef902759f4)
void OMXNodeInstance::addActiveBuffer(OMX_U32 portIndex, OMX::buffer_id id) { ActiveBuffer active; active.mPortIndex = portIndex; active.mID = id; mActiveBuffers.push(active); if (portIndex < NELEM(mNumPortBuffers)) { ++mNumPortBuffers[portIndex]; } }
void OMXNodeInstance::addActiveBuffer(OMX_U32 portIndex, OMX::buffer_id id) { ActiveBuffer active; active.mPortIndex = portIndex; active.mID = id; mActiveBuffers.push(active); if (portIndex < NELEM(mNumPortBuffers)) { ++mNumPortBuffers[portIndex]; } }
C
Android
0
CVE-2017-5120
https://www.cvedetails.com/cve/CVE-2017-5120/
null
https://github.com/chromium/chromium/commit/b7277af490d28ac7f802c015bb0ff31395768556
b7277af490d28ac7f802c015bb0ff31395768556
bindings: Support "attribute FrozenArray<T>?" Adds a quick hack to support a case of "attribute FrozenArray<T>?". Bug: 1028047 Change-Id: Ib3cecc4beb6bcc0fb0dbc667aca595454cc90c86 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1933866 Reviewed-by: Hitoshi Yoshida <[email protected]> Commit-Queue: Yuki Shiino <[email protected]> Cr-Commit-Position: refs/heads/master@{#718676}
void V8TestObject::TestInterfaceOrNullAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_testInterfaceOrNullAttribute_Getter"); test_object_v8_internal::TestInterfaceOrNullAttributeAttributeGetter(info); }
void V8TestObject::TestInterfaceOrNullAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_testInterfaceOrNullAttribute_Getter"); test_object_v8_internal::TestInterfaceOrNullAttributeAttributeGetter(info); }
C
Chrome
0
CVE-2016-1622
https://www.cvedetails.com/cve/CVE-2016-1622/
CWE-264
https://github.com/chromium/chromium/commit/83a4b3aa72d98fe4176b4a54c8cea227ed966570
83a4b3aa72d98fe4176b4a54c8cea227ed966570
[Extensions] Don't allow built-in extensions code to be overridden BUG=546677 Review URL: https://codereview.chromium.org/1417513003 Cr-Commit-Position: refs/heads/master@{#356654}
std::string ModuleSystem::ExceptionHandler::CreateExceptionString( const v8::TryCatch& try_catch) { v8::Local<v8::Message> message(try_catch.Message()); if (message.IsEmpty()) { return "try_catch has no message"; } std::string resource_name = "<unknown resource>"; if (!message->GetScriptOrigin().ResourceName().IsEmpty()) { v8::String::Utf8Value resource_name_v8( message->GetScriptOrigin().ResourceName()); resource_name.assign(*resource_name_v8, resource_name_v8.length()); } std::string error_message = "<no error message>"; if (!message->Get().IsEmpty()) { v8::String::Utf8Value error_message_v8(message->Get()); error_message.assign(*error_message_v8, error_message_v8.length()); } auto maybe = message->GetLineNumber(context_->v8_context()); int line_number = maybe.IsJust() ? maybe.FromJust() : 0; return base::StringPrintf("%s:%d: %s", resource_name.c_str(), line_number, error_message.c_str()); }
std::string ModuleSystem::ExceptionHandler::CreateExceptionString( const v8::TryCatch& try_catch) { v8::Local<v8::Message> message(try_catch.Message()); if (message.IsEmpty()) { return "try_catch has no message"; } std::string resource_name = "<unknown resource>"; if (!message->GetScriptOrigin().ResourceName().IsEmpty()) { v8::String::Utf8Value resource_name_v8( message->GetScriptOrigin().ResourceName()); resource_name.assign(*resource_name_v8, resource_name_v8.length()); } std::string error_message = "<no error message>"; if (!message->Get().IsEmpty()) { v8::String::Utf8Value error_message_v8(message->Get()); error_message.assign(*error_message_v8, error_message_v8.length()); } auto maybe = message->GetLineNumber(context_->v8_context()); int line_number = maybe.IsJust() ? maybe.FromJust() : 0; return base::StringPrintf("%s:%d: %s", resource_name.c_str(), line_number, error_message.c_str()); }
C
Chrome
0
null
null
null
https://github.com/chromium/chromium/commit/610f904d8215075c4681be4eb413f4348860bf9f
610f904d8215075c4681be4eb413f4348860bf9f
Retrieve per host storage usage from QuotaManager. [email protected] BUG=none TEST=QuotaManagerTest.GetUsage Review URL: http://codereview.chromium.org/8079004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@103921 0039d316-1c4b-4281-b951-d872f2087c98
void QuotaManager::GetHostUsage(const std::string& host, StorageType type, HostUsageCallback* callback) { LazyInitialize(); GetUsageTracker(type)->GetHostUsage(host, callback); }
void QuotaManager::GetHostUsage(const std::string& host, StorageType type, HostUsageCallback* callback) { LazyInitialize(); GetUsageTracker(type)->GetHostUsage(host, callback); }
C
Chrome
0
CVE-2016-6136
https://www.cvedetails.com/cve/CVE-2016-6136/
CWE-362
https://github.com/torvalds/linux/commit/43761473c254b45883a64441dd0bc85a42f3645c
43761473c254b45883a64441dd0bc85a42f3645c
audit: fix a double fetch in audit_log_single_execve_arg() There is a double fetch problem in audit_log_single_execve_arg() where we first check the execve(2) argumnets for any "bad" characters which would require hex encoding and then re-fetch the arguments for logging in the audit record[1]. Of course this leaves a window of opportunity for an unsavory application to munge with the data. This patch reworks things by only fetching the argument data once[2] into a buffer where it is scanned and logged into the audit records(s). In addition to fixing the double fetch, this patch improves on the original code in a few other ways: better handling of large arguments which require encoding, stricter record length checking, and some performance improvements (completely unverified, but we got rid of some strlen() calls, that's got to be a good thing). As part of the development of this patch, I've also created a basic regression test for the audit-testsuite, the test can be tracked on GitHub at the following link: * https://github.com/linux-audit/audit-testsuite/issues/25 [1] If you pay careful attention, there is actually a triple fetch problem due to a strnlen_user() call at the top of the function. [2] This is a tiny white lie, we do make a call to strnlen_user() prior to fetching the argument data. I don't like it, but due to the way the audit record is structured we really have no choice unless we copy the entire argument at once (which would require a rather wasteful allocation). The good news is that with this patch the kernel no longer relies on this strnlen_user() value for anything beyond recording it in the log, we also update it with a trustworthy value whenever possible. Reported-by: Pengfei Wang <[email protected]> Cc: <[email protected]> Signed-off-by: Paul Moore <[email protected]>
void __audit_syscall_entry(int major, unsigned long a1, unsigned long a2, unsigned long a3, unsigned long a4) { struct task_struct *tsk = current; struct audit_context *context = tsk->audit_context; enum audit_state state; if (!context) return; BUG_ON(context->in_syscall || context->name_count); if (!audit_enabled) return; context->arch = syscall_get_arch(); context->major = major; context->argv[0] = a1; context->argv[1] = a2; context->argv[2] = a3; context->argv[3] = a4; state = context->state; context->dummy = !audit_n_rules; if (!context->dummy && state == AUDIT_BUILD_CONTEXT) { context->prio = 0; state = audit_filter_syscall(tsk, context, &audit_filter_list[AUDIT_FILTER_ENTRY]); } if (state == AUDIT_DISABLED) return; context->serial = 0; context->ctime = CURRENT_TIME; context->in_syscall = 1; context->current_state = state; context->ppid = 0; }
void __audit_syscall_entry(int major, unsigned long a1, unsigned long a2, unsigned long a3, unsigned long a4) { struct task_struct *tsk = current; struct audit_context *context = tsk->audit_context; enum audit_state state; if (!context) return; BUG_ON(context->in_syscall || context->name_count); if (!audit_enabled) return; context->arch = syscall_get_arch(); context->major = major; context->argv[0] = a1; context->argv[1] = a2; context->argv[2] = a3; context->argv[3] = a4; state = context->state; context->dummy = !audit_n_rules; if (!context->dummy && state == AUDIT_BUILD_CONTEXT) { context->prio = 0; state = audit_filter_syscall(tsk, context, &audit_filter_list[AUDIT_FILTER_ENTRY]); } if (state == AUDIT_DISABLED) return; context->serial = 0; context->ctime = CURRENT_TIME; context->in_syscall = 1; context->current_state = state; context->ppid = 0; }
C
linux
0
CVE-2019-11487
https://www.cvedetails.com/cve/CVE-2019-11487/
CWE-416
https://github.com/torvalds/linux/commit/15fab63e1e57be9fdb5eec1bbc5916e9825e9acb
15fab63e1e57be9fdb5eec1bbc5916e9825e9acb
fs: prevent page refcount overflow in pipe_buf_get Change pipe_buf_get() to return a bool indicating whether it succeeded in raising the refcount of the page (if the thing in the pipe is a page). This removes another mechanism for overflowing the page refcount. All callers converted to handle a failure. Reported-by: Jann Horn <[email protected]> Signed-off-by: Matthew Wilcox <[email protected]> Cc: [email protected] Signed-off-by: Linus Torvalds <[email protected]>
update_max_tr(struct trace_array *tr, struct task_struct *tsk, int cpu) { if (tr->stop_count) return; WARN_ON_ONCE(!irqs_disabled()); if (!tr->allocated_snapshot) { /* Only the nop tracer should hit this when disabling */ WARN_ON_ONCE(tr->current_trace != &nop_trace); return; } arch_spin_lock(&tr->max_lock); /* Inherit the recordable setting from trace_buffer */ if (ring_buffer_record_is_set_on(tr->trace_buffer.buffer)) ring_buffer_record_on(tr->max_buffer.buffer); else ring_buffer_record_off(tr->max_buffer.buffer); swap(tr->trace_buffer.buffer, tr->max_buffer.buffer); __update_max_tr(tr, tsk, cpu); arch_spin_unlock(&tr->max_lock); }
update_max_tr(struct trace_array *tr, struct task_struct *tsk, int cpu) { if (tr->stop_count) return; WARN_ON_ONCE(!irqs_disabled()); if (!tr->allocated_snapshot) { /* Only the nop tracer should hit this when disabling */ WARN_ON_ONCE(tr->current_trace != &nop_trace); return; } arch_spin_lock(&tr->max_lock); /* Inherit the recordable setting from trace_buffer */ if (ring_buffer_record_is_set_on(tr->trace_buffer.buffer)) ring_buffer_record_on(tr->max_buffer.buffer); else ring_buffer_record_off(tr->max_buffer.buffer); swap(tr->trace_buffer.buffer, tr->max_buffer.buffer); __update_max_tr(tr, tsk, cpu); arch_spin_unlock(&tr->max_lock); }
C
linux
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 <[email protected]> Signed-off-by: Frank Blaschka <[email protected]> Reviewed-by: Heiko Carstens <[email protected]> Reported-by: Nico Golde <[email protected]> Reported-by: Fabian Yamaguchi <[email protected]> Cc: <[email protected]> Signed-off-by: David S. Miller <[email protected]>
static int qeth_init_qdio_out_buf(struct qeth_qdio_out_q *q, int bidx) { int rc; struct qeth_qdio_out_buffer *newbuf; rc = 0; newbuf = kmem_cache_zalloc(qeth_qdio_outbuf_cache, GFP_ATOMIC); if (!newbuf) { rc = -ENOMEM; goto out; } newbuf->buffer = &q->qdio_bufs[bidx]; skb_queue_head_init(&newbuf->skb_list); lockdep_set_class(&newbuf->skb_list.lock, &qdio_out_skb_queue_key); newbuf->q = q; newbuf->aob = NULL; newbuf->next_pending = q->bufs[bidx]; atomic_set(&newbuf->state, QETH_QDIO_BUF_EMPTY); q->bufs[bidx] = newbuf; if (q->bufstates) { q->bufstates[bidx].user = newbuf; QETH_CARD_TEXT_(q->card, 2, "nbs%d", bidx); QETH_CARD_TEXT_(q->card, 2, "%lx", (long) newbuf); QETH_CARD_TEXT_(q->card, 2, "%lx", (long) newbuf->next_pending); } out: return rc; }
static int qeth_init_qdio_out_buf(struct qeth_qdio_out_q *q, int bidx) { int rc; struct qeth_qdio_out_buffer *newbuf; rc = 0; newbuf = kmem_cache_zalloc(qeth_qdio_outbuf_cache, GFP_ATOMIC); if (!newbuf) { rc = -ENOMEM; goto out; } newbuf->buffer = &q->qdio_bufs[bidx]; skb_queue_head_init(&newbuf->skb_list); lockdep_set_class(&newbuf->skb_list.lock, &qdio_out_skb_queue_key); newbuf->q = q; newbuf->aob = NULL; newbuf->next_pending = q->bufs[bidx]; atomic_set(&newbuf->state, QETH_QDIO_BUF_EMPTY); q->bufs[bidx] = newbuf; if (q->bufstates) { q->bufstates[bidx].user = newbuf; QETH_CARD_TEXT_(q->card, 2, "nbs%d", bidx); QETH_CARD_TEXT_(q->card, 2, "%lx", (long) newbuf); QETH_CARD_TEXT_(q->card, 2, "%lx", (long) newbuf->next_pending); } out: return rc; }
C
linux
0
CVE-2013-2865
https://www.cvedetails.com/cve/CVE-2013-2865/
null
https://github.com/chromium/chromium/commit/26160ce25e305d686ca5df192378d2f5310ca0ee
26160ce25e305d686ca5df192378d2f5310ca0ee
shell_aura: Set child to root window size, not host size The host size is in pixels and the root window size is in scaled pixels. So, using the pixel size may make the child window much larger than the root window (and screen). Fix this by matching the root window size. BUG=335713 TEST=ozone content_shell with --force-device-scale-factor=2 Review URL: https://codereview.chromium.org/141853003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@246389 0039d316-1c4b-4281-b951-d872f2087c98
ShellAuraPlatformData::ShellAuraPlatformData() { aura::TestScreen* screen = aura::TestScreen::Create(); gfx::Screen::SetScreenInstance(gfx::SCREEN_TYPE_NATIVE, screen); root_window_.reset(screen->CreateRootWindowForPrimaryDisplay()); root_window_->host()->Show(); root_window_->window()->SetLayoutManager(new FillLayout(root_window_.get())); focus_client_.reset(new aura::test::TestFocusClient()); aura::client::SetFocusClient(root_window_->window(), focus_client_.get()); activation_client_.reset( new aura::client::DefaultActivationClient(root_window_->window())); capture_client_.reset( new aura::client::DefaultCaptureClient(root_window_->window())); window_tree_client_.reset( new aura::test::TestWindowTreeClient(root_window_->window())); ime_filter_.reset(new MinimalInputEventFilter(root_window_.get())); }
ShellAuraPlatformData::ShellAuraPlatformData() { aura::TestScreen* screen = aura::TestScreen::Create(); gfx::Screen::SetScreenInstance(gfx::SCREEN_TYPE_NATIVE, screen); root_window_.reset(screen->CreateRootWindowForPrimaryDisplay()); root_window_->host()->Show(); root_window_->window()->SetLayoutManager(new FillLayout(root_window_.get())); focus_client_.reset(new aura::test::TestFocusClient()); aura::client::SetFocusClient(root_window_->window(), focus_client_.get()); activation_client_.reset( new aura::client::DefaultActivationClient(root_window_->window())); capture_client_.reset( new aura::client::DefaultCaptureClient(root_window_->window())); window_tree_client_.reset( new aura::test::TestWindowTreeClient(root_window_->window())); ime_filter_.reset(new MinimalInputEventFilter(root_window_.get())); }
C
Chrome
0
CVE-2016-1641
https://www.cvedetails.com/cve/CVE-2016-1641/
null
https://github.com/chromium/chromium/commit/75ca8ffd7bd7c58ace1144df05e1307d8d707662
75ca8ffd7bd7c58ace1144df05e1307d8d707662
Don't call WebContents::DownloadImage() callback if the WebContents were deleted BUG=583718 Review URL: https://codereview.chromium.org/1685343004 Cr-Commit-Position: refs/heads/master@{#375700}
void WebContentsImpl::UpdatePreferredSize(const gfx::Size& pref_size) { const gfx::Size old_size = GetPreferredSize(); preferred_size_ = pref_size; OnPreferredSizeChanged(old_size); }
void WebContentsImpl::UpdatePreferredSize(const gfx::Size& pref_size) { const gfx::Size old_size = GetPreferredSize(); preferred_size_ = pref_size; OnPreferredSizeChanged(old_size); }
C
Chrome
0
CVE-2017-6991
https://www.cvedetails.com/cve/CVE-2017-6991/
CWE-119
https://github.com/chromium/chromium/commit/3bfe67c9c4b45eb713326aae7a67c8f7390dae08
3bfe67c9c4b45eb713326aae7a67c8f7390dae08
sqlite: safely move pointer values through SQL. This lands https://www.sqlite.org/src/timeline?c=d6a44b35 in third_party/sqlite/src/ and third_party/sqlite/patches/0013-Add-new-interfaces-sqlite3_bind_pointer-sqlite3_resu.patch and re-generates third_party/sqlite/amalgamation/* using the script at third_party/sqlite/google_generate_amalgamation.sh. The CL also adds a layout test that verifies the patch works as intended. BUG=742407 Change-Id: I2e1a457459cd2e975e6241b630e7b79c82545981 Reviewed-on: https://chromium-review.googlesource.com/572976 Reviewed-by: Chris Mumford <[email protected]> Commit-Queue: Victor Costan <[email protected]> Cr-Commit-Position: refs/heads/master@{#487275}
static int compare2pow63(const char *zNum, int incr){ int c = 0; int i; /* 012345678901234567 */ const char *pow63 = "922337203685477580"; for(i=0; c==0 && i<18; i++){ c = (zNum[i*incr]-pow63[i])*10; } if( c==0 ){ c = zNum[18*incr] - '8'; testcase( c==(-1) ); testcase( c==0 ); testcase( c==(+1) ); } return c; }
static int compare2pow63(const char *zNum, int incr){ int c = 0; int i; /* 012345678901234567 */ const char *pow63 = "922337203685477580"; for(i=0; c==0 && i<18; i++){ c = (zNum[i*incr]-pow63[i])*10; } if( c==0 ){ c = zNum[18*incr] - '8'; testcase( c==(-1) ); testcase( c==0 ); testcase( c==(+1) ); } return c; }
C
Chrome
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 <[email protected]> Signed-off-by: Pablo Neira Ayuso <[email protected]>
do_ip6t_set_ctl(struct sock *sk, int cmd, void __user *user, unsigned int len) { int ret; if (!ns_capable(sock_net(sk)->user_ns, CAP_NET_ADMIN)) return -EPERM; switch (cmd) { case IP6T_SO_SET_REPLACE: ret = do_replace(sock_net(sk), user, len); break; case IP6T_SO_SET_ADD_COUNTERS: ret = do_add_counters(sock_net(sk), user, len, 0); break; default: duprintf("do_ip6t_set_ctl: unknown request %i\n", cmd); ret = -EINVAL; } return ret; }
do_ip6t_set_ctl(struct sock *sk, int cmd, void __user *user, unsigned int len) { int ret; if (!ns_capable(sock_net(sk)->user_ns, CAP_NET_ADMIN)) return -EPERM; switch (cmd) { case IP6T_SO_SET_REPLACE: ret = do_replace(sock_net(sk), user, len); break; case IP6T_SO_SET_ADD_COUNTERS: ret = do_add_counters(sock_net(sk), user, len, 0); break; default: duprintf("do_ip6t_set_ctl: unknown request %i\n", cmd); ret = -EINVAL; } return ret; }
C
linux
0
CVE-2016-10708
https://www.cvedetails.com/cve/CVE-2016-10708/
CWE-476
https://anongit.mindrot.org/openssh.git/commit/?id=28652bca29046f62c7045e933e6b931de1d16737
28652bca29046f62c7045e933e6b931de1d16737
null
kex_free(struct kex *kex) { u_int mode; #ifdef WITH_OPENSSL if (kex->dh) DH_free(kex->dh); #ifdef OPENSSL_HAS_ECC if (kex->ec_client_key) EC_KEY_free(kex->ec_client_key); #endif /* OPENSSL_HAS_ECC */ #endif /* WITH_OPENSSL */ for (mode = 0; mode < MODE_MAX; mode++) { kex_free_newkeys(kex->newkeys[mode]); kex->newkeys[mode] = NULL; } sshbuf_free(kex->peer); sshbuf_free(kex->my); free(kex->session_id); free(kex->client_version_string); free(kex->server_version_string); free(kex->failed_choice); free(kex->hostkey_alg); free(kex->name); free(kex); }
kex_free(struct kex *kex) { u_int mode; #ifdef WITH_OPENSSL if (kex->dh) DH_free(kex->dh); #ifdef OPENSSL_HAS_ECC if (kex->ec_client_key) EC_KEY_free(kex->ec_client_key); #endif /* OPENSSL_HAS_ECC */ #endif /* WITH_OPENSSL */ for (mode = 0; mode < MODE_MAX; mode++) { kex_free_newkeys(kex->newkeys[mode]); kex->newkeys[mode] = NULL; } sshbuf_free(kex->peer); sshbuf_free(kex->my); free(kex->session_id); free(kex->client_version_string); free(kex->server_version_string); free(kex->failed_choice); free(kex->hostkey_alg); free(kex->name); free(kex); }
C
mindrot
0
CVE-2016-3924
https://www.cvedetails.com/cve/CVE-2016-3924/
CWE-200
https://android.googlesource.com/platform/frameworks/av/+/c894aa36be535886a8e5ff02cdbcd07dd24618f6
c894aa36be535886a8e5ff02cdbcd07dd24618f6
Add EFFECT_CMD_SET_PARAM parameter checking Bug: 30204301 Change-Id: Ib9c3ee1c2f23c96f8f7092dd9e146bc453d7a290 (cherry picked from commit e4a1d91501d47931dbae19c47815952378787ab6)
void AudioFlinger::EffectChain::process_l() { sp<ThreadBase> thread = mThread.promote(); if (thread == 0) { ALOGW("process_l(): cannot promote mixer thread"); return; } bool isGlobalSession = (mSessionId == AUDIO_SESSION_OUTPUT_MIX) || (mSessionId == AUDIO_SESSION_OUTPUT_STAGE); bool doProcess = (thread->type() != ThreadBase::OFFLOAD); if (!isGlobalSession) { bool tracksOnSession = (trackCnt() != 0); if (!tracksOnSession && mTailBufferCount == 0) { doProcess = false; } if (activeTrackCnt() == 0) { if (tracksOnSession || mTailBufferCount > 0) { clearInputBuffer_l(thread); if (mTailBufferCount > 0) { mTailBufferCount--; } } } } size_t size = mEffects.size(); if (doProcess) { for (size_t i = 0; i < size; i++) { mEffects[i]->process(); } } for (size_t i = 0; i < size; i++) { mEffects[i]->updateState(); } }
void AudioFlinger::EffectChain::process_l() { sp<ThreadBase> thread = mThread.promote(); if (thread == 0) { ALOGW("process_l(): cannot promote mixer thread"); return; } bool isGlobalSession = (mSessionId == AUDIO_SESSION_OUTPUT_MIX) || (mSessionId == AUDIO_SESSION_OUTPUT_STAGE); bool doProcess = (thread->type() != ThreadBase::OFFLOAD); if (!isGlobalSession) { bool tracksOnSession = (trackCnt() != 0); if (!tracksOnSession && mTailBufferCount == 0) { doProcess = false; } if (activeTrackCnt() == 0) { if (tracksOnSession || mTailBufferCount > 0) { clearInputBuffer_l(thread); if (mTailBufferCount > 0) { mTailBufferCount--; } } } } size_t size = mEffects.size(); if (doProcess) { for (size_t i = 0; i < size; i++) { mEffects[i]->process(); } } for (size_t i = 0; i < size; i++) { mEffects[i]->updateState(); } }
C
Android
0