-
Notifications
You must be signed in to change notification settings - Fork 59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Kernel panic на ядре 4.9 #160
Comments
В 4.9.189 mm/vmalloc.c:1375 BUG_ON(in_interrupt());
баг проявится? |
После исправления баг не проявился. |
В ближайшее время сделаю более корректное изменение. |
you need to refine your code. the check for 32kb is wrong. often kernels are patched with modified memory configurations and it might also be architecture dependend and allocator depenend (SLAB, SLUB etc). in addition you check for 32 kb not 32mb which is very small and unneccessary. so my advise. check for KMALLOC_MAX_SIZE. so standard kernel kmalloc will be used in most cases. and maybe think about handling failed allocations for gfp_atomic if there is such a case |
@BrainSlayer Thanks for the hint about KMALLOC_MAX_SIZE. |
@vel21ripn yes this might happen on embedded systems with modified kernels which restrict the kmalloc maximum size (which depends on the page size and custom kernel konfiguration). i had the same experience while developing the zstd implementation for zfs in the past. just take care that in case of GFP_ATOMIC nothing is guaranteed. no matter which size. so null checks are very important here. its all about timing. GFP_ATOMIC is restricted to a very short allocation time. if it fails, it returns NULL. also on very small block sizes. GFP_KERNEL however will always return a valid unfragmented pointer of memory is available up to KMALLOC_MAX_SIZE. everything bigger immediatly returns NULL and needs vmalloc fallback then. |
also a hint. i made some optimizations for your current ndpi flow4 tree in dd-wrt. it does compile everything as whole source which all functions declared as static. so like lto for poors in kernel space. this may increase performance and definitly decreases codesize. you may merge my approach, so i dont have to spend too much time in syncing sources over and over again if there are any updates here. |
@BrainSlayer Where can I see your build for dd-wrt? |
the builds can be downloaded from our website. the source can be found in our svn or at https://github.com/mirror/dd-wrt/tree/master/src/router/ndpi-netfilter its in sync with your sources almost but contains alot of small changes for compiling all static. nothing really serious. just compare and review it to understand how its made. |
Были ли в недавних коммитах исправления? |
Да. Если все будет нормально, то завтра выложу. |
Существенный коммит f64efcf |
Описание
Ядро 4.9 валится при выполнении iptables -A FORWARD -m ndpi --proto tiktok -j ACCEPT
nDPI Environment (please complete the following information):
Воспроизведение
Собранные заранее файлы были помещены в соответствующие директории:
При выполнении
iptables -A FORWARD -m ndpi --proto tiktok -j ACCEPT
появлялась следующая ошибка:Дополнительный контекст
Сборка проводилась в Docker. Использовалcя пакет linux-headers.
Сборка из коммита 3ff5a9b работала исправно.
The text was updated successfully, but these errors were encountered: