All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sylwester Nawrocki <s.nawrocki@samsung.com>
To: Ezequiel Garcia <elezegarcia@gmail.com>
Cc: Peter Senna Tschudin <peter.senna@gmail.com>,
	pawel@osciak.com, m.szyprowski@samsung.com,
	kyungmin.park@samsung.com, mchehab@infradead.org,
	linux-media@vger.kernel.org, linux-kernel@vger.kernel.org,
	kernel-janitors@vger.kernel.org
Subject: Re: [PATCH V2] drivers/media/v4l2-core/videobuf2-core.c: fix error return code
Date: Thu, 18 Oct 2012 15:51:28 +0000	[thread overview]
Message-ID: <50802580.7090809@samsung.com> (raw)
In-Reply-To: <CALF0-+WPZ7b83Mg=b1KirHt39QE4fuO4MDGhNpQNxMY09O87HA@mail.gmail.com>

On 10/18/2012 05:28 PM, Ezequiel Garcia wrote:
> On Thu, Oct 18, 2012 at 11:47 AM, Peter Senna Tschudin
> <peter.senna@gmail.com> wrote:
>> This patch fixes a NULL pointer dereference bug at __vb2_init_fileio().
>> The NULL pointer deference happens at videobuf2-core.c:
>>
>> static size_t __vb2_perform_fileio(struct vb2_queue *q, char __user *data, size_t count,
>>                 loff_t *ppos, int nonblock, int read)
>> {
>> ...
>>         if (!q->fileio) {
>>                 ret = __vb2_init_fileio(q, read);
>>                 dprintk(3, "file io: vb2_init_fileio result: %d\n", ret);
>>                 if (ret)
>>                         return ret;
>>         }
>>         fileio = q->fileio; // NULL pointer deference here
>> ...
>> }
>>
>> It was tested with vivi driver and qv4l2 for selecting read() as capture method.
>> The OOPS happened when I've artificially forced the error by commenting the line:
>>         if (fileio->bufs[i].vaddr = NULL)
>>
> 
> ... but if you manually changed the original source, how
> can this be a real BUG?
> 
> Or am I missing something here ?

He just commented out this line to trigger the bug, i.e. to simulate
a situation where fileio->bufs[i].vaddr is NULL. Which is now not
handled properly.

--
Thanks,
Sylwester

WARNING: multiple messages have this Message-ID (diff)
From: Sylwester Nawrocki <s.nawrocki@samsung.com>
To: Ezequiel Garcia <elezegarcia@gmail.com>
Cc: Peter Senna Tschudin <peter.senna@gmail.com>,
	pawel@osciak.com, m.szyprowski@samsung.com,
	kyungmin.park@samsung.com, mchehab@infradead.org,
	linux-media@vger.kernel.org, linux-kernel@vger.kernel.org,
	kernel-janitors@vger.kernel.org
Subject: Re: [PATCH V2] drivers/media/v4l2-core/videobuf2-core.c: fix error return code
Date: Thu, 18 Oct 2012 17:51:28 +0200	[thread overview]
Message-ID: <50802580.7090809@samsung.com> (raw)
In-Reply-To: <CALF0-+WPZ7b83Mg=b1KirHt39QE4fuO4MDGhNpQNxMY09O87HA@mail.gmail.com>

On 10/18/2012 05:28 PM, Ezequiel Garcia wrote:
> On Thu, Oct 18, 2012 at 11:47 AM, Peter Senna Tschudin
> <peter.senna@gmail.com> wrote:
>> This patch fixes a NULL pointer dereference bug at __vb2_init_fileio().
>> The NULL pointer deference happens at videobuf2-core.c:
>>
>> static size_t __vb2_perform_fileio(struct vb2_queue *q, char __user *data, size_t count,
>>                 loff_t *ppos, int nonblock, int read)
>> {
>> ...
>>         if (!q->fileio) {
>>                 ret = __vb2_init_fileio(q, read);
>>                 dprintk(3, "file io: vb2_init_fileio result: %d\n", ret);
>>                 if (ret)
>>                         return ret;
>>         }
>>         fileio = q->fileio; // NULL pointer deference here
>> ...
>> }
>>
>> It was tested with vivi driver and qv4l2 for selecting read() as capture method.
>> The OOPS happened when I've artificially forced the error by commenting the line:
>>         if (fileio->bufs[i].vaddr == NULL)
>>
> 
> ... but if you manually changed the original source, how
> can this be a real BUG?
> 
> Or am I missing something here ?

He just commented out this line to trigger the bug, i.e. to simulate
a situation where fileio->bufs[i].vaddr is NULL. Which is now not
handled properly.

--
Thanks,
Sylwester

  parent reply	other threads:[~2012-10-18 15:51 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-06 15:23 [PATCH 4/14] drivers/media/v4l2-core/videobuf2-core.c: fix error return code Peter Senna Tschudin
2012-09-06 15:23 ` Peter Senna Tschudin
2012-10-06 11:17 ` Mauro Carvalho Chehab
2012-10-06 11:17   ` Mauro Carvalho Chehab
2012-10-10 16:47   ` Peter Senna Tschudin
2012-10-10 16:47     ` Peter Senna Tschudin
2012-10-10 17:07     ` Sylwester Nawrocki
2012-10-10 17:07       ` Sylwester Nawrocki
2012-10-18 14:47       ` [PATCH V2] " Peter Senna Tschudin
2012-10-18 15:28         ` Ezequiel Garcia
2012-10-18 15:28           ` Ezequiel Garcia
2012-10-18 15:39           ` Peter Senna Tschudin
2012-10-18 15:39             ` Peter Senna Tschudin
2012-10-18 15:51           ` Sylwester Nawrocki [this message]
2012-10-18 15:51             ` Sylwester Nawrocki

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=50802580.7090809@samsung.com \
    --to=s.nawrocki@samsung.com \
    --cc=elezegarcia@gmail.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=kyungmin.park@samsung.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=m.szyprowski@samsung.com \
    --cc=mchehab@infradead.org \
    --cc=pawel@osciak.com \
    --cc=peter.senna@gmail.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 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.