|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH v8 01/19] common/symbols: Export hypervisor symbols to privileged guest
>>> On 01.07.14 at 16:37, <boris.ostrovsky@xxxxxxxxxx> wrote:
> + case XENPF_get_symbol:
> + {
> + static char name[KSYM_NAME_LEN + 1]; /* protected by xenpf_lock */
> + XEN_GUEST_HANDLE(char) nameh;
> + uint32_t namelen, copylen;
> +
> + guest_from_compat_handle(nameh, op->u.symdata.name);
> +
> + ret = xensyms_read(&op->u.symdata.symnum, &op->u.symdata.type,
> + &op->u.symdata.address, name);
> +
> + namelen = (uint32_t)strlen(name);
Pointless cast.
> +
> + if ( unlikely(strlen(name) > op->u.symdata.namelen) )
Any reason not to use "namelen" here?
> +struct xenpf_symdata {
> + /* IN/OUT variables */
> + uint32_t namelen; /* IN: size-1 of name buffer */
"size-1"? This certainly should be the size of the buffer, so that one
can invoke the hypercall with no buffer allocated (size set to zero).
Jan
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |