Bugzilla – Bug 64002
VUL-0: CVE-2004-1014: rpc.statd DoS
Last modified: 2021-10-14 14:58:50 UTC
We missed the following report from vendor-sec. The issue is public meanwhile. Date: Mon, 22 Nov 2004 10:21:42 -0500 From: Josh Bressers <bressers@redhat.com> To: vendor-sec@lst.de Subject: [vendor-sec] DoS in nfs-utils statd Hello, SGI has reported to us a DoS in statd. statd doesn't properly ignore SIGPIPE, which means a misconfigured or malicious peer could shut it down. It also has several printf formatting problems (like passing only one argument to a routine with two or three format specifiers). The printf formatting problems don't appear to be security related, but do clarify the code a bit. The current embargo date for this issue is 2004-12-01 1400UTC. -- JB diff -prauN --exclude-from=excludes nfs-utils-sgi/nfs-utils-1.0.6/utils/statd/monitor.c nfs-utils-work/nfs-utils-1.0.6/utils/statd/monitor.c --- nfs-utils-sgi/nfs-utils-1.0.6/utils/statd/monitor.c Fri Sep 12 15:41:35 2003 +++ nfs-utils-work/nfs-utils-1.0.6/utils/statd/monitor.c Sun Jun 20 23:41:01 2004 #include <string.h> #include <unistd.h> #include <sys/stat.h> +#include <errno.h> #include <arpa/inet.h> #include "misc.h" #include "statd.h" sprintf(path, "%s/%s", SM_DIR, mon_name); if ((fd = open(path, O_WRONLY|O_SYNC|O_CREAT, S_IRUSR|S_IWUSR)) < 0) { /* Didn't fly. We won't monitor. */ - note(N_ERROR, "creat(%s) failed: %m", path); + note(N_ERROR, "creat(%s) failed: %s", path, strerror (errno)); nlist_free(NULL, clnt); free(path); goto failure; diff -prauN --exclude-from=excludes nfs-utils-sgi/nfs-utils-1.0.6/utils/statd/simulate.c nfs-utils-work/nfs-utils-1.0.6/utils/statd/simulate.c --- nfs-utils-sgi/nfs-utils-1.0.6/utils/statd/simulate.c Fri Sep 12 15:41:38 2003 +++ nfs-utils-work/nfs-utils-1.0.6/utils/statd/simulate.c Sun Jun 20 22:51:15 2004 { static char *result; - dprintf (N_DEBUG, "Recieved state %d for mon_name %s (opaque \"%s\")", + dprintf (N_DEBUG, "Received state %d for mon_name %s (opaque \"%s\")", argp->state, argp->mon_name, argp->priv); svc_exit (); return ((void *)&result); diff -prauN --exclude-from=excludes nfs-utils-sgi/nfs-utils-1.0.6/utils/statd/statd.c nfs-utils-work/nfs-utils-1.0.6/utils/statd/statd.c --- nfs-utils-sgi/nfs-utils-1.0.6/utils/statd/statd.c Fri Sep 12 16:24:29 2003 +++ nfs-utils-work/nfs-utils-1.0.6/utils/statd/statd.c Sun Jun 20 22:39:11 2004 struct stat st; if (stat(SM_DIR, &st) == -1 && - stat(DIR_BASE, &st) == -1) + stat(DIR_BASE, &st) == -1) { st.st_uid = 0; + st.st_gid = 0; + } if (st.st_uid == 0) { note(N_WARNING, "statd running as root. chown %s to choose different user\n", signal (SIGTERM, killer); /* WARNING: the following works on Linux and SysV, but not BSD! */ signal(SIGCHLD, SIG_IGN); + /* + * Ignore SIGPIPE to avoid statd dying when peers close their + * TCP connection while we're trying to reply to them. + */ + signal(SIGPIPE, SIG_IGN); /* initialize out_port */ statd_get_socket(out_port); diff -prauN --exclude-from=excludes nfs-utils-sgi/nfs-utils-1.0.6/utils/statd/svc_run.c nfs-utils-work/nfs-utils-1.0.6/utils/statd/svc_run.c --- nfs-utils-sgi/nfs-utils-1.0.6/utils/statd/svc_run.c Fri Sep 12 15:41:40 2003 +++ nfs-utils-work/nfs-utils-1.0.6/utils/statd/svc_run.c Sun Jun 20 22:40:28 2004 if (errno == EINTR || errno == ECONNREFUSED || errno == ENETUNREACH || errno == EHOSTUNREACH) continue; - note(N_ERROR, "my_svc_run() - select: %m"); + note(N_ERROR, "my_svc_run() - select: %s", + strerror (errno)); return; case 0:
Created attachment 26816 [details] patch
no, the report was not missed. rpc.statd from nfs-utils was never packaged (at least not since SuSE 7.x) we use rpc.statd from the quota package.
<!-- SBZ_reopen -->Reopened by okir@suse.de at Wed Dec 8 09:45:59 2004, took initial reporter lnussel@suse.de to cc
Are you sure? There is only one rpc.statd. I think you're referring to rpc.rquotad, where indeed two versions exist (but the one from nfs-utils is essentially unmaintained)
btw, rpc.rstatd does not come from nfs-utils on our distros, but from the rstatd RPM. The code there looks different.
there is no change in SIGCHLD handling in rstatd, so I suspect we are affected too. -> reassign to maintainer
statd != rstatd
my bad
not shipping -> close
<!-- SBZ_reopen -->Reopened by meissner@suse.de at Wed Dec 8 10:48:56 2004
more coffee. its in older products and is in nfs-utils, so we are affecgted
damn you're right... it's really in SLES8 ...
patch for nfs-utils-1.0.1 (one hunk missing, n/a for version 1.0.1)
Created attachment 26856 [details] patch ported to 1.0.1
CAN-2004-1014
ok, done for 8.1,8.2,9.0 (added a few more %m replacements in rmtcall.c) 9.1 and newer do not have statd any more. are you going to create patchinfos ?
yes. Please add the CAN number to the changelog if the package is not checked in yet
Created attachment 26858 [details] nfs-utils.patch.maintained
Created attachment 26859 [details] nfs-utils.patch.box
packages approved
CVE-2004-1014: CVSS v2 Base Score: 5.0 (AV:N/AC:L/Au:N/C:N/I:N/A:P)