CVE ID
stringlengths
13
43
CVE Page
stringlengths
45
48
CWE ID
stringclasses
90 values
codeLink
stringlengths
46
139
commit_id
stringlengths
6
81
commit_message
stringlengths
3
13.3k
func_after
stringlengths
14
241k
func_before
stringlengths
14
241k
lang
stringclasses
3 values
project
stringclasses
309 values
vul
int8
0
1
CVE-2018-17467
https://www.cvedetails.com/cve/CVE-2018-17467/
CWE-20
https://github.com/chromium/chromium/commit/7da6c3419fd172405bcece1ae4ec6ec8316cd345
7da6c3419fd172405bcece1ae4ec6ec8316cd345
Start rendering timer after first navigation Currently the new content rendering timer in the browser process, which clears an old page's contents 4 seconds after a navigation if the new page doesn't draw in that time, is not set on the first navigation for a top-level frame. This is problematic because content can exist before the first navigation, for instance if it was created by a javascript: URL. This CL removes the code that skips the timer activation on the first navigation. Bug: 844881 Change-Id: I19b3ad1ff62c69ded3a5f7b1c0afde191aaf4584 Reviewed-on: https://chromium-review.googlesource.com/1188589 Reviewed-by: Fady Samuel <fsamuel@chromium.org> Reviewed-by: ccameron <ccameron@chromium.org> Commit-Queue: Ken Buchanan <kenrb@chromium.org> Cr-Commit-Position: refs/heads/master@{#586913}
void RenderWidgetHostImpl::DragTargetDragEnter( const DropData& drop_data, const gfx::PointF& client_pt, const gfx::PointF& screen_pt, WebDragOperationsMask operations_allowed, int key_modifiers) { DragTargetDragEnterWithMetaData(DropDataToMetaData(drop_data), client_pt, screen_pt, operations_allowed, key_modifiers); }
void RenderWidgetHostImpl::DragTargetDragEnter( const DropData& drop_data, const gfx::PointF& client_pt, const gfx::PointF& screen_pt, WebDragOperationsMask operations_allowed, int key_modifiers) { DragTargetDragEnterWithMetaData(DropDataToMetaData(drop_data), client_pt, screen_pt, operations_allowed, key_modifiers); }
C
Chrome
0
CVE-2017-7376
https://www.cvedetails.com/cve/CVE-2017-7376/
CWE-119
https://android.googlesource.com/platform/external/libxml2/+/51e0cb2e5ec18eaf6fb331bc573ff27b743898f4
51e0cb2e5ec18eaf6fb331bc573ff27b743898f4
DO NOT MERGE: Use correct limit for port values no upstream report yet, add it here when we have it issue found & patch by nmehta@ Bug: 36555370 Change-Id: Ibf1efea554b95f514e23e939363d608021de4614 (cherry picked from commit b62884fb49fe92081e414966d9b5fe58250ae53c)
xmlParse3986PathNoScheme(xmlURIPtr uri, const char **str) { const char *cur; int ret; cur = *str; ret = xmlParse3986Segment(&cur, ':', 0); if (ret != 0) return(ret); while (*cur == '/') { cur++; ret = xmlParse3986Segment(&cur, 0, 1); if (ret != 0) return(ret); } if (uri != NULL) { if (uri->path != NULL) xmlFree(uri->path); if (cur != *str) { if (uri->cleanup & 2) uri->path = STRNDUP(*str, cur - *str); else uri->path = xmlURIUnescapeString(*str, cur - *str, NULL); } else { uri->path = NULL; } } *str = cur; return (0); }
xmlParse3986PathNoScheme(xmlURIPtr uri, const char **str) { const char *cur; int ret; cur = *str; ret = xmlParse3986Segment(&cur, ':', 0); if (ret != 0) return(ret); while (*cur == '/') { cur++; ret = xmlParse3986Segment(&cur, 0, 1); if (ret != 0) return(ret); } if (uri != NULL) { if (uri->path != NULL) xmlFree(uri->path); if (cur != *str) { if (uri->cleanup & 2) uri->path = STRNDUP(*str, cur - *str); else uri->path = xmlURIUnescapeString(*str, cur - *str, NULL); } else { uri->path = NULL; } } *str = cur; return (0); }
C
Android
0
CVE-2019-5779
https://www.cvedetails.com/cve/CVE-2019-5779/
CWE-264
https://github.com/chromium/chromium/commit/18c5c5dcef9cfccff64f0c23f920ef22822271a9
18c5c5dcef9cfccff64f0c23f920ef22822271a9
service worker: Make navigate/openWindow go through more security checks. WindowClient.navigate() and Clients.openWindow() were implemented in a way that directly navigated to the URL without going through some checks that the normal navigation path goes through. This CL attempts to fix that: - WindowClient.navigate() now goes through Navigator::RequestOpenURL() instead of directly through WebContents::OpenURL(). - Clients.openWindow() now calls more ContentBrowserClient functions for manipulating the navigation before invoking ContentBrowserClient::OpenURL(). Bug: 904219 Change-Id: Ic38978aee98c09834fdbbc240164068faa3fd4f5 Reviewed-on: https://chromium-review.googlesource.com/c/1345686 Commit-Queue: Matt Falkenhagen <falken@chromium.org> Reviewed-by: Arthur Sonzogni <arthursonzogni@chromium.org> Reviewed-by: Kinuko Yasuda <kinuko@chromium.org> Cr-Commit-Position: refs/heads/master@{#610753}
void ChromeContentBrowserClient::GetAdditionalMappedFilesForChildProcess( const base::CommandLine& command_line, int child_process_id, PosixFileDescriptorInfo* mappings) { #if defined(OS_ANDROID) base::MemoryMappedFile::Region region; int fd = ui::GetMainAndroidPackFd(&region); mappings->ShareWithRegion(kAndroidUIResourcesPakDescriptor, fd, region); fd = ui::GetCommonResourcesPackFd(&region); mappings->ShareWithRegion(kAndroidChrome100PercentPakDescriptor, fd, region); fd = ui::GetLocalePackFd(&region); mappings->ShareWithRegion(kAndroidLocalePakDescriptor, fd, region); fd = ui::GetSecondaryLocalePackFd(&region); if (fd != -1) { mappings->ShareWithRegion(kAndroidSecondaryLocalePakDescriptor, fd, region); } crash_reporter::ChildExitObserver::GetInstance()->BrowserChildProcessStarted( child_process_id, mappings); base::FilePath app_data_path; base::PathService::Get(base::DIR_ANDROID_APP_DATA, &app_data_path); DCHECK(!app_data_path.empty()); #else int crash_signal_fd = GetCrashSignalFD(command_line); if (crash_signal_fd >= 0) { mappings->Share(service_manager::kCrashDumpSignal, crash_signal_fd); } #endif // defined(OS_ANDROID) }
void ChromeContentBrowserClient::GetAdditionalMappedFilesForChildProcess( const base::CommandLine& command_line, int child_process_id, PosixFileDescriptorInfo* mappings) { #if defined(OS_ANDROID) base::MemoryMappedFile::Region region; int fd = ui::GetMainAndroidPackFd(&region); mappings->ShareWithRegion(kAndroidUIResourcesPakDescriptor, fd, region); fd = ui::GetCommonResourcesPackFd(&region); mappings->ShareWithRegion(kAndroidChrome100PercentPakDescriptor, fd, region); fd = ui::GetLocalePackFd(&region); mappings->ShareWithRegion(kAndroidLocalePakDescriptor, fd, region); fd = ui::GetSecondaryLocalePackFd(&region); if (fd != -1) { mappings->ShareWithRegion(kAndroidSecondaryLocalePakDescriptor, fd, region); } crash_reporter::ChildExitObserver::GetInstance()->BrowserChildProcessStarted( child_process_id, mappings); base::FilePath app_data_path; base::PathService::Get(base::DIR_ANDROID_APP_DATA, &app_data_path); DCHECK(!app_data_path.empty()); #else int crash_signal_fd = GetCrashSignalFD(command_line); if (crash_signal_fd >= 0) { mappings->Share(service_manager::kCrashDumpSignal, crash_signal_fd); } #endif // defined(OS_ANDROID) }
C
Chrome
0
CVE-2017-14058
https://www.cvedetails.com/cve/CVE-2017-14058/
CWE-835
https://github.com/FFmpeg/FFmpeg/commit/7ec414892ddcad88313848494b6fc5f437c9ca4a
7ec414892ddcad88313848494b6fc5f437c9ca4a
avformat/hls: Fix DoS due to infinite loop Fixes: loop.m3u The default max iteration count of 1000 is arbitrary and ideas for a better solution are welcome Found-by: Xiaohei and Wangchu from Alibaba Security Team Previous version reviewed-by: Steven Liu <lingjiujianke@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
static void free_rendition_list(HLSContext *c) { int i; for (i = 0; i < c->n_renditions; i++) av_freep(&c->renditions[i]); av_freep(&c->renditions); c->n_renditions = 0; }
static void free_rendition_list(HLSContext *c) { int i; for (i = 0; i < c->n_renditions; i++) av_freep(&c->renditions[i]); av_freep(&c->renditions); c->n_renditions = 0; }
C
FFmpeg
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 <keescook@chromium.org> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
static int crc32_final(struct shash_desc *desc, u8 *out) { u32 *crcp = shash_desc_ctx(desc); *(__le32 *)out = cpu_to_le32p(crcp); return 0; }
static int crc32_final(struct shash_desc *desc, u8 *out) { u32 *crcp = shash_desc_ctx(desc); *(__le32 *)out = cpu_to_le32p(crcp); return 0; }
C
linux
0
CVE-2019-5838
https://www.cvedetails.com/cve/CVE-2019-5838/
CWE-20
https://github.com/chromium/chromium/commit/0660e08731fd42076d7242068e9eaed1482b14d5
0660e08731fd42076d7242068e9eaed1482b14d5
Call CanCaptureVisiblePage in page capture API. Currently the pageCapture permission allows access to arbitrary local files and chrome:// pages which can be a security concern. In order to address this, the page capture API needs to be changed similar to the captureVisibleTab API. The API will now only allow extensions to capture otherwise-restricted URLs if the user has granted activeTab. In addition, file:// URLs are only capturable with the "Allow on file URLs" option enabled. Bug: 893087 Change-Id: I6d6225a3efb70fc033e2e1c031c633869afac624 Reviewed-on: https://chromium-review.googlesource.com/c/1330689 Commit-Queue: Bettina Dea <bdea@chromium.org> Reviewed-by: Devlin <rdevlin.cronin@chromium.org> Reviewed-by: Varun Khaneja <vakh@chromium.org> Cr-Commit-Position: refs/heads/master@{#615248}
const GURL& ExecuteCodeInTabFunction::GetWebViewSrc() const { return GURL::EmptyGURL(); }
const GURL& ExecuteCodeInTabFunction::GetWebViewSrc() const { return GURL::EmptyGURL(); }
C
Chrome
0
CVE-2017-14604
https://www.cvedetails.com/cve/CVE-2017-14604/
CWE-20
https://github.com/GNOME/nautilus/commit/1630f53481f445ada0a455e9979236d31a8d3bb0
1630f53481f445ada0a455e9979236d31a8d3bb0
mime-actions: use file metadata for trusting desktop files Currently we only trust desktop files that have the executable bit set, and don't replace the displayed icon or the displayed name until it's trusted, which prevents for running random programs by a malicious desktop file. However, the executable permission is preserved if the desktop file comes from a compressed file. To prevent this, add a metadata::trusted metadata to the file once the user acknowledges the file as trusted. This adds metadata to the file, which cannot be added unless it has access to the computer. Also remove the SHEBANG "trusted" content we were putting inside the desktop file, since that doesn't add more security since it can come with the file itself. https://bugzilla.gnome.org/show_bug.cgi?id=777991
delete_file_recursively (GFile *file, GCancellable *cancellable, DeleteCallback callback, gpointer callback_data) { gboolean success; g_autoptr (GError) error = NULL; do { g_autoptr (GFileEnumerator) enumerator = NULL; success = g_file_delete (file, cancellable, &error); if (success || !g_error_matches (error, G_IO_ERROR, G_IO_ERROR_NOT_EMPTY)) { break; } g_clear_error (&error); enumerator = g_file_enumerate_children (file, G_FILE_ATTRIBUTE_STANDARD_NAME, G_FILE_QUERY_INFO_NONE, cancellable, &error); if (enumerator) { GFileInfo *info; success = TRUE; info = g_file_enumerator_next_file (enumerator, cancellable, &error); while (info != NULL) { g_autoptr (GFile) child = NULL; child = g_file_enumerator_get_child (enumerator, info); success = success && delete_file_recursively (child, cancellable, callback, callback_data); g_object_unref (info); info = g_file_enumerator_next_file (enumerator, cancellable, &error); } } if (error != NULL) { success = FALSE; } } while (success); if (callback) { callback (file, error, callback_data); } return success; }
delete_file_recursively (GFile *file, GCancellable *cancellable, DeleteCallback callback, gpointer callback_data) { gboolean success; g_autoptr (GError) error = NULL; do { g_autoptr (GFileEnumerator) enumerator = NULL; success = g_file_delete (file, cancellable, &error); if (success || !g_error_matches (error, G_IO_ERROR, G_IO_ERROR_NOT_EMPTY)) { break; } g_clear_error (&error); enumerator = g_file_enumerate_children (file, G_FILE_ATTRIBUTE_STANDARD_NAME, G_FILE_QUERY_INFO_NONE, cancellable, &error); if (enumerator) { GFileInfo *info; success = TRUE; info = g_file_enumerator_next_file (enumerator, cancellable, &error); while (info != NULL) { g_autoptr (GFile) child = NULL; child = g_file_enumerator_get_child (enumerator, info); success = success && delete_file_recursively (child, cancellable, callback, callback_data); g_object_unref (info); info = g_file_enumerator_next_file (enumerator, cancellable, &error); } } if (error != NULL) { success = FALSE; } } while (success); if (callback) { callback (file, error, callback_data); } return success; }
C
nautilus
0
CVE-2018-1000524
https://www.cvedetails.com/cve/CVE-2018-1000524/
CWE-190
https://github.com/fatcerberus/minisphere/commit/252c1ca184cb38e1acb917aa0e451c5f08519996
252c1ca184cb38e1acb917aa0e451c5f08519996
Fix integer overflow in layer_resize in map_engine.c (#268) * Fix integer overflow in layer_resize in map_engine.c There's a buffer overflow bug in the function layer_resize. It allocates a buffer `tilemap` with size `x_size * y_size * sizeof(struct map_tile)`. But it didn't check for integer overflow, so if x_size and y_size are very large, it's possible that the buffer size is smaller than needed, causing a buffer overflow later. PoC: `SetLayerSize(0, 0x7FFFFFFF, 0x7FFFFFFF);` * move malloc to a separate line
person_new(const char* name, spriteset_t* spriteset, bool is_persistent, script_t* create_script) { point3_t origin = map_origin(); person_t* person; if (++s_num_persons > s_max_persons) { s_max_persons = s_num_persons * 2; s_persons = realloc(s_persons, s_max_persons * sizeof(person_t*)); } person = s_persons[s_num_persons - 1] = calloc(1, sizeof(person_t)); person->id = s_next_person_id++; person->sprite = spriteset_ref(spriteset); set_person_name(person, name); person_set_pose(person, spriteset_pose_name(spriteset, 0)); person->is_persistent = is_persistent; person->is_visible = true; person->x = origin.x; person->y = origin.y; person->layer = origin.z; person->speed_x = 1.0; person->speed_y = 1.0; person->anim_frames = spriteset_frame_delay(person->sprite, person->direction, 0); person->mask = mk_color(255, 255, 255, 255); person->scale_x = person->scale_y = 1.0; person->scripts[PERSON_SCRIPT_ON_CREATE] = create_script; person_activate(person, PERSON_SCRIPT_ON_CREATE, NULL, true); sort_persons(); return person; }
person_new(const char* name, spriteset_t* spriteset, bool is_persistent, script_t* create_script) { point3_t origin = map_origin(); person_t* person; if (++s_num_persons > s_max_persons) { s_max_persons = s_num_persons * 2; s_persons = realloc(s_persons, s_max_persons * sizeof(person_t*)); } person = s_persons[s_num_persons - 1] = calloc(1, sizeof(person_t)); person->id = s_next_person_id++; person->sprite = spriteset_ref(spriteset); set_person_name(person, name); person_set_pose(person, spriteset_pose_name(spriteset, 0)); person->is_persistent = is_persistent; person->is_visible = true; person->x = origin.x; person->y = origin.y; person->layer = origin.z; person->speed_x = 1.0; person->speed_y = 1.0; person->anim_frames = spriteset_frame_delay(person->sprite, person->direction, 0); person->mask = mk_color(255, 255, 255, 255); person->scale_x = person->scale_y = 1.0; person->scripts[PERSON_SCRIPT_ON_CREATE] = create_script; person_activate(person, PERSON_SCRIPT_ON_CREATE, NULL, true); sort_persons(); return person; }
C
minisphere
0
CVE-2018-20856
https://www.cvedetails.com/cve/CVE-2018-20856/
CWE-416
https://github.com/torvalds/linux/commit/54648cf1ec2d7f4b6a71767799c45676a138ca24
54648cf1ec2d7f4b6a71767799c45676a138ca24
block: blk_init_allocated_queue() set q->fq as NULL in the fail case We find the memory use-after-free issue in __blk_drain_queue() on the kernel 4.14. After read the latest kernel 4.18-rc6 we think it has the same problem. Memory is allocated for q->fq in the blk_init_allocated_queue(). If the elevator init function called with error return, it will run into the fail case to free the q->fq. Then the __blk_drain_queue() uses the same memory after the free of the q->fq, it will lead to the unpredictable event. The patch is to set q->fq as NULL in the fail case of blk_init_allocated_queue(). Fixes: commit 7c94e1c157a2 ("block: introduce blk_flush_queue to drive flush machinery") Cc: <stable@vger.kernel.org> Reviewed-by: Ming Lei <ming.lei@redhat.com> Reviewed-by: Bart Van Assche <bart.vanassche@wdc.com> Signed-off-by: xiao jin <jin.xiao@intel.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
void blk_rq_init(struct request_queue *q, struct request *rq) { memset(rq, 0, sizeof(*rq)); INIT_LIST_HEAD(&rq->queuelist); INIT_LIST_HEAD(&rq->timeout_list); rq->cpu = -1; rq->q = q; rq->__sector = (sector_t) -1; INIT_HLIST_NODE(&rq->hash); RB_CLEAR_NODE(&rq->rb_node); rq->tag = -1; rq->internal_tag = -1; rq->start_time_ns = ktime_get_ns(); rq->part = NULL; }
void blk_rq_init(struct request_queue *q, struct request *rq) { memset(rq, 0, sizeof(*rq)); INIT_LIST_HEAD(&rq->queuelist); INIT_LIST_HEAD(&rq->timeout_list); rq->cpu = -1; rq->q = q; rq->__sector = (sector_t) -1; INIT_HLIST_NODE(&rq->hash); RB_CLEAR_NODE(&rq->rb_node); rq->tag = -1; rq->internal_tag = -1; rq->start_time_ns = ktime_get_ns(); rq->part = NULL; }
C
linux
0
CVE-2018-16790
https://www.cvedetails.com/cve/CVE-2018-16790/
CWE-125
https://github.com/mongodb/mongo-c-driver/commit/0d9a4d98bfdf4acd2c0138d4aaeb4e2e0934bd84
0d9a4d98bfdf4acd2c0138d4aaeb4e2e0934bd84
Fix for CVE-2018-16790 -- Verify bounds before binary length read. As reported here: https://jira.mongodb.org/browse/CDRIVER-2819, a heap overread occurs due a failure to correctly verify data bounds. In the original check, len - o returns the data left including the sizeof(l) we just read. Instead, the comparison should check against the data left NOT including the binary int32, i.e. just subtype (byte*) instead of int32 subtype (byte*). Added in test for corrupted BSON example.
test_bson_append_binary_deprecated (void) { const static uint8_t binary[] = {'1', '2', '3', '4'}; bson_t *b; bson_t *b2; b = bson_new (); BSON_ASSERT (bson_append_binary ( b, "binary", -1, BSON_SUBTYPE_BINARY_DEPRECATED, binary, 4)); b2 = get_bson ("binary_deprecated.bson"); BSON_ASSERT_BSON_EQUAL (b, b2); bson_destroy (b); bson_destroy (b2); }
test_bson_append_binary_deprecated (void) { const static uint8_t binary[] = {'1', '2', '3', '4'}; bson_t *b; bson_t *b2; b = bson_new (); BSON_ASSERT (bson_append_binary ( b, "binary", -1, BSON_SUBTYPE_BINARY_DEPRECATED, binary, 4)); b2 = get_bson ("binary_deprecated.bson"); BSON_ASSERT_BSON_EQUAL (b, b2); bson_destroy (b); bson_destroy (b2); }
C
mongo-c-driver
0
CVE-2013-2870
https://www.cvedetails.com/cve/CVE-2013-2870/
CWE-399
https://github.com/chromium/chromium/commit/ca8cc70b2de822b939f87effc7c2b83bac280a44
ca8cc70b2de822b939f87effc7c2b83bac280a44
Revert a workaround commit for a Use-After-Free crash. Revert a workaround commit r20158 for a Use-After-Free issue (http://crbug.com/244746) because a cleaner CL r207218 is landed. URLRequestContext does not inherit SupportsWeakPtr now. R=mmenke BUG=244746 Review URL: https://chromiumcodereview.appspot.com/16870008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@207811 0039d316-1c4b-4281-b951-d872f2087c98
int SocketStream::DoResolveProxy() { DCHECK(context_); DCHECK(!pac_request_); next_state_ = STATE_RESOLVE_PROXY_COMPLETE; if (!proxy_url_.is_valid()) { next_state_ = STATE_CLOSE; return ERR_INVALID_ARGUMENT; } return context_->proxy_service()->ResolveProxy( proxy_url_, &proxy_info_, io_callback_, &pac_request_, net_log_); }
int SocketStream::DoResolveProxy() { DCHECK(context_); DCHECK(!pac_request_); next_state_ = STATE_RESOLVE_PROXY_COMPLETE; if (!proxy_url_.is_valid()) { next_state_ = STATE_CLOSE; return ERR_INVALID_ARGUMENT; } return context_->proxy_service()->ResolveProxy( proxy_url_, &proxy_info_, io_callback_, &pac_request_, net_log_); }
C
Chrome
0
CVE-2013-4160
https://www.cvedetails.com/cve/CVE-2013-4160/
null
https://github.com/mm2/Little-CMS/commit/91c2db7f2559be504211b283bc3a2c631d6f06d9
91c2db7f2559be504211b283bc3a2c631d6f06d9
Non happy-path fixes
cmsBool GrowMLUpool(cmsMLU* mlu) { cmsUInt32Number size; void *NewPtr; if (mlu == NULL) return FALSE; if (mlu ->PoolSize == 0) size = 256; else size = mlu ->PoolSize * 2; if (size < mlu ->PoolSize) return FALSE; NewPtr = _cmsRealloc(mlu ->ContextID, mlu ->MemPool, size); if (NewPtr == NULL) return FALSE; mlu ->MemPool = NewPtr; mlu ->PoolSize = size; return TRUE; }
cmsBool GrowMLUpool(cmsMLU* mlu) { cmsUInt32Number size; void *NewPtr; if (mlu == NULL) return FALSE; if (mlu ->PoolSize == 0) size = 256; else size = mlu ->PoolSize * 2; if (size < mlu ->PoolSize) return FALSE; NewPtr = _cmsRealloc(mlu ->ContextID, mlu ->MemPool, size); if (NewPtr == NULL) return FALSE; mlu ->MemPool = NewPtr; mlu ->PoolSize = size; return TRUE; }
C
Little-CMS
0
CVE-2011-4112
https://www.cvedetails.com/cve/CVE-2011-4112/
CWE-264
https://github.com/torvalds/linux/commit/550fd08c2cebad61c548def135f67aba284c6162
550fd08c2cebad61c548def135f67aba284c6162
net: Audit drivers to identify those needing IFF_TX_SKB_SHARING cleared After the last patch, We are left in a state in which only drivers calling ether_setup have IFF_TX_SKB_SHARING set (we assume that drivers touching real hardware call ether_setup for their net_devices and don't hold any state in their skbs. There are a handful of drivers that violate this assumption of course, and need to be fixed up. This patch identifies those drivers, and marks them as not being able to support the safe transmission of skbs by clearning the IFF_TX_SKB_SHARING flag in priv_flags Signed-off-by: Neil Horman <nhorman@tuxdriver.com> CC: Karsten Keil <isdn@linux-pingi.de> CC: "David S. Miller" <davem@davemloft.net> CC: Jay Vosburgh <fubar@us.ibm.com> CC: Andy Gospodarek <andy@greyhouse.net> CC: Patrick McHardy <kaber@trash.net> CC: Krzysztof Halasa <khc@pm.waw.pl> CC: "John W. Linville" <linville@tuxdriver.com> CC: Greg Kroah-Hartman <gregkh@suse.de> CC: Marcel Holtmann <marcel@holtmann.org> CC: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: David S. Miller <davem@davemloft.net>
static u16 aux_setup(struct airo_info *ai, u16 page, u16 offset, u16 *len) { u16 next; OUT4500(ai, AUXPAGE, page); OUT4500(ai, AUXOFF, 0); next = IN4500(ai, AUXDATA); *len = IN4500(ai, AUXDATA)&0xff; if (offset != 4) OUT4500(ai, AUXOFF, offset); return next; }
static u16 aux_setup(struct airo_info *ai, u16 page, u16 offset, u16 *len) { u16 next; OUT4500(ai, AUXPAGE, page); OUT4500(ai, AUXOFF, 0); next = IN4500(ai, AUXDATA); *len = IN4500(ai, AUXDATA)&0xff; if (offset != 4) OUT4500(ai, AUXOFF, offset); return next; }
C
linux
0
CVE-2014-0143
https://www.cvedetails.com/cve/CVE-2014-0143/
CWE-190
https://git.qemu.org/?p=qemu.git;a=commit;h=8f4754ede56e3f9ea3fd7207f4a7c4453e59285b
8f4754ede56e3f9ea3fd7207f4a7c4453e59285b
null
int path_is_absolute(const char *path) { #ifdef _WIN32 /* specific case for names like: "\\.\d:" */ if (is_windows_drive(path) || is_windows_drive_prefix(path)) { return 1; } return (*path == '/' || *path == '\\'); #else return (*path == '/'); #endif }
int path_is_absolute(const char *path) { #ifdef _WIN32 /* specific case for names like: "\\.\d:" */ if (is_windows_drive(path) || is_windows_drive_prefix(path)) { return 1; } return (*path == '/' || *path == '\\'); #else return (*path == '/'); #endif }
C
qemu
0
CVE-2017-10966
https://www.cvedetails.com/cve/CVE-2017-10966/
CWE-416
https://github.com/irssi/irssi/commit/5e26325317c72a04c1610ad952974e206384d291
5e26325317c72a04c1610ad952974e206384d291
Merge branch 'security' into 'master' Security Closes #10 See merge request !17
void nicklist_set_host(CHANNEL_REC *channel, NICK_REC *nick, const char *host) { g_return_if_fail(channel != NULL); g_return_if_fail(nick != NULL); g_return_if_fail(host != NULL); g_free_not_null(nick->host); nick->host = g_strdup(host); signal_emit("nicklist host changed", 2, channel, nick); }
void nicklist_set_host(CHANNEL_REC *channel, NICK_REC *nick, const char *host) { g_return_if_fail(channel != NULL); g_return_if_fail(nick != NULL); g_return_if_fail(host != NULL); g_free_not_null(nick->host); nick->host = g_strdup(host); signal_emit("nicklist host changed", 2, channel, nick); }
C
irssi
0
CVE-2013-2007
https://www.cvedetails.com/cve/CVE-2013-2007/
CWE-264
https://git.qemu.org/?p=qemu.git;a=commit;h=c689b4f1bac352dcfd6ecb9a1d45337de0f1de67
c689b4f1bac352dcfd6ecb9a1d45337de0f1de67
null
static void ga_enable_non_blacklisted(GList *blacklist) { char **list_head, **list; list_head = list = qmp_get_command_list(); while (*list != NULL) { if (g_list_find_custom(blacklist, *list, ga_strcmp) == NULL && !qmp_command_is_enabled(*list)) { g_debug("enabling command: %s", *list); qmp_enable_command(*list); } g_free(*list); list++; } g_free(list_head); }
static void ga_enable_non_blacklisted(GList *blacklist) { char **list_head, **list; list_head = list = qmp_get_command_list(); while (*list != NULL) { if (g_list_find_custom(blacklist, *list, ga_strcmp) == NULL && !qmp_command_is_enabled(*list)) { g_debug("enabling command: %s", *list); qmp_enable_command(*list); } g_free(*list); list++; } g_free(list_head); }
C
qemu
0
CVE-2016-2315
https://www.cvedetails.com/cve/CVE-2016-2315/
CWE-119
https://github.com/git/git/commit/34fa79a6cde56d6d428ab0d3160cb094ebad3305
34fa79a6cde56d6d428ab0d3160cb094ebad3305
prefer memcpy to strcpy When we already know the length of a string (e.g., because we just malloc'd to fit it), it's nicer to use memcpy than strcpy, as it makes it more obvious that we are not going to overflow the buffer (because the size we pass matches the size in the allocation). This also eliminates calls to strcpy, which make auditing the code base harder. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
static struct object_entry *find_object(unsigned char *sha1) { unsigned int h = sha1[0] << 8 | sha1[1]; struct object_entry *e; for (e = object_table[h]; e; e = e->next) if (!hashcmp(sha1, e->idx.sha1)) return e; return NULL; }
static struct object_entry *find_object(unsigned char *sha1) { unsigned int h = sha1[0] << 8 | sha1[1]; struct object_entry *e; for (e = object_table[h]; e; e = e->next) if (!hashcmp(sha1, e->idx.sha1)) return e; return NULL; }
C
git
0
CVE-2013-6621
https://www.cvedetails.com/cve/CVE-2013-6621/
CWE-399
https://github.com/chromium/chromium/commit/4039d2fcaab746b6c20017ba9bb51c3a2403a76c
4039d2fcaab746b6c20017ba9bb51c3a2403a76c
Add logging to figure out which IPC we're failing to deserialize in RenderFrame. BUG=369553 R=creis@chromium.org Review URL: https://codereview.chromium.org/263833020 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@268565 0039d316-1c4b-4281-b951-d872f2087c98
void RenderFrameImpl::PepperCaretPositionChanged( PepperPluginInstanceImpl* instance) { if (instance != render_view_->focused_pepper_plugin()) return; GetRenderWidget()->UpdateSelectionBounds(); }
void RenderFrameImpl::PepperCaretPositionChanged( PepperPluginInstanceImpl* instance) { if (instance != render_view_->focused_pepper_plugin()) return; GetRenderWidget()->UpdateSelectionBounds(); }
C
Chrome
0
CVE-2016-7913
https://www.cvedetails.com/cve/CVE-2016-7913/
CWE-416
https://github.com/torvalds/linux/commit/8dfbcc4351a0b6d2f2d77f367552f48ffefafe18
8dfbcc4351a0b6d2f2d77f367552f48ffefafe18
[media] xc2028: avoid use after free If struct xc2028_config is passed without a firmware name, the following trouble may happen: [11009.907205] xc2028 5-0061: type set to XCeive xc2028/xc3028 tuner [11009.907491] ================================================================== [11009.907750] BUG: KASAN: use-after-free in strcmp+0x96/0xb0 at addr ffff8803bd78ab40 [11009.907992] Read of size 1 by task modprobe/28992 [11009.907994] ============================================================================= [11009.907997] BUG kmalloc-16 (Tainted: G W ): kasan: bad access detected [11009.907999] ----------------------------------------------------------------------------- [11009.908008] INFO: Allocated in xhci_urb_enqueue+0x214/0x14c0 [xhci_hcd] age=0 cpu=3 pid=28992 [11009.908012] ___slab_alloc+0x581/0x5b0 [11009.908014] __slab_alloc+0x51/0x90 [11009.908017] __kmalloc+0x27b/0x350 [11009.908022] xhci_urb_enqueue+0x214/0x14c0 [xhci_hcd] [11009.908026] usb_hcd_submit_urb+0x1e8/0x1c60 [11009.908029] usb_submit_urb+0xb0e/0x1200 [11009.908032] usb_serial_generic_write_start+0xb6/0x4c0 [11009.908035] usb_serial_generic_write+0x92/0xc0 [11009.908039] usb_console_write+0x38a/0x560 [11009.908045] call_console_drivers.constprop.14+0x1ee/0x2c0 [11009.908051] console_unlock+0x40d/0x900 [11009.908056] vprintk_emit+0x4b4/0x830 [11009.908061] vprintk_default+0x1f/0x30 [11009.908064] printk+0x99/0xb5 [11009.908067] kasan_report_error+0x10a/0x550 [11009.908070] __asan_report_load1_noabort+0x43/0x50 [11009.908074] INFO: Freed in xc2028_set_config+0x90/0x630 [tuner_xc2028] age=1 cpu=3 pid=28992 [11009.908077] __slab_free+0x2ec/0x460 [11009.908080] kfree+0x266/0x280 [11009.908083] xc2028_set_config+0x90/0x630 [tuner_xc2028] [11009.908086] xc2028_attach+0x310/0x8a0 [tuner_xc2028] [11009.908090] em28xx_attach_xc3028.constprop.7+0x1f9/0x30d [em28xx_dvb] [11009.908094] em28xx_dvb_init.part.3+0x8e4/0x5cf4 [em28xx_dvb] [11009.908098] em28xx_dvb_init+0x81/0x8a [em28xx_dvb] [11009.908101] em28xx_register_extension+0xd9/0x190 [em28xx] [11009.908105] em28xx_dvb_register+0x10/0x1000 [em28xx_dvb] [11009.908108] do_one_initcall+0x141/0x300 [11009.908111] do_init_module+0x1d0/0x5ad [11009.908114] load_module+0x6666/0x9ba0 [11009.908117] SyS_finit_module+0x108/0x130 [11009.908120] entry_SYSCALL_64_fastpath+0x16/0x76 [11009.908123] INFO: Slab 0xffffea000ef5e280 objects=25 used=25 fp=0x (null) flags=0x2ffff8000004080 [11009.908126] INFO: Object 0xffff8803bd78ab40 @offset=2880 fp=0x0000000000000001 [11009.908130] Bytes b4 ffff8803bd78ab30: 01 00 00 00 2a 07 00 00 9d 28 00 00 01 00 00 00 ....*....(...... [11009.908133] Object ffff8803bd78ab40: 01 00 00 00 00 00 00 00 b0 1d c3 6a 00 88 ff ff ...........j.... [11009.908137] CPU: 3 PID: 28992 Comm: modprobe Tainted: G B W 4.5.0-rc1+ #43 [11009.908140] Hardware name: /NUC5i7RYB, BIOS RYBDWi35.86A.0350.2015.0812.1722 08/12/2015 [11009.908142] ffff8803bd78a000 ffff8802c273f1b8 ffffffff81932007 ffff8803c6407a80 [11009.908148] ffff8802c273f1e8 ffffffff81556759 ffff8803c6407a80 ffffea000ef5e280 [11009.908153] ffff8803bd78ab40 dffffc0000000000 ffff8802c273f210 ffffffff8155ccb4 [11009.908158] Call Trace: [11009.908162] [<ffffffff81932007>] dump_stack+0x4b/0x64 [11009.908165] [<ffffffff81556759>] print_trailer+0xf9/0x150 [11009.908168] [<ffffffff8155ccb4>] object_err+0x34/0x40 [11009.908171] [<ffffffff8155f260>] kasan_report_error+0x230/0x550 [11009.908175] [<ffffffff81237d71>] ? trace_hardirqs_off_caller+0x21/0x290 [11009.908179] [<ffffffff8155e926>] ? kasan_unpoison_shadow+0x36/0x50 [11009.908182] [<ffffffff8155f5c3>] __asan_report_load1_noabort+0x43/0x50 [11009.908185] [<ffffffff8155ea00>] ? __asan_register_globals+0x50/0xa0 [11009.908189] [<ffffffff8194cea6>] ? strcmp+0x96/0xb0 [11009.908192] [<ffffffff8194cea6>] strcmp+0x96/0xb0 [11009.908196] [<ffffffffa13ba4ac>] xc2028_set_config+0x15c/0x630 [tuner_xc2028] [11009.908200] [<ffffffffa13bac90>] xc2028_attach+0x310/0x8a0 [tuner_xc2028] [11009.908203] [<ffffffff8155ea78>] ? memset+0x28/0x30 [11009.908206] [<ffffffffa13ba980>] ? xc2028_set_config+0x630/0x630 [tuner_xc2028] [11009.908211] [<ffffffffa157a59a>] em28xx_attach_xc3028.constprop.7+0x1f9/0x30d [em28xx_dvb] [11009.908215] [<ffffffffa157aa2a>] ? em28xx_dvb_init.part.3+0x37c/0x5cf4 [em28xx_dvb] [11009.908219] [<ffffffffa157a3a1>] ? hauppauge_hvr930c_init+0x487/0x487 [em28xx_dvb] [11009.908222] [<ffffffffa01795ac>] ? lgdt330x_attach+0x1cc/0x370 [lgdt330x] [11009.908226] [<ffffffffa01793e0>] ? i2c_read_demod_bytes.isra.2+0x210/0x210 [lgdt330x] [11009.908230] [<ffffffff812e87d0>] ? ref_module.part.15+0x10/0x10 [11009.908233] [<ffffffff812e56e0>] ? module_assert_mutex_or_preempt+0x80/0x80 [11009.908238] [<ffffffffa157af92>] em28xx_dvb_init.part.3+0x8e4/0x5cf4 [em28xx_dvb] [11009.908242] [<ffffffffa157a6ae>] ? em28xx_attach_xc3028.constprop.7+0x30d/0x30d [em28xx_dvb] [11009.908245] [<ffffffff8195222d>] ? string+0x14d/0x1f0 [11009.908249] [<ffffffff8195381f>] ? symbol_string+0xff/0x1a0 [11009.908253] [<ffffffff81953720>] ? uuid_string+0x6f0/0x6f0 [11009.908257] [<ffffffff811a775e>] ? __kernel_text_address+0x7e/0xa0 [11009.908260] [<ffffffff8104b02f>] ? print_context_stack+0x7f/0xf0 [11009.908264] [<ffffffff812e9846>] ? __module_address+0xb6/0x360 [11009.908268] [<ffffffff8137fdc9>] ? is_ftrace_trampoline+0x99/0xe0 [11009.908271] [<ffffffff811a775e>] ? __kernel_text_address+0x7e/0xa0 [11009.908275] [<ffffffff81240a70>] ? debug_check_no_locks_freed+0x290/0x290 [11009.908278] [<ffffffff8104a24b>] ? dump_trace+0x11b/0x300 [11009.908282] [<ffffffffa13e8143>] ? em28xx_register_extension+0x23/0x190 [em28xx] [11009.908285] [<ffffffff81237d71>] ? trace_hardirqs_off_caller+0x21/0x290 [11009.908289] [<ffffffff8123ff56>] ? trace_hardirqs_on_caller+0x16/0x590 [11009.908292] [<ffffffff812404dd>] ? trace_hardirqs_on+0xd/0x10 [11009.908296] [<ffffffffa13e8143>] ? em28xx_register_extension+0x23/0x190 [em28xx] [11009.908299] [<ffffffff822dcbb0>] ? mutex_trylock+0x400/0x400 [11009.908302] [<ffffffff810021a1>] ? do_one_initcall+0x131/0x300 [11009.908306] [<ffffffff81296dc7>] ? call_rcu_sched+0x17/0x20 [11009.908309] [<ffffffff8159e708>] ? put_object+0x48/0x70 [11009.908314] [<ffffffffa1579f11>] em28xx_dvb_init+0x81/0x8a [em28xx_dvb] [11009.908317] [<ffffffffa13e81f9>] em28xx_register_extension+0xd9/0x190 [em28xx] [11009.908320] [<ffffffffa0150000>] ? 0xffffffffa0150000 [11009.908324] [<ffffffffa0150010>] em28xx_dvb_register+0x10/0x1000 [em28xx_dvb] [11009.908327] [<ffffffff810021b1>] do_one_initcall+0x141/0x300 [11009.908330] [<ffffffff81002070>] ? try_to_run_init_process+0x40/0x40 [11009.908333] [<ffffffff8123ff56>] ? trace_hardirqs_on_caller+0x16/0x590 [11009.908337] [<ffffffff8155e926>] ? kasan_unpoison_shadow+0x36/0x50 [11009.908340] [<ffffffff8155e926>] ? kasan_unpoison_shadow+0x36/0x50 [11009.908343] [<ffffffff8155e926>] ? kasan_unpoison_shadow+0x36/0x50 [11009.908346] [<ffffffff8155ea37>] ? __asan_register_globals+0x87/0xa0 [11009.908350] [<ffffffff8144da7b>] do_init_module+0x1d0/0x5ad [11009.908353] [<ffffffff812f2626>] load_module+0x6666/0x9ba0 [11009.908356] [<ffffffff812e9c90>] ? symbol_put_addr+0x50/0x50 [11009.908361] [<ffffffffa1580037>] ? em28xx_dvb_init.part.3+0x5989/0x5cf4 [em28xx_dvb] [11009.908366] [<ffffffff812ebfc0>] ? module_frob_arch_sections+0x20/0x20 [11009.908369] [<ffffffff815bc940>] ? open_exec+0x50/0x50 [11009.908374] [<ffffffff811671bb>] ? ns_capable+0x5b/0xd0 [11009.908377] [<ffffffff812f5e58>] SyS_finit_module+0x108/0x130 [11009.908379] [<ffffffff812f5d50>] ? SyS_init_module+0x1f0/0x1f0 [11009.908383] [<ffffffff81004044>] ? lockdep_sys_exit_thunk+0x12/0x14 [11009.908394] [<ffffffff822e6936>] entry_SYSCALL_64_fastpath+0x16/0x76 [11009.908396] Memory state around the buggy address: [11009.908398] ffff8803bd78aa00: 00 00 fc fc fc fc fc fc fc fc fc fc fc fc fc fc [11009.908401] ffff8803bd78aa80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [11009.908403] >ffff8803bd78ab00: fc fc fc fc fc fc fc fc 00 00 fc fc fc fc fc fc [11009.908405] ^ [11009.908407] ffff8803bd78ab80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [11009.908409] ffff8803bd78ac00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [11009.908411] ================================================================== In order to avoid it, let's set the cached value of the firmware name to NULL after freeing it. While here, return an error if the memory allocation fails. Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
static int load_firmware(struct dvb_frontend *fe, unsigned int type, v4l2_std_id *id) { struct xc2028_data *priv = fe->tuner_priv; int pos, rc; unsigned char *p, *endp, buf[MAX_XFER_SIZE]; if (priv->ctrl.max_len > sizeof(buf)) priv->ctrl.max_len = sizeof(buf); tuner_dbg("%s called\n", __func__); pos = seek_firmware(fe, type, id); if (pos < 0) return pos; tuner_info("Loading firmware for type="); dump_firm_type(priv->firm[pos].type); printk("(%x), id %016llx.\n", priv->firm[pos].type, (unsigned long long)*id); p = priv->firm[pos].ptr; endp = p + priv->firm[pos].size; while (p < endp) { __u16 size; /* Checks if there's enough bytes to read */ if (p + sizeof(size) > endp) { tuner_err("Firmware chunk size is wrong\n"); return -EINVAL; } size = le16_to_cpu(*(__le16 *) p); p += sizeof(size); if (size == 0xffff) return 0; if (!size) { /* Special callback command received */ rc = do_tuner_callback(fe, XC2028_TUNER_RESET, 0); if (rc < 0) { tuner_err("Error at RESET code %d\n", (*p) & 0x7f); return -EINVAL; } continue; } if (size >= 0xff00) { switch (size) { case 0xff00: rc = do_tuner_callback(fe, XC2028_RESET_CLK, 0); if (rc < 0) { tuner_err("Error at RESET code %d\n", (*p) & 0x7f); return -EINVAL; } break; default: tuner_info("Invalid RESET code %d\n", size & 0x7f); return -EINVAL; } continue; } /* Checks for a sleep command */ if (size & 0x8000) { msleep(size & 0x7fff); continue; } if ((size + p > endp)) { tuner_err("missing bytes: need %d, have %d\n", size, (int)(endp - p)); return -EINVAL; } buf[0] = *p; p++; size--; /* Sends message chunks */ while (size > 0) { int len = (size < priv->ctrl.max_len - 1) ? size : priv->ctrl.max_len - 1; memcpy(buf + 1, p, len); rc = i2c_send(priv, buf, len + 1); if (rc < 0) { tuner_err("%d returned from send\n", rc); return -EINVAL; } p += len; size -= len; } /* silently fail if the frontend doesn't support I2C flush */ rc = do_tuner_callback(fe, XC2028_I2C_FLUSH, 0); if ((rc < 0) && (rc != -EINVAL)) { tuner_err("error executing flush: %d\n", rc); return rc; } } return 0; }
static int load_firmware(struct dvb_frontend *fe, unsigned int type, v4l2_std_id *id) { struct xc2028_data *priv = fe->tuner_priv; int pos, rc; unsigned char *p, *endp, buf[MAX_XFER_SIZE]; if (priv->ctrl.max_len > sizeof(buf)) priv->ctrl.max_len = sizeof(buf); tuner_dbg("%s called\n", __func__); pos = seek_firmware(fe, type, id); if (pos < 0) return pos; tuner_info("Loading firmware for type="); dump_firm_type(priv->firm[pos].type); printk("(%x), id %016llx.\n", priv->firm[pos].type, (unsigned long long)*id); p = priv->firm[pos].ptr; endp = p + priv->firm[pos].size; while (p < endp) { __u16 size; /* Checks if there's enough bytes to read */ if (p + sizeof(size) > endp) { tuner_err("Firmware chunk size is wrong\n"); return -EINVAL; } size = le16_to_cpu(*(__le16 *) p); p += sizeof(size); if (size == 0xffff) return 0; if (!size) { /* Special callback command received */ rc = do_tuner_callback(fe, XC2028_TUNER_RESET, 0); if (rc < 0) { tuner_err("Error at RESET code %d\n", (*p) & 0x7f); return -EINVAL; } continue; } if (size >= 0xff00) { switch (size) { case 0xff00: rc = do_tuner_callback(fe, XC2028_RESET_CLK, 0); if (rc < 0) { tuner_err("Error at RESET code %d\n", (*p) & 0x7f); return -EINVAL; } break; default: tuner_info("Invalid RESET code %d\n", size & 0x7f); return -EINVAL; } continue; } /* Checks for a sleep command */ if (size & 0x8000) { msleep(size & 0x7fff); continue; } if ((size + p > endp)) { tuner_err("missing bytes: need %d, have %d\n", size, (int)(endp - p)); return -EINVAL; } buf[0] = *p; p++; size--; /* Sends message chunks */ while (size > 0) { int len = (size < priv->ctrl.max_len - 1) ? size : priv->ctrl.max_len - 1; memcpy(buf + 1, p, len); rc = i2c_send(priv, buf, len + 1); if (rc < 0) { tuner_err("%d returned from send\n", rc); return -EINVAL; } p += len; size -= len; } /* silently fail if the frontend doesn't support I2C flush */ rc = do_tuner_callback(fe, XC2028_I2C_FLUSH, 0); if ((rc < 0) && (rc != -EINVAL)) { tuner_err("error executing flush: %d\n", rc); return rc; } } return 0; }
C
linux
0
CVE-2011-4131
https://www.cvedetails.com/cve/CVE-2011-4131/
CWE-189
https://github.com/torvalds/linux/commit/bf118a342f10dafe44b14451a1392c3254629a1f
bf118a342f10dafe44b14451a1392c3254629a1f
NFSv4: include bitmap in nfsv4 get acl data The NFSv4 bitmap size is unbounded: a server can return an arbitrary sized bitmap in an FATTR4_WORD0_ACL request. Replace using the nfs4_fattr_bitmap_maxsz as a guess to the maximum bitmask returned by a server with the inclusion of the bitmap (xdr length plus bitmasks) and the acl data xdr length to the (cached) acl page data. This is a general solution to commit e5012d1f "NFSv4.1: update nfs4_fattr_bitmap_maxsz" and fixes hitting a BUG_ON in xdr_shrink_bufhead when getting ACLs. Fix a bug in decode_getacl that returned -EINVAL on ACLs > page when getxattr was called with a NULL buffer, preventing ACL > PAGE_SIZE from being retrieved. Cc: stable@kernel.org Signed-off-by: Andy Adamson <andros@netapp.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
xdr_terminate_string(struct xdr_buf *buf, const u32 len) { char *kaddr; kaddr = kmap_atomic(buf->pages[0], KM_USER0); kaddr[buf->page_base + len] = '\0'; kunmap_atomic(kaddr, KM_USER0); }
xdr_terminate_string(struct xdr_buf *buf, const u32 len) { char *kaddr; kaddr = kmap_atomic(buf->pages[0], KM_USER0); kaddr[buf->page_base + len] = '\0'; kunmap_atomic(kaddr, KM_USER0); }
C
linux
0
CVE-2016-7799
https://www.cvedetails.com/cve/CVE-2016-7799/
CWE-125
https://github.com/ImageMagick/ImageMagick/commit/a7bb158b7bedd1449a34432feb3a67c8f1873bfa
a7bb158b7bedd1449a34432feb3a67c8f1873bfa
https://github.com/ImageMagick/ImageMagick/issues/280
MagickExport char *GetNextImageProfile(const Image *image) { assert(image != (Image *) NULL); assert(image->signature == MagickCoreSignature); if (image->debug != MagickFalse) (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename); if (image->profiles == (SplayTreeInfo *) NULL) return((char *) NULL); return((char *) GetNextKeyInSplayTree((SplayTreeInfo *) image->profiles)); }
MagickExport char *GetNextImageProfile(const Image *image) { assert(image != (Image *) NULL); assert(image->signature == MagickCoreSignature); if (image->debug != MagickFalse) (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename); if (image->profiles == (SplayTreeInfo *) NULL) return((char *) NULL); return((char *) GetNextKeyInSplayTree((SplayTreeInfo *) image->profiles)); }
C
ImageMagick
0
CVE-2016-5219
https://www.cvedetails.com/cve/CVE-2016-5219/
CWE-416
https://github.com/chromium/chromium/commit/a4150b688a754d3d10d2ca385155b1c95d77d6ae
a4150b688a754d3d10d2ca385155b1c95d77d6ae
Add GL_PROGRAM_COMPLETION_QUERY_CHROMIUM This makes the query of GL_COMPLETION_STATUS_KHR to programs much cheaper by minimizing the round-trip to the GPU thread. Bug: 881152, 957001 Change-Id: Iadfa798af29225e752c710ca5c25f50b3dd3101a Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1586630 Commit-Queue: Kenneth Russell <kbr@chromium.org> Reviewed-by: Kentaro Hara <haraken@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Kenneth Russell <kbr@chromium.org> Cr-Commit-Position: refs/heads/master@{#657568}
void GLES2Implementation::Finish() { GPU_CLIENT_SINGLE_THREAD_CHECK(); flush_id_ = GenerateNextFlushId(); FinishHelper(); }
void GLES2Implementation::Finish() { GPU_CLIENT_SINGLE_THREAD_CHECK(); flush_id_ = GenerateNextFlushId(); FinishHelper(); }
C
Chrome
0
CVE-2015-3835
https://www.cvedetails.com/cve/CVE-2015-3835/
CWE-119
https://android.googlesource.com/platform/frameworks/av/+/3cb1b6944e776863aea316e25fdc16d7f9962902
3cb1b6944e776863aea316e25fdc16d7f9962902
IOMX: Enable buffer ptr to buffer id translation for arm32 Bug: 20634516 Change-Id: Iac9eac3cb251eccd9bbad5df7421a07edc21da0c (cherry picked from commit 2d6b6601743c3c6960c6511a2cb774ef902759f4)
status_t OMXNodeInstance::emptyBuffer_l( OMX_BUFFERHEADERTYPE *header, OMX_U32 flags, OMX_TICKS timestamp, intptr_t debugAddr) { header->nFlags = flags; header->nTimeStamp = timestamp; { Mutex::Autolock _l(mDebugLock); mInputBuffersWithCodec.add(header); if ((flags & OMX_BUFFERFLAG_CODECCONFIG) != 0) { bumpDebugLevel_l(2 /* numInputBuffers */, 0 /* numOutputBuffers */); } CLOG_BUMPED_BUFFER(emptyBuffer, WITH_STATS(FULL_BUFFER(debugAddr, header))); } OMX_ERRORTYPE err = OMX_EmptyThisBuffer(mHandle, header); CLOG_IF_ERROR(emptyBuffer, err, FULL_BUFFER(debugAddr, header)); { Mutex::Autolock _l(mDebugLock); if (err != OMX_ErrorNone) { mInputBuffersWithCodec.remove(header); } else if (!(flags & OMX_BUFFERFLAG_CODECCONFIG)) { unbumpDebugLevel_l(kPortIndexInput); } } return StatusFromOMXError(err); }
status_t OMXNodeInstance::emptyBuffer_l( OMX_BUFFERHEADERTYPE *header, OMX_U32 flags, OMX_TICKS timestamp, intptr_t debugAddr) { header->nFlags = flags; header->nTimeStamp = timestamp; { Mutex::Autolock _l(mDebugLock); mInputBuffersWithCodec.add(header); if ((flags & OMX_BUFFERFLAG_CODECCONFIG) != 0) { bumpDebugLevel_l(2 /* numInputBuffers */, 0 /* numOutputBuffers */); } CLOG_BUMPED_BUFFER(emptyBuffer, WITH_STATS(FULL_BUFFER(debugAddr, header))); } OMX_ERRORTYPE err = OMX_EmptyThisBuffer(mHandle, header); CLOG_IF_ERROR(emptyBuffer, err, FULL_BUFFER(debugAddr, header)); { Mutex::Autolock _l(mDebugLock); if (err != OMX_ErrorNone) { mInputBuffersWithCodec.remove(header); } else if (!(flags & OMX_BUFFERFLAG_CODECCONFIG)) { unbumpDebugLevel_l(kPortIndexInput); } } return StatusFromOMXError(err); }
C
Android
0
CVE-2011-2496
https://www.cvedetails.com/cve/CVE-2011-2496/
CWE-189
https://github.com/torvalds/linux/commit/982134ba62618c2d69fbbbd166d0a11ee3b7e3d8
982134ba62618c2d69fbbbd166d0a11ee3b7e3d8
mm: avoid wrapping vm_pgoff in mremap() The normal mmap paths all avoid creating a mapping where the pgoff inside the mapping could wrap around due to overflow. However, an expanding mremap() can take such a non-wrapping mapping and make it bigger and cause a wrapping condition. Noticed by Robert Swiecki when running a system call fuzzer, where it caused a BUG_ON() due to terminally confusing the vma_prio_tree code. A vma dumping patch by Hugh then pinpointed the crazy wrapped case. Reported-and-tested-by: Robert Swiecki <robert@swiecki.net> Acked-by: Hugh Dickins <hughd@google.com> Cc: stable@kernel.org Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
static unsigned long mremap_to(unsigned long addr, unsigned long old_len, unsigned long new_addr, unsigned long new_len) { struct mm_struct *mm = current->mm; struct vm_area_struct *vma; unsigned long ret = -EINVAL; unsigned long charged = 0; unsigned long map_flags; if (new_addr & ~PAGE_MASK) goto out; if (new_len > TASK_SIZE || new_addr > TASK_SIZE - new_len) goto out; /* Check if the location we're moving into overlaps the * old location at all, and fail if it does. */ if ((new_addr <= addr) && (new_addr+new_len) > addr) goto out; if ((addr <= new_addr) && (addr+old_len) > new_addr) goto out; ret = security_file_mmap(NULL, 0, 0, 0, new_addr, 1); if (ret) goto out; ret = do_munmap(mm, new_addr, new_len); if (ret) goto out; if (old_len >= new_len) { ret = do_munmap(mm, addr+new_len, old_len - new_len); if (ret && old_len != new_len) goto out; old_len = new_len; } vma = vma_to_resize(addr, old_len, new_len, &charged); if (IS_ERR(vma)) { ret = PTR_ERR(vma); goto out; } map_flags = MAP_FIXED; if (vma->vm_flags & VM_MAYSHARE) map_flags |= MAP_SHARED; ret = get_unmapped_area(vma->vm_file, new_addr, new_len, vma->vm_pgoff + ((addr - vma->vm_start) >> PAGE_SHIFT), map_flags); if (ret & ~PAGE_MASK) goto out1; ret = move_vma(vma, addr, old_len, new_len, new_addr); if (!(ret & ~PAGE_MASK)) goto out; out1: vm_unacct_memory(charged); out: return ret; }
static unsigned long mremap_to(unsigned long addr, unsigned long old_len, unsigned long new_addr, unsigned long new_len) { struct mm_struct *mm = current->mm; struct vm_area_struct *vma; unsigned long ret = -EINVAL; unsigned long charged = 0; unsigned long map_flags; if (new_addr & ~PAGE_MASK) goto out; if (new_len > TASK_SIZE || new_addr > TASK_SIZE - new_len) goto out; /* Check if the location we're moving into overlaps the * old location at all, and fail if it does. */ if ((new_addr <= addr) && (new_addr+new_len) > addr) goto out; if ((addr <= new_addr) && (addr+old_len) > new_addr) goto out; ret = security_file_mmap(NULL, 0, 0, 0, new_addr, 1); if (ret) goto out; ret = do_munmap(mm, new_addr, new_len); if (ret) goto out; if (old_len >= new_len) { ret = do_munmap(mm, addr+new_len, old_len - new_len); if (ret && old_len != new_len) goto out; old_len = new_len; } vma = vma_to_resize(addr, old_len, new_len, &charged); if (IS_ERR(vma)) { ret = PTR_ERR(vma); goto out; } map_flags = MAP_FIXED; if (vma->vm_flags & VM_MAYSHARE) map_flags |= MAP_SHARED; ret = get_unmapped_area(vma->vm_file, new_addr, new_len, vma->vm_pgoff + ((addr - vma->vm_start) >> PAGE_SHIFT), map_flags); if (ret & ~PAGE_MASK) goto out1; ret = move_vma(vma, addr, old_len, new_len, new_addr); if (!(ret & ~PAGE_MASK)) goto out; out1: vm_unacct_memory(charged); out: return ret; }
C
linux
0
CVE-2017-0635
https://www.cvedetails.com/cve/CVE-2017-0635/
CWE-476
https://android.googlesource.com/platform/frameworks/av/+/523f6b49c1a2289161f40cf9fe80b92e592e9441
523f6b49c1a2289161f40cf9fe80b92e592e9441
Validate lengths in HEVC metadata parsing Add code to validate the size parameter passed to HecvParameterSets::addNalUnit(). Previously vulnerable to decrementing an unsigned past 0, yielding a huge result value. Bug: 35467107 Test: ran POC, no crash, emitted new "bad length" log entry Change-Id: Ia169b9edc1e0f7c5302e3c68aa90a54e8863d79e (cherry picked from commit e0dcf097cc029d056926029a29419e1650cbdf1b)
size_t HevcParameterSets::getSize(size_t index) { CHECK_LT(index, mNalUnits.size()); return mNalUnits[index]->size(); }
size_t HevcParameterSets::getSize(size_t index) { CHECK_LT(index, mNalUnits.size()); return mNalUnits[index]->size(); }
C
Android
0
CVE-2012-2821
https://www.cvedetails.com/cve/CVE-2012-2821/
null
https://github.com/chromium/chromium/commit/6be59593779ed9954710589f00b0bc107d05c536
6be59593779ed9954710589f00b0bc107d05c536
Mark IndexedDBBrowserTest.ClearLocalState and IndexedDBBrowserTest.SaveSessionState as flaky. BUG=115188 TEST= TBR=dgrogan@chromium.org Review URL: https://chromiumcodereview.appspot.com/9416079 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@122925 0039d316-1c4b-4281-b951-d872f2087c98
virtual void SetUpOnMainThread() { const int kInitialQuotaKilobytes = 5000; const int kTemporaryStorageQuotaMaxSize = kInitialQuotaKilobytes * 1024 * QuotaManager::kPerHostTemporaryPortion; SetTempQuota( kTemporaryStorageQuotaMaxSize, content::BrowserContext::GetQuotaManager(browser()->profile())); }
virtual void SetUpOnMainThread() { const int kInitialQuotaKilobytes = 5000; const int kTemporaryStorageQuotaMaxSize = kInitialQuotaKilobytes * 1024 * QuotaManager::kPerHostTemporaryPortion; SetTempQuota( kTemporaryStorageQuotaMaxSize, content::BrowserContext::GetQuotaManager(browser()->profile())); }
C
Chrome
0
CVE-2012-3364
https://www.cvedetails.com/cve/CVE-2012-3364/
CWE-119
https://github.com/torvalds/linux/commit/67de956ff5dc1d4f321e16cfbd63f5be3b691b43
67de956ff5dc1d4f321e16cfbd63f5be3b691b43
NFC: Prevent multiple buffer overflows in NCI Fix multiple remotely-exploitable stack-based buffer overflows due to the NCI code pulling length fields directly from incoming frames and copying too much data into statically-sized arrays. Signed-off-by: Dan Rosenberg <dan.j.rosenberg@gmail.com> Cc: stable@kernel.org Cc: security@kernel.org Cc: Lauro Ramos Venancio <lauro.venancio@openbossa.org> Cc: Aloisio Almeida Jr <aloisio.almeida@openbossa.org> Cc: Samuel Ortiz <sameo@linux.intel.com> Cc: David S. Miller <davem@davemloft.net> Acked-by: Ilan Elias <ilane@ti.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
static void nci_core_conn_credits_ntf_packet(struct nci_dev *ndev, struct sk_buff *skb) { struct nci_core_conn_credit_ntf *ntf = (void *) skb->data; int i; pr_debug("num_entries %d\n", ntf->num_entries); if (ntf->num_entries > NCI_MAX_NUM_CONN) ntf->num_entries = NCI_MAX_NUM_CONN; /* update the credits */ for (i = 0; i < ntf->num_entries; i++) { ntf->conn_entries[i].conn_id = nci_conn_id(&ntf->conn_entries[i].conn_id); pr_debug("entry[%d]: conn_id %d, credits %d\n", i, ntf->conn_entries[i].conn_id, ntf->conn_entries[i].credits); if (ntf->conn_entries[i].conn_id == NCI_STATIC_RF_CONN_ID) { /* found static rf connection */ atomic_add(ntf->conn_entries[i].credits, &ndev->credits_cnt); } } /* trigger the next tx */ if (!skb_queue_empty(&ndev->tx_q)) queue_work(ndev->tx_wq, &ndev->tx_work); }
static void nci_core_conn_credits_ntf_packet(struct nci_dev *ndev, struct sk_buff *skb) { struct nci_core_conn_credit_ntf *ntf = (void *) skb->data; int i; pr_debug("num_entries %d\n", ntf->num_entries); if (ntf->num_entries > NCI_MAX_NUM_CONN) ntf->num_entries = NCI_MAX_NUM_CONN; /* update the credits */ for (i = 0; i < ntf->num_entries; i++) { ntf->conn_entries[i].conn_id = nci_conn_id(&ntf->conn_entries[i].conn_id); pr_debug("entry[%d]: conn_id %d, credits %d\n", i, ntf->conn_entries[i].conn_id, ntf->conn_entries[i].credits); if (ntf->conn_entries[i].conn_id == NCI_STATIC_RF_CONN_ID) { /* found static rf connection */ atomic_add(ntf->conn_entries[i].credits, &ndev->credits_cnt); } } /* trigger the next tx */ if (!skb_queue_empty(&ndev->tx_q)) queue_work(ndev->tx_wq, &ndev->tx_work); }
C
linux
0
CVE-2016-1237
https://www.cvedetails.com/cve/CVE-2016-1237/
CWE-284
https://github.com/torvalds/linux/commit/999653786df6954a31044528ac3f7a5dadca08f4
999653786df6954a31044528ac3f7a5dadca08f4
nfsd: check permissions when setting ACLs Use set_posix_acl, which includes proper permission checks, instead of calling ->set_acl directly. Without this anyone may be able to grant themselves permissions to a file by setting the ACL. Lock the inode to make the new checks atomic with respect to set_acl. (Also, nfsd was the only caller of set_acl not locking the inode, so I suspect this may fix other races.) This also simplifies the code, and ensures our ACLs are checked by posix_acl_valid. The permission checks and the inode locking were lost with commit 4ac7249e, which changed nfsd to use the set_acl inode operation directly instead of going through xattr handlers. Reported-by: David Sinquin <david@sinquin.eu> [agreunba@redhat.com: use set_posix_acl] Fixes: 4ac7249e Cc: Christoph Hellwig <hch@infradead.org> Cc: Al Viro <viro@zeniv.linux.org.uk> Cc: stable@vger.kernel.org Signed-off-by: J. Bruce Fields <bfields@redhat.com>
static inline void deny_bits(struct posix_ace_state *astate, u32 mask) { /* Deny all bits in the mask not already allowed: */ astate->deny |= mask & ~astate->allow; }
static inline void deny_bits(struct posix_ace_state *astate, u32 mask) { /* Deny all bits in the mask not already allowed: */ astate->deny |= mask & ~astate->allow; }
C
linux
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 <peria@chromium.org> Commit-Queue: Yuki Shiino <yukishiino@chromium.org> Cr-Commit-Position: refs/heads/master@{#718676}
static void ReflectUnsignedShortAttributeAttributeGetter(const v8::FunctionCallbackInfo<v8::Value>& info) { v8::Local<v8::Object> holder = info.Holder(); TestObject* impl = V8TestObject::ToImpl(holder); V8SetReturnValueUnsigned(info, std::max(0, static_cast<int>(impl->FastGetAttribute(html_names::kReflectunsignedshortattributeAttr)))); }
static void ReflectUnsignedShortAttributeAttributeGetter(const v8::FunctionCallbackInfo<v8::Value>& info) { v8::Local<v8::Object> holder = info.Holder(); TestObject* impl = V8TestObject::ToImpl(holder); V8SetReturnValueUnsigned(info, std::max(0, static_cast<int>(impl->FastGetAttribute(html_names::kReflectunsignedshortattributeAttr)))); }
C
Chrome
0
null
null
null
https://github.com/chromium/chromium/commit/a44b00c88bc5ea35b5b150217c5fd6e4ce168e58
a44b00c88bc5ea35b5b150217c5fd6e4ce168e58
Apply behaviour change fix from upstream for previous XPath change. BUG=58731 TEST=NONE Review URL: http://codereview.chromium.org/4027006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@63572 0039d316-1c4b-4281-b951-d872f2087c98
xmlXPathCompNodeTest(xmlXPathParserContextPtr ctxt, xmlXPathTestVal *test, xmlXPathTypeVal *type, const xmlChar **prefix, xmlChar *name) { int blanks; if ((test == NULL) || (type == NULL) || (prefix == NULL)) { STRANGE; return(NULL); } *type = (xmlXPathTypeVal) 0; *test = (xmlXPathTestVal) 0; *prefix = NULL; SKIP_BLANKS; if ((name == NULL) && (CUR == '*')) { /* * All elements */ NEXT; *test = NODE_TEST_ALL; return(NULL); } if (name == NULL) name = xmlXPathParseNCName(ctxt); if (name == NULL) { XP_ERRORNULL(XPATH_EXPR_ERROR); } blanks = IS_BLANK_CH(CUR); SKIP_BLANKS; if (CUR == '(') { NEXT; /* * NodeType or PI search */ if (xmlStrEqual(name, BAD_CAST "comment")) *type = NODE_TYPE_COMMENT; else if (xmlStrEqual(name, BAD_CAST "node")) *type = NODE_TYPE_NODE; else if (xmlStrEqual(name, BAD_CAST "processing-instruction")) *type = NODE_TYPE_PI; else if (xmlStrEqual(name, BAD_CAST "text")) *type = NODE_TYPE_TEXT; else { if (name != NULL) xmlFree(name); XP_ERRORNULL(XPATH_EXPR_ERROR); } *test = NODE_TEST_TYPE; SKIP_BLANKS; if (*type == NODE_TYPE_PI) { /* * Specific case: search a PI by name. */ if (name != NULL) xmlFree(name); name = NULL; if (CUR != ')') { name = xmlXPathParseLiteral(ctxt); CHECK_ERROR NULL; *test = NODE_TEST_PI; SKIP_BLANKS; } } if (CUR != ')') { if (name != NULL) xmlFree(name); XP_ERRORNULL(XPATH_UNCLOSED_ERROR); } NEXT; return(name); } *test = NODE_TEST_NAME; if ((!blanks) && (CUR == ':')) { NEXT; /* * Since currently the parser context don't have a * namespace list associated: * The namespace name for this prefix can be computed * only at evaluation time. The compilation is done * outside of any context. */ #if 0 *prefix = xmlXPathNsLookup(ctxt->context, name); if (name != NULL) xmlFree(name); if (*prefix == NULL) { XP_ERROR0(XPATH_UNDEF_PREFIX_ERROR); } #else *prefix = name; #endif if (CUR == '*') { /* * All elements */ NEXT; *test = NODE_TEST_ALL; return(NULL); } name = xmlXPathParseNCName(ctxt); if (name == NULL) { XP_ERRORNULL(XPATH_EXPR_ERROR); } } return(name); }
xmlXPathCompNodeTest(xmlXPathParserContextPtr ctxt, xmlXPathTestVal *test, xmlXPathTypeVal *type, const xmlChar **prefix, xmlChar *name) { int blanks; if ((test == NULL) || (type == NULL) || (prefix == NULL)) { STRANGE; return(NULL); } *type = (xmlXPathTypeVal) 0; *test = (xmlXPathTestVal) 0; *prefix = NULL; SKIP_BLANKS; if ((name == NULL) && (CUR == '*')) { /* * All elements */ NEXT; *test = NODE_TEST_ALL; return(NULL); } if (name == NULL) name = xmlXPathParseNCName(ctxt); if (name == NULL) { XP_ERRORNULL(XPATH_EXPR_ERROR); } blanks = IS_BLANK_CH(CUR); SKIP_BLANKS; if (CUR == '(') { NEXT; /* * NodeType or PI search */ if (xmlStrEqual(name, BAD_CAST "comment")) *type = NODE_TYPE_COMMENT; else if (xmlStrEqual(name, BAD_CAST "node")) *type = NODE_TYPE_NODE; else if (xmlStrEqual(name, BAD_CAST "processing-instruction")) *type = NODE_TYPE_PI; else if (xmlStrEqual(name, BAD_CAST "text")) *type = NODE_TYPE_TEXT; else { if (name != NULL) xmlFree(name); XP_ERRORNULL(XPATH_EXPR_ERROR); } *test = NODE_TEST_TYPE; SKIP_BLANKS; if (*type == NODE_TYPE_PI) { /* * Specific case: search a PI by name. */ if (name != NULL) xmlFree(name); name = NULL; if (CUR != ')') { name = xmlXPathParseLiteral(ctxt); CHECK_ERROR NULL; *test = NODE_TEST_PI; SKIP_BLANKS; } } if (CUR != ')') { if (name != NULL) xmlFree(name); XP_ERRORNULL(XPATH_UNCLOSED_ERROR); } NEXT; return(name); } *test = NODE_TEST_NAME; if ((!blanks) && (CUR == ':')) { NEXT; /* * Since currently the parser context don't have a * namespace list associated: * The namespace name for this prefix can be computed * only at evaluation time. The compilation is done * outside of any context. */ #if 0 *prefix = xmlXPathNsLookup(ctxt->context, name); if (name != NULL) xmlFree(name); if (*prefix == NULL) { XP_ERROR0(XPATH_UNDEF_PREFIX_ERROR); } #else *prefix = name; #endif if (CUR == '*') { /* * All elements */ NEXT; *test = NODE_TEST_ALL; return(NULL); } name = xmlXPathParseNCName(ctxt); if (name == NULL) { XP_ERRORNULL(XPATH_EXPR_ERROR); } } return(name); }
C
Chrome
0
CVE-2018-16427
https://www.cvedetails.com/cve/CVE-2018-16427/
CWE-125
https://github.com/OpenSC/OpenSC/pull/1447/commits/8fe377e93b4b56060e5bbfb6f3142ceaeca744fa
8fe377e93b4b56060e5bbfb6f3142ceaeca744fa
fixed out of bounds reads Thanks to Eric Sesterhenn from X41 D-SEC GmbH for reporting and suggesting security fixes.
static int entersafe_gen_key(sc_card_t *card, sc_entersafe_gen_key_data *data) { int r; size_t len = data->key_length >> 3; sc_apdu_t apdu; u8 rbuf[300]; u8 sbuf[4],*p; SC_FUNC_CALLED(card->ctx, SC_LOG_DEBUG_VERBOSE); /* MSE */ sc_format_apdu(card, &apdu, SC_APDU_CASE_3_SHORT, 0x22, 0x01, 0xB8); apdu.lc=0x04; sbuf[0]=0x83; sbuf[1]=0x02; sbuf[2]=data->key_id; sbuf[3]=0x2A; apdu.data = sbuf; apdu.datalen=4; apdu.lc=4; apdu.le=0; r=entersafe_transmit_apdu(card, &apdu, 0,0,0,0); SC_TEST_RET(card->ctx, SC_LOG_DEBUG_NORMAL, r, "APDU transmit failed"); SC_TEST_RET(card->ctx, SC_LOG_DEBUG_NORMAL, sc_check_sw(card,apdu.sw1,apdu.sw2),"EnterSafe set MSE failed"); /* generate key */ sc_format_apdu(card, &apdu, SC_APDU_CASE_3_SHORT, 0x46, 0x00, 0x00); apdu.le = 0; sbuf[0] = (u8)(data->key_length >> 8); sbuf[1] = (u8)(data->key_length); apdu.data = sbuf; apdu.lc = 2; apdu.datalen = 2; r = entersafe_transmit_apdu(card, &apdu,0,0,0,0); SC_TEST_RET(card->ctx, SC_LOG_DEBUG_NORMAL, r, "APDU transmit failed"); SC_TEST_RET(card->ctx, SC_LOG_DEBUG_NORMAL, sc_check_sw(card,apdu.sw1,apdu.sw2),"EnterSafe generate keypair failed"); /* read public key via READ PUBLIC KEY */ sc_format_apdu(card, &apdu, SC_APDU_CASE_2_SHORT, 0xE6, 0x2A, data->key_id); apdu.cla = 0x80; apdu.resp = rbuf; apdu.resplen = sizeof(rbuf); apdu.le = 256; r = entersafe_transmit_apdu(card, &apdu,0,0,0,0); SC_TEST_RET(card->ctx, SC_LOG_DEBUG_NORMAL, r, "APDU transmit failed"); SC_TEST_RET(card->ctx, SC_LOG_DEBUG_NORMAL, sc_check_sw(card,apdu.sw1,apdu.sw2),"EnterSafe get pukey failed"); data->modulus = malloc(len); if (!data->modulus) SC_FUNC_RETURN(card->ctx, SC_LOG_DEBUG_VERBOSE, SC_ERROR_OUT_OF_MEMORY); p=rbuf; if (*p!='E') SC_FUNC_RETURN(card->ctx, SC_LOG_DEBUG_VERBOSE, SC_ERROR_INVALID_DATA); p+=2+p[1]; /* N */ if (*p!='N') SC_FUNC_RETURN(card->ctx, SC_LOG_DEBUG_VERBOSE, SC_ERROR_INVALID_DATA); ++p; if(*p++>0x80) { u8 len_bytes=(*(p-1))&0x0f; size_t module_len=0; while(len_bytes!=0) { module_len=module_len<<8; module_len+=*p++; --len_bytes; } } entersafe_reverse_buffer(p,len); memcpy(data->modulus,p,len); SC_FUNC_RETURN(card->ctx, SC_LOG_DEBUG_VERBOSE,SC_SUCCESS); }
static int entersafe_gen_key(sc_card_t *card, sc_entersafe_gen_key_data *data) { int r; size_t len = data->key_length >> 3; sc_apdu_t apdu; u8 rbuf[300]; u8 sbuf[4],*p; SC_FUNC_CALLED(card->ctx, SC_LOG_DEBUG_VERBOSE); /* MSE */ sc_format_apdu(card, &apdu, SC_APDU_CASE_3_SHORT, 0x22, 0x01, 0xB8); apdu.lc=0x04; sbuf[0]=0x83; sbuf[1]=0x02; sbuf[2]=data->key_id; sbuf[3]=0x2A; apdu.data = sbuf; apdu.datalen=4; apdu.lc=4; apdu.le=0; r=entersafe_transmit_apdu(card, &apdu, 0,0,0,0); SC_TEST_RET(card->ctx, SC_LOG_DEBUG_NORMAL, r, "APDU transmit failed"); SC_TEST_RET(card->ctx, SC_LOG_DEBUG_NORMAL, sc_check_sw(card,apdu.sw1,apdu.sw2),"EnterSafe set MSE failed"); /* generate key */ sc_format_apdu(card, &apdu, SC_APDU_CASE_3_SHORT, 0x46, 0x00, 0x00); apdu.le = 0; sbuf[0] = (u8)(data->key_length >> 8); sbuf[1] = (u8)(data->key_length); apdu.data = sbuf; apdu.lc = 2; apdu.datalen = 2; r = entersafe_transmit_apdu(card, &apdu,0,0,0,0); SC_TEST_RET(card->ctx, SC_LOG_DEBUG_NORMAL, r, "APDU transmit failed"); SC_TEST_RET(card->ctx, SC_LOG_DEBUG_NORMAL, sc_check_sw(card,apdu.sw1,apdu.sw2),"EnterSafe generate keypair failed"); /* read public key via READ PUBLIC KEY */ sc_format_apdu(card, &apdu, SC_APDU_CASE_2_SHORT, 0xE6, 0x2A, data->key_id); apdu.cla = 0x80; apdu.resp = rbuf; apdu.resplen = sizeof(rbuf); apdu.le = 256; r = entersafe_transmit_apdu(card, &apdu,0,0,0,0); SC_TEST_RET(card->ctx, SC_LOG_DEBUG_NORMAL, r, "APDU transmit failed"); SC_TEST_RET(card->ctx, SC_LOG_DEBUG_NORMAL, sc_check_sw(card,apdu.sw1,apdu.sw2),"EnterSafe get pukey failed"); data->modulus = malloc(len); if (!data->modulus) SC_FUNC_RETURN(card->ctx, SC_LOG_DEBUG_VERBOSE,SC_ERROR_OUT_OF_MEMORY); p=rbuf; assert(*p=='E'); p+=2+p[1]; /* N */ assert(*p=='N'); ++p; if(*p++>0x80) { u8 len_bytes=(*(p-1))&0x0f; size_t module_len=0; while(len_bytes!=0) { module_len=module_len<<8; module_len+=*p++; --len_bytes; } } entersafe_reverse_buffer(p,len); memcpy(data->modulus,p,len); SC_FUNC_RETURN(card->ctx, SC_LOG_DEBUG_VERBOSE,SC_SUCCESS); }
C
OpenSC
1
null
null
null
https://github.com/chromium/chromium/commit/dcd10462fb49c72544719c490238f3a35edf3fc6
dcd10462fb49c72544719c490238f3a35edf3fc6
Open distiller UI setting through JavaScript This change adds support for opening the android view distiller settings from JavaScript via "distiller.openSettings". To avoid passing numerous objects into the DomDistillerViewerSource, the ExternalFeedbackReporter has been refactored into a generic UI handle that is responsible for any interaction between Chrome and Android specific controls and the distiller component. The actual UI in the page is not yet implemented. BUG= Review URL: https://codereview.chromium.org/1386043002 Cr-Commit-Position: refs/heads/master@{#354123}
std::string DomDistillerViewerSource::GetSource() const { return scheme_ + "://"; }
std::string DomDistillerViewerSource::GetSource() const { return scheme_ + "://"; }
C
Chrome
0
CVE-2016-1691
https://www.cvedetails.com/cve/CVE-2016-1691/
CWE-119
https://github.com/chromium/chromium/commit/e3aa8a56706c4abe208934d5c294f7b594b8b693
e3aa8a56706c4abe208934d5c294f7b594b8b693
Enforce the WebUsbAllowDevicesForUrls policy This change modifies UsbChooserContext to use the UsbAllowDevicesForUrls class to consider devices allowed by the WebUsbAllowDevicesForUrls policy. The WebUsbAllowDevicesForUrls policy overrides the other WebUSB policies. Unit tests are also added to ensure that the policy is being enforced correctly. The design document for this feature is found at: https://docs.google.com/document/d/1MPvsrWiVD_jAC8ELyk8njFpy6j1thfVU5aWT3TCWE8w Bug: 854329 Change-Id: I5f82e662ca9dc544da5918eae766b5535a31296b Reviewed-on: https://chromium-review.googlesource.com/c/1259289 Commit-Queue: Ovidio Henriquez <odejesush@chromium.org> Reviewed-by: Reilly Grant <reillyg@chromium.org> Reviewed-by: Julian Pastarmov <pastarmovj@chromium.org> Cr-Commit-Position: refs/heads/master@{#597926}
bool IsJavascriptEnabled(content::WebContents* contents) { std::unique_ptr<base::Value> value = content::ExecuteScriptAndGetValue(contents->GetMainFrame(), "123"); int result = 0; if (!value->GetAsInteger(&result)) EXPECT_EQ(base::Value::Type::NONE, value->type()); return result == 123; }
bool IsJavascriptEnabled(content::WebContents* contents) { std::unique_ptr<base::Value> value = content::ExecuteScriptAndGetValue(contents->GetMainFrame(), "123"); int result = 0; if (!value->GetAsInteger(&result)) EXPECT_EQ(base::Value::Type::NONE, value->type()); return result == 123; }
C
Chrome
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<CSSValue> valueForGridTrackList(const Vector<Length>& trackLengths, const RenderStyle* style) { ASSERT(trackLengths.size()); if (trackLengths.size() == 1 && trackLengths[0].isUndefined()) return cssValuePool().createIdentifierValue(CSSValueNone); RefPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); for (size_t i = 0; i < trackLengths.size(); ++i) list->append(valueForGridTrackBreadth(trackLengths[i], style)); return list.release(); }
static PassRefPtr<CSSValue> valueForGridTrackList(const Vector<Length>& trackLengths, const RenderStyle* style) { ASSERT(trackLengths.size()); if (trackLengths.size() == 1 && trackLengths[0].isUndefined()) return cssValuePool().createIdentifierValue(CSSValueNone); RefPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); for (size_t i = 0; i < trackLengths.size(); ++i) list->append(valueForGridTrackBreadth(trackLengths[i], style)); return list.release(); }
C
Chrome
0
null
null
null
https://github.com/chromium/chromium/commit/b9e2ecab97a8a7f3cce06951ab92a3eaef559206
b9e2ecab97a8a7f3cce06951ab92a3eaef559206
Do not discount a MANUAL_SUBFRAME load just because it involved some redirects. R=brettw BUG=21353 TEST=none Review URL: http://codereview.chromium.org/246073 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@27887 0039d316-1c4b-4281-b951-d872f2087c98
void NavigationController::DiscardTransientEntry() { if (transient_entry_index_ == -1) return; entries_.erase(entries_.begin() + transient_entry_index_); transient_entry_index_ = -1; }
void NavigationController::DiscardTransientEntry() { if (transient_entry_index_ == -1) return; entries_.erase(entries_.begin() + transient_entry_index_); transient_entry_index_ = -1; }
C
Chrome
0
CVE-2016-10066
https://www.cvedetails.com/cve/CVE-2016-10066/
CWE-119
https://github.com/ImageMagick/ImageMagick/commit/f6e9d0d9955e85bdd7540b251cd50d598dacc5e6
f6e9d0d9955e85bdd7540b251cd50d598dacc5e6
null
static void ipa_draw_line(wmfAPI * API, wmfDrawLine_t * draw_line) { /* Save graphic wand */ (void) PushDrawingWand(WmfDrawingWand); if (TO_DRAW(draw_line)) { util_set_pen(API, draw_line->dc); DrawLine(WmfDrawingWand, XC(draw_line->from.x), YC(draw_line->from.y), XC(draw_line->to.x), YC(draw_line->to.y)); } /* Restore graphic wand */ (void) PopDrawingWand(WmfDrawingWand); }
static void ipa_draw_line(wmfAPI * API, wmfDrawLine_t * draw_line) { /* Save graphic wand */ (void) PushDrawingWand(WmfDrawingWand); if (TO_DRAW(draw_line)) { util_set_pen(API, draw_line->dc); DrawLine(WmfDrawingWand, XC(draw_line->from.x), YC(draw_line->from.y), XC(draw_line->to.x), YC(draw_line->to.y)); } /* Restore graphic wand */ (void) PopDrawingWand(WmfDrawingWand); }
C
ImageMagick
0
CVE-2017-15386
https://www.cvedetails.com/cve/CVE-2017-15386/
CWE-20
https://github.com/chromium/chromium/commit/ba3b1b344017bbf36283464b51014fad15c2f3f4
ba3b1b344017bbf36283464b51014fad15c2f3f4
If a page shows a popup, end fullscreen. This was implemented in Blink r159834, but it is susceptible to a popup/fullscreen race. This CL reverts that implementation and re-implements it in WebContents. BUG=752003 TEST=WebContentsImplBrowserTest.PopupsFromJavaScriptEndFullscreen Change-Id: Ia345cdeda273693c3231ad8f486bebfc3d83927f Reviewed-on: https://chromium-review.googlesource.com/606987 Commit-Queue: Avi Drissman <avi@chromium.org> Reviewed-by: Charlie Reis <creis@chromium.org> Reviewed-by: Philip Jägenstedt <foolip@chromium.org> Cr-Commit-Position: refs/heads/master@{#498171}
void WebContentsImpl::CancelActiveAndPendingDialogs() { if (dialog_manager_) { dialog_manager_->CancelDialogs(this, /*reset_state=*/false); } if (browser_plugin_embedder_) browser_plugin_embedder_->CancelGuestDialogs(); if (delegate_) delegate_->HideValidationMessage(this); }
void WebContentsImpl::CancelActiveAndPendingDialogs() { if (dialog_manager_) { dialog_manager_->CancelDialogs(this, /*reset_state=*/false); } if (browser_plugin_embedder_) browser_plugin_embedder_->CancelGuestDialogs(); if (delegate_) delegate_->HideValidationMessage(this); }
C
Chrome
0
CVE-2013-4299
https://www.cvedetails.com/cve/CVE-2013-4299/
CWE-264
https://github.com/torvalds/linux/commit/e9c6a182649f4259db704ae15a91ac820e63b0ca
e9c6a182649f4259db704ae15a91ac820e63b0ca
dm snapshot: fix data corruption This patch fixes a particular type of data corruption that has been encountered when loading a snapshot's metadata from disk. When we allocate a new chunk in persistent_prepare, we increment ps->next_free and we make sure that it doesn't point to a metadata area by further incrementing it if necessary. When we load metadata from disk on device activation, ps->next_free is positioned after the last used data chunk. However, if this last used data chunk is followed by a metadata area, ps->next_free is positioned erroneously to the metadata area. A newly-allocated chunk is placed at the same location as the metadata area, resulting in data or metadata corruption. This patch changes the code so that ps->next_free skips the metadata area when metadata are loaded in function read_exceptions. The patch also moves a piece of code from persistent_prepare_exception to a separate function skip_metadata to avoid code duplication. CVE-2013-4299 Signed-off-by: Mikulas Patocka <mpatocka@redhat.com> Cc: stable@vger.kernel.org Cc: Mike Snitzer <snitzer@redhat.com> Signed-off-by: Alasdair G Kergon <agk@redhat.com>
static void write_exception(struct pstore *ps, uint32_t index, struct core_exception *e) { struct disk_exception *de = get_exception(ps, index); /* copy it */ de->old_chunk = cpu_to_le64(e->old_chunk); de->new_chunk = cpu_to_le64(e->new_chunk); }
static void write_exception(struct pstore *ps, uint32_t index, struct core_exception *e) { struct disk_exception *de = get_exception(ps, index); /* copy it */ de->old_chunk = cpu_to_le64(e->old_chunk); de->new_chunk = cpu_to_le64(e->new_chunk); }
C
linux
0
CVE-2015-6763
https://www.cvedetails.com/cve/CVE-2015-6763/
null
https://github.com/chromium/chromium/commit/f1574f25e1402e748bf2bd7e28ce3dd96ceb1ca4
f1574f25e1402e748bf2bd7e28ce3dd96ceb1ca4
MacViews: Enable secure text input for password Textfields. In Cocoa the NSTextInputContext automatically enables secure text input when activated and it's in the secure text entry mode. RenderWidgetHostViewMac did the similar thing for ages following the WebKit example. views::Textfield needs to do the same thing in a fashion that's sycnrhonized with RenderWidgetHostViewMac, otherwise the race conditions are possible when the Textfield gets focus, activates the secure text input mode and the RWHVM loses focus immediately afterwards and disables the secure text input instead of leaving it in the enabled state. BUG=818133,677220 Change-Id: I6db6c4b59e4a1a72cbb7f8c7056f71b04a3df08b Reviewed-on: https://chromium-review.googlesource.com/943064 Commit-Queue: Michail Pishchagin <mblsha@yandex-team.ru> Reviewed-by: Pavel Feldman <pfeldman@chromium.org> Reviewed-by: Avi Drissman <avi@chromium.org> Reviewed-by: Peter Kasting <pkasting@chromium.org> Cr-Commit-Position: refs/heads/master@{#542517}
bool InputType::IsOutOfRange(const String& value) const { if (!IsSteppable()) return false; const Decimal numeric_value = ParseToNumberOrNaN(value); if (!numeric_value.IsFinite()) return false; StepRange step_range(CreateStepRange(kRejectAny)); return step_range.HasRangeLimitations() && (numeric_value < step_range.Minimum() || numeric_value > step_range.Maximum()); }
bool InputType::IsOutOfRange(const String& value) const { if (!IsSteppable()) return false; const Decimal numeric_value = ParseToNumberOrNaN(value); if (!numeric_value.IsFinite()) return false; StepRange step_range(CreateStepRange(kRejectAny)); return step_range.HasRangeLimitations() && (numeric_value < step_range.Minimum() || numeric_value > step_range.Maximum()); }
C
Chrome
0
CVE-2012-2875
https://www.cvedetails.com/cve/CVE-2012-2875/
null
https://github.com/chromium/chromium/commit/40ed2b7ae4f6f5adb1b0ce9acf9c4dece339c2a6
40ed2b7ae4f6f5adb1b0ce9acf9c4dece339c2a6
gdata: Define the resource ID for the root directory Per the spec, the resource ID for the root directory is defined as "folder:root". Add the resource ID to the root directory in our file system representation so we can look up the root directory by the resource ID. BUG=127697 TEST=add unit tests Review URL: https://chromiumcodereview.appspot.com/10332253 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@137928 0039d316-1c4b-4281-b951-d872f2087c98
std::string GDataRootDirectory::CacheEntry::ToString() const { std::vector<std::string> cache_states; if (GDataFile::IsCachePresent(cache_state)) cache_states.push_back("present"); if (GDataFile::IsCachePinned(cache_state)) cache_states.push_back("pinned"); if (GDataFile::IsCacheDirty(cache_state)) cache_states.push_back("dirty"); return base::StringPrintf("md5=%s, subdir=%s, cache_state=%s", md5.c_str(), CacheSubDirectoryTypeToString(sub_dir_type).c_str(), JoinString(cache_states, ',').c_str()); }
std::string GDataRootDirectory::CacheEntry::ToString() const { std::vector<std::string> cache_states; if (GDataFile::IsCachePresent(cache_state)) cache_states.push_back("present"); if (GDataFile::IsCachePinned(cache_state)) cache_states.push_back("pinned"); if (GDataFile::IsCacheDirty(cache_state)) cache_states.push_back("dirty"); return base::StringPrintf("md5=%s, subdir=%s, cache_state=%s", md5.c_str(), CacheSubDirectoryTypeToString(sub_dir_type).c_str(), JoinString(cache_states, ',').c_str()); }
C
Chrome
0
CVE-2015-3400
https://www.cvedetails.com/cve/CVE-2015-3400/
CWE-200
https://github.com/FransUrbo/zfs/commit/99aa4d2b4fd12c6bef62d02ffd1b375ddd42fcf4
99aa4d2b4fd12c6bef62d02ffd1b375ddd42fcf4
Move nfs.c:foreach_nfs_shareopt() to libshare.c:foreach_shareopt() so that it can be (re)used in other parts of libshare.
sa_fini(sa_handle_t handle) { sa_handle_impl_t impl_handle = (sa_handle_impl_t)handle; sa_share_impl_t impl_share, next; sa_share_impl_t *pcurr; if (impl_handle == NULL) return; /* * clean up shares which don't have a non-NULL dataset property, * which means they're in sharetab but we couldn't find their * ZFS dataset. */ pcurr = &(impl_handle->shares); impl_share = *pcurr; while (impl_share != NULL) { next = impl_share->next; if (impl_share->dataset == NULL) { /* remove item from the linked list */ *pcurr = next; sa_disable_share(impl_share, NULL); free_share(impl_share); } else { pcurr = &(impl_share->next); } impl_share = next; } update_sharetab(impl_handle); if (impl_handle->zfs_libhandle != NULL) libzfs_fini(impl_handle->zfs_libhandle); impl_share = impl_handle->shares; while (impl_share != NULL) { next = impl_share->next; free_share(impl_share); impl_share = next; } free(impl_handle); }
sa_fini(sa_handle_t handle) { sa_handle_impl_t impl_handle = (sa_handle_impl_t)handle; sa_share_impl_t impl_share, next; sa_share_impl_t *pcurr; if (impl_handle == NULL) return; /* * clean up shares which don't have a non-NULL dataset property, * which means they're in sharetab but we couldn't find their * ZFS dataset. */ pcurr = &(impl_handle->shares); impl_share = *pcurr; while (impl_share != NULL) { next = impl_share->next; if (impl_share->dataset == NULL) { /* remove item from the linked list */ *pcurr = next; sa_disable_share(impl_share, NULL); free_share(impl_share); } else { pcurr = &(impl_share->next); } impl_share = next; } update_sharetab(impl_handle); if (impl_handle->zfs_libhandle != NULL) libzfs_fini(impl_handle->zfs_libhandle); impl_share = impl_handle->shares; while (impl_share != NULL) { next = impl_share->next; free_share(impl_share); impl_share = next; } free(impl_handle); }
C
zfs
0
CVE-2016-5202
null
null
https://github.com/chromium/chromium/commit/79708b391b2e91d63b5d009ec6202c7d7ededf93
79708b391b2e91d63b5d009ec6202c7d7ededf93
Ensure that OpenVR only adds placeholder buttons when needed. The current implementation of the OpenVRGamepadHelper always adds the optional grip and secondary axes buttons; however, if those buttons are missing and no additional buttons need to be supported, they should not be included. A prime example of this is the vive controller, which has a trigger, a grip, and a touchpad, but no secondary axis button. This is essentially the controller that the new TestGamepadOptionalData test builds. Bug: 964026 Change-Id: I1de93b5bd7bd0d9e75013cf33b8f333e5d70270f Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1627914 Reviewed-by: Bill Orr <billorr@chromium.org> Commit-Queue: Alexander Cooper <alcooper@chromium.org> Cr-Commit-Position: refs/heads/master@{#662843}
void TestHeadPosesUpdateImpl(WebXrVrBrowserTestBase* t) { WebXrHeadPoseMock my_mock; t->LoadUrlAndAwaitInitialization( t->GetFileUrlForHtmlTestFile("webxr_test_head_poses")); t->EnterSessionWithUserGestureOrFail(); auto pose = gfx::Transform(); my_mock.SetHeadPose(pose); t->RunJavaScriptOrFail("stepWaitForMatchingPose(" + TransformToColMajorString(pose) + ")"); t->WaitOnJavaScriptStep(); pose.RotateAboutXAxis(90); pose.Translate3d(2, 3, 4); my_mock.SetHeadPose(pose); t->RunJavaScriptOrFail("stepWaitForMatchingPose(" + TransformToColMajorString(pose) + ")"); t->WaitOnJavaScriptStep(); t->AssertNoJavaScriptErrors(); }
void TestHeadPosesUpdateImpl(WebXrVrBrowserTestBase* t) { WebXrHeadPoseMock my_mock; t->LoadUrlAndAwaitInitialization( t->GetFileUrlForHtmlTestFile("webxr_test_head_poses")); t->EnterSessionWithUserGestureOrFail(); auto pose = gfx::Transform(); my_mock.SetHeadPose(pose); t->RunJavaScriptOrFail("stepWaitForMatchingPose(" + TransformToColMajorString(pose) + ")"); t->WaitOnJavaScriptStep(); pose.RotateAboutXAxis(90); pose.Translate3d(2, 3, 4); my_mock.SetHeadPose(pose); t->RunJavaScriptOrFail("stepWaitForMatchingPose(" + TransformToColMajorString(pose) + ")"); t->WaitOnJavaScriptStep(); t->AssertNoJavaScriptErrors(); }
C
Chrome
0
CVE-2015-8816
https://www.cvedetails.com/cve/CVE-2015-8816/
null
https://github.com/torvalds/linux/commit/e50293ef9775c5f1cf3fcc093037dd6a8c5684ea
e50293ef9775c5f1cf3fcc093037dd6a8c5684ea
USB: fix invalid memory access in hub_activate() Commit 8520f38099cc ("USB: change hub initialization sleeps to delayed_work") changed the hub_activate() routine to make part of it run in a workqueue. However, the commit failed to take a reference to the usb_hub structure or to lock the hub interface while doing so. As a result, if a hub is plugged in and quickly unplugged before the work routine can run, the routine will try to access memory that has been deallocated. Or, if the hub is unplugged while the routine is running, the memory may be deallocated while it is in active use. This patch fixes the problem by taking a reference to the usb_hub at the start of hub_activate() and releasing it at the end (when the work is finished), and by locking the hub interface while the work routine is running. It also adds a check at the start of the routine to see if the hub has already been disconnected, in which nothing should be done. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Reported-by: Alexandru Cornea <alexandru.cornea@intel.com> Tested-by: Alexandru Cornea <alexandru.cornea@intel.com> Fixes: 8520f38099cc ("USB: change hub initialization sleeps to delayed_work") CC: <stable@vger.kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
static void hub_tt_work(struct work_struct *work) { struct usb_hub *hub = container_of(work, struct usb_hub, tt.clear_work); unsigned long flags; spin_lock_irqsave(&hub->tt.lock, flags); while (!list_empty(&hub->tt.clear_list)) { struct list_head *next; struct usb_tt_clear *clear; struct usb_device *hdev = hub->hdev; const struct hc_driver *drv; int status; next = hub->tt.clear_list.next; clear = list_entry(next, struct usb_tt_clear, clear_list); list_del(&clear->clear_list); /* drop lock so HCD can concurrently report other TT errors */ spin_unlock_irqrestore(&hub->tt.lock, flags); status = hub_clear_tt_buffer(hdev, clear->devinfo, clear->tt); if (status && status != -ENODEV) dev_err(&hdev->dev, "clear tt %d (%04x) error %d\n", clear->tt, clear->devinfo, status); /* Tell the HCD, even if the operation failed */ drv = clear->hcd->driver; if (drv->clear_tt_buffer_complete) (drv->clear_tt_buffer_complete)(clear->hcd, clear->ep); kfree(clear); spin_lock_irqsave(&hub->tt.lock, flags); } spin_unlock_irqrestore(&hub->tt.lock, flags); }
static void hub_tt_work(struct work_struct *work) { struct usb_hub *hub = container_of(work, struct usb_hub, tt.clear_work); unsigned long flags; spin_lock_irqsave(&hub->tt.lock, flags); while (!list_empty(&hub->tt.clear_list)) { struct list_head *next; struct usb_tt_clear *clear; struct usb_device *hdev = hub->hdev; const struct hc_driver *drv; int status; next = hub->tt.clear_list.next; clear = list_entry(next, struct usb_tt_clear, clear_list); list_del(&clear->clear_list); /* drop lock so HCD can concurrently report other TT errors */ spin_unlock_irqrestore(&hub->tt.lock, flags); status = hub_clear_tt_buffer(hdev, clear->devinfo, clear->tt); if (status && status != -ENODEV) dev_err(&hdev->dev, "clear tt %d (%04x) error %d\n", clear->tt, clear->devinfo, status); /* Tell the HCD, even if the operation failed */ drv = clear->hcd->driver; if (drv->clear_tt_buffer_complete) (drv->clear_tt_buffer_complete)(clear->hcd, clear->ep); kfree(clear); spin_lock_irqsave(&hub->tt.lock, flags); } spin_unlock_irqrestore(&hub->tt.lock, flags); }
C
linux
0
CVE-2012-2862
https://www.cvedetails.com/cve/CVE-2012-2862/
CWE-399
https://github.com/chromium/chromium/commit/92afc45a43336c468720a3143e7f2adfa882fa78
92afc45a43336c468720a3143e7f2adfa882fa78
Use display_email() for Uber Tray messages. BUG=124087 TEST=manually Review URL: https://chromiumcodereview.appspot.com/10388171 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@137721 0039d316-1c4b-4281-b951-d872f2087c98
void BluetoothDiscoveryFailure() { }
void BluetoothDiscoveryFailure() { }
C
Chrome
0
CVE-2013-1929
https://www.cvedetails.com/cve/CVE-2013-1929/
CWE-119
https://github.com/torvalds/linux/commit/715230a44310a8cf66fbfb5a46f9a62a9b2de424
715230a44310a8cf66fbfb5a46f9a62a9b2de424
tg3: fix length overflow in VPD firmware parsing Commit 184b89044fb6e2a74611dafa69b1dce0d98612c6 ("tg3: Use VPD fw version when present") introduced VPD parsing that contained a potential length overflow. Limit the hardware's reported firmware string length (max 255 bytes) to stay inside the driver's firmware string length (32 bytes). On overflow, truncate the formatted firmware string instead of potentially overwriting portions of the tg3 struct. http://cansecwest.com/slides/2013/PrivateCore%20CSW%202013.pdf Signed-off-by: Kees Cook <keescook@chromium.org> Reported-by: Oded Horovitz <oded@privatecore.com> Reported-by: Brad Spengler <spender@grsecurity.net> Cc: stable@vger.kernel.org Cc: Matt Carlson <mcarlson@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
static int tg3_poll(struct napi_struct *napi, int budget) { struct tg3_napi *tnapi = container_of(napi, struct tg3_napi, napi); struct tg3 *tp = tnapi->tp; int work_done = 0; struct tg3_hw_status *sblk = tnapi->hw_status; while (1) { if (sblk->status & SD_STATUS_ERROR) tg3_process_error(tp); tg3_poll_link(tp); work_done = tg3_poll_work(tnapi, work_done, budget); if (unlikely(tg3_flag(tp, TX_RECOVERY_PENDING))) goto tx_recovery; if (unlikely(work_done >= budget)) break; if (tg3_flag(tp, TAGGED_STATUS)) { /* tp->last_tag is used in tg3_int_reenable() below * to tell the hw how much work has been processed, * so we must read it before checking for more work. */ tnapi->last_tag = sblk->status_tag; tnapi->last_irq_tag = tnapi->last_tag; rmb(); } else sblk->status &= ~SD_STATUS_UPDATED; if (likely(!tg3_has_work(tnapi))) { napi_complete(napi); tg3_int_reenable(tnapi); break; } } return work_done; tx_recovery: /* work_done is guaranteed to be less than budget. */ napi_complete(napi); tg3_reset_task_schedule(tp); return work_done; }
static int tg3_poll(struct napi_struct *napi, int budget) { struct tg3_napi *tnapi = container_of(napi, struct tg3_napi, napi); struct tg3 *tp = tnapi->tp; int work_done = 0; struct tg3_hw_status *sblk = tnapi->hw_status; while (1) { if (sblk->status & SD_STATUS_ERROR) tg3_process_error(tp); tg3_poll_link(tp); work_done = tg3_poll_work(tnapi, work_done, budget); if (unlikely(tg3_flag(tp, TX_RECOVERY_PENDING))) goto tx_recovery; if (unlikely(work_done >= budget)) break; if (tg3_flag(tp, TAGGED_STATUS)) { /* tp->last_tag is used in tg3_int_reenable() below * to tell the hw how much work has been processed, * so we must read it before checking for more work. */ tnapi->last_tag = sblk->status_tag; tnapi->last_irq_tag = tnapi->last_tag; rmb(); } else sblk->status &= ~SD_STATUS_UPDATED; if (likely(!tg3_has_work(tnapi))) { napi_complete(napi); tg3_int_reenable(tnapi); break; } } return work_done; tx_recovery: /* work_done is guaranteed to be less than budget. */ napi_complete(napi); tg3_reset_task_schedule(tp); return work_done; }
C
linux
0
CVE-2016-10150
https://www.cvedetails.com/cve/CVE-2016-10150/
CWE-416
https://github.com/torvalds/linux/commit/a0f1d21c1ccb1da66629627a74059dd7f5ac9c61
a0f1d21c1ccb1da66629627a74059dd7f5ac9c61
KVM: use after free in kvm_ioctl_create_device() We should move the ops->destroy(dev) after the list_del(&dev->vm_node) so that we don't use "dev" after freeing it. Fixes: a28ebea2adc4 ("KVM: Protect device ops->create and list_add with kvm->lock") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Reviewed-by: David Hildenbrand <david@redhat.com> Signed-off-by: Radim Krčmář <rkrcmar@redhat.com>
void mark_page_dirty(struct kvm *kvm, gfn_t gfn) { struct kvm_memory_slot *memslot; memslot = gfn_to_memslot(kvm, gfn); mark_page_dirty_in_slot(memslot, gfn); }
void mark_page_dirty(struct kvm *kvm, gfn_t gfn) { struct kvm_memory_slot *memslot; memslot = gfn_to_memslot(kvm, gfn); mark_page_dirty_in_slot(memslot, gfn); }
C
linux
0
CVE-2016-6720
https://www.cvedetails.com/cve/CVE-2016-6720/
CWE-200
https://android.googlesource.com/platform/frameworks/av/+/0f177948ae2640bfe4d70f8e4248e106406b3b0a
0f177948ae2640bfe4d70f8e4248e106406b3b0a
DO NOT MERGE: IOMX: work against metadata buffer spoofing - Prohibit direct set/getParam/Settings for extensions meant for OMXNodeInstance alone. This disallows enabling metadata mode without the knowledge of OMXNodeInstance. - Use a backup buffer for metadata mode buffers and do not directly share with clients. - Disallow setting up metadata mode/tunneling/input surface after first sendCommand. - Disallow store-meta for input cross process. - Disallow emptyBuffer for surface input (via IOMX). - Fix checking for input surface. Bug: 29422020 Change-Id: I801c77b80e703903f62e42d76fd2e76a34e4bc8e (cherry picked from commit 7c3c2fa3e233c656fc8c2fc2a6634b3ecf8a23e8)
status_t OMXNodeInstance::getConfig( OMX_INDEXTYPE index, void *params, size_t /* size */) { Mutex::Autolock autoLock(mLock); if (isProhibitedIndex_l(index)) { android_errorWriteLog(0x534e4554, "29422020"); return BAD_INDEX; } OMX_ERRORTYPE err = OMX_GetConfig(mHandle, index, params); OMX_INDEXEXTTYPE extIndex = (OMX_INDEXEXTTYPE)index; if (err != OMX_ErrorNoMore) { CLOG_IF_ERROR(getConfig, err, "%s(%#x)", asString(extIndex), index); } return StatusFromOMXError(err); }
status_t OMXNodeInstance::getConfig( OMX_INDEXTYPE index, void *params, size_t /* size */) { Mutex::Autolock autoLock(mLock); OMX_ERRORTYPE err = OMX_GetConfig(mHandle, index, params); OMX_INDEXEXTTYPE extIndex = (OMX_INDEXEXTTYPE)index; if (err != OMX_ErrorNoMore) { CLOG_IF_ERROR(getConfig, err, "%s(%#x)", asString(extIndex), index); } return StatusFromOMXError(err); }
C
Android
1
CVE-2017-15128
https://www.cvedetails.com/cve/CVE-2017-15128/
CWE-119
https://github.com/torvalds/linux/commit/1e3921471354244f70fe268586ff94a97a6dd4df
1e3921471354244f70fe268586ff94a97a6dd4df
userfaultfd: hugetlbfs: prevent UFFDIO_COPY to fill beyond the end of i_size This oops: kernel BUG at fs/hugetlbfs/inode.c:484! RIP: remove_inode_hugepages+0x3d0/0x410 Call Trace: hugetlbfs_setattr+0xd9/0x130 notify_change+0x292/0x410 do_truncate+0x65/0xa0 do_sys_ftruncate.constprop.3+0x11a/0x180 SyS_ftruncate+0xe/0x10 tracesys+0xd9/0xde was caused by the lack of i_size check in hugetlb_mcopy_atomic_pte. mmap() can still succeed beyond the end of the i_size after vmtruncate zapped vmas in those ranges, but the faults must not succeed, and that includes UFFDIO_COPY. We could differentiate the retval to userland to represent a SIGBUS like a page fault would do (vs SIGSEGV), but it doesn't seem very useful and we'd need to pick a random retval as there's no meaningful syscall retval that would differentiate from SIGSEGV and SIGBUS, there's just -EFAULT. Link: http://lkml.kernel.org/r/20171016223914.2421-2-aarcange@redhat.com Signed-off-by: Andrea Arcangeli <aarcange@redhat.com> Reviewed-by: Mike Kravetz <mike.kravetz@oracle.com> Cc: Mike Rapoport <rppt@linux.vnet.ibm.com> Cc: "Dr. David Alan Gilbert" <dgilbert@redhat.com> Cc: <stable@vger.kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
void resv_map_release(struct kref *ref) { struct resv_map *resv_map = container_of(ref, struct resv_map, refs); struct list_head *head = &resv_map->region_cache; struct file_region *rg, *trg; /* Clear out any active regions before we release the map. */ region_del(resv_map, 0, LONG_MAX); /* ... and any entries left in the cache */ list_for_each_entry_safe(rg, trg, head, link) { list_del(&rg->link); kfree(rg); } VM_BUG_ON(resv_map->adds_in_progress); kfree(resv_map); }
void resv_map_release(struct kref *ref) { struct resv_map *resv_map = container_of(ref, struct resv_map, refs); struct list_head *head = &resv_map->region_cache; struct file_region *rg, *trg; /* Clear out any active regions before we release the map. */ region_del(resv_map, 0, LONG_MAX); /* ... and any entries left in the cache */ list_for_each_entry_safe(rg, trg, head, link) { list_del(&rg->link); kfree(rg); } VM_BUG_ON(resv_map->adds_in_progress); kfree(resv_map); }
C
linux
0
null
null
null
https://github.com/chromium/chromium/commit/a0af50481db56aa780942e8595a20c36b2c34f5c
a0af50481db56aa780942e8595a20c36b2c34f5c
Build fix following bug #30696. Patch by Gavin Barraclough <barraclough@apple.com> on 2009-10-22 Reviewed by NOBODY (build fix). * WebCoreSupport/FrameLoaderClientGtk.cpp: (WebKit::FrameLoaderClient::windowObjectCleared): * webkit/webkitwebframe.cpp: (webkit_web_frame_get_global_context): git-svn-id: svn://svn.chromium.org/blink/trunk@49964 bbb929c8-8fbe-4397-9dbb-9b2b20218538
FrameLoaderClient::~FrameLoaderClient() { if (m_policyDecision) g_object_unref(m_policyDecision); }
FrameLoaderClient::~FrameLoaderClient() { if (m_policyDecision) g_object_unref(m_policyDecision); }
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 Track::GetNumber() const { return m_info.number; }
long Track::GetNumber() const { return m_info.number; }
C
Android
0
CVE-2016-5219
https://www.cvedetails.com/cve/CVE-2016-5219/
CWE-416
https://github.com/chromium/chromium/commit/a4150b688a754d3d10d2ca385155b1c95d77d6ae
a4150b688a754d3d10d2ca385155b1c95d77d6ae
Add GL_PROGRAM_COMPLETION_QUERY_CHROMIUM This makes the query of GL_COMPLETION_STATUS_KHR to programs much cheaper by minimizing the round-trip to the GPU thread. Bug: 881152, 957001 Change-Id: Iadfa798af29225e752c710ca5c25f50b3dd3101a Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1586630 Commit-Queue: Kenneth Russell <kbr@chromium.org> Reviewed-by: Kentaro Hara <haraken@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Kenneth Russell <kbr@chromium.org> Cr-Commit-Position: refs/heads/master@{#657568}
void GLES2DecoderImpl::DoClearBufferfv(GLenum buffer, GLint drawbuffer, const volatile GLfloat* value) { const char* func_name = "glClearBufferfv"; if (!CheckBoundDrawFramebufferValid(func_name)) return; ApplyDirtyState(); if (buffer == GL_COLOR) { if (drawbuffer < 0 || drawbuffer >= static_cast<GLint>(group_->max_draw_buffers())) { LOCAL_SET_GL_ERROR(GL_INVALID_VALUE, func_name, "invalid drawBuffer"); return; } GLenum internal_format = GetBoundColorDrawBufferInternalFormat(drawbuffer); if (GLES2Util::IsIntegerFormat(internal_format)) { LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION, func_name, "can only be called on float buffers"); return; } } else { DCHECK(buffer == GL_DEPTH); if (drawbuffer != 0) { LOCAL_SET_GL_ERROR(GL_INVALID_VALUE, func_name, "invalid drawBuffer"); return; } if (!BoundFramebufferHasDepthAttachment()) { return; } } MarkDrawBufferAsCleared(buffer, drawbuffer); api()->glClearBufferfvFn(buffer, drawbuffer, const_cast<const GLfloat*>(value)); }
void GLES2DecoderImpl::DoClearBufferfv(GLenum buffer, GLint drawbuffer, const volatile GLfloat* value) { const char* func_name = "glClearBufferfv"; if (!CheckBoundDrawFramebufferValid(func_name)) return; ApplyDirtyState(); if (buffer == GL_COLOR) { if (drawbuffer < 0 || drawbuffer >= static_cast<GLint>(group_->max_draw_buffers())) { LOCAL_SET_GL_ERROR(GL_INVALID_VALUE, func_name, "invalid drawBuffer"); return; } GLenum internal_format = GetBoundColorDrawBufferInternalFormat(drawbuffer); if (GLES2Util::IsIntegerFormat(internal_format)) { LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION, func_name, "can only be called on float buffers"); return; } } else { DCHECK(buffer == GL_DEPTH); if (drawbuffer != 0) { LOCAL_SET_GL_ERROR(GL_INVALID_VALUE, func_name, "invalid drawBuffer"); return; } if (!BoundFramebufferHasDepthAttachment()) { return; } } MarkDrawBufferAsCleared(buffer, drawbuffer); api()->glClearBufferfvFn(buffer, drawbuffer, const_cast<const GLfloat*>(value)); }
C
Chrome
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 <keescook@chromium.org> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
static void aes_encrypt(struct crypto_tfm *tfm, u8 *dst, const u8 *src) { struct crypto_sparc64_aes_ctx *ctx = crypto_tfm_ctx(tfm); ctx->ops->encrypt(&ctx->key[0], (const u32 *) src, (u32 *) dst); }
static void aes_encrypt(struct crypto_tfm *tfm, u8 *dst, const u8 *src) { struct crypto_sparc64_aes_ctx *ctx = crypto_tfm_ctx(tfm); ctx->ops->encrypt(&ctx->key[0], (const u32 *) src, (u32 *) dst); }
C
linux
0
CVE-2018-11381
https://www.cvedetails.com/cve/CVE-2018-11381/
CWE-125
https://github.com/radare/radare2/commit/3fcf41ed96ffa25b38029449520c8d0a198745f3
3fcf41ed96ffa25b38029449520c8d0a198745f3
Fix #9902 - Fix oobread in RBin.string_scan_range
R_API int r_bin_file_set_bytes(RBinFile *binfile, const ut8 *bytes, ut64 sz, bool steal_ptr) { if (!binfile) { return false; } if (!bytes) { return false; } r_buf_free (binfile->buf); binfile->buf = r_buf_new (); #if LIMIT_SIZE if (sz > 1024 * 1024) { eprintf ("Too big\n"); return NULL; } #else if (steal_ptr) { r_buf_set_bytes_steal (binfile->buf, bytes, sz); } else { r_buf_set_bytes (binfile->buf, bytes, sz); } #endif return binfile->buf != NULL; }
R_API int r_bin_file_set_bytes(RBinFile *binfile, const ut8 *bytes, ut64 sz, bool steal_ptr) { if (!binfile) { return false; } if (!bytes) { return false; } r_buf_free (binfile->buf); binfile->buf = r_buf_new (); #if LIMIT_SIZE if (sz > 1024 * 1024) { eprintf ("Too big\n"); return NULL; } #else if (steal_ptr) { r_buf_set_bytes_steal (binfile->buf, bytes, sz); } else { r_buf_set_bytes (binfile->buf, bytes, sz); } #endif return binfile->buf != NULL; }
C
radare2
0
CVE-2016-7115
https://www.cvedetails.com/cve/CVE-2016-7115/
CWE-119
https://github.com/haakonnessjoen/MAC-Telnet/commit/b69d11727d4f0f8cf719c79e3fb700f55ca03e9a
b69d11727d4f0f8cf719c79e3fb700f55ca03e9a
Merge pull request #20 from eyalitki/master 2nd round security fixes from eyalitki
static void list_add_connection(struct mt_connection *conn) { DL_APPEND(connections_head, conn); }
static void list_add_connection(struct mt_connection *conn) { DL_APPEND(connections_head, conn); }
C
MAC-Telnet
0
CVE-2019-1010295
https://www.cvedetails.com/cve/CVE-2019-1010295/
CWE-119
https://github.com/OP-TEE/optee_os/commit/d5c5b0b77b2b589666024d219a8007b3f5b6faeb
d5c5b0b77b2b589666024d219a8007b3f5b6faeb
core: svc: always check ta parameters Always check TA parameters from a user TA. This prevents a user TA from passing invalid pointers to a pseudo TA. Fixes: OP-TEE-2018-0007: "Buffer checks missing when calling pseudo TAs". Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org> Tested-by: Joakim Bech <joakim.bech@linaro.org> (QEMU v7, v8) Reviewed-by: Joakim Bech <joakim.bech@linaro.org> Reported-by: Riscure <inforequest@riscure.com> Reported-by: Alyssa Milburn <a.a.milburn@vu.nl> Acked-by: Etienne Carriere <etienne.carriere@linaro.org>
TEE_Result syscall_get_property(unsigned long prop_set, unsigned long index, void *name, uint32_t *name_len, void *buf, uint32_t *blen, uint32_t *prop_type) { struct tee_ta_session *sess; TEE_Result res; TEE_Result res2; const struct tee_props *prop; uint32_t klen; size_t klen_size; uint32_t elen; prop = get_prop_struct(prop_set, index); if (!prop) return TEE_ERROR_ITEM_NOT_FOUND; res = tee_ta_get_current_session(&sess); if (res != TEE_SUCCESS) return res; /* Get the property type */ if (prop_type) { res = tee_svc_copy_to_user(prop_type, &prop->prop_type, sizeof(*prop_type)); if (res != TEE_SUCCESS) return res; } /* Get the property */ if (buf && blen) { res = tee_svc_copy_from_user(&klen, blen, sizeof(klen)); if (res != TEE_SUCCESS) return res; if (prop->get_prop_func) { klen_size = klen; res = prop->get_prop_func(sess, buf, &klen_size); klen = klen_size; res2 = tee_svc_copy_to_user(blen, &klen, sizeof(*blen)); } else { if (klen < prop->len) res = TEE_ERROR_SHORT_BUFFER; else res = tee_svc_copy_to_user(buf, prop->data, prop->len); res2 = tee_svc_copy_to_user(blen, &prop->len, sizeof(*blen)); } if (res2 != TEE_SUCCESS) return res2; if (res != TEE_SUCCESS) return res; } /* Get the property name */ if (name && name_len) { res = tee_svc_copy_from_user(&klen, name_len, sizeof(klen)); if (res != TEE_SUCCESS) return res; elen = strlen(prop->name) + 1; if (klen < elen) res = TEE_ERROR_SHORT_BUFFER; else res = tee_svc_copy_to_user(name, prop->name, elen); res2 = tee_svc_copy_to_user(name_len, &elen, sizeof(*name_len)); if (res2 != TEE_SUCCESS) return res2; if (res != TEE_SUCCESS) return res; } return res; }
TEE_Result syscall_get_property(unsigned long prop_set, unsigned long index, void *name, uint32_t *name_len, void *buf, uint32_t *blen, uint32_t *prop_type) { struct tee_ta_session *sess; TEE_Result res; TEE_Result res2; const struct tee_props *prop; uint32_t klen; size_t klen_size; uint32_t elen; prop = get_prop_struct(prop_set, index); if (!prop) return TEE_ERROR_ITEM_NOT_FOUND; res = tee_ta_get_current_session(&sess); if (res != TEE_SUCCESS) return res; /* Get the property type */ if (prop_type) { res = tee_svc_copy_to_user(prop_type, &prop->prop_type, sizeof(*prop_type)); if (res != TEE_SUCCESS) return res; } /* Get the property */ if (buf && blen) { res = tee_svc_copy_from_user(&klen, blen, sizeof(klen)); if (res != TEE_SUCCESS) return res; if (prop->get_prop_func) { klen_size = klen; res = prop->get_prop_func(sess, buf, &klen_size); klen = klen_size; res2 = tee_svc_copy_to_user(blen, &klen, sizeof(*blen)); } else { if (klen < prop->len) res = TEE_ERROR_SHORT_BUFFER; else res = tee_svc_copy_to_user(buf, prop->data, prop->len); res2 = tee_svc_copy_to_user(blen, &prop->len, sizeof(*blen)); } if (res2 != TEE_SUCCESS) return res2; if (res != TEE_SUCCESS) return res; } /* Get the property name */ if (name && name_len) { res = tee_svc_copy_from_user(&klen, name_len, sizeof(klen)); if (res != TEE_SUCCESS) return res; elen = strlen(prop->name) + 1; if (klen < elen) res = TEE_ERROR_SHORT_BUFFER; else res = tee_svc_copy_to_user(name, prop->name, elen); res2 = tee_svc_copy_to_user(name_len, &elen, sizeof(*name_len)); if (res2 != TEE_SUCCESS) return res2; if (res != TEE_SUCCESS) return res; } return res; }
C
optee_os
0
CVE-2017-6903
https://www.cvedetails.com/cve/CVE-2017-6903/
CWE-269
https://github.com/ioquake/ioq3/commit/b173ac05993f634a42be3d3535e1b158de0c3372
b173ac05993f634a42be3d3535e1b158de0c3372
Merge some file writing extension checks from OpenJK. Thanks Ensiform. https://github.com/JACoders/OpenJK/commit/05928a57f9e4aae15a3bd0 https://github.com/JACoders/OpenJK/commit/ef124fd0fc48af164581176
void QDECL Com_DPrintf( const char *fmt, ...) { va_list argptr; char msg[MAXPRINTMSG]; if ( !com_developer || !com_developer->integer ) { return; // don't confuse non-developers with techie stuff... } va_start (argptr,fmt); Q_vsnprintf (msg, sizeof(msg), fmt, argptr); va_end (argptr); Com_Printf ("%s", msg); }
void QDECL Com_DPrintf( const char *fmt, ...) { va_list argptr; char msg[MAXPRINTMSG]; if ( !com_developer || !com_developer->integer ) { return; // don't confuse non-developers with techie stuff... } va_start (argptr,fmt); Q_vsnprintf (msg, sizeof(msg), fmt, argptr); va_end (argptr); Com_Printf ("%s", msg); }
C
OpenJK
0
CVE-2014-3200
https://www.cvedetails.com/cve/CVE-2014-3200/
null
https://github.com/chromium/chromium/commit/c0947dabeaa10da67798c1bbc668dca4b280cad5
c0947dabeaa10da67798c1bbc668dca4b280cad5
[Contextual Search] Change "Now on Tap" to "Contextual Cards" BUG=644934 Review-Url: https://codereview.chromium.org/2361163003 Cr-Commit-Position: refs/heads/master@{#420899}
bool ContextualSearchFieldTrial::GetBooleanParam(const std::string& name, bool* is_value_cached, bool* cached_value) { if (!*is_value_cached) { *is_value_cached = true; std::string string_value = GetSwitch(name); bool has_switch = HasSwitch(name); if (has_switch && string_value.empty()) string_value = kAnyNonEmptyValue; if (!has_switch) string_value = GetParam(name); *cached_value = !string_value.empty() && string_value != kFalseValue; } return *cached_value; }
bool ContextualSearchFieldTrial::GetBooleanParam(const std::string& name, bool* is_value_cached, bool* cached_value) { if (!*is_value_cached) { *is_value_cached = true; std::string string_value = GetSwitch(name); bool has_switch = HasSwitch(name); if (has_switch && string_value.empty()) string_value = kAnyNonEmptyValue; if (!has_switch) string_value = GetParam(name); *cached_value = !string_value.empty() && string_value != kFalseValue; } return *cached_value; }
C
Chrome
0
CVE-2012-2867
https://www.cvedetails.com/cve/CVE-2012-2867/
null
https://github.com/chromium/chromium/commit/b7a161633fd7ecb59093c2c56ed908416292d778
b7a161633fd7ecb59093c2c56ed908416292d778
[GTK][WTR] Implement AccessibilityUIElement::stringValue https://bugs.webkit.org/show_bug.cgi?id=102951 Reviewed by Martin Robinson. Implement AccessibilityUIElement::stringValue in the ATK backend in the same manner it is implemented in DumpRenderTree. * WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp: (WTR::replaceCharactersForResults): (WTR): (WTR::AccessibilityUIElement::stringValue): git-svn-id: svn://svn.chromium.org/blink/trunk@135485 bbb929c8-8fbe-4397-9dbb-9b2b20218538
JSRetainPtr<JSStringRef> AccessibilityUIElement::rangeForLine(int line) { return JSStringCreateWithCharacters(0, 0); }
JSRetainPtr<JSStringRef> AccessibilityUIElement::rangeForLine(int line) { return JSStringCreateWithCharacters(0, 0); }
C
Chrome
0
CVE-2018-18340
https://www.cvedetails.com/cve/CVE-2018-18340/
CWE-119
https://github.com/chromium/chromium/commit/f5ef337d8fffd10ab327069467ccaedb843cf9db
f5ef337d8fffd10ab327069467ccaedb843cf9db
Check context is attached before creating MediaRecorder Bug: 896736 Change-Id: I3ccfd2188fb15704af14c8af050e0a5667855d34 Reviewed-on: https://chromium-review.googlesource.com/c/1324231 Commit-Queue: Emircan Uysaler <emircan@chromium.org> Reviewed-by: Miguel Casas <mcasas@chromium.org> Cr-Commit-Position: refs/heads/master@{#606242}
void MediaRecorder::Pause() { dispatch_scheduled_event_runner_->Pause(); }
void MediaRecorder::Pause() { dispatch_scheduled_event_runner_->Pause(); }
C
Chrome
0
CVE-2010-2520
https://www.cvedetails.com/cve/CVE-2010-2520/
CWE-119
https://git.savannah.gnu.org/cgit/freetype/freetype2.git/commit/?id=888cd1843e935fe675cf2ac303116d4ed5b9d54b
888cd1843e935fe675cf2ac303116d4ed5b9d54b
null
Read_CVT_Stretched( EXEC_OP_ FT_ULong idx ) { return TT_MULFIX( CUR.cvt[idx], CURRENT_Ratio() ); }
Read_CVT_Stretched( EXEC_OP_ FT_ULong idx ) { return TT_MULFIX( CUR.cvt[idx], CURRENT_Ratio() ); }
C
savannah
0
CVE-2013-6368
https://www.cvedetails.com/cve/CVE-2013-6368/
CWE-20
https://github.com/torvalds/linux/commit/fda4e2e85589191b123d31cdc21fd33ee70f50fd
fda4e2e85589191b123d31cdc21fd33ee70f50fd
KVM: x86: Convert vapic synchronization to _cached functions (CVE-2013-6368) In kvm_lapic_sync_from_vapic and kvm_lapic_sync_to_vapic there is the potential to corrupt kernel memory if userspace provides an address that is at the end of a page. This patches concerts those functions to use kvm_write_guest_cached and kvm_read_guest_cached. It also checks the vapic_address specified by userspace during ioctl processing and returns an error to userspace if the address is not a valid GPA. This is generally not guest triggerable, because the required write is done by firmware that runs before the guest. Also, it only affects AMD processors and oldish Intel that do not have the FlexPriority feature (unless you disable FlexPriority, of course; then newer processors are also affected). Fixes: b93463aa59d6 ('KVM: Accelerated apic support') Reported-by: Andrew Honig <ahonig@google.com> Cc: stable@vger.kernel.org Signed-off-by: Andrew Honig <ahonig@google.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
static int write_exit_mmio(struct kvm_vcpu *vcpu, gpa_t gpa, void *val, int bytes) { struct kvm_mmio_fragment *frag = &vcpu->mmio_fragments[0]; memcpy(vcpu->run->mmio.data, frag->data, min(8u, frag->len)); return X86EMUL_CONTINUE; }
static int write_exit_mmio(struct kvm_vcpu *vcpu, gpa_t gpa, void *val, int bytes) { struct kvm_mmio_fragment *frag = &vcpu->mmio_fragments[0]; memcpy(vcpu->run->mmio.data, frag->data, min(8u, frag->len)); return X86EMUL_CONTINUE; }
C
linux
0
CVE-2018-6151
https://www.cvedetails.com/cve/CVE-2018-6151/
CWE-125
https://github.com/chromium/chromium/commit/cbb2c0940d4e3914ccd74f6466ff4cb9e50e0e86
cbb2c0940d4e3914ccd74f6466ff4cb9e50e0e86
Don't downcast DownloadManagerDelegate to ChromeDownloadManagerDelegate. DownloadManager has public SetDelegate method and tests and or other subsystems can install their own implementations of the delegate. Bug: 805905 Change-Id: Iecf1e0aceada0e1048bed1e2d2ceb29ca64295b8 TBR: tests updated to follow the API change. Reviewed-on: https://chromium-review.googlesource.com/894702 Reviewed-by: David Vallet <dvallet@chromium.org> Reviewed-by: Min Qin <qinmin@chromium.org> Cr-Commit-Position: refs/heads/master@{#533515}
inline Matcher<const base::Callback<bool(const GURL&)>&> ProbablySameFilter( const base::Callback<bool(const GURL&)>& filter) { return MakeMatcher(new ProbablySameFilterMatcher(filter)); }
inline Matcher<const base::Callback<bool(const GURL&)>&> ProbablySameFilter( const base::Callback<bool(const GURL&)>& filter) { return MakeMatcher(new ProbablySameFilterMatcher(filter)); }
C
Chrome
0
CVE-2018-18386
https://www.cvedetails.com/cve/CVE-2018-18386/
CWE-704
https://github.com/torvalds/linux/commit/966031f340185eddd05affcf72b740549f056348
966031f340185eddd05affcf72b740549f056348
n_tty: fix EXTPROC vs ICANON interaction with TIOCINQ (aka FIONREAD) We added support for EXTPROC back in 2010 in commit 26df6d13406d ("tty: Add EXTPROC support for LINEMODE") and the intent was to allow it to override some (all?) ICANON behavior. Quoting from that original commit message: There is a new bit in the termios local flag word, EXTPROC. When this bit is set, several aspects of the terminal driver are disabled. Input line editing, character echo, and mapping of signals are all disabled. This allows the telnetd to turn off these functions when in linemode, but still keep track of what state the user wants the terminal to be in. but the problem turns out that "several aspects of the terminal driver are disabled" is a bit ambiguous, and you can really confuse the n_tty layer by setting EXTPROC and then causing some of the ICANON invariants to no longer be maintained. This fixes at least one such case (TIOCINQ) becoming unhappy because of the confusion over whether ICANON really means ICANON when EXTPROC is set. This basically makes TIOCINQ match the case of read: if EXTPROC is set, we ignore ICANON. Also, make sure to reset the ICANON state ie EXTPROC changes, not just if ICANON changes. Fixes: 26df6d13406d ("tty: Add EXTPROC support for LINEMODE") Reported-by: Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp> Reported-by: syzkaller <syzkaller@googlegroups.com> Cc: Jiri Slaby <jslaby@suse.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
n_tty_receive_buf_closing(struct tty_struct *tty, const unsigned char *cp, char *fp, int count) { char flag = TTY_NORMAL; while (count--) { if (fp) flag = *fp++; if (likely(flag == TTY_NORMAL)) n_tty_receive_char_closing(tty, *cp++); } }
n_tty_receive_buf_closing(struct tty_struct *tty, const unsigned char *cp, char *fp, int count) { char flag = TTY_NORMAL; while (count--) { if (fp) flag = *fp++; if (likely(flag == TTY_NORMAL)) n_tty_receive_char_closing(tty, *cp++); } }
C
linux
0
CVE-2015-8324
https://www.cvedetails.com/cve/CVE-2015-8324/
null
https://github.com/torvalds/linux/commit/744692dc059845b2a3022119871846e74d4f6e11
744692dc059845b2a3022119871846e74d4f6e11
ext4: use ext4_get_block_write in buffer write Allocate uninitialized extent before ext4 buffer write and convert the extent to initialized after io completes. The purpose is to make sure an extent can only be marked initialized after it has been written with new data so we can safely drop the i_mutex lock in ext4 DIO read without exposing stale data. This helps to improve multi-thread DIO read performance on high-speed disks. Skip the nobh and data=journal mount cases to make things simple for now. Signed-off-by: Jiaying Zhang <jiayingz@google.com> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
static int ext4_convert_unwritten_extents_endio(handle_t *handle, struct inode *inode, struct ext4_ext_path *path) { struct ext4_extent *ex; struct ext4_extent_header *eh; int depth; int err = 0; int ret = 0; depth = ext_depth(inode); eh = path[depth].p_hdr; ex = path[depth].p_ext; err = ext4_ext_get_access(handle, inode, path + depth); if (err) goto out; /* first mark the extent as initialized */ ext4_ext_mark_initialized(ex); /* * We have to see if it can be merged with the extent * on the left. */ if (ex > EXT_FIRST_EXTENT(eh)) { /* * To merge left, pass "ex - 1" to try_to_merge(), * since it merges towards right _only_. */ ret = ext4_ext_try_to_merge(inode, path, ex - 1); if (ret) { err = ext4_ext_correct_indexes(handle, inode, path); if (err) goto out; depth = ext_depth(inode); ex--; } } /* * Try to Merge towards right. */ ret = ext4_ext_try_to_merge(inode, path, ex); if (ret) { err = ext4_ext_correct_indexes(handle, inode, path); if (err) goto out; depth = ext_depth(inode); } /* Mark modified extent as dirty */ err = ext4_ext_dirty(handle, inode, path + depth); out: ext4_ext_show_leaf(inode, path); return err; }
static int ext4_convert_unwritten_extents_endio(handle_t *handle, struct inode *inode, struct ext4_ext_path *path) { struct ext4_extent *ex; struct ext4_extent_header *eh; int depth; int err = 0; int ret = 0; depth = ext_depth(inode); eh = path[depth].p_hdr; ex = path[depth].p_ext; err = ext4_ext_get_access(handle, inode, path + depth); if (err) goto out; /* first mark the extent as initialized */ ext4_ext_mark_initialized(ex); /* * We have to see if it can be merged with the extent * on the left. */ if (ex > EXT_FIRST_EXTENT(eh)) { /* * To merge left, pass "ex - 1" to try_to_merge(), * since it merges towards right _only_. */ ret = ext4_ext_try_to_merge(inode, path, ex - 1); if (ret) { err = ext4_ext_correct_indexes(handle, inode, path); if (err) goto out; depth = ext_depth(inode); ex--; } } /* * Try to Merge towards right. */ ret = ext4_ext_try_to_merge(inode, path, ex); if (ret) { err = ext4_ext_correct_indexes(handle, inode, path); if (err) goto out; depth = ext_depth(inode); } /* Mark modified extent as dirty */ err = ext4_ext_dirty(handle, inode, path + depth); out: ext4_ext_show_leaf(inode, path); return err; }
C
linux
0
CVE-2018-20856
https://www.cvedetails.com/cve/CVE-2018-20856/
CWE-416
https://github.com/torvalds/linux/commit/54648cf1ec2d7f4b6a71767799c45676a138ca24
54648cf1ec2d7f4b6a71767799c45676a138ca24
block: blk_init_allocated_queue() set q->fq as NULL in the fail case We find the memory use-after-free issue in __blk_drain_queue() on the kernel 4.14. After read the latest kernel 4.18-rc6 we think it has the same problem. Memory is allocated for q->fq in the blk_init_allocated_queue(). If the elevator init function called with error return, it will run into the fail case to free the q->fq. Then the __blk_drain_queue() uses the same memory after the free of the q->fq, it will lead to the unpredictable event. The patch is to set q->fq as NULL in the fail case of blk_init_allocated_queue(). Fixes: commit 7c94e1c157a2 ("block: introduce blk_flush_queue to drive flush machinery") Cc: <stable@vger.kernel.org> Reviewed-by: Ming Lei <ming.lei@redhat.com> Reviewed-by: Bart Van Assche <bart.vanassche@wdc.com> Signed-off-by: xiao jin <jin.xiao@intel.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
void blk_run_queue_async(struct request_queue *q) { lockdep_assert_held(q->queue_lock); WARN_ON_ONCE(q->mq_ops); if (likely(!blk_queue_stopped(q) && !blk_queue_dead(q))) mod_delayed_work(kblockd_workqueue, &q->delay_work, 0); }
void blk_run_queue_async(struct request_queue *q) { lockdep_assert_held(q->queue_lock); WARN_ON_ONCE(q->mq_ops); if (likely(!blk_queue_stopped(q) && !blk_queue_dead(q))) mod_delayed_work(kblockd_workqueue, &q->delay_work, 0); }
C
linux
0
CVE-2016-9806
https://www.cvedetails.com/cve/CVE-2016-9806/
CWE-415
https://github.com/torvalds/linux/commit/92964c79b357efd980812c4de5c1fd2ec8bb5520
92964c79b357efd980812c4de5c1fd2ec8bb5520
netlink: Fix dump skb leak/double free When we free cb->skb after a dump, we do it after releasing the lock. This means that a new dump could have started in the time being and we'll end up freeing their skb instead of ours. This patch saves the skb and module before we unlock so we free the right memory. Fixes: 16b304f3404f ("netlink: Eliminate kmalloc in netlink dump operation.") Reported-by: Baozeng Ding <sploving1@gmail.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Acked-by: Cong Wang <xiyou.wangcong@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
static void deferred_put_nlk_sk(struct rcu_head *head) { struct netlink_sock *nlk = container_of(head, struct netlink_sock, rcu); sock_put(&nlk->sk); }
static void deferred_put_nlk_sk(struct rcu_head *head) { struct netlink_sock *nlk = container_of(head, struct netlink_sock, rcu); sock_put(&nlk->sk); }
C
linux
0
CVE-2013-2871
https://www.cvedetails.com/cve/CVE-2013-2871/
CWE-20
https://github.com/chromium/chromium/commit/bb9cfb0aba25f4b13e57bdd4a9fac80ba071e7b9
bb9cfb0aba25f4b13e57bdd4a9fac80ba071e7b9
Setting input.x-webkit-speech should not cause focus change In r150866, we introduced element()->focus() in destroyShadowSubtree() to retain focus on <input> when its type attribute gets changed. But when x-webkit-speech attribute is changed, the element is detached before calling destroyShadowSubtree() and element()->focus() failed This patch moves detach() after destroyShadowSubtree() to fix the problem. BUG=243818 TEST=fast/forms/input-type-change-focusout.html NOTRY=true Review URL: https://chromiumcodereview.appspot.com/16084005 git-svn-id: svn://svn.chromium.org/blink/trunk@151444 bbb929c8-8fbe-4397-9dbb-9b2b20218538
bool HTMLInputElement::isTextButton() const { return m_inputType->isTextButton(); }
bool HTMLInputElement::isTextButton() const { return m_inputType->isTextButton(); }
C
Chrome
0
null
null
null
https://github.com/chromium/chromium/commit/9d02cda7a634fbd6e53d98091f618057f0174387
9d02cda7a634fbd6e53d98091f618057f0174387
Coverity: Fixing pass by value. CID=101462, 101458, 101437, 101471, 101467 BUG=NONE TEST=NONE Review URL: http://codereview.chromium.org/9006023 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@115257 0039d316-1c4b-4281-b951-d872f2087c98
void ExtensionPrefs::SetLaunchType(const std::string& extension_id, LaunchType launch_type) { UpdateExtensionPref(extension_id, kPrefLaunchType, Value::CreateIntegerValue(static_cast<int>(launch_type))); }
void ExtensionPrefs::SetLaunchType(const std::string& extension_id, LaunchType launch_type) { UpdateExtensionPref(extension_id, kPrefLaunchType, Value::CreateIntegerValue(static_cast<int>(launch_type))); }
C
Chrome
0
CVE-2018-20784
https://www.cvedetails.com/cve/CVE-2018-20784/
CWE-400
https://github.com/torvalds/linux/commit/c40f7d74c741a907cfaeb73a7697081881c497d0
c40f7d74c741a907cfaeb73a7697081881c497d0
sched/fair: Fix infinite loop in update_blocked_averages() by reverting a9e7f6544b9c Zhipeng Xie, Xie XiuQi and Sargun Dhillon reported lockups in the scheduler under high loads, starting at around the v4.18 time frame, and Zhipeng Xie tracked it down to bugs in the rq->leaf_cfs_rq_list manipulation. Do a (manual) revert of: a9e7f6544b9c ("sched/fair: Fix O(nr_cgroups) in load balance path") It turns out that the list_del_leaf_cfs_rq() introduced by this commit is a surprising property that was not considered in followup commits such as: 9c2791f936ef ("sched/fair: Fix hierarchical order in rq->leaf_cfs_rq_list") As Vincent Guittot explains: "I think that there is a bigger problem with commit a9e7f6544b9c and cfs_rq throttling: Let take the example of the following topology TG2 --> TG1 --> root: 1) The 1st time a task is enqueued, we will add TG2 cfs_rq then TG1 cfs_rq to leaf_cfs_rq_list and we are sure to do the whole branch in one path because it has never been used and can't be throttled so tmp_alone_branch will point to leaf_cfs_rq_list at the end. 2) Then TG1 is throttled 3) and we add TG3 as a new child of TG1. 4) The 1st enqueue of a task on TG3 will add TG3 cfs_rq just before TG1 cfs_rq and tmp_alone_branch will stay on rq->leaf_cfs_rq_list. With commit a9e7f6544b9c, we can del a cfs_rq from rq->leaf_cfs_rq_list. So if the load of TG1 cfs_rq becomes NULL before step 2) above, TG1 cfs_rq is removed from the list. Then at step 4), TG3 cfs_rq is added at the beginning of rq->leaf_cfs_rq_list but tmp_alone_branch still points to TG3 cfs_rq because its throttled parent can't be enqueued when the lock is released. tmp_alone_branch doesn't point to rq->leaf_cfs_rq_list whereas it should. So if TG3 cfs_rq is removed or destroyed before tmp_alone_branch points on another TG cfs_rq, the next TG cfs_rq that will be added, will be linked outside rq->leaf_cfs_rq_list - which is bad. In addition, we can break the ordering of the cfs_rq in rq->leaf_cfs_rq_list but this ordering is used to update and propagate the update from leaf down to root." Instead of trying to work through all these cases and trying to reproduce the very high loads that produced the lockup to begin with, simplify the code temporarily by reverting a9e7f6544b9c - which change was clearly not thought through completely. This (hopefully) gives us a kernel that doesn't lock up so people can continue to enjoy their holidays without worrying about regressions. ;-) [ mingo: Wrote changelog, fixed weird spelling in code comment while at it. ] Analyzed-by: Xie XiuQi <xiexiuqi@huawei.com> Analyzed-by: Vincent Guittot <vincent.guittot@linaro.org> Reported-by: Zhipeng Xie <xiezhipeng1@huawei.com> Reported-by: Sargun Dhillon <sargun@sargun.me> Reported-by: Xie XiuQi <xiexiuqi@huawei.com> Tested-by: Zhipeng Xie <xiezhipeng1@huawei.com> Tested-by: Sargun Dhillon <sargun@sargun.me> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Acked-by: Vincent Guittot <vincent.guittot@linaro.org> Cc: <stable@vger.kernel.org> # v4.13+ Cc: Bin Li <huawei.libin@huawei.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Tejun Heo <tj@kernel.org> Cc: Thomas Gleixner <tglx@linutronix.de> Fixes: a9e7f6544b9c ("sched/fair: Fix O(nr_cgroups) in load balance path") Link: http://lkml.kernel.org/r/1545879866-27809-1-git-send-email-xiexiuqi@huawei.com Signed-off-by: Ingo Molnar <mingo@kernel.org>
pick_next_task_fair(struct rq *rq, struct task_struct *prev, struct rq_flags *rf) { struct cfs_rq *cfs_rq = &rq->cfs; struct sched_entity *se; struct task_struct *p; int new_tasks; again: if (!cfs_rq->nr_running) goto idle; #ifdef CONFIG_FAIR_GROUP_SCHED if (prev->sched_class != &fair_sched_class) goto simple; /* * Because of the set_next_buddy() in dequeue_task_fair() it is rather * likely that a next task is from the same cgroup as the current. * * Therefore attempt to avoid putting and setting the entire cgroup * hierarchy, only change the part that actually changes. */ do { struct sched_entity *curr = cfs_rq->curr; /* * Since we got here without doing put_prev_entity() we also * have to consider cfs_rq->curr. If it is still a runnable * entity, update_curr() will update its vruntime, otherwise * forget we've ever seen it. */ if (curr) { if (curr->on_rq) update_curr(cfs_rq); else curr = NULL; /* * This call to check_cfs_rq_runtime() will do the * throttle and dequeue its entity in the parent(s). * Therefore the nr_running test will indeed * be correct. */ if (unlikely(check_cfs_rq_runtime(cfs_rq))) { cfs_rq = &rq->cfs; if (!cfs_rq->nr_running) goto idle; goto simple; } } se = pick_next_entity(cfs_rq, curr); cfs_rq = group_cfs_rq(se); } while (cfs_rq); p = task_of(se); /* * Since we haven't yet done put_prev_entity and if the selected task * is a different task than we started out with, try and touch the * least amount of cfs_rqs. */ if (prev != p) { struct sched_entity *pse = &prev->se; while (!(cfs_rq = is_same_group(se, pse))) { int se_depth = se->depth; int pse_depth = pse->depth; if (se_depth <= pse_depth) { put_prev_entity(cfs_rq_of(pse), pse); pse = parent_entity(pse); } if (se_depth >= pse_depth) { set_next_entity(cfs_rq_of(se), se); se = parent_entity(se); } } put_prev_entity(cfs_rq, pse); set_next_entity(cfs_rq, se); } goto done; simple: #endif put_prev_task(rq, prev); do { se = pick_next_entity(cfs_rq, NULL); set_next_entity(cfs_rq, se); cfs_rq = group_cfs_rq(se); } while (cfs_rq); p = task_of(se); done: __maybe_unused; #ifdef CONFIG_SMP /* * Move the next running task to the front of * the list, so our cfs_tasks list becomes MRU * one. */ list_move(&p->se.group_node, &rq->cfs_tasks); #endif if (hrtick_enabled(rq)) hrtick_start_fair(rq, p); update_misfit_status(p, rq); return p; idle: update_misfit_status(NULL, rq); new_tasks = idle_balance(rq, rf); /* * Because idle_balance() releases (and re-acquires) rq->lock, it is * possible for any higher priority task to appear. In that case we * must re-start the pick_next_entity() loop. */ if (new_tasks < 0) return RETRY_TASK; if (new_tasks > 0) goto again; return NULL; }
pick_next_task_fair(struct rq *rq, struct task_struct *prev, struct rq_flags *rf) { struct cfs_rq *cfs_rq = &rq->cfs; struct sched_entity *se; struct task_struct *p; int new_tasks; again: if (!cfs_rq->nr_running) goto idle; #ifdef CONFIG_FAIR_GROUP_SCHED if (prev->sched_class != &fair_sched_class) goto simple; /* * Because of the set_next_buddy() in dequeue_task_fair() it is rather * likely that a next task is from the same cgroup as the current. * * Therefore attempt to avoid putting and setting the entire cgroup * hierarchy, only change the part that actually changes. */ do { struct sched_entity *curr = cfs_rq->curr; /* * Since we got here without doing put_prev_entity() we also * have to consider cfs_rq->curr. If it is still a runnable * entity, update_curr() will update its vruntime, otherwise * forget we've ever seen it. */ if (curr) { if (curr->on_rq) update_curr(cfs_rq); else curr = NULL; /* * This call to check_cfs_rq_runtime() will do the * throttle and dequeue its entity in the parent(s). * Therefore the nr_running test will indeed * be correct. */ if (unlikely(check_cfs_rq_runtime(cfs_rq))) { cfs_rq = &rq->cfs; if (!cfs_rq->nr_running) goto idle; goto simple; } } se = pick_next_entity(cfs_rq, curr); cfs_rq = group_cfs_rq(se); } while (cfs_rq); p = task_of(se); /* * Since we haven't yet done put_prev_entity and if the selected task * is a different task than we started out with, try and touch the * least amount of cfs_rqs. */ if (prev != p) { struct sched_entity *pse = &prev->se; while (!(cfs_rq = is_same_group(se, pse))) { int se_depth = se->depth; int pse_depth = pse->depth; if (se_depth <= pse_depth) { put_prev_entity(cfs_rq_of(pse), pse); pse = parent_entity(pse); } if (se_depth >= pse_depth) { set_next_entity(cfs_rq_of(se), se); se = parent_entity(se); } } put_prev_entity(cfs_rq, pse); set_next_entity(cfs_rq, se); } goto done; simple: #endif put_prev_task(rq, prev); do { se = pick_next_entity(cfs_rq, NULL); set_next_entity(cfs_rq, se); cfs_rq = group_cfs_rq(se); } while (cfs_rq); p = task_of(se); done: __maybe_unused; #ifdef CONFIG_SMP /* * Move the next running task to the front of * the list, so our cfs_tasks list becomes MRU * one. */ list_move(&p->se.group_node, &rq->cfs_tasks); #endif if (hrtick_enabled(rq)) hrtick_start_fair(rq, p); update_misfit_status(p, rq); return p; idle: update_misfit_status(NULL, rq); new_tasks = idle_balance(rq, rf); /* * Because idle_balance() releases (and re-acquires) rq->lock, it is * possible for any higher priority task to appear. In that case we * must re-start the pick_next_entity() loop. */ if (new_tasks < 0) return RETRY_TASK; if (new_tasks > 0) goto again; return NULL; }
C
linux
0
CVE-2013-0839
https://www.cvedetails.com/cve/CVE-2013-0839/
CWE-399
https://github.com/chromium/chromium/commit/dd3b6fe574edad231c01c78e4647a74c38dc4178
dd3b6fe574edad231c01c78e4647a74c38dc4178
Remove parent* arg from GDataEntry ctor. * Remove static FromDocumentEntry from GDataEntry, GDataFile, GDataDirectory. Replace with InitFromDocumentEntry. * Move common code from GDataFile::InitFromDocumentEntry and GDataDirectory::InitFromDocumentEntry to GDataEntry::InitFromDocumentEntry. * Add GDataDirectoryService::FromDocumentEntry and use this everywhere. * Make ctors of GDataFile, GDataDirectory private, so these must be created by GDataDirectoryService's CreateGDataFile and CreateGDataDirectory. Make GDataEntry ctor protected. BUG=141494 TEST=unit tests. Review URL: https://chromiumcodereview.appspot.com/10854083 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@151008 0039d316-1c4b-4281-b951-d872f2087c98
GDataDirectory* GDataEntry::AsGDataDirectory() { return NULL; }
GDataDirectory* GDataEntry::AsGDataDirectory() { return NULL; }
C
Chrome
0
CVE-2016-1679
https://www.cvedetails.com/cve/CVE-2016-1679/
null
https://github.com/chromium/chromium/commit/b5bdf3778209179111c9f865af00940e74aa20e7
b5bdf3778209179111c9f865af00940e74aa20e7
V8ValueConverter::ToV8Value should not trigger setters BUG=606390 Review URL: https://codereview.chromium.org/1918793003 Cr-Commit-Position: refs/heads/master@{#390045}
void TestWeirdType(const V8ValueConverterImpl& converter, v8::Local<v8::Value> val, base::Value::Type expected_type, std::unique_ptr<base::Value> expected_value) { v8::Local<v8::Context> context = v8::Local<v8::Context>::New(isolate_, context_); std::unique_ptr<base::Value> raw(converter.FromV8Value(val, context)); if (expected_value) { ASSERT_TRUE(raw.get()); EXPECT_TRUE(expected_value->Equals(raw.get())); EXPECT_EQ(expected_type, raw->GetType()); } else { EXPECT_FALSE(raw.get()); } v8::Local<v8::Object> object(v8::Object::New(isolate_)); object->Set(v8::String::NewFromUtf8(isolate_, "test"), val); std::unique_ptr<base::DictionaryValue> dictionary( static_cast<base::DictionaryValue*>( converter.FromV8Value(object, context))); ASSERT_TRUE(dictionary.get()); if (expected_value) { base::Value* temp = NULL; ASSERT_TRUE(dictionary->Get("test", &temp)); EXPECT_EQ(expected_type, temp->GetType()); EXPECT_TRUE(expected_value->Equals(temp)); } else { EXPECT_FALSE(dictionary->HasKey("test")); } v8::Local<v8::Array> array(v8::Array::New(isolate_)); array->Set(0, val); std::unique_ptr<base::ListValue> list( static_cast<base::ListValue*>(converter.FromV8Value(array, context))); ASSERT_TRUE(list.get()); if (expected_value) { base::Value* temp = NULL; ASSERT_TRUE(list->Get(0, &temp)); EXPECT_EQ(expected_type, temp->GetType()); EXPECT_TRUE(expected_value->Equals(temp)); } else { base::Value* temp = NULL; ASSERT_TRUE(list->Get(0, &temp)); EXPECT_EQ(base::Value::TYPE_NULL, temp->GetType()); } }
void TestWeirdType(const V8ValueConverterImpl& converter, v8::Local<v8::Value> val, base::Value::Type expected_type, std::unique_ptr<base::Value> expected_value) { v8::Local<v8::Context> context = v8::Local<v8::Context>::New(isolate_, context_); std::unique_ptr<base::Value> raw(converter.FromV8Value(val, context)); if (expected_value) { ASSERT_TRUE(raw.get()); EXPECT_TRUE(expected_value->Equals(raw.get())); EXPECT_EQ(expected_type, raw->GetType()); } else { EXPECT_FALSE(raw.get()); } v8::Local<v8::Object> object(v8::Object::New(isolate_)); object->Set(v8::String::NewFromUtf8(isolate_, "test"), val); std::unique_ptr<base::DictionaryValue> dictionary( static_cast<base::DictionaryValue*>( converter.FromV8Value(object, context))); ASSERT_TRUE(dictionary.get()); if (expected_value) { base::Value* temp = NULL; ASSERT_TRUE(dictionary->Get("test", &temp)); EXPECT_EQ(expected_type, temp->GetType()); EXPECT_TRUE(expected_value->Equals(temp)); } else { EXPECT_FALSE(dictionary->HasKey("test")); } v8::Local<v8::Array> array(v8::Array::New(isolate_)); array->Set(0, val); std::unique_ptr<base::ListValue> list( static_cast<base::ListValue*>(converter.FromV8Value(array, context))); ASSERT_TRUE(list.get()); if (expected_value) { base::Value* temp = NULL; ASSERT_TRUE(list->Get(0, &temp)); EXPECT_EQ(expected_type, temp->GetType()); EXPECT_TRUE(expected_value->Equals(temp)); } else { base::Value* temp = NULL; ASSERT_TRUE(list->Get(0, &temp)); EXPECT_EQ(base::Value::TYPE_NULL, temp->GetType()); } }
C
Chrome
0
CVE-2017-18208
https://www.cvedetails.com/cve/CVE-2017-18208/
CWE-835
https://github.com/torvalds/linux/commit/6ea8d958a2c95a1d514015d4e29ba21a8c0a1a91
6ea8d958a2c95a1d514015d4e29ba21a8c0a1a91
mm/madvise.c: fix madvise() infinite loop under special circumstances MADVISE_WILLNEED has always been a noop for DAX (formerly XIP) mappings. Unfortunately madvise_willneed() doesn't communicate this information properly to the generic madvise syscall implementation. The calling convention is quite subtle there. madvise_vma() is supposed to either return an error or update &prev otherwise the main loop will never advance to the next vma and it will keep looping for ever without a way to get out of the kernel. It seems this has been broken since introduction. Nobody has noticed because nobody seems to be using MADVISE_WILLNEED on these DAX mappings. [mhocko@suse.com: rewrite changelog] Link: http://lkml.kernel.org/r/20171127115318.911-1-guoxuenan@huawei.com Fixes: fe77ba6f4f97 ("[PATCH] xip: madvice/fadvice: execute in place") Signed-off-by: chenjie <chenjie6@huawei.com> Signed-off-by: guoxuenan <guoxuenan@huawei.com> Acked-by: Michal Hocko <mhocko@suse.com> Cc: Minchan Kim <minchan@kernel.org> Cc: zhangyi (F) <yi.zhang@huawei.com> Cc: Miao Xie <miaoxie@huawei.com> Cc: Mike Rapoport <rppt@linux.vnet.ibm.com> Cc: Shaohua Li <shli@fb.com> Cc: Andrea Arcangeli <aarcange@redhat.com> Cc: Mel Gorman <mgorman@techsingularity.net> Cc: Kirill A. Shutemov <kirill.shutemov@linux.intel.com> Cc: David Rientjes <rientjes@google.com> Cc: Anshuman Khandual <khandual@linux.vnet.ibm.com> Cc: Rik van Riel <riel@redhat.com> Cc: Carsten Otte <cotte@de.ibm.com> Cc: Dan Williams <dan.j.williams@intel.com> Cc: <stable@vger.kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
static int madvise_free_pte_range(pmd_t *pmd, unsigned long addr, unsigned long end, struct mm_walk *walk) { struct mmu_gather *tlb = walk->private; struct mm_struct *mm = tlb->mm; struct vm_area_struct *vma = walk->vma; spinlock_t *ptl; pte_t *orig_pte, *pte, ptent; struct page *page; int nr_swap = 0; unsigned long next; next = pmd_addr_end(addr, end); if (pmd_trans_huge(*pmd)) if (madvise_free_huge_pmd(tlb, vma, pmd, addr, next)) goto next; if (pmd_trans_unstable(pmd)) return 0; tlb_remove_check_page_size_change(tlb, PAGE_SIZE); orig_pte = pte = pte_offset_map_lock(mm, pmd, addr, &ptl); flush_tlb_batched_pending(mm); arch_enter_lazy_mmu_mode(); for (; addr != end; pte++, addr += PAGE_SIZE) { ptent = *pte; if (pte_none(ptent)) continue; /* * If the pte has swp_entry, just clear page table to * prevent swap-in which is more expensive rather than * (page allocation + zeroing). */ if (!pte_present(ptent)) { swp_entry_t entry; entry = pte_to_swp_entry(ptent); if (non_swap_entry(entry)) continue; nr_swap--; free_swap_and_cache(entry); pte_clear_not_present_full(mm, addr, pte, tlb->fullmm); continue; } page = _vm_normal_page(vma, addr, ptent, true); if (!page) continue; /* * If pmd isn't transhuge but the page is THP and * is owned by only this process, split it and * deactivate all pages. */ if (PageTransCompound(page)) { if (page_mapcount(page) != 1) goto out; get_page(page); if (!trylock_page(page)) { put_page(page); goto out; } pte_unmap_unlock(orig_pte, ptl); if (split_huge_page(page)) { unlock_page(page); put_page(page); pte_offset_map_lock(mm, pmd, addr, &ptl); goto out; } unlock_page(page); put_page(page); pte = pte_offset_map_lock(mm, pmd, addr, &ptl); pte--; addr -= PAGE_SIZE; continue; } VM_BUG_ON_PAGE(PageTransCompound(page), page); if (PageSwapCache(page) || PageDirty(page)) { if (!trylock_page(page)) continue; /* * If page is shared with others, we couldn't clear * PG_dirty of the page. */ if (page_mapcount(page) != 1) { unlock_page(page); continue; } if (PageSwapCache(page) && !try_to_free_swap(page)) { unlock_page(page); continue; } ClearPageDirty(page); unlock_page(page); } if (pte_young(ptent) || pte_dirty(ptent)) { /* * Some of architecture(ex, PPC) don't update TLB * with set_pte_at and tlb_remove_tlb_entry so for * the portability, remap the pte with old|clean * after pte clearing. */ ptent = ptep_get_and_clear_full(mm, addr, pte, tlb->fullmm); ptent = pte_mkold(ptent); ptent = pte_mkclean(ptent); set_pte_at(mm, addr, pte, ptent); tlb_remove_tlb_entry(tlb, pte, addr); } mark_page_lazyfree(page); } out: if (nr_swap) { if (current->mm == mm) sync_mm_rss(mm); add_mm_counter(mm, MM_SWAPENTS, nr_swap); } arch_leave_lazy_mmu_mode(); pte_unmap_unlock(orig_pte, ptl); cond_resched(); next: return 0; }
static int madvise_free_pte_range(pmd_t *pmd, unsigned long addr, unsigned long end, struct mm_walk *walk) { struct mmu_gather *tlb = walk->private; struct mm_struct *mm = tlb->mm; struct vm_area_struct *vma = walk->vma; spinlock_t *ptl; pte_t *orig_pte, *pte, ptent; struct page *page; int nr_swap = 0; unsigned long next; next = pmd_addr_end(addr, end); if (pmd_trans_huge(*pmd)) if (madvise_free_huge_pmd(tlb, vma, pmd, addr, next)) goto next; if (pmd_trans_unstable(pmd)) return 0; tlb_remove_check_page_size_change(tlb, PAGE_SIZE); orig_pte = pte = pte_offset_map_lock(mm, pmd, addr, &ptl); flush_tlb_batched_pending(mm); arch_enter_lazy_mmu_mode(); for (; addr != end; pte++, addr += PAGE_SIZE) { ptent = *pte; if (pte_none(ptent)) continue; /* * If the pte has swp_entry, just clear page table to * prevent swap-in which is more expensive rather than * (page allocation + zeroing). */ if (!pte_present(ptent)) { swp_entry_t entry; entry = pte_to_swp_entry(ptent); if (non_swap_entry(entry)) continue; nr_swap--; free_swap_and_cache(entry); pte_clear_not_present_full(mm, addr, pte, tlb->fullmm); continue; } page = _vm_normal_page(vma, addr, ptent, true); if (!page) continue; /* * If pmd isn't transhuge but the page is THP and * is owned by only this process, split it and * deactivate all pages. */ if (PageTransCompound(page)) { if (page_mapcount(page) != 1) goto out; get_page(page); if (!trylock_page(page)) { put_page(page); goto out; } pte_unmap_unlock(orig_pte, ptl); if (split_huge_page(page)) { unlock_page(page); put_page(page); pte_offset_map_lock(mm, pmd, addr, &ptl); goto out; } unlock_page(page); put_page(page); pte = pte_offset_map_lock(mm, pmd, addr, &ptl); pte--; addr -= PAGE_SIZE; continue; } VM_BUG_ON_PAGE(PageTransCompound(page), page); if (PageSwapCache(page) || PageDirty(page)) { if (!trylock_page(page)) continue; /* * If page is shared with others, we couldn't clear * PG_dirty of the page. */ if (page_mapcount(page) != 1) { unlock_page(page); continue; } if (PageSwapCache(page) && !try_to_free_swap(page)) { unlock_page(page); continue; } ClearPageDirty(page); unlock_page(page); } if (pte_young(ptent) || pte_dirty(ptent)) { /* * Some of architecture(ex, PPC) don't update TLB * with set_pte_at and tlb_remove_tlb_entry so for * the portability, remap the pte with old|clean * after pte clearing. */ ptent = ptep_get_and_clear_full(mm, addr, pte, tlb->fullmm); ptent = pte_mkold(ptent); ptent = pte_mkclean(ptent); set_pte_at(mm, addr, pte, ptent); tlb_remove_tlb_entry(tlb, pte, addr); } mark_page_lazyfree(page); } out: if (nr_swap) { if (current->mm == mm) sync_mm_rss(mm); add_mm_counter(mm, MM_SWAPENTS, nr_swap); } arch_leave_lazy_mmu_mode(); pte_unmap_unlock(orig_pte, ptl); cond_resched(); next: return 0; }
C
linux
0
CVE-2016-5314
https://www.cvedetails.com/cve/CVE-2016-5314/
CWE-787
https://github.com/vadz/libtiff/commit/391e77fcd217e78b2c51342ac3ddb7100ecacdd2
391e77fcd217e78b2c51342ac3ddb7100ecacdd2
* libtiff/tif_pixarlog.c: fix potential buffer write overrun in PixarLogDecode() on corrupted/unexpected images (reported by Mathias Svensson)
horizontalDifference8(unsigned char *ip, int n, int stride, unsigned short *wp, uint16 *From8) { register int r1, g1, b1, a1, r2, g2, b2, a2, mask; #undef CLAMP #define CLAMP(v) (From8[(v)]) mask = CODE_MASK; if (n >= stride) { if (stride == 3) { r2 = wp[0] = CLAMP(ip[0]); g2 = wp[1] = CLAMP(ip[1]); b2 = wp[2] = CLAMP(ip[2]); n -= 3; while (n > 0) { n -= 3; r1 = CLAMP(ip[3]); wp[3] = (uint16)((r1-r2) & mask); r2 = r1; g1 = CLAMP(ip[4]); wp[4] = (uint16)((g1-g2) & mask); g2 = g1; b1 = CLAMP(ip[5]); wp[5] = (uint16)((b1-b2) & mask); b2 = b1; wp += 3; ip += 3; } } else if (stride == 4) { r2 = wp[0] = CLAMP(ip[0]); g2 = wp[1] = CLAMP(ip[1]); b2 = wp[2] = CLAMP(ip[2]); a2 = wp[3] = CLAMP(ip[3]); n -= 4; while (n > 0) { n -= 4; r1 = CLAMP(ip[4]); wp[4] = (uint16)((r1-r2) & mask); r2 = r1; g1 = CLAMP(ip[5]); wp[5] = (uint16)((g1-g2) & mask); g2 = g1; b1 = CLAMP(ip[6]); wp[6] = (uint16)((b1-b2) & mask); b2 = b1; a1 = CLAMP(ip[7]); wp[7] = (uint16)((a1-a2) & mask); a2 = a1; wp += 4; ip += 4; } } else { wp += n + stride - 1; /* point to last one */ ip += n + stride - 1; /* point to last one */ n -= stride; while (n > 0) { REPEAT(stride, wp[0] = CLAMP(ip[0]); wp[stride] -= wp[0]; wp[stride] &= mask; wp--; ip--) n -= stride; } REPEAT(stride, wp[0] = CLAMP(ip[0]); wp--; ip--) } } }
horizontalDifference8(unsigned char *ip, int n, int stride, unsigned short *wp, uint16 *From8) { register int r1, g1, b1, a1, r2, g2, b2, a2, mask; #undef CLAMP #define CLAMP(v) (From8[(v)]) mask = CODE_MASK; if (n >= stride) { if (stride == 3) { r2 = wp[0] = CLAMP(ip[0]); g2 = wp[1] = CLAMP(ip[1]); b2 = wp[2] = CLAMP(ip[2]); n -= 3; while (n > 0) { n -= 3; r1 = CLAMP(ip[3]); wp[3] = (uint16)((r1-r2) & mask); r2 = r1; g1 = CLAMP(ip[4]); wp[4] = (uint16)((g1-g2) & mask); g2 = g1; b1 = CLAMP(ip[5]); wp[5] = (uint16)((b1-b2) & mask); b2 = b1; wp += 3; ip += 3; } } else if (stride == 4) { r2 = wp[0] = CLAMP(ip[0]); g2 = wp[1] = CLAMP(ip[1]); b2 = wp[2] = CLAMP(ip[2]); a2 = wp[3] = CLAMP(ip[3]); n -= 4; while (n > 0) { n -= 4; r1 = CLAMP(ip[4]); wp[4] = (uint16)((r1-r2) & mask); r2 = r1; g1 = CLAMP(ip[5]); wp[5] = (uint16)((g1-g2) & mask); g2 = g1; b1 = CLAMP(ip[6]); wp[6] = (uint16)((b1-b2) & mask); b2 = b1; a1 = CLAMP(ip[7]); wp[7] = (uint16)((a1-a2) & mask); a2 = a1; wp += 4; ip += 4; } } else { wp += n + stride - 1; /* point to last one */ ip += n + stride - 1; /* point to last one */ n -= stride; while (n > 0) { REPEAT(stride, wp[0] = CLAMP(ip[0]); wp[stride] -= wp[0]; wp[stride] &= mask; wp--; ip--) n -= stride; } REPEAT(stride, wp[0] = CLAMP(ip[0]); wp--; ip--) } } }
C
libtiff
0
CVE-2013-7024
https://www.cvedetails.com/cve/CVE-2013-7024/
CWE-119
https://github.com/FFmpeg/FFmpeg/commit/fe448cd28d674c3eff3072552eae366d0b659ce9
fe448cd28d674c3eff3072552eae366d0b659ce9
avcodec/jpeg2000dec: prevent out of array accesses in pixel addressing Fixes Ticket2921 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
static int jpeg2000_read_bitstream_packets(Jpeg2000DecoderContext *s) { int ret = 0; int tileno; for (tileno = 0; tileno < s->numXtiles * s->numYtiles; tileno++) { Jpeg2000Tile *tile = s->tile + tileno; if (ret = init_tile(s, tileno)) return ret; s->g = tile->tile_part[0].tpg; if (ret = jpeg2000_decode_packets(s, tile)) return ret; } return 0; }
static int jpeg2000_read_bitstream_packets(Jpeg2000DecoderContext *s) { int ret = 0; int tileno; for (tileno = 0; tileno < s->numXtiles * s->numYtiles; tileno++) { Jpeg2000Tile *tile = s->tile + tileno; if (ret = init_tile(s, tileno)) return ret; s->g = tile->tile_part[0].tpg; if (ret = jpeg2000_decode_packets(s, tile)) return ret; } return 0; }
C
FFmpeg
0
CVE-2016-5218
https://www.cvedetails.com/cve/CVE-2016-5218/
CWE-20
https://github.com/chromium/chromium/commit/45d901b56f578a74b19ba0d10fa5c4c467f19303
45d901b56f578a74b19ba0d10fa5c4c467f19303
Paint tab groups with the group color. * The background of TabGroupHeader now uses the group color. * The backgrounds of tabs in the group are tinted with the group color. This treatment, along with the colors chosen, are intended to be a placeholder. Bug: 905491 Change-Id: Ic808548f8eba23064606e7fb8c9bba281d0d117f Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1610504 Commit-Queue: Bret Sepulveda <bsep@chromium.org> Reviewed-by: Taylor Bergquist <tbergquist@chromium.org> Cr-Commit-Position: refs/heads/master@{#660498}
Tab* TabStrip::FindTabForEvent(const gfx::Point& point) { DCHECK(touch_layout_); int active_tab_index = touch_layout_->active_index(); Tab* tab = FindTabForEventFrom(point, active_tab_index, -1); return tab ? tab : FindTabForEventFrom(point, active_tab_index + 1, 1); }
Tab* TabStrip::FindTabForEvent(const gfx::Point& point) { DCHECK(touch_layout_); int active_tab_index = touch_layout_->active_index(); Tab* tab = FindTabForEventFrom(point, active_tab_index, -1); return tab ? tab : FindTabForEventFrom(point, active_tab_index + 1, 1); }
C
Chrome
0
CVE-2013-7262
https://www.cvedetails.com/cve/CVE-2013-7262/
CWE-89
https://github.com/mapserver/mapserver/commit/3a10f6b829297dae63492a8c63385044bc6953ed
3a10f6b829297dae63492a8c63385044bc6953ed
Fix potential SQL Injection with postgis TIME filters (#4834)
wkbConvPolygonToShape(wkbObj *w, shapeObj *shape) { int type; int i, nrings; lineObj line; /*endian = */wkbReadChar(w); type = wkbTypeMap(w,wkbReadInt(w)); if( type != WKB_POLYGON ) return MS_FAILURE; /* How many rings? */ nrings = wkbReadInt(w); /* Add each ring to the shape */ for( i = 0; i < nrings; i++ ) { wkbReadLine(w,&line); msAddLineDirectly(shape, &line); } return MS_SUCCESS; }
wkbConvPolygonToShape(wkbObj *w, shapeObj *shape) { int type; int i, nrings; lineObj line; /*endian = */wkbReadChar(w); type = wkbTypeMap(w,wkbReadInt(w)); if( type != WKB_POLYGON ) return MS_FAILURE; /* How many rings? */ nrings = wkbReadInt(w); /* Add each ring to the shape */ for( i = 0; i < nrings; i++ ) { wkbReadLine(w,&line); msAddLineDirectly(shape, &line); } return MS_SUCCESS; }
C
mapserver
0
CVE-2019-5779
https://www.cvedetails.com/cve/CVE-2019-5779/
CWE-264
https://github.com/chromium/chromium/commit/18c5c5dcef9cfccff64f0c23f920ef22822271a9
18c5c5dcef9cfccff64f0c23f920ef22822271a9
service worker: Make navigate/openWindow go through more security checks. WindowClient.navigate() and Clients.openWindow() were implemented in a way that directly navigated to the URL without going through some checks that the normal navigation path goes through. This CL attempts to fix that: - WindowClient.navigate() now goes through Navigator::RequestOpenURL() instead of directly through WebContents::OpenURL(). - Clients.openWindow() now calls more ContentBrowserClient functions for manipulating the navigation before invoking ContentBrowserClient::OpenURL(). Bug: 904219 Change-Id: Ic38978aee98c09834fdbbc240164068faa3fd4f5 Reviewed-on: https://chromium-review.googlesource.com/c/1345686 Commit-Queue: Matt Falkenhagen <falken@chromium.org> Reviewed-by: Arthur Sonzogni <arthursonzogni@chromium.org> Reviewed-by: Kinuko Yasuda <kinuko@chromium.org> Cr-Commit-Position: refs/heads/master@{#610753}
std::unique_ptr<service_manager::Service> CreatePrefService( base::RepeatingCallback<prefs::InProcessPrefServiceFactory*()> factory_callback) { auto* factory = factory_callback.Run(); if (!factory) return std::make_unique<service_manager::Service>(); return factory->CreatePrefService(); }
std::unique_ptr<service_manager::Service> CreatePrefService( base::RepeatingCallback<prefs::InProcessPrefServiceFactory*()> factory_callback) { auto* factory = factory_callback.Run(); if (!factory) return std::make_unique<service_manager::Service>(); return factory->CreatePrefService(); }
C
Chrome
0
CVE-2012-1174
https://www.cvedetails.com/cve/CVE-2012-1174/
CWE-362
https://cgit.freedesktop.org/systemd/systemd/commit/?id=5ebff5337594d690b322078c512eb222d34aaa82
5ebff5337594d690b322078c512eb222d34aaa82
null
int getttyname_harder(int fd, char **r) { int k; char *s; if ((k = getttyname_malloc(fd, &s)) < 0) return k; if (streq(s, "tty")) { free(s); return get_ctty(0, NULL, r); } *r = s; return 0; }
int getttyname_harder(int fd, char **r) { int k; char *s; if ((k = getttyname_malloc(fd, &s)) < 0) return k; if (streq(s, "tty")) { free(s); return get_ctty(0, NULL, r); } *r = s; return 0; }
C
systemd
0
CVE-2017-5019
https://www.cvedetails.com/cve/CVE-2017-5019/
CWE-416
https://github.com/chromium/chromium/commit/f03ea5a5c2ff26e239dfd23e263b15da2d9cee93
f03ea5a5c2ff26e239dfd23e263b15da2d9cee93
Convert FrameHostMsg_DidAddMessageToConsole to Mojo. Note: Since this required changing the test RenderViewImplTest.DispatchBeforeUnloadCanDetachFrame, I manually re-introduced https://crbug.com/666714 locally (the bug the test was added for), and reran the test to confirm that it still covers the bug. Bug: 786836 Change-Id: I110668fa6f0f261fd2ac36bb91a8d8b31c99f4f1 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1526270 Commit-Queue: Lowell Manners <lowell@chromium.org> Reviewed-by: Daniel Cheng <dcheng@chromium.org> Reviewed-by: Camille Lamy <clamy@chromium.org> Cr-Commit-Position: refs/heads/master@{#653137}
TestRenderFrame::TakeLastDocumentInterfaceBrokerRequest() { return mock_frame_host_->TakeLastDocumentInterfaceBrokerRequest(); }
TestRenderFrame::TakeLastDocumentInterfaceBrokerRequest() { return mock_frame_host_->TakeLastDocumentInterfaceBrokerRequest(); }
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
bool OSExchangeDataProviderAura::HasFile() const { return (formats_ & OSExchangeData::FILE_NAME) != 0; }
bool OSExchangeDataProviderAura::HasFile() const { return (formats_ & OSExchangeData::FILE_NAME) != 0; }
C
Chrome
0
CVE-2018-12904
https://www.cvedetails.com/cve/CVE-2018-12904/
null
https://github.com/torvalds/linux/commit/727ba748e110b4de50d142edca9d6a9b7e6111d8
727ba748e110b4de50d142edca9d6a9b7e6111d8
kvm: nVMX: Enforce cpl=0 for VMX instructions VMX instructions executed inside a L1 VM will always trigger a VM exit even when executed with cpl 3. This means we must perform the privilege check in software. Fixes: 70f3aac964ae("kvm: nVMX: Remove superfluous VMX instruction fault checks") Cc: stable@vger.kernel.org Signed-off-by: Felix Wilhelm <fwilhelm@google.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
static inline u32 evmcs_read32(unsigned long field) { return 0; }
static inline u32 evmcs_read32(unsigned long field) { return 0; }
C
linux
0
CVE-2018-12714
https://www.cvedetails.com/cve/CVE-2018-12714/
CWE-787
https://github.com/torvalds/linux/commit/81f9c4e4177d31ced6f52a89bb70e93bfb77ca03
81f9c4e4177d31ced6f52a89bb70e93bfb77ca03
Merge tag 'trace-v4.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace Pull tracing fixes from Steven Rostedt: "This contains a few fixes and a clean up. - a bad merge caused an "endif" to go in the wrong place in scripts/Makefile.build - softirq tracing fix for tracing that corrupts lockdep and causes a false splat - histogram documentation typo fixes - fix a bad memory reference when passing in no filter to the filter code - simplify code by using the swap macro instead of open coding the swap" * tag 'trace-v4.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace: tracing: Fix SKIP_STACK_VALIDATION=1 build due to bad merge with -mrecord-mcount tracing: Fix some errors in histogram documentation tracing: Use swap macro in update_max_tr softirq: Reorder trace_softirqs_on to prevent lockdep splat tracing: Check for no filter when processing event filters
static void free_prog(struct event_filter *filter) { struct prog_entry *prog; int i; prog = rcu_access_pointer(filter->prog); if (!prog) return; for (i = 0; prog[i].pred; i++) kfree(prog[i].pred); kfree(prog); }
static void free_prog(struct event_filter *filter) { struct prog_entry *prog; int i; prog = rcu_access_pointer(filter->prog); if (!prog) return; for (i = 0; prog[i].pred; i++) kfree(prog[i].pred); kfree(prog); }
C
linux
0
CVE-2010-2498
https://www.cvedetails.com/cve/CVE-2010-2498/
CWE-399
https://git.savannah.gnu.org/cgit/freetype/freetype2.git/commit/?id=8d22746c9e5af80ff4304aef440986403a5072e2
8d22746c9e5af80ff4304aef440986403a5072e2
null
psh_glyph_init( PSH_Glyph glyph, FT_Outline* outline, PS_Hints ps_hints, PSH_Globals globals ) { FT_Error error; FT_Memory memory; /* clear all fields */ FT_MEM_ZERO( glyph, sizeof ( *glyph ) ); memory = glyph->memory = globals->memory; /* allocate and setup points + contours arrays */ if ( FT_NEW_ARRAY( glyph->points, outline->n_points ) || FT_NEW_ARRAY( glyph->contours, outline->n_contours ) ) goto Exit; glyph->num_points = outline->n_points; glyph->num_contours = outline->n_contours; { FT_UInt first = 0, next, n; PSH_Point points = glyph->points; PSH_Contour contour = glyph->contours; for ( n = 0; n < glyph->num_contours; n++ ) { FT_Int count; PSH_Point point; next = outline->contours[n] + 1; count = next - first; contour->start = points + first; contour->count = (FT_UInt)count; if ( count > 0 ) { point = points + first; point->prev = points + next - 1; point->contour = contour; for ( ; count > 1; count-- ) { point[0].next = point + 1; point[1].prev = point; point++; point->contour = contour; } point->next = points + first; } contour++; first = next; } } { PSH_Point points = glyph->points; PSH_Point point = points; FT_Vector* vec = outline->points; FT_UInt n; for ( n = 0; n < glyph->num_points; n++, point++ ) { FT_Int n_prev = (FT_Int)( point->prev - points ); FT_Int n_next = (FT_Int)( point->next - points ); FT_Pos dxi, dyi, dxo, dyo; if ( !( outline->tags[n] & FT_CURVE_TAG_ON ) ) point->flags = PSH_POINT_OFF; dxi = vec[n].x - vec[n_prev].x; dyi = vec[n].y - vec[n_prev].y; point->dir_in = (FT_Char)psh_compute_dir( dxi, dyi ); dxo = vec[n_next].x - vec[n].x; dyo = vec[n_next].y - vec[n].y; point->dir_out = (FT_Char)psh_compute_dir( dxo, dyo ); /* detect smooth points */ if ( point->flags & PSH_POINT_OFF ) point->flags |= PSH_POINT_SMOOTH; else if ( point->dir_in == point->dir_out ) { if ( point->dir_out != PSH_DIR_NONE || psh_corner_is_flat( dxi, dyi, dxo, dyo ) ) point->flags |= PSH_POINT_SMOOTH; } } } glyph->outline = outline; glyph->globals = globals; #ifdef COMPUTE_INFLEXS psh_glyph_load_points( glyph, 0 ); psh_glyph_compute_inflections( glyph ); #endif /* COMPUTE_INFLEXS */ /* now deal with hints tables */ error = psh_hint_table_init( &glyph->hint_tables [0], &ps_hints->dimension[0].hints, &ps_hints->dimension[0].masks, &ps_hints->dimension[0].counters, memory ); if ( error ) goto Exit; error = psh_hint_table_init( &glyph->hint_tables [1], &ps_hints->dimension[1].hints, &ps_hints->dimension[1].masks, &ps_hints->dimension[1].counters, memory ); if ( error ) goto Exit; Exit: return error; }
psh_glyph_init( PSH_Glyph glyph, FT_Outline* outline, PS_Hints ps_hints, PSH_Globals globals ) { FT_Error error; FT_Memory memory; /* clear all fields */ FT_MEM_ZERO( glyph, sizeof ( *glyph ) ); memory = glyph->memory = globals->memory; /* allocate and setup points + contours arrays */ if ( FT_NEW_ARRAY( glyph->points, outline->n_points ) || FT_NEW_ARRAY( glyph->contours, outline->n_contours ) ) goto Exit; glyph->num_points = outline->n_points; glyph->num_contours = outline->n_contours; { FT_UInt first = 0, next, n; PSH_Point points = glyph->points; PSH_Contour contour = glyph->contours; for ( n = 0; n < glyph->num_contours; n++ ) { FT_Int count; PSH_Point point; next = outline->contours[n] + 1; count = next - first; contour->start = points + first; contour->count = (FT_UInt)count; if ( count > 0 ) { point = points + first; point->prev = points + next - 1; point->contour = contour; for ( ; count > 1; count-- ) { point[0].next = point + 1; point[1].prev = point; point++; point->contour = contour; } point->next = points + first; } contour++; first = next; } } { PSH_Point points = glyph->points; PSH_Point point = points; FT_Vector* vec = outline->points; FT_UInt n; for ( n = 0; n < glyph->num_points; n++, point++ ) { FT_Int n_prev = (FT_Int)( point->prev - points ); FT_Int n_next = (FT_Int)( point->next - points ); FT_Pos dxi, dyi, dxo, dyo; if ( !( outline->tags[n] & FT_CURVE_TAG_ON ) ) point->flags = PSH_POINT_OFF; dxi = vec[n].x - vec[n_prev].x; dyi = vec[n].y - vec[n_prev].y; point->dir_in = (FT_Char)psh_compute_dir( dxi, dyi ); dxo = vec[n_next].x - vec[n].x; dyo = vec[n_next].y - vec[n].y; point->dir_out = (FT_Char)psh_compute_dir( dxo, dyo ); /* detect smooth points */ if ( point->flags & PSH_POINT_OFF ) point->flags |= PSH_POINT_SMOOTH; else if ( point->dir_in == point->dir_out ) { if ( point->dir_out != PSH_DIR_NONE || psh_corner_is_flat( dxi, dyi, dxo, dyo ) ) point->flags |= PSH_POINT_SMOOTH; } } } glyph->outline = outline; glyph->globals = globals; #ifdef COMPUTE_INFLEXS psh_glyph_load_points( glyph, 0 ); psh_glyph_compute_inflections( glyph ); #endif /* COMPUTE_INFLEXS */ /* now deal with hints tables */ error = psh_hint_table_init( &glyph->hint_tables [0], &ps_hints->dimension[0].hints, &ps_hints->dimension[0].masks, &ps_hints->dimension[0].counters, memory ); if ( error ) goto Exit; error = psh_hint_table_init( &glyph->hint_tables [1], &ps_hints->dimension[1].hints, &ps_hints->dimension[1].masks, &ps_hints->dimension[1].counters, memory ); if ( error ) goto Exit; Exit: return error; }
C
savannah
0
CVE-2013-7339
https://www.cvedetails.com/cve/CVE-2013-7339/
CWE-399
https://github.com/torvalds/linux/commit/c2349758acf1874e4c2b93fe41d072336f1a31d0
c2349758acf1874e4c2b93fe41d072336f1a31d0
rds: prevent dereference of a NULL device Binding might result in a NULL device, which is dereferenced causing this BUG: [ 1317.260548] BUG: unable to handle kernel NULL pointer dereference at 000000000000097 4 [ 1317.261847] IP: [<ffffffff84225f52>] rds_ib_laddr_check+0x82/0x110 [ 1317.263315] PGD 418bcb067 PUD 3ceb21067 PMD 0 [ 1317.263502] Oops: 0000 [#1] PREEMPT SMP DEBUG_PAGEALLOC [ 1317.264179] Dumping ftrace buffer: [ 1317.264774] (ftrace buffer empty) [ 1317.265220] Modules linked in: [ 1317.265824] CPU: 4 PID: 836 Comm: trinity-child46 Tainted: G W 3.13.0-rc4- next-20131218-sasha-00013-g2cebb9b-dirty #4159 [ 1317.267415] task: ffff8803ddf33000 ti: ffff8803cd31a000 task.ti: ffff8803cd31a000 [ 1317.268399] RIP: 0010:[<ffffffff84225f52>] [<ffffffff84225f52>] rds_ib_laddr_check+ 0x82/0x110 [ 1317.269670] RSP: 0000:ffff8803cd31bdf8 EFLAGS: 00010246 [ 1317.270230] RAX: 0000000000000000 RBX: ffff88020b0dd388 RCX: 0000000000000000 [ 1317.270230] RDX: ffffffff8439822e RSI: 00000000000c000a RDI: 0000000000000286 [ 1317.270230] RBP: ffff8803cd31be38 R08: 0000000000000000 R09: 0000000000000000 [ 1317.270230] R10: 0000000000000000 R11: 0000000000000001 R12: 0000000000000000 [ 1317.270230] R13: 0000000054086700 R14: 0000000000a25de0 R15: 0000000000000031 [ 1317.270230] FS: 00007ff40251d700(0000) GS:ffff88022e200000(0000) knlGS:000000000000 0000 [ 1317.270230] CS: 0010 DS: 0000 ES: 0000 CR0: 000000008005003b [ 1317.270230] CR2: 0000000000000974 CR3: 00000003cd478000 CR4: 00000000000006e0 [ 1317.270230] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 [ 1317.270230] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000090602 [ 1317.270230] Stack: [ 1317.270230] 0000000054086700 5408670000a25de0 5408670000000002 0000000000000000 [ 1317.270230] ffffffff84223542 00000000ea54c767 0000000000000000 ffffffff86d26160 [ 1317.270230] ffff8803cd31be68 ffffffff84223556 ffff8803cd31beb8 ffff8800c6765280 [ 1317.270230] Call Trace: [ 1317.270230] [<ffffffff84223542>] ? rds_trans_get_preferred+0x42/0xa0 [ 1317.270230] [<ffffffff84223556>] rds_trans_get_preferred+0x56/0xa0 [ 1317.270230] [<ffffffff8421c9c3>] rds_bind+0x73/0xf0 [ 1317.270230] [<ffffffff83e4ce62>] SYSC_bind+0x92/0xf0 [ 1317.270230] [<ffffffff812493f8>] ? context_tracking_user_exit+0xb8/0x1d0 [ 1317.270230] [<ffffffff8119313d>] ? trace_hardirqs_on+0xd/0x10 [ 1317.270230] [<ffffffff8107a852>] ? syscall_trace_enter+0x32/0x290 [ 1317.270230] [<ffffffff83e4cece>] SyS_bind+0xe/0x10 [ 1317.270230] [<ffffffff843a6ad0>] tracesys+0xdd/0xe2 [ 1317.270230] Code: 00 8b 45 cc 48 8d 75 d0 48 c7 45 d8 00 00 00 00 66 c7 45 d0 02 00 89 45 d4 48 89 df e8 78 49 76 ff 41 89 c4 85 c0 75 0c 48 8b 03 <80> b8 74 09 00 00 01 7 4 06 41 bc 9d ff ff ff f6 05 2a b6 c2 02 [ 1317.270230] RIP [<ffffffff84225f52>] rds_ib_laddr_check+0x82/0x110 [ 1317.270230] RSP <ffff8803cd31bdf8> [ 1317.270230] CR2: 0000000000000974 Signed-off-by: Sasha Levin <sasha.levin@oracle.com> Signed-off-by: David S. Miller <davem@davemloft.net>
static void rds_ib_dev_shutdown(struct rds_ib_device *rds_ibdev) { struct rds_ib_connection *ic; unsigned long flags; spin_lock_irqsave(&rds_ibdev->spinlock, flags); list_for_each_entry(ic, &rds_ibdev->conn_list, ib_node) rds_conn_drop(ic->conn); spin_unlock_irqrestore(&rds_ibdev->spinlock, flags); }
static void rds_ib_dev_shutdown(struct rds_ib_device *rds_ibdev) { struct rds_ib_connection *ic; unsigned long flags; spin_lock_irqsave(&rds_ibdev->spinlock, flags); list_for_each_entry(ic, &rds_ibdev->conn_list, ib_node) rds_conn_drop(ic->conn); spin_unlock_irqrestore(&rds_ibdev->spinlock, flags); }
C
linux
0
CVE-2015-6787
https://www.cvedetails.com/cve/CVE-2015-6787/
null
https://github.com/chromium/chromium/commit/f911e11e7f6b5c0d6f5ee694a9871de6619889f7
f911e11e7f6b5c0d6f5ee694a9871de6619889f7
Reland "[CI] Make paint property nodes non-ref-counted" This reverts commit 887383b30842d9d9006e11bb6932660a3cb5b1b7. Reason for revert: Retry in M69. Original change's description: > Revert "[CI] Make paint property nodes non-ref-counted" > > This reverts commit 70fc0b018c9517558b7aa2be00edf2debb449123. > > Reason for revert: Caused bugs found by clusterfuzz > > Original change's description: > > [CI] Make paint property nodes non-ref-counted > > > > Now all paint property nodes are owned by ObjectPaintProperties > > (and LocalFrameView temporarily before removing non-RLS mode). > > Others just use raw pointers or references. > > > > Bug: 833496 > > Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2 > > Change-Id: I2d544fe153bb94698623248748df63c8aa2081ae > > Reviewed-on: https://chromium-review.googlesource.com/1031101 > > Reviewed-by: Tien-Ren Chen <trchen@chromium.org> > > Commit-Queue: Xianzhu Wang <wangxianzhu@chromium.org> > > Cr-Commit-Position: refs/heads/master@{#554626} > > TBR=wangxianzhu@chromium.org,trchen@chromium.org,chrishtr@chromium.org > > Change-Id: I02bb50d6744cb81a797246a0116b677e80a3c69f > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: 833496,837932,837943 > Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2 > Reviewed-on: https://chromium-review.googlesource.com/1034292 > Reviewed-by: Xianzhu Wang <wangxianzhu@chromium.org> > Commit-Queue: Xianzhu Wang <wangxianzhu@chromium.org> > Cr-Commit-Position: refs/heads/master@{#554653} TBR=wangxianzhu@chromium.org,trchen@chromium.org,chrishtr@chromium.org # Not skipping CQ checks because original CL landed > 1 day ago. Bug: 833496, 837932, 837943 Change-Id: I0b4ef70db1f1f211ba97c30d617225355c750992 Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2 Reviewed-on: https://chromium-review.googlesource.com/1083491 Commit-Queue: Xianzhu Wang <wangxianzhu@chromium.org> Reviewed-by: Xianzhu Wang <wangxianzhu@chromium.org> Cr-Commit-Position: refs/heads/master@{#563930}
void CompositedLayerRasterInvalidator::FullyInvalidateOldChunk( const PaintChunkInfo& info, PaintInvalidationReason reason) { String debug_name; if (tracking_info_) debug_name = tracking_info_->old_client_debug_names.at(&info.id.client); AddRasterInvalidation(info.bounds_in_layer, &info.id.client, reason, &debug_name); }
void CompositedLayerRasterInvalidator::FullyInvalidateOldChunk( const PaintChunkInfo& info, PaintInvalidationReason reason) { String debug_name; if (tracking_info_) debug_name = tracking_info_->old_client_debug_names.at(&info.id.client); AddRasterInvalidation(info.bounds_in_layer, &info.id.client, reason, &debug_name); }
C
Chrome
0
CVE-2017-15419
https://www.cvedetails.com/cve/CVE-2017-15419/
CWE-601
https://github.com/chromium/chromium/commit/fa17c9878dbeebf991b25ac0deb2b4635d85f1b6
fa17c9878dbeebf991b25ac0deb2b4635d85f1b6
Resource Timing: Do not report subsequent navigations within subframes We only want to record resource timing for the load that was initiated by parent document. We filter out subsequent navigations for <iframe>, but we should do it for other types of subframes too. Bug: 780312 Change-Id: I3a7b9e1a365c99e24bb8dac190e88c7099fc3da5 Reviewed-on: https://chromium-review.googlesource.com/750487 Reviewed-by: Nate Chapin <japhet@chromium.org> Commit-Queue: Kunihiko Sakamoto <ksakamoto@chromium.org> Cr-Commit-Position: refs/heads/master@{#513665}
void HTMLIFrameElement::RemovedFrom(ContainerNode* insertion_point) { HTMLFrameElementBase::RemovedFrom(insertion_point); if (insertion_point->IsInDocumentTree() && GetDocument().IsHTMLDocument()) ToHTMLDocument(GetDocument()).RemoveNamedItem(name_); }
void HTMLIFrameElement::RemovedFrom(ContainerNode* insertion_point) { HTMLFrameElementBase::RemovedFrom(insertion_point); if (insertion_point->IsInDocumentTree() && GetDocument().IsHTMLDocument()) ToHTMLDocument(GetDocument()).RemoveNamedItem(name_); }
C
Chrome
0
CVE-2012-0028
https://www.cvedetails.com/cve/CVE-2012-0028/
CWE-264
https://github.com/torvalds/linux/commit/8141c7f3e7aee618312fa1c15109e1219de784a7
8141c7f3e7aee618312fa1c15109e1219de784a7
Move "exit_robust_list" into mm_release() We don't want to get rid of the futexes just at exit() time, we want to drop them when doing an execve() too, since that gets rid of the previous VM image too. Doing it at mm_release() time means that we automatically always do it when we disassociate a VM map from the task. Reported-by: pageexec@freemail.hu Cc: Andrew Morton <akpm@linux-foundation.org> Cc: Nick Piggin <npiggin@suse.de> Cc: Hugh Dickins <hugh@veritas.com> Cc: Ingo Molnar <mingo@elte.hu> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Brad Spengler <spender@grsecurity.net> Cc: Alex Efros <powerman@powerman.name> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Oleg Nesterov <oleg@redhat.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
mm_need_new_owner(struct mm_struct *mm, struct task_struct *p) { /* * If there are other users of the mm and the owner (us) is exiting * we need to find a new owner to take on the responsibility. */ if (atomic_read(&mm->mm_users) <= 1) return 0; if (mm->owner != p) return 0; return 1; }
mm_need_new_owner(struct mm_struct *mm, struct task_struct *p) { /* * If there are other users of the mm and the owner (us) is exiting * we need to find a new owner to take on the responsibility. */ if (atomic_read(&mm->mm_users) <= 1) return 0; if (mm->owner != p) return 0; return 1; }
C
linux
0
CVE-2018-12436
https://www.cvedetails.com/cve/CVE-2018-12436/
CWE-200
https://github.com/wolfSSL/wolfssl/commit/9b9568d500f31f964af26ba8d01e542e1f27e5ca
9b9568d500f31f964af26ba8d01e542e1f27e5ca
Change ECDSA signing to use blinding.
int wc_ecc_get_curve_size_from_name(const char* curveName) { int curve_idx; if (curveName == NULL) return BAD_FUNC_ARG; curve_idx = wc_ecc_get_curve_idx_from_name(curveName); if (curve_idx < 0) return curve_idx; return ecc_sets[curve_idx].size; }
int wc_ecc_get_curve_size_from_name(const char* curveName) { int curve_idx; if (curveName == NULL) return BAD_FUNC_ARG; curve_idx = wc_ecc_get_curve_idx_from_name(curveName); if (curve_idx < 0) return curve_idx; return ecc_sets[curve_idx].size; }
C
wolfssl
0
CVE-2014-6269
https://www.cvedetails.com/cve/CVE-2014-6269/
CWE-189
https://git.haproxy.org/?p=haproxy-1.5.git;a=commitdiff;h=b4d05093bc89f71377230228007e69a1434c1a0c
b4d05093bc89f71377230228007e69a1434c1a0c
null
static void stream_int_chk_snd(struct stream_interface *si) { struct channel *ob = si->ob; DPRINTF(stderr, "%s: si=%p, si->state=%d ib->flags=%08x ob->flags=%08x\n", __FUNCTION__, si, si->state, si->ib->flags, si->ob->flags); if (unlikely(si->state != SI_ST_EST || (si->ob->flags & CF_SHUTW))) return; if (!(si->flags & SI_FL_WAIT_DATA) || /* not waiting for data */ channel_is_empty(ob)) /* called with nothing to send ! */ return; /* Otherwise there are remaining data to be sent in the buffer, * so we tell the handler. */ si->flags &= ~SI_FL_WAIT_DATA; if (!tick_isset(ob->wex)) ob->wex = tick_add_ifset(now_ms, ob->wto); if (!(si->flags & SI_FL_DONT_WAKE) && si->owner) task_wakeup(si->owner, TASK_WOKEN_IO); }
static void stream_int_chk_snd(struct stream_interface *si) { struct channel *ob = si->ob; DPRINTF(stderr, "%s: si=%p, si->state=%d ib->flags=%08x ob->flags=%08x\n", __FUNCTION__, si, si->state, si->ib->flags, si->ob->flags); if (unlikely(si->state != SI_ST_EST || (si->ob->flags & CF_SHUTW))) return; if (!(si->flags & SI_FL_WAIT_DATA) || /* not waiting for data */ channel_is_empty(ob)) /* called with nothing to send ! */ return; /* Otherwise there are remaining data to be sent in the buffer, * so we tell the handler. */ si->flags &= ~SI_FL_WAIT_DATA; if (!tick_isset(ob->wex)) ob->wex = tick_add_ifset(now_ms, ob->wto); if (!(si->flags & SI_FL_DONT_WAKE) && si->owner) task_wakeup(si->owner, TASK_WOKEN_IO); }
C
haproxy
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
int Gfx::getPos() { return parser ? parser->getPos() : -1; }
int Gfx::getPos() { return parser ? parser->getPos() : -1; }
CPP
poppler
0
CVE-2016-10030
https://www.cvedetails.com/cve/CVE-2016-10030/
CWE-284
https://github.com/SchedMD/slurm/commit/92362a92fffe60187df61f99ab11c249d44120ee
92362a92fffe60187df61f99ab11c249d44120ee
Fix security issue in _prolog_error(). Fix security issue caused by insecure file path handling triggered by the failure of a Prolog script. To exploit this a user needs to anticipate or cause the Prolog to fail for their job. (This commit is slightly different from the fix to the 15.08 branch.) CVE-2016-10030.
_valid_sbcast_cred(file_bcast_msg_t *req, uid_t req_uid, uint16_t block_no, uint32_t *job_id) { int rc = SLURM_SUCCESS; char *nodes = NULL; hostset_t hset = NULL; *job_id = NO_VAL; rc = extract_sbcast_cred(conf->vctx, req->cred, block_no, job_id, &nodes); if (rc != 0) { error("Security violation: Invalid sbcast_cred from uid %d", req_uid); return ESLURMD_INVALID_JOB_CREDENTIAL; } if (!(hset = hostset_create(nodes))) { error("Unable to parse sbcast_cred hostlist %s", nodes); rc = ESLURMD_INVALID_JOB_CREDENTIAL; } else if (!hostset_within(hset, conf->node_name)) { error("Security violation: sbcast_cred from %d has " "bad hostset %s", req_uid, nodes); rc = ESLURMD_INVALID_JOB_CREDENTIAL; } if (hset) hostset_destroy(hset); xfree(nodes); /* print_sbcast_cred(req->cred); */ return rc; }
_valid_sbcast_cred(file_bcast_msg_t *req, uid_t req_uid, uint16_t block_no, uint32_t *job_id) { int rc = SLURM_SUCCESS; char *nodes = NULL; hostset_t hset = NULL; *job_id = NO_VAL; rc = extract_sbcast_cred(conf->vctx, req->cred, block_no, job_id, &nodes); if (rc != 0) { error("Security violation: Invalid sbcast_cred from uid %d", req_uid); return ESLURMD_INVALID_JOB_CREDENTIAL; } if (!(hset = hostset_create(nodes))) { error("Unable to parse sbcast_cred hostlist %s", nodes); rc = ESLURMD_INVALID_JOB_CREDENTIAL; } else if (!hostset_within(hset, conf->node_name)) { error("Security violation: sbcast_cred from %d has " "bad hostset %s", req_uid, nodes); rc = ESLURMD_INVALID_JOB_CREDENTIAL; } if (hset) hostset_destroy(hset); xfree(nodes); /* print_sbcast_cred(req->cred); */ return rc; }
C
slurm
0
CVE-2014-7908
https://www.cvedetails.com/cve/CVE-2014-7908/
CWE-189
https://github.com/chromium/chromium/commit/b2006ac87cec58363090e7d5e10d5d9e3bbda9f9
b2006ac87cec58363090e7d5e10d5d9e3bbda9f9
Add extra checks to avoid integer overflow. BUG=425980 TEST=no crash with ASAN Review URL: https://codereview.chromium.org/659743004 Cr-Commit-Position: refs/heads/master@{#301249}
static uint64 ReadBits(BitReader* reader, int num_bits) { DCHECK_GE(reader->bits_available(), num_bits); DCHECK((num_bits > 0) && (num_bits <= 64)); uint64 value; reader->ReadBits(num_bits, &value); return value; }
static uint64 ReadBits(BitReader* reader, int num_bits) { DCHECK_GE(reader->bits_available(), num_bits); DCHECK((num_bits > 0) && (num_bits <= 64)); uint64 value; reader->ReadBits(num_bits, &value); return value; }
C
Chrome
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 <luto@amacapital.net> Acked-by: Paolo Bonzini <pbonzini@redhat.com> Cc: stable@vger.kernel.org Cc: Petr Matousek <pmatouse@redhat.com> Cc: Gleb Natapov <gleb@kernel.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
static void set_cr4_guest_host_mask(struct vcpu_vmx *vmx) { vmx->vcpu.arch.cr4_guest_owned_bits = KVM_CR4_GUEST_OWNED_BITS; if (enable_ept) vmx->vcpu.arch.cr4_guest_owned_bits |= X86_CR4_PGE; if (is_guest_mode(&vmx->vcpu)) vmx->vcpu.arch.cr4_guest_owned_bits &= ~get_vmcs12(&vmx->vcpu)->cr4_guest_host_mask; vmcs_writel(CR4_GUEST_HOST_MASK, ~vmx->vcpu.arch.cr4_guest_owned_bits); }
static void set_cr4_guest_host_mask(struct vcpu_vmx *vmx) { vmx->vcpu.arch.cr4_guest_owned_bits = KVM_CR4_GUEST_OWNED_BITS; if (enable_ept) vmx->vcpu.arch.cr4_guest_owned_bits |= X86_CR4_PGE; if (is_guest_mode(&vmx->vcpu)) vmx->vcpu.arch.cr4_guest_owned_bits &= ~get_vmcs12(&vmx->vcpu)->cr4_guest_host_mask; vmcs_writel(CR4_GUEST_HOST_MASK, ~vmx->vcpu.arch.cr4_guest_owned_bits); }
C
linux
0
CVE-2016-9777
https://www.cvedetails.com/cve/CVE-2016-9777/
CWE-125
https://github.com/torvalds/linux/commit/81cdb259fb6d8c1c4ecfeea389ff5a73c07f5755
81cdb259fb6d8c1c4ecfeea389ff5a73c07f5755
KVM: x86: fix out-of-bounds accesses of rtc_eoi map KVM was using arrays of size KVM_MAX_VCPUS with vcpu_id, but ID can be bigger that the maximal number of VCPUs, resulting in out-of-bounds access. Found by syzkaller: BUG: KASAN: slab-out-of-bounds in __apic_accept_irq+0xb33/0xb50 at addr [...] Write of size 1 by task a.out/27101 CPU: 1 PID: 27101 Comm: a.out Not tainted 4.9.0-rc5+ #49 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Bochs 01/01/2011 [...] Call Trace: [...] __apic_accept_irq+0xb33/0xb50 arch/x86/kvm/lapic.c:905 [...] kvm_apic_set_irq+0x10e/0x180 arch/x86/kvm/lapic.c:495 [...] kvm_irq_delivery_to_apic+0x732/0xc10 arch/x86/kvm/irq_comm.c:86 [...] ioapic_service+0x41d/0x760 arch/x86/kvm/ioapic.c:360 [...] ioapic_set_irq+0x275/0x6c0 arch/x86/kvm/ioapic.c:222 [...] kvm_ioapic_inject_all arch/x86/kvm/ioapic.c:235 [...] kvm_set_ioapic+0x223/0x310 arch/x86/kvm/ioapic.c:670 [...] kvm_vm_ioctl_set_irqchip arch/x86/kvm/x86.c:3668 [...] kvm_arch_vm_ioctl+0x1a08/0x23c0 arch/x86/kvm/x86.c:3999 [...] kvm_vm_ioctl+0x1fa/0x1a70 arch/x86/kvm/../../../virt/kvm/kvm_main.c:3099 Reported-by: Dmitry Vyukov <dvyukov@google.com> Cc: stable@vger.kernel.org Fixes: af1bae5497b9 ("KVM: x86: bump KVM_MAX_VCPU_ID to 1023") Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: David Hildenbrand <david@redhat.com> Signed-off-by: Radim Krčmář <rkrcmar@redhat.com>
int kvm_ioapic_set_irq(struct kvm_ioapic *ioapic, int irq, int irq_source_id, int level, bool line_status) { int ret, irq_level; BUG_ON(irq < 0 || irq >= IOAPIC_NUM_PINS); spin_lock(&ioapic->lock); irq_level = __kvm_irq_line_state(&ioapic->irq_states[irq], irq_source_id, level); ret = ioapic_set_irq(ioapic, irq, irq_level, line_status); spin_unlock(&ioapic->lock); return ret; }
int kvm_ioapic_set_irq(struct kvm_ioapic *ioapic, int irq, int irq_source_id, int level, bool line_status) { int ret, irq_level; BUG_ON(irq < 0 || irq >= IOAPIC_NUM_PINS); spin_lock(&ioapic->lock); irq_level = __kvm_irq_line_state(&ioapic->irq_states[irq], irq_source_id, level); ret = ioapic_set_irq(ioapic, irq, irq_level, line_status); spin_unlock(&ioapic->lock); return ret; }
C
linux
0
CVE-2017-5116
https://www.cvedetails.com/cve/CVE-2017-5116/
CWE-704
https://github.com/chromium/chromium/commit/acf2f0799f6f732dd70f45ddd252d773be7afd11
acf2f0799f6f732dd70f45ddd252d773be7afd11
Desktop Page Info/Harmony: Show close button for internal pages. The Harmony version of Page Info for internal Chrome pages (chrome://, chrome-extension:// and view-source:// pages) show a close button. Update the code to match this. This patch also adds TestBrowserDialog tests for the latter two cases described above (internal extension and view source pages). See screenshot - https://drive.google.com/file/d/18RZnMiHCu-rCX9N6DLUpu4mkFWguh1xm/view?usp=sharing Bug: 535074 Change-Id: I55e5f1aa682fd4ec85f7b65ac88f5a4f5906fe53 Reviewed-on: https://chromium-review.googlesource.com/759624 Commit-Queue: Patti <patricialor@chromium.org> Reviewed-by: Trent Apted <tapted@chromium.org> Cr-Commit-Position: refs/heads/master@{#516624}
void PageInfoBubbleView::SetCookieInfo(const CookieInfoList& cookie_info_list) { if (cookie_dialog_link_ == nullptr) { cookie_dialog_link_ = new views::Link( l10n_util::GetPluralStringFUTF16(IDS_PAGE_INFO_NUM_COOKIES, 0)); cookie_dialog_link_->set_id( PageInfoBubbleView::VIEW_ID_PAGE_INFO_LINK_COOKIE_DIALOG); cookie_dialog_link_->set_listener(this); cookie_dialog_link_->SetUnderline(false); PageInfoUI::PermissionInfo info; info.type = CONTENT_SETTINGS_TYPE_COOKIES; info.setting = CONTENT_SETTING_ALLOW; info.is_incognito = Profile::FromBrowserContext(web_contents()->GetBrowserContext()) ->IsOffTheRecord(); const gfx::ImageSkia icon = PageInfoUI::GetPermissionIcon(info).AsImageSkia(); site_settings_view_->AddChildView(CreateInspectLinkSection( icon, IDS_PAGE_INFO_COOKIES, cookie_dialog_link_)); } DCHECK_EQ(cookie_info_list.size(), 2u); int total_allowed = 0; for (const auto& i : cookie_info_list) { total_allowed += i.allowed; } base::string16 label_text = l10n_util::GetPluralStringFUTF16( IDS_PAGE_INFO_NUM_COOKIES, total_allowed); cookie_dialog_link_->SetText(label_text); cookie_dialog_link_->SetTooltipText( l10n_util::GetStringUTF16(IDS_PAGE_INFO_COOKIES_TOOLTIP)); Layout(); SizeToContents(); }
void PageInfoBubbleView::SetCookieInfo(const CookieInfoList& cookie_info_list) { if (cookie_dialog_link_ == nullptr) { cookie_dialog_link_ = new views::Link( l10n_util::GetPluralStringFUTF16(IDS_PAGE_INFO_NUM_COOKIES, 0)); cookie_dialog_link_->set_id( PageInfoBubbleView::VIEW_ID_PAGE_INFO_LINK_COOKIE_DIALOG); cookie_dialog_link_->set_listener(this); cookie_dialog_link_->SetUnderline(false); PageInfoUI::PermissionInfo info; info.type = CONTENT_SETTINGS_TYPE_COOKIES; info.setting = CONTENT_SETTING_ALLOW; info.is_incognito = Profile::FromBrowserContext(web_contents()->GetBrowserContext()) ->IsOffTheRecord(); const gfx::ImageSkia icon = PageInfoUI::GetPermissionIcon(info).AsImageSkia(); site_settings_view_->AddChildView(CreateInspectLinkSection( icon, IDS_PAGE_INFO_COOKIES, cookie_dialog_link_)); } DCHECK_EQ(cookie_info_list.size(), 2u); int total_allowed = 0; for (const auto& i : cookie_info_list) { total_allowed += i.allowed; } base::string16 label_text = l10n_util::GetPluralStringFUTF16( IDS_PAGE_INFO_NUM_COOKIES, total_allowed); cookie_dialog_link_->SetText(label_text); cookie_dialog_link_->SetTooltipText( l10n_util::GetStringUTF16(IDS_PAGE_INFO_COOKIES_TOOLTIP)); Layout(); SizeToContents(); }
C
Chrome
0
CVE-2018-15594
https://www.cvedetails.com/cve/CVE-2018-15594/
CWE-200
https://github.com/torvalds/linux/commit/5800dc5c19f34e6e03b5adab1282535cb102fafd
5800dc5c19f34e6e03b5adab1282535cb102fafd
x86/paravirt: Fix spectre-v2 mitigations for paravirt guests Nadav reported that on guests we're failing to rewrite the indirect calls to CALLEE_SAVE paravirt functions. In particular the pv_queued_spin_unlock() call is left unpatched and that is all over the place. This obviously wrecks Spectre-v2 mitigation (for paravirt guests) which relies on not actually having indirect calls around. The reason is an incorrect clobber test in paravirt_patch_call(); this function rewrites an indirect call with a direct call to the _SAME_ function, there is no possible way the clobbers can be different because of this. Therefore remove this clobber check. Also put WARNs on the other patch failure case (not enough room for the instruction) which I've not seen trigger in my (limited) testing. Three live kernel image disassemblies for lock_sock_nested (as a small function that illustrates the problem nicely). PRE is the current situation for guests, POST is with this patch applied and NATIVE is with or without the patch for !guests. PRE: (gdb) disassemble lock_sock_nested Dump of assembler code for function lock_sock_nested: 0xffffffff817be970 <+0>: push %rbp 0xffffffff817be971 <+1>: mov %rdi,%rbp 0xffffffff817be974 <+4>: push %rbx 0xffffffff817be975 <+5>: lea 0x88(%rbp),%rbx 0xffffffff817be97c <+12>: callq 0xffffffff819f7160 <_cond_resched> 0xffffffff817be981 <+17>: mov %rbx,%rdi 0xffffffff817be984 <+20>: callq 0xffffffff819fbb00 <_raw_spin_lock_bh> 0xffffffff817be989 <+25>: mov 0x8c(%rbp),%eax 0xffffffff817be98f <+31>: test %eax,%eax 0xffffffff817be991 <+33>: jne 0xffffffff817be9ba <lock_sock_nested+74> 0xffffffff817be993 <+35>: movl $0x1,0x8c(%rbp) 0xffffffff817be99d <+45>: mov %rbx,%rdi 0xffffffff817be9a0 <+48>: callq *0xffffffff822299e8 0xffffffff817be9a7 <+55>: pop %rbx 0xffffffff817be9a8 <+56>: pop %rbp 0xffffffff817be9a9 <+57>: mov $0x200,%esi 0xffffffff817be9ae <+62>: mov $0xffffffff817be993,%rdi 0xffffffff817be9b5 <+69>: jmpq 0xffffffff81063ae0 <__local_bh_enable_ip> 0xffffffff817be9ba <+74>: mov %rbp,%rdi 0xffffffff817be9bd <+77>: callq 0xffffffff817be8c0 <__lock_sock> 0xffffffff817be9c2 <+82>: jmp 0xffffffff817be993 <lock_sock_nested+35> End of assembler dump. POST: (gdb) disassemble lock_sock_nested Dump of assembler code for function lock_sock_nested: 0xffffffff817be970 <+0>: push %rbp 0xffffffff817be971 <+1>: mov %rdi,%rbp 0xffffffff817be974 <+4>: push %rbx 0xffffffff817be975 <+5>: lea 0x88(%rbp),%rbx 0xffffffff817be97c <+12>: callq 0xffffffff819f7160 <_cond_resched> 0xffffffff817be981 <+17>: mov %rbx,%rdi 0xffffffff817be984 <+20>: callq 0xffffffff819fbb00 <_raw_spin_lock_bh> 0xffffffff817be989 <+25>: mov 0x8c(%rbp),%eax 0xffffffff817be98f <+31>: test %eax,%eax 0xffffffff817be991 <+33>: jne 0xffffffff817be9ba <lock_sock_nested+74> 0xffffffff817be993 <+35>: movl $0x1,0x8c(%rbp) 0xffffffff817be99d <+45>: mov %rbx,%rdi 0xffffffff817be9a0 <+48>: callq 0xffffffff810a0c20 <__raw_callee_save___pv_queued_spin_unlock> 0xffffffff817be9a5 <+53>: xchg %ax,%ax 0xffffffff817be9a7 <+55>: pop %rbx 0xffffffff817be9a8 <+56>: pop %rbp 0xffffffff817be9a9 <+57>: mov $0x200,%esi 0xffffffff817be9ae <+62>: mov $0xffffffff817be993,%rdi 0xffffffff817be9b5 <+69>: jmpq 0xffffffff81063aa0 <__local_bh_enable_ip> 0xffffffff817be9ba <+74>: mov %rbp,%rdi 0xffffffff817be9bd <+77>: callq 0xffffffff817be8c0 <__lock_sock> 0xffffffff817be9c2 <+82>: jmp 0xffffffff817be993 <lock_sock_nested+35> End of assembler dump. NATIVE: (gdb) disassemble lock_sock_nested Dump of assembler code for function lock_sock_nested: 0xffffffff817be970 <+0>: push %rbp 0xffffffff817be971 <+1>: mov %rdi,%rbp 0xffffffff817be974 <+4>: push %rbx 0xffffffff817be975 <+5>: lea 0x88(%rbp),%rbx 0xffffffff817be97c <+12>: callq 0xffffffff819f7160 <_cond_resched> 0xffffffff817be981 <+17>: mov %rbx,%rdi 0xffffffff817be984 <+20>: callq 0xffffffff819fbb00 <_raw_spin_lock_bh> 0xffffffff817be989 <+25>: mov 0x8c(%rbp),%eax 0xffffffff817be98f <+31>: test %eax,%eax 0xffffffff817be991 <+33>: jne 0xffffffff817be9ba <lock_sock_nested+74> 0xffffffff817be993 <+35>: movl $0x1,0x8c(%rbp) 0xffffffff817be99d <+45>: mov %rbx,%rdi 0xffffffff817be9a0 <+48>: movb $0x0,(%rdi) 0xffffffff817be9a3 <+51>: nopl 0x0(%rax) 0xffffffff817be9a7 <+55>: pop %rbx 0xffffffff817be9a8 <+56>: pop %rbp 0xffffffff817be9a9 <+57>: mov $0x200,%esi 0xffffffff817be9ae <+62>: mov $0xffffffff817be993,%rdi 0xffffffff817be9b5 <+69>: jmpq 0xffffffff81063ae0 <__local_bh_enable_ip> 0xffffffff817be9ba <+74>: mov %rbp,%rdi 0xffffffff817be9bd <+77>: callq 0xffffffff817be8c0 <__lock_sock> 0xffffffff817be9c2 <+82>: jmp 0xffffffff817be993 <lock_sock_nested+35> End of assembler dump. Fixes: 63f70270ccd9 ("[PATCH] i386: PARAVIRT: add common patching machinery") Fixes: 3010a0663fd9 ("x86/paravirt, objtool: Annotate indirect calls") Reported-by: Nadav Amit <namit@vmware.com> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Juergen Gross <jgross@suse.com> Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com> Cc: David Woodhouse <dwmw2@infradead.org> Cc: stable@vger.kernel.org
int paravirt_disable_iospace(void) { return request_resource(&ioport_resource, &reserve_ioports); }
int paravirt_disable_iospace(void) { return request_resource(&ioport_resource, &reserve_ioports); }
C
linux
0
CVE-2017-12182
https://www.cvedetails.com/cve/CVE-2017-12182/
CWE-20
https://cgit.freedesktop.org/xorg/xserver/commit/?id=1b1d4c04695dced2463404174b50b3581dbd857b
1b1d4c04695dced2463404174b50b3581dbd857b
null
DGAStealButtonEvent(DeviceIntPtr dev, int index, int button, int is_down) { DGAScreenPtr pScreenPriv; DGAEvent event; if (!DGAScreenKeyRegistered) /* no DGA */ return FALSE; pScreenPriv = DGA_GET_SCREEN_PRIV(screenInfo.screens[index]); if (!pScreenPriv || !pScreenPriv->grabMouse) return FALSE; event = (DGAEvent) { .header = ET_Internal, .type = ET_DGAEvent, .length = sizeof(event), .time = GetTimeInMillis(), .subtype = (is_down ? ET_ButtonPress : ET_ButtonRelease), .detail = button, .dx = 0, .dy = 0 }; mieqEnqueue(dev, (InternalEvent *) &event); return TRUE; }
DGAStealButtonEvent(DeviceIntPtr dev, int index, int button, int is_down) { DGAScreenPtr pScreenPriv; DGAEvent event; if (!DGAScreenKeyRegistered) /* no DGA */ return FALSE; pScreenPriv = DGA_GET_SCREEN_PRIV(screenInfo.screens[index]); if (!pScreenPriv || !pScreenPriv->grabMouse) return FALSE; event = (DGAEvent) { .header = ET_Internal, .type = ET_DGAEvent, .length = sizeof(event), .time = GetTimeInMillis(), .subtype = (is_down ? ET_ButtonPress : ET_ButtonRelease), .detail = button, .dx = 0, .dy = 0 }; mieqEnqueue(dev, (InternalEvent *) &event); return TRUE; }
C
xserver
0
CVE-2012-2891
https://www.cvedetails.com/cve/CVE-2012-2891/
CWE-200
https://github.com/chromium/chromium/commit/116d0963cadfbf55ef2ec3d13781987c4d80517a
116d0963cadfbf55ef2ec3d13781987c4d80517a
Print preview: Use an ID instead of memory pointer string in WebUI. BUG=144051 Review URL: https://chromiumcodereview.appspot.com/10870003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@153342 0039d316-1c4b-4281-b951-d872f2087c98
void PrintPreviewHandler::HandleManagePrinters(const ListValue* /*args*/) { ++manage_printers_dialog_request_count_; printing::PrinterManagerDialog::ShowPrinterManagerDialog(); }
void PrintPreviewHandler::HandleManagePrinters(const ListValue* /*args*/) { ++manage_printers_dialog_request_count_; printing::PrinterManagerDialog::ShowPrinterManagerDialog(); }
C
Chrome
0
CVE-2018-18352
https://www.cvedetails.com/cve/CVE-2018-18352/
CWE-732
https://github.com/chromium/chromium/commit/a9cbaa7a40e2b2723cfc2f266c42f4980038a949
a9cbaa7a40e2b2723cfc2f266c42f4980038a949
Simplify "WouldTaintOrigin" concept in media/blink Currently WebMediaPlayer has three predicates: - DidGetOpaqueResponseFromServiceWorker - HasSingleSecurityOrigin - DidPassCORSAccessCheck . These are used to determine whether the response body is available for scripts. They are known to be confusing, and actually MediaElementAudioSourceHandler::WouldTaintOrigin misuses them. This CL merges the three predicates to one, WouldTaintOrigin, to remove the confusion. Now the "response type" concept is available and we don't need a custom CORS check, so this CL removes BaseAudioContext::WouldTaintOrigin. This CL also renames URLData::has_opaque_data_ and its (direct and indirect) data accessors to match the spec. Bug: 849942, 875153 Change-Id: I6acf50169d7445c4ff614e80ac606f79ee577d2a Reviewed-on: https://chromium-review.googlesource.com/c/1238098 Reviewed-by: Fredrik Hubinette <hubbe@chromium.org> Reviewed-by: Kinuko Yasuda <kinuko@chromium.org> Reviewed-by: Raymond Toy <rtoy@chromium.org> Commit-Queue: Yutaka Hirano <yhirano@chromium.org> Cr-Commit-Position: refs/heads/master@{#598258}
bool WebMediaPlayerMS::CopyVideoTextureToPlatformTexture( gpu::gles2::GLES2Interface* gl, unsigned target, unsigned int texture, unsigned internal_format, unsigned format, unsigned type, int level, bool premultiply_alpha, bool flip_y, int already_uploaded_id, VideoFrameUploadMetadata* out_metadata) { TRACE_EVENT0("media", "copyVideoTextureToPlatformTexture"); DCHECK(thread_checker_.CalledOnValidThread()); scoped_refptr<media::VideoFrame> video_frame = compositor_->GetCurrentFrameWithoutUpdatingStatistics(); if (!video_frame.get() || !video_frame->HasTextures()) return false; media::Context3D context_3d; auto* provider = RenderThreadImpl::current()->SharedMainThreadContextProvider().get(); if (!provider) return false; context_3d = media::Context3D(provider->ContextGL(), provider->GrContext()); DCHECK(context_3d.gl); return video_renderer_.CopyVideoFrameTexturesToGLTexture( context_3d, provider->ContextSupport(), gl, video_frame.get(), target, texture, internal_format, format, type, level, premultiply_alpha, flip_y); }
bool WebMediaPlayerMS::CopyVideoTextureToPlatformTexture( gpu::gles2::GLES2Interface* gl, unsigned target, unsigned int texture, unsigned internal_format, unsigned format, unsigned type, int level, bool premultiply_alpha, bool flip_y, int already_uploaded_id, VideoFrameUploadMetadata* out_metadata) { TRACE_EVENT0("media", "copyVideoTextureToPlatformTexture"); DCHECK(thread_checker_.CalledOnValidThread()); scoped_refptr<media::VideoFrame> video_frame = compositor_->GetCurrentFrameWithoutUpdatingStatistics(); if (!video_frame.get() || !video_frame->HasTextures()) return false; media::Context3D context_3d; auto* provider = RenderThreadImpl::current()->SharedMainThreadContextProvider().get(); if (!provider) return false; context_3d = media::Context3D(provider->ContextGL(), provider->GrContext()); DCHECK(context_3d.gl); return video_renderer_.CopyVideoFrameTexturesToGLTexture( context_3d, provider->ContextSupport(), gl, video_frame.get(), target, texture, internal_format, format, type, level, premultiply_alpha, flip_y); }
C
Chrome
0
CVE-2018-6091
https://www.cvedetails.com/cve/CVE-2018-6091/
null
https://github.com/chromium/chromium/commit/59ad2dcbe6dd5c5d846944258e6cd26a700ade83
59ad2dcbe6dd5c5d846944258e6cd26a700ade83
service worker: Disable interception when OBJECT/EMBED uses ImageLoader. Per the specification, service worker should not intercept requests for OBJECT/EMBED elements. R=kinuko Bug: 771933 Change-Id: Ia6da6107dc5c68aa2c2efffde14bd2c51251fbd4 Reviewed-on: https://chromium-review.googlesource.com/927303 Reviewed-by: Kinuko Yasuda <kinuko@chromium.org> Commit-Queue: Matt Falkenhagen <falken@chromium.org> Cr-Commit-Position: refs/heads/master@{#538027}
void ImageLoader::UpdateLayoutObject() { LayoutImageResource* image_resource = GetLayoutImageResource(); if (!image_resource) return; ImageResourceContent* cached_image_content = image_resource->CachedImage(); if (image_content_ != cached_image_content && (image_complete_ || !cached_image_content)) image_resource->SetImageResource(image_content_.Get()); }
void ImageLoader::UpdateLayoutObject() { LayoutImageResource* image_resource = GetLayoutImageResource(); if (!image_resource) return; ImageResourceContent* cached_image_content = image_resource->CachedImage(); if (image_content_ != cached_image_content && (image_complete_ || !cached_image_content)) image_resource->SetImageResource(image_content_.Get()); }
C
Chrome
0