From owner-svn-src-head@freebsd.org Thu Sep 22 22:34:45 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4F73ABE6D7F; Thu, 22 Sep 2016 22:34:45 +0000 (UTC) (envelope-from oshogbo.vx@gmail.com) Received: from mail-wm0-x232.google.com (mail-wm0-x232.google.com [IPv6:2a00:1450:400c:c09::232]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BAF5D275; Thu, 22 Sep 2016 22:34:44 +0000 (UTC) (envelope-from oshogbo.vx@gmail.com) Received: by mail-wm0-x232.google.com with SMTP id b130so173426393wmc.0; Thu, 22 Sep 2016 15:34:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=HDMskWIpHmJe+7CBKsxr9cE4LNgyPqmrTEN8Ip1gIWA=; b=flalFxy5yiCtd38zDv2NqsGxGyU47dCv4pncv6KKvuQtT7sYeTHu9wlq0+ZIeLYC2j v5RZ3YZoRJjhtwfwX9DWAxviWC9/J9sl1LGqMlj58y398yAvAt4S9Uq9JX11WbUoo3rA bfL96k1KXRENHFLCkpTgpk25NosQ+MAuA+9n6yRVXNHcB+LspEzO2qQ9pofKxzE0KZ06 ukkYX8hZ7HSQDucdoyB5+wGyTfbtEJwWrenCMH3YrGLvaY6V9ikSX5rY8agobGXJC8/r 2q6v7ozFzTV7AKyqbmFX08Ji1oMfBMYSZcfNoi4eTtdgwyYcIhe3Hi5qA5mMqSL5S67g G+tw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=HDMskWIpHmJe+7CBKsxr9cE4LNgyPqmrTEN8Ip1gIWA=; b=BD3zRxLbJp3sHIGxSSf27P6ii7Rlk+tdIT3vZ48jiZ9XYSFhLQK82biTaeyvn4QpXx D+R/E8g86+uNbyPAMTax+x5Cg6p8TU2sPEcN5CpkCUz6cRjq4QlStxgKHuaFSMCrd8cs pRXIsCmVMxZIAwInMBiA9XD/5qTcJkQCpQEegnuNGKuLLU7NzW7lu5P5DRTSFYhWNKqI m46b8R3F8PoLQKL/ZaedmfIzjvcpRGn+NUxwl/Rd7oolSJk26q/26798zd2ZtaH5ywtP MxKLb0MLyS1ojrqylOlxwDfK8PBbTEz6Oae4/wL0v/jTw0Y5cvfC1tC0xDW6NQ5cRsg6 QTHw== X-Gm-Message-State: AA6/9RmuAZAlkh+oFejj5Gv9AIYf0SJQuasyLFIxDfY8SBwkdifulB7eiHYzfD59kuofrz0JjbT+1w7BcSbbcA== X-Received: by 10.28.87.16 with SMTP id l16mr115482wmb.75.1474583683196; Thu, 22 Sep 2016 15:34:43 -0700 (PDT) MIME-Version: 1.0 Sender: oshogbo.vx@gmail.com Received: by 10.28.158.197 with HTTP; Thu, 22 Sep 2016 15:34:40 -0700 (PDT) In-Reply-To: <20160922161102.GA71374@bsdpad.com> References: <201609220958.u8M9wkfh034759@repo.freebsd.org> <20160922143412.GA69951@bsdpad.com> <20160922145625.GA70214@bsdpad.com> <20160922152153.GA70762@bsdpad.com> <20160922161102.GA71374@bsdpad.com> From: Mariusz Zaborski Date: Fri, 23 Sep 2016 00:34:40 +0200 X-Google-Sender-Auth: xiorRzRkGr9RfSpsU1p8nYeKojE Message-ID: Subject: Re: svn commit: r306174 - in head/sys: compat/cloudabi compat/linux kern netinet sys To: Ruslan Bukin Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: multipart/mixed; boundary=001a1144375aa10e4c053d20446c X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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: Thu, 22 Sep 2016 22:34:45 -0000 --001a1144375aa10e4c053d20446c Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Thanks, I was able to reproduce that :) I attached the patch. Could you please confirm that it fix the problem? Thank you and sorry for inconveniences, Mariusz On 22 September 2016 at 18:11, Ruslan Bukin wro= te: > I have just tested this with MIPS64EL and the result is the same. > So you can try both EL or EB > > e.g. make -j16 TARGET=3Dmips TARGET_ARCH=3Dmips64el KERNCONF=3DMALTA64 bu= ildkernel > > Ruslan > > On Thu, Sep 22, 2016 at 03:21:53PM +0000, Ruslan Bukin wrote: >> Hi >> >> It reports nothing. Yes I use qemu: >> /home/rb743/dev/qemu/qemu/build1/mips64-softmmu/qemu-system-mips64 -M ma= lta -kernel ~/obj/mips.mips64/home/rb743/dev/freebsd-mips/sys/MALTA64/kerne= l -hda /home/rb743/world-mips64eb/mips64eb.img -nographic -smp 1 -cpu 5kf -= net nic -net user -m 2048M -redir tcp:4022::22 >> >> Ruslan >> >> On Thu, Sep 22, 2016 at 05:11:07PM +0200, Mariusz Zaborski wrote: >> > I tested it on the mips for Malta kernel and it's works fine. I will >> > try to do it on mips64, are you using qemu to test it? >> > What is ctrl + t reporting you? >> > >> > >> > On 22 September 2016 at 16:56, Ruslan Bukin wrote: >> > > May be. The next line should be >> > > /etc/rc: WARNING: $hostname is not set -- see rc.conf(5). >> > > >> > > but it hangs before this line >> > > >> > > Ruslan >> > > >> > > On Thu, Sep 22, 2016 at 04:39:16PM +0200, Mariusz Zaborski wrote: >> > >> Hi Ruslan, >> > >> >> > >> Does it hang on some network script? >> > >> >> > >> Thanks, >> > >> Mariusz >> > >> >> > >> >> > >> On 22 September 2016 at 16:34, Ruslan Bukin wrote: >> > >> > Hi Mariusz >> > >> > >> > >> > my MIPS64EB kernel stops booting with this >> > >> > >> > >> > somewhere here: >> > >> > [...] >> > >> > Starting file system checks: >> > >> > /dev/ada0: 20369 files, 794696 used, 7573573 free (933 frags, 946= 580 blocks, 0.0% fragmentation) >> > >> > Mounting local filesystems:. >> > >> > ELF ldconfig path: /lib /usr/lib /usr/lib/compat >> > >> > random: unblocking device. >> > >> > >> > >> > any idea ? (should I rebuild something?) >> > >> > >> > >> > thanks! >> > >> > >> > >> > Ruslan >> > >> > >> > >> > On Thu, Sep 22, 2016 at 09:58:46AM +0000, Mariusz Zaborski wrote: >> > >> >> Author: oshogbo >> > >> >> Date: Thu Sep 22 09:58:46 2016 >> > >> >> New Revision: 306174 >> > >> >> URL: https://svnweb.freebsd.org/changeset/base/306174 >> > >> >> >> > >> >> Log: >> > >> >> capsicum: propagate rights on accept(2) >> > >> >> >> > >> >> Descriptor returned by accept(2) should inherits capabilities = rights from >> > >> >> the listening socket. >> > >> >> >> > >> >> PR: 201052 >> > >> >> Reviewed by: emaste, jonathan >> > >> >> Discussed with: many >> > >> >> Differential Revision: https://reviews.freebsd.org/D7724 >> > >> >> >> > >> >> Modified: >> > >> >> head/sys/compat/cloudabi/cloudabi_sock.c >> > >> >> head/sys/compat/linux/linux_socket.c >> > >> >> head/sys/kern/kern_sendfile.c >> > >> >> head/sys/kern/uipc_syscalls.c >> > >> >> head/sys/netinet/sctp_syscalls.c >> > >> >> head/sys/sys/socketvar.h >> > >> >> >> > >> >> Modified: head/sys/compat/cloudabi/cloudabi_sock.c >> > >> >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D >> > >> >> --- head/sys/compat/cloudabi/cloudabi_sock.c Thu Sep 22 09:33:2= 2 2016 (r306173) >> > >> >> +++ head/sys/compat/cloudabi/cloudabi_sock.c Thu Sep 22 09:58:4= 6 2016 (r306174) >> > >> >> @@ -210,7 +210,7 @@ cloudabi_sys_sock_stat_get(struct thread >> > >> >> int error; >> > >> >> >> > >> >> error =3D getsock_cap(td, uap->sock, cap_rights_init(&righ= ts, >> > >> >> - CAP_GETSOCKOPT, CAP_GETPEERNAME, CAP_GETSOCKNAME), &fp= , NULL); >> > >> >> + CAP_GETSOCKOPT, CAP_GETPEERNAME, CAP_GETSOCKNAME), &fp= , NULL, NULL); >> > >> >> if (error !=3D 0) >> > >> >> return (error); >> > >> >> so =3D fp->f_data; >> > >> >> >> > >> >> Modified: head/sys/compat/linux/linux_socket.c >> > >> >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D >> > >> >> --- head/sys/compat/linux/linux_socket.c Thu Sep 22 09:33:2= 2 2016 (r306173) >> > >> >> +++ head/sys/compat/linux/linux_socket.c Thu Sep 22 09:58:4= 6 2016 (r306174) >> > >> >> @@ -855,7 +855,7 @@ linux_accept_common(struct thread *td, i >> > >> >> if (error =3D=3D EFAULT && namelen !=3D sizeof(str= uct sockaddr_in)) >> > >> >> return (EINVAL); >> > >> >> if (error =3D=3D EINVAL) { >> > >> >> - error1 =3D getsock_cap(td, s, &rights, &fp= , NULL); >> > >> >> + error1 =3D getsock_cap(td, s, &rights, &fp= , NULL, NULL); >> > >> >> if (error1 !=3D 0) >> > >> >> return (error1); >> > >> >> so =3D fp->f_data; >> > >> >> >> > >> >> Modified: head/sys/kern/kern_sendfile.c >> > >> >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D >> > >> >> --- head/sys/kern/kern_sendfile.c Thu Sep 22 09:33:22 2016 = (r306173) >> > >> >> +++ head/sys/kern/kern_sendfile.c Thu Sep 22 09:58:46 2016 = (r306174) >> > >> >> @@ -502,7 +502,7 @@ sendfile_getsock(struct thread *td, int >> > >> >> * The socket must be a stream socket and connected. >> > >> >> */ >> > >> >> error =3D getsock_cap(td, s, cap_rights_init(&rights, CAP_= SEND), >> > >> >> - sock_fp, NULL); >> > >> >> + sock_fp, NULL, NULL); >> > >> >> if (error !=3D 0) >> > >> >> return (error); >> > >> >> *so =3D (*sock_fp)->f_data; >> > >> >> >> > >> >> Modified: head/sys/kern/uipc_syscalls.c >> > >> >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D >> > >> >> --- head/sys/kern/uipc_syscalls.c Thu Sep 22 09:33:22 2016 = (r306173) >> > >> >> +++ head/sys/kern/uipc_syscalls.c Thu Sep 22 09:58:46 2016 = (r306174) >> > >> >> @@ -89,20 +89,23 @@ static int sockargs(struct mbuf **, char >> > >> >> /* >> > >> >> * Convert a user file descriptor to a kernel file entry and ch= eck if required >> > >> >> * capability rights are present. >> > >> >> + * If required copy of current set of capability rights is retu= rned. >> > >> >> * A reference on the file entry is held upon returning. >> > >> >> */ >> > >> >> int >> > >> >> getsock_cap(struct thread *td, int fd, cap_rights_t *rightsp, >> > >> >> - struct file **fpp, u_int *fflagp) >> > >> >> + struct file **fpp, u_int *fflagp, struct filecaps *havecaps= p) >> > >> >> { >> > >> >> struct file *fp; >> > >> >> int error; >> > >> >> >> > >> >> - error =3D fget_unlocked(td->td_proc->p_fd, fd, rightsp, &f= p, NULL); >> > >> >> + error =3D fget_cap(td, fd, rightsp, &fp, havecapsp); >> > >> >> if (error !=3D 0) >> > >> >> return (error); >> > >> >> if (fp->f_type !=3D DTYPE_SOCKET) { >> > >> >> fdrop(fp, td); >> > >> >> + if (havecapsp !=3D NULL) >> > >> >> + filecaps_free(havecapsp); >> > >> >> return (ENOTSOCK); >> > >> >> } >> > >> >> if (fflagp !=3D NULL) >> > >> >> @@ -188,7 +191,7 @@ kern_bindat(struct thread *td, int dirfd >> > >> >> AUDIT_ARG_FD(fd); >> > >> >> AUDIT_ARG_SOCKADDR(td, dirfd, sa); >> > >> >> error =3D getsock_cap(td, fd, cap_rights_init(&rights, CAP= _BIND), >> > >> >> - &fp, NULL); >> > >> >> + &fp, NULL, NULL); >> > >> >> if (error !=3D 0) >> > >> >> return (error); >> > >> >> so =3D fp->f_data; >> > >> >> @@ -235,7 +238,7 @@ sys_listen(struct thread *td, struct lis >> > >> >> >> > >> >> AUDIT_ARG_FD(uap->s); >> > >> >> error =3D getsock_cap(td, uap->s, cap_rights_init(&rights,= CAP_LISTEN), >> > >> >> - &fp, NULL); >> > >> >> + &fp, NULL, NULL); >> > >> >> if (error =3D=3D 0) { >> > >> >> so =3D fp->f_data; >> > >> >> #ifdef MAC >> > >> >> @@ -308,6 +311,7 @@ kern_accept4(struct thread *td, int s, s >> > >> >> struct file *headfp, *nfp =3D NULL; >> > >> >> struct sockaddr *sa =3D NULL; >> > >> >> struct socket *head, *so; >> > >> >> + struct filecaps fcaps; >> > >> >> cap_rights_t rights; >> > >> >> u_int fflag; >> > >> >> pid_t pgid; >> > >> >> @@ -318,7 +322,7 @@ kern_accept4(struct thread *td, int s, s >> > >> >> >> > >> >> AUDIT_ARG_FD(s); >> > >> >> error =3D getsock_cap(td, s, cap_rights_init(&rights, CAP_= ACCEPT), >> > >> >> - &headfp, &fflag); >> > >> >> + &headfp, &fflag, &fcaps); >> > >> >> if (error !=3D 0) >> > >> >> return (error); >> > >> >> head =3D headfp->f_data; >> > >> >> @@ -331,7 +335,8 @@ kern_accept4(struct thread *td, int s, s >> > >> >> if (error !=3D 0) >> > >> >> goto done; >> > >> >> #endif >> > >> >> - error =3D falloc(td, &nfp, &fd, (flags & SOCK_CLOEXEC) ? O= _CLOEXEC : 0); >> > >> >> + error =3D falloc_caps(td, &nfp, &fd, >> > >> >> + (flags & SOCK_CLOEXEC) ? O_CLOEXEC : 0, &fcaps); >> > >> >> if (error !=3D 0) >> > >> >> goto done; >> > >> >> ACCEPT_LOCK(); >> > >> >> @@ -440,6 +445,8 @@ noconnection: >> > >> >> * a reference on nfp to the caller on success if they req= uest it. >> > >> >> */ >> > >> >> done: >> > >> >> + if (nfp =3D=3D NULL) >> > >> >> + filecaps_free(&fcaps); >> > >> >> if (fp !=3D NULL) { >> > >> >> if (error =3D=3D 0) { >> > >> >> *fp =3D nfp; >> > >> >> @@ -511,7 +518,7 @@ kern_connectat(struct thread *td, int di >> > >> >> AUDIT_ARG_FD(fd); >> > >> >> AUDIT_ARG_SOCKADDR(td, dirfd, sa); >> > >> >> error =3D getsock_cap(td, fd, cap_rights_init(&rights, CAP= _CONNECT), >> > >> >> - &fp, NULL); >> > >> >> + &fp, NULL, NULL); >> > >> >> if (error !=3D 0) >> > >> >> return (error); >> > >> >> so =3D fp->f_data; >> > >> >> @@ -754,7 +761,7 @@ kern_sendit(struct thread *td, int s, st >> > >> >> AUDIT_ARG_SOCKADDR(td, AT_FDCWD, mp->msg_name); >> > >> >> cap_rights_set(&rights, CAP_CONNECT); >> > >> >> } >> > >> >> - error =3D getsock_cap(td, s, &rights, &fp, NULL); >> > >> >> + error =3D getsock_cap(td, s, &rights, &fp, NULL, NULL); >> > >> >> if (error !=3D 0) >> > >> >> return (error); >> > >> >> so =3D (struct socket *)fp->f_data; >> > >> >> @@ -923,7 +930,7 @@ kern_recvit(struct thread *td, int s, st >> > >> >> >> > >> >> AUDIT_ARG_FD(s); >> > >> >> error =3D getsock_cap(td, s, cap_rights_init(&rights, CAP_= RECV), >> > >> >> - &fp, NULL); >> > >> >> + &fp, NULL, NULL); >> > >> >> if (error !=3D 0) >> > >> >> return (error); >> > >> >> so =3D fp->f_data; >> > >> >> @@ -1198,7 +1205,7 @@ sys_shutdown(struct thread *td, struct s >> > >> >> >> > >> >> AUDIT_ARG_FD(uap->s); >> > >> >> error =3D getsock_cap(td, uap->s, cap_rights_init(&rights,= CAP_SHUTDOWN), >> > >> >> - &fp, NULL); >> > >> >> + &fp, NULL, NULL); >> > >> >> if (error =3D=3D 0) { >> > >> >> so =3D fp->f_data; >> > >> >> error =3D soshutdown(so, uap->how); >> > >> >> @@ -1257,7 +1264,7 @@ kern_setsockopt(struct thread *td, int s >> > >> >> >> > >> >> AUDIT_ARG_FD(s); >> > >> >> error =3D getsock_cap(td, s, cap_rights_init(&rights, CAP_= SETSOCKOPT), >> > >> >> - &fp, NULL); >> > >> >> + &fp, NULL, NULL); >> > >> >> if (error =3D=3D 0) { >> > >> >> so =3D fp->f_data; >> > >> >> error =3D sosetopt(so, &sopt); >> > >> >> @@ -1323,7 +1330,7 @@ kern_getsockopt(struct thread *td, int s >> > >> >> >> > >> >> AUDIT_ARG_FD(s); >> > >> >> error =3D getsock_cap(td, s, cap_rights_init(&rights, CAP_= GETSOCKOPT), >> > >> >> - &fp, NULL); >> > >> >> + &fp, NULL, NULL); >> > >> >> if (error =3D=3D 0) { >> > >> >> so =3D fp->f_data; >> > >> >> error =3D sogetopt(so, &sopt); >> > >> >> @@ -1376,7 +1383,7 @@ kern_getsockname(struct thread *td, int >> > >> >> >> > >> >> AUDIT_ARG_FD(fd); >> > >> >> error =3D getsock_cap(td, fd, cap_rights_init(&rights, CAP= _GETSOCKNAME), >> > >> >> - &fp, NULL); >> > >> >> + &fp, NULL, NULL); >> > >> >> if (error !=3D 0) >> > >> >> return (error); >> > >> >> so =3D fp->f_data; >> > >> >> @@ -1463,7 +1470,7 @@ kern_getpeername(struct thread *td, int >> > >> >> >> > >> >> AUDIT_ARG_FD(fd); >> > >> >> error =3D getsock_cap(td, fd, cap_rights_init(&rights, CAP= _GETPEERNAME), >> > >> >> - &fp, NULL); >> > >> >> + &fp, NULL, NULL); >> > >> >> if (error !=3D 0) >> > >> >> return (error); >> > >> >> so =3D fp->f_data; >> > >> >> >> > >> >> Modified: head/sys/netinet/sctp_syscalls.c >> > >> >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D >> > >> >> --- head/sys/netinet/sctp_syscalls.c Thu Sep 22 09:33:22 2016 = (r306173) >> > >> >> +++ head/sys/netinet/sctp_syscalls.c Thu Sep 22 09:58:46 2016 = (r306174) >> > >> >> @@ -248,7 +248,7 @@ sys_sctp_generic_sendmsg (td, uap) >> > >> >> } >> > >> >> >> > >> >> AUDIT_ARG_FD(uap->sd); >> > >> >> - error =3D getsock_cap(td, uap->sd, &rights, &fp, NULL); >> > >> >> + error =3D getsock_cap(td, uap->sd, &rights, &fp, NULL, NUL= L); >> > >> >> if (error !=3D 0) >> > >> >> goto sctp_bad; >> > >> >> #ifdef KTRACE >> > >> >> @@ -361,7 +361,7 @@ sys_sctp_generic_sendmsg_iov(td, uap) >> > >> >> } >> > >> >> >> > >> >> AUDIT_ARG_FD(uap->sd); >> > >> >> - error =3D getsock_cap(td, uap->sd, &rights, &fp, NULL); >> > >> >> + error =3D getsock_cap(td, uap->sd, &rights, &fp, NULL, NUL= L); >> > >> >> if (error !=3D 0) >> > >> >> goto sctp_bad1; >> > >> >> >> > >> >> @@ -477,7 +477,7 @@ sys_sctp_generic_recvmsg(td, uap) >> > >> >> >> > >> >> AUDIT_ARG_FD(uap->sd); >> > >> >> error =3D getsock_cap(td, uap->sd, cap_rights_init(&rights= , CAP_RECV), >> > >> >> - &fp, NULL); >> > >> >> + &fp, NULL, NULL); >> > >> >> if (error !=3D 0) >> > >> >> return (error); >> > >> >> #ifdef COMPAT_FREEBSD32 >> > >> >> >> > >> >> Modified: head/sys/sys/socketvar.h >> > >> >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D >> > >> >> --- head/sys/sys/socketvar.h Thu Sep 22 09:33:22 2016 (r= 306173) >> > >> >> +++ head/sys/sys/socketvar.h Thu Sep 22 09:58:46 2016 (r= 306174) >> > >> >> @@ -321,6 +321,7 @@ extern u_long sb_max; >> > >> >> extern so_gen_t so_gencnt; >> > >> >> >> > >> >> struct file; >> > >> >> +struct filecaps; >> > >> >> struct filedesc; >> > >> >> struct mbuf; >> > >> >> struct sockaddr; >> > >> >> @@ -340,7 +341,7 @@ struct uio; >> > >> >> */ >> > >> >> int getsockaddr(struct sockaddr **namp, caddr_t uaddr, size_t = len); >> > >> >> int getsock_cap(struct thread *td, int fd, cap_rights_t *right= sp, >> > >> >> - struct file **fpp, u_int *fflagp); >> > >> >> + struct file **fpp, u_int *fflagp, struct filecaps *hav= ecaps); >> > >> >> void soabort(struct socket *so); >> > >> >> int soaccept(struct socket *so, struct sockaddr **nam); >> > >> >> void soaio_enqueue(struct task *task); >> > >> >> >> > >> --001a1144375aa10e4c053d20446c Content-Type: text/x-patch; charset=US-ASCII; name="fget_cap.patch" Content-Disposition: attachment; filename="fget_cap.patch" Content-Transfer-Encoding: base64 X-Attachment-Id: f_itex0rw30 ZGlmZiAtLWdpdCBhL3N5cy9rZXJuL2tlcm5fZGVzY3JpcC5jIGIvc3lzL2tlcm4va2Vybl9kZXNj cmlwLmMKaW5kZXggMzEwNzJmMS4uNDcyNDVlNyAxMDA2NDQKLS0tIGEvc3lzL2tlcm4va2Vybl9k ZXNjcmlwLmMKKysrIGIvc3lzL2tlcm4va2Vybl9kZXNjcmlwLmMKQEAgLTI0ODEsMTIgKzI0ODEs MTYgQEAgaW50CiBmZ2V0X2NhcChzdHJ1Y3QgdGhyZWFkICp0ZCwgaW50IGZkLCBjYXBfcmlnaHRz X3QgKm5lZWRyaWdodHNwLAogICAgIHN0cnVjdCBmaWxlICoqZnBwLCBzdHJ1Y3QgZmlsZWNhcHMg KmhhdmVjYXBzcCkKIHsKLQlzdHJ1Y3QgZmlsZWRlc2MgKmZkcDsKLQlzdHJ1Y3QgZmlsZSAqZnA7 CisJc3RydWN0IGZpbGVkZXNjICpmZHAgPSB0ZC0+dGRfcHJvYy0+cF9mZDsKIAlpbnQgZXJyb3I7 CisjaWZuZGVmIENBUEFCSUxJVElFUworCWVycm9yID0gZmdldF91bmxvY2tlZChmZHAsIGZkLCBu ZWVkcmlnaHRzcCwgZnBwLCBOVUxMKTsKKwlpZiAoZXJyb3IgPT0gMCAmJiBoYXZlY2Fwc3AgIT0g TlVMTCkKKwkJZmlsZWNhcHNfZmlsbChoYXZlY2Fwc3ApOworI2Vsc2UKKwlzdHJ1Y3QgZmlsZSAq ZnA7CiAJc2VxX3Qgc2VxOwogCi0JZmRwID0gdGQtPnRkX3Byb2MtPnBfZmQ7CiAJZm9yICg7Oykg ewogCQllcnJvciA9IGZnZXRfdW5sb2NrZWQoZmRwLCBmZCwgbmVlZHJpZ2h0c3AsICZmcCwgJnNl cSk7CiAJCWlmIChlcnJvciAhPSAwKQpAQCAtMjUxMiw3ICsyNTE2LDcgQEAgZ2V0X2xvY2tlZDoK IAlGSUxFREVTQ19TTE9DSyhmZHApOwogCWVycm9yID0gZmdldF9jYXBfbG9ja2VkKGZkcCwgZmQs IG5lZWRyaWdodHNwLCBmcHAsIGhhdmVjYXBzcCk7CiAJRklMRURFU0NfU1VOTE9DSyhmZHApOwot CisjZW5kaWYKIAlyZXR1cm4gKGVycm9yKTsKIH0KIAo= --001a1144375aa10e4c053d20446c--