This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Add finit_module syscall for Linux


On Tue, Jan 22, 2013 at 9:02 PM, Mike Frysinger <vapier@gentoo.org> wrote:
> On Tuesday 22 January 2013 23:06:06 Kees Cook wrote:
>> On Tue, Jan 22, 2013 at 7:34 PM, Mike Frysinger <vapier@gentoo.org> wrote:
>> > On Tuesday 22 January 2013 22:16:38 Joseph S. Myers wrote:
>> >> On Tue, 22 Jan 2013, Kees Cook wrote:
>> >> > This adds the new Linux finit_module() syscall.
>> >>
>> >> There's no point in adding syscalls to syscalls.list without at least
>> >> adding a symbol version so the function is actually exported from
>> >> libc.so. Note that in the kexec_load discussion last May / June, doubts
>> >> were expressed about whether some existing module-related syscalls
>> >> really should have had functions in glibc.
>> >
>> > the lack of a header file that exports prototypes for these functions
>> > seems like bad form too (not a new issue to finit_module)
>>
>> I got the impression those were auto-generated from syscalls.list
>> (which contains the prototype in an encoded for ("i:isi" in
>> finit_module's case). And that this generation is what converts the
>> syscall into return value and errno?
>
> syscalls.list auto generates the simple funcs in glibc that are glorified
> syscall() calls, but they don't (afaik) generate headers.  grepping installed
> glibc headers doesn't show any match that i can see either.
> -mike

Yeah, seems true. Weird. The callers (e.g. kmod) use their own externs. Hmpf

$ readelf -s /lib/x86_64-linux-gnu/libc.so.6  | grep init_module
   894: 00000000000f77d0    36 FUNC    GLOBAL DEFAULT   12
init_module@@GLIBC_2.2.5

But it is exported. Is this something to fix, or should finit_module
follow this lead?

-Kees

--
Kees Cook
Chrome OS Security


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]