From owner-svn-src-all@freebsd.org Thu Jan 5 06:29:55 2017 Return-Path: Delivered-To: svn-src-all@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 23745C9F658; Thu, 5 Jan 2017 06:29:55 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pf0-x241.google.com (mail-pf0-x241.google.com [IPv6:2607:f8b0:400e:c00::241]) (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 EDAC510E3; Thu, 5 Jan 2017 06:29:54 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pf0-x241.google.com with SMTP id y68so28019267pfb.1; Wed, 04 Jan 2017 22:29:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=ME2ZdFHkSqq2bJ1Q9VzesHkd2D/vbAVSzdxSkzrsCJI=; b=t0q+YwBX8AARWP4MCGfVw3WW4xQ+EnyoiCYYpgtjIoM9DMuA9V+XOe0ynmu94swyjR bEFc5vp1UuuBU/Px4wourXw4MKMzv6K6X5V2JZAKR6ezxTFmfRftgxhAV5zCavTa0z2Q bsSXG6E9C1Qa0oz3zIuYYYrl/EJaHPgA7Imeq4jCkxgBaYiivXYncFKBfdpPsW9nOIhy 4DOND+BJm+elRJ4AzmfrnzADAELCMWxMJpJkjzJi+aEzvVD7/rJwLIttemOcxw9jvZTY T5gZPJQS98MhdCs4aoKTRzIiX0TzKoXMg4wBxqwj4LMQhIHeCmSwsRf1WmA5MwLDTLkU 9HRA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=ME2ZdFHkSqq2bJ1Q9VzesHkd2D/vbAVSzdxSkzrsCJI=; b=EGCcjSabvKZ/Ium2bt1O09w25ILGlw/HQyw2Tgmczy1rdmsjK5WlhDJcLJRKYcbmWs dToz2bVd2gGiIFg3n34gXnaDd9Rg+OAqKBYCyTPZCAulaWIiISquETyo1UYjH7j9bC7W FsWPJZ2vErZ1o4nI5cP7f2AvG3qPjJUoJAoH5zZ4GvUY6eg9u+7b0N7j09z1mZ29ZF6G +rNlk1QazKvm/qVp5KrcmO+ciAZqJTGerPtHFS/o01em/VzF0nVgZj7Wsppa6DiYpx+b 3F78GgaVl3zv1NO+OkVLeXlaq3mkSvWropwiw9nDVJSKGIp/6vOgDU8Hu6xmUN/h3WaR EtIg== X-Gm-Message-State: AIkVDXJJFxvd4i+jY6I3gSna4ZTswSRVIYw47nQ0VISd0D93WFIxJvdoHXiI35whsKhG5w== X-Received: by 10.84.198.129 with SMTP id p1mr155259936pld.14.1483597794357; Wed, 04 Jan 2017 22:29:54 -0800 (PST) Received: from ?IPv6:2607:fb90:80b1:1aa9:91a9:7481:6851:3188? ([2607:fb90:80b1:1aa9:91a9:7481:6851:3188]) by smtp.gmail.com with ESMTPSA id x4sm152451629pgc.14.2017.01.04.22.29.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 04 Jan 2017 22:29:53 -0800 (PST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (1.0) Subject: Re: svn commit: r311233 - head/contrib/netbsd-tests/fs/tmpfs From: Ngie Cooper X-Mailer: iPhone Mail (14C92) In-Reply-To: Date: Wed, 4 Jan 2017 22:29:52 -0800 Cc: Jilles Tjoelker , Ngie Cooper , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <201701040246.v042kaEh039041@repo.freebsd.org> <20170104233650.GB17765@stack.nl> To: Juli Mallett X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 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, 05 Jan 2017 06:29:55 -0000 > On Jan 4, 2017, at 15:45, Juli Mallett wrote: >=20 >> On Wed, Jan 4, 2017 at 3:36 PM, Jilles Tjoelker wrote: >>> On Wed, Jan 04, 2017 at 02:46:36AM +0000, Ngie Cooper wrote: >>> - Initialize .sun_len before passing it to strlcpy and bind. >> It would be better to avoid naming the non-portable sun_len field if it >> is just to make Coverity happy. I suggest initializing the structure >> with designated initializers or memset(). >>=20 >> Apart from that, the value for sun_len is wrong; it should be the length >> of the whole structure and not just the sun_path part. Fortunately, the >> field is ignored by bind(), which uses the addrlen parameter instead. The problem was the strcpy and the fact that the code didn't check the input= buffer to make sure it didn't overrun the destination buffer. > This is incorrect, too. It's the length of the sockaddr_un header > plus the actual length of the pathname, not the available size of the > path field. It's kind of awful that it's inconsistent with the other > sockaddr types, but that's the fun of sockaddr_un, to accommodate the > fact that the path name is naturally a variable-length field. In > fact, the calculation here seems to be wrong, also; we have the > SUN_LEN macro in for a reason, and it's what the unix(4) > manpage suggests. Of course, sun_len is sort of needlessly obscure > and in general it's best for us to fix anything which requires the > _len fields to be accurate, and to just ignore them :( Ack.. thanks for the reminder :/.. I'll fix this soon :(. -Ngie=