CVE ID
stringlengths
13
43
CVE Page
stringlengths
45
48
CWE ID
stringclasses
90 values
codeLink
stringlengths
46
139
commit_id
stringlengths
6
81
commit_message
stringlengths
3
13.3k
func_after
stringlengths
14
241k
func_before
stringlengths
14
241k
lang
stringclasses
3 values
project
stringclasses
309 values
vul
int8
0
1
null
null
null
https://github.com/chromium/chromium/commit/eb7971fdb0c3b76bacfb77c1ecc76459ef481f17
eb7971fdb0c3b76bacfb77c1ecc76459ef481f17
Implement delegation to Metro file pickers. [email protected],[email protected] BUG=None TEST=None Review URL: https://chromiumcodereview.appspot.com/10310103 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@136624 0039d316-1c4b-4281-b951-d872f2087c98
void SelectFileDialogImpl::ListenerDestroyed() { listener_ = NULL; }
void SelectFileDialogImpl::ListenerDestroyed() { listener_ = NULL; }
C
Chrome
0
null
null
null
https://github.com/chromium/chromium/commit/183f4bcddd821b4af3f6234ad2e8c371694a9ffb
183f4bcddd821b4af3f6234ad2e8c371694a9ffb
Add a histogram (Net.PacResultForStrippedUrl) that estimates how often PAC scripts depend on the URL path. BUG=593759 Review URL: https://codereview.chromium.org/1797313003 Cr-Commit-Position: refs/heads/master@{#382644}
int Job::ExecuteProxyResolver() { int result = ERR_UNEXPECTED; // Initialized to silence warnings. switch (operation_) { case CREATE_V8_RESOLVER: { scoped_ptr<ProxyResolverV8> resolver; result = ProxyResolverV8::Create(script_data_, this, &resolver); if (result == OK) *resolver_out_ = std::move(resolver); break; } case GET_PROXY_FOR_URL: { result = v8_resolver()->GetProxyForURL( url_, &results_, this); break; } } return result; }
int Job::ExecuteProxyResolver() { int result = ERR_UNEXPECTED; // Initialized to silence warnings. switch (operation_) { case CREATE_V8_RESOLVER: { scoped_ptr<ProxyResolverV8> resolver; result = ProxyResolverV8::Create(script_data_, this, &resolver); if (result == OK) *resolver_out_ = std::move(resolver); break; } case GET_PROXY_FOR_URL: { result = v8_resolver()->GetProxyForURL( url_, &results_, this); break; } } return result; }
C
Chrome
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 <[email protected]> Reviewed-by: Kentaro Hara <[email protected]> Reviewed-by: Geoff Lang <[email protected]> Reviewed-by: Kenneth Russell <[email protected]> Cr-Commit-Position: refs/heads/master@{#657568}
PassthroughResources::PassthroughResources() : texture_object_map(nullptr) {}
PassthroughResources::PassthroughResources() : texture_object_map(nullptr) {}
C
Chrome
0
CVE-2018-6061
https://www.cvedetails.com/cve/CVE-2018-6061/
CWE-362
https://github.com/chromium/chromium/commit/70340ce072cee8a0bdcddb5f312d32567b2269f6
70340ce072cee8a0bdcddb5f312d32567b2269f6
vaapi vda: Delete owned objects on worker thread in Cleanup() This CL adds a SEQUENCE_CHECKER to Vaapi*Accelerator classes, and posts the destruction of those objects to the appropriate thread on Cleanup(). Also makes {H264,VP8,VP9}Picture RefCountedThreadSafe, see miu@ comment in https://chromium-review.googlesource.com/c/chromium/src/+/794091#message-a64bed985cfaf8a19499a517bb110a7ce581dc0f TEST=play back VP9/VP8/H264 w/ simplechrome on soraka, Release build unstripped, let video play for a few seconds then navigate back; no crashes. Unittests as before: video_decode_accelerator_unittest --test_video_data=test-25fps.vp9:320:240:250:250:35:150:12 video_decode_accelerator_unittest --test_video_data=test-25fps.vp8:320:240:250:250:35:150:11 video_decode_accelerator_unittest --test_video_data=test-25fps.h264:320:240:250:258:35:150:1 Bug: 789160 Cq-Include-Trybots: master.tryserver.chromium.android:android_optional_gpu_tests_rel;master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel Change-Id: I7d96aaf89c92bf46f00c8b8b36798e057a842ed2 Reviewed-on: https://chromium-review.googlesource.com/794091 Reviewed-by: Pawel Osciak <[email protected]> Commit-Queue: Miguel Casas <[email protected]> Cr-Commit-Position: refs/heads/master@{#523372}
gfx::Rect visible_rect() const { return visible_rect_; }
gfx::Rect visible_rect() const { return visible_rect_; }
C
Chrome
0
CVE-2015-6787
https://www.cvedetails.com/cve/CVE-2015-6787/
null
https://github.com/chromium/chromium/commit/f911e11e7f6b5c0d6f5ee694a9871de6619889f7
f911e11e7f6b5c0d6f5ee694a9871de6619889f7
Reland "[CI] Make paint property nodes non-ref-counted" This reverts commit 887383b30842d9d9006e11bb6932660a3cb5b1b7. Reason for revert: Retry in M69. Original change's description: > Revert "[CI] Make paint property nodes non-ref-counted" > > This reverts commit 70fc0b018c9517558b7aa2be00edf2debb449123. > > Reason for revert: Caused bugs found by clusterfuzz > > Original change's description: > > [CI] Make paint property nodes non-ref-counted > > > > Now all paint property nodes are owned by ObjectPaintProperties > > (and LocalFrameView temporarily before removing non-RLS mode). > > Others just use raw pointers or references. > > > > Bug: 833496 > > Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2 > > Change-Id: I2d544fe153bb94698623248748df63c8aa2081ae > > Reviewed-on: https://chromium-review.googlesource.com/1031101 > > Reviewed-by: Tien-Ren Chen <[email protected]> > > Commit-Queue: Xianzhu Wang <[email protected]> > > Cr-Commit-Position: refs/heads/master@{#554626} > > [email protected],[email protected],[email protected] > > Change-Id: I02bb50d6744cb81a797246a0116b677e80a3c69f > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: 833496,837932,837943 > Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2 > Reviewed-on: https://chromium-review.googlesource.com/1034292 > Reviewed-by: Xianzhu Wang <[email protected]> > Commit-Queue: Xianzhu Wang <[email protected]> > Cr-Commit-Position: refs/heads/master@{#554653} [email protected],[email protected],[email protected] # Not skipping CQ checks because original CL landed > 1 day ago. Bug: 833496, 837932, 837943 Change-Id: I0b4ef70db1f1f211ba97c30d617225355c750992 Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2 Reviewed-on: https://chromium-review.googlesource.com/1083491 Commit-Queue: Xianzhu Wang <[email protected]> Reviewed-by: Xianzhu Wang <[email protected]> Cr-Commit-Position: refs/heads/master@{#563930}
UpdateRepeatingTableSectionPaintOffsetAdjustment() { if (!context_.is_repeating_table_section) return; if (object_.IsTableSection()) { if (ToLayoutTableSection(object_).IsRepeatingHeaderGroup()) UpdateRepeatingTableHeaderPaintOffsetAdjustment(); else if (ToLayoutTableSection(object_).IsRepeatingFooterGroup()) UpdateRepeatingTableFooterPaintOffsetAdjustment(); } else if (!context_.painting_layer->EnclosingPaginationLayer()) { for (auto& fragment_context : context_.fragments) { fragment_context.repeating_paint_offset_adjustment = LayoutSize(); } } }
UpdateRepeatingTableSectionPaintOffsetAdjustment() { if (!context_.is_repeating_table_section) return; if (object_.IsTableSection()) { if (ToLayoutTableSection(object_).IsRepeatingHeaderGroup()) UpdateRepeatingTableHeaderPaintOffsetAdjustment(); else if (ToLayoutTableSection(object_).IsRepeatingFooterGroup()) UpdateRepeatingTableFooterPaintOffsetAdjustment(); } else if (!context_.painting_layer->EnclosingPaginationLayer()) { for (auto& fragment_context : context_.fragments) { fragment_context.repeating_paint_offset_adjustment = LayoutSize(); } } }
C
Chrome
0
CVE-2018-12249
https://www.cvedetails.com/cve/CVE-2018-12249/
CWE-476
https://github.com/mruby/mruby/commit/faa4eaf6803bd11669bc324b4c34e7162286bfa3
faa4eaf6803bd11669bc324b4c34e7162286bfa3
`mrb_class_real()` did not work for `BasicObject`; fix #4037
mrb_get_argc(mrb_state *mrb) { mrb_int argc = mrb->c->ci->argc; if (argc < 0) { struct RArray *a = mrb_ary_ptr(mrb->c->stack[1]); argc = ARY_LEN(a); } return argc; }
mrb_get_argc(mrb_state *mrb) { mrb_int argc = mrb->c->ci->argc; if (argc < 0) { struct RArray *a = mrb_ary_ptr(mrb->c->stack[1]); argc = ARY_LEN(a); } return argc; }
C
mruby
0
CVE-2016-9539
https://www.cvedetails.com/cve/CVE-2016-9539/
CWE-125
https://github.com/vadz/libtiff/commit/ae9365db1b271b62b35ce018eac8799b1d5e8a53
ae9365db1b271b62b35ce018eac8799b1d5e8a53
* tools/tiffcrop.c: fix out-of-bound read of up to 3 bytes in readContigTilesIntoBuffer(). Reported as MSVR 35092 by Axel Souchet & Vishal Chauhan from the MSRC Vulnerabilities & Mitigations team.
void process_command_opts (int argc, char *argv[], char *mp, char *mode, uint32 *dirnum, uint16 *defconfig, uint16 *deffillorder, uint32 *deftilewidth, uint32 *deftilelength, uint32 *defrowsperstrip, struct crop_mask *crop_data, struct pagedef *page, struct dump_opts *dump, unsigned int *imagelist, unsigned int *image_count ) { int c, good_args = 0; char *opt_offset = NULL; /* Position in string of value sought */ char *opt_ptr = NULL; /* Pointer to next token in option set */ char *sep = NULL; /* Pointer to a token separator */ unsigned int i, j, start, end; #if !HAVE_DECL_OPTARG extern int optind; extern char* optarg; #endif *mp++ = 'w'; *mp = '\0'; while ((c = getopt(argc, argv, "ac:d:e:f:hil:m:p:r:stvw:z:BCD:E:F:H:I:J:K:LMN:O:P:R:S:U:V:X:Y:Z:")) != -1) { good_args++; switch (c) { case 'a': mode[0] = 'a'; /* append to output */ break; case 'c': if (!processCompressOptions(optarg)) /* compression scheme */ { TIFFError ("Unknown compression option", "%s", optarg); TIFFError ("For valid options type", "tiffcrop -h"); exit (-1); } break; case 'd': start = strtoul(optarg, NULL, 0); /* initial IFD offset */ if (start == 0) { TIFFError ("","Directory offset must be greater than zero"); TIFFError ("For valid options type", "tiffcrop -h"); exit (-1); } *dirnum = start - 1; break; case 'e': switch (tolower((int) optarg[0])) /* image export modes*/ { case 'c': crop_data->exp_mode = ONE_FILE_COMPOSITE; crop_data->img_mode = COMPOSITE_IMAGES; break; /* Composite */ case 'd': crop_data->exp_mode = ONE_FILE_SEPARATED; crop_data->img_mode = SEPARATED_IMAGES; break; /* Divided */ case 'i': crop_data->exp_mode = FILE_PER_IMAGE_COMPOSITE; crop_data->img_mode = COMPOSITE_IMAGES; break; /* Image */ case 'm': crop_data->exp_mode = FILE_PER_IMAGE_SEPARATED; crop_data->img_mode = SEPARATED_IMAGES; break; /* Multiple */ case 's': crop_data->exp_mode = FILE_PER_SELECTION; crop_data->img_mode = SEPARATED_IMAGES; break; /* Sections */ default: TIFFError ("Unknown export mode","%s", optarg); TIFFError ("For valid options type", "tiffcrop -h"); exit (-1); } break; case 'f': if (streq(optarg, "lsb2msb")) /* fill order */ *deffillorder = FILLORDER_LSB2MSB; else if (streq(optarg, "msb2lsb")) *deffillorder = FILLORDER_MSB2LSB; else { TIFFError ("Unknown fill order", "%s", optarg); TIFFError ("For valid options type", "tiffcrop -h"); exit (-1); } break; case 'h': usage(); break; case 'i': ignore = TRUE; /* ignore errors */ break; case 'l': outtiled = TRUE; /* tile length */ *deftilelength = atoi(optarg); break; case 'p': /* planar configuration */ if (streq(optarg, "separate")) *defconfig = PLANARCONFIG_SEPARATE; else if (streq(optarg, "contig")) *defconfig = PLANARCONFIG_CONTIG; else { TIFFError ("Unkown planar configuration", "%s", optarg); TIFFError ("For valid options type", "tiffcrop -h"); exit (-1); } break; case 'r': /* rows/strip */ *defrowsperstrip = atol(optarg); break; case 's': /* generate stripped output */ outtiled = FALSE; break; case 't': /* generate tiled output */ outtiled = TRUE; break; case 'v': TIFFError("Library Release", "%s", TIFFGetVersion()); TIFFError ("Tiffcrop version", "%s, last updated: %s", tiffcrop_version_id, tiffcrop_rev_date); TIFFError ("Tiffcp code", "Copyright (c) 1988-1997 Sam Leffler"); TIFFError (" ", "Copyright (c) 1991-1997 Silicon Graphics, Inc"); TIFFError ("Tiffcrop additions", "Copyright (c) 2007-2010 Richard Nolde"); exit (0); break; case 'w': /* tile width */ outtiled = TRUE; *deftilewidth = atoi(optarg); break; case 'z': /* regions of an image specified as x1,y1,x2,y2:x3,y3,x4,y4 etc */ crop_data->crop_mode |= CROP_REGIONS; for (i = 0, opt_ptr = strtok (optarg, ":"); ((opt_ptr != NULL) && (i < MAX_REGIONS)); (opt_ptr = strtok (NULL, ":")), i++) { crop_data->regions++; if (sscanf(opt_ptr, "%lf,%lf,%lf,%lf", &crop_data->corners[i].X1, &crop_data->corners[i].Y1, &crop_data->corners[i].X2, &crop_data->corners[i].Y2) != 4) { TIFFError ("Unable to parse coordinates for region", "%d %s", i, optarg); TIFFError ("For valid options type", "tiffcrop -h"); exit (-1); } } /* check for remaining elements over MAX_REGIONS */ if ((opt_ptr != NULL) && (i >= MAX_REGIONS)) { TIFFError ("Region list exceeds limit of", "%d regions %s", MAX_REGIONS, optarg); TIFFError ("For valid options type", "tiffcrop -h"); exit (-1);; } break; /* options for file open modes */ case 'B': *mp++ = 'b'; *mp = '\0'; break; case 'L': *mp++ = 'l'; *mp = '\0'; break; case 'M': *mp++ = 'm'; *mp = '\0'; break; case 'C': *mp++ = 'c'; *mp = '\0'; break; /* options for Debugging / data dump */ case 'D': for (i = 0, opt_ptr = strtok (optarg, ","); (opt_ptr != NULL); (opt_ptr = strtok (NULL, ",")), i++) { opt_offset = strpbrk(opt_ptr, ":="); if (opt_offset == NULL) { TIFFError("Invalid dump option", "%s", optarg); TIFFError ("For valid options type", "tiffcrop -h"); exit (-1); } *opt_offset = '\0'; /* convert option to lowercase */ end = strlen (opt_ptr); for (i = 0; i < end; i++) *(opt_ptr + i) = tolower((int) *(opt_ptr + i)); /* Look for dump format specification */ if (strncmp(opt_ptr, "for", 3) == 0) { /* convert value to lowercase */ end = strlen (opt_offset + 1); for (i = 1; i <= end; i++) *(opt_offset + i) = tolower((int) *(opt_offset + i)); /* check dump format value */ if (strncmp (opt_offset + 1, "txt", 3) == 0) { dump->format = DUMP_TEXT; strcpy (dump->mode, "w"); } else { if (strncmp(opt_offset + 1, "raw", 3) == 0) { dump->format = DUMP_RAW; strcpy (dump->mode, "wb"); } else { TIFFError("parse_command_opts", "Unknown dump format %s", opt_offset + 1); TIFFError ("For valid options type", "tiffcrop -h"); exit (-1); } } } else { /* Look for dump level specification */ if (strncmp (opt_ptr, "lev", 3) == 0) dump->level = atoi(opt_offset + 1); /* Look for input data dump file name */ if (strncmp (opt_ptr, "in", 2) == 0) { strncpy (dump->infilename, opt_offset + 1, PATH_MAX - 20); dump->infilename[PATH_MAX - 20] = '\0'; } /* Look for output data dump file name */ if (strncmp (opt_ptr, "out", 3) == 0) { strncpy (dump->outfilename, opt_offset + 1, PATH_MAX - 20); dump->outfilename[PATH_MAX - 20] = '\0'; } if (strncmp (opt_ptr, "deb", 3) == 0) dump->debug = atoi(opt_offset + 1); } } if ((strlen(dump->infilename)) || (strlen(dump->outfilename))) { if (dump->level == 1) TIFFError("","Defaulting to dump level 1, no data."); if (dump->format == DUMP_NONE) { TIFFError("", "You must specify a dump format for dump files"); TIFFError ("For valid options type", "tiffcrop -h"); exit (-1); } } break; /* image manipulation routine options */ case 'm': /* margins to exclude from selection, uppercase M was already used */ /* order of values must be TOP, LEFT, BOTTOM, RIGHT */ crop_data->crop_mode |= CROP_MARGINS; for (i = 0, opt_ptr = strtok (optarg, ",:"); ((opt_ptr != NULL) && (i < 4)); (opt_ptr = strtok (NULL, ",:")), i++) { crop_data->margins[i] = atof(opt_ptr); } break; case 'E': /* edge reference */ switch (tolower((int) optarg[0])) { case 't': crop_data->edge_ref = EDGE_TOP; break; case 'b': crop_data->edge_ref = EDGE_BOTTOM; break; case 'l': crop_data->edge_ref = EDGE_LEFT; break; case 'r': crop_data->edge_ref = EDGE_RIGHT; break; default: TIFFError ("Edge reference must be top, bottom, left, or right", "%s", optarg); TIFFError ("For valid options type", "tiffcrop -h"); exit (-1); } break; case 'F': /* flip eg mirror image or cropped segment, M was already used */ crop_data->crop_mode |= CROP_MIRROR; switch (tolower((int) optarg[0])) { case 'h': crop_data->mirror = MIRROR_HORIZ; break; case 'v': crop_data->mirror = MIRROR_VERT; break; case 'b': crop_data->mirror = MIRROR_BOTH; break; default: TIFFError ("Flip mode must be horiz, vert, or both", "%s", optarg); TIFFError ("For valid options type", "tiffcrop -h"); exit (-1); } break; case 'H': /* set horizontal resolution to new value */ page->hres = atof (optarg); page->mode |= PAGE_MODE_RESOLUTION; break; case 'I': /* invert the color space, eg black to white */ crop_data->crop_mode |= CROP_INVERT; /* The PHOTOMETIC_INTERPRETATION tag may be updated */ if (streq(optarg, "black")) { crop_data->photometric = PHOTOMETRIC_MINISBLACK; continue; } if (streq(optarg, "white")) { crop_data->photometric = PHOTOMETRIC_MINISWHITE; continue; } if (streq(optarg, "data")) { crop_data->photometric = INVERT_DATA_ONLY; continue; } if (streq(optarg, "both")) { crop_data->photometric = INVERT_DATA_AND_TAG; continue; } TIFFError("Missing or unknown option for inverting PHOTOMETRIC_INTERPRETATION", "%s", optarg); TIFFError ("For valid options type", "tiffcrop -h"); exit (-1); break; case 'J': /* horizontal margin for sectioned ouput pages */ page->hmargin = atof(optarg); page->mode |= PAGE_MODE_MARGINS; break; case 'K': /* vertical margin for sectioned ouput pages*/ page->vmargin = atof(optarg); page->mode |= PAGE_MODE_MARGINS; break; case 'N': /* list of images to process */ for (i = 0, opt_ptr = strtok (optarg, ","); ((opt_ptr != NULL) && (i < MAX_IMAGES)); (opt_ptr = strtok (NULL, ","))) { /* We do not know how many images are in file yet * so we build a list to include the maximum allowed * and follow it until we hit the end of the file. * Image count is not accurate for odd, even, last * so page numbers won't be valid either. */ if (streq(opt_ptr, "odd")) { for (j = 1; j <= MAX_IMAGES; j += 2) imagelist[i++] = j; *image_count = (MAX_IMAGES - 1) / 2; break; } else { if (streq(opt_ptr, "even")) { for (j = 2; j <= MAX_IMAGES; j += 2) imagelist[i++] = j; *image_count = MAX_IMAGES / 2; break; } else { if (streq(opt_ptr, "last")) imagelist[i++] = MAX_IMAGES; else /* single value between commas */ { sep = strpbrk(opt_ptr, ":-"); if (!sep) imagelist[i++] = atoi(opt_ptr); else { *sep = '\0'; start = atoi (opt_ptr); if (!strcmp((sep + 1), "last")) end = MAX_IMAGES; else end = atoi (sep + 1); for (j = start; j <= end && j - start + i < MAX_IMAGES; j++) imagelist[i++] = j; } } } } } *image_count = i; break; case 'O': /* page orientation */ switch (tolower((int) optarg[0])) { case 'a': page->orient = ORIENTATION_AUTO; break; case 'p': page->orient = ORIENTATION_PORTRAIT; break; case 'l': page->orient = ORIENTATION_LANDSCAPE; break; default: TIFFError ("Orientation must be portrait, landscape, or auto.", "%s", optarg); TIFFError ("For valid options type", "tiffcrop -h"); exit (-1); } break; case 'P': /* page size selection */ if (sscanf(optarg, "%lfx%lf", &page->width, &page->length) == 2) { strcpy (page->name, "Custom"); page->mode |= PAGE_MODE_PAPERSIZE; break; } if (get_page_geometry (optarg, page)) { if (!strcmp(optarg, "list")) { TIFFError("", "Name Width Length (in inches)"); for (i = 0; i < MAX_PAPERNAMES - 1; i++) TIFFError ("", "%-15.15s %5.2f %5.2f", PaperTable[i].name, PaperTable[i].width, PaperTable[i].length); exit (-1); } TIFFError ("Invalid paper size", "%s", optarg); TIFFError ("", "Select one of:"); TIFFError("", "Name Width Length (in inches)"); for (i = 0; i < MAX_PAPERNAMES - 1; i++) TIFFError ("", "%-15.15s %5.2f %5.2f", PaperTable[i].name, PaperTable[i].width, PaperTable[i].length); exit (-1); } else { page->mode |= PAGE_MODE_PAPERSIZE; } break; case 'R': /* rotate image or cropped segment */ crop_data->crop_mode |= CROP_ROTATE; switch (strtoul(optarg, NULL, 0)) { case 90: crop_data->rotation = (uint16)90; break; case 180: crop_data->rotation = (uint16)180; break; case 270: crop_data->rotation = (uint16)270; break; default: TIFFError ("Rotation must be 90, 180, or 270 degrees clockwise", "%s", optarg); TIFFError ("For valid options type", "tiffcrop -h"); exit (-1); } break; case 'S': /* subdivide into Cols:Rows sections, eg 3:2 would be 3 across and 2 down */ sep = strpbrk(optarg, ",:"); if (sep) { *sep = '\0'; page->cols = atoi(optarg); page->rows = atoi(sep +1); } else { page->cols = atoi(optarg); page->rows = atoi(optarg); } if ((page->cols * page->rows) > MAX_SECTIONS) { TIFFError ("Limit for subdivisions, ie rows x columns, exceeded", "%d", MAX_SECTIONS); exit (-1); } page->mode |= PAGE_MODE_ROWSCOLS; break; case 'U': /* units for measurements and offsets */ if (streq(optarg, "in")) { crop_data->res_unit = RESUNIT_INCH; page->res_unit = RESUNIT_INCH; } else if (streq(optarg, "cm")) { crop_data->res_unit = RESUNIT_CENTIMETER; page->res_unit = RESUNIT_CENTIMETER; } else if (streq(optarg, "px")) { crop_data->res_unit = RESUNIT_NONE; page->res_unit = RESUNIT_NONE; } else { TIFFError ("Illegal unit of measure","%s", optarg); TIFFError ("For valid options type", "tiffcrop -h"); exit (-1); } break; case 'V': /* set vertical resolution to new value */ page->vres = atof (optarg); page->mode |= PAGE_MODE_RESOLUTION; break; case 'X': /* selection width */ crop_data->crop_mode |= CROP_WIDTH; crop_data->width = atof(optarg); break; case 'Y': /* selection length */ crop_data->crop_mode |= CROP_LENGTH; crop_data->length = atof(optarg); break; case 'Z': /* zones of an image X:Y read as zone X of Y */ crop_data->crop_mode |= CROP_ZONES; for (i = 0, opt_ptr = strtok (optarg, ","); ((opt_ptr != NULL) && (i < MAX_REGIONS)); (opt_ptr = strtok (NULL, ",")), i++) { crop_data->zones++; opt_offset = strchr(opt_ptr, ':'); if (!opt_offset) { TIFFError("Wrong parameter syntax for -Z", "tiffcrop -h"); exit(-1); } *opt_offset = '\0'; crop_data->zonelist[i].position = atoi(opt_ptr); crop_data->zonelist[i].total = atoi(opt_offset + 1); } /* check for remaining elements over MAX_REGIONS */ if ((opt_ptr != NULL) && (i >= MAX_REGIONS)) { TIFFError("Zone list exceeds region limit", "%d", MAX_REGIONS); exit (-1); } break; case '?': TIFFError ("For valid options type", "tiffcrop -h"); exit (-1); /*NOTREACHED*/ } } } /* end process_command_opts */
void process_command_opts (int argc, char *argv[], char *mp, char *mode, uint32 *dirnum, uint16 *defconfig, uint16 *deffillorder, uint32 *deftilewidth, uint32 *deftilelength, uint32 *defrowsperstrip, struct crop_mask *crop_data, struct pagedef *page, struct dump_opts *dump, unsigned int *imagelist, unsigned int *image_count ) { int c, good_args = 0; char *opt_offset = NULL; /* Position in string of value sought */ char *opt_ptr = NULL; /* Pointer to next token in option set */ char *sep = NULL; /* Pointer to a token separator */ unsigned int i, j, start, end; #if !HAVE_DECL_OPTARG extern int optind; extern char* optarg; #endif *mp++ = 'w'; *mp = '\0'; while ((c = getopt(argc, argv, "ac:d:e:f:hil:m:p:r:stvw:z:BCD:E:F:H:I:J:K:LMN:O:P:R:S:U:V:X:Y:Z:")) != -1) { good_args++; switch (c) { case 'a': mode[0] = 'a'; /* append to output */ break; case 'c': if (!processCompressOptions(optarg)) /* compression scheme */ { TIFFError ("Unknown compression option", "%s", optarg); TIFFError ("For valid options type", "tiffcrop -h"); exit (-1); } break; case 'd': start = strtoul(optarg, NULL, 0); /* initial IFD offset */ if (start == 0) { TIFFError ("","Directory offset must be greater than zero"); TIFFError ("For valid options type", "tiffcrop -h"); exit (-1); } *dirnum = start - 1; break; case 'e': switch (tolower((int) optarg[0])) /* image export modes*/ { case 'c': crop_data->exp_mode = ONE_FILE_COMPOSITE; crop_data->img_mode = COMPOSITE_IMAGES; break; /* Composite */ case 'd': crop_data->exp_mode = ONE_FILE_SEPARATED; crop_data->img_mode = SEPARATED_IMAGES; break; /* Divided */ case 'i': crop_data->exp_mode = FILE_PER_IMAGE_COMPOSITE; crop_data->img_mode = COMPOSITE_IMAGES; break; /* Image */ case 'm': crop_data->exp_mode = FILE_PER_IMAGE_SEPARATED; crop_data->img_mode = SEPARATED_IMAGES; break; /* Multiple */ case 's': crop_data->exp_mode = FILE_PER_SELECTION; crop_data->img_mode = SEPARATED_IMAGES; break; /* Sections */ default: TIFFError ("Unknown export mode","%s", optarg); TIFFError ("For valid options type", "tiffcrop -h"); exit (-1); } break; case 'f': if (streq(optarg, "lsb2msb")) /* fill order */ *deffillorder = FILLORDER_LSB2MSB; else if (streq(optarg, "msb2lsb")) *deffillorder = FILLORDER_MSB2LSB; else { TIFFError ("Unknown fill order", "%s", optarg); TIFFError ("For valid options type", "tiffcrop -h"); exit (-1); } break; case 'h': usage(); break; case 'i': ignore = TRUE; /* ignore errors */ break; case 'l': outtiled = TRUE; /* tile length */ *deftilelength = atoi(optarg); break; case 'p': /* planar configuration */ if (streq(optarg, "separate")) *defconfig = PLANARCONFIG_SEPARATE; else if (streq(optarg, "contig")) *defconfig = PLANARCONFIG_CONTIG; else { TIFFError ("Unkown planar configuration", "%s", optarg); TIFFError ("For valid options type", "tiffcrop -h"); exit (-1); } break; case 'r': /* rows/strip */ *defrowsperstrip = atol(optarg); break; case 's': /* generate stripped output */ outtiled = FALSE; break; case 't': /* generate tiled output */ outtiled = TRUE; break; case 'v': TIFFError("Library Release", "%s", TIFFGetVersion()); TIFFError ("Tiffcrop version", "%s, last updated: %s", tiffcrop_version_id, tiffcrop_rev_date); TIFFError ("Tiffcp code", "Copyright (c) 1988-1997 Sam Leffler"); TIFFError (" ", "Copyright (c) 1991-1997 Silicon Graphics, Inc"); TIFFError ("Tiffcrop additions", "Copyright (c) 2007-2010 Richard Nolde"); exit (0); break; case 'w': /* tile width */ outtiled = TRUE; *deftilewidth = atoi(optarg); break; case 'z': /* regions of an image specified as x1,y1,x2,y2:x3,y3,x4,y4 etc */ crop_data->crop_mode |= CROP_REGIONS; for (i = 0, opt_ptr = strtok (optarg, ":"); ((opt_ptr != NULL) && (i < MAX_REGIONS)); (opt_ptr = strtok (NULL, ":")), i++) { crop_data->regions++; if (sscanf(opt_ptr, "%lf,%lf,%lf,%lf", &crop_data->corners[i].X1, &crop_data->corners[i].Y1, &crop_data->corners[i].X2, &crop_data->corners[i].Y2) != 4) { TIFFError ("Unable to parse coordinates for region", "%d %s", i, optarg); TIFFError ("For valid options type", "tiffcrop -h"); exit (-1); } } /* check for remaining elements over MAX_REGIONS */ if ((opt_ptr != NULL) && (i >= MAX_REGIONS)) { TIFFError ("Region list exceeds limit of", "%d regions %s", MAX_REGIONS, optarg); TIFFError ("For valid options type", "tiffcrop -h"); exit (-1);; } break; /* options for file open modes */ case 'B': *mp++ = 'b'; *mp = '\0'; break; case 'L': *mp++ = 'l'; *mp = '\0'; break; case 'M': *mp++ = 'm'; *mp = '\0'; break; case 'C': *mp++ = 'c'; *mp = '\0'; break; /* options for Debugging / data dump */ case 'D': for (i = 0, opt_ptr = strtok (optarg, ","); (opt_ptr != NULL); (opt_ptr = strtok (NULL, ",")), i++) { opt_offset = strpbrk(opt_ptr, ":="); if (opt_offset == NULL) { TIFFError("Invalid dump option", "%s", optarg); TIFFError ("For valid options type", "tiffcrop -h"); exit (-1); } *opt_offset = '\0'; /* convert option to lowercase */ end = strlen (opt_ptr); for (i = 0; i < end; i++) *(opt_ptr + i) = tolower((int) *(opt_ptr + i)); /* Look for dump format specification */ if (strncmp(opt_ptr, "for", 3) == 0) { /* convert value to lowercase */ end = strlen (opt_offset + 1); for (i = 1; i <= end; i++) *(opt_offset + i) = tolower((int) *(opt_offset + i)); /* check dump format value */ if (strncmp (opt_offset + 1, "txt", 3) == 0) { dump->format = DUMP_TEXT; strcpy (dump->mode, "w"); } else { if (strncmp(opt_offset + 1, "raw", 3) == 0) { dump->format = DUMP_RAW; strcpy (dump->mode, "wb"); } else { TIFFError("parse_command_opts", "Unknown dump format %s", opt_offset + 1); TIFFError ("For valid options type", "tiffcrop -h"); exit (-1); } } } else { /* Look for dump level specification */ if (strncmp (opt_ptr, "lev", 3) == 0) dump->level = atoi(opt_offset + 1); /* Look for input data dump file name */ if (strncmp (opt_ptr, "in", 2) == 0) { strncpy (dump->infilename, opt_offset + 1, PATH_MAX - 20); dump->infilename[PATH_MAX - 20] = '\0'; } /* Look for output data dump file name */ if (strncmp (opt_ptr, "out", 3) == 0) { strncpy (dump->outfilename, opt_offset + 1, PATH_MAX - 20); dump->outfilename[PATH_MAX - 20] = '\0'; } if (strncmp (opt_ptr, "deb", 3) == 0) dump->debug = atoi(opt_offset + 1); } } if ((strlen(dump->infilename)) || (strlen(dump->outfilename))) { if (dump->level == 1) TIFFError("","Defaulting to dump level 1, no data."); if (dump->format == DUMP_NONE) { TIFFError("", "You must specify a dump format for dump files"); TIFFError ("For valid options type", "tiffcrop -h"); exit (-1); } } break; /* image manipulation routine options */ case 'm': /* margins to exclude from selection, uppercase M was already used */ /* order of values must be TOP, LEFT, BOTTOM, RIGHT */ crop_data->crop_mode |= CROP_MARGINS; for (i = 0, opt_ptr = strtok (optarg, ",:"); ((opt_ptr != NULL) && (i < 4)); (opt_ptr = strtok (NULL, ",:")), i++) { crop_data->margins[i] = atof(opt_ptr); } break; case 'E': /* edge reference */ switch (tolower((int) optarg[0])) { case 't': crop_data->edge_ref = EDGE_TOP; break; case 'b': crop_data->edge_ref = EDGE_BOTTOM; break; case 'l': crop_data->edge_ref = EDGE_LEFT; break; case 'r': crop_data->edge_ref = EDGE_RIGHT; break; default: TIFFError ("Edge reference must be top, bottom, left, or right", "%s", optarg); TIFFError ("For valid options type", "tiffcrop -h"); exit (-1); } break; case 'F': /* flip eg mirror image or cropped segment, M was already used */ crop_data->crop_mode |= CROP_MIRROR; switch (tolower((int) optarg[0])) { case 'h': crop_data->mirror = MIRROR_HORIZ; break; case 'v': crop_data->mirror = MIRROR_VERT; break; case 'b': crop_data->mirror = MIRROR_BOTH; break; default: TIFFError ("Flip mode must be horiz, vert, or both", "%s", optarg); TIFFError ("For valid options type", "tiffcrop -h"); exit (-1); } break; case 'H': /* set horizontal resolution to new value */ page->hres = atof (optarg); page->mode |= PAGE_MODE_RESOLUTION; break; case 'I': /* invert the color space, eg black to white */ crop_data->crop_mode |= CROP_INVERT; /* The PHOTOMETIC_INTERPRETATION tag may be updated */ if (streq(optarg, "black")) { crop_data->photometric = PHOTOMETRIC_MINISBLACK; continue; } if (streq(optarg, "white")) { crop_data->photometric = PHOTOMETRIC_MINISWHITE; continue; } if (streq(optarg, "data")) { crop_data->photometric = INVERT_DATA_ONLY; continue; } if (streq(optarg, "both")) { crop_data->photometric = INVERT_DATA_AND_TAG; continue; } TIFFError("Missing or unknown option for inverting PHOTOMETRIC_INTERPRETATION", "%s", optarg); TIFFError ("For valid options type", "tiffcrop -h"); exit (-1); break; case 'J': /* horizontal margin for sectioned ouput pages */ page->hmargin = atof(optarg); page->mode |= PAGE_MODE_MARGINS; break; case 'K': /* vertical margin for sectioned ouput pages*/ page->vmargin = atof(optarg); page->mode |= PAGE_MODE_MARGINS; break; case 'N': /* list of images to process */ for (i = 0, opt_ptr = strtok (optarg, ","); ((opt_ptr != NULL) && (i < MAX_IMAGES)); (opt_ptr = strtok (NULL, ","))) { /* We do not know how many images are in file yet * so we build a list to include the maximum allowed * and follow it until we hit the end of the file. * Image count is not accurate for odd, even, last * so page numbers won't be valid either. */ if (streq(opt_ptr, "odd")) { for (j = 1; j <= MAX_IMAGES; j += 2) imagelist[i++] = j; *image_count = (MAX_IMAGES - 1) / 2; break; } else { if (streq(opt_ptr, "even")) { for (j = 2; j <= MAX_IMAGES; j += 2) imagelist[i++] = j; *image_count = MAX_IMAGES / 2; break; } else { if (streq(opt_ptr, "last")) imagelist[i++] = MAX_IMAGES; else /* single value between commas */ { sep = strpbrk(opt_ptr, ":-"); if (!sep) imagelist[i++] = atoi(opt_ptr); else { *sep = '\0'; start = atoi (opt_ptr); if (!strcmp((sep + 1), "last")) end = MAX_IMAGES; else end = atoi (sep + 1); for (j = start; j <= end && j - start + i < MAX_IMAGES; j++) imagelist[i++] = j; } } } } } *image_count = i; break; case 'O': /* page orientation */ switch (tolower((int) optarg[0])) { case 'a': page->orient = ORIENTATION_AUTO; break; case 'p': page->orient = ORIENTATION_PORTRAIT; break; case 'l': page->orient = ORIENTATION_LANDSCAPE; break; default: TIFFError ("Orientation must be portrait, landscape, or auto.", "%s", optarg); TIFFError ("For valid options type", "tiffcrop -h"); exit (-1); } break; case 'P': /* page size selection */ if (sscanf(optarg, "%lfx%lf", &page->width, &page->length) == 2) { strcpy (page->name, "Custom"); page->mode |= PAGE_MODE_PAPERSIZE; break; } if (get_page_geometry (optarg, page)) { if (!strcmp(optarg, "list")) { TIFFError("", "Name Width Length (in inches)"); for (i = 0; i < MAX_PAPERNAMES - 1; i++) TIFFError ("", "%-15.15s %5.2f %5.2f", PaperTable[i].name, PaperTable[i].width, PaperTable[i].length); exit (-1); } TIFFError ("Invalid paper size", "%s", optarg); TIFFError ("", "Select one of:"); TIFFError("", "Name Width Length (in inches)"); for (i = 0; i < MAX_PAPERNAMES - 1; i++) TIFFError ("", "%-15.15s %5.2f %5.2f", PaperTable[i].name, PaperTable[i].width, PaperTable[i].length); exit (-1); } else { page->mode |= PAGE_MODE_PAPERSIZE; } break; case 'R': /* rotate image or cropped segment */ crop_data->crop_mode |= CROP_ROTATE; switch (strtoul(optarg, NULL, 0)) { case 90: crop_data->rotation = (uint16)90; break; case 180: crop_data->rotation = (uint16)180; break; case 270: crop_data->rotation = (uint16)270; break; default: TIFFError ("Rotation must be 90, 180, or 270 degrees clockwise", "%s", optarg); TIFFError ("For valid options type", "tiffcrop -h"); exit (-1); } break; case 'S': /* subdivide into Cols:Rows sections, eg 3:2 would be 3 across and 2 down */ sep = strpbrk(optarg, ",:"); if (sep) { *sep = '\0'; page->cols = atoi(optarg); page->rows = atoi(sep +1); } else { page->cols = atoi(optarg); page->rows = atoi(optarg); } if ((page->cols * page->rows) > MAX_SECTIONS) { TIFFError ("Limit for subdivisions, ie rows x columns, exceeded", "%d", MAX_SECTIONS); exit (-1); } page->mode |= PAGE_MODE_ROWSCOLS; break; case 'U': /* units for measurements and offsets */ if (streq(optarg, "in")) { crop_data->res_unit = RESUNIT_INCH; page->res_unit = RESUNIT_INCH; } else if (streq(optarg, "cm")) { crop_data->res_unit = RESUNIT_CENTIMETER; page->res_unit = RESUNIT_CENTIMETER; } else if (streq(optarg, "px")) { crop_data->res_unit = RESUNIT_NONE; page->res_unit = RESUNIT_NONE; } else { TIFFError ("Illegal unit of measure","%s", optarg); TIFFError ("For valid options type", "tiffcrop -h"); exit (-1); } break; case 'V': /* set vertical resolution to new value */ page->vres = atof (optarg); page->mode |= PAGE_MODE_RESOLUTION; break; case 'X': /* selection width */ crop_data->crop_mode |= CROP_WIDTH; crop_data->width = atof(optarg); break; case 'Y': /* selection length */ crop_data->crop_mode |= CROP_LENGTH; crop_data->length = atof(optarg); break; case 'Z': /* zones of an image X:Y read as zone X of Y */ crop_data->crop_mode |= CROP_ZONES; for (i = 0, opt_ptr = strtok (optarg, ","); ((opt_ptr != NULL) && (i < MAX_REGIONS)); (opt_ptr = strtok (NULL, ",")), i++) { crop_data->zones++; opt_offset = strchr(opt_ptr, ':'); if (!opt_offset) { TIFFError("Wrong parameter syntax for -Z", "tiffcrop -h"); exit(-1); } *opt_offset = '\0'; crop_data->zonelist[i].position = atoi(opt_ptr); crop_data->zonelist[i].total = atoi(opt_offset + 1); } /* check for remaining elements over MAX_REGIONS */ if ((opt_ptr != NULL) && (i >= MAX_REGIONS)) { TIFFError("Zone list exceeds region limit", "%d", MAX_REGIONS); exit (-1); } break; case '?': TIFFError ("For valid options type", "tiffcrop -h"); exit (-1); /*NOTREACHED*/ } } } /* end process_command_opts */
C
libtiff
0
CVE-2018-20169
https://www.cvedetails.com/cve/CVE-2018-20169/
CWE-400
https://github.com/torvalds/linux/commit/704620afc70cf47abb9d6a1a57f3825d2bca49cf
704620afc70cf47abb9d6a1a57f3825d2bca49cf
USB: check usb_get_extra_descriptor for proper size When reading an extra descriptor, we need to properly check the minimum and maximum size allowed, to prevent from invalid data being sent by a device. Reported-by: Hui Peng <[email protected]> Reported-by: Mathias Payer <[email protected]> Co-developed-by: Linus Torvalds <[email protected]> Signed-off-by: Hui Peng <[email protected]> Signed-off-by: Mathias Payer <[email protected]> Signed-off-by: Linus Torvalds <[email protected]> Cc: stable <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
static int descriptors_changed(struct usb_device *udev, struct usb_device_descriptor *old_device_descriptor, struct usb_host_bos *old_bos) { int changed = 0; unsigned index; unsigned serial_len = 0; unsigned len; unsigned old_length; int length; char *buf; if (memcmp(&udev->descriptor, old_device_descriptor, sizeof(*old_device_descriptor)) != 0) return 1; if ((old_bos && !udev->bos) || (!old_bos && udev->bos)) return 1; if (udev->bos) { len = le16_to_cpu(udev->bos->desc->wTotalLength); if (len != le16_to_cpu(old_bos->desc->wTotalLength)) return 1; if (memcmp(udev->bos->desc, old_bos->desc, len)) return 1; } /* Since the idVendor, idProduct, and bcdDevice values in the * device descriptor haven't changed, we will assume the * Manufacturer and Product strings haven't changed either. * But the SerialNumber string could be different (e.g., a * different flash card of the same brand). */ if (udev->serial) serial_len = strlen(udev->serial) + 1; len = serial_len; for (index = 0; index < udev->descriptor.bNumConfigurations; index++) { old_length = le16_to_cpu(udev->config[index].desc.wTotalLength); len = max(len, old_length); } buf = kmalloc(len, GFP_NOIO); if (!buf) /* assume the worst */ return 1; for (index = 0; index < udev->descriptor.bNumConfigurations; index++) { old_length = le16_to_cpu(udev->config[index].desc.wTotalLength); length = usb_get_descriptor(udev, USB_DT_CONFIG, index, buf, old_length); if (length != old_length) { dev_dbg(&udev->dev, "config index %d, error %d\n", index, length); changed = 1; break; } if (memcmp(buf, udev->rawdescriptors[index], old_length) != 0) { dev_dbg(&udev->dev, "config index %d changed (#%d)\n", index, ((struct usb_config_descriptor *) buf)-> bConfigurationValue); changed = 1; break; } } if (!changed && serial_len) { length = usb_string(udev, udev->descriptor.iSerialNumber, buf, serial_len); if (length + 1 != serial_len) { dev_dbg(&udev->dev, "serial string error %d\n", length); changed = 1; } else if (memcmp(buf, udev->serial, length) != 0) { dev_dbg(&udev->dev, "serial string changed\n"); changed = 1; } } kfree(buf); return changed; }
static int descriptors_changed(struct usb_device *udev, struct usb_device_descriptor *old_device_descriptor, struct usb_host_bos *old_bos) { int changed = 0; unsigned index; unsigned serial_len = 0; unsigned len; unsigned old_length; int length; char *buf; if (memcmp(&udev->descriptor, old_device_descriptor, sizeof(*old_device_descriptor)) != 0) return 1; if ((old_bos && !udev->bos) || (!old_bos && udev->bos)) return 1; if (udev->bos) { len = le16_to_cpu(udev->bos->desc->wTotalLength); if (len != le16_to_cpu(old_bos->desc->wTotalLength)) return 1; if (memcmp(udev->bos->desc, old_bos->desc, len)) return 1; } /* Since the idVendor, idProduct, and bcdDevice values in the * device descriptor haven't changed, we will assume the * Manufacturer and Product strings haven't changed either. * But the SerialNumber string could be different (e.g., a * different flash card of the same brand). */ if (udev->serial) serial_len = strlen(udev->serial) + 1; len = serial_len; for (index = 0; index < udev->descriptor.bNumConfigurations; index++) { old_length = le16_to_cpu(udev->config[index].desc.wTotalLength); len = max(len, old_length); } buf = kmalloc(len, GFP_NOIO); if (!buf) /* assume the worst */ return 1; for (index = 0; index < udev->descriptor.bNumConfigurations; index++) { old_length = le16_to_cpu(udev->config[index].desc.wTotalLength); length = usb_get_descriptor(udev, USB_DT_CONFIG, index, buf, old_length); if (length != old_length) { dev_dbg(&udev->dev, "config index %d, error %d\n", index, length); changed = 1; break; } if (memcmp(buf, udev->rawdescriptors[index], old_length) != 0) { dev_dbg(&udev->dev, "config index %d changed (#%d)\n", index, ((struct usb_config_descriptor *) buf)-> bConfigurationValue); changed = 1; break; } } if (!changed && serial_len) { length = usb_string(udev, udev->descriptor.iSerialNumber, buf, serial_len); if (length + 1 != serial_len) { dev_dbg(&udev->dev, "serial string error %d\n", length); changed = 1; } else if (memcmp(buf, udev->serial, length) != 0) { dev_dbg(&udev->dev, "serial string changed\n"); changed = 1; } } kfree(buf); return changed; }
C
linux
0
CVE-2018-0500
https://www.cvedetails.com/cve/CVE-2018-0500/
CWE-119
https://github.com/curl/curl/commit/ba1dbd78e5f1ed67c1b8d37ac89d90e5e330b628
ba1dbd78e5f1ed67c1b8d37ac89d90e5e330b628
smtp: use the upload buffer size for scratch buffer malloc ... not the read buffer size, as that can be set smaller and thus cause a buffer overflow! CVE-2018-0500 Reported-by: Peter Wu Bug: https://curl.haxx.se/docs/adv_2018-70a2.html
static CURLcode smtp_state_postdata_resp(struct connectdata *conn, int smtpcode, smtpstate instate) { CURLcode result = CURLE_OK; (void)instate; /* no use for this yet */ if(smtpcode != 250) result = CURLE_RECV_ERROR; /* End of DONE phase */ state(conn, SMTP_STOP); return result; }
static CURLcode smtp_state_postdata_resp(struct connectdata *conn, int smtpcode, smtpstate instate) { CURLcode result = CURLE_OK; (void)instate; /* no use for this yet */ if(smtpcode != 250) result = CURLE_RECV_ERROR; /* End of DONE phase */ state(conn, SMTP_STOP); return result; }
C
curl
0
CVE-2012-5143
https://www.cvedetails.com/cve/CVE-2012-5143/
CWE-190
https://github.com/chromium/chromium/commit/ad103a1564365c95f4ee4f10261f9604f91f686a
ad103a1564365c95f4ee4f10261f9604f91f686a
Security fix: integer overflow on checking image size Test is left in another CL (codereview.chromiu,.org/11274036) to avoid conflict there. Hope it's fine. BUG=160926 Review URL: https://chromiumcodereview.appspot.com/11410081 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@167882 0039d316-1c4b-4281-b951-d872f2087c98
PP_Resource PPB_ImageData_Impl::CreatePlatform(PP_Instance instance, PP_ImageDataFormat format, const PP_Size& size, PP_Bool init_to_zero) { scoped_refptr<PPB_ImageData_Impl> data(new PPB_ImageData_Impl(instance, PLATFORM)); if (!data->Init(format, size.width, size.height, !!init_to_zero)) return 0; return data->GetReference(); }
PP_Resource PPB_ImageData_Impl::CreatePlatform(PP_Instance instance, PP_ImageDataFormat format, const PP_Size& size, PP_Bool init_to_zero) { scoped_refptr<PPB_ImageData_Impl> data(new PPB_ImageData_Impl(instance, PLATFORM)); if (!data->Init(format, size.width, size.height, !!init_to_zero)) return 0; return data->GetReference(); }
C
Chrome
0
CVE-2019-5837
https://www.cvedetails.com/cve/CVE-2019-5837/
CWE-200
https://github.com/chromium/chromium/commit/04aaacb936a08d70862d6d9d7e8354721ae46be8
04aaacb936a08d70862d6d9d7e8354721ae46be8
Reland "AppCache: Add padding to cross-origin responses." This is a reland of 85b389caa7d725cdd31f59e9a2b79ff54804b7b7 Initialized CacheRecord::padding_size to 0. Original change's description: > AppCache: Add padding to cross-origin responses. > > Bug: 918293 > Change-Id: I4f16640f06feac009d6bbbb624951da6d2669f6c > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1488059 > Commit-Queue: Staphany Park <[email protected]> > Reviewed-by: Victor Costan <[email protected]> > Reviewed-by: Marijn Kruisselbrink <[email protected]> > Cr-Commit-Position: refs/heads/master@{#644624} Bug: 918293 Change-Id: Ie1d3f99c7e8a854d33255a4d66243da2ce16441c Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1539906 Reviewed-by: Victor Costan <[email protected]> Commit-Queue: Staphany Park <[email protected]> Cr-Commit-Position: refs/heads/master@{#644719}
bool AppCacheDatabase::DeleteCache(int64_t cache_id) { if (!LazyOpen(kDontCreate)) return false; static const char kSql[] = "DELETE FROM Caches WHERE cache_id = ?"; sql::Statement statement(db_->GetCachedStatement(SQL_FROM_HERE, kSql)); statement.BindInt64(0, cache_id); return statement.Run(); }
bool AppCacheDatabase::DeleteCache(int64_t cache_id) { if (!LazyOpen(kDontCreate)) return false; static const char kSql[] = "DELETE FROM Caches WHERE cache_id = ?"; sql::Statement statement(db_->GetCachedStatement(SQL_FROM_HERE, kSql)); statement.BindInt64(0, cache_id); return statement.Run(); }
C
Chrome
0
CVE-2017-7375
https://www.cvedetails.com/cve/CVE-2017-7375/
CWE-611
https://android.googlesource.com/platform/external/libxml2/+/308396a55280f69ad4112d4f9892f4cbeff042aa
308396a55280f69ad4112d4f9892f4cbeff042aa
DO NOT MERGE: Add validation for eternal enities https://bugzilla.gnome.org/show_bug.cgi?id=780691 Bug: 36556310 Change-Id: I9450743e167c3c73af5e4071f3fc85e81d061648 (cherry picked from commit bef9af3d89d241bcb518c20cba6da2a2fd9ba049)
xmlParseStringPEReference(xmlParserCtxtPtr ctxt, const xmlChar **str) { const xmlChar *ptr; xmlChar cur; xmlChar *name; xmlEntityPtr entity = NULL; if ((str == NULL) || (*str == NULL)) return(NULL); ptr = *str; cur = *ptr; if (cur != '%') return(NULL); ptr++; name = xmlParseStringName(ctxt, &ptr); if (name == NULL) { xmlFatalErrMsg(ctxt, XML_ERR_NAME_REQUIRED, "xmlParseStringPEReference: no name\n"); *str = ptr; return(NULL); } cur = *ptr; if (cur != ';') { xmlFatalErr(ctxt, XML_ERR_ENTITYREF_SEMICOL_MISSING, NULL); xmlFree(name); *str = ptr; return(NULL); } ptr++; /* * Increate the number of entity references parsed */ ctxt->nbentities++; /* * Request the entity from SAX */ if ((ctxt->sax != NULL) && (ctxt->sax->getParameterEntity != NULL)) entity = ctxt->sax->getParameterEntity(ctxt->userData, name); if (ctxt->instate == XML_PARSER_EOF) { xmlFree(name); return(NULL); } if (entity == NULL) { /* * [ WFC: Entity Declared ] * In a document without any DTD, a document with only an * internal DTD subset which contains no parameter entity * references, or a document with "standalone='yes'", ... * ... The declaration of a parameter entity must precede * any reference to it... */ if ((ctxt->standalone == 1) || ((ctxt->hasExternalSubset == 0) && (ctxt->hasPErefs == 0))) { xmlFatalErrMsgStr(ctxt, XML_ERR_UNDECLARED_ENTITY, "PEReference: %%%s; not found\n", name); } else { /* * [ VC: Entity Declared ] * In a document with an external subset or external * parameter entities with "standalone='no'", ... * ... The declaration of a parameter entity must * precede any reference to it... */ xmlWarningMsg(ctxt, XML_WAR_UNDECLARED_ENTITY, "PEReference: %%%s; not found\n", name, NULL); ctxt->valid = 0; } xmlParserEntityCheck(ctxt, 0, NULL, 0); } else { /* * Internal checking in case the entity quest barfed */ if ((entity->etype != XML_INTERNAL_PARAMETER_ENTITY) && (entity->etype != XML_EXTERNAL_PARAMETER_ENTITY)) { xmlWarningMsg(ctxt, XML_WAR_UNDECLARED_ENTITY, "%%%s; is not a parameter entity\n", name, NULL); } } ctxt->hasPErefs = 1; xmlFree(name); *str = ptr; return(entity); }
xmlParseStringPEReference(xmlParserCtxtPtr ctxt, const xmlChar **str) { const xmlChar *ptr; xmlChar cur; xmlChar *name; xmlEntityPtr entity = NULL; if ((str == NULL) || (*str == NULL)) return(NULL); ptr = *str; cur = *ptr; if (cur != '%') return(NULL); ptr++; name = xmlParseStringName(ctxt, &ptr); if (name == NULL) { xmlFatalErrMsg(ctxt, XML_ERR_NAME_REQUIRED, "xmlParseStringPEReference: no name\n"); *str = ptr; return(NULL); } cur = *ptr; if (cur != ';') { xmlFatalErr(ctxt, XML_ERR_ENTITYREF_SEMICOL_MISSING, NULL); xmlFree(name); *str = ptr; return(NULL); } ptr++; /* * Increate the number of entity references parsed */ ctxt->nbentities++; /* * Request the entity from SAX */ if ((ctxt->sax != NULL) && (ctxt->sax->getParameterEntity != NULL)) entity = ctxt->sax->getParameterEntity(ctxt->userData, name); if (ctxt->instate == XML_PARSER_EOF) { xmlFree(name); return(NULL); } if (entity == NULL) { /* * [ WFC: Entity Declared ] * In a document without any DTD, a document with only an * internal DTD subset which contains no parameter entity * references, or a document with "standalone='yes'", ... * ... The declaration of a parameter entity must precede * any reference to it... */ if ((ctxt->standalone == 1) || ((ctxt->hasExternalSubset == 0) && (ctxt->hasPErefs == 0))) { xmlFatalErrMsgStr(ctxt, XML_ERR_UNDECLARED_ENTITY, "PEReference: %%%s; not found\n", name); } else { /* * [ VC: Entity Declared ] * In a document with an external subset or external * parameter entities with "standalone='no'", ... * ... The declaration of a parameter entity must * precede any reference to it... */ xmlWarningMsg(ctxt, XML_WAR_UNDECLARED_ENTITY, "PEReference: %%%s; not found\n", name, NULL); ctxt->valid = 0; } xmlParserEntityCheck(ctxt, 0, NULL, 0); } else { /* * Internal checking in case the entity quest barfed */ if ((entity->etype != XML_INTERNAL_PARAMETER_ENTITY) && (entity->etype != XML_EXTERNAL_PARAMETER_ENTITY)) { xmlWarningMsg(ctxt, XML_WAR_UNDECLARED_ENTITY, "%%%s; is not a parameter entity\n", name, NULL); } } ctxt->hasPErefs = 1; xmlFree(name); *str = ptr; return(entity); }
C
Android
0
CVE-2012-5136
https://www.cvedetails.com/cve/CVE-2012-5136/
CWE-20
https://github.com/chromium/chromium/commit/401d30ef93030afbf7e81e53a11b68fc36194502
401d30ef93030afbf7e81e53a11b68fc36194502
Refactoring: Move m_mayDisplaySeamlesslyWithParent down to Document The member is used only in Document, thus no reason to stay in SecurityContext. TEST=none BUG=none [email protected], abarth, haraken, hayato Review URL: https://codereview.chromium.org/27615003 git-svn-id: svn://svn.chromium.org/blink/trunk@159829 bbb929c8-8fbe-4397-9dbb-9b2b20218538
static inline bool isValidNamePart(UChar32 c) { if (isValidNameStart(c)) return true; if (c == 0x00B7 || c == 0x0387) return true; if (c == '-' || c == '.') return true; const uint32_t otherNamePartMask = Mark_NonSpacing | Mark_Enclosing | Mark_SpacingCombining | Letter_Modifier | Number_DecimalDigit; if (!(Unicode::category(c) & otherNamePartMask)) return false; if (c >= 0xF900 && c < 0xFFFE) return false; DecompositionType decompType = decompositionType(c); if (decompType == DecompositionFont || decompType == DecompositionCompat) return false; return true; }
static inline bool isValidNamePart(UChar32 c) { if (isValidNameStart(c)) return true; if (c == 0x00B7 || c == 0x0387) return true; if (c == '-' || c == '.') return true; const uint32_t otherNamePartMask = Mark_NonSpacing | Mark_Enclosing | Mark_SpacingCombining | Letter_Modifier | Number_DecimalDigit; if (!(Unicode::category(c) & otherNamePartMask)) return false; if (c >= 0xF900 && c < 0xFFFE) return false; DecompositionType decompType = decompositionType(c); if (decompType == DecompositionFont || decompType == DecompositionCompat) return false; return true; }
C
Chrome
0
CVE-2017-0375
https://www.cvedetails.com/cve/CVE-2017-0375/
CWE-617
https://github.com/torproject/tor/commit/79b59a2dfcb68897ee89d98587d09e55f07e68d7
79b59a2dfcb68897ee89d98587d09e55f07e68d7
TROVE-2017-004: Fix assertion failure in relay_send_end_cell_from_edge_ This fixes an assertion failure in relay_send_end_cell_from_edge_() when an origin circuit and a cpath_layer = NULL were passed. A service rendezvous circuit could do such a thing when a malformed BEGIN cell is received but shouldn't in the first place because the service needs to send an END cell on the circuit for which it can not do without a cpath_layer. Fixes #22493 Reported-by: Roger Dingledine <[email protected]> Signed-off-by: David Goulet <[email protected]>
connection_ap_get_original_destination(entry_connection_t *conn, socks_request_t *req) { #ifdef TRANS_NETFILTER return destination_from_socket(conn, req); #elif defined(TRANS_PF) const or_options_t *options = get_options(); if (options->TransProxyType_parsed == TPT_PF_DIVERT) return destination_from_socket(conn, req); if (options->TransProxyType_parsed == TPT_DEFAULT || options->TransProxyType_parsed == TPT_IPFW) return destination_from_pf(conn, req); (void)conn; (void)req; log_warn(LD_BUG, "Proxy destination determination mechanism %s unknown.", options->TransProxyType); return -1; #else (void)conn; (void)req; log_warn(LD_BUG, "Called connection_ap_get_original_destination, but no " "transparent proxy method was configured."); return -1; #endif }
connection_ap_get_original_destination(entry_connection_t *conn, socks_request_t *req) { #ifdef TRANS_NETFILTER return destination_from_socket(conn, req); #elif defined(TRANS_PF) const or_options_t *options = get_options(); if (options->TransProxyType_parsed == TPT_PF_DIVERT) return destination_from_socket(conn, req); if (options->TransProxyType_parsed == TPT_DEFAULT || options->TransProxyType_parsed == TPT_IPFW) return destination_from_pf(conn, req); (void)conn; (void)req; log_warn(LD_BUG, "Proxy destination determination mechanism %s unknown.", options->TransProxyType); return -1; #else (void)conn; (void)req; log_warn(LD_BUG, "Called connection_ap_get_original_destination, but no " "transparent proxy method was configured."); return -1; #endif }
C
tor
0
CVE-2013-1774
https://www.cvedetails.com/cve/CVE-2013-1774/
CWE-264
https://github.com/torvalds/linux/commit/1ee0a224bc9aad1de496c795f96bc6ba2c394811
1ee0a224bc9aad1de496c795f96bc6ba2c394811
USB: io_ti: Fix NULL dereference in chase_port() The tty is NULL when the port is hanging up. chase_port() needs to check for this. This patch is intended for stable series. The behavior was observed and tested in Linux 3.2 and 3.7.1. Johan Hovold submitted a more elaborate patch for the mainline kernel. [ 56.277883] usb 1-1: edge_bulk_in_callback - nonzero read bulk status received: -84 [ 56.278811] usb 1-1: USB disconnect, device number 3 [ 56.278856] usb 1-1: edge_bulk_in_callback - stopping read! [ 56.279562] BUG: unable to handle kernel NULL pointer dereference at 00000000000001c8 [ 56.280536] IP: [<ffffffff8144e62a>] _raw_spin_lock_irqsave+0x19/0x35 [ 56.281212] PGD 1dc1b067 PUD 1e0f7067 PMD 0 [ 56.282085] Oops: 0002 [#1] SMP [ 56.282744] Modules linked in: [ 56.283512] CPU 1 [ 56.283512] Pid: 25, comm: khubd Not tainted 3.7.1 #1 innotek GmbH VirtualBox/VirtualBox [ 56.283512] RIP: 0010:[<ffffffff8144e62a>] [<ffffffff8144e62a>] _raw_spin_lock_irqsave+0x19/0x35 [ 56.283512] RSP: 0018:ffff88001fa99ab0 EFLAGS: 00010046 [ 56.283512] RAX: 0000000000000046 RBX: 00000000000001c8 RCX: 0000000000640064 [ 56.283512] RDX: 0000000000010000 RSI: ffff88001fa99b20 RDI: 00000000000001c8 [ 56.283512] RBP: ffff88001fa99b20 R08: 0000000000000000 R09: 0000000000000000 [ 56.283512] R10: 0000000000000000 R11: ffffffff812fcb4c R12: ffff88001ddf53c0 [ 56.283512] R13: 0000000000000000 R14: 00000000000001c8 R15: ffff88001e19b9f4 [ 56.283512] FS: 0000000000000000(0000) GS:ffff88001fd00000(0000) knlGS:0000000000000000 [ 56.283512] CS: 0010 DS: 0000 ES: 0000 CR0: 000000008005003b [ 56.283512] CR2: 00000000000001c8 CR3: 000000001dc51000 CR4: 00000000000006e0 [ 56.283512] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 [ 56.283512] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400 [ 56.283512] Process khubd (pid: 25, threadinfo ffff88001fa98000, task ffff88001fa94f80) [ 56.283512] Stack: [ 56.283512] 0000000000000046 00000000000001c8 ffffffff810578ec ffffffff812fcb4c [ 56.283512] ffff88001e19b980 0000000000002710 ffffffff812ffe81 0000000000000001 [ 56.283512] ffff88001fa94f80 0000000000000202 ffffffff00000001 0000000000000296 [ 56.283512] Call Trace: [ 56.283512] [<ffffffff810578ec>] ? add_wait_queue+0x12/0x3c [ 56.283512] [<ffffffff812fcb4c>] ? usb_serial_port_work+0x28/0x28 [ 56.283512] [<ffffffff812ffe81>] ? chase_port+0x84/0x2d6 [ 56.283512] [<ffffffff81063f27>] ? try_to_wake_up+0x199/0x199 [ 56.283512] [<ffffffff81263a5c>] ? tty_ldisc_hangup+0x222/0x298 [ 56.283512] [<ffffffff81300171>] ? edge_close+0x64/0x129 [ 56.283512] [<ffffffff810612f7>] ? __wake_up+0x35/0x46 [ 56.283512] [<ffffffff8106135b>] ? should_resched+0x5/0x23 [ 56.283512] [<ffffffff81264916>] ? tty_port_shutdown+0x39/0x44 [ 56.283512] [<ffffffff812fcb4c>] ? usb_serial_port_work+0x28/0x28 [ 56.283512] [<ffffffff8125d38c>] ? __tty_hangup+0x307/0x351 [ 56.283512] [<ffffffff812e6ddc>] ? usb_hcd_flush_endpoint+0xde/0xed [ 56.283512] [<ffffffff8144e625>] ? _raw_spin_lock_irqsave+0x14/0x35 [ 56.283512] [<ffffffff812fd361>] ? usb_serial_disconnect+0x57/0xc2 [ 56.283512] [<ffffffff812ea99b>] ? usb_unbind_interface+0x5c/0x131 [ 56.283512] [<ffffffff8128d738>] ? __device_release_driver+0x7f/0xd5 [ 56.283512] [<ffffffff8128d9cd>] ? device_release_driver+0x1a/0x25 [ 56.283512] [<ffffffff8128d393>] ? bus_remove_device+0xd2/0xe7 [ 56.283512] [<ffffffff8128b7a3>] ? device_del+0x119/0x167 [ 56.283512] [<ffffffff812e8d9d>] ? usb_disable_device+0x6a/0x180 [ 56.283512] [<ffffffff812e2ae0>] ? usb_disconnect+0x81/0xe6 [ 56.283512] [<ffffffff812e4435>] ? hub_thread+0x577/0xe82 [ 56.283512] [<ffffffff8144daa7>] ? __schedule+0x490/0x4be [ 56.283512] [<ffffffff8105798f>] ? abort_exclusive_wait+0x79/0x79 [ 56.283512] [<ffffffff812e3ebe>] ? usb_remote_wakeup+0x2f/0x2f [ 56.283512] [<ffffffff812e3ebe>] ? usb_remote_wakeup+0x2f/0x2f [ 56.283512] [<ffffffff810570b4>] ? kthread+0x81/0x89 [ 56.283512] [<ffffffff81057033>] ? __kthread_parkme+0x5c/0x5c [ 56.283512] [<ffffffff8145387c>] ? ret_from_fork+0x7c/0xb0 [ 56.283512] [<ffffffff81057033>] ? __kthread_parkme+0x5c/0x5c [ 56.283512] Code: 8b 7c 24 08 e8 17 0b c3 ff 48 8b 04 24 48 83 c4 10 c3 53 48 89 fb 41 50 e8 e0 0a c3 ff 48 89 04 24 e8 e7 0a c3 ff ba 00 00 01 00 <f0> 0f c1 13 48 8b 04 24 89 d1 c1 ea 10 66 39 d1 74 07 f3 90 66 [ 56.283512] RIP [<ffffffff8144e62a>] _raw_spin_lock_irqsave+0x19/0x35 [ 56.283512] RSP <ffff88001fa99ab0> [ 56.283512] CR2: 00000000000001c8 [ 56.283512] ---[ end trace 49714df27e1679ce ]--- Signed-off-by: Wolfgang Frisch <[email protected]> Cc: Johan Hovold <[email protected]> Cc: stable <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
static int edge_port_probe(struct usb_serial_port *port) { struct edgeport_port *edge_port; int ret; edge_port = kzalloc(sizeof(*edge_port), GFP_KERNEL); if (!edge_port) return -ENOMEM; ret = kfifo_alloc(&edge_port->write_fifo, EDGE_OUT_BUF_SIZE, GFP_KERNEL); if (ret) { kfree(edge_port); return -ENOMEM; } spin_lock_init(&edge_port->ep_lock); edge_port->port = port; edge_port->edge_serial = usb_get_serial_data(port->serial); edge_port->bUartMode = default_uart_mode; usb_set_serial_port_data(port, edge_port); ret = edge_create_sysfs_attrs(port); if (ret) { kfifo_free(&edge_port->write_fifo); kfree(edge_port); return ret; } return 0; }
static int edge_port_probe(struct usb_serial_port *port) { struct edgeport_port *edge_port; int ret; edge_port = kzalloc(sizeof(*edge_port), GFP_KERNEL); if (!edge_port) return -ENOMEM; ret = kfifo_alloc(&edge_port->write_fifo, EDGE_OUT_BUF_SIZE, GFP_KERNEL); if (ret) { kfree(edge_port); return -ENOMEM; } spin_lock_init(&edge_port->ep_lock); edge_port->port = port; edge_port->edge_serial = usb_get_serial_data(port->serial); edge_port->bUartMode = default_uart_mode; usb_set_serial_port_data(port, edge_port); ret = edge_create_sysfs_attrs(port); if (ret) { kfifo_free(&edge_port->write_fifo); kfree(edge_port); return ret; } return 0; }
C
linux
0
CVE-2011-2861
https://www.cvedetails.com/cve/CVE-2011-2861/
CWE-20
https://github.com/chromium/chromium/commit/8262245d384be025f13e2a5b3a03b7e5c98374ce
8262245d384be025f13e2a5b3a03b7e5c98374ce
DevTools: move DevToolsAgent/Client into content. BUG=84078 TEST= Review URL: http://codereview.chromium.org/7461019 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@93596 0039d316-1c4b-4281-b951-d872f2087c98
void ChromeContentRendererClient::DidCreateIsolatedScriptContext( WebFrame* frame) { EventBindings::HandleContextCreated(frame, true, extension_dispatcher_.get()); }
void ChromeContentRendererClient::DidCreateIsolatedScriptContext( WebFrame* frame) { EventBindings::HandleContextCreated(frame, true, extension_dispatcher_.get()); }
C
Chrome
0
CVE-2011-3055
https://www.cvedetails.com/cve/CVE-2011-3055/
null
https://github.com/chromium/chromium/commit/e9372a1bfd3588a80fcf49aa07321f0971dd6091
e9372a1bfd3588a80fcf49aa07321f0971dd6091
[V8] Pass Isolate to throwNotEnoughArgumentsError() https://bugs.webkit.org/show_bug.cgi?id=86983 Reviewed by Adam Barth. The objective is to pass Isolate around in V8 bindings. This patch passes Isolate to throwNotEnoughArgumentsError(). No tests. No change in behavior. * bindings/scripts/CodeGeneratorV8.pm: (GenerateArgumentsCountCheck): (GenerateEventConstructorCallback): * bindings/scripts/test/V8/V8Float64Array.cpp: (WebCore::Float64ArrayV8Internal::fooCallback): * bindings/scripts/test/V8/V8TestActiveDOMObject.cpp: (WebCore::TestActiveDOMObjectV8Internal::excitingFunctionCallback): (WebCore::TestActiveDOMObjectV8Internal::postMessageCallback): * bindings/scripts/test/V8/V8TestCustomNamedGetter.cpp: (WebCore::TestCustomNamedGetterV8Internal::anotherFunctionCallback): * bindings/scripts/test/V8/V8TestEventConstructor.cpp: (WebCore::V8TestEventConstructor::constructorCallback): * bindings/scripts/test/V8/V8TestEventTarget.cpp: (WebCore::TestEventTargetV8Internal::itemCallback): (WebCore::TestEventTargetV8Internal::dispatchEventCallback): * bindings/scripts/test/V8/V8TestInterface.cpp: (WebCore::TestInterfaceV8Internal::supplementalMethod2Callback): (WebCore::V8TestInterface::constructorCallback): * bindings/scripts/test/V8/V8TestMediaQueryListListener.cpp: (WebCore::TestMediaQueryListListenerV8Internal::methodCallback): * bindings/scripts/test/V8/V8TestNamedConstructor.cpp: (WebCore::V8TestNamedConstructorConstructorCallback): * bindings/scripts/test/V8/V8TestObj.cpp: (WebCore::TestObjV8Internal::voidMethodWithArgsCallback): (WebCore::TestObjV8Internal::intMethodWithArgsCallback): (WebCore::TestObjV8Internal::objMethodWithArgsCallback): (WebCore::TestObjV8Internal::methodWithSequenceArgCallback): (WebCore::TestObjV8Internal::methodReturningSequenceCallback): (WebCore::TestObjV8Internal::methodThatRequiresAllArgsAndThrowsCallback): (WebCore::TestObjV8Internal::serializedValueCallback): (WebCore::TestObjV8Internal::idbKeyCallback): (WebCore::TestObjV8Internal::optionsObjectCallback): (WebCore::TestObjV8Internal::methodWithNonOptionalArgAndOptionalArgCallback): (WebCore::TestObjV8Internal::methodWithNonOptionalArgAndTwoOptionalArgsCallback): (WebCore::TestObjV8Internal::methodWithCallbackArgCallback): (WebCore::TestObjV8Internal::methodWithNonCallbackArgAndCallbackArgCallback): (WebCore::TestObjV8Internal::overloadedMethod1Callback): (WebCore::TestObjV8Internal::overloadedMethod2Callback): (WebCore::TestObjV8Internal::overloadedMethod3Callback): (WebCore::TestObjV8Internal::overloadedMethod4Callback): (WebCore::TestObjV8Internal::overloadedMethod5Callback): (WebCore::TestObjV8Internal::overloadedMethod6Callback): (WebCore::TestObjV8Internal::overloadedMethod7Callback): (WebCore::TestObjV8Internal::overloadedMethod11Callback): (WebCore::TestObjV8Internal::overloadedMethod12Callback): (WebCore::TestObjV8Internal::enabledAtRuntimeMethod1Callback): (WebCore::TestObjV8Internal::enabledAtRuntimeMethod2Callback): (WebCore::TestObjV8Internal::convert1Callback): (WebCore::TestObjV8Internal::convert2Callback): (WebCore::TestObjV8Internal::convert3Callback): (WebCore::TestObjV8Internal::convert4Callback): (WebCore::TestObjV8Internal::convert5Callback): (WebCore::TestObjV8Internal::strictFunctionCallback): (WebCore::V8TestObj::constructorCallback): * bindings/scripts/test/V8/V8TestSerializedScriptValueInterface.cpp: (WebCore::TestSerializedScriptValueInterfaceV8Internal::acceptTransferListCallback): (WebCore::V8TestSerializedScriptValueInterface::constructorCallback): * bindings/v8/ScriptController.cpp: (WebCore::setValueAndClosePopupCallback): * bindings/v8/V8Proxy.cpp: (WebCore::V8Proxy::throwNotEnoughArgumentsError): * bindings/v8/V8Proxy.h: (V8Proxy): * bindings/v8/custom/V8AudioContextCustom.cpp: (WebCore::V8AudioContext::constructorCallback): * bindings/v8/custom/V8DataViewCustom.cpp: (WebCore::V8DataView::getInt8Callback): (WebCore::V8DataView::getUint8Callback): (WebCore::V8DataView::setInt8Callback): (WebCore::V8DataView::setUint8Callback): * bindings/v8/custom/V8DirectoryEntryCustom.cpp: (WebCore::V8DirectoryEntry::getDirectoryCallback): (WebCore::V8DirectoryEntry::getFileCallback): * bindings/v8/custom/V8IntentConstructor.cpp: (WebCore::V8Intent::constructorCallback): * bindings/v8/custom/V8SVGLengthCustom.cpp: (WebCore::V8SVGLength::convertToSpecifiedUnitsCallback): * bindings/v8/custom/V8WebGLRenderingContextCustom.cpp: (WebCore::getObjectParameter): (WebCore::V8WebGLRenderingContext::getAttachedShadersCallback): (WebCore::V8WebGLRenderingContext::getExtensionCallback): (WebCore::V8WebGLRenderingContext::getFramebufferAttachmentParameterCallback): (WebCore::V8WebGLRenderingContext::getParameterCallback): (WebCore::V8WebGLRenderingContext::getProgramParameterCallback): (WebCore::V8WebGLRenderingContext::getShaderParameterCallback): (WebCore::V8WebGLRenderingContext::getUniformCallback): (WebCore::vertexAttribAndUniformHelperf): (WebCore::uniformHelperi): (WebCore::uniformMatrixHelper): * bindings/v8/custom/V8WebKitMutationObserverCustom.cpp: (WebCore::V8WebKitMutationObserver::constructorCallback): (WebCore::V8WebKitMutationObserver::observeCallback): * bindings/v8/custom/V8WebSocketCustom.cpp: (WebCore::V8WebSocket::constructorCallback): (WebCore::V8WebSocket::sendCallback): * bindings/v8/custom/V8XMLHttpRequestCustom.cpp: (WebCore::V8XMLHttpRequest::openCallback): git-svn-id: svn://svn.chromium.org/blink/trunk@117736 bbb929c8-8fbe-4397-9dbb-9b2b20218538
void ScriptController::installFunctionsForPagePopup(Frame* frame, PagePopupClient* popupClient) { ASSERT(frame); ASSERT(popupClient); v8::HandleScope handleScope; v8::Handle<v8::Context> context = V8Proxy::mainWorldContext(frame); if (context.IsEmpty()) { ASSERT_NOT_REACHED(); return; } v8::Context::Scope scope(context); DOMWindowPagePopup::install(frame->existingDOMWindow(), popupClient); v8::Local<v8::FunctionTemplate> templ = v8::FunctionTemplate::New(setValueAndClosePopupCallback, V8DOMWindow::wrap(frame->existingDOMWindow())); context->Global()->Set(v8::String::New("setValueAndClosePopup"), v8::Handle<v8::Function>(templ->GetFunction())); }
void ScriptController::installFunctionsForPagePopup(Frame* frame, PagePopupClient* popupClient) { ASSERT(frame); ASSERT(popupClient); v8::HandleScope handleScope; v8::Handle<v8::Context> context = V8Proxy::mainWorldContext(frame); if (context.IsEmpty()) { ASSERT_NOT_REACHED(); return; } v8::Context::Scope scope(context); DOMWindowPagePopup::install(frame->existingDOMWindow(), popupClient); v8::Local<v8::FunctionTemplate> templ = v8::FunctionTemplate::New(setValueAndClosePopupCallback, V8DOMWindow::wrap(frame->existingDOMWindow())); context->Global()->Set(v8::String::New("setValueAndClosePopup"), v8::Handle<v8::Function>(templ->GetFunction())); }
C
Chrome
0
CVE-2013-1792
https://www.cvedetails.com/cve/CVE-2013-1792/
CWE-362
https://github.com/torvalds/linux/commit/0da9dfdd2cd9889201bc6f6f43580c99165cd087
0da9dfdd2cd9889201bc6f6f43580c99165cd087
keys: fix race with concurrent install_user_keyrings() This fixes CVE-2013-1792. There is a race in install_user_keyrings() that can cause a NULL pointer dereference when called concurrently for the same user if the uid and uid-session keyrings are not yet created. It might be possible for an unprivileged user to trigger this by calling keyctl() from userspace in parallel immediately after logging in. Assume that we have two threads both executing lookup_user_key(), both looking for KEY_SPEC_USER_SESSION_KEYRING. THREAD A THREAD B =============================== =============================== ==>call install_user_keyrings(); if (!cred->user->session_keyring) ==>call install_user_keyrings() ... user->uid_keyring = uid_keyring; if (user->uid_keyring) return 0; <== key = cred->user->session_keyring [== NULL] user->session_keyring = session_keyring; atomic_inc(&key->usage); [oops] At the point thread A dereferences cred->user->session_keyring, thread B hasn't updated user->session_keyring yet, but thread A assumes it is populated because install_user_keyrings() returned ok. The race window is really small but can be exploited if, for example, thread B is interrupted or preempted after initializing uid_keyring, but before doing setting session_keyring. This couldn't be reproduced on a stock kernel. However, after placing systemtap probe on 'user->session_keyring = session_keyring;' that introduced some delay, the kernel could be crashed reliably. Fix this by checking both pointers before deciding whether to return. Alternatively, the test could be done away with entirely as it is checked inside the mutex - but since the mutex is global, that may not be the best way. Signed-off-by: David Howells <[email protected]> Reported-by: Mateusz Guzik <[email protected]> Cc: <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: James Morris <[email protected]>
int install_process_keyring_to_cred(struct cred *new) { struct key *keyring; if (new->process_keyring) return -EEXIST; keyring = keyring_alloc("_pid", new->uid, new->gid, new, KEY_POS_ALL | KEY_USR_VIEW, KEY_ALLOC_QUOTA_OVERRUN, NULL); if (IS_ERR(keyring)) return PTR_ERR(keyring); new->process_keyring = keyring; return 0; }
int install_process_keyring_to_cred(struct cred *new) { struct key *keyring; if (new->process_keyring) return -EEXIST; keyring = keyring_alloc("_pid", new->uid, new->gid, new, KEY_POS_ALL | KEY_USR_VIEW, KEY_ALLOC_QUOTA_OVERRUN, NULL); if (IS_ERR(keyring)) return PTR_ERR(keyring); new->process_keyring = keyring; return 0; }
C
linux
0
CVE-2012-1179
https://www.cvedetails.com/cve/CVE-2012-1179/
CWE-264
https://github.com/torvalds/linux/commit/4a1d704194a441bf83c636004a479e01360ec850
4a1d704194a441bf83c636004a479e01360ec850
mm: thp: fix pmd_bad() triggering in code paths holding mmap_sem read mode commit 1a5a9906d4e8d1976b701f889d8f35d54b928f25 upstream. In some cases it may happen that pmd_none_or_clear_bad() is called with the mmap_sem hold in read mode. In those cases the huge page faults can allocate hugepmds under pmd_none_or_clear_bad() and that can trigger a false positive from pmd_bad() that will not like to see a pmd materializing as trans huge. It's not khugepaged causing the problem, khugepaged holds the mmap_sem in write mode (and all those sites must hold the mmap_sem in read mode to prevent pagetables to go away from under them, during code review it seems vm86 mode on 32bit kernels requires that too unless it's restricted to 1 thread per process or UP builds). The race is only with the huge pagefaults that can convert a pmd_none() into a pmd_trans_huge(). Effectively all these pmd_none_or_clear_bad() sites running with mmap_sem in read mode are somewhat speculative with the page faults, and the result is always undefined when they run simultaneously. This is probably why it wasn't common to run into this. For example if the madvise(MADV_DONTNEED) runs zap_page_range() shortly before the page fault, the hugepage will not be zapped, if the page fault runs first it will be zapped. Altering pmd_bad() not to error out if it finds hugepmds won't be enough to fix this, because zap_pmd_range would then proceed to call zap_pte_range (which would be incorrect if the pmd become a pmd_trans_huge()). The simplest way to fix this is to read the pmd in the local stack (regardless of what we read, no need of actual CPU barriers, only compiler barrier needed), and be sure it is not changing under the code that computes its value. Even if the real pmd is changing under the value we hold on the stack, we don't care. If we actually end up in zap_pte_range it means the pmd was not none already and it was not huge, and it can't become huge from under us (khugepaged locking explained above). All we need is to enforce that there is no way anymore that in a code path like below, pmd_trans_huge can be false, but pmd_none_or_clear_bad can run into a hugepmd. The overhead of a barrier() is just a compiler tweak and should not be measurable (I only added it for THP builds). I don't exclude different compiler versions may have prevented the race too by caching the value of *pmd on the stack (that hasn't been verified, but it wouldn't be impossible considering pmd_none_or_clear_bad, pmd_bad, pmd_trans_huge, pmd_none are all inlines and there's no external function called in between pmd_trans_huge and pmd_none_or_clear_bad). if (pmd_trans_huge(*pmd)) { if (next-addr != HPAGE_PMD_SIZE) { VM_BUG_ON(!rwsem_is_locked(&tlb->mm->mmap_sem)); split_huge_page_pmd(vma->vm_mm, pmd); } else if (zap_huge_pmd(tlb, vma, pmd, addr)) continue; /* fall through */ } if (pmd_none_or_clear_bad(pmd)) Because this race condition could be exercised without special privileges this was reported in CVE-2012-1179. The race was identified and fully explained by Ulrich who debugged it. I'm quoting his accurate explanation below, for reference. ====== start quote ======= mapcount 0 page_mapcount 1 kernel BUG at mm/huge_memory.c:1384! At some point prior to the panic, a "bad pmd ..." message similar to the following is logged on the console: mm/memory.c:145: bad pmd ffff8800376e1f98(80000000314000e7). The "bad pmd ..." message is logged by pmd_clear_bad() before it clears the page's PMD table entry. 143 void pmd_clear_bad(pmd_t *pmd) 144 { -> 145 pmd_ERROR(*pmd); 146 pmd_clear(pmd); 147 } After the PMD table entry has been cleared, there is an inconsistency between the actual number of PMD table entries that are mapping the page and the page's map count (_mapcount field in struct page). When the page is subsequently reclaimed, __split_huge_page() detects this inconsistency. 1381 if (mapcount != page_mapcount(page)) 1382 printk(KERN_ERR "mapcount %d page_mapcount %d\n", 1383 mapcount, page_mapcount(page)); -> 1384 BUG_ON(mapcount != page_mapcount(page)); The root cause of the problem is a race of two threads in a multithreaded process. Thread B incurs a page fault on a virtual address that has never been accessed (PMD entry is zero) while Thread A is executing an madvise() system call on a virtual address within the same 2 MB (huge page) range. virtual address space .---------------------. | | | | .-|---------------------| | | | | | |<-- B(fault) | | | 2 MB | |/////////////////////|-. huge < |/////////////////////| > A(range) page | |/////////////////////|-' | | | | | | '-|---------------------| | | | | '---------------------' - Thread A is executing an madvise(..., MADV_DONTNEED) system call on the virtual address range "A(range)" shown in the picture. sys_madvise // Acquire the semaphore in shared mode. down_read(&current->mm->mmap_sem) ... madvise_vma switch (behavior) case MADV_DONTNEED: madvise_dontneed zap_page_range unmap_vmas unmap_page_range zap_pud_range zap_pmd_range // // Assume that this huge page has never been accessed. // I.e. content of the PMD entry is zero (not mapped). // if (pmd_trans_huge(*pmd)) { // We don't get here due to the above assumption. } // // Assume that Thread B incurred a page fault and .---------> // sneaks in here as shown below. | // | if (pmd_none_or_clear_bad(pmd)) | { | if (unlikely(pmd_bad(*pmd))) | pmd_clear_bad | { | pmd_ERROR | // Log "bad pmd ..." message here. | pmd_clear | // Clear the page's PMD entry. | // Thread B incremented the map count | // in page_add_new_anon_rmap(), but | // now the page is no longer mapped | // by a PMD entry (-> inconsistency). | } | } | v - Thread B is handling a page fault on virtual address "B(fault)" shown in the picture. ... do_page_fault __do_page_fault // Acquire the semaphore in shared mode. down_read_trylock(&mm->mmap_sem) ... handle_mm_fault if (pmd_none(*pmd) && transparent_hugepage_enabled(vma)) // We get here due to the above assumption (PMD entry is zero). do_huge_pmd_anonymous_page alloc_hugepage_vma // Allocate a new transparent huge page here. ... __do_huge_pmd_anonymous_page ... spin_lock(&mm->page_table_lock) ... page_add_new_anon_rmap // Here we increment the page's map count (starts at -1). atomic_set(&page->_mapcount, 0) set_pmd_at // Here we set the page's PMD entry which will be cleared // when Thread A calls pmd_clear_bad(). ... spin_unlock(&mm->page_table_lock) The mmap_sem does not prevent the race because both threads are acquiring it in shared mode (down_read). Thread B holds the page_table_lock while the page's map count and PMD table entry are updated. However, Thread A does not synchronize on that lock. ====== end quote ======= [[email protected]: checkpatch fixes] Reported-by: Ulrich Obergfell <[email protected]> Signed-off-by: Andrea Arcangeli <[email protected]> Acked-by: Johannes Weiner <[email protected]> Cc: Mel Gorman <[email protected]> Cc: Hugh Dickins <[email protected]> Cc: Dave Jones <[email protected]> Acked-by: Larry Woodman <[email protected]> Acked-by: Rik van Riel <[email protected]> Cc: Mark Salter <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
__mem_cgroup_largest_soft_limit_node(struct mem_cgroup_tree_per_zone *mctz) { struct rb_node *rightmost = NULL; struct mem_cgroup_per_zone *mz; retry: mz = NULL; rightmost = rb_last(&mctz->rb_root); if (!rightmost) goto done; /* Nothing to reclaim from */ mz = rb_entry(rightmost, struct mem_cgroup_per_zone, tree_node); /* * Remove the node now but someone else can add it back, * we will to add it back at the end of reclaim to its correct * position in the tree. */ __mem_cgroup_remove_exceeded(mz->mem, mz, mctz); if (!res_counter_soft_limit_excess(&mz->mem->res) || !css_tryget(&mz->mem->css)) goto retry; done: return mz; }
__mem_cgroup_largest_soft_limit_node(struct mem_cgroup_tree_per_zone *mctz) { struct rb_node *rightmost = NULL; struct mem_cgroup_per_zone *mz; retry: mz = NULL; rightmost = rb_last(&mctz->rb_root); if (!rightmost) goto done; /* Nothing to reclaim from */ mz = rb_entry(rightmost, struct mem_cgroup_per_zone, tree_node); /* * Remove the node now but someone else can add it back, * we will to add it back at the end of reclaim to its correct * position in the tree. */ __mem_cgroup_remove_exceeded(mz->mem, mz, mctz); if (!res_counter_soft_limit_excess(&mz->mem->res) || !css_tryget(&mz->mem->css)) goto retry; done: return mz; }
C
linux
0
CVE-2016-10066
https://www.cvedetails.com/cve/CVE-2016-10066/
CWE-119
https://github.com/ImageMagick/ImageMagick/commit/f6e9d0d9955e85bdd7540b251cd50d598dacc5e6
f6e9d0d9955e85bdd7540b251cd50d598dacc5e6
null
static void ipa_rop_draw(wmfAPI * API, wmfROP_Draw_t * rop_draw) { /* wmfBrush */ /* *brush = WMF_DC_BRUSH(rop_draw->dc); */ /* wmfBMP */ /* *brush_bmp = WMF_BRUSH_BITMAP(brush); */ if (TO_FILL(rop_draw) == 0) return; /* Save graphic wand */ (void) PushDrawingWand(WmfDrawingWand); /* FIXME: finish implementing (once we know what it is supposed to do!) */ /* struct _wmfROP_Draw_t { wmfDC* dc; wmfD_Coord TL; wmfD_Coord BR; U32 ROP; double pixel_width; double pixel_height; }; */ /* if (brush_bmp && brush_bmp->data != 0) */ /* printf("Have an image!\n"); */ switch (rop_draw->ROP) /* Ternary raster operations */ { case SRCCOPY: /* dest = source */ printf("ipa_rop_draw SRCCOPY ROP mode not implemented\n"); break; case SRCPAINT: /* dest = source OR dest */ printf("ipa_rop_draw SRCPAINT ROP mode not implemented\n"); break; case SRCAND: /* dest = source AND dest */ printf("ipa_rop_draw SRCAND ROP mode not implemented\n"); break; case SRCINVERT: /* dest = source XOR dest */ printf("ipa_rop_draw SRCINVERT ROP mode not implemented\n"); break; case SRCERASE: /* dest = source AND (NOT dest) */ printf("ipa_rop_draw SRCERASE ROP mode not implemented\n"); break; case NOTSRCCOPY: /* dest = (NOT source) */ printf("ipa_rop_draw NOTSRCCOPY ROP mode not implemented\n"); break; case NOTSRCERASE: /* dest = (NOT src) AND (NOT dest) */ printf("ipa_rop_draw NOTSRCERASE ROP mode not implemented\n"); break; case MERGECOPY: /* dest = (source AND pattern) */ printf("ipa_rop_draw MERGECOPY ROP mode not implemented\n"); break; case MERGEPAINT: /* dest = (NOT source) OR dest */ printf("ipa_rop_draw MERGEPAINT ROP mode not implemented\n"); break; case PATCOPY: /* dest = pattern */ util_set_brush(API, rop_draw->dc, BrushApplyFill); break; case PATPAINT: /* dest = DPSnoo */ printf("ipa_rop_draw PATPAINT ROP mode not implemented\n"); break; case PATINVERT: /* dest = pattern XOR dest */ printf("ipa_rop_draw PATINVERT ROP mode not implemented\n"); break; case DSTINVERT: /* dest = (NOT dest) */ printf("ipa_rop_draw DSTINVERT ROP mode not implemented\n"); break; case BLACKNESS: /* dest = BLACK */ draw_fill_color_string(WmfDrawingWand,"black"); break; case WHITENESS: /* dest = WHITE */ draw_fill_color_string(WmfDrawingWand,"white"); break; default: printf("ipa_rop_draw 0x%x ROP mode not implemented\n", rop_draw->ROP); break; } DrawRectangle(WmfDrawingWand, XC(rop_draw->TL.x), YC(rop_draw->TL.y), XC(rop_draw->BR.x), YC(rop_draw->BR.y)); /* Restore graphic wand */ (void) PopDrawingWand(WmfDrawingWand); }
static void ipa_rop_draw(wmfAPI * API, wmfROP_Draw_t * rop_draw) { /* wmfBrush */ /* *brush = WMF_DC_BRUSH(rop_draw->dc); */ /* wmfBMP */ /* *brush_bmp = WMF_BRUSH_BITMAP(brush); */ if (TO_FILL(rop_draw) == 0) return; /* Save graphic wand */ (void) PushDrawingWand(WmfDrawingWand); /* FIXME: finish implementing (once we know what it is supposed to do!) */ /* struct _wmfROP_Draw_t { wmfDC* dc; wmfD_Coord TL; wmfD_Coord BR; U32 ROP; double pixel_width; double pixel_height; }; */ /* if (brush_bmp && brush_bmp->data != 0) */ /* printf("Have an image!\n"); */ switch (rop_draw->ROP) /* Ternary raster operations */ { case SRCCOPY: /* dest = source */ printf("ipa_rop_draw SRCCOPY ROP mode not implemented\n"); break; case SRCPAINT: /* dest = source OR dest */ printf("ipa_rop_draw SRCPAINT ROP mode not implemented\n"); break; case SRCAND: /* dest = source AND dest */ printf("ipa_rop_draw SRCAND ROP mode not implemented\n"); break; case SRCINVERT: /* dest = source XOR dest */ printf("ipa_rop_draw SRCINVERT ROP mode not implemented\n"); break; case SRCERASE: /* dest = source AND (NOT dest) */ printf("ipa_rop_draw SRCERASE ROP mode not implemented\n"); break; case NOTSRCCOPY: /* dest = (NOT source) */ printf("ipa_rop_draw NOTSRCCOPY ROP mode not implemented\n"); break; case NOTSRCERASE: /* dest = (NOT src) AND (NOT dest) */ printf("ipa_rop_draw NOTSRCERASE ROP mode not implemented\n"); break; case MERGECOPY: /* dest = (source AND pattern) */ printf("ipa_rop_draw MERGECOPY ROP mode not implemented\n"); break; case MERGEPAINT: /* dest = (NOT source) OR dest */ printf("ipa_rop_draw MERGEPAINT ROP mode not implemented\n"); break; case PATCOPY: /* dest = pattern */ util_set_brush(API, rop_draw->dc, BrushApplyFill); break; case PATPAINT: /* dest = DPSnoo */ printf("ipa_rop_draw PATPAINT ROP mode not implemented\n"); break; case PATINVERT: /* dest = pattern XOR dest */ printf("ipa_rop_draw PATINVERT ROP mode not implemented\n"); break; case DSTINVERT: /* dest = (NOT dest) */ printf("ipa_rop_draw DSTINVERT ROP mode not implemented\n"); break; case BLACKNESS: /* dest = BLACK */ draw_fill_color_string(WmfDrawingWand,"black"); break; case WHITENESS: /* dest = WHITE */ draw_fill_color_string(WmfDrawingWand,"white"); break; default: printf("ipa_rop_draw 0x%x ROP mode not implemented\n", rop_draw->ROP); break; } DrawRectangle(WmfDrawingWand, XC(rop_draw->TL.x), YC(rop_draw->TL.y), XC(rop_draw->BR.x), YC(rop_draw->BR.y)); /* Restore graphic wand */ (void) PopDrawingWand(WmfDrawingWand); }
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 <[email protected]> Reviewed-by: Kentaro Hara <[email protected]> Reviewed-by: Geoff Lang <[email protected]> Reviewed-by: Kenneth Russell <[email protected]> Cr-Commit-Position: refs/heads/master@{#657568}
error::Error GLES2DecoderPassthroughImpl::DoUniformBlockBinding( GLuint program, GLuint index, GLuint binding) { api()->glUniformBlockBindingFn(GetProgramServiceID(program, resources_), index, binding); return error::kNoError; }
error::Error GLES2DecoderPassthroughImpl::DoUniformBlockBinding( GLuint program, GLuint index, GLuint binding) { api()->glUniformBlockBindingFn(GetProgramServiceID(program, resources_), index, binding); return error::kNoError; }
C
Chrome
0
CVE-2013-4591
https://www.cvedetails.com/cve/CVE-2013-4591/
CWE-119
https://github.com/torvalds/linux/commit/7d3e91a89b7adbc2831334def9e494dd9892f9af
7d3e91a89b7adbc2831334def9e494dd9892f9af
NFSv4: Check for buffer length in __nfs4_get_acl_uncached Commit 1f1ea6c "NFSv4: Fix buffer overflow checking in __nfs4_get_acl_uncached" accidently dropped the checking for too small result buffer length. If someone uses getxattr on "system.nfs4_acl" on an NFSv4 mount supporting ACLs, the ACL has not been cached and the buffer suplied is too short, we still copy the complete ACL, resulting in kernel and user space memory corruption. Signed-off-by: Sven Wegener <[email protected]> Cc: [email protected] Signed-off-by: Trond Myklebust <[email protected]>
static int nfs4_lookup_root(struct nfs_server *server, struct nfs_fh *fhandle, struct nfs_fsinfo *info) { struct nfs4_exception exception = { }; int err; do { err = _nfs4_lookup_root(server, fhandle, info); switch (err) { case 0: case -NFS4ERR_WRONGSEC: goto out; default: err = nfs4_handle_exception(server, err, &exception); } } while (exception.retry); out: return err; }
static int nfs4_lookup_root(struct nfs_server *server, struct nfs_fh *fhandle, struct nfs_fsinfo *info) { struct nfs4_exception exception = { }; int err; do { err = _nfs4_lookup_root(server, fhandle, info); switch (err) { case 0: case -NFS4ERR_WRONGSEC: goto out; default: err = nfs4_handle_exception(server, err, &exception); } } while (exception.retry); out: return err; }
C
linux
0
CVE-2017-15265
https://www.cvedetails.com/cve/CVE-2017-15265/
CWE-416
https://github.com/torvalds/linux/commit/71105998845fb012937332fe2e806d443c09e026
71105998845fb012937332fe2e806d443c09e026
ALSA: seq: Fix use-after-free at creating a port There is a potential race window opened at creating and deleting a port via ioctl, as spotted by fuzzing. snd_seq_create_port() creates a port object and returns its pointer, but it doesn't take the refcount, thus it can be deleted immediately by another thread. Meanwhile, snd_seq_ioctl_create_port() still calls the function snd_seq_system_client_ev_port_start() with the created port object that is being deleted, and this triggers use-after-free like: BUG: KASAN: use-after-free in snd_seq_ioctl_create_port+0x504/0x630 [snd_seq] at addr ffff8801f2241cb1 ============================================================================= BUG kmalloc-512 (Tainted: G B ): kasan: bad access detected ----------------------------------------------------------------------------- INFO: Allocated in snd_seq_create_port+0x94/0x9b0 [snd_seq] age=1 cpu=3 pid=4511 ___slab_alloc+0x425/0x460 __slab_alloc+0x20/0x40 kmem_cache_alloc_trace+0x150/0x190 snd_seq_create_port+0x94/0x9b0 [snd_seq] snd_seq_ioctl_create_port+0xd1/0x630 [snd_seq] snd_seq_do_ioctl+0x11c/0x190 [snd_seq] snd_seq_ioctl+0x40/0x80 [snd_seq] do_vfs_ioctl+0x54b/0xda0 SyS_ioctl+0x79/0x90 entry_SYSCALL_64_fastpath+0x16/0x75 INFO: Freed in port_delete+0x136/0x1a0 [snd_seq] age=1 cpu=2 pid=4717 __slab_free+0x204/0x310 kfree+0x15f/0x180 port_delete+0x136/0x1a0 [snd_seq] snd_seq_delete_port+0x235/0x350 [snd_seq] snd_seq_ioctl_delete_port+0xc8/0x180 [snd_seq] snd_seq_do_ioctl+0x11c/0x190 [snd_seq] snd_seq_ioctl+0x40/0x80 [snd_seq] do_vfs_ioctl+0x54b/0xda0 SyS_ioctl+0x79/0x90 entry_SYSCALL_64_fastpath+0x16/0x75 Call Trace: [<ffffffff81b03781>] dump_stack+0x63/0x82 [<ffffffff81531b3b>] print_trailer+0xfb/0x160 [<ffffffff81536db4>] object_err+0x34/0x40 [<ffffffff815392d3>] kasan_report.part.2+0x223/0x520 [<ffffffffa07aadf4>] ? snd_seq_ioctl_create_port+0x504/0x630 [snd_seq] [<ffffffff815395fe>] __asan_report_load1_noabort+0x2e/0x30 [<ffffffffa07aadf4>] snd_seq_ioctl_create_port+0x504/0x630 [snd_seq] [<ffffffffa07aa8f0>] ? snd_seq_ioctl_delete_port+0x180/0x180 [snd_seq] [<ffffffff8136be50>] ? taskstats_exit+0xbc0/0xbc0 [<ffffffffa07abc5c>] snd_seq_do_ioctl+0x11c/0x190 [snd_seq] [<ffffffffa07abd10>] snd_seq_ioctl+0x40/0x80 [snd_seq] [<ffffffff8136d433>] ? acct_account_cputime+0x63/0x80 [<ffffffff815b515b>] do_vfs_ioctl+0x54b/0xda0 ..... We may fix this in a few different ways, and in this patch, it's fixed simply by taking the refcount properly at snd_seq_create_port() and letting the caller unref the object after use. Also, there is another potential use-after-free by sprintf() call in snd_seq_create_port(), and this is moved inside the lock. This fix covers CVE-2017-15265. Reported-and-tested-by: Michael23 Yu <[email protected]> Suggested-by: Linus Torvalds <[email protected]> Cc: <[email protected]> Signed-off-by: Takashi Iwai <[email protected]>
static void get_client_info(struct snd_seq_client *cptr, struct snd_seq_client_info *info) { info->client = cptr->number; /* fill the info fields */ info->type = cptr->type; strcpy(info->name, cptr->name); info->filter = cptr->filter; info->event_lost = cptr->event_lost; memcpy(info->event_filter, cptr->event_filter, 32); info->num_ports = cptr->num_ports; if (cptr->type == USER_CLIENT) info->pid = pid_vnr(cptr->data.user.owner); else info->pid = -1; if (cptr->type == KERNEL_CLIENT) info->card = cptr->data.kernel.card ? cptr->data.kernel.card->number : -1; else info->card = -1; memset(info->reserved, 0, sizeof(info->reserved)); }
static void get_client_info(struct snd_seq_client *cptr, struct snd_seq_client_info *info) { info->client = cptr->number; /* fill the info fields */ info->type = cptr->type; strcpy(info->name, cptr->name); info->filter = cptr->filter; info->event_lost = cptr->event_lost; memcpy(info->event_filter, cptr->event_filter, 32); info->num_ports = cptr->num_ports; if (cptr->type == USER_CLIENT) info->pid = pid_vnr(cptr->data.user.owner); else info->pid = -1; if (cptr->type == KERNEL_CLIENT) info->card = cptr->data.kernel.card ? cptr->data.kernel.card->number : -1; else info->card = -1; memset(info->reserved, 0, sizeof(info->reserved)); }
C
linux
0
CVE-2018-6140
https://www.cvedetails.com/cve/CVE-2018-6140/
CWE-20
https://github.com/chromium/chromium/commit/2aec794f26098c7a361c27d7c8f57119631cca8a
2aec794f26098c7a361c27d7c8f57119631cca8a
[DevTools] Do not allow chrome.debugger to attach to web ui pages If the page navigates to web ui, we force detach the debugger extension. [email protected] Bug: 798222 Change-Id: Idb46c2f59e839388397a8dfa6ce2e2a897698df3 Reviewed-on: https://chromium-review.googlesource.com/935961 Commit-Queue: Dmitry Gozman <[email protected]> Reviewed-by: Devlin <[email protected]> Reviewed-by: Pavel Feldman <[email protected]> Reviewed-by: Nasko Oskov <[email protected]> Cr-Commit-Position: refs/heads/master@{#540916}
void DevToolsAgentHostImpl::DetachSession(DevToolsSession* session) {}
void DevToolsAgentHostImpl::DetachSession(DevToolsSession* session) {}
C
Chrome
0
CVE-2017-17052
https://www.cvedetails.com/cve/CVE-2017-17052/
CWE-416
https://github.com/torvalds/linux/commit/2b7e8665b4ff51c034c55df3cff76518d1a9ee3a
2b7e8665b4ff51c034c55df3cff76518d1a9ee3a
fork: fix incorrect fput of ->exe_file causing use-after-free Commit 7c051267931a ("mm, fork: make dup_mmap wait for mmap_sem for write killable") made it possible to kill a forking task while it is waiting to acquire its ->mmap_sem for write, in dup_mmap(). However, it was overlooked that this introduced an new error path before a reference is taken on the mm_struct's ->exe_file. Since the ->exe_file of the new mm_struct was already set to the old ->exe_file by the memcpy() in dup_mm(), it was possible for the mmput() in the error path of dup_mm() to drop a reference to ->exe_file which was never taken. This caused the struct file to later be freed prematurely. Fix it by updating mm_init() to NULL out the ->exe_file, in the same place it clears other things like the list of mmaps. This bug was found by syzkaller. It can be reproduced using the following C program: #define _GNU_SOURCE #include <pthread.h> #include <stdlib.h> #include <sys/mman.h> #include <sys/syscall.h> #include <sys/wait.h> #include <unistd.h> static void *mmap_thread(void *_arg) { for (;;) { mmap(NULL, 0x1000000, PROT_READ, MAP_POPULATE|MAP_ANONYMOUS|MAP_PRIVATE, -1, 0); } } static void *fork_thread(void *_arg) { usleep(rand() % 10000); fork(); } int main(void) { fork(); fork(); fork(); for (;;) { if (fork() == 0) { pthread_t t; pthread_create(&t, NULL, mmap_thread, NULL); pthread_create(&t, NULL, fork_thread, NULL); usleep(rand() % 10000); syscall(__NR_exit_group, 0); } wait(NULL); } } No special kernel config options are needed. It usually causes a NULL pointer dereference in __remove_shared_vm_struct() during exit, or in dup_mmap() (which is usually inlined into copy_process()) during fork. Both are due to a vm_area_struct's ->vm_file being used after it's already been freed. Google Bug Id: 64772007 Link: http://lkml.kernel.org/r/[email protected] Fixes: 7c051267931a ("mm, fork: make dup_mmap wait for mmap_sem for write killable") Signed-off-by: Eric Biggers <[email protected]> Tested-by: Mark Rutland <[email protected]> Acked-by: Michal Hocko <[email protected]> Cc: Dmitry Vyukov <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Konstantin Khlebnikov <[email protected]> Cc: Oleg Nesterov <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Vlastimil Babka <[email protected]> Cc: <[email protected]> [v4.7+] Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
void walk_process_tree(struct task_struct *top, proc_visitor visitor, void *data) { struct task_struct *leader, *parent, *child; int res; read_lock(&tasklist_lock); leader = top = top->group_leader; down: for_each_thread(leader, parent) { list_for_each_entry(child, &parent->children, sibling) { res = visitor(child, data); if (res) { if (res < 0) goto out; leader = child; goto down; } up: ; } } if (leader != top) { child = leader; parent = child->real_parent; leader = parent->group_leader; goto up; } out: read_unlock(&tasklist_lock); }
void walk_process_tree(struct task_struct *top, proc_visitor visitor, void *data) { struct task_struct *leader, *parent, *child; int res; read_lock(&tasklist_lock); leader = top = top->group_leader; down: for_each_thread(leader, parent) { list_for_each_entry(child, &parent->children, sibling) { res = visitor(child, data); if (res) { if (res < 0) goto out; leader = child; goto down; } up: ; } } if (leader != top) { child = leader; parent = child->real_parent; leader = parent->group_leader; goto up; } out: read_unlock(&tasklist_lock); }
C
linux
0
CVE-2015-7540
https://www.cvedetails.com/cve/CVE-2015-7540/
CWE-399
https://git.samba.org/?p=samba.git;a=commit;h=530d50a1abdcdf4d1775652d4c456c1274d83d8d
530d50a1abdcdf4d1775652d4c456c1274d83d8d
null
static bool decode_server_sort_request(void *mem_ctx, DATA_BLOB in, void *_out) { void **out = (void **)_out; DATA_BLOB attr; DATA_BLOB rule; struct asn1_data *data = asn1_init(mem_ctx); struct ldb_server_sort_control **lssc; int num; if (!data) return false; if (!asn1_load(data, in)) { return false; } if (!asn1_start_tag(data, ASN1_SEQUENCE(0))) { return false; } lssc = NULL; for (num = 0; asn1_peek_tag(data, ASN1_SEQUENCE(0)); num++) { lssc = talloc_realloc(mem_ctx, lssc, struct ldb_server_sort_control *, num + 2); if (!lssc) { return false; } lssc[num] = talloc_zero(lssc, struct ldb_server_sort_control); if (!lssc[num]) { return false; } if (!asn1_start_tag(data, ASN1_SEQUENCE(0))) { return false; } if (!asn1_read_OctetString(data, mem_ctx, &attr)) { return false; } lssc[num]->attributeName = talloc_strndup(lssc[num], (const char *)attr.data, attr.length); if (!lssc [num]->attributeName) { return false; } if (asn1_peek_tag(data, ASN1_OCTET_STRING)) { if (!asn1_read_OctetString(data, mem_ctx, &rule)) { return false; } lssc[num]->orderingRule = talloc_strndup(lssc[num], (const char *)rule.data, rule.length); if (!lssc[num]->orderingRule) { return false; } } if (asn1_peek_tag(data, ASN1_CONTEXT_SIMPLE(1))) { bool reverse; if (!asn1_read_BOOLEAN_context(data, &reverse, 1)) { return false; } lssc[num]->reverse = reverse; } if (!asn1_end_tag(data)) { return false; } } if (lssc != NULL) { lssc[num] = NULL; } if (!asn1_end_tag(data)) { return false; } *out = lssc; return true; }
static bool decode_server_sort_request(void *mem_ctx, DATA_BLOB in, void *_out) { void **out = (void **)_out; DATA_BLOB attr; DATA_BLOB rule; struct asn1_data *data = asn1_init(mem_ctx); struct ldb_server_sort_control **lssc; int num; if (!data) return false; if (!asn1_load(data, in)) { return false; } if (!asn1_start_tag(data, ASN1_SEQUENCE(0))) { return false; } lssc = NULL; for (num = 0; asn1_peek_tag(data, ASN1_SEQUENCE(0)); num++) { lssc = talloc_realloc(mem_ctx, lssc, struct ldb_server_sort_control *, num + 2); if (!lssc) { return false; } lssc[num] = talloc_zero(lssc, struct ldb_server_sort_control); if (!lssc[num]) { return false; } if (!asn1_start_tag(data, ASN1_SEQUENCE(0))) { return false; } if (!asn1_read_OctetString(data, mem_ctx, &attr)) { return false; } lssc[num]->attributeName = talloc_strndup(lssc[num], (const char *)attr.data, attr.length); if (!lssc [num]->attributeName) { return false; } if (asn1_peek_tag(data, ASN1_OCTET_STRING)) { if (!asn1_read_OctetString(data, mem_ctx, &rule)) { return false; } lssc[num]->orderingRule = talloc_strndup(lssc[num], (const char *)rule.data, rule.length); if (!lssc[num]->orderingRule) { return false; } } if (asn1_peek_tag(data, ASN1_CONTEXT_SIMPLE(1))) { bool reverse; if (!asn1_read_BOOLEAN_context(data, &reverse, 1)) { return false; } lssc[num]->reverse = reverse; } if (!asn1_end_tag(data)) { return false; } } if (lssc != NULL) { lssc[num] = NULL; } if (!asn1_end_tag(data)) { return false; } *out = lssc; return true; }
C
samba
0
CVE-2018-13006
https://www.cvedetails.com/cve/CVE-2018-13006/
CWE-125
https://github.com/gpac/gpac/commit/bceb03fd2be95097a7b409ea59914f332fb6bc86
bceb03fd2be95097a7b409ea59914f332fb6bc86
fixed 2 possible heap overflows (inc. #1088)
GF_Box *pasp_New() { ISOM_DECL_BOX_ALLOC(GF_PixelAspectRatioBox, GF_ISOM_BOX_TYPE_PASP); return (GF_Box *)tmp; }
GF_Box *pasp_New() { ISOM_DECL_BOX_ALLOC(GF_PixelAspectRatioBox, GF_ISOM_BOX_TYPE_PASP); return (GF_Box *)tmp; }
C
gpac
0
CVE-2011-3896
https://www.cvedetails.com/cve/CVE-2011-3896/
CWE-119
https://github.com/chromium/chromium/commit/5925dff83699508b5e2735afb0297dfb310e159d
5925dff83699508b5e2735afb0297dfb310e159d
Implement a bubble that appears at the top of the screen when a tab enters fullscreen mode via webkitRequestFullScreen(), telling the user how to exit fullscreen. This is implemented as an NSView rather than an NSWindow because the floating chrome that appears in presentation mode should overlap the bubble. Content-initiated fullscreen mode makes use of 'presentation mode' on the Mac: the mode in which the UI is hidden, accessible by moving the cursor to the top of the screen. On Snow Leopard, this mode is synonymous with fullscreen mode. On Lion, however, fullscreen mode does not imply presentation mode: in non-presentation fullscreen mode, the chrome is permanently shown. It is possible to switch between presentation mode and fullscreen mode using the presentation mode UI control. When a tab initiates fullscreen mode on Lion, we enter presentation mode if not in presentation mode already. When the user exits fullscreen mode using Chrome UI (i.e. keyboard shortcuts, menu items, buttons, switching tabs, etc.) we return the user to the mode they were in before the tab entered fullscreen. BUG=14471 TEST=Enter fullscreen mode using webkitRequestFullScreen. You should see a bubble pop down from the top of the screen. Need to test the Lion logic somehow, with no Lion trybots. BUG=96883 Original review http://codereview.chromium.org/7890056/ TBR=thakis Review URL: http://codereview.chromium.org/7920024 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@101624 0039d316-1c4b-4281-b951-d872f2087c98
void Browser::Observe(int type, const NotificationSource& source, const NotificationDetails& details) { switch (type) { case content::NOTIFICATION_TAB_CONTENTS_DISCONNECTED: if (is_attempting_to_close_browser_) { ClearUnloadState(Source<TabContents>(source).ptr(), false); } break; case content::NOTIFICATION_SSL_VISIBLE_STATE_CHANGED: if (GetSelectedTabContents() && &GetSelectedTabContents()->controller() == Source<NavigationController>(source).ptr()) UpdateToolbar(false); break; case chrome::NOTIFICATION_EXTENSION_UPDATE_DISABLED: { Profile* profile = Source<Profile>(source).ptr(); if (profile_->IsSameProfile(profile)) { ExtensionService* service = profile->GetExtensionService(); DCHECK(service); const Extension* extension = Details<const Extension>(details).ptr(); if (service->extension_prefs()->DidExtensionEscalatePermissions( extension->id())) ShowExtensionDisabledUI(service, profile_, extension); } break; } case chrome::NOTIFICATION_EXTENSION_UNLOADED: { if (window()->GetLocationBar()) window()->GetLocationBar()->UpdatePageActions(); const Extension* extension = Details<UnloadedExtensionInfo>(details)->extension; TabStripModel* model = tab_handler_->GetTabStripModel(); for (int i = model->count() - 1; i >= 0; --i) { TabContents* tc = model->GetTabContentsAt(i)->tab_contents(); if (tc->GetURL().SchemeIs(chrome::kExtensionScheme) && tc->GetURL().host() == extension->id()) { CloseTabContents(tc); } } break; } case chrome::NOTIFICATION_EXTENSION_PROCESS_TERMINATED: { Profile* profile = Source<Profile>(source).ptr(); if (profile_->IsSameProfile(profile) && window()->GetLocationBar()) window()->GetLocationBar()->InvalidatePageActions(); break; } case chrome::NOTIFICATION_EXTENSION_UNINSTALLED: case chrome::NOTIFICATION_EXTENSION_LOADED: if (window() && window()->GetLocationBar()) window()->GetLocationBar()->UpdatePageActions(); break; case chrome::NOTIFICATION_BROWSER_THEME_CHANGED: window()->UserChangedTheme(); break; case chrome::NOTIFICATION_EXTENSION_READY_FOR_INSTALL: { if (BrowserList::FindTabbedBrowser(profile(), true) != this) break; GURL download_url = *(Details<GURL>(details).ptr()); if (ExtensionService::IsDownloadFromMiniGallery(download_url)) window()->ShowThemeInstallBubble(); break; } case chrome::NOTIFICATION_PREF_CHANGED: { const std::string& pref_name = *Details<std::string>(details).ptr(); if (pref_name == prefs::kUseVerticalTabs) { UseVerticalTabsChanged(); } else if (pref_name == prefs::kUseCompactNavigationBar) { UseCompactNavigationBarChanged(); } else if (pref_name == prefs::kPrintingEnabled) { UpdatePrintingState(GetContentRestrictionsForSelectedTab()); } else if (pref_name == prefs::kInstantEnabled || pref_name == prefs::kMetricsReportingEnabled || pref_name == prefs::kSearchSuggestEnabled) { if (!InstantController::IsEnabled(profile())) { if (instant()) { instant()->DestroyPreviewContents(); instant_.reset(); instant_unload_handler_.reset(); } } else { CreateInstantIfNecessary(); } } else if (pref_name == prefs::kIncognitoModeAvailability) { IncognitoModePrefs::Availability available = IncognitoModePrefs::GetAvailability(profile_->GetPrefs()); command_updater_.UpdateCommandEnabled( IDC_NEW_WINDOW, available != IncognitoModePrefs::FORCED); command_updater_.UpdateCommandEnabled( IDC_NEW_INCOGNITO_WINDOW, available != IncognitoModePrefs::DISABLED); } else if (pref_name == prefs::kDevToolsDisabled) { UpdateCommandsForDevTools(); if (profile_->GetPrefs()->GetBoolean(prefs::kDevToolsDisabled)) g_browser_process->devtools_manager()->CloseAllClientHosts(); } else if (pref_name == prefs::kEditBookmarksEnabled) { UpdateCommandsForBookmarkEditing(); } else if (pref_name == prefs::kEnableBookmarkBar) { UpdateCommandsForBookmarkBar(); } else if (pref_name == prefs::kHomePage) { PrefService* pref_service = Source<PrefService>(source).ptr(); MarkHomePageAsChanged(pref_service); } else if (pref_name == prefs::kAllowFileSelectionDialogs) { UpdateSaveAsState(GetContentRestrictionsForSelectedTab()); UpdateOpenFileState(); } else { NOTREACHED(); } break; } case chrome::NOTIFICATION_TAB_CONTENT_SETTINGS_CHANGED: { TabContents* tab_contents = Source<TabContents>(source).ptr(); if (tab_contents == GetSelectedTabContents()) { LocationBar* location_bar = window()->GetLocationBar(); if (location_bar) location_bar->UpdateContentSettingsIcons(); } break; } case content::NOTIFICATION_INTERSTITIAL_ATTACHED: UpdateBookmarkBarState(BOOKMARK_BAR_STATE_CHANGE_TAB_STATE); break; case chrome::NOTIFICATION_BOOKMARK_BAR_VISIBILITY_PREF_CHANGED: if (profile_->IsSameProfile(Source<Profile>(source).ptr())) UpdateBookmarkBarState(BOOKMARK_BAR_STATE_CHANGE_PREF_CHANGE); break; default: NOTREACHED() << "Got a notification we didn't register for."; } }
void Browser::Observe(int type, const NotificationSource& source, const NotificationDetails& details) { switch (type) { case content::NOTIFICATION_TAB_CONTENTS_DISCONNECTED: if (is_attempting_to_close_browser_) { ClearUnloadState(Source<TabContents>(source).ptr(), false); } break; case content::NOTIFICATION_SSL_VISIBLE_STATE_CHANGED: if (GetSelectedTabContents() && &GetSelectedTabContents()->controller() == Source<NavigationController>(source).ptr()) UpdateToolbar(false); break; case chrome::NOTIFICATION_EXTENSION_UPDATE_DISABLED: { Profile* profile = Source<Profile>(source).ptr(); if (profile_->IsSameProfile(profile)) { ExtensionService* service = profile->GetExtensionService(); DCHECK(service); const Extension* extension = Details<const Extension>(details).ptr(); if (service->extension_prefs()->DidExtensionEscalatePermissions( extension->id())) ShowExtensionDisabledUI(service, profile_, extension); } break; } case chrome::NOTIFICATION_EXTENSION_UNLOADED: { if (window()->GetLocationBar()) window()->GetLocationBar()->UpdatePageActions(); const Extension* extension = Details<UnloadedExtensionInfo>(details)->extension; TabStripModel* model = tab_handler_->GetTabStripModel(); for (int i = model->count() - 1; i >= 0; --i) { TabContents* tc = model->GetTabContentsAt(i)->tab_contents(); if (tc->GetURL().SchemeIs(chrome::kExtensionScheme) && tc->GetURL().host() == extension->id()) { CloseTabContents(tc); } } break; } case chrome::NOTIFICATION_EXTENSION_PROCESS_TERMINATED: { Profile* profile = Source<Profile>(source).ptr(); if (profile_->IsSameProfile(profile) && window()->GetLocationBar()) window()->GetLocationBar()->InvalidatePageActions(); break; } case chrome::NOTIFICATION_EXTENSION_UNINSTALLED: case chrome::NOTIFICATION_EXTENSION_LOADED: if (window() && window()->GetLocationBar()) window()->GetLocationBar()->UpdatePageActions(); break; case chrome::NOTIFICATION_BROWSER_THEME_CHANGED: window()->UserChangedTheme(); break; case chrome::NOTIFICATION_EXTENSION_READY_FOR_INSTALL: { if (BrowserList::FindTabbedBrowser(profile(), true) != this) break; GURL download_url = *(Details<GURL>(details).ptr()); if (ExtensionService::IsDownloadFromMiniGallery(download_url)) window()->ShowThemeInstallBubble(); break; } case chrome::NOTIFICATION_PREF_CHANGED: { const std::string& pref_name = *Details<std::string>(details).ptr(); if (pref_name == prefs::kUseVerticalTabs) { UseVerticalTabsChanged(); } else if (pref_name == prefs::kUseCompactNavigationBar) { UseCompactNavigationBarChanged(); } else if (pref_name == prefs::kPrintingEnabled) { UpdatePrintingState(GetContentRestrictionsForSelectedTab()); } else if (pref_name == prefs::kInstantEnabled || pref_name == prefs::kMetricsReportingEnabled || pref_name == prefs::kSearchSuggestEnabled) { if (!InstantController::IsEnabled(profile())) { if (instant()) { instant()->DestroyPreviewContents(); instant_.reset(); instant_unload_handler_.reset(); } } else { CreateInstantIfNecessary(); } } else if (pref_name == prefs::kIncognitoModeAvailability) { IncognitoModePrefs::Availability available = IncognitoModePrefs::GetAvailability(profile_->GetPrefs()); command_updater_.UpdateCommandEnabled( IDC_NEW_WINDOW, available != IncognitoModePrefs::FORCED); command_updater_.UpdateCommandEnabled( IDC_NEW_INCOGNITO_WINDOW, available != IncognitoModePrefs::DISABLED); } else if (pref_name == prefs::kDevToolsDisabled) { UpdateCommandsForDevTools(); if (profile_->GetPrefs()->GetBoolean(prefs::kDevToolsDisabled)) g_browser_process->devtools_manager()->CloseAllClientHosts(); } else if (pref_name == prefs::kEditBookmarksEnabled) { UpdateCommandsForBookmarkEditing(); } else if (pref_name == prefs::kEnableBookmarkBar) { UpdateCommandsForBookmarkBar(); } else if (pref_name == prefs::kHomePage) { PrefService* pref_service = Source<PrefService>(source).ptr(); MarkHomePageAsChanged(pref_service); } else if (pref_name == prefs::kAllowFileSelectionDialogs) { UpdateSaveAsState(GetContentRestrictionsForSelectedTab()); UpdateOpenFileState(); } else { NOTREACHED(); } break; } case chrome::NOTIFICATION_TAB_CONTENT_SETTINGS_CHANGED: { TabContents* tab_contents = Source<TabContents>(source).ptr(); if (tab_contents == GetSelectedTabContents()) { LocationBar* location_bar = window()->GetLocationBar(); if (location_bar) location_bar->UpdateContentSettingsIcons(); } break; } case content::NOTIFICATION_INTERSTITIAL_ATTACHED: UpdateBookmarkBarState(BOOKMARK_BAR_STATE_CHANGE_TAB_STATE); break; case chrome::NOTIFICATION_BOOKMARK_BAR_VISIBILITY_PREF_CHANGED: if (profile_->IsSameProfile(Source<Profile>(source).ptr())) UpdateBookmarkBarState(BOOKMARK_BAR_STATE_CHANGE_PREF_CHANGE); break; default: NOTREACHED() << "Got a notification we didn't register for."; } }
C
Chrome
0
CVE-2017-11144
https://www.cvedetails.com/cve/CVE-2017-11144/
CWE-754
https://git.php.net/?p=php-src.git;a=commit;h=73cabfedf519298e1a11192699f44d53c529315e
73cabfedf519298e1a11192699f44d53c529315e
null
PHP_FUNCTION(openssl_spki_export) { size_t spkstr_len; char *spkstr = NULL, * spkstr_cleaned = NULL, * s = NULL; int spkstr_cleaned_len; EVP_PKEY *pkey = NULL; NETSCAPE_SPKI *spki = NULL; BIO *out = NULL; if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &spkstr, &spkstr_len) == FAILURE) { return; } RETVAL_FALSE; if (spkstr == NULL) { php_error_docref(NULL, E_WARNING, "Unable to use supplied SPKAC"); goto cleanup; } spkstr_cleaned = emalloc(spkstr_len + 1); spkstr_cleaned_len = (int)(spkstr_len - openssl_spki_cleanup(spkstr, spkstr_cleaned)); if (spkstr_cleaned_len == 0) { php_error_docref(NULL, E_WARNING, "Invalid SPKAC"); goto cleanup; } spki = NETSCAPE_SPKI_b64_decode(spkstr_cleaned, spkstr_cleaned_len); if (spki == NULL) { php_error_docref(NULL, E_WARNING, "Unable to decode supplied SPKAC"); goto cleanup; } pkey = X509_PUBKEY_get(spki->spkac->pubkey); if (pkey == NULL) { php_error_docref(NULL, E_WARNING, "Unable to acquire signed public key"); goto cleanup; } out = BIO_new(BIO_s_mem()); if (out && PEM_write_bio_PUBKEY(out, pkey)) { BUF_MEM *bio_buf; BIO_get_mem_ptr(out, &bio_buf); RETVAL_STRINGL((char *)bio_buf->data, bio_buf->length); } goto cleanup; cleanup: if (spki != NULL) { NETSCAPE_SPKI_free(spki); } if (out != NULL) { BIO_free_all(out); } if (pkey != NULL) { EVP_PKEY_free(pkey); } if (spkstr_cleaned != NULL) { efree(spkstr_cleaned); } if (s != NULL) { efree(s); } }
PHP_FUNCTION(openssl_spki_export) { size_t spkstr_len; char *spkstr = NULL, * spkstr_cleaned = NULL, * s = NULL; int spkstr_cleaned_len; EVP_PKEY *pkey = NULL; NETSCAPE_SPKI *spki = NULL; BIO *out = NULL; if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &spkstr, &spkstr_len) == FAILURE) { return; } RETVAL_FALSE; if (spkstr == NULL) { php_error_docref(NULL, E_WARNING, "Unable to use supplied SPKAC"); goto cleanup; } spkstr_cleaned = emalloc(spkstr_len + 1); spkstr_cleaned_len = (int)(spkstr_len - openssl_spki_cleanup(spkstr, spkstr_cleaned)); if (spkstr_cleaned_len == 0) { php_error_docref(NULL, E_WARNING, "Invalid SPKAC"); goto cleanup; } spki = NETSCAPE_SPKI_b64_decode(spkstr_cleaned, spkstr_cleaned_len); if (spki == NULL) { php_error_docref(NULL, E_WARNING, "Unable to decode supplied SPKAC"); goto cleanup; } pkey = X509_PUBKEY_get(spki->spkac->pubkey); if (pkey == NULL) { php_error_docref(NULL, E_WARNING, "Unable to acquire signed public key"); goto cleanup; } out = BIO_new(BIO_s_mem()); if (out && PEM_write_bio_PUBKEY(out, pkey)) { BUF_MEM *bio_buf; BIO_get_mem_ptr(out, &bio_buf); RETVAL_STRINGL((char *)bio_buf->data, bio_buf->length); } goto cleanup; cleanup: if (spki != NULL) { NETSCAPE_SPKI_free(spki); } if (out != NULL) { BIO_free_all(out); } if (pkey != NULL) { EVP_PKEY_free(pkey); } if (spkstr_cleaned != NULL) { efree(spkstr_cleaned); } if (s != NULL) { efree(s); } }
C
php
0
CVE-2013-0828
https://www.cvedetails.com/cve/CVE-2013-0828/
CWE-399
https://github.com/chromium/chromium/commit/4d17163f4b66be517dc49019a029e5ddbd45078c
4d17163f4b66be517dc49019a029e5ddbd45078c
Remove the Simple Default Stylesheet, it's just a foot-gun. We've been bitten by the Simple Default Stylesheet being out of sync with the real html.css twice this week. The Simple Default Stylesheet was invented years ago for Mac: http://trac.webkit.org/changeset/36135 It nicely handles the case where you just want to create a single WebView and parse some simple HTML either without styling said HTML, or only to display a small string, etc. Note that this optimization/complexity *only* helps for the very first document, since the default stylesheets are all static (process-global) variables. Since any real page on the internet uses a tag not covered by the simple default stylesheet, not real load benefits from this optimization. Only uses of WebView which were just rendering small bits of text might have benefited from this. about:blank would also have used this sheet. This was a common application for some uses of WebView back in those days. These days, even with WebView on Android, there are likely much larger overheads than parsing the html.css stylesheet, so making it required seems like the right tradeoff of code-simplicity for this case. BUG=319556 Review URL: https://codereview.chromium.org/73723005 git-svn-id: svn://svn.chromium.org/blink/trunk@162153 bbb929c8-8fbe-4397-9dbb-9b2b20218538
static const MediaQueryEvaluator& printEval() { DEFINE_STATIC_LOCAL(const MediaQueryEvaluator, staticPrintEval, ("print")); return staticPrintEval; }
static const MediaQueryEvaluator& printEval() { DEFINE_STATIC_LOCAL(const MediaQueryEvaluator, staticPrintEval, ("print")); return staticPrintEval; }
C
Chrome
0
CVE-2013-7441
https://www.cvedetails.com/cve/CVE-2013-7441/
CWE-399
https://github.com/yoe/nbd/commit/741495cb08503fd32a9d22648e63b64390c601f4
741495cb08503fd32a9d22648e63b64390c601f4
nbd-server: handle modern-style negotiation in a child process Previously, the modern style negotiation was carried out in the root server (listener) process before forking the actual client handler. This made it possible for a malfunctioning or evil client to terminate the root process simply by querying a non-existent export or aborting in the middle of the negotation process (caused SIGPIPE in the server). This commit moves the negotiation process to the child to keep the root process up and running no matter what happens during the negotiation. See http://sourceforge.net/mailarchive/message.php?msg_id=30410146 Signed-off-by: Tuomas Räsänen <[email protected]>
GArray* do_cfile_dir(gchar* dir, GError** e) { DIR* dirh = opendir(dir); struct dirent* de; gchar* fname; GArray* retval = NULL; GArray* tmp; struct stat stbuf; if(!dir) { g_set_error(e, NBDS_ERR, NBDS_ERR_CFILE_DIR_UNKNOWN, "Invalid directory specified: %s", strerror(errno)); return NULL; } errno=0; while((de = readdir(dirh))) { int saved_errno=errno; fname = g_build_filename(dir, de->d_name, NULL); switch(de->d_type) { case DT_UNKNOWN: /* Filesystem doesn't return type of * file through readdir. Run stat() on * the file instead */ if(stat(fname, &stbuf)) { perror("stat"); goto err_out; } if (!S_ISREG(stbuf.st_mode)) { goto next; } case DT_REG: /* Skip unless the name ends with '.conf' */ if(strcmp((de->d_name + strlen(de->d_name) - 5), ".conf")) { goto next; } tmp = parse_cfile(fname, NULL, e); errno=saved_errno; if(*e) { goto err_out; } if(!retval) retval = g_array_new(FALSE, TRUE, sizeof(SERVER)); retval = g_array_append_vals(retval, tmp->data, tmp->len); g_array_free(tmp, TRUE); default: break; } next: g_free(fname); } if(errno) { g_set_error(e, NBDS_ERR, NBDS_ERR_CFILE_READDIR_ERR, "Error trying to read directory: %s", strerror(errno)); err_out: if(retval) g_array_free(retval, TRUE); return NULL; } return retval; }
GArray* do_cfile_dir(gchar* dir, GError** e) { DIR* dirh = opendir(dir); struct dirent* de; gchar* fname; GArray* retval = NULL; GArray* tmp; struct stat stbuf; if(!dir) { g_set_error(e, NBDS_ERR, NBDS_ERR_CFILE_DIR_UNKNOWN, "Invalid directory specified: %s", strerror(errno)); return NULL; } errno=0; while((de = readdir(dirh))) { int saved_errno=errno; fname = g_build_filename(dir, de->d_name, NULL); switch(de->d_type) { case DT_UNKNOWN: /* Filesystem doesn't return type of * file through readdir. Run stat() on * the file instead */ if(stat(fname, &stbuf)) { perror("stat"); goto err_out; } if (!S_ISREG(stbuf.st_mode)) { goto next; } case DT_REG: /* Skip unless the name ends with '.conf' */ if(strcmp((de->d_name + strlen(de->d_name) - 5), ".conf")) { goto next; } tmp = parse_cfile(fname, NULL, e); errno=saved_errno; if(*e) { goto err_out; } if(!retval) retval = g_array_new(FALSE, TRUE, sizeof(SERVER)); retval = g_array_append_vals(retval, tmp->data, tmp->len); g_array_free(tmp, TRUE); default: break; } next: g_free(fname); } if(errno) { g_set_error(e, NBDS_ERR, NBDS_ERR_CFILE_READDIR_ERR, "Error trying to read directory: %s", strerror(errno)); err_out: if(retval) g_array_free(retval, TRUE); return NULL; } return retval; }
C
nbd
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 <[email protected]> Reviewed-by: Kentaro Hara <[email protected]> Reviewed-by: Geoff Lang <[email protected]> Reviewed-by: Kenneth Russell <[email protected]> Cr-Commit-Position: refs/heads/master@{#657568}
void PassthroughResources::Destroy(gl::GLApi* api) { bool have_context = !!api; DeleteServiceObjects(&texture_id_map, have_context, [this, api](GLuint client_id, GLuint texture) { if (!texture_object_map.HasClientID(client_id)) { api->glDeleteTexturesFn(1, &texture); } }); DeleteServiceObjects(&buffer_id_map, have_context, [api](GLuint client_id, GLuint buffer) { api->glDeleteBuffersARBFn(1, &buffer); }); DeleteServiceObjects(&renderbuffer_id_map, have_context, [api](GLuint client_id, GLuint renderbuffer) { api->glDeleteRenderbuffersEXTFn(1, &renderbuffer); }); DeleteServiceObjects(&sampler_id_map, have_context, [api](GLuint client_id, GLuint sampler) { api->glDeleteSamplersFn(1, &sampler); }); DeleteServiceObjects(&program_id_map, have_context, [api](GLuint client_id, GLuint program) { api->glDeleteProgramFn(program); }); DeleteServiceObjects(&shader_id_map, have_context, [api](GLuint client_id, GLuint shader) { api->glDeleteShaderFn(shader); }); DeleteServiceObjects(&sync_id_map, have_context, [api](GLuint client_id, uintptr_t sync) { api->glDeleteSyncFn(reinterpret_cast<GLsync>(sync)); }); if (!have_context) { texture_object_map.ForEach( [](GLuint client_id, scoped_refptr<TexturePassthrough> texture) { texture->MarkContextLost(); }); for (const auto& pair : texture_shared_image_map) { pair.second->OnContextLost(); } } texture_object_map.Clear(); texture_shared_image_map.clear(); DestroyPendingTextures(have_context); }
void PassthroughResources::Destroy(gl::GLApi* api) { bool have_context = !!api; DeleteServiceObjects(&texture_id_map, have_context, [this, api](GLuint client_id, GLuint texture) { if (!texture_object_map.HasClientID(client_id)) { api->glDeleteTexturesFn(1, &texture); } }); DeleteServiceObjects(&buffer_id_map, have_context, [api](GLuint client_id, GLuint buffer) { api->glDeleteBuffersARBFn(1, &buffer); }); DeleteServiceObjects(&renderbuffer_id_map, have_context, [api](GLuint client_id, GLuint renderbuffer) { api->glDeleteRenderbuffersEXTFn(1, &renderbuffer); }); DeleteServiceObjects(&sampler_id_map, have_context, [api](GLuint client_id, GLuint sampler) { api->glDeleteSamplersFn(1, &sampler); }); DeleteServiceObjects(&program_id_map, have_context, [api](GLuint client_id, GLuint program) { api->glDeleteProgramFn(program); }); DeleteServiceObjects(&shader_id_map, have_context, [api](GLuint client_id, GLuint shader) { api->glDeleteShaderFn(shader); }); DeleteServiceObjects(&sync_id_map, have_context, [api](GLuint client_id, uintptr_t sync) { api->glDeleteSyncFn(reinterpret_cast<GLsync>(sync)); }); if (!have_context) { texture_object_map.ForEach( [](GLuint client_id, scoped_refptr<TexturePassthrough> texture) { texture->MarkContextLost(); }); for (const auto& pair : texture_shared_image_map) { pair.second->OnContextLost(); } } texture_object_map.Clear(); texture_shared_image_map.clear(); DestroyPendingTextures(have_context); }
C
Chrome
0
CVE-2014-8709
https://www.cvedetails.com/cve/CVE-2014-8709/
CWE-200
https://github.com/torvalds/linux/commit/338f977f4eb441e69bb9a46eaa0ac715c931a67f
338f977f4eb441e69bb9a46eaa0ac715c931a67f
mac80211: fix fragmentation code, particularly for encryption The "new" fragmentation code (since my rewrite almost 5 years ago) erroneously sets skb->len rather than using skb_trim() to adjust the length of the first fragment after copying out all the others. This leaves the skb tail pointer pointing to after where the data originally ended, and thus causes the encryption MIC to be written at that point, rather than where it belongs: immediately after the data. The impact of this is that if software encryption is done, then a) encryption doesn't work for the first fragment, the connection becomes unusable as the first fragment will never be properly verified at the receiver, the MIC is practically guaranteed to be wrong b) we leak up to 8 bytes of plaintext (!) of the packet out into the air This is only mitigated by the fact that many devices are capable of doing encryption in hardware, in which case this can't happen as the tail pointer is irrelevant in that case. Additionally, fragmentation is not used very frequently and would normally have to be configured manually. Fix this by using skb_trim() properly. Cc: [email protected] Fixes: 2de8e0d999b8 ("mac80211: rewrite fragmentation") Reported-by: Jouni Malinen <[email protected]> Signed-off-by: Johannes Berg <[email protected]>
struct sk_buff *ieee80211_beacon_get_tim(struct ieee80211_hw *hw, struct ieee80211_vif *vif, u16 *tim_offset, u16 *tim_length) { struct ieee80211_local *local = hw_to_local(hw); struct sk_buff *skb = NULL; struct ieee80211_tx_info *info; struct ieee80211_sub_if_data *sdata = NULL; enum ieee80211_band band; struct ieee80211_tx_rate_control txrc; struct ieee80211_chanctx_conf *chanctx_conf; rcu_read_lock(); sdata = vif_to_sdata(vif); chanctx_conf = rcu_dereference(sdata->vif.chanctx_conf); if (!ieee80211_sdata_running(sdata) || !chanctx_conf) goto out; if (tim_offset) *tim_offset = 0; if (tim_length) *tim_length = 0; if (sdata->vif.type == NL80211_IFTYPE_AP) { struct ieee80211_if_ap *ap = &sdata->u.ap; struct beacon_data *beacon = rcu_dereference(ap->beacon); if (beacon) { if (sdata->vif.csa_active) ieee80211_update_csa(sdata, beacon); /* * headroom, head length, * tail length and maximum TIM length */ skb = dev_alloc_skb(local->tx_headroom + beacon->head_len + beacon->tail_len + 256 + local->hw.extra_beacon_tailroom); if (!skb) goto out; skb_reserve(skb, local->tx_headroom); memcpy(skb_put(skb, beacon->head_len), beacon->head, beacon->head_len); ieee80211_beacon_add_tim(sdata, &ap->ps, skb); if (tim_offset) *tim_offset = beacon->head_len; if (tim_length) *tim_length = skb->len - beacon->head_len; if (beacon->tail) memcpy(skb_put(skb, beacon->tail_len), beacon->tail, beacon->tail_len); } else goto out; } else if (sdata->vif.type == NL80211_IFTYPE_ADHOC) { struct ieee80211_if_ibss *ifibss = &sdata->u.ibss; struct ieee80211_hdr *hdr; struct beacon_data *presp = rcu_dereference(ifibss->presp); if (!presp) goto out; if (sdata->vif.csa_active) ieee80211_update_csa(sdata, presp); skb = dev_alloc_skb(local->tx_headroom + presp->head_len + local->hw.extra_beacon_tailroom); if (!skb) goto out; skb_reserve(skb, local->tx_headroom); memcpy(skb_put(skb, presp->head_len), presp->head, presp->head_len); hdr = (struct ieee80211_hdr *) skb->data; hdr->frame_control = cpu_to_le16(IEEE80211_FTYPE_MGMT | IEEE80211_STYPE_BEACON); } else if (ieee80211_vif_is_mesh(&sdata->vif)) { struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh; struct beacon_data *bcn = rcu_dereference(ifmsh->beacon); if (!bcn) goto out; if (sdata->vif.csa_active) ieee80211_update_csa(sdata, bcn); if (ifmsh->sync_ops) ifmsh->sync_ops->adjust_tbtt(sdata, bcn); skb = dev_alloc_skb(local->tx_headroom + bcn->head_len + 256 + /* TIM IE */ bcn->tail_len + local->hw.extra_beacon_tailroom); if (!skb) goto out; skb_reserve(skb, local->tx_headroom); memcpy(skb_put(skb, bcn->head_len), bcn->head, bcn->head_len); ieee80211_beacon_add_tim(sdata, &ifmsh->ps, skb); memcpy(skb_put(skb, bcn->tail_len), bcn->tail, bcn->tail_len); } else { WARN_ON(1); goto out; } band = chanctx_conf->def.chan->band; info = IEEE80211_SKB_CB(skb); info->flags |= IEEE80211_TX_INTFL_DONT_ENCRYPT; info->flags |= IEEE80211_TX_CTL_NO_ACK; info->band = band; memset(&txrc, 0, sizeof(txrc)); txrc.hw = hw; txrc.sband = local->hw.wiphy->bands[band]; txrc.bss_conf = &sdata->vif.bss_conf; txrc.skb = skb; txrc.reported_rate.idx = -1; txrc.rate_idx_mask = sdata->rc_rateidx_mask[band]; if (txrc.rate_idx_mask == (1 << txrc.sband->n_bitrates) - 1) txrc.max_rate_idx = -1; else txrc.max_rate_idx = fls(txrc.rate_idx_mask) - 1; txrc.bss = true; rate_control_get_rate(sdata, NULL, &txrc); info->control.vif = vif; info->flags |= IEEE80211_TX_CTL_CLEAR_PS_FILT | IEEE80211_TX_CTL_ASSIGN_SEQ | IEEE80211_TX_CTL_FIRST_FRAGMENT; out: rcu_read_unlock(); return skb; }
struct sk_buff *ieee80211_beacon_get_tim(struct ieee80211_hw *hw, struct ieee80211_vif *vif, u16 *tim_offset, u16 *tim_length) { struct ieee80211_local *local = hw_to_local(hw); struct sk_buff *skb = NULL; struct ieee80211_tx_info *info; struct ieee80211_sub_if_data *sdata = NULL; enum ieee80211_band band; struct ieee80211_tx_rate_control txrc; struct ieee80211_chanctx_conf *chanctx_conf; rcu_read_lock(); sdata = vif_to_sdata(vif); chanctx_conf = rcu_dereference(sdata->vif.chanctx_conf); if (!ieee80211_sdata_running(sdata) || !chanctx_conf) goto out; if (tim_offset) *tim_offset = 0; if (tim_length) *tim_length = 0; if (sdata->vif.type == NL80211_IFTYPE_AP) { struct ieee80211_if_ap *ap = &sdata->u.ap; struct beacon_data *beacon = rcu_dereference(ap->beacon); if (beacon) { if (sdata->vif.csa_active) ieee80211_update_csa(sdata, beacon); /* * headroom, head length, * tail length and maximum TIM length */ skb = dev_alloc_skb(local->tx_headroom + beacon->head_len + beacon->tail_len + 256 + local->hw.extra_beacon_tailroom); if (!skb) goto out; skb_reserve(skb, local->tx_headroom); memcpy(skb_put(skb, beacon->head_len), beacon->head, beacon->head_len); ieee80211_beacon_add_tim(sdata, &ap->ps, skb); if (tim_offset) *tim_offset = beacon->head_len; if (tim_length) *tim_length = skb->len - beacon->head_len; if (beacon->tail) memcpy(skb_put(skb, beacon->tail_len), beacon->tail, beacon->tail_len); } else goto out; } else if (sdata->vif.type == NL80211_IFTYPE_ADHOC) { struct ieee80211_if_ibss *ifibss = &sdata->u.ibss; struct ieee80211_hdr *hdr; struct beacon_data *presp = rcu_dereference(ifibss->presp); if (!presp) goto out; if (sdata->vif.csa_active) ieee80211_update_csa(sdata, presp); skb = dev_alloc_skb(local->tx_headroom + presp->head_len + local->hw.extra_beacon_tailroom); if (!skb) goto out; skb_reserve(skb, local->tx_headroom); memcpy(skb_put(skb, presp->head_len), presp->head, presp->head_len); hdr = (struct ieee80211_hdr *) skb->data; hdr->frame_control = cpu_to_le16(IEEE80211_FTYPE_MGMT | IEEE80211_STYPE_BEACON); } else if (ieee80211_vif_is_mesh(&sdata->vif)) { struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh; struct beacon_data *bcn = rcu_dereference(ifmsh->beacon); if (!bcn) goto out; if (sdata->vif.csa_active) ieee80211_update_csa(sdata, bcn); if (ifmsh->sync_ops) ifmsh->sync_ops->adjust_tbtt(sdata, bcn); skb = dev_alloc_skb(local->tx_headroom + bcn->head_len + 256 + /* TIM IE */ bcn->tail_len + local->hw.extra_beacon_tailroom); if (!skb) goto out; skb_reserve(skb, local->tx_headroom); memcpy(skb_put(skb, bcn->head_len), bcn->head, bcn->head_len); ieee80211_beacon_add_tim(sdata, &ifmsh->ps, skb); memcpy(skb_put(skb, bcn->tail_len), bcn->tail, bcn->tail_len); } else { WARN_ON(1); goto out; } band = chanctx_conf->def.chan->band; info = IEEE80211_SKB_CB(skb); info->flags |= IEEE80211_TX_INTFL_DONT_ENCRYPT; info->flags |= IEEE80211_TX_CTL_NO_ACK; info->band = band; memset(&txrc, 0, sizeof(txrc)); txrc.hw = hw; txrc.sband = local->hw.wiphy->bands[band]; txrc.bss_conf = &sdata->vif.bss_conf; txrc.skb = skb; txrc.reported_rate.idx = -1; txrc.rate_idx_mask = sdata->rc_rateidx_mask[band]; if (txrc.rate_idx_mask == (1 << txrc.sband->n_bitrates) - 1) txrc.max_rate_idx = -1; else txrc.max_rate_idx = fls(txrc.rate_idx_mask) - 1; txrc.bss = true; rate_control_get_rate(sdata, NULL, &txrc); info->control.vif = vif; info->flags |= IEEE80211_TX_CTL_CLEAR_PS_FILT | IEEE80211_TX_CTL_ASSIGN_SEQ | IEEE80211_TX_CTL_FIRST_FRAGMENT; out: rcu_read_unlock(); return skb; }
C
linux
0
CVE-2017-9949
https://www.cvedetails.com/cve/CVE-2017-9949/
CWE-787
https://github.com/radare/radare2/commit/796dd28aaa6b9fa76d99c42c4d5ff8b257cc2191
796dd28aaa6b9fa76d99c42c4d5ff8b257cc2191
Fix ext2 buffer overflow in r2_sbu_grub_memmove
find_file (const char *currpath, grub_fshelp_node_t currroot, grub_fshelp_node_t *currfound, struct grub_fshelp_find_file_closure *c) { #ifndef _MSC_VER char fpath[grub_strlen (currpath) + 1]; #else char *fpath = grub_malloc (grub_strlen (currpath) + 1); #endif char *name = fpath; char *next; enum grub_fshelp_filetype type = GRUB_FSHELP_DIR; grub_fshelp_node_t currnode = currroot; grub_fshelp_node_t oldnode = currroot; c->currroot = currroot; grub_strncpy (fpath, currpath, grub_strlen (currpath) + 1); /* Remove all leading slashes. */ while (*name == '/') name++; if (! *name) { *currfound = currnode; return 0; } for (;;) { int found; struct find_file_closure cc; /* Extract the actual part from the pathname. */ next = grub_strchr (name, '/'); if (next) { /* Remove all leading slashes. */ while (*next == '/') *(next++) = '\0'; } /* At this point it is expected that the current node is a directory, check if this is true. */ if (type != GRUB_FSHELP_DIR) { free_node (currnode, c); return grub_error (GRUB_ERR_BAD_FILE_TYPE, "not a directory"); } cc.name = name; cc.type = &type; cc.oldnode = &oldnode; cc.currnode = &currnode; /* Iterate over the directory. */ found = c->iterate_dir (currnode, iterate, &cc); if (! found) { if (grub_errno) return grub_errno; break; } /* Read in the symlink and follow it. */ if (type == GRUB_FSHELP_SYMLINK) { char *symlink; /* Test if the symlink does not loop. */ if (++(c->symlinknest) == 8) { free_node (currnode, c); free_node (oldnode, c); return grub_error (GRUB_ERR_SYMLINK_LOOP, "too deep nesting of symlinks"); } symlink = c->read_symlink (currnode); free_node (currnode, c); if (!symlink) { free_node (oldnode, c); return grub_errno; } /* The symlink is an absolute path, go back to the root inode. */ if (symlink[0] == '/') { free_node (oldnode, c); oldnode = c->rootnode; } /* Lookup the node the symlink points to. */ find_file (symlink, oldnode, &currnode, c); type = c->foundtype; grub_free (symlink); if (grub_errno) { free_node (oldnode, c); return grub_errno; } } free_node (oldnode, c); /* Found the node! */ if (! next || *next == '\0') { *currfound = currnode; c->foundtype = type; return 0; } name = next; } return grub_error (GRUB_ERR_FILE_NOT_FOUND, "file not found"); }
find_file (const char *currpath, grub_fshelp_node_t currroot, grub_fshelp_node_t *currfound, struct grub_fshelp_find_file_closure *c) { #ifndef _MSC_VER char fpath[grub_strlen (currpath) + 1]; #else char *fpath = grub_malloc (grub_strlen (currpath) + 1); #endif char *name = fpath; char *next; enum grub_fshelp_filetype type = GRUB_FSHELP_DIR; grub_fshelp_node_t currnode = currroot; grub_fshelp_node_t oldnode = currroot; c->currroot = currroot; grub_strncpy (fpath, currpath, grub_strlen (currpath) + 1); /* Remove all leading slashes. */ while (*name == '/') name++; if (! *name) { *currfound = currnode; return 0; } for (;;) { int found; struct find_file_closure cc; /* Extract the actual part from the pathname. */ next = grub_strchr (name, '/'); if (next) { /* Remove all leading slashes. */ while (*next == '/') *(next++) = '\0'; } /* At this point it is expected that the current node is a directory, check if this is true. */ if (type != GRUB_FSHELP_DIR) { free_node (currnode, c); return grub_error (GRUB_ERR_BAD_FILE_TYPE, "not a directory"); } cc.name = name; cc.type = &type; cc.oldnode = &oldnode; cc.currnode = &currnode; /* Iterate over the directory. */ found = c->iterate_dir (currnode, iterate, &cc); if (! found) { if (grub_errno) return grub_errno; break; } /* Read in the symlink and follow it. */ if (type == GRUB_FSHELP_SYMLINK) { char *symlink; /* Test if the symlink does not loop. */ if (++(c->symlinknest) == 8) { free_node (currnode, c); free_node (oldnode, c); return grub_error (GRUB_ERR_SYMLINK_LOOP, "too deep nesting of symlinks"); } symlink = c->read_symlink (currnode); free_node (currnode, c); if (!symlink) { free_node (oldnode, c); return grub_errno; } /* The symlink is an absolute path, go back to the root inode. */ if (symlink[0] == '/') { free_node (oldnode, c); oldnode = c->rootnode; } /* Lookup the node the symlink points to. */ find_file (symlink, oldnode, &currnode, c); type = c->foundtype; grub_free (symlink); if (grub_errno) { free_node (oldnode, c); return grub_errno; } } free_node (oldnode, c); /* Found the node! */ if (! next || *next == '\0') { *currfound = currnode; c->foundtype = type; return 0; } name = next; } return grub_error (GRUB_ERR_FILE_NOT_FOUND, "file not found"); }
C
radare2
0
CVE-2015-6783
https://www.cvedetails.com/cve/CVE-2015-6783/
CWE-20
https://github.com/chromium/chromium/commit/d9e316238aee59acf665d80b544cf4e1edfd3349
d9e316238aee59acf665d80b544cf4e1edfd3349
crazy linker: Alter search for zip EOCD start When loading directly from APK, begin searching backwards for the zip EOCD record signature at size of EOCD record bytes before the end of the file. BUG=537205 [email protected] Review URL: https://codereview.chromium.org/1390553002 . Cr-Commit-Position: refs/heads/master@{#352577}
inline uint32_t ReadUInt32(uint8_t* mem_bytes, int offset) { return static_cast<uint32_t>(mem_bytes[offset]) | (static_cast<uint32_t>(mem_bytes[offset + 1]) << 8) | (static_cast<uint32_t>(mem_bytes[offset + 2]) << 16) | (static_cast<uint32_t>(mem_bytes[offset + 3]) << 24); }
inline uint32_t ReadUInt32(uint8_t* mem_bytes, int offset) { return static_cast<uint32_t>(mem_bytes[offset]) | (static_cast<uint32_t>(mem_bytes[offset + 1]) << 8) | (static_cast<uint32_t>(mem_bytes[offset + 2]) << 16) | (static_cast<uint32_t>(mem_bytes[offset + 3]) << 24); }
C
Chrome
0
CVE-2015-6761
https://www.cvedetails.com/cve/CVE-2015-6761/
CWE-362
https://github.com/chromium/chromium/commit/fd506b0ac6c7846ae45b5034044fe85c28ee68ac
fd506b0ac6c7846ae45b5034044fe85c28ee68ac
Fix detach with open()ed document leaving parent loading indefinitely Change-Id: I26c2a054b9f1e5eb076acd677e1223058825f6d6 Bug: 803416 Test: fast/loader/document-open-iframe-then-detach.html Change-Id: I26c2a054b9f1e5eb076acd677e1223058825f6d6 Reviewed-on: https://chromium-review.googlesource.com/887298 Reviewed-by: Mike West <[email protected]> Commit-Queue: Nate Chapin <[email protected]> Cr-Commit-Position: refs/heads/master@{#532967}
ResourceRequest FrameLoader::ResourceRequestForReload( FrameLoadType frame_load_type, const KURL& override_url, ClientRedirectPolicy client_redirect_policy) { DCHECK(IsReloadLoadType(frame_load_type)); const auto cache_mode = frame_load_type == kFrameLoadTypeReloadBypassingCache ? mojom::FetchCacheMode::kBypassCache : mojom::FetchCacheMode::kValidateCache; if (!document_loader_ || !document_loader_->GetHistoryItem()) return ResourceRequest(); ResourceRequest request = document_loader_->GetHistoryItem()->GenerateResourceRequest(cache_mode); request.SetRequestorOrigin(SecurityOrigin::Create(request.Url())); if (client_redirect_policy == ClientRedirectPolicy::kClientRedirect) { request.SetHTTPReferrer(SecurityPolicy::GenerateReferrer( frame_->GetDocument()->GetReferrerPolicy(), frame_->GetDocument()->Url(), frame_->GetDocument()->OutgoingReferrer())); } if (!override_url.IsEmpty()) { request.SetURL(override_url); request.ClearHTTPReferrer(); } request.SetServiceWorkerMode(frame_load_type == kFrameLoadTypeReloadBypassingCache ? WebURLRequest::ServiceWorkerMode::kNone : WebURLRequest::ServiceWorkerMode::kAll); return request; }
ResourceRequest FrameLoader::ResourceRequestForReload( FrameLoadType frame_load_type, const KURL& override_url, ClientRedirectPolicy client_redirect_policy) { DCHECK(IsReloadLoadType(frame_load_type)); const auto cache_mode = frame_load_type == kFrameLoadTypeReloadBypassingCache ? mojom::FetchCacheMode::kBypassCache : mojom::FetchCacheMode::kValidateCache; if (!document_loader_ || !document_loader_->GetHistoryItem()) return ResourceRequest(); ResourceRequest request = document_loader_->GetHistoryItem()->GenerateResourceRequest(cache_mode); request.SetRequestorOrigin(SecurityOrigin::Create(request.Url())); if (client_redirect_policy == ClientRedirectPolicy::kClientRedirect) { request.SetHTTPReferrer(SecurityPolicy::GenerateReferrer( frame_->GetDocument()->GetReferrerPolicy(), frame_->GetDocument()->Url(), frame_->GetDocument()->OutgoingReferrer())); } if (!override_url.IsEmpty()) { request.SetURL(override_url); request.ClearHTTPReferrer(); } request.SetServiceWorkerMode(frame_load_type == kFrameLoadTypeReloadBypassingCache ? WebURLRequest::ServiceWorkerMode::kNone : WebURLRequest::ServiceWorkerMode::kAll); return request; }
C
Chrome
0
CVE-2019-11833
https://www.cvedetails.com/cve/CVE-2019-11833/
CWE-200
https://github.com/torvalds/linux/commit/592acbf16821288ecdc4192c47e3774a4c48bb64
592acbf16821288ecdc4192c47e3774a4c48bb64
ext4: zero out the unused memory region in the extent tree block This commit zeroes out the unused memory region in the buffer_head corresponding to the extent metablock after writing the extent header and the corresponding extent node entries. This is done to prevent random uninitialized data from getting into the filesystem when the extent block is synced. This fixes CVE-2019-11833. Signed-off-by: Sriram Rajagopalan <[email protected]> Signed-off-by: Theodore Ts'o <[email protected]> Cc: [email protected]
static int ext4_alloc_file_blocks(struct file *file, ext4_lblk_t offset, ext4_lblk_t len, loff_t new_size, int flags) { struct inode *inode = file_inode(file); handle_t *handle; int ret = 0; int ret2 = 0; int retries = 0; int depth = 0; struct ext4_map_blocks map; unsigned int credits; loff_t epos; BUG_ON(!ext4_test_inode_flag(inode, EXT4_INODE_EXTENTS)); map.m_lblk = offset; map.m_len = len; /* * Don't normalize the request if it can fit in one extent so * that it doesn't get unnecessarily split into multiple * extents. */ if (len <= EXT_UNWRITTEN_MAX_LEN) flags |= EXT4_GET_BLOCKS_NO_NORMALIZE; /* * credits to insert 1 extent into extent tree */ credits = ext4_chunk_trans_blocks(inode, len); depth = ext_depth(inode); retry: while (ret >= 0 && len) { /* * Recalculate credits when extent tree depth changes. */ if (depth != ext_depth(inode)) { credits = ext4_chunk_trans_blocks(inode, len); depth = ext_depth(inode); } handle = ext4_journal_start(inode, EXT4_HT_MAP_BLOCKS, credits); if (IS_ERR(handle)) { ret = PTR_ERR(handle); break; } ret = ext4_map_blocks(handle, inode, &map, flags); if (ret <= 0) { ext4_debug("inode #%lu: block %u: len %u: " "ext4_ext_map_blocks returned %d", inode->i_ino, map.m_lblk, map.m_len, ret); ext4_mark_inode_dirty(handle, inode); ret2 = ext4_journal_stop(handle); break; } map.m_lblk += ret; map.m_len = len = len - ret; epos = (loff_t)map.m_lblk << inode->i_blkbits; inode->i_ctime = current_time(inode); if (new_size) { if (epos > new_size) epos = new_size; if (ext4_update_inode_size(inode, epos) & 0x1) inode->i_mtime = inode->i_ctime; } else { if (epos > inode->i_size) ext4_set_inode_flag(inode, EXT4_INODE_EOFBLOCKS); } ext4_mark_inode_dirty(handle, inode); ext4_update_inode_fsync_trans(handle, inode, 1); ret2 = ext4_journal_stop(handle); if (ret2) break; } if (ret == -ENOSPC && ext4_should_retry_alloc(inode->i_sb, &retries)) { ret = 0; goto retry; } return ret > 0 ? ret2 : ret; }
static int ext4_alloc_file_blocks(struct file *file, ext4_lblk_t offset, ext4_lblk_t len, loff_t new_size, int flags) { struct inode *inode = file_inode(file); handle_t *handle; int ret = 0; int ret2 = 0; int retries = 0; int depth = 0; struct ext4_map_blocks map; unsigned int credits; loff_t epos; BUG_ON(!ext4_test_inode_flag(inode, EXT4_INODE_EXTENTS)); map.m_lblk = offset; map.m_len = len; /* * Don't normalize the request if it can fit in one extent so * that it doesn't get unnecessarily split into multiple * extents. */ if (len <= EXT_UNWRITTEN_MAX_LEN) flags |= EXT4_GET_BLOCKS_NO_NORMALIZE; /* * credits to insert 1 extent into extent tree */ credits = ext4_chunk_trans_blocks(inode, len); depth = ext_depth(inode); retry: while (ret >= 0 && len) { /* * Recalculate credits when extent tree depth changes. */ if (depth != ext_depth(inode)) { credits = ext4_chunk_trans_blocks(inode, len); depth = ext_depth(inode); } handle = ext4_journal_start(inode, EXT4_HT_MAP_BLOCKS, credits); if (IS_ERR(handle)) { ret = PTR_ERR(handle); break; } ret = ext4_map_blocks(handle, inode, &map, flags); if (ret <= 0) { ext4_debug("inode #%lu: block %u: len %u: " "ext4_ext_map_blocks returned %d", inode->i_ino, map.m_lblk, map.m_len, ret); ext4_mark_inode_dirty(handle, inode); ret2 = ext4_journal_stop(handle); break; } map.m_lblk += ret; map.m_len = len = len - ret; epos = (loff_t)map.m_lblk << inode->i_blkbits; inode->i_ctime = current_time(inode); if (new_size) { if (epos > new_size) epos = new_size; if (ext4_update_inode_size(inode, epos) & 0x1) inode->i_mtime = inode->i_ctime; } else { if (epos > inode->i_size) ext4_set_inode_flag(inode, EXT4_INODE_EOFBLOCKS); } ext4_mark_inode_dirty(handle, inode); ext4_update_inode_fsync_trans(handle, inode, 1); ret2 = ext4_journal_stop(handle); if (ret2) break; } if (ret == -ENOSPC && ext4_should_retry_alloc(inode->i_sb, &retries)) { ret = 0; goto retry; } return ret > 0 ? ret2 : ret; }
C
linux
0
CVE-2015-3412
https://www.cvedetails.com/cve/CVE-2015-3412/
CWE-254
https://git.php.net/?p=php-src.git;a=commit;h=4435b9142ff9813845d5c97ab29a5d637bedb257
4435b9142ff9813845d5c97ab29a5d637bedb257
null
PHP_FUNCTION(imagefontwidth) { php_imagefontsize(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0); }
PHP_FUNCTION(imagefontwidth) { php_imagefontsize(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0); }
C
php
0
CVE-2016-3839
https://www.cvedetails.com/cve/CVE-2016-3839/
CWE-284
https://android.googlesource.com/platform/system/bt/+/472271b153c5dc53c28beac55480a8d8434b2d5c
472271b153c5dc53c28beac55480a8d8434b2d5c
DO NOT MERGE Fix potential DoS caused by delivering signal to BT process Bug: 28885210 Change-Id: I63866d894bfca47464d6e42e3fb0357c4f94d360 Conflicts: btif/co/bta_hh_co.c btif/src/btif_core.c Merge conflict resolution of ag/1161415 (referencing ag/1164670) - Directly into mnc-mr2-release
static void bta_pan_callback(tBTA_PAN_EVT event, tBTA_PAN *p_data) { btif_transfer_context(bta_pan_callback_transfer, event, (char*)p_data, sizeof(tBTA_PAN), NULL); }
static void bta_pan_callback(tBTA_PAN_EVT event, tBTA_PAN *p_data) { btif_transfer_context(bta_pan_callback_transfer, event, (char*)p_data, sizeof(tBTA_PAN), NULL); }
C
Android
0
CVE-2018-13006
https://www.cvedetails.com/cve/CVE-2018-13006/
CWE-125
https://github.com/gpac/gpac/commit/bceb03fd2be95097a7b409ea59914f332fb6bc86
bceb03fd2be95097a7b409ea59914f332fb6bc86
fixed 2 possible heap overflows (inc. #1088)
GF_Err url_Size(GF_Box *s) { GF_DataEntryURLBox *ptr = (GF_DataEntryURLBox *)s; if ( !(ptr->flags & 1)) { if (ptr->location) ptr->size += 1 + strlen(ptr->location); } return GF_OK; }
GF_Err url_Size(GF_Box *s) { GF_DataEntryURLBox *ptr = (GF_DataEntryURLBox *)s; if ( !(ptr->flags & 1)) { if (ptr->location) ptr->size += 1 + strlen(ptr->location); } return GF_OK; }
C
gpac
0
CVE-2014-2739
https://www.cvedetails.com/cve/CVE-2014-2739/
CWE-20
https://github.com/torvalds/linux/commit/b2853fd6c2d0f383dbdf7427e263eb576a633867
b2853fd6c2d0f383dbdf7427e263eb576a633867
IB/core: Don't resolve passive side RoCE L2 address in CMA REQ handler The code that resolves the passive side source MAC within the rdma_cm connection request handler was both redundant and buggy, so remove it. It was redundant since later, when an RC QP is modified to RTR state, the resolution will take place in the ib_core module. It was buggy because this callback also deals with UD SIDR exchange, for which we incorrectly looked at the REQ member of the CM event and dereferenced a random value. Fixes: dd5f03beb4f7 ("IB/core: Ethernet L2 attributes in verbs/cm structures") Signed-off-by: Moni Shoua <[email protected]> Signed-off-by: Or Gerlitz <[email protected]> Signed-off-by: Roland Dreier <[email protected]>
static int cma_set_qkey(struct rdma_id_private *id_priv, u32 qkey) { struct ib_sa_mcmember_rec rec; int ret = 0; if (id_priv->qkey) { if (qkey && id_priv->qkey != qkey) return -EINVAL; return 0; } if (qkey) { id_priv->qkey = qkey; return 0; } switch (id_priv->id.ps) { case RDMA_PS_UDP: case RDMA_PS_IB: id_priv->qkey = RDMA_UDP_QKEY; break; case RDMA_PS_IPOIB: ib_addr_get_mgid(&id_priv->id.route.addr.dev_addr, &rec.mgid); ret = ib_sa_get_mcmember_rec(id_priv->id.device, id_priv->id.port_num, &rec.mgid, &rec); if (!ret) id_priv->qkey = be32_to_cpu(rec.qkey); break; default: break; } return ret; }
static int cma_set_qkey(struct rdma_id_private *id_priv, u32 qkey) { struct ib_sa_mcmember_rec rec; int ret = 0; if (id_priv->qkey) { if (qkey && id_priv->qkey != qkey) return -EINVAL; return 0; } if (qkey) { id_priv->qkey = qkey; return 0; } switch (id_priv->id.ps) { case RDMA_PS_UDP: case RDMA_PS_IB: id_priv->qkey = RDMA_UDP_QKEY; break; case RDMA_PS_IPOIB: ib_addr_get_mgid(&id_priv->id.route.addr.dev_addr, &rec.mgid); ret = ib_sa_get_mcmember_rec(id_priv->id.device, id_priv->id.port_num, &rec.mgid, &rec); if (!ret) id_priv->qkey = be32_to_cpu(rec.qkey); break; default: break; } return ret; }
C
linux
0
CVE-2012-5155
https://www.cvedetails.com/cve/CVE-2012-5155/
CWE-264
https://github.com/chromium/chromium/commit/0d7717faeaef5b72434632c95c78bee4883e2573
0d7717faeaef5b72434632c95c78bee4883e2573
Fix OS_MACOS typos. Should be OS_MACOSX. BUG=163208 TEST=none Review URL: https://codereview.chromium.org/12829005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@189130 0039d316-1c4b-4281-b951-d872f2087c98
void FocusFirstNameField() { LOG(WARNING) << "Clicking on the tab."; content::SimulateMouseClick( browser()->tab_strip_model()->GetActiveWebContents(), 0, WebKit::WebMouseEvent::ButtonLeft); LOG(WARNING) << "Focusing the first name field."; bool result = false; ASSERT_TRUE(content::ExecuteScriptAndExtractBool( render_view_host(), "if (document.readyState === 'complete')" " document.getElementById('firstname').focus();" "else" " domAutomationController.send(false);", &result)); ASSERT_TRUE(result); }
void FocusFirstNameField() { LOG(WARNING) << "Clicking on the tab."; content::SimulateMouseClick( browser()->tab_strip_model()->GetActiveWebContents(), 0, WebKit::WebMouseEvent::ButtonLeft); LOG(WARNING) << "Focusing the first name field."; bool result = false; ASSERT_TRUE(content::ExecuteScriptAndExtractBool( render_view_host(), "if (document.readyState === 'complete')" " document.getElementById('firstname').focus();" "else" " domAutomationController.send(false);", &result)); ASSERT_TRUE(result); }
C
Chrome
0
CVE-2016-8666
https://www.cvedetails.com/cve/CVE-2016-8666/
CWE-400
https://github.com/torvalds/linux/commit/fac8e0f579695a3ecbc4d3cac369139d7f819971
fac8e0f579695a3ecbc4d3cac369139d7f819971
tunnels: Don't apply GRO to multiple layers of encapsulation. When drivers express support for TSO of encapsulated packets, they only mean that they can do it for one layer of encapsulation. Supporting additional levels would mean updating, at a minimum, more IP length fields and they are unaware of this. No encapsulation device expresses support for handling offloaded encapsulated packets, so we won't generate these types of frames in the transmit path. However, GRO doesn't have a check for multiple levels of encapsulation and will attempt to build them. UDP tunnel GRO actually does prevent this situation but it only handles multiple UDP tunnels stacked on top of each other. This generalizes that solution to prevent any kind of tunnel stacking that would cause problems. Fixes: bf5a755f ("net-gre-gro: Add GRE support to the GRO stack") Signed-off-by: Jesse Gross <[email protected]> Signed-off-by: David S. Miller <[email protected]>
static void netif_reset_xps_queues_gt(struct net_device *dev, u16 index) { struct xps_dev_maps *dev_maps; int cpu, i; bool active = false; mutex_lock(&xps_map_mutex); dev_maps = xmap_dereference(dev->xps_maps); if (!dev_maps) goto out_no_maps; for_each_possible_cpu(cpu) { for (i = index; i < dev->num_tx_queues; i++) { if (!remove_xps_queue(dev_maps, cpu, i)) break; } if (i == dev->num_tx_queues) active = true; } if (!active) { RCU_INIT_POINTER(dev->xps_maps, NULL); kfree_rcu(dev_maps, rcu); } for (i = index; i < dev->num_tx_queues; i++) netdev_queue_numa_node_write(netdev_get_tx_queue(dev, i), NUMA_NO_NODE); out_no_maps: mutex_unlock(&xps_map_mutex); }
static void netif_reset_xps_queues_gt(struct net_device *dev, u16 index) { struct xps_dev_maps *dev_maps; int cpu, i; bool active = false; mutex_lock(&xps_map_mutex); dev_maps = xmap_dereference(dev->xps_maps); if (!dev_maps) goto out_no_maps; for_each_possible_cpu(cpu) { for (i = index; i < dev->num_tx_queues; i++) { if (!remove_xps_queue(dev_maps, cpu, i)) break; } if (i == dev->num_tx_queues) active = true; } if (!active) { RCU_INIT_POINTER(dev->xps_maps, NULL); kfree_rcu(dev_maps, rcu); } for (i = index; i < dev->num_tx_queues; i++) netdev_queue_numa_node_write(netdev_get_tx_queue(dev, i), NUMA_NO_NODE); out_no_maps: mutex_unlock(&xps_map_mutex); }
C
linux
0
CVE-2014-3980
https://www.cvedetails.com/cve/CVE-2014-3980/
CWE-264
https://github.com/ueno/libfep/commit/293d9d3f
293d9d3f
Don't use abstract Unix domain sockets
command_send_text (Fep *fep, FepControlMessage *request) { _fep_output_send_text (fep, request->args[0].str); }
command_send_text (Fep *fep, FepControlMessage *request) { _fep_output_send_text (fep, request->args[0].str); }
C
libfep
0
CVE-2016-2494
https://www.cvedetails.com/cve/CVE-2016-2494/
CWE-264
https://android.googlesource.com/platform/system/core/+/864e2e22fcd0cba3f5e67680ccabd0302dfda45d
864e2e22fcd0cba3f5e67680ccabd0302dfda45d
Fix overflow in path building An incorrect size was causing an unsigned value to wrap, causing it to write past the end of the buffer. Bug: 28085658 Change-Id: Ie9625c729cca024d514ba2880ff97209d435a165
static int fuse_reply_entry(struct fuse* fuse, __u64 unique, struct node* parent, const char* name, const char* actual_name, const char* path) { struct node* node; struct fuse_entry_out out; struct stat s; if (lstat(path, &s) < 0) { return -errno; } pthread_mutex_lock(&fuse->global->lock); node = acquire_or_create_child_locked(fuse, parent, name, actual_name); if (!node) { pthread_mutex_unlock(&fuse->global->lock); return -ENOMEM; } memset(&out, 0, sizeof(out)); attr_from_stat(fuse, &out.attr, &s, node); out.attr_valid = 10; out.entry_valid = 10; out.nodeid = node->nid; out.generation = node->gen; pthread_mutex_unlock(&fuse->global->lock); fuse_reply(fuse, unique, &out, sizeof(out)); return NO_STATUS; }
static int fuse_reply_entry(struct fuse* fuse, __u64 unique, struct node* parent, const char* name, const char* actual_name, const char* path) { struct node* node; struct fuse_entry_out out; struct stat s; if (lstat(path, &s) < 0) { return -errno; } pthread_mutex_lock(&fuse->global->lock); node = acquire_or_create_child_locked(fuse, parent, name, actual_name); if (!node) { pthread_mutex_unlock(&fuse->global->lock); return -ENOMEM; } memset(&out, 0, sizeof(out)); attr_from_stat(fuse, &out.attr, &s, node); out.attr_valid = 10; out.entry_valid = 10; out.nodeid = node->nid; out.generation = node->gen; pthread_mutex_unlock(&fuse->global->lock); fuse_reply(fuse, unique, &out, sizeof(out)); return NO_STATUS; }
C
Android
0
CVE-2011-2349
https://www.cvedetails.com/cve/CVE-2011-2349/
CWE-399
https://github.com/chromium/chromium/commit/e755d9faf5c7d75a8ea290892cb1b5cc07c412ec
e755d9faf5c7d75a8ea290892cb1b5cc07c412ec
cros: The next 100 clang plugin errors. BUG=none TEST=none TBR=dpolukhin Review URL: http://codereview.chromium.org/7022008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@85418 0039d316-1c4b-4281-b951-d872f2087c98
bool PluginSelectionPolicy::InitFromFile(const FilePath& policy_file) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); string data; if (!file_util::ReadFileToString(policy_file, &data)) { LOG(ERROR) << "Unable to read plugin policy file \"" << policy_file.value() << "\"."; init_from_file_finished_ = true; return false; } std::istringstream input_stream(data); string line; map<string, Policy> policies; Policy policy; string last_plugin; while (std::getline(input_stream, line)) { string::size_type pos = line.find("#"); if (pos != string::npos) { line = line.substr(0, pos); } TrimWhitespaceASCII(line, TRIM_ALL, &line); if (line.find("allow") == 0) { if (last_plugin.empty()) { LOG(ERROR) << "Plugin policy file error: 'allow' out of context."; init_from_file_finished_ = true; return false; } line = line.substr(5); TrimWhitespaceASCII(line, TRIM_ALL, &line); line = StringToLowerASCII(line); policy.push_back(make_pair(true, line)); } if (line.find("deny") == 0) { if (last_plugin.empty()) { LOG(ERROR) << "Plugin policy file error: 'deny' out of context."; init_from_file_finished_ = true; return false; } line = line.substr(4); TrimWhitespaceASCII(line, TRIM_ALL, &line); line = StringToLowerASCII(line); policy.push_back(make_pair(false, line)); } if (line.find("plugin") == 0) { line = line.substr(6); TrimWhitespaceASCII(line, TRIM_ALL, &line); if (!policy.empty() && !last_plugin.empty()) policies.insert(make_pair(last_plugin, policy)); last_plugin = line; policy.clear(); } } if (!last_plugin.empty()) policies.insert(make_pair(last_plugin, policy)); policies_.swap(policies); init_from_file_finished_ = true; return true; }
bool PluginSelectionPolicy::InitFromFile(const FilePath& policy_file) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); string data; if (!file_util::ReadFileToString(policy_file, &data)) { LOG(ERROR) << "Unable to read plugin policy file \"" << policy_file.value() << "\"."; init_from_file_finished_ = true; return false; } std::istringstream input_stream(data); string line; map<string, Policy> policies; Policy policy; string last_plugin; while (std::getline(input_stream, line)) { string::size_type pos = line.find("#"); if (pos != string::npos) { line = line.substr(0, pos); } TrimWhitespaceASCII(line, TRIM_ALL, &line); if (line.find("allow") == 0) { if (last_plugin.empty()) { LOG(ERROR) << "Plugin policy file error: 'allow' out of context."; init_from_file_finished_ = true; return false; } line = line.substr(5); TrimWhitespaceASCII(line, TRIM_ALL, &line); line = StringToLowerASCII(line); policy.push_back(make_pair(true, line)); } if (line.find("deny") == 0) { if (last_plugin.empty()) { LOG(ERROR) << "Plugin policy file error: 'deny' out of context."; init_from_file_finished_ = true; return false; } line = line.substr(4); TrimWhitespaceASCII(line, TRIM_ALL, &line); line = StringToLowerASCII(line); policy.push_back(make_pair(false, line)); } if (line.find("plugin") == 0) { line = line.substr(6); TrimWhitespaceASCII(line, TRIM_ALL, &line); if (!policy.empty() && !last_plugin.empty()) policies.insert(make_pair(last_plugin, policy)); last_plugin = line; policy.clear(); } } if (!last_plugin.empty()) policies.insert(make_pair(last_plugin, policy)); policies_.swap(policies); init_from_file_finished_ = true; return true; }
C
Chrome
0
CVE-2015-8325
https://www.cvedetails.com/cve/CVE-2015-8325/
CWE-264
https://anongit.mindrot.org/openssh.git/commit/?id=85bdcd7c92fe7ff133bbc4e10a65c91810f88755
85bdcd7c92fe7ff133bbc4e10a65c91810f88755
null
session_subsystem_req(Session *s) { struct stat st; u_int len; int success = 0; char *prog, *cmd; u_int i; s->subsys = packet_get_string(&len); packet_check_eom(); debug2("subsystem request for %.100s by user %s", s->subsys, s->pw->pw_name); for (i = 0; i < options.num_subsystems; i++) { if (strcmp(s->subsys, options.subsystem_name[i]) == 0) { prog = options.subsystem_command[i]; cmd = options.subsystem_args[i]; if (strcmp(INTERNAL_SFTP_NAME, prog) == 0) { s->is_subsystem = SUBSYSTEM_INT_SFTP; debug("subsystem: %s", prog); } else { if (stat(prog, &st) < 0) debug("subsystem: cannot stat %s: %s", prog, strerror(errno)); s->is_subsystem = SUBSYSTEM_EXT; debug("subsystem: exec() %s", cmd); } success = do_exec(s, cmd) == 0; break; } } if (!success) logit("subsystem request for %.100s by user %s failed, " "subsystem not found", s->subsys, s->pw->pw_name); return success; }
session_subsystem_req(Session *s) { struct stat st; u_int len; int success = 0; char *prog, *cmd; u_int i; s->subsys = packet_get_string(&len); packet_check_eom(); debug2("subsystem request for %.100s by user %s", s->subsys, s->pw->pw_name); for (i = 0; i < options.num_subsystems; i++) { if (strcmp(s->subsys, options.subsystem_name[i]) == 0) { prog = options.subsystem_command[i]; cmd = options.subsystem_args[i]; if (strcmp(INTERNAL_SFTP_NAME, prog) == 0) { s->is_subsystem = SUBSYSTEM_INT_SFTP; debug("subsystem: %s", prog); } else { if (stat(prog, &st) < 0) debug("subsystem: cannot stat %s: %s", prog, strerror(errno)); s->is_subsystem = SUBSYSTEM_EXT; debug("subsystem: exec() %s", cmd); } success = do_exec(s, cmd) == 0; break; } } if (!success) logit("subsystem request for %.100s by user %s failed, " "subsystem not found", s->subsys, s->pw->pw_name); return success; }
C
mindrot
0
CVE-2015-7613
https://www.cvedetails.com/cve/CVE-2015-7613/
CWE-362
https://github.com/torvalds/linux/commit/b9a532277938798b53178d5a66af6e2915cb27cf
b9a532277938798b53178d5a66af6e2915cb27cf
Initialize msg/shm IPC objects before doing ipc_addid() As reported by Dmitry Vyukov, we really shouldn't do ipc_addid() before having initialized the IPC object state. Yes, we initialize the IPC object in a locked state, but with all the lockless RCU lookup work, that IPC object lock no longer means that the state cannot be seen. We already did this for the IPC semaphore code (see commit e8577d1f0329: "ipc/sem.c: fully initialize sem_array before making it visible") but we clearly forgot about msg and shm. Reported-by: Dmitry Vyukov <[email protected]> Cc: Manfred Spraul <[email protected]> Cc: Davidlohr Bueso <[email protected]> Cc: [email protected] Signed-off-by: Linus Torvalds <[email protected]>
void *ipc_rcu_alloc(int size) { /* * We prepend the allocation with the rcu struct */ struct ipc_rcu *out = ipc_alloc(sizeof(struct ipc_rcu) + size); if (unlikely(!out)) return NULL; atomic_set(&out->refcount, 1); return out + 1; }
void *ipc_rcu_alloc(int size) { /* * We prepend the allocation with the rcu struct */ struct ipc_rcu *out = ipc_alloc(sizeof(struct ipc_rcu) + size); if (unlikely(!out)) return NULL; atomic_set(&out->refcount, 1); return out + 1; }
C
linux
0
CVE-2013-6622
https://www.cvedetails.com/cve/CVE-2013-6622/
CWE-399
https://github.com/chromium/chromium/commit/438b99bc730bc665eedfc62c4eb864c981e5c65f
438b99bc730bc665eedfc62c4eb864c981e5c65f
Remove --disable-app-shims. App shims have been enabled by default for 3 milestones (since r242711). BUG=350161 Review URL: https://codereview.chromium.org/298953002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@272786 0039d316-1c4b-4281-b951-d872f2087c98
base::string16 GetUrlWithLang(const GURL& url) { return base::ASCIIToUTF16(google_util::AppendGoogleLocaleParam(url).spec()); }
base::string16 GetUrlWithLang(const GURL& url) { return base::ASCIIToUTF16(google_util::AppendGoogleLocaleParam(url).spec()); }
C
Chrome
0
CVE-2017-11462
https://www.cvedetails.com/cve/CVE-2017-11462/
CWE-415
https://github.com/krb5/krb5/commit/56f7b1bc95a2a3eeb420e069e7655fb181ade5cf
56f7b1bc95a2a3eeb420e069e7655fb181ade5cf
Preserve GSS context on init/accept failure After gss_init_sec_context() or gss_accept_sec_context() has created a context, don't delete the mechglue context on failures from subsequent calls, even if the mechanism deletes the mech-specific context (which is allowed by RFC 2744 but not preferred). Check for union contexts with no mechanism context in each GSS function which accepts a gss_ctx_id_t. CVE-2017-11462: RFC 2744 permits a GSS-API implementation to delete an existing security context on a second or subsequent call to gss_init_sec_context() or gss_accept_sec_context() if the call results in an error. This API behavior has been found to be dangerous, leading to the possibility of memory errors in some callers. For safety, GSS-API implementations should instead preserve existing security contexts on error until the caller deletes them. All versions of MIT krb5 prior to this change may delete acceptor contexts on error. Versions 1.13.4 through 1.13.7, 1.14.1 through 1.14.5, and 1.15 through 1.15.1 may also delete initiator contexts on error. ticket: 8598 (new) target_version: 1.15-next target_version: 1.14-next tags: pullup
gss_unwrap_iov (minor_status, context_handle, conf_state, qop_state, iov, iov_count) OM_uint32 * minor_status; gss_ctx_id_t context_handle; int * conf_state; gss_qop_t *qop_state; gss_iov_buffer_desc * iov; int iov_count; { /* EXPORT DELETE START */ OM_uint32 status; gss_union_ctx_id_t ctx; gss_mechanism mech; status = val_unwrap_iov_args(minor_status, context_handle, conf_state, qop_state, iov, iov_count); if (status != GSS_S_COMPLETE) return (status); /* * select the approprate underlying mechanism routine and * call it. */ ctx = (gss_union_ctx_id_t) context_handle; if (ctx->internal_ctx_id == GSS_C_NO_CONTEXT) return (GSS_S_NO_CONTEXT); mech = gssint_get_mechanism (ctx->mech_type); if (mech) { if (mech->gss_unwrap_iov) { status = mech->gss_unwrap_iov( minor_status, ctx->internal_ctx_id, conf_state, qop_state, iov, iov_count); if (status != GSS_S_COMPLETE) map_error(minor_status, mech); } else status = GSS_S_UNAVAILABLE; return(status); } /* EXPORT DELETE END */ return (GSS_S_BAD_MECH); }
gss_unwrap_iov (minor_status, context_handle, conf_state, qop_state, iov, iov_count) OM_uint32 * minor_status; gss_ctx_id_t context_handle; int * conf_state; gss_qop_t *qop_state; gss_iov_buffer_desc * iov; int iov_count; { /* EXPORT DELETE START */ OM_uint32 status; gss_union_ctx_id_t ctx; gss_mechanism mech; status = val_unwrap_iov_args(minor_status, context_handle, conf_state, qop_state, iov, iov_count); if (status != GSS_S_COMPLETE) return (status); /* * select the approprate underlying mechanism routine and * call it. */ ctx = (gss_union_ctx_id_t) context_handle; mech = gssint_get_mechanism (ctx->mech_type); if (mech) { if (mech->gss_unwrap_iov) { status = mech->gss_unwrap_iov( minor_status, ctx->internal_ctx_id, conf_state, qop_state, iov, iov_count); if (status != GSS_S_COMPLETE) map_error(minor_status, mech); } else status = GSS_S_UNAVAILABLE; return(status); } /* EXPORT DELETE END */ return (GSS_S_BAD_MECH); }
C
krb5
1
CVE-2011-2918
https://www.cvedetails.com/cve/CVE-2011-2918/
CWE-399
https://github.com/torvalds/linux/commit/a8b0ca17b80e92faab46ee7179ba9e99ccb61233
a8b0ca17b80e92faab46ee7179ba9e99ccb61233
perf: Remove the nmi parameter from the swevent and overflow interface The nmi parameter indicated if we could do wakeups from the current context, if not, we would set some state and self-IPI and let the resulting interrupt do the wakeup. For the various event classes: - hardware: nmi=0; PMI is in fact an NMI or we run irq_work_run from the PMI-tail (ARM etc.) - tracepoint: nmi=0; since tracepoint could be from NMI context. - software: nmi=[0,1]; some, like the schedule thing cannot perform wakeups, and hence need 0. As one can see, there is very little nmi=1 usage, and the down-side of not using it is that on some platforms some software events can have a jiffy delay in wakeup (when arch_irq_work_raise isn't implemented). The up-side however is that we can remove the nmi parameter and save a bunch of conditionals in fast paths. Signed-off-by: Peter Zijlstra <[email protected]> Cc: Michael Cree <[email protected]> Cc: Will Deacon <[email protected]> Cc: Deng-Cheng Zhu <[email protected]> Cc: Anton Blanchard <[email protected]> Cc: Eric B Munson <[email protected]> Cc: Heiko Carstens <[email protected]> Cc: Paul Mundt <[email protected]> Cc: David S. Miller <[email protected]> Cc: Frederic Weisbecker <[email protected]> Cc: Jason Wessel <[email protected]> Cc: Don Zickus <[email protected]> Link: http://lkml.kernel.org/n/[email protected] Signed-off-by: Ingo Molnar <[email protected]>
void __cpuinit per_cpu_trap_init(void) { extern void *vbr_base; /* NOTE: The VBR value should be at P1 (or P2, virtural "fixed" address space). It's definitely should not in physical address. */ asm volatile("ldc %0, vbr" : /* no output */ : "r" (&vbr_base) : "memory"); /* disable exception blocking now when the vbr has been setup */ clear_bl_bit(); }
void __cpuinit per_cpu_trap_init(void) { extern void *vbr_base; /* NOTE: The VBR value should be at P1 (or P2, virtural "fixed" address space). It's definitely should not in physical address. */ asm volatile("ldc %0, vbr" : /* no output */ : "r" (&vbr_base) : "memory"); /* disable exception blocking now when the vbr has been setup */ clear_bl_bit(); }
C
linux
0
CVE-2015-6563
https://www.cvedetails.com/cve/CVE-2015-6563/
CWE-20
https://github.com/openssh/openssh-portable/commit/d4697fe9a28dab7255c60433e4dd23cf7fce8a8b
d4697fe9a28dab7255c60433e4dd23cf7fce8a8b
Don't resend username to PAM; it already has it. Pointed out by Moritz Jodeit; ok dtucker@
mm_ssh1_session_id(u_char session_id[16]) { Buffer m; int i; debug3("%s entering", __func__); buffer_init(&m); for (i = 0; i < 16; i++) buffer_put_char(&m, session_id[i]); mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_SESSID, &m); buffer_free(&m); }
mm_ssh1_session_id(u_char session_id[16]) { Buffer m; int i; debug3("%s entering", __func__); buffer_init(&m); for (i = 0; i < 16; i++) buffer_put_char(&m, session_id[i]); mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_SESSID, &m); buffer_free(&m); }
C
openssh-portable
0
CVE-2010-1166
https://www.cvedetails.com/cve/CVE-2010-1166/
CWE-189
https://cgit.freedesktop.org/xorg/xserver/commit/?id=d2f813f7db
d2f813f7db157fc83abc4b3726821c36ee7e40b1
null
fbFetch_x4a4 (const FbBits *bits, int x, int width, CARD32 *buffer, miIndexedPtr indexed) { const CARD8 *pixel = (const CARD8 *)bits + x; const CARD8 *end = pixel + width; while (pixel < end) { CARD8 p = READ(pixel++) & 0xf; WRITE(buffer++, (p | (p << 4)) << 24); } }
fbFetch_x4a4 (const FbBits *bits, int x, int width, CARD32 *buffer, miIndexedPtr indexed) { const CARD8 *pixel = (const CARD8 *)bits + x; const CARD8 *end = pixel + width; while (pixel < end) { CARD8 p = READ(pixel++) & 0xf; WRITE(buffer++, (p | (p << 4)) << 24); } }
C
xserver
0
CVE-2018-5344
https://www.cvedetails.com/cve/CVE-2018-5344/
CWE-416
https://github.com/torvalds/linux/commit/ae6650163c66a7eff1acd6eb8b0f752dcfa8eba5
ae6650163c66a7eff1acd6eb8b0f752dcfa8eba5
loop: fix concurrent lo_open/lo_release 范龙飞 reports that KASAN can report a use-after-free in __lock_acquire. The reason is due to insufficient serialization in lo_release(), which will continue to use the loop device even after it has decremented the lo_refcnt to zero. In the meantime, another process can come in, open the loop device again as it is being shut down. Confusion ensues. Reported-by: 范龙飞 <[email protected]> Signed-off-by: Linus Torvalds <[email protected]> Signed-off-by: Jens Axboe <[email protected]>
loop_info64_from_old(const struct loop_info *info, struct loop_info64 *info64) { memset(info64, 0, sizeof(*info64)); info64->lo_number = info->lo_number; info64->lo_device = info->lo_device; info64->lo_inode = info->lo_inode; info64->lo_rdevice = info->lo_rdevice; info64->lo_offset = info->lo_offset; info64->lo_sizelimit = 0; info64->lo_encrypt_type = info->lo_encrypt_type; info64->lo_encrypt_key_size = info->lo_encrypt_key_size; info64->lo_flags = info->lo_flags; info64->lo_init[0] = info->lo_init[0]; info64->lo_init[1] = info->lo_init[1]; if (info->lo_encrypt_type == LO_CRYPT_CRYPTOAPI) memcpy(info64->lo_crypt_name, info->lo_name, LO_NAME_SIZE); else memcpy(info64->lo_file_name, info->lo_name, LO_NAME_SIZE); memcpy(info64->lo_encrypt_key, info->lo_encrypt_key, LO_KEY_SIZE); }
loop_info64_from_old(const struct loop_info *info, struct loop_info64 *info64) { memset(info64, 0, sizeof(*info64)); info64->lo_number = info->lo_number; info64->lo_device = info->lo_device; info64->lo_inode = info->lo_inode; info64->lo_rdevice = info->lo_rdevice; info64->lo_offset = info->lo_offset; info64->lo_sizelimit = 0; info64->lo_encrypt_type = info->lo_encrypt_type; info64->lo_encrypt_key_size = info->lo_encrypt_key_size; info64->lo_flags = info->lo_flags; info64->lo_init[0] = info->lo_init[0]; info64->lo_init[1] = info->lo_init[1]; if (info->lo_encrypt_type == LO_CRYPT_CRYPTOAPI) memcpy(info64->lo_crypt_name, info->lo_name, LO_NAME_SIZE); else memcpy(info64->lo_file_name, info->lo_name, LO_NAME_SIZE); memcpy(info64->lo_encrypt_key, info->lo_encrypt_key, LO_KEY_SIZE); }
C
linux
0
CVE-2013-0886
https://www.cvedetails.com/cve/CVE-2013-0886/
null
https://github.com/chromium/chromium/commit/18d67244984a574ba2dd8779faabc0e3e34f4b76
18d67244984a574ba2dd8779faabc0e3e34f4b76
Implement TextureImageTransportSurface using texture mailbox This has a couple of advantages: - allow tearing down and recreating the UI parent context without losing the renderer contexts - do not require a context to be able to generate textures when creating the GLSurfaceHandle - clearer ownership semantics that potentially allows for more robust and easier lost context handling/thumbnailing/etc., since a texture is at any given time owned by either: UI parent, mailbox, or TextureImageTransportSurface - simplify frontbuffer protection logic; the frontbuffer textures are now owned by RWHV where they are refcounted The TextureImageTransportSurface informs RenderWidgetHostView of the mailbox names for the front- and backbuffer textures by associating them with a surface_handle (1 or 2) in the AcceleratedSurfaceNew message. During SwapBuffers() or PostSubBuffer() cycles, it then uses produceTextureCHROMIUM() and consumeTextureCHROMIUM() to transfer ownership between renderer and browser compositor. RWHV sends back the surface_handle of the buffer being returned with the Swap ACK (or 0 if no buffer is being returned in which case TextureImageTransportSurface will allocate a new texture - note that this could be used to simply keep textures for thumbnailing). BUG=154815,139616 [email protected] Review URL: https://chromiumcodereview.appspot.com/11194042 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@171569 0039d316-1c4b-4281-b951-d872f2087c98
void RenderWidgetHostImpl::AccessibilitySetTextSelection( int object_id, int start_offset, int end_offset) { Send(new AccessibilityMsg_SetTextSelection( GetRoutingID(), object_id, start_offset, end_offset)); }
void RenderWidgetHostImpl::AccessibilitySetTextSelection( int object_id, int start_offset, int end_offset) { Send(new AccessibilityMsg_SetTextSelection( GetRoutingID(), object_id, start_offset, end_offset)); }
C
Chrome
0
CVE-2018-10124
https://www.cvedetails.com/cve/CVE-2018-10124/
CWE-119
https://github.com/torvalds/linux/commit/4ea77014af0d6205b05503d1c7aac6eace11d473
4ea77014af0d6205b05503d1c7aac6eace11d473
kernel/signal.c: avoid undefined behaviour in kill_something_info When running kill(72057458746458112, 0) in userspace I hit the following issue. UBSAN: Undefined behaviour in kernel/signal.c:1462:11 negation of -2147483648 cannot be represented in type 'int': CPU: 226 PID: 9849 Comm: test Tainted: G B ---- ------- 3.10.0-327.53.58.70.x86_64_ubsan+ #116 Hardware name: Huawei Technologies Co., Ltd. RH8100 V3/BC61PBIA, BIOS BLHSV028 11/11/2014 Call Trace: dump_stack+0x19/0x1b ubsan_epilogue+0xd/0x50 __ubsan_handle_negate_overflow+0x109/0x14e SYSC_kill+0x43e/0x4d0 SyS_kill+0xe/0x10 system_call_fastpath+0x16/0x1b Add code to avoid the UBSAN detection. [[email protected]: tweak comment] Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: zhongjiang <[email protected]> Cc: Oleg Nesterov <[email protected]> Cc: Michal Hocko <[email protected]> Cc: Vlastimil Babka <[email protected]> Cc: Xishi Qiu <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
COMPAT_SYSCALL_DEFINE1(sigpending, compat_old_sigset_t __user *, set32) { sigset_t set; int err = do_sigpending(&set, sizeof(old_sigset_t)); if (err == 0) if (copy_to_user(set32, &set, sizeof(old_sigset_t))) err = -EFAULT; return err; }
COMPAT_SYSCALL_DEFINE1(sigpending, compat_old_sigset_t __user *, set32) { sigset_t set; int err = do_sigpending(&set, sizeof(old_sigset_t)); if (err == 0) if (copy_to_user(set32, &set, sizeof(old_sigset_t))) err = -EFAULT; return err; }
C
linux
0
CVE-2016-3698
https://www.cvedetails.com/cve/CVE-2016-3698/
CWE-284
https://github.com/jpirko/libndp/commit/2af9a55b38b55abbf05fd116ec097d4029115839
2af9a55b38b55abbf05fd116ec097d4029115839
libndb: reject redirect and router advertisements from non-link-local RFC4861 suggests that these messages should only originate from link-local addresses in 6.1.2 (RA) and 8.1. (redirect): Mitigates CVE-2016-3698. Signed-off-by: Lubomir Rintel <[email protected]> Signed-off-by: Jiri Pirko <[email protected]>
static int ndp_sock_recv(struct ndp *ndp) { struct ndp_msg *msg; enum ndp_msg_type msg_type; size_t len; int err; msg = ndp_msg_alloc(); if (!msg) return -ENOMEM; len = ndp_msg_payload_maxlen(msg); err = myrecvfrom6(ndp->sock, msg->buf, &len, 0, &msg->addrto, &msg->ifindex, &msg->hoplimit); if (err) { err(ndp, "Failed to receive message"); goto free_msg; } dbg(ndp, "rcvd from: %s, ifindex: %u, hoplimit: %d", str_in6_addr(&msg->addrto), msg->ifindex, msg->hoplimit); if (msg->hoplimit != 255) { warn(ndp, "ignoring packet with bad hop limit (%d)", msg->hoplimit); err = 0; goto free_msg; } if (len < sizeof(*msg->icmp6_hdr)) { warn(ndp, "rcvd icmp6 packet too short (%luB)", len); err = 0; goto free_msg; } err = ndp_msg_type_by_raw_type(&msg_type, msg->icmp6_hdr->icmp6_type); if (err) { err = 0; goto free_msg; } ndp_msg_init(msg, msg_type); ndp_msg_payload_len_set(msg, len); if (!ndp_msg_check_valid(msg)) { warn(ndp, "rcvd invalid ND message"); err = 0; goto free_msg; } dbg(ndp, "rcvd %s, len: %zuB", ndp_msg_type_info(msg_type)->strabbr, len); if (!ndp_msg_check_opts(msg)) { err = 0; goto free_msg; } err = ndp_call_handlers(ndp, msg);; free_msg: ndp_msg_destroy(msg); return err; }
static int ndp_sock_recv(struct ndp *ndp) { struct ndp_msg *msg; enum ndp_msg_type msg_type; size_t len; int err; msg = ndp_msg_alloc(); if (!msg) return -ENOMEM; len = ndp_msg_payload_maxlen(msg); err = myrecvfrom6(ndp->sock, msg->buf, &len, 0, &msg->addrto, &msg->ifindex, &msg->hoplimit); if (err) { err(ndp, "Failed to receive message"); goto free_msg; } dbg(ndp, "rcvd from: %s, ifindex: %u, hoplimit: %d", str_in6_addr(&msg->addrto), msg->ifindex, msg->hoplimit); if (msg->hoplimit != 255) { warn(ndp, "ignoring packet with bad hop limit (%d)", msg->hoplimit); err = 0; goto free_msg; } if (len < sizeof(*msg->icmp6_hdr)) { warn(ndp, "rcvd icmp6 packet too short (%luB)", len); err = 0; goto free_msg; } err = ndp_msg_type_by_raw_type(&msg_type, msg->icmp6_hdr->icmp6_type); if (err) { err = 0; goto free_msg; } ndp_msg_init(msg, msg_type); ndp_msg_payload_len_set(msg, len); if (!ndp_msg_check_valid(msg)) { warn(ndp, "rcvd invalid ND message"); err = 0; goto free_msg; } dbg(ndp, "rcvd %s, len: %zuB", ndp_msg_type_info(msg_type)->strabbr, len); if (!ndp_msg_check_opts(msg)) { err = 0; goto free_msg; } err = ndp_call_handlers(ndp, msg);; free_msg: ndp_msg_destroy(msg); return err; }
C
libndp
0
CVE-2014-2669
https://www.cvedetails.com/cve/CVE-2014-2669/
CWE-189
https://github.com/postgres/postgres/commit/31400a673325147e1205326008e32135a78b4d8a
31400a673325147e1205326008e32135a78b4d8a
Predict integer overflow to avoid buffer overruns. Several functions, mostly type input functions, calculated an allocation size such that the calculation wrapped to a small positive value when arguments implied a sufficiently-large requirement. Writes past the end of the inadvertent small allocation followed shortly thereafter. Coverity identified the path_in() vulnerability; code inspection led to the rest. In passing, add check_stack_depth() to prevent stack overflow in related functions. Back-patch to 8.4 (all supported versions). The non-comment hstore changes touch code that did not exist in 8.4, so that part stops at 9.0. Noah Misch and Heikki Linnakangas, reviewed by Tom Lane. Security: CVE-2014-0064
buf_finalize(StringInfo buf) { TxidSnapshot *snap = (TxidSnapshot *) buf->data; SET_VARSIZE(snap, buf->len); /* buf is not needed anymore */ buf->data = NULL; pfree(buf); return snap; }
buf_finalize(StringInfo buf) { TxidSnapshot *snap = (TxidSnapshot *) buf->data; SET_VARSIZE(snap, buf->len); /* buf is not needed anymore */ buf->data = NULL; pfree(buf); return snap; }
C
postgres
0
CVE-2011-2784
https://www.cvedetails.com/cve/CVE-2011-2784/
CWE-200
https://github.com/chromium/chromium/commit/225e7438996c9c939bd239376dfa93e562972cf8
225e7438996c9c939bd239376dfa93e562972cf8
Update PrerenderBrowserTests to work with new PrerenderContents. Also update PrerenderContents to pass plugin and HTML5 prerender tests. BUG=81229 TEST=PrerenderBrowserTests (Once the new code is enabled) Review URL: http://codereview.chromium.org/6905169 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@83841 0039d316-1c4b-4281-b951-d872f2087c98
TestPrerenderContents( PrerenderManager* prerender_manager, Profile* profile, const GURL& url, const GURL& referrer, int number_of_loads, FinalStatus expected_final_status) : PrerenderContents(prerender_manager, profile, url, referrer), number_of_loads_(0), expected_number_of_loads_(number_of_loads), expected_final_status_(expected_final_status) { }
TestPrerenderContents( PrerenderManager* prerender_manager, Profile* profile, const GURL& url, const GURL& referrer, int number_of_loads, FinalStatus expected_final_status) : PrerenderContents(prerender_manager, profile, url, referrer), number_of_loads_(0), expected_number_of_loads_(number_of_loads), expected_final_status_(expected_final_status) { }
C
Chrome
0
CVE-2018-13006
https://www.cvedetails.com/cve/CVE-2018-13006/
CWE-125
https://github.com/gpac/gpac/commit/bceb03fd2be95097a7b409ea59914f332fb6bc86
bceb03fd2be95097a7b409ea59914f332fb6bc86
fixed 2 possible heap overflows (inc. #1088)
void clap_del(GF_Box *s) { GF_CleanAppertureBox *ptr = (GF_CleanAppertureBox*)s; if (ptr == NULL) return; gf_free(ptr); }
void clap_del(GF_Box *s) { GF_CleanAppertureBox *ptr = (GF_CleanAppertureBox*)s; if (ptr == NULL) return; gf_free(ptr); }
C
gpac
0
CVE-2013-3301
https://www.cvedetails.com/cve/CVE-2013-3301/
null
https://github.com/torvalds/linux/commit/6a76f8c0ab19f215af2a3442870eeb5f0e81998d
6a76f8c0ab19f215af2a3442870eeb5f0e81998d
tracing: Fix possible NULL pointer dereferences Currently set_ftrace_pid and set_graph_function files use seq_lseek for their fops. However seq_open() is called only for FMODE_READ in the fops->open() so that if an user tries to seek one of those file when she open it for writing, it sees NULL seq_file and then panic. It can be easily reproduced with following command: $ cd /sys/kernel/debug/tracing $ echo 1234 | sudo tee -a set_ftrace_pid In this example, GNU coreutils' tee opens the file with fopen(, "a") and then the fopen() internally calls lseek(). Link: http://lkml.kernel.org/r/[email protected] Cc: Frederic Weisbecker <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Namhyung Kim <[email protected]> Cc: [email protected] Signed-off-by: Namhyung Kim <[email protected]> Signed-off-by: Steven Rostedt <[email protected]>
static int function_stat_show(struct seq_file *m, void *v) { struct ftrace_profile *rec = v; char str[KSYM_SYMBOL_LEN]; int ret = 0; #ifdef CONFIG_FUNCTION_GRAPH_TRACER static struct trace_seq s; unsigned long long avg; unsigned long long stddev; #endif mutex_lock(&ftrace_profile_lock); /* we raced with function_profile_reset() */ if (unlikely(rec->counter == 0)) { ret = -EBUSY; goto out; } kallsyms_lookup(rec->ip, NULL, NULL, NULL, str); seq_printf(m, " %-30.30s %10lu", str, rec->counter); #ifdef CONFIG_FUNCTION_GRAPH_TRACER seq_printf(m, " "); avg = rec->time; do_div(avg, rec->counter); /* Sample standard deviation (s^2) */ if (rec->counter <= 1) stddev = 0; else { stddev = rec->time_squared - rec->counter * avg * avg; /* * Divide only 1000 for ns^2 -> us^2 conversion. * trace_print_graph_duration will divide 1000 again. */ do_div(stddev, (rec->counter - 1) * 1000); } trace_seq_init(&s); trace_print_graph_duration(rec->time, &s); trace_seq_puts(&s, " "); trace_print_graph_duration(avg, &s); trace_seq_puts(&s, " "); trace_print_graph_duration(stddev, &s); trace_print_seq(m, &s); #endif seq_putc(m, '\n'); out: mutex_unlock(&ftrace_profile_lock); return ret; }
static int function_stat_show(struct seq_file *m, void *v) { struct ftrace_profile *rec = v; char str[KSYM_SYMBOL_LEN]; int ret = 0; #ifdef CONFIG_FUNCTION_GRAPH_TRACER static struct trace_seq s; unsigned long long avg; unsigned long long stddev; #endif mutex_lock(&ftrace_profile_lock); /* we raced with function_profile_reset() */ if (unlikely(rec->counter == 0)) { ret = -EBUSY; goto out; } kallsyms_lookup(rec->ip, NULL, NULL, NULL, str); seq_printf(m, " %-30.30s %10lu", str, rec->counter); #ifdef CONFIG_FUNCTION_GRAPH_TRACER seq_printf(m, " "); avg = rec->time; do_div(avg, rec->counter); /* Sample standard deviation (s^2) */ if (rec->counter <= 1) stddev = 0; else { stddev = rec->time_squared - rec->counter * avg * avg; /* * Divide only 1000 for ns^2 -> us^2 conversion. * trace_print_graph_duration will divide 1000 again. */ do_div(stddev, (rec->counter - 1) * 1000); } trace_seq_init(&s); trace_print_graph_duration(rec->time, &s); trace_seq_puts(&s, " "); trace_print_graph_duration(avg, &s); trace_seq_puts(&s, " "); trace_print_graph_duration(stddev, &s); trace_print_seq(m, &s); #endif seq_putc(m, '\n'); out: mutex_unlock(&ftrace_profile_lock); return ret; }
C
linux
0
CVE-2013-2548
https://www.cvedetails.com/cve/CVE-2013-2548/
CWE-310
https://github.com/torvalds/linux/commit/9a5467bf7b6e9e02ec9c3da4e23747c05faeaac6
9a5467bf7b6e9e02ec9c3da4e23747c05faeaac6
crypto: user - fix info leaks in report API Three errors resulting in kernel memory disclosure: 1/ The structures used for the netlink based crypto algorithm report API are located on the stack. As snprintf() does not fill the remainder of the buffer with null bytes, those stack bytes will be disclosed to users of the API. Switch to strncpy() to fix this. 2/ crypto_report_one() does not initialize all field of struct crypto_user_alg. Fix this to fix the heap info leak. 3/ For the module name we should copy only as many bytes as module_name() returns -- not as much as the destination buffer could hold. But the current code does not and therefore copies random data from behind the end of the module name, as the module name is always shorter than CRYPTO_MAX_ALG_NAME. Also switch to use strncpy() to copy the algorithm's name and driver_name. They are strings, after all. Signed-off-by: Mathias Krause <[email protected]> Cc: Steffen Klassert <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
static int setkey_unaligned(struct crypto_tfm *tfm, const u8 *key, unsigned int keylen) { struct blkcipher_alg *cipher = &tfm->__crt_alg->cra_blkcipher; unsigned long alignmask = crypto_tfm_alg_alignmask(tfm); int ret; u8 *buffer, *alignbuffer; unsigned long absize; absize = keylen + alignmask; buffer = kmalloc(absize, GFP_ATOMIC); if (!buffer) return -ENOMEM; alignbuffer = (u8 *)ALIGN((unsigned long)buffer, alignmask + 1); memcpy(alignbuffer, key, keylen); ret = cipher->setkey(tfm, alignbuffer, keylen); memset(alignbuffer, 0, keylen); kfree(buffer); return ret; }
static int setkey_unaligned(struct crypto_tfm *tfm, const u8 *key, unsigned int keylen) { struct blkcipher_alg *cipher = &tfm->__crt_alg->cra_blkcipher; unsigned long alignmask = crypto_tfm_alg_alignmask(tfm); int ret; u8 *buffer, *alignbuffer; unsigned long absize; absize = keylen + alignmask; buffer = kmalloc(absize, GFP_ATOMIC); if (!buffer) return -ENOMEM; alignbuffer = (u8 *)ALIGN((unsigned long)buffer, alignmask + 1); memcpy(alignbuffer, key, keylen); ret = cipher->setkey(tfm, alignbuffer, keylen); memset(alignbuffer, 0, keylen); kfree(buffer); return ret; }
C
linux
0
CVE-2016-5352
https://www.cvedetails.com/cve/CVE-2016-5352/
CWE-125
https://github.com/wireshark/wireshark/commit/b6d838eebf4456192360654092e5587c5207f185
b6d838eebf4456192360654092e5587c5207f185
Sanity check eapol_len in AirPDcapDecryptWPABroadcastKey Bug: 12175 Change-Id: Iaf977ba48f8668bf8095800a115ff9a3472dd893 Reviewed-on: https://code.wireshark.org/review/15326 Petri-Dish: Michael Mann <[email protected]> Tested-by: Petri Dish Buildbot <[email protected]> Reviewed-by: Alexis La Goutte <[email protected]> Reviewed-by: Peter Wu <[email protected]> Tested-by: Peter Wu <[email protected]>
INT AirPDcapInitContext( PAIRPDCAP_CONTEXT ctx) { AIRPDCAP_DEBUG_TRACE_START("AirPDcapInitContext"); if (ctx==NULL) { AIRPDCAP_DEBUG_PRINT_LINE("AirPDcapInitContext", "NULL context", AIRPDCAP_DEBUG_LEVEL_5); AIRPDCAP_DEBUG_TRACE_END("AirPDcapInitContext"); return AIRPDCAP_RET_UNSUCCESS; } AirPDcapCleanKeys(ctx); ctx->first_free_index=0; ctx->index=-1; ctx->sa_index=-1; ctx->pkt_ssid_len = 0; memset(ctx->sa, 0, AIRPDCAP_MAX_SEC_ASSOCIATIONS_NR * sizeof(AIRPDCAP_SEC_ASSOCIATION)); AIRPDCAP_DEBUG_PRINT_LINE("AirPDcapInitContext", "Context initialized!", AIRPDCAP_DEBUG_LEVEL_5); AIRPDCAP_DEBUG_TRACE_END("AirPDcapInitContext"); return AIRPDCAP_RET_SUCCESS; }
INT AirPDcapInitContext( PAIRPDCAP_CONTEXT ctx) { AIRPDCAP_DEBUG_TRACE_START("AirPDcapInitContext"); if (ctx==NULL) { AIRPDCAP_DEBUG_PRINT_LINE("AirPDcapInitContext", "NULL context", AIRPDCAP_DEBUG_LEVEL_5); AIRPDCAP_DEBUG_TRACE_END("AirPDcapInitContext"); return AIRPDCAP_RET_UNSUCCESS; } AirPDcapCleanKeys(ctx); ctx->first_free_index=0; ctx->index=-1; ctx->sa_index=-1; ctx->pkt_ssid_len = 0; memset(ctx->sa, 0, AIRPDCAP_MAX_SEC_ASSOCIATIONS_NR * sizeof(AIRPDCAP_SEC_ASSOCIATION)); AIRPDCAP_DEBUG_PRINT_LINE("AirPDcapInitContext", "Context initialized!", AIRPDCAP_DEBUG_LEVEL_5); AIRPDCAP_DEBUG_TRACE_END("AirPDcapInitContext"); return AIRPDCAP_RET_SUCCESS; }
C
wireshark
0
CVE-2015-3146
https://www.cvedetails.com/cve/CVE-2015-3146/
null
https://git.libssh.org/projects/libssh.git/commit/?h=libssh-0.6.5&id=94f6955fbaee6fda9385a23e505497efe21f5b4f
94f6955fbaee6fda9385a23e505497efe21f5b4f
null
SSH_PACKET_CALLBACK(ssh_packet_newkeys){ ssh_string sig_blob = NULL; int rc; (void)packet; (void)user; (void)type; SSH_LOG(SSH_LOG_PROTOCOL, "Received SSH_MSG_NEWKEYS"); if (session->session_state != SSH_SESSION_STATE_DH || session->dh_handshake_state != DH_STATE_NEWKEYS_SENT) { ssh_set_error(session, SSH_FATAL, "ssh_packet_newkeys called in wrong state : %d:%d", session->session_state,session->dh_handshake_state); goto error; } if(session->server){ /* server things are done in server.c */ session->dh_handshake_state=DH_STATE_FINISHED; if (rc != SSH_OK) { goto error; } /* * Set the cryptographic functions for the next crypto * (it is needed for generate_session_keys for key lengths) */ if (crypt_set_algorithms(session, SSH_3DES) /* knows nothing about DES*/ ) { goto error; } if (generate_session_keys(session) < 0) { goto error; } /* Verify the host's signature. FIXME do it sooner */ sig_blob = session->next_crypto->dh_server_signature; session->next_crypto->dh_server_signature = NULL; /* get the server public key */ rc = ssh_pki_import_pubkey_blob(session->next_crypto->server_pubkey, &key); if (rc < 0) { return SSH_ERROR; } /* check if public key from server matches user preferences */ if (session->opts.wanted_methods[SSH_HOSTKEYS]) { if(!ssh_match_group(session->opts.wanted_methods[SSH_HOSTKEYS], key->type_c)) { ssh_set_error(session, SSH_FATAL, "Public key from server (%s) doesn't match user " "preference (%s)", key->type_c, session->opts.wanted_methods[SSH_HOSTKEYS]); ssh_key_free(key); return -1; } } rc = ssh_pki_signature_verify_blob(session, sig_blob, key, session->next_crypto->secret_hash, session->next_crypto->digest_len); /* Set the server public key type for known host checking */ session->next_crypto->server_pubkey_type = key->type_c; ssh_key_free(key); ssh_string_burn(sig_blob); ssh_string_free(sig_blob); sig_blob = NULL; if (rc == SSH_ERROR) { goto error; } SSH_LOG(SSH_LOG_PROTOCOL,"Signature verified and valid"); /* * Once we got SSH2_MSG_NEWKEYS we can switch next_crypto and * current_crypto */ if (session->current_crypto) { crypto_free(session->current_crypto); session->current_crypto=NULL; } /* FIXME later, include a function to change keys */ session->current_crypto = session->next_crypto; session->next_crypto = crypto_new(); if (session->next_crypto == NULL) { ssh_set_error_oom(session); goto error; } session->next_crypto->session_id = malloc(session->current_crypto->digest_len); if (session->next_crypto->session_id == NULL) { ssh_set_error_oom(session); goto error; } memcpy(session->next_crypto->session_id, session->current_crypto->session_id, session->current_crypto->digest_len); } session->dh_handshake_state = DH_STATE_FINISHED; session->ssh_connection_callback(session); return SSH_PACKET_USED; error: session->session_state=SSH_SESSION_STATE_ERROR; return SSH_PACKET_USED; }
SSH_PACKET_CALLBACK(ssh_packet_newkeys){ ssh_string sig_blob = NULL; int rc; (void)packet; (void)user; (void)type; SSH_LOG(SSH_LOG_PROTOCOL, "Received SSH_MSG_NEWKEYS"); if(session->session_state!= SSH_SESSION_STATE_DH && session->dh_handshake_state != DH_STATE_NEWKEYS_SENT){ ssh_set_error(session,SSH_FATAL,"ssh_packet_newkeys called in wrong state : %d:%d", session->session_state,session->dh_handshake_state); goto error; } if(session->server){ /* server things are done in server.c */ session->dh_handshake_state=DH_STATE_FINISHED; if (rc != SSH_OK) { goto error; } /* * Set the cryptographic functions for the next crypto * (it is needed for generate_session_keys for key lengths) */ if (crypt_set_algorithms(session, SSH_3DES) /* knows nothing about DES*/ ) { goto error; } if (generate_session_keys(session) < 0) { goto error; } /* Verify the host's signature. FIXME do it sooner */ sig_blob = session->next_crypto->dh_server_signature; session->next_crypto->dh_server_signature = NULL; /* get the server public key */ rc = ssh_pki_import_pubkey_blob(session->next_crypto->server_pubkey, &key); if (rc < 0) { return SSH_ERROR; } /* check if public key from server matches user preferences */ if (session->opts.wanted_methods[SSH_HOSTKEYS]) { if(!ssh_match_group(session->opts.wanted_methods[SSH_HOSTKEYS], key->type_c)) { ssh_set_error(session, SSH_FATAL, "Public key from server (%s) doesn't match user " "preference (%s)", key->type_c, session->opts.wanted_methods[SSH_HOSTKEYS]); ssh_key_free(key); return -1; } } rc = ssh_pki_signature_verify_blob(session, sig_blob, key, session->next_crypto->secret_hash, session->next_crypto->digest_len); /* Set the server public key type for known host checking */ session->next_crypto->server_pubkey_type = key->type_c; ssh_key_free(key); ssh_string_burn(sig_blob); ssh_string_free(sig_blob); sig_blob = NULL; if (rc == SSH_ERROR) { goto error; } SSH_LOG(SSH_LOG_PROTOCOL,"Signature verified and valid"); /* * Once we got SSH2_MSG_NEWKEYS we can switch next_crypto and * current_crypto */ if (session->current_crypto) { crypto_free(session->current_crypto); session->current_crypto=NULL; } /* FIXME later, include a function to change keys */ session->current_crypto = session->next_crypto; session->next_crypto = crypto_new(); if (session->next_crypto == NULL) { ssh_set_error_oom(session); goto error; } session->next_crypto->session_id = malloc(session->current_crypto->digest_len); if (session->next_crypto->session_id == NULL) { ssh_set_error_oom(session); goto error; } memcpy(session->next_crypto->session_id, session->current_crypto->session_id, session->current_crypto->digest_len); } session->dh_handshake_state = DH_STATE_FINISHED; session->ssh_connection_callback(session); return SSH_PACKET_USED; error: session->session_state=SSH_SESSION_STATE_ERROR; return SSH_PACKET_USED; }
C
libssh
1
CVE-2012-3552
https://www.cvedetails.com/cve/CVE-2012-3552/
CWE-362
https://github.com/torvalds/linux/commit/f6d8bd051c391c1c0458a30b2a7abcd939329259
f6d8bd051c391c1c0458a30b2a7abcd939329259
inet: add RCU protection to inet->opt We lack proper synchronization to manipulate inet->opt ip_options Problem is ip_make_skb() calls ip_setup_cork() and ip_setup_cork() possibly makes a copy of ipc->opt (struct ip_options), without any protection against another thread manipulating inet->opt. Another thread can change inet->opt pointer and free old one under us. Use RCU to protect inet->opt (changed to inet->inet_opt). Instead of handling atomic refcounts, just copy ip_options when necessary, to avoid cache line dirtying. We cant insert an rcu_head in struct ip_options since its included in skb->cb[], so this patch is large because I had to introduce a new ip_options_rcu structure. Signed-off-by: Eric Dumazet <[email protected]> Cc: Herbert Xu <[email protected]> Signed-off-by: David S. Miller <[email protected]>
static int icmp_glue_bits(void *from, char *to, int offset, int len, int odd, struct sk_buff *skb) { struct icmp_bxm *icmp_param = (struct icmp_bxm *)from; __wsum csum; csum = skb_copy_and_csum_bits(icmp_param->skb, icmp_param->offset + offset, to, len, 0); skb->csum = csum_block_add(skb->csum, csum, odd); if (icmp_pointers[icmp_param->data.icmph.type].error) nf_ct_attach(skb, icmp_param->skb); return 0; }
static int icmp_glue_bits(void *from, char *to, int offset, int len, int odd, struct sk_buff *skb) { struct icmp_bxm *icmp_param = (struct icmp_bxm *)from; __wsum csum; csum = skb_copy_and_csum_bits(icmp_param->skb, icmp_param->offset + offset, to, len, 0); skb->csum = csum_block_add(skb->csum, csum, odd); if (icmp_pointers[icmp_param->data.icmph.type].error) nf_ct_attach(skb, icmp_param->skb); return 0; }
C
linux
0
CVE-2014-9665
https://www.cvedetails.com/cve/CVE-2014-9665/
CWE-119
https://git.savannah.gnu.org/cgit/freetype/freetype2.git/commit/?id=b3500af717010137046ec4076d1e1c0641e33727
b3500af717010137046ec4076d1e1c0641e33727
null
Line_To( RAS_ARGS Long x, Long y ) { /* First, detect a change of direction */ switch ( ras.state ) { case Unknown_State: if ( y > ras.lastY ) { if ( New_Profile( RAS_VARS Ascending_State, IS_BOTTOM_OVERSHOOT( ras.lastY ) ) ) return FAILURE; } else { if ( y < ras.lastY ) if ( New_Profile( RAS_VARS Descending_State, IS_TOP_OVERSHOOT( ras.lastY ) ) ) return FAILURE; } break; case Ascending_State: if ( y < ras.lastY ) { if ( End_Profile( RAS_VARS IS_TOP_OVERSHOOT( ras.lastY ) ) || New_Profile( RAS_VARS Descending_State, IS_TOP_OVERSHOOT( ras.lastY ) ) ) return FAILURE; } break; case Descending_State: if ( y > ras.lastY ) { if ( End_Profile( RAS_VARS IS_BOTTOM_OVERSHOOT( ras.lastY ) ) || New_Profile( RAS_VARS Ascending_State, IS_BOTTOM_OVERSHOOT( ras.lastY ) ) ) return FAILURE; } break; default: ; } /* Then compute the lines */ switch ( ras.state ) { case Ascending_State: if ( Line_Up( RAS_VARS ras.lastX, ras.lastY, x, y, ras.minY, ras.maxY ) ) return FAILURE; break; case Descending_State: if ( Line_Down( RAS_VARS ras.lastX, ras.lastY, x, y, ras.minY, ras.maxY ) ) return FAILURE; break; default: ; } ras.lastX = x; ras.lastY = y; return SUCCESS; }
Line_To( RAS_ARGS Long x, Long y ) { /* First, detect a change of direction */ switch ( ras.state ) { case Unknown_State: if ( y > ras.lastY ) { if ( New_Profile( RAS_VARS Ascending_State, IS_BOTTOM_OVERSHOOT( ras.lastY ) ) ) return FAILURE; } else { if ( y < ras.lastY ) if ( New_Profile( RAS_VARS Descending_State, IS_TOP_OVERSHOOT( ras.lastY ) ) ) return FAILURE; } break; case Ascending_State: if ( y < ras.lastY ) { if ( End_Profile( RAS_VARS IS_TOP_OVERSHOOT( ras.lastY ) ) || New_Profile( RAS_VARS Descending_State, IS_TOP_OVERSHOOT( ras.lastY ) ) ) return FAILURE; } break; case Descending_State: if ( y > ras.lastY ) { if ( End_Profile( RAS_VARS IS_BOTTOM_OVERSHOOT( ras.lastY ) ) || New_Profile( RAS_VARS Ascending_State, IS_BOTTOM_OVERSHOOT( ras.lastY ) ) ) return FAILURE; } break; default: ; } /* Then compute the lines */ switch ( ras.state ) { case Ascending_State: if ( Line_Up( RAS_VARS ras.lastX, ras.lastY, x, y, ras.minY, ras.maxY ) ) return FAILURE; break; case Descending_State: if ( Line_Down( RAS_VARS ras.lastX, ras.lastY, x, y, ras.minY, ras.maxY ) ) return FAILURE; break; default: ; } ras.lastX = x; ras.lastY = y; return SUCCESS; }
C
savannah
0
CVE-2016-7915
https://www.cvedetails.com/cve/CVE-2016-7915/
CWE-125
https://github.com/torvalds/linux/commit/50220dead1650609206efe91f0cc116132d59b3f
50220dead1650609206efe91f0cc116132d59b3f
HID: core: prevent out-of-bound readings Plugging a Logitech DJ receiver with KASAN activated raises a bunch of out-of-bound readings. The fields are allocated up to MAX_USAGE, meaning that potentially, we do not have enough fields to fit the incoming values. Add checks and silence KASAN. Signed-off-by: Benjamin Tissoires <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
static int hid_parser_global(struct hid_parser *parser, struct hid_item *item) { __s32 raw_value; switch (item->tag) { case HID_GLOBAL_ITEM_TAG_PUSH: if (parser->global_stack_ptr == HID_GLOBAL_STACK_SIZE) { hid_err(parser->device, "global environment stack overflow\n"); return -1; } memcpy(parser->global_stack + parser->global_stack_ptr++, &parser->global, sizeof(struct hid_global)); return 0; case HID_GLOBAL_ITEM_TAG_POP: if (!parser->global_stack_ptr) { hid_err(parser->device, "global environment stack underflow\n"); return -1; } memcpy(&parser->global, parser->global_stack + --parser->global_stack_ptr, sizeof(struct hid_global)); return 0; case HID_GLOBAL_ITEM_TAG_USAGE_PAGE: parser->global.usage_page = item_udata(item); return 0; case HID_GLOBAL_ITEM_TAG_LOGICAL_MINIMUM: parser->global.logical_minimum = item_sdata(item); return 0; case HID_GLOBAL_ITEM_TAG_LOGICAL_MAXIMUM: if (parser->global.logical_minimum < 0) parser->global.logical_maximum = item_sdata(item); else parser->global.logical_maximum = item_udata(item); return 0; case HID_GLOBAL_ITEM_TAG_PHYSICAL_MINIMUM: parser->global.physical_minimum = item_sdata(item); return 0; case HID_GLOBAL_ITEM_TAG_PHYSICAL_MAXIMUM: if (parser->global.physical_minimum < 0) parser->global.physical_maximum = item_sdata(item); else parser->global.physical_maximum = item_udata(item); return 0; case HID_GLOBAL_ITEM_TAG_UNIT_EXPONENT: /* Many devices provide unit exponent as a two's complement * nibble due to the common misunderstanding of HID * specification 1.11, 6.2.2.7 Global Items. Attempt to handle * both this and the standard encoding. */ raw_value = item_sdata(item); if (!(raw_value & 0xfffffff0)) parser->global.unit_exponent = hid_snto32(raw_value, 4); else parser->global.unit_exponent = raw_value; return 0; case HID_GLOBAL_ITEM_TAG_UNIT: parser->global.unit = item_udata(item); return 0; case HID_GLOBAL_ITEM_TAG_REPORT_SIZE: parser->global.report_size = item_udata(item); if (parser->global.report_size > 128) { hid_err(parser->device, "invalid report_size %d\n", parser->global.report_size); return -1; } return 0; case HID_GLOBAL_ITEM_TAG_REPORT_COUNT: parser->global.report_count = item_udata(item); if (parser->global.report_count > HID_MAX_USAGES) { hid_err(parser->device, "invalid report_count %d\n", parser->global.report_count); return -1; } return 0; case HID_GLOBAL_ITEM_TAG_REPORT_ID: parser->global.report_id = item_udata(item); if (parser->global.report_id == 0 || parser->global.report_id >= HID_MAX_IDS) { hid_err(parser->device, "report_id %u is invalid\n", parser->global.report_id); return -1; } return 0; default: hid_err(parser->device, "unknown global tag 0x%x\n", item->tag); return -1; } }
static int hid_parser_global(struct hid_parser *parser, struct hid_item *item) { __s32 raw_value; switch (item->tag) { case HID_GLOBAL_ITEM_TAG_PUSH: if (parser->global_stack_ptr == HID_GLOBAL_STACK_SIZE) { hid_err(parser->device, "global environment stack overflow\n"); return -1; } memcpy(parser->global_stack + parser->global_stack_ptr++, &parser->global, sizeof(struct hid_global)); return 0; case HID_GLOBAL_ITEM_TAG_POP: if (!parser->global_stack_ptr) { hid_err(parser->device, "global environment stack underflow\n"); return -1; } memcpy(&parser->global, parser->global_stack + --parser->global_stack_ptr, sizeof(struct hid_global)); return 0; case HID_GLOBAL_ITEM_TAG_USAGE_PAGE: parser->global.usage_page = item_udata(item); return 0; case HID_GLOBAL_ITEM_TAG_LOGICAL_MINIMUM: parser->global.logical_minimum = item_sdata(item); return 0; case HID_GLOBAL_ITEM_TAG_LOGICAL_MAXIMUM: if (parser->global.logical_minimum < 0) parser->global.logical_maximum = item_sdata(item); else parser->global.logical_maximum = item_udata(item); return 0; case HID_GLOBAL_ITEM_TAG_PHYSICAL_MINIMUM: parser->global.physical_minimum = item_sdata(item); return 0; case HID_GLOBAL_ITEM_TAG_PHYSICAL_MAXIMUM: if (parser->global.physical_minimum < 0) parser->global.physical_maximum = item_sdata(item); else parser->global.physical_maximum = item_udata(item); return 0; case HID_GLOBAL_ITEM_TAG_UNIT_EXPONENT: /* Many devices provide unit exponent as a two's complement * nibble due to the common misunderstanding of HID * specification 1.11, 6.2.2.7 Global Items. Attempt to handle * both this and the standard encoding. */ raw_value = item_sdata(item); if (!(raw_value & 0xfffffff0)) parser->global.unit_exponent = hid_snto32(raw_value, 4); else parser->global.unit_exponent = raw_value; return 0; case HID_GLOBAL_ITEM_TAG_UNIT: parser->global.unit = item_udata(item); return 0; case HID_GLOBAL_ITEM_TAG_REPORT_SIZE: parser->global.report_size = item_udata(item); if (parser->global.report_size > 128) { hid_err(parser->device, "invalid report_size %d\n", parser->global.report_size); return -1; } return 0; case HID_GLOBAL_ITEM_TAG_REPORT_COUNT: parser->global.report_count = item_udata(item); if (parser->global.report_count > HID_MAX_USAGES) { hid_err(parser->device, "invalid report_count %d\n", parser->global.report_count); return -1; } return 0; case HID_GLOBAL_ITEM_TAG_REPORT_ID: parser->global.report_id = item_udata(item); if (parser->global.report_id == 0 || parser->global.report_id >= HID_MAX_IDS) { hid_err(parser->device, "report_id %u is invalid\n", parser->global.report_id); return -1; } return 0; default: hid_err(parser->device, "unknown global tag 0x%x\n", item->tag); return -1; } }
C
linux
0
CVE-2011-4914
https://www.cvedetails.com/cve/CVE-2011-4914/
CWE-20
https://github.com/torvalds/linux/commit/e0bccd315db0c2f919e7fcf9cb60db21d9986f52
e0bccd315db0c2f919e7fcf9cb60db21d9986f52
rose: Add length checks to CALL_REQUEST parsing Define some constant offsets for CALL_REQUEST based on the description at <http://www.techfest.com/networking/wan/x25plp.htm> and the definition of ROSE as using 10-digit (5-byte) addresses. Use them consistently. Validate all implicit and explicit facilities lengths. Validate the address length byte rather than either trusting or assuming its value. Signed-off-by: Ben Hutchings <[email protected]> Signed-off-by: David S. Miller <[email protected]>
static int rose_del_node(struct rose_route_struct *rose_route, struct net_device *dev) { struct rose_node *rose_node; struct rose_neigh *rose_neigh; int i, err = 0; spin_lock_bh(&rose_node_list_lock); spin_lock_bh(&rose_neigh_list_lock); rose_node = rose_node_list; while (rose_node != NULL) { if ((rose_node->mask == rose_route->mask) && (rosecmpm(&rose_route->address, &rose_node->address, rose_route->mask) == 0)) break; rose_node = rose_node->next; } if (rose_node == NULL || rose_node->loopback) { err = -EINVAL; goto out; } rose_neigh = rose_neigh_list; while (rose_neigh != NULL) { if (ax25cmp(&rose_route->neighbour, &rose_neigh->callsign) == 0 && rose_neigh->dev == dev) break; rose_neigh = rose_neigh->next; } if (rose_neigh == NULL) { err = -EINVAL; goto out; } for (i = 0; i < rose_node->count; i++) { if (rose_node->neighbour[i] == rose_neigh) { rose_neigh->count--; if (rose_neigh->count == 0 && rose_neigh->use == 0) rose_remove_neigh(rose_neigh); rose_node->count--; if (rose_node->count == 0) { rose_remove_node(rose_node); } else { switch (i) { case 0: rose_node->neighbour[0] = rose_node->neighbour[1]; case 1: rose_node->neighbour[1] = rose_node->neighbour[2]; case 2: break; } } goto out; } } err = -EINVAL; out: spin_unlock_bh(&rose_neigh_list_lock); spin_unlock_bh(&rose_node_list_lock); return err; }
static int rose_del_node(struct rose_route_struct *rose_route, struct net_device *dev) { struct rose_node *rose_node; struct rose_neigh *rose_neigh; int i, err = 0; spin_lock_bh(&rose_node_list_lock); spin_lock_bh(&rose_neigh_list_lock); rose_node = rose_node_list; while (rose_node != NULL) { if ((rose_node->mask == rose_route->mask) && (rosecmpm(&rose_route->address, &rose_node->address, rose_route->mask) == 0)) break; rose_node = rose_node->next; } if (rose_node == NULL || rose_node->loopback) { err = -EINVAL; goto out; } rose_neigh = rose_neigh_list; while (rose_neigh != NULL) { if (ax25cmp(&rose_route->neighbour, &rose_neigh->callsign) == 0 && rose_neigh->dev == dev) break; rose_neigh = rose_neigh->next; } if (rose_neigh == NULL) { err = -EINVAL; goto out; } for (i = 0; i < rose_node->count; i++) { if (rose_node->neighbour[i] == rose_neigh) { rose_neigh->count--; if (rose_neigh->count == 0 && rose_neigh->use == 0) rose_remove_neigh(rose_neigh); rose_node->count--; if (rose_node->count == 0) { rose_remove_node(rose_node); } else { switch (i) { case 0: rose_node->neighbour[0] = rose_node->neighbour[1]; case 1: rose_node->neighbour[1] = rose_node->neighbour[2]; case 2: break; } } goto out; } } err = -EINVAL; out: spin_unlock_bh(&rose_neigh_list_lock); spin_unlock_bh(&rose_node_list_lock); return err; }
C
linux
0
CVE-2011-3084
https://www.cvedetails.com/cve/CVE-2011-3084/
CWE-264
https://github.com/chromium/chromium/commit/744c2a2d90c3c9a33c818e1ea4b7ccb5010663a0
744c2a2d90c3c9a33c818e1ea4b7ccb5010663a0
Allow browser to handle all WebUI navigations. BUG=113496 TEST="Google Dashboard" link in Sync settings loads in new process. Review URL: http://codereview.chromium.org/9663045 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@126949 0039d316-1c4b-4281-b951-d872f2087c98
virtual ~RenderViewHostManagerTestWebUIControllerFactory() {}
virtual ~RenderViewHostManagerTestWebUIControllerFactory() {}
C
Chrome
0
CVE-2018-13006
https://www.cvedetails.com/cve/CVE-2018-13006/
CWE-125
https://github.com/gpac/gpac/commit/bceb03fd2be95097a7b409ea59914f332fb6bc86
bceb03fd2be95097a7b409ea59914f332fb6bc86
fixed 2 possible heap overflows (inc. #1088)
GF_Err mdia_Size(GF_Box *s) { GF_Err e; GF_MediaBox *ptr = (GF_MediaBox *)s; if (ptr->mediaHeader) { e = gf_isom_box_size((GF_Box *) ptr->mediaHeader); if (e) return e; ptr->size += ptr->mediaHeader->size; } if (ptr->handler) { e = gf_isom_box_size((GF_Box *) ptr->handler); if (e) return e; ptr->size += ptr->handler->size; } if (ptr->information) { e = gf_isom_box_size((GF_Box *) ptr->information); if (e) return e; ptr->size += ptr->information->size; } return GF_OK; }
GF_Err mdia_Size(GF_Box *s) { GF_Err e; GF_MediaBox *ptr = (GF_MediaBox *)s; if (ptr->mediaHeader) { e = gf_isom_box_size((GF_Box *) ptr->mediaHeader); if (e) return e; ptr->size += ptr->mediaHeader->size; } if (ptr->handler) { e = gf_isom_box_size((GF_Box *) ptr->handler); if (e) return e; ptr->size += ptr->handler->size; } if (ptr->information) { e = gf_isom_box_size((GF_Box *) ptr->information); if (e) return e; ptr->size += ptr->information->size; } return GF_OK; }
C
gpac
0
CVE-2017-9798
https://www.cvedetails.com/cve/CVE-2017-9798/
CWE-416
https://github.com/apache/httpd/commit/29afdd2550b3d30a8defece2b95ae81edcf66ac9
29afdd2550b3d30a8defece2b95ae81edcf66ac9
core: Disallow Methods' registration at run time (.htaccess), they may be used only if registered at init time (httpd.conf). Calling ap_method_register() in children processes is not the right scope since it won't be shared for all requests. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1807655 13f79535-47bb-0310-9956-ffa450edef68
static const char *set_qualify_redirect_url(cmd_parms *cmd, void *d_, int flag) { core_dir_config *d = d_; d->qualify_redirect_url = flag ? AP_CORE_CONFIG_ON : AP_CORE_CONFIG_OFF; return NULL; }
static const char *set_qualify_redirect_url(cmd_parms *cmd, void *d_, int flag) { core_dir_config *d = d_; d->qualify_redirect_url = flag ? AP_CORE_CONFIG_ON : AP_CORE_CONFIG_OFF; return NULL; }
C
httpd
0
CVE-2017-5118
https://www.cvedetails.com/cve/CVE-2017-5118/
CWE-732
https://github.com/chromium/chromium/commit/0ab2412a104d2f235d7b9fe19d30ef605a410832
0ab2412a104d2f235d7b9fe19d30ef605a410832
Inherit CSP when we inherit the security origin This prevents attacks that use main window navigation to get out of the existing csp constraints such as the related bug Bug: 747847 Change-Id: I1e57b50da17f65d38088205b0a3c7c49ef2ae4d8 Reviewed-on: https://chromium-review.googlesource.com/592027 Reviewed-by: Mike West <[email protected]> Commit-Queue: Andy Paicu <[email protected]> Cr-Commit-Position: refs/heads/master@{#492333}
const KURL& Document::VirtualURL() const { return url_; }
const KURL& Document::VirtualURL() const { return url_; }
C
Chrome
0
CVE-2011-2895
https://www.cvedetails.com/cve/CVE-2011-2895/
CWE-119
https://cgit.freedesktop.org/xorg/lib/libXfont/commit/?id=d11ee5886e9d9ec610051a206b135a4cdc1e09a0
d11ee5886e9d9ec610051a206b135a4cdc1e09a0
null
BufFilePushCompressed (BufFilePtr f) { int code; int maxbits; int hsize; CompressedFile *file; int extra; if ((BufFileGet(f) != (magic_header[0] & 0xFF)) || (BufFileGet(f) != (magic_header[1] & 0xFF))) { return 0; } code = BufFileGet (f); if (code == BUFFILEEOF) return 0; maxbits = code & BIT_MASK; if (maxbits > BITS || maxbits < 12) return 0; hsize = hsize_table[maxbits - 12]; extra = (1 << maxbits) * sizeof (char_type) + hsize * sizeof (unsigned short); file = malloc (sizeof (CompressedFile) + extra); if (!file) return 0; file->file = f; file->maxbits = maxbits; file->block_compress = code & BLOCK_MASK; file->maxmaxcode = 1 << file->maxbits; file->tab_suffix = (char_type *) &file[1]; file->tab_prefix = (unsigned short *) (file->tab_suffix + file->maxmaxcode); /* * As above, initialize the first 256 entries in the table. */ file->maxcode = MAXCODE(file->n_bits = INIT_BITS); for ( code = 255; code >= 0; code-- ) { file->tab_prefix[code] = 0; file->tab_suffix[code] = (char_type) code; } file->free_ent = ((file->block_compress) ? FIRST : 256 ); file->clear_flg = 0; file->offset = 0; file->size = 0; file->stackp = file->de_stack; bzero(file->buf, BITS); file->finchar = file->oldcode = getcode (file); if (file->oldcode != -1) *file->stackp++ = file->finchar; return BufFileCreate ((char *) file, BufCompressedFill, 0, BufCompressedSkip, BufCompressedClose); }
BufFilePushCompressed (BufFilePtr f) { int code; int maxbits; int hsize; CompressedFile *file; int extra; if ((BufFileGet(f) != (magic_header[0] & 0xFF)) || (BufFileGet(f) != (magic_header[1] & 0xFF))) { return 0; } code = BufFileGet (f); if (code == BUFFILEEOF) return 0; maxbits = code & BIT_MASK; if (maxbits > BITS || maxbits < 12) return 0; hsize = hsize_table[maxbits - 12]; extra = (1 << maxbits) * sizeof (char_type) + hsize * sizeof (unsigned short); file = malloc (sizeof (CompressedFile) + extra); if (!file) return 0; file->file = f; file->maxbits = maxbits; file->block_compress = code & BLOCK_MASK; file->maxmaxcode = 1 << file->maxbits; file->tab_suffix = (char_type *) &file[1]; file->tab_prefix = (unsigned short *) (file->tab_suffix + file->maxmaxcode); /* * As above, initialize the first 256 entries in the table. */ file->maxcode = MAXCODE(file->n_bits = INIT_BITS); for ( code = 255; code >= 0; code-- ) { file->tab_prefix[code] = 0; file->tab_suffix[code] = (char_type) code; } file->free_ent = ((file->block_compress) ? FIRST : 256 ); file->clear_flg = 0; file->offset = 0; file->size = 0; file->stackp = file->de_stack; bzero(file->buf, BITS); file->finchar = file->oldcode = getcode (file); if (file->oldcode != -1) *file->stackp++ = file->finchar; return BufFileCreate ((char *) file, BufCompressedFill, 0, BufCompressedSkip, BufCompressedClose); }
C
libxfont
0
CVE-2017-15411
https://www.cvedetails.com/cve/CVE-2017-15411/
CWE-416
https://github.com/chromium/chromium/commit/9d81094d7b0bfc8be6bba2f5084e790677e527c8
9d81094d7b0bfc8be6bba2f5084e790677e527c8
[Reland #1] Add Android OOP HP end-to-end tests. The original CL added a javatest and its dependencies to the apk_under_test. This causes the dependencies to be stripped from the instrumentation_apk, which causes issue. This CL updates the build configuration so that the javatest and its dependencies are only added to the instrumentation_apk. This is a reland of e0b4355f0651adb1ebc2c513dc4410471af712f5 Original change's description: > Add Android OOP HP end-to-end tests. > > This CL has three components: > 1) The bulk of the logic in OOP HP was refactored into ProfilingTestDriver. > 2) Adds a java instrumentation test, along with a JNI shim that forwards into > ProfilingTestDriver. > 3) Creates a new apk: chrome_public_apk_for_test that contains the same > content as chrome_public_apk, as well as native files needed for (2). > chrome_public_apk_test now targets chrome_public_apk_for_test instead of > chrome_public_apk. > > Other ideas, discarded: > * Originally, I attempted to make the browser_tests target runnable on > Android. The primary problem is that native test harness cannot fork > or spawn processes. This is difficult to solve. > > More details on each of the components: > (1) ProfilingTestDriver > * The TracingController test was migrated to use ProfilingTestDriver, but the > write-to-file test was left as-is. The latter behavior will likely be phased > out, but I'll clean that up in a future CL. > * gtest isn't supported for Android instrumentation tests. ProfilingTestDriver > has a single function RunTest that returns a 'bool' indicating success. On > failure, the class uses LOG(ERROR) to print the nature of the error. This will > cause the error to be printed out on browser_test error. On instrumentation > test failure, the error will be forwarded to logcat, which is available on all > infra bot test runs. > (2) Instrumentation test > * For now, I only added a single test for the "browser" mode. Furthermore, I'm > only testing the start with command-line path. > (3) New apk > * libchromefortest is a new shared library that contains all content from > libchrome, but also contains native sources for the JNI shim. > * chrome_public_apk_for_test is a new apk that contains all content from > chrome_public_apk, but uses a single shared library libchromefortest rather > than libchrome. This also contains java sources for the JNI shim. > * There is no way to just add a second shared library to chrome_public_apk > that just contains the native sources from the JNI shim without causing ODR > issues. > * chrome_public_test_apk now has apk_under_test = chrome_public_apk_for_test. > * There is no way to add native JNI sources as a shared library to > chrome_public_test_apk without causing ODR issues. > > Finally, this CL drastically increases the timeout to wait for native > initialization. The previous timeout was 2 * > CriteriaHelper.DEFAULT_MAX_TIME_TO_POLL, which flakily failed for this test. > This suggests that this step/timeout is generally flaky. I increased the timeout > to 20 * CriteriaHelper.DEFAULT_MAX_TIME_TO_POLL. > > Bug: 753218 > Change-Id: Ic224b7314fff57f1770a4048aa5753f54e040b55 > Reviewed-on: https://chromium-review.googlesource.com/770148 > Commit-Queue: Erik Chen <[email protected]> > Reviewed-by: John Budorick <[email protected]> > Reviewed-by: Brett Wilson <[email protected]> > Cr-Commit-Position: refs/heads/master@{#517541} Bug: 753218 TBR: [email protected] Change-Id: Ic6aafb34c2467253f75cc85da48200d19f3bc9af Reviewed-on: https://chromium-review.googlesource.com/777697 Commit-Queue: Erik Chen <[email protected]> Reviewed-by: John Budorick <[email protected]> Cr-Commit-Position: refs/heads/master@{#517850}
ProfilingProcessHost::ProfilingProcessHost() : is_registered_(false), background_triggers_(this), mode_(Mode::kNone), profiled_renderer_(nullptr), always_sample_for_tests_(false) {}
ProfilingProcessHost::ProfilingProcessHost() : is_registered_(false), background_triggers_(this), mode_(Mode::kNone), profiled_renderer_(nullptr), always_sample_for_tests_(false) {}
C
Chrome
0
CVE-2017-9994
https://www.cvedetails.com/cve/CVE-2017-9994/
CWE-119
https://github.com/FFmpeg/FFmpeg/commit/6b5d3fb26fb4be48e4966e4b1d97c2165538d4ef
6b5d3fb26fb4be48e4966e4b1d97c2165538d4ef
avcodec/webp: Always set pix_fmt Fixes: out of array access Fixes: 1434/clusterfuzz-testcase-minimized-6314998085189632 Fixes: 1435/clusterfuzz-testcase-minimized-6483783723253760 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg Reviewed-by: "Ronald S. Bultje" <[email protected]> Signed-off-by: Michael Niedermayer <[email protected]>
void filter_mb_simple(VP8Context *s, uint8_t *dst, VP8FilterStrength *f, int mb_x, int mb_y) { int mbedge_lim, bedge_lim; int filter_level = f->filter_level; int inner_limit = f->inner_limit; int inner_filter = f->inner_filter; ptrdiff_t linesize = s->linesize; if (!filter_level) return; bedge_lim = 2 * filter_level + inner_limit; mbedge_lim = bedge_lim + 4; if (mb_x) s->vp8dsp.vp8_h_loop_filter_simple(dst, linesize, mbedge_lim); if (inner_filter) { s->vp8dsp.vp8_h_loop_filter_simple(dst + 4, linesize, bedge_lim); s->vp8dsp.vp8_h_loop_filter_simple(dst + 8, linesize, bedge_lim); s->vp8dsp.vp8_h_loop_filter_simple(dst + 12, linesize, bedge_lim); } if (mb_y) s->vp8dsp.vp8_v_loop_filter_simple(dst, linesize, mbedge_lim); if (inner_filter) { s->vp8dsp.vp8_v_loop_filter_simple(dst + 4 * linesize, linesize, bedge_lim); s->vp8dsp.vp8_v_loop_filter_simple(dst + 8 * linesize, linesize, bedge_lim); s->vp8dsp.vp8_v_loop_filter_simple(dst + 12 * linesize, linesize, bedge_lim); } }
void filter_mb_simple(VP8Context *s, uint8_t *dst, VP8FilterStrength *f, int mb_x, int mb_y) { int mbedge_lim, bedge_lim; int filter_level = f->filter_level; int inner_limit = f->inner_limit; int inner_filter = f->inner_filter; ptrdiff_t linesize = s->linesize; if (!filter_level) return; bedge_lim = 2 * filter_level + inner_limit; mbedge_lim = bedge_lim + 4; if (mb_x) s->vp8dsp.vp8_h_loop_filter_simple(dst, linesize, mbedge_lim); if (inner_filter) { s->vp8dsp.vp8_h_loop_filter_simple(dst + 4, linesize, bedge_lim); s->vp8dsp.vp8_h_loop_filter_simple(dst + 8, linesize, bedge_lim); s->vp8dsp.vp8_h_loop_filter_simple(dst + 12, linesize, bedge_lim); } if (mb_y) s->vp8dsp.vp8_v_loop_filter_simple(dst, linesize, mbedge_lim); if (inner_filter) { s->vp8dsp.vp8_v_loop_filter_simple(dst + 4 * linesize, linesize, bedge_lim); s->vp8dsp.vp8_v_loop_filter_simple(dst + 8 * linesize, linesize, bedge_lim); s->vp8dsp.vp8_v_loop_filter_simple(dst + 12 * linesize, linesize, bedge_lim); } }
C
FFmpeg
0
CVE-2017-5120
https://www.cvedetails.com/cve/CVE-2017-5120/
null
https://github.com/chromium/chromium/commit/b7277af490d28ac7f802c015bb0ff31395768556
b7277af490d28ac7f802c015bb0ff31395768556
bindings: Support "attribute FrozenArray<T>?" Adds a quick hack to support a case of "attribute FrozenArray<T>?". Bug: 1028047 Change-Id: Ib3cecc4beb6bcc0fb0dbc667aca595454cc90c86 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1933866 Reviewed-by: Hitoshi Yoshida <[email protected]> Commit-Queue: Yuki Shiino <[email protected]> Cr-Commit-Position: refs/heads/master@{#718676}
static void ActivityLoggingAccessForIsolatedWorldsPerWorldBindingsLongAttributeAttributeGetterForMainWorld(const v8::FunctionCallbackInfo<v8::Value>& info) { v8::Local<v8::Object> holder = info.Holder(); TestObject* impl = V8TestObject::ToImpl(holder); V8SetReturnValueInt(info, impl->activityLoggingAccessForIsolatedWorldsPerWorldBindingsLongAttribute()); }
static void ActivityLoggingAccessForIsolatedWorldsPerWorldBindingsLongAttributeAttributeGetterForMainWorld(const v8::FunctionCallbackInfo<v8::Value>& info) { v8::Local<v8::Object> holder = info.Holder(); TestObject* impl = V8TestObject::ToImpl(holder); V8SetReturnValueInt(info, impl->activityLoggingAccessForIsolatedWorldsPerWorldBindingsLongAttribute()); }
C
Chrome
0
CVE-2013-2906
https://www.cvedetails.com/cve/CVE-2013-2906/
CWE-362
https://github.com/chromium/chromium/commit/c4a4dfb26615b5ef5e9dcc730ef43f70ce9202e2
c4a4dfb26615b5ef5e9dcc730ef43f70ce9202e2
Suspend shared timers while blockingly closing databases BUG=388771 [email protected] Review URL: https://codereview.chromium.org/409863002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@284785 0039d316-1c4b-4281-b951-d872f2087c98
void RenderThreadImpl::UpdateHistograms(int sequence_number) { child_histogram_message_filter()->SendHistograms(sequence_number); }
void RenderThreadImpl::UpdateHistograms(int sequence_number) { child_histogram_message_filter()->SendHistograms(sequence_number); }
C
Chrome
0
CVE-2013-2017
https://www.cvedetails.com/cve/CVE-2013-2017/
CWE-399
https://github.com/torvalds/linux/commit/6ec82562ffc6f297d0de36d65776cff8e5704867
6ec82562ffc6f297d0de36d65776cff8e5704867
veth: Dont kfree_skb() after dev_forward_skb() In case of congestion, netif_rx() frees the skb, so we must assume dev_forward_skb() also consume skb. Bug introduced by commit 445409602c092 (veth: move loopback logic to common location) We must change dev_forward_skb() to always consume skb, and veth to not double free it. Bug report : http://marc.info/?l=linux-netdev&m=127310770900442&w=3 Reported-by: Martín Ferrari <[email protected]> Signed-off-by: Eric Dumazet <[email protected]> Signed-off-by: David S. Miller <[email protected]>
void netdev_state_change(struct net_device *dev) { if (dev->flags & IFF_UP) { call_netdevice_notifiers(NETDEV_CHANGE, dev); rtmsg_ifinfo(RTM_NEWLINK, dev, 0); } }
void netdev_state_change(struct net_device *dev) { if (dev->flags & IFF_UP) { call_netdevice_notifiers(NETDEV_CHANGE, dev); rtmsg_ifinfo(RTM_NEWLINK, dev, 0); } }
C
linux
0
CVE-2015-6761
https://www.cvedetails.com/cve/CVE-2015-6761/
CWE-362
https://github.com/chromium/chromium/commit/fd506b0ac6c7846ae45b5034044fe85c28ee68ac
fd506b0ac6c7846ae45b5034044fe85c28ee68ac
Fix detach with open()ed document leaving parent loading indefinitely Change-Id: I26c2a054b9f1e5eb076acd677e1223058825f6d6 Bug: 803416 Test: fast/loader/document-open-iframe-then-detach.html Change-Id: I26c2a054b9f1e5eb076acd677e1223058825f6d6 Reviewed-on: https://chromium-review.googlesource.com/887298 Reviewed-by: Mike West <[email protected]> Commit-Queue: Nate Chapin <[email protected]> Cr-Commit-Position: refs/heads/master@{#532967}
void FrameLoader::ProcessFragment(const KURL& url, FrameLoadType frame_load_type, LoadStartType load_start_type) { LocalFrameView* view = frame_->View(); if (!view) return; Frame* boundary_frame = url.HasFragmentIdentifier() ? frame_->FindUnsafeParentScrollPropagationBoundary() : nullptr; if (boundary_frame && boundary_frame->IsLocalFrame()) { ToLocalFrame(boundary_frame) ->View() ->SetSafeToPropagateScrollToParent(false); } bool should_scroll_to_fragment = (load_start_type == kNavigationWithinSameDocument && !IsBackForwardLoadType(frame_load_type)) || (!GetDocumentLoader()->GetInitialScrollState().did_restore_from_history && !(GetDocumentLoader()->GetHistoryItem() && GetDocumentLoader()->GetHistoryItem()->ScrollRestorationType() == kScrollRestorationManual)); view->ProcessUrlFragment(url, should_scroll_to_fragment ? LocalFrameView::kUrlFragmentScroll : LocalFrameView::kUrlFragmentDontScroll); if (boundary_frame && boundary_frame->IsLocalFrame()) ToLocalFrame(boundary_frame) ->View() ->SetSafeToPropagateScrollToParent(true); }
void FrameLoader::ProcessFragment(const KURL& url, FrameLoadType frame_load_type, LoadStartType load_start_type) { LocalFrameView* view = frame_->View(); if (!view) return; Frame* boundary_frame = url.HasFragmentIdentifier() ? frame_->FindUnsafeParentScrollPropagationBoundary() : nullptr; if (boundary_frame && boundary_frame->IsLocalFrame()) { ToLocalFrame(boundary_frame) ->View() ->SetSafeToPropagateScrollToParent(false); } bool should_scroll_to_fragment = (load_start_type == kNavigationWithinSameDocument && !IsBackForwardLoadType(frame_load_type)) || (!GetDocumentLoader()->GetInitialScrollState().did_restore_from_history && !(GetDocumentLoader()->GetHistoryItem() && GetDocumentLoader()->GetHistoryItem()->ScrollRestorationType() == kScrollRestorationManual)); view->ProcessUrlFragment(url, should_scroll_to_fragment ? LocalFrameView::kUrlFragmentScroll : LocalFrameView::kUrlFragmentDontScroll); if (boundary_frame && boundary_frame->IsLocalFrame()) ToLocalFrame(boundary_frame) ->View() ->SetSafeToPropagateScrollToParent(true); }
C
Chrome
0
CVE-2016-3760
https://www.cvedetails.com/cve/CVE-2016-3760/
CWE-20
https://android.googlesource.com/platform/system/bt/+/37c88107679d36c419572732b4af6e18bb2f7dce
37c88107679d36c419572732b4af6e18bb2f7dce
Add guest mode functionality (2/3) Add a flag to enable() to start Bluetooth in restricted mode. In restricted mode, all devices that are paired during restricted mode are deleted upon leaving restricted mode. Right now restricted mode is only entered while a guest user is active. Bug: 27410683 Change-Id: I8f23d28ef0aa3a8df13d469c73005c8e1b894d19
bool btif_config_get_int(const char *section, const char *key, int *value) { assert(config != NULL); assert(section != NULL); assert(key != NULL); assert(value != NULL); pthread_mutex_lock(&lock); bool ret = config_has_key(config, section, key); if (ret) *value = config_get_int(config, section, key, *value); pthread_mutex_unlock(&lock); return ret; }
bool btif_config_get_int(const char *section, const char *key, int *value) { assert(config != NULL); assert(section != NULL); assert(key != NULL); assert(value != NULL); pthread_mutex_lock(&lock); bool ret = config_has_key(config, section, key); if (ret) *value = config_get_int(config, section, key, *value); pthread_mutex_unlock(&lock); return ret; }
C
Android
0
CVE-2013-2548
https://www.cvedetails.com/cve/CVE-2013-2548/
CWE-310
https://github.com/torvalds/linux/commit/9a5467bf7b6e9e02ec9c3da4e23747c05faeaac6
9a5467bf7b6e9e02ec9c3da4e23747c05faeaac6
crypto: user - fix info leaks in report API Three errors resulting in kernel memory disclosure: 1/ The structures used for the netlink based crypto algorithm report API are located on the stack. As snprintf() does not fill the remainder of the buffer with null bytes, those stack bytes will be disclosed to users of the API. Switch to strncpy() to fix this. 2/ crypto_report_one() does not initialize all field of struct crypto_user_alg. Fix this to fix the heap info leak. 3/ For the module name we should copy only as many bytes as module_name() returns -- not as much as the destination buffer could hold. But the current code does not and therefore copies random data from behind the end of the module name, as the module name is always shorter than CRYPTO_MAX_ALG_NAME. Also switch to use strncpy() to copy the algorithm's name and driver_name. They are strings, after all. Signed-off-by: Mathias Krause <[email protected]> Cc: Steffen Klassert <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
static inline unsigned int ablkcipher_done_fast(struct ablkcipher_walk *walk, unsigned int n) { scatterwalk_advance(&walk->in, n); scatterwalk_advance(&walk->out, n); return n; }
static inline unsigned int ablkcipher_done_fast(struct ablkcipher_walk *walk, unsigned int n) { scatterwalk_advance(&walk->in, n); scatterwalk_advance(&walk->out, n); return n; }
C
linux
0
CVE-2012-2890
https://www.cvedetails.com/cve/CVE-2012-2890/
CWE-399
https://github.com/chromium/chromium/commit/a6f7726de20450074a01493e4e85409ce3f2595a
a6f7726de20450074a01493e4e85409ce3f2595a
Unreviewed, rolling out r147402. http://trac.webkit.org/changeset/147402 https://bugs.webkit.org/show_bug.cgi?id=112903 Source/WebCore: * dom/Document.cpp: (WebCore::Document::processHttpEquiv): * loader/DocumentLoader.cpp: (WebCore::DocumentLoader::responseReceived): LayoutTests: * http/tests/security/XFrameOptions/x-frame-options-deny-expected.txt: * http/tests/security/XFrameOptions/x-frame-options-deny-meta-tag-expected.txt: * http/tests/security/XFrameOptions/x-frame-options-deny-meta-tag-in-body-expected.txt: * http/tests/security/XFrameOptions/x-frame-options-deny-meta-tag-in-body.html: * http/tests/security/XFrameOptions/x-frame-options-deny-meta-tag-parent-same-origin-deny-expected.txt: * http/tests/security/XFrameOptions/x-frame-options-deny-meta-tag-parent-same-origin-deny.html: * http/tests/security/XFrameOptions/x-frame-options-deny-meta-tag.html: * http/tests/security/XFrameOptions/x-frame-options-deny.html: * http/tests/security/XFrameOptions/x-frame-options-multiple-headers-sameorigin-deny-expected.txt: * http/tests/security/XFrameOptions/x-frame-options-multiple-headers-sameorigin-deny.html: * http/tests/security/XFrameOptions/x-frame-options-parent-same-origin-deny-expected.txt: * http/tests/security/XFrameOptions/x-frame-options-parent-same-origin-deny.html: * platform/chromium/http/tests/security/XFrameOptions/x-frame-options-deny-expected.txt: * platform/chromium/http/tests/security/XFrameOptions/x-frame-options-deny-meta-tag-expected.txt: * platform/chromium/http/tests/security/XFrameOptions/x-frame-options-deny-meta-tag-in-body-expected.txt: * platform/chromium/http/tests/security/XFrameOptions/x-frame-options-deny-meta-tag-parent-same-origin-deny-expected.txt: * platform/chromium/http/tests/security/XFrameOptions/x-frame-options-multiple-headers-sameorigin-deny-expected.txt: * platform/chromium/http/tests/security/XFrameOptions/x-frame-options-parent-same-origin-deny-expected.txt: git-svn-id: svn://svn.chromium.org/blink/trunk@147450 bbb929c8-8fbe-4397-9dbb-9b2b20218538
void DocumentLoader::deliverSubstituteResourcesAfterDelay() { if (m_pendingSubstituteResources.isEmpty()) return; ASSERT(m_frame && m_frame->page()); if (m_frame->page()->defersLoading()) return; if (!m_substituteResourceDeliveryTimer.isActive()) m_substituteResourceDeliveryTimer.startOneShot(0); }
void DocumentLoader::deliverSubstituteResourcesAfterDelay() { if (m_pendingSubstituteResources.isEmpty()) return; ASSERT(m_frame && m_frame->page()); if (m_frame->page()->defersLoading()) return; if (!m_substituteResourceDeliveryTimer.isActive()) m_substituteResourceDeliveryTimer.startOneShot(0); }
C
Chrome
0
CVE-2013-2879
https://www.cvedetails.com/cve/CVE-2013-2879/
CWE-200
https://github.com/chromium/chromium/commit/afbc71b7a78ac99810a6b22b2b0a2e85dde18794
afbc71b7a78ac99810a6b22b2b0a2e85dde18794
Display confirmation dialog for untrusted signins BUG=252062 Review URL: https://chromiumcodereview.appspot.com/17482002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@208520 0039d316-1c4b-4281-b951-d872f2087c98
void LogHistogramValue(SyncPromoUI::Source source, int action) { switch (source) { case SyncPromoUI::SOURCE_START_PAGE: UMA_HISTOGRAM_ENUMERATION("Signin.StartPageActions", action, one_click_signin::HISTOGRAM_MAX); break; case SyncPromoUI::SOURCE_NTP_LINK: UMA_HISTOGRAM_ENUMERATION("Signin.NTPLinkActions", action, one_click_signin::HISTOGRAM_MAX); break; case SyncPromoUI::SOURCE_MENU: UMA_HISTOGRAM_ENUMERATION("Signin.MenuActions", action, one_click_signin::HISTOGRAM_MAX); break; case SyncPromoUI::SOURCE_SETTINGS: UMA_HISTOGRAM_ENUMERATION("Signin.SettingsActions", action, one_click_signin::HISTOGRAM_MAX); break; case SyncPromoUI::SOURCE_EXTENSION_INSTALL_BUBBLE: UMA_HISTOGRAM_ENUMERATION("Signin.ExtensionInstallBubbleActions", action, one_click_signin::HISTOGRAM_MAX); break; case SyncPromoUI::SOURCE_WEBSTORE_INSTALL: UMA_HISTOGRAM_ENUMERATION("Signin.WebstoreInstallActions", action, one_click_signin::HISTOGRAM_MAX); break; case SyncPromoUI::SOURCE_APP_LAUNCHER: UMA_HISTOGRAM_ENUMERATION("Signin.AppLauncherActions", action, one_click_signin::HISTOGRAM_MAX); break; case SyncPromoUI::SOURCE_APPS_PAGE_LINK: UMA_HISTOGRAM_ENUMERATION("Signin.AppsPageLinkActions", action, one_click_signin::HISTOGRAM_MAX); break; default: NOTREACHED() << "Invalid Source"; return; } UMA_HISTOGRAM_ENUMERATION("Signin.AllAccessPointActions", action, one_click_signin::HISTOGRAM_MAX); }
void LogHistogramValue(SyncPromoUI::Source source, int action) { switch (source) { case SyncPromoUI::SOURCE_START_PAGE: UMA_HISTOGRAM_ENUMERATION("Signin.StartPageActions", action, one_click_signin::HISTOGRAM_MAX); break; case SyncPromoUI::SOURCE_NTP_LINK: UMA_HISTOGRAM_ENUMERATION("Signin.NTPLinkActions", action, one_click_signin::HISTOGRAM_MAX); break; case SyncPromoUI::SOURCE_MENU: UMA_HISTOGRAM_ENUMERATION("Signin.MenuActions", action, one_click_signin::HISTOGRAM_MAX); break; case SyncPromoUI::SOURCE_SETTINGS: UMA_HISTOGRAM_ENUMERATION("Signin.SettingsActions", action, one_click_signin::HISTOGRAM_MAX); break; case SyncPromoUI::SOURCE_EXTENSION_INSTALL_BUBBLE: UMA_HISTOGRAM_ENUMERATION("Signin.ExtensionInstallBubbleActions", action, one_click_signin::HISTOGRAM_MAX); break; case SyncPromoUI::SOURCE_WEBSTORE_INSTALL: UMA_HISTOGRAM_ENUMERATION("Signin.WebstoreInstallActions", action, one_click_signin::HISTOGRAM_MAX); break; case SyncPromoUI::SOURCE_APP_LAUNCHER: UMA_HISTOGRAM_ENUMERATION("Signin.AppLauncherActions", action, one_click_signin::HISTOGRAM_MAX); break; case SyncPromoUI::SOURCE_APPS_PAGE_LINK: UMA_HISTOGRAM_ENUMERATION("Signin.AppsPageLinkActions", action, one_click_signin::HISTOGRAM_MAX); break; default: NOTREACHED() << "Invalid Source"; return; } UMA_HISTOGRAM_ENUMERATION("Signin.AllAccessPointActions", action, one_click_signin::HISTOGRAM_MAX); }
C
Chrome
0
CVE-2014-1713
https://www.cvedetails.com/cve/CVE-2014-1713/
CWE-399
https://github.com/chromium/chromium/commit/f85a87ec670ad0fce9d98d90c9a705b72a288154
f85a87ec670ad0fce9d98d90c9a705b72a288154
document.location bindings fix BUG=352374 [email protected] Review URL: https://codereview.chromium.org/196343011 git-svn-id: svn://svn.chromium.org/blink/trunk@169176 bbb929c8-8fbe-4397-9dbb-9b2b20218538
static void raisesExceptionVoidMethodOptionalTestCallbackInterfaceArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); TestObjectPythonV8Internal::raisesExceptionVoidMethodOptionalTestCallbackInterfaceArgMethod(info); TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); }
static void raisesExceptionVoidMethodOptionalTestCallbackInterfaceArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); TestObjectPythonV8Internal::raisesExceptionVoidMethodOptionalTestCallbackInterfaceArgMethod(info); TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); }
C
Chrome
0
CVE-2011-3963
https://www.cvedetails.com/cve/CVE-2011-3963/
CWE-119
https://github.com/chromium/chromium/commit/0a38f71865b63025dce4de1f8cca71979c48d14d
0a38f71865b63025dce4de1f8cca71979c48d14d
Implement methods for pairing of bluetooth devices. BUG=chromium:100392,chromium:102139 TEST= Review URL: http://codereview.chromium.org/8495018 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@109094 0039d316-1c4b-4281-b951-d872f2087c98
void BluetoothOptionsHandler::EnableChangeCallback( const ListValue* args) { bool bluetooth_enabled; args->GetBoolean(0, &bluetooth_enabled); base::FundamentalValue checked(bluetooth_enabled); web_ui_->CallJavascriptFunction( "options.SystemOptions.setBluetoothCheckboxState", checked); }
void BluetoothOptionsHandler::EnableChangeCallback( const ListValue* args) { bool bluetooth_enabled; args->GetBoolean(0, &bluetooth_enabled); base::FundamentalValue checked(bluetooth_enabled); web_ui_->CallJavascriptFunction( "options.SystemOptions.setBluetoothCheckboxState", checked); }
C
Chrome
0
CVE-2015-5307
https://www.cvedetails.com/cve/CVE-2015-5307/
CWE-399
https://github.com/torvalds/linux/commit/54a20552e1eae07aa240fa370a0293e006b5faed
54a20552e1eae07aa240fa370a0293e006b5faed
KVM: x86: work around infinite loop in microcode when #AC is delivered It was found that a guest can DoS a host by triggering an infinite stream of "alignment check" (#AC) exceptions. This causes the microcode to enter an infinite loop where the core never receives another interrupt. The host kernel panics pretty quickly due to the effects (CVE-2015-5307). Signed-off-by: Eric Northup <[email protected]> Cc: [email protected] Signed-off-by: Paolo Bonzini <[email protected]>
static void vmx_set_constant_host_state(struct vcpu_vmx *vmx) { u32 low32, high32; unsigned long tmpl; struct desc_ptr dt; unsigned long cr4; vmcs_writel(HOST_CR0, read_cr0() & ~X86_CR0_TS); /* 22.2.3 */ vmcs_writel(HOST_CR3, read_cr3()); /* 22.2.3 FIXME: shadow tables */ /* Save the most likely value for this task's CR4 in the VMCS. */ cr4 = cr4_read_shadow(); vmcs_writel(HOST_CR4, cr4); /* 22.2.3, 22.2.5 */ vmx->host_state.vmcs_host_cr4 = cr4; vmcs_write16(HOST_CS_SELECTOR, __KERNEL_CS); /* 22.2.4 */ #ifdef CONFIG_X86_64 /* * Load null selectors, so we can avoid reloading them in * __vmx_load_host_state(), in case userspace uses the null selectors * too (the expected case). */ vmcs_write16(HOST_DS_SELECTOR, 0); vmcs_write16(HOST_ES_SELECTOR, 0); #else vmcs_write16(HOST_DS_SELECTOR, __KERNEL_DS); /* 22.2.4 */ vmcs_write16(HOST_ES_SELECTOR, __KERNEL_DS); /* 22.2.4 */ #endif vmcs_write16(HOST_SS_SELECTOR, __KERNEL_DS); /* 22.2.4 */ vmcs_write16(HOST_TR_SELECTOR, GDT_ENTRY_TSS*8); /* 22.2.4 */ native_store_idt(&dt); vmcs_writel(HOST_IDTR_BASE, dt.address); /* 22.2.4 */ vmx->host_idt_base = dt.address; vmcs_writel(HOST_RIP, vmx_return); /* 22.2.5 */ rdmsr(MSR_IA32_SYSENTER_CS, low32, high32); vmcs_write32(HOST_IA32_SYSENTER_CS, low32); rdmsrl(MSR_IA32_SYSENTER_EIP, tmpl); vmcs_writel(HOST_IA32_SYSENTER_EIP, tmpl); /* 22.2.3 */ if (vmcs_config.vmexit_ctrl & VM_EXIT_LOAD_IA32_PAT) { rdmsr(MSR_IA32_CR_PAT, low32, high32); vmcs_write64(HOST_IA32_PAT, low32 | ((u64) high32 << 32)); } }
static void vmx_set_constant_host_state(struct vcpu_vmx *vmx) { u32 low32, high32; unsigned long tmpl; struct desc_ptr dt; unsigned long cr4; vmcs_writel(HOST_CR0, read_cr0() & ~X86_CR0_TS); /* 22.2.3 */ vmcs_writel(HOST_CR3, read_cr3()); /* 22.2.3 FIXME: shadow tables */ /* Save the most likely value for this task's CR4 in the VMCS. */ cr4 = cr4_read_shadow(); vmcs_writel(HOST_CR4, cr4); /* 22.2.3, 22.2.5 */ vmx->host_state.vmcs_host_cr4 = cr4; vmcs_write16(HOST_CS_SELECTOR, __KERNEL_CS); /* 22.2.4 */ #ifdef CONFIG_X86_64 /* * Load null selectors, so we can avoid reloading them in * __vmx_load_host_state(), in case userspace uses the null selectors * too (the expected case). */ vmcs_write16(HOST_DS_SELECTOR, 0); vmcs_write16(HOST_ES_SELECTOR, 0); #else vmcs_write16(HOST_DS_SELECTOR, __KERNEL_DS); /* 22.2.4 */ vmcs_write16(HOST_ES_SELECTOR, __KERNEL_DS); /* 22.2.4 */ #endif vmcs_write16(HOST_SS_SELECTOR, __KERNEL_DS); /* 22.2.4 */ vmcs_write16(HOST_TR_SELECTOR, GDT_ENTRY_TSS*8); /* 22.2.4 */ native_store_idt(&dt); vmcs_writel(HOST_IDTR_BASE, dt.address); /* 22.2.4 */ vmx->host_idt_base = dt.address; vmcs_writel(HOST_RIP, vmx_return); /* 22.2.5 */ rdmsr(MSR_IA32_SYSENTER_CS, low32, high32); vmcs_write32(HOST_IA32_SYSENTER_CS, low32); rdmsrl(MSR_IA32_SYSENTER_EIP, tmpl); vmcs_writel(HOST_IA32_SYSENTER_EIP, tmpl); /* 22.2.3 */ if (vmcs_config.vmexit_ctrl & VM_EXIT_LOAD_IA32_PAT) { rdmsr(MSR_IA32_CR_PAT, low32, high32); vmcs_write64(HOST_IA32_PAT, low32 | ((u64) high32 << 32)); } }
C
linux
0
CVE-2019-5837
https://www.cvedetails.com/cve/CVE-2019-5837/
CWE-200
https://github.com/chromium/chromium/commit/04aaacb936a08d70862d6d9d7e8354721ae46be8
04aaacb936a08d70862d6d9d7e8354721ae46be8
Reland "AppCache: Add padding to cross-origin responses." This is a reland of 85b389caa7d725cdd31f59e9a2b79ff54804b7b7 Initialized CacheRecord::padding_size to 0. Original change's description: > AppCache: Add padding to cross-origin responses. > > Bug: 918293 > Change-Id: I4f16640f06feac009d6bbbb624951da6d2669f6c > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1488059 > Commit-Queue: Staphany Park <[email protected]> > Reviewed-by: Victor Costan <[email protected]> > Reviewed-by: Marijn Kruisselbrink <[email protected]> > Cr-Commit-Position: refs/heads/master@{#644624} Bug: 918293 Change-Id: Ie1d3f99c7e8a854d33255a4d66243da2ce16441c Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1539906 Reviewed-by: Victor Costan <[email protected]> Commit-Queue: Staphany Park <[email protected]> Cr-Commit-Position: refs/heads/master@{#644719}
void AppCacheUpdateJob::CheckIfManifestChanged() { DCHECK(update_type_ == UPGRADE_ATTEMPT); AppCacheEntry* entry = nullptr; if (group_->newest_complete_cache()) entry = group_->newest_complete_cache()->GetEntry(manifest_url_); if (!entry) { if (service_->storage() == storage_) { AppCacheServiceImpl* service = service_; HandleCacheFailure( blink::mojom::AppCacheErrorDetails( "Manifest entry not found in existing cache", blink::mojom::AppCacheErrorReason::APPCACHE_UNKNOWN_ERROR, GURL(), 0, false /*is_cross_origin*/), DB_ERROR, GURL()); AppCacheHistograms::AddMissingManifestEntrySample(); service->DeleteAppCacheGroup(manifest_url_, net::CompletionOnceCallback()); } return; } manifest_response_reader_ = storage_->CreateResponseReader(manifest_url_, entry->response_id()); read_manifest_buffer_ = base::MakeRefCounted<net::IOBuffer>(kAppCacheFetchBufferSize); manifest_response_reader_->ReadData( read_manifest_buffer_.get(), kAppCacheFetchBufferSize, base::BindOnce(&AppCacheUpdateJob::OnManifestDataReadComplete, base::Unretained(this))); // async read }
void AppCacheUpdateJob::CheckIfManifestChanged() { DCHECK(update_type_ == UPGRADE_ATTEMPT); AppCacheEntry* entry = nullptr; if (group_->newest_complete_cache()) entry = group_->newest_complete_cache()->GetEntry(manifest_url_); if (!entry) { if (service_->storage() == storage_) { AppCacheServiceImpl* service = service_; HandleCacheFailure( blink::mojom::AppCacheErrorDetails( "Manifest entry not found in existing cache", blink::mojom::AppCacheErrorReason::APPCACHE_UNKNOWN_ERROR, GURL(), 0, false /*is_cross_origin*/), DB_ERROR, GURL()); AppCacheHistograms::AddMissingManifestEntrySample(); service->DeleteAppCacheGroup(manifest_url_, net::CompletionOnceCallback()); } return; } manifest_response_reader_ = storage_->CreateResponseReader(manifest_url_, entry->response_id()); read_manifest_buffer_ = base::MakeRefCounted<net::IOBuffer>(kAppCacheFetchBufferSize); manifest_response_reader_->ReadData( read_manifest_buffer_.get(), kAppCacheFetchBufferSize, base::BindOnce(&AppCacheUpdateJob::OnManifestDataReadComplete, base::Unretained(this))); // async read }
C
Chrome
0
CVE-2017-9217
https://www.cvedetails.com/cve/CVE-2017-9217/
CWE-20
https://github.com/systemd/systemd/commit/a924f43f30f9c4acaf70618dd2a055f8b0f166be
a924f43f30f9c4acaf70618dd2a055f8b0f166be
resolved: bugfix of null pointer p->question dereferencing (#6020) See https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/1621396
int dns_packet_new(DnsPacket **ret, DnsProtocol protocol, size_t mtu) { DnsPacket *p; size_t a; assert(ret); if (mtu <= UDP_PACKET_HEADER_SIZE) a = DNS_PACKET_SIZE_START; else a = mtu - UDP_PACKET_HEADER_SIZE; if (a < DNS_PACKET_HEADER_SIZE) a = DNS_PACKET_HEADER_SIZE; /* round up to next page size */ a = PAGE_ALIGN(ALIGN(sizeof(DnsPacket)) + a) - ALIGN(sizeof(DnsPacket)); /* make sure we never allocate more than useful */ if (a > DNS_PACKET_SIZE_MAX) a = DNS_PACKET_SIZE_MAX; p = malloc0(ALIGN(sizeof(DnsPacket)) + a); if (!p) return -ENOMEM; p->size = p->rindex = DNS_PACKET_HEADER_SIZE; p->allocated = a; p->protocol = protocol; p->opt_start = p->opt_size = (size_t) -1; p->n_ref = 1; *ret = p; return 0; }
int dns_packet_new(DnsPacket **ret, DnsProtocol protocol, size_t mtu) { DnsPacket *p; size_t a; assert(ret); if (mtu <= UDP_PACKET_HEADER_SIZE) a = DNS_PACKET_SIZE_START; else a = mtu - UDP_PACKET_HEADER_SIZE; if (a < DNS_PACKET_HEADER_SIZE) a = DNS_PACKET_HEADER_SIZE; /* round up to next page size */ a = PAGE_ALIGN(ALIGN(sizeof(DnsPacket)) + a) - ALIGN(sizeof(DnsPacket)); /* make sure we never allocate more than useful */ if (a > DNS_PACKET_SIZE_MAX) a = DNS_PACKET_SIZE_MAX; p = malloc0(ALIGN(sizeof(DnsPacket)) + a); if (!p) return -ENOMEM; p->size = p->rindex = DNS_PACKET_HEADER_SIZE; p->allocated = a; p->protocol = protocol; p->opt_start = p->opt_size = (size_t) -1; p->n_ref = 1; *ret = p; return 0; }
C
systemd
0
CVE-2015-5697
https://www.cvedetails.com/cve/CVE-2015-5697/
CWE-200
https://github.com/torvalds/linux/commit/b6878d9e03043695dbf3fa1caa6dfc09db225b16
b6878d9e03043695dbf3fa1caa6dfc09db225b16
md: use kzalloc() when bitmap is disabled In drivers/md/md.c get_bitmap_file() uses kmalloc() for creating a mdu_bitmap_file_t called "file". 5769 file = kmalloc(sizeof(*file), GFP_NOIO); 5770 if (!file) 5771 return -ENOMEM; This structure is copied to user space at the end of the function. 5786 if (err == 0 && 5787 copy_to_user(arg, file, sizeof(*file))) 5788 err = -EFAULT But if bitmap is disabled only the first byte of "file" is initialized with zero, so it's possible to read some bytes (up to 4095) of kernel space memory from user space. This is an information leak. 5775 /* bitmap disabled, zero the first byte and copy out */ 5776 if (!mddev->bitmap_info.file) 5777 file->pathname[0] = '\0'; Signed-off-by: Benjamin Randazzo <[email protected]> Signed-off-by: NeilBrown <[email protected]>
static void status_unused(struct seq_file *seq) { int i = 0; struct md_rdev *rdev; seq_printf(seq, "unused devices: "); list_for_each_entry(rdev, &pending_raid_disks, same_set) { char b[BDEVNAME_SIZE]; i++; seq_printf(seq, "%s ", bdevname(rdev->bdev,b)); } if (!i) seq_printf(seq, "<none>"); seq_printf(seq, "\n"); }
static void status_unused(struct seq_file *seq) { int i = 0; struct md_rdev *rdev; seq_printf(seq, "unused devices: "); list_for_each_entry(rdev, &pending_raid_disks, same_set) { char b[BDEVNAME_SIZE]; i++; seq_printf(seq, "%s ", bdevname(rdev->bdev,b)); } if (!i) seq_printf(seq, "<none>"); seq_printf(seq, "\n"); }
C
linux
0
CVE-2012-2390
https://www.cvedetails.com/cve/CVE-2012-2390/
CWE-399
https://github.com/torvalds/linux/commit/c50ac050811d6485616a193eb0f37bfbd191cc89
c50ac050811d6485616a193eb0f37bfbd191cc89
hugetlb: fix resv_map leak in error path When called for anonymous (non-shared) mappings, hugetlb_reserve_pages() does a resv_map_alloc(). It depends on code in hugetlbfs's vm_ops->close() to release that allocation. However, in the mmap() failure path, we do a plain unmap_region() without the remove_vma() which actually calls vm_ops->close(). This is a decent fix. This leak could get reintroduced if new code (say, after hugetlb_reserve_pages() in hugetlbfs_file_mmap()) decides to return an error. But, I think it would have to unroll the reservation anyway. Christoph's test case: http://marc.info/?l=linux-mm&m=133728900729735 This patch applies to 3.4 and later. A version for earlier kernels is at https://lkml.org/lkml/2012/5/22/418. Signed-off-by: Dave Hansen <[email protected]> Acked-by: Mel Gorman <[email protected]> Acked-by: KOSAKI Motohiro <[email protected]> Reported-by: Christoph Lameter <[email protected]> Tested-by: Christoph Lameter <[email protected]> Cc: Andrea Arcangeli <[email protected]> Cc: <[email protected]> [2.6.32+] Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
static struct page *hugetlbfs_pagecache_page(struct hstate *h, struct vm_area_struct *vma, unsigned long address) { struct address_space *mapping; pgoff_t idx; mapping = vma->vm_file->f_mapping; idx = vma_hugecache_offset(h, vma, address); return find_lock_page(mapping, idx); }
static struct page *hugetlbfs_pagecache_page(struct hstate *h, struct vm_area_struct *vma, unsigned long address) { struct address_space *mapping; pgoff_t idx; mapping = vma->vm_file->f_mapping; idx = vma_hugecache_offset(h, vma, address); return find_lock_page(mapping, idx); }
C
linux
0
CVE-2018-19476
https://www.cvedetails.com/cve/CVE-2018-19476/
CWE-704
http://git.ghostscript.com/?p=ghostpdl.git;a=commit;h=67d760ab775dae4efe803b5944b0439aa3c0b04a
67d760ab775dae4efe803b5944b0439aa3c0b04a
null
int seticc(i_ctx_t * i_ctx_p, int ncomps, ref *ICCdict, float *range_buff) { int code, k; gs_color_space * pcs; ref * pstrmval; stream * s = 0L; cmm_profile_t *picc_profile = NULL; int i, expected = 0; ref * pnameval; static const char *const icc_std_profile_names[] = { GSICC_STANDARD_PROFILES }; static const char *const icc_std_profile_keys[] = { GSICC_STANDARD_PROFILES_KEYS }; /* verify the DataSource entry */ if (dict_find_string(ICCdict, "DataSource", &pstrmval) <= 0) return_error(gs_error_undefined); check_read_file(i_ctx_p, s, pstrmval); /* build the color space object */ code = gs_cspace_build_ICC(&pcs, NULL, gs_gstate_memory(igs)); if (code < 0) return gs_rethrow(code, "building color space object"); /* For now, dump the profile into a buffer and obtain handle from the buffer when we need it. We may want to change this later. This depends to some degree on what the CMS is capable of doing. I don't want to get bogged down on stream I/O at this point. Note also, if we are going to be putting these into the clist we will want to have this buffer. */ /* Check if we have the /Name entry. This is used to associate with specs that have enumerated types to indicate sRGB sGray etc */ if (dict_find_string(ICCdict, "Name", &pnameval) > 0 && r_has_type(pnameval, t_string)){ uint size = r_size(pnameval); char *str = (char *)gs_alloc_bytes(gs_gstate_memory(igs), size+1, "seticc"); memcpy(str, (const char *)pnameval->value.bytes, size); str[size] = 0; /* Compare this to the standard profile names */ for (k = 0; k < GSICC_NUMBER_STANDARD_PROFILES; k++) { if ( strcmp( str, icc_std_profile_keys[k] ) == 0 ) { picc_profile = gsicc_get_profile_handle_file(icc_std_profile_names[k], strlen(icc_std_profile_names[k]), gs_gstate_memory(igs)); break; } } gs_free_object(gs_gstate_memory(igs), str, "seticc"); } else { picc_profile = gsicc_profile_new(s, gs_gstate_memory(igs), NULL, 0); if (picc_profile == NULL) return gs_throw(gs_error_VMerror, "Creation of ICC profile failed"); /* We have to get the profile handle due to the fact that we need to know if it has a data space that is CIELAB */ picc_profile->profile_handle = gsicc_get_profile_handle_buffer(picc_profile->buffer, picc_profile->buffer_size, gs_gstate_memory(igs)); } if (picc_profile == NULL || picc_profile->profile_handle == NULL) { /* Free up everything, the profile is not valid. We will end up going ahead and using a default based upon the number of components */ rc_decrement(picc_profile,"seticc"); rc_decrement(pcs,"seticc"); return -1; } code = gsicc_set_gscs_profile(pcs, picc_profile, gs_gstate_memory(igs)); if (code < 0) { rc_decrement(picc_profile,"seticc"); rc_decrement(pcs,"seticc"); return code; } picc_profile->num_comps = ncomps; picc_profile->data_cs = gscms_get_profile_data_space(picc_profile->profile_handle, picc_profile->memory); switch (picc_profile->data_cs) { case gsCIEXYZ: case gsCIELAB: case gsRGB: expected = 3; break; case gsGRAY: expected = 1; break; case gsCMYK: expected = 4; break; case gsNCHANNEL: case gsNAMED: /* Silence warnings */ case gsUNDEFINED: /* Silence warnings */ break; } if (!expected || ncomps != expected) { rc_decrement(picc_profile,"seticc"); rc_decrement(pcs,"seticc"); return_error(gs_error_rangecheck); } /* Lets go ahead and get the hash code and check if we match one of the default spaces */ /* Later we may want to delay this, but for now lets go ahead and do it */ gsicc_init_hash_cs(picc_profile, igs); /* Set the range according to the data type that is associated with the ICC input color type. Occasionally, we will run into CIELAB to CIELAB profiles for spot colors in PDF documents. These spot colors are typically described as separation colors with tint transforms that go from a tint value to a linear mapping between the CIELAB white point and the CIELAB tint color. This results in a CIELAB value that we need to use to fill. We need to detect this to make sure we do the proper scaling of the data. For CIELAB images in PDF, the source is always normal 8 or 16 bit encoded data in the range from 0 to 255 or 0 to 65535. In that case, there should not be any encoding and decoding to CIELAB. The PDF content will not include an ICC profile but will set the color space to \Lab. In this case, we use our seticc_lab operation to install the LAB to LAB profile, but we detect that we did that through the use of the is_lab flag in the profile descriptor. When then avoid the CIELAB encode and decode */ if (picc_profile->data_cs == gsCIELAB) { /* If the input space to this profile is CIELAB, then we need to adjust the limits */ /* See ICC spec ICC.1:2004-10 Section 6.3.4.2 and 6.4. I don't believe we need to worry about CIEXYZ profiles or any of the other odds ones. Need to check that though at some point. */ picc_profile->Range.ranges[0].rmin = 0.0; picc_profile->Range.ranges[0].rmax = 100.0; picc_profile->Range.ranges[1].rmin = -128.0; picc_profile->Range.ranges[1].rmax = 127.0; picc_profile->Range.ranges[2].rmin = -128.0; picc_profile->Range.ranges[2].rmax = 127.0; picc_profile->islab = true; } else { for (i = 0; i < ncomps; i++) { picc_profile->Range.ranges[i].rmin = range_buff[2 * i]; picc_profile->Range.ranges[i].rmax = range_buff[2 * i + 1]; } } /* Now see if we are in an overide situation. We have to wait until now in case this is an LAB profile which we will not overide */ if (gs_currentoverrideicc(igs) && picc_profile->data_cs != gsCIELAB) { /* Free up the profile structure */ switch( picc_profile->data_cs ) { case gsRGB: pcs->cmm_icc_profile_data = igs->icc_manager->default_rgb; break; case gsGRAY: pcs->cmm_icc_profile_data = igs->icc_manager->default_gray; break; case gsCMYK: pcs->cmm_icc_profile_data = igs->icc_manager->default_cmyk; break; default: break; } /* Have one increment from the color space. Having these tied together is not really correct. Need to fix that. ToDo. MJV */ rc_adjust(picc_profile, -2, "seticc"); rc_increment(pcs->cmm_icc_profile_data); } /* Set the color space. We are done. No joint cache here... */ code = gs_setcolorspace(igs, pcs); /* The context has taken a reference to the colorspace. We no longer need * ours, so drop it. */ rc_decrement_only(pcs, "seticc"); /* In this case, we already have a ref count of 2 on the icc profile one for when it was created and one for when it was set. We really only want one here so adjust */ rc_decrement(picc_profile,"seticc"); /* Remove the ICC dict from the stack */ pop(1); return code; }
int seticc(i_ctx_t * i_ctx_p, int ncomps, ref *ICCdict, float *range_buff) { int code, k; gs_color_space * pcs; ref * pstrmval; stream * s = 0L; cmm_profile_t *picc_profile = NULL; int i, expected = 0; ref * pnameval; static const char *const icc_std_profile_names[] = { GSICC_STANDARD_PROFILES }; static const char *const icc_std_profile_keys[] = { GSICC_STANDARD_PROFILES_KEYS }; /* verify the DataSource entry */ if (dict_find_string(ICCdict, "DataSource", &pstrmval) <= 0) return_error(gs_error_undefined); check_read_file(i_ctx_p, s, pstrmval); /* build the color space object */ code = gs_cspace_build_ICC(&pcs, NULL, gs_gstate_memory(igs)); if (code < 0) return gs_rethrow(code, "building color space object"); /* For now, dump the profile into a buffer and obtain handle from the buffer when we need it. We may want to change this later. This depends to some degree on what the CMS is capable of doing. I don't want to get bogged down on stream I/O at this point. Note also, if we are going to be putting these into the clist we will want to have this buffer. */ /* Check if we have the /Name entry. This is used to associate with specs that have enumerated types to indicate sRGB sGray etc */ if (dict_find_string(ICCdict, "Name", &pnameval) > 0){ uint size = r_size(pnameval); char *str = (char *)gs_alloc_bytes(gs_gstate_memory(igs), size+1, "seticc"); memcpy(str, (const char *)pnameval->value.bytes, size); str[size] = 0; /* Compare this to the standard profile names */ for (k = 0; k < GSICC_NUMBER_STANDARD_PROFILES; k++) { if ( strcmp( str, icc_std_profile_keys[k] ) == 0 ) { picc_profile = gsicc_get_profile_handle_file(icc_std_profile_names[k], strlen(icc_std_profile_names[k]), gs_gstate_memory(igs)); break; } } gs_free_object(gs_gstate_memory(igs), str, "seticc"); } else { picc_profile = gsicc_profile_new(s, gs_gstate_memory(igs), NULL, 0); if (picc_profile == NULL) return gs_throw(gs_error_VMerror, "Creation of ICC profile failed"); /* We have to get the profile handle due to the fact that we need to know if it has a data space that is CIELAB */ picc_profile->profile_handle = gsicc_get_profile_handle_buffer(picc_profile->buffer, picc_profile->buffer_size, gs_gstate_memory(igs)); } if (picc_profile == NULL || picc_profile->profile_handle == NULL) { /* Free up everything, the profile is not valid. We will end up going ahead and using a default based upon the number of components */ rc_decrement(picc_profile,"seticc"); rc_decrement(pcs,"seticc"); return -1; } code = gsicc_set_gscs_profile(pcs, picc_profile, gs_gstate_memory(igs)); if (code < 0) { rc_decrement(picc_profile,"seticc"); rc_decrement(pcs,"seticc"); return code; } picc_profile->num_comps = ncomps; picc_profile->data_cs = gscms_get_profile_data_space(picc_profile->profile_handle, picc_profile->memory); switch (picc_profile->data_cs) { case gsCIEXYZ: case gsCIELAB: case gsRGB: expected = 3; break; case gsGRAY: expected = 1; break; case gsCMYK: expected = 4; break; case gsNCHANNEL: case gsNAMED: /* Silence warnings */ case gsUNDEFINED: /* Silence warnings */ break; } if (!expected || ncomps != expected) { rc_decrement(picc_profile,"seticc"); rc_decrement(pcs,"seticc"); return_error(gs_error_rangecheck); } /* Lets go ahead and get the hash code and check if we match one of the default spaces */ /* Later we may want to delay this, but for now lets go ahead and do it */ gsicc_init_hash_cs(picc_profile, igs); /* Set the range according to the data type that is associated with the ICC input color type. Occasionally, we will run into CIELAB to CIELAB profiles for spot colors in PDF documents. These spot colors are typically described as separation colors with tint transforms that go from a tint value to a linear mapping between the CIELAB white point and the CIELAB tint color. This results in a CIELAB value that we need to use to fill. We need to detect this to make sure we do the proper scaling of the data. For CIELAB images in PDF, the source is always normal 8 or 16 bit encoded data in the range from 0 to 255 or 0 to 65535. In that case, there should not be any encoding and decoding to CIELAB. The PDF content will not include an ICC profile but will set the color space to \Lab. In this case, we use our seticc_lab operation to install the LAB to LAB profile, but we detect that we did that through the use of the is_lab flag in the profile descriptor. When then avoid the CIELAB encode and decode */ if (picc_profile->data_cs == gsCIELAB) { /* If the input space to this profile is CIELAB, then we need to adjust the limits */ /* See ICC spec ICC.1:2004-10 Section 6.3.4.2 and 6.4. I don't believe we need to worry about CIEXYZ profiles or any of the other odds ones. Need to check that though at some point. */ picc_profile->Range.ranges[0].rmin = 0.0; picc_profile->Range.ranges[0].rmax = 100.0; picc_profile->Range.ranges[1].rmin = -128.0; picc_profile->Range.ranges[1].rmax = 127.0; picc_profile->Range.ranges[2].rmin = -128.0; picc_profile->Range.ranges[2].rmax = 127.0; picc_profile->islab = true; } else { for (i = 0; i < ncomps; i++) { picc_profile->Range.ranges[i].rmin = range_buff[2 * i]; picc_profile->Range.ranges[i].rmax = range_buff[2 * i + 1]; } } /* Now see if we are in an overide situation. We have to wait until now in case this is an LAB profile which we will not overide */ if (gs_currentoverrideicc(igs) && picc_profile->data_cs != gsCIELAB) { /* Free up the profile structure */ switch( picc_profile->data_cs ) { case gsRGB: pcs->cmm_icc_profile_data = igs->icc_manager->default_rgb; break; case gsGRAY: pcs->cmm_icc_profile_data = igs->icc_manager->default_gray; break; case gsCMYK: pcs->cmm_icc_profile_data = igs->icc_manager->default_cmyk; break; default: break; } /* Have one increment from the color space. Having these tied together is not really correct. Need to fix that. ToDo. MJV */ rc_adjust(picc_profile, -2, "seticc"); rc_increment(pcs->cmm_icc_profile_data); } /* Set the color space. We are done. No joint cache here... */ code = gs_setcolorspace(igs, pcs); /* The context has taken a reference to the colorspace. We no longer need * ours, so drop it. */ rc_decrement_only(pcs, "seticc"); /* In this case, we already have a ref count of 2 on the icc profile one for when it was created and one for when it was set. We really only want one here so adjust */ rc_decrement(picc_profile,"seticc"); /* Remove the ICC dict from the stack */ pop(1); return code; }
C
ghostscript
1
CVE-2018-20456
https://www.cvedetails.com/cve/CVE-2018-20456/
CWE-125
https://github.com/radare/radare2/commit/9b46d38dd3c4de6048a488b655c7319f845af185
9b46d38dd3c4de6048a488b655c7319f845af185
Fix #12372 and #12373 - Crash in x86 assembler (#12380) 0 ,0,[bP-bL-bP-bL-bL-r-bL-bP-bL-bL- mov ,0,[ax+Bx-ax+Bx-ax+ax+Bx-ax+Bx-- leA ,0,[bP-bL-bL-bP-bL-bP-bL-60@bL- leA ,0,[bP-bL-r-bP-bL-bP-bL-60@bL- mov ,0,[ax+Bx-ax+Bx-ax+ax+Bx-ax+Bx--
static int opadd(RAsm *a, ut8 *data, const Opcode *op) { if (op->operands[1].type & OT_CONSTANT) { if (op->operands[0].type & OT_GPREG && op->operands[0].type & OT_WORD) { return process_16bit_group_1 (a, data, op, 0x00); } if (!is_al_reg (&op->operands[0])) { return process_group_1 (a, data, op); } } return process_1byte_op (a, data, op, 0x00); }
static int opadd(RAsm *a, ut8 *data, const Opcode *op) { if (op->operands[1].type & OT_CONSTANT) { if (op->operands[0].type & OT_GPREG && op->operands[0].type & OT_WORD) { return process_16bit_group_1 (a, data, op, 0x00); } if (!is_al_reg (&op->operands[0])) { return process_group_1 (a, data, op); } } return process_1byte_op (a, data, op, 0x00); }
C
radare2
0
CVE-2014-3173
https://www.cvedetails.com/cve/CVE-2014-3173/
CWE-119
https://github.com/chromium/chromium/commit/ee7579229ff7e9e5ae28bf53aea069251499d7da
ee7579229ff7e9e5ae28bf53aea069251499d7da
Framebuffer clear() needs to consider the situation some draw buffers are disabled. This is when we expose DrawBuffers extension. BUG=376951 TEST=the attached test case, webgl conformance [email protected],[email protected] Review URL: https://codereview.chromium.org/315283002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@275338 0039d316-1c4b-4281-b951-d872f2087c98
void GLES2DecoderImpl::DoTexStorage2DEXT( GLenum target, GLint levels, GLenum internal_format, GLsizei width, GLsizei height) { TRACE_EVENT2("gpu", "GLES2DecoderImpl::DoTexStorage2DEXT", "width", width, "height", height); if (!texture_manager()->ValidForTarget(target, 0, width, height, 1) || TextureManager::ComputeMipMapCount(target, width, height, 1) < levels) { LOCAL_SET_GL_ERROR( GL_INVALID_VALUE, "glTexStorage2DEXT", "dimensions out of range"); return; } TextureRef* texture_ref = texture_manager()->GetTextureInfoForTarget( &state_, target); if (!texture_ref) { LOCAL_SET_GL_ERROR( GL_INVALID_OPERATION, "glTexStorage2DEXT", "unknown texture for target"); return; } Texture* texture = texture_ref->texture(); if (texture->IsAttachedToFramebuffer()) { framebuffer_state_.clear_state_dirty = true; } if (texture->IsImmutable()) { LOCAL_SET_GL_ERROR( GL_INVALID_OPERATION, "glTexStorage2DEXT", "texture is immutable"); return; } GLenum format = ExtractFormatFromStorageFormat(internal_format); GLenum type = ExtractTypeFromStorageFormat(internal_format); { GLsizei level_width = width; GLsizei level_height = height; uint32 estimated_size = 0; for (int ii = 0; ii < levels; ++ii) { uint32 level_size = 0; if (!GLES2Util::ComputeImageDataSizes( level_width, level_height, format, type, state_.unpack_alignment, &estimated_size, NULL, NULL) || !SafeAddUint32(estimated_size, level_size, &estimated_size)) { LOCAL_SET_GL_ERROR( GL_OUT_OF_MEMORY, "glTexStorage2DEXT", "dimensions too large"); return; } level_width = std::max(1, level_width >> 1); level_height = std::max(1, level_height >> 1); } if (!EnsureGPUMemoryAvailable(estimated_size)) { LOCAL_SET_GL_ERROR( GL_OUT_OF_MEMORY, "glTexStorage2DEXT", "out of memory"); return; } } LOCAL_COPY_REAL_GL_ERRORS_TO_WRAPPER("glTexStorage2DEXT"); glTexStorage2DEXT(target, levels, internal_format, width, height); GLenum error = LOCAL_PEEK_GL_ERROR("glTexStorage2DEXT"); if (error == GL_NO_ERROR) { GLsizei level_width = width; GLsizei level_height = height; for (int ii = 0; ii < levels; ++ii) { texture_manager()->SetLevelInfo( texture_ref, target, ii, format, level_width, level_height, 1, 0, format, type, false); level_width = std::max(1, level_width >> 1); level_height = std::max(1, level_height >> 1); } texture->SetImmutable(true); } }
void GLES2DecoderImpl::DoTexStorage2DEXT( GLenum target, GLint levels, GLenum internal_format, GLsizei width, GLsizei height) { TRACE_EVENT2("gpu", "GLES2DecoderImpl::DoTexStorage2DEXT", "width", width, "height", height); if (!texture_manager()->ValidForTarget(target, 0, width, height, 1) || TextureManager::ComputeMipMapCount(target, width, height, 1) < levels) { LOCAL_SET_GL_ERROR( GL_INVALID_VALUE, "glTexStorage2DEXT", "dimensions out of range"); return; } TextureRef* texture_ref = texture_manager()->GetTextureInfoForTarget( &state_, target); if (!texture_ref) { LOCAL_SET_GL_ERROR( GL_INVALID_OPERATION, "glTexStorage2DEXT", "unknown texture for target"); return; } Texture* texture = texture_ref->texture(); if (texture->IsAttachedToFramebuffer()) { framebuffer_state_.clear_state_dirty = true; } if (texture->IsImmutable()) { LOCAL_SET_GL_ERROR( GL_INVALID_OPERATION, "glTexStorage2DEXT", "texture is immutable"); return; } GLenum format = ExtractFormatFromStorageFormat(internal_format); GLenum type = ExtractTypeFromStorageFormat(internal_format); { GLsizei level_width = width; GLsizei level_height = height; uint32 estimated_size = 0; for (int ii = 0; ii < levels; ++ii) { uint32 level_size = 0; if (!GLES2Util::ComputeImageDataSizes( level_width, level_height, format, type, state_.unpack_alignment, &estimated_size, NULL, NULL) || !SafeAddUint32(estimated_size, level_size, &estimated_size)) { LOCAL_SET_GL_ERROR( GL_OUT_OF_MEMORY, "glTexStorage2DEXT", "dimensions too large"); return; } level_width = std::max(1, level_width >> 1); level_height = std::max(1, level_height >> 1); } if (!EnsureGPUMemoryAvailable(estimated_size)) { LOCAL_SET_GL_ERROR( GL_OUT_OF_MEMORY, "glTexStorage2DEXT", "out of memory"); return; } } LOCAL_COPY_REAL_GL_ERRORS_TO_WRAPPER("glTexStorage2DEXT"); glTexStorage2DEXT(target, levels, internal_format, width, height); GLenum error = LOCAL_PEEK_GL_ERROR("glTexStorage2DEXT"); if (error == GL_NO_ERROR) { GLsizei level_width = width; GLsizei level_height = height; for (int ii = 0; ii < levels; ++ii) { texture_manager()->SetLevelInfo( texture_ref, target, ii, format, level_width, level_height, 1, 0, format, type, false); level_width = std::max(1, level_width >> 1); level_height = std::max(1, level_height >> 1); } texture->SetImmutable(true); } }
C
Chrome
0
CVE-2018-12714
https://www.cvedetails.com/cve/CVE-2018-12714/
CWE-787
https://github.com/torvalds/linux/commit/81f9c4e4177d31ced6f52a89bb70e93bfb77ca03
81f9c4e4177d31ced6f52a89bb70e93bfb77ca03
Merge tag 'trace-v4.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace Pull tracing fixes from Steven Rostedt: "This contains a few fixes and a clean up. - a bad merge caused an "endif" to go in the wrong place in scripts/Makefile.build - softirq tracing fix for tracing that corrupts lockdep and causes a false splat - histogram documentation typo fixes - fix a bad memory reference when passing in no filter to the filter code - simplify code by using the swap macro instead of open coding the swap" * tag 'trace-v4.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace: tracing: Fix SKIP_STACK_VALIDATION=1 build due to bad merge with -mrecord-mcount tracing: Fix some errors in histogram documentation tracing: Use swap macro in update_max_tr softirq: Reorder trace_softirqs_on to prevent lockdep splat tracing: Check for no filter when processing event filters
static int __init set_cmdline_ftrace(char *str) { strlcpy(bootup_tracer_buf, str, MAX_TRACER_SIZE); default_bootup_tracer = bootup_tracer_buf; /* We are using ftrace early, expand it */ ring_buffer_expanded = true; return 1; }
static int __init set_cmdline_ftrace(char *str) { strlcpy(bootup_tracer_buf, str, MAX_TRACER_SIZE); default_bootup_tracer = bootup_tracer_buf; /* We are using ftrace early, expand it */ ring_buffer_expanded = true; return 1; }
C
linux
0
CVE-2017-9059
https://www.cvedetails.com/cve/CVE-2017-9059/
CWE-404
https://github.com/torvalds/linux/commit/c70422f760c120480fee4de6c38804c72aa26bc1
c70422f760c120480fee4de6c38804c72aa26bc1
Merge tag 'nfsd-4.12' of git://linux-nfs.org/~bfields/linux Pull nfsd updates from Bruce Fields: "Another RDMA update from Chuck Lever, and a bunch of miscellaneous bugfixes" * tag 'nfsd-4.12' of git://linux-nfs.org/~bfields/linux: (26 commits) nfsd: Fix up the "supattr_exclcreat" attributes nfsd: encoders mustn't use unitialized values in error cases nfsd: fix undefined behavior in nfsd4_layout_verify lockd: fix lockd shutdown race NFSv4: Fix callback server shutdown SUNRPC: Refactor svc_set_num_threads() NFSv4.x/callback: Create the callback service through svc_create_pooled lockd: remove redundant check on block svcrdma: Clean out old XDR encoders svcrdma: Remove the req_map cache svcrdma: Remove unused RDMA Write completion handler svcrdma: Reduce size of sge array in struct svc_rdma_op_ctxt svcrdma: Clean up RPC-over-RDMA backchannel reply processing svcrdma: Report Write/Reply chunk overruns svcrdma: Clean up RDMA_ERROR path svcrdma: Use rdma_rw API in RPC reply path svcrdma: Introduce local rdma_rw API helpers svcrdma: Clean up svc_rdma_get_inv_rkey() svcrdma: Add helper to save pages under I/O svcrdma: Eliminate RPCRDMA_SQ_DEPTH_MULT ...
nfsd4_decode_seek(struct nfsd4_compoundargs *argp, struct nfsd4_seek *seek) { DECODE_HEAD; status = nfsd4_decode_stateid(argp, &seek->seek_stateid); if (status) return status; READ_BUF(8 + 4); p = xdr_decode_hyper(p, &seek->seek_offset); seek->seek_whence = be32_to_cpup(p); DECODE_TAIL; }
nfsd4_decode_seek(struct nfsd4_compoundargs *argp, struct nfsd4_seek *seek) { DECODE_HEAD; status = nfsd4_decode_stateid(argp, &seek->seek_stateid); if (status) return status; READ_BUF(8 + 4); p = xdr_decode_hyper(p, &seek->seek_offset); seek->seek_whence = be32_to_cpup(p); DECODE_TAIL; }
C
linux
0
CVE-2018-17204
https://www.cvedetails.com/cve/CVE-2018-17204/
CWE-617
https://github.com/openvswitch/ovs/commit/4af6da3b275b764b1afe194df6499b33d2bf4cde
4af6da3b275b764b1afe194df6499b33d2bf4cde
ofp-group: Don't assert-fail decoding bad OF1.5 group mod type or command. When decoding a group mod, the current code validates the group type and command after the whole group mod has been decoded. The OF1.5 decoder, however, tries to use the type and command earlier, when it might still be invalid. This caused an assertion failure (via OVS_NOT_REACHED). This commit fixes the problem. ovs-vswitchd does not enable support for OpenFlow 1.5 by default. Reported-at: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=9249 Signed-off-by: Ben Pfaff <[email protected]> Reviewed-by: Yifeng Sun <[email protected]>
ofputil_put_group_prop_ntr_selection_method(enum ofp_version ofp_version, const struct ofputil_group_props *gp, struct ofpbuf *openflow) { struct ntr_group_prop_selection_method *prop; size_t start; start = openflow->size; ofpbuf_put_zeros(openflow, sizeof *prop); oxm_put_field_array(openflow, &gp->fields, ofp_version); prop = ofpbuf_at_assert(openflow, start, sizeof *prop); prop->type = htons(OFPGPT15_EXPERIMENTER); prop->experimenter = htonl(NTR_VENDOR_ID); prop->exp_type = htonl(NTRT_SELECTION_METHOD); strcpy(prop->selection_method, gp->selection_method); prop->selection_method_param = htonll(gp->selection_method_param); ofpprop_end(openflow, start); }
ofputil_put_group_prop_ntr_selection_method(enum ofp_version ofp_version, const struct ofputil_group_props *gp, struct ofpbuf *openflow) { struct ntr_group_prop_selection_method *prop; size_t start; start = openflow->size; ofpbuf_put_zeros(openflow, sizeof *prop); oxm_put_field_array(openflow, &gp->fields, ofp_version); prop = ofpbuf_at_assert(openflow, start, sizeof *prop); prop->type = htons(OFPGPT15_EXPERIMENTER); prop->experimenter = htonl(NTR_VENDOR_ID); prop->exp_type = htonl(NTRT_SELECTION_METHOD); strcpy(prop->selection_method, gp->selection_method); prop->selection_method_param = htonll(gp->selection_method_param); ofpprop_end(openflow, start); }
C
ovs
0
CVE-2014-3515
https://www.cvedetails.com/cve/CVE-2014-3515/
null
https://git.php.net/?p=php-src.git;a=commit;h=88223c5245e9b470e1e6362bfd96829562ffe6ab
88223c5245e9b470e1e6362bfd96829562ffe6ab
null
zend_object_iterator *spl_array_get_iterator(zend_class_entry *ce, zval *object, int by_ref TSRMLS_DC) /* {{{ */ { spl_array_it *iterator; spl_array_object *array_object = (spl_array_object*)zend_object_store_get_object(object TSRMLS_CC); if (by_ref && (array_object->ar_flags & SPL_ARRAY_OVERLOADED_CURRENT)) { zend_error(E_ERROR, "An iterator cannot be used with foreach by reference"); } iterator = emalloc(sizeof(spl_array_it)); Z_ADDREF_P(object); iterator->intern.it.data = (void*)object; iterator->intern.it.funcs = &spl_array_it_funcs; iterator->intern.ce = ce; iterator->intern.value = NULL; iterator->object = array_object; return (zend_object_iterator*)iterator; } /* }}} */
zend_object_iterator *spl_array_get_iterator(zend_class_entry *ce, zval *object, int by_ref TSRMLS_DC) /* {{{ */ { spl_array_it *iterator; spl_array_object *array_object = (spl_array_object*)zend_object_store_get_object(object TSRMLS_CC); if (by_ref && (array_object->ar_flags & SPL_ARRAY_OVERLOADED_CURRENT)) { zend_error(E_ERROR, "An iterator cannot be used with foreach by reference"); } iterator = emalloc(sizeof(spl_array_it)); Z_ADDREF_P(object); iterator->intern.it.data = (void*)object; iterator->intern.it.funcs = &spl_array_it_funcs; iterator->intern.ce = ce; iterator->intern.value = NULL; iterator->object = array_object; return (zend_object_iterator*)iterator; } /* }}} */
C
php
0
CVE-2013-2884
https://www.cvedetails.com/cve/CVE-2013-2884/
CWE-399
https://github.com/chromium/chromium/commit/4ac8bc08e3306f38a5ab3e551aef6ad43753579c
4ac8bc08e3306f38a5ab3e551aef6ad43753579c
Set Attr.ownerDocument in Element#setAttributeNode() Attr objects can move across documents by setAttributeNode(). So It needs to reset ownerDocument through TreeScopeAdoptr::adoptIfNeeded(). BUG=248950 TEST=set-attribute-node-from-iframe.html Review URL: https://chromiumcodereview.appspot.com/17583003 git-svn-id: svn://svn.chromium.org/blink/trunk@152938 bbb929c8-8fbe-4397-9dbb-9b2b20218538
~StyleResolverParentPusher() { if (!m_pushedStyleResolver) return; ASSERT(m_pushedStyleResolver == m_parent->document()->styleResolver()); if (m_pushedStyleResolver != m_parent->document()->styleResolver()) return; m_pushedStyleResolver->popParentElement(m_parent); }
~StyleResolverParentPusher() { if (!m_pushedStyleResolver) return; ASSERT(m_pushedStyleResolver == m_parent->document()->styleResolver()); if (m_pushedStyleResolver != m_parent->document()->styleResolver()) return; m_pushedStyleResolver->popParentElement(m_parent); }
C
Chrome
0
CVE-2018-6135
https://www.cvedetails.com/cve/CVE-2018-6135/
null
https://github.com/chromium/chromium/commit/2ccbb407dccc976ae4bdbaa5ff2f777f4eb0723b
2ccbb407dccc976ae4bdbaa5ff2f777f4eb0723b
Force a flush of drawing to the widget when a dialog is shown. BUG=823353 TEST=as in bug Change-Id: I5da777068fc29c5638ef02d50e59d5d7b2729260 Reviewed-on: https://chromium-review.googlesource.com/971661 Reviewed-by: Ken Buchanan <[email protected]> Commit-Queue: Avi Drissman <[email protected]> Cr-Commit-Position: refs/heads/master@{#544518}
void RenderWidgetHostImpl::SetForceEnableZoom(bool enabled) { input_router_->SetForceEnableZoom(enabled); }
void RenderWidgetHostImpl::SetForceEnableZoom(bool enabled) { input_router_->SetForceEnableZoom(enabled); }
C
Chrome
0
CVE-2015-6787
https://www.cvedetails.com/cve/CVE-2015-6787/
null
https://github.com/chromium/chromium/commit/f911e11e7f6b5c0d6f5ee694a9871de6619889f7
f911e11e7f6b5c0d6f5ee694a9871de6619889f7
Reland "[CI] Make paint property nodes non-ref-counted" This reverts commit 887383b30842d9d9006e11bb6932660a3cb5b1b7. Reason for revert: Retry in M69. Original change's description: > Revert "[CI] Make paint property nodes non-ref-counted" > > This reverts commit 70fc0b018c9517558b7aa2be00edf2debb449123. > > Reason for revert: Caused bugs found by clusterfuzz > > Original change's description: > > [CI] Make paint property nodes non-ref-counted > > > > Now all paint property nodes are owned by ObjectPaintProperties > > (and LocalFrameView temporarily before removing non-RLS mode). > > Others just use raw pointers or references. > > > > Bug: 833496 > > Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2 > > Change-Id: I2d544fe153bb94698623248748df63c8aa2081ae > > Reviewed-on: https://chromium-review.googlesource.com/1031101 > > Reviewed-by: Tien-Ren Chen <[email protected]> > > Commit-Queue: Xianzhu Wang <[email protected]> > > Cr-Commit-Position: refs/heads/master@{#554626} > > [email protected],[email protected],[email protected] > > Change-Id: I02bb50d6744cb81a797246a0116b677e80a3c69f > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: 833496,837932,837943 > Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2 > Reviewed-on: https://chromium-review.googlesource.com/1034292 > Reviewed-by: Xianzhu Wang <[email protected]> > Commit-Queue: Xianzhu Wang <[email protected]> > Cr-Commit-Position: refs/heads/master@{#554653} [email protected],[email protected],[email protected] # Not skipping CQ checks because original CL landed > 1 day ago. Bug: 833496, 837932, 837943 Change-Id: I0b4ef70db1f1f211ba97c30d617225355c750992 Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2 Reviewed-on: https://chromium-review.googlesource.com/1083491 Commit-Queue: Xianzhu Wang <[email protected]> Reviewed-by: Xianzhu Wang <[email protected]> Cr-Commit-Position: refs/heads/master@{#563930}
TestPaintArtifact& TestPaintArtifact::Chunk( const PropertyTreeState& properties) { return Chunk(NewClient(), properties); }
TestPaintArtifact& TestPaintArtifact::Chunk( const PropertyTreeState& properties) { return Chunk(NewClient(), properties); }
C
Chrome
0