Received: by mail.netbsd.org (Postfix, from userid 605) id 3EDFD84F28; Sat, 23 Feb 2019 06:58:16 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by mail.netbsd.org (Postfix) with ESMTP id B5F3E84F26 for ; Sat, 23 Feb 2019 06:58:15 +0000 (UTC) X-Virus-Scanned: amavisd-new at netbsd.org Received: from mail.netbsd.org ([127.0.0.1]) by localhost (mail.netbsd.org [127.0.0.1]) (amavisd-new, port 10025) with ESMTP id YrEc5r9laXYG for ; Sat, 23 Feb 2019 06:58:15 +0000 (UTC) Received: from cvs.NetBSD.org (ivanova.netbsd.org [199.233.217.197]) by mail.netbsd.org (Postfix) with ESMTP id 2D33C84CCF for ; Sat, 23 Feb 2019 06:58:15 +0000 (UTC) Received: by cvs.NetBSD.org (Postfix, from userid 500) id 27A2CFB16; Sat, 23 Feb 2019 06:58:15 +0000 (UTC) Content-Disposition: inline Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII" MIME-Version: 1.0 Date: Sat, 23 Feb 2019 06:58:15 +0000 From: "Martin Husemann" Subject: CVS commit: [netbsd-8] src/sys To: source-changes@NetBSD.org X-Mailer: log_accum Message-Id: <20190223065815.27A2CFB16@cvs.NetBSD.org> Sender: source-changes-owner@NetBSD.org List-Id: source-changes.NetBSD.org Precedence: bulk Reply-To: source-changes-d@NetBSD.org Mail-Reply-To: "Martin Husemann" Mail-Followup-To: source-changes-d@NetBSD.org List-Unsubscribe: Module Name: src Committed By: martin Date: Sat Feb 23 06:58:14 UTC 2019 Modified Files: src/sys/compat/linux/common [netbsd-8]: linux_ipc.c src/sys/compat/linux32/common [netbsd-8]: linux32_ipccall.c src/sys/compat/netbsd32 [netbsd-8]: netbsd32_compat_14.c netbsd32_conv.h src/sys/compat/sys [netbsd-8]: ipc.h msg.h sem.h shm.h src/sys/kern [netbsd-8]: sysv_msg.c sysv_sem.c sysv_shm.c Log Message: Pull up following revision(s) (requested by mrg in ticket #1195): sys/compat/sys/ipc.h: revision 1.6 sys/compat/sys/ipc.h: revision 1.7 sys/compat/sys/shm.h: revision 1.8 sys/kern/sysv_shm.c: revision 1.133 sys/compat/sys/sem.h: revision 1.7 sys/compat/linux/common/linux_ipc.c: revision 1.56 sys/compat/netbsd32/netbsd32_conv.h: revision 1.38 sys/kern/sysv_sem.c: revision 1.96 sys/compat/netbsd32/netbsd32_compat_14.c: revision 1.28 sys/compat/netbsd32/netbsd32_compat_14.c: revision 1.29 sys/compat/linux32/common/linux32_ipccall.c: revision 1.12 sys/kern/sysv_msg.c: revision 1.73 sys/compat/sys/msg.h: revision 1.6 for sysv ipc stat operations, explicitly copy the exported parts instead of the whole ds structure. besides triggering a recently added assert in netbsd32, this stops exposing kernel addresses. copy the mode clamping to 0777 from sem to shm and msg. while here, make sure that the compat callers to sysv_ipc clear the contents of the compat structure before setting the result members to ensure padding bytes are cleared. don't set/copy _sem_base, _msg_first, _msg_last or _shm_internal. even if used, which seems very dodgy, they leak KVAs as well. possibly this may affect linux binaries, in particular, the comments around _shm_internal ("XXX Oh well.") may mean apps rely upon these but hopefully not -- the comments date back to rev 1.1 in 1995. the _key, _seq and _msg_cbytes members are exported as before as i found multiple consumers of these (no less than ipcs(1), and they appear to be useful for debugging and more. XXX: the naming of compat functions have too many styles. there are at least 3 different ones changed here. fix naming errors in previous. (this file is no longer compiled, but this fix makes the pull up more obvious, before deleting this file.) include libkern.h or strings.h. should fix i386 build issues. To generate a diff of this commit: cvs rdiff -u -r1.55 -r1.55.48.1 src/sys/compat/linux/common/linux_ipc.c cvs rdiff -u -r1.11 -r1.11.52.1 \ src/sys/compat/linux32/common/linux32_ipccall.c cvs rdiff -u -r1.26.10.1 -r1.26.10.2 \ src/sys/compat/netbsd32/netbsd32_compat_14.c cvs rdiff -u -r1.31.8.2 -r1.31.8.3 src/sys/compat/netbsd32/netbsd32_conv.h cvs rdiff -u -r1.4 -r1.4.48.1 src/sys/compat/sys/ipc.h cvs rdiff -u -r1.4.58.1 -r1.4.58.2 src/sys/compat/sys/msg.h cvs rdiff -u -r1.6 -r1.6.58.1 src/sys/compat/sys/sem.h cvs rdiff -u -r1.7 -r1.7.56.1 src/sys/compat/sys/shm.h cvs rdiff -u -r1.71 -r1.71.8.1 src/sys/kern/sysv_msg.c cvs rdiff -u -r1.95 -r1.95.10.1 src/sys/kern/sysv_sem.c cvs rdiff -u -r1.131 -r1.131.10.1 src/sys/kern/sysv_shm.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.