lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Fri, 15 Jul 2011 08:54:50 -0700
From:	Joe Perches <joe@...ches.com>
To:	Jason Baron <jbaron@...hat.com>
Cc:	Bart Van Assche <bvanassche@....org>, gregkh@...e.de,
	jim.cromie@...il.com, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 03/11] dynamic_debug: Remove uses of KERN_CONT in
 dynamic_emit_prefix

On Fri, 2011-07-15 at 11:07 -0400, Jason Baron wrote:
> On Fri, Jul 15, 2011 at 12:04:22PM +0200, Bart Van Assche wrote:
> > On Thu, Jul 14, 2011 at 6:09 PM, Jason Baron <jbaron@...hat.com> wrote:
> > > +       char tid[sizeof(int) + sizeof(int)/2 + 4];
> > > +       char lineno[sizeof(int) + sizeof(int)/2];
> > It's not clear to me where the array bounds come from ? Also, why
> > sizeof(int) + sizeof(int)/2 instead of sizeof(int)*3 + 1 ?
> hmmm...for the tid it bounded by PID_MAX_LIMIT, which is 4 million, so
> you need 7 characters + 3 for the brackets and space = 10. So that looks
> right to me. Although I'm not sure where the sizeof() comes from? Joe?

It's incorrect.

sizeof(int) => # decimal digits + terminating 0
4 => 11
8 => 21

I think I meant to type sizeof(int) * 2 + sizeof(int) / 2 + 1

> For the lineno, it is 24 bits, so it can be 2^24 = 16,777,216, or 8
> characters, so I think the 6 is incorrect. Although, in practice I don't
> think we have any files that are that big.

Then the tid size should be based on PID_MAX_LIMIT.
I don't much care.
I just wanted to minimize stack consumption.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ