From owner-svn-src-all@freebsd.org Mon Nov 12 21:51:38 2018 Return-Path: Delivered-To: svn-src-all@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 7CD6111242FE; Mon, 12 Nov 2018 21:51:38 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F280785ED0; Mon, 12 Nov 2018 21:51:37 +0000 (UTC) (envelope-from brooks@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 D242326891; Mon, 12 Nov 2018 21:51:37 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wACLpbaE092326; Mon, 12 Nov 2018 21:51:37 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wACLpbxr092324; Mon, 12 Nov 2018 21:51:37 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201811122151.wACLpbxr092324@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Mon, 12 Nov 2018 21:51:37 +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: r340388 - in stable/12/sys: compat/freebsd32 kern X-SVN-Group: stable-12 X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: in stable/12/sys: compat/freebsd32 kern X-SVN-Commit-Revision: 340388 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: F280785ED0 X-Spamd-Result: default: False [-106.88 / 200.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; ALLOW_DOMAIN_WHITELIST(-100.00)[FreeBSD.org]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; HAS_XAW(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all]; DMARC_NA(0.00)[FreeBSD.org]; RCVD_COUNT_THREE(0.00)[4]; MX_GOOD(-0.01)[cached: mx1.FreeBSD.org]; NEURAL_HAM_SHORT(-1.00)[-1.000,0]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; IP_SCORE(-3.77)[ip: (-9.91), ipnet: 2610:1c1:1::/48(-4.93), asn: 11403(-3.91), country: US(-0.09)] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 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: Mon, 12 Nov 2018 21:51:38 -0000 Author: brooks Date: Mon Nov 12 21:51:36 2018 New Revision: 340388 URL: https://svnweb.freebsd.org/changeset/base/340388 Log: MFC r340302: Fix freebsd32 mknod(at). As dev_t is now a 64-bit integer, it requires special handling as a system call argument. 64-bit arguments are split between two 64-bit integers due to the way arguments are promoted to allow reuse of most system call implementations. They must be reassembled before use. Further, 64-bit arguments at an odd offset (counting from zero) are padded and slid to the next slot on powerpc and mips. Fix the non-COMPAT11 system call by adding a freebsd32_mknodat() and appropriately padded declerations. The COMPAT11 system calls are fully compatible with the 64-bit implementations so remove the freebsd32_ versions. Use uint32_t consistently as the type of the old dev_t. This matches the old definition. Reviewed by: kib Approved by: re (gjb) Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D17928 Modified: stable/12/sys/compat/freebsd32/freebsd32_misc.c stable/12/sys/compat/freebsd32/syscalls.master stable/12/sys/kern/syscalls.master Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/compat/freebsd32/freebsd32_misc.c ============================================================================== --- stable/12/sys/compat/freebsd32/freebsd32_misc.c Mon Nov 12 21:01:28 2018 (r340387) +++ stable/12/sys/compat/freebsd32/freebsd32_misc.c Mon Nov 12 21:51:36 2018 (r340388) @@ -463,25 +463,14 @@ freebsd32_fexecve(struct thread *td, struct freebsd32_ return (error); } -#if defined(COMPAT_FREEBSD11) -int -freebsd11_freebsd32_mknod(struct thread *td, - struct freebsd11_freebsd32_mknod_args *uap) -{ - return (kern_mknodat(td, AT_FDCWD, uap->path, UIO_USERSPACE, uap->mode, - uap->dev)); -} - int -freebsd11_freebsd32_mknodat(struct thread *td, - struct freebsd11_freebsd32_mknodat_args *uap) +freebsd32_mknodat(struct thread *td, struct freebsd32_mknodat_args *uap) { - return (kern_mknodat(td, uap->fd, uap->path, UIO_USERSPACE, uap->mode, - uap->dev)); + return (kern_mknodat(td, uap->fd, uap->path, UIO_USERSPACE, + uap->mode, PAIR32TO64(dev_t, uap->dev))); } -#endif /* COMPAT_FREEBSD11 */ int freebsd32_mprotect(struct thread *td, struct freebsd32_mprotect_args *uap) Modified: stable/12/sys/compat/freebsd32/syscalls.master ============================================================================== --- stable/12/sys/compat/freebsd32/syscalls.master Mon Nov 12 21:01:28 2018 (r340387) +++ stable/12/sys/compat/freebsd32/syscalls.master Mon Nov 12 21:51:36 2018 (r340388) @@ -83,8 +83,8 @@ 11 AUE_NULL OBSOL execv 12 AUE_CHDIR NOPROTO { int chdir(char *path); } 13 AUE_FCHDIR NOPROTO { int fchdir(int fd); } -14 AUE_MKNOD COMPAT11 { int freebsd32_mknod(char *path, \ - int mode, int dev); } +14 AUE_MKNOD COMPAT11|NOPROTO { int mknod(char *path, \ + int mode, uint32_t dev); } 15 AUE_CHMOD NOPROTO { int chmod(char *path, int mode); } 16 AUE_CHOWN NOPROTO { int chown(char *path, int uid, int gid); } 17 AUE_NULL NOPROTO { caddr_t break(char *nsize); } @@ -943,7 +943,7 @@ mode_t mode); } 497 AUE_MKFIFOAT NOPROTO { int mkfifoat(int fd, char *path, \ mode_t mode); } -498 AUE_MKNODAT COMPAT11 { int freebsd32_mknodat(int fd, char *path, \ +498 AUE_MKNODAT COMPAT11|NOPROTO { int mknodat(int fd, char *path, \ mode_t mode, uint32_t dev); } 499 AUE_OPENAT_RWTC NOPROTO { int openat(int fd, char *path, int flag, \ mode_t mode); } @@ -1095,8 +1095,15 @@ long bufsize, int mode); } 558 AUE_FHSTATFS NOPROTO { int fhstatfs(const struct fhandle *u_fhp, \ struct statfs32 *buf); } -559 AUE_MKNODAT NOPROTO { int mknodat(int fd, char *path, mode_t mode, \ - dev_t dev); } +#ifdef PAD64_REQUIRED +559 AUE_MKNODAT STD { int freebsd32_mknodat(int fd, \ + char *path, mode_t mode, \ + int pad, uint32_t dev1, uint32_t dev2); } +#else +559 AUE_MKNODAT STD { int freebsd32_mknodat(int fd, \ + char *path, mode_t mode, \ + uint32_t dev1, uint32_t dev2); } +#endif 560 AUE_KEVENT STD { int freebsd32_kevent(int fd, \ const struct kevent32 *changelist, \ int nchanges, \ Modified: stable/12/sys/kern/syscalls.master ============================================================================== --- stable/12/sys/kern/syscalls.master Mon Nov 12 21:01:28 2018 (r340387) +++ stable/12/sys/kern/syscalls.master Mon Nov 12 21:51:36 2018 (r340388) @@ -114,7 +114,7 @@ 12 AUE_CHDIR STD { int chdir(_In_z_ char *path); } 13 AUE_FCHDIR STD { int fchdir(int fd); } 14 AUE_MKNOD COMPAT11 { int mknod(_In_z_ char *path, int mode, \ - int dev); } + uint32_t dev); } 15 AUE_CHMOD STD { int chmod(_In_z_ char *path, int mode); } 16 AUE_CHOWN STD { int chown(_In_z_ char *path, \ int uid, int gid); }