Date: Mon, 21 Nov 2016 16:43:14 -0800 From: Adrian Chadd <adrian.chadd@gmail.com> To: Ruslan Bukin <br@freebsd.org> Cc: "src-committers@freebsd.org" <src-committers@freebsd.org>, "svn-src-all@freebsd.org" <svn-src-all@freebsd.org>, "svn-src-head@freebsd.org" <svn-src-head@freebsd.org> Subject: Re: svn commit: r306186 - head/sys/kern Message-ID: <CAJ-VmokmLW6ufatSFzLfmHVTAGc3-2BEmqLzsFs_h9VUcMtziw@mail.gmail.com> In-Reply-To: <201609221241.u8MCfsvv097499@repo.freebsd.org> References: <201609221241.u8MCfsvv097499@repo.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
Hi, For reference - this breaks sooptcopyin() on MIPS32 BE. Undoing this commit fixes things. :) (it breaks ipfw. ) -adrian On 22 September 2016 at 05:41, Ruslan Bukin <br@freebsd.org> wrote: > Author: br > Date: Thu Sep 22 12:41:53 2016 > New Revision: 306186 > URL: https://svnweb.freebsd.org/changeset/base/306186 > > Log: > Adjust the sopt_val pointer on bigendian systems (e.g. MIPS64EB). > > sooptcopyin() checks if size of data provided by user is <= than we can > accept, else it strips down the size. On bigendian platforms we have to > move pointer as well so we copy the actual data. > > Reviewed by: gnn > Sponsored by: DARPA, AFRL > Sponsored by: HEIF5 > Differential Revision: https://reviews.freebsd.org/D7980 > > Modified: > head/sys/kern/uipc_socket.c > > Modified: head/sys/kern/uipc_socket.c > ============================================================================== > --- head/sys/kern/uipc_socket.c Thu Sep 22 12:08:26 2016 (r306185) > +++ head/sys/kern/uipc_socket.c Thu Sep 22 12:41:53 2016 (r306186) > @@ -2455,8 +2455,12 @@ sooptcopyin(struct sockopt *sopt, void * > */ > if ((valsize = sopt->sopt_valsize) < minlen) > return EINVAL; > - if (valsize > len) > + if (valsize > len) { > +#if _BYTE_ORDER == _BIG_ENDIAN > + sopt->sopt_val = (void *)((uintptr_t)sopt->sopt_val + (valsize - len)); > +#endif > sopt->sopt_valsize = valsize = len; > + } > > if (sopt->sopt_td != NULL) > return (copyin(sopt->sopt_val, buf, valsize)); >
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAJ-VmokmLW6ufatSFzLfmHVTAGc3-2BEmqLzsFs_h9VUcMtziw>