From owner-svn-src-head@freebsd.org Sat May 19 05:14:07 2018 Return-Path: Delivered-To: svn-src-head@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 1D50BEEF283; Sat, 19 May 2018 05:14:07 +0000 (UTC) (envelope-from mmacy@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 C10147F568; Sat, 19 May 2018 05:14:06 +0000 (UTC) (envelope-from mmacy@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 8825322A09; Sat, 19 May 2018 05:14:06 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4J5E66g058423; Sat, 19 May 2018 05:14:06 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4J5E5gG058420; Sat, 19 May 2018 05:14:05 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201805190514.w4J5E5gG058420@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Sat, 19 May 2018 05:14:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333863 - in head/sys: kern sys X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: in head/sys: kern sys X-SVN-Commit-Revision: 333863 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 May 2018 05:14:07 -0000 Author: mmacy Date: Sat May 19 05:14:05 2018 New Revision: 333863 URL: https://svnweb.freebsd.org/changeset/base/333863 Log: capsicum: propagate const correctness Modified: head/sys/kern/kern_descrip.c head/sys/kern/sys_capability.c head/sys/sys/capsicum.h Modified: head/sys/kern/kern_descrip.c ============================================================================== --- head/sys/kern/kern_descrip.c Sat May 19 05:12:57 2018 (r333862) +++ head/sys/kern/kern_descrip.c Sat May 19 05:14:05 2018 (r333863) @@ -2625,9 +2625,9 @@ fget_unlocked(struct filedesc *fdp, int fd, cap_rights struct file **fpp, seq_t *seqp) { #ifdef CAPABILITIES - struct filedescent *fde; + const struct filedescent *fde; #endif - struct fdescenttbl *fdt; + const struct fdescenttbl *fdt; struct file *fp; u_int count; #ifdef CAPABILITIES @@ -2673,7 +2673,7 @@ fget_unlocked(struct filedesc *fdp, int fd, cap_rights * table before this fd was closed, so it possible that * there is a stale fp pointer in cached version. */ - fdt = *(struct fdescenttbl * volatile *)&(fdp->fd_files); + fdt = *(const struct fdescenttbl * const volatile *)&(fdp->fd_files); continue; } /* Modified: head/sys/kern/sys_capability.c ============================================================================== --- head/sys/kern/sys_capability.c Sat May 19 05:12:57 2018 (r333862) +++ head/sys/kern/sys_capability.c Sat May 19 05:14:05 2018 (r333863) @@ -183,7 +183,7 @@ cap_check(const cap_rights_t *havep, const cap_rights_ * Convert capability rights into VM access flags. */ u_char -cap_rights_to_vmprot(cap_rights_t *havep) +cap_rights_to_vmprot(const cap_rights_t *havep) { u_char maxprot; @@ -204,14 +204,14 @@ cap_rights_to_vmprot(cap_rights_t *havep) * this one file. */ -cap_rights_t * -cap_rights_fde(struct filedescent *fdep) +const cap_rights_t * +cap_rights_fde(const struct filedescent *fdep) { return (&fdep->fde_rights); } -cap_rights_t * +const cap_rights_t * cap_rights(struct filedesc *fdp, int fd) { Modified: head/sys/sys/capsicum.h ============================================================================== --- head/sys/sys/capsicum.h Sat May 19 05:12:57 2018 (r333862) +++ head/sys/sys/capsicum.h Sat May 19 05:14:05 2018 (r333863) @@ -444,14 +444,14 @@ int cap_check(const cap_rights_t *havep, const cap_rig /* * Convert capability rights into VM access flags. */ -u_char cap_rights_to_vmprot(cap_rights_t *havep); +u_char cap_rights_to_vmprot(const cap_rights_t *havep); /* * For the purposes of procstat(1) and similar tools, allow kern_descrip.c to * extract the rights from a capability. */ -cap_rights_t *cap_rights_fde(struct filedescent *fde); -cap_rights_t *cap_rights(struct filedesc *fdp, int fd); +const cap_rights_t *cap_rights_fde(const struct filedescent *fde); +const cap_rights_t *cap_rights(struct filedesc *fdp, int fd); int cap_ioctl_check(struct filedesc *fdp, int fd, u_long cmd); int cap_fcntl_check_fde(struct filedescent *fde, int cmd);