CVE ID
stringlengths
13
43
CVE Page
stringlengths
45
48
CWE ID
stringclasses
90 values
codeLink
stringlengths
46
139
commit_id
stringlengths
6
81
commit_message
stringlengths
3
13.3k
func_after
stringlengths
14
241k
func_before
stringlengths
14
241k
lang
stringclasses
3 values
project
stringclasses
309 values
vul
int8
0
1
CVE-2017-12985
https://www.cvedetails.com/cve/CVE-2017-12985/
CWE-125
https://github.com/the-tcpdump-group/tcpdump/commit/66df248b49095c261138b5a5e34d341a6bf9ac7f
66df248b49095c261138b5a5e34d341a6bf9ac7f
CVE-2017-12985/IPv6: Check for print routines returning -1 when running past the end. rt6_print(), ah_print(), and esp_print() return -1 if they run up against the end of the packet while dissecting; if that happens, stop dissecting, don't try to fetch the next header value, because 1) *it* might be past the end of the packet and 2) we won't be using it in any case, as we'll be exiting the loop. Also, change mobility_print() to return -1 if it runs up against the end of the packet, and stop dissecting if it does so. This fixes a buffer over-read discovered by Brian 'geeknik' Carpenter. Add tests using the capture files supplied by the reporter(s).
nextproto6_cksum(netdissect_options *ndo, const struct ip6_hdr *ip6, const uint8_t *data, u_int len, u_int covlen, u_int next_proto) { struct { struct in6_addr ph_src; struct in6_addr ph_dst; uint32_t ph_len; uint8_t ph_zero[3]; uint8_t ph_nxt; } ph; struct cksum_vec vec[2]; /* pseudo-header */ memset(&ph, 0, sizeof(ph)); UNALIGNED_MEMCPY(&ph.ph_src, &ip6->ip6_src, sizeof (struct in6_addr)); switch (ip6->ip6_nxt) { case IPPROTO_HOPOPTS: case IPPROTO_DSTOPTS: case IPPROTO_MOBILITY_OLD: case IPPROTO_MOBILITY: case IPPROTO_FRAGMENT: case IPPROTO_ROUTING: /* * The next header is either a routing header or a header * after which there might be a routing header, so scan * for a routing header. */ ip6_finddst(ndo, &ph.ph_dst, ip6); break; default: UNALIGNED_MEMCPY(&ph.ph_dst, &ip6->ip6_dst, sizeof (struct in6_addr)); break; } ph.ph_len = htonl(len); ph.ph_nxt = next_proto; vec[0].ptr = (const uint8_t *)(void *)&ph; vec[0].len = sizeof(ph); vec[1].ptr = data; vec[1].len = covlen; return in_cksum(vec, 2); }
nextproto6_cksum(netdissect_options *ndo, const struct ip6_hdr *ip6, const uint8_t *data, u_int len, u_int covlen, u_int next_proto) { struct { struct in6_addr ph_src; struct in6_addr ph_dst; uint32_t ph_len; uint8_t ph_zero[3]; uint8_t ph_nxt; } ph; struct cksum_vec vec[2]; /* pseudo-header */ memset(&ph, 0, sizeof(ph)); UNALIGNED_MEMCPY(&ph.ph_src, &ip6->ip6_src, sizeof (struct in6_addr)); switch (ip6->ip6_nxt) { case IPPROTO_HOPOPTS: case IPPROTO_DSTOPTS: case IPPROTO_MOBILITY_OLD: case IPPROTO_MOBILITY: case IPPROTO_FRAGMENT: case IPPROTO_ROUTING: /* * The next header is either a routing header or a header * after which there might be a routing header, so scan * for a routing header. */ ip6_finddst(ndo, &ph.ph_dst, ip6); break; default: UNALIGNED_MEMCPY(&ph.ph_dst, &ip6->ip6_dst, sizeof (struct in6_addr)); break; } ph.ph_len = htonl(len); ph.ph_nxt = next_proto; vec[0].ptr = (const uint8_t *)(void *)&ph; vec[0].len = sizeof(ph); vec[1].ptr = data; vec[1].len = covlen; return in_cksum(vec, 2); }
C
tcpdump
0
CVE-2013-1828
https://www.cvedetails.com/cve/CVE-2013-1828/
CWE-20
https://github.com/torvalds/linux/commit/726bc6b092da4c093eb74d13c07184b18c1af0f1
726bc6b092da4c093eb74d13c07184b18c1af0f1
net/sctp: Validate parameter size for SCTP_GET_ASSOC_STATS Building sctp may fail with: In function ‘copy_from_user’, inlined from ‘sctp_getsockopt_assoc_stats’ at net/sctp/socket.c:5656:20: arch/x86/include/asm/uaccess_32.h:211:26: error: call to ‘copy_from_user_overflow’ declared with attribute error: copy_from_user() buffer size is not provably correct if built with W=1 due to a missing parameter size validation before the call to copy_from_user. Signed-off-by: Guenter Roeck <[email protected]> Acked-by: Vlad Yasevich <[email protected]> Signed-off-by: David S. Miller <[email protected]>
static int sctp_getsockopt_partial_delivery_point(struct sock *sk, int len, char __user *optval, int __user *optlen) { u32 val; if (len < sizeof(u32)) return -EINVAL; len = sizeof(u32); val = sctp_sk(sk)->pd_point; if (put_user(len, optlen)) return -EFAULT; if (copy_to_user(optval, &val, len)) return -EFAULT; return 0; }
static int sctp_getsockopt_partial_delivery_point(struct sock *sk, int len, char __user *optval, int __user *optlen) { u32 val; if (len < sizeof(u32)) return -EINVAL; len = sizeof(u32); val = sctp_sk(sk)->pd_point; if (put_user(len, optlen)) return -EFAULT; if (copy_to_user(optval, &val, len)) return -EFAULT; return 0; }
C
linux
0
CVE-2016-10066
https://www.cvedetails.com/cve/CVE-2016-10066/
CWE-119
https://github.com/ImageMagick/ImageMagick/commit/f6e9d0d9955e85bdd7540b251cd50d598dacc5e6
f6e9d0d9955e85bdd7540b251cd50d598dacc5e6
null
static MagickStatusType ReadPSDMergedImage(Image* image, const PSDInfo* psd_info,ExceptionInfo *exception) { MagickOffsetType *offsets; MagickStatusType status; PSDCompressionType compression; register ssize_t i; compression=(PSDCompressionType) ReadBlobMSBShort(image); image->compression=ConvertPSDCompression(compression); if (compression != Raw && compression != RLE) { (void) ThrowMagickException(exception,GetMagickModule(), TypeWarning,"CompressionNotSupported","'%.20g'",(double) compression); return(MagickFalse); } offsets=(MagickOffsetType *) NULL; if (compression == RLE) { offsets=ReadPSDRLEOffsets(image,psd_info,image->rows*psd_info->channels); if (offsets == (MagickOffsetType *) NULL) ThrowBinaryException(ResourceLimitError,"MemoryAllocationFailed", image->filename); } status=MagickTrue; for (i=0; i < (ssize_t) psd_info->channels; i++) { if (compression == RLE) status=ReadPSDChannelRLE(image,psd_info,i,offsets+(i*image->rows), exception); else status=ReadPSDChannelRaw(image,psd_info->channels,i,exception); if (status == MagickFalse) break; status=SetImageProgress(image,LoadImagesTag,i,psd_info->channels); if (status == MagickFalse) break; } if (image->colorspace == CMYKColorspace) (void) NegateImage(image,MagickFalse); if (offsets != (MagickOffsetType *) NULL) offsets=(MagickOffsetType *) RelinquishMagickMemory(offsets); return(status); }
static MagickStatusType ReadPSDMergedImage(Image* image, const PSDInfo* psd_info,ExceptionInfo *exception) { MagickOffsetType *offsets; MagickStatusType status; PSDCompressionType compression; register ssize_t i; compression=(PSDCompressionType) ReadBlobMSBShort(image); image->compression=ConvertPSDCompression(compression); if (compression != Raw && compression != RLE) { (void) ThrowMagickException(exception,GetMagickModule(), TypeWarning,"CompressionNotSupported","'%.20g'",(double) compression); return(MagickFalse); } offsets=(MagickOffsetType *) NULL; if (compression == RLE) { offsets=ReadPSDRLEOffsets(image,psd_info,image->rows*psd_info->channels); if (offsets == (MagickOffsetType *) NULL) ThrowBinaryException(ResourceLimitError,"MemoryAllocationFailed", image->filename); } status=MagickTrue; for (i=0; i < (ssize_t) psd_info->channels; i++) { if (compression == RLE) status=ReadPSDChannelRLE(image,psd_info,i,offsets+(i*image->rows), exception); else status=ReadPSDChannelRaw(image,psd_info->channels,i,exception); if (status == MagickFalse) break; status=SetImageProgress(image,LoadImagesTag,i,psd_info->channels); if (status == MagickFalse) break; } if (image->colorspace == CMYKColorspace) (void) NegateImage(image,MagickFalse); if (offsets != (MagickOffsetType *) NULL) offsets=(MagickOffsetType *) RelinquishMagickMemory(offsets); return(status); }
C
ImageMagick
0
CVE-2019-13300
https://www.cvedetails.com/cve/CVE-2019-13300/
CWE-119
https://github.com/ImageMagick/ImageMagick/commit/a906fe9298bf89e01d5272023db687935068849a
a906fe9298bf89e01d5272023db687935068849a
https://github.com/ImageMagick/ImageMagick/issues/1586
static PixelChannels **AcquirePixelThreadSet(const Image *image) static PixelChannels **AcquirePixelThreadSet(const Image *images) { const Image *next; PixelChannels **pixels; register ssize_t i; size_t columns, number_threads; number_threads=(size_t) GetMagickResourceLimit(ThreadResource); pixels=(PixelChannels **) AcquireQuantumMemory(number_threads, sizeof(*pixels)); if (pixels == (PixelChannels **) NULL) return((PixelChannels **) NULL); (void) memset(pixels,0,number_threads*sizeof(*pixels)); columns=images->columns; for (next=images; next != (Image *) NULL; next=next->next) columns=MagickMax(next->columns,columns); for (i=0; i < (ssize_t) number_threads; i++) { register ssize_t j; pixels[i]=(PixelChannels *) AcquireQuantumMemory(columns,sizeof(**pixels)); if (pixels[i] == (PixelChannels *) NULL) return(DestroyPixelThreadSet(pixels)); for (j=0; j < (ssize_t) columns; j++) { register ssize_t k; for (k=0; k < MaxPixelChannels; k++) pixels[i][j].channel[k]=0.0; } } return(pixels); }
static PixelChannels **AcquirePixelThreadSet(const Image *image) { PixelChannels **pixels; register ssize_t i; size_t number_threads; number_threads=(size_t) GetMagickResourceLimit(ThreadResource); pixels=(PixelChannels **) AcquireQuantumMemory(number_threads, sizeof(*pixels)); if (pixels == (PixelChannels **) NULL) return((PixelChannels **) NULL); (void) memset(pixels,0,number_threads*sizeof(*pixels)); for (i=0; i < (ssize_t) number_threads; i++) { register ssize_t j; pixels[i]=(PixelChannels *) AcquireQuantumMemory(image->columns, sizeof(**pixels)); if (pixels[i] == (PixelChannels *) NULL) return(DestroyPixelThreadSet(pixels)); for (j=0; j < (ssize_t) image->columns; j++) { register ssize_t k; for (k=0; k < MaxPixelChannels; k++) pixels[i][j].channel[k]=0.0; } } return(pixels); }
C
ImageMagick6
1
CVE-2014-9903
https://www.cvedetails.com/cve/CVE-2014-9903/
CWE-200
https://github.com/torvalds/linux/commit/4efbc454ba68def5ef285b26ebfcfdb605b52755
4efbc454ba68def5ef285b26ebfcfdb605b52755
sched: Fix information leak in sys_sched_getattr() We're copying the on-stack structure to userspace, but forgot to give the right number of bytes to copy. This allows the calling process to obtain up to PAGE_SIZE bytes from the stack (and possibly adjacent kernel memory). This fix copies only as much as we actually have on the stack (attr->size defaults to the size of the struct) and leaves the rest of the userspace-provided buffer untouched. Found using kmemcheck + trinity. Fixes: d50dde5a10f30 ("sched: Add new scheduler syscalls to support an extended scheduling parameters ABI") Cc: Dario Faggioli <[email protected]> Cc: Juri Lelli <[email protected]> Cc: Ingo Molnar <[email protected]> Signed-off-by: Vegard Nossum <[email protected]> Signed-off-by: Peter Zijlstra <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Thomas Gleixner <[email protected]>
set_table_entry(struct ctl_table *entry, const char *procname, void *data, int maxlen, umode_t mode, proc_handler *proc_handler, bool load_idx) { entry->procname = procname; entry->data = data; entry->maxlen = maxlen; entry->mode = mode; entry->proc_handler = proc_handler; if (load_idx) { entry->extra1 = &min_load_idx; entry->extra2 = &max_load_idx; } }
set_table_entry(struct ctl_table *entry, const char *procname, void *data, int maxlen, umode_t mode, proc_handler *proc_handler, bool load_idx) { entry->procname = procname; entry->data = data; entry->maxlen = maxlen; entry->mode = mode; entry->proc_handler = proc_handler; if (load_idx) { entry->extra1 = &min_load_idx; entry->extra2 = &max_load_idx; } }
C
linux
0
CVE-2011-2795
https://www.cvedetails.com/cve/CVE-2011-2795/
CWE-264
https://github.com/chromium/chromium/commit/73edae623529f04c668268de49d00324b96166a2
73edae623529f04c668268de49d00324b96166a2
There are too many poorly named functions to create a fragment from markup https://bugs.webkit.org/show_bug.cgi?id=87339 Reviewed by Eric Seidel. Source/WebCore: Moved all functions that create a fragment from markup to markup.h/cpp. There should be no behavioral change. * dom/Range.cpp: (WebCore::Range::createContextualFragment): * dom/Range.h: Removed createDocumentFragmentForElement. * dom/ShadowRoot.cpp: (WebCore::ShadowRoot::setInnerHTML): * editing/markup.cpp: (WebCore::createFragmentFromMarkup): (WebCore::createFragmentForInnerOuterHTML): Renamed from createFragmentFromSource. (WebCore::createFragmentForTransformToFragment): Moved from XSLTProcessor. (WebCore::removeElementPreservingChildren): Moved from Range. (WebCore::createContextualFragment): Ditto. * editing/markup.h: * html/HTMLElement.cpp: (WebCore::HTMLElement::setInnerHTML): (WebCore::HTMLElement::setOuterHTML): (WebCore::HTMLElement::insertAdjacentHTML): * inspector/DOMPatchSupport.cpp: (WebCore::DOMPatchSupport::patchNode): Added a FIXME since this code should be using one of the functions listed in markup.h * xml/XSLTProcessor.cpp: (WebCore::XSLTProcessor::transformToFragment): Source/WebKit/qt: Replace calls to Range::createDocumentFragmentForElement by calls to createContextualDocumentFragment. * Api/qwebelement.cpp: (QWebElement::appendInside): (QWebElement::prependInside): (QWebElement::prependOutside): (QWebElement::appendOutside): (QWebElement::encloseContentsWith): (QWebElement::encloseWith): git-svn-id: svn://svn.chromium.org/blink/trunk@118414 bbb929c8-8fbe-4397-9dbb-9b2b20218538
int Range::maxStartOffset() const { if (!m_start.container()) return 0; if (!m_start.container()->offsetInCharacters()) return m_start.container()->childNodeCount(); return m_start.container()->maxCharacterOffset(); }
int Range::maxStartOffset() const { if (!m_start.container()) return 0; if (!m_start.container()->offsetInCharacters()) return m_start.container()->childNodeCount(); return m_start.container()->maxCharacterOffset(); }
C
Chrome
0
CVE-2011-2784
https://www.cvedetails.com/cve/CVE-2011-2784/
CWE-200
https://github.com/chromium/chromium/commit/225e7438996c9c939bd239376dfa93e562972cf8
225e7438996c9c939bd239376dfa93e562972cf8
Update PrerenderBrowserTests to work with new PrerenderContents. Also update PrerenderContents to pass plugin and HTML5 prerender tests. BUG=81229 TEST=PrerenderBrowserTests (Once the new code is enabled) Review URL: http://codereview.chromium.org/6905169 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@83841 0039d316-1c4b-4281-b951-d872f2087c98
bool UrlIsInPrerenderManager(const GURL& url) { return (prerender_manager()->FindEntry(url) != NULL); }
bool UrlIsInPrerenderManager(const GURL& url) { return (prerender_manager()->FindEntry(url) != NULL); }
C
Chrome
0
CVE-2017-0375
https://www.cvedetails.com/cve/CVE-2017-0375/
CWE-617
https://github.com/torproject/tor/commit/79b59a2dfcb68897ee89d98587d09e55f07e68d7
79b59a2dfcb68897ee89d98587d09e55f07e68d7
TROVE-2017-004: Fix assertion failure in relay_send_end_cell_from_edge_ This fixes an assertion failure in relay_send_end_cell_from_edge_() when an origin circuit and a cpath_layer = NULL were passed. A service rendezvous circuit could do such a thing when a malformed BEGIN cell is received but shouldn't in the first place because the service needs to send an END cell on the circuit for which it can not do without a cpath_layer. Fixes #22493 Reported-by: Roger Dingledine <[email protected]> Signed-off-by: David Goulet <[email protected]>
connected_cell_format_payload(uint8_t *payload_out, const tor_addr_t *addr, uint32_t ttl) { const sa_family_t family = tor_addr_family(addr); int connected_payload_len; /* should be needless */ memset(payload_out, 0, MAX_CONNECTED_CELL_PAYLOAD_LEN); if (family == AF_INET) { set_uint32(payload_out, tor_addr_to_ipv4n(addr)); connected_payload_len = 4; } else if (family == AF_INET6) { set_uint32(payload_out, 0); set_uint8(payload_out + 4, 6); memcpy(payload_out + 5, tor_addr_to_in6_addr8(addr), 16); connected_payload_len = 21; } else { return -1; } set_uint32(payload_out + connected_payload_len, htonl(dns_clip_ttl(ttl))); connected_payload_len += 4; tor_assert(connected_payload_len <= MAX_CONNECTED_CELL_PAYLOAD_LEN); return connected_payload_len; }
connected_cell_format_payload(uint8_t *payload_out, const tor_addr_t *addr, uint32_t ttl) { const sa_family_t family = tor_addr_family(addr); int connected_payload_len; /* should be needless */ memset(payload_out, 0, MAX_CONNECTED_CELL_PAYLOAD_LEN); if (family == AF_INET) { set_uint32(payload_out, tor_addr_to_ipv4n(addr)); connected_payload_len = 4; } else if (family == AF_INET6) { set_uint32(payload_out, 0); set_uint8(payload_out + 4, 6); memcpy(payload_out + 5, tor_addr_to_in6_addr8(addr), 16); connected_payload_len = 21; } else { return -1; } set_uint32(payload_out + connected_payload_len, htonl(dns_clip_ttl(ttl))); connected_payload_len += 4; tor_assert(connected_payload_len <= MAX_CONNECTED_CELL_PAYLOAD_LEN); return connected_payload_len; }
C
tor
0
CVE-2018-20784
https://www.cvedetails.com/cve/CVE-2018-20784/
CWE-400
https://github.com/torvalds/linux/commit/c40f7d74c741a907cfaeb73a7697081881c497d0
c40f7d74c741a907cfaeb73a7697081881c497d0
sched/fair: Fix infinite loop in update_blocked_averages() by reverting a9e7f6544b9c Zhipeng Xie, Xie XiuQi and Sargun Dhillon reported lockups in the scheduler under high loads, starting at around the v4.18 time frame, and Zhipeng Xie tracked it down to bugs in the rq->leaf_cfs_rq_list manipulation. Do a (manual) revert of: a9e7f6544b9c ("sched/fair: Fix O(nr_cgroups) in load balance path") It turns out that the list_del_leaf_cfs_rq() introduced by this commit is a surprising property that was not considered in followup commits such as: 9c2791f936ef ("sched/fair: Fix hierarchical order in rq->leaf_cfs_rq_list") As Vincent Guittot explains: "I think that there is a bigger problem with commit a9e7f6544b9c and cfs_rq throttling: Let take the example of the following topology TG2 --> TG1 --> root: 1) The 1st time a task is enqueued, we will add TG2 cfs_rq then TG1 cfs_rq to leaf_cfs_rq_list and we are sure to do the whole branch in one path because it has never been used and can't be throttled so tmp_alone_branch will point to leaf_cfs_rq_list at the end. 2) Then TG1 is throttled 3) and we add TG3 as a new child of TG1. 4) The 1st enqueue of a task on TG3 will add TG3 cfs_rq just before TG1 cfs_rq and tmp_alone_branch will stay on rq->leaf_cfs_rq_list. With commit a9e7f6544b9c, we can del a cfs_rq from rq->leaf_cfs_rq_list. So if the load of TG1 cfs_rq becomes NULL before step 2) above, TG1 cfs_rq is removed from the list. Then at step 4), TG3 cfs_rq is added at the beginning of rq->leaf_cfs_rq_list but tmp_alone_branch still points to TG3 cfs_rq because its throttled parent can't be enqueued when the lock is released. tmp_alone_branch doesn't point to rq->leaf_cfs_rq_list whereas it should. So if TG3 cfs_rq is removed or destroyed before tmp_alone_branch points on another TG cfs_rq, the next TG cfs_rq that will be added, will be linked outside rq->leaf_cfs_rq_list - which is bad. In addition, we can break the ordering of the cfs_rq in rq->leaf_cfs_rq_list but this ordering is used to update and propagate the update from leaf down to root." Instead of trying to work through all these cases and trying to reproduce the very high loads that produced the lockup to begin with, simplify the code temporarily by reverting a9e7f6544b9c - which change was clearly not thought through completely. This (hopefully) gives us a kernel that doesn't lock up so people can continue to enjoy their holidays without worrying about regressions. ;-) [ mingo: Wrote changelog, fixed weird spelling in code comment while at it. ] Analyzed-by: Xie XiuQi <[email protected]> Analyzed-by: Vincent Guittot <[email protected]> Reported-by: Zhipeng Xie <[email protected]> Reported-by: Sargun Dhillon <[email protected]> Reported-by: Xie XiuQi <[email protected]> Tested-by: Zhipeng Xie <[email protected]> Tested-by: Sargun Dhillon <[email protected]> Signed-off-by: Linus Torvalds <[email protected]> Acked-by: Vincent Guittot <[email protected]> Cc: <[email protected]> # v4.13+ Cc: Bin Li <[email protected]> Cc: Mike Galbraith <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Tejun Heo <[email protected]> Cc: Thomas Gleixner <[email protected]> Fixes: a9e7f6544b9c ("sched/fair: Fix O(nr_cgroups) in load balance path") Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Ingo Molnar <[email protected]>
static inline void update_sg_lb_stats(struct lb_env *env, struct sched_group *group, struct sg_lb_stats *sgs, int *sg_status) { int local_group = cpumask_test_cpu(env->dst_cpu, sched_group_span(group)); int load_idx = get_sd_load_idx(env->sd, env->idle); unsigned long load; int i, nr_running; memset(sgs, 0, sizeof(*sgs)); for_each_cpu_and(i, sched_group_span(group), env->cpus) { struct rq *rq = cpu_rq(i); if ((env->flags & LBF_NOHZ_STATS) && update_nohz_stats(rq, false)) env->flags |= LBF_NOHZ_AGAIN; /* Bias balancing toward CPUs of our domain: */ if (local_group) load = target_load(i, load_idx); else load = source_load(i, load_idx); sgs->group_load += load; sgs->group_util += cpu_util(i); sgs->sum_nr_running += rq->cfs.h_nr_running; nr_running = rq->nr_running; if (nr_running > 1) *sg_status |= SG_OVERLOAD; if (cpu_overutilized(i)) *sg_status |= SG_OVERUTILIZED; #ifdef CONFIG_NUMA_BALANCING sgs->nr_numa_running += rq->nr_numa_running; sgs->nr_preferred_running += rq->nr_preferred_running; #endif sgs->sum_weighted_load += weighted_cpuload(rq); /* * No need to call idle_cpu() if nr_running is not 0 */ if (!nr_running && idle_cpu(i)) sgs->idle_cpus++; if (env->sd->flags & SD_ASYM_CPUCAPACITY && sgs->group_misfit_task_load < rq->misfit_task_load) { sgs->group_misfit_task_load = rq->misfit_task_load; *sg_status |= SG_OVERLOAD; } } /* Adjust by relative CPU capacity of the group */ sgs->group_capacity = group->sgc->capacity; sgs->avg_load = (sgs->group_load*SCHED_CAPACITY_SCALE) / sgs->group_capacity; if (sgs->sum_nr_running) sgs->load_per_task = sgs->sum_weighted_load / sgs->sum_nr_running; sgs->group_weight = group->group_weight; sgs->group_no_capacity = group_is_overloaded(env, sgs); sgs->group_type = group_classify(group, sgs); }
static inline void update_sg_lb_stats(struct lb_env *env, struct sched_group *group, struct sg_lb_stats *sgs, int *sg_status) { int local_group = cpumask_test_cpu(env->dst_cpu, sched_group_span(group)); int load_idx = get_sd_load_idx(env->sd, env->idle); unsigned long load; int i, nr_running; memset(sgs, 0, sizeof(*sgs)); for_each_cpu_and(i, sched_group_span(group), env->cpus) { struct rq *rq = cpu_rq(i); if ((env->flags & LBF_NOHZ_STATS) && update_nohz_stats(rq, false)) env->flags |= LBF_NOHZ_AGAIN; /* Bias balancing toward CPUs of our domain: */ if (local_group) load = target_load(i, load_idx); else load = source_load(i, load_idx); sgs->group_load += load; sgs->group_util += cpu_util(i); sgs->sum_nr_running += rq->cfs.h_nr_running; nr_running = rq->nr_running; if (nr_running > 1) *sg_status |= SG_OVERLOAD; if (cpu_overutilized(i)) *sg_status |= SG_OVERUTILIZED; #ifdef CONFIG_NUMA_BALANCING sgs->nr_numa_running += rq->nr_numa_running; sgs->nr_preferred_running += rq->nr_preferred_running; #endif sgs->sum_weighted_load += weighted_cpuload(rq); /* * No need to call idle_cpu() if nr_running is not 0 */ if (!nr_running && idle_cpu(i)) sgs->idle_cpus++; if (env->sd->flags & SD_ASYM_CPUCAPACITY && sgs->group_misfit_task_load < rq->misfit_task_load) { sgs->group_misfit_task_load = rq->misfit_task_load; *sg_status |= SG_OVERLOAD; } } /* Adjust by relative CPU capacity of the group */ sgs->group_capacity = group->sgc->capacity; sgs->avg_load = (sgs->group_load*SCHED_CAPACITY_SCALE) / sgs->group_capacity; if (sgs->sum_nr_running) sgs->load_per_task = sgs->sum_weighted_load / sgs->sum_nr_running; sgs->group_weight = group->group_weight; sgs->group_no_capacity = group_is_overloaded(env, sgs); sgs->group_type = group_classify(group, sgs); }
C
linux
0
CVE-2012-5532
https://www.cvedetails.com/cve/CVE-2012-5532/
null
https://github.com/torvalds/linux/commit/95a69adab9acfc3981c504737a2b6578e4d846ef
95a69adab9acfc3981c504737a2b6578e4d846ef
tools: hv: Netlink source address validation allows DoS The source code without this patch caused hypervkvpd to exit when it processed a spoofed Netlink packet which has been sent from an untrusted local user. Now Netlink messages with a non-zero nl_pid source address are ignored and a warning is printed into the syslog. Signed-off-by: Tomas Hozza <[email protected]> Acked-by: K. Y. Srinivasan <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
static char *kvp_get_if_name(char *guid) { DIR *dir; struct dirent *entry; FILE *file; char *p, *q, *x; char *if_name = NULL; char buf[256]; char *kvp_net_dir = "/sys/class/net/"; char dev_id[256]; dir = opendir(kvp_net_dir); if (dir == NULL) return NULL; snprintf(dev_id, sizeof(dev_id), "%s", kvp_net_dir); q = dev_id + strlen(kvp_net_dir); while ((entry = readdir(dir)) != NULL) { /* * Set the state for the next pass. */ *q = '\0'; strcat(dev_id, entry->d_name); strcat(dev_id, "/device/device_id"); file = fopen(dev_id, "r"); if (file == NULL) continue; p = fgets(buf, sizeof(buf), file); if (p) { x = strchr(p, '\n'); if (x) *x = '\0'; if (!strcmp(p, guid)) { /* * Found the guid match; return the interface * name. The caller will free the memory. */ if_name = strdup(entry->d_name); fclose(file); break; } } fclose(file); } closedir(dir); return if_name; }
static char *kvp_get_if_name(char *guid) { DIR *dir; struct dirent *entry; FILE *file; char *p, *q, *x; char *if_name = NULL; char buf[256]; char *kvp_net_dir = "/sys/class/net/"; char dev_id[256]; dir = opendir(kvp_net_dir); if (dir == NULL) return NULL; snprintf(dev_id, sizeof(dev_id), "%s", kvp_net_dir); q = dev_id + strlen(kvp_net_dir); while ((entry = readdir(dir)) != NULL) { /* * Set the state for the next pass. */ *q = '\0'; strcat(dev_id, entry->d_name); strcat(dev_id, "/device/device_id"); file = fopen(dev_id, "r"); if (file == NULL) continue; p = fgets(buf, sizeof(buf), file); if (p) { x = strchr(p, '\n'); if (x) *x = '\0'; if (!strcmp(p, guid)) { /* * Found the guid match; return the interface * name. The caller will free the memory. */ if_name = strdup(entry->d_name); fclose(file); break; } } fclose(file); } closedir(dir); return if_name; }
C
linux
0
CVE-2018-11469
https://www.cvedetails.com/cve/CVE-2018-11469/
CWE-200
https://git.haproxy.org/?p=haproxy-1.8.git;a=commit;h=17514045e5d934dede62116216c1b016fe23dd06
17514045e5d934dede62116216c1b016fe23dd06
null
smp_fetch_url_port(const struct arg *args, struct sample *smp, const char *kw, void *private) { struct http_txn *txn; struct sockaddr_storage addr; CHECK_HTTP_MESSAGE_FIRST(); txn = smp->strm->txn; url2sa(txn->req.chn->buf->p + txn->req.sl.rq.u, txn->req.sl.rq.u_l, &addr, NULL); if (((struct sockaddr_in *)&addr)->sin_family != AF_INET) return 0; smp->data.type = SMP_T_SINT; smp->data.u.sint = ntohs(((struct sockaddr_in *)&addr)->sin_port); smp->flags = 0; return 1; }
smp_fetch_url_port(const struct arg *args, struct sample *smp, const char *kw, void *private) { struct http_txn *txn; struct sockaddr_storage addr; CHECK_HTTP_MESSAGE_FIRST(); txn = smp->strm->txn; url2sa(txn->req.chn->buf->p + txn->req.sl.rq.u, txn->req.sl.rq.u_l, &addr, NULL); if (((struct sockaddr_in *)&addr)->sin_family != AF_INET) return 0; smp->data.type = SMP_T_SINT; smp->data.u.sint = ntohs(((struct sockaddr_in *)&addr)->sin_port); smp->flags = 0; return 1; }
C
haproxy
0
CVE-2019-6978
https://www.cvedetails.com/cve/CVE-2019-6978/
CWE-415
https://github.com/php/php-src/commit/089f7c0bc28d399b0420aa6ef058e4c1c120b2ae
089f7c0bc28d399b0420aa6ef058e4c1c120b2ae
Sync with upstream Even though libgd/libgd#492 is not a relevant bug fix for PHP, since the binding doesn't use the `gdImage*Ptr()` functions at all, we're porting the fix to stay in sync here.
const char * gdJpegGetVersionString() { switch(JPEG_LIB_VERSION) { case 62: return "6b"; break; case 70: return "7"; break; case 80: return "8"; break; case 90: return "9 compatible"; break; default: return "unknown"; } }
const char * gdJpegGetVersionString() { switch(JPEG_LIB_VERSION) { case 62: return "6b"; break; case 70: return "7"; break; case 80: return "8"; break; case 90: return "9 compatible"; break; default: return "unknown"; } }
C
php-src
0
CVE-2014-3168
https://www.cvedetails.com/cve/CVE-2014-3168/
null
https://github.com/chromium/chromium/commit/f592cf6a66b63decc7e7093b36501229a5de1f1d
f592cf6a66b63decc7e7093b36501229a5de1f1d
SVG: Moving animating <svg> to other iframe should not crash. Moving SVGSVGElement with its SMILTimeContainer already started caused crash before this patch. |SVGDocumentExtentions::startAnimations()| calls begin() against all SMILTimeContainers in the document, but the SMILTimeContainer for <svg> moved from other document may be already started. BUG=369860 Review URL: https://codereview.chromium.org/290353002 git-svn-id: svn://svn.chromium.org/blink/trunk@174338 bbb929c8-8fbe-4397-9dbb-9b2b20218538
void SVGDocumentExtensions::markPendingResourcesForRemoval(const AtomicString& id) { if (id.isEmpty()) return; ASSERT(!m_pendingResourcesForRemoval.contains(id)); OwnPtr<SVGPendingElements> existing = m_pendingResources.take(id); if (existing && !existing->isEmpty()) m_pendingResourcesForRemoval.add(id, existing.release()); }
void SVGDocumentExtensions::markPendingResourcesForRemoval(const AtomicString& id) { if (id.isEmpty()) return; ASSERT(!m_pendingResourcesForRemoval.contains(id)); OwnPtr<SVGPendingElements> existing = m_pendingResources.take(id); if (existing && !existing->isEmpty()) m_pendingResourcesForRemoval.add(id, existing.release()); }
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
bool Browser::is_app() const { return !app_name_.empty(); }
bool Browser::is_app() const { return !app_name_.empty(); }
C
Chrome
0
CVE-2018-6049
https://www.cvedetails.com/cve/CVE-2018-6049/
null
https://github.com/chromium/chromium/commit/56762260ca8ef62578fa4718b7d47711f7e120dc
56762260ca8ef62578fa4718b7d47711f7e120dc
Elide the permission bubble title from the head of the string. Long URLs can be used to spoof other origins in the permission bubble title. This CL customises the title to be elided from the head, which ensures that the maximal amount of the URL host is displayed in the case where the URL is too long and causes the string to overflow. Implementing the ellision means that the title cannot be multiline (where elision is not well supported). Note that in English, the window title is a string "$ORIGIN wants to", so the non-origin component will not be elided. In other languages, the non-origin component may appear fully or partly before the origin (e.g. in Filipino, "Gusto ng $ORIGIN na"), so it may be elided there if the URL is sufficiently long. This is not optimal, but the URLs that are sufficiently long to trigger the elision are probably malicious, and displaying the most relevant component of the URL is most important for security purposes. BUG=774438 Change-Id: I75c2364b10bf69bf337c7f4970481bf1809f6aae Reviewed-on: https://chromium-review.googlesource.com/768312 Reviewed-by: Ben Wells <[email protected]> Reviewed-by: Lucas Garron <[email protected]> Reviewed-by: Matt Giuca <[email protected]> Commit-Queue: Dominick Ng <[email protected]> Cr-Commit-Position: refs/heads/master@{#516921}
bool PermissionPromptImpl::CanAcceptRequestUpdate() { return !(bubble_delegate_ && bubble_delegate_->IsMouseHovered()); }
bool PermissionPromptImpl::CanAcceptRequestUpdate() { return !(bubble_delegate_ && bubble_delegate_->IsMouseHovered()); }
C
Chrome
0
null
null
null
https://github.com/chromium/chromium/commit/57fb5393bf051c590769c9b5723d5a9f4090a4cc
57fb5393bf051c590769c9b5723d5a9f4090a4cc
Implement range reading for NetworkReaderProxy. The feature is not yet actually used, but will be used for range reading of DriveFileStreamReader. BUG=127129 TEST=Ran unit_tests Review URL: https://chromiumcodereview.appspot.com/14493008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@196636 0039d316-1c4b-4281-b951-d872f2087c98
int DriveFileStreamReader::Read(net::IOBuffer* buffer, int buffer_length, const net::CompletionCallback& callback) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); DCHECK(reader_proxy_); DCHECK(buffer); DCHECK(!callback.is_null()); return reader_proxy_->Read(buffer, buffer_length, callback); }
int DriveFileStreamReader::Read(net::IOBuffer* buffer, int buffer_length, const net::CompletionCallback& callback) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); DCHECK(reader_proxy_); DCHECK(buffer); DCHECK(!callback.is_null()); return reader_proxy_->Read(buffer, buffer_length, callback); }
C
Chrome
0
CVE-2016-9105
https://www.cvedetails.com/cve/CVE-2016-9105/
CWE-399
https://git.qemu.org/?p=qemu.git;a=commit;h=4c1586787ff43c9acd18a56c12d720e3e6be9f7c
4c1586787ff43c9acd18a56c12d720e3e6be9f7c
null
static void coroutine_fn v9fs_write(void *opaque) { ssize_t err; int32_t fid; uint64_t off; uint32_t count; int32_t len = 0; int32_t total = 0; size_t offset = 7; V9fsFidState *fidp; V9fsPDU *pdu = opaque; V9fsState *s = pdu->s; QEMUIOVector qiov_full; QEMUIOVector qiov; err = pdu_unmarshal(pdu, offset, "dqd", &fid, &off, &count); if (err < 0) { pdu_complete(pdu, err); return; } offset += err; v9fs_init_qiov_from_pdu(&qiov_full, pdu, offset, count, true); trace_v9fs_write(pdu->tag, pdu->id, fid, off, count, qiov_full.niov); fidp = get_fid(pdu, fid); if (fidp == NULL) { err = -EINVAL; goto out_nofid; } if (fidp->fid_type == P9_FID_FILE) { if (fidp->fs.fd == -1) { err = -EINVAL; goto out; } } else if (fidp->fid_type == P9_FID_XATTR) { /* * setxattr operation */ err = v9fs_xattr_write(s, pdu, fidp, off, count, qiov_full.iov, qiov_full.niov); goto out; } else { err = -EINVAL; goto out; } qemu_iovec_init(&qiov, qiov_full.niov); do { qemu_iovec_reset(&qiov); qemu_iovec_concat(&qiov, &qiov_full, total, qiov_full.size - total); if (0) { print_sg(qiov.iov, qiov.niov); } /* Loop in case of EINTR */ do { len = v9fs_co_pwritev(pdu, fidp, qiov.iov, qiov.niov, off); if (len >= 0) { off += len; total += len; } } while (len == -EINTR && !pdu->cancelled); if (len < 0) { /* IO error return the error */ err = len; goto out_qiov; } } while (total < count && len > 0); offset = 7; err = pdu_marshal(pdu, offset, "d", total); if (err < 0) { goto out; } err += offset; trace_v9fs_write_return(pdu->tag, pdu->id, total, err); out_qiov: qemu_iovec_destroy(&qiov); out: put_fid(pdu, fidp); out_nofid: qemu_iovec_destroy(&qiov_full); pdu_complete(pdu, err); }
static void coroutine_fn v9fs_write(void *opaque) { ssize_t err; int32_t fid; uint64_t off; uint32_t count; int32_t len = 0; int32_t total = 0; size_t offset = 7; V9fsFidState *fidp; V9fsPDU *pdu = opaque; V9fsState *s = pdu->s; QEMUIOVector qiov_full; QEMUIOVector qiov; err = pdu_unmarshal(pdu, offset, "dqd", &fid, &off, &count); if (err < 0) { pdu_complete(pdu, err); return; } offset += err; v9fs_init_qiov_from_pdu(&qiov_full, pdu, offset, count, true); trace_v9fs_write(pdu->tag, pdu->id, fid, off, count, qiov_full.niov); fidp = get_fid(pdu, fid); if (fidp == NULL) { err = -EINVAL; goto out_nofid; } if (fidp->fid_type == P9_FID_FILE) { if (fidp->fs.fd == -1) { err = -EINVAL; goto out; } } else if (fidp->fid_type == P9_FID_XATTR) { /* * setxattr operation */ err = v9fs_xattr_write(s, pdu, fidp, off, count, qiov_full.iov, qiov_full.niov); goto out; } else { err = -EINVAL; goto out; } qemu_iovec_init(&qiov, qiov_full.niov); do { qemu_iovec_reset(&qiov); qemu_iovec_concat(&qiov, &qiov_full, total, qiov_full.size - total); if (0) { print_sg(qiov.iov, qiov.niov); } /* Loop in case of EINTR */ do { len = v9fs_co_pwritev(pdu, fidp, qiov.iov, qiov.niov, off); if (len >= 0) { off += len; total += len; } } while (len == -EINTR && !pdu->cancelled); if (len < 0) { /* IO error return the error */ err = len; goto out_qiov; } } while (total < count && len > 0); offset = 7; err = pdu_marshal(pdu, offset, "d", total); if (err < 0) { goto out; } err += offset; trace_v9fs_write_return(pdu->tag, pdu->id, total, err); out_qiov: qemu_iovec_destroy(&qiov); out: put_fid(pdu, fidp); out_nofid: qemu_iovec_destroy(&qiov_full); pdu_complete(pdu, err); }
C
qemu
0
CVE-2012-1179
https://www.cvedetails.com/cve/CVE-2012-1179/
CWE-264
https://github.com/torvalds/linux/commit/4a1d704194a441bf83c636004a479e01360ec850
4a1d704194a441bf83c636004a479e01360ec850
mm: thp: fix pmd_bad() triggering in code paths holding mmap_sem read mode commit 1a5a9906d4e8d1976b701f889d8f35d54b928f25 upstream. In some cases it may happen that pmd_none_or_clear_bad() is called with the mmap_sem hold in read mode. In those cases the huge page faults can allocate hugepmds under pmd_none_or_clear_bad() and that can trigger a false positive from pmd_bad() that will not like to see a pmd materializing as trans huge. It's not khugepaged causing the problem, khugepaged holds the mmap_sem in write mode (and all those sites must hold the mmap_sem in read mode to prevent pagetables to go away from under them, during code review it seems vm86 mode on 32bit kernels requires that too unless it's restricted to 1 thread per process or UP builds). The race is only with the huge pagefaults that can convert a pmd_none() into a pmd_trans_huge(). Effectively all these pmd_none_or_clear_bad() sites running with mmap_sem in read mode are somewhat speculative with the page faults, and the result is always undefined when they run simultaneously. This is probably why it wasn't common to run into this. For example if the madvise(MADV_DONTNEED) runs zap_page_range() shortly before the page fault, the hugepage will not be zapped, if the page fault runs first it will be zapped. Altering pmd_bad() not to error out if it finds hugepmds won't be enough to fix this, because zap_pmd_range would then proceed to call zap_pte_range (which would be incorrect if the pmd become a pmd_trans_huge()). The simplest way to fix this is to read the pmd in the local stack (regardless of what we read, no need of actual CPU barriers, only compiler barrier needed), and be sure it is not changing under the code that computes its value. Even if the real pmd is changing under the value we hold on the stack, we don't care. If we actually end up in zap_pte_range it means the pmd was not none already and it was not huge, and it can't become huge from under us (khugepaged locking explained above). All we need is to enforce that there is no way anymore that in a code path like below, pmd_trans_huge can be false, but pmd_none_or_clear_bad can run into a hugepmd. The overhead of a barrier() is just a compiler tweak and should not be measurable (I only added it for THP builds). I don't exclude different compiler versions may have prevented the race too by caching the value of *pmd on the stack (that hasn't been verified, but it wouldn't be impossible considering pmd_none_or_clear_bad, pmd_bad, pmd_trans_huge, pmd_none are all inlines and there's no external function called in between pmd_trans_huge and pmd_none_or_clear_bad). if (pmd_trans_huge(*pmd)) { if (next-addr != HPAGE_PMD_SIZE) { VM_BUG_ON(!rwsem_is_locked(&tlb->mm->mmap_sem)); split_huge_page_pmd(vma->vm_mm, pmd); } else if (zap_huge_pmd(tlb, vma, pmd, addr)) continue; /* fall through */ } if (pmd_none_or_clear_bad(pmd)) Because this race condition could be exercised without special privileges this was reported in CVE-2012-1179. The race was identified and fully explained by Ulrich who debugged it. I'm quoting his accurate explanation below, for reference. ====== start quote ======= mapcount 0 page_mapcount 1 kernel BUG at mm/huge_memory.c:1384! At some point prior to the panic, a "bad pmd ..." message similar to the following is logged on the console: mm/memory.c:145: bad pmd ffff8800376e1f98(80000000314000e7). The "bad pmd ..." message is logged by pmd_clear_bad() before it clears the page's PMD table entry. 143 void pmd_clear_bad(pmd_t *pmd) 144 { -> 145 pmd_ERROR(*pmd); 146 pmd_clear(pmd); 147 } After the PMD table entry has been cleared, there is an inconsistency between the actual number of PMD table entries that are mapping the page and the page's map count (_mapcount field in struct page). When the page is subsequently reclaimed, __split_huge_page() detects this inconsistency. 1381 if (mapcount != page_mapcount(page)) 1382 printk(KERN_ERR "mapcount %d page_mapcount %d\n", 1383 mapcount, page_mapcount(page)); -> 1384 BUG_ON(mapcount != page_mapcount(page)); The root cause of the problem is a race of two threads in a multithreaded process. Thread B incurs a page fault on a virtual address that has never been accessed (PMD entry is zero) while Thread A is executing an madvise() system call on a virtual address within the same 2 MB (huge page) range. virtual address space .---------------------. | | | | .-|---------------------| | | | | | |<-- B(fault) | | | 2 MB | |/////////////////////|-. huge < |/////////////////////| > A(range) page | |/////////////////////|-' | | | | | | '-|---------------------| | | | | '---------------------' - Thread A is executing an madvise(..., MADV_DONTNEED) system call on the virtual address range "A(range)" shown in the picture. sys_madvise // Acquire the semaphore in shared mode. down_read(&current->mm->mmap_sem) ... madvise_vma switch (behavior) case MADV_DONTNEED: madvise_dontneed zap_page_range unmap_vmas unmap_page_range zap_pud_range zap_pmd_range // // Assume that this huge page has never been accessed. // I.e. content of the PMD entry is zero (not mapped). // if (pmd_trans_huge(*pmd)) { // We don't get here due to the above assumption. } // // Assume that Thread B incurred a page fault and .---------> // sneaks in here as shown below. | // | if (pmd_none_or_clear_bad(pmd)) | { | if (unlikely(pmd_bad(*pmd))) | pmd_clear_bad | { | pmd_ERROR | // Log "bad pmd ..." message here. | pmd_clear | // Clear the page's PMD entry. | // Thread B incremented the map count | // in page_add_new_anon_rmap(), but | // now the page is no longer mapped | // by a PMD entry (-> inconsistency). | } | } | v - Thread B is handling a page fault on virtual address "B(fault)" shown in the picture. ... do_page_fault __do_page_fault // Acquire the semaphore in shared mode. down_read_trylock(&mm->mmap_sem) ... handle_mm_fault if (pmd_none(*pmd) && transparent_hugepage_enabled(vma)) // We get here due to the above assumption (PMD entry is zero). do_huge_pmd_anonymous_page alloc_hugepage_vma // Allocate a new transparent huge page here. ... __do_huge_pmd_anonymous_page ... spin_lock(&mm->page_table_lock) ... page_add_new_anon_rmap // Here we increment the page's map count (starts at -1). atomic_set(&page->_mapcount, 0) set_pmd_at // Here we set the page's PMD entry which will be cleared // when Thread A calls pmd_clear_bad(). ... spin_unlock(&mm->page_table_lock) The mmap_sem does not prevent the race because both threads are acquiring it in shared mode (down_read). Thread B holds the page_table_lock while the page's map count and PMD table entry are updated. However, Thread A does not synchronize on that lock. ====== end quote ======= [[email protected]: checkpatch fixes] Reported-by: Ulrich Obergfell <[email protected]> Signed-off-by: Andrea Arcangeli <[email protected]> Acked-by: Johannes Weiner <[email protected]> Cc: Mel Gorman <[email protected]> Cc: Hugh Dickins <[email protected]> Cc: Dave Jones <[email protected]> Acked-by: Larry Woodman <[email protected]> Acked-by: Rik van Riel <[email protected]> Cc: Mark Salter <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
static inline int mpol_store_user_nodemask(const struct mempolicy *pol) { return pol->flags & MPOL_MODE_FLAGS; }
static inline int mpol_store_user_nodemask(const struct mempolicy *pol) { return pol->flags & MPOL_MODE_FLAGS; }
C
linux
0
CVE-2013-0839
https://www.cvedetails.com/cve/CVE-2013-0839/
CWE-399
https://github.com/chromium/chromium/commit/dd3b6fe574edad231c01c78e4647a74c38dc4178
dd3b6fe574edad231c01c78e4647a74c38dc4178
Remove parent* arg from GDataEntry ctor. * Remove static FromDocumentEntry from GDataEntry, GDataFile, GDataDirectory. Replace with InitFromDocumentEntry. * Move common code from GDataFile::InitFromDocumentEntry and GDataDirectory::InitFromDocumentEntry to GDataEntry::InitFromDocumentEntry. * Add GDataDirectoryService::FromDocumentEntry and use this everywhere. * Make ctors of GDataFile, GDataDirectory private, so these must be created by GDataDirectoryService's CreateGDataFile and CreateGDataDirectory. Make GDataEntry ctor protected. BUG=141494 TEST=unit tests. Review URL: https://chromiumcodereview.appspot.com/10854083 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@151008 0039d316-1c4b-4281-b951-d872f2087c98
void GDataFileSystem::UpdateFileByResourceId( const std::string& resource_id, const FileOperationCallback& callback) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI) || BrowserThread::CurrentlyOn(BrowserThread::IO)); RunTaskOnUIThread( base::Bind(&GDataFileSystem::UpdateFileByResourceIdOnUIThread, ui_weak_ptr_, resource_id, CreateRelayCallback(callback))); }
void GDataFileSystem::UpdateFileByResourceId( const std::string& resource_id, const FileOperationCallback& callback) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI) || BrowserThread::CurrentlyOn(BrowserThread::IO)); RunTaskOnUIThread( base::Bind(&GDataFileSystem::UpdateFileByResourceIdOnUIThread, ui_weak_ptr_, resource_id, CreateRelayCallback(callback))); }
C
Chrome
0
CVE-2016-1586
https://www.cvedetails.com/cve/CVE-2016-1586/
CWE-20
https://git.launchpad.net/oxide/commit/?id=29014da83e5fc358d6bff0f574e9ed45e61a35ac
29014da83e5fc358d6bff0f574e9ed45e61a35ac
null
qreal OxideQQuickWebView::viewportWidth() const { Q_D(const OxideQQuickWebView); if (!d->proxy_) { return 0.f; } return const_cast<OxideQQuickWebViewPrivate*>( d)->proxy_->compositorFrameViewportSize().width(); }
qreal OxideQQuickWebView::viewportWidth() const { Q_D(const OxideQQuickWebView); if (!d->proxy_) { return 0.f; } return const_cast<OxideQQuickWebViewPrivate*>( d)->proxy_->compositorFrameViewportSize().width(); }
CPP
launchpad
0
CVE-2012-2888
https://www.cvedetails.com/cve/CVE-2012-2888/
CWE-399
https://github.com/chromium/chromium/commit/3b0d77670a0613f409110817455d2137576b485a
3b0d77670a0613f409110817455d2137576b485a
Revert 143656 - Add an IPC channel between the NaCl loader process and the renderer. BUG=116317 TEST=ppapi, nacl tests, manual testing for experimental IPC proxy. Review URL: https://chromiumcodereview.appspot.com/10641016 [email protected] Review URL: https://chromiumcodereview.appspot.com/10625007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@143665 0039d316-1c4b-4281-b951-d872f2087c98
void SetKnownToValidate(const std::string& signature) { if (!listener_->Send(new NaClProcessMsg_SetKnownToValidate(signature))) { LOG(ERROR) << "Failed to update NaCl validation cache."; } }
void SetKnownToValidate(const std::string& signature) { if (!listener_->Send(new NaClProcessMsg_SetKnownToValidate(signature))) { LOG(ERROR) << "Failed to update NaCl validation cache."; } }
C
Chrome
0
CVE-2016-5155
https://www.cvedetails.com/cve/CVE-2016-5155/
CWE-254
https://github.com/chromium/chromium/commit/32a9879fc01c24f9216bb2975200ab8a4afac80c
32a9879fc01c24f9216bb2975200ab8a4afac80c
Prefer SyncService over ProfileSyncService in foreign_session_helper SyncService is the interface, ProfileSyncService is the concrete implementation. Generally no clients should need to use the conrete implementation - for one, testing will be much easier once everyone uses the interface only. Bug: 924508 Change-Id: Ia210665f8f02512053d1a60d627dea0f22758387 Reviewed-on: https://chromium-review.googlesource.com/c/1461119 Auto-Submit: Marc Treib <[email protected]> Commit-Queue: Yaron Friedman <[email protected]> Reviewed-by: Yaron Friedman <[email protected]> Cr-Commit-Position: refs/heads/master@{#630662}
ForeignSessionHelper::~ForeignSessionHelper() { }
ForeignSessionHelper::~ForeignSessionHelper() { }
C
Chrome
0
CVE-2019-5755
https://www.cvedetails.com/cve/CVE-2019-5755/
CWE-189
https://github.com/chromium/chromium/commit/971548cdca2d4c0a6fedd3db0c94372c2a27eac3
971548cdca2d4c0a6fedd3db0c94372c2a27eac3
Make MediaStreamDispatcherHost per-request instead of per-frame. Instead of having RenderFrameHost own a single MSDH to handle all requests from a frame, MSDH objects will be owned by a strong binding. A consequence of this is that an additional requester ID is added to requests to MediaStreamManager, so that an MSDH is able to cancel only requests generated by it. In practice, MSDH will continue to be per frame in most cases since each frame normally makes a single request for an MSDH object. This fixes a lifetime issue caused by the IO thread executing tasks after the RenderFrameHost dies. Drive-by: Fix some minor lint issues. Bug: 912520 Change-Id: I52742ffc98b9fc57ce8e6f5093a61aed86d3e516 Reviewed-on: https://chromium-review.googlesource.com/c/1369799 Reviewed-by: Emircan Uysaler <[email protected]> Reviewed-by: Ken Buchanan <[email protected]> Reviewed-by: Olga Sharonova <[email protected]> Commit-Queue: Guido Urdaneta <[email protected]> Cr-Commit-Position: refs/heads/master@{#616347}
void SpeechRecognitionManagerImpl::OnRecognitionResults( int session_id, const std::vector<blink::mojom::SpeechRecognitionResultPtr>& results) { DCHECK_CURRENTLY_ON(BrowserThread::IO); if (!SessionExists(session_id)) return; if (SpeechRecognitionEventListener* delegate_listener = GetDelegateListener()) delegate_listener->OnRecognitionResults(session_id, results); if (SpeechRecognitionEventListener* listener = GetListener(session_id)) listener->OnRecognitionResults(session_id, results); }
void SpeechRecognitionManagerImpl::OnRecognitionResults( int session_id, const std::vector<blink::mojom::SpeechRecognitionResultPtr>& results) { DCHECK_CURRENTLY_ON(BrowserThread::IO); if (!SessionExists(session_id)) return; if (SpeechRecognitionEventListener* delegate_listener = GetDelegateListener()) delegate_listener->OnRecognitionResults(session_id, results); if (SpeechRecognitionEventListener* listener = GetListener(session_id)) listener->OnRecognitionResults(session_id, results); }
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
delete_cb (GtkDialog *dialog) { gtk_dialog_response (dialog, GTK_RESPONSE_DELETE_EVENT); return TRUE; }
delete_cb (GtkDialog *dialog) { gtk_dialog_response (dialog, GTK_RESPONSE_DELETE_EVENT); return TRUE; }
C
nautilus
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]>
struct net_device *dev_get_by_name_rcu(struct net *net, const char *name) { struct net_device *dev; struct hlist_head *head = dev_name_hash(net, name); hlist_for_each_entry_rcu(dev, head, name_hlist) if (!strncmp(dev->name, name, IFNAMSIZ)) return dev; return NULL; }
struct net_device *dev_get_by_name_rcu(struct net *net, const char *name) { struct net_device *dev; struct hlist_head *head = dev_name_hash(net, name); hlist_for_each_entry_rcu(dev, head, name_hlist) if (!strncmp(dev->name, name, IFNAMSIZ)) return dev; return NULL; }
C
linux
0
CVE-2019-11487
https://www.cvedetails.com/cve/CVE-2019-11487/
CWE-416
https://github.com/torvalds/linux/commit/6b3a707736301c2128ca85ce85fb13f60b5e350a
6b3a707736301c2128ca85ce85fb13f60b5e350a
Merge branch 'page-refs' (page ref overflow) Merge page ref overflow branch. Jann Horn reported that he can overflow the page ref count with sufficient memory (and a filesystem that is intentionally extremely slow). Admittedly it's not exactly easy. To have more than four billion references to a page requires a minimum of 32GB of kernel memory just for the pointers to the pages, much less any metadata to keep track of those pointers. Jann needed a total of 140GB of memory and a specially crafted filesystem that leaves all reads pending (in order to not ever free the page references and just keep adding more). Still, we have a fairly straightforward way to limit the two obvious user-controllable sources of page references: direct-IO like page references gotten through get_user_pages(), and the splice pipe page duplication. So let's just do that. * branch page-refs: fs: prevent page refcount overflow in pipe_buf_get mm: prevent get_user_pages() from overflowing page refcount mm: add 'try_get_page()' helper function mm: make page ref count overflow check tighter and more explicit
void __fuse_get_request(struct fuse_req *req) { refcount_inc(&req->count); }
void __fuse_get_request(struct fuse_req *req) { refcount_inc(&req->count); }
C
linux
0
CVE-2016-6787
https://www.cvedetails.com/cve/CVE-2016-6787/
CWE-264
https://github.com/torvalds/linux/commit/f63a8daa5812afef4f06c962351687e1ff9ccb2b
f63a8daa5812afef4f06c962351687e1ff9ccb2b
perf: Fix event->ctx locking There have been a few reported issues wrt. the lack of locking around changing event->ctx. This patch tries to address those. It avoids the whole rwsem thing; and while it appears to work, please give it some thought in review. What I did fail at is sensible runtime checks on the use of event->ctx, the RCU use makes it very hard. Signed-off-by: Peter Zijlstra (Intel) <[email protected]> Cc: Paul E. McKenney <[email protected]> Cc: Jiri Olsa <[email protected]> Cc: Arnaldo Carvalho de Melo <[email protected]> Cc: Linus Torvalds <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Ingo Molnar <[email protected]>
__perf_event_exit_task(struct perf_event *child_event, struct perf_event_context *child_ctx, struct task_struct *child) { /* * Do not destroy the 'original' grouping; because of the context * switch optimization the original events could've ended up in a * random child task. * * If we were to destroy the original group, all group related * operations would cease to function properly after this random * child dies. * * Do destroy all inherited groups, we don't care about those * and being thorough is better. */ perf_remove_from_context(child_event, !!child_event->parent); /* * It can happen that the parent exits first, and has events * that are still around due to the child reference. These * events need to be zapped. */ if (child_event->parent) { sync_child_event(child_event, child); free_event(child_event); } else { child_event->state = PERF_EVENT_STATE_EXIT; perf_event_wakeup(child_event); } }
__perf_event_exit_task(struct perf_event *child_event, struct perf_event_context *child_ctx, struct task_struct *child) { /* * Do not destroy the 'original' grouping; because of the context * switch optimization the original events could've ended up in a * random child task. * * If we were to destroy the original group, all group related * operations would cease to function properly after this random * child dies. * * Do destroy all inherited groups, we don't care about those * and being thorough is better. */ perf_remove_from_context(child_event, !!child_event->parent); /* * It can happen that the parent exits first, and has events * that are still around due to the child reference. These * events need to be zapped. */ if (child_event->parent) { sync_child_event(child_event, child); free_event(child_event); } else { child_event->state = PERF_EVENT_STATE_EXIT; perf_event_wakeup(child_event); } }
C
linux
0
CVE-2016-5170
https://www.cvedetails.com/cve/CVE-2016-5170/
CWE-416
https://github.com/chromium/chromium/commit/c3957448cfc6e299165196a33cd954b790875fdb
c3957448cfc6e299165196a33cd954b790875fdb
Cleanup and remove dead code in SetFocusedElement This early-out was added in: https://crrev.com/ce8ea3446283965c7eabab592cbffe223b1cf2bc Back then, we applied fragment focus in LayoutUpdated() which could cause this issue. This got cleaned up in: https://crrev.com/45236fd563e9df53dc45579be1f3d0b4784885a2 so that focus is no longer applied after layout. +Cleanup: Goto considered harmful Bug: 795381 Change-Id: Ifeb4d2e03e872fd48cca6720b1d4de36ad1ecbb7 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1524417 Commit-Queue: David Bokan <[email protected]> Reviewed-by: Stefan Zager <[email protected]> Cr-Commit-Position: refs/heads/master@{#641101}
SVGDocumentExtensions& Document::AccessSVGExtensions() { if (!svg_extensions_) svg_extensions_ = MakeGarbageCollected<SVGDocumentExtensions>(this); return *svg_extensions_; }
SVGDocumentExtensions& Document::AccessSVGExtensions() { if (!svg_extensions_) svg_extensions_ = MakeGarbageCollected<SVGDocumentExtensions>(this); return *svg_extensions_; }
C
Chrome
0
CVE-2013-0879
https://www.cvedetails.com/cve/CVE-2013-0879/
CWE-119
https://github.com/chromium/chromium/commit/0f05aa7e29cf814a204830c82ba2619f9c636894
0f05aa7e29cf814a204830c82ba2619f9c636894
DIAL (Discovery and Launch protocol) extension API skeleton. This implements the skeleton for a new Chrome extension API for local device discovery. The API will first be restricted to whitelisted extensions only. The API will allow extensions to receive events from a DIAL service running within Chrome which notifies of devices being discovered on the local network. Spec available here: https://docs.google.com/a/google.com/document/d/14FI-VKWrsMG7pIy3trgM3ybnKS-o5TULkt8itiBNXlQ/edit BUG=163288 [email protected] Review URL: https://chromiumcodereview.appspot.com/11444020 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@172243 0039d316-1c4b-4281-b951-d872f2087c98
void APIPermissionInfo::RegisterAllPermissions( PermissionsInfo* info) { struct PermissionRegistration { APIPermission::ID id; const char* name; int flags; int l10n_message_id; PermissionMessage::ID message_id; APIPermissionConstructor constructor; } PermissionsToRegister[] = { { APIPermission::kBackground, "background" }, { APIPermission::kClipboardRead, "clipboardRead", kFlagNone, IDS_EXTENSION_PROMPT_WARNING_CLIPBOARD, PermissionMessage::kClipboard }, { APIPermission::kClipboardWrite, "clipboardWrite" }, { APIPermission::kDeclarativeWebRequest, "declarativeWebRequest" }, { APIPermission::kDownloads, "downloads", kFlagNone, IDS_EXTENSION_PROMPT_WARNING_DOWNLOADS, PermissionMessage::kDownloads }, { APIPermission::kExperimental, "experimental", kFlagCannotBeOptional }, { APIPermission::kGeolocation, "geolocation", kFlagCannotBeOptional, IDS_EXTENSION_PROMPT_WARNING_GEOLOCATION, PermissionMessage::kGeolocation }, { APIPermission::kNotification, "notifications" }, { APIPermission::kUnlimitedStorage, "unlimitedStorage", kFlagCannotBeOptional }, { APIPermission::kAppNotifications, "appNotifications" }, { APIPermission::kActiveTab, "activeTab" }, { APIPermission::kAlarms, "alarms" }, { APIPermission::kBookmark, "bookmarks", kFlagNone, IDS_EXTENSION_PROMPT_WARNING_BOOKMARKS, PermissionMessage::kBookmarks }, { APIPermission::kBrowsingData, "browsingData" }, { APIPermission::kContentSettings, "contentSettings", kFlagNone, IDS_EXTENSION_PROMPT_WARNING_CONTENT_SETTINGS, PermissionMessage::kContentSettings }, { APIPermission::kContextMenus, "contextMenus" }, { APIPermission::kCookie, "cookies" }, { APIPermission::kFileBrowserHandler, "fileBrowserHandler", kFlagCannotBeOptional }, { APIPermission::kFontSettings, "fontSettings", kFlagCannotBeOptional }, { APIPermission::kHistory, "history", kFlagNone, IDS_EXTENSION_PROMPT_WARNING_BROWSING_HISTORY, PermissionMessage::kBrowsingHistory }, { APIPermission::kIdle, "idle" }, { APIPermission::kInput, "input", kFlagNone, IDS_EXTENSION_PROMPT_WARNING_INPUT, PermissionMessage::kInput }, { APIPermission::kManagement, "management", kFlagNone, IDS_EXTENSION_PROMPT_WARNING_MANAGEMENT, PermissionMessage::kManagement }, { APIPermission::kPrivacy, "privacy", kFlagNone, IDS_EXTENSION_PROMPT_WARNING_PRIVACY, PermissionMessage::kPrivacy }, { APIPermission::kStorage, "storage" }, { APIPermission::kSyncFileSystem, "syncFileSystem" }, { APIPermission::kTab, "tabs", kFlagNone, IDS_EXTENSION_PROMPT_WARNING_TABS, PermissionMessage::kTabs }, { APIPermission::kTopSites, "topSites", kFlagNone, IDS_EXTENSION_PROMPT_WARNING_BROWSING_HISTORY, PermissionMessage::kBrowsingHistory }, { APIPermission::kTts, "tts", 0, kFlagCannotBeOptional }, { APIPermission::kTtsEngine, "ttsEngine", kFlagCannotBeOptional, IDS_EXTENSION_PROMPT_WARNING_TTS_ENGINE, PermissionMessage::kTtsEngine }, { APIPermission::kWebNavigation, "webNavigation", kFlagNone, IDS_EXTENSION_PROMPT_WARNING_TABS, PermissionMessage::kTabs }, { APIPermission::kWebRequest, "webRequest" }, { APIPermission::kWebRequestBlocking, "webRequestBlocking" }, { APIPermission::kWebView, "webview", kFlagCannotBeOptional }, { APIPermission::kBookmarkManagerPrivate, "bookmarkManagerPrivate", kFlagCannotBeOptional }, { APIPermission::kChromeosInfoPrivate, "chromeosInfoPrivate", kFlagCannotBeOptional }, { APIPermission::kDial, "dial", kFlagCannotBeOptional }, { APIPermission::kFileBrowserHandlerInternal, "fileBrowserHandlerInternal", kFlagCannotBeOptional }, { APIPermission::kFileBrowserPrivate, "fileBrowserPrivate", kFlagCannotBeOptional }, { APIPermission::kManagedModePrivate, "managedModePrivate", kFlagCannotBeOptional }, { APIPermission::kMediaPlayerPrivate, "mediaPlayerPrivate", kFlagCannotBeOptional }, { APIPermission::kMetricsPrivate, "metricsPrivate", kFlagCannotBeOptional }, { APIPermission::kSystemPrivate, "systemPrivate", kFlagCannotBeOptional }, { APIPermission::kCloudPrintPrivate, "cloudPrintPrivate", kFlagCannotBeOptional }, { APIPermission::kInputMethodPrivate, "inputMethodPrivate", kFlagCannotBeOptional }, { APIPermission::kEchoPrivate, "echoPrivate", kFlagCannotBeOptional }, { APIPermission::kRtcPrivate, "rtcPrivate", kFlagCannotBeOptional }, { APIPermission::kTerminalPrivate, "terminalPrivate", kFlagCannotBeOptional }, { APIPermission::kWallpaperPrivate, "wallpaperPrivate", kFlagCannotBeOptional }, { APIPermission::kWebRequestInternal, "webRequestInternal" }, { APIPermission::kWebSocketProxyPrivate, "webSocketProxyPrivate", kFlagCannotBeOptional }, { APIPermission::kWebstorePrivate, "webstorePrivate", kFlagCannotBeOptional }, { APIPermission::kMediaGalleriesPrivate, "mediaGalleriesPrivate", kFlagCannotBeOptional }, { APIPermission::kDebugger, "debugger", kFlagImpliesFullURLAccess | kFlagCannotBeOptional, IDS_EXTENSION_PROMPT_WARNING_DEBUGGER, PermissionMessage::kDebugger }, { APIPermission::kDevtools, "devtools", kFlagImpliesFullURLAccess | kFlagCannotBeOptional }, { APIPermission::kPageCapture, "pageCapture", kFlagImpliesFullURLAccess }, { APIPermission::kTabCapture, "tabCapture", kFlagImpliesFullURLAccess }, { APIPermission::kPlugin, "plugin", kFlagImpliesFullURLAccess | kFlagImpliesFullAccess | kFlagCannotBeOptional, IDS_EXTENSION_PROMPT_WARNING_FULL_ACCESS, PermissionMessage::kFullAccess }, { APIPermission::kProxy, "proxy", kFlagImpliesFullURLAccess | kFlagCannotBeOptional }, { APIPermission::kSerial, "serial", kFlagNone, IDS_EXTENSION_PROMPT_WARNING_SERIAL, PermissionMessage::kSerial }, { APIPermission::kSocket, "socket", kFlagCannotBeOptional, 0, PermissionMessage::kNone, &::CreateAPIPermission<SocketPermission> }, { APIPermission::kAppCurrentWindowInternal, "app.currentWindowInternal" }, { APIPermission::kAppRuntime, "app.runtime" }, { APIPermission::kAppWindow, "app.window" }, { APIPermission::kAudioCapture, "audioCapture", kFlagNone, IDS_EXTENSION_PROMPT_WARNING_AUDIO_CAPTURE, PermissionMessage::kAudioCapture }, { APIPermission::kVideoCapture, "videoCapture", kFlagNone, IDS_EXTENSION_PROMPT_WARNING_VIDEO_CAPTURE, PermissionMessage::kVideoCapture }, { APIPermission::kFileSystem, "fileSystem" }, { APIPermission::kFileSystemWrite, "fileSystem.write", kFlagNone, IDS_EXTENSION_PROMPT_WARNING_FILE_SYSTEM_WRITE, PermissionMessage::kFileSystemWrite }, { APIPermission::kMediaGalleries, "mediaGalleries" }, { APIPermission::kMediaGalleriesRead, "mediaGalleries.read" }, { APIPermission::kMediaGalleriesAllAutoDetected, "mediaGalleries.allAutoDetected", kFlagNone, IDS_EXTENSION_PROMPT_WARNING_MEDIA_GALLERIES_ALL_GALLERIES, PermissionMessage::kMediaGalleriesAllGalleries }, { APIPermission::kPushMessaging, "pushMessaging", kFlagCannotBeOptional }, { APIPermission::kBluetooth, "bluetooth", kFlagNone, IDS_EXTENSION_PROMPT_WARNING_BLUETOOTH, PermissionMessage::kBluetooth }, { APIPermission::kBluetoothDevice, "bluetoothDevice", kFlagNone, 0, PermissionMessage::kNone, &::CreateAPIPermission<BluetoothDevicePermission> }, { APIPermission::kUsb, "usb", kFlagNone, IDS_EXTENSION_PROMPT_WARNING_USB, PermissionMessage::kUsb }, { APIPermission::kSystemIndicator, "systemIndicator", kFlagNone, IDS_EXTENSION_PROMPT_WARNING_SYSTEM_INDICATOR, PermissionMessage::kSystemIndicator }, { APIPermission::kPointerLock, "pointerLock" }, }; for (size_t i = 0; i < ARRAYSIZE_UNSAFE(PermissionsToRegister); ++i) { const PermissionRegistration& pr = PermissionsToRegister[i]; info->RegisterPermission( pr.id, pr.name, pr.l10n_message_id, pr.message_id ? pr.message_id : PermissionMessage::kNone, pr.flags, pr.constructor); } info->RegisterAlias("unlimitedStorage", kOldUnlimitedStoragePermission); info->RegisterAlias("tabs", kWindowsPermission); }
void APIPermissionInfo::RegisterAllPermissions( PermissionsInfo* info) { struct PermissionRegistration { APIPermission::ID id; const char* name; int flags; int l10n_message_id; PermissionMessage::ID message_id; APIPermissionConstructor constructor; } PermissionsToRegister[] = { { APIPermission::kBackground, "background" }, { APIPermission::kClipboardRead, "clipboardRead", kFlagNone, IDS_EXTENSION_PROMPT_WARNING_CLIPBOARD, PermissionMessage::kClipboard }, { APIPermission::kClipboardWrite, "clipboardWrite" }, { APIPermission::kDeclarativeWebRequest, "declarativeWebRequest" }, { APIPermission::kDownloads, "downloads", kFlagNone, IDS_EXTENSION_PROMPT_WARNING_DOWNLOADS, PermissionMessage::kDownloads }, { APIPermission::kExperimental, "experimental", kFlagCannotBeOptional }, { APIPermission::kGeolocation, "geolocation", kFlagCannotBeOptional, IDS_EXTENSION_PROMPT_WARNING_GEOLOCATION, PermissionMessage::kGeolocation }, { APIPermission::kNotification, "notifications" }, { APIPermission::kUnlimitedStorage, "unlimitedStorage", kFlagCannotBeOptional }, { APIPermission::kAppNotifications, "appNotifications" }, { APIPermission::kActiveTab, "activeTab" }, { APIPermission::kAlarms, "alarms" }, { APIPermission::kBookmark, "bookmarks", kFlagNone, IDS_EXTENSION_PROMPT_WARNING_BOOKMARKS, PermissionMessage::kBookmarks }, { APIPermission::kBrowsingData, "browsingData" }, { APIPermission::kContentSettings, "contentSettings", kFlagNone, IDS_EXTENSION_PROMPT_WARNING_CONTENT_SETTINGS, PermissionMessage::kContentSettings }, { APIPermission::kContextMenus, "contextMenus" }, { APIPermission::kCookie, "cookies" }, { APIPermission::kFileBrowserHandler, "fileBrowserHandler", kFlagCannotBeOptional }, { APIPermission::kFontSettings, "fontSettings", kFlagCannotBeOptional }, { APIPermission::kHistory, "history", kFlagNone, IDS_EXTENSION_PROMPT_WARNING_BROWSING_HISTORY, PermissionMessage::kBrowsingHistory }, { APIPermission::kIdle, "idle" }, { APIPermission::kInput, "input", kFlagNone, IDS_EXTENSION_PROMPT_WARNING_INPUT, PermissionMessage::kInput }, { APIPermission::kManagement, "management", kFlagNone, IDS_EXTENSION_PROMPT_WARNING_MANAGEMENT, PermissionMessage::kManagement }, { APIPermission::kPrivacy, "privacy", kFlagNone, IDS_EXTENSION_PROMPT_WARNING_PRIVACY, PermissionMessage::kPrivacy }, { APIPermission::kStorage, "storage" }, { APIPermission::kSyncFileSystem, "syncFileSystem" }, { APIPermission::kTab, "tabs", kFlagNone, IDS_EXTENSION_PROMPT_WARNING_TABS, PermissionMessage::kTabs }, { APIPermission::kTopSites, "topSites", kFlagNone, IDS_EXTENSION_PROMPT_WARNING_BROWSING_HISTORY, PermissionMessage::kBrowsingHistory }, { APIPermission::kTts, "tts", 0, kFlagCannotBeOptional }, { APIPermission::kTtsEngine, "ttsEngine", kFlagCannotBeOptional, IDS_EXTENSION_PROMPT_WARNING_TTS_ENGINE, PermissionMessage::kTtsEngine }, { APIPermission::kWebNavigation, "webNavigation", kFlagNone, IDS_EXTENSION_PROMPT_WARNING_TABS, PermissionMessage::kTabs }, { APIPermission::kWebRequest, "webRequest" }, { APIPermission::kWebRequestBlocking, "webRequestBlocking" }, { APIPermission::kWebView, "webview", kFlagCannotBeOptional }, { APIPermission::kBookmarkManagerPrivate, "bookmarkManagerPrivate", kFlagCannotBeOptional }, { APIPermission::kChromeosInfoPrivate, "chromeosInfoPrivate", kFlagCannotBeOptional }, { APIPermission::kFileBrowserHandlerInternal, "fileBrowserHandlerInternal", kFlagCannotBeOptional }, { APIPermission::kFileBrowserPrivate, "fileBrowserPrivate", kFlagCannotBeOptional }, { APIPermission::kManagedModePrivate, "managedModePrivate", kFlagCannotBeOptional }, { APIPermission::kMediaPlayerPrivate, "mediaPlayerPrivate", kFlagCannotBeOptional }, { APIPermission::kMetricsPrivate, "metricsPrivate", kFlagCannotBeOptional }, { APIPermission::kSystemPrivate, "systemPrivate", kFlagCannotBeOptional }, { APIPermission::kCloudPrintPrivate, "cloudPrintPrivate", kFlagCannotBeOptional }, { APIPermission::kInputMethodPrivate, "inputMethodPrivate", kFlagCannotBeOptional }, { APIPermission::kEchoPrivate, "echoPrivate", kFlagCannotBeOptional }, { APIPermission::kRtcPrivate, "rtcPrivate", kFlagCannotBeOptional }, { APIPermission::kTerminalPrivate, "terminalPrivate", kFlagCannotBeOptional }, { APIPermission::kWallpaperPrivate, "wallpaperPrivate", kFlagCannotBeOptional }, { APIPermission::kWebRequestInternal, "webRequestInternal" }, { APIPermission::kWebSocketProxyPrivate, "webSocketProxyPrivate", kFlagCannotBeOptional }, { APIPermission::kWebstorePrivate, "webstorePrivate", kFlagCannotBeOptional }, { APIPermission::kMediaGalleriesPrivate, "mediaGalleriesPrivate", kFlagCannotBeOptional }, { APIPermission::kDebugger, "debugger", kFlagImpliesFullURLAccess | kFlagCannotBeOptional, IDS_EXTENSION_PROMPT_WARNING_DEBUGGER, PermissionMessage::kDebugger }, { APIPermission::kDevtools, "devtools", kFlagImpliesFullURLAccess | kFlagCannotBeOptional }, { APIPermission::kPageCapture, "pageCapture", kFlagImpliesFullURLAccess }, { APIPermission::kTabCapture, "tabCapture", kFlagImpliesFullURLAccess }, { APIPermission::kPlugin, "plugin", kFlagImpliesFullURLAccess | kFlagImpliesFullAccess | kFlagCannotBeOptional, IDS_EXTENSION_PROMPT_WARNING_FULL_ACCESS, PermissionMessage::kFullAccess }, { APIPermission::kProxy, "proxy", kFlagImpliesFullURLAccess | kFlagCannotBeOptional }, { APIPermission::kSerial, "serial", kFlagNone, IDS_EXTENSION_PROMPT_WARNING_SERIAL, PermissionMessage::kSerial }, { APIPermission::kSocket, "socket", kFlagCannotBeOptional, 0, PermissionMessage::kNone, &::CreateAPIPermission<SocketPermission> }, { APIPermission::kAppCurrentWindowInternal, "app.currentWindowInternal" }, { APIPermission::kAppRuntime, "app.runtime" }, { APIPermission::kAppWindow, "app.window" }, { APIPermission::kAudioCapture, "audioCapture", kFlagNone, IDS_EXTENSION_PROMPT_WARNING_AUDIO_CAPTURE, PermissionMessage::kAudioCapture }, { APIPermission::kVideoCapture, "videoCapture", kFlagNone, IDS_EXTENSION_PROMPT_WARNING_VIDEO_CAPTURE, PermissionMessage::kVideoCapture }, { APIPermission::kFileSystem, "fileSystem" }, { APIPermission::kFileSystemWrite, "fileSystem.write", kFlagNone, IDS_EXTENSION_PROMPT_WARNING_FILE_SYSTEM_WRITE, PermissionMessage::kFileSystemWrite }, { APIPermission::kMediaGalleries, "mediaGalleries" }, { APIPermission::kMediaGalleriesRead, "mediaGalleries.read" }, { APIPermission::kMediaGalleriesAllAutoDetected, "mediaGalleries.allAutoDetected", kFlagNone, IDS_EXTENSION_PROMPT_WARNING_MEDIA_GALLERIES_ALL_GALLERIES, PermissionMessage::kMediaGalleriesAllGalleries }, { APIPermission::kPushMessaging, "pushMessaging", kFlagCannotBeOptional }, { APIPermission::kBluetooth, "bluetooth", kFlagNone, IDS_EXTENSION_PROMPT_WARNING_BLUETOOTH, PermissionMessage::kBluetooth }, { APIPermission::kBluetoothDevice, "bluetoothDevice", kFlagNone, 0, PermissionMessage::kNone, &::CreateAPIPermission<BluetoothDevicePermission> }, { APIPermission::kUsb, "usb", kFlagNone, IDS_EXTENSION_PROMPT_WARNING_USB, PermissionMessage::kUsb }, { APIPermission::kSystemIndicator, "systemIndicator", kFlagNone, IDS_EXTENSION_PROMPT_WARNING_SYSTEM_INDICATOR, PermissionMessage::kSystemIndicator }, { APIPermission::kPointerLock, "pointerLock" }, }; for (size_t i = 0; i < ARRAYSIZE_UNSAFE(PermissionsToRegister); ++i) { const PermissionRegistration& pr = PermissionsToRegister[i]; info->RegisterPermission( pr.id, pr.name, pr.l10n_message_id, pr.message_id ? pr.message_id : PermissionMessage::kNone, pr.flags, pr.constructor); } info->RegisterAlias("unlimitedStorage", kOldUnlimitedStoragePermission); info->RegisterAlias("tabs", kWindowsPermission); }
C
Chrome
1
CVE-2012-5148
https://www.cvedetails.com/cve/CVE-2012-5148/
CWE-20
https://github.com/chromium/chromium/commit/e89cfcb9090e8c98129ae9160c513f504db74599
e89cfcb9090e8c98129ae9160c513f504db74599
Remove TabContents from TabStripModelObserver::TabDetachedAt. BUG=107201 TEST=no visible change Review URL: https://chromiumcodereview.appspot.com/11293205 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@167122 0039d316-1c4b-4281-b951-d872f2087c98
void BrowserTabStripController::CloseTab(int model_index, CloseTabSource source) { hover_tab_selector_.CancelTabTransition(); tabstrip_->PrepareForCloseAt(model_index, source); model_->CloseTabContentsAt(model_index, TabStripModel::CLOSE_USER_GESTURE | TabStripModel::CLOSE_CREATE_HISTORICAL_TAB); }
void BrowserTabStripController::CloseTab(int model_index, CloseTabSource source) { hover_tab_selector_.CancelTabTransition(); tabstrip_->PrepareForCloseAt(model_index, source); model_->CloseTabContentsAt(model_index, TabStripModel::CLOSE_USER_GESTURE | TabStripModel::CLOSE_CREATE_HISTORICAL_TAB); }
C
Chrome
0
CVE-2016-3695
https://www.cvedetails.com/cve/CVE-2016-3695/
CWE-74
https://github.com/mjg59/linux/commit/d7a6be58edc01b1c66ecd8fcc91236bfbce0a420
d7a6be58edc01b1c66ecd8fcc91236bfbce0a420
acpi: Disable APEI error injection if securelevel is set ACPI provides an error injection mechanism, EINJ, for debugging and testing the ACPI Platform Error Interface (APEI) and other RAS features. If supported by the firmware, ACPI specification 5.0 and later provide for a way to specify a physical memory address to which to inject the error. Injecting errors through EINJ can produce errors which to the platform are indistinguishable from real hardware errors. This can have undesirable side-effects, such as causing the platform to mark hardware as needing replacement. While it does not provide a method to load unauthenticated privileged code, the effect of these errors may persist across reboots and affect trust in the underlying hardware, so disable error injection through EINJ if securelevel is set. Signed-off-by: Linn Crosetto <[email protected]>
static int error_inject_set(void *data, u64 val) { if (!error_type) return -EINVAL; return einj_error_inject(error_type, error_flags, error_param1, error_param2, error_param3, error_param4); }
static int error_inject_set(void *data, u64 val) { if (!error_type) return -EINVAL; return einj_error_inject(error_type, error_flags, error_param1, error_param2, error_param3, error_param4); }
C
linux
0
CVE-2017-6903
https://www.cvedetails.com/cve/CVE-2017-6903/
CWE-269
https://github.com/ioquake/ioq3/commit/376267d534476a875d8b9228149c4ee18b74a4fd
376267d534476a875d8b9228149c4ee18b74a4fd
Don't load .pk3s as .dlls, and don't load user config files from .pk3s.
void *Sys_LoadGameDll(const char *name, intptr_t (QDECL **entryPoint)(int, ...), intptr_t (*systemcalls)(intptr_t, ...)) { void *libHandle; void (*dllEntry)(intptr_t (*syscallptr)(intptr_t, ...)); assert(name); Com_Printf( "Loading DLL file: %s\n", name); libHandle = Sys_LoadLibrary(name); if(!libHandle) { Com_Printf("Sys_LoadGameDll(%s) failed:\n\"%s\"\n", name, Sys_LibraryError()); return NULL; } dllEntry = Sys_LoadFunction( libHandle, "dllEntry" ); *entryPoint = Sys_LoadFunction( libHandle, "vmMain" ); if ( !*entryPoint || !dllEntry ) { Com_Printf ( "Sys_LoadGameDll(%s) failed to find vmMain function:\n\"%s\" !\n", name, Sys_LibraryError( ) ); Sys_UnloadLibrary(libHandle); return NULL; } Com_Printf ( "Sys_LoadGameDll(%s) found vmMain function at %p\n", name, *entryPoint ); dllEntry( systemcalls ); return libHandle; }
void *Sys_LoadGameDll(const char *name, intptr_t (QDECL **entryPoint)(int, ...), intptr_t (*systemcalls)(intptr_t, ...)) { void *libHandle; void (*dllEntry)(intptr_t (*syscallptr)(intptr_t, ...)); assert(name); Com_Printf( "Loading DLL file: %s\n", name); libHandle = Sys_LoadLibrary(name); if(!libHandle) { Com_Printf("Sys_LoadGameDll(%s) failed:\n\"%s\"\n", name, Sys_LibraryError()); return NULL; } dllEntry = Sys_LoadFunction( libHandle, "dllEntry" ); *entryPoint = Sys_LoadFunction( libHandle, "vmMain" ); if ( !*entryPoint || !dllEntry ) { Com_Printf ( "Sys_LoadGameDll(%s) failed to find vmMain function:\n\"%s\" !\n", name, Sys_LibraryError( ) ); Sys_UnloadLibrary(libHandle); return NULL; } Com_Printf ( "Sys_LoadGameDll(%s) found vmMain function at %p\n", name, *entryPoint ); dllEntry( systemcalls ); return libHandle; }
C
OpenJK
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::OnWebContentsDestroyed(WebContentsImpl* web_contents) { RemoveDestructionObserver(web_contents); for (PendingContents::iterator iter = pending_contents_.begin(); iter != pending_contents_.end(); ++iter) { if (iter->second != web_contents) continue; pending_contents_.erase(iter); return; } NOTREACHED(); }
void WebContentsImpl::OnWebContentsDestroyed(WebContentsImpl* web_contents) { RemoveDestructionObserver(web_contents); for (PendingContents::iterator iter = pending_contents_.begin(); iter != pending_contents_.end(); ++iter) { if (iter->second != web_contents) continue; pending_contents_.erase(iter); return; } NOTREACHED(); }
C
Chrome
0
CVE-2013-2885
https://www.cvedetails.com/cve/CVE-2013-2885/
CWE-399
https://github.com/chromium/chromium/commit/79cfdeb5fbe79fa2604d37fba467f371cb436bc3
79cfdeb5fbe79fa2604d37fba467f371cb436bc3
Fix reentrance of BaseMultipleFieldsDateAndTimeInputType::destroyShadowSubtree. destroyShadowSubtree could dispatch 'blur' event unexpectedly because element()->focused() had incorrect information. We make sure it has correct information by checking if the UA shadow root contains the focused element. BUG=257353 Review URL: https://chromiumcodereview.appspot.com/19067004 git-svn-id: svn://svn.chromium.org/blink/trunk@154086 bbb929c8-8fbe-4397-9dbb-9b2b20218538
DateTimeFormatValidator() : m_hasYear(false) , m_hasMonth(false) , m_hasWeek(false) , m_hasDay(false) , m_hasAMPM(false) , m_hasHour(false) , m_hasMinute(false) , m_hasSecond(false) { }
DateTimeFormatValidator() : m_hasYear(false) , m_hasMonth(false) , m_hasWeek(false) , m_hasDay(false) , m_hasAMPM(false) , m_hasHour(false) , m_hasMinute(false) , m_hasSecond(false) { }
C
Chrome
0
CVE-2018-6038
https://www.cvedetails.com/cve/CVE-2018-6038/
CWE-125
https://github.com/chromium/chromium/commit/9b99a43fc119a2533a87e2357cad8f603779a7b9
9b99a43fc119a2533a87e2357cad8f603779a7b9
Implement 2D texture uploading from client array with FLIP_Y or PREMULTIPLY_ALPHA. BUG=774174 TEST=https://github.com/KhronosGroup/WebGL/pull/2555 [email protected] Cq-Include-Trybots: master.tryserver.chromium.android:android_optional_gpu_tests_rel;master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2;master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel Change-Id: I4f4e7636314502451104730501a5048a5d7b9f3f Reviewed-on: https://chromium-review.googlesource.com/808665 Commit-Queue: Zhenyao Mo <[email protected]> Reviewed-by: Kenneth Russell <[email protected]> Cr-Commit-Position: refs/heads/master@{#522003}
void Pack<WebGLImageConversion::kDataFormatRG32F, WebGLImageConversion::kAlphaDoNothing, float, float>(const float* source, float* destination, unsigned pixels_per_row) { for (unsigned i = 0; i < pixels_per_row; ++i) { destination[0] = source[0]; destination[1] = source[1]; source += 4; destination += 2; } }
void Pack<WebGLImageConversion::kDataFormatRG32F, WebGLImageConversion::kAlphaDoNothing, float, float>(const float* source, float* destination, unsigned pixels_per_row) { for (unsigned i = 0; i < pixels_per_row; ++i) { destination[0] = source[0]; destination[1] = source[1]; source += 4; destination += 2; } }
C
Chrome
0
CVE-2016-1586
https://www.cvedetails.com/cve/CVE-2016-1586/
CWE-20
https://git.launchpad.net/oxide/commit/?id=29014da83e5fc358d6bff0f574e9ed45e61a35ac
29014da83e5fc358d6bff0f574e9ed45e61a35ac
null
void OxideQQuickWebView::setContextMenu(QQmlComponent* contextMenu) { Q_D(OxideQQuickWebView); if (d->contents_view_->contextMenu() == contextMenu) { return; } d->contents_view_->setContextMenu(contextMenu); emit contextMenuChanged(); }
void OxideQQuickWebView::setContextMenu(QQmlComponent* contextMenu) { Q_D(OxideQQuickWebView); if (d->contents_view_->contextMenu() == contextMenu) { return; } d->contents_view_->setContextMenu(contextMenu); emit contextMenuChanged(); }
CPP
launchpad
0
CVE-2013-6622
https://www.cvedetails.com/cve/CVE-2013-6622/
CWE-399
https://github.com/chromium/chromium/commit/438b99bc730bc665eedfc62c4eb864c981e5c65f
438b99bc730bc665eedfc62c4eb864c981e5c65f
Remove --disable-app-shims. App shims have been enabled by default for 3 milestones (since r242711). BUG=350161 Review URL: https://codereview.chromium.org/298953002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@272786 0039d316-1c4b-4281-b951-d872f2087c98
AppShortcutManager::~AppShortcutManager() { if (g_browser_process && is_profile_info_cache_observer_) { ProfileManager* profile_manager = g_browser_process->profile_manager(); if (profile_manager) profile_manager->GetProfileInfoCache().RemoveObserver(this); } }
AppShortcutManager::~AppShortcutManager() { if (g_browser_process && is_profile_info_cache_observer_) { ProfileManager* profile_manager = g_browser_process->profile_manager(); if (profile_manager) profile_manager->GetProfileInfoCache().RemoveObserver(this); } }
C
Chrome
0
CVE-2015-1265
https://www.cvedetails.com/cve/CVE-2015-1265/
null
https://github.com/chromium/chromium/commit/7c28e7988fef9bb3e03027226bd199736d99abc3
7c28e7988fef9bb3e03027226bd199736d99abc3
Add PersistenceDelegate to HostCache PersistenceDelegate is a new interface for persisting the contents of the HostCache. This commit includes the interface itself, the logic in HostCache for interacting with it, and a mock implementation of the interface for testing. It does not include support for immediate data removal since that won't be needed for the currently planned use case. BUG=605149 Review-Url: https://codereview.chromium.org/2943143002 Cr-Commit-Position: refs/heads/master@{#481015}
const HostCache::Entry* HostCache::Lookup(const Key& key, base::TimeTicks now) { DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); if (caching_is_disabled()) return nullptr; HostCache::Entry* entry = LookupInternal(key); if (!entry) { RecordLookup(LOOKUP_MISS_ABSENT, now, nullptr); return nullptr; } if (entry->IsStale(now, network_changes_)) { RecordLookup(LOOKUP_MISS_STALE, now, entry); return nullptr; } entry->CountHit(/* hit_is_stale= */ false); RecordLookup(LOOKUP_HIT_VALID, now, entry); return entry; }
const HostCache::Entry* HostCache::Lookup(const Key& key, base::TimeTicks now) { DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); if (caching_is_disabled()) return nullptr; HostCache::Entry* entry = LookupInternal(key); if (!entry) { RecordLookup(LOOKUP_MISS_ABSENT, now, nullptr); return nullptr; } if (entry->IsStale(now, network_changes_)) { RecordLookup(LOOKUP_MISS_STALE, now, entry); return nullptr; } entry->CountHit(/* hit_is_stale= */ false); RecordLookup(LOOKUP_HIT_VALID, now, entry); return entry; }
C
Chrome
0
CVE-2011-4594
https://www.cvedetails.com/cve/CVE-2011-4594/
null
https://github.com/torvalds/linux/commit/bc909d9ddbf7778371e36a651d6e4194b1cc7d4c
bc909d9ddbf7778371e36a651d6e4194b1cc7d4c
sendmmsg/sendmsg: fix unsafe user pointer access Dereferencing a user pointer directly from kernel-space without going through the copy_from_user family of functions is a bad idea. Two of such usages can be found in the sendmsg code path called from sendmmsg, added by commit c71d8ebe7a4496fb7231151cb70a6baa0cb56f9a upstream. commit 5b47b8038f183b44d2d8ff1c7d11a5c1be706b34 in the 3.0-stable tree. Usages are performed through memcmp() and memcpy() directly. Fix those by using the already copied msg_sys structure instead of the __user *msg structure. Note that msg_sys can be set to NULL by verify_compat_iovec() or verify_iovec(), which requires additional NULL pointer checks. Signed-off-by: Mathieu Desnoyers <[email protected]> Signed-off-by: David Goulet <[email protected]> CC: Tetsuo Handa <[email protected]> CC: Anton Blanchard <[email protected]> CC: David S. Miller <[email protected]> CC: stable <[email protected]> Signed-off-by: David S. Miller <[email protected]>
static int compat_sock_ioctl_trans(struct file *file, struct socket *sock, unsigned int cmd, unsigned long arg) { void __user *argp = compat_ptr(arg); struct sock *sk = sock->sk; struct net *net = sock_net(sk); if (cmd >= SIOCDEVPRIVATE && cmd <= (SIOCDEVPRIVATE + 15)) return siocdevprivate_ioctl(net, cmd, argp); switch (cmd) { case SIOCSIFBR: case SIOCGIFBR: return old_bridge_ioctl(argp); case SIOCGIFNAME: return dev_ifname32(net, argp); case SIOCGIFCONF: return dev_ifconf(net, argp); case SIOCETHTOOL: return ethtool_ioctl(net, argp); case SIOCWANDEV: return compat_siocwandev(net, argp); case SIOCGIFMAP: case SIOCSIFMAP: return compat_sioc_ifmap(net, cmd, argp); case SIOCBONDENSLAVE: case SIOCBONDRELEASE: case SIOCBONDSETHWADDR: case SIOCBONDSLAVEINFOQUERY: case SIOCBONDINFOQUERY: case SIOCBONDCHANGEACTIVE: return bond_ioctl(net, cmd, argp); case SIOCADDRT: case SIOCDELRT: return routing_ioctl(net, sock, cmd, argp); case SIOCGSTAMP: return do_siocgstamp(net, sock, cmd, argp); case SIOCGSTAMPNS: return do_siocgstampns(net, sock, cmd, argp); case SIOCSHWTSTAMP: return compat_siocshwtstamp(net, argp); case FIOSETOWN: case SIOCSPGRP: case FIOGETOWN: case SIOCGPGRP: case SIOCBRADDBR: case SIOCBRDELBR: case SIOCGIFVLAN: case SIOCSIFVLAN: case SIOCADDDLCI: case SIOCDELDLCI: return sock_ioctl(file, cmd, arg); case SIOCGIFFLAGS: case SIOCSIFFLAGS: case SIOCGIFMETRIC: case SIOCSIFMETRIC: case SIOCGIFMTU: case SIOCSIFMTU: case SIOCGIFMEM: case SIOCSIFMEM: case SIOCGIFHWADDR: case SIOCSIFHWADDR: case SIOCADDMULTI: case SIOCDELMULTI: case SIOCGIFINDEX: case SIOCGIFADDR: case SIOCSIFADDR: case SIOCSIFHWBROADCAST: case SIOCDIFADDR: case SIOCGIFBRDADDR: case SIOCSIFBRDADDR: case SIOCGIFDSTADDR: case SIOCSIFDSTADDR: case SIOCGIFNETMASK: case SIOCSIFNETMASK: case SIOCSIFPFLAGS: case SIOCGIFPFLAGS: case SIOCGIFTXQLEN: case SIOCSIFTXQLEN: case SIOCBRADDIF: case SIOCBRDELIF: case SIOCSIFNAME: case SIOCGMIIPHY: case SIOCGMIIREG: case SIOCSMIIREG: return dev_ifsioc(net, sock, cmd, argp); case SIOCSARP: case SIOCGARP: case SIOCDARP: case SIOCATMARK: return sock_do_ioctl(net, sock, cmd, arg); } /* Prevent warning from compat_sys_ioctl, these always * result in -EINVAL in the native case anyway. */ switch (cmd) { case SIOCRTMSG: case SIOCGIFCOUNT: case SIOCSRARP: case SIOCGRARP: case SIOCDRARP: case SIOCSIFLINK: case SIOCGIFSLAVE: case SIOCSIFSLAVE: return -EINVAL; } return -ENOIOCTLCMD; }
static int compat_sock_ioctl_trans(struct file *file, struct socket *sock, unsigned int cmd, unsigned long arg) { void __user *argp = compat_ptr(arg); struct sock *sk = sock->sk; struct net *net = sock_net(sk); if (cmd >= SIOCDEVPRIVATE && cmd <= (SIOCDEVPRIVATE + 15)) return siocdevprivate_ioctl(net, cmd, argp); switch (cmd) { case SIOCSIFBR: case SIOCGIFBR: return old_bridge_ioctl(argp); case SIOCGIFNAME: return dev_ifname32(net, argp); case SIOCGIFCONF: return dev_ifconf(net, argp); case SIOCETHTOOL: return ethtool_ioctl(net, argp); case SIOCWANDEV: return compat_siocwandev(net, argp); case SIOCGIFMAP: case SIOCSIFMAP: return compat_sioc_ifmap(net, cmd, argp); case SIOCBONDENSLAVE: case SIOCBONDRELEASE: case SIOCBONDSETHWADDR: case SIOCBONDSLAVEINFOQUERY: case SIOCBONDINFOQUERY: case SIOCBONDCHANGEACTIVE: return bond_ioctl(net, cmd, argp); case SIOCADDRT: case SIOCDELRT: return routing_ioctl(net, sock, cmd, argp); case SIOCGSTAMP: return do_siocgstamp(net, sock, cmd, argp); case SIOCGSTAMPNS: return do_siocgstampns(net, sock, cmd, argp); case SIOCSHWTSTAMP: return compat_siocshwtstamp(net, argp); case FIOSETOWN: case SIOCSPGRP: case FIOGETOWN: case SIOCGPGRP: case SIOCBRADDBR: case SIOCBRDELBR: case SIOCGIFVLAN: case SIOCSIFVLAN: case SIOCADDDLCI: case SIOCDELDLCI: return sock_ioctl(file, cmd, arg); case SIOCGIFFLAGS: case SIOCSIFFLAGS: case SIOCGIFMETRIC: case SIOCSIFMETRIC: case SIOCGIFMTU: case SIOCSIFMTU: case SIOCGIFMEM: case SIOCSIFMEM: case SIOCGIFHWADDR: case SIOCSIFHWADDR: case SIOCADDMULTI: case SIOCDELMULTI: case SIOCGIFINDEX: case SIOCGIFADDR: case SIOCSIFADDR: case SIOCSIFHWBROADCAST: case SIOCDIFADDR: case SIOCGIFBRDADDR: case SIOCSIFBRDADDR: case SIOCGIFDSTADDR: case SIOCSIFDSTADDR: case SIOCGIFNETMASK: case SIOCSIFNETMASK: case SIOCSIFPFLAGS: case SIOCGIFPFLAGS: case SIOCGIFTXQLEN: case SIOCSIFTXQLEN: case SIOCBRADDIF: case SIOCBRDELIF: case SIOCSIFNAME: case SIOCGMIIPHY: case SIOCGMIIREG: case SIOCSMIIREG: return dev_ifsioc(net, sock, cmd, argp); case SIOCSARP: case SIOCGARP: case SIOCDARP: case SIOCATMARK: return sock_do_ioctl(net, sock, cmd, arg); } /* Prevent warning from compat_sys_ioctl, these always * result in -EINVAL in the native case anyway. */ switch (cmd) { case SIOCRTMSG: case SIOCGIFCOUNT: case SIOCSRARP: case SIOCGRARP: case SIOCDRARP: case SIOCSIFLINK: case SIOCGIFSLAVE: case SIOCSIFSLAVE: return -EINVAL; } return -ENOIOCTLCMD; }
C
linux
0
CVE-2012-5147
https://www.cvedetails.com/cve/CVE-2012-5147/
CWE-399
https://github.com/chromium/chromium/commit/9c0b13574dc0ddeb502d7ed92ba10f7981da6736
9c0b13574dc0ddeb502d7ed92ba10f7981da6736
Add QuicStream and friends to QUIC code. Fix bug in tests that caused failures. Revert 165859 First Landed as 165858 Review URL: https://chromiumcodereview.appspot.com/11367082 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@165864 0039d316-1c4b-4281-b951-d872f2087c98
MockFramerVisitor::~MockFramerVisitor() {}
MockFramerVisitor::~MockFramerVisitor() {}
C
Chrome
0
CVE-2018-12714
https://www.cvedetails.com/cve/CVE-2018-12714/
CWE-787
https://github.com/torvalds/linux/commit/81f9c4e4177d31ced6f52a89bb70e93bfb77ca03
81f9c4e4177d31ced6f52a89bb70e93bfb77ca03
Merge tag 'trace-v4.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace Pull tracing fixes from Steven Rostedt: "This contains a few fixes and a clean up. - a bad merge caused an "endif" to go in the wrong place in scripts/Makefile.build - softirq tracing fix for tracing that corrupts lockdep and causes a false splat - histogram documentation typo fixes - fix a bad memory reference when passing in no filter to the filter code - simplify code by using the swap macro instead of open coding the swap" * tag 'trace-v4.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace: tracing: Fix SKIP_STACK_VALIDATION=1 build due to bad merge with -mrecord-mcount tracing: Fix some errors in histogram documentation tracing: Use swap macro in update_max_tr softirq: Reorder trace_softirqs_on to prevent lockdep splat tracing: Check for no filter when processing event filters
static int tracing_set_tracer(struct trace_array *tr, const char *buf) { struct tracer *t; #ifdef CONFIG_TRACER_MAX_TRACE bool had_max_tr; #endif int ret = 0; mutex_lock(&trace_types_lock); if (!ring_buffer_expanded) { ret = __tracing_resize_ring_buffer(tr, trace_buf_size, RING_BUFFER_ALL_CPUS); if (ret < 0) goto out; ret = 0; } for (t = trace_types; t; t = t->next) { if (strcmp(t->name, buf) == 0) break; } if (!t) { ret = -EINVAL; goto out; } if (t == tr->current_trace) goto out; /* Some tracers won't work on kernel command line */ if (system_state < SYSTEM_RUNNING && t->noboot) { pr_warn("Tracer '%s' is not allowed on command line, ignored\n", t->name); goto out; } /* Some tracers are only allowed for the top level buffer */ if (!trace_ok_for_array(t, tr)) { ret = -EINVAL; goto out; } /* If trace pipe files are being read, we can't change the tracer */ if (tr->current_trace->ref) { ret = -EBUSY; goto out; } trace_branch_disable(); tr->current_trace->enabled--; if (tr->current_trace->reset) tr->current_trace->reset(tr); /* Current trace needs to be nop_trace before synchronize_sched */ tr->current_trace = &nop_trace; #ifdef CONFIG_TRACER_MAX_TRACE had_max_tr = tr->allocated_snapshot; if (had_max_tr && !t->use_max_tr) { /* * We need to make sure that the update_max_tr sees that * current_trace changed to nop_trace to keep it from * swapping the buffers after we resize it. * The update_max_tr is called from interrupts disabled * so a synchronized_sched() is sufficient. */ synchronize_sched(); free_snapshot(tr); } #endif #ifdef CONFIG_TRACER_MAX_TRACE if (t->use_max_tr && !had_max_tr) { ret = tracing_alloc_snapshot_instance(tr); if (ret < 0) goto out; } #endif if (t->init) { ret = tracer_init(t, tr); if (ret) goto out; } tr->current_trace = t; tr->current_trace->enabled++; trace_branch_enable(tr); out: mutex_unlock(&trace_types_lock); return ret; }
static int tracing_set_tracer(struct trace_array *tr, const char *buf) { struct tracer *t; #ifdef CONFIG_TRACER_MAX_TRACE bool had_max_tr; #endif int ret = 0; mutex_lock(&trace_types_lock); if (!ring_buffer_expanded) { ret = __tracing_resize_ring_buffer(tr, trace_buf_size, RING_BUFFER_ALL_CPUS); if (ret < 0) goto out; ret = 0; } for (t = trace_types; t; t = t->next) { if (strcmp(t->name, buf) == 0) break; } if (!t) { ret = -EINVAL; goto out; } if (t == tr->current_trace) goto out; /* Some tracers won't work on kernel command line */ if (system_state < SYSTEM_RUNNING && t->noboot) { pr_warn("Tracer '%s' is not allowed on command line, ignored\n", t->name); goto out; } /* Some tracers are only allowed for the top level buffer */ if (!trace_ok_for_array(t, tr)) { ret = -EINVAL; goto out; } /* If trace pipe files are being read, we can't change the tracer */ if (tr->current_trace->ref) { ret = -EBUSY; goto out; } trace_branch_disable(); tr->current_trace->enabled--; if (tr->current_trace->reset) tr->current_trace->reset(tr); /* Current trace needs to be nop_trace before synchronize_sched */ tr->current_trace = &nop_trace; #ifdef CONFIG_TRACER_MAX_TRACE had_max_tr = tr->allocated_snapshot; if (had_max_tr && !t->use_max_tr) { /* * We need to make sure that the update_max_tr sees that * current_trace changed to nop_trace to keep it from * swapping the buffers after we resize it. * The update_max_tr is called from interrupts disabled * so a synchronized_sched() is sufficient. */ synchronize_sched(); free_snapshot(tr); } #endif #ifdef CONFIG_TRACER_MAX_TRACE if (t->use_max_tr && !had_max_tr) { ret = tracing_alloc_snapshot_instance(tr); if (ret < 0) goto out; } #endif if (t->init) { ret = tracer_init(t, tr); if (ret) goto out; } tr->current_trace = t; tr->current_trace->enabled++; trace_branch_enable(tr); out: mutex_unlock(&trace_types_lock); return ret; }
C
linux
0
CVE-2011-2918
https://www.cvedetails.com/cve/CVE-2011-2918/
CWE-399
https://github.com/torvalds/linux/commit/a8b0ca17b80e92faab46ee7179ba9e99ccb61233
a8b0ca17b80e92faab46ee7179ba9e99ccb61233
perf: Remove the nmi parameter from the swevent and overflow interface The nmi parameter indicated if we could do wakeups from the current context, if not, we would set some state and self-IPI and let the resulting interrupt do the wakeup. For the various event classes: - hardware: nmi=0; PMI is in fact an NMI or we run irq_work_run from the PMI-tail (ARM etc.) - tracepoint: nmi=0; since tracepoint could be from NMI context. - software: nmi=[0,1]; some, like the schedule thing cannot perform wakeups, and hence need 0. As one can see, there is very little nmi=1 usage, and the down-side of not using it is that on some platforms some software events can have a jiffy delay in wakeup (when arch_irq_work_raise isn't implemented). The up-side however is that we can remove the nmi parameter and save a bunch of conditionals in fast paths. Signed-off-by: Peter Zijlstra <[email protected]> Cc: Michael Cree <[email protected]> Cc: Will Deacon <[email protected]> Cc: Deng-Cheng Zhu <[email protected]> Cc: Anton Blanchard <[email protected]> Cc: Eric B Munson <[email protected]> Cc: Heiko Carstens <[email protected]> Cc: Paul Mundt <[email protected]> Cc: David S. Miller <[email protected]> Cc: Frederic Weisbecker <[email protected]> Cc: Jason Wessel <[email protected]> Cc: Don Zickus <[email protected]> Link: http://lkml.kernel.org/n/[email protected] Signed-off-by: Ingo Molnar <[email protected]>
static int putreg(struct task_struct *child, unsigned long offset, unsigned long value) { switch (offset) { case offsetof(struct user_regs_struct, cs): case offsetof(struct user_regs_struct, ds): case offsetof(struct user_regs_struct, es): case offsetof(struct user_regs_struct, fs): case offsetof(struct user_regs_struct, gs): case offsetof(struct user_regs_struct, ss): return set_segment_reg(child, offset, value); case offsetof(struct user_regs_struct, flags): return set_flags(child, value); #ifdef CONFIG_X86_64 case offsetof(struct user_regs_struct,fs_base): if (value >= TASK_SIZE_OF(child)) return -EIO; /* * When changing the segment base, use do_arch_prctl * to set either thread.fs or thread.fsindex and the * corresponding GDT slot. */ if (child->thread.fs != value) return do_arch_prctl(child, ARCH_SET_FS, value); return 0; case offsetof(struct user_regs_struct,gs_base): /* * Exactly the same here as the %fs handling above. */ if (value >= TASK_SIZE_OF(child)) return -EIO; if (child->thread.gs != value) return do_arch_prctl(child, ARCH_SET_GS, value); return 0; #endif } *pt_regs_access(task_pt_regs(child), offset) = value; return 0; }
static int putreg(struct task_struct *child, unsigned long offset, unsigned long value) { switch (offset) { case offsetof(struct user_regs_struct, cs): case offsetof(struct user_regs_struct, ds): case offsetof(struct user_regs_struct, es): case offsetof(struct user_regs_struct, fs): case offsetof(struct user_regs_struct, gs): case offsetof(struct user_regs_struct, ss): return set_segment_reg(child, offset, value); case offsetof(struct user_regs_struct, flags): return set_flags(child, value); #ifdef CONFIG_X86_64 case offsetof(struct user_regs_struct,fs_base): if (value >= TASK_SIZE_OF(child)) return -EIO; /* * When changing the segment base, use do_arch_prctl * to set either thread.fs or thread.fsindex and the * corresponding GDT slot. */ if (child->thread.fs != value) return do_arch_prctl(child, ARCH_SET_FS, value); return 0; case offsetof(struct user_regs_struct,gs_base): /* * Exactly the same here as the %fs handling above. */ if (value >= TASK_SIZE_OF(child)) return -EIO; if (child->thread.gs != value) return do_arch_prctl(child, ARCH_SET_GS, value); return 0; #endif } *pt_regs_access(task_pt_regs(child), offset) = value; return 0; }
C
linux
0
CVE-2016-0849
https://www.cvedetails.com/cve/CVE-2016-0849/
CWE-189
https://android.googlesource.com/platform/bootable/recovery/+/28a566f7731b4cb76d2a9ba16d997ac5aeb07dad
28a566f7731b4cb76d2a9ba16d997ac5aeb07dad
Fix integer overflows in recovery procedure. Bug: 26960931 Change-Id: Ieae45caccfb4728fcf514f0d920976585d8e6caf (cherry picked from commit 4f2df162c6ab4a71ca86e4b38735b681729c353b)
int sysMapFile(const char* fn, MemMapping* pMap) { memset(pMap, 0, sizeof(*pMap)); if (fn && fn[0] == '@') { FILE* mapf = fopen(fn+1, "r"); if (mapf == NULL) { LOGV("Unable to open '%s': %s\n", fn+1, strerror(errno)); return -1; } if (sysMapBlockFile(mapf, pMap) != 0) { LOGW("Map of '%s' failed\n", fn); fclose(mapf); return -1; } fclose(mapf); } else { int fd = open(fn, O_RDONLY, 0); if (fd < 0) { LOGE("Unable to open '%s': %s\n", fn, strerror(errno)); return -1; } if (sysMapFD(fd, pMap) != 0) { LOGE("Map of '%s' failed\n", fn); close(fd); return -1; } close(fd); } return 0; }
int sysMapFile(const char* fn, MemMapping* pMap) { memset(pMap, 0, sizeof(*pMap)); if (fn && fn[0] == '@') { FILE* mapf = fopen(fn+1, "r"); if (mapf == NULL) { LOGV("Unable to open '%s': %s\n", fn+1, strerror(errno)); return -1; } if (sysMapBlockFile(mapf, pMap) != 0) { LOGW("Map of '%s' failed\n", fn); return -1; } fclose(mapf); } else { int fd = open(fn, O_RDONLY, 0); if (fd < 0) { LOGE("Unable to open '%s': %s\n", fn, strerror(errno)); return -1; } if (sysMapFD(fd, pMap) != 0) { LOGE("Map of '%s' failed\n", fn); close(fd); return -1; } close(fd); } return 0; }
C
Android
1
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
static void *merge_core_dir_configs(apr_pool_t *a, void *basev, void *newv) { core_dir_config *base = (core_dir_config *)basev; core_dir_config *new = (core_dir_config *)newv; core_dir_config *conf; /* Create this conf by duplicating the base, replacing elements * (or creating copies for merging) where new-> values exist. */ conf = (core_dir_config *)apr_pmemdup(a, base, sizeof(core_dir_config)); conf->d = new->d; conf->d_is_fnmatch = new->d_is_fnmatch; conf->d_components = new->d_components; conf->r = new->r; conf->refs = new->refs; conf->condition = new->condition; if (new->opts & OPT_UNSET) { /* there was no explicit setting of new->opts, so we merge * preserve the invariant (opts_add & opts_remove) == 0 */ conf->opts_add = (conf->opts_add & ~new->opts_remove) | new->opts_add; conf->opts_remove = (conf->opts_remove & ~new->opts_add) | new->opts_remove; conf->opts = (conf->opts & ~conf->opts_remove) | conf->opts_add; /* If Includes was enabled with exec in the base config, but * was enabled without exec in the new config, then disable * exec in the merged set. */ if (((base->opts & (OPT_INCLUDES|OPT_INC_WITH_EXEC)) == (OPT_INCLUDES|OPT_INC_WITH_EXEC)) && ((new->opts & (OPT_INCLUDES|OPT_INC_WITH_EXEC)) == OPT_INCLUDES)) { conf->opts &= ~OPT_INC_WITH_EXEC; } } else { /* otherwise we just copy, because an explicit opts setting * overrides all earlier +/- modifiers */ conf->opts = new->opts; conf->opts_add = new->opts_add; conf->opts_remove = new->opts_remove; } if (!(new->override & OR_UNSET)) { conf->override = new->override; } if (!(new->override_opts & OPT_UNSET)) { conf->override_opts = new->override_opts; } if (new->override_list != NULL) { conf->override_list = new->override_list; } if (conf->response_code_exprs == NULL) { conf->response_code_exprs = new->response_code_exprs; } else if (new->response_code_exprs != NULL) { conf->response_code_exprs = apr_hash_overlay(a, new->response_code_exprs, conf->response_code_exprs); } /* Otherwise we simply use the base->response_code_exprs array */ if (new->hostname_lookups != HOSTNAME_LOOKUP_UNSET) { conf->hostname_lookups = new->hostname_lookups; } if (new->content_md5 != AP_CONTENT_MD5_UNSET) { conf->content_md5 = new->content_md5; } if (new->accept_path_info != AP_ACCEPT_PATHINFO_UNSET) { conf->accept_path_info = new->accept_path_info; } if (new->use_canonical_name != USE_CANONICAL_NAME_UNSET) { conf->use_canonical_name = new->use_canonical_name; } if (new->use_canonical_phys_port != USE_CANONICAL_PHYS_PORT_UNSET) { conf->use_canonical_phys_port = new->use_canonical_phys_port; } #ifdef RLIMIT_CPU if (new->limit_cpu) { conf->limit_cpu = new->limit_cpu; } #endif #if defined(RLIMIT_DATA) || defined(RLIMIT_VMEM) || defined(RLIMIT_AS) if (new->limit_mem) { conf->limit_mem = new->limit_mem; } #endif #ifdef RLIMIT_NPROC if (new->limit_nproc) { conf->limit_nproc = new->limit_nproc; } #endif if (new->limit_req_body != AP_LIMIT_REQ_BODY_UNSET) { conf->limit_req_body = new->limit_req_body; } if (new->limit_xml_body != AP_LIMIT_UNSET) conf->limit_xml_body = new->limit_xml_body; if (!conf->sec_file) { conf->sec_file = new->sec_file; } else if (new->sec_file) { /* If we merge, the merge-result must have its own array */ conf->sec_file = apr_array_append(a, base->sec_file, new->sec_file); } /* Otherwise we simply use the base->sec_file array */ if (!conf->sec_if) { conf->sec_if = new->sec_if; } else if (new->sec_if) { /* If we merge, the merge-result must have its own array */ conf->sec_if = apr_array_append(a, base->sec_if, new->sec_if); } /* Otherwise we simply use the base->sec_if array */ if (new->server_signature != srv_sig_unset) { conf->server_signature = new->server_signature; } if (new->add_default_charset != ADD_DEFAULT_CHARSET_UNSET) { conf->add_default_charset = new->add_default_charset; conf->add_default_charset_name = new->add_default_charset_name; } /* Overriding all negotiation */ if (new->mime_type) { conf->mime_type = new->mime_type; } if (new->handler) { conf->handler = new->handler; } if (new->expr_handler) { conf->expr_handler = new->expr_handler; } if (new->output_filters) { conf->output_filters = new->output_filters; } if (new->input_filters) { conf->input_filters = new->input_filters; } /* * Now merge the setting of the FileETag directive. */ if (new->etag_bits == ETAG_UNSET) { conf->etag_add = (conf->etag_add & (~ new->etag_remove)) | new->etag_add; conf->etag_remove = (conf->etag_remove & (~ new->etag_add)) | new->etag_remove; conf->etag_bits = (conf->etag_bits & (~ conf->etag_remove)) | conf->etag_add; } else { conf->etag_bits = new->etag_bits; conf->etag_add = new->etag_add; conf->etag_remove = new->etag_remove; } if (conf->etag_bits != ETAG_NONE) { conf->etag_bits &= (~ ETAG_NONE); } if (new->enable_mmap != ENABLE_MMAP_UNSET) { conf->enable_mmap = new->enable_mmap; } if (new->enable_sendfile != ENABLE_SENDFILE_UNSET) { conf->enable_sendfile = new->enable_sendfile; } if (new->allow_encoded_slashes_set) { conf->allow_encoded_slashes = new->allow_encoded_slashes; } if (new->decode_encoded_slashes_set) { conf->decode_encoded_slashes = new->decode_encoded_slashes; } if (new->log) { if (!conf->log) { conf->log = new->log; } else { conf->log = ap_new_log_config(a, new->log); ap_merge_log_config(base->log, conf->log); } } conf->max_ranges = new->max_ranges != AP_MAXRANGES_UNSET ? new->max_ranges : base->max_ranges; conf->max_overlaps = new->max_overlaps != AP_MAXRANGES_UNSET ? new->max_overlaps : base->max_overlaps; conf->max_reversals = new->max_reversals != AP_MAXRANGES_UNSET ? new->max_reversals : base->max_reversals; conf->cgi_pass_auth = new->cgi_pass_auth != AP_CGI_PASS_AUTH_UNSET ? new->cgi_pass_auth : base->cgi_pass_auth; if (new->cgi_var_rules) { if (!conf->cgi_var_rules) { conf->cgi_var_rules = new->cgi_var_rules; } else { conf->cgi_var_rules = apr_hash_overlay(a, new->cgi_var_rules, conf->cgi_var_rules); } } AP_CORE_MERGE_FLAG(qualify_redirect_url, conf, base, new); return (void*)conf; }
static void *merge_core_dir_configs(apr_pool_t *a, void *basev, void *newv) { core_dir_config *base = (core_dir_config *)basev; core_dir_config *new = (core_dir_config *)newv; core_dir_config *conf; /* Create this conf by duplicating the base, replacing elements * (or creating copies for merging) where new-> values exist. */ conf = (core_dir_config *)apr_pmemdup(a, base, sizeof(core_dir_config)); conf->d = new->d; conf->d_is_fnmatch = new->d_is_fnmatch; conf->d_components = new->d_components; conf->r = new->r; conf->refs = new->refs; conf->condition = new->condition; if (new->opts & OPT_UNSET) { /* there was no explicit setting of new->opts, so we merge * preserve the invariant (opts_add & opts_remove) == 0 */ conf->opts_add = (conf->opts_add & ~new->opts_remove) | new->opts_add; conf->opts_remove = (conf->opts_remove & ~new->opts_add) | new->opts_remove; conf->opts = (conf->opts & ~conf->opts_remove) | conf->opts_add; /* If Includes was enabled with exec in the base config, but * was enabled without exec in the new config, then disable * exec in the merged set. */ if (((base->opts & (OPT_INCLUDES|OPT_INC_WITH_EXEC)) == (OPT_INCLUDES|OPT_INC_WITH_EXEC)) && ((new->opts & (OPT_INCLUDES|OPT_INC_WITH_EXEC)) == OPT_INCLUDES)) { conf->opts &= ~OPT_INC_WITH_EXEC; } } else { /* otherwise we just copy, because an explicit opts setting * overrides all earlier +/- modifiers */ conf->opts = new->opts; conf->opts_add = new->opts_add; conf->opts_remove = new->opts_remove; } if (!(new->override & OR_UNSET)) { conf->override = new->override; } if (!(new->override_opts & OPT_UNSET)) { conf->override_opts = new->override_opts; } if (new->override_list != NULL) { conf->override_list = new->override_list; } if (conf->response_code_exprs == NULL) { conf->response_code_exprs = new->response_code_exprs; } else if (new->response_code_exprs != NULL) { conf->response_code_exprs = apr_hash_overlay(a, new->response_code_exprs, conf->response_code_exprs); } /* Otherwise we simply use the base->response_code_exprs array */ if (new->hostname_lookups != HOSTNAME_LOOKUP_UNSET) { conf->hostname_lookups = new->hostname_lookups; } if (new->content_md5 != AP_CONTENT_MD5_UNSET) { conf->content_md5 = new->content_md5; } if (new->accept_path_info != AP_ACCEPT_PATHINFO_UNSET) { conf->accept_path_info = new->accept_path_info; } if (new->use_canonical_name != USE_CANONICAL_NAME_UNSET) { conf->use_canonical_name = new->use_canonical_name; } if (new->use_canonical_phys_port != USE_CANONICAL_PHYS_PORT_UNSET) { conf->use_canonical_phys_port = new->use_canonical_phys_port; } #ifdef RLIMIT_CPU if (new->limit_cpu) { conf->limit_cpu = new->limit_cpu; } #endif #if defined(RLIMIT_DATA) || defined(RLIMIT_VMEM) || defined(RLIMIT_AS) if (new->limit_mem) { conf->limit_mem = new->limit_mem; } #endif #ifdef RLIMIT_NPROC if (new->limit_nproc) { conf->limit_nproc = new->limit_nproc; } #endif if (new->limit_req_body != AP_LIMIT_REQ_BODY_UNSET) { conf->limit_req_body = new->limit_req_body; } if (new->limit_xml_body != AP_LIMIT_UNSET) conf->limit_xml_body = new->limit_xml_body; if (!conf->sec_file) { conf->sec_file = new->sec_file; } else if (new->sec_file) { /* If we merge, the merge-result must have its own array */ conf->sec_file = apr_array_append(a, base->sec_file, new->sec_file); } /* Otherwise we simply use the base->sec_file array */ if (!conf->sec_if) { conf->sec_if = new->sec_if; } else if (new->sec_if) { /* If we merge, the merge-result must have its own array */ conf->sec_if = apr_array_append(a, base->sec_if, new->sec_if); } /* Otherwise we simply use the base->sec_if array */ if (new->server_signature != srv_sig_unset) { conf->server_signature = new->server_signature; } if (new->add_default_charset != ADD_DEFAULT_CHARSET_UNSET) { conf->add_default_charset = new->add_default_charset; conf->add_default_charset_name = new->add_default_charset_name; } /* Overriding all negotiation */ if (new->mime_type) { conf->mime_type = new->mime_type; } if (new->handler) { conf->handler = new->handler; } if (new->expr_handler) { conf->expr_handler = new->expr_handler; } if (new->output_filters) { conf->output_filters = new->output_filters; } if (new->input_filters) { conf->input_filters = new->input_filters; } /* * Now merge the setting of the FileETag directive. */ if (new->etag_bits == ETAG_UNSET) { conf->etag_add = (conf->etag_add & (~ new->etag_remove)) | new->etag_add; conf->etag_remove = (conf->etag_remove & (~ new->etag_add)) | new->etag_remove; conf->etag_bits = (conf->etag_bits & (~ conf->etag_remove)) | conf->etag_add; } else { conf->etag_bits = new->etag_bits; conf->etag_add = new->etag_add; conf->etag_remove = new->etag_remove; } if (conf->etag_bits != ETAG_NONE) { conf->etag_bits &= (~ ETAG_NONE); } if (new->enable_mmap != ENABLE_MMAP_UNSET) { conf->enable_mmap = new->enable_mmap; } if (new->enable_sendfile != ENABLE_SENDFILE_UNSET) { conf->enable_sendfile = new->enable_sendfile; } if (new->allow_encoded_slashes_set) { conf->allow_encoded_slashes = new->allow_encoded_slashes; } if (new->decode_encoded_slashes_set) { conf->decode_encoded_slashes = new->decode_encoded_slashes; } if (new->log) { if (!conf->log) { conf->log = new->log; } else { conf->log = ap_new_log_config(a, new->log); ap_merge_log_config(base->log, conf->log); } } conf->max_ranges = new->max_ranges != AP_MAXRANGES_UNSET ? new->max_ranges : base->max_ranges; conf->max_overlaps = new->max_overlaps != AP_MAXRANGES_UNSET ? new->max_overlaps : base->max_overlaps; conf->max_reversals = new->max_reversals != AP_MAXRANGES_UNSET ? new->max_reversals : base->max_reversals; conf->cgi_pass_auth = new->cgi_pass_auth != AP_CGI_PASS_AUTH_UNSET ? new->cgi_pass_auth : base->cgi_pass_auth; if (new->cgi_var_rules) { if (!conf->cgi_var_rules) { conf->cgi_var_rules = new->cgi_var_rules; } else { conf->cgi_var_rules = apr_hash_overlay(a, new->cgi_var_rules, conf->cgi_var_rules); } } AP_CORE_MERGE_FLAG(qualify_redirect_url, conf, base, new); return (void*)conf; }
C
httpd
0
CVE-2011-2861
https://www.cvedetails.com/cve/CVE-2011-2861/
CWE-20
https://github.com/chromium/chromium/commit/8262245d384be025f13e2a5b3a03b7e5c98374ce
8262245d384be025f13e2a5b3a03b7e5c98374ce
DevTools: move DevToolsAgent/Client into content. BUG=84078 TEST= Review URL: http://codereview.chromium.org/7461019 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@93596 0039d316-1c4b-4281-b951-d872f2087c98
GpuChannelHost* RenderThread::EstablishGpuChannelSync( content::CauseForGpuLaunch cause_for_gpu_launch) { if (gpu_channel_.get()) { if (gpu_channel_->state() == GpuChannelHost::kUnconnected || gpu_channel_->state() == GpuChannelHost::kConnected) return GetGpuChannel(); if (gpu_channel_->state() == GpuChannelHost::kLost) gpu_channel_ = NULL; } if (!gpu_channel_.get()) gpu_channel_ = new GpuChannelHost; IPC::ChannelHandle channel_handle; base::ProcessHandle renderer_process_for_gpu; GPUInfo gpu_info; if (!Send(new GpuHostMsg_EstablishGpuChannel(cause_for_gpu_launch, &channel_handle, &renderer_process_for_gpu, &gpu_info)) || channel_handle.name.empty() || renderer_process_for_gpu == base::kNullProcessHandle) { gpu_channel_ = NULL; return NULL; } gpu_channel_->set_gpu_info(gpu_info); content::GetContentClient()->SetGpuInfo(gpu_info); gpu_channel_->Connect(channel_handle, renderer_process_for_gpu); return GetGpuChannel(); }
GpuChannelHost* RenderThread::EstablishGpuChannelSync( content::CauseForGpuLaunch cause_for_gpu_launch) { if (gpu_channel_.get()) { if (gpu_channel_->state() == GpuChannelHost::kUnconnected || gpu_channel_->state() == GpuChannelHost::kConnected) return GetGpuChannel(); if (gpu_channel_->state() == GpuChannelHost::kLost) gpu_channel_ = NULL; } if (!gpu_channel_.get()) gpu_channel_ = new GpuChannelHost; IPC::ChannelHandle channel_handle; base::ProcessHandle renderer_process_for_gpu; GPUInfo gpu_info; if (!Send(new GpuHostMsg_EstablishGpuChannel(cause_for_gpu_launch, &channel_handle, &renderer_process_for_gpu, &gpu_info)) || channel_handle.name.empty() || renderer_process_for_gpu == base::kNullProcessHandle) { gpu_channel_ = NULL; return NULL; } gpu_channel_->set_gpu_info(gpu_info); content::GetContentClient()->SetGpuInfo(gpu_info); gpu_channel_->Connect(channel_handle, renderer_process_for_gpu); return GetGpuChannel(); }
C
Chrome
0
CVE-2013-4623
https://www.cvedetails.com/cve/CVE-2013-4623/
CWE-20
https://github.com/polarssl/polarssl/commit/1922a4e6aade7b1d685af19d4d9339ddb5c02859
1922a4e6aade7b1d685af19d4d9339ddb5c02859
ssl_parse_certificate() now calls x509parse_crt_der() directly
int ssl_handshake_step( ssl_context *ssl ) { int ret = POLARSSL_ERR_SSL_FEATURE_UNAVAILABLE; #if defined(POLARSSL_SSL_CLI_C) if( ssl->endpoint == SSL_IS_CLIENT ) ret = ssl_handshake_client_step( ssl ); #endif #if defined(POLARSSL_SSL_SRV_C) if( ssl->endpoint == SSL_IS_SERVER ) ret = ssl_handshake_server_step( ssl ); #endif return( ret ); }
int ssl_handshake_step( ssl_context *ssl ) { int ret = POLARSSL_ERR_SSL_FEATURE_UNAVAILABLE; #if defined(POLARSSL_SSL_CLI_C) if( ssl->endpoint == SSL_IS_CLIENT ) ret = ssl_handshake_client_step( ssl ); #endif #if defined(POLARSSL_SSL_SRV_C) if( ssl->endpoint == SSL_IS_SERVER ) ret = ssl_handshake_server_step( ssl ); #endif return( ret ); }
C
polarssl
0
CVE-2011-3927
https://www.cvedetails.com/cve/CVE-2011-3927/
CWE-19
https://github.com/chromium/chromium/commit/58ffd25567098d8ce9443b7c977382929d163b3d
58ffd25567098d8ce9443b7c977382929d163b3d
[skia] not all convex paths are convex, so recompute convexity for the problematic ones https://bugs.webkit.org/show_bug.cgi?id=75960 Reviewed by Stephen White. No new tests. See related chrome issue http://code.google.com/p/chromium/issues/detail?id=108605 * platform/graphics/skia/GraphicsContextSkia.cpp: (WebCore::setPathFromConvexPoints): git-svn-id: svn://svn.chromium.org/blink/trunk@104609 bbb929c8-8fbe-4397-9dbb-9b2b20218538
static bool isCoordinateSkiaSafe(float coord) { #if defined(_MSC_VER) if (!_finite(coord)) #else if (!finite(coord)) #endif return false; static const int maxPointMagnitude = 32767; if (coord > maxPointMagnitude || coord < -maxPointMagnitude) return false; return true; }
static bool isCoordinateSkiaSafe(float coord) { #if defined(_MSC_VER) if (!_finite(coord)) #else if (!finite(coord)) #endif return false; static const int maxPointMagnitude = 32767; if (coord > maxPointMagnitude || coord < -maxPointMagnitude) return false; return true; }
C
Chrome
0
CVE-2013-6626
https://www.cvedetails.com/cve/CVE-2013-6626/
null
https://github.com/chromium/chromium/commit/90fb08ed0146c9beacfd4dde98a20fc45419fff3
90fb08ed0146c9beacfd4dde98a20fc45419fff3
Cancel JavaScript dialogs when an interstitial appears. BUG=295695 TEST=See bug for repro steps. Review URL: https://chromiumcodereview.appspot.com/24360011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@225026 0039d316-1c4b-4281-b951-d872f2087c98
void WebContentsImpl::SetClosedByUserGesture(bool value) { closed_by_user_gesture_ = value; }
void WebContentsImpl::SetClosedByUserGesture(bool value) { closed_by_user_gesture_ = value; }
C
Chrome
0
CVE-2013-7446
https://www.cvedetails.com/cve/CVE-2013-7446/
null
https://github.com/torvalds/linux/commit/7d267278a9ece963d77eefec61630223fce08c6c
7d267278a9ece963d77eefec61630223fce08c6c
unix: avoid use-after-free in ep_remove_wait_queue Rainer Weikusat <[email protected]> writes: An AF_UNIX datagram socket being the client in an n:1 association with some server socket is only allowed to send messages to the server if the receive queue of this socket contains at most sk_max_ack_backlog datagrams. This implies that prospective writers might be forced to go to sleep despite none of the message presently enqueued on the server receive queue were sent by them. In order to ensure that these will be woken up once space becomes again available, the present unix_dgram_poll routine does a second sock_poll_wait call with the peer_wait wait queue of the server socket as queue argument (unix_dgram_recvmsg does a wake up on this queue after a datagram was received). This is inherently problematic because the server socket is only guaranteed to remain alive for as long as the client still holds a reference to it. In case the connection is dissolved via connect or by the dead peer detection logic in unix_dgram_sendmsg, the server socket may be freed despite "the polling mechanism" (in particular, epoll) still has a pointer to the corresponding peer_wait queue. There's no way to forcibly deregister a wait queue with epoll. Based on an idea by Jason Baron, the patch below changes the code such that a wait_queue_t belonging to the client socket is enqueued on the peer_wait queue of the server whenever the peer receive queue full condition is detected by either a sendmsg or a poll. A wake up on the peer queue is then relayed to the ordinary wait queue of the client socket via wake function. The connection to the peer wait queue is again dissolved if either a wake up is about to be relayed or the client socket reconnects or a dead peer is detected or the client socket is itself closed. This enables removing the second sock_poll_wait from unix_dgram_poll, thus avoiding the use-after-free, while still ensuring that no blocked writer sleeps forever. Signed-off-by: Rainer Weikusat <[email protected]> Fixes: ec0d215f9420 ("af_unix: fix 'poll for write'/connected DGRAM sockets") Reviewed-by: Jason Baron <[email protected]> Signed-off-by: David S. Miller <[email protected]>
static int unix_seqpacket_sendmsg(struct socket *sock, struct msghdr *msg, size_t len) { int err; struct sock *sk = sock->sk; err = sock_error(sk); if (err) return err; if (sk->sk_state != TCP_ESTABLISHED) return -ENOTCONN; if (msg->msg_namelen) msg->msg_namelen = 0; return unix_dgram_sendmsg(sock, msg, len); }
static int unix_seqpacket_sendmsg(struct socket *sock, struct msghdr *msg, size_t len) { int err; struct sock *sk = sock->sk; err = sock_error(sk); if (err) return err; if (sk->sk_state != TCP_ESTABLISHED) return -ENOTCONN; if (msg->msg_namelen) msg->msg_namelen = 0; return unix_dgram_sendmsg(sock, msg, len); }
C
linux
0
CVE-2014-3172
https://www.cvedetails.com/cve/CVE-2014-3172/
CWE-264
https://github.com/chromium/chromium/commit/684a212a93141908bcc10f4bc57f3edb53d2d21f
684a212a93141908bcc10f4bc57f3edb53d2d21f
Have the Debugger extension api check that it has access to the tab Check PermissionsData::CanAccessTab() prior to attaching the debugger. BUG=367567 Review URL: https://codereview.chromium.org/352523003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@280354 0039d316-1c4b-4281-b951-d872f2087c98
void PermissionsData::SetActivePermissions( const PermissionSet* permissions) const { base::AutoLock auto_lock(runtime_lock_); active_permissions_unsafe_ = permissions; }
void PermissionsData::SetActivePermissions( const PermissionSet* permissions) const { base::AutoLock auto_lock(runtime_lock_); active_permissions_unsafe_ = permissions; }
C
Chrome
0
CVE-2018-1066
https://www.cvedetails.com/cve/CVE-2018-1066/
CWE-476
https://github.com/torvalds/linux/commit/cabfb3680f78981d26c078a26e5c748531257ebb
cabfb3680f78981d26c078a26e5c748531257ebb
CIFS: Enable encryption during session setup phase In order to allow encryption on SMB connection we need to exchange a session key and generate encryption and decryption keys. Signed-off-by: Pavel Shilovsky <[email protected]>
small_smb2_init(__le16 smb2_command, struct cifs_tcon *tcon, void **request_buf) { int rc; unsigned int total_len; struct smb2_pdu *pdu; rc = smb2_reconnect(smb2_command, tcon); if (rc) return rc; /* BB eventually switch this to SMB2 specific small buf size */ *request_buf = cifs_small_buf_get(); if (*request_buf == NULL) { /* BB should we add a retry in here if not a writepage? */ return -ENOMEM; } pdu = (struct smb2_pdu *)(*request_buf); fill_small_buf(smb2_command, tcon, get_sync_hdr(pdu), &total_len); /* Note this is only network field converted to big endian */ pdu->hdr.smb2_buf_length = cpu_to_be32(total_len); if (tcon != NULL) { #ifdef CONFIG_CIFS_STATS2 uint16_t com_code = le16_to_cpu(smb2_command); cifs_stats_inc(&tcon->stats.smb2_stats.smb2_com_sent[com_code]); #endif cifs_stats_inc(&tcon->num_smbs_sent); } return rc; }
small_smb2_init(__le16 smb2_command, struct cifs_tcon *tcon, void **request_buf) { int rc; unsigned int total_len; struct smb2_pdu *pdu; rc = smb2_reconnect(smb2_command, tcon); if (rc) return rc; /* BB eventually switch this to SMB2 specific small buf size */ *request_buf = cifs_small_buf_get(); if (*request_buf == NULL) { /* BB should we add a retry in here if not a writepage? */ return -ENOMEM; } pdu = (struct smb2_pdu *)(*request_buf); fill_small_buf(smb2_command, tcon, get_sync_hdr(pdu), &total_len); /* Note this is only network field converted to big endian */ pdu->hdr.smb2_buf_length = cpu_to_be32(total_len); if (tcon != NULL) { #ifdef CONFIG_CIFS_STATS2 uint16_t com_code = le16_to_cpu(smb2_command); cifs_stats_inc(&tcon->stats.smb2_stats.smb2_com_sent[com_code]); #endif cifs_stats_inc(&tcon->num_smbs_sent); } return rc; }
C
linux
0
CVE-2015-3842
https://www.cvedetails.com/cve/CVE-2015-3842/
CWE-119
https://android.googlesource.com/platform/frameworks/av/+/aeea52da00d210587fb3ed895de3d5f2e0264c88
aeea52da00d210587fb3ed895de3d5f2e0264c88
audio effects: fix heap overflow Check consistency of effect command reply sizes before copying to reply address. Also add null pointer check on reply size. Also remove unused parameter warning. Bug: 21953516. Change-Id: I4cf00c12eaed696af28f3b7613f7e36f47a160c4 (cherry picked from commit 0f714a464d2425afe00d6450535e763131b40844)
int Downmix_Reset(downmix_object_t *pDownmixer, bool init) { int Downmix_Reset(downmix_object_t *pDownmixer __unused, bool init __unused) { return 0; }
int Downmix_Reset(downmix_object_t *pDownmixer, bool init) { return 0; }
C
Android
1
CVE-2017-13006
https://www.cvedetails.com/cve/CVE-2017-13006/
CWE-125
https://github.com/the-tcpdump-group/tcpdump/commit/cc4a7391c616be7a64ed65742ef9ed3f106eb165
cc4a7391c616be7a64ed65742ef9ed3f106eb165
CVE-2017-13006/L2TP: Check whether an AVP's content exceeds the AVP length. It's not good enough to check whether all the data specified by the AVP length was captured - you also have to check whether that length is large enough for all the required data in the AVP. This fixes a buffer over-read discovered by Yannick Formaggio. Add a test using the capture file supplied by the reporter(s).
l2tp_packet_proc_delay_print(netdissect_options *ndo) { ND_PRINT((ndo, "obsolete")); }
l2tp_packet_proc_delay_print(netdissect_options *ndo) { ND_PRINT((ndo, "obsolete")); }
C
tcpdump
0
CVE-2012-2895
https://www.cvedetails.com/cve/CVE-2012-2895/
CWE-119
https://github.com/chromium/chromium/commit/baef1ffd73db183ca50c854e1779ed7f6e5100a8
baef1ffd73db183ca50c854e1779ed7f6e5100a8
Revert 144993 - gdata: Remove invalid files in the cache directories Broke linux_chromeos_valgrind: http://build.chromium.org/p/chromium.memory.fyi/builders/Chromium%20OS%20%28valgrind%29%285%29/builds/8628/steps/memory%20test%3A%20unit/logs/stdio In theory, we shouldn't have any invalid files left in the cache directories, but things can go wrong and invalid files may be left if the device shuts down unexpectedly, for instance. Besides, it's good to be defensive. BUG=134862 TEST=added unit tests Review URL: https://chromiumcodereview.appspot.com/10693020 [email protected] git-svn-id: svn://svn.chromium.org/chrome/trunk/src@145029 0039d316-1c4b-4281-b951-d872f2087c98
void GDataCache::OnUnpinned(base::PlatformFileError* error, const std::string& resource_id, const std::string& md5, const CacheOperationCallback& callback) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); DCHECK(error); if (!callback.is_null()) callback.Run(*error, resource_id, md5); if (*error == base::PLATFORM_FILE_OK) FOR_EACH_OBSERVER(Observer, observers_, OnCacheUnpinned(resource_id, md5)); bool* has_enough_space = new bool(false); pool_->GetSequencedTaskRunner(sequence_token_)->PostTask( FROM_HERE, base::Bind(&GDataCache::FreeDiskSpaceIfNeededFor, base::Unretained(this), 0, base::Owned(has_enough_space))); }
void GDataCache::OnUnpinned(base::PlatformFileError* error, const std::string& resource_id, const std::string& md5, const CacheOperationCallback& callback) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); DCHECK(error); if (!callback.is_null()) callback.Run(*error, resource_id, md5); if (*error == base::PLATFORM_FILE_OK) FOR_EACH_OBSERVER(Observer, observers_, OnCacheUnpinned(resource_id, md5)); bool* has_enough_space = new bool(false); pool_->GetSequencedTaskRunner(sequence_token_)->PostTask( FROM_HERE, base::Bind(&GDataCache::FreeDiskSpaceIfNeededFor, base::Unretained(this), 0, base::Owned(has_enough_space))); }
C
Chrome
0
CVE-2018-9510
https://www.cvedetails.com/cve/CVE-2018-9510/
CWE-200
https://android.googlesource.com/platform/system/bt/+/6e4b8e505173f803a5fc05abc09f64eef89dc308
6e4b8e505173f803a5fc05abc09f64eef89dc308
Checks the SMP length to fix OOB read Bug: 111937065 Test: manual Change-Id: I330880a6e1671d0117845430db4076dfe1aba688 Merged-In: I330880a6e1671d0117845430db4076dfe1aba688 (cherry picked from commit fceb753bda651c4135f3f93a510e5fcb4c7542b8)
void smp_process_dhkey_check(tSMP_CB* p_cb, tSMP_INT_DATA* p_data) { uint8_t* p = p_data->p_data; SMP_TRACE_DEBUG("%s", __func__); if (smp_command_has_invalid_parameters(p_cb)) { tSMP_INT_DATA smp_int_data; smp_int_data.status = SMP_INVALID_PARAMETERS; smp_sm_event(p_cb, SMP_AUTH_CMPL_EVT, &smp_int_data); return; } if (p != NULL) { STREAM_TO_ARRAY(p_cb->remote_dhkey_check, p, BT_OCTET16_LEN); } p_cb->flags |= SMP_PAIR_FLAG_HAVE_PEER_DHK_CHK; }
void smp_process_dhkey_check(tSMP_CB* p_cb, tSMP_INT_DATA* p_data) { uint8_t* p = p_data->p_data; SMP_TRACE_DEBUG("%s", __func__); if (smp_command_has_invalid_parameters(p_cb)) { tSMP_INT_DATA smp_int_data; smp_int_data.status = SMP_INVALID_PARAMETERS; smp_sm_event(p_cb, SMP_AUTH_CMPL_EVT, &smp_int_data); return; } if (p != NULL) { STREAM_TO_ARRAY(p_cb->remote_dhkey_check, p, BT_OCTET16_LEN); } p_cb->flags |= SMP_PAIR_FLAG_HAVE_PEER_DHK_CHK; }
C
Android
0
CVE-2015-7540
https://www.cvedetails.com/cve/CVE-2015-7540/
CWE-399
https://git.samba.org/?p=samba.git;a=commit;h=530d50a1abdcdf4d1775652d4c456c1274d83d8d
530d50a1abdcdf4d1775652d4c456c1274d83d8d
null
static bool decode_vlv_request(void *mem_ctx, DATA_BLOB in, void *_out) { void **out = (void **)_out; DATA_BLOB assertion_value, context_id; struct asn1_data *data = asn1_init(mem_ctx); struct ldb_vlv_req_control *lvrc; if (!data) return false; if (!asn1_load(data, in)) { return false; } lvrc = talloc(mem_ctx, struct ldb_vlv_req_control); if (!lvrc) { return false; } if (!asn1_start_tag(data, ASN1_SEQUENCE(0))) { return false; } if (!asn1_read_Integer(data, &(lvrc->beforeCount))) { return false; } if (!asn1_read_Integer(data, &(lvrc->afterCount))) { return false; } if (asn1_peek_tag(data, ASN1_CONTEXT(0))) { lvrc->type = 0; if (!asn1_start_tag(data, ASN1_CONTEXT(0))) { return false; } if (!asn1_start_tag(data, ASN1_SEQUENCE(0))) { return false; } if (!asn1_read_Integer(data, &(lvrc->match.byOffset.offset))) { return false; } if (!asn1_read_Integer(data, &(lvrc->match.byOffset.contentCount))) { return false; } if (!asn1_end_tag(data)) { /*SEQUENCE*/ return false; } if (!asn1_end_tag(data)) { /*CONTEXT*/ return false; } } else { lvrc->type = 1; if (!asn1_start_tag(data, ASN1_CONTEXT(1))) { return false; } if (!asn1_read_OctetString(data, mem_ctx, &assertion_value)) { return false; } lvrc->match.gtOrEq.value_len = assertion_value.length; if (lvrc->match.gtOrEq.value_len) { lvrc->match.gtOrEq.value = talloc_memdup(lvrc, assertion_value.data, assertion_value.length); if (!(lvrc->match.gtOrEq.value)) { return false; } } else { lvrc->match.gtOrEq.value = NULL; } if (!asn1_end_tag(data)) { /*CONTEXT*/ return false; } } if (asn1_peek_tag(data, ASN1_OCTET_STRING)) { if (!asn1_read_OctetString(data, mem_ctx, &context_id)) { return false; } lvrc->ctxid_len = context_id.length; if (lvrc->ctxid_len) { lvrc->contextId = talloc_memdup(lvrc, context_id.data, context_id.length); if (!(lvrc->contextId)) { return false; } } else { lvrc->contextId = NULL; } } else { lvrc->contextId = NULL; lvrc->ctxid_len = 0; } if (!asn1_end_tag(data)) { return false; } *out = lvrc; return true; }
static bool decode_vlv_request(void *mem_ctx, DATA_BLOB in, void *_out) { void **out = (void **)_out; DATA_BLOB assertion_value, context_id; struct asn1_data *data = asn1_init(mem_ctx); struct ldb_vlv_req_control *lvrc; if (!data) return false; if (!asn1_load(data, in)) { return false; } lvrc = talloc(mem_ctx, struct ldb_vlv_req_control); if (!lvrc) { return false; } if (!asn1_start_tag(data, ASN1_SEQUENCE(0))) { return false; } if (!asn1_read_Integer(data, &(lvrc->beforeCount))) { return false; } if (!asn1_read_Integer(data, &(lvrc->afterCount))) { return false; } if (asn1_peek_tag(data, ASN1_CONTEXT(0))) { lvrc->type = 0; if (!asn1_start_tag(data, ASN1_CONTEXT(0))) { return false; } if (!asn1_start_tag(data, ASN1_SEQUENCE(0))) { return false; } if (!asn1_read_Integer(data, &(lvrc->match.byOffset.offset))) { return false; } if (!asn1_read_Integer(data, &(lvrc->match.byOffset.contentCount))) { return false; } if (!asn1_end_tag(data)) { /*SEQUENCE*/ return false; } if (!asn1_end_tag(data)) { /*CONTEXT*/ return false; } } else { lvrc->type = 1; if (!asn1_start_tag(data, ASN1_CONTEXT(1))) { return false; } if (!asn1_read_OctetString(data, mem_ctx, &assertion_value)) { return false; } lvrc->match.gtOrEq.value_len = assertion_value.length; if (lvrc->match.gtOrEq.value_len) { lvrc->match.gtOrEq.value = talloc_memdup(lvrc, assertion_value.data, assertion_value.length); if (!(lvrc->match.gtOrEq.value)) { return false; } } else { lvrc->match.gtOrEq.value = NULL; } if (!asn1_end_tag(data)) { /*CONTEXT*/ return false; } } if (asn1_peek_tag(data, ASN1_OCTET_STRING)) { if (!asn1_read_OctetString(data, mem_ctx, &context_id)) { return false; } lvrc->ctxid_len = context_id.length; if (lvrc->ctxid_len) { lvrc->contextId = talloc_memdup(lvrc, context_id.data, context_id.length); if (!(lvrc->contextId)) { return false; } } else { lvrc->contextId = NULL; } } else { lvrc->contextId = NULL; lvrc->ctxid_len = 0; } if (!asn1_end_tag(data)) { return false; } *out = lvrc; return true; }
C
samba
0
CVE-2014-3173
https://www.cvedetails.com/cve/CVE-2014-3173/
CWE-119
https://github.com/chromium/chromium/commit/ee7579229ff7e9e5ae28bf53aea069251499d7da
ee7579229ff7e9e5ae28bf53aea069251499d7da
Framebuffer clear() needs to consider the situation some draw buffers are disabled. This is when we expose DrawBuffers extension. BUG=376951 TEST=the attached test case, webgl conformance [email protected],[email protected] Review URL: https://codereview.chromium.org/315283002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@275338 0039d316-1c4b-4281-b951-d872f2087c98
bool GLES2DecoderImpl::BoundFramebufferHasStencilAttachment() { Framebuffer* framebuffer = GetFramebufferInfoForTarget(GL_DRAW_FRAMEBUFFER_EXT); if (framebuffer) { return framebuffer->HasStencilAttachment(); } if (offscreen_target_frame_buffer_.get()) { return offscreen_target_stencil_format_ != 0 || offscreen_target_depth_format_ == GL_DEPTH24_STENCIL8; } return back_buffer_has_stencil_; }
bool GLES2DecoderImpl::BoundFramebufferHasStencilAttachment() { Framebuffer* framebuffer = GetFramebufferInfoForTarget(GL_DRAW_FRAMEBUFFER_EXT); if (framebuffer) { return framebuffer->HasStencilAttachment(); } if (offscreen_target_frame_buffer_.get()) { return offscreen_target_stencil_format_ != 0 || offscreen_target_depth_format_ == GL_DEPTH24_STENCIL8; } return back_buffer_has_stencil_; }
C
Chrome
0
CVE-2013-0921
https://www.cvedetails.com/cve/CVE-2013-0921/
CWE-264
https://github.com/chromium/chromium/commit/e9841fbdaf41b4a2baaa413f94d5c0197f9261f4
e9841fbdaf41b4a2baaa413f94d5c0197f9261f4
Ensure extensions and the Chrome Web Store are loaded in new BrowsingInstances. BUG=174943 TEST=Can't post message to CWS. See bug for repro steps. Review URL: https://chromiumcodereview.appspot.com/12301013 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@184208 0039d316-1c4b-4281-b951-d872f2087c98
content::BrowserMainParts* ChromeContentBrowserClient::CreateBrowserMainParts( const content::MainFunctionParams& parameters) { ChromeBrowserMainParts* main_parts; #if defined(OS_WIN) main_parts = new ChromeBrowserMainPartsWin(parameters); #elif defined(OS_MACOSX) main_parts = new ChromeBrowserMainPartsMac(parameters); #elif defined(OS_CHROMEOS) main_parts = new chromeos::ChromeBrowserMainPartsChromeos(parameters); #elif defined(OS_LINUX) main_parts = new ChromeBrowserMainPartsLinux(parameters); #elif defined(OS_ANDROID) main_parts = new ChromeBrowserMainPartsAndroid(parameters); #elif defined(OS_POSIX) main_parts = new ChromeBrowserMainPartsPosix(parameters); #else NOTREACHED(); main_parts = new ChromeBrowserMainParts(parameters); #endif #if defined(TOOLKIT_GTK) chrome::AddGtkToolkitExtraParts(main_parts); #endif #if defined(TOOLKIT_VIEWS) chrome::AddViewsToolkitExtraParts(main_parts); #endif #if defined(USE_ASH) chrome::AddAshToolkitExtraParts(main_parts); #endif #if defined(USE_AURA) chrome::AddAuraToolkitExtraParts(main_parts); #endif return main_parts; }
content::BrowserMainParts* ChromeContentBrowserClient::CreateBrowserMainParts( const content::MainFunctionParams& parameters) { ChromeBrowserMainParts* main_parts; #if defined(OS_WIN) main_parts = new ChromeBrowserMainPartsWin(parameters); #elif defined(OS_MACOSX) main_parts = new ChromeBrowserMainPartsMac(parameters); #elif defined(OS_CHROMEOS) main_parts = new chromeos::ChromeBrowserMainPartsChromeos(parameters); #elif defined(OS_LINUX) main_parts = new ChromeBrowserMainPartsLinux(parameters); #elif defined(OS_ANDROID) main_parts = new ChromeBrowserMainPartsAndroid(parameters); #elif defined(OS_POSIX) main_parts = new ChromeBrowserMainPartsPosix(parameters); #else NOTREACHED(); main_parts = new ChromeBrowserMainParts(parameters); #endif #if defined(TOOLKIT_GTK) chrome::AddGtkToolkitExtraParts(main_parts); #endif #if defined(TOOLKIT_VIEWS) chrome::AddViewsToolkitExtraParts(main_parts); #endif #if defined(USE_ASH) chrome::AddAshToolkitExtraParts(main_parts); #endif #if defined(USE_AURA) chrome::AddAuraToolkitExtraParts(main_parts); #endif return main_parts; }
C
Chrome
0
CVE-2017-5120
https://www.cvedetails.com/cve/CVE-2017-5120/
null
https://github.com/chromium/chromium/commit/b7277af490d28ac7f802c015bb0ff31395768556
b7277af490d28ac7f802c015bb0ff31395768556
bindings: Support "attribute FrozenArray<T>?" Adds a quick hack to support a case of "attribute FrozenArray<T>?". Bug: 1028047 Change-Id: Ib3cecc4beb6bcc0fb0dbc667aca595454cc90c86 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1933866 Reviewed-by: Hitoshi Yoshida <[email protected]> Commit-Queue: Yuki Shiino <[email protected]> Cr-Commit-Position: refs/heads/master@{#718676}
static void NullableTestInterfaceMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) { TestObject* impl = V8TestObject::ToImpl(info.Holder()); V8SetReturnValue(info, impl->nullableTestInterfaceMethod()); }
static void NullableTestInterfaceMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) { TestObject* impl = V8TestObject::ToImpl(info.Holder()); V8SetReturnValue(info, impl->nullableTestInterfaceMethod()); }
C
Chrome
0
CVE-2011-2858
https://www.cvedetails.com/cve/CVE-2011-2858/
CWE-119
https://github.com/chromium/chromium/commit/c13e1da62b5f5f0e6fe8c1f769a5a28415415244
c13e1da62b5f5f0e6fe8c1f769a5a28415415244
Revert "Revert 100494 - Fix bug in SimulateAttrib0.""" TEST=none BUG=95625 [email protected] Review URL: http://codereview.chromium.org/7796016 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@100507 0039d316-1c4b-4281-b951-d872f2087c98
void ReadPixels( GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, void* pixels) const { DCHECK_GE(x, 0); DCHECK_GE(y, 0); DCHECK_LE(x + width, width_); DCHECK_LE(y + height, height_); for (GLint yy = 0; yy < height; ++yy) { const int8* src = GetPixelAddress(src_pixels_, x, y + yy); const void* dst = ComputePackAlignmentAddress(0, yy, width, pixels); memcpy(const_cast<void*>(dst), src, width * bytes_per_pixel_); } }
void ReadPixels( GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, void* pixels) const { DCHECK_GE(x, 0); DCHECK_GE(y, 0); DCHECK_LE(x + width, width_); DCHECK_LE(y + height, height_); for (GLint yy = 0; yy < height; ++yy) { const int8* src = GetPixelAddress(src_pixels_, x, y + yy); const void* dst = ComputePackAlignmentAddress(0, yy, width, pixels); memcpy(const_cast<void*>(dst), src, width * bytes_per_pixel_); } }
C
Chrome
0
CVE-2016-10165
https://www.cvedetails.com/cve/CVE-2016-10165/
CWE-125
https://github.com/mm2/Little-CMS/commit/5ca71a7bc18b6897ab21d815d15e218e204581e2
5ca71a7bc18b6897ab21d815d15e218e204581e2
Added an extra check to MLU bounds Thanks to Ibrahim el-sayed for spotting the bug
cmsBool WriteSetOfCurves(struct _cms_typehandler_struct* self, cmsIOHANDLER* io, cmsTagTypeSignature Type, cmsStage* mpe) { cmsUInt32Number i, n; cmsTagTypeSignature CurrentType; cmsToneCurve** Curves; n = cmsStageOutputChannels(mpe); Curves = _cmsStageGetPtrToCurveSet(mpe); for (i=0; i < n; i++) { CurrentType = Type; if ((Curves[i] ->nSegments == 0)|| ((Curves[i]->nSegments == 2) && (Curves[i] ->Segments[1].Type == 0)) ) CurrentType = cmsSigCurveType; else if (Curves[i] ->Segments[0].Type < 0) CurrentType = cmsSigCurveType; if (!_cmsWriteTypeBase(io, CurrentType)) return FALSE; switch (CurrentType) { case cmsSigCurveType: if (!Type_Curve_Write(self, io, Curves[i], 1)) return FALSE; break; case cmsSigParametricCurveType: if (!Type_ParametricCurve_Write(self, io, Curves[i], 1)) return FALSE; break; default: { char String[5]; _cmsTagSignature2String(String, (cmsTagSignature) Type); cmsSignalError(self ->ContextID, cmsERROR_UNKNOWN_EXTENSION, "Unknown curve type '%s'", String); } return FALSE; } if (!_cmsWriteAlignment(io)) return FALSE; } return TRUE; }
cmsBool WriteSetOfCurves(struct _cms_typehandler_struct* self, cmsIOHANDLER* io, cmsTagTypeSignature Type, cmsStage* mpe) { cmsUInt32Number i, n; cmsTagTypeSignature CurrentType; cmsToneCurve** Curves; n = cmsStageOutputChannels(mpe); Curves = _cmsStageGetPtrToCurveSet(mpe); for (i=0; i < n; i++) { CurrentType = Type; if ((Curves[i] ->nSegments == 0)|| ((Curves[i]->nSegments == 2) && (Curves[i] ->Segments[1].Type == 0)) ) CurrentType = cmsSigCurveType; else if (Curves[i] ->Segments[0].Type < 0) CurrentType = cmsSigCurveType; if (!_cmsWriteTypeBase(io, CurrentType)) return FALSE; switch (CurrentType) { case cmsSigCurveType: if (!Type_Curve_Write(self, io, Curves[i], 1)) return FALSE; break; case cmsSigParametricCurveType: if (!Type_ParametricCurve_Write(self, io, Curves[i], 1)) return FALSE; break; default: { char String[5]; _cmsTagSignature2String(String, (cmsTagSignature) Type); cmsSignalError(self ->ContextID, cmsERROR_UNKNOWN_EXTENSION, "Unknown curve type '%s'", String); } return FALSE; } if (!_cmsWriteAlignment(io)) return FALSE; } return TRUE; }
C
Little-CMS
0
CVE-2016-1503
https://www.cvedetails.com/cve/CVE-2016-1503/
CWE-119
https://android.googlesource.com/platform/external/dhcpcd/+/1390ace71179f04a09c300ee8d0300aa69d9db09
1390ace71179f04a09c300ee8d0300aa69d9db09
Improve length checks in DHCP Options parsing of dhcpcd. Bug: 26461634 Change-Id: Ic4c2eb381a6819e181afc8ab13891f3fc58b7deb
valid_length(uint8_t option, int dl, int *type) { const struct dhcp_opt *opt; ssize_t sz; if (dl == 0) return -1; for (opt = dhcp_opts; opt->option; opt++) { if (opt->option != option) continue; if (type) *type = opt->type; /* The size of RFC3442 and RFC5969 options is checked at a later * stage in the code */ if (opt->type == 0 || opt->type & (STRING | RFC3442 | RFC5969)) return 0; /* The code does not use SINT16 / SINT32 together with ARRAY. * It is however far easier to reason about the code if all * possible array elements are included, and also does not code * any additional CPU resources. sizeof(uintXX_t) == * sizeof(intXX_t) can be assumed. */ sz = 0; if (opt->type & (UINT32 | SINT32 | IPV4)) sz = sizeof(uint32_t); else if (opt->type & (UINT16 | SINT16)) sz = sizeof(uint16_t); else if (opt->type & UINT8) sz = sizeof(uint8_t); if (opt->type & ARRAY) { /* The result of modulo zero is undefined. There are no * options defined in this file that do not match one of * the if-clauses above, so the following is not really * necessary. However, to avoid confusion and unexpected * behavior if the defined options are ever extended, * returning false here seems sensible. */ if (!sz) return -1; return (dl % sz == 0) ? 0 : -1; } return (sz == dl) ? 0 : -1; } /* unknown option, so let it pass */ return 0; }
valid_length(uint8_t option, int dl, int *type) { const struct dhcp_opt *opt; ssize_t sz; if (dl == 0) return -1; for (opt = dhcp_opts; opt->option; opt++) { if (opt->option != option) continue; if (type) *type = opt->type; if (opt->type == 0 || opt->type & (STRING | RFC3442 | RFC5969)) return 0; sz = 0; if (opt->type & (UINT32 | IPV4)) sz = sizeof(uint32_t); if (opt->type & UINT16) sz = sizeof(uint16_t); if (opt->type & UINT8) sz = sizeof(uint8_t); if (opt->type & (IPV4 | ARRAY)) return dl % sz; return (dl == sz ? 0 : -1); } /* unknown option, so let it pass */ return 0; }
C
Android
1
CVE-2011-2802
https://www.cvedetails.com/cve/CVE-2011-2802/
CWE-399
https://github.com/chromium/chromium/commit/4ab22cfc619ee8ff17a8c50e289ec3b30731ceba
4ab22cfc619ee8ff17a8c50e289ec3b30731ceba
In chromedriver, add /log url to get the contents of the chromedriver log remotely. Also add a 'chrome.verbose' boolean startup option. Remove usage of VLOG(1) in chromedriver. We do not need as complicated logging as in Chrome. BUG=85241 TEST=none Review URL: http://codereview.chromium.org/7104085 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@88591 0039d316-1c4b-4281-b951-d872f2087c98
bool SendWaitForAllTabsToStopLoadingJSONRequest( AutomationMessageSender* sender, std::string* error_msg) { DictionaryValue dict; dict.SetString("command", "WaitForAllTabsToStopLoading"); DictionaryValue reply_dict; return SendAutomationJSONRequest(sender, dict, &reply_dict, error_msg); }
bool SendWaitForAllTabsToStopLoadingJSONRequest( AutomationMessageSender* sender, std::string* error_msg) { DictionaryValue dict; dict.SetString("command", "WaitForAllTabsToStopLoading"); DictionaryValue reply_dict; return SendAutomationJSONRequest(sender, dict, &reply_dict, error_msg); }
C
Chrome
0
CVE-2012-5148
https://www.cvedetails.com/cve/CVE-2012-5148/
CWE-20
https://github.com/chromium/chromium/commit/e89cfcb9090e8c98129ae9160c513f504db74599
e89cfcb9090e8c98129ae9160c513f504db74599
Remove TabContents from TabStripModelObserver::TabDetachedAt. BUG=107201 TEST=no visible change Review URL: https://chromiumcodereview.appspot.com/11293205 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@167122 0039d316-1c4b-4281-b951-d872f2087c98
void TabStripGtk::ExtendTabSelection(TabGtk* tab) { int index = GetIndexOfTab(tab); if (model_->ContainsIndex(index)) model_->ExtendSelectionTo(index); }
void TabStripGtk::ExtendTabSelection(TabGtk* tab) { int index = GetIndexOfTab(tab); if (model_->ContainsIndex(index)) model_->ExtendSelectionTo(index); }
C
Chrome
0
CVE-2017-0402
https://www.cvedetails.com/cve/CVE-2017-0402/
CWE-200
https://android.googlesource.com/platform/hardware/qcom/audio/+/d72ea85c78a1a68bf99fd5804ad9784b4102fe57
d72ea85c78a1a68bf99fd5804ad9784b4102fe57
Fix security vulnerability: Equalizer command might allow negative indexes Bug: 32247948 Bug: 32438598 Bug: 32436341 Test: use POC on bug or cts security test Change-Id: I56a92582687599b5b313dea1abcb8bcb19c7fc0e (cherry picked from commit 3f37d4ef89f4f0eef9e201c5a91b7b2c77ed1071) (cherry picked from commit ceb7b2d7a4c4cb8d03f166c61f5c7551c6c760aa)
int equalizer_get_band_freq_range(equalizer_context_t *context __unused, int32_t band, uint32_t *low, uint32_t *high) { ALOGV("%s: band: %d", __func__, band); *low = equalizer_band_freq_range[band][0]; *high = equalizer_band_freq_range[band][1]; return 0; }
int equalizer_get_band_freq_range(equalizer_context_t *context __unused, int32_t band, uint32_t *low, uint32_t *high) { ALOGV("%s: band: %d", __func__, band); *low = equalizer_band_freq_range[band][0]; *high = equalizer_band_freq_range[band][1]; return 0; }
C
Android
0
CVE-2015-6782
https://www.cvedetails.com/cve/CVE-2015-6782/
CWE-20
https://github.com/chromium/chromium/commit/e1e0c4301aaa8228e362f2409dbde2d4d1896866
e1e0c4301aaa8228e362f2409dbde2d4d1896866
Don't change Document load progress in any page dismissal events. This can confuse the logic for blocking modal dialogs. BUG=536652 Review URL: https://codereview.chromium.org/1373113002 Cr-Commit-Position: refs/heads/master@{#351419}
WeakPtrWillBeRawPtr<Document> Document::contextDocument() { if (m_contextDocument) return m_contextDocument; if (m_frame) { #if ENABLE(OILPAN) return this; #else return m_weakFactory.createWeakPtr(); #endif } return nullptr; }
WeakPtrWillBeRawPtr<Document> Document::contextDocument() { if (m_contextDocument) return m_contextDocument; if (m_frame) { #if ENABLE(OILPAN) return this; #else return m_weakFactory.createWeakPtr(); #endif } return nullptr; }
C
Chrome
0
CVE-2017-5019
https://www.cvedetails.com/cve/CVE-2017-5019/
CWE-416
https://github.com/chromium/chromium/commit/f03ea5a5c2ff26e239dfd23e263b15da2d9cee93
f03ea5a5c2ff26e239dfd23e263b15da2d9cee93
Convert FrameHostMsg_DidAddMessageToConsole to Mojo. Note: Since this required changing the test RenderViewImplTest.DispatchBeforeUnloadCanDetachFrame, I manually re-introduced https://crbug.com/666714 locally (the bug the test was added for), and reran the test to confirm that it still covers the bug. Bug: 786836 Change-Id: I110668fa6f0f261fd2ac36bb91a8d8b31c99f4f1 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1526270 Commit-Queue: Lowell Manners <[email protected]> Reviewed-by: Daniel Cheng <[email protected]> Reviewed-by: Camille Lamy <[email protected]> Cr-Commit-Position: refs/heads/master@{#653137}
RenderFrameImpl* RenderFrameImpl::FromRoutingID(int routing_id) { DCHECK(RenderThread::IsMainThread()); auto iter = g_routing_id_frame_map.Get().find(routing_id); if (iter != g_routing_id_frame_map.Get().end()) return iter->second; return nullptr; }
RenderFrameImpl* RenderFrameImpl::FromRoutingID(int routing_id) { DCHECK(RenderThread::IsMainThread()); auto iter = g_routing_id_frame_map.Get().find(routing_id); if (iter != g_routing_id_frame_map.Get().end()) return iter->second; return nullptr; }
C
Chrome
0
CVE-2015-3412
https://www.cvedetails.com/cve/CVE-2015-3412/
CWE-254
https://git.php.net/?p=php-src.git;a=commit;h=4435b9142ff9813845d5c97ab29a5d637bedb257
4435b9142ff9813845d5c97ab29a5d637bedb257
null
PHP_FUNCTION(stream_get_meta_data) { zval *arg1; php_stream *stream; zval *newval; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &arg1) == FAILURE) { return; } php_stream_from_zval(stream, &arg1); array_init(return_value); if (stream->wrapperdata) { MAKE_STD_ZVAL(newval); MAKE_COPY_ZVAL(&stream->wrapperdata, newval); add_assoc_zval(return_value, "wrapper_data", newval); } if (stream->wrapper) { add_assoc_string(return_value, "wrapper_type", (char *)stream->wrapper->wops->label, 1); } add_assoc_string(return_value, "stream_type", (char *)stream->ops->label, 1); add_assoc_string(return_value, "mode", stream->mode, 1); #if 0 /* TODO: needs updating for new filter API */ if (stream->filterhead) { php_stream_filter *filter; MAKE_STD_ZVAL(newval); array_init(newval); for (filter = stream->filterhead; filter != NULL; filter = filter->next) { add_next_index_string(newval, (char *)filter->fops->label, 1); } add_assoc_zval(return_value, "filters", newval); } #endif add_assoc_long(return_value, "unread_bytes", stream->writepos - stream->readpos); add_assoc_bool(return_value, "seekable", (stream->ops->seek) && (stream->flags & PHP_STREAM_FLAG_NO_SEEK) == 0); if (stream->orig_path) { add_assoc_string(return_value, "uri", stream->orig_path, 1); } if (!php_stream_populate_meta_data(stream, return_value)) { add_assoc_bool(return_value, "timed_out", 0); add_assoc_bool(return_value, "blocked", 1); add_assoc_bool(return_value, "eof", php_stream_eof(stream)); } }
PHP_FUNCTION(stream_get_meta_data) { zval *arg1; php_stream *stream; zval *newval; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &arg1) == FAILURE) { return; } php_stream_from_zval(stream, &arg1); array_init(return_value); if (stream->wrapperdata) { MAKE_STD_ZVAL(newval); MAKE_COPY_ZVAL(&stream->wrapperdata, newval); add_assoc_zval(return_value, "wrapper_data", newval); } if (stream->wrapper) { add_assoc_string(return_value, "wrapper_type", (char *)stream->wrapper->wops->label, 1); } add_assoc_string(return_value, "stream_type", (char *)stream->ops->label, 1); add_assoc_string(return_value, "mode", stream->mode, 1); #if 0 /* TODO: needs updating for new filter API */ if (stream->filterhead) { php_stream_filter *filter; MAKE_STD_ZVAL(newval); array_init(newval); for (filter = stream->filterhead; filter != NULL; filter = filter->next) { add_next_index_string(newval, (char *)filter->fops->label, 1); } add_assoc_zval(return_value, "filters", newval); } #endif add_assoc_long(return_value, "unread_bytes", stream->writepos - stream->readpos); add_assoc_bool(return_value, "seekable", (stream->ops->seek) && (stream->flags & PHP_STREAM_FLAG_NO_SEEK) == 0); if (stream->orig_path) { add_assoc_string(return_value, "uri", stream->orig_path, 1); } if (!php_stream_populate_meta_data(stream, return_value)) { add_assoc_bool(return_value, "timed_out", 0); add_assoc_bool(return_value, "blocked", 1); add_assoc_bool(return_value, "eof", php_stream_eof(stream)); } }
C
php
0
CVE-2016-7799
https://www.cvedetails.com/cve/CVE-2016-7799/
CWE-125
https://github.com/ImageMagick/ImageMagick/commit/a7bb158b7bedd1449a34432feb3a67c8f1873bfa
a7bb158b7bedd1449a34432feb3a67c8f1873bfa
https://github.com/ImageMagick/ImageMagick/issues/280
MagickBooleanType SyncExifProfile(Image *image,StringInfo *profile) { #define MaxDirectoryStack 16 #define EXIF_DELIMITER "\n" #define EXIF_NUM_FORMATS 12 #define TAG_EXIF_OFFSET 0x8769 #define TAG_INTEROP_OFFSET 0xa005 typedef struct _DirectoryInfo { unsigned char *directory; size_t entry; } DirectoryInfo; DirectoryInfo directory_stack[MaxDirectoryStack]; EndianType endian; size_t entry, length, number_entries; ssize_t id, level, offset; static int format_bytes[] = {0, 1, 1, 2, 4, 8, 1, 1, 2, 4, 8, 4, 8}; unsigned char *directory, *exif; /* Set EXIF resolution tag. */ length=GetStringInfoLength(profile); exif=GetStringInfoDatum(profile); if (length < 16) return(MagickFalse); id=(ssize_t) ReadProfileShort(LSBEndian,exif); if ((id != 0x4949) && (id != 0x4D4D)) { while (length != 0) { if (ReadProfileByte(&exif,&length) != 0x45) continue; if (ReadProfileByte(&exif,&length) != 0x78) continue; if (ReadProfileByte(&exif,&length) != 0x69) continue; if (ReadProfileByte(&exif,&length) != 0x66) continue; if (ReadProfileByte(&exif,&length) != 0x00) continue; if (ReadProfileByte(&exif,&length) != 0x00) continue; break; } if (length < 16) return(MagickFalse); id=(ssize_t) ReadProfileShort(LSBEndian,exif); } endian=LSBEndian; if (id == 0x4949) endian=LSBEndian; else if (id == 0x4D4D) endian=MSBEndian; else return(MagickFalse); if (ReadProfileShort(endian,exif+2) != 0x002a) return(MagickFalse); /* This the offset to the first IFD. */ offset=(ssize_t) ReadProfileLong(endian,exif+4); if ((offset < 0) || (size_t) offset >= length) return(MagickFalse); directory=exif+offset; level=0; entry=0; do { if (level > 0) { level--; directory=directory_stack[level].directory; entry=directory_stack[level].entry; } if ((directory < exif) || (directory > (exif+length-2))) break; /* Determine how many entries there are in the current IFD. */ number_entries=ReadProfileShort(endian,directory); for ( ; entry < number_entries; entry++) { int components; register unsigned char *p, *q; size_t number_bytes; ssize_t format, tag_value; q=(unsigned char *) (directory+2+(12*entry)); if (q > (exif+length-12)) break; /* corrupt EXIF */ tag_value=(ssize_t) ReadProfileShort(endian,q); format=(ssize_t) ReadProfileShort(endian,q+2); if ((format < 0) || ((format-1) >= EXIF_NUM_FORMATS)) break; components=(ssize_t) ReadProfileLong(endian,q+4); if (components < 0) break; /* corrupt EXIF */ number_bytes=(size_t) components*format_bytes[format]; if ((ssize_t) number_bytes < components) break; /* prevent overflow */ if (number_bytes <= 4) p=q+8; else { /* The directory entry contains an offset. */ offset=(ssize_t) ReadProfileLong(endian,q+8); if ((size_t) (offset+number_bytes) > length) continue; if (~length < number_bytes) continue; /* prevent overflow */ p=(unsigned char *) (exif+offset); } switch (tag_value) { case 0x011a: { (void) WriteProfileLong(endian,(size_t) (image->resolution.x+0.5),p); (void) WriteProfileLong(endian,1UL,p+4); break; } case 0x011b: { (void) WriteProfileLong(endian,(size_t) (image->resolution.y+0.5),p); (void) WriteProfileLong(endian,1UL,p+4); break; } case 0x0112: { if (number_bytes == 4) { (void) WriteProfileLong(endian,(size_t) image->orientation,p); break; } (void) WriteProfileShort(endian,(unsigned short) image->orientation, p); break; } case 0x0128: { if (number_bytes == 4) { (void) WriteProfileLong(endian,(size_t) (image->units+1),p); break; } (void) WriteProfileShort(endian,(unsigned short) (image->units+1),p); break; } default: break; } if ((tag_value == TAG_EXIF_OFFSET) || (tag_value == TAG_INTEROP_OFFSET)) { offset=(ssize_t) ReadProfileLong(endian,p); if (((size_t) offset < length) && (level < (MaxDirectoryStack-2))) { directory_stack[level].directory=directory; entry++; directory_stack[level].entry=entry; level++; directory_stack[level].directory=exif+offset; directory_stack[level].entry=0; level++; if ((directory+2+(12*number_entries)) > (exif+length)) break; offset=(ssize_t) ReadProfileLong(endian,directory+2+(12* number_entries)); if ((offset != 0) && ((size_t) offset < length) && (level < (MaxDirectoryStack-2))) { directory_stack[level].directory=exif+offset; directory_stack[level].entry=0; level++; } } break; } } } while (level > 0); return(MagickTrue); }
MagickBooleanType SyncExifProfile(Image *image,StringInfo *profile) { #define MaxDirectoryStack 16 #define EXIF_DELIMITER "\n" #define EXIF_NUM_FORMATS 12 #define TAG_EXIF_OFFSET 0x8769 #define TAG_INTEROP_OFFSET 0xa005 typedef struct _DirectoryInfo { unsigned char *directory; size_t entry; } DirectoryInfo; DirectoryInfo directory_stack[MaxDirectoryStack]; EndianType endian; size_t entry, length, number_entries; ssize_t id, level, offset; static int format_bytes[] = {0, 1, 1, 2, 4, 8, 1, 1, 2, 4, 8, 4, 8}; unsigned char *directory, *exif; /* Set EXIF resolution tag. */ length=GetStringInfoLength(profile); exif=GetStringInfoDatum(profile); if (length < 16) return(MagickFalse); id=(ssize_t) ReadProfileShort(LSBEndian,exif); if ((id != 0x4949) && (id != 0x4D4D)) { while (length != 0) { if (ReadProfileByte(&exif,&length) != 0x45) continue; if (ReadProfileByte(&exif,&length) != 0x78) continue; if (ReadProfileByte(&exif,&length) != 0x69) continue; if (ReadProfileByte(&exif,&length) != 0x66) continue; if (ReadProfileByte(&exif,&length) != 0x00) continue; if (ReadProfileByte(&exif,&length) != 0x00) continue; break; } if (length < 16) return(MagickFalse); id=(ssize_t) ReadProfileShort(LSBEndian,exif); } endian=LSBEndian; if (id == 0x4949) endian=LSBEndian; else if (id == 0x4D4D) endian=MSBEndian; else return(MagickFalse); if (ReadProfileShort(endian,exif+2) != 0x002a) return(MagickFalse); /* This the offset to the first IFD. */ offset=(ssize_t) ReadProfileLong(endian,exif+4); if ((offset < 0) || (size_t) offset >= length) return(MagickFalse); directory=exif+offset; level=0; entry=0; do { if (level > 0) { level--; directory=directory_stack[level].directory; entry=directory_stack[level].entry; } if ((directory < exif) || (directory > (exif+length-2))) break; /* Determine how many entries there are in the current IFD. */ number_entries=ReadProfileShort(endian,directory); for ( ; entry < number_entries; entry++) { int components; register unsigned char *p, *q; size_t number_bytes; ssize_t format, tag_value; q=(unsigned char *) (directory+2+(12*entry)); if (q > (exif+length-12)) break; /* corrupt EXIF */ tag_value=(ssize_t) ReadProfileShort(endian,q); format=(ssize_t) ReadProfileShort(endian,q+2); if ((format-1) >= EXIF_NUM_FORMATS) break; components=(ssize_t) ReadProfileLong(endian,q+4); if (components < 0) break; /* corrupt EXIF */ number_bytes=(size_t) components*format_bytes[format]; if ((ssize_t) number_bytes < components) break; /* prevent overflow */ if (number_bytes <= 4) p=q+8; else { /* The directory entry contains an offset. */ offset=(ssize_t) ReadProfileLong(endian,q+8); if ((size_t) (offset+number_bytes) > length) continue; if (~length < number_bytes) continue; /* prevent overflow */ p=(unsigned char *) (exif+offset); } switch (tag_value) { case 0x011a: { (void) WriteProfileLong(endian,(size_t) (image->resolution.x+0.5),p); (void) WriteProfileLong(endian,1UL,p+4); break; } case 0x011b: { (void) WriteProfileLong(endian,(size_t) (image->resolution.y+0.5),p); (void) WriteProfileLong(endian,1UL,p+4); break; } case 0x0112: { if (number_bytes == 4) { (void) WriteProfileLong(endian,(size_t) image->orientation,p); break; } (void) WriteProfileShort(endian,(unsigned short) image->orientation, p); break; } case 0x0128: { if (number_bytes == 4) { (void) WriteProfileLong(endian,(size_t) (image->units+1),p); break; } (void) WriteProfileShort(endian,(unsigned short) (image->units+1),p); break; } default: break; } if ((tag_value == TAG_EXIF_OFFSET) || (tag_value == TAG_INTEROP_OFFSET)) { offset=(ssize_t) ReadProfileLong(endian,p); if (((size_t) offset < length) && (level < (MaxDirectoryStack-2))) { directory_stack[level].directory=directory; entry++; directory_stack[level].entry=entry; level++; directory_stack[level].directory=exif+offset; directory_stack[level].entry=0; level++; if ((directory+2+(12*number_entries)) > (exif+length)) break; offset=(ssize_t) ReadProfileLong(endian,directory+2+(12* number_entries)); if ((offset != 0) && ((size_t) offset < length) && (level < (MaxDirectoryStack-2))) { directory_stack[level].directory=exif+offset; directory_stack[level].entry=0; level++; } } break; } } } while (level > 0); return(MagickTrue); }
C
ImageMagick
1
CVE-2016-4538
https://www.cvedetails.com/cve/CVE-2016-4538/
CWE-20
https://git.php.net/?p=php-src.git;a=commit;h=d650063a0457aec56364e4005a636dc6c401f9cd
d650063a0457aec56364e4005a636dc6c401f9cd
null
static PHP_GINIT_FUNCTION(bcmath) { bcmath_globals->bc_precision = 0; bc_init_numbers(TSRMLS_C); }
static PHP_GINIT_FUNCTION(bcmath) { bcmath_globals->bc_precision = 0; bc_init_numbers(TSRMLS_C); }
C
php
0
CVE-2011-4112
https://www.cvedetails.com/cve/CVE-2011-4112/
CWE-264
https://github.com/torvalds/linux/commit/550fd08c2cebad61c548def135f67aba284c6162
550fd08c2cebad61c548def135f67aba284c6162
net: Audit drivers to identify those needing IFF_TX_SKB_SHARING cleared After the last patch, We are left in a state in which only drivers calling ether_setup have IFF_TX_SKB_SHARING set (we assume that drivers touching real hardware call ether_setup for their net_devices and don't hold any state in their skbs. There are a handful of drivers that violate this assumption of course, and need to be fixed up. This patch identifies those drivers, and marks them as not being able to support the safe transmission of skbs by clearning the IFF_TX_SKB_SHARING flag in priv_flags Signed-off-by: Neil Horman <[email protected]> CC: Karsten Keil <[email protected]> CC: "David S. Miller" <[email protected]> CC: Jay Vosburgh <[email protected]> CC: Andy Gospodarek <[email protected]> CC: Patrick McHardy <[email protected]> CC: Krzysztof Halasa <[email protected]> CC: "John W. Linville" <[email protected]> CC: Greg Kroah-Hartman <[email protected]> CC: Marcel Holtmann <[email protected]> CC: Johannes Berg <[email protected]> Signed-off-by: David S. Miller <[email protected]>
static int pvc_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) { pvc_device *pvc = dev->ml_priv; fr_proto_pvc_info info; if (ifr->ifr_settings.type == IF_GET_PROTO) { if (dev->type == ARPHRD_ETHER) ifr->ifr_settings.type = IF_PROTO_FR_ETH_PVC; else ifr->ifr_settings.type = IF_PROTO_FR_PVC; if (ifr->ifr_settings.size < sizeof(info)) { /* data size wanted */ ifr->ifr_settings.size = sizeof(info); return -ENOBUFS; } info.dlci = pvc->dlci; memcpy(info.master, pvc->frad->name, IFNAMSIZ); if (copy_to_user(ifr->ifr_settings.ifs_ifsu.fr_pvc_info, &info, sizeof(info))) return -EFAULT; return 0; } return -EINVAL; }
static int pvc_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) { pvc_device *pvc = dev->ml_priv; fr_proto_pvc_info info; if (ifr->ifr_settings.type == IF_GET_PROTO) { if (dev->type == ARPHRD_ETHER) ifr->ifr_settings.type = IF_PROTO_FR_ETH_PVC; else ifr->ifr_settings.type = IF_PROTO_FR_PVC; if (ifr->ifr_settings.size < sizeof(info)) { /* data size wanted */ ifr->ifr_settings.size = sizeof(info); return -ENOBUFS; } info.dlci = pvc->dlci; memcpy(info.master, pvc->frad->name, IFNAMSIZ); if (copy_to_user(ifr->ifr_settings.ifs_ifsu.fr_pvc_info, &info, sizeof(info))) return -EFAULT; return 0; } return -EINVAL; }
C
linux
0
CVE-2018-13006
https://www.cvedetails.com/cve/CVE-2018-13006/
CWE-125
https://github.com/gpac/gpac/commit/bceb03fd2be95097a7b409ea59914f332fb6bc86
bceb03fd2be95097a7b409ea59914f332fb6bc86
fixed 2 possible heap overflows (inc. #1088)
GF_Box *tfdt_New() { ISOM_DECL_BOX_ALLOC(GF_TFBaseMediaDecodeTimeBox, GF_ISOM_BOX_TYPE_TFDT); return (GF_Box *)tmp; }
GF_Box *tfdt_New() { ISOM_DECL_BOX_ALLOC(GF_TFBaseMediaDecodeTimeBox, GF_ISOM_BOX_TYPE_TFDT); return (GF_Box *)tmp; }
C
gpac
0
CVE-2016-2487
https://www.cvedetails.com/cve/CVE-2016-2487/
CWE-20
https://android.googlesource.com/platform/frameworks/av/+/4e32001e4196f39ddd0b86686ae0231c8f5ed944
4e32001e4196f39ddd0b86686ae0231c8f5ed944
DO NOT MERGE codecs: check OMX buffer size before use in (vorbis|opus)dec Bug: 27833616 Change-Id: I1ccdd16a00741da072527a6d13e87fd7c7fe8c54
OMX_ERRORTYPE SoftOpus::internalSetParameter( OMX_INDEXTYPE index, const OMX_PTR params) { switch ((int)index) { case OMX_IndexParamStandardComponentRole: { const OMX_PARAM_COMPONENTROLETYPE *roleParams = (const OMX_PARAM_COMPONENTROLETYPE *)params; if (!isValidOMXParam(roleParams)) { return OMX_ErrorBadParameter; } if (strncmp((const char *)roleParams->cRole, "audio_decoder.opus", OMX_MAX_STRINGNAME_SIZE - 1)) { return OMX_ErrorUndefined; } return OMX_ErrorNone; } case OMX_IndexParamAudioAndroidOpus: { const OMX_AUDIO_PARAM_ANDROID_OPUSTYPE *opusParams = (const OMX_AUDIO_PARAM_ANDROID_OPUSTYPE *)params; if (!isValidOMXParam(opusParams)) { return OMX_ErrorBadParameter; } if (opusParams->nPortIndex != 0) { return OMX_ErrorUndefined; } return OMX_ErrorNone; } default: return SimpleSoftOMXComponent::internalSetParameter(index, params); } }
OMX_ERRORTYPE SoftOpus::internalSetParameter( OMX_INDEXTYPE index, const OMX_PTR params) { switch ((int)index) { case OMX_IndexParamStandardComponentRole: { const OMX_PARAM_COMPONENTROLETYPE *roleParams = (const OMX_PARAM_COMPONENTROLETYPE *)params; if (!isValidOMXParam(roleParams)) { return OMX_ErrorBadParameter; } if (strncmp((const char *)roleParams->cRole, "audio_decoder.opus", OMX_MAX_STRINGNAME_SIZE - 1)) { return OMX_ErrorUndefined; } return OMX_ErrorNone; } case OMX_IndexParamAudioAndroidOpus: { const OMX_AUDIO_PARAM_ANDROID_OPUSTYPE *opusParams = (const OMX_AUDIO_PARAM_ANDROID_OPUSTYPE *)params; if (!isValidOMXParam(opusParams)) { return OMX_ErrorBadParameter; } if (opusParams->nPortIndex != 0) { return OMX_ErrorUndefined; } return OMX_ErrorNone; } default: return SimpleSoftOMXComponent::internalSetParameter(index, params); } }
C
Android
0
CVE-2018-1000039
https://www.cvedetails.com/cve/CVE-2018-1000039/
CWE-416
http://git.ghostscript.com/?p=mupdf.git;a=commitdiff;h=4dcc6affe04368461310a21238f7e1871a752a05;hp=8ec561d1bccc46e9db40a9f61310cd8b3763914e
4dcc6affe04368461310a21238f7e1871a752a05
null
static void pdf_run_MP(fz_context *ctx, pdf_processor *proc, const char *tag) { }
static void pdf_run_MP(fz_context *ctx, pdf_processor *proc, const char *tag) { }
C
ghostscript
0
CVE-2013-0892
https://www.cvedetails.com/cve/CVE-2013-0892/
null
https://github.com/chromium/chromium/commit/da5e5f78f02bc0af5ddc5694090defbef7853af1
da5e5f78f02bc0af5ddc5694090defbef7853af1
DevTools: remove references to modules/device_orientation from core BUG=340221 Review URL: https://codereview.chromium.org/150913003 git-svn-id: svn://svn.chromium.org/blink/trunk@166493 bbb929c8-8fbe-4397-9dbb-9b2b20218538
bool InspectorPageAgent::applyViewportStyleOverride(StyleResolver* resolver) { if (!m_deviceMetricsOverridden || !m_emulateViewportEnabled) return false; RefPtr<StyleSheetContents> styleSheet = StyleSheetContents::create(CSSParserContext(UASheetMode)); styleSheet->parseString(String(viewportAndroidUserAgentStyleSheet, sizeof(viewportAndroidUserAgentStyleSheet))); OwnPtr<RuleSet> ruleSet = RuleSet::create(); ruleSet->addRulesFromSheet(styleSheet.get(), MediaQueryEvaluator("screen")); resolver->viewportStyleResolver()->collectViewportRules(ruleSet.get(), ViewportStyleResolver::UserAgentOrigin); return true; }
bool InspectorPageAgent::applyViewportStyleOverride(StyleResolver* resolver) { if (!m_deviceMetricsOverridden || !m_emulateViewportEnabled) return false; RefPtr<StyleSheetContents> styleSheet = StyleSheetContents::create(CSSParserContext(UASheetMode)); styleSheet->parseString(String(viewportAndroidUserAgentStyleSheet, sizeof(viewportAndroidUserAgentStyleSheet))); OwnPtr<RuleSet> ruleSet = RuleSet::create(); ruleSet->addRulesFromSheet(styleSheet.get(), MediaQueryEvaluator("screen")); resolver->viewportStyleResolver()->collectViewportRules(ruleSet.get(), ViewportStyleResolver::UserAgentOrigin); return true; }
C
Chrome
0
CVE-2019-5787
https://www.cvedetails.com/cve/CVE-2019-5787/
CWE-416
https://github.com/chromium/chromium/commit/6a7063ae61cf031630b48bdcdb09863ffc199962
6a7063ae61cf031630b48bdcdb09863ffc199962
Clean up CanvasResourceDispatcher on finalizer We may have pending mojo messages after GC, so we want to drop the dispatcher as soon as possible. Bug: 929757,913964 Change-Id: I5789bcbb55aada4a74c67a28758f07686f8911c0 Reviewed-on: https://chromium-review.googlesource.com/c/1489175 Reviewed-by: Ken Rockot <[email protected]> Commit-Queue: Ken Rockot <[email protected]> Commit-Queue: Fernando Serboncini <[email protected]> Auto-Submit: Fernando Serboncini <[email protected]> Cr-Commit-Position: refs/heads/master@{#635833}
void OffscreenCanvas::DidDraw(const FloatRect& rect) { if (rect.IsEmpty()) return; if (HasPlaceholderCanvas()) { needs_push_frame_ = true; GetOrCreateResourceDispatcher()->SetNeedsBeginFrame(true); } }
void OffscreenCanvas::DidDraw(const FloatRect& rect) { if (rect.IsEmpty()) return; if (HasPlaceholderCanvas()) { needs_push_frame_ = true; GetOrCreateResourceDispatcher()->SetNeedsBeginFrame(true); } }
C
Chrome
0
CVE-2016-10066
https://www.cvedetails.com/cve/CVE-2016-10066/
CWE-119
https://github.com/ImageMagick/ImageMagick/commit/f6e9d0d9955e85bdd7540b251cd50d598dacc5e6
f6e9d0d9955e85bdd7540b251cd50d598dacc5e6
null
static Image *ReadWMFImage(const ImageInfo *image_info,ExceptionInfo *exception) { char filename[MaxTextExtent]; int unique_file; FILE *file; Image *image; ImageInfo *read_info; MagickBooleanType status; size_t flags; wmfAPI *wmf_info; wmfAPI_Options options; wmfD_Rect bounding_box; wmf_eps_t *eps_info; wmf_error_t wmf_status; /* Read WMF image. */ image=AcquireImage(image_info); status=OpenBlob(image_info,image,ReadBinaryBlobMode,exception); if (status == MagickFalse) { image=DestroyImageList(image); return((Image *) NULL); } wmf_info=(wmfAPI *) NULL; flags=0; flags|=WMF_OPT_IGNORE_NONFATAL; flags|=WMF_OPT_FUNCTION; options.function=wmf_eps_function; wmf_status=wmf_api_create(&wmf_info,(unsigned long) flags,&options); if (wmf_status != wmf_E_None) { if (wmf_info != (wmfAPI *) NULL) wmf_api_destroy(wmf_info); ThrowReaderException(DelegateError,"UnableToInitializeWMFLibrary"); } wmf_status=wmf_bbuf_input(wmf_info,WMFReadBlob,WMFSeekBlob,WMFTellBlob, (void *) image); if (wmf_status != wmf_E_None) { wmf_api_destroy(wmf_info); ThrowFileException(exception,FileOpenError,"UnableToOpenFile", image->filename); image=DestroyImageList(image); return((Image *) NULL); } wmf_status=wmf_scan(wmf_info,0,&bounding_box); if (wmf_status != wmf_E_None) { wmf_api_destroy(wmf_info); ThrowReaderException(DelegateError,"FailedToScanFile"); } eps_info=WMF_EPS_GetData(wmf_info); file=(FILE *) NULL; unique_file=AcquireUniqueFileResource(filename); if (unique_file != -1) file=fdopen(unique_file,"wb"); if ((unique_file == -1) || (file == (FILE *) NULL)) { wmf_api_destroy(wmf_info); ThrowReaderException(FileOpenError,"UnableToCreateTemporaryFile"); } eps_info->out=wmf_stream_create(wmf_info,file); eps_info->bbox=bounding_box; wmf_status=wmf_play(wmf_info,0,&bounding_box); if (wmf_status != wmf_E_None) { wmf_api_destroy(wmf_info); ThrowReaderException(DelegateError,"FailedToRenderFile"); } (void) fclose(file); wmf_api_destroy(wmf_info); (void) CloseBlob(image); image=DestroyImage(image); /* Read EPS image. */ read_info=CloneImageInfo(image_info); SetImageInfoBlob(read_info,(void *) NULL,0); (void) FormatLocaleString(read_info->filename,MaxTextExtent,"eps:%s", filename); image=ReadImage(read_info,exception); read_info=DestroyImageInfo(read_info); if (image != (Image *) NULL) { (void) CopyMagickString(image->filename,image_info->filename, MaxTextExtent); (void) CopyMagickString(image->magick_filename,image_info->filename, MaxTextExtent); (void) CopyMagickString(image->magick,"WMF",MaxTextExtent); } (void) RelinquishUniqueFileResource(filename); return(GetFirstImageInList(image)); }
static Image *ReadWMFImage(const ImageInfo *image_info,ExceptionInfo *exception) { char filename[MaxTextExtent]; int unique_file; FILE *file; Image *image; ImageInfo *read_info; MagickBooleanType status; size_t flags; wmfAPI *wmf_info; wmfAPI_Options options; wmfD_Rect bounding_box; wmf_eps_t *eps_info; wmf_error_t wmf_status; /* Read WMF image. */ image=AcquireImage(image_info); status=OpenBlob(image_info,image,ReadBinaryBlobMode,exception); if (status == MagickFalse) { image=DestroyImageList(image); return((Image *) NULL); } wmf_info=(wmfAPI *) NULL; flags=0; flags|=WMF_OPT_IGNORE_NONFATAL; flags|=WMF_OPT_FUNCTION; options.function=wmf_eps_function; wmf_status=wmf_api_create(&wmf_info,(unsigned long) flags,&options); if (wmf_status != wmf_E_None) { if (wmf_info != (wmfAPI *) NULL) wmf_api_destroy(wmf_info); ThrowReaderException(DelegateError,"UnableToInitializeWMFLibrary"); } wmf_status=wmf_bbuf_input(wmf_info,WMFReadBlob,WMFSeekBlob,WMFTellBlob, (void *) image); if (wmf_status != wmf_E_None) { wmf_api_destroy(wmf_info); ThrowFileException(exception,FileOpenError,"UnableToOpenFile", image->filename); image=DestroyImageList(image); return((Image *) NULL); } wmf_status=wmf_scan(wmf_info,0,&bounding_box); if (wmf_status != wmf_E_None) { wmf_api_destroy(wmf_info); ThrowReaderException(DelegateError,"FailedToScanFile"); } eps_info=WMF_EPS_GetData(wmf_info); file=(FILE *) NULL; unique_file=AcquireUniqueFileResource(filename); if (unique_file != -1) file=fdopen(unique_file,"wb"); if ((unique_file == -1) || (file == (FILE *) NULL)) { wmf_api_destroy(wmf_info); ThrowReaderException(FileOpenError,"UnableToCreateTemporaryFile"); } eps_info->out=wmf_stream_create(wmf_info,file); eps_info->bbox=bounding_box; wmf_status=wmf_play(wmf_info,0,&bounding_box); if (wmf_status != wmf_E_None) { wmf_api_destroy(wmf_info); ThrowReaderException(DelegateError,"FailedToRenderFile"); } (void) fclose(file); wmf_api_destroy(wmf_info); (void) CloseBlob(image); image=DestroyImage(image); /* Read EPS image. */ read_info=CloneImageInfo(image_info); SetImageInfoBlob(read_info,(void *) NULL,0); (void) FormatLocaleString(read_info->filename,MaxTextExtent,"eps:%s", filename); image=ReadImage(read_info,exception); read_info=DestroyImageInfo(read_info); if (image != (Image *) NULL) { (void) CopyMagickString(image->filename,image_info->filename, MaxTextExtent); (void) CopyMagickString(image->magick_filename,image_info->filename, MaxTextExtent); (void) CopyMagickString(image->magick,"WMF",MaxTextExtent); } (void) RelinquishUniqueFileResource(filename); return(GetFirstImageInList(image)); }
C
ImageMagick
0
CVE-2013-0886
https://www.cvedetails.com/cve/CVE-2013-0886/
null
https://github.com/chromium/chromium/commit/18d67244984a574ba2dd8779faabc0e3e34f4b76
18d67244984a574ba2dd8779faabc0e3e34f4b76
Implement TextureImageTransportSurface using texture mailbox This has a couple of advantages: - allow tearing down and recreating the UI parent context without losing the renderer contexts - do not require a context to be able to generate textures when creating the GLSurfaceHandle - clearer ownership semantics that potentially allows for more robust and easier lost context handling/thumbnailing/etc., since a texture is at any given time owned by either: UI parent, mailbox, or TextureImageTransportSurface - simplify frontbuffer protection logic; the frontbuffer textures are now owned by RWHV where they are refcounted The TextureImageTransportSurface informs RenderWidgetHostView of the mailbox names for the front- and backbuffer textures by associating them with a surface_handle (1 or 2) in the AcceleratedSurfaceNew message. During SwapBuffers() or PostSubBuffer() cycles, it then uses produceTextureCHROMIUM() and consumeTextureCHROMIUM() to transfer ownership between renderer and browser compositor. RWHV sends back the surface_handle of the buffer being returned with the Swap ACK (or 0 if no buffer is being returned in which case TextureImageTransportSurface will allocate a new texture - note that this could be used to simply keep textures for thumbnailing). BUG=154815,139616 [email protected] Review URL: https://chromiumcodereview.appspot.com/11194042 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@171569 0039d316-1c4b-4281-b951-d872f2087c98
void RenderWidgetHostViewGtk::RenderViewGone(base::TerminationStatus status, int error_code) { Destroy(); plugin_container_manager_.set_host_widget(NULL); }
void RenderWidgetHostViewGtk::RenderViewGone(base::TerminationStatus status, int error_code) { Destroy(); plugin_container_manager_.set_host_widget(NULL); }
C
Chrome
0
CVE-2018-18338
https://www.cvedetails.com/cve/CVE-2018-18338/
CWE-119
https://github.com/chromium/chromium/commit/78d89fe556cb5dabbc47b4967cdf55e607e29580
78d89fe556cb5dabbc47b4967cdf55e607e29580
Fix *StaticBitmapImage ThreadChecker and unaccelerated SkImage destroy - AcceleratedStaticBitmapImage was misusing ThreadChecker by having its own detach logic. Using proper DetachThread is simpler, cleaner and correct. - UnacceleratedStaticBitmapImage didn't destroy the SkImage in the proper thread, leading to GrContext/SkSp problems. Bug: 890576 Change-Id: Ic71e7f7322b0b851774628247aa5256664bc0723 Reviewed-on: https://chromium-review.googlesource.com/c/1307775 Reviewed-by: Gabriel Charette <[email protected]> Reviewed-by: Jeremy Roman <[email protected]> Commit-Queue: Fernando Serboncini <[email protected]> Cr-Commit-Position: refs/heads/master@{#604427}
bool AcceleratedStaticBitmapImage::CopyToTexture( gpu::gles2::GLES2Interface* dest_gl, GLenum dest_target, GLuint dest_texture_id, bool unpack_premultiply_alpha, bool unpack_flip_y, const IntPoint& dest_point, const IntRect& source_sub_rectangle) { DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); if (!IsValid()) return false; DCHECK(texture_holder_->IsCrossThread() || dest_gl != ContextProviderWrapper()->ContextProvider()->ContextGL()); EnsureMailbox(kUnverifiedSyncToken, GL_NEAREST); dest_gl->WaitSyncTokenCHROMIUM( texture_holder_->GetSyncToken().GetConstData()); GLuint source_texture_id = dest_gl->CreateAndConsumeTextureCHROMIUM( texture_holder_->GetMailbox().name); dest_gl->CopySubTextureCHROMIUM( source_texture_id, 0, dest_target, dest_texture_id, 0, dest_point.X(), dest_point.Y(), source_sub_rectangle.X(), source_sub_rectangle.Y(), source_sub_rectangle.Width(), source_sub_rectangle.Height(), unpack_flip_y ? GL_FALSE : GL_TRUE, GL_FALSE, unpack_premultiply_alpha ? GL_FALSE : GL_TRUE); dest_gl->DeleteTextures(1, &source_texture_id); gpu::SyncToken sync_token; dest_gl->GenUnverifiedSyncTokenCHROMIUM(sync_token.GetData()); texture_holder_->UpdateSyncToken(sync_token); return true; }
bool AcceleratedStaticBitmapImage::CopyToTexture( gpu::gles2::GLES2Interface* dest_gl, GLenum dest_target, GLuint dest_texture_id, bool unpack_premultiply_alpha, bool unpack_flip_y, const IntPoint& dest_point, const IntRect& source_sub_rectangle) { CheckThread(); if (!IsValid()) return false; DCHECK(texture_holder_->IsCrossThread() || dest_gl != ContextProviderWrapper()->ContextProvider()->ContextGL()); EnsureMailbox(kUnverifiedSyncToken, GL_NEAREST); dest_gl->WaitSyncTokenCHROMIUM( texture_holder_->GetSyncToken().GetConstData()); GLuint source_texture_id = dest_gl->CreateAndConsumeTextureCHROMIUM( texture_holder_->GetMailbox().name); dest_gl->CopySubTextureCHROMIUM( source_texture_id, 0, dest_target, dest_texture_id, 0, dest_point.X(), dest_point.Y(), source_sub_rectangle.X(), source_sub_rectangle.Y(), source_sub_rectangle.Width(), source_sub_rectangle.Height(), unpack_flip_y ? GL_FALSE : GL_TRUE, GL_FALSE, unpack_premultiply_alpha ? GL_FALSE : GL_TRUE); dest_gl->DeleteTextures(1, &source_texture_id); gpu::SyncToken sync_token; dest_gl->GenUnverifiedSyncTokenCHROMIUM(sync_token.GetData()); texture_holder_->UpdateSyncToken(sync_token); return true; }
C
Chrome
1
CVE-2012-2875
https://www.cvedetails.com/cve/CVE-2012-2875/
null
https://github.com/chromium/chromium/commit/d345af9ed62ee5f431be327967f41c3cc3fe936a
d345af9ed62ee5f431be327967f41c3cc3fe936a
[BlackBerry] Adapt to new BlackBerry::Platform::TouchPoint API https://bugs.webkit.org/show_bug.cgi?id=105143 RIM PR 171941 Reviewed by Rob Buis. Internally reviewed by George Staikos. Source/WebCore: TouchPoint instances now provide document coordinates for the viewport and content position of the touch event. The pixel coordinates stored in the TouchPoint should no longer be needed in WebKit. Also adapt to new method names and encapsulation of TouchPoint data members. No change in behavior, no new tests. * platform/blackberry/PlatformTouchPointBlackBerry.cpp: (WebCore::PlatformTouchPoint::PlatformTouchPoint): Source/WebKit/blackberry: TouchPoint instances now provide document coordinates for the viewport and content position of the touch event. The pixel coordinates stored in the TouchPoint should no longer be needed in WebKit. One exception is when passing events to a full screen plugin. Also adapt to new method names and encapsulation of TouchPoint data members. * Api/WebPage.cpp: (BlackBerry::WebKit::WebPage::touchEvent): (BlackBerry::WebKit::WebPage::touchPointAsMouseEvent): (BlackBerry::WebKit::WebPagePrivate::dispatchTouchEventToFullScreenPlugin): (BlackBerry::WebKit::WebPagePrivate::dispatchTouchPointAsMouseEventToFullScreenPlugin): * WebKitSupport/InputHandler.cpp: (BlackBerry::WebKit::InputHandler::shouldRequestSpellCheckingOptionsForPoint): * WebKitSupport/InputHandler.h: (InputHandler): * WebKitSupport/TouchEventHandler.cpp: (BlackBerry::WebKit::TouchEventHandler::doFatFingers): (BlackBerry::WebKit::TouchEventHandler::handleTouchPoint): * WebKitSupport/TouchEventHandler.h: (TouchEventHandler): Tools: Adapt to new method names and encapsulation of TouchPoint data members. * DumpRenderTree/blackberry/EventSender.cpp: (addTouchPointCallback): (updateTouchPointCallback): (touchEndCallback): (releaseTouchPointCallback): (sendTouchEvent): git-svn-id: svn://svn.chromium.org/blink/trunk@137880 bbb929c8-8fbe-4397-9dbb-9b2b20218538
int32_t WebPage::setComposingText(spannable_string_t* spannableString, int32_t relativeCursorPosition) { if (d->m_page->defersLoading()) return -1; return d->m_inputHandler->setComposingText(spannableString, relativeCursorPosition); }
int32_t WebPage::setComposingText(spannable_string_t* spannableString, int32_t relativeCursorPosition) { if (d->m_page->defersLoading()) return -1; return d->m_inputHandler->setComposingText(spannableString, relativeCursorPosition); }
C
Chrome
0
CVE-2017-0813
https://www.cvedetails.com/cve/CVE-2017-0813/
CWE-772
https://android.googlesource.com/platform/frameworks/av/+/7fa3f552a6f34ed05c15e64ea30b8eed53f77a41
7fa3f552a6f34ed05c15e64ea30b8eed53f77a41
Fix 'potential memory leak' compiler warning. This CL fixes the following compiler warning: frameworks/av/media/libstagefright/SampleTable.cpp:569:9: warning: Memory allocated by 'new[]' should be deallocated by 'delete[]', not 'delete'. Bug: 33137046 Test: Compiled with change; no warning generated. Change-Id: I29abd90e02bf482fa840d1f7206ebbdacf7dfa37 (cherry picked from commit 158c197b668ad684f92829db6a31bee3aec794ba) (cherry picked from commit 37c428cd521351837fccb6864f509f996820b234)
int32_t SampleTable::CompositionDeltaLookup::getCompositionTimeOffset( uint32_t sampleIndex) { Mutex::Autolock autolock(mLock); if (mDeltaEntries == NULL) { return 0; } if (sampleIndex < mCurrentEntrySampleIndex) { mCurrentDeltaEntry = 0; mCurrentEntrySampleIndex = 0; } while (mCurrentDeltaEntry < mNumDeltaEntries) { uint32_t sampleCount = mDeltaEntries[2 * mCurrentDeltaEntry]; if (sampleIndex < mCurrentEntrySampleIndex + sampleCount) { return mDeltaEntries[2 * mCurrentDeltaEntry + 1]; } mCurrentEntrySampleIndex += sampleCount; ++mCurrentDeltaEntry; } return 0; }
int32_t SampleTable::CompositionDeltaLookup::getCompositionTimeOffset( uint32_t sampleIndex) { Mutex::Autolock autolock(mLock); if (mDeltaEntries == NULL) { return 0; } if (sampleIndex < mCurrentEntrySampleIndex) { mCurrentDeltaEntry = 0; mCurrentEntrySampleIndex = 0; } while (mCurrentDeltaEntry < mNumDeltaEntries) { uint32_t sampleCount = mDeltaEntries[2 * mCurrentDeltaEntry]; if (sampleIndex < mCurrentEntrySampleIndex + sampleCount) { return mDeltaEntries[2 * mCurrentDeltaEntry + 1]; } mCurrentEntrySampleIndex += sampleCount; ++mCurrentDeltaEntry; } return 0; }
C
Android
0
CVE-2011-1292
https://www.cvedetails.com/cve/CVE-2011-1292/
CWE-399
https://github.com/chromium/chromium/commit/5f372f899b8709dac700710b5f0f90959dcf9ecb
5f372f899b8709dac700710b5f0f90959dcf9ecb
Add support for autofill server experiments BUG=none TEST=unit_tests --gtest_filter=AutoFillMetricsTest.QualityMetricsWithExperimentId:AutoFillQueryXmlParserTest.ParseExperimentId Review URL: http://codereview.chromium.org/6260027 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@73216 0039d316-1c4b-4281-b951-d872f2087c98
void AutoFillManager::OnInfoBarClosed(bool should_save) { if (should_save) personal_data_->SaveImportedCreditCard(); }
void AutoFillManager::OnInfoBarClosed(bool should_save) { if (should_save) personal_data_->SaveImportedCreditCard(); }
C
Chrome
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 __net_init int ipv4_mib_init_net(struct net *net) { if (snmp_mib_init((void __percpu **)net->mib.tcp_statistics, sizeof(struct tcp_mib), __alignof__(struct tcp_mib)) < 0) goto err_tcp_mib; if (snmp_mib_init((void __percpu **)net->mib.ip_statistics, sizeof(struct ipstats_mib), __alignof__(struct ipstats_mib)) < 0) goto err_ip_mib; if (snmp_mib_init((void __percpu **)net->mib.net_statistics, sizeof(struct linux_mib), __alignof__(struct linux_mib)) < 0) goto err_net_mib; if (snmp_mib_init((void __percpu **)net->mib.udp_statistics, sizeof(struct udp_mib), __alignof__(struct udp_mib)) < 0) goto err_udp_mib; if (snmp_mib_init((void __percpu **)net->mib.udplite_statistics, sizeof(struct udp_mib), __alignof__(struct udp_mib)) < 0) goto err_udplite_mib; if (snmp_mib_init((void __percpu **)net->mib.icmp_statistics, sizeof(struct icmp_mib), __alignof__(struct icmp_mib)) < 0) goto err_icmp_mib; if (snmp_mib_init((void __percpu **)net->mib.icmpmsg_statistics, sizeof(struct icmpmsg_mib), __alignof__(struct icmpmsg_mib)) < 0) goto err_icmpmsg_mib; tcp_mib_init(net); return 0; err_icmpmsg_mib: snmp_mib_free((void __percpu **)net->mib.icmp_statistics); err_icmp_mib: snmp_mib_free((void __percpu **)net->mib.udplite_statistics); err_udplite_mib: snmp_mib_free((void __percpu **)net->mib.udp_statistics); err_udp_mib: snmp_mib_free((void __percpu **)net->mib.net_statistics); err_net_mib: snmp_mib_free((void __percpu **)net->mib.ip_statistics); err_ip_mib: snmp_mib_free((void __percpu **)net->mib.tcp_statistics); err_tcp_mib: return -ENOMEM; }
static __net_init int ipv4_mib_init_net(struct net *net) { if (snmp_mib_init((void __percpu **)net->mib.tcp_statistics, sizeof(struct tcp_mib), __alignof__(struct tcp_mib)) < 0) goto err_tcp_mib; if (snmp_mib_init((void __percpu **)net->mib.ip_statistics, sizeof(struct ipstats_mib), __alignof__(struct ipstats_mib)) < 0) goto err_ip_mib; if (snmp_mib_init((void __percpu **)net->mib.net_statistics, sizeof(struct linux_mib), __alignof__(struct linux_mib)) < 0) goto err_net_mib; if (snmp_mib_init((void __percpu **)net->mib.udp_statistics, sizeof(struct udp_mib), __alignof__(struct udp_mib)) < 0) goto err_udp_mib; if (snmp_mib_init((void __percpu **)net->mib.udplite_statistics, sizeof(struct udp_mib), __alignof__(struct udp_mib)) < 0) goto err_udplite_mib; if (snmp_mib_init((void __percpu **)net->mib.icmp_statistics, sizeof(struct icmp_mib), __alignof__(struct icmp_mib)) < 0) goto err_icmp_mib; if (snmp_mib_init((void __percpu **)net->mib.icmpmsg_statistics, sizeof(struct icmpmsg_mib), __alignof__(struct icmpmsg_mib)) < 0) goto err_icmpmsg_mib; tcp_mib_init(net); return 0; err_icmpmsg_mib: snmp_mib_free((void __percpu **)net->mib.icmp_statistics); err_icmp_mib: snmp_mib_free((void __percpu **)net->mib.udplite_statistics); err_udplite_mib: snmp_mib_free((void __percpu **)net->mib.udp_statistics); err_udp_mib: snmp_mib_free((void __percpu **)net->mib.net_statistics); err_net_mib: snmp_mib_free((void __percpu **)net->mib.ip_statistics); err_ip_mib: snmp_mib_free((void __percpu **)net->mib.tcp_statistics); err_tcp_mib: return -ENOMEM; }
C
linux
0
CVE-2018-19497
https://www.cvedetails.com/cve/CVE-2018-19497/
CWE-125
https://github.com/sleuthkit/sleuthkit/commit/bc04aa017c0bd297de8a3b7fc40ffc6ddddbb95d
bc04aa017c0bd297de8a3b7fc40ffc6ddddbb95d
Merge pull request #1374 from JordyZomer/develop Fix CVE-2018-19497.
hfs_load_attrs(TSK_FS_FILE * fs_file) { TSK_FS_INFO *fs; HFS_INFO *hfs; TSK_FS_ATTR *fs_attr; TSK_FS_ATTR_RUN *attr_run; hfs_fork *forkx; unsigned char resource_fork_has_contents = FALSE; unsigned char compression_flag = FALSE; unsigned char isCompressed = FALSE; unsigned char compDataInRSRCFork = FALSE; unsigned char cmpType = 0; uint64_t uncompressedSize; uint64_t logicalSize; // of a fork tsk_error_reset(); if ((fs_file == NULL) || (fs_file->meta == NULL) || (fs_file->fs_info == NULL)) { error_detected(TSK_ERR_FS_ARG, "hfs_load_attrs: fs_file or meta is NULL"); return 1; } fs = (TSK_FS_INFO *) fs_file->fs_info; hfs = (HFS_INFO *) fs; if (tsk_verbose) tsk_fprintf(stderr, "hfs_load_attrs: Processing file %" PRIuINUM "\n", fs_file->meta->addr); if (fs_file->meta->attr_state == TSK_FS_META_ATTR_STUDIED) { if (tsk_verbose) tsk_fprintf(stderr, "hfs_load_attrs: Attributes already loaded\n"); return 0; } else if (fs_file->meta->attr_state == TSK_FS_META_ATTR_ERROR) { if (tsk_verbose) tsk_fprintf(stderr, "hfs_load_attrs: Previous attempt to load attributes resulted in error\n"); return 1; } if (fs_file->meta->attr != NULL) { tsk_fs_attrlist_markunused(fs_file->meta->attr); } else if (fs_file->meta->attr == NULL) { fs_file->meta->attr = tsk_fs_attrlist_alloc(); } /****************** EXTENDED ATTRIBUTES *******************************/ if (tsk_verbose) tsk_fprintf(stderr, "hfs_load_attrs: loading the HFS+ extended attributes\n"); if (hfs_load_extended_attrs(fs_file, &isCompressed, &cmpType, &uncompressedSize)) { error_returned(" - hfs_load_attrs A"); fs_file->meta->attr_state = TSK_FS_META_ATTR_ERROR; return 1; } switch (cmpType) { case DECMPFS_TYPE_ZLIB_RSRC: case DECMPFS_TYPE_LZVN_RSRC: compDataInRSRCFork = TRUE; break; default: compDataInRSRCFork = FALSE; break; } if (isCompressed) { fs_file->meta->size = uncompressedSize; } compression_flag = (fs_file->meta->flags & TSK_FS_META_FLAG_COMP) != 0; if (compression_flag && !isCompressed) { if (tsk_verbose) tsk_fprintf(stderr, "hfs_load_attrs: WARNING, HFS marks this as a" " compressed file, but no compression record was found.\n"); } if (isCompressed && !compression_flag) { if (tsk_verbose) tsk_fprintf(stderr, "hfs_load_attrs: WARNING, this file has a compression" " record, but the HFS compression flag is not set.\n"); } /************* FORKS (both) ************************************/ if (fs_file->meta->content_ptr != NULL) { /************** DATA FORK STUFF ***************************/ forkx = (hfs_fork *) fs_file->meta->content_ptr; if (!isCompressed) { logicalSize = tsk_getu64(fs->endian, forkx->logic_sz); if (logicalSize > 0 || fs_file->meta->type == TSK_FS_META_TYPE_REG || fs_file->meta->type == TSK_FS_META_TYPE_LNK) { if (tsk_verbose) tsk_fprintf(stderr, "hfs_load_attrs: loading the data fork attribute\n"); if ((fs_attr = tsk_fs_attrlist_getnew(fs_file->meta->attr, TSK_FS_ATTR_NONRES)) == NULL) { error_returned(" - hfs_load_attrs"); return 1; } /* NOTE that fs_attr is now tied to fs_file->meta->attr. * that means that we do not need to free it if we abort in the * following code (and doing so will cause double free errors). */ if (logicalSize > 0) { if (((attr_run = hfs_extents_to_attr(fs, forkx->extents, 0)) == NULL) && (tsk_error_get_errno() != 0)) { error_returned(" - hfs_load_attrs"); return 1; } if (tsk_fs_attr_set_run(fs_file, fs_attr, attr_run, "", TSK_FS_ATTR_TYPE_HFS_DATA, HFS_FS_ATTR_ID_DATA, logicalSize, logicalSize, (TSK_OFF_T) tsk_getu32(fs->endian, forkx->total_blk) * fs->block_size, 0, 0)) { error_returned(" - hfs_load_attrs (DATA)"); tsk_fs_attr_run_free(attr_run); return 1; } if (hfs_ext_find_extent_record_attr(hfs, (uint32_t) fs_file->meta->addr, fs_attr, TRUE)) { error_returned(" - hfs_load_attrs B"); fs_file->meta->attr_state = TSK_FS_META_ATTR_ERROR; return 1; } } else { if (tsk_fs_attr_set_run(fs_file, fs_attr, NULL, "", TSK_FS_ATTR_TYPE_HFS_DATA, HFS_FS_ATTR_ID_DATA, 0, 0, 0, 0, 0)) { error_returned(" - hfs_load_attrs (non-file)"); return 1; } } } // END logicalSize>0 or REG or LNK file type } // END if not Compressed /************** RESOURCE FORK STUFF ************************************/ forkx = &((hfs_fork *) fs_file->meta->content_ptr)[1]; logicalSize = tsk_getu64(fs->endian, forkx->logic_sz); if (logicalSize > 0) { if (tsk_verbose) tsk_fprintf(stderr, "hfs_load_attrs: loading the resource fork\n"); resource_fork_has_contents = TRUE; if ((fs_attr = tsk_fs_attrlist_getnew(fs_file->meta->attr, TSK_FS_ATTR_NONRES)) == NULL) { error_returned(" - hfs_load_attrs (RSRC)"); return 1; } /* NOTE that fs_attr is now tied to fs_file->meta->attr. * that means that we do not need to free it if we abort in the * following code (and doing so will cause double free errors). */ if (((attr_run = hfs_extents_to_attr(fs, forkx->extents, 0)) == NULL) && (tsk_error_get_errno() != 0)) { error_returned(" - hfs_load_attrs"); return 1; } if (tsk_fs_attr_set_run(fs_file, fs_attr, attr_run, "RSRC", TSK_FS_ATTR_TYPE_HFS_RSRC, HFS_FS_ATTR_ID_RSRC, tsk_getu64(fs->endian, forkx->logic_sz), tsk_getu64(fs->endian, forkx->logic_sz), (TSK_OFF_T) tsk_getu32(fs->endian, forkx->total_blk) * fs->block_size, 0, 0)) { error_returned(" - hfs_load_attrs (RSRC)"); tsk_fs_attr_run_free(attr_run); return 1; } if (hfs_ext_find_extent_record_attr(hfs, (uint32_t) fs_file->meta->addr, fs_attr, FALSE)) { error_returned(" - hfs_load_attrs C"); fs_file->meta->attr_state = TSK_FS_META_ATTR_ERROR; return 1; } if (isCompressed && compDataInRSRCFork) { if (tsk_verbose) tsk_fprintf(stderr, "File is compressed with data in the resource fork. " "Loading the default DATA attribute.\n"); if ((fs_attr = tsk_fs_attrlist_getnew(fs_file->meta->attr, TSK_FS_ATTR_NONRES)) == NULL) { error_returned (" - hfs_load_attrs (RSRC loading as DATA)"); return 1; } /* NOTE that fs_attr is now tied to fs_file->meta->attr. * that means that we do not need to free it if we abort in the * following code (and doing so will cause double free errors). */ switch (cmpType) { case DECMPFS_TYPE_ZLIB_RSRC: #ifdef HAVE_LIBZ fs_attr->w = hfs_attr_walk_zlib_rsrc; fs_attr->r = hfs_file_read_zlib_rsrc; #else if (tsk_verbose) tsk_fprintf(stderr, "hfs_load_attrs: No zlib compression library, so setting a zero-length default DATA attribute.\n"); if (tsk_fs_attr_set_run(fs_file, fs_attr, NULL, "DATA", TSK_FS_ATTR_TYPE_HFS_DATA, HFS_FS_ATTR_ID_DATA, 0, 0, 0, 0, 0)) { error_returned(" - hfs_load_attrs (non-file)"); return 1; } #endif break; case DECMPFS_TYPE_LZVN_RSRC: fs_attr->w = hfs_attr_walk_lzvn_rsrc; fs_attr->r = hfs_file_read_lzvn_rsrc; break; } if (((attr_run = hfs_extents_to_attr(fs, forkx->extents, 0)) == NULL) && (tsk_error_get_errno() != 0)) { error_returned (" - hfs_load_attrs, RSRC fork as DATA fork"); return 1; } if (tsk_verbose) tsk_fprintf(stderr, "hfs_load_attrs: Loading RSRC fork block runs as the default DATA attribute.\n"); if (tsk_fs_attr_set_run(fs_file, fs_attr, attr_run, "DECOMP", TSK_FS_ATTR_TYPE_HFS_DATA, HFS_FS_ATTR_ID_DATA, logicalSize, logicalSize, (TSK_OFF_T) tsk_getu32(fs->endian, forkx->total_blk) * fs->block_size, TSK_FS_ATTR_COMP | TSK_FS_ATTR_NONRES, 0)) { error_returned (" - hfs_load_attrs (RSRC loading as DATA)"); tsk_fs_attr_run_free(attr_run); return 1; } if (hfs_ext_find_extent_record_attr(hfs, (uint32_t) fs_file->meta->addr, fs_attr, FALSE)) { error_returned (" - hfs_load_attrs (RSRC loading as DATA"); fs_file->meta->attr_state = TSK_FS_META_ATTR_ERROR; return 1; } if (tsk_verbose) tsk_fprintf(stderr, "hfs_load_attrs: setting the \"special\" function pointers to inflate compressed data.\n"); } } // END resource fork size > 0 } // END the fork data structures are non-NULL if (isCompressed && compDataInRSRCFork && !resource_fork_has_contents) { if (tsk_verbose) tsk_fprintf(stderr, "hfs_load_attrs: WARNING, compression record claims that compressed data" " is in the Resource Fork, but that fork is empty or non-existent.\n"); } fs_file->meta->attr_state = TSK_FS_META_ATTR_STUDIED; return 0; }
hfs_load_attrs(TSK_FS_FILE * fs_file) { TSK_FS_INFO *fs; HFS_INFO *hfs; TSK_FS_ATTR *fs_attr; TSK_FS_ATTR_RUN *attr_run; hfs_fork *forkx; unsigned char resource_fork_has_contents = FALSE; unsigned char compression_flag = FALSE; unsigned char isCompressed = FALSE; unsigned char compDataInRSRCFork = FALSE; unsigned char cmpType = 0; uint64_t uncompressedSize; uint64_t logicalSize; // of a fork tsk_error_reset(); if ((fs_file == NULL) || (fs_file->meta == NULL) || (fs_file->fs_info == NULL)) { error_detected(TSK_ERR_FS_ARG, "hfs_load_attrs: fs_file or meta is NULL"); return 1; } fs = (TSK_FS_INFO *) fs_file->fs_info; hfs = (HFS_INFO *) fs; if (tsk_verbose) tsk_fprintf(stderr, "hfs_load_attrs: Processing file %" PRIuINUM "\n", fs_file->meta->addr); if (fs_file->meta->attr_state == TSK_FS_META_ATTR_STUDIED) { if (tsk_verbose) tsk_fprintf(stderr, "hfs_load_attrs: Attributes already loaded\n"); return 0; } else if (fs_file->meta->attr_state == TSK_FS_META_ATTR_ERROR) { if (tsk_verbose) tsk_fprintf(stderr, "hfs_load_attrs: Previous attempt to load attributes resulted in error\n"); return 1; } if (fs_file->meta->attr != NULL) { tsk_fs_attrlist_markunused(fs_file->meta->attr); } else if (fs_file->meta->attr == NULL) { fs_file->meta->attr = tsk_fs_attrlist_alloc(); } /****************** EXTENDED ATTRIBUTES *******************************/ if (tsk_verbose) tsk_fprintf(stderr, "hfs_load_attrs: loading the HFS+ extended attributes\n"); if (hfs_load_extended_attrs(fs_file, &isCompressed, &cmpType, &uncompressedSize)) { error_returned(" - hfs_load_attrs A"); fs_file->meta->attr_state = TSK_FS_META_ATTR_ERROR; return 1; } switch (cmpType) { case DECMPFS_TYPE_ZLIB_RSRC: case DECMPFS_TYPE_LZVN_RSRC: compDataInRSRCFork = TRUE; break; default: compDataInRSRCFork = FALSE; break; } if (isCompressed) { fs_file->meta->size = uncompressedSize; } compression_flag = (fs_file->meta->flags & TSK_FS_META_FLAG_COMP) != 0; if (compression_flag && !isCompressed) { if (tsk_verbose) tsk_fprintf(stderr, "hfs_load_attrs: WARNING, HFS marks this as a" " compressed file, but no compression record was found.\n"); } if (isCompressed && !compression_flag) { if (tsk_verbose) tsk_fprintf(stderr, "hfs_load_attrs: WARNING, this file has a compression" " record, but the HFS compression flag is not set.\n"); } /************* FORKS (both) ************************************/ if (fs_file->meta->content_ptr != NULL) { /************** DATA FORK STUFF ***************************/ forkx = (hfs_fork *) fs_file->meta->content_ptr; if (!isCompressed) { logicalSize = tsk_getu64(fs->endian, forkx->logic_sz); if (logicalSize > 0 || fs_file->meta->type == TSK_FS_META_TYPE_REG || fs_file->meta->type == TSK_FS_META_TYPE_LNK) { if (tsk_verbose) tsk_fprintf(stderr, "hfs_load_attrs: loading the data fork attribute\n"); if ((fs_attr = tsk_fs_attrlist_getnew(fs_file->meta->attr, TSK_FS_ATTR_NONRES)) == NULL) { error_returned(" - hfs_load_attrs"); return 1; } /* NOTE that fs_attr is now tied to fs_file->meta->attr. * that means that we do not need to free it if we abort in the * following code (and doing so will cause double free errors). */ if (logicalSize > 0) { if (((attr_run = hfs_extents_to_attr(fs, forkx->extents, 0)) == NULL) && (tsk_error_get_errno() != 0)) { error_returned(" - hfs_load_attrs"); return 1; } if (tsk_fs_attr_set_run(fs_file, fs_attr, attr_run, "", TSK_FS_ATTR_TYPE_HFS_DATA, HFS_FS_ATTR_ID_DATA, logicalSize, logicalSize, (TSK_OFF_T) tsk_getu32(fs->endian, forkx->total_blk) * fs->block_size, 0, 0)) { error_returned(" - hfs_load_attrs (DATA)"); tsk_fs_attr_run_free(attr_run); return 1; } if (hfs_ext_find_extent_record_attr(hfs, (uint32_t) fs_file->meta->addr, fs_attr, TRUE)) { error_returned(" - hfs_load_attrs B"); fs_file->meta->attr_state = TSK_FS_META_ATTR_ERROR; return 1; } } else { if (tsk_fs_attr_set_run(fs_file, fs_attr, NULL, "", TSK_FS_ATTR_TYPE_HFS_DATA, HFS_FS_ATTR_ID_DATA, 0, 0, 0, 0, 0)) { error_returned(" - hfs_load_attrs (non-file)"); return 1; } } } // END logicalSize>0 or REG or LNK file type } // END if not Compressed /************** RESOURCE FORK STUFF ************************************/ forkx = &((hfs_fork *) fs_file->meta->content_ptr)[1]; logicalSize = tsk_getu64(fs->endian, forkx->logic_sz); if (logicalSize > 0) { if (tsk_verbose) tsk_fprintf(stderr, "hfs_load_attrs: loading the resource fork\n"); resource_fork_has_contents = TRUE; if ((fs_attr = tsk_fs_attrlist_getnew(fs_file->meta->attr, TSK_FS_ATTR_NONRES)) == NULL) { error_returned(" - hfs_load_attrs (RSRC)"); return 1; } /* NOTE that fs_attr is now tied to fs_file->meta->attr. * that means that we do not need to free it if we abort in the * following code (and doing so will cause double free errors). */ if (((attr_run = hfs_extents_to_attr(fs, forkx->extents, 0)) == NULL) && (tsk_error_get_errno() != 0)) { error_returned(" - hfs_load_attrs"); return 1; } if (tsk_fs_attr_set_run(fs_file, fs_attr, attr_run, "RSRC", TSK_FS_ATTR_TYPE_HFS_RSRC, HFS_FS_ATTR_ID_RSRC, tsk_getu64(fs->endian, forkx->logic_sz), tsk_getu64(fs->endian, forkx->logic_sz), (TSK_OFF_T) tsk_getu32(fs->endian, forkx->total_blk) * fs->block_size, 0, 0)) { error_returned(" - hfs_load_attrs (RSRC)"); tsk_fs_attr_run_free(attr_run); return 1; } if (hfs_ext_find_extent_record_attr(hfs, (uint32_t) fs_file->meta->addr, fs_attr, FALSE)) { error_returned(" - hfs_load_attrs C"); fs_file->meta->attr_state = TSK_FS_META_ATTR_ERROR; return 1; } if (isCompressed && compDataInRSRCFork) { if (tsk_verbose) tsk_fprintf(stderr, "File is compressed with data in the resource fork. " "Loading the default DATA attribute.\n"); if ((fs_attr = tsk_fs_attrlist_getnew(fs_file->meta->attr, TSK_FS_ATTR_NONRES)) == NULL) { error_returned (" - hfs_load_attrs (RSRC loading as DATA)"); return 1; } /* NOTE that fs_attr is now tied to fs_file->meta->attr. * that means that we do not need to free it if we abort in the * following code (and doing so will cause double free errors). */ switch (cmpType) { case DECMPFS_TYPE_ZLIB_RSRC: #ifdef HAVE_LIBZ fs_attr->w = hfs_attr_walk_zlib_rsrc; fs_attr->r = hfs_file_read_zlib_rsrc; #else if (tsk_verbose) tsk_fprintf(stderr, "hfs_load_attrs: No zlib compression library, so setting a zero-length default DATA attribute.\n"); if (tsk_fs_attr_set_run(fs_file, fs_attr, NULL, "DATA", TSK_FS_ATTR_TYPE_HFS_DATA, HFS_FS_ATTR_ID_DATA, 0, 0, 0, 0, 0)) { error_returned(" - hfs_load_attrs (non-file)"); return 1; } #endif break; case DECMPFS_TYPE_LZVN_RSRC: fs_attr->w = hfs_attr_walk_lzvn_rsrc; fs_attr->r = hfs_file_read_lzvn_rsrc; break; } if (((attr_run = hfs_extents_to_attr(fs, forkx->extents, 0)) == NULL) && (tsk_error_get_errno() != 0)) { error_returned (" - hfs_load_attrs, RSRC fork as DATA fork"); return 1; } if (tsk_verbose) tsk_fprintf(stderr, "hfs_load_attrs: Loading RSRC fork block runs as the default DATA attribute.\n"); if (tsk_fs_attr_set_run(fs_file, fs_attr, attr_run, "DECOMP", TSK_FS_ATTR_TYPE_HFS_DATA, HFS_FS_ATTR_ID_DATA, logicalSize, logicalSize, (TSK_OFF_T) tsk_getu32(fs->endian, forkx->total_blk) * fs->block_size, TSK_FS_ATTR_COMP | TSK_FS_ATTR_NONRES, 0)) { error_returned (" - hfs_load_attrs (RSRC loading as DATA)"); tsk_fs_attr_run_free(attr_run); return 1; } if (hfs_ext_find_extent_record_attr(hfs, (uint32_t) fs_file->meta->addr, fs_attr, FALSE)) { error_returned (" - hfs_load_attrs (RSRC loading as DATA"); fs_file->meta->attr_state = TSK_FS_META_ATTR_ERROR; return 1; } if (tsk_verbose) tsk_fprintf(stderr, "hfs_load_attrs: setting the \"special\" function pointers to inflate compressed data.\n"); } } // END resource fork size > 0 } // END the fork data structures are non-NULL if (isCompressed && compDataInRSRCFork && !resource_fork_has_contents) { if (tsk_verbose) tsk_fprintf(stderr, "hfs_load_attrs: WARNING, compression record claims that compressed data" " is in the Resource Fork, but that fork is empty or non-existent.\n"); } fs_file->meta->attr_state = TSK_FS_META_ATTR_STUDIED; return 0; }
C
sleuthkit
0
CVE-2009-3605
https://www.cvedetails.com/cve/CVE-2009-3605/
CWE-189
https://cgit.freedesktop.org/poppler/poppler/commit/?id=9cf2325fb22f812b31858e519411f57747d39bd8
9cf2325fb22f812b31858e519411f57747d39bd8
null
int Splash::getLineJoin() { return state->lineJoin; }
int Splash::getLineJoin() { return state->lineJoin; }
CPP
poppler
0
CVE-2012-2883
https://www.cvedetails.com/cve/CVE-2012-2883/
CWE-119
https://github.com/chromium/chromium/commit/f7b020b3d36def118881daa4402c44ca72271482
f7b020b3d36def118881daa4402c44ca72271482
INPUT_MULTIPLE_FIELDS_UI: Inconsistent value of aria-valuetext attribute https://bugs.webkit.org/show_bug.cgi?id=107897 Reviewed by Kentaro Hara. Source/WebCore: aria-valuetext and aria-valuenow attributes had inconsistent values in a case of initial empty state and a case that a user clears a field. - aria-valuetext attribute should have "blank" message in the initial empty state. - aria-valuenow attribute should be removed in the cleared empty state. Also, we have a bug that aira-valuenow had a symbolic value such as "AM" "January". It should always have a numeric value according to the specification. http://www.w3.org/TR/wai-aria/states_and_properties#aria-valuenow No new tests. Updates fast/forms/*-multiple-fields/*-multiple-fields-ax-aria-attributes.html. * html/shadow/DateTimeFieldElement.cpp: (WebCore::DateTimeFieldElement::DateTimeFieldElement): Set "blank" message to aria-valuetext attribute. (WebCore::DateTimeFieldElement::updateVisibleValue): aria-valuenow attribute should be a numeric value. Apply String::number to the return value of valueForARIAValueNow. Remove aria-valuenow attribute if nothing is selected. (WebCore::DateTimeFieldElement::valueForARIAValueNow): Added. * html/shadow/DateTimeFieldElement.h: (DateTimeFieldElement): Declare valueForARIAValueNow. * html/shadow/DateTimeSymbolicFieldElement.cpp: (WebCore::DateTimeSymbolicFieldElement::valueForARIAValueNow): Added. Returns 1 + internal selection index. For example, the function returns 1 for January. * html/shadow/DateTimeSymbolicFieldElement.h: (DateTimeSymbolicFieldElement): Declare valueForARIAValueNow. LayoutTests: Fix existing tests to show aria-valuenow attribute values. * fast/forms/resources/multiple-fields-ax-aria-attributes.js: Added. * fast/forms/date-multiple-fields/date-multiple-fields-ax-aria-attributes-expected.txt: * fast/forms/date-multiple-fields/date-multiple-fields-ax-aria-attributes.html: Use multiple-fields-ax-aria-attributes.js. Add tests for initial empty-value state. * fast/forms/month-multiple-fields/month-multiple-fields-ax-aria-attributes-expected.txt: * fast/forms/month-multiple-fields/month-multiple-fields-ax-aria-attributes.html: Use multiple-fields-ax-aria-attributes.js. * fast/forms/time-multiple-fields/time-multiple-fields-ax-aria-attributes-expected.txt: * fast/forms/time-multiple-fields/time-multiple-fields-ax-aria-attributes.html: Use multiple-fields-ax-aria-attributes.js. git-svn-id: svn://svn.chromium.org/blink/trunk@140803 bbb929c8-8fbe-4397-9dbb-9b2b20218538
void DateTimeSymbolicFieldElement::setEmptyValue(EventBehavior eventBehavior) { if (isReadOnly()) return; m_selectedIndex = invalidIndex; updateVisibleValue(eventBehavior); }
void DateTimeSymbolicFieldElement::setEmptyValue(EventBehavior eventBehavior) { if (isReadOnly()) return; m_selectedIndex = invalidIndex; updateVisibleValue(eventBehavior); }
C
Chrome
0
CVE-2019-1010208
https://www.cvedetails.com/cve/CVE-2019-1010208/
CWE-119
https://github.com/veracrypt/VeraCrypt/commit/f30f9339c9a0b9bbcc6f5ad38804af39db1f479e
f30f9339c9a0b9bbcc6f5ad38804af39db1f479e
Windows: fix low severity vulnerability in driver that allowed reading 3 bytes of kernel stack memory (with a rare possibility of 25 additional bytes). Reported by Tim Harrison.
static VOID SendDeviceIoControlRequestWorkItemRoutine (PDEVICE_OBJECT rootDeviceObject, SendDeviceIoControlRequestWorkItemArgs *arg) { arg->Status = SendDeviceIoControlRequest (arg->deviceObject, arg->ioControlCode, arg->inputBuffer, arg->inputBufferSize, arg->outputBuffer, arg->outputBufferSize); KeSetEvent (&arg->WorkItemCompletedEvent, IO_NO_INCREMENT, FALSE); }
static VOID SendDeviceIoControlRequestWorkItemRoutine (PDEVICE_OBJECT rootDeviceObject, SendDeviceIoControlRequestWorkItemArgs *arg) { arg->Status = SendDeviceIoControlRequest (arg->deviceObject, arg->ioControlCode, arg->inputBuffer, arg->inputBufferSize, arg->outputBuffer, arg->outputBufferSize); KeSetEvent (&arg->WorkItemCompletedEvent, IO_NO_INCREMENT, FALSE); }
C
VeraCrypt
0
CVE-2012-5148
https://www.cvedetails.com/cve/CVE-2012-5148/
CWE-20
https://github.com/chromium/chromium/commit/e89cfcb9090e8c98129ae9160c513f504db74599
e89cfcb9090e8c98129ae9160c513f504db74599
Remove TabContents from TabStripModelObserver::TabDetachedAt. BUG=107201 TEST=no visible change Review URL: https://chromiumcodereview.appspot.com/11293205 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@167122 0039d316-1c4b-4281-b951-d872f2087c98
bool BrowserWindowGtk::IsTabStripSupported() const { return browser_->SupportsWindowFeature(Browser::FEATURE_TABSTRIP); }
bool BrowserWindowGtk::IsTabStripSupported() const { return browser_->SupportsWindowFeature(Browser::FEATURE_TABSTRIP); }
C
Chrome
0
CVE-2017-9835
https://www.cvedetails.com/cve/CVE-2017-9835/
CWE-190
http://git.ghostscript.com/?p=ghostpdl.git;a=commit;h=cfde94be1d4286bc47633c6e6eaf4e659bd78066
cfde94be1d4286bc47633c6e6eaf4e659bd78066
null
alloc_size_is_ok(gs_memory_type_ptr_t stype) { return (stype->ssize > 0 && stype->ssize < 0x200000); }
alloc_size_is_ok(gs_memory_type_ptr_t stype) { return (stype->ssize > 0 && stype->ssize < 0x200000); }
C
ghostscript
0
CVE-2015-6563
https://www.cvedetails.com/cve/CVE-2015-6563/
CWE-20
https://github.com/openssh/openssh-portable/commit/d4697fe9a28dab7255c60433e4dd23cf7fce8a8b
d4697fe9a28dab7255c60433e4dd23cf7fce8a8b
Don't resend username to PAM; it already has it. Pointed out by Moritz Jodeit; ok dtucker@
mm_ssh_gssapi_checkmic(Gssctxt *ctx, gss_buffer_t gssbuf, gss_buffer_t gssmic) { Buffer m; OM_uint32 major; buffer_init(&m); buffer_put_string(&m, gssbuf->value, gssbuf->length); buffer_put_string(&m, gssmic->value, gssmic->length); mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_GSSCHECKMIC, &m); mm_request_receive_expect(pmonitor->m_recvfd, MONITOR_ANS_GSSCHECKMIC, &m); major = buffer_get_int(&m); buffer_free(&m); return(major); }
mm_ssh_gssapi_checkmic(Gssctxt *ctx, gss_buffer_t gssbuf, gss_buffer_t gssmic) { Buffer m; OM_uint32 major; buffer_init(&m); buffer_put_string(&m, gssbuf->value, gssbuf->length); buffer_put_string(&m, gssmic->value, gssmic->length); mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_GSSCHECKMIC, &m); mm_request_receive_expect(pmonitor->m_recvfd, MONITOR_ANS_GSSCHECKMIC, &m); major = buffer_get_int(&m); buffer_free(&m); return(major); }
C
openssh-portable
0
CVE-2013-4483
https://www.cvedetails.com/cve/CVE-2013-4483/
CWE-189
https://github.com/torvalds/linux/commit/6062a8dc0517bce23e3c2f7d2fea5e22411269a3
6062a8dc0517bce23e3c2f7d2fea5e22411269a3
ipc,sem: fine grained locking for semtimedop Introduce finer grained locking for semtimedop, to handle the common case of a program wanting to manipulate one semaphore from an array with multiple semaphores. If the call is a semop manipulating just one semaphore in an array with multiple semaphores, only take the lock for that semaphore itself. If the call needs to manipulate multiple semaphores, or another caller is in a transaction that manipulates multiple semaphores, the sem_array lock is taken, as well as all the locks for the individual semaphores. On a 24 CPU system, performance numbers with the semop-multi test with N threads and N semaphores, look like this: vanilla Davidlohr's Davidlohr's + Davidlohr's + threads patches rwlock patches v3 patches 10 610652 726325 1783589 2142206 20 341570 365699 1520453 1977878 30 288102 307037 1498167 2037995 40 290714 305955 1612665 2256484 50 288620 312890 1733453 2650292 60 289987 306043 1649360 2388008 70 291298 306347 1723167 2717486 80 290948 305662 1729545 2763582 90 290996 306680 1736021 2757524 100 292243 306700 1773700 3059159 [[email protected]: do not call sem_lock when bogus sma] [[email protected]: make refcounter atomic] Signed-off-by: Rik van Riel <[email protected]> Suggested-by: Linus Torvalds <[email protected]> Acked-by: Davidlohr Bueso <[email protected]> Cc: Chegu Vinod <[email protected]> Cc: Jason Low <[email protected]> Reviewed-by: Michel Lespinasse <[email protected]> Cc: Peter Hurley <[email protected]> Cc: Stanislav Kinsbursky <[email protected]> Tested-by: Emmanuel Benisty <[email protected]> Tested-by: Sedat Dilek <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
copy_semid_from_user(struct semid64_ds *out, void __user *buf, int version) { switch(version) { case IPC_64: if (copy_from_user(out, buf, sizeof(*out))) return -EFAULT; return 0; case IPC_OLD: { struct semid_ds tbuf_old; if(copy_from_user(&tbuf_old, buf, sizeof(tbuf_old))) return -EFAULT; out->sem_perm.uid = tbuf_old.sem_perm.uid; out->sem_perm.gid = tbuf_old.sem_perm.gid; out->sem_perm.mode = tbuf_old.sem_perm.mode; return 0; } default: return -EINVAL; } }
copy_semid_from_user(struct semid64_ds *out, void __user *buf, int version) { switch(version) { case IPC_64: if (copy_from_user(out, buf, sizeof(*out))) return -EFAULT; return 0; case IPC_OLD: { struct semid_ds tbuf_old; if(copy_from_user(&tbuf_old, buf, sizeof(tbuf_old))) return -EFAULT; out->sem_perm.uid = tbuf_old.sem_perm.uid; out->sem_perm.gid = tbuf_old.sem_perm.gid; out->sem_perm.mode = tbuf_old.sem_perm.mode; return 0; } default: return -EINVAL; } }
C
linux
0
CVE-2016-5200
https://www.cvedetails.com/cve/CVE-2016-5200/
CWE-119
https://github.com/chromium/chromium/commit/2f19869af13bbfdcfd682a55c0d2c61c6e102475
2f19869af13bbfdcfd682a55c0d2c61c6e102475
chrome/browser/ui/webauthn: long domains may cause a line break. As requested by UX in [1], allow long host names to split a title into two lines. This allows us to show more of the name before eliding, although sufficiently long names will still trigger elision. Screenshot at https://drive.google.com/open?id=1_V6t2CeZDAVazy3Px-OET2LnB__aEW1r. [1] https://docs.google.com/presentation/d/1TtxkPUchyVZulqgdMcfui-68B0W-DWaFFVJEffGIbLA/edit#slide=id.g5913c4105f_1_12 Change-Id: I70f6541e0db3e9942239304de43b487a7561ca34 Bug: 870892 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1601812 Auto-Submit: Adam Langley <[email protected]> Commit-Queue: Nina Satragno <[email protected]> Reviewed-by: Nina Satragno <[email protected]> Cr-Commit-Position: refs/heads/master@{#658114}
AuthenticatorBlePowerOnAutomaticSheetModel::GetAcceptButtonLabel() const { return l10n_util::GetStringUTF16(IDS_WEBAUTHN_BLUETOOTH_POWER_ON_AUTO_NEXT); }
AuthenticatorBlePowerOnAutomaticSheetModel::GetAcceptButtonLabel() const { return l10n_util::GetStringUTF16(IDS_WEBAUTHN_BLUETOOTH_POWER_ON_AUTO_NEXT); }
C
Chrome
0
CVE-2014-1713
https://www.cvedetails.com/cve/CVE-2014-1713/
CWE-399
https://github.com/chromium/chromium/commit/f85a87ec670ad0fce9d98d90c9a705b72a288154
f85a87ec670ad0fce9d98d90c9a705b72a288154
document.location bindings fix BUG=352374 [email protected] Review URL: https://codereview.chromium.org/196343011 git-svn-id: svn://svn.chromium.org/blink/trunk@169176 bbb929c8-8fbe-4397-9dbb-9b2b20218538
static void methodWithEnforceRangeUInt64MethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); TestObjectV8Internal::methodWithEnforceRangeUInt64Method(info); TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); }
static void methodWithEnforceRangeUInt64MethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); TestObjectV8Internal::methodWithEnforceRangeUInt64Method(info); TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); }
C
Chrome
0
CVE-2015-6764
https://www.cvedetails.com/cve/CVE-2015-6764/
CWE-119
https://github.com/chromium/chromium/commit/f7b2214a08547e0d28b1a2fef3c19ee0f9febd19
f7b2214a08547e0d28b1a2fef3c19ee0f9febd19
Reland "[Fuchsia] Use Netstack FIDL interface to get network interfaces." This is a reland of b29fc269716e556be6b4e999bb4b24332cc43c6e Original change's description: > [Fuchsia] Use Netstack FIDL interface to get network interfaces. > > 1. Updated FILD GN template to generate and compile tables file, FIDL > generated code was failing to link without them. > 2. Updated GetNetworkList() for Fuchsia to FIDL API instead of ioctl(). > > Bug: 831384 > Change-Id: Ib90303a5110a465ea5f2bad787a7b63a2bf13f61 > Reviewed-on: https://chromium-review.googlesource.com/1023124 > Commit-Queue: Sergey Ulanov <[email protected]> > Reviewed-by: James Robinson <[email protected]> > Reviewed-by: Matt Menke <[email protected]> > Cr-Commit-Position: refs/heads/master@{#554868} [email protected] Bug: 831384 Change-Id: Iabb29661680b835b947b2780d169e204fd5e2559 Reviewed-on: https://chromium-review.googlesource.com/1036484 Commit-Queue: Sergey Ulanov <[email protected]> Reviewed-by: Kevin Marshall <[email protected]> Cr-Commit-Position: refs/heads/master@{#554946}
std::string GetWifiSSID() { NOTIMPLEMENTED(); return std::string(); }
std::string GetWifiSSID() { NOTIMPLEMENTED(); return std::string(); }
C
Chrome
0
CVE-2011-2875
https://www.cvedetails.com/cve/CVE-2011-2875/
CWE-20
https://github.com/chromium/chromium/commit/ab5e55ff333def909d025ac45da9ffa0d88a63f2
ab5e55ff333def909d025ac45da9ffa0d88a63f2
Unreviewed, rolling out r127612, r127660, and r127664. http://trac.webkit.org/changeset/127612 http://trac.webkit.org/changeset/127660 http://trac.webkit.org/changeset/127664 https://bugs.webkit.org/show_bug.cgi?id=95920 Source/Platform: * Platform.gypi: * chromium/public/WebRTCPeerConnectionHandler.h: (WebKit): (WebRTCPeerConnectionHandler): * chromium/public/WebRTCVoidRequest.h: Removed. Source/WebCore: * CMakeLists.txt: * GNUmakefile.list.am: * Modules/mediastream/RTCErrorCallback.h: (WebCore): (RTCErrorCallback): * Modules/mediastream/RTCErrorCallback.idl: * Modules/mediastream/RTCPeerConnection.cpp: (WebCore::RTCPeerConnection::createOffer): * Modules/mediastream/RTCPeerConnection.h: (WebCore): (RTCPeerConnection): * Modules/mediastream/RTCPeerConnection.idl: * Modules/mediastream/RTCSessionDescriptionCallback.h: (WebCore): (RTCSessionDescriptionCallback): * Modules/mediastream/RTCSessionDescriptionCallback.idl: * Modules/mediastream/RTCSessionDescriptionRequestImpl.cpp: (WebCore::RTCSessionDescriptionRequestImpl::create): (WebCore::RTCSessionDescriptionRequestImpl::RTCSessionDescriptionRequestImpl): (WebCore::RTCSessionDescriptionRequestImpl::requestSucceeded): (WebCore::RTCSessionDescriptionRequestImpl::requestFailed): (WebCore::RTCSessionDescriptionRequestImpl::clear): * Modules/mediastream/RTCSessionDescriptionRequestImpl.h: (RTCSessionDescriptionRequestImpl): * Modules/mediastream/RTCVoidRequestImpl.cpp: Removed. * Modules/mediastream/RTCVoidRequestImpl.h: Removed. * WebCore.gypi: * platform/chromium/support/WebRTCVoidRequest.cpp: Removed. * platform/mediastream/RTCPeerConnectionHandler.cpp: (RTCPeerConnectionHandlerDummy): (WebCore::RTCPeerConnectionHandlerDummy::RTCPeerConnectionHandlerDummy): * platform/mediastream/RTCPeerConnectionHandler.h: (WebCore): (WebCore::RTCPeerConnectionHandler::~RTCPeerConnectionHandler): (RTCPeerConnectionHandler): (WebCore::RTCPeerConnectionHandler::RTCPeerConnectionHandler): * platform/mediastream/RTCVoidRequest.h: Removed. * platform/mediastream/chromium/RTCPeerConnectionHandlerChromium.cpp: * platform/mediastream/chromium/RTCPeerConnectionHandlerChromium.h: (RTCPeerConnectionHandlerChromium): Tools: * DumpRenderTree/chromium/MockWebRTCPeerConnectionHandler.cpp: (MockWebRTCPeerConnectionHandler::SuccessCallbackTask::SuccessCallbackTask): (MockWebRTCPeerConnectionHandler::SuccessCallbackTask::runIfValid): (MockWebRTCPeerConnectionHandler::FailureCallbackTask::FailureCallbackTask): (MockWebRTCPeerConnectionHandler::FailureCallbackTask::runIfValid): (MockWebRTCPeerConnectionHandler::createOffer): * DumpRenderTree/chromium/MockWebRTCPeerConnectionHandler.h: (MockWebRTCPeerConnectionHandler): (SuccessCallbackTask): (FailureCallbackTask): LayoutTests: * fast/mediastream/RTCPeerConnection-createOffer.html: * fast/mediastream/RTCPeerConnection-localDescription-expected.txt: Removed. * fast/mediastream/RTCPeerConnection-localDescription.html: Removed. * fast/mediastream/RTCPeerConnection-remoteDescription-expected.txt: Removed. * fast/mediastream/RTCPeerConnection-remoteDescription.html: Removed. git-svn-id: svn://svn.chromium.org/blink/trunk@127679 bbb929c8-8fbe-4397-9dbb-9b2b20218538
bool MockWebRTCPeerConnectionHandler::addICECandidate(const WebRTCICECandidateDescriptor& iceCandidate) { m_client->didGenerateICECandidate(iceCandidate); return true; }
bool MockWebRTCPeerConnectionHandler::addICECandidate(const WebRTCICECandidateDescriptor& iceCandidate) { m_client->didGenerateICECandidate(iceCandidate); return true; }
C
Chrome
0
CVE-2017-8284
https://www.cvedetails.com/cve/CVE-2017-8284/
CWE-94
https://github.com/qemu/qemu/commit/30663fd26c0307e414622c7a8607fbc04f92ec14
30663fd26c0307e414622c7a8607fbc04f92ec14
tcg/i386: Check the size of instruction being translated This fixes the bug: 'user-to-root privesc inside VM via bad translation caching' reported by Jann Horn here: https://bugs.chromium.org/p/project-zero/issues/detail?id=1122 Reviewed-by: Richard Henderson <[email protected]> CC: Peter Maydell <[email protected]> CC: Paolo Bonzini <[email protected]> Reported-by: Jann Horn <[email protected]> Signed-off-by: Pranith Kumar <[email protected]> Message-Id: <[email protected]> Signed-off-by: Paolo Bonzini <[email protected]>
static inline void gen_op_mov_v_reg(TCGMemOp ot, TCGv t0, int reg) { if (ot == MO_8 && byte_reg_is_xH(reg)) { tcg_gen_extract_tl(t0, cpu_regs[reg - 4], 8, 8); } else { tcg_gen_mov_tl(t0, cpu_regs[reg]); } }
static inline void gen_op_mov_v_reg(TCGMemOp ot, TCGv t0, int reg) { if (ot == MO_8 && byte_reg_is_xH(reg)) { tcg_gen_extract_tl(t0, cpu_regs[reg - 4], 8, 8); } else { tcg_gen_mov_tl(t0, cpu_regs[reg]); } }
C
qemu
0
CVE-2018-9490
https://www.cvedetails.com/cve/CVE-2018-9490/
CWE-704
https://android.googlesource.com/platform/external/v8/+/a24543157ae2cdd25da43e20f4e48a07481e6ceb
a24543157ae2cdd25da43e20f4e48a07481e6ceb
Backport: Fix Object.entries/values with changing elements Bug: 111274046 Test: m -j proxy_resolver_v8_unittest && adb sync && adb shell \ /data/nativetest64/proxy_resolver_v8_unittest/proxy_resolver_v8_unittest Change-Id: I705fc512cc5837e9364ed187559cc75d079aa5cb (cherry picked from commit d8be9a10287afed07705ac8af027d6a46d4def99)
void ElementsAccessor::InitializeOncePerProcess() { static ElementsAccessor* accessor_array[] = { #define ACCESSOR_ARRAY(Class, Kind, Store) new Class(#Kind), ELEMENTS_LIST(ACCESSOR_ARRAY) #undef ACCESSOR_ARRAY }; STATIC_ASSERT((sizeof(accessor_array) / sizeof(*accessor_array)) == kElementsKindCount); elements_accessors_ = accessor_array; }
void ElementsAccessor::InitializeOncePerProcess() { static ElementsAccessor* accessor_array[] = { #define ACCESSOR_ARRAY(Class, Kind, Store) new Class(#Kind), ELEMENTS_LIST(ACCESSOR_ARRAY) #undef ACCESSOR_ARRAY }; STATIC_ASSERT((sizeof(accessor_array) / sizeof(*accessor_array)) == kElementsKindCount); elements_accessors_ = accessor_array; }
C
Android
0
CVE-2016-2117
https://www.cvedetails.com/cve/CVE-2016-2117/
CWE-200
https://github.com/torvalds/linux/commit/f43bfaeddc79effbf3d0fcb53ca477cca66f3db8
f43bfaeddc79effbf3d0fcb53ca477cca66f3db8
atl2: Disable unimplemented scatter/gather feature atl2 includes NETIF_F_SG in hw_features even though it has no support for non-linear skbs. This bug was originally harmless since the driver does not claim to implement checksum offload and that used to be a requirement for SG. Now that SG and checksum offload are independent features, if you explicitly enable SG *and* use one of the rare protocols that can use SG without checkusm offload, this potentially leaks sensitive information (before you notice that it just isn't working). Therefore this obscure bug has been designated CVE-2016-2117. Reported-by: Justin Yackoski <[email protected]> Signed-off-by: Ben Hutchings <[email protected]> Fixes: ec5f06156423 ("net: Kill link between CSUM and SG features.") Signed-off-by: David S. Miller <[email protected]>
static void atl2_init_pcie(struct atl2_hw *hw) { u32 value; value = LTSSM_TEST_MODE_DEF; ATL2_WRITE_REG(hw, REG_LTSSM_TEST_MODE, value); value = PCIE_DLL_TX_CTRL1_DEF; ATL2_WRITE_REG(hw, REG_PCIE_DLL_TX_CTRL1, value); }
static void atl2_init_pcie(struct atl2_hw *hw) { u32 value; value = LTSSM_TEST_MODE_DEF; ATL2_WRITE_REG(hw, REG_LTSSM_TEST_MODE, value); value = PCIE_DLL_TX_CTRL1_DEF; ATL2_WRITE_REG(hw, REG_PCIE_DLL_TX_CTRL1, value); }
C
linux
0
CVE-2014-3645
https://www.cvedetails.com/cve/CVE-2014-3645/
CWE-20
https://github.com/torvalds/linux/commit/bfd0a56b90005f8c8a004baf407ad90045c2b11e
bfd0a56b90005f8c8a004baf407ad90045c2b11e
nEPT: Nested INVEPT If we let L1 use EPT, we should probably also support the INVEPT instruction. In our current nested EPT implementation, when L1 changes its EPT table for L2 (i.e., EPT12), L0 modifies the shadow EPT table (EPT02), and in the course of this modification already calls INVEPT. But if last level of shadow page is unsync not all L1's changes to EPT12 are intercepted, which means roots need to be synced when L1 calls INVEPT. Global INVEPT should not be different since roots are synced by kvm_mmu_load() each time EPTP02 changes. Reviewed-by: Xiao Guangrong <[email protected]> Signed-off-by: Nadav Har'El <[email protected]> Signed-off-by: Jun Nakajima <[email protected]> Signed-off-by: Xinhao Xu <[email protected]> Signed-off-by: Yang Zhang <[email protected]> Signed-off-by: Gleb Natapov <[email protected]> Signed-off-by: Paolo Bonzini <[email protected]>
int kvm_mmu_load(struct kvm_vcpu *vcpu) { int r; r = mmu_topup_memory_caches(vcpu); if (r) goto out; r = mmu_alloc_roots(vcpu); kvm_mmu_sync_roots(vcpu); if (r) goto out; /* set_cr3() should ensure TLB has been flushed */ vcpu->arch.mmu.set_cr3(vcpu, vcpu->arch.mmu.root_hpa); out: return r; }
int kvm_mmu_load(struct kvm_vcpu *vcpu) { int r; r = mmu_topup_memory_caches(vcpu); if (r) goto out; r = mmu_alloc_roots(vcpu); kvm_mmu_sync_roots(vcpu); if (r) goto out; /* set_cr3() should ensure TLB has been flushed */ vcpu->arch.mmu.set_cr3(vcpu, vcpu->arch.mmu.root_hpa); out: return r; }
C
linux
0
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.
static struct sc_card_driver * sc_get_driver(void) { if (iso_ops == NULL) iso_ops = sc_get_iso7816_driver()->ops; asepcos_ops = *iso_ops; asepcos_ops.match_card = asepcos_match_card; asepcos_ops.init = asepcos_init; asepcos_ops.select_file = asepcos_select_file; asepcos_ops.set_security_env = asepcos_set_security_env; asepcos_ops.decipher = asepcos_decipher; asepcos_ops.compute_signature = asepcos_compute_signature; asepcos_ops.create_file = asepcos_create_file; asepcos_ops.delete_file = asepcos_delete_file; asepcos_ops.list_files = asepcos_list_files; asepcos_ops.card_ctl = asepcos_card_ctl; asepcos_ops.pin_cmd = asepcos_pin_cmd; asepcos_ops.card_reader_lock_obtained = asepcos_card_reader_lock_obtained; return &asepcos_drv; }
static struct sc_card_driver * sc_get_driver(void) { if (iso_ops == NULL) iso_ops = sc_get_iso7816_driver()->ops; asepcos_ops = *iso_ops; asepcos_ops.match_card = asepcos_match_card; asepcos_ops.init = asepcos_init; asepcos_ops.select_file = asepcos_select_file; asepcos_ops.set_security_env = asepcos_set_security_env; asepcos_ops.decipher = asepcos_decipher; asepcos_ops.compute_signature = asepcos_compute_signature; asepcos_ops.create_file = asepcos_create_file; asepcos_ops.delete_file = asepcos_delete_file; asepcos_ops.list_files = asepcos_list_files; asepcos_ops.card_ctl = asepcos_card_ctl; asepcos_ops.pin_cmd = asepcos_pin_cmd; asepcos_ops.card_reader_lock_obtained = asepcos_card_reader_lock_obtained; return &asepcos_drv; }
C
OpenSC
0