All of lore.kernel.org
 help / color / mirror / Atom feed
From: Roel Kluin <12o3l@tiscali.nl>
To: Al Viro <viro@ftp.linux.org.uk>
Cc: lkml <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] fix writing to unintended memory in pkt_generic_packet(); drivers/block/pktcdvd.c
Date: Wed, 07 Nov 2007 00:14:48 +0100	[thread overview]
Message-ID: <4730F568.3080901@tiscali.nl> (raw)
In-Reply-To: <20071106225012.GK8181@ftp.linux.org.uk>

Al Viro wrote:
> On Tue, Nov 06, 2007 at 11:43:12PM +0100, Roel Kluin wrote:
>> CDROM_PACKET_SIZE is added as an offset to the pointer to unsigned char cmd[16].
>> The adjusted pointer is then used as a destination address in a call to
>> memset(). However, when CDROM_PACKET_SIZE is added to the pointer, it is
>> automatically scaled by the size of cmd, which is 16. This results in the call
>> to memset() writing to unintended memory.
> 
> What are you talking about?  rq->cmd is an array, not a pointer to array.
> When it occurs as an argument of +, it decays to pointer to array element.

Ok, I misunderstood, but please...

> Please, learn C.

That's not a nice thing to say.

  reply	other threads:[~2007-11-06 23:15 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-06 22:43 [PATCH] fix writing to unintended memory in pkt_generic_packet(); drivers/block/pktcdvd.c Roel Kluin
2007-11-06 22:50 ` Al Viro
2007-11-06 23:14   ` Roel Kluin [this message]
2007-11-06 23:34     ` Al Viro

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=4730F568.3080901@tiscali.nl \
    --to=12o3l@tiscali.nl \
    --cc=linux-kernel@vger.kernel.org \
    --cc=viro@ftp.linux.org.uk \
    /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.