From owner-svn-src-stable-12@freebsd.org Mon Aug 24 12:35:03 2020 Return-Path: Delivered-To: svn-src-stable-12@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 714F13BDAD7; Mon, 24 Aug 2020 12:35:03 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BZs5g2MCnz4hg0; Mon, 24 Aug 2020 12:35:03 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 344C218850; Mon, 24 Aug 2020 12:35:03 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07OCZ2al028247; Mon, 24 Aug 2020 12:35:02 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07OCZ2Ck028244; Mon, 24 Aug 2020 12:35:02 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <202008241235.07OCZ2Ck028244@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Mon, 24 Aug 2020 12:35:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r364663 - stable/12/sys/compat/linux X-SVN-Group: stable-12 X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: stable/12/sys/compat/linux X-SVN-Commit-Revision: 364663 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Aug 2020 12:35:03 -0000 Author: trasz Date: Mon Aug 24 12:35:02 2020 New Revision: 364663 URL: https://svnweb.freebsd.org/changeset/base/364663 Log: MFC r357202: Add compat.linux.ignore_ip_recverr sysctl. This is a workaround for missing IP_RECVERR setsockopt(2) support. Without it, DNS resolution is broken for glibc >= 2.30 (glibc BZ #24047). From the user point of view this fixes "yum update" on recent CentOS 8. Sponsored by: The FreeBSD Foundation Modified: stable/12/sys/compat/linux/linux_mib.c stable/12/sys/compat/linux/linux_mib.h stable/12/sys/compat/linux/linux_socket.c stable/12/sys/compat/linux/linux_socket.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/compat/linux/linux_mib.c ============================================================================== --- stable/12/sys/compat/linux/linux_mib.c Mon Aug 24 12:33:42 2020 (r364662) +++ stable/12/sys/compat/linux/linux_mib.c Mon Aug 24 12:35:02 2020 (r364663) @@ -62,6 +62,10 @@ static unsigned linux_osd_jail_slot; SYSCTL_NODE(_compat, OID_AUTO, linux, CTLFLAG_RW, 0, "Linux mode"); +int linux_ignore_ip_recverr = 1; +SYSCTL_INT(_compat_linux, OID_AUTO, ignore_ip_recverr, CTLFLAG_RWTUN, + &linux_ignore_ip_recverr, 0, "Ignore enabling IP_RECVERR"); + int linux_preserve_vstatus = 0; SYSCTL_INT(_compat_linux, OID_AUTO, preserve_vstatus, CTLFLAG_RWTUN, &linux_preserve_vstatus, 0, "Preserve VSTATUS termios(4) flag"); Modified: stable/12/sys/compat/linux/linux_mib.h ============================================================================== --- stable/12/sys/compat/linux/linux_mib.h Mon Aug 24 12:33:42 2020 (r364662) +++ stable/12/sys/compat/linux/linux_mib.h Mon Aug 24 12:35:02 2020 (r364663) @@ -62,6 +62,7 @@ int linux_kernver(struct thread *td); #define linux_use26(t) (linux_kernver(t) >= LINUX_KERNVER_2006000) +extern int linux_ignore_ip_recverr; extern int linux_preserve_vstatus; #endif /* _LINUX_MIB_H_ */ Modified: stable/12/sys/compat/linux/linux_socket.c ============================================================================== --- stable/12/sys/compat/linux/linux_socket.c Mon Aug 24 12:33:42 2020 (r364662) +++ stable/12/sys/compat/linux/linux_socket.c Mon Aug 24 12:35:02 2020 (r364663) @@ -71,6 +71,7 @@ __FBSDID("$FreeBSD$"); #include #endif #include +#include #include #include #include @@ -1569,6 +1570,14 @@ linux_setsockopt(struct thread *td, struct linux_setso } break; case IPPROTO_IP: + if (args->optname == LINUX_IP_RECVERR && + linux_ignore_ip_recverr) { + /* + * XXX: This is a hack to unbreak DNS resolution + * with glibc 2.30 and above. + */ + return (0); + } name = linux_to_bsd_ip_sockopt(args->optname); break; case IPPROTO_IPV6: Modified: stable/12/sys/compat/linux/linux_socket.h ============================================================================== --- stable/12/sys/compat/linux/linux_socket.h Mon Aug 24 12:33:42 2020 (r364662) +++ stable/12/sys/compat/linux/linux_socket.h Mon Aug 24 12:35:02 2020 (r364663) @@ -215,6 +215,7 @@ int linux_accept(struct thread *td, struct linux_accep #define LINUX_IP_TTL 2 #define LINUX_IP_HDRINCL 3 #define LINUX_IP_OPTIONS 4 +#define LINUX_IP_RECVERR 11 #define LINUX_IP_MULTICAST_IF 32 #define LINUX_IP_MULTICAST_TTL 33