Bug 150816

Summary: /proc/kallsyms doesn't distinguish between exported and unexported symbols
Product: [Fedora] Fedora Reporter: Timur Tabi <timur.tabi>
Component: kernelAssignee: Dave Jones <davej>
Status: CLOSED NOTABUG QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 3CC: pfrields, wtogami
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2005-04-12 00:52:46 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Timur Tabi 2005-03-10 22:06:26 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.5)
Gecko/20041217

Description of problem:
In the 2.6.10 versions of FC3, the /proc/kallsyms file doesn't use the
"T" and "t" symbols correctly.  The capital "T" is for exported
symbols, and the lowercase "t" is for unexported symbols.  In
FC3/2.6.10, a number of symbols that are not exported still have a
capital "T".  

sys_open is an example:

grep -w sys_open /proc/kallsyms
c0151b27 T sys_open

If I try to load a module that links against sys_open(), it will fail.
 However, if it links against sys_read() instead, then it will still
load.  

grep -w sys_read /proc/kallsyms
c0152450 T sys_read



Version-Release number of selected component (if applicable):
kernel-smp-2.6.10-1.760_FC3

How reproducible:
Always

Steps to Reproduce:
N/A

Additional info:

Comment 1 Timur Tabi 2005-03-10 22:52:54 UTC
More information:

As you can see from the following grep of the source code, sys_read is
exported on all platforms, but sys_open is not exported on i386.

[root@vic2 linux-2.6.10]# grep -wr sys_open * | grep EXPORT
arch/arm/kernel/armksyms.c:EXPORT_SYMBOL(sys_open);
arch/arm26/kernel/armksyms.c:EXPORT_SYMBOL(sys_open);
arch/alpha/kernel/alpha_ksyms.c:EXPORT_SYMBOL(sys_open);
arch/um/kernel/ksyms.c:EXPORT_SYMBOL(sys_open);
arch/parisc/kernel/parisc_ksyms.c:EXPORT_SYMBOL(sys_open);
[root@vic2 linux-2.6.10]# grep -wr sys_read * | grep EXPORT
arch/arm/kernel/armksyms.c:EXPORT_SYMBOL(sys_read);
arch/arm26/kernel/armksyms.c:EXPORT_SYMBOL(sys_read);
arch/alpha/kernel/alpha_ksyms.c:EXPORT_SYMBOL(sys_read);
arch/um/kernel/ksyms.c:EXPORT_SYMBOL(sys_read);
arch/parisc/kernel/parisc_ksyms.c:EXPORT_SYMBOL(sys_read);
fs/read_write.c:EXPORT_SYMBOL_GPL(sys_read);

Contrast this with a Suse 9.2 system (kernel 2.6.8):

vic2:~ # grep -w sys_close /proc/kallsyms
c0161400 T sys_close
vic2:~ # grep -w sys_open /proc/kallsyms
c01612a0 t sys_open  

Here, sys_close is correctly marked as exported, and sys_open is
correctly marked as unexported.

Comment 2 Dave Jones 2005-04-12 00:52:46 UTC
it's been deliberatly unexported in the Fedora kernel to discourage usage by
third party modules calling syscalls from modules.