All of lore.kernel.org
 help / color / mirror / Atom feed
From: Zhu Yi <yi.zhu@intel.com>
To: Reinette Chatre <reinette.chatre@intel.com>
Cc: linville@tuxdriver.com, linux-wireless@vger.kernel.org,
	viro@zeniv.linux.org.uk
Subject: Re: [PATCH] ipw2200: prevent alloc of unspecified size on stack
Date: Wed, 19 Dec 2007 14:20:40 +0800	[thread overview]
Message-ID: <1198045240.2857.320.camel@debian.sh.intel.com> (raw)
In-Reply-To: <1198044062-25201-1-git-send-email-reinette.chatre@intel.com>


On Tue, 2007-12-18 at 22:01 -0800, Reinette Chatre wrote:
> if log_len is larger than 4K then we are killing the stack.
> allocate on heap instead and limit size to what practically can
> be used (PAGE_SIZE)
> 
> Is it possible for this to get into 2.6.24?
> 
> Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>

ACK.

> ---
> +       /* not using min() because of its strict type checking */
> +       log_size = sizeof(*log) * log_len < PAGE_SIZE ?
> +                       sizeof(*log) * log_len : PAGE_SIZE;

A (u32) cast should work. But I don't think it's a big issue.

Thanks,
-yi


  reply	other threads:[~2007-12-19  6:23 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-12-19  6:01 [PATCH] ipw2200: prevent alloc of unspecified size on stack Reinette Chatre
2007-12-19  6:20 ` Zhu Yi [this message]
2007-12-19  6:35 ` Al Viro
2007-12-19  6:52   ` Chatre, Reinette
2007-12-19  7:16   ` Zhu Yi

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=1198045240.2857.320.camel@debian.sh.intel.com \
    --to=yi.zhu@intel.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    --cc=reinette.chatre@intel.com \
    --cc=viro@zeniv.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.