Better HN
topnewbestaskshowjobs
Log inSign up

binarycrusader

3,608 karma · joined Jun 9, 2011 (15y ago) · 1,202 submissions

Windows Developer @Microsoft. Hobbyist Game Developer. My words are my own and not those of any affiliate or employer. Formerly: Solaris Principal Software Engineer at Sun Microsystems/Oracle.
Submissions

comment 10y ago · link · parent

Yes, many projects do not, but some very popular ones do: Google Go requires one. Apache requires one. Some FSF projects require one.

I could go on, but the point is that CLAs exist for good reasons. There may be another, different way to accomplish the same goals, but since it isn't my pocketbook funding the project, I don't feel like I have a right to complain.

As such, just because a project has a CLA doesn't mean there's anything nefarious or inhibiting going on.

comment 10y ago · link · parent

Geico, as an example, no longer cares if you park your car in a garage (secured) or not. I was explicitly told they no longer consider it statistically meaningful.

Instead, they go off statistics from the area code that your vehicle will generally be parked in and how far your commute to work is.

comment 10y ago · link · parent

Yes, I think that's likely. The titles I've contributed to or worked on generally don't have networking, threading, or muck about with the filesystem.

They usually are single-threaded, have a single file archive or open files from a single directory (without any searching or the like). Surprised you've run into IPC use at all really.

I have had to deal with the file case-sensitivity issue, but that's usually not the most difficult issue to resolve. SDL_physfs and SDL itself provides solutions for a lot of the usual hackery in dealing with file I/O though.

Never had to deal with Endian issues as I've only been involved with ports that ran on x86.

Still, I'd say that the parts that SDL provides abstractions for are the parts that I least want to deal with -- especially when it comes to input handling or dealing with screen resolution changes. Years of knowledge there.

comment 10y ago · link · parent

Only when I'm in a situation where it's impractical to use a normal mouse; for example, while commuting on the train in the morning.

Otherwise, I can't stand them.

comment 10y ago · link · parent

Actually, SDL is generally most of the parts that makes a Windows port work (having done that myself...); at least for older 2D titles and assuming you're not using any "middleware".

SDL provides input, graphics, sound, and even some OS-level abstractions. That's quite a bit of the effort involved in porting a game typically.

3D titles that were using DirectX or C#, of course, can be significantly more involved.

comment 10y ago · link · parent

If you're trying to argue "pre-built" on the basis that they started with some existing code, that defines almost all software, so does not seems like a useful definition.

I think most commenters here would generally associate "pre-built" with the licensing of an existing engine available on the open market. Such as Unity, UE4, etc.

The very top AAA game studio actually use their own proprietary engines. For example, EA uses the Frostbite Engine in many titles:

https://en.wikipedia.org/wiki/List_of_Frostbite_games

Even if I were to accept the strict definition you proposed, many of the upcoming titles on PlayStation 4, such as Dreams and Tomorrow's Children are essentially completely new game engines.

They're breaking new ground in rendering and gameplay technology and are as reasonably close to "from scratch" as you're going to get at this point.

comment 10y ago · link · parent

Yes, in the x86 world, things are not as rosy as they could be.

SPARC moved to a 64-bit address space a long time ago. 32 terabytes of memory in a single server? Sure, why not.

But as the other poster pointed out, this really isn't an issue given the approach they've taken, even on x86.

comment 10y ago · link · parent

Eh, this is sort of silly in some respects. chroot is not meant to be a security mechanism (yes, I know the presentation mentions this). The limitations are well known in the OS community. With that said, I agree that many developers mistake chroot's real purpose.

Solaris, in particular, offers a far superior solution with zones.

comment 10y ago · link · parent

This is just a guess, but I believe it's because of what you just said; "running on every Linux machine". Docker runs on more than Linux, and you need a solution that can manage containers everywhere.

comment 10y ago · link · parent

Because taxing those people won't solve the real issue? I pay more in taxes every year on my income than many millionaires do because my income is primarily salary instead of stocks, etc.

120k may seem like a lot, but it isn't in several parts of the US now (e.g SF Bay Area, New York).

comment 10y ago · link · parent

Well, they believed it was worth adding something (from a commit today):

https://github.com/golang/go/commit/50c5042047be3af36e7bb478...

comment 11y ago · link · parent

On my Android phone, in Google Chrome, there is no date visible in the first paragraph.

Checking my desktop browser, it is visible there.

So poor site design then; on mobile the side panel showing the date and issue isn't visible. And on my desktop, the panel shows on the right, not the left.

comment 11y ago · link · parent

There's absolutely nothing that indicates the date on the article. But I appreciate the note.

comment 11y ago · link · parent

Mods, this needs a (2006) tag.

comment 11y ago · link · parent

The audio is really choppy on Google Chrome 46.0.2490.86 m and a little warbly although not choppy on FireFox 35.0. Otherwise, still a pretty nifty demo.

comment 11y ago · link · parent

From my experience, SDL, Ogre3D, and Dragonfly BSD were great. There are other projects I've made contributions to, but many of them are a lot more challenging to engage with.

comment 11y ago · link · parent

Many of the contributions for the ports aren't from the Go team themselves, but from external contributors.

Also, work is in progress to improve build times, although I don't know if that's an active focus, rather than just something that's being fixed as time permits. A few improvements have already gone back to the current development gate for a variety of cases.

I think it's important to remember that development can be done in parallel, just because you see work being done on an area that isn't important to you doesn't mean that there isn't work being done on the area that's important to you as well. Some of these changes take a long time.

comment 11y ago · link · parent

I strongly disagree with the author's assertions that the need for better C API support is strictly a need for integrating with "legacy applications".

The fact of the matter is that a vast array of systems-level software and high-performance software is only available via a C API interface. New or old, that's still true today.

I've used ctypes and I've used cffi; I'm glad they exist, but authors of popular packages often don't have the luxury of supporting both of them and the CPython API.

If by legacy, they're attempting to paint the CPython API as the legacy one, I also find that a misleading argument at best. PyPy is not yet the official future of Python, and attempting to paint themselves as the successor without any clear indicator of support for that future from the Python leadership seems odd.

I'm all for them getting financial support they need to do the work, but attempting to justify that work by claiming only "legacy" applications need it seems uninformed at best.

comment 11y ago · link · parent

No, it works on Android too but only for songs that are marked as allowing it. I know because I have used it on my Moto X 2014.

comment 11y ago · link · parent

1. "interesting definitions"...

Understood.

2. code size: I see that conceptually these 2 code samples work similarly, but one has 5x more LOC.

I think that's nit-picking a bit, especially since, as I said, there are some other convenience functions that could be used depending on the situation. But regardless, it's hardly onerous. We're talking about 7 lines of actual code vs. 2 lines. That's not even worth arguing about, especially as most applications do this once if they're permanently dropping privileges.

3. dropping and picking up isn't really dropping: If I drop privileges, but can pick them back up, then if I decide to misbehave, picking them back up is just something I do first. Dropping them with the possibility of picking them up is security theater, not actual security.

No, it's actually not security theatre at all. I think you misunderstand the threat model that's trying to be addressed. The kernel is enforcing the restrictions.

Note that I also specifically said Solaris allows both -- the developer can temporarily drop privileges or can permanently drop them or use a combination thereof. Each style of interface is appropriate for a different situation.

For example, consider a case where your program allows the execution of a user script to retrieve a password required to unlock an SSL Private Key file (Apache does this). For the duration of that operation, you can set your effective privileges to be very limited, and thus any programs you fork/exec can also inherit those very limited privileges and you have additional mitigations against certain attacks.

Or consider any other scenario, where during that particular period of execution, you may have to accept untrusted user input. By limiting your effective privileges during that operation, you can significantly mitigate potential attacks against your application.

Privilege bracketing (as this is called) allows you to carefully control sensitive information to ensure that it is not compromised. It's important because sometimes programs do need a higher level of privilege, but only for short durations of program execution. Privilege bracketing is not always the correct answer for an application, but sometimes it is best and only practical choice.

The key benefit of privilege bracketing is to narrow the window of a program's vulnerability so that it is as small as possible, reducing the damage any exploit can do. For example, in order for a process to be able to write to a file, it is only necessary for that file to be opened for write access. In other words, we would assert privileges only for the open() call (relinquishing them immediately after); they should not be asserted for the write() call.

4. sandboxing is addressed in other presentations: Earlier presentations explain why having tools to restrict the privileges of programs without source modification is inadequate; a common pattern for programs is that they require some privileges during start up, but then don't need them for the rest of execution; a source-unaware mechanism would have to allow the start-up privileges for the entire execution. Otherwise, it's not too different than existing priv-sep tools.

Yes, sandboxing is not a complete answer, but if you don't have the source code to an application (which happens often in an enterprise environment), it is one of the best ways to ensure that an application behaves as expected.

As for handling applications that only need certain privileges for startup, Solaris provides a mitigation for that via SMF (Service Management Facility). In particular, it's possible to have SMF allow an extended set of privileges to start the service, and after the service is online, then modify the effective set for the program. That may not work for all programs, but it's still important.

As a historical example, you could modify Apache to start with a greater set of privileges than needed after startup:

http://www.c0t0d0s0.org/archives/4075-Less-known-Solaris-fea...

5. pledge() isn't about administrative privileges, it's about code vulnerability mitigation. Security tools around administrative boundaries are important, sure. But that is fundamentally not the problem that pledge() is trying to solve; pledge is /mitigating/ against vulnerabilities in the /implementation/ of the program. It's saying "for the remainder of my execution, I should only do these types of operations; if I try to do anything else, I have cracked & compromised."

Fundamentally, operations a program can perform is an administrative consideration - not just an implementation consideration. For example, consider a libc function that historically used a specific syscall, but is later optimised to no longer require a certain syscall (as the OpenBSD folks themselves point out as examples of things they are changing). If you represent the privilege in terms of the syscall, then when the implementation changes, either the program breaks or now the program can perform an operation you didn't previously want to allow.

Not only that, a privilege capability model needs to be represented in terms not only appropriate for a developer, but for an administrator as well. Especially since administrators will often require the ability to restrict the capabilities of programs for which they have no source access.

Solaris attempts to strike a balance between the two as you can see in the list of privileges here:

https://docs.oracle.com/cd/E53394_01/html/E54776/privileges-...

Also, this is precisely why both the ability to permanently and temporarily drop privileges is important. As an example, a program at startup could drop everything but the ability to read and write files permanently. Later, it could then further use privilege bracketing to temporarily drop the ability to read or write files (as appropriate) during certain parts of program execution.

In short, I think it's important to not limit perspective of privilege capability to a model where you treat the entire program as hostile -- privileges can be used not only by the administrator to ensure a program behaves as expected, but by the application itself to insulate itself from other bad actors.

comment 11y ago · link · parent

The examples provided are some of the more complex cases that let you do advanced things.

You can shrink the amount of code required if you limit it to more simple cases as those shown in the slides.

For example, as derived from the OpenBSD presentation:

  if (pledge("stdio fattr", NULL) == -1):
     err(1, "pledge");
A similar (not completely equivalent, since OpenBSD chose some "interesting" definitions for their privileges, and is admittedly untested) example for Solaris might be:

  priv_set_t *tmp = priv_str_to_set(
     "PRIV_FILE_READ PRIV_FILE_WRITE PRIV_FILE_CHOWN_SELF",
     " ", NULL);

  /* Assert required privileges. */
  if (setppriv(PRIV_ON, PRIV_PERMITTED, tmp) == -1)
    err(1, "setppriv permitted");
  if (setppriv(PRIV_ON, PRIV_EFFECTIVE, tmp) == -1)
    err(1, "setppriv effective");

  priv_inverse(tmp);

  /* Drop all privileges not required. */
  (void) setppriv(PRIV_OFF, PRIV_PERMITTED, tmp);
The big difference, I think, between the Solaris interfaces and the OpenBSD ones are that Solaris allows the process to temporarily drop privileges and then add them back, or permanently drop them. From the proposed OpenBSD interfaces, it looks they only allow the permanent drop model.

There are a few convenience wrappers that might simplify the above further, but the real point is not to compare efficiency of interfaces, but capability.

Also, Solaris offers the ability to restrict privileges of programs without source code modification (imagine a program you don't quite trust and don't have the source code to). I didn't see that in the OpenBSD presentation.

In their defense, they're also clearly still working on these interfaces, so there can't yet be a fair comparison. Solaris has had privilege interfaces for over a decade, so the model presented is a bit more mature obviously.

The only thing I'd mention is that Solaris tries to provide a default set of privileges that represent things closer to administrative boundaries, rather then implementation-specific ones, as implementation can change, but the basic high-level operations do not.

For example, Solaris has a file read/write privilege, but doesn't bother letting you restrict the ability to set file timestamps separately because that doesn't seem like a useful thing to do. It does however, provide separate privilege(s) for manipulating ownership of files, since that's clearly a different category of operations. OpenBSD currently seems to be focused on the implementation instead of the administrative-level operations being performed.

comment 11y ago · link · parent

OpenBSD is not unique here; Solaris has a "whole-system approach" to development as well, and has had the ability for programs and admins to easily do privilege drop or provide privilege separation for many years now.

Not only that, Solaris allows you to wrap programs without any source modifications easily using ppriv to drop or add privileges as required.

Almost every slide in the presentation that talks about how you would use the proposed pledge() interface applies to Solaris' privileges model as well.

Some relevant examples:

http://www.kernelthread.com/publications/security/solaris.ht... http://docs.oracle.com/cd/E23823_01/html/816-4863/ch3priv-25...

Solaris' role-based access control and advanced privileges model even lets you implement things like only allowing someone to become 'root' if both them and another person logs in at the same time. Think of the "two-keys required to unlock this door" sort of approach to security:

https://blogs.oracle.com/gbrunett/entry/enforcing_a_two_man_...

comment 11y ago · link · parent

If you enjoyed this article, consider supporting the author on Patreon:

https://www.patreon.com/DigitalAntiquarian?ty=h

Jimmy has done a non-trivial amount of work in bringing high-quality articles about past gaming history and shared them for free with everyone.

comment 11y ago · link · parent

It's the very last sentence of the article. Hard to miss.

comment 11y ago · link · parent

Yes, but for the typical sort of talent that Apple, Google, Facebook, etc. want to hire, you need those things first.

Also, while those companies could start a long-term investment in an area, it's not something that could be done in a year or two, and ultimately they could only influence the process.

You need relatively successful leadership in that community to start to ensure those things happen -- the money alone isn't enough.

comment 11y ago · link · parent

Because money alone isn't enough; you need good schools, roads, and other public services.

comment 11y ago · link · parent

Better than Powell's City of Books in portland?

http://www.powells.com/locations/powells-city-of-books

I'd find that hard to believe.

comment 11y ago · link · parent

Almost everything uses libc, so that's an easy one. But after that, libraries tend to be domain specific.

For example, all C++ programs will probably be linked against libstdc++. Programs compiled with gcc have a good chance of being linked against libgcc_s.

All desktop applications are probably going to be linked against libgtk or libqt, libx11, and various other X libraries. In short, there's a significant, obvious benefit.

As I mentioned somewhere else though, if a library is only used by a single application and that library and application are built together, then yes, you might as well statically-link it unless there's some other requirement.

comment 11y ago · link · parent

I think it's the typical mindset of a developer to have a directory full of random scripts and utilities and how much "easier" it is to not have "deal with packaging".

While I support that being an option, providing packaging is really preferable from a deployment and basic system cleanliness standpoint. Software lifecycle management requires packaging of some form (with the most extreme form being entire images, ala docker, et al., of course).

comment 11y ago · link · parent

Some data would be nice so that we can see the difference.
1
161718
41