public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
From: Andy Walls <awalls@md.metrocast.net>
To: Jarod Wilson <jarod@redhat.com>
Cc: linux-media@vger.kernel.org
Subject: Re: [PATCH 5/6] lirc_zilog: error out if buffer read bytes != chunk size
Date: Thu, 17 Mar 2011 20:50:33 -0400	[thread overview]
Message-ID: <1300409433.2317.64.camel@localhost> (raw)
In-Reply-To: <20110317190827.GD5941@redhat.com>

On Thu, 2011-03-17 at 15:08 -0400, Jarod Wilson wrote:
> On Thu, Mar 17, 2011 at 12:16:31PM -0400, Andy Walls wrote:
> > Jarod Wilson <jarod@redhat.com> wrote:
> .
> > 
> > But the orignal intent of the check I put in was to avoid passing
> partial/junk data to userspace, and go around again to see if good
> data could be provided.  
> > 
> > Your check bails when good data that might be sitting there still.
> That doesn't seem like a good trade for supporting backward compat for
> old kernels.
> 
> Ah. Another thing I neglected to notice then. :)
> 
> Perhaps there should be a retry count check as well then, as otherwise,
> its possible to get stuck in that loop forever (which is what was
> happening on older kernels). Its conceivable that similar could happen on
> a newer kernel for some reason.

Well, lets see,

>From the perspective of userspace & lircd:

1. A specification compliance failure for a corner case isn't too bad
(bailing out on junk and leaving good data behind)

2. An unrecoverable failure for any case is very bad (spinning/hanging
on a result that won't change)

3. Sending unitialized bytes out to userspace with copy_to_user() is
very bad.
(I recall the old code would do the copy to user and always tell
userspace it got a code whether it read anything out of the buffer or
not.  IIRC, that leaked information off the stack.)


If the code as patched avoids the two very bad things (#2 and #3), then
the patch is OK by me.

Regards,
Andy


  reply	other threads:[~2011-03-18  0:50 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-16 20:24 [PATCH 0/6] media: trivial IR fixes Jarod Wilson
2011-03-16 20:24 ` [PATCH 1/6] docs: fix typo in lirc_device_interface.xml Jarod Wilson
2011-03-16 20:24 ` [PATCH 2/6] imon: add more panel scancode mappings Jarod Wilson
2011-03-16 20:24 ` [PATCH 3/6] ir-kbd-i2c: pass device code w/key in hauppauge case Jarod Wilson
2011-03-16 20:24 ` [PATCH 4/6] lirc: silence some compile warnings Jarod Wilson
2011-03-16 20:24 ` [PATCH 5/6] lirc_zilog: error out if buffer read bytes != chunk size Jarod Wilson
2011-03-17  0:07   ` Andy Walls
2011-03-17 13:19     ` Jarod Wilson
2011-03-17 15:29       ` Andy Walls
2011-03-17 15:42         ` Jarod Wilson
2011-03-17 16:16           ` Andy Walls
2011-03-17 19:08             ` Jarod Wilson
2011-03-18  0:50               ` Andy Walls [this message]
2011-03-22 20:39                 ` Jarod Wilson
2011-03-16 20:24 ` [PATCH 6/6] mceusb: topseed 0x0011 needs gen3 init for tx to work Jarod Wilson

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=1300409433.2317.64.camel@localhost \
    --to=awalls@md.metrocast.net \
    --cc=jarod@redhat.com \
    --cc=linux-media@vger.kernel.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