Trying to generate the kernel with gnu gcc -fsanitize=undefined I got a warning at modpost.c:2032 strncpy(buf->p + buf->pos, s, len); because s == NULL but len == 0 so it should be harmless. I fixed this one with the following if(len) strncpy(buf->p + buf->pos, s, len);