Hacker Newsnew | past | comments | ask | show | jobs | submit | more lambda's commentslogin

A DoS from a program already running on the same hardware is nowhere near the same level of vulnerability as a privilege escalation.

Security is all about increasing those difficulty thresholds, not absolutes.


I agree, the only thing I was really taking issue with is calling it a "golden solution". When in fact it is just a (useful) mitigation.

TRR might better fit the description of a "golden solution" although it is still technically a mitigation. I would very much like to see more ECC in consumer/desktop systems.


I agree as I also found the lack of transition of ECC into consumer level pricing and hardware a lamentable state.

Now with these public issues becoming more open, one can only hope that some consumer product moves to ECC and ends up driving ECC memory prices down in much the same way as mobile phones have driven many sensors and associated hardware down in price, thru volume.


For a very large number of people, these aren't "extremely niche use cases."

Something more comparable to Bitcoin than regular banking would be Western Union; they make 5 billion dollars a year in revenue transferring money. And they charge vastly higher rates than the Bitcoin network does, charging in the 5-10% range for for transactions, which is a pretty hefty overhead.


Not the same since it's on the mining, not the transactions, but here we have the founders taking 20% of the value of the network for the first four years. That's a decent overhead, too.


Command-period is the native Mac way to do it, though ESC works as well.


Command-period on macOS.


The processor speed is less important to me. But the lack of more than 16 GB of RAM is a serious problem. As a developer, I frequently run a large number of VMs at once. My current laptop has 16 GB of RAM, and I frequently need more to run all of the VMs that I need, so I wind up having to use my workstation with has 32 GB of RAM, and just connect to that remotely when I'm on my laptop. That's cumbersome and doesn't work well when I'm on the road in places with flaky connectivity (I travel a lot, as I work remotely and come into the office, so being able to do all of my work on my laptop would be a big win).

The escape key issue doesn't bother me as much, but I'm not a Vim user and I already have Caps Lock mapped to escape or control depending on whether it's a modifier or not. I do use the function keys occasionally in cross-platform development tools like gitk, but I'm sure that other keybindings can be substituted and I'd be able to deal with that.

But the lack of RAM beyond 16 GB pretty much means there's no reason for me to upgrade from my 3 year old laptop. I would have considered upgrading this cycle if they offered more RAM, but as it is I'll probably hold off. Maybe if they release another in a year or so with more RAM I'll upgrade; if not, I may just switch to a Lenovo or other laptop that has more expansion room.

3 years without a bump in RAM capacity seems like an awful lot. I realize that Moore's Law is flattening out, but stagnating for 3 years like this seems like a long time.


On my laptop, I already use Karabiner to make Caps Lock function as Control if used as a modifier key, and ESC if just tapped. Much easier to reach, works for both Emacs and Vim keybindings, only issue is that sometimes you hit ESC by accident if you start doing a chord but then decide against it. I personally think this is a better solution than a soft key for escape, but it may not be to everyone's taste.


I think they broke Karabiner support in the new macOS


Ah, that's disappointing. Another reason to be glad I haven't upgraded yet, I guess.

Also, wow, I'm glad I don't maintain any popular open source projects on GitHub: https://github.com/tekezo/Karabiner/issues/660. I can't believe the number of people who think "+1", "me too", and "donated" messages are at all helpful.

Also, looks like Karabiner Elements exists as a rewrite for Sierra. https://github.com/tekezo/Karabiner-Elements Haven't yet checked if it supports the same dual behavior, though.


It's being worked on, but the latest macOS also adds Caps Lock to Escape mapping as a builtin preference.


I'm an Emacs user though, so I like it being Control as a modifier/Escape if pressed alone. Just having Caps Lock function as escape wouldn't help.


This seems needlessly negative; and you seem to be inferring a lot about what Linus wants without him having said anything. The one thing he's asked about so far on this patch series is how it handles resource exhaustion/denial-of-service issues, and they have a reasonable reply, though there may need to be some iteration there: http://www.mail-archive.com/[email protected]/msg...

The last attempt, kdbus, was definitely way too complicated and funky. It went through a few rounds of review and was never merged for a good reason.

This redesign from the ground up does a lot of what you are asking for. It derives inspiration from other, well respected, capability based systems, as well as other IPC systems for the Linux kernel, like binder, which is used on one of the most popular Linux based consumer platforms, Android.

Linux already supports the IPC mechanisms supported by most of the BSDs; pipes, Unix domain sockets, POSIX IPC. But these actually have a number of shortcomings for building reliable, efficient IPC between processes.

Another inspiration that they cited as inspiration in the announcement of their talk (https://www.linuxplumbersconf.org/2016/ocw/proposals/3819), used by the most popular consumer-oriented BSD, is Mach message ports, used on in XNU, the macOS/iOS kernel. However, those are not an ideal API to adopt wholesale, as shown by the serious vulnerabilities based on trying to integrate them with a monolithic kernel: https://googleprojectzero.blogspot.com/2016/10/taskt-conside...

I would say that they have done most of what you ask. They have investigated the existing solutions, and found them wanting. They have already gone through one design that they threw away due to it being too complicated. They have picked a model that is widely respected and implemented in one form or another on most systems, a capability based model. There's a little bit of new invention here due to the ability to multicast messages and their message ordering guarantees, and probably some room for iterating, but overall, this looks like a pretty promising IPC system compared to the fairly overwrought kdbus.

And yeah, an ioctl interface may not be the prettiest, but they've said that they're using that over syscalls just because it's easier to implement and iterate out of tree that way before getting it merged, but are willing to switch to a sycall based interface if that's preferred: http://www.mail-archive.com/[email protected]/msg...

Besides the ioctl vs. syscall issue, which is pretty much just an implementation detail that can be solved with a wrapper API or done away with before merging, what do you find not in good taste about this proposal?


I would say that they have done most of what you ask.

No.


Twitter's working fine for me. This attack is affecting different people differently; as a DDOS, attacking a distributed system (DNS) with a lot of redundancy, it's possible for some people to be affected badly while others not affected at all.

I briefly lost access to GitHub, but Twitter has been working fine every time I've checked. Posting status messages in multiple venues helps to ensure that even if one channel is down, people might be able to get status from another channel.


Very few people can read and understand C without being a language lawyer an knowing tons of esoteric magic. There are many things in C which look perfectly reasonable but which actually result in undefined behavior, and you cannot reason about what a program will do in the presence of undefined behavior.


Further, C makes it impractically difficult to handle things that should be simple. Like, uh, errors and resource cleanup. The inability to have something as trivial as a scope guard that works as a human being would expect it to work will ensure that under no circumstances will I ever write a piece of C that anything I care about relies upon. I know I'm not good enough to write perfect C, and imperfect C is disastrous. (The fraction that is good enough to write perfect C is a vanishingly small proportion of those who think they do. And try to. And fail. And hurt other people in the process.)


But there is a difference between using C in crazy ways, and using 20 features of a language in ways that make them interact.

The more features a language has, the more I have to know just to read someone's code or be productive in a company - and the more chance someone doesn't know about potential harmful interactions and side effects.


> there is a difference between using C in crazy ways

As per my sibling, write me something as straightforward as a C++ RAII-using dtor in C without "using C in crazy ways". I will not hold my breath. The cost of a very minimal subset of C++ is literally zero, and yet significantly improves the likelihood of your code actually working. You're picking social baggage in either case: either understanding the subset of C++ that your team is using or expecting all of your developers to be perfect where C++ (and other languages--shouts, Rust!) just do it for you, correctly.

Technology is socially interesting in that incompleteness and inexpressivity is so often misread as "elegance" or "minimalism". That a language is "simple" is not a feature when it offloads all of the danger onto the (almost invariably failing to consider critical information at the worst possible time, and I include myself at the forefront of that characterization!) developer. This is why we have tools that compensate for the most common, and most destructive, of our mistakes.

(This post should not be construed as any particular endorsement of C++. C++ is a gong show when used improperly. But at least it's possible for a mere mortal to use it properly.)


The reason I dislike C++ (since about the 2000 as well) is that while it is possible to shackle yourself to only using C++ RAII etc, the vast majority of code in the wild (and in libraries, etc) does not. It does 90%, but that doesn't get you 90% of the benefit (maybe 50%, maybe 0%, depending on your point of view).

You can do essentially all the "C in crazy ways" in C++ as well, and people do. In my opinion and experience, it isn't what the language provides, it is how it is used in practice - and again from my experience (YMMV), C is used sanely and C++ is not.


I think the profusion of use-after-free bugs and memory leaks in C code running all over the place should put the lie to this. And, further, modern C++ allows you to firewall off the damage of bad C++ and most C, when you are forced to interact with it, via unique_ptr and your own enforced RAII. (And the idea that using this is so pejoratively "shackling" is bonkers to me; being "shackled" to the use of railings on walkways over a pit of fulminating acid is just the worst.)

The idea that people use C "sanely" more often than C++ (or, you know, something actually good--further shouts, Rust!) doesn't pass the smell test. Are you checking the retval of every sprintf? Are you writing goto drops in every method where there's allocated memory, diligently checking every error code, and properly bailing out, every time? If so, you're that one percent. But you're probably not. And that's not a slight--I'm not, either. That's why I am proud to count myself as a member of a tool-using species, because we build (and have built) better tools to compensate for our flaws.


"shackle" was a bad choice of word, I agree. I meant to say that you might be disciplined enough to never use anything except RAII, but most (users/libraries) aren't.

> If so, you're that one percent.

I probably am that one percent (and I don't use sprintf, because there is no sane way to use it). When I say people use C "sanely", I do not mean that they never err in any way, far from it. And my observation (your mileage obviously varies) is only that C code bases that I tend to use and meet (e.g. x264, ffmpeg/libav, the linux kernel, the Nim compiler) tend to be saner than C++ code bases that I tend to use and meet (e.g. libzmq, although that one improved dramatically since 4.0, and is now almost sane, boost, stl)

I admit that I have not yet met a C++11 codebase with lambdas - that might have restored sanity. But even if it does, it does not retroactively bestow that goodness on the millions of lines of code already out there.

I stress again - I am not passing judgement on the language, but about how it is used in practice, through my own sample set. If I work on a project in which I can dictate the exact subset, choose the people, etc, I might pick C++. But in most projects I'm involved in, the constraints are dictated in some way or the other that makes C at least as good a choice (and often better) than C++


I completely agree and would, most of the time, choose C over C++!

Except, that I have seen C++11 codebases that heavily relied on lambdas. And that was far from sane. I am very familiar with lambdas from pure functional languages and partially ones (python, ...). But all the syntax specifics, brackets, ... in C++ made it a very annoying process to understand, what was even going on at all.

Using short functions would be more lines of code. But at least I would have known right away what's happening in the code.


And we already could take advantage of many of those positive features with C++ARM.

Hence why I eventually did a Turbo Pascal -> C++ transition, with a very very short stop in C.

I was lucky that our technical school also had access to Turbo C++ 1.0 for MS-DOS on their software library. As I was not getting why should I downgrade myself from Turbo Pascal 6.0 into C.

Already in those days of "The C++ Report" and when "The C/C++ Users Journal" was still called "The C Users Journal", there were articles how to put C++ features to good use for increased safety.

And this is a major culture gap between C and C++, that I have observed since then, yes we also get the performance obsessed ones, but there are also the security minded ones.

I seldom see talks about how to increase type safety in C, their C99 security annex is a joke as it keeps pointers and size separated, and is so highly regarded that it was moved into optional in C11.

C++ community on the other hard improves the standard library to decrease the unsafe use cases, promotes guidelines and is trying to reduce the amount of UB use cases.


This is a really interesting notion. I'd love to follow up with you offline. Drop me an email?


So that's easy:

  #define NEW(t, args...) ((t*)malloc(sizeof(t)) && t ## _construct(args))

  #define DELETE(t) (t ## _destruct() && !free(t) && (t = NULL))


This isn't sufficient unless you consciously error-check and goto-trap every single failure point in your code. Which you might do. But you'd be the literal one percent. If not the literal one permille.


In DELETE(), is t the variable name or the type name? It is used as both, which won't work.


Yes, RAII and exceptions (as well as a few other things like being able to declare variables anywhere) is the reason why I liked C++ in 2000 more than C.

But beyond that, it all went downhill. There was no reason to make C++ the most bloated language ever.

The same is true of Javascript etc. Newbies will not be able to start, now, because they will think about let/var/const the same way as in C++ they have to think about all the possible casts, copy constructor vs casting semantics etc.

Tell me this for example, does the following use a cast or a copy constructor?

http://stackoverflow.com/questions/11222076/why-is-copy-cons...


"C++ has optional and complicated things that incur costs only when you use them, so let's not even have dtors" is...not a good look, I think.


Gotta love those non virtual destructors which only clean up the base class. And the ambiguity about whether you're going to call a type conversion operator or a copy constructor when assigning A a = b.

Because you know, it's all super clear.


Who said anything about inheritance? Like, at all? That is yet another feature you pay for only when you adopt it. You can pick one of two problems: you can agree upon a subset of C++ to use or you can expect your C developers to be perfect all of the time (while having fewer, if any, ways to express correctness). Dragging out additional things that are not part of your subset of C++ doesn't help formulate an argument against this.


I agree about C needing memory management and exceptions. That's why I said I liked C++ when that's all there was. Classes were nice sumyntactic sugar.

But the language jumped the shark starting with C++0x


C++0x adds nothing you are obligated to use, though. No sharks have been jumped unless you choose to strap on some skis and rent a boat. (Meanwhile, with move semantics and unique_ptrs, C++14 is actually way nicer as far as memory management goes than that 2000-era C++ was.)


Being a language geek with major in compiler design and systems programming, I tend to be a bit language lawyer.

I seldom meet C developers that are able to distinguish between ANSI C and my compiler's C, that extrapolate from my compiler's C version Y, how the language should behave.

Then they port the code to my compiler's C version Y + 1, or another compiler vendor, their code gets broken, blame the compiler, only to find out that the code was already broken from ANSI C point of view.


So is your compiler ANSI C or not? c89 or c99?


I am writing about C developers' knowledge about the language.


> But there is a difference between using C in crazy ways

Is signed arithmetic using C in crazy ways? Is shifting by an arbitrary value without checking to make sure that the number of bits is in the valid range of the type using C in crazy ways?

Undefined behavior is everywhere in C.


And all of those are inherited by C++. Thankfully C++ has a large assortment of additional footguns to help combat the previous footguns. It also has armored, self-detonating shoes.


In my experience, some people are too much attached to that good feeling of knowing "all there is to know" about something; this has the taste of proficiency, but the very real risk is to prefer the small pond because of that, calling the sea "overextended".


LLVM wants to switch from a BSD-style license to Apache 2.0, with a few exceptions, one allowing use with GPLv2 code, another allowing the bits of compiler-rt and other components that get built into binaries to be redistributed without restriction.

The main benefit of Apache 2.0 is that it includes a patent grant as well. Right now, LLVM relies on a custom "developer agreement" for anyone who contributes code that includes a grant of patent rights, but it's kind of vague and fuzzy and so makes it hard for some people to contribute, and the license itself doesn't actually mention patents at all:

http://lists.llvm.org/pipermail/llvm-dev/2015-October/091536...

Theo objects to any license that applies more restrictions than the original BSD license. OpenBSD makes an exception for GPLv2 licensed utilities that have been traditionally shipped with BSDs that there's not a good replacement for, but has stopped upgrading things that have moved to GPLv3 and apparently objects to the Apache license as well.


The existing patent agreements seem to make the current license not comparable BSD but instead comparable to an awkward or even apparently extreme Apache 2.0, so isn't this about in practice removing restrictions, not adding restrictions? (This thought process is backed up by their stated reasoning and the kinds of contributors that are supposedly complaining.)


"Additional restrictions" can be funny. You may recall the FSF's position that the app store EULA placed "additional restrictions" on the GPL, a position that was and remains controversial.

In this case, it is a little harder to understand OpenBSD's interpretation of additional restrictions because they haven't listed their objections in any centralized place, but from reading around, they seem to believe:

* "You must cause any modified files to carry prominent notices stating that You changed the files" is an additional restriction * "any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License" is an additional restriction * The sheer length and complexity of the Apache license suggests to them there are other additional restrictions buried in there somewhere


> You may recall the FSF's position that the app store EULA placed "additional restrictions" on the GPL, a position that was and remains controversial.

I don't think that the position was contraversial, I just think that people took it the wrong way. The Apple EULA objectively has clauses in it that state that users must follow the "acceptable usage policy" and it is enforced regardless of any external agreements -- this would mean that Apple would be violating the GPL if they distribute any GPL software in their store.

You can add additional terms that permit distribution in the Apple store (as Signal has done), but the stock GPL does not permit distribution in the Apple store because the "acceptable use policy" is one of the things the GPL was made to fight against (the idea that users must act in an "acceptable" way to Apple when running software on their own computing devices).


> The Apple EULA objectively has clauses in it that state that users must follow the "acceptable usage policy" and it is enforced regardless of any external agreements -- this would mean that Apple would be violating the GPL if they distribute any GPL software in their store.

And Red Hat EULA objectively has clauses in it that you may not redistribute RHEL.

There is a slippery slope here, the FSF has decided for whatever reason that RHEL's restrictions "weren’t really restrictive, because they were so easy to comply with" [0] but there is really nothing "objective" about that determination.

[0] https://www.gnu.org/licenses/quick-guide-gplv3.html


You're being a tad disingenuous here. RHEL's EULA[1] is basically the same as SLE's, openSUSE's, Ubuntu's and so on. It only states that you are not allowed to use the RedHat trademarks when you redistribute RHEL -- and since RHEL (and the other distributions I mentioned) puts all of their trademarked components in a single "branding" package then it is not practically restrictive to make such a requirement. RHEL has no requirement that you cannot distribute some software (in fact, the distribution is under GPLv2 much like openSUSE and SLE).

Apple's EULA restricts users to only being able to use software they distribute under their "acceptable use policy". This is simply a violation of the GPL, with no wiggle room for discussion.

[1]: https://www.redhat.com/en/about/red-hat-end-user-license-agr...


The existing patent agreements are a contributor agreement, not part of the license. So, they restrict people from contributing, but don't actually provide any guaranteed protection for downstream users, as far as I can tell.

However, I'm not a lawyer and not involved, was just trying to summarize as well as I could, so I could be wrong.


Thank you very much for the detailed description. Makes sense now.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: