Skip to contentSkip to conversation

undefined references

DISCUSSION John Richard Moser 2 participants 3 messages Jan 25, 2005

lore
Share & tools
lore
#0 lore raw

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

icebox linux-2.6.10-grs # make
CHK include/linux/version.h
make[1]: `arch/x86_64/kernel/asm-offsets.s' is up to date.

  CHK     include/linux/compile.h
  CHK     usr/initramfs_list
  GEN     .version
  CHK     include/linux/compile.h
  UPD     include/linux/compile.h
  CC      init/version.o
  LD      init/built-in.o
  LD      .tmp_vmlinux1

fs/built-in.o(.text+0xe413): In function `link_path_walk':
: undefined reference to gr_inode_follow_link' fs/built-in.o(.text+0xe933): In function link_path_walk':
: undefined reference to gr_inode_follow_link' fs/built-in.o(.text+0x10c28): In function sys_link':
: undefined reference to gr_inode_hardlink' fs/built-in.o(.text+0x10c52): In function sys_link':
: undefined reference to `gr_inode_handle_create'
make: *** [.tmp_vmlinux1] Error 1

What would cause this kind of error?

I'm messing with reimplementing LSM from scratch and have a patch for what I'm doing if anyone wants to communicate on this; it's pretty much an academic endeavor (learn to code in the kernel, learn how lsm was created, learn how GrSecurity's codebase works).
- --
All content of all messages exchanged herein are left in the Public Domain, unless otherwise explicitly stated.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFB9Y0lhDd4aOud5P8RAmGxAJ9XZESD1nHO7mEIA7Bw0YCC/ns3KACfSgLF 4XRkAjHoayXprZR1Ma/0doI=
=LqFc
-----END PGP SIGNATURE-----

#1 lore raw
Quoted 11 lines · John Richard Moser

fs/built-in.o(.text+0xe413): In function `link_path_walk':
: undefined reference to gr_inode_follow_link' fs/built-in.o(.text+0xe933): In function link_path_walk':
: undefined reference to gr_inode_follow_link' fs/built-in.o(.text+0x10c28): In function sys_link':
: undefined reference to gr_inode_hardlink' fs/built-in.o(.text+0x10c52): In function sys_link':
: undefined reference to `gr_inode_handle_create'
make: *** [.tmp_vmlinux1] Error 1

What would cause this kind of error?

link_path_walk() still has a reference to gr_inode_follow_link (the code you probably want to move to an LSM exit), and sys_ling() still calls gr_inode_hardlink() and gr_inode_handle_create() - but the actual functions you're calling either don't exist anymore, or they didn't get compiled and linked in. If those functions are supposed to exist, you need to get them into a .o. If those are (as I suspect) becoming LSM exit hooks, then you need to clean up the direct calls in link_path_walk() and sys_link().

#2 lore raw

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 16 lines · [email protected] wrote:
Quoted 11 lines · John Richard Moser

fs/built-in.o(.text+0xe413): In function `link_path_walk':
: undefined reference to gr_inode_follow_link' fs/built-in.o(.text+0xe933): In function link_path_walk':
: undefined reference to gr_inode_follow_link' fs/built-in.o(.text+0x10c28): In function sys_link':
: undefined reference to gr_inode_hardlink' fs/built-in.o(.text+0x10c52): In function sys_link':
: undefined reference to `gr_inode_handle_create'
make: *** [.tmp_vmlinux1] Error 1

What would cause this kind of error?

Quoted 7 lines

link_path_walk() still has a reference to gr_inode_follow_link (the code you probably want to move to an LSM exit), and sys_ling() still calls gr_inode_hardlink() and gr_inode_handle_create() - but the actual functions you're calling either don't exist anymore, or they didn't get compiled and linked in. If those functions are supposed to exist, you need to get them into a .o. If those are (as I suspect) becoming LSM exit hooks, then you need to clean up the direct calls in link_path_walk() and sys_link().

I figured it out.

I had in the makefile

subdir-$(CONFIG_GRSECURITY) += grsecurity/

I had to use obj- instead.

This is just an academic thing-- I'm rewriting GrSecurity's invasive code as a bunch of hooks, collapsing what I can down, and making a stackable (easy) security framework from scratch (what the hell am I doing?). I'm not modifying LSM, though I did rip off the security_initcall things (did I just create a new .text section in vmlinuz? o.o).

Thanks for your comments though. I'll look to them if I have trouble in the future.
- --
All content of all messages exchanged herein are left in the Public Domain, unless otherwise explicitly stated.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFB9cf7hDd4aOud5P8RAtfbAJ9eaHGZpl2DXoqSJBlPVgBnnI7ivACfdw3H xQuH4N3DOwWgBtkKQWpDOhA=
=U7C8
-----END PGP SIGNATURE-----