From owner-svn-src-all@freebsd.org Thu Jul 18 21:48:44 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C371FB2770 for ; Thu, 18 Jul 2019 21:48:44 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound3d.ore.mailhop.org (outbound3d.ore.mailhop.org [54.186.57.195]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 430ED73460 for ; Thu, 18 Jul 2019 21:48:44 +0000 (UTC) (envelope-from ian@freebsd.org) ARC-Seal: i=1; a=rsa-sha256; t=1563486522; cv=none; d=outbound.mailhop.org; s=arc-outbound20181012; b=vrM/z5EFRF/MVzYpI8wplzwDUU5mjfkiUCxi+ASi7HpC33nBp0lM1SS329jagU2TUq2h9vxdsb7dX DLrJPu1lYxZpZr8OIDN7jjDoiu39UMe5aa+CFTN5OgAYUbiDkQvxYnPCi2BWlNHqQiLTdwXtPG4Jwi yNbB4G6NKx3SOXI2ZiI9tk58ZjAM3fQyqb7Y0PgAgXpf/dK0cV9Aw4apkPcn4nvrrNrwK6UDL+4tjz BrtDebD0wy3QeH8OlLqBbIuIK1OVWkWO84M8wvyn9p1lyEw3OiWTVyGxYIL7DmqNTHZjslkKLwDHI4 bzcBmdS4qbFMSQWtczvHo6U+cKz0m4A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=arc-outbound20181012; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:cc:to:from:subject:message-id:dkim-signature:from; bh=4tmf0xafcVRwE7E9cbx6RFAQfS6zIetmANlgHxDhxdM=; b=K16V4FUACD69mKEW3Jwfxa7DVitVS6sfaJhyHJPor8QPLyXTkeNryxdR9WGFGNuxg3zRJb5qYJM1N qpVxUxZQ3WCHWnYFmsNYK7HTZ5LhktgNhSlZjMrXL5dbpF7eAOLjDYLPOz1MuhNykc532OW/Apcroq sJJaTNZHpBMLZIpuV7d3ftrR+zCogXwDXI+Fd1W0S5YnRqiY4OARVr29B8DJeP2+XAvLEUunse+VF9 AMJOcnsmGhIhuVxP6niYZdy5YMS0D34kO/0b4Qz8CQHeOYYK87i1sOYluntxz7vE4rw3QsmGTgMmVK wj50csLDPipZsGpaQ6r19RmxZixq4/g== ARC-Authentication-Results: i=1; outbound3.ore.mailhop.org; spf=softfail smtp.mailfrom=freebsd.org smtp.remote-ip=67.177.211.60; dmarc=none header.from=freebsd.org; arc=none header.oldest-pass=0; DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=dkim-high; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:cc:to:from:subject:message-id:from; bh=4tmf0xafcVRwE7E9cbx6RFAQfS6zIetmANlgHxDhxdM=; b=piVdw1/DA4USNpnnT5xCRycO/xd6MbPidQ/WPZuGPg31xkG4jXIPYtGwMXa9WWxqGTH30COI69A9b mkiQBlaKl/s3zsoln9xSoQWm+RpNFxdUn2J7WH9a4jrQFRfXExIl3mVlVI3v/+6FtbhLaAmzdq0F7U /OGcgrQGTEXBaegDNdsm+uaAKLFyUMVhQVSdlL4V8CRyLpmYNDxGXWwq/hJ8lBLhh2vwTErocD6e8o epmNNT9vfiuR7eNWAIDtGAc9iWR8+F8680hSrpncNzGVmWEejbyyxYSpQfpXS6024opO4HMhHLHg4P apIqtrdsxvM8O+eNsFzMqd1jsBwd1kA== X-MHO-RoutePath: aGlwcGll X-MHO-User: cdf7a3a8-a9a5-11e9-90e8-c17e0c9f2e02 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 67.177.211.60 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [67.177.211.60]) by outbound3.ore.mailhop.org (Halon) with ESMTPSA id cdf7a3a8-a9a5-11e9-90e8-c17e0c9f2e02; Thu, 18 Jul 2019 21:48:41 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id x6ILmdJY046119; Thu, 18 Jul 2019 15:48:39 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: Subject: Re: svn commit: r350116 - head/lib/libc/gen From: Ian Lepore To: Brooks Davis Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Thu, 18 Jul 2019 15:48:39 -0600 In-Reply-To: <20190718214115.GA42117@spindle.one-eyed-alien.net> References: <201907182133.x6ILXu4k026793@repo.freebsd.org> <20190718214115.GA42117@spindle.one-eyed-alien.net> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5 FreeBSD GNOME Team Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 430ED73460 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.975,0]; ASN(0.00)[asn:16509, ipnet:54.186.0.0/15, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Jul 2019 21:48:44 -0000 On Thu, 2019-07-18 at 21:41 +0000, Brooks Davis wrote: > On Thu, Jul 18, 2019 at 09:33:56PM +0000, Brooks Davis wrote: > > Author: brooks > > Date: Thu Jul 18 21:33:55 2019 > > New Revision: 350116 > > URL: https://svnweb.freebsd.org/changeset/base/350116 > > > > Log: > > Document that setmode(3) is not thread safe. > > > > In some circumstances, setmode(3) may call umask(2) twice to retrieve > > the current mode and then restore it. Between calls, the process will > > have a umask of 0. > > This race isn't especially serious, since it only occurs when > security.bsd.unprivileged_proc_debug=0, but it's probably something to > fix. The easiest solution would probably be to implement a getumask() > syscall. > Or define a magic value to pass to umask(2) that means "return the old mask without changing anything". If umask() only cares about the low 9 bits and mode_t is uint16, that shouldn't be hard. -- Ian