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

Building cockpit with ASAN+UBSAN support fails in a test due to initializing "pamh" to NULL

Linking RHIVOS CVEs to...Migration: Automation ...SWIFT: POC ConversionSync from "Extern...XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • rhel-9.7
    • rhel-9.6
    • cockpit
    • None
    • cockpit-343-1.el9
    • No
    • Low
    • 1
    • rhel-cockpit
    • 1
    • False
    • False
    • Hide

      None

      Show
      None
    • None
    • Red Hat Enterprise Linux
    • 25Q3 - July/16
    • Unspecified
    • Unspecified
    • Unspecified
    • None

      Trying to build cockpit with ASAN+UBSAN support (spec file attached), it appears that the project doesn't build because of a test failure:

      test-ssh-add: pam_ssh_add: src/pam-ssh-add/pam-ssh-add.c:349:3: runtime error: null pointer passed as argument 1, which is declared to never be null
      

      The root cause is passing pamh through a stack of multiple functions, with pamh initialized to NULL initially, which is prohibited by pam_modutil_sanitize_helper_fds declaration:

      1 test-ssh-add.c test_keys            347 ret = pam_ssh_add_load (NULL, fix->pw, "mock-socket", fix->password);
      2 test-ssh-add.c test_key_environment 365 ret = pam_ssh_add_load (NULL, fix->pw, NULL, NULL);
      3 test-ssh-add.c test_key_environment 381 ret = pam_ssh_add_load (NULL, fix->pw, "mock-socket", NULL);
      
      1 test-ssh-add.c run_test_agent_environment 207 ret = pam_ssh_add_start_agent (NULL, fix->pw, xdg_runtime, NULL, NULL);
      2 test-ssh-add.c test_failed_agent          251 ret = pam_ssh_add_start_agent (NULL, fix->pw, NULL, &sock, &pid);
      3 test-ssh-add.c test_bad_agent_vars        274 ret = pam_ssh_add_start_agent (NULL, fix->pw, NULL, &sock, &pid);
      4 test-ssh-add.c test_good_agent_vars       296 ret = pam_ssh_add_start_agent (NULL, fix->pw, NULL, &sock, &pid);
      

      Call stacks:

      • pam_ssh_add_load() > run_as_user() > setup_child() > pam_modutil_sanitize_helper_fds()
      • pam_ssh_add_start_agent() > run_as_user() > setup_child() > pam_modutil_sanitize_helper_fds()

      There is also a warning on a different test:

      src/common/test-jsonfds.c: In function 'test_print_string_memory_safety':
      src/common/test-jsonfds.c:320:32: warning: 'reps' may be used uninitialized in this function [-Wmaybe-uninitialized]
        320 |           for (gint i = length - reps + 1; i <= length; i++)
            |                         ~~~~~~~^~~~~~
      

        1. cockpit.spec
          86 kB
        2. ASAN_UBSAN.patch
          0.8 kB

              rhn-engineering-mpitt Martin Pitt
              rhn-support-rmetrich Renaud Métrich
              RH Bugzilla Integration RH Bugzilla Integration
              Jan Scotka Jan Scotka
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

                Created:
                Updated: