diff
stringlengths
136
4.7k
msg
stringlengths
9
207
--- tools/tpm2_hmac.c +++ tools/tpm2_hmac.c @@ -208,7 +208,7 @@ static bool init(int argc, char *argv[], tpm_hmac_ctx *ctx) { } /* - * Options g, i, o must be specified and k or c must be specified. + * Options g, I, o must be specified and k or c must be specified. */ if (!((flags.k || flags.c) && flags.I && flags.o && flags.g)) { LOG_ERR("Must specify options g, i, o and k or c");
tpm2_hmac: fix option comment
--- tools/tpm2_getmanufec.c +++ tools/tpm2_getmanufec.c @@ -235,6 +235,12 @@ int createEKHandle(TSS2_SYS_CONTEXT *sapi_context) LOG_INFO("EK create succ.. Handle: 0x%8.8x", handle2048ek); if (!ctx.non_persistent_read) { + + if (!ctx.persistent_handle) { + LOG_ERR("Persistent handle for EK was not provided"); + return 1; + } + /* * To make EK persistent, use own auth */
tpm2_getmanufec: only attempt to persist the EK if a handle was provided
--- tools/tpm2_import.c +++ tools/tpm2_import.c @@ -161,6 +161,7 @@ static bool encrypt_seed_with_tpm2_rsa_public_key(void) { return false; } return_code = RSA_generate_key_ex(rsa, 2048, bne, NULL); + BN_free(bne); if (return_code != 1) { LOG_ERR("RSA_generate_key_ex failed\n"); return false; @@ -178,7 +179,6 @@ static bool encrypt_seed_with_tpm2_rsa_public_key(void) { LOG_ERR("Failed RSA_public_encrypt\n"); } RSA_free(rsa); - BN_free(bne); return true; }
tpm2_import: free exponent BIGNUM after RSA_generate_key_ex() call
--- tools/tpm2_verifysignature.c +++ tools/tpm2_verifysignature.c @@ -194,6 +194,14 @@ static bool init(tpm2_verifysig_ctx *ctx) { /* If no digest is specified, compute it */ if (!ctx->flags.digest) { + if (!ctx->flags.msg) { + /* + * This is a redundant check since main() checks this case, but we'll add it here to silence any + * complainers. + */ + LOG_ERR("No digest set and no message file to compute from, cannot compute message hash!"); + goto err; + } int rc = tpm_hash_compute_data(ctx->sapi_context, msg->buffer, msg->size, ctx->halg, &ctx->msgHash); if (rc) {
tpm2_verifysignature: ensure msg is not null
--- lib/tpm2_tcti_ldr.c +++ lib/tpm2_tcti_ldr.c @@ -55,7 +55,7 @@ const TSS2_TCTI_INFO *tpm2_tcti_ldr_getinfo(void) { bool tpm2_tcti_ldr_is_tcti_present(const char *name) { char path[PATH_MAX]; - snprintf(path, sizeof(path), "libtss2-tcti-%s.so", name); + snprintf(path, sizeof(path), "libtss2-tcti-%s.so.0", name); void *handle = dlopen (path, RTLD_LAZY); if (handle) {
tcti_ldr: load a specific so version
--- ldap/servers/slapd/back-ldbm/ldbm_bind.c +++ ldap/servers/slapd/back-ldbm/ldbm_bind.c @@ -76,8 +76,8 @@ ldbm_back_bind(Slapi_PBlock *pb) case LDAP_AUTH_SIMPLE: { Slapi_Value cv; if (slapi_entry_attr_find(e->ep_entry, "userpassword", &attr) != 0) { - slapi_send_ldap_result(pb, LDAP_INAPPROPRIATE_AUTH, NULL, - NULL, 0, NULL); + slapi_pblock_set(pb, SLAPI_PB_RESULT_TEXT, "Entry does not have userpassword set"); + slapi_send_ldap_result(pb, LDAP_INVALID_CREDENTIALS, NULL, NULL, 0, NULL); CACHE_RETURN(&inst->inst_cache, &e); rc = SLAPI_BIND_FAIL; goto bail; --- ldap/servers/slapd/dse.c +++ ldap/servers/slapd/dse.c @@ -1446,7 +1446,8 @@ dse_bind(Slapi_PBlock *pb) /* JCM There should only be one exit point from this ec = dse_get_entry_copy(pdse, sdn, DSE_USE_LOCK); if (ec == NULL) { - slapi_send_ldap_result(pb, LDAP_NO_SUCH_OBJECT, NULL, NULL, 0, NULL); + slapi_pblock_set(pb, SLAPI_PB_RESULT_TEXT, "Entry does not exist"); + slapi_send_ldap_result(pb, LDAP_INVALID_CREDENTIALS, NULL, NULL, 0, NULL); return (SLAPI_BIND_FAIL); } @@ -1454,7 +1455,8 @@ dse_bind(Slapi_PBlock *pb) /* JCM There should only be one exit point from this case LDAP_AUTH_SIMPLE: { Slapi_Value cv; if (slapi_entry_attr_find(ec, "userpassword", &attr) != 0) { - slapi_send_ldap_result(pb, LDAP_INAPPROPRIATE_AUTH, NULL, NULL, 0, NULL); + slapi_pblock_set(pb, SLAPI_PB_RESULT_TEXT, "Entry does not have userpassword set"); + slapi_send_ldap_result(pb, LDAP_INVALID_CREDENTIALS, NULL, NULL, 0, NULL); slapi_entry_free(ec); return SLAPI_BIND_FAIL; } @@ -1462,6 +1464,7 @@ dse_bind(Slapi_PBlock *pb) /* JCM There should only be one exit point from this slapi_value_init_berval(&cv, cred); if (slapi_pw_find_sv(bvals, &cv) != 0) { + slapi_pblock_set(pb, SLAPI_PB_RESULT_TEXT, "Invalid credentials"); slapi_send_ldap_result(pb, LDAP_INVALID_CREDENTIALS, NULL, NULL, 0, NULL); slapi_entry_free(ec); value_done(&cv);
Issue 4609 - CVE - info disclosure when authenticating
--- ldap/servers/slapd/back-ldbm/ldbm_config.c +++ ldap/servers/slapd/back-ldbm/ldbm_config.c @@ -1243,7 +1243,7 @@ ldbm_config_search_entry_callback(Slapi_PBlock *pb __attribute__((unused)), if (attrs) { for (size_t i = 0; attrs[i]; i++) { if (ldbm_config_moved_attr(attrs[i])) { - slapi_pblock_set(pb, SLAPI_PB_RESULT_TEXT, "at least one required attribute has been moved to the BDB scecific configuration entry"); + slapi_pblock_set(pb, SLAPI_RESULT_TEXT, "at least one required attribute has been moved to the BDB scecific configuration entry"); break; } } --- ldap/servers/slapd/result.c +++ ldap/servers/slapd/result.c @@ -355,7 +355,7 @@ send_ldap_result_ext( if (text) { pbtext = text; } else { - slapi_pblock_get(pb, SLAPI_PB_RESULT_TEXT, &pbtext); + slapi_pblock_get(pb, SLAPI_RESULT_TEXT, &pbtext); } if (operation == NULL) {
Issue 4480 - Unexpected info returned to ldap request (#4491)
--- lib/Plugins/CCpp.cpp +++ lib/Plugins/CCpp.cpp @@ -295,14 +295,17 @@ void CAnalyzerCCpp::GetIndependentBuldIdPC(const std::string& pBuildIdPC, std::s line += pBuildIdPC[ii]; ii++; } - while (!isspace(line[jj]) && jj < line.length()) + while (line[jj] != '+' && jj < line.length()) { jj++; } jj++; - while (!isspace(line[jj]) && jj < line.length()) + while (line[jj] != '@' && jj < line.length()) { - pIndependentBuildIdPC += line[jj]; + if (!isspace(line[jj])) + { + pIndependentBuildIdPC += line[jj]; + } jj++; } ii++;
fixed local UUID
--- src/hooks/abrt-hook-ccpp.c +++ src/hooks/abrt-hook-ccpp.c @@ -721,6 +721,14 @@ int main(int argc, char** argv) dd_save_text(dd, FILENAME_ENVIRON, environ ? : ""); free(environ); + char *fips_enabled = xmalloc_fopen_fgetline_fclose("/proc/sys/crypto/fips_enabled"); + if (fips_enabled) + { + if (strcmp(fips_enabled, "0") != 0) + dd_save_text(dd, "fips_enabled", fips_enabled); + free(fips_enabled); + } + dd_save_text(dd, FILENAME_ABRT_VERSION, VERSION); if (src_fd_binary > 0)
abrt-hook-ccpp: save /proc/sys/crypto/fips_enabled value if it isn't "0". Closes rhbz#747870
--- src/hooks/abrt-hook-ccpp.c +++ src/hooks/abrt-hook-ccpp.c @@ -795,6 +795,8 @@ int main(int argc, char** argv) unlink(core_basename); } +/* Because of #1211835 and #1126850 */ +#if 0 /* Save JVM crash log if it exists. (JVM's coredump per se * is nearly useless for JVM developers) */ @@ -827,6 +829,7 @@ int main(int argc, char** argv) close(src_fd); } } +#endif /* We close dumpdir before we start catering for crash storm case. * Otherwise, delete_dump_dir's from other concurrent
ccpp: stop reading hs_error.log from /tmp
--- src/Hooks/abrt-hook-ccpp.cpp +++ src/Hooks/abrt-hook-ccpp.cpp @@ -137,7 +137,15 @@ static char* get_executable(pid_t pid) char buf[sizeof("/proc/%lu/exe") + sizeof(long)*3]; sprintf(buf, "/proc/%lu/exe", (long)pid); - return malloc_readlink(buf); + char *executable = malloc_readlink(buf); + /* find and cut off " (deleted)" from the path */ + char *deleted = executable + strlen(executable) - strlen(" (deleted)"); + if (deleted > executable && strcmp(deleted, " (deleted)") == 0) + { + *deleted = '\0'; + log("file %s seems to be deleted", executable); + } + return executable; } static char* get_cwd(pid_t pid)
remove "(deleted)" from executable path rhbz#593037
--- src/hooks/abrt-hook-ccpp.c +++ src/hooks/abrt-hook-ccpp.c @@ -116,6 +116,8 @@ static off_t copyfd_sparse(int src_fd, int dst_fd1, int dst_fd2, off_t size2) size2 -= rd; if (size2 < 0) dst_fd2 = -1; +//TODO: truncate to 0 or even delete the second file +//(currently we delete the file later) } out:
abrt-hook-ccpp: added a TODO comment. No code changes
--- src/hooks/abrt-hook-ccpp.c +++ src/hooks/abrt-hook-ccpp.c @@ -718,7 +718,8 @@ int main(int argc, char** argv) if (snprintf(path, sizeof(path), "%s/%s-coredump", g_settings_dump_location, last_slash) >= sizeof(path)) error_msg_and_die("Error saving '%s': truncated long file path", path); - int abrt_core_fd = xopen3(path, O_WRONLY | O_CREAT | O_TRUNC, 0600); + unlink(path); + int abrt_core_fd = xopen3(path, O_WRONLY | O_CREAT | O_EXCL, 0600); off_t core_size = copyfd_eof(STDIN_FILENO, abrt_core_fd, COPYFD_SPARSE); if (core_size < 0 || fsync(abrt_core_fd) != 0) {
ccpp: save abrt core files only to new files
--- src/hooks/abrt-hook-ccpp.c +++ src/hooks/abrt-hook-ccpp.c @@ -678,7 +678,7 @@ int main(int argc, char** argv) { char *rootdir = get_rootdir(pid); - dd_create_basic_files(dd, fsuid, (rootdir && strcmp(rootdir, "/") != 0) ? rootdir : NULL); + dd_create_basic_files(dd, fsuid, NULL); char source_filename[sizeof("/proc/%lu/somewhat_long_name") + sizeof(long)*3]; int source_base_ofs = sprintf(source_filename, "/proc/%lu/smaps", (long)pid);
ccpp: do not read data from root directories
--- src/Daemon/Daemon.cpp +++ src/Daemon/Daemon.cpp @@ -810,6 +810,7 @@ int main(int argc, char** argv) int inotify_fd = inotify_init(); if (inotify_fd == -1) perror_msg_and_die("inotify_init failed"); + close_on_exec_on(inotify_fd); if (inotify_add_watch(inotify_fd, DEBUG_DUMPS_DIR, IN_CREATE | IN_MOVED_TO) == -1) perror_msg_and_die("inotify_add_watch failed on '%s'", DEBUG_DUMPS_DIR);
trivial: close inotify_fd on exec
--- src/applet/applet.c +++ src/applet/applet.c @@ -195,7 +195,7 @@ static bool problem_info_ensure_writable(problem_info_t *pi) static problem_info_t *problem_info_new(const char *dir) { - problem_info_t *pi = xzalloc(sizeof(*pi)); + problem_info_t *pi = g_new0(problem_info_t, 1); pi->problem_data = problem_data_new(); problem_info_set_dir(pi, dir); return pi; @@ -207,7 +207,7 @@ static void problem_info_free(problem_info_t *pi) return; problem_data_free(pi->problem_data); - free(pi); + g_free(pi); } static void run_event_async(problem_info_t *pi, const char *event_name, int flags); @@ -228,7 +228,7 @@ struct event_processing_state static struct event_processing_state *new_event_processing_state(void) { - struct event_processing_state *p = xzalloc(sizeof(*p)); + struct event_processing_state *p = g_new0(struct event_processing_state, 1); p->child_pid = -1; p->child_stdout_fd = -1; p->cmd_output = strbuf_new(); @@ -241,7 +241,7 @@ static void free_event_processing_state(struct event_processing_state *p) return; strbuf_free(p->cmd_output); - free(p); + g_free(p); } static char *build_message(problem_info_t *pi)
applet: Use g_new0() instead of xzalloc()
--- src/plugins/abrt-action-analyze-oops.c +++ src/plugins/abrt-action-analyze-oops.c @@ -48,10 +48,15 @@ static void hash_oops_str(char hash_str[SHA1_RESULT_LEN*2 + 1], char *oops_buf, end_mem_block = skip_whitespace(end_mem_block); - /* +1 for '?' and +1 for space after '?' == +2*/ + /* skip symbols prefixed with ? */ if (end_mem_block && *end_mem_block == '?') - end_mem_block += 2; + { + call_trace += end_line - call_trace + 1; + end_line = strchr(call_trace, '\n'); + free(line); + continue; + } /* strip out offset +off/len */ char *begin_off_len = strchr(end_mem_block, '+'); if (!begin_off_len)
rhbz#789526 - abrt hashing on kernel backtraces needs improving
--- lib/plugins/FileTransfer.cpp +++ lib/plugins/FileTransfer.cpp @@ -232,6 +232,10 @@ void CFileTransfer::Run(const char *pActionDir, const char *pArgs, int force) { /* Remember pActiveDir for later sending */ FILE *dirlist = fopen(FILETRANSFER_DIRLIST, "a"); + if (!dirlist) + { + throw CABRTException(EXCEP_PLUGIN, "Can't open "FILETRANSFER_DIRLIST); + } fprintf(dirlist, "%s\n", pActionDir); fclose(dirlist); VERB3 log("Remembered '%s' for future file transfer", pActionDir);
FileTransfer.cpp: add forgotten open error test
--- lib/Plugins/CCpp.cpp +++ lib/Plugins/CCpp.cpp @@ -183,8 +183,8 @@ void CAnalyzerCCpp::InstallDebugInfos(const std::string& pPackage) } if (strstr(buff, "Total download size") != NULL) { - int r = write(pipein[1], "y\n", sizeof("y\n")); - if (r != sizeof("y\n")) + int r = write(pipein[1], "y\n", sizeof("y\n")-1); + if (r != sizeof("y\n")-1) { close(pipein[1]); close(pipeout[0]); @@ -466,14 +466,13 @@ std::string CAnalyzerCCpp::GetLocalUUID(const std::string& pDebugDumpDir) std::string core = "--core="+ pDebugDumpDir + "/" +FILENAME_COREDUMP; char* command = (char*)"eu-unstrip"; char* args[4] = { (char*)"eu-unstrip", NULL, (char*)"-n", NULL }; - args[1] = strdup(core.c_str()); + args[1] = (char*)core.c_str(); dd.Open(pDebugDumpDir); dd.LoadText(FILENAME_UID, UID); dd.LoadText(FILENAME_EXECUTABLE, executable); dd.LoadText(FILENAME_PACKAGE, package); ExecVP(command, args, atoi(UID.c_str()), buildIdPC); dd.Close(); - free(args[1]); GetIndependentBuildIdPC(buildIdPC, independentBuildIdPC); return CreateHash(package + executable + independentBuildIdPC); }
two trivial fixlets in lib/Plugins/CCpp.cpp
--- src/plugins/abrt-action-install-debuginfo-to-abrt-cache.c +++ src/plugins/abrt-action-install-debuginfo-to-abrt-cache.c @@ -182,6 +182,9 @@ int main(int argc, char **argv) if (u != 0) strcpy(path_env, "PATH=/usr/bin:/bin:"BIN_DIR); putenv(path_env); + + /* Use safe umask */ + umask(0022); } execvp(EXECUTABLE, (char **)args);
a-a-i-d-t-a-cache: sanitize umask
--- src/gui-gtk/abrt-gtk.c +++ src/gui-gtk/abrt-gtk.c @@ -390,7 +390,7 @@ GtkWidget *create_main_window(void) gtk_container_add(GTK_CONTAINER(halign), hbox_report_delete); GtkWidget *hbox_help_close = gtk_hbutton_box_new(); - GtkWidget *btn_online_help = gtk_button_new_with_mnemonic(_("_Online Help")); + GtkWidget *btn_online_help = gtk_button_new_with_mnemonic(_("Online _Help")); GtkWidget *btn_close = gtk_button_new_from_stock(GTK_STOCK_CLOSE); gtk_box_pack_end(GTK_BOX(hbox_help_close), btn_online_help, false, false, 0); gtk_box_pack_end(GTK_BOX(hbox_help_close), btn_close, false, false, 0);
abrt-gui: change the help accelerator to alt-H
--- src/hooks/abrt-hook-ccpp.c +++ src/hooks/abrt-hook-ccpp.c @@ -399,7 +399,7 @@ static int open_user_core(uid_t uid, uid_t fsuid, pid_t pid, char **percent_valu static bool dump_fd_info(const char *dest_filename, char *source_filename, int source_base_ofs, uid_t uid, gid_t gid) { - FILE *fp = fopen(dest_filename, "w"); + FILE *fp = fopen(dest_filename, "wx"); if (!fp) return false;
ccpp: open file for dump_fd_info with O_EXCL
--- src/dbus/abrt-dbus.c +++ src/dbus/abrt-dbus.c @@ -599,7 +599,7 @@ static void handle_method_call(GDBusConnection *connection, g_variant_get(parameters, "(&s&s&s)", &problem_id, &element, &value); - if (element == NULL || element[0] == '\0' || strlen(element) > 64) + if (!str_is_correct_filename(element)) { log_notice("'%s' is not a valid element name of '%s'", element, problem_id); char *error = xasprintf(_("'%s' is not a valid element name"), element); @@ -658,6 +658,18 @@ static void handle_method_call(GDBusConnection *connection, g_variant_get(parameters, "(&s&s)", &problem_id, &element); + if (!str_is_correct_filename(element)) + { + log_notice("'%s' is not a valid element name of '%s'", element, problem_id); + char *error = xasprintf(_("'%s' is not a valid element name"), element); + g_dbus_method_invocation_return_dbus_error(invocation, + "org.freedesktop.problems.InvalidElement", + error); + + free(error); + return; + } + struct dump_dir *dd = open_directory_for_modification_of_element( invocation, caller_uid, problem_id, element); if (!dd)
dbus: report invalid element names
--- src/daemon/Daemon.cpp +++ src/daemon/Daemon.cpp @@ -142,8 +142,8 @@ static gboolean server_socket_cb(GIOChannel *source, GIOCondition condition, gpo pid_t pid = fork(); if (pid < 0) { - close(socket); perror_msg("fork"); + close(socket); return TRUE; } if (pid == 0) /* child */
perror has to be used immediately after failed syscall
--- src/lib/OpenEXR/ImfCompositeDeepScanLine.cpp +++ src/lib/OpenEXR/ImfCompositeDeepScanLine.cpp @@ -238,6 +238,20 @@ CompositeDeepScanLine::setFrameBuffer(const FrameBuffer& fr) for(FrameBuffer::ConstIterator q=fr.begin();q!=fr.end();q++) { + + // + // Frame buffer must have xSampling and ySampling set to 1 + // (Sampling in FrameBuffers must match sampling in file, + // and Header::sanityCheck enforces sampling in deep files is 1) + // + + if(q.slice().xSampling!=1 || q.slice().ySampling!=1) + { + THROW (IEX_NAMESPACE::ArgExc, "X and/or y subsampling factors " + "of \"" << q.name() << "\" channel in framebuffer " + "are not 1"); + } + string name(q.name()); if(name=="ZBack") {
enforce xSampling/ySampling==1 in CompositeDeepScanLine (#1209)
--- OpenEXR/IlmImf/ImfMultiPartInputFile.cpp +++ OpenEXR/IlmImf/ImfMultiPartInputFile.cpp @@ -340,6 +340,11 @@ MultiPartInputFile::initialize() // Perform usual check on headers. // + if ( _data->_headers.size() == 0) + { + throw IEX_NAMESPACE::ArgExc ("Files must contain at least one header"); + } + for (size_t i = 0; i < _data->_headers.size(); i++) { //
add sanity check for reading multipart files with no parts (#840)
--- OpenEXR/IlmImf/ImfTiledInputFile.cpp +++ OpenEXR/IlmImf/ImfTiledInputFile.cpp @@ -1313,6 +1313,13 @@ TiledInputFile::rawTileData (int &dx, int &dy, throw IEX_NAMESPACE::ArgExc ("rawTileData read the wrong tile"); } } + else + { + if(!isValidTile (dx, dy, lx, ly) ) + { + throw IEX_NAMESPACE::IoExc ("rawTileData read an invalid tile"); + } + } pixelData = tileBuffer->buffer; } catch (IEX_NAMESPACE::BaseExc &e)
Fix for #494: validate tile coordinates when doing copyPixels
--- OpenEXR/exrmakepreview/makePreview.cpp +++ OpenEXR/exrmakepreview/makePreview.cpp @@ -120,8 +120,8 @@ generatePreview (const char inFileName[], previewHeight = max (int (h / (w * a) * previewWidth + .5f), 1); previewPixels.resizeErase (previewHeight, previewWidth); - float fx = (previewWidth > 0)? (float (w - 1) / (previewWidth - 1)): 1; - float fy = (previewHeight > 0)? (float (h - 1) / (previewHeight - 1)): 1; + float fx = (previewWidth > 1)? (float (w - 1) / (previewWidth - 1)): 1; + float fy = (previewHeight > 1)? (float (h - 1) / (previewHeight - 1)): 1; float m = Math<float>::pow (2.f, IMATH_NAMESPACE::clamp (exposure + 2.47393f, -20.f, 20.f)); for (int y = 0; y < previewHeight; ++y)
Fix logic for 1 pixel high/wide preview images (Fixes #493)
--- OpenEXR/IlmImf/ImfB44Compressor.cpp +++ OpenEXR/IlmImf/ImfB44Compressor.cpp @@ -494,7 +494,7 @@ B44Compressor::B44Compressor // _tmpBuffer = new unsigned short - [checkArraySize (uiMult (maxScanLineSize, numScanLines), + [checkArraySize (uiMult (maxScanLineSize / sizeof(unsigned short), numScanLines), sizeof (unsigned short))]; const ChannelList &channels = header().channels();
reduce B44 _tmpBufferSize (was allocating two bytes per byte) (#843)
--- OpenEXR/IlmImf/ImfMultiPartInputFile.cpp +++ OpenEXR/IlmImf/ImfMultiPartInputFile.cpp @@ -571,7 +571,7 @@ MultiPartInputFile::Data::chunkOffsetReconstruction(OPENEXR_IMF_INTERNAL_NAMESPA - if(partNumber<0 || partNumber> static_cast<int>(parts.size())) + if(partNumber<0 || partNumber>= static_cast<int>(parts.size())) { throw IEX_NAMESPACE::IoExc("part number out of range"); }
Fix #491, issue with part number range check reconstructing chunk offset table
--- keepalived/core/main.c +++ keepalived/core/main.c @@ -882,7 +882,7 @@ set_umask(const char *optarg) if (*endptr || umask_long < 0 || umask_long & ~0777L) { fprintf(stderr, "Invalid --umask option %s", optarg); - return; + return 0; } umask_val = umask_long & 0777;
Fix compile warning introduced in commit c6247a9
--- accel-pppd/radius/packet.c +++ accel-pppd/radius/packet.c @@ -206,6 +206,14 @@ int rad_packet_recv(int fd, struct rad_packet_t **p, struct sockaddr_in *addr) len -= vendor->tag + vendor->len; n -= 4 + vendor->tag + vendor->len; + if (len < 0) { + log_ppp_warn("radius:packet invalid vendor attribute len received\n"); + goto out_err; + } + if (2 + len > n) { + log_ppp_warn("radius:packet: too long vendor attribute received (%i, %i)\n", id, len); + goto out_err; + } } else log_ppp_warn("radius:packet: vendor %i not found\n", id); } else
radius: sanity check for vendor attribute length
--- source/components/executer/exmisc.c +++ source/components/executer/exmisc.c @@ -2,7 +2,7 @@ /****************************************************************************** * * Module Name: exmisc - ACPI AML (p-code) execution - specific opcodes - * $Revision: 1.127 $ + * $Revision: 1.129 $ * *****************************************************************************/ @@ -10,7 +10,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2004, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2005, Intel Corp. * All rights reserved. * * 2. License @@ -173,6 +173,7 @@ AcpiExGetObjectReference ( { case AML_LOCAL_OP: case AML_ARG_OP: + case AML_DEBUG_OP: /* The referenced object is the pseudo-node for the local/arg */ @@ -181,7 +182,7 @@ AcpiExGetObjectReference ( default: - ACPI_REPORT_ERROR (("Unknown Reference subtype in get ref %X\n", + ACPI_REPORT_ERROR (("Unknown Reference opcode in GetReference %X\n", ObjDesc->Reference.Opcode)); return_ACPI_STATUS (AE_AML_INTERNAL); } @@ -199,7 +200,7 @@ AcpiExGetObjectReference ( default: - ACPI_REPORT_ERROR (("Invalid descriptor type in get ref: %X\n", + ACPI_REPORT_ERROR (("Invalid descriptor type in GetReference: %X\n", ACPI_GET_DESCRIPTOR_TYPE (ObjDesc))); return_ACPI_STATUS (AE_TYPE); }
Allow RefOf on the Debug object
--- source/common/adisasm.c +++ source/common/adisasm.c @@ -1,7 +1,7 @@ /****************************************************************************** * * Module Name: adisasm - Application-level disassembler routines - * $Revision: 1.67 $ + * $Revision: 1.68 $ * *****************************************************************************/ @@ -880,6 +880,7 @@ AdGetLocalTables ( ACPI_TABLE_HEADER *NewTable; UINT32 NumTables; UINT32 PointerSize; + char *FacsSuffix = ""; if (GetAllTables) @@ -923,6 +924,8 @@ AdGetLocalTables ( AcpiGbl_FADT = (void *) NewTable; AdWriteTable (NewTable, NewTable->Length, FADT_SIG, NewTable->OemTableId); + + FacsSuffix = &AcpiGbl_FADT->OemTableId; } AcpiOsPrintf ("\n"); @@ -934,7 +937,7 @@ AdGetLocalTables ( { AcpiGbl_FACS = (void *) NewTable; AdWriteTable (NewTable, AcpiGbl_FACS->Length, - FACS_SIG, AcpiGbl_FADT->OemTableId); + FACS_SIG, FacsSuffix); } AcpiOsPrintf ("\n"); }
Special handling for FACS table "name"
--- source/components/disassembler/dmresrc.c +++ source/components/disassembler/dmresrc.c @@ -544,6 +544,15 @@ AcpiDmIsResourceTemplate ( * intialization byte list. Because the resource macros will create * a buffer of the exact required length (buffer length will be equal * to the actual length). + * + * NOTE (April 2017): Resource templates with this issue have been + * seen in the field. We still don't want to attempt to disassemble + * a buffer like this to a resource template because this output + * would not match the original input buffer (it would be shorter + * than the original when the disassembled code is recompiled). + * Basically, a buffer like this appears to be hand crafted in the + * first place, so just emitting a buffer object instead of a + * resource template more closely resembles the original ASL code. */ if (DeclaredBufferLength != BufferLength) {
Add new comment, no functional change
--- source/components/namespace/nsxfname.c +++ source/components/namespace/nsxfname.c @@ -239,7 +239,7 @@ AcpiGetHandle ( { ACPI_STATUS Status; NAME_TABLE_ENTRY *ThisEntry; - ACPI_HANDLE Scope = NULL; + NAME_TABLE_ENTRY *Scope = NULL; if (!RetHandle || !Pathname) { @@ -247,7 +247,7 @@ AcpiGetHandle ( } if (Parent) - Scope = Parent->Scope; + Scope = ((NAME_TABLE_ENTRY*) Parent)->Scope; /* Special case for root, since we can't search for it */
Fixed bug in AcpiGetHandle(): searching for a relative path always
--- source/components/events/evregion.c +++ source/components/events/evregion.c @@ -1,7 +1,7 @@ /****************************************************************************** * * Module Name: evregion - ACPI AddressSpace / OpRegion handler dispatch - * $Revision: 1.79 $ + * $Revision: 1.80 $ * *****************************************************************************/ @@ -148,7 +148,7 @@ AcpiEvInstallDefaultAddressSpaceHandlers ( FUNCTION_TRACE ("EvInstallDefaultAddressSpaceHandlers"); - /* + /* * All address spaces (PCI Config, EC, SMBus) are scope dependent * and registration must occur for a specific device. In the case * system memory and IO address spaces there is currently no device
Ran acpisrc source cleanup
--- source/compiler/aslerror.c +++ source/compiler/aslerror.c @@ -247,6 +247,11 @@ AePrintException ( FILE *SourceFile; + if (Gbl_NoErrors) + { + return; + } + /* * Only listing files have a header, and remarks/optimizations * are always output --- source/compiler/aslglobal.h +++ source/compiler/aslglobal.h @@ -188,6 +188,7 @@ ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_ParseOnlyFlag, FALSE); ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_CompileTimesFlag, FALSE); ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_FoldConstants, TRUE); ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_VerboseErrors, TRUE); +ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_NoErrors, FALSE); ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_DisasmFlag, FALSE); ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_GetAllTables, FALSE); ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_IntegerOptimizationFlag, TRUE); --- source/compiler/aslmain.c +++ source/compiler/aslmain.c @@ -170,6 +170,7 @@ Options ( printf ("General Output:\n"); printf (" -p <prefix> Specify path/filename prefix for all output files\n"); + printf (" -va Disable all errors and warnings (summary only)\n"); printf (" -vi Less verbose errors and warnings for use with IDEs\n"); printf (" -vo Enable optimization comments\n"); printf (" -vr Disable remarks\n"); @@ -620,6 +621,12 @@ AslCommandLine ( switch (AcpiGbl_Optarg[0]) { + case 'a': + /* Disable All error/warning messages */ + + Gbl_NoErrors = TRUE; + break; + case 'i': /* Less verbose error messages */
iASL: Add option to display summary only.
--- source/components/utilities/utalloc.c +++ source/components/utilities/utalloc.c @@ -795,11 +795,14 @@ CmInitStaticObject ( * 1) This is an ACPI_OBJECT_INTERNAL descriptor * 2) The size is the full object (worst case) * 3) The flags field indicates static allocation + * 4) Reference count starts at one (not really necessary since the + * object can't be deleted, but keeps everything sane) */ - ObjDesc->Common.DataType = DESC_TYPE_ACPI_OBJ; - ObjDesc->Common.Size = sizeof (ACPI_OBJECT_INTERNAL); - ObjDesc->Common.Flags = AO_STATIC_ALLOCATION; + ObjDesc->Common.DataType = DESC_TYPE_ACPI_OBJ; + ObjDesc->Common.Size = sizeof (ACPI_OBJECT_INTERNAL); + ObjDesc->Common.Flags = AO_STATIC_ALLOCATION; + ObjDesc->Common.ReferenceCount = 1; return_VOID; }
Init static object reference count
--- source/include/acpixf.h +++ source/include/acpixf.h @@ -270,7 +270,6 @@ INT32 AcpiModeCapabilities ( void); - /* * Event / System interfaces */
Modified various APIs to match our intent.
--- source/components/events/evgpe.c +++ source/components/events/evgpe.c @@ -1,7 +1,7 @@ /****************************************************************************** * * Module Name: evgpe - General Purpose Event handling and dispatch - * $Revision: 1.32 $ + * $Revision: 1.34 $ * *****************************************************************************/ @@ -9,7 +9,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2003, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2004, Intel Corp. * All rights reserved. * * 2. License @@ -228,6 +228,12 @@ AcpiEvGpeDetect ( ACPI_FUNCTION_NAME ("EvGpeDetect"); + /* Check for the case where there are no GPEs */ + + if (!GpeXruptList) + { + return (IntStatus); + } /* Examine all GPE blocks attached to this interrupt level */
Check for the case where there are no GPEs
--- source/components/hardware/hwsleep.c +++ source/components/hardware/hwsleep.c @@ -2,7 +2,7 @@ /****************************************************************************** * * Name: hwsleep.c - ACPI Hardware Sleep/Wake Interface - * $Revision: 1.14 $ + * $Revision: 1.15 $ * *****************************************************************************/ @@ -298,8 +298,11 @@ AcpiEnterSleepState ( /* wait a second, then try again */ AcpiOsStall(1000000); - AcpiHwRegisterWrite(ACPI_MTX_LOCK, PM1_CONTROL, - (1 << AcpiHwGetBitShift (SLP_EN_MASK))); + if (SleepState > ACPI_STATE_S1) + { + AcpiHwRegisterWrite(ACPI_MTX_LOCK, PM1_CONTROL, + (1 << AcpiHwGetBitShift (SLP_EN_MASK))); + } enable();
don't try secondary PM_EN write if doing S1
--- source/components/parser/psparse.c +++ source/components/parser/psparse.c @@ -1,7 +1,7 @@ /****************************************************************************** * * Module Name: psparse - Parser top level AML parse routines - * $Revision: 1.75 $ + * $Revision: 1.76 $ * *****************************************************************************/ @@ -1439,7 +1439,6 @@ AcpiPsParseAml ( } - /* Normal exit */ AcpiAmlReleaseAllMutexes ((ACPI_OPERAND_OBJECT *) &WalkList.AcquiredMutexList);
Code cleanup (acpisrc -c)
--- source/compiler/cvcompiler.c +++ source/compiler/cvcompiler.c @@ -198,18 +198,15 @@ CvProcessComment ( CvDbgPrint ("CommentString: %s\n", CommentString); /* - * Determine whether if this comment spans multiple lines. - * If so, break apart the comment by line so that it can be - * properly indented. + * Determine whether if this comment spans multiple lines. If so, + * break apart the comment by storing each line in a different node + * within the comment list. This allows the disassembler to + * properly indent a multi-line comment. */ LineToken = strtok (CommentString, "\n"); if (LineToken) { - /* - * Get the first token. The for loop pads subsequent lines - * for comments similar to the style of this comment. - */ FinalLineToken = UtStringCacheCalloc (strlen (LineToken) + 1); strcpy (FinalLineToken, LineToken);
iasl: fix ASL/ASL+ converter comment.
--- source/compiler/aslglobal.h +++ source/compiler/aslglobal.h @@ -3,7 +3,7 @@ /****************************************************************************** * * Module Name: aslglobal.h - Global variable definitions - * $Revision: 1.15 $ + * $Revision: 1.17 $ * *****************************************************************************/ @@ -216,7 +216,8 @@ EXTERN ASL_PARSE_NODE INIT_GLOBAL (*Gbl_NodeCacheNext, NULL); EXTERN ASL_PARSE_NODE INIT_GLOBAL (*Gbl_NodeCacheLast, NULL); EXTERN NATIVE_CHAR INIT_GLOBAL (*Gbl_StringCacheNext, NULL); EXTERN NATIVE_CHAR INIT_GLOBAL (*Gbl_StringCacheLast, NULL); - +EXTERN UINT32 INIT_GLOBAL (Gbl_TempCount, 0); +EXTERN ASL_PARSE_NODE *Gbl_FirstLevelInsertionNode; EXTERN UINT32 INIT_GLOBAL (Gbl_CurrentHexColumn, 0); @@ -234,6 +235,7 @@ EXTERN FILE *DebugFile; /* Placeholder for oswinxf only */ EXTERN ASL_ANALYSIS_WALK_INFO AnalysisWalkInfo; EXTERN ACPI_TABLE_HEADER TableHeader; extern ASL_RESERVED_INFO ReservedMethods[]; +EXTERN ASL_EVENT_INFO AslGbl_Events[20]; /* Scratch buffers */
Support for Switch/Case added
--- source/components/hardware/hwgpe.c +++ source/components/hardware/hwgpe.c @@ -222,7 +222,7 @@ AcpiHwLowSetGpe ( break; default: - ACPI_ERROR ((AE_INFO, "Invalid GPE Action, %u\n", Action)); + ACPI_ERROR ((AE_INFO, "Invalid GPE Action, %u", Action)); return (AE_BAD_PARAMETER); } --- source/components/dispatcher/dswload2.c +++ source/components/dispatcher/dswload2.c @@ -308,7 +308,7 @@ AcpiDsLoad2BeginOp ( */ ACPI_WARNING ((AE_INFO, "Type override - [%4.4s] had invalid type (%s) " - "for Scope operator, changed to type ANY\n", + "for Scope operator, changed to type ANY", AcpiUtGetNodeName (Node), AcpiUtGetTypeName (Node->Type))); Node->Type = ACPI_TYPE_ANY; --- source/components/dispatcher/dsobject.c +++ source/components/dispatcher/dsobject.c @@ -613,7 +613,7 @@ AcpiDsBuildInternalPackageObj ( } ACPI_INFO ((AE_INFO, - "Actual Package length (%u) is larger than NumElements field (%u), truncated\n", + "Actual Package length (%u) is larger than NumElements field (%u), truncated", i, ElementCount)); } else if (i < ElementCount)
Remove some extraneous newlines in ACPI_ERROR type calls..
--- source/components/events/evxface.c +++ source/components/events/evxface.c @@ -714,7 +714,7 @@ AcpiRemoveNotifyHandler ( ACPI_STATUS AcpiInstallAddressSpaceHandler ( ACPI_HANDLE Device, - UINT32 SpaceId, + ACPI_ADDRESS_SPACE_TYPE SpaceId, ADDRESS_SPACE_HANDLER Handler, void *Context) { @@ -763,15 +763,15 @@ AcpiInstallAddressSpaceHandler ( { switch (SpaceId) { - case REGION_SystemMemory: + case ADDRESS_SPACE_SYSTEM_MEMORY: Handler = AmlSystemMemorySpaceHandler; break; - case REGION_SystemIO: + case ADDRESS_SPACE_SYSTEM_IO: Handler = AmlSystemIoSpaceHandler; break; - case REGION_PCIConfig: + case ADDRESS_SPACE_PCI_CONFIG: Handler = AmlPciConfigSpaceHandler; break; @@ -933,7 +933,7 @@ AcpiInstallAddressSpaceHandler ( ACPI_STATUS AcpiRemoveAddressSpaceHandler ( ACPI_HANDLE Device, - UINT32 SpaceId, + ACPI_ADDRESS_SPACE_TYPE SpaceId, ADDRESS_SPACE_HANDLER Handler) { ACPI_OBJECT_INTERNAL *ObjDesc;
date 2000.01.24.22.09.00; author psdiefen; state Exp;
--- source/components/namespace/nseval.c +++ source/components/namespace/nseval.c @@ -428,6 +428,16 @@ AcpiNsEvaluate ( Status = AE_OK; } + else if (ACPI_FAILURE(Status)) + { + /* If ReturnObject exists, delete it */ + + if (Info->ReturnObject) + { + AcpiUtRemoveReference (Info->ReturnObject); + Info->ReturnObject = NULL; + } + } ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, "*** Completed evaluation of object %s ***\n",
acpi: acpica: fix acpi operand cache leak in nseval.c
--- source/tools/acpiexec/aeexec.c +++ source/tools/acpiexec/aeexec.c @@ -1,7 +1,7 @@ /****************************************************************************** * * Module Name: aeexec - Support routines for AcpiExec utility - * $Revision: 1.107 $ + * $Revision: 1.108 $ * *****************************************************************************/ @@ -1120,6 +1120,8 @@ AeMiscellaneousTests ( AcpiOsPrintf ("Could not get GlobalLock, %X\n", Status); } + Status = AcpiAcquireGlobalLock (0x5, &LockHandle); /* Should fail */ + Status = AcpiReleaseGlobalLock (LockHandle); if (ACPI_FAILURE (Status)) {
ACPICA: test timeout on global lock interface
--- source/components/tables/tbinstal.c +++ source/components/tables/tbinstal.c @@ -236,7 +236,7 @@ AcpiTbInstallTableWithOverride ( * DESCRIPTION: This function is called to verify and install an ACPI table. * When this function is called by "Load" or "LoadTable" opcodes, * or by AcpiLoadTable() API, the "Reload" parameter is set. - * After sucessfully returning from this function, table is + * After successfully returning from this function, table is * "INSTALLED" but not "VALIDATED". * ******************************************************************************/
Tables: Fix spelling mistake in comment
--- source/components/namespace/nsnames.c +++ source/components/namespace/nsnames.c @@ -1,7 +1,7 @@ /******************************************************************************* * * Module Name: nsnames - Name manipulation and search - * $Revision: 1.77 $ + * $Revision: 1.78 $ * ******************************************************************************/ @@ -275,7 +275,7 @@ AcpiNsGetPathnameLength ( Size = 0; NextNode = Node; - while (NextNode != AcpiGbl_RootNode) + while (NextNode && (NextNode != AcpiGbl_RootNode)) { Size += PATH_SEGMENT_LENGTH; NextNode = AcpiNsGetParentNode (NextNode);
Fix for RefOf/DeRefOf issue. RefOf now returns an object of type
--- source/components/executer/exdump.c +++ source/components/executer/exdump.c @@ -358,6 +358,11 @@ AmlDumpOperand ( break; + case AML_NAMEPATH_OP: + DEBUG_PRINT_RAW (ACPI_INFO, ("Lvalue.Nte->Name %x\n", + EntryDesc->Lvalue.Nte->Name)); + break; + default: /* unknown opcode */
Added AML_NAMEPATH_OP to AmlDumpOperand case statement.
--- source/components/events/evxfregn.c +++ source/components/events/evxfregn.c @@ -139,6 +139,12 @@ * * DESCRIPTION: Install a handler for all OpRegions of a given SpaceId. * + * NOTE: This function should only be called after AcpiEnableSubsystem has + * been called. This is because any _REG methods associated with the Space ID + * are executed here, and these methods can only be safely executed after + * the default handlers have been installed and the hardware has been + * initialized (via AcpiEnableSubsystem.) + * ******************************************************************************/ ACPI_STATUS
Comment update; no functional change.
--- source/include/platform/acwin.h +++ source/include/platform/acwin.h @@ -1,7 +1,7 @@ /****************************************************************************** * * Name: acwin.h - OS specific defines, etc. - * $Revision: 1.27 $ + * $Revision: 1.28 $ * *****************************************************************************/ @@ -173,6 +173,8 @@ typedef COMPILER_DEPENDENT_UINT64 u64; #define ACPI_SIMPLE_RETURN_MACROS #endif +/*! [End] no source code translation !*/ + /* * Global Lock acquire/release code *
ACPICA: Fix for Linux source translation
--- source/compiler/asllisting.c +++ source/compiler/asllisting.c @@ -2,7 +2,7 @@ /****************************************************************************** * * Module Name: asllisting - Listing file generation - * $Revision: 1.24 $ + * $Revision: 1.25 $ * *****************************************************************************/ @@ -621,7 +621,7 @@ LsWriteNodeToListing ( */ OpInfo = AcpiPsGetOpcodeInfo (Node->AmlOpcode); - OpClass = ACPI_GET_OP_CLASS (OpInfo); + OpClass = OpInfo->Class; switch (OpClass) {
Split opcode flags into separate class/type/flags fields
--- source/components/executer/exstore.c +++ source/components/executer/exstore.c @@ -206,12 +206,13 @@ AmlExecute ( * the execution of an numeric operator. It is not clear who should delete the result * object if it is not to be returned. Needs more investigation. */ - +/* if (StackTopEntry != AmlObjStackGetValue (STACK_TOP)) { DEBUG_PRINT (ACPI_INFO, ("AmlExecute: *** Deleting internal return value %p\n")); AmlObjStackDeleteValue (STACK_TOP); } +*/ /* Map PENDING (normal exit, no return value) to OK */
Fixes for ESG.
--- source/components/executer/exfldio.c +++ source/components/executer/exfldio.c @@ -613,13 +613,13 @@ AcpiExFieldDatumIo ( return_ACPI_STATUS (Status); } - ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD, - "I/O to Data Register: ValuePtr %p\n", Value)); - if (ReadWrite == ACPI_READ) { /* Read the datum from the DataRegister */ + ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD, + "Read from Data Register\n")); + Status = AcpiExExtractFromField (ObjDesc->IndexField.DataObj, Value, sizeof (ACPI_INTEGER)); } @@ -627,6 +627,10 @@ AcpiExFieldDatumIo ( { /* Write the datum to the DataRegister */ + ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD, + "Write to Data Register: Value %8.8X%8.8X\n", + ACPI_FORMAT_UINT64 (*Value))); + Status = AcpiExInsertIntoField (ObjDesc->IndexField.DataObj, Value, sizeof (ACPI_INTEGER)); }
Update debug output for IndexField I/O.
--- source/components/debugger/dbstats.c +++ source/components/debugger/dbstats.c @@ -1,7 +1,7 @@ /******************************************************************************* * * Module Name: dbstats - Generation and display of ACPI table statistics - * $Revision: 1.89 $ + * $Revision: 1.90 $ * ******************************************************************************/ @@ -592,6 +592,7 @@ AcpiDbDisplayStatistics ( AcpiOsPrintf ("ParseObjectAsl %3d\n", sizeof (ACPI_PARSE_OBJ_ASL)); AcpiOsPrintf ("OperandObject %3d\n", sizeof (ACPI_OPERAND_OBJECT)); AcpiOsPrintf ("NamespaceNode %3d\n", sizeof (ACPI_NAMESPACE_NODE)); + AcpiOsPrintf ("AcpiObject %3d\n", sizeof (ACPI_OBJECT)); break;
Added additional object to SIZES command.
--- source/tools/acpiexec/aehandlers.c +++ source/tools/acpiexec/aehandlers.c @@ -1127,11 +1127,21 @@ AeInstallEarlyHandlers ( Status = AcpiDetachData (Handle, AeAttachedDataHandler); AE_CHECK_OK (AcpiDetachData, Status); - Status = AcpiAttachData (Handle, AeAttachedDataHandler, Handle); + /* Test attach data at the root object */ + + Status = AcpiAttachData (ACPI_ROOT_OBJECT, AeAttachedDataHandler, + AcpiGbl_RootNode); + AE_CHECK_OK (AcpiAttachData, Status); + + Status = AcpiAttachData (ACPI_ROOT_OBJECT, AeAttachedDataHandler2, + AcpiGbl_RootNode); AE_CHECK_OK (AcpiAttachData, Status); /* Test support for multiple attaches */ + Status = AcpiAttachData (Handle, AeAttachedDataHandler, Handle); + AE_CHECK_OK (AcpiAttachData, Status); + Status = AcpiAttachData (Handle, AeAttachedDataHandler2, Handle); AE_CHECK_OK (AcpiAttachData, Status); }
AcpiExec: Add support to test attach/delete root node objects.
--- source/components/utilities/utdecode.c +++ source/components/utilities/utdecode.c @@ -629,9 +629,9 @@ static const char *AcpiGbl_GenericNotify[ACPI_GENERIC_NOTIFY_MAX + 1] /* 09 */ "Device PLD Check", /* 0A */ "Reserved", /* 0B */ "System Locality Update", - /* 0C */ "Shutdown Request", /* Reserved in ACPI 6.0 */ + /* 0C */ "Reserved (was previously Shutdown Request)", /* Reserved in ACPI 6.0 */ /* 0D */ "System Resource Affinity Update", - /* 0E */ "Heterogeneous Memory Attributes Update" /* ACPI 6.2 */ + /* 0E */ "Heterogeneous Memory Attributes Update" /* ACPI 6.2 */ }; static const char *AcpiGbl_DeviceNotify[5] =
Utilities: Make a notify value reserved
--- source/compiler/aslcodegen.c +++ source/compiler/aslcodegen.c @@ -2,7 +2,7 @@ /****************************************************************************** * * Module Name: aslcodegen - AML code generation - * $Revision: 1.60 $ + * $Revision: 1.61 $ * *****************************************************************************/ @@ -396,7 +396,7 @@ CgWriteAmlOpcode ( CgLocalWriteAmlData (Op, &PkgLen.LenBytes[0], 1); } - else + else if (Op->Asl.AmlPkgLenBytes != 0) { /* * Encode the "bytes to follow" in the first byte, top two bits.
Fix fault if package length too long to be encoded (BZ 432)
--- source/include/platform/acenv.h +++ source/include/platform/acenv.h @@ -224,8 +224,8 @@ typedef char *va_list; #endif /* va_arg */ -#define STRSTR(s1,s2) __strstr((char *) (s1), (char *) (s2)) -#define STRUPR(s) _strupr((char *) (s)) +#define STRSTR(s1,s2) _strstr((char *) (s1), (char *) (s2)) +#define STRUPR(s) __strupr((char *) (s)) #define STRLEN(s) _strlen((char *) (s)) #define STRCPY(d,s) _strcpy((char *) (d), (char *) (s)) #define STRNCPY(d,s,n) _strncpy((char *) (d), (char *) (s), (n))
Changed _strupr to __strupr (two __) unable to link on WDM because
--- source/components/executer/exmisc.c +++ source/components/executer/exmisc.c @@ -2,7 +2,7 @@ /****************************************************************************** * * Module Name: exmisc - ACPI AML (p-code) execution - specific opcodes - * $Revision: 1.84 $ + * $Revision: 1.85 $ * *****************************************************************************/ @@ -408,9 +408,8 @@ AcpiExHexadic ( * "continue" (proceed to next iteration of enclosing * "for" loop) signifies a non-match. */ - switch (Op1Desc->Integer.Value) + switch ((NATIVE_UINT) Op1Desc->Integer.Value) { - case MATCH_MTR: /* always true */ break; @@ -472,9 +471,8 @@ AcpiExHexadic ( } - switch(Op2Desc->Integer.Value) + switch ((NATIVE_UINT) Op2Desc->Integer.Value) { - case MATCH_MTR: break;
Added NATIVE_UINT for switch statements, prevents switch on a 64-bit
--- source/components/events/evgpe.c +++ source/components/events/evgpe.c @@ -494,6 +494,16 @@ AcpiEvGpeDetect ( GpeRegisterInfo = &GpeBlock->RegisterInfo[i]; + /* + * Optimization: If there are no GPEs enabled within this + * register, we can safely ignore the entire register. + */ + if (!(GpeRegisterInfo->EnableForRun | + GpeRegisterInfo->EnableForWake)) + { + continue; + } + /* Read the Status Register */ Status = AcpiHwRead (&StatusReg, &GpeRegisterInfo->StatusAddress);
GPE detect optimization - ignore unused GPE registers.
--- source/components/events/evevent.c +++ source/components/events/evevent.c @@ -2,7 +2,7 @@ * * Module Name: evevent - Fixed and General Purpose AcpiEvent * handling and dispatch - * $Revision: 1.52 $ + * $Revision: 1.53 $ * *****************************************************************************/ @@ -124,7 +124,6 @@ MODULE_NAME ("evevent") - /******************************************************************************* * * FUNCTION: AcpiEvInitialize
Cleanup - extraneous spaces and tab removal
--- source/include/actypes.h +++ source/include/actypes.h @@ -1,7 +1,7 @@ /****************************************************************************** * * Name: actypes.h - Common data types for the entire ACPI subsystem - * $Revision: 1.134 $ + * $Revision: 1.135 $ * *****************************************************************************/ @@ -355,7 +355,7 @@ typedef UINT8 OBJECT_TYPE_INTERNAL; * This section contains object types that do not relate to the ACPI ObjectType operator. * They are used for various internal purposes only. If new predefined ACPI_TYPEs are * added (via the ACPI specification), these internal types must move upwards. - * Also, values exceeding the largest official ACPI ObjectType must not overlap with + * Also, values exceeding the largest official ACPI ObjectType must not overlap with * defined AML opcodes. */ #define INTERNAL_TYPE_BEGIN 17
Ran acpisrc source cleanup
--- source/components/executer/exutils.c +++ source/components/executer/exutils.c @@ -2,7 +2,7 @@ /****************************************************************************** * * Module Name: exutils - interpreter/scanner utilities - * $Revision: 1.116 $ + * $Revision: 1.117 $ * *****************************************************************************/ @@ -454,7 +454,7 @@ AcpiExEisaIdToString ( * * RETURN: None, string * - * DESCRIPTOIN: Convert a number to string representation. Assumes string + * DESCRIPTION: Convert a number to string representation. Assumes string * buffer is large enough to hold the string. * ******************************************************************************/
typo in comment
--- source/components/namespace/nsdump.c +++ source/components/namespace/nsdump.c @@ -287,6 +287,13 @@ AcpiNsDumpOneObject ( } ThisNode = AcpiNsMapHandleToNode (ObjHandle); + if (!ThisNode) + { + ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Invalid object handle %p\n", + ObjHandle)); + return (AE_OK); + } + Type = ThisNode->Type; /* Check if the owner matches */
Add error check to debug object dump routine.
--- source/compiler/aslopcodes.c +++ source/compiler/aslopcodes.c @@ -2,7 +2,7 @@ /****************************************************************************** * * Module Name: aslopcode - AML opcode generation - * $Revision: 1.68 $ + * $Revision: 1.69 $ * *****************************************************************************/ @@ -320,6 +320,19 @@ OpcSetOptimalIntegerSize ( } else { + if (AcpiGbl_IntegerByteWidth == 4) + { + AslError (ASL_WARNING, ASL_MSG_INTEGER_LENGTH, + Op, NULL); + + if (!Gbl_IgnoreErrors) + { + /* Truncate the integer to 32-bit */ + Op->Asl.AmlOpcode = AML_DWORD_OP; + return 4; + } + } + Op->Asl.AmlOpcode = AML_QWORD_OP; return 8; }
warning and truncation for large integers in 32-bit tables
--- source/components/debugger/dbstats.c +++ source/components/debugger/dbstats.c @@ -213,13 +213,13 @@ DbDisplayStatistics (void) OsdPrintf ("Control Method Parse Trees:.% 7ld\n", SizeOfMethodTrees); OsdPrintf ("Named Object NTEs:..........% 7ld\n", SizeOfNTEs); OsdPrintf ("Named Internal Objects......% 7ld\n", SizeOfAcpiObjects); - OsdPrintf ("Global State Cache.requests.% 7ld\n", Gbl_StateCacheRequests); - OsdPrintf ("Global State Cache depth....% 7ld\n", Gbl_GenericStateCacheDepth); - OsdPrintf ("Global State Cache..........% 7ld\n", Gbl_GenericStateCacheDepth * sizeof (ACPI_GENERIC_STATE)); + OsdPrintf ("Global State Cache.size.....% 7ld\n", Gbl_GenericStateCacheDepth * sizeof (ACPI_GENERIC_STATE)); OsdPrintf ("\n"); - OsdPrintf ("Search Statistics:\n\n"); + OsdPrintf ("Miscellaneous Statistics:\n\n"); + OsdPrintf ("Global State Cache.requests.% 7ld\n", Gbl_StateCacheRequests); + OsdPrintf ("Global State Cache depth....% 7ld\n", Gbl_GenericStateCacheDepth); OsdPrintf ("Calls to PsFind:.. ........% 7ld\n", Gbl_PsFindCount); OsdPrintf ("Calls to NsLookup:..........% 7ld\n", Gbl_NsLookupCount);
date 2000.05.03.23.17.00; author rmoore1; state Exp;
--- source/components/namespace/nsaccess.c +++ source/components/namespace/nsaccess.c @@ -188,8 +188,8 @@ AcpiNsRootInitialize ( continue; } - Status = AcpiNsLookup (NULL, (char *) InitVal->Name, InitVal->Type, - ACPI_IMODE_LOAD_PASS2, ACPI_NS_NO_UPSEARCH, + Status = AcpiNsLookup (NULL, ACPI_CAST_PTR (char, InitVal->Name), + InitVal->Type, ACPI_IMODE_LOAD_PASS2, ACPI_NS_NO_UPSEARCH, NULL, &NewNode); if (ACPI_FAILURE (Status)) {
Fix deconstification warnings (-Wcast-qual) with AcpiNsRootInitialize().
--- source/components/debugger/dbdisply.c +++ source/components/debugger/dbdisply.c @@ -1,7 +1,7 @@ /******************************************************************************* * * Module Name: dbdisply - debug display commands - * $Revision: 1.81 $ + * $Revision: 1.82 $ * ******************************************************************************/ @@ -843,7 +843,7 @@ AcpiDbDisplayArguments (void) AcpiOsPrintf ("Method [%4.4s] has %X arguments, max concurrency = %X\n", Node->Name.Ascii, NumArgs, Concurrency); - for (i = 0; i < NumArgs; i++) + for (i = 0; i < MTH_NUM_ARGS; i++) { ObjDesc = WalkState->Arguments[i].Object; AcpiOsPrintf ("Arg%d: ", i);
Display all Args - they can be used as locals
--- source/components/resources/rsutils.c +++ source/components/resources/rsutils.c @@ -1,7 +1,7 @@ /******************************************************************************* * * Module Name: rsutils - Utilities for the resource manager - * $Revision: 1.22 $ + * $Revision: 1.23 $ * ******************************************************************************/ @@ -490,7 +490,6 @@ AcpiRsSetSrsMethodData ( */ Cleanup: - ACPI_MEM_FREE (ByteStream); return_ACPI_STATUS (Status); }
double deleting ByteStream - remove non-refcounted version
--- source/components/executer/excreate.c +++ source/components/executer/excreate.c @@ -322,7 +322,7 @@ AmlExecCreateField ( FieldDesc->FieldUnit.UpdateRule = (UINT8) UPDATE_Preserve; FieldDesc->FieldUnit.Length = BitCount; FieldDesc->FieldUnit.BitOffset = (UINT8) (BitOffset % 8); - FieldDesc->FieldUnit.Offset = BitOffset / 8; + FieldDesc->FieldUnit.Offset = DIV_8 (BitOffset); FieldDesc->FieldUnit.Container = SrcDesc; FieldDesc->FieldUnit.Sequence = SrcDesc->Buffer.Sequence;
Added alignment and math macros
--- tests/aapits/athardware.c +++ tests/aapits/athardware.c @@ -1095,7 +1095,7 @@ AtHardwTest0010(void) return (Status); } - Status = AcpiSetFirmwareWakingVector ((UINT32) PhysicalAddress); + Status = AcpiSetFirmwareWakingVector ((UINT32) PhysicalAddress, 0); if (ACPI_FAILURE(Status)) { AapiErrors++; @@ -1143,7 +1143,7 @@ AtHardwTest0011(void) return (Status); } - Status = AcpiSetFirmwareWakingVector((UINT32) PhysicalAddress); + Status = AcpiSetFirmwareWakingVector((UINT32) PhysicalAddress, 0); if (Status != AE_NO_ACPI_TABLES) { AapiErrors++;
aapts: Update for ACPICA interface change.
--- source/tools/acpidump/apdump.c +++ source/tools/acpidump/apdump.c @@ -154,7 +154,7 @@ ApIsValidHeader ( /* Check for minimum table length */ - if (Table->Length <= sizeof (ACPI_TABLE_HEADER)) + if (Table->Length < sizeof (ACPI_TABLE_HEADER)) { fprintf (stderr, "Table length (0x%8.8X) is invalid\n", Table->Length);
AcpiDump: Allow tables that contain only an ACPI table header.
--- source/compiler/aslcompile.c +++ source/compiler/aslcompile.c @@ -2,7 +2,7 @@ /****************************************************************************** * * Module Name: aslcompile - top level compile module - * $Revision: 1.77 $ + * $Revision: 1.78 $ * *****************************************************************************/ @@ -684,7 +684,6 @@ CmCleanupAndExit (void) UtDisplaySummary (ASL_FILE_STDOUT); - if (Gbl_ExceptionCount[ASL_ERROR] > 0) { exit (1);
Exit with non-zero on error
--- source/components/hardware/hwregs.c +++ source/components/hardware/hwregs.c @@ -382,17 +382,19 @@ AcpiHwClearAcpiStatus ( Status = AcpiHwRegisterWrite (ACPI_REGISTER_PM1_STATUS, ACPI_BITMASK_ALL_FIXED_STATUS); + + AcpiOsReleaseLock (AcpiGbl_HardwareLock, LockFlags); + if (ACPI_FAILURE (Status)) { - goto UnlockAndExit; + goto Exit; } /* Clear the GPE Bits in all GPE registers in all GPE blocks */ Status = AcpiEvWalkGpeList (AcpiHwClearGpeBlock, NULL); -UnlockAndExit: - AcpiOsReleaseLock (AcpiGbl_HardwareLock, LockFlags); +Exit: return_ACPI_STATUS (Status); }
Hardware: Fix possible recursive locking in hwregs.c
--- source/compiler/asltransform.c +++ source/compiler/asltransform.c @@ -2,7 +2,7 @@ /****************************************************************************** * * Module Name: asltransform - Parse tree transforms - * $Revision: 1.27 $ + * $Revision: 1.28 $ * *****************************************************************************/ @@ -540,7 +540,10 @@ TrDoSwitch ( /* * Integer and Buffer case. * - * Change CaseOp() to: If (PredicateValue == CaseValue) {...} + * Change CaseOp() to: If (LEqual (SwitchValue, CaseValue)) {...} + * Note: SwitchValue is first to allow the CaseValue to be implicitly + * converted to the type of SwitchValue if necessary. + * * CaseOp->Child is the case value * CaseOp->Child->Peer is the beginning of the case block */
update a comment
--- source/components/namespace/nsload.c +++ source/components/namespace/nsload.c @@ -1,7 +1,7 @@ /****************************************************************************** * * Module Name: nsload - namespace loading/expanding/contracting procedures - * $Revision: 1.49 $ + * $Revision: 1.51 $ * *****************************************************************************/ @@ -9,7 +9,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999, 2000, 2001, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2002, Intel Corp. * All rights reserved. * * 2. License @@ -330,6 +330,17 @@ AcpiNsLoadTable ( FUNCTION_TRACE ("NsLoadTable"); + /* Check if table contains valid AML (must be DSDT, PSDT, SSDT, etc.) */ + + if (!(AcpiGbl_AcpiTableData[TableDesc->Type].Flags & ACPI_TABLE_EXECUTABLE)) + { + /* Just ignore this table */ + + return_ACPI_STATUS (AE_OK); + } + + /* Check validity of the AML start and length */ + if (!TableDesc->AmlStart) { ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Null AML pointer\n"));
Added support for FADT, FACS in AcpiInstallTable.
--- source/components/parser/psargs.c +++ source/components/parser/psargs.c @@ -1051,6 +1051,9 @@ AcpiPsGetNextArg ( if (Arg->Common.AmlOpcode == AML_INT_METHODCALL_OP) { + /* Free method call op and corresponding namestring sub-ob */ + + AcpiPsFreeOp (Arg->Common.Value.Arg); AcpiPsFreeOp (Arg); Arg = NULL; WalkState->ArgCount = 1;
Fix memory leak on unusual memory leak
--- source/components/events/evgpeblk.c +++ source/components/events/evgpeblk.c @@ -613,6 +613,19 @@ AcpiEvInitializeGpeBlock ( GpeIndex = (i * ACPI_GPE_REGISTER_WIDTH) + j; GpeEventInfo = &GpeBlock->EventInfo[GpeIndex]; + GpeNumber = GpeIndex + GpeBlock->BlockBaseNumber; + + /* + * If the GPE has already been enabled for runtime + * signalling, make sure that it remains enabled, but + * do not increment its reference count. + */ + if (GpeEventInfo->RuntimeCount) + { + (void) AcpiSetGpe (GpeDevice, GpeNumber, ACPI_GPE_ENABLE); + GpeEnabledCount++; + continue; + } /* Ignore GPEs that can wake the system */ @@ -634,7 +647,6 @@ AcpiEvInitializeGpeBlock ( /* Enable this GPE */ - GpeNumber = GpeIndex + GpeBlock->BlockBaseNumber; Status = AcpiEnableGpe (GpeDevice, GpeNumber, ACPI_GPE_TYPE_RUNTIME); if (ACPI_FAILURE (Status))
Ensure GPEs are not enabled twice.
--- source/compiler/aslwalks.c +++ source/compiler/aslwalks.c @@ -176,9 +176,12 @@ AnMethodTypingWalkEnd ( * The called method is untyped at this time (typically a * forward reference). * - * Check for a recursive method call first. + * Check for a recursive method call first. Note: the + * Child->Node will be null if the method has not been + * resolved. */ - if (Op->Asl.ParentMethod != Op->Asl.Child->Asl.Node->Op) + if (Op->Asl.Child->Asl.Node && + (Op->Asl.ParentMethod != Op->Asl.Child->Asl.Node->Op)) { /* We must type the method here */
iASL: Fix a possible fault in a Return statement
--- source/components/parser/psparse.c +++ source/components/parser/psparse.c @@ -524,19 +524,19 @@ PsParseLoop ( switch (Op->Opcode) { - case AML_ByteOp: /* AML_BYTEDATA_ARG */ - case AML_WordOp: /* AML_WORDDATA_ARG */ - case AML_DWordOp: /* AML_DWORDATA_ARG */ - case AML_StringOp: /* AML_ASCIICHARLIST_ARG */ + case AML_ByteOp: /* AML_BYTEDATA_ARG */ + case AML_WordOp: /* AML_WORDDATA_ARG */ + case AML_DWordOp: /* AML_DWORDATA_ARG */ + case AML_StringOp: /* AML_ASCIICHARLIST_ARG */ /* fill in constant or string argument directly */ PsGetNextSimpleArg (ParserState, *Args, Op); break; - case AML_NAMEPATH: /* AML_NAMESTRING_ARG */ + case AML_NAMEPATH: /* AML_NAMESTRING_ARG */ - PsGetNextNamepath (ParserState, Op, &ArgCount); + PsGetNextNamepath (ParserState, Op, &ArgCount, 1); Args = NULL; break;
Fix to support method references without mistaking them for method
--- source/components/events/evregion.c +++ source/components/events/evregion.c @@ -1,7 +1,7 @@ /****************************************************************************** * * Module Name: evregion - ACPI AddressSpace (OpRegion) handler dispatch - * $Revision: 1.120 $ + * $Revision: 1.121 $ * *****************************************************************************/ @@ -713,7 +713,7 @@ AcpiEvAddrHandlerHelper ( /* * Devices are handled different than regions */ - if (IS_THIS_OBJECT_TYPE (ObjDesc, ACPI_TYPE_DEVICE)) + if (ObjDesc->Common.Type == ACPI_TYPE_DEVICE) { /* * See if this guy has any handlers
Macro rename and cleanup
--- source/os_specific/service_layers/osunixxf.c +++ source/os_specific/service_layers/osunixxf.c @@ -879,10 +879,17 @@ AcpiOsDeleteSemaphore ( return (AE_BAD_PARAMETER); } +#ifdef __APPLE__ + if (sem_close (Sem) == -1) + { + return (AE_BAD_PARAMETER); + } +#else if (sem_destroy (Sem) == -1) { return (AE_BAD_PARAMETER); } +#endif return (AE_OK); } --- source/include/platform/acmacosx.h +++ source/include/platform/acmacosx.h @@ -119,7 +119,6 @@ #include "aclinux.h" #ifdef __APPLE__ -#define sem_destroy sem_close #define ACPI_USE_ALTERNATE_TIMEOUT #endif /* __APPLE__ */
MacOSX: Fix wrong sem_destroy definition
--- source/include/acglobal.h +++ source/include/acglobal.h @@ -1,7 +1,7 @@ /****************************************************************************** * * Name: acglobal.h - Declarations for global variables - * $Revision: 1.153 $ + * $Revision: 1.154 $ * *****************************************************************************/ @@ -132,7 +132,7 @@ #define ACPI_INIT_GLOBAL(a,b) a #endif -/* +/* * Keep local copies of these FADT-based registers. NOTE: These globals * are first in this file for alignment reasons on 64-bit systems. */
automated code cleanup
--- source/include/amlresrc.h +++ source/include/amlresrc.h @@ -2,7 +2,7 @@ /****************************************************************************** * * Module Name: amlresrc.h - AML resource descriptors - * $Revision: 1.25 $ + * $Revision: 1.26 $ * *****************************************************************************/ @@ -123,6 +123,7 @@ #define ASL_RESNAME_ADDRESS "_ADR" #define ASL_RESNAME_ALIGNMENT "_ALN" #define ASL_RESNAME_ADDRESSSPACE "_ASI" +#define ASL_RESNAME_ACCESSSIZE "_ASZ" #define ASL_RESNAME_BASEADDRESS "_BAS" #define ASL_RESNAME_BUSMASTER "_BM_" /* Master(1), Slave(0) */ #define ASL_RESNAME_DECODE "_DEC" @@ -381,7 +382,7 @@ typedef struct asl_general_register_desc UINT8 AddressSpaceId; UINT8 BitWidth; UINT8 BitOffset; - UINT8 Reserved; + UINT8 AccessSize; /* ACPI 3.0, was Reserved */ UINT64 Address; } ASL_GENERAL_REGISTER_DESC;
Support for ACPI 3.0 Register macro, new parameter
--- source/components/utilities/utdelete.c +++ source/components/utilities/utdelete.c @@ -388,6 +388,11 @@ CmDeleteInternalObj ( FUNCTION_TRACE_PTR ("CmDeleteInternalObj", Object); + if (!Object) + { + return_VOID; + } + /* Only delete the object when the reference count reaches zero */
date 99.09.24.23.01.00; author grsmith1; state Exp;
--- source/tools/acpisrc/astable.c +++ source/tools/acpisrc/astable.c @@ -2,7 +2,7 @@ /****************************************************************************** * * Module Name: astable - Tables used for source conversion - * $Revision: 1.18 $ + * $Revision: 1.19 $ * *****************************************************************************/ @@ -164,7 +164,7 @@ ACPI_STRING_TABLE StandardDataTypes[] = { char LinuxHeader[] = "/*\n" -" * Copyright (C) 2000 - 2007, R. Byron Moore\n" +" * Copyright (C) 2000 - 2008, Intel Corp.\n" " * All rights reserved.\n" " *\n" " * Redistribution and use in source and binary forms, with or without\n" @@ -716,8 +716,8 @@ ACPI_CONVERSION_TABLE StatsConversionTable = { ACPI_STRING_TABLE CustomReplacements[] = { + {"(c) 1999 - 2008", "(c) 1999 - 2008", REPLACE_WHOLE_WORD}, #if 0 - {"(c) 1999 - 2006", "(c) 1999 - 2007", REPLACE_WHOLE_WORD}, {"AcpiTbSumTable", "AcpiTbSumTable", REPLACE_WHOLE_WORD}, {"ACPI_SIG_BOOT", "ACPI_SIG_BOOT", REPLACE_WHOLE_WORD}, {"ACPI_SIG_DBGP", "ACPI_SIG_DBGP", REPLACE_WHOLE_WORD},
2008 Copyright support added.
--- source/components/executer/exutils.c +++ source/components/executer/exutils.c @@ -2,7 +2,7 @@ /****************************************************************************** * * Module Name: exutils - interpreter/scanner utilities - * $Revision: 1.107 $ + * $Revision: 1.109 $ * *****************************************************************************/ @@ -10,7 +10,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2002, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2003, Intel Corp. * All rights reserved. * * 2. License @@ -372,7 +372,11 @@ AcpiExDigitsNeeded ( /* * ACPI_INTEGER is unsigned, so we don't worry about a '-' */ - CurrentValue = Value; + if ((CurrentValue = Value) == 0) + { + return_VALUE (1); + } + NumDigits = 0; while (CurrentValue)
fix DigitsNeeded for 0 (Takayoshi Kochi)
--- source/components/utilities/utalloc.c +++ source/components/utilities/utalloc.c @@ -121,8 +121,9 @@ #include <namespace.h> #include <globals.h> -#define _THIS_MODULE "cmalloc.c" #define _COMPONENT MISCELLANEOUS + MODULE_NAME ("cmalloc"); + /* * Most of this code is for tracking memory leaks in the subsystem, and it
Macro support to eliminate excessive debug string duplication
--- source/compiler/aslopcodes.c +++ source/compiler/aslopcodes.c @@ -956,7 +956,7 @@ OpcDoPld ( { UINT8 *Buffer; ACPI_PARSE_OBJECT *Node; - ACPI_PLD_INFO PldInfo = {0}; + ACPI_PLD_INFO PldInfo; ACPI_PARSE_OBJECT *NewOp; @@ -979,6 +979,8 @@ OpcDoPld ( return; } + ACPI_MEMSET (&PldInfo, 0, sizeof (ACPI_PLD_INFO)); + Node = Op->Asl.Child; while (Node) {
iASL: Update for ToPLD macro.
--- source/components/executer/exsystem.c +++ source/components/executer/exsystem.c @@ -382,7 +382,7 @@ ACPI_STATUS OsGetGlobalLock(void) { UINT32 GlobalLockReg; - ACPI_STATUS Status; + ACPI_STATUS Status = AE_OK; if (FACS)
Initialized Status, line 386.
--- source/components/parser/psparse.c +++ source/components/parser/psparse.c @@ -1,7 +1,7 @@ /****************************************************************************** * * Module Name: psparse - Parser top level AML parse routines - * $Revision: 1.124 $ + * $Revision: 1.125 $ * *****************************************************************************/ @@ -947,7 +947,11 @@ AcpiPsParseLoop ( { /* There are arguments (complex ones), push Op and prepare for argument */ - AcpiPsPushScope (ParserState, Op, WalkState->ArgTypes, WalkState->ArgCount); + Status = AcpiPsPushScope (ParserState, Op, WalkState->ArgTypes, WalkState->ArgCount); + if (ACPI_FAILURE (Status)) + { + return_ACPI_STATUS (Status); + } Op = NULL; continue; }
Fourth pass to include lint changes/comments/cleanup (64-bit)
--- source/components/namespace/nsaccess.c +++ source/components/namespace/nsaccess.c @@ -1,7 +1,7 @@ /******************************************************************************* * * Module Name: nsaccess - Top-level functions for accessing ACPI namespace - * $Revision: 1.163 $ + * $Revision: 1.164 $ * ******************************************************************************/ @@ -249,6 +249,7 @@ AcpiNsRootInitialize (void) case ACPI_TYPE_MUTEX: + ObjDesc->Mutex.Node = NewNode; ObjDesc->Mutex.SyncLevel = (UINT16) ACPI_STRTOUL (InitVal->Val, NULL, 10); @@ -349,6 +350,7 @@ AcpiNsLookup ( ACPI_NAMESPACE_NODE *CurrentNode = NULL; ACPI_NAMESPACE_NODE *ThisNode = NULL; UINT32 NumSegments; + UINT32 NumCarats; ACPI_NAME SimpleName; ACPI_OBJECT_TYPE TypeToCheckFor; ACPI_OBJECT_TYPE ThisSearchType; @@ -468,6 +470,7 @@ AcpiNsLookup ( * the parent node for each prefix instance. */ ThisNode = PrefixNode; + NumCarats = 0; while (*Path == (UINT8) AML_PARENT_PREFIX) { /* Name is fully qualified, no search rules apply */ @@ -481,6 +484,7 @@ AcpiNsLookup ( /* Backup to the parent node */ + NumCarats++; ThisNode = AcpiNsGetParentNode (ThisNode); if (!ThisNode) { @@ -495,7 +499,8 @@ AcpiNsLookup ( if (SearchParentFlag == ACPI_NS_NO_UPSEARCH) { ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, - "Path is absolute with one or more carats\n")); + "Search scope is [%4.4s], path has %d carat(s)\n", + ThisNode->Name.Ascii, NumCarats)); } } @@ -520,6 +525,7 @@ AcpiNsLookup ( * have the correct target node and there are no name segments. */ NumSegments = 0; + Type = ThisNode->Type; ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, "Prefix-only Pathname (Zero name segments), Flags=%X\n", Flags));
Init Mutex Node. Set proper type for single-nameseg case
--- src/lib/Libifl/trq_auth.c +++ src/lib/Libifl/trq_auth.c @@ -998,6 +998,9 @@ int authorize_socket( if (trq_server_addr != NULL) free(trq_server_addr); + if (server_name != NULL) + free(server_name); + return(rc); } // END authorize_socket()
TRQ-3017 Leak in trqauthd
--- src/lib/Libutils/numa_chip.cpp +++ src/lib/Libutils/numa_chip.cpp @@ -1425,6 +1425,14 @@ void Chip::calculateStepCounts( int &place_count_remaining) { + if (lprocs_per_task == 0) + { + step = 0; + step_remainder = processing_units_per_task; + place_count = 0; + return; + } + if (lprocs_per_task == 1) { step = (processing_units_per_task/2) + 1;
Made it so cores or threads can be allocated on
--- src/resmom/requests.c +++ src/resmom/requests.c @@ -2469,7 +2469,7 @@ int req_stat_job( */ snprintf(name, sizeof(name), "%s", preq->rq_ind.rq_status.rq_id); - name[(PBS_MAXSVRJOBID > PBS_MAXDEST ? PBS_MAXSVRJOBID:PBS_MAXDEST)] = '\0'; + name[sizeof(name) - 1] = '\0'; if ((name[0] == '\0') || (name[0] == '@')) {
Improved a line of code checked in earlier.
--- src/cmds/qstat.c +++ src/cmds/qstat.c @@ -1366,7 +1366,8 @@ void display_statjob( } } - c++; /* List the first part of the server name, too. */ + if (*c != '\0') + c++; /* List the first part of the server name, too. */ while ((*c != '.') && (*c != '\0')) c++;
Avoid reading/writing past the end of a buffer with display_job_server_suffix=false