public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Sasha Levin <sasha.levin@oracle.com>
To: Alexander Shishkin <alexander.shishkin@linux.intel.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: linux-kernel@vger.kernel.org, mathieu.poirier@linaro.org,
	peter.lachner@intel.com, norbert.schulz@intel.com,
	keven.boell@intel.com, yann.fouassier@intel.com,
	laurent.fert@intel.com, linux-api@vger.kernel.org
Subject: Re: [PATCH v4 01/11] stm class: Introduce an abstraction for System Trace Module devices
Date: Sat, 5 Dec 2015 22:40:10 -0500	[thread overview]
Message-ID: <5663AE1A.2080808@oracle.com> (raw)
In-Reply-To: <1442926040-15150-2-git-send-email-alexander.shishkin@linux.intel.com>

On 09/22/2015 08:47 AM, Alexander Shishkin wrote:
> +static ssize_t stm_char_write(struct file *file, const char __user *buf,
> +			      size_t count, loff_t *ppos)
> +{
> +	struct stm_file *stmf = file->private_data;
> +	struct stm_device *stm = stmf->stm;
> +	char *kbuf;
> +	int err;
> +
> +	/*
> +	 * if no m/c have been assigned to this writer up to this
> +	 * point, use "default" policy entry
> +	 */
> +	if (!stmf->output.nr_chans) {
> +		err = stm_file_assign(stmf, "default", 1);
> +		/*
> +		 * EBUSY means that somebody else just assigned this
> +		 * output, which is just fine for write()
> +		 */
> +		if (err && err != -EBUSY)
> +			return err;
> +	}
> +
> +	kbuf = kmalloc(count + 1, GFP_KERNEL);

This bit allows for user-controllable kmalloc() allocation lengths, including
a possible overflow.


Thanks,
Sasha

  reply	other threads:[~2015-12-06  3:40 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-22 12:47 [PATCH v4 00/11] Introduce Intel Trace Hub support Alexander Shishkin
2015-09-22 12:47 ` [PATCH v4 01/11] stm class: Introduce an abstraction for System Trace Module devices Alexander Shishkin
2015-12-06  3:40   ` Sasha Levin [this message]
2015-09-22 12:47 ` [PATCH v4 02/11] MAINTAINERS: add an entry for System Trace Module device class Alexander Shishkin
2015-09-22 12:47 ` [PATCH v4 03/11] stm class: dummy_stm: Add dummy driver for testing stm class Alexander Shishkin
2015-09-22 12:47 ` [PATCH v4 04/11] stm class: stm_console: Add kernel-console-over-stm driver Alexander Shishkin
2015-09-22 12:47 ` [PATCH v4 05/11] intel_th: Add driver infrastructure for Intel(R) Trace Hub devices Alexander Shishkin
2015-09-22 12:47 ` [PATCH v4 06/11] intel_th: Add pci glue layer for Intel(R) Trace Hub Alexander Shishkin
2015-09-22 12:47 ` [PATCH v4 07/11] intel_th: Add Global Trace Hub driver Alexander Shishkin
2015-09-22 12:47 ` [PATCH v4 08/11] intel_th: Add Software " Alexander Shishkin
2015-09-22 12:47 ` [PATCH v4 09/11] intel_th: Add Memory Storage Unit driver Alexander Shishkin
2015-09-22 12:47 ` [PATCH v4 10/11] intel_th: Add PTI output driver Alexander Shishkin
2015-09-22 12:47 ` [PATCH v4 11/11] MAINTAINERS: add an entry for Intel(R) Trace Hub Alexander Shishkin

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=5663AE1A.2080808@oracle.com \
    --to=sasha.levin@oracle.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=keven.boell@intel.com \
    --cc=laurent.fert@intel.com \
    --cc=linux-api@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mathieu.poirier@linaro.org \
    --cc=norbert.schulz@intel.com \
    --cc=peter.lachner@intel.com \
    --cc=yann.fouassier@intel.com \
    /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