public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Cc: arnd@arndb.de, robh+dt@kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org, bjorn.andersson@linaro.org,
	bkumar@qti.qualcomm.com, linux-arm-msm@vger.kernel.org,
	Thierry Escande <thierry.escande@linaro.org>
Subject: Re: [PATCH v6 4/5] misc: fastrpc: Add support for create remote init process
Date: Fri, 8 Feb 2019 14:56:56 +0100	[thread overview]
Message-ID: <20190208135656.GB23406@kroah.com> (raw)
In-Reply-To: <20190208132306.12571-5-srinivas.kandagatla@linaro.org>

On Fri, Feb 08, 2019 at 01:23:05PM +0000, Srinivas Kandagatla wrote:
> +static int fastrpc_init_create_process(struct fastrpc_user *fl,
> +					char __user *argp)
> +{
> +	struct fastrpc_init_create init;
> +	struct fastrpc_invoke_args args[6];

All on the stack?  Ok, but:

> +	struct fastrpc_phy_page pages[1];
> +	struct fastrpc_map *map = NULL;
> +	struct fastrpc_buf *imem = NULL;
> +	int memlen;
> +	int err;
> +	struct {
> +		int pgid;
> +		u32 namelen;
> +		u32 filelen;
> +		u32 pageslen;
> +		u32 attrs;
> +		u32 siglen;
> +	} inbuf;
> +	u32 sc;
> +
> +	if (copy_from_user(&init, argp, sizeof(init)))
> +		return -EFAULT;
> +
> +	if (init.filelen > INIT_FILELEN_MAX)
> +		return -EINVAL;
> +
> +	inbuf.pgid = fl->tgid;
> +	inbuf.namelen = strlen(current->comm) + 1;
> +	inbuf.filelen = init.filelen;
> +	inbuf.pageslen = 1;
> +	inbuf.attrs = init.attrs;
> +	inbuf.siglen = init.siglen;
> +	fl->pd = 1;
> +
> +	if (init.filelen && init.filefd) {
> +		err = fastrpc_map_create(fl, init.filefd, init.filelen, &map);
> +		if (err)
> +			return err;
> +	}
> +
> +	memlen = ALIGN(max(INIT_FILELEN_MAX, (int)init.filelen * 4),
> +		       1024 * 1024);
> +	err = fastrpc_buf_alloc(fl, fl->sctx->dev, memlen,
> +				&imem);
> +	if (err) {
> +		fastrpc_map_put(map);
> +		return err;
> +	}
> +
> +	fl->init_mem = imem;
> +	args[0].ptr = (u64)(uintptr_t)&inbuf;
> +	args[0].length = sizeof(inbuf);
> +	args[0].fd = -1;

You never clear the reserved field :(

thanks,

greg k-h

  reply	other threads:[~2019-02-08 13:57 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-08 13:23 [PATCH v6 0/5] misc: Add support to Qualcomm FastRPC driver Srinivas Kandagatla
2019-02-08 13:23 ` [PATCH v6 1/5] misc: dt-bindings: Add Qualcomm Fastrpc bindings Srinivas Kandagatla
2019-02-08 13:23 ` [PATCH v6 2/5] misc: fastrpc: Add Qualcomm fastrpc basic driver model Srinivas Kandagatla
2019-02-08 13:23 ` [PATCH v6 3/5] misc: fastrpc: Add support for context Invoke method Srinivas Kandagatla
2019-02-08 13:55   ` Greg KH
2019-02-08 14:01     ` Srinivas Kandagatla
2019-02-08 14:11       ` Greg KH
2019-02-08 14:26         ` Srinivas Kandagatla
2019-02-08 13:23 ` [PATCH v6 4/5] misc: fastrpc: Add support for create remote init process Srinivas Kandagatla
2019-02-08 13:56   ` Greg KH [this message]
2019-02-08 13:23 ` [PATCH v6 5/5] misc: fastrpc: Add support for dmabuf exporter Srinivas Kandagatla

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190208135656.GB23406@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=arnd@arndb.de \
    --cc=bjorn.andersson@linaro.org \
    --cc=bkumar@qti.qualcomm.com \
    --cc=devicetree@vger.kernel.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=robh+dt@kernel.org \
    --cc=srinivas.kandagatla@linaro.org \
    --cc=thierry.escande@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox