From owner-freebsd-net@freebsd.org Sat Mar 2 00:58:14 2019 Return-Path: Delivered-To: freebsd-net@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0C647150827A for ; Sat, 2 Mar 2019 00:58:14 +0000 (UTC) (envelope-from rmacklem@uoguelph.ca) Received: from CAN01-QB1-obe.outbound.protection.outlook.com (mail-eopbgr660073.outbound.protection.outlook.com [40.107.66.73]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (Client CN "mail.protection.outlook.com", Issuer "GlobalSign Organization Validation CA - SHA256 - G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AF1F66C6B4; Sat, 2 Mar 2019 00:58:12 +0000 (UTC) (envelope-from rmacklem@uoguelph.ca) Received: from QB1PR01MB3537.CANPRD01.PROD.OUTLOOK.COM (52.132.89.15) by QB1PR01MB3057.CANPRD01.PROD.OUTLOOK.COM (52.132.84.161) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1665.17; Sat, 2 Mar 2019 00:58:10 +0000 Received: from QB1PR01MB3537.CANPRD01.PROD.OUTLOOK.COM ([fe80::609b:1ecd:c908:d44c]) by QB1PR01MB3537.CANPRD01.PROD.OUTLOOK.COM ([fe80::609b:1ecd:c908:d44c%6]) with mapi id 15.20.1643.022; Sat, 2 Mar 2019 00:58:10 +0000 From: Rick Macklem To: "Rodney W. Grimes" CC: FreeBSD Net , "hrs@freebsd.org" , "Bjoern A. Zeeb" , "rgrimes@freebsd.org" Subject: Re: use of #ifdef INET and #ifdef INET6 in the kernel sources Thread-Topic: use of #ifdef INET and #ifdef INET6 in the kernel sources Thread-Index: AQHUzwGwHmKnVmR//0yzd/zC2ycfBaX0bvqAgAGlN+2AAJ/pAIAAuLZygAAY78g= Date: Sat, 2 Mar 2019 00:58:10 +0000 Message-ID: References: , <201903011219.x21CJkIE061223@pdx.rh.CN85.dnsmgr.net>, In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: d233adf6-76d4-4661-74e6-08d69eaa2416 x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600127)(711020)(4605104)(2017052603328)(7153060)(7193020); SRVR:QB1PR01MB3057; x-ms-traffictypediagnostic: QB1PR01MB3057: x-microsoft-exchange-diagnostics: =?iso-8859-1?Q?1; QB1PR01MB3057; 23:/yLu1hoejYakd0wfrBfkj0hnVgiQ+dGv5pofuv/?= =?iso-8859-1?Q?ZKs6rFGrjYL/xhMsweWR6dWTqO48z6UVj/iS55EKRy7zMeAb06gED+qD/b?= =?iso-8859-1?Q?tpLkeEz7+DZaNoh65D5lT+9y2HpSpfFkozXm0WfeBypxlb+xrssFdZiawd?= =?iso-8859-1?Q?OJyOWscoZpfYimbVpfbQof2Lh7m2UieVnO/p0fbNkfliRyT757okn6d209?= =?iso-8859-1?Q?o1lGgmn7FdeNEiiIoJyL7btoCD2AW3fXp7csvWTFBG5HJX34NAdxB1gTEH?= =?iso-8859-1?Q?BkJ4qL60hqoQZXSwQocaHcCH+FIZY82lq86Dng/vVFJwDObtTX1ufDbhrh?= =?iso-8859-1?Q?3R5Yc7knuzUE0uMmKgto/lQs84wGOc+fqIduHl3JHAdC887frAF90AXO4z?= =?iso-8859-1?Q?oAXWAKWPg/hJWxsEicQGhnmqzXWNJzIHXniPIAwp4R4a3hKEeypOppF0zS?= =?iso-8859-1?Q?iLi/fcEReAod4WogcDMmB41jY/iErf+2r0SEnIChObKx5QQh+PrZS+yHAI?= =?iso-8859-1?Q?sZ+4oXDk6tLDnZhvMOZc+R6ewaUwoWUMb54RKyOuTnIuDZEPCnXDJPqfoa?= =?iso-8859-1?Q?o/SgKSpCH7aI9KQDJ2jpcUM5eBKqprPU6V6f9vlsRvmoPle8fi5xPkGv8o?= =?iso-8859-1?Q?OraAsDjvWyZprs2sMRHLkBvL2glSHDXRX0Jhx1bGzDBF2Nzi7uccns7bY5?= =?iso-8859-1?Q?GWcjjMNVyowRAdc06oxs4L8+/jmzHqYW8QNswPuJUDof3EV1JGzBy9P/zn?= =?iso-8859-1?Q?GP2euzpfyEYzHjPLOmr66R0ZRUlQiTAO3Zwk08FTqAqUh9yc40heGweUzp?= =?iso-8859-1?Q?rZgPkleRWG725I2dl7Q2thGTQO8eIFdzkEgtrZTdsfj2TjDpnWqC4oCkKr?= =?iso-8859-1?Q?kf4I9d5/1qbU7C3hp+6VnRqacvll4Ywqrte1EQ2SWT48lPX98oeIQzou9t?= =?iso-8859-1?Q?KLYNYvE/CLmgM9sejvysL091BUgtNFEgV8jsApTH6CEHagYX5vBcbg5sEz?= =?iso-8859-1?Q?vt38axiwA8vs39lcMHcaP+9af1+GXIJdDFpr9mNIXdSGdGhuCdKqe7b6W0?= =?iso-8859-1?Q?so7HQrQo8YOjjBFsnnZnTmzLO0U1jLO01DvN0Y/qsLxMMN+BxLWu5LJwpz?= =?iso-8859-1?Q?0jhc6zOUY1l1LJW4UIE/IbwAWSsbA2rYc5cQ0gtEm1/fIFCnMbOkZql7Ec?= =?iso-8859-1?Q?/Edfsp29pmXNLMOm4nIl+znrfN2NqCL3A=3D=3D?= x-microsoft-antispam-prvs: x-forefront-prvs: 09645BAC66 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(39860400002)(366004)(376002)(396003)(346002)(136003)(199004)(189003)(476003)(446003)(11346002)(486006)(53936002)(25786009)(4326008)(256004)(6246003)(71190400001)(46003)(14444005)(71200400001)(7696005)(97736004)(76176011)(102836004)(99286004)(5660300002)(6506007)(186003)(106356001)(105586002)(81166006)(786003)(316002)(54906003)(229853002)(6436002)(305945005)(74316002)(8676002)(55016002)(81156014)(9686003)(478600001)(86362001)(8936002)(14454004)(2906002)(74482002)(33656002)(6916009)(68736007); DIR:OUT; SFP:1101; SCL:1; SRVR:QB1PR01MB3057; H:QB1PR01MB3537.CANPRD01.PROD.OUTLOOK.COM; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: uoguelph.ca does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: stz3zPjW32U/VlEUxvm5YbsZwSuho4OUMEkqXkZenrCqsLJnSXMii9ye00ap8eIguO26leZpsGwj1F8A8EAIRY8zVCTgsunDtulhsolq5rHja3Bx0l/ekxY/HIbhp1mukr7eV+cX/64k7AoRBuxtNOUvaXhjezgfulPWN2n24iUWK4hUL57BoTAvWQ9OR6xJFgZ476EQRGBTix5xQbq0+wT6+jtiwKa41jgT8+1/YzrU5Vf1+pNrnYE9Pf2wmMfucGJeWH/pPoWt3MxpN3nTTnnRbbMajiEzct3fcqNeLZTgwi8sC4YZcXVIbMWlnZZJNVbaB4SGnWjsl8o8Njr2MsdJHQLsSvSbidOjk/67ZhyF1iRSv5aaJXql/meDMX9AVViYxje0U/vVQs82zV169S3k+YG7p34ocYXBdSDowTU= Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: uoguelph.ca X-MS-Exchange-CrossTenant-Network-Message-Id: d233adf6-76d4-4661-74e6-08d69eaa2416 X-MS-Exchange-CrossTenant-originalarrivaltime: 02 Mar 2019 00:58:10.5973 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: be62a12b-2cad-49a1-a5fa-85f4f3156a7d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-Transport-CrossTenantHeadersStamped: QB1PR01MB3057 X-Rspamd-Queue-Id: AF1F66C6B4 X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; spf=pass (mx1.freebsd.org: domain of rmacklem@uoguelph.ca designates 40.107.66.73 as permitted sender) smtp.mailfrom=rmacklem@uoguelph.ca X-Spamd-Result: default: False [-1.02 / 15.00]; ARC_NA(0.00)[]; TO_DN_EQ_ADDR_SOME(0.00)[]; NEURAL_HAM_MEDIUM(-0.35)[-0.345,0]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:40.107.0.0/16]; NEURAL_HAM_LONG(-0.94)[-0.935,0]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[uoguelph.ca]; RCPT_COUNT_FIVE(0.00)[5]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_SPAM_SHORT(0.57)[0.572,0]; MX_GOOD(-0.01)[cached: mx2.hc184-76.ca.iphmx.com]; RCVD_IN_DNSWL_NONE(0.00)[73.66.107.40.list.dnswl.org : 127.0.3.0]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_LAST(0.00)[] X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Mar 2019 00:58:14 -0000 Rick Macklem wrote: [stuff snipped] >The AF_LOCAL code was in head for a short period of time before a vnode lo= ck panic() >issue was reported and I reverted the patch. > >Here is the commit log message for that reversion: >PR#230752 shows a panic where an nfsd thread tries to do soconnect() on >the AF_LOCAL socket used by the nfsuserd while already holding an >exclusive lock on it. I am not 100% sure how this happens, but since an >AF_LOCAL socket is in the file system namespace it is conceivable that it >could lock it and then attempt an upcall to the nfsuserd. >However, reverting r320757 stops the nfsuserd from using an AF_LOCAL >socket, so it should avoid any such panic(). >r320757 did fix a problem with running the nfsuserd when jails were >enabled, but that can be dealt with less elegantly by allowing the >use of an alternate address instead of 127.0.0.1. >The gssd daemon also uses an AF_LOCAL socket, but it will do upcalls >before the nfsd thread processes the RPC, so I think it should not >be suseptible to this problem. Oops. Duh. I should have read my own commit message more carefully... It was an nfsd thread, so the file system wasn't an NFS mount, it was a fil= e system exported to NFS client(s). It is possible to test to see if a file system is exported, but that can ch= ange at any time, so even if it isn't exported when the nfsuserd daemon is start= ed, it could be exported later. So, I don't see any way AF_LOCAL can be safely used here. Oh, and the kernel RPC expects to be able to do a soconnect() using a sockaddr, so socketpair() won't do the trick. rick