The NetBSD Project

CVS log for src/sys/kern/subr_kobj.c

[BACK] Up to [cvs.NetBSD.org] / src / sys / kern

Request diff between arbitrary revisions


Default branch: MAIN
Current tag: MAIN


Revision 1.78 / (download) - annotate - [select for diffs], Fri Apr 28 07:33:57 2023 UTC (10 months, 3 weeks ago) by skrll
Branch: MAIN
CVS Tags: triaxx-drm, thorpej-ifq-base, thorpej-ifq, thorpej-altq-separation-base, thorpej-altq-separation, HEAD
Changes since 1.77: +14 -4 lines
Diff to previous 1.77 (colored)

Pass local symbols relocations in both passes and provide the kobj_reloc
implementation visibility of these relocations.

Currently all implementations resolve local symbol relocations in the first
pass and simply skip them in the second. The RISC-V implementation will
make use of this visiblity.

Revision 1.77 / (download) - annotate - [select for diffs], Mon Apr 17 08:14:51 2023 UTC (11 months ago) by skrll
Branch: MAIN
Changes since 1.76: +4 -3 lines
Diff to previous 1.76 (colored)

KNF

Revision 1.76 / (download) - annotate - [select for diffs], Sun Jan 29 17:20:48 2023 UTC (13 months, 2 weeks ago) by skrll
Branch: MAIN
Changes since 1.75: +4 -4 lines
Diff to previous 1.75 (colored)

Trailing whitespace

Revision 1.75 / (download) - annotate - [select for diffs], Wed Oct 26 23:26:45 2022 UTC (16 months, 3 weeks ago) by riastradh
Branch: MAIN
CVS Tags: netbsd-10-base, netbsd-10-0-RC6, netbsd-10-0-RC5, netbsd-10-0-RC4, netbsd-10-0-RC3, netbsd-10-0-RC2, netbsd-10-0-RC1, netbsd-10
Changes since 1.74: +2 -4 lines
Diff to previous 1.74 (colored)

kern/subr_kobj.c: We already get module_base from sys/module.h.

Revision 1.74 / (download) - annotate - [select for diffs], Wed Oct 26 23:22:07 2022 UTC (16 months, 3 weeks ago) by riastradh
Branch: MAIN
Changes since 1.73: +2 -4 lines
Diff to previous 1.73 (colored)

sys/*: Get module_map consistently from sys/module.h.

Revision 1.73 / (download) - annotate - [select for diffs], Sat Oct 15 15:28:23 2022 UTC (17 months ago) by riastradh
Branch: MAIN
Changes since 1.72: +44 -32 lines
Diff to previous 1.72 (colored)

kobj(9): Rephrase kobj_load and kobj_affix positively.

Write error cases as branches, normal cases as straight-line code.

Side effect: One fewer call to kobj_jettison in case of error in
kobj_affix, but it already calls kobj_jettison once in the error case
via kobj_unload, which does kobj_jettison itself, and kobj_jettison
is idempotent.

No functional change intended.

Revision 1.72 / (download) - annotate - [select for diffs], Sat Oct 15 15:27:20 2022 UTC (17 months ago) by riastradh
Branch: MAIN
Changes since 1.71: +10 -18 lines
Diff to previous 1.71 (colored)

kobj(9): Fix kobj_read_mem error branches.

Rewrite positively to simplify logic: Write errors as branches,
normal case as straight-line code.

In the case where allocate=true but arithmetic overflow occurs, this
avoids trying to kmem_free null, which is forbidden.

Revision 1.71 / (download) - annotate - [select for diffs], Sat Oct 15 15:23:24 2022 UTC (17 months ago) by riastradh
Branch: MAIN
Changes since 1.70: +4 -3 lines
Diff to previous 1.70 (colored)

kobj(9): Avoid arithmetic overflow in overflow detection.

Revision 1.70 / (download) - annotate - [select for diffs], Sat Oct 15 15:22:27 2022 UTC (17 months ago) by riastradh
Branch: MAIN
Changes since 1.69: +8 -3 lines
Diff to previous 1.69 (colored)

kobj(9): Forbid reading negative offsets.

Shouldn't have any functional change, but let's fail with EINVAL
rather than reading arbitrarily distant memory.

Revision 1.69 / (download) - annotate - [select for diffs], Sat Aug 21 23:00:32 2021 UTC (2 years, 6 months ago) by andvar
Branch: MAIN
CVS Tags: bouyer-sunxi-drm-base, bouyer-sunxi-drm
Changes since 1.68: +3 -3 lines
Diff to previous 1.68 (colored)

fix mainly same typos as in my previous commit but outside sys/dev/dm.

Revision 1.68 / (download) - annotate - [select for diffs], Wed Jun 9 15:15:35 2021 UTC (2 years, 9 months ago) by christos
Branch: MAIN
CVS Tags: thorpej-i2c-spi-conf2-base, thorpej-i2c-spi-conf2, thorpej-i2c-spi-conf-base, thorpej-futex2-base, thorpej-futex2, thorpej-cfargs2-base, thorpej-cfargs2
Changes since 1.67: +15 -5 lines
Diff to previous 1.67 (colored)

Work around abs rela relocations issue (for now):

$ readelf -r compat_linux
...
Relocation section '.rela.data' at offset 0x37270 contains 537 entries:
Offset          Info           Type           Sym. Value    Sym. Name + Addend
...
000000000040  000000000001 R_X86_64_64                          0
000000000048  000000000001 R_X86_64_64                          0
...

$ objdump -r compat_linux
...
RELOCATION RECORDS FOR [.data]:
OFFSET           TYPE              VALUE
...
0000000000000040 R_X86_64_64       *ABS*
0000000000000048 R_X86_64_64       *ABS*
...

Since those have symidx == 0, and the 0 symbol table entry is special,
treat them as SHN_ABS.

Change ENOENT -> ENOEXEC to avoid confusion (like other linking errors),
and add some debugging when that happens.

Revision 1.67 / (download) - annotate - [select for diffs], Sat Jun 27 17:27:59 2020 UTC (3 years, 8 months ago) by christos
Branch: MAIN
CVS Tags: thorpej-futex-base, thorpej-futex, thorpej-cfargs-base, thorpej-cfargs, cjep_sun2x-base1, cjep_sun2x-base, cjep_sun2x, cjep_staticlib_x-base1, cjep_staticlib_x-base, cjep_staticlib_x
Branch point for: thorpej-i2c-spi-conf
Changes since 1.66: +14 -7 lines
Diff to previous 1.66 (colored)

print the index of the problematic symbol

Revision 1.66 / (download) - annotate - [select for diffs], Sat Jun 23 14:22:30 2018 UTC (5 years, 8 months ago) by jakllsch
Branch: MAIN
CVS Tags: phil-wifi-base, phil-wifi-20200421, phil-wifi-20200411, phil-wifi-20200406, phil-wifi-20191119, phil-wifi-20190609, phil-wifi, pgoyette-compat-20190127, pgoyette-compat-20190118, pgoyette-compat-1226, pgoyette-compat-1126, pgoyette-compat-1020, pgoyette-compat-0930, pgoyette-compat-0906, pgoyette-compat-0728, pgoyette-compat-0625, netbsd-9-base, netbsd-9-3-RELEASE, netbsd-9-2-RELEASE, netbsd-9-1-RELEASE, netbsd-9-0-RELEASE, netbsd-9-0-RC2, netbsd-9-0-RC1, netbsd-9, isaki-audio2-base, isaki-audio2, is-mlppp-base, is-mlppp, bouyer-xenpvh-base2, bouyer-xenpvh-base1, bouyer-xenpvh-base, bouyer-xenpvh, ad-namecache-base3, ad-namecache-base2, ad-namecache-base1, ad-namecache-base, ad-namecache
Changes since 1.65: +3 -2 lines
Diff to previous 1.65 (colored)

add a kobj_error() to a recently added error case

Revision 1.65 / (download) - annotate - [select for diffs], Sat Nov 4 22:17:55 2017 UTC (6 years, 4 months ago) by christos
Branch: MAIN
CVS Tags: tls-maxphys-base-20171202, pgoyette-compat-base, pgoyette-compat-0521, pgoyette-compat-0502, pgoyette-compat-0422, pgoyette-compat-0415, pgoyette-compat-0407, pgoyette-compat-0330, pgoyette-compat-0322, pgoyette-compat-0315
Branch point for: pgoyette-compat
Changes since 1.64: +3 -3 lines
Diff to previous 1.64 (colored)

use Elf_Sym ** instead of casting.

Revision 1.64 / (download) - annotate - [select for diffs], Sat Nov 4 12:14:41 2017 UTC (6 years, 4 months ago) by martin
Branch: MAIN
Changes since 1.63: +3 -3 lines
Diff to previous 1.63 (colored)

Make kobj_sym_lookup's result type an Elf_Addr.
Fixes the arm builds.

Revision 1.63 / (download) - annotate - [select for diffs], Fri Nov 3 09:59:07 2017 UTC (6 years, 4 months ago) by maxv
Branch: MAIN
Changes since 1.62: +34 -18 lines
Diff to previous 1.62 (colored)

Handle absolute relocations coming from the kernel: preserve SHN_ABS in
the kernel and module symbols, and when relocating a symbol that has
SHN_ABS, take its value as-is and don't return an error if it equals zero.

Sent on tech-kern@.

Revision 1.62 / (download) - annotate - [select for diffs], Thu Jun 1 02:45:13 2017 UTC (6 years, 9 months ago) by chs
Branch: MAIN
CVS Tags: perseant-stdc-iso10646-base, perseant-stdc-iso10646, nick-nhusb-base-20170825, netbsd-8-base, netbsd-8-2-RELEASE, netbsd-8-1-RELEASE, netbsd-8-1-RC1, netbsd-8-0-RELEASE, netbsd-8-0-RC2, netbsd-8-0-RC1, netbsd-8, matt-nb8-mediatek-base, matt-nb8-mediatek
Changes since 1.61: +2 -6 lines
Diff to previous 1.61 (colored)

remove checks for failure after memory allocation calls that cannot fail:

  kmem_alloc() with KM_SLEEP
  kmem_zalloc() with KM_SLEEP
  percpu_alloc()
  pserialize_create()
  psref_class_create()

all of these paths include an assertion that the allocation has not failed,
so callers should not assert that again.

Revision 1.61 / (download) - annotate - [select for diffs], Wed Apr 19 15:54:45 2017 UTC (6 years, 11 months ago) by christos
Branch: MAIN
CVS Tags: prg-localcount2-base3, prg-localcount2-base2, prg-localcount2-base1, prg-localcount2-base, prg-localcount2, pgoyette-localcount-20170426, bouyer-socketcan-base1
Changes since 1.60: +33 -38 lines
Diff to previous 1.60 (colored)

simplify.

Revision 1.60 / (download) - annotate - [select for diffs], Wed Apr 19 06:19:02 2017 UTC (6 years, 11 months ago) by pgoyette
Branch: MAIN
Changes since 1.59: +32 -28 lines
Diff to previous 1.59 (colored)

Be consistent about checking for text section address being 0, and
don't ignore errors by falling through to the next section(s).

As discussed on tech-kern@

Revision 1.59 / (download) - annotate - [select for diffs], Tue Aug 2 12:23:08 2016 UTC (7 years, 7 months ago) by martin
Branch: MAIN
CVS Tags: pgoyette-localcount-20170320, pgoyette-localcount-20170107, pgoyette-localcount-20161104, pgoyette-localcount-20160806, nick-nhusb-base-20170204, nick-nhusb-base-20161204, nick-nhusb-base-20161004, localcount-20160914, jdolecek-ncq-base, jdolecek-ncq, bouyer-socketcan-base
Branch point for: bouyer-socketcan
Changes since 1.58: +12 -13 lines
Diff to previous 1.58 (colored)

kobj_machdep() needs a chance to moify the loaded code, so move the code
to protect it read-only a bit later.

Revision 1.58 / (download) - annotate - [select for diffs], Mon Aug 1 15:41:05 2016 UTC (7 years, 7 months ago) by maxv
Branch: MAIN
Changes since 1.57: +72 -54 lines
Diff to previous 1.57 (colored)

Don't fail if a module does not have a data or rodata section. Small
modules don't have data.

Revision 1.57 / (download) - annotate - [select for diffs], Wed Jul 20 13:36:19 2016 UTC (7 years, 8 months ago) by maxv
Branch: MAIN
CVS Tags: pgoyette-localcount-20160726
Changes since 1.56: +52 -2 lines
Diff to previous 1.56 (colored)

Split the data+bss+rodata segment in two data+bss and rodata segments. The
latter is made read-only.

Revision 1.56 / (download) - annotate - [select for diffs], Wed Jul 20 13:11:58 2016 UTC (7 years, 8 months ago) by maxv
Branch: MAIN
Changes since 1.55: +6 -2 lines
Diff to previous 1.55 (colored)

Change the protection of the kernel modules segments once we are done
relocating them. The text is allocated as RWX, and then mprotected to RW.

There is a bug that prevents us from doing RW->RX on amd64 and perhaps
sparc64. On x86, the pmap waits for the page to fault before granting it
the X permission. But in the trap handler, such a page is considered as
belonging to kernel_map, while it actually belongs to module_map. The
kernel then finds out the page is not present in kernel_map, and panics.
In all cases, module_map is non pageable, so even if the trap were handled
properly, it still wouldn't work.

Therefore, there is a small window in which the segment is RWX. But that's
fine enough, for now.

Revision 1.55 / (download) - annotate - [select for diffs], Sat Jul 9 07:25:00 2016 UTC (7 years, 8 months ago) by maxv
Branch: MAIN
CVS Tags: pgoyette-localcount-base, nick-nhusb-base-20160907
Branch point for: pgoyette-localcount
Changes since 1.54: +91 -47 lines
Diff to previous 1.54 (colored)

When loading a module from VFS and from the bootloader, the kernel packs
up the module segments into one big RWX chunk. Split this chunk into two
different text and data+bss+rodata chunks. The latter is made non-
executable. This also provides some kind of ASLR, since the chunks are
not necessarily contiguous.

Revision 1.54 / (download) - annotate - [select for diffs], Fri Jul 8 08:55:48 2016 UTC (7 years, 8 months ago) by maxv
Branch: MAIN
Changes since 1.53: +34 -49 lines
Diff to previous 1.53 (colored)

Force the kernel to dynamically reallocate the preloaded modules.

Revision 1.53 / (download) - annotate - [select for diffs], Thu Jul 7 06:55:43 2016 UTC (7 years, 8 months ago) by msaitoh
Branch: MAIN
Changes since 1.52: +3 -3 lines
Diff to previous 1.52 (colored)

KNF. Remove extra spaces. No functional change.

Revision 1.52 / (download) - annotate - [select for diffs], Tue May 31 03:57:04 2016 UTC (7 years, 9 months ago) by pgoyette
Branch: MAIN
Changes since 1.51: +3 -3 lines
Diff to previous 1.51 (colored)

Compare names of duplicate symbols properly, so we correctly return
an error status.

Fixes PR kern/45125 with patch supplied by Akinobu  Mita

Revision 1.51 / (download) - annotate - [select for diffs], Mon Aug 24 22:50:32 2015 UTC (8 years, 6 months ago) by pooka
Branch: MAIN
CVS Tags: nick-nhusb-base-20160529, nick-nhusb-base-20160422, nick-nhusb-base-20160319, nick-nhusb-base-20151226, nick-nhusb-base-20150921
Changes since 1.50: +4 -2 lines
Diff to previous 1.50 (colored)

to garnish, dust with _KERNEL_OPT

Revision 1.50 / (download) - annotate - [select for diffs], Wed Jul 16 13:26:33 2014 UTC (9 years, 8 months ago) by maxv
Branch: MAIN
CVS Tags: tls-maxphys-base, tls-earlyentropy-base, nick-nhusb-base-20150606, nick-nhusb-base-20150406, nick-nhusb-base, netbsd-7-nhusb-base-20170116, netbsd-7-nhusb-base, netbsd-7-nhusb, netbsd-7-base, netbsd-7-1-RELEASE, netbsd-7-1-RC2, netbsd-7-1-RC1, netbsd-7-1-1-RELEASE, netbsd-7-0-RELEASE, netbsd-7-0-RC3, netbsd-7-0-RC2, netbsd-7-0-RC1, netbsd-7-0-2-RELEASE, netbsd-7-0-1-RELEASE
Branch point for: nick-nhusb, netbsd-7-1, netbsd-7-0, netbsd-7
Changes since 1.49: +11 -12 lines
Diff to previous 1.49 (colored)

Keep setting 'error' as appropriate (even if this place is broken enough
to crash in many other ways...)

Revision 1.49 / (download) - annotate - [select for diffs], Wed Jul 9 05:50:51 2014 UTC (9 years, 8 months ago) by maxv
Branch: MAIN
Changes since 1.48: +25 -14 lines
Diff to previous 1.48 (colored)

 - limit the number of sections with ELF_MAXSHNUM
 - fix the (symstrindex > hdr->e_shnum) check: it should be >=, otherwise there's an
   off-by-one
 - fix the (symstrindex < 0) check: the value is unsigned, so it can't be <0. However,
   we should ensure that symstrindex!=0 (done with SHN_UNDEF)
 - set 'error' as appropriate
 - ensure that e_shstrndx < hdr->e_shnum, to prevent out-of-bound reads

Fixes several crashes that could occur when loading a kernel module.

Quick glance from martin@

Revision 1.48 / (download) - annotate - [select for diffs], Sun Jul 6 15:35:32 2014 UTC (9 years, 8 months ago) by maxv
Branch: MAIN
Changes since 1.47: +4 -8 lines
Diff to previous 1.47 (colored)

Remove this (symtabindex == -1) check; it is already handled by (nsym != 1).
Put a KASSERT instead.

Revision 1.47 / (download) - annotate - [select for diffs], Sun Jul 6 15:22:31 2014 UTC (9 years, 8 months ago) by maxv
Branch: MAIN
Changes since 1.46: +54 -59 lines
Diff to previous 1.46 (colored)

Use a macro instead of always putting __func__ and __LINE__.

Revision 1.46 / (download) - annotate - [select for diffs], Fri Aug 9 05:10:14 2013 UTC (10 years, 7 months ago) by matt
Branch: MAIN
CVS Tags: yamt-pagecache-base9, rmind-smpnet-nbase, rmind-smpnet-base, riastradh-xf86-video-intel-2-7-1-pre-2-21-15, riastradh-drm2-base3
Branch point for: tls-earlyentropy
Changes since 1.45: +25 -8 lines
Diff to previous 1.45 (colored)

Ignore REL/RELA if they aren't against a PROGBIT section.
(this causes EXIDX sections to be ignored for ARM).

Revision 1.45 / (download) - annotate - [select for diffs], Sun Dec 30 20:52:20 2012 UTC (11 years, 2 months ago) by pooka
Branch: MAIN
CVS Tags: yamt-pagecache-base8, riastradh-drm2-base2, riastradh-drm2-base1, riastradh-drm2-base, riastradh-drm2, khorben-n900, agc-symver-base, agc-symver
Branch point for: rmind-smpnet
Changes since 1.44: +3 -3 lines
Diff to previous 1.44 (colored)

size_t needs to printed with %zu

Revision 1.44 / (download) - annotate - [select for diffs], Sat Aug 13 21:04:06 2011 UTC (12 years, 7 months ago) by christos
Branch: MAIN
CVS Tags: yamt-pagecache-base7, yamt-pagecache-base6, yamt-pagecache-base5, yamt-pagecache-base4, yamt-pagecache-base3, yamt-pagecache-base2, yamt-pagecache-base, netbsd-6-base, netbsd-6-1-RELEASE, netbsd-6-1-RC4, netbsd-6-1-RC3, netbsd-6-1-RC2, netbsd-6-1-RC1, netbsd-6-1-5-RELEASE, netbsd-6-1-4-RELEASE, netbsd-6-1-3-RELEASE, netbsd-6-1-2-RELEASE, netbsd-6-1-1-RELEASE, netbsd-6-1, netbsd-6-0-RELEASE, netbsd-6-0-RC2, netbsd-6-0-RC1, netbsd-6-0-6-RELEASE, netbsd-6-0-5-RELEASE, netbsd-6-0-4-RELEASE, netbsd-6-0-3-RELEASE, netbsd-6-0-2-RELEASE, netbsd-6-0-1-RELEASE, netbsd-6-0, netbsd-6, matt-nb6-plus-nbase, matt-nb6-plus-base, matt-nb6-plus, jmcneill-usbmp-pre-base2, jmcneill-usbmp-base9, jmcneill-usbmp-base8, jmcneill-usbmp-base7, jmcneill-usbmp-base6, jmcneill-usbmp-base5, jmcneill-usbmp-base4, jmcneill-usbmp-base3, jmcneill-usbmp-base2, jmcneill-usbmp-base10, jmcneill-usbmp-base, jmcneill-usbmp, jmcneill-audiomp3-base, jmcneill-audiomp3
Branch point for: yamt-pagecache, tls-maxphys
Changes since 1.43: +106 -40 lines
Diff to previous 1.43 (colored)

Always provide a meaningful short name for the kobj in the error message,
as well as the function name and the linenumber, without extra line feeds.

Revision 1.43 / (download) - annotate - [select for diffs], Sun Jul 17 20:54:52 2011 UTC (12 years, 8 months ago) by joerg
Branch: MAIN
Changes since 1.42: +2 -4 lines
Diff to previous 1.42 (colored)

Retire varargs.h support. Move machine/stdarg.h logic into MI
sys/stdarg.h and expect compiler to provide proper builtins, defaulting
to the GCC interface. lint still has a special fallback.
Reduce abuse of _BSD_VA_LIST_ by defining __va_list by default and
derive va_list as required by standards.

Revision 1.42 / (download) - annotate - [select for diffs], Tue Jan 18 08:15:51 2011 UTC (13 years, 2 months ago) by matt
Branch: MAIN
CVS Tags: rmind-uvmplock-nbase, rmind-uvmplock-base, cherry-xenmp-base, cherry-xenmp, bouyer-quota2-nbase, bouyer-quota2-base, bouyer-quota2
Changes since 1.41: +5 -3 lines
Diff to previous 1.41 (colored)

Deal with ELFnn_MACHDEP_ID_CASES a bit better.

Revision 1.41 / (download) - annotate - [select for diffs], Mon Apr 26 22:58:53 2010 UTC (13 years, 10 months ago) by pooka
Branch: MAIN
CVS Tags: yamt-nfs-mp-base11, yamt-nfs-mp-base10, uebayasi-xip-base4, uebayasi-xip-base3, uebayasi-xip-base2, uebayasi-xip-base1, matt-mips64-premerge-20101231, jruoho-x86intr-base
Branch point for: jruoho-x86intr
Changes since 1.40: +11 -2 lines
Diff to previous 1.40 (colored)

Add an optional hook for adjusting module string table after load.
Currently to be used for rump "SAOS" namespace trick.

Revision 1.40 / (download) - annotate - [select for diffs], Fri Nov 27 17:54:11 2009 UTC (14 years, 3 months ago) by pooka
Branch: MAIN
CVS Tags: yamt-nfs-mp-base9, uebayasi-xip-base, matt-premerge-20091211
Branch point for: uebayasi-xip, rmind-uvmplock
Changes since 1.39: +51 -164 lines
Diff to previous 1.39 (colored)

Due to the schizophrenic nature of kobj (mem + vfs source),
split the module in twain to subj_kobj.c (master + mem) and
subr_kobj_vfs.c (vfs).

Revision 1.39 / (download) - annotate - [select for diffs], Wed Jun 17 21:04:25 2009 UTC (14 years, 9 months ago) by dyoung
Branch: MAIN
CVS Tags: yamt-nfs-mp-base8, yamt-nfs-mp-base7, yamt-nfs-mp-base6, yamt-nfs-mp-base5, jymxensuspend-base, jym-xensuspend-nbase
Changes since 1.38: +6 -5 lines
Diff to previous 1.38 (colored)

Make kobj_stat() return ENOSYS instead of panicking ("not modular")
on non-MODULAR kernels.  Make a few kobj_stat() callers check for
a non-zero return code and deal gracefully.

Revision 1.38 / (download) - annotate - [select for diffs], Tue May 26 08:34:23 2009 UTC (14 years, 9 months ago) by jnemeth
Branch: MAIN
Changes since 1.37: +6 -5 lines
Diff to previous 1.37 (colored)

Move all namei flags handling into kobj_load_file().

When I originally wrote this, I was going for maximum flexibility.
However, after a private discussion with dholland@, I see how this
will cause problems with the future world order of namei whenever
that might be.  At the moment, I don't need the extra flexibility,
but if something comes up this may have to be revisited.

Revision 1.37 / (download) - annotate - [select for diffs], Mon May 25 22:33:00 2009 UTC (14 years, 9 months ago) by jnemeth
Branch: MAIN
Changes since 1.36: +6 -24 lines
Diff to previous 1.36 (colored)

Phase 0.5 of my options MODULAR enhancements.  As suggested by ad@,
these commits move all path handling into module_do_load() from
kobj_load_file().  This way the final path used to load a module
is available for loading <module>.plist, which will store parameters
for a module.  The end goal of this project is good support for
MODULAR device drivers.

Revision 1.36 / (download) - annotate - [select for diffs], Sun May 24 15:00:24 2009 UTC (14 years, 9 months ago) by ad
Branch: MAIN
Changes since 1.35: +3 -62 lines
Diff to previous 1.35 (colored)

Split out kobj structures so crash/ddb can get at them.

Revision 1.35 / (download) - annotate - [select for diffs], Sat May 23 15:13:57 2009 UTC (14 years, 9 months ago) by ad
Branch: MAIN
Changes since 1.34: +14 -14 lines
Diff to previous 1.34 (colored)

Fix a crash observed when trying to load a corrupted ELF image.

Revision 1.34 / (download) - annotate - [select for diffs], Fri Feb 13 22:41:04 2009 UTC (15 years, 1 month ago) by apb
Branch: MAIN
CVS Tags: yamt-nfs-mp-base4, yamt-nfs-mp-base3, nick-hppapmap-base4, nick-hppapmap-base3, nick-hppapmap-base2, nick-hppapmap-base, jym-xensuspend-base
Changes since 1.33: +4 -2 lines
Diff to previous 1.33 (colored)

Use "defopt MODULAR" in sys/conf/files, and #include "opt_modular.h"
in all kernel sources that use the MODULAR option.
Proposed in tech-kern on 18 Jan 2009.

Revision 1.33 / (download) - annotate - [select for diffs], Thu Jan 8 01:03:24 2009 UTC (15 years, 2 months ago) by pooka
Branch: MAIN
CVS Tags: mjf-devfs2-base
Branch point for: jym-xensuspend
Changes since 1.32: +7 -3 lines
Diff to previous 1.32 (colored)

Sprinkle comments explaining purpose of kobj_machdep(), per email from ad.
no functional change

Revision 1.32 / (download) - annotate - [select for diffs], Thu Jan 1 22:17:55 2009 UTC (15 years, 2 months ago) by pooka
Branch: MAIN
Changes since 1.31: +6 -6 lines
Diff to previous 1.31 (colored)

revert previous, disabled aliasing in offending build

(XXX: two evil casts in the original)

Revision 1.31 / (download) - annotate - [select for diffs], Thu Jan 1 21:35:22 2009 UTC (15 years, 2 months ago) by pooka
Branch: MAIN
Changes since 1.30: +7 -7 lines
Diff to previous 1.30 (colored)

Squelch type-punning warnings with void * casts.  We are allowed
to do this because the pointers do not have aliases.

Revision 1.30 / (download) - annotate - [select for diffs], Sun Nov 16 16:23:58 2008 UTC (15 years, 4 months ago) by ad
Branch: MAIN
CVS Tags: haad-nbase2, haad-dm-base2, haad-dm-base, ad-audiomp2-base, ad-audiomp2
Changes since 1.29: +21 -12 lines
Diff to previous 1.29 (colored)

Another fix to previous.

Revision 1.29 / (download) - annotate - [select for diffs], Sun Nov 16 14:55:42 2008 UTC (15 years, 4 months ago) by ad
Branch: MAIN
Changes since 1.28: +3 -3 lines
Diff to previous 1.28 (colored)

Correction to previous.

Revision 1.28 / (download) - annotate - [select for diffs], Sun Nov 16 11:26:28 2008 UTC (15 years, 4 months ago) by ad
Branch: MAIN
Changes since 1.27: +34 -28 lines
Diff to previous 1.27 (colored)

Do not look up any given symbol more than once. Does away with the vast
majority of symbol table lookups.

Revision 1.27 / (download) - annotate - [select for diffs], Fri Nov 14 22:00:23 2008 UTC (15 years, 4 months ago) by ad
Branch: MAIN
Changes since 1.26: +3 -3 lines
Diff to previous 1.26 (colored)

Use NOCHROOT when doing the lookup against the standard module path.
Prevents abuse of chroots to load tainted kernel modules.

Revision 1.26 / (download) - annotate - [select for diffs], Wed Nov 12 14:22:17 2008 UTC (15 years, 4 months ago) by ad
Branch: MAIN
Changes since 1.25: +2 -10 lines
Diff to previous 1.25 (colored)

Don't try appending ".o" to the module path.

Revision 1.25 / (download) - annotate - [select for diffs], Wed Nov 12 12:36:16 2008 UTC (15 years, 4 months ago) by ad
Branch: MAIN
Changes since 1.24: +12 -11 lines
Diff to previous 1.24 (colored)

Remove LKMs and switch to the module framework, pass 1.

Proposed on tech-kern@.

Revision 1.24 / (download) - annotate - [select for diffs], Mon Oct 20 20:07:35 2008 UTC (15 years, 5 months ago) by ad
Branch: MAIN
CVS Tags: netbsd-5-base, netbsd-5-0-RC1, matt-mips64-base2
Branch point for: nick-hppapmap, netbsd-5
Changes since 1.23: +3 -3 lines
Diff to previous 1.23 (colored)

Correct an error message.

Revision 1.23 / (download) - annotate - [select for diffs], Mon Oct 20 10:24:18 2008 UTC (15 years, 5 months ago) by ad
Branch: MAIN
Changes since 1.22: +70 -13 lines
Diff to previous 1.22 (colored)

PR kern/38814 ksyms needs locking

- Make ksyms MT safe.
- Fix deadlock from an operation like "modload foo.lkm < /dev/ksyms".
- Fix uninitialized structure members.
- Reduce memory footprint for loaded modules.
- Export ksyms structures for kernel grovellers like savecore.
- Some KNF.

Revision 1.22 / (download) - annotate - [select for diffs], Mon Oct 6 10:46:58 2008 UTC (15 years, 5 months ago) by ad
Branch: MAIN
CVS Tags: wrstuden-revivesa-base-4, haad-dm-base1
Changes since 1.21: +6 -3 lines
Diff to previous 1.21 (colored)

kobj_read: plug a leak.

Revision 1.21 / (download) - annotate - [select for diffs], Tue May 20 19:20:38 2008 UTC (15 years, 10 months ago) by ad
Branch: MAIN
CVS Tags: yamt-pf42-base4, yamt-pf42-base3, wrstuden-revivesa-base-3, wrstuden-revivesa-base-2, wrstuden-revivesa-base-1, wrstuden-revivesa-base, simonb-wapbl-nbase, simonb-wapbl-base, simonb-wapbl
Branch point for: haad-dm
Changes since 1.20: +6 -5 lines
Diff to previous 1.20 (colored)

If autoloading a module, don't consider the current working directory.

Revision 1.20 / (download) - annotate - [select for diffs], Tue May 20 16:18:51 2008 UTC (15 years, 10 months ago) by martin
Branch: MAIN
Changes since 1.19: +3 -3 lines
Diff to previous 1.19 (colored)

fix !MODULAR compiles

Revision 1.19 / (download) - annotate - [select for diffs], Tue May 20 14:11:55 2008 UTC (15 years, 10 months ago) by ad
Branch: MAIN
Changes since 1.18: +11 -9 lines
Diff to previous 1.18 (colored)

PR kern/38694 module dependencies do not work as expected

Autoload modules from the correct path based on kernel version.

Revision 1.18 / (download) - annotate - [select for diffs], Tue May 20 13:34:44 2008 UTC (15 years, 10 months ago) by ad
Branch: MAIN
CVS Tags: hpcarm-cleanup-nbase
Changes since 1.17: +95 -93 lines
Diff to previous 1.17 (colored)

- Do local relocs before loading requisite modules, and all others only
  after requisite modules have been loaded. For PR kern/38697.
- Simplify kobj interface slightly to make error handling easier.

Revision 1.17 / (download) - annotate - [select for diffs], Mon May 19 17:33:42 2008 UTC (15 years, 10 months ago) by jmcneill
Branch: MAIN
Changes since 1.16: +3 -2 lines
Diff to previous 1.16 (colored)

If we see a non-loadable BSS section in a pre-loaded module, make sure we
don't return success from kobj_load or nasty things will happen.

Revision 1.16 / (download) - annotate - [select for diffs], Sun May 4 12:51:44 2008 UTC (15 years, 10 months ago) by ad
Branch: MAIN
CVS Tags: yamt-pf42-base2, yamt-nfs-mp-base2
Branch point for: wrstuden-revivesa
Changes since 1.15: +8 -5 lines
Diff to previous 1.15 (colored)

Make it compile as part of librump.

Revision 1.15 / (download) - annotate - [select for diffs], Sat May 3 15:57:17 2008 UTC (15 years, 10 months ago) by ad
Branch: MAIN
Changes since 1.14: +2 -5 lines
Diff to previous 1.14 (colored)

Broken assertions.

Revision 1.14 / (download) - annotate - [select for diffs], Fri May 2 13:00:01 2008 UTC (15 years, 10 months ago) by ad
Branch: MAIN
Changes since 1.13: +11 -13 lines
Diff to previous 1.13 (colored)

Keep the program table and section strings around after loading the object,
since module_find_section() needs them.

Revision 1.13 / (download) - annotate - [select for diffs], Thu May 1 17:07:10 2008 UTC (15 years, 10 months ago) by ad
Branch: MAIN
Changes since 1.12: +33 -17 lines
Diff to previous 1.12 (colored)

Another fix for pre-loaded modules.

Revision 1.12 / (download) - annotate - [select for diffs], Thu May 1 14:44:48 2008 UTC (15 years, 10 months ago) by ad
Branch: MAIN
Changes since 1.11: +105 -63 lines
Diff to previous 1.11 (colored)

Get the pre-loaded module code working.

Revision 1.11 / (download) - annotate - [select for diffs], Mon Apr 28 20:24:04 2008 UTC (15 years, 10 months ago) by martin
Branch: MAIN
Changes since 1.10: +2 -9 lines
Diff to previous 1.10 (colored)

Remove clause 3 and 4 from TNF licenses

Revision 1.10 / (download) - annotate - [select for diffs], Fri Mar 21 21:55:00 2008 UTC (16 years ago) by ad
Branch: MAIN
CVS Tags: yamt-pf42-baseX, yamt-pf42-base, yamt-nfs-mp-base, yamt-lazymbuf-base15, yamt-lazymbuf-base14, ad-socklock-base1
Branch point for: yamt-pf42, yamt-nfs-mp
Changes since 1.9: +3 -3 lines
Diff to previous 1.9 (colored)

Catch up with descriptor handling changes. See kern_descrip.c revision
1.173 for details.

Revision 1.9 / (download) - annotate - [select for diffs], Thu Jan 17 22:32:49 2008 UTC (16 years, 2 months ago) by rumble
Branch: MAIN
CVS Tags: nick-net80211-sync-base, nick-net80211-sync, mjf-devfs-base, matt-armv6-nbase, keiichi-mipv6-nbase, keiichi-mipv6-base, keiichi-mipv6, hpcarm-cleanup-base, bouyer-xeni386-nbase, bouyer-xeni386-base
Branch point for: yamt-lazymbuf, mjf-devfs2, mjf-devfs
Changes since 1.8: +7 -2 lines
Diff to previous 1.8 (colored)

Before bailing on ENOENT, try one more time with an appended ".o". This
lets us load dependencies by module name and makes 'modload foo' work when
'foo.o' is the file.

Revision 1.8 / (download) - annotate - [select for diffs], Sat Jan 12 23:35:58 2008 UTC (16 years, 2 months ago) by ad
Branch: MAIN
Changes since 1.7: +86 -25 lines
Diff to previous 1.7 (colored)

Add a function to look up a section by name and return address/size, and
nuke return of object entrypoint from kobj_stat(). It's a lot easier to
denote the module entypoint using a linkset.

Revision 1.7 / (download) - annotate - [select for diffs], Mon Jan 7 20:42:48 2008 UTC (16 years, 2 months ago) by ad
Branch: MAIN
CVS Tags: matt-armv6-base
Branch point for: matt-armv6, bouyer-xeni386
Changes since 1.6: +5 -5 lines
Diff to previous 1.6 (colored)

Fix build if !MODULAR. Reported by elad@.

Revision 1.6 / (download) - annotate - [select for diffs], Mon Jan 7 18:25:56 2008 UTC (16 years, 2 months ago) by ad
Branch: MAIN
Changes since 1.5: +21 -24 lines
Diff to previous 1.5 (colored)

Don't both about module name / ksyms until the name is known for sure.

Revision 1.5 / (download) - annotate - [select for diffs], Sun Jan 6 18:03:58 2008 UTC (16 years, 2 months ago) by ad
Branch: MAIN
Changes since 1.4: +59 -2 lines
Diff to previous 1.4 (colored)

Add MODULAR option. Include kernel linker stuff if MODULAR.

Revision 1.4 / (download) - annotate - [select for diffs], Sun Jan 6 15:13:07 2008 UTC (16 years, 2 months ago) by jmcneill
Branch: MAIN
Changes since 1.3: +3 -3 lines
Diff to previous 1.3 (colored)

Fix off-by-one in kobj_read range checking for case KT_MEMORY

Revision 1.3 / (download) - annotate - [select for diffs], Sun Jan 6 14:47:26 2008 UTC (16 years, 2 months ago) by ad
Branch: MAIN
Changes since 1.2: +182 -58 lines
Diff to previous 1.2 (colored)

- Allow loading ELF objects from memory. Based on a patch from jmcneill.
- Allow for changing object name later, once known.
- Split open/load of the objects.

Revision 1.2 / (download) - annotate - [select for diffs], Fri Jan 4 14:53:33 2008 UTC (16 years, 2 months ago) by ad
Branch: MAIN
Changes since 1.1: +42 -9 lines
Diff to previous 1.1 (colored)

Add a kobj_stat() to get basic info about the object, and some other
minor changes.

Revision 1.1 / (download) - annotate - [select for diffs], Fri Jan 4 12:26:20 2008 UTC (16 years, 2 months ago) by ad
Branch: MAIN

Add a simple in-kernel linker, derived from FreeBSD's link_elf_obj.c. Needs
more work but is enough to load simple LKMs. amd64 is untested.

Locking is caller provided. This is decoupled from the LKM framework because
kernel modules need not be loaded from the file system - they could be built
into the kernel and referenced via link set.

This form allows you to request diff's between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.




CVSweb <webmaster@jp.NetBSD.org>