sysutils/fuser allows user to send any signal to any process when installed with suid bit Fix: patch: How-To-Repeat: # chmod +s /usr/local/bin/fuser (as recommended in pkg-message) % fuser -k /usr/sbin/syslogd
Responsible Changed From-To: freebsd-ports-bugs->stas Over to maintainer (via the GNATS Auto Assign Tool)
now I see, better way: diff -urN fuser/files/patch-fuser.c.orig fuser/files/patch-fuser.c --- fuser/files/patch-fuser.c.orig 1970-01-01 03:00:00.000000000 +0300 +++ fuser/files/patch-fuser.c 2009-12-21 22:52:36.000000000 +0300 @@ -0,0 +1,35 @@ +--- fuser.c.orig 2006-03-14 14:07:08.000000000 +0300 ++++ fuser.c 2009-12-21 22:51:33.000000000 +0300 +@@ -608,6 +608,7 @@ + char *ep; + char *kernimg = NULL; /* We are using curr. sys by default */ + char *mcore = NULL; ++ int retvalue = 0; + + while ((ch = getopt(argc, argv, "C:K:cfkms:u")) != -1) + switch(ch) { +@@ -696,8 +697,13 @@ + if (ufl != 0) { + print_file_info(pinfo->pid, \ + pinfo->uid, ufl); +- if ((flags & KFLAG) != 0) +- (void)kill(pinfo->pid, sig); ++ if ((flags & KFLAG) != 0) { ++ if (geteuid() == getuid() || pinfo->uid == getuid()) { ++ (void)kill(pinfo->pid, sig); ++ } else { ++ retvalue = 1; ++ } ++ } + } + } + (void)fprintf(stderr, "\n"); +@@ -707,7 +713,7 @@ + SLIST_FREE(&prclist, next, pinfo_free); + (void)kvm_close(kd); + +- return 0; ++ return retvalue; + + } + -- Cheers Denis Barov
stas 2009-12-21 21:49:39 UTC FreeBSD ports repository Modified files: sysutils/fuser Makefile Added files: sysutils/fuser/files extra::patch-nfs.c patch-fuser.c Log: - Fix build on HEAD. - Do not allow the user to send signals to arbitrary processes if setuid binary is used. PR: ports/141852 Submitted by: Denis Barov <dindin@dindin.ru> Security: http://www.freebsd.org/ports/portaudit/4d6076fe-ee7a-11de-9cd0-001a926c7637.html Revision Changes Path 1.10 +2 -2 ports/sysutils/fuser/Makefile 1.1 +10 -0 ports/sysutils/fuser/files/extra::patch-nfs.c (new) 1.1 +35 -0 ports/sysutils/fuser/files/patch-fuser.c (new) _______________________________________________ cvs-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/cvs-all To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
State Changed From-To: open->closed Committed. Thanks!