Linux Standard Base Core Specification 4.1

Total Page:16

File Type:pdf, Size:1020Kb

Linux Standard Base Core Specification 4.1 Linux Standard Base Core Specification 4.1 Linux Standard Base Core Specification 4.1 ISO/IEC 23360 Part 1:2010(E) Copyright © 2010 Linux Foundation Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.1; with no Invariant Sections, with no Front-Cover Texts, and with no Back- Cover Texts. A copy of the license is included in the section entitled "GNU Free Documentation License". Portions of the text may be copyrighted by the following parties: • The Regents of the University of California • Free Software Foundation • Ian F. Darwin • Paul Vixie • BSDI (now Wind River) • Andrew G Morgan • Jean-loup Gailly and Mark Adler • Massachusetts Institute of Technology • Apple Inc. • Easy Software Products • artofcode LLC • Till Kamppeter • Manfred Wassman • Python Software Foundation These excerpts are being used in accordance with their respective licenses. Linux is the registered trademark of Linus Torvalds in the U.S. and other countries. UNIX is a registered trademark of The Open Group. LSB is a trademark of the Linux Foundation in the United States and other countries. AMD is a trademark of Advanced Micro Devices, Inc. Intel and Itanium are registered trademarks and Intel386 is a trademark of Intel Corporation. PowerPC is a registered trademark and PowerPC Architecture is a trademark of the IBM Corporation. S/390 is a registered trademark of the IBM Corporation. OpenGL is a registered trademark of Silicon Graphics, Inc. ISO/IEC 23360 Part 1:2010(E) Contents I Introductory Elements ...............................................................................................1 1 Scope....................................................................................................................1 1.1 General....................................................................................................1 1.2 Module Specific Scope..........................................................................1 2 References...........................................................................................................2 2.1 Normative References ..........................................................................2 2.2 Informative References/Bibliography ...............................................3 3 Requirements .....................................................................................................6 3.1 Relevant Libraries .................................................................................6 3.2 LSB Implementation Conformance ....................................................6 3.3 LSB Application Conformance............................................................7 4 Terms and Definitions.......................................................................................9 5 Documentation Conventions .........................................................................11 6 Relationship To ISO/IEC 9945 POSIX ..........................................................12 7 Relationship To Other Linux Foundation Specifications ...........................13 II Executable And Linking Format (ELF)................................................................14 8 Introduction......................................................................................................15 9 Low Level System Information......................................................................16 9.1 Operating System Interface ...............................................................16 9.2 Machine Interface................................................................................16 10 Object Format.................................................................................................17 10.1 Object Files .........................................................................................17 10.2 Sections...............................................................................................17 10.3 Special Sections..................................................................................21 10.4 Symbol Mapping...............................................................................26 10.5 DWARF Extensions ..........................................................................26 10.6 Exception Frames ..............................................................................30 10.7 Symbol Versioning............................................................................35 10.8 ABI note tag .......................................................................................38 11 Dynamic Linking ...........................................................................................40 11.1 Program Loading and Dynamic Linking.......................................40 11.2 Program Header................................................................................40 11.3 Dynamic Entries ................................................................................40 III Base Libraries .........................................................................................................45 12 Base Libraries .................................................................................................46 12.1 Introduction .......................................................................................46 12.2 Program Interpreter..........................................................................46 12.3 Interfaces for libc...............................................................................46 12.4 Data Definitions for libc ...................................................................65 12.5 Interface Definitions for libc ..........................................................159 12.6 Interfaces for libm ...........................................................................362 12.7 Data Definitions for libm................................................................365 12.8 Interface Definitions for libm ........................................................372 12.9 Interfaces for libpthread.................................................................396 12.10 Data Definitions for libpthread ...................................................400 12.11 Interface Definitions for libpthread ............................................406 12.12 Interfaces for libgcc_s ...................................................................410 12.13 Data Definitions for libgcc_s........................................................410 12.14 Interface Definitions for libgcc_s.................................................412 12.15 Interfaces for libdl .........................................................................418 12.16 Data Definitions for libdl .............................................................419 © 2010 Linux Foundation iii ISO/IEC 23360 Part 1:2010(E) 12.17 Interface Definitions for libdl ......................................................420 12.18 Interfaces for librt..........................................................................423 12.19 Data Definitions for librt ..............................................................424 12.20 Interfaces for libcrypt....................................................................425 12.21 Interfaces for libpam.....................................................................426 12.22 Data Definitions for libpam .........................................................426 12.23 Interface Definitions for libpam ..................................................428 IV Utility Libraries....................................................................................................442 13 Utility Libraries............................................................................................443 13.1 Introduction .....................................................................................443 13.2 Interfaces for libz.............................................................................443 13.3 Data Definitions for libz.................................................................444 13.4 Interface Definitions for libz..........................................................447 13.5 Interfaces for libncurses..................................................................491 13.6 Data Definitions for libncurses......................................................496 13.7 Interface Definitions for libncurses...............................................505 13.8 Interfaces for libutil.........................................................................512 13.9 Interface Definitions for libutil......................................................513 V Network Security Services ..................................................................................519 14 Libraries ........................................................................................................520 14.1 Interfaces for libnspr4.....................................................................520 14.2 Data Definitions for libnspr4 .........................................................521 14.3 Interfaces for libnss3 .......................................................................528 14.4 Data Definitions for libnss3 ...........................................................529 14.5 Interfaces for libssl3 ........................................................................552 14.6 Data Definitions for libssl3.............................................................553 VI Commands and Utilities ....................................................................................563
Recommended publications
  • A Practical UNIX Capability System
    A Practical UNIX Capability System Adam Langley <[email protected]> 22nd June 2005 ii Abstract This report seeks to document the development of a capability security system based on a Linux kernel and to follow through the implications of such a system. After defining terms, several other capability systems are discussed and found to be excellent, but to have too high a barrier to entry. This motivates the development of the above system. The capability system decomposes traditionally monolithic applications into a number of communicating actors, each of which is a separate process. Actors may only communicate using the capabilities given to them and so the impact of a vulnerability in a given actor can be reasoned about. This design pattern is demonstrated to be advantageous in terms of security, comprehensibility and mod- ularity and with an acceptable performance penality. From this, following through a few of the further avenues which present themselves is the two hours traffic of our stage. Acknowledgments I would like to thank my supervisor, Dr Kelly, for all the time he has put into cajoling and persuading me that the rest of the world might have a trick or two worth learning. Also, I’d like to thank Bryce Wilcox-O’Hearn for introducing me to capabilities many years ago. Contents 1 Introduction 1 2 Terms 3 2.1 POSIX ‘Capabilities’ . 3 2.2 Password Capabilities . 4 3 Motivations 7 3.1 Ambient Authority . 7 3.2 Confused Deputy . 8 3.3 Pervasive Testing . 8 3.4 Clear Auditing of Vulnerabilities . 9 3.5 Easy Configurability .
    [Show full text]
  • Systems Programming II
    Systems Programming II Iqbal Mohomed CSC 209 – Summer 2004 Week 7 Motivation for Signals • When a program forks into 2 or more processes, rarely do they execute independently of each other • The processes usually require some form of synchronization, and this is typically handled using signals. Job control is another important use • Data usually needs to be passed between processes also, and this is typically handled using pipes and sockets, which we will discuss shortly • Signals are usually generated by – Machine interrupts – The program itself, other programs, or the user (i.e. from the keyboard) Introduction to Signals • When a C program receives a signal, control is immediately passed to a function called a signal handler • The signal handler function can execute some C statements and exit in three different ways: – Return control to the place in the program which was executing when the signal occurred – Return control to some other point in the program – Terminate the program by calling the exit (or _exit) function signal() • A default action is provided for each kind of signal, such as terminate, stop or ignore • For nearly all signal types, the default action can be changed using the signal() function. The exceptions are SIGKILL and SIGSTOP. The handler is defined as follows: – typedef void (*sighandler_t)(int); • To change the handler: – sighandler_t signal(int signum, sighandler_t handler); More on signal() • For each process, the OS maintains a table of actions that should be performed for each kind of signal. The signal() function changes the table entry for the signal named as the first argument to the value provided as the second argument.
    [Show full text]
  • UNIX Shell Programming (15CS35) Solution Internal Assessment
    UNIX Shell Programming (15CS35) Solution Internal Assessment- II November - 2016 1. Explain significance of following commands (2x5=10 M) i. cp ?????? progs Wild card ? matches any single character, hence the above command (cp) copies files whose names are six in length to progs directory ii. ls *.[xyz]* Wild card * matches any number of characters, hence the above command (ls) lists all the files having extension as either x, or y or z. iii. ls jones[0-9][0- 9][0-9] In the above command the character class[0-9] matches any digit between 0 to 9. Hence the above command lists all the files beginning with jones and having last three characters as any digit between 0 to 9. iv. echo * The above command lists all the file in the current directory. v. cp foo foo* The above command copies the file foo to file called foo*. Here the wild card * loses its meaning. 1. Write UNIX commands for the following (2 X 5= 10 M) i. Find and replace all the occurrences of unix with UNIX in the file after confirming the user. : 1,$s/unix/UNIX/gc ii. List all the files in the current directory which names are having exactly 5 characters and any number of characters in their extension. ls ?????.* iii. Copy all files stored in /home/vtu with .c, .cpp and .java extensions to progs sub- directory in current directory cp /home/vtu/*.{c,cpp,java} ./progs iv. Delete all files containing agra or agar in their file names. rm *ag[ra][ar]* v.
    [Show full text]
  • Report on the 2020 FOSS Contributor Survey
    Report on the 2020 FOSS Contributor Survey The Linux Foundation & The Laboratory for Innovation Science at Harvard Frank Nagle Harvard Business School David A. Wheeler The Linux Foundation Hila Lifshitz-Assaf New York University Haylee Ham Jennifer L. Hoffman Laboratory for Innovation Science at Harvard Acknowledgments This report and the research behind it would not have been possible without the leadership of the Core Infrastructure Initiative’s Advisory Committee, composed of Josh Corman, Steve Lipner, Audris Mockus, Henning Piezunka, and Sam Ransbotham. Frank Nagle would also like to thank his fellow co-directors of the Core Infrastructure Initiative, Jim Zemlin at the Linux Foundation and Karim Lakhani at the Laboratory for Innovation Science at Harvard, for their counsel and direction throughout this project. Gratitude and thanks to Michael Dolan and Kate Stewart at the Linux Foundation for their ongoing commitment to this undertaking. Thank you to James Dana for laying the initial groundwork for this survey. Finally — and perhaps, most importantly — thank you to all the individuals who contribute to FOSS projects. Without their tireless efforts, our core digital infrastructure and the feats enabled by it would not be sustainable. REVISED: This report has been updated since its original release on 8 December 2020. This second version, released on 10 December 2020, corrects errors found in the original text and graphics. Contents Executive Summary 4 Introduction 7 Methodology 9 Overview of Findings 10 Demographics 10 Figure 1: Gender
    [Show full text]
  • CSE421 Midterm Solutions —SOLUTION SET— 09 Mar 2012
    CSE421 Midterm Solutions —SOLUTION SET— 09 Mar 2012 This midterm exam consists of three types of questions: 1. 10 multiple choice questions worth 1 point each. These are drawn directly from lecture slides and intended to be easy. 2. 6 short answer questions worth 5 points each. You can answer as many as you want, but we will give you credit for your best four answers for a total of up to 20 points. You should be able to answer the short answer questions in four or five sentences. 3. 2 long answer questions worth 20 points each. Please answer only one long answer question. If you answer both, we will only grade one. Your answer to the long answer should span a page or two. Please answer each question as clearly and succinctly as possible. Feel free to draw pic- tures or diagrams if they help you to do so. No aids of any kind are permitted. The point value assigned to each question is intended to suggest how to allocate your time. So you should work on a 5 point question for roughly 5 minutes. CSE421 Midterm Solutions 09 Mar 2012 Multiple Choice 1. (10 points) Answer all ten of the following questions. Each is worth one point. (a) In the story that GWA (Geoff) began class with on Monday, March 4th, why was the Harvard student concerned about his grade? p He never attended class. He never arrived at class on time. He usually fell asleep in class. He was using drugs. (b) All of the following are inter-process (IPC) communication mechanisms except p shared files.
    [Show full text]
  • Unix System Programming Overview Outline What Is a Signal? Signal
    Overview Last Week: ● How to program UNIX processes (Chapters 7-9) ● fork() and exec() Unix System Programming This Week, and next week: ● UNIX inter-process communication mechanisms: signals, Signals » (next week) pipes and FIFOs. ● How to program with UNIX signals (Chapter 10) » http://en.wikipedia.org/wiki/Unix_signal ● Non-local jumps (Chapter 7) ● Focus on the sigaction() function Maria Hybinette, UGA 1 Maria Hybinette, UGA 2 Outline What is a Signal? ● A signal is an asynchronous event which is ● What is a UNIX signal? delivered to a process (instantiated by a small message) ● Signal types ● Asynchronous means that the event can occur ● Generating signals at any time (e.g., posting at a bulletin board ) ● Responding to a signal » may be unrelated to the execution of the process ● Common uses of a signal – e.g., user types Ctrl-C, or the modem hangs (SIGINT) ● Implementing a read() time-out – e.g,, user types Ctrl-Z (SIGTSTP) ● Sent from kernel (e.g. detects divide by zero ● Non-local jumps setjmp()/longjmp() (SIGFPE) or could be at the request of another ● POSIX signals process to send to another) ● Interrupted system calls ● Only information that a signal carries is its ● System calls inside handlers unique ID and that it arrived Maria Hybinette, UGA 3 Maria Hybinette, UGA 4 Signal Types (31 in POSIX) Signal Sources terminal memory ID Name Description Default Action driver management shell command 2 SIGINT Interrupt from keyboard (^C) terminate Ctr-C SIGINT SIGHUP 3 SIGQUIT Quit from keyboard (^\) terminate & core SIGSEGV 9 SIGKILL
    [Show full text]
  • Name Synopsis Description
    UTMP(5) Linux Programmer’sManual UTMP(5) NAME utmp, wtmp − login records SYNOPSIS #include <utmp.h> DESCRIPTION The utmp file allows one to discoverinformation about who is currently using the system. There may be more users currently using the system, because not all programs use utmp logging. Warning: utmp must not be writable by the user class "other", because manysystem programs (foolishly) depend on its integrity.You risk faked system logfiles and modifications of system files if you leave utmp writable to anyuser other than the owner and group owner of the file. The file is a sequence of utmp structures, declared as follows in <utmp.h> (note that this is only one of sev- eral definitions around; details depend on the version of libc): /* Values for ut_type field, below */ #define EMPTY 0/*Record does not contain valid info (formerly known as UT_UNKNOWN on Linux) */ #define RUN_LVL 1/*Change in system run-level (see init(8)) */ #define BOOT_TIME 2/*Time of system boot (in ut_tv)*/ #define NEW_TIME 3/*Time after system clock change (in ut_tv)*/ #define OLD_TIME 4/*Time before system clock change (in ut_tv)*/ #define INIT_PROCESS 5/*Process spawned by init(8) */ #define LOGIN_PROCESS 6 /* Session leader process for user login */ #define USER_PROCESS 7/*Normal process */ #define DEAD_PROCESS 8/*Terminated process */ #define ACCOUNTING 9/*Not implemented */ #define UT_LINESIZE 32 #define UT_NAMESIZE 32 #define UT_HOSTSIZE 256 struct exit_status { /* Type for ut_exit, below */ short int e_termination; /* Process termination status */ short int
    [Show full text]
  • Precise Garbage Collection for C
    Precise Garbage Collection for C Jon Rafkind Adam Wick John Regehr Matthew Flatt University of Utah Galois, Inc. University of Utah University of Utah [email protected] [email protected] [email protected] mfl[email protected] Abstract no-ops. The resulting program usually runs about as well as before, Magpie is a source-to-source transformation for C programs that but without the ongoing maintenance burden of manual memory enables precise garbage collection, where precise means that inte- management. In our experience, however, conservative GC works gers are not confused with pointers, and the liveness of a pointer poorly for long-running programs, such as a web server, a program- is apparent at the source level. Precise GC is primarily useful for ming environment, or an operating system kernel. For such pro- long-running programs and programs that interact with untrusted grams, conservative GC can trigger unbounded memory use due to components. In particular, we have successfully deployed precise linked lists [Boehm 2002] that manage threads and continuations; GC in the C implementation of a language run-time system that was this problem is usually due to liveness imprecision [Hirzel et al. originally designed to use conservative GC. We also report on our 2002], rather than type imprecision. Furthermore, the programs experience in transforming parts of the Linux kernel to use precise are susceptible to memory-exhaustion attack from malicious code GC instead of manual memory management. (e.g., user programs or untrusted servlets) that might be otherwise restricted through a sandbox [Wick and Flatt 2004]. Categories and Subject Descriptors D.4.2 [Storage Manage- This paper describes our design of and experience with a GC ment]: Garbage Collection for C that is less conservative.
    [Show full text]
  • Filesystem Hierarchy Standard
    Filesystem Hierarchy Standard LSB Workgroup, The Linux Foundation Filesystem Hierarchy Standard LSB Workgroup, The Linux Foundation Version 3.0 Publication date March 19, 2015 Copyright © 2015 The Linux Foundation Copyright © 1994-2004 Daniel Quinlan Copyright © 2001-2004 Paul 'Rusty' Russell Copyright © 2003-2004 Christopher Yeoh Abstract This standard consists of a set of requirements and guidelines for file and directory placement under UNIX-like operating systems. The guidelines are intended to support interoperability of applications, system administration tools, development tools, and scripts as well as greater uniformity of documentation for these systems. All trademarks and copyrights are owned by their owners, unless specifically noted otherwise. Use of a term in this document should not be regarded as affecting the validity of any trademark or service mark. Permission is granted to make and distribute verbatim copies of this standard provided the copyright and this permission notice are preserved on all copies. Permission is granted to copy and distribute modified versions of this standard under the conditions for verbatim copying, provided also that the title page is labeled as modified including a reference to the original standard, provided that information on retrieving the original standard is included, and provided that the entire resulting derived work is distributed under the terms of a permission notice identical to this one. Permission is granted to copy and distribute translations of this standard into another language, under the above conditions for modified versions, except that this permission notice may be stated in a translation approved by the copyright holder. Dedication This release is dedicated to the memory of Christopher Yeoh, a long-time friend and colleague, and one of the original editors of the FHS.
    [Show full text]
  • Report Received March 2006
    2005 was a busy year for me as of POSIX was published (the the USENIX standards represen- Shell and Utilities volume), and tative. There are three major it became a second ISO standard. NICHOLAS M. STOUGHTON standards that I watch carefully: Amendments to these standards I POSIX, which also incorpo- were also under development, USENIX rates the Single UNIX Specifi- and led to the addition of real- cation time interfaces, including Standards I ISO-C pthreads, to the core system call I The Linux Standard Base (LSB) set. Many of the other projects Activities died away as the people involved In order to do that, USENIX lost interest or hit political road- funds my participation in the blocks (most of which were Nick is the USENIX Standards committees that develop and reported in ;login: at the time). Liaison and represents the maintain these standards. Association in the POSIX, ISO C, Throughout 2005, the Free Until the end of the twentieth and LSB working groups. He is century, POSIX was developed the ISO organizational repre- Standards Group (FSG) also sentative to the Austin Group, helped fund these activities. For and maintained by IEEE exclu- a member of INCITS commit- each of these, let’s look at the his- sively. At the same time, the tees J11 and CT22, and the Open Group (also known as Specification Authority sub- tory of the standards, then at group leader for the LSB. what has happened over the past X/Open) had an entirely separate but 100% overlapping standard, [email protected] 12 months or so, and, finally, what is on the agenda for this known as the Single UNIX year.
    [Show full text]
  • Moxa Nport Real TTY Driver for Arm-Based Platform Porting Guide
    Moxa NPort Real TTY Driver for Arm-based Platform Porting Guide Moxa Technical Support Team [email protected] Contents 1 Introduction ...................................................................................2 2 Porting to the Moxa UC-Series—Arm-based Computer ....................2 2.1 Build binaries on a general Arm platform ...................................................... 2 2.2 Cross-compiler and the Real TTY driver ........................................................ 3 2.3 Moxa cross-compiling interactive script......................................................... 4 2.4 Manually build the Real TTY driver with a cross-compiler ................................ 5 2.5 Deploy cross-compiled binary to target......................................................... 8 3 Porting to Raspberry Pi OS .............................................................9 4 Porting to the Yocto Project on Raspberry Pi ................................ 10 4.1 Prerequisite............................................................................................... 10 4.2 Create a Moxa layer for the Yocto Project..................................................... 11 4.3 Install a Moxa layer into the Yocto Project.................................................... 17 4.4 Deploy the Yocto image in Raspberry Pi ....................................................... 17 4.5 Start the Real TTY driver in Raspberry Pi ..................................................... 18 4.6 Set the default tty mapping to the Real TTY configuration ............................
    [Show full text]
  • Kernel Validation with Kselftest Shuah Khan, Kernel Maintainer and Fellow, the Linux Foundation
    Kernel Validation With Kselftest Shuah Khan, Kernel Maintainer and Fellow, The Linux Foundation • Why do we test? • Kinds of testing/tests ... – Unit, developer, regression, integration • Linux kernel testing philosophy – Developer and community driven testing – Reliance on community and users • Linux kernel release cycle – Time based - not feature based – Continuous and parallel development/testing model • Linux kernel testing and validation – Writing tests • Kernel test frameworks - Kselftest & KUnit – Developer testing • Kselftest, KUnit and others. – Regression testing • Kselftest, KUnit and others. • Linux kernel testing and validation – Continuous Integration testing • Static analysis tools (sparse, smatch, coccicheck etc.) • Dynamic analysis tools (fuzzers, syzbot etc.) • Where does this all happen? – Developer test systems – Continuous Integration Rings • Kernel CI Dashboard — Home • 0-Day - Boot and Performance issues • 0-Day - Build issues • Linaro QA • Buildbot • Hulk Robot • What is tested? – Kernel repositories: • linux mainline • linux-next • developer git repositories – Active kernel releases • Basic testing – Boot and usage test – Run basic sanity tests • Basic sanity tests – Does networking (wifi/wired) work correctly? – Does ssh work? – rsync a large file(s) from another system – Download files: wget, ftp, git clone etc. – Play audio/video • Examine kernel logs – Look for new critical and error messages – Check for new warning messages – Check for panic traces • Kernel selftest (Kselftest) – Regression test suite • Kernel
    [Show full text]