Bug 1643941 - haproxy basic auth broken when using nbthread
Summary: haproxy basic auth broken when using nbthread
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: haproxy
Version: 29
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Ryan O'Hara
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
: 1643560 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-10-29 13:45 UTC by Robin
Modified: 2018-12-14 20:41 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-12-11 17:04:09 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
BUG/MEDIUM: auth/threads: use of crypt() is not thread-safe (2.65 KB, patch)
2018-10-30 15:09 UTC, Ryan O'Hara
no flags Details | Diff

Description Robin 2018-10-29 13:45:03 UTC
Description of problem: When running haproxy with the `nbthread` directive in the configuration `http-request auth` is broken.


Version-Release number of selected component (if applicable): haproxy-1.8.14-1.fc29


How reproducible: Almost always (data race?)


Steps to Reproduce:
1. git clone https://github.com/rbjorklin/selinux-haproxy-bug.git
2. ./setup29.sh
3. visit http://localhost:8080/
4. enter credentials test/test

Actual results: Credential popup keeps reappearing.


Expected results: Credential popup disappears and site proceeds to load correctly.


Additional info: This does not seem to happen on the official haproxy docker image based on Debian. Try it out by running ./setup.sh in the above mentioned git repository.

Comment 1 Robin 2018-10-29 13:47:26 UTC
*** Bug 1643560 has been marked as a duplicate of this bug. ***

Comment 2 Ryan O'Hara 2018-10-29 16:26:57 UTC
I mentioned this to upstream and was told that they could not reproduce the problem using the scripts -- it works 10% of the time. You might want to start a discussion there.

I saw the other BZ related to selinux. How are you disabling selinux? Is it disabled on the host and the docker image? Do you have any haproxy logs?

Comment 3 Ryan O'Hara 2018-10-29 16:28:23 UTC
(In reply to Ryan O'Hara from comment #2)
> I mentioned this to upstream and was told that they could not reproduce the
> problem using the scripts -- it works 10% of the time. You might want to
> start a discussion there.

Sorry, meant to say 100% of the the time. Big difference. :)

Comment 4 Robin 2018-10-30 12:49:19 UTC
To disable selinux I ran "setenforce 0" on the host system. I don't have any haproxy logs as nothing really useful is printed to journald.

I can't reproduce this with the official haproxy image either, only under Fedora which makes me wonder if there are any patches applied in the build chain which are not used by upstream?

Comment 5 Ryan O'Hara 2018-10-30 15:07:45 UTC
(In reply to Robin from comment #4)
> To disable selinux I ran "setenforce 0" on the host system. I don't have any
> haproxy logs as nothing really useful is printed to journald.

OK.

> I can't reproduce this with the official haproxy image either, only under
> Fedora which makes me wonder if there are any patches applied in the build
> chain which are not used by upstream?

No, haproxy in Fedora is unpatched. Same bits as upstream.

I talked with upstream about this and Willy sent a possible patch. I do not know if this will fix the problem. Applying the patch and releasing an update in Fedora is easy enough, but I am unsure how/where/when the Fedora image is created. If you know and want to test the patch, please advise. I will attach the patch.

Comment 6 Ryan O'Hara 2018-10-30 15:09:18 UTC
Created attachment 1498983 [details]
BUG/MEDIUM: auth/threads: use of crypt() is not thread-safe

Potential patch to solve issue. Unsure if this will resolve problem.

Comment 7 Ryan O'Hara 2018-12-01 19:47:59 UTC
I am going to commit this patch and would greatly appreciate any assistance testing. First order of business is to figure out how/when the docker images are being built.

Comment 8 Fedora Update System 2018-12-01 20:22:08 UTC
haproxy-1.8.14-2.fc29 has been submitted as an update to Fedora 29. https://bodhi.fedoraproject.org/updates/FEDORA-2018-7d14594565

Comment 9 Fedora Update System 2018-12-02 10:10:24 UTC
haproxy-1.8.14-2.fc29 has been pushed to the Fedora 29 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2018-7d14594565

Comment 10 Randy Barlow 2018-12-11 17:04:09 UTC
A Fedora update associated with this bug has been pushed to the stable repository.

Comment 11 Randy Barlow 2018-12-14 20:41:19 UTC
A Fedora update associated with this bug has been pushed to the stable repository.


Note You need to log in before you can comment on or make changes to this bug.