Slashdot Mirror


User: whig

whig's activity in the archive.

Stories
0
Comments
193
First seen
Last seen
Profile
(view on slashdot.org)

Comments · 193

  1. Linux Capabilities FAQ 0.1 on EROS 1.1 relased under GPL · · Score: 1

    This FAQ was written and is maintained by:
    Alexander Kjeldaas

    1) What is a capability?

    The name "capabilities" as used in the Linux kernel can be confusing.
    First there are Capabilities as defined in computer science. A
    capability is a token used by a process to prove that it is allowed to
    do an operation on an object. The capability identifies the object
    and the operations allowed on that object. A file descriptor is a
    capability. You create the file descriptor with the "open" call and
    request read or write permissions. Later, when doing a read or write,
    the kernel uses the file descriptor as an index into a datastructure
    that indicates what operations are allowed. This is an efficient way
    to check permissions - you create the necessary datastructures to
    check permissions once during the "open" call. Later read and write
    calls only have to do a table lookup. Other operations on
    capabilities include copying capabilities, giving a capability to
    another process, modifying a capability, and revoking a capability.
    Modifying a capability can be something like taking a read-write
    filedescriptor and making it read-only. A capability often has a
    notion of an "owner" which is able to invalidate all copies and
    derived versions of a capability. Entire OSes are based on this
    "capability" model, with varying degrees of purity. There are other
    ways of implementing capabilities than the file descriptor model -
    traditionally special hardware has been used, but recently the memory
    management unit of the CPU is often used.

    Then there is something quite different called "POSIX capabilities"
    which is what Linux uses. Capabilities here are a partitioning of the
    all powerful root privilege into a set of distinct privileges. Users
    familiar with VMS or "Trusted" versions of other UNIX variants will
    know this under the name "privileges". The reason we use the name
    "capabilities" in Linux is that this is what the POSIX draft uses.

    2) So what is a "POSIX capability"?

    A process has three sets of bitmaps called the Inheritable(I),
    Permitted(P), and Effective(E) capabilities. Each capability is
    implemented as a bit in each of these bitmaps which is either set or
    unset. When a process tries to do a privileged operation, the
    operating system will check the appropriate bit in the Effective set
    of the process (instead of checking whether the effective uid of the
    process i 0 as is normally done). The Permitted set of the process
    indicates the capabilities the process can use. The process can have
    capabilities set in the permitted set that are not in the effective
    set. This means that the process has temporarily lowered this
    capability. A process is allowed to set a bit in its Effective set
    only if it is available in the Permitted set. The distinction between
    Effective and Permitted exists so that processes can "bracket"
    operations that need privilege. The Inheritable capabilities are the
    capabilities of the current process that should be inherited by child
    processes. The Permitted set of a process is masked against the
    Inheritable set before being transferred to another process. "Another
    process" means a process image after an exec() call. Capabilities are
    copied to child processes or threads. The capability rules (see own
    question) are only enforced during exec().

    3) What about other entities in the system? Users, Groups, Files?

    Files have capabilities. Conseptually they have three bitmaps just as
    processes, but we call them by other names to avoid confusion. Only
    executable files have capabilities, libraries don't have capabilities
    (yet). They three sets are called the Allowed set, the Forced set, and
    the Effective set. The Allowed set indicates what capabilities the
    executable is allowed to receive from an execing process. The Forced
    set is a set of capabilities created out of thin air and given to the
    process after execing the executable. The forced set is similar in
    nature to the setuid feature. In fact, the setuid bit from the
    filesystem is "read" as a full Forced set by the kernel. The
    Effective set is acutally not a set, but a single bit. It indicates
    which bits set in the permitted set of the new process should be set
    in the effective set of the new process. However, transferring only a
    few bits from the Permitted set to the Effective bit doesn't seem to
    be useful. The Effective set is best thought of as a "capability
    aware" bit. Only if the executable is aware of the capability API can
    it start with an empty Effective set.
    NOTE: Filesystem support for capabilities is not part of Linux 2.2

    Users and Groups don't have associated capabilities from the kernel's
    point of view, but it is entirely reasonable to associate users with
    capabilities. By letting the "login" program set some capabilities it
    is possible to make a "backup" user for example. This could be
    implemented as a PAM module. However, this is not done yet. Also see
    question about capability policies.

    4) What capabilities exist?

    The capabilities available in Linux are listed and documented in the
    file /usr/src/linux/include/linux/capability.h.

    5) Are Linux capabilities hierarchical?

    No, you cannot make a "subcapability" out of a Linux capability as in
    capability-based OSes.

    6) What about passing capabilities between processes?

    Currently this is done by a systemcall setcap which can set the
    capability of another process. This requires the CAP_SETPCAP
    capability which you will only grant to a _few_ processes.
    CAP_SETPCAP was intended as a workaround to be able to implement
    filesystem support for capabilities using a daemon outside the kernel.

    There has been discussions about implementing socket-level capability
    passing. This means that you can pass a capability over a socket. No
    support for this exists in the normal kernel however.

    7) I see securelevel has been removed from 2.2 and are superceeded by
    capabilities. How do I emulate securelevel using capabilities?

    The setcap system call can remove a capability from _all_ processes on
    the system in one atomic operation. The setcap utility from the
    libcap distribution will do this for you. The utility requires the
    CAP_SETPCAP privilege to do this. The CAP_SETPCAP capability is not
    enabled by default.

    libcap is available from
    ftp://ftp.kernel.org/pub/linux/libs/security/lin ux-privs/kernel-2.1/

    8) Seems I need a CAP_SETPCAP capability that I don't have to make use
    of capabilities. How do I enable this capability?

    Well no, but for some uses such as emulating securelevel you need it.
    What you do is you change the definition of CAP_INIT_EFF_SET and
    CAP_INIT_INH_SET to the following in include/linux/capability.h:

    #define CAP_INIT_EFF_SET { ~0 }
    #define CAP_INIT_INH_SET { ~0 }

    This will start init with a full capability set and not with
    CAP_SETPCAP removed.

    9) How do I start a process with a limited set of capabilities?

    Get the libcap library and use the execcap utility. The following
    example starts the update daemon with only the CAP_SYS_ADMIN
    capability.

    execcap 'cap_sys_admin=eip' update

    10) How do I start a process with a limited set of capabilities under
    another uid?

    Use the sucap utility which changes uid from root without loosing any
    capabilities. Normally all capabilities are cleared when changing uid
    from root. The sucap utility requires the CAP_SETPCAP capability.
    The following example starts updated under uid updated and gid updated
    with CAP_SYS_ADMIN raised in the Effective set.

    sucap updated updated execcap 'cap_sys_admin=eip' update

    [ Sucap is currently available from
    ftp://ftp.guardian.no/pub/free/linux/capabilitie s/sucap.c. It is
    intended to be put in the progs directory of libcap.]

    11) What are the "capability rules"

    The capability rules are the rules used to set the capabilities of the
    new process image after an exec. They work like this:

    pI' = pI
    (***) pP' = fP | (fI & pI)
    pE' = pP' & fE [NB. fE is 0 or ~0]

    I=Inheritable, P=Permitted, E=Effective // p=process, f=file
    ' indicates post-exec().

    Now to make any sense of the equations think of fP as the Forced set
    of the executable, and fI as the Allowed set of the executable.
    Notice how the Inheritable set isn't touched at all during exec().

    12) What are the laws for setting capability bits in the Inheritable,
    Permitted, and Effective sets?

    Bits can be transferred from Permitted to either Effective or
    Inheritable set.

    13) Where is the standard on which the Linux capabilities are based?

    There used to be a POSIX draft called POSIX.6 and later POSIX 1003.1e.
    However after the committee had spent over 10 years, POSIX decided
    that enough is enough and dropped the draft. There will therefore not
    be a POSIX standard covering this aspect anytime soon. This may lead
    to that the POSIX draft is available for free, however.

  2. Old News on EROS 1.1 relased under GPL · · Score: 1

    Didn't that happen back in April?

  3. Neil "Makes Me A Tree" Gaiman on Slashdot! on New Sandman Book and Signing · · Score: 1

    Too cool!

    Just want to say, as well, that I recently watched Dark City on DVD, based on Neil's recommendation, and was very impressed.

    There should be a "reviews" section on Slashdot, so that worthwhile books, comics, movies and so forth can get reviewed more frequently without clogging up the main Slashdot news area.

  4. Depends on the "worker" on No More Suits; IT Worker Shortage Will End Soon · · Score: 1

    It's important to distinguish between supervision and maintenance, on the one hand, and research and development, on the other.

    Sure, system administration requires a high level of competency, but it is something which many people can learn to do with training and adequate experience. Let's be honest, this is glorified janitorial work most of the time, something that needs to be done, but doesn't require a whole lot of genius. There are exceptions, of course, but generally it requires only the understanding and use of tools which have been provided.

    On the other hand, to develop a new product or tool requires significantly more skill. And it is a well known fact that top programmers are ten times as efficient (at least) as the rest. This has to do with a natural capability, something which cannot be taught or even learned through experience, you either have it or you don't.

    For those who are in the first category, high salaries will not last forever, as the market will certainly supply an ever increasing number of people who are willing to learn the skills needed in order to board the gravy train. It's actually somewhat astonishing that so few people today have so little clue how to administer even their own desktop. I think more and more people are becoming clueful, but this is counterposed with the rapid increase in new users which have even less of a clue than the prior set. This trend is likely to continue for awhile, so there is some job security in the medium term, but eventually there will be some equilibrium and salaries will trend downward.

    On the other hand, those who have skills which are innate, whose abilities cannot be reproduced by formal methods, will continue to remain highly prized and well compensated forever.

  5. Packers and Mappers on The Programmer's Stone · · Score: 2
    After reading Chapter 1, I forwarded it to my (packer) business partner as Required Reading. This is a really good explanation of why we (mappers) have such a hard time communicating with those who aren't like us.

    For many years I have summed up my philosophy as: "Challenge the Default Assumption", and applied this principle in every domain. It seems like a reasonably good technique for ensuring that new experiences and techniques get mapped instead of merely packed.

  6. Jikes Open Source on More Open Source and Linux Support from IBM · · Score: 4

    As the Debian maintainer for Jikes, I have been incredibly impressed with IBM's serious adoption of Open Source. With the original Jikes release, there were problems with the license which prevented it from being included in Debian's main distribution. When these problems were brought to IBM's attention, they immediately agreed to get their lawyers to work on a revision. The end result is that Debian now has a completely free Java implementation available for those who can accept the limitations of Kaffe's runtime library, and a truly fast and robust alternative to Sun's javac even for those who use the JDK runtime.

  7. No Taxes on the Internet on Sen. McCain Introduces Bill to Ban Internet Taxes Forever · · Score: 1
    Ultimately, the Internet does/will force governments to fundamentally rethink tax policy literally from the ground up. While it is possible to assess issuance of IP addresses and/or domain names, it is not possible, in general, to track how these are used.

    Even the simplest tracking strategy, raw bandwidth use, is problemmatic. A large percentage of net traffic never goes through any of the concentrated access points, and as more private companies expand their networks, this will increase. If they cannot even track bandwidth, they certainly cannot monitor the content of that traffic to a sufficient extent to determine what is commercial and what is not.

    To some extent, they could assess incorporated businesses which ship products ordered over the Internet, but this is just an extension of mail order. And much Internet commerce involves services which are not shipped at all.

    At the moment, only a small percentage of commerce happens on the Internet, as compared with traditional stores, mail and telephone order. But over time, this will certainly increase to a point where a considerable portion is online. And if governments seek to shift the tax burden to non-connected businesses, it will only accelerate this trend.

    Ultimately, taxes on commerce will become impractical altogether. At this point, a return to land assessment will become a very necessary alternative.

    For some economic & political implications of this, you may find some of the following links interesting:

    EarthSharing Homepage

    Dan Sullivan's essays:
    Real Libertarians and Royal Libertarians
    Greens and Libertarians

  8. Space is cool on Space Station Funding Safe - For Now. · · Score: 1

    Space is cool. But that doesn't mean we should support NASA and the ISS. The net effect of government spending on space programs is to inhibit private sector spending on alternatives.

    Want space elevators, interplanetary human exploration, and permanent space settlements? Do you want these to be available to ordinary people in our lifetime? Do you believe that they will be, if the government is the primary source of space research and exploration dollars?

    No private entrepreneur wants to compete with NASA. It would be foolhardy in the extreme. Furthermore, the ISS is just bad science. No fundamental new principles of physics or engineering are really being derived, just recycled old technology from the 60s and 70s.

    Finally, and while it may seem an archaic point, where in the Constitution is it provided for government to spend money on space programs? Apart from the "provide for a national defense" argument, there is none. Thus, it is not merely a misguided program on pragmatic grounds, but as a matter of principle should be ceased at once.

  9. False Dichotomy on Ask Slashdot: Employees or Contractors? · · Score: 1

    There is no reason for "employment" at all, one can use contractors on a long-term basis as long as the contract is structured to do so.

    I am an independent contractor and a business owner. I will not work under terms of ordinary employment, and I am fortunate enough to be able to set my own terms and have them met, without negotiation 99% of the time.

    This does not mean I am unwilling or unable to commit to long term support of my clients. Moreover, I have worked contracts which were "full time" for over a year duration, and which posed no serious accounting difficulties for me or my client.

    The important thing that you *must* do in such cases is to ensure that there are two contracts, one in each direction - the contractor must be responsible for providing his/her own hours, work area and tools. Conversely, if work needs to be done during certain hours at your place of business, a rental agreement may be drafted to specify the same.

    Consequently, you do not have to pay unemployment or FICA taxes, and your contractor can receive more money upfront, to manage according to his/her own priorities.

  10. Parallel Make on Distributed Compiling? · · Score: 1

    A good test of this can be done before distributing by building with make -jX (where X is some number >1), this works whether or not you have SMP, though in the case that you do, it will actually take advantage of your multiprocessor capability. Once you can safely do parallel makes on a single machine, you should be able to extend this to a fully distributed make. (Obviously, such considerations require some thought and effort, so trying to do this for something you just need to make once is silly. But for large apps under active development, which need to be built from the base up periodically, it can be a real win.)

  11. Mumia Abu Jamal on Mitnick Charges Dropped · · Score: 1

    To assert, as you do, that Jamal "did" what he was accused of, presumes he was convicted beyond a reasonable doubt in a fair trial.

    In fact, he has not had a fair trial. Maybe he did it, maybe he didn't, but the interest of justice is not served by presuming guilt.

    Furthermore, and more significant to some people, is that even if he was given a fair trial, his conviction was for murder in the SECOND degree. That is to say, this is a crime for which the penalty is never execution in Pennsylvania -- UNLESS the victim happens to have been a police officer.

    I guess some animals are more equal than others, after all.

  12. Reply sent to David Brin on David Brin on Star Wars: TPM · · Score: 1
    I enjoyed reading your Salon article, comparing Star Wars with Star Trek. You made a number of excellent points, but I had a different perspective on many of them, which taken together cause me to view them in nearly opposite positions.

    In the Star Trek mythos, we are asked to believe in a beneficent world government, indeed, a galactic federation of planets united in peace, and pursuing only the advancement of knowledge. Oh, a rare incompetent or even scheming individual may hold some office or other for a time, but these are readily weeded out, and life goes on.

    Star Wars does not ask us to place our trust in power. Through the story of Anakin Skywalker, it shows that an innocent but clever and talented lad may seek to rectify injustice by acquiring power, but in taking the easy way of doing so, may be corrupted. Yet a spark of his idealism may remain, and in the end, he may turn against the evil he has served for so long, and thus redeem his humanity.

    Of these, which is the more realistic, and which the more dangerous?

    You seem most concerned that the Star Wars mythos puts great emphasis on the actions of a few individuals, whilst the great masses are just peripheral "spear carriers." But Star Trek is more like a well-oiled machine, where every person is given a place where he may best serve the Federation. And what if one chooses not to serve the Federation?

    While we should treat individuals as equal before the law, people are not equal in fact. Each of us has certain capacities and lacks others. Everyman does not write science fiction books, or develop software, or establish lasting governments. Of course, nobody is an everyman, everyone is an actual someone.

    Both Star Wars and Star Trek have aspects which can be fairly criticized. But I think neither should be despised, for each is intended as entertainment, and no substitute for real understanding. If your concern is that people will lack the judgment to discern fiction from reality, or will be incapable of drawing independent conclusions, then there is a great deal more to worry about in our culture than these films.

  13. Virtual Reality on Virtual Property Revisited · · Score: 1

    It is amazing, really, that people who work for virtual currencies would protest the non-reality of virtual economies. Consider that dollars, marks, pounds, yen and so forth, are all really nothing more than informational paper. There is no "reality" behind them, except the willingness of others to accept them in exchange for the products of their labor or for access to resources. A domain name like BY.NET is no less real than a physical address like WALL STREET. Both are simply linguistic devices which allow people to find things. Ultimately, all language is virtual reality. Language references people, places and things, but does not constitute the subjects themselves (with the possible exception of self-referential statements: i.e., "This statement is false.")

  14. Capitalism? on Commercial Open-Source Software · · Score: 1

    Hm. Classical economics takes a very different definitional stance.

    Production is achieved by the combination of three factors: Land, Labor and Capital.

    Economic Land differs from the common use of the term, in that it includes all natural properties not owing to man, that is, in addition to ordinary land, air, water, sunlight, natural (uncultivated) plants and animals, etc., used for production.

    Likewise Economic Labor includes more than physical effort, but includes all mental processes and administration which go into production.

    Economic Capital is that produce of Land and Labor (and Capital) which is reinvested to enhance effectiveness of subsequent production.

    Money (and Credit) is not really a factor of production at all. This is a proxy for production, and to the extent that it is reinvested, it is treated like Capital (see definition above). Properly, Money is not part of Economics, but of Finance, which is a derivative study.

    This is very hard for many people to grasp, due to the way terms have been (mis)applied for so long.

    The bottom line is, Free (Open Source) Software is very much in line with principles of true Capitalism (aka Classical Economics), but different from modern Finance Capitalism (aka Neoclassical Economics).

  15. Instead of a Post on Feature:Why ideas should not be property · · Score: 1

    Property in produced goods is not the same as property in lands or property in ideas.

    This must be evident to anyone who considers it, for only production gives rise to an absolute and perpetual claim of ownership. Could one man claim absolute dominion of the whole soil, all others would be his slave, for none could exist without his consent. Ideas, too, cannot be held out of general use indefinitely, or we might remain in caves while the descendents of the first discoverers of fire and the wheel would be the only ones permitted to use it.

    Yet, there is an interest secured by intellectual property, limited in scope and duration. For it is an incentive, not to invention itself, but to disclosure. In the absence of IP, every idea would have to be independently discovered by each person who would employ it, for those desiring a competitive advantage would be strongly inclined to keep their ideas as secret as possible.

  16. tchrist is a teckla on Feature:Free Linux · · Score: 1

    So, Christiansen wants an FSF-free Linux distribution, but he's not above using FSF-derived tools like the EGCS compiler? Please.

    The fact is, according to his own data, FSF is the largest single contributor of code to the S.u.S.E. distribution. The Linux kernel itself is just a tiny (though important) fraction of this.

    And it's not like anyone is FORCING us to credit GNU for their contribution (apart from keeping their copyright notices intact), since there is no advertising clause in the GPL. It's purely a matter of conscience.

    If Tom Christiansen wants a totally "Artistic" distribution, nothing is stopping him except the massive time investment of thousands of people that would be required. It wouldn't accomplish anything especially useful, though.

    Tom should stop whining.

  17. Project Tango: RPMs for Linux 2.2 on Ask Slashdot: Upgrading Red Hat 5.2 to Linux 2.2.0 · · Score: 1

    Take a look at Project Tango:

    http://www.linuxhq.com/lnxlists/linux-kernel/lk_ 9901_04/msg00969.html

  18. Yourdon annoys me... on Review:Rise & Resurrection of the American Programmer · · Score: 1

    Just a personal thing, maybe. I used to subscribe to Computer Language magazine back in the late '80s, and enjoyed it very much. Then Yourdon began writing a column for them, and the editors seemed to place great stock in his prescriptions. I found them to be tedious, annoying and just plain wrong. Consequently, I discontinued my subscription.

    Do they still publish, now?