From owner-freebsd-hackers@freebsd.org Sun Jan 17 08:26:46 2016 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 74552A6AA54 for ; Sun, 17 Jan 2016 08:26:46 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-wm0-x22e.google.com (mail-wm0-x22e.google.com [IPv6:2a00:1450:400c:c09::22e]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 09E4114C2; Sun, 17 Jan 2016 08:26:46 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: by mail-wm0-x22e.google.com with SMTP id 123so17931775wmz.0; Sun, 17 Jan 2016 00:26:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:mail-followup-to:references :mime-version:content-type:content-disposition:in-reply-to :user-agent; bh=p+b4699Ty3jpUESemCp9XDmHLpOoV0qCt/nKG+1uHMo=; b=eaJufzRFY8O9Oto2HwQoNCwzoWcITSeVOKiaBNQ7fIEIXMaBzf/S6TM5L7JIR+VxuP 8m9SlcrLIz+FhKtus0LZYa9gQgE8CMLBy1zGK+1sXAgYXf4NNAnUCkFqSHMgVAHSEKDA 33acCV7NT8tXRPl0m+sT+Mm9AIw1Pey6dkTM4mWzWlc7O4f+Byzzo6g0rAf7YJnZTxPu 4K90/BWyXx8W7ySQWy2Dqfav1iMavIFgYcmpZ/ipfZiLevFPphGY7eRuwf6HTJswFZUj D6txm7Nv0hJU8Ls6FDON5D/Dh6AUDyp7lkeaCMCYRoFRDMh28xTOwF/4f6ih5H7669j2 VFpg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id :mail-followup-to:references:mime-version:content-type :content-disposition:in-reply-to:user-agent; bh=p+b4699Ty3jpUESemCp9XDmHLpOoV0qCt/nKG+1uHMo=; b=DpbgRAsLrhGxkd4FaGcJ7MbVXweXI3kCEj+/deSpKRB+cqOUkMD0nTZD119a3pc8Qy WzYdvJdEm1/WF7iYecSqVNKTrg7naNFTKJGk9RumSq5U2qdZim16cta0ySdForxBmaJL zKuw7ILc1TNZbjDbX4HbrkKplIhNkw5X6UddOquz1Ns1QgiqmkXMu7ZlpXZ3vxSVy1+8 CwcJp3c+G6aNgNQpG0AibOH/qgOEIM0Tt4gY1f15eUZKQKNMQqH0Z1LaM2YxVf+r6yDA HmhgUBofdY3lFqBKJ6dhapC0iTIFxfE3SM8hZ2//yCepF7LBvN/KxPgBYYmyKyXnELXi RDUQ== X-Gm-Message-State: AG10YORe+SQzmZzeEPbLxaWtACgk0Tmw3xkM3QM7mUBQXc4lIC6c1dVeigUfgqHQtPnAHQ== X-Received: by 10.28.97.11 with SMTP id v11mr7677094wmb.42.1453019204539; Sun, 17 Jan 2016 00:26:44 -0800 (PST) Received: from dft-labs.eu (n1x0n-1-pt.tunnel.tserv5.lon1.ipv6.he.net. [2001:470:1f08:1f7::2]) by smtp.gmail.com with ESMTPSA id m143sm10191002wma.17.2016.01.17.00.26.43 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Sun, 17 Jan 2016 00:26:44 -0800 (PST) Date: Sun, 17 Jan 2016 09:26:42 +0100 From: Mateusz Guzik To: Chagin Dmitry Cc: Konstantin Belousov , Vijay Singh , freebsd-hackers@freebsd.org Subject: Re: irrelevant locking Message-ID: <20160117082642.GC1963@dft-labs.eu> Mail-Followup-To: Mateusz Guzik , Chagin Dmitry , Konstantin Belousov , Vijay Singh , freebsd-hackers@freebsd.org References: <20160116195819.GA41610@chd.heemeyer.club> <20160116202643.GL3942@kib.kiev.ua> <20160116224312.GA1963@dft-labs.eu> <20160117034315.GN3942@kib.kiev.ua> <20160117080515.GA32432@chd.heemeyer.club> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20160117080515.GA32432@chd.heemeyer.club> User-Agent: Mutt/1.5.21 (2010-09-15) X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Jan 2016 08:26:46 -0000 On Sun, Jan 17, 2016 at 11:05:15AM +0300, Chagin Dmitry wrote: > On Sun, Jan 17, 2016 at 05:43:15AM +0200, Konstantin Belousov wrote: > > On Sat, Jan 16, 2016 at 11:43:13PM +0100, Mateusz Guzik wrote: > > > The real question is if it would make sense to add the bit to elf aux > > > vector to save the call as done by the loader. > > I once did a pass to remove (most of) sysctls executed during process > > startup. issetugid indeed may be treated same. > > like a Linux AT_SECURE? our P_SUGID bit can be changed after exec, > so the result of issetugid() implementated on auxv table will be unnafected > by calls to setuid(), setgid() or other such calls. > This is only to save issetugid call done early by the loader and it is perfectly safe at that point. This definitely is not a replacement for the syscall in general. -- Mateusz Guzik