All of lore.kernel.org
 help / color / mirror / Atom feed
From: Oleg Drokin <green@linuxhacker.ru>
To: alan@redhat.com, linux-kernel@vger.kernel.org
Cc: torvalds@transmeta.com
Subject: NCPFS memleak/crazyness?
Date: Sun, 9 Mar 2003 23:30:48 +0300	[thread overview]
Message-ID: <20030309203048.GA31393@linuxhacker.ru> (raw)

Hello!

   Looking at fs/ncpfs/ioctl.c (latest 2.4 bk tree), I seem to see a place
   where we use userspace-pointers directly (And eventually doing kfree on
   these). In NCP_IOC_SETOBJECTNAME handler, we allocated space (newname
   pointer), copy stuff from userspace to there and then assign userspace
   pointer to our internal structure, whoops! Or am I missing something?

   Seems that following patch is needed. (Same problem is present in 2.5
   and same patch should apply)

   Found with help of smatch + enhanced unfree script.

Bye,
    Oleg

===== fs/ncpfs/ioctl.c 1.3 vs edited =====
--- 1.3/fs/ncpfs/ioctl.c	Mon Sep  9 22:36:07 2002
+++ edited/fs/ncpfs/ioctl.c	Sun Mar  9 23:23:12 2003
@@ -434,7 +434,7 @@
 			oldprivatelen = server->priv.len;
 			server->auth.auth_type = user.auth_type;
 			server->auth.object_name_len = user.object_name_len;
-			server->auth.object_name = user.object_name;
+			server->auth.object_name = newname;
 			server->priv.len = 0;
 			server->priv.data = NULL;
 			/* leave critical section */

             reply	other threads:[~2003-03-09 20:21 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-03-09 20:30 Oleg Drokin [this message]
2003-03-09 20:43 ` [PATCH] Re: NCPFS memleak/crazyness? Petr Vandrovec

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=20030309203048.GA31393@linuxhacker.ru \
    --to=green@linuxhacker.ru \
    --cc=alan@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@transmeta.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.