public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Shankar Brahadeeswaran <shankoo77@gmail.com>
Cc: linux-kernel@vger.kernel.org,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	devel@driverdev.osuosl.org,
	Cruz Julian Bishop <cruzjbishop@gmail.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Hugh Dickins <hughd@google.com>,
	Konstantin Khlebnikov <khlebnikov@openvz.org>
Subject: Re: [PATCH] staging: android: ashmem: get_name, set_name not to hold ashmem_mutex
Date: Tue, 19 Feb 2013 16:38:06 +0300	[thread overview]
Message-ID: <20130219133806.GC9138@mwanda> (raw)
In-Reply-To: <CAJsYZ5nnAHW9Uu-ee09ttFZZT-DeBVSiHzUnpwt3ZE0hjTFA=g@mail.gmail.com>

Good job fixing the bug.  :)

My one concern would be that in set_name() there is a race caused
by dropping the lock.  It would be better to do that
copy_from_user() first, before taking the lock.  I don't expect this
to actually be a problem in real life.

+       /*
+        * Local variable to hold the name copied from user space
+        * This variable is approx of size 270 bytes, not huge
+        */
+       char local_name[ASHMEM_NAME_LEN];

These obvious comments are not needed.  We trust you do not overflow
the stack.  ;)  Also it's checked automatically during build.

Looks good generally.

regards,
dan carpenter


  reply	other threads:[~2013-02-19 13:38 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-18  5:35 [PATCH] staging: android: ashmem: get_name,set_name not to hold ashmem_mutex Shankar Brahadeeswaran
2013-02-19 13:38 ` Dan Carpenter [this message]
2013-02-20 12:19   ` [PATCH] staging: android: ashmem: get_name, set_name " Shankar Brahadeeswaran

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=20130219133806.GC9138@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=akpm@linux-foundation.org \
    --cc=cruzjbishop@gmail.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=hughd@google.com \
    --cc=khlebnikov@openvz.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=shankoo77@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox