From: Nicholas Piggin > Sent: 12 October 2023 02:19 ... > It is a kernel crash, so we need something for stable. But In a case > like this there's not one single problem. Linux kernel stack use has > always been pretty dumb - "don't use too much", for some values of > too much, and just cross fingers config and compiler and worlkoad > doesn't hit some overflow case.
I think it ought to be possible to use a FINE_IBT (I think that is what it is called) compile to get indirect calls grouped and change objtool to output the stack offset of every call. It is then a simple (for some definition of simple) process to work out the static maximum stack usage. Any recursion causes grief (the stack depth for each loop can be reported). Also I suspect the compiler will need an enhancement to add a constant into the hash to disambiguate indirect calls with the same argument list. My suspicion (from doing this exercise on an embedded system a long time ago) is that the stack will be blown somewhere inside printk() in some error path. David - Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK Registration No: 1397386 (Wales) _______________________________________________ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev