From: Dmitry Torokhov <dtor_core@ameritech.net>
To: Wouter Paesen <wouter@kangaroot.net>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [RFC][PATCH 2.6.17-rc6] input/mouse/sermouse: fix memleak and potential buffer overflow
Date: Sun, 18 Jun 2006 00:24:31 -0400 [thread overview]
Message-ID: <200606180024.32759.dtor_core@ameritech.net> (raw)
In-Reply-To: <20060615104702.GA4866@tougher.kangaroot.net>
On Thursday 15 June 2006 06:47, Wouter Paesen wrote:
> While strolling trough the sermouse driver for some example code, I
> noticed 2 strange things happening there :
>
> * In the sermouse_connect function an input device structure is
> allocated (input_allocate_device), which is not deallocated
> in the sermouse_disconnect function.
>
> If I understand this correctly someone repeatedly connecting and
> disconnecting the mouse would leak input_dev structures.
>
No, input_free_device() should not be called after input_register_device()
returns successfully because input_dev will be freed automatically once
last reference to it is dropped.
> * In the sermouse_connect function the phys member of the sermouse
> structure (32 characters) is initialised with :
>
> sprintf(sermouse->phys, "%s/input0", serio->phys);
>
> Because serio->phys is also a 32 character field the sprintf could
> result in 39 characters being written to the sermouse->phys.
>
Right, we need to change it to use snprintf.
--
Dmitry
next prev parent reply other threads:[~2006-06-18 4:24 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-06-15 10:47 Wouter Paesen
2006-06-18 4:24 ` Dmitry Torokhov [this message]
2006-06-20 6:41 ` Wouter Paesen
2006-06-21 16:23 ` Rolf Eike Beer
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=200606180024.32759.dtor_core@ameritech.net \
--to=dtor_core@ameritech.net \
--cc=linux-kernel@vger.kernel.org \
--cc=wouter@kangaroot.net \
/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
all inboxes | Powered by JetHome®