Bug 28061 - A failing dlmopen called by an auditor crashed
Summary: A failing dlmopen called by an auditor crashed
Status: RESOLVED FIXED
Alias: None
Product: glibc
Classification: Unclassified
Component: dynamic-link (show other bugs)
Version: unspecified
: P2 normal
Target Milestone: 2.35
Assignee: Adhemerval Zanella
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-07-07 13:13 UTC by Adhemerval Zanella
Modified: 2021-12-28 11:52 UTC (History)
0 users

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Adhemerval Zanella 2021-07-07 13:13:55 UTC
$ cat main.c 
int main (int argc, char *argv[])
{
  return 0;
}
$ cat auditor.c 
#define _GNU_SOURCE
#include <link.h>
#include <dlfcn.h>

unsigned int
la_version (unsigned int v)
{
  return LAV_CURRENT;
}

void la_activity (uintptr_t* cookie, unsigned int flag)
{
  dlmopen(LM_ID_BASE, "/nonexistent.so", RTLD_NOW);
}
$ gcc -Wall main.c -o main
$ gcc -shared -fpic auditor.c -o libauditor.so -ldl
$ LD_AUDIT=./libauditor.so ./main 
Segmentation fault (core dumped)
Comment 1 Adhemerval Zanella 2021-12-28 11:52:28 UTC
Fixed on 2.35 (484e672ddabe0a919a692520e6ac8f2580866235).