libpam-cap causes PAM applications to crash
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
libcap2 (Ubuntu) |
Triaged
|
Medium
|
Unassigned |
Bug Description
Install ocserv and setup for PAM authentication. On second connection, ocserv crashes due to a double free in PAM.
Repro steps:
1. Create Dockerfile that installs ocserv + libpam-cap
```
FROM ubuntu:20.04
RUN apt update && apt install -y ocserv libpam-cap && apt autoremove && apt clean
COPY server-cert.pem /etc/ssl/
COPY server-key.pem /etc/ssl/
COPY ca-cert.pem /etc/ssl/
COPY ocserv.conf /etc/ocserv/
RUN useradd test
RUN echo "test\ntest" | passwd test
ENV MALLOC_CHECK_=3
CMD ocserv -f -d 1
```
2. Build container:
```
sudo docker build -t ocserv:20.04 .
```
3. Launch container:
```
docker run -p 443:443/tcp -p 443:443/udp -it --rm --device /dev/net/tun --cap-add net_admin ocserv:20.04
```
4. From another console, connect / disconnect:
```
while true; do echo test | openconnect https:/
```
5. ocserv crashes:
free(): invalid pointer
ocserv[8]: main: main-sec-
ocserv[8]: main: main.c:1179: error in command from sec-mod
ocserv[8]: main: termination request received; waiting for children to die
For more details see:
https:/
Changed in libcap2 (Ubuntu): | |
importance: | Undecided → Medium |
Changed in libcap2 (Ubuntu): | |
status: | Confirmed → Triaged |
Confirmed the issue