Re: Kernel code pattern searching

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Nov 08, 2002 at 06:44:24PM -0000, Pedro Nunes da Costa wrote:
> I'm trying to write a module that searchs for a pattern in kernel code.

About a year and a half ago, I successfully converted the libpcre "perl
compatible regular expression" library to run in kernel space. The
conversion in and of itself wasn't too rough, though it was my first
real experience with the kernel, so the other learning experiences I
had along the way (think: system include directories :) added to the
complexity significantly.

Of course, today, I look back and wonder about its stack usage. I never
pushed the library very hard, so it is possible that under real use, it
would fall apart with excessive stack use. But, the code was clean, easy
to read, and was made quite easier by having a malloc() function pointer
for easy replacement. :)

Anyway, I'd suggest not using the expression compiler in the kernel --
only the matching. (And even then, you will probably be better off to
even do the matching in userspace through a pipe or character device or
filesystem or something ... I did it in part as a learning exercise.)

-- 
Outlook users: please do not put my email address in your address book.
This way, when you get infected with a virus, my address won't appear in
the From: header. Thanks.

Attachment: pgp00203.pgp
Description: PGP signature


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux