Kernel Newbies archive mirror
 help / color / mirror / Atom feed
From: John Ousterhout <john.ousterhout@gmail.com>
To: kernelnewbies@kernelnewbies.org
Subject: Re: Can KASAN be used with loadable modules?
Date: Tue, 11 Oct 2022 21:44:53 -0700	[thread overview]
Message-ID: <CAGXJAmyJ8a93ryOm7oaakH2n19eKiMDKUiNb=x2jv__SRFiZBA@mail.gmail.com> (raw)
In-Reply-To: <CAGXJAmy2wb134OaDb1VFcjSc8yZ-fN0hSPoie6E83RVjWyOwug@mail.gmail.com>

Responding to my own message:

It turns out that I had somehow botched the installation of the
KASAN-ified kernel, so that the module compilation was using old
information that didn't include KASAN. Once I got the KASAN-ified
kernel properly installed, my module compiled cleanly with KASAN and
KASAN did indeed detect memory problems.

Sorry for the false alarm.


On Tue, Oct 11, 2022 at 9:43 PM John Ousterhout <ouster@cs.stanford.edu> wrote:
>
> Responding to my own message:
>
> It turns out that I had somehow botched the installation of the
> KASAN-ified kernel, so that the module compilation was using old
> information that didn't include KASAN. Once I got the KASAN-ified
> kernel properly installed, my module compiled cleanly with KASAN and
> KASAN did indeed detect memory problems.
>
> Sorry for the false alarm.
>
>
> On Tue, Oct 11, 2022 at 2:47 PM John Ousterhout
> <john.ousterhout@gmail.com> wrote:
> >
> > I'm trying to use the address sanitizer (KASAN) with a loadable module, but so far haven't been able to make it work. I compiled a kernel with KASAN and tested to see that it detects errors properly with kernel files, but when I compile a loadable module with that kernel, the module is not configured for KASAN (e.g. missing CFLAGS switches). Furthermore, I found that the lib/include/config/auto.conf file in the /lib/modules/xxx directory is different from the one in the kernel build directory. I tried copying the auto.conf file from the kernel directory to lib/modules/xxx, but then the module build fails during the link step with missing symbols such as __asan_handle_no_return.
> >
> > Is KASAN known to work with modules? If so, is any additional configuration needed for a module to use KASAN?
> >
> > Thanks in advance for any help you can provide.
> >
> > -John-

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

      parent reply	other threads:[~2022-10-12  4:45 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-11 21:47 Can KASAN be used with loadable modules? John Ousterhout
     [not found] ` <CAGXJAmy2wb134OaDb1VFcjSc8yZ-fN0hSPoie6E83RVjWyOwug@mail.gmail.com>
2022-10-12  4:44   ` John Ousterhout [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAGXJAmyJ8a93ryOm7oaakH2n19eKiMDKUiNb=x2jv__SRFiZBA@mail.gmail.com' \
    --to=john.ousterhout@gmail.com \
    --cc=kernelnewbies@kernelnewbies.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).