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-5009
https://www.cvedetails.com/cve/CVE-2017-5009/
CWE-119
https://github.com/chromium/chromium/commit/1c40f9042ae2d6ee7483d72998aabb5e73b2ff60
1c40f9042ae2d6ee7483d72998aabb5e73b2ff60
DevTools: send proper resource type in Network.RequestWillBeSent This patch plumbs resoure type into the DispatchWillSendRequest instrumenation. This allows us to report accurate type in Network.RequestWillBeSent event, instead of "Other", that we report today. BUG=765501 R=dgozman Change-Id: I0134c08b841e8dd247fdc8ff208bfd51e462709c Reviewed-on: https://chromium-review.googlesource.com/667504 Reviewed-by: Pavel Feldman <[email protected]> Reviewed-by: Dmitry Gozman <[email protected]> Commit-Queue: Andrey Lushnikov <[email protected]> Cr-Commit-Position: refs/heads/master@{#507936}
std::unique_ptr<TracedValue> FillLocation(const String& url, const TextPosition& text_position) { std::unique_ptr<TracedValue> value = TracedValue::Create(); value->SetString("url", url); value->SetInteger("lineNumber", text_position.line_.OneBasedInt()); value->SetInteger("columnNumber", text_position.column_.OneBasedInt()); return value; }
std::unique_ptr<TracedValue> FillLocation(const String& url, const TextPosition& text_position) { std::unique_ptr<TracedValue> value = TracedValue::Create(); value->SetString("url", url); value->SetInteger("lineNumber", text_position.line_.OneBasedInt()); value->SetInteger("columnNumber", text_position.column_.OneBasedInt()); return value; }
C
Chrome
0
CVE-2014-1715
https://www.cvedetails.com/cve/CVE-2014-1715/
CWE-22
https://github.com/chromium/chromium/commit/ce70785c73a2b7cf2b34de0d8439ca31929b4743
ce70785c73a2b7cf2b34de0d8439ca31929b4743
Consistently check if a block can handle pagination strut propagation. https://codereview.chromium.org/1360753002 got it right for inline child layout, but did nothing for block child layout. BUG=329421 [email protected],[email protected] Review URL: https://codereview.chromium.org/1387553002 Cr-Commit-Position: refs/heads/master@{#352429}
GapRects LayoutBlockFlow::selectionGapRectsForPaintInvalidation(const LayoutBoxModelObject* paintInvalidationContainer) const { ASSERT(!needsLayout()); if (!shouldPaintSelectionGaps()) return GapRects(); TransformState transformState(TransformState::ApplyTransformDirection, FloatPoint()); mapLocalToContainer(paintInvalidationContainer, transformState, ApplyContainerFlip | UseTransforms); LayoutPoint offsetFromPaintInvalidationContainer = roundedLayoutPoint(transformState.mappedPoint()); if (hasOverflowClip()) offsetFromPaintInvalidationContainer -= scrolledContentOffset(); LayoutUnit lastTop = 0; LayoutUnit lastLeft = logicalLeftSelectionOffset(this, lastTop); LayoutUnit lastRight = logicalRightSelectionOffset(this, lastTop); return selectionGaps(this, offsetFromPaintInvalidationContainer, LayoutSize(), lastTop, lastLeft, lastRight); }
GapRects LayoutBlockFlow::selectionGapRectsForPaintInvalidation(const LayoutBoxModelObject* paintInvalidationContainer) const { ASSERT(!needsLayout()); if (!shouldPaintSelectionGaps()) return GapRects(); TransformState transformState(TransformState::ApplyTransformDirection, FloatPoint()); mapLocalToContainer(paintInvalidationContainer, transformState, ApplyContainerFlip | UseTransforms); LayoutPoint offsetFromPaintInvalidationContainer = roundedLayoutPoint(transformState.mappedPoint()); if (hasOverflowClip()) offsetFromPaintInvalidationContainer -= scrolledContentOffset(); LayoutUnit lastTop = 0; LayoutUnit lastLeft = logicalLeftSelectionOffset(this, lastTop); LayoutUnit lastRight = logicalRightSelectionOffset(this, lastTop); return selectionGaps(this, offsetFromPaintInvalidationContainer, LayoutSize(), lastTop, lastLeft, lastRight); }
C
Chrome
0
CVE-2016-1621
https://www.cvedetails.com/cve/CVE-2016-1621/
CWE-119
https://android.googlesource.com/platform/external/libvpx/+/04839626ed859623901ebd3a5fd483982186b59d
04839626ed859623901ebd3a5fd483982186b59d
libwebm: Pull from upstream Rolling mkvparser from upstream. Primarily for fixing a bug on parsing failures with certain Opus WebM files. Upstream commit hash of this pull: 574045edd4ecbeb802ee3f1d214b5510269852ae The diff is so huge because there were some style clean ups upstream. But it was ensured that there were no breaking changes when the style clean ups was done upstream. Change-Id: Ib6e907175484b4b0ae1b55ab39522ea3188ad039
Track::EOSBlock::EOSBlock() :
Track::EOSBlock::EOSBlock() : BlockEntry(NULL, LONG_MIN) { }
C
Android
1
CVE-2016-3861
https://www.cvedetails.com/cve/CVE-2016-3861/
CWE-119
https://android.googlesource.com/platform/system/core/+/ecf5fd58a8f50362ce9e8d4245a33d56f29f142b
ecf5fd58a8f50362ce9e8d4245a33d56f29f142b
libutils/Unicode.cpp: Correct length computation and add checks for utf16->utf8 Inconsistent behaviour between utf16_to_utf8 and utf16_to_utf8_length is causing a heap overflow. Correcting the length computation and adding bound checks to the conversion functions. Test: ran libutils_tests Bug: 29250543 Change-Id: I6115e3357141ed245c63c6eb25fc0fd0a9a7a2bb (cherry picked from commit c4966a363e46d2e1074d1a365e232af0dcedd6a1)
static inline int32_t utf32_at_internal(const char* cur, size_t *num_read) { const char first_char = *cur; if ((first_char & 0x80) == 0) { // ASCII *num_read = 1; return *cur; } cur++; char32_t mask, to_ignore_mask; size_t num_to_read = 0; char32_t utf32 = first_char; for (num_to_read = 1, mask = 0x40, to_ignore_mask = 0xFFFFFF80; (first_char & mask); num_to_read++, to_ignore_mask |= mask, mask >>= 1) { utf32 = (utf32 << 6) + (*cur++ & 0x3F); } to_ignore_mask |= mask; utf32 &= ~(to_ignore_mask << (6 * (num_to_read - 1))); *num_read = num_to_read; return static_cast<int32_t>(utf32); }
static inline int32_t utf32_at_internal(const char* cur, size_t *num_read) { const char first_char = *cur; if ((first_char & 0x80) == 0) { // ASCII *num_read = 1; return *cur; } cur++; char32_t mask, to_ignore_mask; size_t num_to_read = 0; char32_t utf32 = first_char; for (num_to_read = 1, mask = 0x40, to_ignore_mask = 0xFFFFFF80; (first_char & mask); num_to_read++, to_ignore_mask |= mask, mask >>= 1) { utf32 = (utf32 << 6) + (*cur++ & 0x3F); } to_ignore_mask |= mask; utf32 &= ~(to_ignore_mask << (6 * (num_to_read - 1))); *num_read = num_to_read; return static_cast<int32_t>(utf32); }
C
Android
0
CVE-2011-4621
https://www.cvedetails.com/cve/CVE-2011-4621/
null
https://github.com/torvalds/linux/commit/f26f9aff6aaf67e9a430d16c266f91b13a5bff64
f26f9aff6aaf67e9a430d16c266f91b13a5bff64
Sched: fix skip_clock_update optimization idle_balance() drops/retakes rq->lock, leaving the previous task vulnerable to set_tsk_need_resched(). Clear it after we return from balancing instead, and in setup_thread_stack() as well, so no successfully descheduled or never scheduled task has it set. Need resched confused the skip_clock_update logic, which assumes that the next call to update_rq_clock() will come nearly immediately after being set. Make the optimization robust against the waking a sleeper before it sucessfully deschedules case by checking that the current task has not been dequeued before setting the flag, since it is that useless clock update we're trying to save, and clear unconditionally in schedule() proper instead of conditionally in put_prev_task(). Signed-off-by: Mike Galbraith <[email protected]> Reported-by: Bjoern B. Brandenburg <[email protected]> Tested-by: Yong Zhang <[email protected]> Signed-off-by: Peter Zijlstra <[email protected]> Cc: [email protected] LKML-Reference: <[email protected]> Signed-off-by: Ingo Molnar <[email protected]>
static inline void free_fair_sched_group(struct task_group *tg) { }
static inline void free_fair_sched_group(struct task_group *tg) { }
C
linux
0
CVE-2017-9203
https://www.cvedetails.com/cve/CVE-2017-9203/
CWE-787
https://github.com/jsummers/imageworsener/commit/a4f247707f08e322f0b41e82c3e06e224240a654
a4f247707f08e322f0b41e82c3e06e224240a654
Fixed a bug that could cause invalid memory to be accessed The bug could happen when transparency is removed from an image. Also fixed a semi-related BMP error handling logic bug. Fixes issue #21
static int find_high_bit(unsigned int x) { int i; for(i=31;i>=0;i--) { if(x&(1U<<(unsigned int)i)) return i; } return 0; }
static int find_high_bit(unsigned int x) { int i; for(i=31;i>=0;i--) { if(x&(1U<<(unsigned int)i)) return i; } return 0; }
C
imageworsener
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 readonlyDOMTimeStampAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) { TestObjectPython* imp = V8TestObjectPython::toNative(info.Holder()); v8SetReturnValue(info, static_cast<double>(imp->readonlyDOMTimeStampAttribute())); }
static void readonlyDOMTimeStampAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) { TestObjectPython* imp = V8TestObjectPython::toNative(info.Holder()); v8SetReturnValue(info, static_cast<double>(imp->readonlyDOMTimeStampAttribute())); }
C
Chrome
0
CVE-2011-2517
https://www.cvedetails.com/cve/CVE-2011-2517/
CWE-119
https://github.com/torvalds/linux/commit/208c72f4fe44fe09577e7975ba0e7fa0278f3d03
208c72f4fe44fe09577e7975ba0e7fa0278f3d03
nl80211: fix check for valid SSID size in scan operations In both trigger_scan and sched_scan operations, we were checking for the SSID length before assigning the value correctly. Since the memory was just kzalloc'ed, the check was always failing and SSID with over 32 characters were allowed to go through. This was causing a buffer overflow when copying the actual SSID to the proper place. This bug has been there since 2.6.29-rc4. Cc: [email protected] Signed-off-by: Luciano Coelho <[email protected]> Signed-off-by: John W. Linville <[email protected]>
void nl80211_send_unprot_disassoc(struct cfg80211_registered_device *rdev, struct net_device *netdev, const u8 *buf, size_t len, gfp_t gfp) { nl80211_send_mlme_event(rdev, netdev, buf, len, NL80211_CMD_UNPROT_DISASSOCIATE, gfp); }
void nl80211_send_unprot_disassoc(struct cfg80211_registered_device *rdev, struct net_device *netdev, const u8 *buf, size_t len, gfp_t gfp) { nl80211_send_mlme_event(rdev, netdev, buf, len, NL80211_CMD_UNPROT_DISASSOCIATE, gfp); }
C
linux
0
CVE-2010-2060
https://www.cvedetails.com/cve/CVE-2010-2060/
null
https://github.com/kr/beanstalkd/commit/2e8e8c6387ecdf5923dfc4d7718d18eba1b0873d
2e8e8c6387ecdf5923dfc4d7718d18eba1b0873d
Discard job body bytes if the job is too big. Previously, a malicious user could craft a job payload and inject beanstalk commands without the client application knowing. (An extra-careful client library could check the size of the job body before sending the put command, but most libraries do not do this, nor should they have to.) Reported by Graham Barr.
do_list_tubes(conn c, ms l) { char *buf; tube t; size_t i, resp_z; /* first, measure how big a buffer we will need */ resp_z = 6; /* initial "---\n" and final "\r\n" */ for (i = 0; i < l->used; i++) { t = l->items[i]; resp_z += 3 + strlen(t->name); /* including "- " and "\n" */ } c->out_job = allocate_job(resp_z); /* fake job to hold response data */ if (!c->out_job) return reply_serr(c, MSG_OUT_OF_MEMORY); /* Mark this job as a copy so it can be appropriately freed later on */ c->out_job->state = JOB_STATE_COPY; /* now actually format the response */ buf = c->out_job->body; buf += snprintf(buf, 5, "---\n"); for (i = 0; i < l->used; i++) { t = l->items[i]; buf += snprintf(buf, 4 + strlen(t->name), "- %s\n", t->name); } buf[0] = '\r'; buf[1] = '\n'; c->out_job_sent = 0; return reply_line(c, STATE_SENDJOB, "OK %d\r\n", resp_z - 2); }
do_list_tubes(conn c, ms l) { char *buf; tube t; size_t i, resp_z; /* first, measure how big a buffer we will need */ resp_z = 6; /* initial "---\n" and final "\r\n" */ for (i = 0; i < l->used; i++) { t = l->items[i]; resp_z += 3 + strlen(t->name); /* including "- " and "\n" */ } c->out_job = allocate_job(resp_z); /* fake job to hold response data */ if (!c->out_job) return reply_serr(c, MSG_OUT_OF_MEMORY); /* Mark this job as a copy so it can be appropriately freed later on */ c->out_job->state = JOB_STATE_COPY; /* now actually format the response */ buf = c->out_job->body; buf += snprintf(buf, 5, "---\n"); for (i = 0; i < l->used; i++) { t = l->items[i]; buf += snprintf(buf, 4 + strlen(t->name), "- %s\n", t->name); } buf[0] = '\r'; buf[1] = '\n'; c->out_job_sent = 0; return reply_line(c, STATE_SENDJOB, "OK %d\r\n", resp_z - 2); }
C
beanstalkd
0
CVE-2013-7281
https://www.cvedetails.com/cve/CVE-2013-7281/
CWE-200
https://github.com/torvalds/linux/commit/bceaa90240b6019ed73b49965eac7d167610be69
bceaa90240b6019ed73b49965eac7d167610be69
inet: prevent leakage of uninitialized memory to user in recv syscalls Only update *addr_len when we actually fill in sockaddr, otherwise we can return uninitialized memory from the stack to the caller in the recvfrom, recvmmsg and recvmsg syscalls. Drop the the (addr_len == NULL) checks because we only get called with a valid addr_len pointer either from sock_common_recvmsg or inet_recvmsg. If a blocking read waits on a socket which is concurrently shut down we now return zero and set msg_msgnamelen to 0. Reported-by: mpb <[email protected]> Suggested-by: Eric Dumazet <[email protected]> Signed-off-by: Hannes Frederic Sowa <[email protected]> Signed-off-by: David S. Miller <[email protected]>
static struct sock *__udp4_lib_demux_lookup(struct net *net, __be16 loc_port, __be32 loc_addr, __be16 rmt_port, __be32 rmt_addr, int dif) { struct sock *sk, *result; struct hlist_nulls_node *node; unsigned short hnum = ntohs(loc_port); unsigned int hash2 = udp4_portaddr_hash(net, loc_addr, hnum); unsigned int slot2 = hash2 & udp_table.mask; struct udp_hslot *hslot2 = &udp_table.hash2[slot2]; INET_ADDR_COOKIE(acookie, rmt_addr, loc_addr) const __portpair ports = INET_COMBINED_PORTS(rmt_port, hnum); rcu_read_lock(); result = NULL; udp_portaddr_for_each_entry_rcu(sk, node, &hslot2->head) { if (INET_MATCH(sk, net, acookie, rmt_addr, loc_addr, ports, dif)) result = sk; /* Only check first socket in chain */ break; } if (result) { if (unlikely(!atomic_inc_not_zero_hint(&result->sk_refcnt, 2))) result = NULL; else if (unlikely(!INET_MATCH(sk, net, acookie, rmt_addr, loc_addr, ports, dif))) { sock_put(result); result = NULL; } } rcu_read_unlock(); return result; }
static struct sock *__udp4_lib_demux_lookup(struct net *net, __be16 loc_port, __be32 loc_addr, __be16 rmt_port, __be32 rmt_addr, int dif) { struct sock *sk, *result; struct hlist_nulls_node *node; unsigned short hnum = ntohs(loc_port); unsigned int hash2 = udp4_portaddr_hash(net, loc_addr, hnum); unsigned int slot2 = hash2 & udp_table.mask; struct udp_hslot *hslot2 = &udp_table.hash2[slot2]; INET_ADDR_COOKIE(acookie, rmt_addr, loc_addr) const __portpair ports = INET_COMBINED_PORTS(rmt_port, hnum); rcu_read_lock(); result = NULL; udp_portaddr_for_each_entry_rcu(sk, node, &hslot2->head) { if (INET_MATCH(sk, net, acookie, rmt_addr, loc_addr, ports, dif)) result = sk; /* Only check first socket in chain */ break; } if (result) { if (unlikely(!atomic_inc_not_zero_hint(&result->sk_refcnt, 2))) result = NULL; else if (unlikely(!INET_MATCH(sk, net, acookie, rmt_addr, loc_addr, ports, dif))) { sock_put(result); result = NULL; } } rcu_read_unlock(); return result; }
C
linux
0
CVE-2013-2856
https://www.cvedetails.com/cve/CVE-2013-2856/
CWE-416
https://github.com/chromium/chromium/commit/e68fafe04d29810cebe8d25554863b0cae4c1356
e68fafe04d29810cebe8d25554863b0cae4c1356
Map posix error codes in bind better, and fix one windows mapping. r=wtc BUG=330233 Review URL: https://codereview.chromium.org/101193008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@242224 0039d316-1c4b-4281-b951-d872f2087c98
int UDPSocketLibevent::SetMulticastLoopbackMode(bool loopback) { DCHECK(CalledOnValidThread()); if (is_connected()) return ERR_SOCKET_IS_CONNECTED; if (loopback) socket_options_ |= SOCKET_OPTION_MULTICAST_LOOP; else socket_options_ &= ~SOCKET_OPTION_MULTICAST_LOOP; return OK; }
int UDPSocketLibevent::SetMulticastLoopbackMode(bool loopback) { DCHECK(CalledOnValidThread()); if (is_connected()) return ERR_SOCKET_IS_CONNECTED; if (loopback) socket_options_ |= SOCKET_OPTION_MULTICAST_LOOP; else socket_options_ &= ~SOCKET_OPTION_MULTICAST_LOOP; return OK; }
C
Chrome
0
CVE-2017-9059
https://www.cvedetails.com/cve/CVE-2017-9059/
CWE-404
https://github.com/torvalds/linux/commit/c70422f760c120480fee4de6c38804c72aa26bc1
c70422f760c120480fee4de6c38804c72aa26bc1
Merge tag 'nfsd-4.12' of git://linux-nfs.org/~bfields/linux Pull nfsd updates from Bruce Fields: "Another RDMA update from Chuck Lever, and a bunch of miscellaneous bugfixes" * tag 'nfsd-4.12' of git://linux-nfs.org/~bfields/linux: (26 commits) nfsd: Fix up the "supattr_exclcreat" attributes nfsd: encoders mustn't use unitialized values in error cases nfsd: fix undefined behavior in nfsd4_layout_verify lockd: fix lockd shutdown race NFSv4: Fix callback server shutdown SUNRPC: Refactor svc_set_num_threads() NFSv4.x/callback: Create the callback service through svc_create_pooled lockd: remove redundant check on block svcrdma: Clean out old XDR encoders svcrdma: Remove the req_map cache svcrdma: Remove unused RDMA Write completion handler svcrdma: Reduce size of sge array in struct svc_rdma_op_ctxt svcrdma: Clean up RPC-over-RDMA backchannel reply processing svcrdma: Report Write/Reply chunk overruns svcrdma: Clean up RDMA_ERROR path svcrdma: Use rdma_rw API in RPC reply path svcrdma: Introduce local rdma_rw API helpers svcrdma: Clean up svc_rdma_get_inv_rkey() svcrdma: Add helper to save pages under I/O svcrdma: Eliminate RPCRDMA_SQ_DEPTH_MULT ...
static inline u32 nfsd4_open_rsize(struct svc_rqst *rqstp, struct nfsd4_op *op) { return (op_encode_hdr_size + op_encode_stateid_maxsz + op_encode_change_info_maxsz + 1 + nfs4_fattr_bitmap_maxsz + op_encode_delegation_maxsz) * sizeof(__be32); }
static inline u32 nfsd4_open_rsize(struct svc_rqst *rqstp, struct nfsd4_op *op) { return (op_encode_hdr_size + op_encode_stateid_maxsz + op_encode_change_info_maxsz + 1 + nfs4_fattr_bitmap_maxsz + op_encode_delegation_maxsz) * sizeof(__be32); }
C
linux
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}
bool OffscreenCanvas::OriginClean() const { return origin_clean_ && !disable_reading_from_canvas_; }
bool OffscreenCanvas::OriginClean() const { return origin_clean_ && !disable_reading_from_canvas_; }
C
Chrome
0
CVE-2011-3897
https://www.cvedetails.com/cve/CVE-2011-3897/
CWE-399
https://github.com/chromium/chromium/commit/c7a90019bf7054145b11d2577b851cf2779d3d79
c7a90019bf7054145b11d2577b851cf2779d3d79
Fix print preview workflow to reflect settings of selected printer. BUG=95110 TEST=none Review URL: http://codereview.chromium.org/7831041 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@102242 0039d316-1c4b-4281-b951-d872f2087c98
void PrintWebViewHelper::Print(WebKit::WebFrame* frame, WebKit::WebNode* node) { if (print_web_view_) return; scoped_ptr<PrepareFrameAndViewForPrint> prepare; if (!InitPrintSettingsAndPrepareFrame(frame, node, &prepare)) { DidFinishPrinting(FAIL_PRINT); return; // Failed to init print page settings. } int expected_page_count = 0; bool use_browser_overlays = true; expected_page_count = prepare->GetExpectedPageCount(); if (expected_page_count) use_browser_overlays = prepare->ShouldUseBrowserOverlays(); prepare.reset(); if (!expected_page_count) { DidFinishPrinting(OK); // Release resources and fail silently. return; } if (!GetPrintSettingsFromUser(frame, expected_page_count, use_browser_overlays)) { DidFinishPrinting(OK); // Release resources and fail silently. return; } if (!RenderPagesForPrint(frame, node, NULL)) { LOG(ERROR) << "RenderPagesForPrint failed"; DidFinishPrinting(FAIL_PRINT); } ResetScriptedPrintCount(); }
void PrintWebViewHelper::Print(WebKit::WebFrame* frame, WebKit::WebNode* node) { if (print_web_view_) return; scoped_ptr<PrepareFrameAndViewForPrint> prepare; if (!InitPrintSettingsAndPrepareFrame(frame, node, &prepare)) return; // Failed to init print page settings. int expected_page_count = 0; bool use_browser_overlays = true; expected_page_count = prepare->GetExpectedPageCount(); if (expected_page_count) use_browser_overlays = prepare->ShouldUseBrowserOverlays(); prepare.reset(); if (!expected_page_count) { DidFinishPrinting(OK); // Release resources and fail silently. return; } if (!GetPrintSettingsFromUser(frame, expected_page_count, use_browser_overlays)) { DidFinishPrinting(OK); // Release resources and fail silently. return; } if (!RenderPagesForPrint(frame, node, NULL)) { LOG(ERROR) << "RenderPagesForPrint failed"; DidFinishPrinting(FAIL_PRINT); } ResetScriptedPrintCount(); }
C
Chrome
1
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 inline int notify_page_fault(struct pt_regs *regs, unsigned int fsr) { int ret = 0; if (!user_mode(regs)) { /* kprobe_running() needs smp_processor_id() */ preempt_disable(); if (kprobe_running() && kprobe_fault_handler(regs, fsr)) ret = 1; preempt_enable(); } return ret; }
static inline int notify_page_fault(struct pt_regs *regs, unsigned int fsr) { int ret = 0; if (!user_mode(regs)) { /* kprobe_running() needs smp_processor_id() */ preempt_disable(); if (kprobe_running() && kprobe_fault_handler(regs, fsr)) ret = 1; preempt_enable(); } return ret; }
C
linux
0
CVE-2013-7421
https://www.cvedetails.com/cve/CVE-2013-7421/
CWE-264
https://github.com/torvalds/linux/commit/5d26a105b5a73e5635eae0629b42fa0a90e07b7b
5d26a105b5a73e5635eae0629b42fa0a90e07b7b
crypto: prefix module autoloading with "crypto-" This prefixes all crypto module loading with "crypto-" so we never run the risk of exposing module auto-loading to userspace via a crypto API, as demonstrated by Mathias Krause: https://lkml.org/lkml/2013/3/4/70 Signed-off-by: Kees Cook <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
static int __init sha256_ssse3_mod_init(void) { /* test for SSSE3 first */ if (cpu_has_ssse3) sha256_transform_asm = sha256_transform_ssse3; #ifdef CONFIG_AS_AVX /* allow AVX to override SSSE3, it's a little faster */ if (avx_usable()) { #ifdef CONFIG_AS_AVX2 if (boot_cpu_has(X86_FEATURE_AVX2) && boot_cpu_has(X86_FEATURE_BMI2)) sha256_transform_asm = sha256_transform_rorx; else #endif sha256_transform_asm = sha256_transform_avx; } #endif if (sha256_transform_asm) { #ifdef CONFIG_AS_AVX if (sha256_transform_asm == sha256_transform_avx) pr_info("Using AVX optimized SHA-256 implementation\n"); #ifdef CONFIG_AS_AVX2 else if (sha256_transform_asm == sha256_transform_rorx) pr_info("Using AVX2 optimized SHA-256 implementation\n"); #endif else #endif pr_info("Using SSSE3 optimized SHA-256 implementation\n"); return crypto_register_shashes(algs, ARRAY_SIZE(algs)); } pr_info("Neither AVX nor SSSE3 is available/usable.\n"); return -ENODEV; }
static int __init sha256_ssse3_mod_init(void) { /* test for SSSE3 first */ if (cpu_has_ssse3) sha256_transform_asm = sha256_transform_ssse3; #ifdef CONFIG_AS_AVX /* allow AVX to override SSSE3, it's a little faster */ if (avx_usable()) { #ifdef CONFIG_AS_AVX2 if (boot_cpu_has(X86_FEATURE_AVX2) && boot_cpu_has(X86_FEATURE_BMI2)) sha256_transform_asm = sha256_transform_rorx; else #endif sha256_transform_asm = sha256_transform_avx; } #endif if (sha256_transform_asm) { #ifdef CONFIG_AS_AVX if (sha256_transform_asm == sha256_transform_avx) pr_info("Using AVX optimized SHA-256 implementation\n"); #ifdef CONFIG_AS_AVX2 else if (sha256_transform_asm == sha256_transform_rorx) pr_info("Using AVX2 optimized SHA-256 implementation\n"); #endif else #endif pr_info("Using SSSE3 optimized SHA-256 implementation\n"); return crypto_register_shashes(algs, ARRAY_SIZE(algs)); } pr_info("Neither AVX nor SSSE3 is available/usable.\n"); return -ENODEV; }
C
linux
0
CVE-2017-6001
https://www.cvedetails.com/cve/CVE-2017-6001/
CWE-362
https://github.com/torvalds/linux/commit/321027c1fe77f892f4ea07846aeae08cefbbb290
321027c1fe77f892f4ea07846aeae08cefbbb290
perf/core: Fix concurrent sys_perf_event_open() vs. 'move_group' race Di Shen reported a race between two concurrent sys_perf_event_open() calls where both try and move the same pre-existing software group into a hardware context. The problem is exactly that described in commit: f63a8daa5812 ("perf: Fix event->ctx locking") ... where, while we wait for a ctx->mutex acquisition, the event->ctx relation can have changed under us. That very same commit failed to recognise sys_perf_event_context() as an external access vector to the events and thereby didn't apply the established locking rules correctly. So while one sys_perf_event_open() call is stuck waiting on mutex_lock_double(), the other (which owns said locks) moves the group about. So by the time the former sys_perf_event_open() acquires the locks, the context we've acquired is stale (and possibly dead). Apply the established locking rules as per perf_event_ctx_lock_nested() to the mutex_lock_double() for the 'move_group' case. This obviously means we need to validate state after we acquire the locks. Reported-by: Di Shen (Keen Lab) Tested-by: John Dias <[email protected]> Signed-off-by: Peter Zijlstra (Intel) <[email protected]> Cc: Alexander Shishkin <[email protected]> Cc: Arnaldo Carvalho de Melo <[email protected]> Cc: Arnaldo Carvalho de Melo <[email protected]> Cc: Jiri Olsa <[email protected]> Cc: Kees Cook <[email protected]> Cc: Linus Torvalds <[email protected]> Cc: Min Chong <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Stephane Eranian <[email protected]> Cc: Thomas Gleixner <[email protected]> Cc: Vince Weaver <[email protected]> Fixes: f63a8daa5812 ("perf: Fix event->ctx locking") Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Ingo Molnar <[email protected]>
__perf_remove_from_context(struct perf_event *event, struct perf_cpu_context *cpuctx, struct perf_event_context *ctx, void *info) { unsigned long flags = (unsigned long)info; event_sched_out(event, cpuctx, ctx); if (flags & DETACH_GROUP) perf_group_detach(event); list_del_event(event, ctx); if (!ctx->nr_events && ctx->is_active) { ctx->is_active = 0; if (ctx->task) { WARN_ON_ONCE(cpuctx->task_ctx != ctx); cpuctx->task_ctx = NULL; } } }
__perf_remove_from_context(struct perf_event *event, struct perf_cpu_context *cpuctx, struct perf_event_context *ctx, void *info) { unsigned long flags = (unsigned long)info; event_sched_out(event, cpuctx, ctx); if (flags & DETACH_GROUP) perf_group_detach(event); list_del_event(event, ctx); if (!ctx->nr_events && ctx->is_active) { ctx->is_active = 0; if (ctx->task) { WARN_ON_ONCE(cpuctx->task_ctx != ctx); cpuctx->task_ctx = NULL; } } }
C
linux
0
CVE-2017-7495
https://www.cvedetails.com/cve/CVE-2017-7495/
CWE-200
https://github.com/torvalds/linux/commit/06bd3c36a733ac27962fea7d6f47168841376824
06bd3c36a733ac27962fea7d6f47168841376824
ext4: fix data exposure after a crash Huang has reported that in his powerfail testing he is seeing stale block contents in some of recently allocated blocks although he mounts ext4 in data=ordered mode. After some investigation I have found out that indeed when delayed allocation is used, we don't add inode to transaction's list of inodes needing flushing before commit. Originally we were doing that but commit f3b59291a69d removed the logic with a flawed argument that it is not needed. The problem is that although for delayed allocated blocks we write their contents immediately after allocating them, there is no guarantee that the IO scheduler or device doesn't reorder things and thus transaction allocating blocks and attaching them to inode can reach stable storage before actual block contents. Actually whenever we attach freshly allocated blocks to inode using a written extent, we should add inode to transaction's ordered inode list to make sure we properly wait for block contents to be written before committing the transaction. So that is what we do in this patch. This also handles other cases where stale data exposure was possible - like filling hole via mmap in data=ordered,nodelalloc mode. The only exception to the above rule are extending direct IO writes where blkdev_direct_IO() waits for IO to complete before increasing i_size and thus stale data exposure is not possible. For now we don't complicate the code with optimizing this special case since the overhead is pretty low. In case this is observed to be a performance problem we can always handle it using a special flag to ext4_map_blocks(). CC: [email protected] Fixes: f3b59291a69d0b734be1fc8be489fef2dd846d3d Reported-by: "HUANG Weller (CM/ESW12-CN)" <[email protected]> Tested-by: "HUANG Weller (CM/ESW12-CN)" <[email protected]> Signed-off-by: Jan Kara <[email protected]> Signed-off-by: Theodore Ts'o <[email protected]>
int ext4_filemap_fault(struct vm_area_struct *vma, struct vm_fault *vmf) { struct inode *inode = file_inode(vma->vm_file); int err; down_read(&EXT4_I(inode)->i_mmap_sem); err = filemap_fault(vma, vmf); up_read(&EXT4_I(inode)->i_mmap_sem); return err; }
int ext4_filemap_fault(struct vm_area_struct *vma, struct vm_fault *vmf) { struct inode *inode = file_inode(vma->vm_file); int err; down_read(&EXT4_I(inode)->i_mmap_sem); err = filemap_fault(vma, vmf); up_read(&EXT4_I(inode)->i_mmap_sem); return err; }
C
linux
0
CVE-2012-2880
https://www.cvedetails.com/cve/CVE-2012-2880/
CWE-362
https://github.com/chromium/chromium/commit/fcd3a7a671ecf2d5f46ea34787d27507a914d2f5
fcd3a7a671ecf2d5f46ea34787d27507a914d2f5
[Sync] Cleanup all tab sync enabling logic now that its on by default. BUG=none TEST= Review URL: https://chromiumcodereview.appspot.com/10443046 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@139462 0039d316-1c4b-4281-b951-d872f2087c98
bool ProfileSyncService::HasSyncSetupCompleted() const { return sync_prefs_.HasSyncSetupCompleted(); }
bool ProfileSyncService::HasSyncSetupCompleted() const { return sync_prefs_.HasSyncSetupCompleted(); }
C
Chrome
0
CVE-2015-8126
https://www.cvedetails.com/cve/CVE-2015-8126/
CWE-119
https://github.com/chromium/chromium/commit/7f3d85b096f66870a15b37c2f40b219b2e292693
7f3d85b096f66870a15b37c2f40b219b2e292693
third_party/libpng: update to 1.2.54 [email protected] BUG=560291 Review URL: https://codereview.chromium.org/1467263003 Cr-Commit-Position: refs/heads/master@{#362298}
png_save_uint_32(png_bytep buf, png_uint_32 i) { buf[0] = (png_byte)((i >> 24) & 0xff); buf[1] = (png_byte)((i >> 16) & 0xff); buf[2] = (png_byte)((i >> 8) & 0xff); buf[3] = (png_byte)(i & 0xff); }
png_save_uint_32(png_bytep buf, png_uint_32 i) { buf[0] = (png_byte)((i >> 24) & 0xff); buf[1] = (png_byte)((i >> 16) & 0xff); buf[2] = (png_byte)((i >> 8) & 0xff); buf[3] = (png_byte)(i & 0xff); }
C
Chrome
0
CVE-2017-5122
https://www.cvedetails.com/cve/CVE-2017-5122/
CWE-119
https://github.com/chromium/chromium/commit/f8675cbb337440a11bf9afb10ea11bae42bb92cb
f8675cbb337440a11bf9afb10ea11bae42bb92cb
cros: Enable some tests in //ash/wm in ash_unittests --mash For the ones that fail, disable them via filter file instead of in the code, per our disablement policy. Bug: 698085, 695556, 698878, 698888, 698093, 698894 Test: ash_unittests --mash Change-Id: Ic145ab6a95508968d6884d14fac2a3ca08888d26 Reviewed-on: https://chromium-review.googlesource.com/752423 Commit-Queue: James Cook <[email protected]> Reviewed-by: Steven Bennetts <[email protected]> Cr-Commit-Position: refs/heads/master@{#513836}
void RunTest(AshTestBase* test_base) { std::unique_ptr<aura::Window> window( test_base->CreateTestWindowInShellWithDelegate( this, 0, gfx::Rect(0, 0, 100, 100))); window->Show(); GenerateEvents(window.get()); EXPECT_EQ(2, mouse_event_count_); EXPECT_EQ(3, scroll_event_count_); EXPECT_EQ(4, touch_event_count_); EXPECT_EQ(10, gesture_event_count_); Reset(); views::Widget* widget = views::Widget::CreateWindowWithContextAndBounds( new TestWindow(true), Shell::GetPrimaryRootWindow(), gfx::Rect(200, 200, 100, 100)); widget->Show(); EXPECT_TRUE(ShellPort::Get()->IsSystemModalWindowOpen()); GenerateEvents(window.get()); EXPECT_EQ(0, mouse_event_count_); EXPECT_EQ(0, scroll_event_count_); EXPECT_EQ(0, touch_event_count_); EXPECT_EQ(0, gesture_event_count_); Reset(); widget->Close(); EXPECT_FALSE(ShellPort::Get()->IsSystemModalWindowOpen()); GenerateEvents(window.get()); EXPECT_EQ(2, mouse_event_count_); EXPECT_EQ(3, scroll_event_count_); EXPECT_EQ(4, touch_event_count_); EXPECT_EQ(10, gesture_event_count_); }
void RunTest(AshTestBase* test_base) { std::unique_ptr<aura::Window> window( test_base->CreateTestWindowInShellWithDelegate( this, 0, gfx::Rect(0, 0, 100, 100))); window->Show(); GenerateEvents(window.get()); EXPECT_EQ(2, mouse_event_count_); EXPECT_EQ(3, scroll_event_count_); EXPECT_EQ(4, touch_event_count_); EXPECT_EQ(10, gesture_event_count_); Reset(); views::Widget* widget = views::Widget::CreateWindowWithContextAndBounds( new TestWindow(true), Shell::GetPrimaryRootWindow(), gfx::Rect(200, 200, 100, 100)); widget->Show(); EXPECT_TRUE(ShellPort::Get()->IsSystemModalWindowOpen()); GenerateEvents(window.get()); EXPECT_EQ(0, mouse_event_count_); EXPECT_EQ(0, scroll_event_count_); EXPECT_EQ(0, touch_event_count_); EXPECT_EQ(0, gesture_event_count_); Reset(); widget->Close(); EXPECT_FALSE(ShellPort::Get()->IsSystemModalWindowOpen()); GenerateEvents(window.get()); EXPECT_EQ(2, mouse_event_count_); EXPECT_EQ(3, scroll_event_count_); EXPECT_EQ(4, touch_event_count_); EXPECT_EQ(10, gesture_event_count_); }
C
Chrome
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)
void tkhd_del(GF_Box *s) { GF_TrackHeaderBox *ptr = (GF_TrackHeaderBox *)s; if (ptr == NULL) return; gf_free(ptr); return; }
void tkhd_del(GF_Box *s) { GF_TrackHeaderBox *ptr = (GF_TrackHeaderBox *)s; if (ptr == NULL) return; gf_free(ptr); return; }
C
gpac
0
CVE-2015-6763
https://www.cvedetails.com/cve/CVE-2015-6763/
null
https://github.com/chromium/chromium/commit/f1574f25e1402e748bf2bd7e28ce3dd96ceb1ca4
f1574f25e1402e748bf2bd7e28ce3dd96ceb1ca4
MacViews: Enable secure text input for password Textfields. In Cocoa the NSTextInputContext automatically enables secure text input when activated and it's in the secure text entry mode. RenderWidgetHostViewMac did the similar thing for ages following the WebKit example. views::Textfield needs to do the same thing in a fashion that's sycnrhonized with RenderWidgetHostViewMac, otherwise the race conditions are possible when the Textfield gets focus, activates the secure text input mode and the RWHVM loses focus immediately afterwards and disables the secure text input instead of leaving it in the enabled state. BUG=818133,677220 Change-Id: I6db6c4b59e4a1a72cbb7f8c7056f71b04a3df08b Reviewed-on: https://chromium-review.googlesource.com/943064 Commit-Queue: Michail Pishchagin <[email protected]> Reviewed-by: Pavel Feldman <[email protected]> Reviewed-by: Avi Drissman <[email protected]> Reviewed-by: Peter Kasting <[email protected]> Cr-Commit-Position: refs/heads/master@{#542517}
bool Textfield::HasSelection() const { return !GetSelectedRange().is_empty(); }
bool Textfield::HasSelection() const { return !GetSelectedRange().is_empty(); }
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 byteAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) { TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); TestObjectPythonV8Internal::byteAttributeAttributeGetter(info); TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); }
static void byteAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) { TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); TestObjectPythonV8Internal::byteAttributeAttributeGetter(info); TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); }
C
Chrome
0
CVE-2017-15906
https://www.cvedetails.com/cve/CVE-2017-15906/
CWE-269
https://github.com/openbsd/src/commit/a6981567e8e215acc1ef690c8dbb30f2d9b00a19
a6981567e8e215acc1ef690c8dbb30f2d9b00a19
disallow creation (of empty files) in read-only mode; reported by Michal Zalewski, feedback & ok deraadt@
attrib_to_tv(const Attrib *a) { static struct timeval tv[2]; tv[0].tv_sec = a->atime; tv[0].tv_usec = 0; tv[1].tv_sec = a->mtime; tv[1].tv_usec = 0; return tv; }
attrib_to_tv(const Attrib *a) { static struct timeval tv[2]; tv[0].tv_sec = a->atime; tv[0].tv_usec = 0; tv[1].tv_sec = a->mtime; tv[1].tv_usec = 0; return tv; }
C
src
0
CVE-2015-3418
https://www.cvedetails.com/cve/CVE-2015-3418/
CWE-369
https://cgit.freedesktop.org/xorg/xserver/commit/?id=dc777c346d5d452a53b13b917c45f6a1bad2f20b
dc777c346d5d452a53b13b917c45f6a1bad2f20b
null
ProcFreeColors(ClientPtr client) { ColormapPtr pcmp; int rc; REQUEST(xFreeColorsReq); REQUEST_AT_LEAST_SIZE(xFreeColorsReq); rc = dixLookupResourceByType((void **) &pcmp, stuff->cmap, RT_COLORMAP, client, DixRemoveAccess); if (rc == Success) { int count; if (pcmp->flags & AllAllocated) return BadAccess; count = bytes_to_int32((client->req_len << 2) - sizeof(xFreeColorsReq)); return FreeColors(pcmp, client->index, count, (Pixel *) &stuff[1], (Pixel) stuff->planeMask); } else { client->errorValue = stuff->cmap; return rc; } }
ProcFreeColors(ClientPtr client) { ColormapPtr pcmp; int rc; REQUEST(xFreeColorsReq); REQUEST_AT_LEAST_SIZE(xFreeColorsReq); rc = dixLookupResourceByType((void **) &pcmp, stuff->cmap, RT_COLORMAP, client, DixRemoveAccess); if (rc == Success) { int count; if (pcmp->flags & AllAllocated) return BadAccess; count = bytes_to_int32((client->req_len << 2) - sizeof(xFreeColorsReq)); return FreeColors(pcmp, client->index, count, (Pixel *) &stuff[1], (Pixel) stuff->planeMask); } else { client->errorValue = stuff->cmap; return rc; } }
C
xserver
0
CVE-2019-16910
https://www.cvedetails.com/cve/CVE-2019-16910/
CWE-200
https://github.com/ARMmbed/mbedtls/commit/298a43a77ec0ed2c19a8c924ddd8571ef3e65dfd
298a43a77ec0ed2c19a8c924ddd8571ef3e65dfd
Merge remote-tracking branch 'upstream-restricted/pr/549' into mbedtls-2.7-restricted
int mbedtls_ecdsa_write_signature( mbedtls_ecdsa_context *ctx, mbedtls_md_type_t md_alg, const unsigned char *hash, size_t hlen, unsigned char *sig, size_t *slen, int (*f_rng)(void *, unsigned char *, size_t), void *p_rng ) { int ret; mbedtls_mpi r, s; mbedtls_mpi_init( &r ); mbedtls_mpi_init( &s ); #if defined(MBEDTLS_ECDSA_DETERMINISTIC) MBEDTLS_MPI_CHK( ecdsa_sign_det_internal( &ctx->grp, &r, &s, &ctx->d, hash, hlen, md_alg, f_rng, p_rng ) ); #else (void) md_alg; MBEDTLS_MPI_CHK( mbedtls_ecdsa_sign( &ctx->grp, &r, &s, &ctx->d, hash, hlen, f_rng, p_rng ) ); #endif /* MBEDTLS_ECDSA_DETERMINISTIC */ MBEDTLS_MPI_CHK( ecdsa_signature_to_asn1( &r, &s, sig, slen ) ); cleanup: mbedtls_mpi_free( &r ); mbedtls_mpi_free( &s ); return( ret ); }
int mbedtls_ecdsa_write_signature( mbedtls_ecdsa_context *ctx, mbedtls_md_type_t md_alg, const unsigned char *hash, size_t hlen, unsigned char *sig, size_t *slen, int (*f_rng)(void *, unsigned char *, size_t), void *p_rng ) { int ret; mbedtls_mpi r, s; mbedtls_mpi_init( &r ); mbedtls_mpi_init( &s ); #if defined(MBEDTLS_ECDSA_DETERMINISTIC) (void) f_rng; (void) p_rng; MBEDTLS_MPI_CHK( mbedtls_ecdsa_sign_det( &ctx->grp, &r, &s, &ctx->d, hash, hlen, md_alg ) ); #else (void) md_alg; MBEDTLS_MPI_CHK( mbedtls_ecdsa_sign( &ctx->grp, &r, &s, &ctx->d, hash, hlen, f_rng, p_rng ) ); #endif MBEDTLS_MPI_CHK( ecdsa_signature_to_asn1( &r, &s, sig, slen ) ); cleanup: mbedtls_mpi_free( &r ); mbedtls_mpi_free( &s ); return( ret ); }
C
mbedtls
1
null
null
null
https://github.com/chromium/chromium/commit/d1a59e4e845a01d7d7b80ef184b672752a9eae4d
d1a59e4e845a01d7d7b80ef184b672752a9eae4d
Fixing cross-process postMessage replies on more than two iterations. When two frames are replying to each other using event.source across processes, after the first two replies, things break down. The root cause is that in RenderViewImpl::GetFrameByMappedID, the lookup was incorrect. It is now properly searching for the remote frame id and returning the local one. BUG=153445 Review URL: https://chromiumcodereview.appspot.com/11040015 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@159924 0039d316-1c4b-4281-b951-d872f2087c98
void RenderViewImpl::OnExecuteEditCommand(const std::string& name, const std::string& value) { if (!webview() || !webview()->focusedFrame()) return; webview()->focusedFrame()->executeCommand( WebString::fromUTF8(name), WebString::fromUTF8(value)); }
void RenderViewImpl::OnExecuteEditCommand(const std::string& name, const std::string& value) { if (!webview() || !webview()->focusedFrame()) return; webview()->focusedFrame()->executeCommand( WebString::fromUTF8(name), WebString::fromUTF8(value)); }
C
Chrome
0
CVE-2018-6161
https://www.cvedetails.com/cve/CVE-2018-6161/
CWE-20
https://github.com/chromium/chromium/commit/761c75d2d607638ff53c764b4925bcca9be601d8
761c75d2d607638ff53c764b4925bcca9be601d8
Redirect should not circumvent same-origin restrictions Check whether we have access to the audio data when the format is set. At this point we have enough information to determine this. The old approach based on when the src was changed was incorrect because at the point, we only know the new src; none of the response headers have been read yet. This new approach also removes the incorrect message reported in 619114. Bug: 826552, 619114 Change-Id: I95119b3a1e399c05d0fbd2da71f87967978efff6 Reviewed-on: https://chromium-review.googlesource.com/1069540 Commit-Queue: Raymond Toy <[email protected]> Reviewed-by: Yutaka Hirano <[email protected]> Reviewed-by: Hongchan Choi <[email protected]> Cr-Commit-Position: refs/heads/master@{#564313}
BaseAudioContext::~BaseAudioContext() { GetDeferredTaskHandler().ContextWillBeDestroyed(); DCHECK(!active_source_nodes_.size()); DCHECK(!is_resolving_resume_promises_); DCHECK(!resume_resolvers_.size()); DCHECK(!autoplay_status_.has_value()); }
BaseAudioContext::~BaseAudioContext() { GetDeferredTaskHandler().ContextWillBeDestroyed(); DCHECK(!active_source_nodes_.size()); DCHECK(!is_resolving_resume_promises_); DCHECK(!resume_resolvers_.size()); DCHECK(!autoplay_status_.has_value()); }
C
Chrome
0
CVE-2009-3605
https://www.cvedetails.com/cve/CVE-2009-3605/
CWE-189
https://cgit.freedesktop.org/poppler/poppler/commit/?id=7b2d314a61fd0e12f47c62996cb49ec0d1ba747a
7b2d314a61fd0e12f47c62996cb49ec0d1ba747a
null
void CairoOutputDev::type3D0(GfxState *state, double wx, double wy) { t3_glyph_wx = wx; t3_glyph_wy = wy; }
void CairoOutputDev::type3D0(GfxState *state, double wx, double wy) { t3_glyph_wx = wx; t3_glyph_wy = wy; }
CPP
poppler
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 SameObjectAttributeAttributeGetter(const v8::FunctionCallbackInfo<v8::Value>& info) { v8::Local<v8::Object> holder = info.Holder(); TestObject* impl = V8TestObject::ToImpl(holder); TestInterfaceImplementation* cpp_value(WTF::GetPtr(impl->sameObjectAttribute())); if (cpp_value && DOMDataStore::SetReturnValue(info.GetReturnValue(), cpp_value)) return; v8::Local<v8::Value> v8_value(ToV8(cpp_value, holder, info.GetIsolate())); static const V8PrivateProperty::SymbolKey kKeepAliveKey; V8PrivateProperty::GetSymbol(info.GetIsolate(), kKeepAliveKey) .Set(holder, v8_value); V8SetReturnValue(info, v8_value); }
static void SameObjectAttributeAttributeGetter(const v8::FunctionCallbackInfo<v8::Value>& info) { v8::Local<v8::Object> holder = info.Holder(); TestObject* impl = V8TestObject::ToImpl(holder); TestInterfaceImplementation* cpp_value(WTF::GetPtr(impl->sameObjectAttribute())); if (cpp_value && DOMDataStore::SetReturnValue(info.GetReturnValue(), cpp_value)) return; v8::Local<v8::Value> v8_value(ToV8(cpp_value, holder, info.GetIsolate())); static const V8PrivateProperty::SymbolKey kKeepAliveKey; V8PrivateProperty::GetSymbol(info.GetIsolate(), kKeepAliveKey) .Set(holder, v8_value); V8SetReturnValue(info, v8_value); }
C
Chrome
0
CVE-2016-3899
https://www.cvedetails.com/cve/CVE-2016-3899/
CWE-284
https://android.googlesource.com/platform/frameworks/av/+/97837bb6cbac21ea679843a0037779d3834bed64
97837bb6cbac21ea679843a0037779d3834bed64
OMXCodec: check IMemory::pointer() before using allocation Bug: 29421811 Change-Id: I0a73ba12bae4122f1d89fc92e5ea4f6a96cd1ed1
void setCodec(const sp<OMXCodec> &target) { mTarget = target; }
void setCodec(const sp<OMXCodec> &target) { mTarget = target; }
C
Android
0
CVE-2014-8130
https://www.cvedetails.com/cve/CVE-2014-8130/
CWE-369
https://github.com/vadz/libtiff/commit/3c5eb8b1be544e41d2c336191bc4936300ad7543
3c5eb8b1be544e41d2c336191bc4936300ad7543
* libtiff/tif_{unix,vms,win32}.c (_TIFFmalloc): ANSI C does not require malloc() to return NULL pointer if requested allocation size is zero. Assure that _TIFFmalloc does.
Win32WarningHandler(const char* module, const char* fmt, va_list ap) { #ifndef TIF_PLATFORM_CONSOLE LPTSTR szTitle; LPTSTR szTmp; LPCTSTR szTitleText = "%s Warning"; LPCTSTR szDefaultModule = "LIBTIFF"; LPCTSTR szTmpModule = (module == NULL) ? szDefaultModule : module; SIZE_T nBufSize = (strlen(szTmpModule) + strlen(szTitleText) + strlen(fmt) + 256)*sizeof(char); if ((szTitle = (LPTSTR)LocalAlloc(LMEM_FIXED, nBufSize)) == NULL) return; sprintf(szTitle, szTitleText, szTmpModule); szTmp = szTitle + (strlen(szTitle)+2)*sizeof(char); vsnprintf(szTmp, nBufSize-(strlen(szTitle)+2)*sizeof(char), fmt, ap); MessageBoxA(GetFocus(), szTmp, szTitle, MB_OK | MB_ICONINFORMATION); LocalFree(szTitle); return; #else if (module != NULL) fprintf(stderr, "%s: ", module); fprintf(stderr, "Warning, "); vfprintf(stderr, fmt, ap); fprintf(stderr, ".\n"); #endif }
Win32WarningHandler(const char* module, const char* fmt, va_list ap) { #ifndef TIF_PLATFORM_CONSOLE LPTSTR szTitle; LPTSTR szTmp; LPCTSTR szTitleText = "%s Warning"; LPCTSTR szDefaultModule = "LIBTIFF"; LPCTSTR szTmpModule = (module == NULL) ? szDefaultModule : module; SIZE_T nBufSize = (strlen(szTmpModule) + strlen(szTitleText) + strlen(fmt) + 256)*sizeof(char); if ((szTitle = (LPTSTR)LocalAlloc(LMEM_FIXED, nBufSize)) == NULL) return; sprintf(szTitle, szTitleText, szTmpModule); szTmp = szTitle + (strlen(szTitle)+2)*sizeof(char); vsnprintf(szTmp, nBufSize-(strlen(szTitle)+2)*sizeof(char), fmt, ap); MessageBoxA(GetFocus(), szTmp, szTitle, MB_OK | MB_ICONINFORMATION); LocalFree(szTitle); return; #else if (module != NULL) fprintf(stderr, "%s: ", module); fprintf(stderr, "Warning, "); vfprintf(stderr, fmt, ap); fprintf(stderr, ".\n"); #endif }
C
libtiff
0
CVE-2010-2060
https://www.cvedetails.com/cve/CVE-2010-2060/
null
https://github.com/kr/beanstalkd/commit/2e8e8c6387ecdf5923dfc4d7718d18eba1b0873d
2e8e8c6387ecdf5923dfc4d7718d18eba1b0873d
Discard job body bytes if the job is too big. Previously, a malicious user could craft a job payload and inject beanstalk commands without the client application knowing. (An extra-careful client library could check the size of the job body before sending the put command, but most libraries do not do this, nor should they have to.) Reported by Graham Barr.
prot_replay_binlog(job binlog_jobs) { job j, nj; usec delay; int r; for (j = binlog_jobs->next ; j != binlog_jobs ; j = nj) { nj = j->next; job_remove(j); binlog_reserve_space_update(j); /* reserve space for a delete */ delay = 0; switch (j->state) { case JOB_STATE_BURIED: bury_job(j, 0); break; case JOB_STATE_DELAYED: if (started_at < j->deadline_at) { delay = j->deadline_at - started_at; } /* fall through */ default: r = enqueue_job(j, delay, 0); if (r < 1) twarnx("error processing binlog job %llu", j->id); } } }
prot_replay_binlog(job binlog_jobs) { job j, nj; usec delay; int r; for (j = binlog_jobs->next ; j != binlog_jobs ; j = nj) { nj = j->next; job_remove(j); binlog_reserve_space_update(j); /* reserve space for a delete */ delay = 0; switch (j->state) { case JOB_STATE_BURIED: bury_job(j, 0); break; case JOB_STATE_DELAYED: if (started_at < j->deadline_at) { delay = j->deadline_at - started_at; } /* fall through */ default: r = enqueue_job(j, delay, 0); if (r < 1) twarnx("error processing binlog job %llu", j->id); } } }
C
beanstalkd
0
null
null
null
https://github.com/chromium/chromium/commit/df831400bcb63db4259b5858281b1727ba972a2a
df831400bcb63db4259b5858281b1727ba972a2a
WebKit2: Support window bounce when panning. https://bugs.webkit.org/show_bug.cgi?id=58065 <rdar://problem/9244367> Reviewed by Adam Roben. Make gestureDidScroll synchronous, as once we scroll, we need to know whether or not we are at the beginning or end of the scrollable document. If we are at either end of the scrollable document, we call the Windows 7 API to bounce the window to give an indication that you are past an end of the document. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::gestureDidScroll): Pass a boolean for the reply, and return it. * UIProcess/WebPageProxy.h: * UIProcess/win/WebView.cpp: (WebKit::WebView::WebView): Inititalize a new variable. (WebKit::WebView::onGesture): Once we send the message to scroll, check if have gone to an end of the document, and if we have, bounce the window. * UIProcess/win/WebView.h: * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: GestureDidScroll is now sync. * WebProcess/WebPage/win/WebPageWin.cpp: (WebKit::WebPage::gestureDidScroll): When we are done scrolling, check if we have a vertical scrollbar and if we are at the beginning or the end of the scrollable document. git-svn-id: svn://svn.chromium.org/blink/trunk@83197 bbb929c8-8fbe-4397-9dbb-9b2b20218538
void WebPageProxy::handleKeyboardEvent(const NativeWebKeyboardEvent& event) { if (!isValid()) return; m_keyEventQueue.append(event); process()->responsivenessTimer()->start(); process()->send(Messages::WebPage::KeyEvent(event), m_pageID); }
void WebPageProxy::handleKeyboardEvent(const NativeWebKeyboardEvent& event) { if (!isValid()) return; m_keyEventQueue.append(event); process()->responsivenessTimer()->start(); process()->send(Messages::WebPage::KeyEvent(event), m_pageID); }
C
Chrome
0
CVE-2015-8126
https://www.cvedetails.com/cve/CVE-2015-8126/
CWE-119
https://github.com/chromium/chromium/commit/7f3d85b096f66870a15b37c2f40b219b2e292693
7f3d85b096f66870a15b37c2f40b219b2e292693
third_party/libpng: update to 1.2.54 [email protected] BUG=560291 Review URL: https://codereview.chromium.org/1467263003 Cr-Commit-Position: refs/heads/master@{#362298}
png_get_tRNS(png_structp png_ptr, png_infop info_ptr, png_bytep *trans, int *num_trans, png_color_16p *trans_values) { png_uint_32 retval = 0; if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_tRNS)) { png_debug1(1, "in %s retrieval function", "tRNS"); if (info_ptr->color_type == PNG_COLOR_TYPE_PALETTE) { if (trans != NULL) { *trans = info_ptr->trans; retval |= PNG_INFO_tRNS; } if (trans_values != NULL) *trans_values = &(info_ptr->trans_values); } else /* if (info_ptr->color_type != PNG_COLOR_TYPE_PALETTE) */ { if (trans_values != NULL) { *trans_values = &(info_ptr->trans_values); retval |= PNG_INFO_tRNS; } if (trans != NULL) *trans = NULL; } if (num_trans != NULL) { *num_trans = info_ptr->num_trans; retval |= PNG_INFO_tRNS; } } return (retval); }
png_get_tRNS(png_structp png_ptr, png_infop info_ptr, png_bytep *trans, int *num_trans, png_color_16p *trans_values) { png_uint_32 retval = 0; if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_tRNS)) { png_debug1(1, "in %s retrieval function", "tRNS"); if (info_ptr->color_type == PNG_COLOR_TYPE_PALETTE) { if (trans != NULL) { *trans = info_ptr->trans; retval |= PNG_INFO_tRNS; } if (trans_values != NULL) *trans_values = &(info_ptr->trans_values); } else /* if (info_ptr->color_type != PNG_COLOR_TYPE_PALETTE) */ { if (trans_values != NULL) { *trans_values = &(info_ptr->trans_values); retval |= PNG_INFO_tRNS; } if (trans != NULL) *trans = NULL; } if (num_trans != NULL) { *num_trans = info_ptr->num_trans; retval |= PNG_INFO_tRNS; } } return (retval); }
C
Chrome
0
null
null
null
https://github.com/chromium/chromium/commit/1161a49d663dd395bd639549c2dfe7324f847938
1161a49d663dd395bd639549c2dfe7324f847938
Don't populate URL data in WebDropData when dragging files. This is considered a potential security issue as well, since it leaks filesystem paths. BUG=332579 Review URL: https://codereview.chromium.org/135633002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@244538 0039d316-1c4b-4281-b951-d872f2087c98
static STGMEDIUM* GetStorageForBytes(const void* data, size_t bytes) { HANDLE handle = GlobalAlloc(GPTR, static_cast<int>(bytes)); if (handle) { base::win::ScopedHGlobal<uint8> scoped(handle); memcpy(scoped.get(), data, bytes); } STGMEDIUM* storage = new STGMEDIUM; storage->hGlobal = handle; storage->tymed = TYMED_HGLOBAL; storage->pUnkForRelease = NULL; return storage; }
static STGMEDIUM* GetStorageForBytes(const void* data, size_t bytes) { HANDLE handle = GlobalAlloc(GPTR, static_cast<int>(bytes)); if (handle) { base::win::ScopedHGlobal<uint8> scoped(handle); memcpy(scoped.get(), data, bytes); } STGMEDIUM* storage = new STGMEDIUM; storage->hGlobal = handle; storage->tymed = TYMED_HGLOBAL; storage->pUnkForRelease = NULL; return storage; }
C
Chrome
0
CVE-2016-7943
https://www.cvedetails.com/cve/CVE-2016-7943/
CWE-787
https://cgit.freedesktop.org/xorg/lib/libX11/commit/?id=8c29f1607a31dac0911e45a0dd3d74173822b3c9
8c29f1607a31dac0911e45a0dd3d74173822b3c9
null
XFreeModifiermap(XModifierKeymap *map) { if (map) { Xfree(map->modifiermap); Xfree(map); } return 1; }
XFreeModifiermap(XModifierKeymap *map) { if (map) { Xfree(map->modifiermap); Xfree(map); } return 1; }
C
libx11
0
CVE-2011-3188
https://www.cvedetails.com/cve/CVE-2011-3188/
null
https://github.com/torvalds/linux/commit/6e5714eaf77d79ae1c8b47e3e040ff5411b717ec
6e5714eaf77d79ae1c8b47e3e040ff5411b717ec
net: Compute protocol sequence numbers and fragment IDs using MD5. Computers have become a lot faster since we compromised on the partial MD4 hash which we use currently for performance reasons. MD5 is a much safer choice, and is inline with both RFC1948 and other ISS generators (OpenBSD, Solaris, etc.) Furthermore, only having 24-bits of the sequence number be truly unpredictable is a very serious limitation. So the periodic regeneration and 8-bit counter have been removed. We compute and use a full 32-bit sequence number. For ipv6, DCCP was found to use a 32-bit truncated initial sequence number (it needs 43-bits) and that is fixed here as well. Reported-by: Dan Kaminsky <[email protected]> Tested-by: Willy Tarreau <[email protected]> Signed-off-by: David S. Miller <[email protected]>
static u32 rt_peer_genid(void) { return atomic_read(&__rt_peer_genid); }
static u32 rt_peer_genid(void) { return atomic_read(&__rt_peer_genid); }
C
linux
0
CVE-2011-2806
https://www.cvedetails.com/cve/CVE-2011-2806/
CWE-119
https://github.com/chromium/chromium/commit/01e4ee2fda0a5e57a8d0c8cb829022eb84fdff12
01e4ee2fda0a5e57a8d0c8cb829022eb84fdff12
Rename isPositioned to isOutOfFlowPositioned for clarity https://bugs.webkit.org/show_bug.cgi?id=89836 Reviewed by Antti Koivisto. RenderObject and RenderStyle had an isPositioned() method that was confusing, because it excluded relative positioning. Rename to isOutOfFlowPositioned(), which makes it clearer that it only applies to absolute and fixed positioning. Simple rename; no behavior change. Source/WebCore: * css/CSSComputedStyleDeclaration.cpp: (WebCore::getPositionOffsetValue): * css/StyleResolver.cpp: (WebCore::StyleResolver::collectMatchingRulesForList): * dom/Text.cpp: (WebCore::Text::rendererIsNeeded): * editing/DeleteButtonController.cpp: (WebCore::isDeletableElement): * editing/TextIterator.cpp: (WebCore::shouldEmitNewlinesBeforeAndAfterNode): * rendering/AutoTableLayout.cpp: (WebCore::shouldScaleColumns): * rendering/InlineFlowBox.cpp: (WebCore::InlineFlowBox::addToLine): (WebCore::InlineFlowBox::placeBoxesInInlineDirection): (WebCore::InlineFlowBox::requiresIdeographicBaseline): (WebCore::InlineFlowBox::adjustMaxAscentAndDescent): (WebCore::InlineFlowBox::computeLogicalBoxHeights): (WebCore::InlineFlowBox::placeBoxesInBlockDirection): (WebCore::InlineFlowBox::flipLinesInBlockDirection): (WebCore::InlineFlowBox::computeOverflow): (WebCore::InlineFlowBox::computeOverAnnotationAdjustment): (WebCore::InlineFlowBox::computeUnderAnnotationAdjustment): * rendering/InlineIterator.h: (WebCore::isIteratorTarget): * rendering/LayoutState.cpp: (WebCore::LayoutState::LayoutState): * rendering/RenderBlock.cpp: (WebCore::RenderBlock::MarginInfo::MarginInfo): (WebCore::RenderBlock::styleWillChange): (WebCore::RenderBlock::styleDidChange): (WebCore::RenderBlock::addChildToContinuation): (WebCore::RenderBlock::addChildToAnonymousColumnBlocks): (WebCore::RenderBlock::containingColumnsBlock): (WebCore::RenderBlock::columnsBlockForSpanningElement): (WebCore::RenderBlock::addChildIgnoringAnonymousColumnBlocks): (WebCore::getInlineRun): (WebCore::RenderBlock::isSelfCollapsingBlock): (WebCore::RenderBlock::layoutBlock): (WebCore::RenderBlock::addOverflowFromBlockChildren): (WebCore::RenderBlock::expandsToEncloseOverhangingFloats): (WebCore::RenderBlock::handlePositionedChild): (WebCore::RenderBlock::moveRunInUnderSiblingBlockIfNeeded): (WebCore::RenderBlock::collapseMargins): (WebCore::RenderBlock::clearFloatsIfNeeded): (WebCore::RenderBlock::simplifiedNormalFlowLayout): (WebCore::RenderBlock::isSelectionRoot): (WebCore::RenderBlock::blockSelectionGaps): (WebCore::RenderBlock::clearFloats): (WebCore::RenderBlock::markAllDescendantsWithFloatsForLayout): (WebCore::RenderBlock::markSiblingsWithFloatsForLayout): (WebCore::isChildHitTestCandidate): (WebCore::InlineMinMaxIterator::next): (WebCore::RenderBlock::computeBlockPreferredLogicalWidths): (WebCore::RenderBlock::firstLineBoxBaseline): (WebCore::RenderBlock::lastLineBoxBaseline): (WebCore::RenderBlock::updateFirstLetter): (WebCore::shouldCheckLines): (WebCore::getHeightForLineCount): (WebCore::RenderBlock::adjustForBorderFit): (WebCore::inNormalFlow): (WebCore::RenderBlock::adjustLinePositionForPagination): (WebCore::RenderBlock::adjustBlockChildForPagination): (WebCore::RenderBlock::renderName): * rendering/RenderBlock.h: (WebCore::RenderBlock::shouldSkipCreatingRunsForObject): * rendering/RenderBlockLineLayout.cpp: (WebCore::RenderBlock::setMarginsForRubyRun): (WebCore::RenderBlock::computeInlineDirectionPositionsForLine): (WebCore::RenderBlock::computeBlockDirectionPositionsForLine): (WebCore::RenderBlock::layoutInlineChildren): (WebCore::requiresLineBox): (WebCore::RenderBlock::LineBreaker::skipTrailingWhitespace): (WebCore::RenderBlock::LineBreaker::skipLeadingWhitespace): (WebCore::RenderBlock::LineBreaker::nextLineBreak): * rendering/RenderBox.cpp: (WebCore::RenderBox::removeFloatingOrPositionedChildFromBlockLists): (WebCore::RenderBox::styleWillChange): (WebCore::RenderBox::styleDidChange): (WebCore::RenderBox::updateBoxModelInfoFromStyle): (WebCore::RenderBox::offsetFromContainer): (WebCore::RenderBox::positionLineBox): (WebCore::RenderBox::computeRectForRepaint): (WebCore::RenderBox::computeLogicalWidthInRegion): (WebCore::RenderBox::renderBoxRegionInfo): (WebCore::RenderBox::computeLogicalHeight): (WebCore::RenderBox::computePercentageLogicalHeight): (WebCore::RenderBox::computeReplacedLogicalWidthUsing): (WebCore::RenderBox::computeReplacedLogicalHeightUsing): (WebCore::RenderBox::availableLogicalHeightUsing): (WebCore::percentageLogicalHeightIsResolvable): * rendering/RenderBox.h: (WebCore::RenderBox::stretchesToViewport): (WebCore::RenderBox::isDeprecatedFlexItem): * rendering/RenderBoxModelObject.cpp: (WebCore::RenderBoxModelObject::adjustedPositionRelativeToOffsetParent): (WebCore::RenderBoxModelObject::mapAbsoluteToLocalPoint): * rendering/RenderBoxModelObject.h: (WebCore::RenderBoxModelObject::requiresLayer): * rendering/RenderDeprecatedFlexibleBox.cpp: (WebCore::childDoesNotAffectWidthOrFlexing): (WebCore::RenderDeprecatedFlexibleBox::layoutBlock): (WebCore::RenderDeprecatedFlexibleBox::layoutHorizontalBox): (WebCore::RenderDeprecatedFlexibleBox::layoutVerticalBox): (WebCore::RenderDeprecatedFlexibleBox::renderName): * rendering/RenderFieldset.cpp: (WebCore::RenderFieldset::findLegend): * rendering/RenderFlexibleBox.cpp: (WebCore::RenderFlexibleBox::computePreferredLogicalWidths): (WebCore::RenderFlexibleBox::autoMarginOffsetInMainAxis): (WebCore::RenderFlexibleBox::availableAlignmentSpaceForChild): (WebCore::RenderFlexibleBox::computeMainAxisPreferredSizes): (WebCore::RenderFlexibleBox::computeNextFlexLine): (WebCore::RenderFlexibleBox::resolveFlexibleLengths): (WebCore::RenderFlexibleBox::prepareChildForPositionedLayout): (WebCore::RenderFlexibleBox::layoutAndPlaceChildren): (WebCore::RenderFlexibleBox::layoutColumnReverse): (WebCore::RenderFlexibleBox::adjustAlignmentForChild): (WebCore::RenderFlexibleBox::flipForRightToLeftColumn): * rendering/RenderGrid.cpp: (WebCore::RenderGrid::renderName): * rendering/RenderImage.cpp: (WebCore::RenderImage::computeIntrinsicRatioInformation): * rendering/RenderInline.cpp: (WebCore::RenderInline::addChildIgnoringContinuation): (WebCore::RenderInline::addChildToContinuation): (WebCore::RenderInline::generateCulledLineBoxRects): (WebCore): (WebCore::RenderInline::culledInlineFirstLineBox): (WebCore::RenderInline::culledInlineLastLineBox): (WebCore::RenderInline::culledInlineVisualOverflowBoundingBox): (WebCore::RenderInline::computeRectForRepaint): (WebCore::RenderInline::dirtyLineBoxes): * rendering/RenderLayer.cpp: (WebCore::checkContainingBlockChainForPagination): (WebCore::RenderLayer::updateLayerPosition): (WebCore::isPositionedContainer): (WebCore::RenderLayer::calculateClipRects): (WebCore::RenderLayer::shouldBeNormalFlowOnly): * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::requiresCompositingForPosition): * rendering/RenderLineBoxList.cpp: (WebCore::RenderLineBoxList::dirtyLinesFromChangedChild): * rendering/RenderListItem.cpp: (WebCore::getParentOfFirstLineBox): * rendering/RenderMultiColumnBlock.cpp: (WebCore::RenderMultiColumnBlock::renderName): * rendering/RenderObject.cpp: (WebCore::RenderObject::markContainingBlocksForLayout): (WebCore::RenderObject::setPreferredLogicalWidthsDirty): (WebCore::RenderObject::invalidateContainerPreferredLogicalWidths): (WebCore::RenderObject::styleWillChange): (WebCore::RenderObject::offsetParent): * rendering/RenderObject.h: (WebCore::RenderObject::isOutOfFlowPositioned): (WebCore::RenderObject::isInFlowPositioned): (WebCore::RenderObject::hasClip): (WebCore::RenderObject::isFloatingOrOutOfFlowPositioned): * rendering/RenderObjectChildList.cpp: (WebCore::RenderObjectChildList::removeChildNode): * rendering/RenderReplaced.cpp: (WebCore::hasAutoHeightOrContainingBlockWithAutoHeight): * rendering/RenderRubyRun.cpp: (WebCore::RenderRubyRun::rubyText): * rendering/RenderTable.cpp: (WebCore::RenderTable::addChild): (WebCore::RenderTable::computeLogicalWidth): (WebCore::RenderTable::layout): * rendering/style/RenderStyle.h: Source/WebKit/blackberry: * Api/WebPage.cpp: (BlackBerry::WebKit::isPositionedContainer): (BlackBerry::WebKit::isNonRenderViewFixedPositionedContainer): (BlackBerry::WebKit::isFixedPositionedContainer): Source/WebKit2: * WebProcess/WebPage/qt/LayerTreeHostQt.cpp: (WebKit::updateOffsetFromViewportForSelf): git-svn-id: svn://svn.chromium.org/blink/trunk@121123 bbb929c8-8fbe-4397-9dbb-9b2b20218538
static PassRefPtr<CSSPrimitiveValue> fontStyleFromStyle(RenderStyle* style) { if (style->fontDescription().italic()) return cssValuePool().createIdentifierValue(CSSValueItalic); return cssValuePool().createIdentifierValue(CSSValueNormal); }
static PassRefPtr<CSSPrimitiveValue> fontStyleFromStyle(RenderStyle* style) { if (style->fontDescription().italic()) return cssValuePool().createIdentifierValue(CSSValueItalic); return cssValuePool().createIdentifierValue(CSSValueNormal); }
C
Chrome
0
CVE-2014-4656
https://www.cvedetails.com/cve/CVE-2014-4656/
CWE-189
https://github.com/torvalds/linux/commit/ac902c112d90a89e59916f751c2745f4dbdbb4bd
ac902c112d90a89e59916f751c2745f4dbdbb4bd
ALSA: control: Handle numid overflow Each control gets automatically assigned its numids when the control is created. The allocation is done by incrementing the numid by the amount of allocated numids per allocation. This means that excessive creation and destruction of controls (e.g. via SNDRV_CTL_IOCTL_ELEM_ADD/REMOVE) can cause the id to eventually overflow. Currently when this happens for the control that caused the overflow kctl->id.numid + kctl->count will also over flow causing it to be smaller than kctl->id.numid. Most of the code assumes that this is something that can not happen, so we need to make sure that it won't happen Signed-off-by: Lars-Peter Clausen <[email protected]> Acked-by: Jaroslav Kysela <[email protected]> Cc: <[email protected]> Signed-off-by: Takashi Iwai <[email protected]>
static int snd_ctl_tlv_ioctl(struct snd_ctl_file *file, struct snd_ctl_tlv __user *_tlv, int op_flag) { struct snd_card *card = file->card; struct snd_ctl_tlv tlv; struct snd_kcontrol *kctl; struct snd_kcontrol_volatile *vd; unsigned int len; int err = 0; if (copy_from_user(&tlv, _tlv, sizeof(tlv))) return -EFAULT; if (tlv.length < sizeof(unsigned int) * 2) return -EINVAL; down_read(&card->controls_rwsem); kctl = snd_ctl_find_numid(card, tlv.numid); if (kctl == NULL) { err = -ENOENT; goto __kctl_end; } if (kctl->tlv.p == NULL) { err = -ENXIO; goto __kctl_end; } vd = &kctl->vd[tlv.numid - kctl->id.numid]; if ((op_flag == 0 && (vd->access & SNDRV_CTL_ELEM_ACCESS_TLV_READ) == 0) || (op_flag > 0 && (vd->access & SNDRV_CTL_ELEM_ACCESS_TLV_WRITE) == 0) || (op_flag < 0 && (vd->access & SNDRV_CTL_ELEM_ACCESS_TLV_COMMAND) == 0)) { err = -ENXIO; goto __kctl_end; } if (vd->access & SNDRV_CTL_ELEM_ACCESS_TLV_CALLBACK) { if (vd->owner != NULL && vd->owner != file) { err = -EPERM; goto __kctl_end; } err = kctl->tlv.c(kctl, op_flag, tlv.length, _tlv->tlv); if (err > 0) { struct snd_ctl_elem_id id = kctl->id; up_read(&card->controls_rwsem); snd_ctl_notify(card, SNDRV_CTL_EVENT_MASK_TLV, &id); return 0; } } else { if (op_flag) { err = -ENXIO; goto __kctl_end; } len = kctl->tlv.p[1] + 2 * sizeof(unsigned int); if (tlv.length < len) { err = -ENOMEM; goto __kctl_end; } if (copy_to_user(_tlv->tlv, kctl->tlv.p, len)) err = -EFAULT; } __kctl_end: up_read(&card->controls_rwsem); return err; }
static int snd_ctl_tlv_ioctl(struct snd_ctl_file *file, struct snd_ctl_tlv __user *_tlv, int op_flag) { struct snd_card *card = file->card; struct snd_ctl_tlv tlv; struct snd_kcontrol *kctl; struct snd_kcontrol_volatile *vd; unsigned int len; int err = 0; if (copy_from_user(&tlv, _tlv, sizeof(tlv))) return -EFAULT; if (tlv.length < sizeof(unsigned int) * 2) return -EINVAL; down_read(&card->controls_rwsem); kctl = snd_ctl_find_numid(card, tlv.numid); if (kctl == NULL) { err = -ENOENT; goto __kctl_end; } if (kctl->tlv.p == NULL) { err = -ENXIO; goto __kctl_end; } vd = &kctl->vd[tlv.numid - kctl->id.numid]; if ((op_flag == 0 && (vd->access & SNDRV_CTL_ELEM_ACCESS_TLV_READ) == 0) || (op_flag > 0 && (vd->access & SNDRV_CTL_ELEM_ACCESS_TLV_WRITE) == 0) || (op_flag < 0 && (vd->access & SNDRV_CTL_ELEM_ACCESS_TLV_COMMAND) == 0)) { err = -ENXIO; goto __kctl_end; } if (vd->access & SNDRV_CTL_ELEM_ACCESS_TLV_CALLBACK) { if (vd->owner != NULL && vd->owner != file) { err = -EPERM; goto __kctl_end; } err = kctl->tlv.c(kctl, op_flag, tlv.length, _tlv->tlv); if (err > 0) { struct snd_ctl_elem_id id = kctl->id; up_read(&card->controls_rwsem); snd_ctl_notify(card, SNDRV_CTL_EVENT_MASK_TLV, &id); return 0; } } else { if (op_flag) { err = -ENXIO; goto __kctl_end; } len = kctl->tlv.p[1] + 2 * sizeof(unsigned int); if (tlv.length < len) { err = -ENOMEM; goto __kctl_end; } if (copy_to_user(_tlv->tlv, kctl->tlv.p, len)) err = -EFAULT; } __kctl_end: up_read(&card->controls_rwsem); return err; }
C
linux
0
CVE-2017-5009
https://www.cvedetails.com/cve/CVE-2017-5009/
CWE-119
https://github.com/chromium/chromium/commit/1c40f9042ae2d6ee7483d72998aabb5e73b2ff60
1c40f9042ae2d6ee7483d72998aabb5e73b2ff60
DevTools: send proper resource type in Network.RequestWillBeSent This patch plumbs resoure type into the DispatchWillSendRequest instrumenation. This allows us to report accurate type in Network.RequestWillBeSent event, instead of "Other", that we report today. BUG=765501 R=dgozman Change-Id: I0134c08b841e8dd247fdc8ff208bfd51e462709c Reviewed-on: https://chromium-review.googlesource.com/667504 Reviewed-by: Pavel Feldman <[email protected]> Reviewed-by: Dmitry Gozman <[email protected]> Commit-Queue: Andrey Lushnikov <[email protected]> Cr-Commit-Position: refs/heads/master@{#507936}
const char* ResourcePriorityString(ResourceLoadPriority priority) { const char* priority_string = 0; switch (priority) { case kResourceLoadPriorityVeryLow: priority_string = "VeryLow"; break; case kResourceLoadPriorityLow: priority_string = "Low"; break; case kResourceLoadPriorityMedium: priority_string = "Medium"; break; case kResourceLoadPriorityHigh: priority_string = "High"; break; case kResourceLoadPriorityVeryHigh: priority_string = "VeryHigh"; break; case kResourceLoadPriorityUnresolved: break; } return priority_string; }
const char* ResourcePriorityString(ResourceLoadPriority priority) { const char* priority_string = 0; switch (priority) { case kResourceLoadPriorityVeryLow: priority_string = "VeryLow"; break; case kResourceLoadPriorityLow: priority_string = "Low"; break; case kResourceLoadPriorityMedium: priority_string = "Medium"; break; case kResourceLoadPriorityHigh: priority_string = "High"; break; case kResourceLoadPriorityVeryHigh: priority_string = "VeryHigh"; break; case kResourceLoadPriorityUnresolved: break; } return priority_string; }
C
Chrome
0
CVE-2016-3070
https://www.cvedetails.com/cve/CVE-2016-3070/
CWE-476
https://github.com/torvalds/linux/commit/42cb14b110a5698ccf26ce59c4441722605a3743
42cb14b110a5698ccf26ce59c4441722605a3743
mm: migrate dirty page without clear_page_dirty_for_io etc clear_page_dirty_for_io() has accumulated writeback and memcg subtleties since v2.6.16 first introduced page migration; and the set_page_dirty() which completed its migration of PageDirty, later had to be moderated to __set_page_dirty_nobuffers(); then PageSwapBacked had to skip that too. No actual problems seen with this procedure recently, but if you look into what the clear_page_dirty_for_io(page)+set_page_dirty(newpage) is actually achieving, it turns out to be nothing more than moving the PageDirty flag, and its NR_FILE_DIRTY stat from one zone to another. It would be good to avoid a pile of irrelevant decrementations and incrementations, and improper event counting, and unnecessary descent of the radix_tree under tree_lock (to set the PAGECACHE_TAG_DIRTY which radix_tree_replace_slot() left in place anyway). Do the NR_FILE_DIRTY movement, like the other stats movements, while interrupts still disabled in migrate_page_move_mapping(); and don't even bother if the zone is the same. Do the PageDirty movement there under tree_lock too, where old page is frozen and newpage not yet visible: bearing in mind that as soon as newpage becomes visible in radix_tree, an un-page-locked set_page_dirty() might interfere (or perhaps that's just not possible: anything doing so should already hold an additional reference to the old page, preventing its migration; but play safe). But we do still need to transfer PageDirty in migrate_page_copy(), for those who don't go the mapping route through migrate_page_move_mapping(). Signed-off-by: Hugh Dickins <[email protected]> Cc: Christoph Lameter <[email protected]> Cc: "Kirill A. Shutemov" <[email protected]> Cc: Rik van Riel <[email protected]> Cc: Vlastimil Babka <[email protected]> Cc: Davidlohr Bueso <[email protected]> Cc: Oleg Nesterov <[email protected]> Cc: Sasha Levin <[email protected]> Cc: Dmitry Vyukov <[email protected]> Cc: KOSAKI Motohiro <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
static void copy_huge_page(struct page *dst, struct page *src) { int i; int nr_pages; if (PageHuge(src)) { /* hugetlbfs page */ struct hstate *h = page_hstate(src); nr_pages = pages_per_huge_page(h); if (unlikely(nr_pages > MAX_ORDER_NR_PAGES)) { __copy_gigantic_page(dst, src, nr_pages); return; } } else { /* thp page */ BUG_ON(!PageTransHuge(src)); nr_pages = hpage_nr_pages(src); } for (i = 0; i < nr_pages; i++) { cond_resched(); copy_highpage(dst + i, src + i); } }
static void copy_huge_page(struct page *dst, struct page *src) { int i; int nr_pages; if (PageHuge(src)) { /* hugetlbfs page */ struct hstate *h = page_hstate(src); nr_pages = pages_per_huge_page(h); if (unlikely(nr_pages > MAX_ORDER_NR_PAGES)) { __copy_gigantic_page(dst, src, nr_pages); return; } } else { /* thp page */ BUG_ON(!PageTransHuge(src)); nr_pages = hpage_nr_pages(src); } for (i = 0; i < nr_pages; i++) { cond_resched(); copy_highpage(dst + i, src + i); } }
C
linux
0
CVE-2013-1774
https://www.cvedetails.com/cve/CVE-2013-1774/
CWE-264
https://github.com/torvalds/linux/commit/1ee0a224bc9aad1de496c795f96bc6ba2c394811
1ee0a224bc9aad1de496c795f96bc6ba2c394811
USB: io_ti: Fix NULL dereference in chase_port() The tty is NULL when the port is hanging up. chase_port() needs to check for this. This patch is intended for stable series. The behavior was observed and tested in Linux 3.2 and 3.7.1. Johan Hovold submitted a more elaborate patch for the mainline kernel. [ 56.277883] usb 1-1: edge_bulk_in_callback - nonzero read bulk status received: -84 [ 56.278811] usb 1-1: USB disconnect, device number 3 [ 56.278856] usb 1-1: edge_bulk_in_callback - stopping read! [ 56.279562] BUG: unable to handle kernel NULL pointer dereference at 00000000000001c8 [ 56.280536] IP: [<ffffffff8144e62a>] _raw_spin_lock_irqsave+0x19/0x35 [ 56.281212] PGD 1dc1b067 PUD 1e0f7067 PMD 0 [ 56.282085] Oops: 0002 [#1] SMP [ 56.282744] Modules linked in: [ 56.283512] CPU 1 [ 56.283512] Pid: 25, comm: khubd Not tainted 3.7.1 #1 innotek GmbH VirtualBox/VirtualBox [ 56.283512] RIP: 0010:[<ffffffff8144e62a>] [<ffffffff8144e62a>] _raw_spin_lock_irqsave+0x19/0x35 [ 56.283512] RSP: 0018:ffff88001fa99ab0 EFLAGS: 00010046 [ 56.283512] RAX: 0000000000000046 RBX: 00000000000001c8 RCX: 0000000000640064 [ 56.283512] RDX: 0000000000010000 RSI: ffff88001fa99b20 RDI: 00000000000001c8 [ 56.283512] RBP: ffff88001fa99b20 R08: 0000000000000000 R09: 0000000000000000 [ 56.283512] R10: 0000000000000000 R11: ffffffff812fcb4c R12: ffff88001ddf53c0 [ 56.283512] R13: 0000000000000000 R14: 00000000000001c8 R15: ffff88001e19b9f4 [ 56.283512] FS: 0000000000000000(0000) GS:ffff88001fd00000(0000) knlGS:0000000000000000 [ 56.283512] CS: 0010 DS: 0000 ES: 0000 CR0: 000000008005003b [ 56.283512] CR2: 00000000000001c8 CR3: 000000001dc51000 CR4: 00000000000006e0 [ 56.283512] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 [ 56.283512] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400 [ 56.283512] Process khubd (pid: 25, threadinfo ffff88001fa98000, task ffff88001fa94f80) [ 56.283512] Stack: [ 56.283512] 0000000000000046 00000000000001c8 ffffffff810578ec ffffffff812fcb4c [ 56.283512] ffff88001e19b980 0000000000002710 ffffffff812ffe81 0000000000000001 [ 56.283512] ffff88001fa94f80 0000000000000202 ffffffff00000001 0000000000000296 [ 56.283512] Call Trace: [ 56.283512] [<ffffffff810578ec>] ? add_wait_queue+0x12/0x3c [ 56.283512] [<ffffffff812fcb4c>] ? usb_serial_port_work+0x28/0x28 [ 56.283512] [<ffffffff812ffe81>] ? chase_port+0x84/0x2d6 [ 56.283512] [<ffffffff81063f27>] ? try_to_wake_up+0x199/0x199 [ 56.283512] [<ffffffff81263a5c>] ? tty_ldisc_hangup+0x222/0x298 [ 56.283512] [<ffffffff81300171>] ? edge_close+0x64/0x129 [ 56.283512] [<ffffffff810612f7>] ? __wake_up+0x35/0x46 [ 56.283512] [<ffffffff8106135b>] ? should_resched+0x5/0x23 [ 56.283512] [<ffffffff81264916>] ? tty_port_shutdown+0x39/0x44 [ 56.283512] [<ffffffff812fcb4c>] ? usb_serial_port_work+0x28/0x28 [ 56.283512] [<ffffffff8125d38c>] ? __tty_hangup+0x307/0x351 [ 56.283512] [<ffffffff812e6ddc>] ? usb_hcd_flush_endpoint+0xde/0xed [ 56.283512] [<ffffffff8144e625>] ? _raw_spin_lock_irqsave+0x14/0x35 [ 56.283512] [<ffffffff812fd361>] ? usb_serial_disconnect+0x57/0xc2 [ 56.283512] [<ffffffff812ea99b>] ? usb_unbind_interface+0x5c/0x131 [ 56.283512] [<ffffffff8128d738>] ? __device_release_driver+0x7f/0xd5 [ 56.283512] [<ffffffff8128d9cd>] ? device_release_driver+0x1a/0x25 [ 56.283512] [<ffffffff8128d393>] ? bus_remove_device+0xd2/0xe7 [ 56.283512] [<ffffffff8128b7a3>] ? device_del+0x119/0x167 [ 56.283512] [<ffffffff812e8d9d>] ? usb_disable_device+0x6a/0x180 [ 56.283512] [<ffffffff812e2ae0>] ? usb_disconnect+0x81/0xe6 [ 56.283512] [<ffffffff812e4435>] ? hub_thread+0x577/0xe82 [ 56.283512] [<ffffffff8144daa7>] ? __schedule+0x490/0x4be [ 56.283512] [<ffffffff8105798f>] ? abort_exclusive_wait+0x79/0x79 [ 56.283512] [<ffffffff812e3ebe>] ? usb_remote_wakeup+0x2f/0x2f [ 56.283512] [<ffffffff812e3ebe>] ? usb_remote_wakeup+0x2f/0x2f [ 56.283512] [<ffffffff810570b4>] ? kthread+0x81/0x89 [ 56.283512] [<ffffffff81057033>] ? __kthread_parkme+0x5c/0x5c [ 56.283512] [<ffffffff8145387c>] ? ret_from_fork+0x7c/0xb0 [ 56.283512] [<ffffffff81057033>] ? __kthread_parkme+0x5c/0x5c [ 56.283512] Code: 8b 7c 24 08 e8 17 0b c3 ff 48 8b 04 24 48 83 c4 10 c3 53 48 89 fb 41 50 e8 e0 0a c3 ff 48 89 04 24 e8 e7 0a c3 ff ba 00 00 01 00 <f0> 0f c1 13 48 8b 04 24 89 d1 c1 ea 10 66 39 d1 74 07 f3 90 66 [ 56.283512] RIP [<ffffffff8144e62a>] _raw_spin_lock_irqsave+0x19/0x35 [ 56.283512] RSP <ffff88001fa99ab0> [ 56.283512] CR2: 00000000000001c8 [ 56.283512] ---[ end trace 49714df27e1679ce ]--- Signed-off-by: Wolfgang Frisch <[email protected]> Cc: Johan Hovold <[email protected]> Cc: stable <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
static int i2c_type_bootmode(struct edgeport_serial *serial) { struct device *dev = &serial->serial->dev->dev; int status; u8 *data; data = kmalloc(1, GFP_KERNEL); if (!data) { dev_err(dev, "%s - out of memory\n", __func__); return -ENOMEM; } /* Try to read type 2 */ status = ti_vread_sync(serial->serial->dev, UMPC_MEMORY_READ, DTK_ADDR_SPACE_I2C_TYPE_II, 0, data, 0x01); if (status) dev_dbg(dev, "%s - read 2 status error = %d\n", __func__, status); else dev_dbg(dev, "%s - read 2 data = 0x%x\n", __func__, *data); if ((!status) && (*data == UMP5152 || *data == UMP3410)) { dev_dbg(dev, "%s - ROM_TYPE_II\n", __func__); serial->TI_I2C_Type = DTK_ADDR_SPACE_I2C_TYPE_II; goto out; } /* Try to read type 3 */ status = ti_vread_sync(serial->serial->dev, UMPC_MEMORY_READ, DTK_ADDR_SPACE_I2C_TYPE_III, 0, data, 0x01); if (status) dev_dbg(dev, "%s - read 3 status error = %d\n", __func__, status); else dev_dbg(dev, "%s - read 2 data = 0x%x\n", __func__, *data); if ((!status) && (*data == UMP5152 || *data == UMP3410)) { dev_dbg(dev, "%s - ROM_TYPE_III\n", __func__); serial->TI_I2C_Type = DTK_ADDR_SPACE_I2C_TYPE_III; goto out; } dev_dbg(dev, "%s - Unknown\n", __func__); serial->TI_I2C_Type = DTK_ADDR_SPACE_I2C_TYPE_II; status = -ENODEV; out: kfree(data); return status; }
static int i2c_type_bootmode(struct edgeport_serial *serial) { struct device *dev = &serial->serial->dev->dev; int status; u8 *data; data = kmalloc(1, GFP_KERNEL); if (!data) { dev_err(dev, "%s - out of memory\n", __func__); return -ENOMEM; } /* Try to read type 2 */ status = ti_vread_sync(serial->serial->dev, UMPC_MEMORY_READ, DTK_ADDR_SPACE_I2C_TYPE_II, 0, data, 0x01); if (status) dev_dbg(dev, "%s - read 2 status error = %d\n", __func__, status); else dev_dbg(dev, "%s - read 2 data = 0x%x\n", __func__, *data); if ((!status) && (*data == UMP5152 || *data == UMP3410)) { dev_dbg(dev, "%s - ROM_TYPE_II\n", __func__); serial->TI_I2C_Type = DTK_ADDR_SPACE_I2C_TYPE_II; goto out; } /* Try to read type 3 */ status = ti_vread_sync(serial->serial->dev, UMPC_MEMORY_READ, DTK_ADDR_SPACE_I2C_TYPE_III, 0, data, 0x01); if (status) dev_dbg(dev, "%s - read 3 status error = %d\n", __func__, status); else dev_dbg(dev, "%s - read 2 data = 0x%x\n", __func__, *data); if ((!status) && (*data == UMP5152 || *data == UMP3410)) { dev_dbg(dev, "%s - ROM_TYPE_III\n", __func__); serial->TI_I2C_Type = DTK_ADDR_SPACE_I2C_TYPE_III; goto out; } dev_dbg(dev, "%s - Unknown\n", __func__); serial->TI_I2C_Type = DTK_ADDR_SPACE_I2C_TYPE_II; status = -ENODEV; out: kfree(data); return status; }
C
linux
0
CVE-2015-8963
https://www.cvedetails.com/cve/CVE-2015-8963/
CWE-416
https://github.com/torvalds/linux/commit/12ca6ad2e3a896256f086497a7c7406a547ee373
12ca6ad2e3a896256f086497a7c7406a547ee373
perf: Fix race in swevent hash There's a race on CPU unplug where we free the swevent hash array while it can still have events on. This will result in a use-after-free which is BAD. Simply do not free the hash array on unplug. This leaves the thing around and no use-after-free takes place. When the last swevent dies, we do a for_each_possible_cpu() iteration anyway to clean these up, at which time we'll free it, so no leakage will occur. Reported-by: Sasha Levin <[email protected]> Tested-by: Sasha Levin <[email protected]> Signed-off-by: Peter Zijlstra (Intel) <[email protected]> Cc: Arnaldo Carvalho de Melo <[email protected]> Cc: Frederic Weisbecker <[email protected]> Cc: Jiri Olsa <[email protected]> Cc: Linus Torvalds <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Stephane Eranian <[email protected]> Cc: Thomas Gleixner <[email protected]> Cc: Vince Weaver <[email protected]> Signed-off-by: Ingo Molnar <[email protected]>
__perf_read(struct perf_event *event, char __user *buf, size_t count) { u64 read_format = event->attr.read_format; int ret; /* * Return end-of-file for a read on a event that is in * error state (i.e. because it was pinned but it couldn't be * scheduled on to the CPU at some point). */ if (event->state == PERF_EVENT_STATE_ERROR) return 0; if (count < event->read_size) return -ENOSPC; WARN_ON_ONCE(event->ctx->parent_ctx); if (read_format & PERF_FORMAT_GROUP) ret = perf_read_group(event, read_format, buf); else ret = perf_read_one(event, read_format, buf); return ret; }
__perf_read(struct perf_event *event, char __user *buf, size_t count) { u64 read_format = event->attr.read_format; int ret; /* * Return end-of-file for a read on a event that is in * error state (i.e. because it was pinned but it couldn't be * scheduled on to the CPU at some point). */ if (event->state == PERF_EVENT_STATE_ERROR) return 0; if (count < event->read_size) return -ENOSPC; WARN_ON_ONCE(event->ctx->parent_ctx); if (read_format & PERF_FORMAT_GROUP) ret = perf_read_group(event, read_format, buf); else ret = perf_read_one(event, read_format, buf); return ret; }
C
linux
0
CVE-2011-3104
https://www.cvedetails.com/cve/CVE-2011-3104/
CWE-119
https://github.com/chromium/chromium/commit/6b5f83842b5edb5d4bd6684b196b3630c6769731
6b5f83842b5edb5d4bd6684b196b3630c6769731
[i18n-fixlet] Make strings branding specific in extension code. IDS_EXTENSIONS_UNINSTALL IDS_EXTENSIONS_INCOGNITO_WARNING IDS_EXTENSION_INSTALLED_HEADING IDS_EXTENSION_ALERT_ITEM_EXTERNAL And fix a $1 $1 bug. IDS_EXTENSION_INLINE_INSTALL_PROMPT_TITLE BUG=NONE TEST=NONE Review URL: http://codereview.chromium.org/9107061 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@118018 0039d316-1c4b-4281-b951-d872f2087c98
bool ExtensionGlobalError::HasBubbleView() { return true; }
bool ExtensionGlobalError::HasBubbleView() { return true; }
C
Chrome
0
CVE-2016-2543
https://www.cvedetails.com/cve/CVE-2016-2543/
null
https://github.com/torvalds/linux/commit/030e2c78d3a91dd0d27fef37e91950dde333eba1
030e2c78d3a91dd0d27fef37e91950dde333eba1
ALSA: seq: Fix missing NULL check at remove_events ioctl snd_seq_ioctl_remove_events() calls snd_seq_fifo_clear() unconditionally even if there is no FIFO assigned, and this leads to an Oops due to NULL dereference. The fix is just to add a proper NULL check. Reported-by: Dmitry Vyukov <[email protected]> Tested-by: Dmitry Vyukov <[email protected]> Cc: <[email protected]> Signed-off-by: Takashi Iwai <[email protected]>
static int multicast_event(struct snd_seq_client *client, struct snd_seq_event *event, int atomic, int hop) { pr_debug("ALSA: seq: multicast not supported yet.\n"); return 0; /* ignored */ }
static int multicast_event(struct snd_seq_client *client, struct snd_seq_event *event, int atomic, int hop) { pr_debug("ALSA: seq: multicast not supported yet.\n"); return 0; /* ignored */ }
C
linux
0
null
null
null
https://github.com/chromium/chromium/commit/dc3857aac17be72c96f28d860d875235b3be349a
dc3857aac17be72c96f28d860d875235b3be349a
Unreviewed, rolling out r142736. http://trac.webkit.org/changeset/142736 https://bugs.webkit.org/show_bug.cgi?id=109716 Broke ABI, nightly builds crash on launch (Requested by ap on #webkit). Patch by Sheriff Bot <[email protected]> on 2013-02-13 Source/WebKit2: * Shared/APIClientTraits.cpp: (WebKit): * Shared/APIClientTraits.h: * UIProcess/API/C/WKPage.h: * UIProcess/API/gtk/WebKitLoaderClient.cpp: (attachLoaderClientToView): * WebProcess/InjectedBundle/API/c/WKBundlePage.h: * WebProcess/qt/QtBuiltinBundlePage.cpp: (WebKit::QtBuiltinBundlePage::QtBuiltinBundlePage): Tools: * MiniBrowser/mac/WK2BrowserWindowController.m: (-[WK2BrowserWindowController awakeFromNib]): * WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp: (WTR::InjectedBundlePage::InjectedBundlePage): * WebKitTestRunner/TestController.cpp: (WTR::TestController::createWebViewWithOptions): git-svn-id: svn://svn.chromium.org/blink/trunk@142762 bbb929c8-8fbe-4397-9dbb-9b2b20218538
static void dumpFrameText(WKBundleFrameRef frame, StringBuilder& stringBuilder) { if (!hasDocumentElement(frame)) return; WKRetainPtr<WKStringRef> text(AdoptWK, WKBundleFrameCopyInnerText(frame)); stringBuilder.append(toWTFString(text)); stringBuilder.append('\n'); }
static void dumpFrameText(WKBundleFrameRef frame, StringBuilder& stringBuilder) { if (!hasDocumentElement(frame)) return; WKRetainPtr<WKStringRef> text(AdoptWK, WKBundleFrameCopyInnerText(frame)); stringBuilder.append(toWTFString(text)); stringBuilder.append('\n'); }
C
Chrome
0
CVE-2017-6508
https://www.cvedetails.com/cve/CVE-2017-6508/
CWE-93
https://git.savannah.gnu.org/cgit/wget.git/commit/?id=4d729e322fae359a1aefaafec1144764a54e8ad4
4d729e322fae359a1aefaafec1144764a54e8ad4
null
url_escape_1 (const char *s, unsigned char mask, bool allow_passthrough) { const char *p1; char *p2, *newstr; int newlen; int addition = 0; for (p1 = s; *p1; p1++) if (urlchr_test (*p1, mask)) addition += 2; /* Two more characters (hex digits) */ if (!addition) return allow_passthrough ? (char *)s : xstrdup (s); newlen = (p1 - s) + addition; newstr = xmalloc (newlen + 1); p1 = s; p2 = newstr; while (*p1) { /* Quote the characters that match the test mask. */ if (urlchr_test (*p1, mask)) { unsigned char c = *p1++; *p2++ = '%'; *p2++ = XNUM_TO_DIGIT (c >> 4); *p2++ = XNUM_TO_DIGIT (c & 0xf); } else *p2++ = *p1++; } assert (p2 - newstr == newlen); *p2 = '\0'; return newstr; }
url_escape_1 (const char *s, unsigned char mask, bool allow_passthrough) { const char *p1; char *p2, *newstr; int newlen; int addition = 0; for (p1 = s; *p1; p1++) if (urlchr_test (*p1, mask)) addition += 2; /* Two more characters (hex digits) */ if (!addition) return allow_passthrough ? (char *)s : xstrdup (s); newlen = (p1 - s) + addition; newstr = xmalloc (newlen + 1); p1 = s; p2 = newstr; while (*p1) { /* Quote the characters that match the test mask. */ if (urlchr_test (*p1, mask)) { unsigned char c = *p1++; *p2++ = '%'; *p2++ = XNUM_TO_DIGIT (c >> 4); *p2++ = XNUM_TO_DIGIT (c & 0xf); } else *p2++ = *p1++; } assert (p2 - newstr == newlen); *p2 = '\0'; return newstr; }
C
savannah
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(imagecopyresampled) { zval *SIM, *DIM; long SX, SY, SW, SH, DX, DY, DW, DH; gdImagePtr im_dst, im_src; int srcH, srcW, dstH, dstW, srcY, srcX, dstY, dstX; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rrllllllll", &DIM, &SIM, &DX, &DY, &SX, &SY, &DW, &DH, &SW, &SH) == FAILURE) { return; } ZEND_FETCH_RESOURCE(im_dst, gdImagePtr, &DIM, -1, "Image", le_gd); ZEND_FETCH_RESOURCE(im_src, gdImagePtr, &SIM, -1, "Image", le_gd); srcX = SX; srcY = SY; srcH = SH; srcW = SW; dstX = DX; dstY = DY; dstH = DH; dstW = DW; gdImageCopyResampled(im_dst, im_src, dstX, dstY, srcX, srcY, dstW, dstH, srcW, srcH); RETURN_TRUE; }
PHP_FUNCTION(imagecopyresampled) { zval *SIM, *DIM; long SX, SY, SW, SH, DX, DY, DW, DH; gdImagePtr im_dst, im_src; int srcH, srcW, dstH, dstW, srcY, srcX, dstY, dstX; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rrllllllll", &DIM, &SIM, &DX, &DY, &SX, &SY, &DW, &DH, &SW, &SH) == FAILURE) { return; } ZEND_FETCH_RESOURCE(im_dst, gdImagePtr, &DIM, -1, "Image", le_gd); ZEND_FETCH_RESOURCE(im_src, gdImagePtr, &SIM, -1, "Image", le_gd); srcX = SX; srcY = SY; srcH = SH; srcW = SW; dstX = DX; dstY = DY; dstH = DH; dstW = DW; gdImageCopyResampled(im_dst, im_src, dstX, dstY, srcX, srcY, dstW, dstH, srcW, srcH); RETURN_TRUE; }
C
php
0
CVE-2016-3834
https://www.cvedetails.com/cve/CVE-2016-3834/
CWE-200
https://android.googlesource.com/platform/frameworks/av/+/1f24c730ab6ca5aff1e3137b340b8aeaeda4bdbc
1f24c730ab6ca5aff1e3137b340b8aeaeda4bdbc
DO NOT MERGE: Camera: Adjust pointers to ANW buffers to avoid infoleak Subtract address of a random static object from pointers being routed through app process. Bug: 28466701 Change-Id: Idcbfe81e9507433769672f3dc6d67db5eeed4e04
status_t CameraSource::read( MediaBuffer **buffer, const ReadOptions *options) { ALOGV("read"); *buffer = NULL; int64_t seekTimeUs; ReadOptions::SeekMode mode; if (options && options->getSeekTo(&seekTimeUs, &mode)) { return ERROR_UNSUPPORTED; } sp<IMemory> frame; int64_t frameTime; { Mutex::Autolock autoLock(mLock); while (mStarted && mFramesReceived.empty()) { if (NO_ERROR != mFrameAvailableCondition.waitRelative(mLock, mTimeBetweenFrameCaptureUs * 1000LL + CAMERA_SOURCE_TIMEOUT_NS)) { if (mCameraRecordingProxy != 0 && !IInterface::asBinder(mCameraRecordingProxy)->isBinderAlive()) { ALOGW("camera recording proxy is gone"); return ERROR_END_OF_STREAM; } ALOGW("Timed out waiting for incoming camera video frames: %" PRId64 " us", mLastFrameTimestampUs); } } if (!mStarted) { return OK; } frame = *mFramesReceived.begin(); mFramesReceived.erase(mFramesReceived.begin()); frameTime = *mFrameTimes.begin(); mFrameTimes.erase(mFrameTimes.begin()); mFramesBeingEncoded.push_back(frame); *buffer = new MediaBuffer(frame->pointer(), frame->size()); (*buffer)->setObserver(this); (*buffer)->add_ref(); (*buffer)->meta_data()->setInt64(kKeyTime, frameTime); } return OK; }
status_t CameraSource::read( MediaBuffer **buffer, const ReadOptions *options) { ALOGV("read"); *buffer = NULL; int64_t seekTimeUs; ReadOptions::SeekMode mode; if (options && options->getSeekTo(&seekTimeUs, &mode)) { return ERROR_UNSUPPORTED; } sp<IMemory> frame; int64_t frameTime; { Mutex::Autolock autoLock(mLock); while (mStarted && mFramesReceived.empty()) { if (NO_ERROR != mFrameAvailableCondition.waitRelative(mLock, mTimeBetweenFrameCaptureUs * 1000LL + CAMERA_SOURCE_TIMEOUT_NS)) { if (mCameraRecordingProxy != 0 && !IInterface::asBinder(mCameraRecordingProxy)->isBinderAlive()) { ALOGW("camera recording proxy is gone"); return ERROR_END_OF_STREAM; } ALOGW("Timed out waiting for incoming camera video frames: %" PRId64 " us", mLastFrameTimestampUs); } } if (!mStarted) { return OK; } frame = *mFramesReceived.begin(); mFramesReceived.erase(mFramesReceived.begin()); frameTime = *mFrameTimes.begin(); mFrameTimes.erase(mFrameTimes.begin()); mFramesBeingEncoded.push_back(frame); *buffer = new MediaBuffer(frame->pointer(), frame->size()); (*buffer)->setObserver(this); (*buffer)->add_ref(); (*buffer)->meta_data()->setInt64(kKeyTime, frameTime); } return OK; }
C
Android
0
CVE-2013-2128
https://www.cvedetails.com/cve/CVE-2013-2128/
CWE-119
https://github.com/torvalds/linux/commit/baff42ab1494528907bf4d5870359e31711746ae
baff42ab1494528907bf4d5870359e31711746ae
net: Fix oops from tcp_collapse() when using splice() tcp_read_sock() can have a eat skbs without immediately advancing copied_seq. This can cause a panic in tcp_collapse() if it is called as a result of the recv_actor dropping the socket lock. A userspace program that splices data from a socket to either another socket or to a file can trigger this bug. Signed-off-by: Steven J. Magnani <[email protected]> Signed-off-by: David S. Miller <[email protected]>
int compat_tcp_setsockopt(struct sock *sk, int level, int optname, char __user *optval, unsigned int optlen) { if (level != SOL_TCP) return inet_csk_compat_setsockopt(sk, level, optname, optval, optlen); return do_tcp_setsockopt(sk, level, optname, optval, optlen); }
int compat_tcp_setsockopt(struct sock *sk, int level, int optname, char __user *optval, unsigned int optlen) { if (level != SOL_TCP) return inet_csk_compat_setsockopt(sk, level, optname, optval, optlen); return do_tcp_setsockopt(sk, level, optname, optval, optlen); }
C
linux
0
CVE-2014-3690
https://www.cvedetails.com/cve/CVE-2014-3690/
CWE-399
https://github.com/torvalds/linux/commit/d974baa398f34393db76be45f7d4d04fbdbb4a0a
d974baa398f34393db76be45f7d4d04fbdbb4a0a
x86,kvm,vmx: Preserve CR4 across VM entry CR4 isn't constant; at least the TSD and PCE bits can vary. TBH, treating CR0 and CR3 as constant scares me a bit, too, but it looks like it's correct. This adds a branch and a read from cr4 to each vm entry. Because it is extremely likely that consecutive entries into the same vcpu will have the same host cr4 value, this fixes up the vmcs instead of restoring cr4 after the fact. A subsequent patch will add a kernel-wide cr4 shadow, reducing the overhead in the common case to just two memory reads and a branch. Signed-off-by: Andy Lutomirski <[email protected]> Acked-by: Paolo Bonzini <[email protected]> Cc: [email protected] Cc: Petr Matousek <[email protected]> Cc: Gleb Natapov <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
static struct kvm_vcpu *vmx_create_vcpu(struct kvm *kvm, unsigned int id) { int err; struct vcpu_vmx *vmx = kmem_cache_zalloc(kvm_vcpu_cache, GFP_KERNEL); int cpu; if (!vmx) return ERR_PTR(-ENOMEM); allocate_vpid(vmx); err = kvm_vcpu_init(&vmx->vcpu, kvm, id); if (err) goto free_vcpu; vmx->guest_msrs = kmalloc(PAGE_SIZE, GFP_KERNEL); BUILD_BUG_ON(ARRAY_SIZE(vmx_msr_index) * sizeof(vmx->guest_msrs[0]) > PAGE_SIZE); err = -ENOMEM; if (!vmx->guest_msrs) { goto uninit_vcpu; } vmx->loaded_vmcs = &vmx->vmcs01; vmx->loaded_vmcs->vmcs = alloc_vmcs(); if (!vmx->loaded_vmcs->vmcs) goto free_msrs; if (!vmm_exclusive) kvm_cpu_vmxon(__pa(per_cpu(vmxarea, raw_smp_processor_id()))); loaded_vmcs_init(vmx->loaded_vmcs); if (!vmm_exclusive) kvm_cpu_vmxoff(); cpu = get_cpu(); vmx_vcpu_load(&vmx->vcpu, cpu); vmx->vcpu.cpu = cpu; err = vmx_vcpu_setup(vmx); vmx_vcpu_put(&vmx->vcpu); put_cpu(); if (err) goto free_vmcs; if (vm_need_virtualize_apic_accesses(kvm)) { err = alloc_apic_access_page(kvm); if (err) goto free_vmcs; } if (enable_ept) { if (!kvm->arch.ept_identity_map_addr) kvm->arch.ept_identity_map_addr = VMX_EPT_IDENTITY_PAGETABLE_ADDR; err = init_rmode_identity_map(kvm); if (err) goto free_vmcs; } vmx->nested.current_vmptr = -1ull; vmx->nested.current_vmcs12 = NULL; return &vmx->vcpu; free_vmcs: free_loaded_vmcs(vmx->loaded_vmcs); free_msrs: kfree(vmx->guest_msrs); uninit_vcpu: kvm_vcpu_uninit(&vmx->vcpu); free_vcpu: free_vpid(vmx); kmem_cache_free(kvm_vcpu_cache, vmx); return ERR_PTR(err); }
static struct kvm_vcpu *vmx_create_vcpu(struct kvm *kvm, unsigned int id) { int err; struct vcpu_vmx *vmx = kmem_cache_zalloc(kvm_vcpu_cache, GFP_KERNEL); int cpu; if (!vmx) return ERR_PTR(-ENOMEM); allocate_vpid(vmx); err = kvm_vcpu_init(&vmx->vcpu, kvm, id); if (err) goto free_vcpu; vmx->guest_msrs = kmalloc(PAGE_SIZE, GFP_KERNEL); BUILD_BUG_ON(ARRAY_SIZE(vmx_msr_index) * sizeof(vmx->guest_msrs[0]) > PAGE_SIZE); err = -ENOMEM; if (!vmx->guest_msrs) { goto uninit_vcpu; } vmx->loaded_vmcs = &vmx->vmcs01; vmx->loaded_vmcs->vmcs = alloc_vmcs(); if (!vmx->loaded_vmcs->vmcs) goto free_msrs; if (!vmm_exclusive) kvm_cpu_vmxon(__pa(per_cpu(vmxarea, raw_smp_processor_id()))); loaded_vmcs_init(vmx->loaded_vmcs); if (!vmm_exclusive) kvm_cpu_vmxoff(); cpu = get_cpu(); vmx_vcpu_load(&vmx->vcpu, cpu); vmx->vcpu.cpu = cpu; err = vmx_vcpu_setup(vmx); vmx_vcpu_put(&vmx->vcpu); put_cpu(); if (err) goto free_vmcs; if (vm_need_virtualize_apic_accesses(kvm)) { err = alloc_apic_access_page(kvm); if (err) goto free_vmcs; } if (enable_ept) { if (!kvm->arch.ept_identity_map_addr) kvm->arch.ept_identity_map_addr = VMX_EPT_IDENTITY_PAGETABLE_ADDR; err = init_rmode_identity_map(kvm); if (err) goto free_vmcs; } vmx->nested.current_vmptr = -1ull; vmx->nested.current_vmcs12 = NULL; return &vmx->vcpu; free_vmcs: free_loaded_vmcs(vmx->loaded_vmcs); free_msrs: kfree(vmx->guest_msrs); uninit_vcpu: kvm_vcpu_uninit(&vmx->vcpu); free_vcpu: free_vpid(vmx); kmem_cache_free(kvm_vcpu_cache, vmx); return ERR_PTR(err); }
C
linux
0
CVE-2017-8294
https://www.cvedetails.com/cve/CVE-2017-8294/
CWE-125
https://github.com/VirusTotal/yara/commit/83d799804648c2a0895d40a19835d9b757c6fa4e
83d799804648c2a0895d40a19835d9b757c6fa4e
Fix issue #646 (#648) * Fix issue #646 and some edge cases with wide regexps using \b and \B * Rename function IS_WORD_CHAR to _yr_re_is_word_char
int yr_re_match( RE* re, const char* target) { return yr_re_exec( re->code, (uint8_t*) target, strlen(target), 0, re->flags | RE_FLAGS_SCAN, NULL, NULL); }
int yr_re_match( RE* re, const char* target) { return yr_re_exec( re->code, (uint8_t*) target, strlen(target), re->flags | RE_FLAGS_SCAN, NULL, NULL); }
C
yara
1
null
null
null
https://github.com/chromium/chromium/commit/183f4bcddd821b4af3f6234ad2e8c371694a9ffb
183f4bcddd821b4af3f6234ad2e8c371694a9ffb
Add a histogram (Net.PacResultForStrippedUrl) that estimates how often PAC scripts depend on the URL path. BUG=593759 Review URL: https://codereview.chromium.org/1797313003 Cr-Commit-Position: refs/heads/master@{#382644}
void Job::Alert(const base::string16& message) { HandleAlertOrError(true, -1, message); }
void Job::Alert(const base::string16& message) { HandleAlertOrError(true, -1, message); }
C
Chrome
0
CVE-2016-5400
https://www.cvedetails.com/cve/CVE-2016-5400/
CWE-119
https://github.com/torvalds/linux/commit/aa93d1fee85c890a34f2510a310e55ee76a27848
aa93d1fee85c890a34f2510a310e55ee76a27848
media: fix airspy usb probe error path Fix a memory leak on probe error of the airspy usb device driver. The problem is triggered when more than 64 usb devices register with v4l2 of type VFL_TYPE_SDR or VFL_TYPE_SUBDEV. The memory leak is caused by the probe function of the airspy driver mishandeling errors and not freeing the corresponding control structures when an error occours registering the device to v4l2 core. A badusb device can emulate 64 of these devices, and then through continual emulated connect/disconnect of the 65th device, cause the kernel to run out of RAM and crash the kernel, thus causing a local DOS vulnerability. Fixes CVE-2016-5400 Signed-off-by: James Patrick-Evans <[email protected]> Reviewed-by: Kees Cook <[email protected]> Cc: [email protected] # 3.17+ Signed-off-by: Linus Torvalds <[email protected]>
static int airspy_g_fmt_sdr_cap(struct file *file, void *priv, struct v4l2_format *f) { struct airspy *s = video_drvdata(file); f->fmt.sdr.pixelformat = s->pixelformat; f->fmt.sdr.buffersize = s->buffersize; memset(f->fmt.sdr.reserved, 0, sizeof(f->fmt.sdr.reserved)); return 0; }
static int airspy_g_fmt_sdr_cap(struct file *file, void *priv, struct v4l2_format *f) { struct airspy *s = video_drvdata(file); f->fmt.sdr.pixelformat = s->pixelformat; f->fmt.sdr.buffersize = s->buffersize; memset(f->fmt.sdr.reserved, 0, sizeof(f->fmt.sdr.reserved)); return 0; }
C
linux
0
CVE-2016-9317
https://www.cvedetails.com/cve/CVE-2016-9317/
CWE-20
https://github.com/libgd/libgd/commit/1846f48e5fcdde996e7c27a4bbac5d0aef183e4b
1846f48e5fcdde996e7c27a4bbac5d0aef183e4b
Fix #340: System frozen gdImageCreate() doesn't check for oversized images and as such is prone to DoS vulnerabilities. We fix that by applying the same overflow check that is already in place for gdImageCreateTrueColor(). CVE-2016-9317
BGD_DECLARE(void) gdImageCopyMergeGray (gdImagePtr dst, gdImagePtr src, int dstX, int dstY, int srcX, int srcY, int w, int h, int pct) { int c, dc; int x, y; int tox, toy; int ncR, ncG, ncB; float g; toy = dstY; for (y = srcY; (y < (srcY + h)); y++) { tox = dstX; for (x = srcX; (x < (srcX + w)); x++) { int nc; c = gdImageGetPixel (src, x, y); /* Added 7/24/95: support transparent copies */ if (gdImageGetTransparent (src) == c) { tox++; continue; } /* * If it's the same image, mapping is NOT trivial since we * merge with greyscale target, but if pct is 100, the grey * value is not used, so it becomes trivial. pjw 2.0.12. */ if (dst == src && pct == 100) { nc = c; } else { dc = gdImageGetPixel (dst, tox, toy); g = 0.29900 * gdImageRed(dst, dc) + 0.58700 * gdImageGreen(dst, dc) + 0.11400 * gdImageBlue(dst, dc); ncR = gdImageRed (src, c) * (pct / 100.0) + g * ((100 - pct) / 100.0); ncG = gdImageGreen (src, c) * (pct / 100.0) + g * ((100 - pct) / 100.0); ncB = gdImageBlue (src, c) * (pct / 100.0) + g * ((100 - pct) / 100.0); /* First look for an exact match */ nc = gdImageColorExact (dst, ncR, ncG, ncB); if (nc == (-1)) { /* No, so try to allocate it */ nc = gdImageColorAllocate (dst, ncR, ncG, ncB); /* If we're out of colors, go for the closest color */ if (nc == (-1)) { nc = gdImageColorClosest (dst, ncR, ncG, ncB); } } } gdImageSetPixel (dst, tox, toy, nc); tox++; } toy++; } }
BGD_DECLARE(void) gdImageCopyMergeGray (gdImagePtr dst, gdImagePtr src, int dstX, int dstY, int srcX, int srcY, int w, int h, int pct) { int c, dc; int x, y; int tox, toy; int ncR, ncG, ncB; float g; toy = dstY; for (y = srcY; (y < (srcY + h)); y++) { tox = dstX; for (x = srcX; (x < (srcX + w)); x++) { int nc; c = gdImageGetPixel (src, x, y); /* Added 7/24/95: support transparent copies */ if (gdImageGetTransparent (src) == c) { tox++; continue; } /* * If it's the same image, mapping is NOT trivial since we * merge with greyscale target, but if pct is 100, the grey * value is not used, so it becomes trivial. pjw 2.0.12. */ if (dst == src && pct == 100) { nc = c; } else { dc = gdImageGetPixel (dst, tox, toy); g = 0.29900 * gdImageRed(dst, dc) + 0.58700 * gdImageGreen(dst, dc) + 0.11400 * gdImageBlue(dst, dc); ncR = gdImageRed (src, c) * (pct / 100.0) + g * ((100 - pct) / 100.0); ncG = gdImageGreen (src, c) * (pct / 100.0) + g * ((100 - pct) / 100.0); ncB = gdImageBlue (src, c) * (pct / 100.0) + g * ((100 - pct) / 100.0); /* First look for an exact match */ nc = gdImageColorExact (dst, ncR, ncG, ncB); if (nc == (-1)) { /* No, so try to allocate it */ nc = gdImageColorAllocate (dst, ncR, ncG, ncB); /* If we're out of colors, go for the closest color */ if (nc == (-1)) { nc = gdImageColorClosest (dst, ncR, ncG, ncB); } } } gdImageSetPixel (dst, tox, toy, nc); tox++; } toy++; } }
C
libgd
0
CVE-2013-0910
https://www.cvedetails.com/cve/CVE-2013-0910/
CWE-287
https://github.com/chromium/chromium/commit/ac8bd041b81e46e4e4fcd5021aaa5499703952e6
ac8bd041b81e46e4e4fcd5021aaa5499703952e6
Follow-on fixes and naming changes for https://codereview.chromium.org/12086077/ BUG=172573 Review URL: https://codereview.chromium.org/12177018 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@180600 0039d316-1c4b-4281-b951-d872f2087c98
void Cancel() { delete this; }
void Cancel() { delete this; }
C
Chrome
0
CVE-2011-4621
https://www.cvedetails.com/cve/CVE-2011-4621/
null
https://github.com/torvalds/linux/commit/f26f9aff6aaf67e9a430d16c266f91b13a5bff64
f26f9aff6aaf67e9a430d16c266f91b13a5bff64
Sched: fix skip_clock_update optimization idle_balance() drops/retakes rq->lock, leaving the previous task vulnerable to set_tsk_need_resched(). Clear it after we return from balancing instead, and in setup_thread_stack() as well, so no successfully descheduled or never scheduled task has it set. Need resched confused the skip_clock_update logic, which assumes that the next call to update_rq_clock() will come nearly immediately after being set. Make the optimization robust against the waking a sleeper before it sucessfully deschedules case by checking that the current task has not been dequeued before setting the flag, since it is that useless clock update we're trying to save, and clear unconditionally in schedule() proper instead of conditionally in put_prev_task(). Signed-off-by: Mike Galbraith <[email protected]> Reported-by: Bjoern B. Brandenburg <[email protected]> Tested-by: Yong Zhang <[email protected]> Signed-off-by: Peter Zijlstra <[email protected]> Cc: [email protected] LKML-Reference: <[email protected]> Signed-off-by: Ingo Molnar <[email protected]>
static void register_sched_domain_sysctl(void) { }
static void register_sched_domain_sysctl(void) { }
C
linux
0
CVE-2011-2517
https://www.cvedetails.com/cve/CVE-2011-2517/
CWE-119
https://github.com/torvalds/linux/commit/208c72f4fe44fe09577e7975ba0e7fa0278f3d03
208c72f4fe44fe09577e7975ba0e7fa0278f3d03
nl80211: fix check for valid SSID size in scan operations In both trigger_scan and sched_scan operations, we were checking for the SSID length before assigning the value correctly. Since the memory was just kzalloc'ed, the check was always failing and SSID with over 32 characters were allowed to go through. This was causing a buffer overflow when copying the actual SSID to the proper place. This bug has been there since 2.6.29-rc4. Cc: [email protected] Signed-off-by: Luciano Coelho <[email protected]> Signed-off-by: John W. Linville <[email protected]>
static int nl80211_tx_mgmt_cancel_wait(struct sk_buff *skb, struct genl_info *info) { struct cfg80211_registered_device *rdev = info->user_ptr[0]; struct net_device *dev = info->user_ptr[1]; u64 cookie; if (!info->attrs[NL80211_ATTR_COOKIE]) return -EINVAL; if (!rdev->ops->mgmt_tx_cancel_wait) return -EOPNOTSUPP; if (dev->ieee80211_ptr->iftype != NL80211_IFTYPE_STATION && dev->ieee80211_ptr->iftype != NL80211_IFTYPE_ADHOC && dev->ieee80211_ptr->iftype != NL80211_IFTYPE_P2P_CLIENT && dev->ieee80211_ptr->iftype != NL80211_IFTYPE_AP && dev->ieee80211_ptr->iftype != NL80211_IFTYPE_AP_VLAN && dev->ieee80211_ptr->iftype != NL80211_IFTYPE_P2P_GO) return -EOPNOTSUPP; cookie = nla_get_u64(info->attrs[NL80211_ATTR_COOKIE]); return rdev->ops->mgmt_tx_cancel_wait(&rdev->wiphy, dev, cookie); }
static int nl80211_tx_mgmt_cancel_wait(struct sk_buff *skb, struct genl_info *info) { struct cfg80211_registered_device *rdev = info->user_ptr[0]; struct net_device *dev = info->user_ptr[1]; u64 cookie; if (!info->attrs[NL80211_ATTR_COOKIE]) return -EINVAL; if (!rdev->ops->mgmt_tx_cancel_wait) return -EOPNOTSUPP; if (dev->ieee80211_ptr->iftype != NL80211_IFTYPE_STATION && dev->ieee80211_ptr->iftype != NL80211_IFTYPE_ADHOC && dev->ieee80211_ptr->iftype != NL80211_IFTYPE_P2P_CLIENT && dev->ieee80211_ptr->iftype != NL80211_IFTYPE_AP && dev->ieee80211_ptr->iftype != NL80211_IFTYPE_AP_VLAN && dev->ieee80211_ptr->iftype != NL80211_IFTYPE_P2P_GO) return -EOPNOTSUPP; cookie = nla_get_u64(info->attrs[NL80211_ATTR_COOKIE]); return rdev->ops->mgmt_tx_cancel_wait(&rdev->wiphy, dev, cookie); }
C
linux
0
CVE-2013-0836
https://www.cvedetails.com/cve/CVE-2013-0836/
CWE-399
https://github.com/chromium/chromium/commit/f7038db6ef172459f14b1b67a5155b8dd210be0f
f7038db6ef172459f14b1b67a5155b8dd210be0f
Progressive JPEG outputScanlines() calls should handle failure outputScanlines() can fail and delete |this|, so any attempt to access members thereafter should be avoided. Copy the decoder pointer member, and use that copy to detect and handle the failure case. BUG=232763 [email protected] Review URL: https://codereview.chromium.org/14844003 git-svn-id: svn://svn.chromium.org/blink/trunk@150545 bbb929c8-8fbe-4397-9dbb-9b2b20218538
void createColorTransform(const ColorProfile& colorProfile, bool hasAlpha) { if (m_transform) qcms_transform_release(m_transform); m_transform = 0; if (colorProfile.isEmpty()) return; qcms_profile* deviceProfile = ImageDecoder::qcmsOutputDeviceProfile(); if (!deviceProfile) return; qcms_profile* inputProfile = qcms_profile_from_memory(colorProfile.data(), colorProfile.size()); if (!inputProfile) return; ASSERT(icSigRgbData == qcms_profile_get_color_space(inputProfile)); qcms_data_type dataFormat = hasAlpha ? QCMS_DATA_RGBA_8 : QCMS_DATA_RGB_8; m_transform = qcms_transform_create(inputProfile, dataFormat, deviceProfile, dataFormat, QCMS_INTENT_PERCEPTUAL); qcms_profile_release(inputProfile); }
void createColorTransform(const ColorProfile& colorProfile, bool hasAlpha) { if (m_transform) qcms_transform_release(m_transform); m_transform = 0; if (colorProfile.isEmpty()) return; qcms_profile* deviceProfile = ImageDecoder::qcmsOutputDeviceProfile(); if (!deviceProfile) return; qcms_profile* inputProfile = qcms_profile_from_memory(colorProfile.data(), colorProfile.size()); if (!inputProfile) return; ASSERT(icSigRgbData == qcms_profile_get_color_space(inputProfile)); qcms_data_type dataFormat = hasAlpha ? QCMS_DATA_RGBA_8 : QCMS_DATA_RGB_8; m_transform = qcms_transform_create(inputProfile, dataFormat, deviceProfile, dataFormat, QCMS_INTENT_PERCEPTUAL); qcms_profile_release(inputProfile); }
C
Chrome
0
null
null
null
https://github.com/chromium/chromium/commit/610f904d8215075c4681be4eb413f4348860bf9f
610f904d8215075c4681be4eb413f4348860bf9f
Retrieve per host storage usage from QuotaManager. [email protected] BUG=none TEST=QuotaManagerTest.GetUsage Review URL: http://codereview.chromium.org/8079004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@103921 0039d316-1c4b-4281-b951-d872f2087c98
void DidGetLRUOrigin(const GURL& origin) { lru_origin_ = origin; }
void DidGetLRUOrigin(const GURL& origin) { lru_origin_ = origin; }
C
Chrome
0
CVE-2010-3702
https://www.cvedetails.com/cve/CVE-2010-3702/
CWE-20
https://cgit.freedesktop.org/poppler/poppler/commit/?id=e853106b58d6b4b0467dbd6436c9bb1cfbd372cf
e853106b58d6b4b0467dbd6436c9bb1cfbd372cf
null
void Gfx::opSetFillRGBColor(Object args[], int numArgs) { GfxColor color; int i; if (textHaveCSPattern && drawText) { GBool needFill = out->deviceHasTextClip(state); out->endTextObject(state); if (needFill) { doPatternFill(gTrue); } out->restoreState(state); } state->setFillPattern(NULL); state->setFillColorSpace(new GfxDeviceRGBColorSpace()); out->updateFillColorSpace(state); for (i = 0; i < 3; ++i) { color.c[i] = dblToCol(args[i].getNum()); } state->setFillColor(&color); out->updateFillColor(state); if (textHaveCSPattern) { out->beginTextObject(state); out->updateRender(state); out->updateTextMat(state); out->updateTextPos(state); textHaveCSPattern = gFalse; } }
void Gfx::opSetFillRGBColor(Object args[], int numArgs) { GfxColor color; int i; if (textHaveCSPattern && drawText) { GBool needFill = out->deviceHasTextClip(state); out->endTextObject(state); if (needFill) { doPatternFill(gTrue); } out->restoreState(state); } state->setFillPattern(NULL); state->setFillColorSpace(new GfxDeviceRGBColorSpace()); out->updateFillColorSpace(state); for (i = 0; i < 3; ++i) { color.c[i] = dblToCol(args[i].getNum()); } state->setFillColor(&color); out->updateFillColor(state); if (textHaveCSPattern) { out->beginTextObject(state); out->updateRender(state); out->updateTextMat(state); out->updateTextPos(state); textHaveCSPattern = gFalse; } }
CPP
poppler
0
CVE-2018-18352
https://www.cvedetails.com/cve/CVE-2018-18352/
CWE-732
https://github.com/chromium/chromium/commit/a9cbaa7a40e2b2723cfc2f266c42f4980038a949
a9cbaa7a40e2b2723cfc2f266c42f4980038a949
Simplify "WouldTaintOrigin" concept in media/blink Currently WebMediaPlayer has three predicates: - DidGetOpaqueResponseFromServiceWorker - HasSingleSecurityOrigin - DidPassCORSAccessCheck . These are used to determine whether the response body is available for scripts. They are known to be confusing, and actually MediaElementAudioSourceHandler::WouldTaintOrigin misuses them. This CL merges the three predicates to one, WouldTaintOrigin, to remove the confusion. Now the "response type" concept is available and we don't need a custom CORS check, so this CL removes BaseAudioContext::WouldTaintOrigin. This CL also renames URLData::has_opaque_data_ and its (direct and indirect) data accessors to match the spec. Bug: 849942, 875153 Change-Id: I6acf50169d7445c4ff614e80ac606f79ee577d2a Reviewed-on: https://chromium-review.googlesource.com/c/1238098 Reviewed-by: Fredrik Hubinette <[email protected]> Reviewed-by: Kinuko Yasuda <[email protected]> Reviewed-by: Raymond Toy <[email protected]> Commit-Queue: Yutaka Hirano <[email protected]> Cr-Commit-Position: refs/heads/master@{#598258}
void WebMediaPlayerImpl::OnRemotePlaybackEnded() { DVLOG(1) << __func__; DCHECK(main_task_runner_->BelongsToCurrentThread()); ended_ = true; client_->TimeChanged(); }
void WebMediaPlayerImpl::OnRemotePlaybackEnded() { DVLOG(1) << __func__; DCHECK(main_task_runner_->BelongsToCurrentThread()); ended_ = true; client_->TimeChanged(); }
C
Chrome
0
CVE-2016-8675
https://www.cvedetails.com/cve/CVE-2016-8675/
CWE-476
https://github.com/libav/libav/commit/e5b019725f53b79159931d3a7317107cbbfd0860
e5b019725f53b79159931d3a7317107cbbfd0860
m4vdec: Check for non-startcode 00 00 00 sequences in probe This makes the m4v detection less trigger-happy. Bug-Id: 949 Signed-off-by: Diego Biurrun <[email protected]>
static int mpeg4video_probe(AVProbeData *probe_packet) { uint32_t temp_buffer = -1; int VO = 0, VOL = 0, VOP = 0, VISO = 0, res = 0; int i; for (i = 0; i < probe_packet->buf_size; i++) { temp_buffer = (temp_buffer << 8) + probe_packet->buf[i]; if (temp_buffer & 0xfffffe00) continue; if (temp_buffer < 2) continue; if (temp_buffer == VOP_START_CODE) VOP++; else if (temp_buffer == VISUAL_OBJECT_START_CODE) VISO++; else if (temp_buffer >= 0x100 && temp_buffer < 0x120) VO++; else if (temp_buffer >= 0x120 && temp_buffer < 0x130) VOL++; else if (!(0x1AF < temp_buffer && temp_buffer < 0x1B7) && !(0x1B9 < temp_buffer && temp_buffer < 0x1C4)) res++; } if (VOP >= VISO && VOP >= VOL && VO >= VOL && VOL > 0 && res == 0) return AVPROBE_SCORE_EXTENSION; return 0; }
static int mpeg4video_probe(AVProbeData *probe_packet) { uint32_t temp_buffer = -1; int VO = 0, VOL = 0, VOP = 0, VISO = 0, res = 0; int i; for (i = 0; i < probe_packet->buf_size; i++) { temp_buffer = (temp_buffer << 8) + probe_packet->buf[i]; if ((temp_buffer & 0xffffff00) != 0x100) continue; if (temp_buffer == VOP_START_CODE) VOP++; else if (temp_buffer == VISUAL_OBJECT_START_CODE) VISO++; else if (temp_buffer < 0x120) VO++; else if (temp_buffer < 0x130) VOL++; else if (!(0x1AF < temp_buffer && temp_buffer < 0x1B7) && !(0x1B9 < temp_buffer && temp_buffer < 0x1C4)) res++; } if (VOP >= VISO && VOP >= VOL && VO >= VOL && VOL > 0 && res == 0) return AVPROBE_SCORE_EXTENSION; return 0; }
C
libav
1
CVE-2014-3191
https://www.cvedetails.com/cve/CVE-2014-3191/
CWE-416
https://github.com/chromium/chromium/commit/11a4cc4a6d6e665d9a118fada4b7c658d6f70d95
11a4cc4a6d6e665d9a118fada4b7c658d6f70d95
Defer call to updateWidgetPositions() outside of RenderLayerScrollableArea. updateWidgetPositions() can destroy the render tree, so it should never be called from inside RenderLayerScrollableArea. Leaving it there allows for the potential of use-after-free bugs. BUG=402407 [email protected] Review URL: https://codereview.chromium.org/490473003 git-svn-id: svn://svn.chromium.org/blink/trunk@180681 bbb929c8-8fbe-4397-9dbb-9b2b20218538
int RenderLayerScrollableArea::pixelSnappedScrollWidth() const { return snapSizeToPixel(scrollWidth(), box().clientLeft() + box().x()); }
int RenderLayerScrollableArea::pixelSnappedScrollWidth() const { return snapSizeToPixel(scrollWidth(), box().clientLeft() + box().x()); }
C
Chrome
0
CVE-2018-6611
https://www.cvedetails.com/cve/CVE-2018-6611/
CWE-125
https://github.com/OpenMPT/openmpt/commit/61fc6d3030a4d4283105cb5fb46b27b42fa5575e
61fc6d3030a4d4283105cb5fb46b27b42fa5575e
[Fix] STP: Possible out-of-bounds memory read with malformed STP files (caught with afl-fuzz). git-svn-id: https://source.openmpt.org/svn/openmpt/trunk/OpenMPT@9567 56274372-70c3-4bfc-bfc3-4c3a0b034d27
CSoundFile::ProbeResult CSoundFile::ProbeFileHeaderSTP(MemoryFileReader file, const uint64 *pfilesize) { STPFileHeader fileHeader; if(!file.ReadStruct(fileHeader)) { return ProbeWantMoreData; } if(!ValidateHeader(fileHeader)) { return ProbeFailure; } MPT_UNREFERENCED_PARAMETER(pfilesize); return ProbeSuccess; }
CSoundFile::ProbeResult CSoundFile::ProbeFileHeaderSTP(MemoryFileReader file, const uint64 *pfilesize) { STPFileHeader fileHeader; if(!file.ReadStruct(fileHeader)) { return ProbeWantMoreData; } if(!ValidateHeader(fileHeader)) { return ProbeFailure; } MPT_UNREFERENCED_PARAMETER(pfilesize); return ProbeSuccess; }
C
openmpt
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 *trpy_New() { ISOM_DECL_BOX_ALLOC(GF_TRPYBox, GF_ISOM_BOX_TYPE_TRPY); return (GF_Box *)tmp; }
GF_Box *trpy_New() { ISOM_DECL_BOX_ALLOC(GF_TRPYBox, GF_ISOM_BOX_TYPE_TRPY); return (GF_Box *)tmp; }
C
gpac
0
CVE-2019-5818
https://www.cvedetails.com/cve/CVE-2019-5818/
CWE-200
https://github.com/chromium/chromium/commit/929f77d4173022a731ae91218ce6894d20f87f35
929f77d4173022a731ae91218ce6894d20f87f35
Cleanup media BitReader ReadBits() calls Initialize temporary values, check return values. Small tweaks to solution proposed by [email protected]. Bug: 929962 Change-Id: Iaa7da7534174882d040ec7e4c353ba5cd0da5735 Reviewed-on: https://chromium-review.googlesource.com/c/1481085 Commit-Queue: Chrome Cunningham <[email protected]> Reviewed-by: Dan Sanders <[email protected]> Cr-Commit-Position: refs/heads/master@{#634889}
static bool CheckH261(const uint8_t* buffer, int buffer_size) { RCHECK(buffer_size > 16); int offset = 0; bool seen_start_code = false; while (true) { if (!AdvanceToStartCode(buffer, buffer_size, &offset, 4, 20, 0x10)) { return seen_start_code; } BitReader reader(buffer + offset, buffer_size - offset); RCHECK(ReadBits(&reader, 20) == 0x10); reader.SkipBits(5 + 6); int extra = ReadBits(&reader, 1); while (extra == 1) { if (!reader.SkipBits(8)) return seen_start_code; if (!reader.ReadBits(1, &extra)) return seen_start_code; } int next; if (!reader.ReadBits(16, &next)) return seen_start_code; RCHECK(next == 1); seen_start_code = true; offset += 4; } }
static bool CheckH261(const uint8_t* buffer, int buffer_size) { RCHECK(buffer_size > 16); int offset = 0; bool seen_start_code = false; while (true) { if (!AdvanceToStartCode(buffer, buffer_size, &offset, 4, 20, 0x10)) { return seen_start_code; } BitReader reader(buffer + offset, buffer_size - offset); RCHECK(ReadBits(&reader, 20) == 0x10); reader.SkipBits(5 + 6); int extra = ReadBits(&reader, 1); while (extra == 1) { if (!reader.SkipBits(8)) return seen_start_code; if (!reader.ReadBits(1, &extra)) return seen_start_code; } int next; if (!reader.ReadBits(16, &next)) return seen_start_code; RCHECK(next == 1); seen_start_code = true; offset += 4; } }
C
Chrome
0
CVE-2016-10190
https://www.cvedetails.com/cve/CVE-2016-10190/
CWE-119
https://github.com/FFmpeg/FFmpeg/commit/2a05c8f813de6f2278827734bf8102291e7484aa
2a05c8f813de6f2278827734bf8102291e7484aa
http: make length/offset-related variables unsigned. Fixes #5992, reported and found by Paul Cher <[email protected]>.
int ff_http_do_new_request(URLContext *h, const char *uri) { HTTPContext *s = h->priv_data; AVDictionary *options = NULL; int ret; s->off = 0; s->icy_data_read = 0; av_free(s->location); s->location = av_strdup(uri); if (!s->location) return AVERROR(ENOMEM); ret = http_open_cnx(h, &options); av_dict_free(&options); return ret; }
int ff_http_do_new_request(URLContext *h, const char *uri) { HTTPContext *s = h->priv_data; AVDictionary *options = NULL; int ret; s->off = 0; s->icy_data_read = 0; av_free(s->location); s->location = av_strdup(uri); if (!s->location) return AVERROR(ENOMEM); ret = http_open_cnx(h, &options); av_dict_free(&options); return ret; }
C
FFmpeg
0
CVE-2016-5337
https://www.cvedetails.com/cve/CVE-2016-5337/
CWE-200
https://git.qemu.org/?p=qemu.git;a=commit;h=844864fbae66935951529408831c2f22367a57b6
844864fbae66935951529408831c2f22367a57b6
null
static int megasas_handle_io(MegasasState *s, MegasasCmd *cmd) { uint32_t lba_count, lba_start_hi, lba_start_lo; uint64_t lba_start; bool is_write = (cmd->frame->header.frame_cmd == MFI_CMD_LD_WRITE); uint8_t cdb[16]; int len; struct SCSIDevice *sdev = NULL; lba_count = le32_to_cpu(cmd->frame->io.header.data_len); lba_start_lo = le32_to_cpu(cmd->frame->io.lba_lo); lba_start_hi = le32_to_cpu(cmd->frame->io.lba_hi); lba_start = ((uint64_t)lba_start_hi << 32) | lba_start_lo; if (cmd->frame->header.target_id < MFI_MAX_LD && cmd->frame->header.lun_id == 0) { sdev = scsi_device_find(&s->bus, 0, cmd->frame->header.target_id, cmd->frame->header.lun_id); } trace_megasas_handle_io(cmd->index, mfi_frame_desc[cmd->frame->header.frame_cmd], cmd->frame->header.target_id, cmd->frame->header.lun_id, (unsigned long)lba_start, (unsigned long)lba_count); if (!sdev) { trace_megasas_io_target_not_present(cmd->index, mfi_frame_desc[cmd->frame->header.frame_cmd], cmd->frame->header.target_id, cmd->frame->header.lun_id); return MFI_STAT_DEVICE_NOT_FOUND; } if (cmd->frame->header.cdb_len > 16) { trace_megasas_scsi_invalid_cdb_len( mfi_frame_desc[cmd->frame->header.frame_cmd], 1, cmd->frame->header.target_id, cmd->frame->header.lun_id, cmd->frame->header.cdb_len); megasas_write_sense(cmd, SENSE_CODE(INVALID_OPCODE)); cmd->frame->header.scsi_status = CHECK_CONDITION; s->event_count++; return MFI_STAT_SCSI_DONE_WITH_ERROR; } cmd->iov_size = lba_count * sdev->blocksize; if (megasas_map_sgl(s, cmd, &cmd->frame->io.sgl)) { megasas_write_sense(cmd, SENSE_CODE(TARGET_FAILURE)); cmd->frame->header.scsi_status = CHECK_CONDITION; s->event_count++; return MFI_STAT_SCSI_DONE_WITH_ERROR; } megasas_encode_lba(cdb, lba_start, lba_count, is_write); cmd->req = scsi_req_new(sdev, cmd->index, cmd->frame->header.lun_id, cdb, cmd); if (!cmd->req) { trace_megasas_scsi_req_alloc_failed( mfi_frame_desc[cmd->frame->header.frame_cmd], cmd->frame->header.target_id, cmd->frame->header.lun_id); megasas_write_sense(cmd, SENSE_CODE(NO_SENSE)); cmd->frame->header.scsi_status = BUSY; s->event_count++; return MFI_STAT_SCSI_DONE_WITH_ERROR; } len = megasas_enqueue_req(cmd, is_write); if (len > 0) { if (is_write) { trace_megasas_io_write_start(cmd->index, lba_start, lba_count, len); } else { trace_megasas_io_read_start(cmd->index, lba_start, lba_count, len); } } return MFI_STAT_INVALID_STATUS; }
static int megasas_handle_io(MegasasState *s, MegasasCmd *cmd) { uint32_t lba_count, lba_start_hi, lba_start_lo; uint64_t lba_start; bool is_write = (cmd->frame->header.frame_cmd == MFI_CMD_LD_WRITE); uint8_t cdb[16]; int len; struct SCSIDevice *sdev = NULL; lba_count = le32_to_cpu(cmd->frame->io.header.data_len); lba_start_lo = le32_to_cpu(cmd->frame->io.lba_lo); lba_start_hi = le32_to_cpu(cmd->frame->io.lba_hi); lba_start = ((uint64_t)lba_start_hi << 32) | lba_start_lo; if (cmd->frame->header.target_id < MFI_MAX_LD && cmd->frame->header.lun_id == 0) { sdev = scsi_device_find(&s->bus, 0, cmd->frame->header.target_id, cmd->frame->header.lun_id); } trace_megasas_handle_io(cmd->index, mfi_frame_desc[cmd->frame->header.frame_cmd], cmd->frame->header.target_id, cmd->frame->header.lun_id, (unsigned long)lba_start, (unsigned long)lba_count); if (!sdev) { trace_megasas_io_target_not_present(cmd->index, mfi_frame_desc[cmd->frame->header.frame_cmd], cmd->frame->header.target_id, cmd->frame->header.lun_id); return MFI_STAT_DEVICE_NOT_FOUND; } if (cmd->frame->header.cdb_len > 16) { trace_megasas_scsi_invalid_cdb_len( mfi_frame_desc[cmd->frame->header.frame_cmd], 1, cmd->frame->header.target_id, cmd->frame->header.lun_id, cmd->frame->header.cdb_len); megasas_write_sense(cmd, SENSE_CODE(INVALID_OPCODE)); cmd->frame->header.scsi_status = CHECK_CONDITION; s->event_count++; return MFI_STAT_SCSI_DONE_WITH_ERROR; } cmd->iov_size = lba_count * sdev->blocksize; if (megasas_map_sgl(s, cmd, &cmd->frame->io.sgl)) { megasas_write_sense(cmd, SENSE_CODE(TARGET_FAILURE)); cmd->frame->header.scsi_status = CHECK_CONDITION; s->event_count++; return MFI_STAT_SCSI_DONE_WITH_ERROR; } megasas_encode_lba(cdb, lba_start, lba_count, is_write); cmd->req = scsi_req_new(sdev, cmd->index, cmd->frame->header.lun_id, cdb, cmd); if (!cmd->req) { trace_megasas_scsi_req_alloc_failed( mfi_frame_desc[cmd->frame->header.frame_cmd], cmd->frame->header.target_id, cmd->frame->header.lun_id); megasas_write_sense(cmd, SENSE_CODE(NO_SENSE)); cmd->frame->header.scsi_status = BUSY; s->event_count++; return MFI_STAT_SCSI_DONE_WITH_ERROR; } len = megasas_enqueue_req(cmd, is_write); if (len > 0) { if (is_write) { trace_megasas_io_write_start(cmd->index, lba_start, lba_count, len); } else { trace_megasas_io_read_start(cmd->index, lba_start, lba_count, len); } } return MFI_STAT_INVALID_STATUS; }
C
qemu
0
CVE-2012-2896
https://www.cvedetails.com/cve/CVE-2012-2896/
CWE-189
https://github.com/chromium/chromium/commit/3aad1a37affb1ab70d1897f2b03eb8c077264984
3aad1a37affb1ab70d1897f2b03eb8c077264984
Fix SafeAdd and SafeMultiply BUG=145648,145544 Review URL: https://chromiumcodereview.appspot.com/10916165 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@155478 0039d316-1c4b-4281-b951-d872f2087c98
void GLES2DecoderImpl::ReleaseCurrent() { if (context_.get()) context_->ReleaseCurrent(surface_.get()); }
void GLES2DecoderImpl::ReleaseCurrent() { if (context_.get()) context_->ReleaseCurrent(surface_.get()); }
C
Chrome
0
null
null
null
https://github.com/chromium/chromium/commit/e49d943e9f5f90411313e64d0ae6b646edc85043
e49d943e9f5f90411313e64d0ae6b646edc85043
Use document referrer policy when preloading Previously, preload requests used the referrer policy from meta tags encountered during scanning, but not from headers delivered with the page. This CL uses the document's current referrer policy when the preload scan starts. BUG=605451 Review-Url: https://codereview.chromium.org/1913983002 Cr-Commit-Position: refs/heads/master@{#390264}
void TokenPreloadScanner::scan(const HTMLToken& token, const SegmentedString& source, PreloadRequestStream& requests, ViewportDescriptionWrapper* viewport) { scanCommon(token, source, requests, viewport, nullptr); }
void TokenPreloadScanner::scan(const HTMLToken& token, const SegmentedString& source, PreloadRequestStream& requests, ViewportDescriptionWrapper* viewport) { scanCommon(token, source, requests, viewport, nullptr); }
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}
void V8TestObject::VoidMethodVariadicStringArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_voidMethodVariadicStringArg"); test_object_v8_internal::VoidMethodVariadicStringArgMethod(info); }
void V8TestObject::VoidMethodVariadicStringArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_voidMethodVariadicStringArg"); test_object_v8_internal::VoidMethodVariadicStringArgMethod(info); }
C
Chrome
0
CVE-2016-2464
https://www.cvedetails.com/cve/CVE-2016-2464/
CWE-20
https://android.googlesource.com/platform/external/libvpx/+/cc274e2abe8b2a6698a5c47d8aa4bb45f1f9538d
cc274e2abe8b2a6698a5c47d8aa4bb45f1f9538d
external/libvpx/libwebm: Update snapshot Update libwebm snapshot. This update contains security fixes from upstream. Upstream git hash: 229f49347d19b0ca0941e072b199a242ef6c5f2b BUG=23167726 Change-Id: Id3e140e7b31ae11294724b1ecfe2e9c83b4d4207 (cherry picked from commit d0281a15b3c6bd91756e453cc9398c5ef412d99a)
long Cues::GetCount() const { if (m_cue_points == NULL) return -1; return m_count; // TODO: really ignore preload count? }
long Cues::GetCount() const { if (m_cue_points == NULL) return -1; return m_count; // TODO: really ignore preload count? }
C
Android
0
CVE-2016-10162
https://www.cvedetails.com/cve/CVE-2016-10162/
CWE-476
https://github.com/php/php-src/commit/8d2539fa0faf3f63e1d1e7635347c5b9e777d47b
8d2539fa0faf3f63e1d1e7635347c5b9e777d47b
Fix bug #73831 - NULL Pointer Dereference while unserialize php object
int php_wddx_deserialize_ex(const char *value, size_t vallen, zval *return_value) { wddx_stack stack; XML_Parser parser; st_entry *ent; int retval; wddx_stack_init(&stack); parser = XML_ParserCreate((XML_Char *) "UTF-8"); XML_SetUserData(parser, &stack); XML_SetElementHandler(parser, php_wddx_push_element, php_wddx_pop_element); XML_SetCharacterDataHandler(parser, php_wddx_process_data); /* XXX value should be parsed in the loop to exhaust size_t */ XML_Parse(parser, (const XML_Char *) value, (int)vallen, 1); XML_ParserFree(parser); if (stack.top == 1) { wddx_stack_top(&stack, (void**)&ent); if (Z_ISUNDEF(ent->data)) { retval = FAILURE; } else { ZVAL_COPY(return_value, &ent->data); retval = SUCCESS; } } else { retval = FAILURE; } wddx_stack_destroy(&stack); return retval; }
int php_wddx_deserialize_ex(const char *value, size_t vallen, zval *return_value) { wddx_stack stack; XML_Parser parser; st_entry *ent; int retval; wddx_stack_init(&stack); parser = XML_ParserCreate((XML_Char *) "UTF-8"); XML_SetUserData(parser, &stack); XML_SetElementHandler(parser, php_wddx_push_element, php_wddx_pop_element); XML_SetCharacterDataHandler(parser, php_wddx_process_data); /* XXX value should be parsed in the loop to exhaust size_t */ XML_Parse(parser, (const XML_Char *) value, (int)vallen, 1); XML_ParserFree(parser); if (stack.top == 1) { wddx_stack_top(&stack, (void**)&ent); if (Z_ISUNDEF(ent->data)) { retval = FAILURE; } else { ZVAL_COPY(return_value, &ent->data); retval = SUCCESS; } } else { retval = FAILURE; } wddx_stack_destroy(&stack); return retval; }
C
php-src
0
CVE-2017-5125
https://www.cvedetails.com/cve/CVE-2017-5125/
CWE-119
https://github.com/chromium/chromium/commit/1a90b2996bfd341a04073f0054047073865b485d
1a90b2996bfd341a04073f0054047073865b485d
Remove some senseless indirection from the Push API code Four files to call one Java function. Let's just call it directly. BUG= Change-Id: I6e988e9a000051dd7e3dd2b517a33a09afc2fff6 Reviewed-on: https://chromium-review.googlesource.com/749147 Reviewed-by: Anita Woodruff <[email protected]> Commit-Queue: Peter Beverloo <[email protected]> Cr-Commit-Position: refs/heads/master@{#513464}
base::string16 PushMessagingServiceImpl::GetName() { return l10n_util::GetStringUTF16(IDS_NOTIFICATIONS_BACKGROUND_SERVICE_NAME); }
base::string16 PushMessagingServiceImpl::GetName() { return l10n_util::GetStringUTF16(IDS_NOTIFICATIONS_BACKGROUND_SERVICE_NAME); }
C
Chrome
0
CVE-2018-17470
https://www.cvedetails.com/cve/CVE-2018-17470/
CWE-119
https://github.com/chromium/chromium/commit/385508dc888ef15d272cdd2705b17996abc519d6
385508dc888ef15d272cdd2705b17996abc519d6
Implement immutable texture base/max level clamping It seems some drivers fail to handle that gracefully, so let's always clamp to be on the safe side. BUG=877874 TEST=test case in the bug, gpu_unittests [email protected] Cq-Include-Trybots: luci.chromium.try:android_optional_gpu_tests_rel;luci.chromium.try:linux_optional_gpu_tests_rel;luci.chromium.try:mac_optional_gpu_tests_rel;luci.chromium.try:win_optional_gpu_tests_rel Change-Id: I6d93cb9389ea70525df4604112223604577582a2 Reviewed-on: https://chromium-review.googlesource.com/1194994 Reviewed-by: Kenneth Russell <[email protected]> Commit-Queue: Zhenyao Mo <[email protected]> Cr-Commit-Position: refs/heads/master@{#587264}
void GLES2DecoderImpl::DoSamplerParameterf( GLuint client_id, GLenum pname, GLfloat param) { Sampler* sampler = GetSampler(client_id); if (!sampler) { LOCAL_SET_GL_ERROR( GL_INVALID_VALUE, "glSamplerParameterf", "unknown sampler"); return; } sampler_manager()->SetParameterf( "glSamplerParameterf", GetErrorState(), sampler, pname, param); }
void GLES2DecoderImpl::DoSamplerParameterf( GLuint client_id, GLenum pname, GLfloat param) { Sampler* sampler = GetSampler(client_id); if (!sampler) { LOCAL_SET_GL_ERROR( GL_INVALID_VALUE, "glSamplerParameterf", "unknown sampler"); return; } sampler_manager()->SetParameterf( "glSamplerParameterf", GetErrorState(), sampler, pname, param); }
C
Chrome
0
CVE-2013-0216
https://www.cvedetails.com/cve/CVE-2013-0216/
CWE-20
https://github.com/torvalds/linux/commit/48856286b64e4b66ec62b94e504d0b29c1ade664
48856286b64e4b66ec62b94e504d0b29c1ade664
xen/netback: shutdown the ring if it contains garbage. A buggy or malicious frontend should not be able to confuse netback. If we spot anything which is not as it should be then shutdown the device and don't try to continue with the ring in a potentially hostile state. Well behaved and non-hostile frontends will not be penalised. As well as making the existing checks for such errors fatal also add a new check that ensures that there isn't an insane number of requests on the ring (i.e. more than would fit in the ring). If the ring contains garbage then previously is was possible to loop over this insane number, getting an error each time and therefore not generating any more pending requests and therefore not exiting the loop in xen_netbk_tx_build_gops for an externded period. Also turn various netdev_dbg calls which no precipitate a fatal error into netdev_err, they are rate limited because the device is shutdown afterwards. This fixes at least one known DoS/softlockup of the backend domain. Signed-off-by: Ian Campbell <[email protected]> Reviewed-by: Konrad Rzeszutek Wilk <[email protected]> Acked-by: Jan Beulich <[email protected]> Signed-off-by: David S. Miller <[email protected]>
static void xen_netbk_tx_action(struct xen_netbk *netbk) { unsigned nr_gops; nr_gops = xen_netbk_tx_build_gops(netbk); if (nr_gops == 0) return; gnttab_batch_copy(netbk->tx_copy_ops, nr_gops); xen_netbk_tx_submit(netbk); }
static void xen_netbk_tx_action(struct xen_netbk *netbk) { unsigned nr_gops; nr_gops = xen_netbk_tx_build_gops(netbk); if (nr_gops == 0) return; gnttab_batch_copy(netbk->tx_copy_ops, nr_gops); xen_netbk_tx_submit(netbk); }
C
linux
0
CVE-2010-1172
https://www.cvedetails.com/cve/CVE-2010-1172/
CWE-264
https://cgit.freedesktop.org/dbus/dbus-glib/commit/?h=rhel5&id=9a6bce9b615abca6068348c1606ba8eaf13d9ae0
9a6bce9b615abca6068348c1606ba8eaf13d9ae0
null
my_object_emit_signals (MyObject *obj, GError **error)
my_object_emit_signals (MyObject *obj, GError **error) { GValue val = {0, }; g_signal_emit (obj, signals[SIG0], 0, "foo", 22, "moo"); g_value_init (&val, G_TYPE_STRING); g_value_set_string (&val, "bar"); g_signal_emit (obj, signals[SIG1], 0, "baz", &val); g_value_unset (&val); return TRUE; }
C
dbus
1
CVE-2018-19044
https://www.cvedetails.com/cve/CVE-2018-19044/
CWE-59
https://github.com/acassen/keepalived/commit/04f2d32871bb3b11d7dc024039952f2fe2750306
04f2d32871bb3b11d7dc024039952f2fe2750306
When opening files for write, ensure they aren't symbolic links Issue #1048 identified that if, for example, a non privileged user created a symbolic link from /etc/keepalvied.data to /etc/passwd, writing to /etc/keepalived.data (which could be invoked via DBus) would cause /etc/passwd to be overwritten. This commit stops keepalived writing to pathnames where the ultimate component is a symbolic link, by setting O_NOFOLLOW whenever opening a file for writing. This might break some setups, where, for example, /etc/keepalived.data was a symbolic link to /home/fred/keepalived.data. If this was the case, instead create a symbolic link from /home/fred/keepalived.data to /tmp/keepalived.data, so that the file is still accessible via /home/fred/keepalived.data. There doesn't appear to be a way around this backward incompatibility, since even checking if the pathname is a symbolic link prior to opening for writing would create a race condition. Signed-off-by: Quentin Armitage <[email protected]>
process_running(const char *pid_file) { FILE *pidfile = fopen(pid_file, "r"); pid_t pid = 0; int ret; /* No pidfile */ if (!pidfile) return 0; ret = fscanf(pidfile, "%d", &pid); fclose(pidfile); if (ret != 1) { log_message(LOG_INFO, "Error reading pid file %s", pid_file); pid = 0; pidfile_rm(pid_file); } /* What should we return - we don't know if it is running or not. */ if (!pid) return 1; /* If no process is attached to pidfile, remove it */ if (kill(pid, 0)) { log_message(LOG_INFO, "Remove a zombie pid file %s", pid_file); pidfile_rm(pid_file); return 0; } return 1; }
process_running(const char *pid_file) { FILE *pidfile = fopen(pid_file, "r"); pid_t pid = 0; int ret; /* No pidfile */ if (!pidfile) return 0; ret = fscanf(pidfile, "%d", &pid); fclose(pidfile); if (ret != 1) { log_message(LOG_INFO, "Error reading pid file %s", pid_file); pid = 0; pidfile_rm(pid_file); } /* What should we return - we don't know if it is running or not. */ if (!pid) return 1; /* If no process is attached to pidfile, remove it */ if (kill(pid, 0)) { log_message(LOG_INFO, "Remove a zombie pid file %s", pid_file); pidfile_rm(pid_file); return 0; } return 1; }
C
keepalived
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]>
int do_migrate_pages(struct mm_struct *mm, const nodemask_t *from_nodes, const nodemask_t *to_nodes, int flags) { int busy = 0; int err; nodemask_t tmp; err = migrate_prep(); if (err) return err; down_read(&mm->mmap_sem); err = migrate_vmas(mm, from_nodes, to_nodes, flags); if (err) goto out; /* * Find a 'source' bit set in 'tmp' whose corresponding 'dest' * bit in 'to' is not also set in 'tmp'. Clear the found 'source' * bit in 'tmp', and return that <source, dest> pair for migration. * The pair of nodemasks 'to' and 'from' define the map. * * If no pair of bits is found that way, fallback to picking some * pair of 'source' and 'dest' bits that are not the same. If the * 'source' and 'dest' bits are the same, this represents a node * that will be migrating to itself, so no pages need move. * * If no bits are left in 'tmp', or if all remaining bits left * in 'tmp' correspond to the same bit in 'to', return false * (nothing left to migrate). * * This lets us pick a pair of nodes to migrate between, such that * if possible the dest node is not already occupied by some other * source node, minimizing the risk of overloading the memory on a * node that would happen if we migrated incoming memory to a node * before migrating outgoing memory source that same node. * * A single scan of tmp is sufficient. As we go, we remember the * most recent <s, d> pair that moved (s != d). If we find a pair * that not only moved, but what's better, moved to an empty slot * (d is not set in tmp), then we break out then, with that pair. * Otherwise when we finish scanning from_tmp, we at least have the * most recent <s, d> pair that moved. If we get all the way through * the scan of tmp without finding any node that moved, much less * moved to an empty node, then there is nothing left worth migrating. */ tmp = *from_nodes; while (!nodes_empty(tmp)) { int s,d; int source = -1; int dest = 0; for_each_node_mask(s, tmp) { d = node_remap(s, *from_nodes, *to_nodes); if (s == d) continue; source = s; /* Node moved. Memorize */ dest = d; /* dest not in remaining from nodes? */ if (!node_isset(dest, tmp)) break; } if (source == -1) break; node_clear(source, tmp); err = migrate_to_node(mm, source, dest, flags); if (err > 0) busy += err; if (err < 0) break; } out: up_read(&mm->mmap_sem); if (err < 0) return err; return busy; }
int do_migrate_pages(struct mm_struct *mm, const nodemask_t *from_nodes, const nodemask_t *to_nodes, int flags) { int busy = 0; int err; nodemask_t tmp; err = migrate_prep(); if (err) return err; down_read(&mm->mmap_sem); err = migrate_vmas(mm, from_nodes, to_nodes, flags); if (err) goto out; /* * Find a 'source' bit set in 'tmp' whose corresponding 'dest' * bit in 'to' is not also set in 'tmp'. Clear the found 'source' * bit in 'tmp', and return that <source, dest> pair for migration. * The pair of nodemasks 'to' and 'from' define the map. * * If no pair of bits is found that way, fallback to picking some * pair of 'source' and 'dest' bits that are not the same. If the * 'source' and 'dest' bits are the same, this represents a node * that will be migrating to itself, so no pages need move. * * If no bits are left in 'tmp', or if all remaining bits left * in 'tmp' correspond to the same bit in 'to', return false * (nothing left to migrate). * * This lets us pick a pair of nodes to migrate between, such that * if possible the dest node is not already occupied by some other * source node, minimizing the risk of overloading the memory on a * node that would happen if we migrated incoming memory to a node * before migrating outgoing memory source that same node. * * A single scan of tmp is sufficient. As we go, we remember the * most recent <s, d> pair that moved (s != d). If we find a pair * that not only moved, but what's better, moved to an empty slot * (d is not set in tmp), then we break out then, with that pair. * Otherwise when we finish scanning from_tmp, we at least have the * most recent <s, d> pair that moved. If we get all the way through * the scan of tmp without finding any node that moved, much less * moved to an empty node, then there is nothing left worth migrating. */ tmp = *from_nodes; while (!nodes_empty(tmp)) { int s,d; int source = -1; int dest = 0; for_each_node_mask(s, tmp) { d = node_remap(s, *from_nodes, *to_nodes); if (s == d) continue; source = s; /* Node moved. Memorize */ dest = d; /* dest not in remaining from nodes? */ if (!node_isset(dest, tmp)) break; } if (source == -1) break; node_clear(source, tmp); err = migrate_to_node(mm, source, dest, flags); if (err > 0) busy += err; if (err < 0) break; } out: up_read(&mm->mmap_sem); if (err < 0) return err; return busy; }
C
linux
0
CVE-2017-6214
https://www.cvedetails.com/cve/CVE-2017-6214/
CWE-835
https://github.com/torvalds/linux/commit/ccf7abb93af09ad0868ae9033d1ca8108bdaec82
ccf7abb93af09ad0868ae9033d1ca8108bdaec82
tcp: avoid infinite loop in tcp_splice_read() Splicing from TCP socket is vulnerable when a packet with URG flag is received and stored into receive queue. __tcp_splice_read() returns 0, and sk_wait_data() immediately returns since there is the problematic skb in queue. This is a nice way to burn cpu (aka infinite loop) and trigger soft lockups. Again, this gem was found by syzkaller tool. Fixes: 9c55e01c0cc8 ("[TCP]: Splice receive support.") Signed-off-by: Eric Dumazet <[email protected]> Reported-by: Dmitry Vyukov <[email protected]> Cc: Willy Tarreau <[email protected]> Signed-off-by: David S. Miller <[email protected]>
void tcp_init_sock(struct sock *sk) { struct inet_connection_sock *icsk = inet_csk(sk); struct tcp_sock *tp = tcp_sk(sk); tp->out_of_order_queue = RB_ROOT; tcp_init_xmit_timers(sk); tcp_prequeue_init(tp); INIT_LIST_HEAD(&tp->tsq_node); icsk->icsk_rto = TCP_TIMEOUT_INIT; tp->mdev_us = jiffies_to_usecs(TCP_TIMEOUT_INIT); minmax_reset(&tp->rtt_min, tcp_time_stamp, ~0U); /* So many TCP implementations out there (incorrectly) count the * initial SYN frame in their delayed-ACK and congestion control * algorithms that we must have the following bandaid to talk * efficiently to them. -DaveM */ tp->snd_cwnd = TCP_INIT_CWND; /* There's a bubble in the pipe until at least the first ACK. */ tp->app_limited = ~0U; /* See draft-stevens-tcpca-spec-01 for discussion of the * initialization of these values. */ tp->snd_ssthresh = TCP_INFINITE_SSTHRESH; tp->snd_cwnd_clamp = ~0; tp->mss_cache = TCP_MSS_DEFAULT; tp->reordering = sock_net(sk)->ipv4.sysctl_tcp_reordering; tcp_enable_early_retrans(tp); tcp_assign_congestion_control(sk); tp->tsoffset = 0; sk->sk_state = TCP_CLOSE; sk->sk_write_space = sk_stream_write_space; sock_set_flag(sk, SOCK_USE_WRITE_QUEUE); icsk->icsk_sync_mss = tcp_sync_mss; sk->sk_sndbuf = sysctl_tcp_wmem[1]; sk->sk_rcvbuf = sysctl_tcp_rmem[1]; local_bh_disable(); sk_sockets_allocated_inc(sk); local_bh_enable(); }
void tcp_init_sock(struct sock *sk) { struct inet_connection_sock *icsk = inet_csk(sk); struct tcp_sock *tp = tcp_sk(sk); tp->out_of_order_queue = RB_ROOT; tcp_init_xmit_timers(sk); tcp_prequeue_init(tp); INIT_LIST_HEAD(&tp->tsq_node); icsk->icsk_rto = TCP_TIMEOUT_INIT; tp->mdev_us = jiffies_to_usecs(TCP_TIMEOUT_INIT); minmax_reset(&tp->rtt_min, tcp_time_stamp, ~0U); /* So many TCP implementations out there (incorrectly) count the * initial SYN frame in their delayed-ACK and congestion control * algorithms that we must have the following bandaid to talk * efficiently to them. -DaveM */ tp->snd_cwnd = TCP_INIT_CWND; /* There's a bubble in the pipe until at least the first ACK. */ tp->app_limited = ~0U; /* See draft-stevens-tcpca-spec-01 for discussion of the * initialization of these values. */ tp->snd_ssthresh = TCP_INFINITE_SSTHRESH; tp->snd_cwnd_clamp = ~0; tp->mss_cache = TCP_MSS_DEFAULT; tp->reordering = sock_net(sk)->ipv4.sysctl_tcp_reordering; tcp_enable_early_retrans(tp); tcp_assign_congestion_control(sk); tp->tsoffset = 0; sk->sk_state = TCP_CLOSE; sk->sk_write_space = sk_stream_write_space; sock_set_flag(sk, SOCK_USE_WRITE_QUEUE); icsk->icsk_sync_mss = tcp_sync_mss; sk->sk_sndbuf = sysctl_tcp_wmem[1]; sk->sk_rcvbuf = sysctl_tcp_rmem[1]; local_bh_disable(); sk_sockets_allocated_inc(sk); local_bh_enable(); }
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}
base::string16 AuthenticatorBlePinEntrySheetModel::GetStepDescription() const { return l10n_util::GetStringUTF16(IDS_WEBAUTHN_BLE_PIN_ENTRY_DESCRIPTION); }
base::string16 AuthenticatorBlePinEntrySheetModel::GetStepDescription() const { return l10n_util::GetStringUTF16(IDS_WEBAUTHN_BLE_PIN_ENTRY_DESCRIPTION); }
C
Chrome
0
CVE-2017-5330
https://www.cvedetails.com/cve/CVE-2017-5330/
CWE-78
https://cgit.kde.org/ark.git/commit/?id=82fdfd24d46966a117fa625b68784735a40f9065
82fdfd24d46966a117fa625b68784735a40f9065
null
void Part::slotActivated(const QModelIndex &index) { Q_UNUSED(index) if (QGuiApplication::keyboardModifiers() != Qt::ShiftModifier && QGuiApplication::keyboardModifiers() != Qt::ControlModifier) { ArkSettings::defaultOpenAction() == ArkSettings::EnumDefaultOpenAction::Preview ? slotOpenEntry(Preview) : slotOpenEntry(OpenFile); } }
void Part::slotActivated(const QModelIndex &index) { Q_UNUSED(index) if (QGuiApplication::keyboardModifiers() != Qt::ShiftModifier && QGuiApplication::keyboardModifiers() != Qt::ControlModifier) { ArkSettings::defaultOpenAction() == ArkSettings::EnumDefaultOpenAction::Preview ? slotOpenEntry(Preview) : slotOpenEntry(OpenFile); } }
CPP
kde
0
CVE-2018-11596
https://www.cvedetails.com/cve/CVE-2018-11596/
CWE-119
https://github.com/espruino/Espruino/commit/ce1924193862d58cb43d3d4d9dada710a8361b89
ce1924193862d58cb43d3d4d9dada710a8361b89
fix jsvGetString regression
JsVar *jsvAsString(JsVar *v, bool unlockVar) { JsVar *str = 0; if (jsvHasCharacterData(v) && jsvIsName(v)) { str = jsvNewFromStringVar(v,0,JSVAPPENDSTRINGVAR_MAXLENGTH); } else if (jsvIsString(v)) { // If it is a string - just return a reference str = jsvLockAgain(v); } else if (jsvIsObject(v)) { // If it is an object and we can call toString on it JsVar *toStringFn = jspGetNamedField(v, "toString", false); if (toStringFn && toStringFn->varData.native.ptr != (void (*)(void))jswrap_object_toString) { JsVar *result = jspExecuteFunction(toStringFn,v,0,0); jsvUnLock(toStringFn); str = jsvAsString(result, true); } else { jsvUnLock(toStringFn); str = jsvNewFromString("[object Object]"); } } else { const char *constChar = jsvGetConstString(v); assert(JS_NUMBER_BUFFER_SIZE>=10); char buf[JS_NUMBER_BUFFER_SIZE]; if (constChar) { str = jsvNewFromString(constChar); } else if (jsvIsPin(v)) { jshGetPinString(buf, (Pin)v->varData.integer); str = jsvNewFromString(buf); } else if (jsvIsInt(v)) { itostr(v->varData.integer, buf, 10); str = jsvNewFromString(buf); } else if (jsvIsFloat(v)) { ftoa_bounded(v->varData.floating, buf, sizeof(buf)); str = jsvNewFromString(buf); } else if (jsvIsArray(v) || jsvIsArrayBuffer(v)) { JsVar *filler = jsvNewFromString(","); str = jsvArrayJoin(v, filler); jsvUnLock(filler); } else if (jsvIsFunction(v)) { str = jsvNewFromEmptyString(); if (str) jsfGetJSON(v, str, JSON_NONE); } else { jsExceptionHere(JSET_INTERNALERROR, "Variable type cannot be converted to string"); str = 0; } } if (unlockVar) jsvUnLock(v); return str; }
JsVar *jsvAsString(JsVar *v, bool unlockVar) { JsVar *str = 0; if (jsvHasCharacterData(v) && jsvIsName(v)) { str = jsvNewFromStringVar(v,0,JSVAPPENDSTRINGVAR_MAXLENGTH); } else if (jsvIsString(v)) { // If it is a string - just return a reference str = jsvLockAgain(v); } else if (jsvIsObject(v)) { // If it is an object and we can call toString on it JsVar *toStringFn = jspGetNamedField(v, "toString", false); if (toStringFn && toStringFn->varData.native.ptr != (void (*)(void))jswrap_object_toString) { JsVar *result = jspExecuteFunction(toStringFn,v,0,0); jsvUnLock(toStringFn); str = jsvAsString(result, true); } else { jsvUnLock(toStringFn); str = jsvNewFromString("[object Object]"); } } else { const char *constChar = jsvGetConstString(v); assert(JS_NUMBER_BUFFER_SIZE>=10); char buf[JS_NUMBER_BUFFER_SIZE]; if (constChar) { str = jsvNewFromString(constChar); } else if (jsvIsPin(v)) { jshGetPinString(buf, (Pin)v->varData.integer); str = jsvNewFromString(buf); } else if (jsvIsInt(v)) { itostr(v->varData.integer, buf, 10); str = jsvNewFromString(buf); } else if (jsvIsFloat(v)) { ftoa_bounded(v->varData.floating, buf, sizeof(buf)); str = jsvNewFromString(buf); } else if (jsvIsArray(v) || jsvIsArrayBuffer(v)) { JsVar *filler = jsvNewFromString(","); str = jsvArrayJoin(v, filler); jsvUnLock(filler); } else if (jsvIsFunction(v)) { str = jsvNewFromEmptyString(); if (str) jsfGetJSON(v, str, JSON_NONE); } else { jsExceptionHere(JSET_INTERNALERROR, "Variable type cannot be converted to string"); str = 0; } } if (unlockVar) jsvUnLock(v); return str; }
C
Espruino
0
CVE-2016-4072
https://www.cvedetails.com/cve/CVE-2016-4072/
CWE-20
https://git.php.net/?p=php-src.git;a=commit;h=1e9b175204e3286d64dfd6c9f09151c31b5e099a
1e9b175204e3286d64dfd6c9f09151c31b5e099a
null
static void phar_mkdir(phar_archive_data **pphar, char *dirname, int dirname_len) { char *error; phar_entry_data *data; if (!(data = phar_get_or_create_entry_data((*pphar)->fname, (*pphar)->fname_len, dirname, dirname_len, "w+b", 2, &error, 1))) { if (error) { zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "Directory %s does not exist and cannot be created: %s", dirname, error); efree(error); } else { zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "Directory %s does not exist and cannot be created", dirname); } return; } else { if (error) { efree(error); } /* check for copy on write */ if (data->phar != *pphar) { *pphar = data->phar; } phar_entry_delref(data); phar_flush(*pphar, 0, 0, 0, &error); if (error) { zend_throw_exception_ex(phar_ce_PharException, 0, "%s", error); efree(error); } } }
static void phar_mkdir(phar_archive_data **pphar, char *dirname, int dirname_len) { char *error; phar_entry_data *data; if (!(data = phar_get_or_create_entry_data((*pphar)->fname, (*pphar)->fname_len, dirname, dirname_len, "w+b", 2, &error, 1))) { if (error) { zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "Directory %s does not exist and cannot be created: %s", dirname, error); efree(error); } else { zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "Directory %s does not exist and cannot be created", dirname); } return; } else { if (error) { efree(error); } /* check for copy on write */ if (data->phar != *pphar) { *pphar = data->phar; } phar_entry_delref(data); phar_flush(*pphar, 0, 0, 0, &error); if (error) { zend_throw_exception_ex(phar_ce_PharException, 0, "%s", error); efree(error); } } }
C
php
0
CVE-2012-2890
https://www.cvedetails.com/cve/CVE-2012-2890/
CWE-399
https://github.com/chromium/chromium/commit/eb4bcacd683a68534bbe2e4d8d6eeafafc7f57ba
eb4bcacd683a68534bbe2e4d8d6eeafafc7f57ba
Make chrome.appWindow.create() provide access to the child window at a predictable time. When you first create a window with chrome.appWindow.create(), it won't have loaded any resources. So, at create time, you are guaranteed that: child_window.location.href == 'about:blank' child_window.document.documentElement.outerHTML == '<html><head></head><body></body></html>' This is in line with the behaviour of window.open(). BUG=131735 TEST=browser_tests:PlatformAppBrowserTest.WindowsApi Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=144072 Review URL: https://chromiumcodereview.appspot.com/10644006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@144356 0039d316-1c4b-4281-b951-d872f2087c98
virtual void PlatformCancel() {}
virtual void PlatformCancel() {}
C
Chrome
0
CVE-2017-8933
https://www.cvedetails.com/cve/CVE-2017-8933/
CWE-20
https://git.lxde.org/gitweb/?p=lxde/menu-cache.git;a=commit;h=56f66684592abf257c4004e6e1fff041c64a12ce
56f66684592abf257c4004e6e1fff041c64a12ce
null
const char* menu_cache_item_get_id( MenuCacheItem* item ) { return item->id; }
const char* menu_cache_item_get_id( MenuCacheItem* item ) { return item->id; }
C
lxde
0
CVE-2013-4129
https://www.cvedetails.com/cve/CVE-2013-4129/
CWE-20
https://github.com/torvalds/linux/commit/c7e8e8a8f7a70b343ca1e0f90a31e35ab2d16de1
c7e8e8a8f7a70b343ca1e0f90a31e35ab2d16de1
bridge: fix some kernel warning in multicast timer Several people reported the warning: "kernel BUG at kernel/timer.c:729!" and the stack trace is: #7 [ffff880214d25c10] mod_timer+501 at ffffffff8106d905 #8 [ffff880214d25c50] br_multicast_del_pg.isra.20+261 at ffffffffa0731d25 [bridge] #9 [ffff880214d25c80] br_multicast_disable_port+88 at ffffffffa0732948 [bridge] #10 [ffff880214d25cb0] br_stp_disable_port+154 at ffffffffa072bcca [bridge] #11 [ffff880214d25ce8] br_device_event+520 at ffffffffa072a4e8 [bridge] #12 [ffff880214d25d18] notifier_call_chain+76 at ffffffff8164aafc #13 [ffff880214d25d50] raw_notifier_call_chain+22 at ffffffff810858f6 #14 [ffff880214d25d60] call_netdevice_notifiers+45 at ffffffff81536aad #15 [ffff880214d25d80] dev_close_many+183 at ffffffff81536d17 #16 [ffff880214d25dc0] rollback_registered_many+168 at ffffffff81537f68 #17 [ffff880214d25de8] rollback_registered+49 at ffffffff81538101 #18 [ffff880214d25e10] unregister_netdevice_queue+72 at ffffffff815390d8 #19 [ffff880214d25e30] __tun_detach+272 at ffffffffa074c2f0 [tun] #20 [ffff880214d25e88] tun_chr_close+45 at ffffffffa074c4bd [tun] #21 [ffff880214d25ea8] __fput+225 at ffffffff8119b1f1 #22 [ffff880214d25ef0] ____fput+14 at ffffffff8119b3fe #23 [ffff880214d25f00] task_work_run+159 at ffffffff8107cf7f #24 [ffff880214d25f30] do_notify_resume+97 at ffffffff810139e1 #25 [ffff880214d25f50] int_signal+18 at ffffffff8164f292 this is due to I forgot to check if mp->timer is armed in br_multicast_del_pg(). This bug is introduced by commit 9f00b2e7cf241fa389733d41b6 (bridge: only expire the mdb entry when query is received). Same for __br_mdb_del(). Tested-by: poma <[email protected]> Reported-by: LiYonghua <[email protected]> Reported-by: Robert Hancock <[email protected]> Cc: Herbert Xu <[email protected]> Cc: Stephen Hemminger <[email protected]> Cc: "David S. Miller" <[email protected]> Signed-off-by: Cong Wang <[email protected]> Signed-off-by: David S. Miller <[email protected]>
static struct net_bridge_mdb_entry *__br_mdb_ip_get( struct net_bridge_mdb_htable *mdb, struct br_ip *dst, int hash) { struct net_bridge_mdb_entry *mp; hlist_for_each_entry_rcu(mp, &mdb->mhash[hash], hlist[mdb->ver]) { if (br_ip_equal(&mp->addr, dst)) return mp; } return NULL; }
static struct net_bridge_mdb_entry *__br_mdb_ip_get( struct net_bridge_mdb_htable *mdb, struct br_ip *dst, int hash) { struct net_bridge_mdb_entry *mp; hlist_for_each_entry_rcu(mp, &mdb->mhash[hash], hlist[mdb->ver]) { if (br_ip_equal(&mp->addr, dst)) return mp; } return NULL; }
C
linux
0
CVE-2017-13041
https://www.cvedetails.com/cve/CVE-2017-13041/
CWE-125
https://github.com/the-tcpdump-group/tcpdump/commit/f4b9e24c7384d882a7f434cc7413925bf871d63e
f4b9e24c7384d882a7f434cc7413925bf871d63e
CVE-2017-13041/ICMP6: Add more bounds checks. This fixes a buffer over-read discovered by Kim Gwan Yeong. Add a test using the capture file supplied by the reporter(s).
mldv2_query_print(netdissect_options *ndo, const u_char *bp, u_int len) { const struct icmp6_hdr *icp = (const struct icmp6_hdr *) bp; u_int mrc; int mrt, qqi; u_int nsrcs; register u_int i; /* Minimum len is 28 */ if (len < 28) { ND_PRINT((ndo," [invalid len %d]", len)); return; } ND_TCHECK(icp->icmp6_data16[0]); mrc = EXTRACT_16BITS(&icp->icmp6_data16[0]); if (mrc < 32768) { mrt = mrc; } else { mrt = ((mrc & 0x0fff) | 0x1000) << (((mrc & 0x7000) >> 12) + 3); } if (ndo->ndo_vflag) { ND_PRINT((ndo," [max resp delay=%d]", mrt)); } ND_TCHECK2(bp[8], sizeof(struct in6_addr)); ND_PRINT((ndo," [gaddr %s", ip6addr_string(ndo, &bp[8]))); if (ndo->ndo_vflag) { ND_TCHECK(bp[25]); if (bp[24] & 0x08) { ND_PRINT((ndo," sflag")); } if (bp[24] & 0x07) { ND_PRINT((ndo," robustness=%d", bp[24] & 0x07)); } if (bp[25] < 128) { qqi = bp[25]; } else { qqi = ((bp[25] & 0x0f) | 0x10) << (((bp[25] & 0x70) >> 4) + 3); } ND_PRINT((ndo," qqi=%d", qqi)); } ND_TCHECK2(bp[26], 2); nsrcs = EXTRACT_16BITS(&bp[26]); if (nsrcs > 0) { if (len < 28 + nsrcs * sizeof(struct in6_addr)) ND_PRINT((ndo," [invalid number of sources]")); else if (ndo->ndo_vflag > 1) { ND_PRINT((ndo," {")); for (i = 0; i < nsrcs; i++) { ND_TCHECK2(bp[28 + i * sizeof(struct in6_addr)], sizeof(struct in6_addr)); ND_PRINT((ndo," %s", ip6addr_string(ndo, &bp[28 + i * sizeof(struct in6_addr)]))); } ND_PRINT((ndo," }")); } else ND_PRINT((ndo,", %d source(s)", nsrcs)); } ND_PRINT((ndo,"]")); return; trunc: ND_PRINT((ndo,"[|icmp6]")); return; }
mldv2_query_print(netdissect_options *ndo, const u_char *bp, u_int len) { const struct icmp6_hdr *icp = (const struct icmp6_hdr *) bp; u_int mrc; int mrt, qqi; u_int nsrcs; register u_int i; /* Minimum len is 28 */ if (len < 28) { ND_PRINT((ndo," [invalid len %d]", len)); return; } ND_TCHECK(icp->icmp6_data16[0]); mrc = EXTRACT_16BITS(&icp->icmp6_data16[0]); if (mrc < 32768) { mrt = mrc; } else { mrt = ((mrc & 0x0fff) | 0x1000) << (((mrc & 0x7000) >> 12) + 3); } if (ndo->ndo_vflag) { ND_PRINT((ndo," [max resp delay=%d]", mrt)); } ND_TCHECK2(bp[8], sizeof(struct in6_addr)); ND_PRINT((ndo," [gaddr %s", ip6addr_string(ndo, &bp[8]))); if (ndo->ndo_vflag) { ND_TCHECK(bp[25]); if (bp[24] & 0x08) { ND_PRINT((ndo," sflag")); } if (bp[24] & 0x07) { ND_PRINT((ndo," robustness=%d", bp[24] & 0x07)); } if (bp[25] < 128) { qqi = bp[25]; } else { qqi = ((bp[25] & 0x0f) | 0x10) << (((bp[25] & 0x70) >> 4) + 3); } ND_PRINT((ndo," qqi=%d", qqi)); } ND_TCHECK2(bp[26], 2); nsrcs = EXTRACT_16BITS(&bp[26]); if (nsrcs > 0) { if (len < 28 + nsrcs * sizeof(struct in6_addr)) ND_PRINT((ndo," [invalid number of sources]")); else if (ndo->ndo_vflag > 1) { ND_PRINT((ndo," {")); for (i = 0; i < nsrcs; i++) { ND_TCHECK2(bp[28 + i * sizeof(struct in6_addr)], sizeof(struct in6_addr)); ND_PRINT((ndo," %s", ip6addr_string(ndo, &bp[28 + i * sizeof(struct in6_addr)]))); } ND_PRINT((ndo," }")); } else ND_PRINT((ndo,", %d source(s)", nsrcs)); } ND_PRINT((ndo,"]")); return; trunc: ND_PRINT((ndo,"[|icmp6]")); return; }
C
tcpdump
0
CVE-2019-5827
https://www.cvedetails.com/cve/CVE-2019-5827/
CWE-190
https://github.com/chromium/chromium/commit/517ac71c9ee27f856f9becde8abea7d1604af9d4
517ac71c9ee27f856f9becde8abea7d1604af9d4
sqlite: backport bugfixes for dbfuzz2 Bug: 952406 Change-Id: Icbec429742048d6674828726c96d8e265c41b595 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1568152 Reviewed-by: Chris Mumford <[email protected]> Commit-Queue: Darwin Huang <[email protected]> Cr-Commit-Position: refs/heads/master@{#651030}
static int convertCompoundSelectToSubquery(Walker *pWalker, Select *p){ int i; Select *pNew; Select *pX; sqlite3 *db; struct ExprList_item *a; SrcList *pNewSrc; Parse *pParse; Token dummy; if( p->pPrior==0 ) return WRC_Continue; if( p->pOrderBy==0 ) return WRC_Continue; for(pX=p; pX && (pX->op==TK_ALL || pX->op==TK_SELECT); pX=pX->pPrior){} if( pX==0 ) return WRC_Continue; a = p->pOrderBy->a; for(i=p->pOrderBy->nExpr-1; i>=0; i--){ if( a[i].pExpr->flags & EP_Collate ) break; } if( i<0 ) return WRC_Continue; /* If we reach this point, that means the transformation is required. */ pParse = pWalker->pParse; db = pParse->db; pNew = sqlite3DbMallocZero(db, sizeof(*pNew) ); if( pNew==0 ) return WRC_Abort; memset(&dummy, 0, sizeof(dummy)); pNewSrc = sqlite3SrcListAppendFromTerm(pParse,0,0,0,&dummy,pNew,0,0); if( pNewSrc==0 ) return WRC_Abort; *pNew = *p; p->pSrc = pNewSrc; p->pEList = sqlite3ExprListAppend(pParse, 0, sqlite3Expr(db, TK_ASTERISK, 0)); p->op = TK_SELECT; p->pWhere = 0; pNew->pGroupBy = 0; pNew->pHaving = 0; pNew->pOrderBy = 0; p->pPrior = 0; p->pNext = 0; p->pWith = 0; p->selFlags &= ~SF_Compound; assert( (p->selFlags & SF_Converted)==0 ); p->selFlags |= SF_Converted; assert( pNew->pPrior!=0 ); pNew->pPrior->pNext = pNew; pNew->pLimit = 0; return WRC_Continue; }
static int convertCompoundSelectToSubquery(Walker *pWalker, Select *p){ int i; Select *pNew; Select *pX; sqlite3 *db; struct ExprList_item *a; SrcList *pNewSrc; Parse *pParse; Token dummy; if( p->pPrior==0 ) return WRC_Continue; if( p->pOrderBy==0 ) return WRC_Continue; for(pX=p; pX && (pX->op==TK_ALL || pX->op==TK_SELECT); pX=pX->pPrior){} if( pX==0 ) return WRC_Continue; a = p->pOrderBy->a; for(i=p->pOrderBy->nExpr-1; i>=0; i--){ if( a[i].pExpr->flags & EP_Collate ) break; } if( i<0 ) return WRC_Continue; /* If we reach this point, that means the transformation is required. */ pParse = pWalker->pParse; db = pParse->db; pNew = sqlite3DbMallocZero(db, sizeof(*pNew) ); if( pNew==0 ) return WRC_Abort; memset(&dummy, 0, sizeof(dummy)); pNewSrc = sqlite3SrcListAppendFromTerm(pParse,0,0,0,&dummy,pNew,0,0); if( pNewSrc==0 ) return WRC_Abort; *pNew = *p; p->pSrc = pNewSrc; p->pEList = sqlite3ExprListAppend(pParse, 0, sqlite3Expr(db, TK_ASTERISK, 0)); p->op = TK_SELECT; p->pWhere = 0; pNew->pGroupBy = 0; pNew->pHaving = 0; pNew->pOrderBy = 0; p->pPrior = 0; p->pNext = 0; p->pWith = 0; p->selFlags &= ~SF_Compound; assert( (p->selFlags & SF_Converted)==0 ); p->selFlags |= SF_Converted; assert( pNew->pPrior!=0 ); pNew->pPrior->pNext = pNew; pNew->pLimit = 0; return WRC_Continue; }
C
Chrome
0
CVE-2018-17206
https://www.cvedetails.com/cve/CVE-2018-17206/
null
https://github.com/openvswitch/ovs/commit/9237a63c47bd314b807cda0bd2216264e82edbe8
9237a63c47bd314b807cda0bd2216264e82edbe8
ofp-actions: Avoid buffer overread in BUNDLE action decoding. Reported-at: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=9052 Signed-off-by: Ben Pfaff <[email protected]> Acked-by: Justin Pettit <[email protected]>
encode_NAT(const struct ofpact_nat *nat, enum ofp_version ofp_version OVS_UNUSED, struct ofpbuf *out) { struct nx_action_nat *nan; const size_t ofs = out->size; uint16_t range_present = 0; nan = put_NXAST_NAT(out); nan->flags = htons(nat->flags); if (nat->range_af == AF_INET) { if (nat->range.addr.ipv4.min) { ovs_be32 *min = ofpbuf_put_uninit(out, sizeof *min); *min = nat->range.addr.ipv4.min; range_present |= NX_NAT_RANGE_IPV4_MIN; } if (nat->range.addr.ipv4.max) { ovs_be32 *max = ofpbuf_put_uninit(out, sizeof *max); *max = nat->range.addr.ipv4.max; range_present |= NX_NAT_RANGE_IPV4_MAX; } } else if (nat->range_af == AF_INET6) { if (!ipv6_mask_is_any(&nat->range.addr.ipv6.min)) { struct in6_addr *min = ofpbuf_put_uninit(out, sizeof *min); *min = nat->range.addr.ipv6.min; range_present |= NX_NAT_RANGE_IPV6_MIN; } if (!ipv6_mask_is_any(&nat->range.addr.ipv6.max)) { struct in6_addr *max = ofpbuf_put_uninit(out, sizeof *max); *max = nat->range.addr.ipv6.max; range_present |= NX_NAT_RANGE_IPV6_MAX; } } if (nat->range_af != AF_UNSPEC) { if (nat->range.proto.min) { ovs_be16 *min = ofpbuf_put_uninit(out, sizeof *min); *min = htons(nat->range.proto.min); range_present |= NX_NAT_RANGE_PROTO_MIN; } if (nat->range.proto.max) { ovs_be16 *max = ofpbuf_put_uninit(out, sizeof *max); *max = htons(nat->range.proto.max); range_present |= NX_NAT_RANGE_PROTO_MAX; } } pad_ofpat(out, ofs); nan = ofpbuf_at(out, ofs, sizeof *nan); nan->range_present = htons(range_present); }
encode_NAT(const struct ofpact_nat *nat, enum ofp_version ofp_version OVS_UNUSED, struct ofpbuf *out) { struct nx_action_nat *nan; const size_t ofs = out->size; uint16_t range_present = 0; nan = put_NXAST_NAT(out); nan->flags = htons(nat->flags); if (nat->range_af == AF_INET) { if (nat->range.addr.ipv4.min) { ovs_be32 *min = ofpbuf_put_uninit(out, sizeof *min); *min = nat->range.addr.ipv4.min; range_present |= NX_NAT_RANGE_IPV4_MIN; } if (nat->range.addr.ipv4.max) { ovs_be32 *max = ofpbuf_put_uninit(out, sizeof *max); *max = nat->range.addr.ipv4.max; range_present |= NX_NAT_RANGE_IPV4_MAX; } } else if (nat->range_af == AF_INET6) { if (!ipv6_mask_is_any(&nat->range.addr.ipv6.min)) { struct in6_addr *min = ofpbuf_put_uninit(out, sizeof *min); *min = nat->range.addr.ipv6.min; range_present |= NX_NAT_RANGE_IPV6_MIN; } if (!ipv6_mask_is_any(&nat->range.addr.ipv6.max)) { struct in6_addr *max = ofpbuf_put_uninit(out, sizeof *max); *max = nat->range.addr.ipv6.max; range_present |= NX_NAT_RANGE_IPV6_MAX; } } if (nat->range_af != AF_UNSPEC) { if (nat->range.proto.min) { ovs_be16 *min = ofpbuf_put_uninit(out, sizeof *min); *min = htons(nat->range.proto.min); range_present |= NX_NAT_RANGE_PROTO_MIN; } if (nat->range.proto.max) { ovs_be16 *max = ofpbuf_put_uninit(out, sizeof *max); *max = htons(nat->range.proto.max); range_present |= NX_NAT_RANGE_PROTO_MAX; } } pad_ofpat(out, ofs); nan = ofpbuf_at(out, ofs, sizeof *nan); nan->range_present = htons(range_present); }
C
ovs
0
CVE-2017-5120
https://www.cvedetails.com/cve/CVE-2017-5120/
null
https://github.com/chromium/chromium/commit/b7277af490d28ac7f802c015bb0ff31395768556
b7277af490d28ac7f802c015bb0ff31395768556
bindings: Support "attribute FrozenArray<T>?" Adds a quick hack to support a case of "attribute FrozenArray<T>?". Bug: 1028047 Change-Id: Ib3cecc4beb6bcc0fb0dbc667aca595454cc90c86 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1933866 Reviewed-by: Hitoshi Yoshida <[email protected]> Commit-Queue: Yuki Shiino <[email protected]> Cr-Commit-Position: refs/heads/master@{#718676}
void V8TestObject::VoidMethodShortArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_voidMethodShortArg"); test_object_v8_internal::VoidMethodShortArgMethod(info); }
void V8TestObject::VoidMethodShortArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_voidMethodShortArg"); test_object_v8_internal::VoidMethodShortArgMethod(info); }
C
Chrome
0
CVE-2016-1674
https://www.cvedetails.com/cve/CVE-2016-1674/
null
https://github.com/chromium/chromium/commit/14ff9d0cded8ae8032ef027d1f33c6666a695019
14ff9d0cded8ae8032ef027d1f33c6666a695019
[Extensions] Add more bindings access checks BUG=598165 Review URL: https://codereview.chromium.org/1854983002 Cr-Commit-Position: refs/heads/master@{#385282}
void PageCaptureCustomBindings::SendResponseAck( const v8::FunctionCallbackInfo<v8::Value>& args) { CHECK(args.Length() == 1); CHECK(args[0]->IsInt32()); content::RenderFrame* render_frame = context()->GetRenderFrame(); if (render_frame) { render_frame->Send(new ExtensionHostMsg_ResponseAck( render_frame->GetRoutingID(), args[0]->Int32Value())); } }
void PageCaptureCustomBindings::SendResponseAck( const v8::FunctionCallbackInfo<v8::Value>& args) { CHECK(args.Length() == 1); CHECK(args[0]->IsInt32()); content::RenderFrame* render_frame = context()->GetRenderFrame(); if (render_frame) { render_frame->Send(new ExtensionHostMsg_ResponseAck( render_frame->GetRoutingID(), args[0]->Int32Value())); } }
C
Chrome
0
CVE-2018-6140
https://www.cvedetails.com/cve/CVE-2018-6140/
CWE-20
https://github.com/chromium/chromium/commit/2aec794f26098c7a361c27d7c8f57119631cca8a
2aec794f26098c7a361c27d7c8f57119631cca8a
[DevTools] Do not allow chrome.debugger to attach to web ui pages If the page navigates to web ui, we force detach the debugger extension. [email protected] Bug: 798222 Change-Id: Idb46c2f59e839388397a8dfa6ce2e2a897698df3 Reviewed-on: https://chromium-review.googlesource.com/935961 Commit-Queue: Dmitry Gozman <[email protected]> Reviewed-by: Devlin <[email protected]> Reviewed-by: Pavel Feldman <[email protected]> Reviewed-by: Nasko Oskov <[email protected]> Cr-Commit-Position: refs/heads/master@{#540916}
void DevToolsAgentHostImpl::AttachSession(DevToolsSession* session) {}
void DevToolsAgentHostImpl::AttachSession(DevToolsSession* session) {}
C
Chrome
0
CVE-2016-5199
https://www.cvedetails.com/cve/CVE-2016-5199/
CWE-119
https://github.com/chromium/chromium/commit/c995d4fe5e96f4d6d4a88b7867279b08e72d2579
c995d4fe5e96f4d6d4a88b7867279b08e72d2579
Move IsDataSaverEnabledByUser to be a static method and use it This method now officially becomes the source of truth that everything in the code base eventually calls into to determine whether or not DataSaver is enabled. Bug: 934399 Change-Id: Iae837b710ace8cc3101188f79d02cbc2d4f0fd93 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1537242 Reviewed-by: Joshua Pawlicki <[email protected]> Reviewed-by: Tarun Bansal <[email protected]> Commit-Queue: Robert Ogden <[email protected]> Cr-Commit-Position: refs/heads/master@{#643948}
void InitPrefMembers() {
void InitPrefMembers() { settings_->InitPrefMembers(); }
C
Chrome
1
CVE-2016-6720
https://www.cvedetails.com/cve/CVE-2016-6720/
CWE-200
https://android.googlesource.com/platform/frameworks/av/+/7c88b498fda1c2b608a9dd73960a2fd4d7b7e3f7
7c88b498fda1c2b608a9dd73960a2fd4d7b7e3f7
IOMX: allow configuration after going to loaded state This was disallowed recently but we still use it as MediaCodcec.stop only goes to loaded state, and does not free component. Bug: 31450460 Change-Id: I72e092e4e55c9f23b1baee3e950d76e84a5ef28d (cherry picked from commit e03b22839d78c841ce0a1a0a1ee1960932188b0b)
status_t OMXNodeInstance::prepareForAdaptivePlayback( OMX_U32 portIndex, OMX_BOOL enable, OMX_U32 maxFrameWidth, OMX_U32 maxFrameHeight) { Mutex::Autolock autolock(mLock); if (mSailed) { android_errorWriteLog(0x534e4554, "29422020"); return INVALID_OPERATION; } CLOG_CONFIG(prepareForAdaptivePlayback, "%s:%u en=%d max=%ux%u", portString(portIndex), portIndex, enable, maxFrameWidth, maxFrameHeight); OMX_INDEXTYPE index; OMX_STRING name = const_cast<OMX_STRING>( "OMX.google.android.index.prepareForAdaptivePlayback"); OMX_ERRORTYPE err = OMX_GetExtensionIndex(mHandle, name, &index); if (err != OMX_ErrorNone) { CLOG_ERROR_IF(enable, getExtensionIndex, err, "%s", name); return StatusFromOMXError(err); } PrepareForAdaptivePlaybackParams params; InitOMXParams(&params); params.nPortIndex = portIndex; params.bEnable = enable; params.nMaxFrameWidth = maxFrameWidth; params.nMaxFrameHeight = maxFrameHeight; err = OMX_SetParameter(mHandle, index, &params); CLOG_IF_ERROR(setParameter, err, "%s(%#x): %s:%u en=%d max=%ux%u", name, index, portString(portIndex), portIndex, enable, maxFrameWidth, maxFrameHeight); return StatusFromOMXError(err); }
status_t OMXNodeInstance::prepareForAdaptivePlayback( OMX_U32 portIndex, OMX_BOOL enable, OMX_U32 maxFrameWidth, OMX_U32 maxFrameHeight) { Mutex::Autolock autolock(mLock); if (mSailed) { android_errorWriteLog(0x534e4554, "29422020"); return INVALID_OPERATION; } CLOG_CONFIG(prepareForAdaptivePlayback, "%s:%u en=%d max=%ux%u", portString(portIndex), portIndex, enable, maxFrameWidth, maxFrameHeight); OMX_INDEXTYPE index; OMX_STRING name = const_cast<OMX_STRING>( "OMX.google.android.index.prepareForAdaptivePlayback"); OMX_ERRORTYPE err = OMX_GetExtensionIndex(mHandle, name, &index); if (err != OMX_ErrorNone) { CLOG_ERROR_IF(enable, getExtensionIndex, err, "%s", name); return StatusFromOMXError(err); } PrepareForAdaptivePlaybackParams params; InitOMXParams(&params); params.nPortIndex = portIndex; params.bEnable = enable; params.nMaxFrameWidth = maxFrameWidth; params.nMaxFrameHeight = maxFrameHeight; err = OMX_SetParameter(mHandle, index, &params); CLOG_IF_ERROR(setParameter, err, "%s(%#x): %s:%u en=%d max=%ux%u", name, index, portString(portIndex), portIndex, enable, maxFrameWidth, maxFrameHeight); return StatusFromOMXError(err); }
C
Android
0
CVE-2017-7375
https://www.cvedetails.com/cve/CVE-2017-7375/
CWE-611
https://android.googlesource.com/platform/external/libxml2/+/308396a55280f69ad4112d4f9892f4cbeff042aa
308396a55280f69ad4112d4f9892f4cbeff042aa
DO NOT MERGE: Add validation for eternal enities https://bugzilla.gnome.org/show_bug.cgi?id=780691 Bug: 36556310 Change-Id: I9450743e167c3c73af5e4071f3fc85e81d061648 (cherry picked from commit bef9af3d89d241bcb518c20cba6da2a2fd9ba049)
xmlParseMarkupDecl(xmlParserCtxtPtr ctxt) { GROW; if (CUR == '<') { if (NXT(1) == '!') { switch (NXT(2)) { case 'E': if (NXT(3) == 'L') xmlParseElementDecl(ctxt); else if (NXT(3) == 'N') xmlParseEntityDecl(ctxt); break; case 'A': xmlParseAttributeListDecl(ctxt); break; case 'N': xmlParseNotationDecl(ctxt); break; case '-': xmlParseComment(ctxt); break; default: /* there is an error but it will be detected later */ break; } } else if (NXT(1) == '?') { xmlParsePI(ctxt); } } /* * detect requirement to exit there and act accordingly * and avoid having instate overriden later on */ if (ctxt->instate == XML_PARSER_EOF) return; /* * This is only for internal subset. On external entities, * the replacement is done before parsing stage */ if ((ctxt->external == 0) && (ctxt->inputNr == 1)) xmlParsePEReference(ctxt); /* * Conditional sections are allowed from entities included * by PE References in the internal subset. */ if ((ctxt->external == 0) && (ctxt->inputNr > 1)) { if ((RAW == '<') && (NXT(1) == '!') && (NXT(2) == '[')) { xmlParseConditionalSections(ctxt); } } ctxt->instate = XML_PARSER_DTD; }
xmlParseMarkupDecl(xmlParserCtxtPtr ctxt) { GROW; if (CUR == '<') { if (NXT(1) == '!') { switch (NXT(2)) { case 'E': if (NXT(3) == 'L') xmlParseElementDecl(ctxt); else if (NXT(3) == 'N') xmlParseEntityDecl(ctxt); break; case 'A': xmlParseAttributeListDecl(ctxt); break; case 'N': xmlParseNotationDecl(ctxt); break; case '-': xmlParseComment(ctxt); break; default: /* there is an error but it will be detected later */ break; } } else if (NXT(1) == '?') { xmlParsePI(ctxt); } } /* * detect requirement to exit there and act accordingly * and avoid having instate overriden later on */ if (ctxt->instate == XML_PARSER_EOF) return; /* * This is only for internal subset. On external entities, * the replacement is done before parsing stage */ if ((ctxt->external == 0) && (ctxt->inputNr == 1)) xmlParsePEReference(ctxt); /* * Conditional sections are allowed from entities included * by PE References in the internal subset. */ if ((ctxt->external == 0) && (ctxt->inputNr > 1)) { if ((RAW == '<') && (NXT(1) == '!') && (NXT(2) == '[')) { xmlParseConditionalSections(ctxt); } } ctxt->instate = XML_PARSER_DTD; }
C
Android
0
CVE-2013-7421
https://www.cvedetails.com/cve/CVE-2013-7421/
CWE-264
https://github.com/torvalds/linux/commit/5d26a105b5a73e5635eae0629b42fa0a90e07b7b
5d26a105b5a73e5635eae0629b42fa0a90e07b7b
crypto: prefix module autoloading with "crypto-" This prefixes all crypto module loading with "crypto-" so we never run the risk of exposing module auto-loading to userspace via a crypto API, as demonstrated by Mathias Krause: https://lkml.org/lkml/2013/3/4/70 Signed-off-by: Kees Cook <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
static int cbc_des3_decrypt(struct blkcipher_desc *desc, struct scatterlist *dst, struct scatterlist *src, unsigned int nbytes) { struct blkcipher_walk walk; blkcipher_walk_init(&walk, dst, src, nbytes); return cbc_desall_crypt(desc, KMC_TDEA_192_DECRYPT, &walk); }
static int cbc_des3_decrypt(struct blkcipher_desc *desc, struct scatterlist *dst, struct scatterlist *src, unsigned int nbytes) { struct blkcipher_walk walk; blkcipher_walk_init(&walk, dst, src, nbytes); return cbc_desall_crypt(desc, KMC_TDEA_192_DECRYPT, &walk); }
C
linux
0