Skip to content

Subaudit/update_pltbind.c contains unreachable code #149

@SamHerts

Description

@SamHerts

Priority: Low

Spindle has two interception paths: the standard LD_AUDIT path (used on x86_64 and aarch64) and the SubAudit path (OPT_SUBAUDIT) which has only remaining use case of ppc64le.

Bug: spindleint_none is an unreachable enum state.

has_spindleint = ld_preload && strstr(ld_preload, "libspindleint.so") ? spindleint_present : spindleint_unset;

Sets has_spindleint to either spindleint_present or spindleint_unset, but
if (has_spindleint == spindleint_none)
redirect_interceptions(update_list[i]);

checks for spindleint_none.

Because has_spindleint is never set to spindleint_none, two things follow:

  1. getenv("LD_PRELOAD") + strstr is called on every la_activity event for the lifetime of the process, rather than being cached after the first check.
  2. The redirect_interceptions() call at line 231 is unreachable dead code — spindleint_none is defined in the enum and has a consumer, but is never assigned.

Fix:

has_spindleint = ld_preload && strstr(ld_preload, "libspindleint.so") ? spindleint_present : spindleint_none;

Potential follow-up:

  • Confirm whether redirect_interceptions() / spindleint_none represents intentional design or can be removed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions