Messages in this thread | | | Date | Fri, 20 May 2022 14:08:45 +0100 | From | Matthew Wilcox <> | Subject | Re: [PATCH v2 03/28] vsprintf: %pf(%p) |
| |
On Fri, May 20, 2022 at 08:03:29AM +0000, David Laight wrote: > From: Matthew Wilcox > > Sent: 19 May 2022 22:15 > > > > On Thu, May 19, 2022 at 09:06:24PM +0000, David Laight wrote: > > > I suspect this a very good way to blow the kernel stack. > > > The highest stack use is already very likely to be inside > > > the printf code in an error path somewhere. > > > > ... > > > > > Double copying using a temporary buffer isn't the end of the world. > > > > How can you hold both of these positions simultaneously? > > Mostly you only need a short(ish) buffer to format a single item. > But even a full line buffer is probably less stack than a > nested printf call. > It certainly makes it possible for static analysis to determine > maximum stack depth.
There are a lot of words in this response. Numbers, please.
> That made me realise that one of the problems doing static > analysis of stack depth is indirect calls. > The hashes that (IIRC) fine-ibt add to indirect calls > and functions make it possible to tie these together. > So you can determine the worst one of the called functions > and use it for the stack depth at the call sites. > > David > > - > Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK > Registration No: 1397386 (Wales) >
| |