From owner-dev-commits-src-all@freebsd.org Wed Jul 28 18:27:34 2021 Return-Path: Delivered-To: dev-commits-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 BDB6B662B30 for ; Wed, 28 Jul 2021 18:27:34 +0000 (UTC) (envelope-from kevin.bowling@kev009.com) Received: from mail-yb1-xb2d.google.com (mail-yb1-xb2d.google.com [IPv6:2607:f8b0:4864:20::b2d]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GZhwQ4l01z4mL5 for ; Wed, 28 Jul 2021 18:27:34 +0000 (UTC) (envelope-from kevin.bowling@kev009.com) Received: by mail-yb1-xb2d.google.com with SMTP id p145so4470496ybg.6 for ; Wed, 28 Jul 2021 11:27:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kev009.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=O+Qa+2XLiDDQjFpXiOg7JEy/+ljXZECiS64vXfuAYAc=; b=nMADxTWp/YFZ00+YZ0SLo5BokpeRpkgzNm5uEnKp3o4aw8NPsR8Qd0ywO0DdrXxp0j 5s6z4uMVKN3UsTsJltu/FzHiefSJsjGcE+vhXIeDOwGr1aUJ+xQfRAxZAL+OUdVEysqe tH8ovWJhtkiEJQ5d2YxzY4QaFk+dtBQfNgIMU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=O+Qa+2XLiDDQjFpXiOg7JEy/+ljXZECiS64vXfuAYAc=; b=npAbMb432jt/JnJTFPBdkUUXD/uUEvqls+y8kSoq5Nc5h0sVHKk6Nh/HrFTzFHlGzY 7zGhYiOQAo910V4/cNlfPyhhsr76nkpLGeqPAuNi2X7KhlXwJlWKuh7MC30lY2jVxgbs w7Wc8pZJ2WuHwME9szG/VKFZEYE7Xho7jD4VBV/L631+4oyT8iG6pzW2V9kPSiZNbmGw zdekPWI19NyHzxVVCYd7ZSXj5nf3ajiCJkUwVBT3XFcJmd6qYVUpFufIzGOnRRRQ83nK DpgL7S5jAL/MZmrPifrCDCopUdBJ2FK35ZNPiNc9BMeHnzO26hau4fVTLYxI1RxEfBOK vGCw== X-Gm-Message-State: AOAM533s91CMBXFo+RA32B7as266J4Hq1JI51wxMhb3ciBY00GjzbUbm uQP67N0cOSZXJdydJsqknCudI6mF2mMZ9VpC9392zQ== X-Google-Smtp-Source: ABdhPJxVMYUO/fyB/U3NsCPyTRbp+GEB+E+O+2qA02u6hbBO5PRt3zO9OsWSw3JLvTegkODkNu4mM4fzeakhOsFhPE0= X-Received: by 2002:a25:18a:: with SMTP id 132mr1373733ybb.123.1627496848360; Wed, 28 Jul 2021 11:27:28 -0700 (PDT) MIME-Version: 1.0 References: <202107281635.16SGZHdx081512@gitrepo.freebsd.org> <20210728163725.6qzqbvwynoeua2jo@mutt-hbsd> In-Reply-To: <20210728163725.6qzqbvwynoeua2jo@mutt-hbsd> From: Kevin Bowling Date: Wed, 28 Jul 2021 11:27:17 -0700 Message-ID: Subject: Re: git: 7045b1603bdf - main - socket: Implement SO_RERROR To: Shawn Webb Cc: Kevin Bowling , src-committers , "" , "dev-commits-src-main@FreeBSD.org" Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 4GZhwQ4l01z4mL5 X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Jul 2021 18:27:34 -0000 On Wed, Jul 28, 2021 at 9:37 AM Shawn Webb wrote: > > On Wed, Jul 28, 2021 at 04:35:17PM +0000, Kevin Bowling wrote: > > The branch main has been updated by kbowling (ports committer): > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=7045b1603bdf054145dd958a4acc17b410fb62a0 > > > > commit 7045b1603bdf054145dd958a4acc17b410fb62a0 > > Author: Roy Marples > > AuthorDate: 2021-07-28 15:46:59 +0000 > > Commit: Kevin Bowling > > CommitDate: 2021-07-28 16:35:09 +0000 > > > > socket: Implement SO_RERROR > > > > SO_RERROR indicates that receive buffer overflows should be handled as > > errors. Historically receive buffer overflows have been ignored and > > programs could not tell if they missed messages or messages had been > > truncated because of overflows. Since programs historically do not > > expect to get receive overflow errors, this behavior is not the > > default. > > > > This is really really important for programs that use route(4) to keep > > in sync with the system. If we loose a message then we need to reload > > the full system state, otherwise the behaviour from that point is > > undefined and can lead to chasing bogus bug reports. > > > > Reviewed by: philip (network), kbowling (transport), gbe (manpages) > > MFC after: 2 weeks > > Differential Revision: https://reviews.freebsd.org/D26652 > > --- > > lib/libc/sys/getsockopt.2 | 10 +++++++- > > sbin/route/route.c | 13 +++++++++- > > sys/kern/uipc_sockbuf.c | 24 +++++++++++++++++ > > sys/kern/uipc_socket.c | 30 ++++++++++++++++------ > > sys/kern/uipc_usrreq.c | 2 +- > > sys/net/raw_usrreq.c | 11 ++++---- > > .../bluetooth/socket/ng_btsocket_hci_raw.c | 1 + > > sys/netgraph/ng_socket.c | 2 +- > > sys/netinet/ip_divert.c | 2 +- > > sys/netinet/ip_mroute.c | 2 +- > > sys/netinet/raw_ip.c | 3 +-- > > sys/netinet/udp_usrreq.c | 2 +- > > sys/netinet6/icmp6.c | 6 ++--- > > sys/netinet6/ip6_input.c | 1 + > > sys/netinet6/ip6_mroute.c | 3 ++- > > sys/netinet6/raw_ip6.c | 2 ++ > > sys/netinet6/send.c | 2 +- > > sys/netinet6/udp6_usrreq.c | 2 +- > > sys/netipsec/keysock.c | 10 ++++---- > > sys/sys/socket.h | 1 + > > sys/sys/socketvar.h | 6 ++++- > > 21 files changed, 100 insertions(+), 35 deletions(-) > > Hey Kevin, Hi > Would this commit be a good candidate for bumping __FreeBSD_version? Off hand I don't think so but this is a weakly held opinion. My reasoning is, this is just a new flag and doesn't affect the KBI or ABI directly. There are no MFC concerns I observe (other than localized issues past stable-13, I haven't looked at 12 yet to see if MFC is easy enough that I want to do it but I will to stable-13) If we import something into src that uses this like ntpd, at most we'd just enable the feature in its respective bmake or config.h or wherever. The ntpd bugzilla is down so I can't see how they accomplished this particular feature test but I suspect it is just an inline ifdef on SO_RERROR based on Roy's other patches. On the ports side I think most external projects would use a feature test macro of their respective build systems or ifdef on the SO_RERROR definition in the minimal case (all of the API usages I know of do it like that, see https://github.com/FRRouting/frr/pull/7242/files#diff-586e1a2c472fc93bf57ce9597b0ec6559e383bd161c959fd794d7316b23255dfR1429 for an example). If you can demonstrate a reason to do it I will prep a phabricator and seek review so I can commit it. > Thanks, > > -- > Shawn Webb > Cofounder / Security Engineer > HardenedBSD > > https://git.hardenedbsd.org/hardenedbsd/pubkeys/-/raw/master/Shawn_Webb/03A4CBEBB82EA5A67D9F3853FF2E67A277F8E1FA.pub.asc