Uploaded image for project: 'RHEL'
  1. RHEL
  2. RHEL-35997

direct_api.c:598: cast_underflow: An assign of a possibly negative number to an unsigned type el10

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Normal Normal
    • rhel-10.0
    • rhel-10.0.beta
    • libsemanage
    • None
    • libsemanage-3.7-4.el10
    • None
    • Low
    • 2
    • rhel-sst-security-selinux
    • ssg_security
    • 2
    • False
    • Hide

      None

      Show
      None
    • None
    • SELINUX 241016 - 241106, SELINUX 241106 - 241127
    • Hide

      The source code is fixed in such a way that Coverity scan does not find this error in that area.

      Show
      The source code is fixed in such a way that Coverity scan does not find this error in that area.
    • Fail
    • None
    • None

      Error: INTEGER_OVERFLOW (CWE-190):
      libsemanage-3.6/src/direct_api.c:598: tainted_data_return: Called function "read(fd, data_read + data_read_len, max_len - data_read_len)", and a possible return value may be less than zero.
      libsemanage-3.6/src/direct_api.c:598: cast_underflow: An assign of a possibly negative number to an unsigned type, which might trigger an underflow.
      libsemanage-3.6/src/direct_api.c:599: overflow: The expression "data_read_len += read_len" is deemed underflowed because at least one of its arguments has underflowed.
      libsemanage-3.6/src/direct_api.c:598: overflow: The expression "max_len - data_read_len" is deemed underflowed because at least one of its arguments has underflowed.
      libsemanage-3.6/src/direct_api.c:598: overflow_sink: "max_len - data_read_len", which might have underflowed, is passed to "read(fd, data_read + data_read_len, max_len - data_read_len)". [Note: The source code implementation of the function has been overridden by a builtin model.]
      #  596|           }
      #  597|   
      #  598|->         while ((read_len = read(fd, data_read + data_read_len, max_len - data_read_len)) > 0) {
      #  599|                   data_read_len += read_len;
      #  600|                   if (data_read_len == max_len) { 
      # 1473|   
      # 1474|   exit:
      # 1475|-> 	strs_destroy(&strs);
      # 1476|   
      # 1477|   	if (rc != 0) {
      
      

              vmojzis@redhat.com Vit Mojzis
              vmojzis@redhat.com Vit Mojzis
              Amith Kumar Peethambaran Amith Kumar Peethambaran
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

                Created:
                Updated: