All of lore.kernel.org
 help / color / mirror / Atom feed
From: Boaz Harrosh <bharrosh@panasas.com>
To: kernel-janitors@vger.kernel.org
Subject: Re: [patch] exofs: fix endian conversion in exofs_sync_fs()
Date: Mon, 30 Jan 2012 13:45:07 +0000	[thread overview]
Message-ID: <4F269EE3.9070605@panasas.com> (raw)
In-Reply-To: <20111121144311.GA19025@elgon.mountain>

On 01/29/2012 04:29 PM, Dan Carpenter wrote:
> On Sun, Jan 29, 2012 at 05:25:33PM +0300, Dan Carpenter wrote:
>> On Mon, Nov 21, 2011 at 04:57:23PM -0800, Boaz Harrosh wrote:
>>> On 11/21/2011 06:43 AM, Dan Carpenter wrote:
>>>> fscb->s_numfiles is an __le64 field so we need to use cpu_to_le64()
>>>> to get a little endian 64 bit on big endian systems.
>>>>
>>>> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
>>>> ---
>>>> This is a static checker fix.  Untested.
>>>>
>>>
>>> Will apply. s_numfiles is never used but should be loaded
>>> correctly regardless.
>>>
>>
>> This is still the same in linux-next.
> 

Sorry will fix.

> Also Sparse warns about the following potential stack overflows.
> The kernel has an 8k stack and the upper limit on these array sizes
> are not capped.
> 
> fs/exofs/super.c:562:51: error: bad constant expression
> fs/exofs/super.c:563:38: error: bad constant expression
> 

Do you mean this code:
	struct __alloc_ore_devs_and_exofs_devs {
		/* Twice bigger table: See exofs_init_comps() and comment at
		 * exofs_read_lookup_dev_table()
		 */
=>		struct ore_dev *oreds[numdevs * 2 - 1];
=>		struct exofs_dev eds[numdevs];
	} *aoded;


If so than Sparse should be fixed. It is plain wrong. This complete
structure is kmalloc(ed) two lines below.

The only limit is, perhaps, the entire struct should not be bigger than
PAGE_SIZE but kmalloc would fail and we will not mount. That code is
fine

> regards,
> dan carpenter

Cheers
Boaz

  parent reply	other threads:[~2012-01-30 13:45 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-21 14:43 [patch] exofs: fix endian conversion in exofs_sync_fs() Dan Carpenter
2011-11-22  0:57 ` Boaz Harrosh
2012-01-29 14:25 ` Dan Carpenter
2012-01-29 14:29 ` Dan Carpenter
2012-01-30 13:45 ` Boaz Harrosh [this message]
2012-01-30 13:58 ` Dan Carpenter

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=4F269EE3.9070605@panasas.com \
    --to=bharrosh@panasas.com \
    --cc=kernel-janitors@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 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.