Bug 1940341
Summary: | CVE-2021-46828 libtirpc: rpcbind sockets remain ESTABLISHED indefinitely after port scan. [rhel-8.6.0] | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | Red Hat Enterprise Linux 8 | Reporter: | Ravindra Patil <ravpatil> | ||||||
Component: | libtirpc | Assignee: | Steve Dickson <steved> | ||||||
Status: | CLOSED ERRATA | QA Contact: | Zhi Li <yieli> | ||||||
Severity: | medium | Docs Contact: | |||||||
Priority: | medium | ||||||||
Version: | 8.3 | CC: | calum.mackay, dai.ngo, dchong, peter.vreman, saroy, steved, xzhou, yoyang | ||||||
Target Milestone: | rc | Keywords: | Patch, Reproducer, Security, SecurityTracking, Triaged | ||||||
Target Release: | --- | ||||||||
Hardware: | Unspecified | ||||||||
OS: | Unspecified | ||||||||
Whiteboard: | |||||||||
Fixed In Version: | libtirpc-1.1.4-6.el8 | Doc Type: | If docs needed, set a value | ||||||
Doc Text: | Story Points: | --- | |||||||
Clone Of: | |||||||||
: | 2038662 (view as bug list) | Environment: | |||||||
Last Closed: | 2022-05-10 15:24:57 UTC | Type: | Bug | ||||||
Regression: | --- | Mount Type: | --- | ||||||
Documentation: | --- | CRM: | |||||||
Verified Versions: | Category: | --- | |||||||
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||||
Cloudforms Team: | --- | Target Upstream Version: | |||||||
Embargoed: | |||||||||
Bug Depends On: | |||||||||
Bug Blocks: | 2038662, 2109352 | ||||||||
Attachments: |
|
Description
Ravindra Patil
2021-03-18 08:57:10 UTC
Created attachment 1811286 [details]
patch for rpcbind
This bug is more serious that what was described above. When the number of idle ESTABLISHED connections reaches the limit of open file descriptors (ulimit -n) then accept(2) fails with EMFILE. Currently svc_run (libtirpc) and my_svc_run (rpcbind) do not handle EMFILE error returned from accept(2), it just ignores the error and continue on. This causes svc_run/my_svc_run to get in a tight loop calling accept(2). Once it gets into this state rpcbind cannot service any requests, basically taking the RPC service down. Note that mountd and statd also suffer the same problem. This is a DoS vulnerability of rpcbind, mountd, statd and any consumers of svc_run in libtirpc. These RPC services are essential for NFSv3 operations. The problem in libtirpc was introduced by commit: b2c9430f46c4 Use poll() instead of select() in svc_run() The problem in rpcbind was introduced by commit: 44bf15b8 rpcbind: don't use obsolete svc_fdset interface of libtirpc These commits removed the handling EMFILE returned by accept(2) and handling of poll timeout in svc_run/my_svc_run. The problem can be reproduced using open source tool 'nc' (ncat). One can run this script to take the RPC service down: #!/bin/sh # Usage: td.sh server dst_port conn_cnt if [ $# -ne 3 ]; then echo "$0: server dst_port conn_cnt" exit fi server=$1 dport=$2 conn_cnt=$3 echo "dport[$dport] server[$server] conn_cnt[$conn_cnt]" pcnt=0 while [ $pcnt -lt $conn_cnt ] do echo "connect from $sport" nc -v --recv-only $server $dport & pcnt=`expr $pcnt + 1` done # ./td.sh server 111 1024 /* take down rpcbind service */ Created attachment 1811287 [details]
patch for libtirpc
(In reply to Dai Ngo from comment #5) > Created attachment 1811287 [details] > patch for libtirpc I'm a bit confused... was this problem take care of with commit 86529758570cef4c73fb9b9c4104fdc510f701ed Author: Dai Ngo <dai.ngo> Date: Sat Aug 21 13:16:23 2021 -0400 Fix DoS vulnerability in libtirpc in both libtirpc and rpcbind? Yes, this problem was taken care of by the fix in libtirpc with commit 86529758570cef4c73fb9b9c4104fdc510f701ed. There is no need to do anything with rpcbind. (In reply to Dai Ngo from comment #8) > Yes, this problem was taken care of by the fix in libtirpc with commit > 86529758570cef4c73fb9b9c4104fdc510f701ed. > There is no need to do anything with rpcbind. I'm just re-setting this bug to libtirpc according to that. Which may clear some flags. Moving to VERIFIED according to comment#14. Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory (libtirpc bug fix and enhancement update), and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2022:2065 *** Bug 2109404 has been marked as a duplicate of this bug. *** *** Bug 2109403 has been marked as a duplicate of this bug. *** |