All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Ralf Baechle <ralf@linux-mips.org>
Cc: linux-mips@linux-mips.org, kernel-janitors@vger.kernel.org
Subject: Re: [patch] [MIPS] Lasat: a couple off by one bugs in picvue_proc.c
Date: Wed, 02 Apr 2014 16:52:49 +0000	[thread overview]
Message-ID: <20140402165249.GL18506@mwanda> (raw)
In-Reply-To: <20131108094431.GC27977@elgon.mountain>

These off by one bugs are still there in linux-next.

regards,
dan carpenter

On Fri, Nov 08, 2013 at 12:44:31PM +0300, Dan Carpenter wrote:
> These should be ">=" instead of ">" or we go past the end of the
> pvc_lines[] array.
> 
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> 
> diff --git a/arch/mips/lasat/picvue_proc.c b/arch/mips/lasat/picvue_proc.c
> index 638c5db..8c55de4 100644
> --- a/arch/mips/lasat/picvue_proc.c
> +++ b/arch/mips/lasat/picvue_proc.c
> @@ -44,7 +44,7 @@ static int pvc_line_proc_show(struct seq_file *m, void *v)
>  {
>  	int lineno = *(int *)m->private;
>  
> -	if (lineno < 0 || lineno > PVC_NLINES) {
> +	if (lineno < 0 || lineno >= PVC_NLINES) {
>  		printk(KERN_WARNING "proc_read_line: invalid lineno %d\n", lineno);
>  		return 0;
>  	}
> @@ -68,7 +68,7 @@ static ssize_t pvc_line_proc_write(struct file *file, const char __user *buf,
>  	char kbuf[PVC_LINELEN];
>  	size_t len;
>  
> -	BUG_ON(lineno < 0 || lineno > PVC_NLINES);
> +	BUG_ON(lineno < 0 || lineno >= PVC_NLINES);
>  
>  	len = min(count, sizeof(kbuf) - 1);
>  	if (copy_from_user(kbuf, buf, len))

WARNING: multiple messages have this Message-ID (diff)
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Ralf Baechle <ralf@linux-mips.org>
Cc: linux-mips@linux-mips.org, kernel-janitors@vger.kernel.org
Subject: Re: [patch] [MIPS] Lasat: a couple off by one bugs in picvue_proc.c
Date: Wed, 2 Apr 2014 19:52:49 +0300	[thread overview]
Message-ID: <20140402165249.GL18506@mwanda> (raw)
In-Reply-To: <20131108094431.GC27977@elgon.mountain>

These off by one bugs are still there in linux-next.

regards,
dan carpenter

On Fri, Nov 08, 2013 at 12:44:31PM +0300, Dan Carpenter wrote:
> These should be ">=" instead of ">" or we go past the end of the
> pvc_lines[] array.
> 
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> 
> diff --git a/arch/mips/lasat/picvue_proc.c b/arch/mips/lasat/picvue_proc.c
> index 638c5db..8c55de4 100644
> --- a/arch/mips/lasat/picvue_proc.c
> +++ b/arch/mips/lasat/picvue_proc.c
> @@ -44,7 +44,7 @@ static int pvc_line_proc_show(struct seq_file *m, void *v)
>  {
>  	int lineno = *(int *)m->private;
>  
> -	if (lineno < 0 || lineno > PVC_NLINES) {
> +	if (lineno < 0 || lineno >= PVC_NLINES) {
>  		printk(KERN_WARNING "proc_read_line: invalid lineno %d\n", lineno);
>  		return 0;
>  	}
> @@ -68,7 +68,7 @@ static ssize_t pvc_line_proc_write(struct file *file, const char __user *buf,
>  	char kbuf[PVC_LINELEN];
>  	size_t len;
>  
> -	BUG_ON(lineno < 0 || lineno > PVC_NLINES);
> +	BUG_ON(lineno < 0 || lineno >= PVC_NLINES);
>  
>  	len = min(count, sizeof(kbuf) - 1);
>  	if (copy_from_user(kbuf, buf, len))

  reply	other threads:[~2014-04-02 16:52 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-08  9:44 [patch] [MIPS] Lasat: a couple off by one bugs in picvue_proc.c Dan Carpenter
2013-11-08  9:44 ` Dan Carpenter
2014-04-02 16:52 ` Dan Carpenter [this message]
2014-04-02 16:52   ` Dan Carpenter

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=20140402165249.GL18506@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-mips@linux-mips.org \
    --cc=ralf@linux-mips.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.