haproxy/src
Willy Tarreau 340b07e868 BUG/MAJOR: hashes: fix the signedness of the hash inputs
Wietse Venema reported in the thread below that we have a signedness
issue with our hashes implementations: due to the use of const char*
for the input key that's often text, the crc32, sdbm, djb2, and wt6
algorithms return a platform-dependent value for binary input keys
containing bytes with bit 7 set. This means that an ARM or PPC
platform will hash binary inputs differently from an x86 typically.
Worse, some algorithms are well defined in the industry (like CRC32)
and do not provide the expected result on x86, possibly causing
interoperability issues (e.g. a user-agent would fail to compare the
CRC32 of a message body against the one computed by haproxy).

Fortunately, and contrary to the first impression, the CRC32c variant
used in the PROXY protocol processing is not affected. Thus the impact
remains very limited (the vast majority of input keys are text-based,
such as user-agent headers for exmaple).

This patch addresses the issue by fixing all hash functions' prototypes
(even those not affected, for API consistency). A reg test will follow
in another patch.

The vast majority of users do not use these hashes. And among those
using them, very few will pass them on binary inputs. However, for the
rare ones doing it, this fix MAY have an impact during the upgrade. For
example if the package is upgraded on one LB then on another one, and
the CRC32 of a binary input is used as a stick table key (why?) then
these CRCs will not match between both nodes. Similarly, if
"hash-type ... crc32" is used, LB inconsistency may appear during the
transition. For this reason it is preferable to apply the patch on all
nodes using such hashes at the same time. Systems upgraded via their
distros will likely observe the least impact since they're expected to
be upgraded within a short time frame.

And it is important for distros NOT to skip this fix, in order to avoid
distributing an incompatible implementation of a hash. This is the
reason why this patch is tagged as MAJOR, eventhough it's extremely
unlikely that anyone will ever notice a change at all.

This patch must be backported to all supported branches since the
hashes were introduced in 1.5-dev20 (commit 98634f0c). Some parts
may be dropped since implemented later.

Link to Wietse's report:
  https://marc.info/?l=postfix-users&m=157879464518535&w=2
2020-01-16 08:23:42 +01:00
..
51d.c
acl.c
action.c
activity.c
applet.c
arg.c
auth.c
backend.c BUG/MEDIUM: connections: Hold the lock when wanting to kill a connection. 2019-12-30 18:18:28 +01:00
base64.c
buffer.c
cache.c MINOR: chunk: add chunk_istcat() to concatenate an ist after a chunk 2019-10-29 13:09:14 +01:00
calltrace.c
cfgparse-global.c MEDIUM: init: set NO_NEW_PRIVS by default when supported 2019-12-06 17:20:26 +01:00
cfgparse-listen.c MINOR: http: add a new "replace-path" action 2019-12-19 09:24:57 +01:00
cfgparse.c MEDIUM: init: prevent process and thread creation at runtime 2019-12-03 11:49:00 +01:00
channel.c BUG/MINOR: channel: inject output data at the end of output 2020-01-07 10:51:15 +01:00
checks.c BUG/MEDIUM: checks: Only attempt to do handshakes if the connection is ready. 2019-12-30 15:18:16 +01:00
chunk.c
cli.c BUG/MINOR: cli/mworker: can't start haproxy with 2 programs 2020-01-14 15:42:38 +01:00
compression.c
connection.c CLEANUP: connection: merge CO_FL_NOTIFY_DATA and CO_FL_NOTIFY_DONE 2019-12-27 16:38:47 +01:00
da.c
debug.c MINOR: debug: replace popen() with pipe+fork() in "debug dev exec" 2019-12-06 17:20:26 +01:00
dict.c
dns.c MEDIUM: dns: implement synchronous send 2020-01-08 06:10:38 +01:00
ev_epoll.c OPTIM: epoll: always poll for recv if neither active nor ready 2019-12-27 16:38:47 +01:00
ev_evports.c MINOR: pollers: add a new flag to indicate pollers reporting ERR & HUP 2019-12-27 14:04:33 +01:00
ev_kqueue.c MINOR: pollers: add a new flag to indicate pollers reporting ERR & HUP 2019-12-27 14:04:33 +01:00
ev_poll.c MINOR: pollers: add a new flag to indicate pollers reporting ERR & HUP 2019-12-27 14:04:33 +01:00
ev_select.c
fcgi-app.c BUG/MINOR: fcgi-app: Make the directive pass-header case insensitive 2019-12-02 10:38:52 +01:00
fcgi.c
fd.c BUG/MEDIUM: fd/threads: fix a concurrency issue between add and rm on the same fd 2019-12-20 08:09:28 +01:00
filters.c MEDIUM: filters: Adapt filters API to allow again TCP filtering on HTX streams 2019-11-15 13:43:08 +01:00
flt_http_comp.c CLEANUP: compression: remove unused deinit_comp_ctx section 2020-01-15 10:58:17 +01:00
flt_spoe.c BUG/MINOR: spoe: fix off-by-one length in UUID format string 2019-10-29 10:33:13 +01:00
flt_trace.c MEDIUM: filters: Adapt filters API to allow again TCP filtering on HTX streams 2019-11-15 13:43:08 +01:00
freq_ctr.c
frontend.c
h1.c BUG/MINOR: h1: Report the right error position when a header value is invalid 2020-01-06 13:58:21 +01:00
h1_htx.c MEDIUM: h1-htx: Add HTX EOM block when the message is in H1_MSG_DONE state 2019-12-11 16:46:16 +01:00
h2.c BUG/MAJOR: h2: make header field name filtering stronger 2019-11-25 11:11:32 +01:00
haproxy.c BUG/MEDIUM: mworker: remain in mworker mode during reload 2020-01-14 18:10:29 +01:00
hash.c BUG/MAJOR: hashes: fix the signedness of the hash inputs 2020-01-16 08:23:42 +01:00
hathreads.c BUILD/MEDIUM: threads: rename thread_info struct to ha_thread_info 2019-10-17 07:15:17 +02:00
hlua.c MEDIUM: lua: don't call the GC as often when dealing with outgoing connections 2020-01-14 10:12:31 +01:00
hlua_fcn.c
hpack-dec.c
hpack-enc.c
hpack-huff.c
hpack-tbl.c
http.c MINOR: http: Add 404 to http-request deny 2020-01-08 16:15:23 +01:00
http_acl.c
http_act.c MINOR: http: add a new "replace-path" action 2019-12-19 09:24:57 +01:00
http_ana.c BUG/MEDIUM: http-ana: Truncate the response when a redirect rule is applied 2020-01-07 10:50:28 +01:00
http_conv.c MINOR: sample: add us/ms support to date/http_date 2019-10-31 08:47:31 +01:00
http_fetch.c CLEANUP: h1-htx: Move htx-to-h1 formatting functions from htx.c to h1_htx.c 2019-10-14 22:28:50 +02:00
http_htx.c MINOR: http-htx: Add some htx sample fetches for debugging purpose 2019-12-11 16:46:16 +01:00
http_rules.c
htx.c CLEANUP: h1-htx: Move htx-to-h1 formatting functions from htx.c to h1_htx.c 2019-10-14 22:28:50 +02:00
i386-linux-vsys.c
lb_chash.c
lb_fas.c
lb_fwlc.c
lb_fwrr.c
lb_map.c
listener.c BUG/MAJOR: listener: do not schedule a task-less proxy 2020-01-08 19:39:09 +01:00
log.c BUG/MINOR: log: fix minor resource leaks on logformat error path 2019-12-11 12:05:39 +01:00
lru.c
mailers.c
map.c
memory.c
mux_fcgi.c MEDIUM: h1-htx: Add HTX EOM block when the message is in H1_MSG_DONE state 2019-12-11 16:46:16 +01:00
mux_h1.c BUG/MEDIUM: mux_h1: Don't call h1_send if we subscribed(). 2020-01-15 19:13:32 +01:00
mux_h2.c BUG/MEDIUM: mux-h2: don't stop sending when crossing a buffer boundary 2020-01-14 13:55:04 +01:00
mux_pt.c MINOR: mux: Add a new method to get informations about a mux. 2019-10-29 14:15:20 +01:00
mworker-prog.c
mworker.c BUG/MINOR: mworker: properly pass SIGTTOU/SIGTTIN to workers 2019-12-11 14:26:53 +01:00
namespace.c
pattern.c BUG/MEDIUM: pattern: make the pattern LRU cache thread-local and lockless 2019-10-23 07:27:25 +02:00
payload.c
peers.c BUG/MINOR: peers: "peer alive" flag not reset when deconnecting. 2019-11-20 13:38:13 +01:00
pipe.c
proto_sockpair.c
proto_tcp.c REORG: connection: move tcp_connect_probe() to conn_fd_check() 2019-12-27 16:38:43 +01:00
proto_udp.c BUG/MEDIUM: proto_udp/threads: recv() and send() must not be exclusive. 2019-12-10 19:09:15 +01:00
proto_uxst.c BUILD/MINOR: unix sockets: silence an absurd gcc warning about strncpy() 2019-12-11 16:29:10 +01:00
protocol.c
proxy.c CLEANUP: proxy: simplify proxy_parse_rate_limit proxy checks 2020-01-16 07:04:05 +01:00
queue.c BUG/MINOR: queue/threads: make the queue unlinking atomic 2019-11-14 14:58:39 +01:00
raw_sock.c BUG/MEDIUM: raw_sock: Make sur the fd and conn are sync. 2020-01-15 19:16:23 +01:00
regex.c
ring.c MINOR: ring: make the parse function automatically set the handler/release 2019-11-15 15:48:12 +01:00
sample.c MINOR: debug: support logging to various sinks 2019-12-19 09:19:13 +01:00
server.c CLEANUP: server: remove unused err section in server_finalize_init 2020-01-09 05:54:48 +01:00
session.c BUG/MEDIUM: session: do not report a failure when rejecting a session 2020-01-07 18:15:32 +01:00
sha1.c
shctx.c
signal.c
sink.c MINOR: ring: make the parse function automatically set the handler/release 2019-11-15 15:48:12 +01:00
ssl_sock.c CLEANUP: ssl: remove opendir call in ssl_sock_load_cert 2020-01-13 19:51:52 +01:00
standard.c BUILD/MINOR: tools: shut up the format truncation warning in get_gmt_offset() 2019-10-29 10:19:34 +01:00
stats.c BUG/MINOR: stats: Fix HTML output for the frontends heading 2019-12-02 11:40:04 +01:00
stick_table.c MINOR: stick-table: allow sc-set-gpt0 to set value from an expression 2019-11-15 18:24:19 +01:00
stream.c BUILD/MINOR: trace: fix use of long type in a few printf format strings 2019-11-27 15:45:11 +01:00
stream_interface.c BUG/MINOR: stream-int: Don't trigger L7 retry if max retries is already reached 2020-01-09 15:39:06 +01:00
task.c BUG/MAJOR: task: add a new TASK_SHARED_WQ flag to fix foreing requeuing 2019-12-19 14:42:22 +01:00
tcp_rules.c MEDIUM: stream/trace: Register a new trace source with its events 2019-11-06 10:14:32 +01:00
time.c
trace.c BUG/MEDIUM: trace: fix a typo causing an incorrect startup error 2019-11-25 19:47:22 +01:00
uri_auth.c
vars.c
version.c MINOR: version: make the version strings variables, not constants 2019-10-16 09:56:57 +02:00
wdt.c BUILD/MEDIUM: threads: rename thread_info struct to ha_thread_info 2019-10-17 07:15:17 +02:00
wurfl.c BUG/MINOR: WURFL: fix send_log() function arguments 2019-10-15 10:47:31 +02:00
xprt_handshake.c
xxhash.c