From owner-freebsd-security@FreeBSD.ORG Sun Oct 7 20:57:36 2007 Return-Path: Delivered-To: freebsd-security@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B2B2616A419 for ; Sun, 7 Oct 2007 20:57:36 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from gnome.kiev.sovam.com (gnome.kiev.sovam.com [212.109.32.24]) by mx1.freebsd.org (Postfix) with ESMTP id 5857D13C44B for ; Sun, 7 Oct 2007 20:57:36 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from relay02.kiev.sovam.com ([62.64.120.197]) by gnome.kiev.sovam.com with esmtp (Exim 4.67 (FreeBSD)) (envelope-from ) id 1IeaUB-0001mQ-6b for freebsd-security@freebsd.org; Sun, 07 Oct 2007 21:04:15 +0300 Received: from [212.82.216.226] (helo=deviant.kiev.zoral.com.ua) by relay02.kiev.sovam.com with esmtps (TLSv1:AES256-SHA:256) (Exim 4.67) (envelope-from ) id 1IeaUA-000I8y-A0 for freebsd-security@freebsd.org; Sun, 07 Oct 2007 21:04:14 +0300 Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.1/8.14.1) with ESMTP id l97I42xk071213; Sun, 7 Oct 2007 21:04:02 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.1/8.14.1/Submit) id l97I42Gp071212; Sun, 7 Oct 2007 21:04:02 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Sun, 7 Oct 2007 21:04:02 +0300 From: Kostik Belousov To: "Zane C.B." Message-ID: <20071007180402.GI2180@deviant.kiev.zoral.com.ua> References: <20071007105258.2d4c2e37@vixen42> <47090895.9050202@nruns.com> <20071007122805.3853bffe@vixen42> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="wIc/V6YLA2QdyfT4" Content-Disposition: inline In-Reply-To: <20071007122805.3853bffe@vixen42> User-Agent: Mutt/1.4.2.3i X-Scanner-Signature: b22dd54e5e410b0526d530b08df0ebb5 X-DrWeb-checked: yes X-SpamTest-Envelope-From: kostikbel@gmail.com X-SpamTest-Group-ID: 00000000 X-SpamTest-Info: Profiles 1563 [Oct 05 2007] X-SpamTest-Info: helo_type=3 X-SpamTest-Info: {received from trusted relay: not dialup} X-SpamTest-Method: none X-SpamTest-Method: Local Lists X-SpamTest-Rate: 0 X-SpamTest-Status: Not detected X-SpamTest-Status-Extended: not_detected X-SpamTest-Version: SMTP-Filter Version 3.0.0 [0255], KAS30/Release Cc: freebsd-security@freebsd.org, Jan M?nther Subject: Re: issetugid() for other procs X-BeenThere: freebsd-security@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Security issues \[members-only posting\]" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Oct 2007 20:57:36 -0000 --wIc/V6YLA2QdyfT4 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Oct 07, 2007 at 12:28:05PM -0500, Zane C.B. wrote: > On Sun, 07 Oct 2007 18:25:57 +0200 > Jan M?nther wrote: >=20 > > man getuid, man geteuid. >=20 > This does work for other procs, only the one that is calling it. >=20 > Like I said initially I am looking to check if another proc has run > setuid, seteuid, or been executed or forked by one that has. Note that what you trying to do is racy by definition. To get the value of issetugid() for some other process, as it _could_ be returned at some moment in a time, you shall check the P_SUGID bit of the p_flag from the corresponding struct proc. This is available by the kvm_getprocs(3) interface in the ki_flag field of the kinfo_proc structure, see corresponding man page. --wIc/V6YLA2QdyfT4 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.4 (FreeBSD) iD8DBQFHCR+RC3+MBN1Mb4gRAu8yAKDXBQ2KBIDxA7ocXQ4ARCE/mI3E+ACdHKo7 Wz6mPiqcvH1dgd1tRg2WNKw= =9a+s -----END PGP SIGNATURE----- --wIc/V6YLA2QdyfT4--