|
|
Subscribe / Log in / New account

Recently posted comments

GNOME 3.32 released

Posted Mar 14, 2019 19:51 UTC (Thu) by josh (subscriber, #17465)
Parent article: GNOME 3.32 released

Fractional scaling is *huge*; people have been asking for that for years, and it's critical for certain resolutions like 2560x1440.


Cook: security things in Linux v5.0

Posted Mar 14, 2019 18:49 UTC (Thu) by tdz (subscriber, #58733)
In reply to: Cook: security things in Linux v5.0 by rweikusat2
Parent article: Cook: security things in Linux v5.0

Time for coloring some bike sheds!

I don't see anything wrong with this. Of all the changes from the linked article, this is the least controversial. This has no runtime/compile overhead or any form of weird semantics. It doesn't obfuscate the code base. This change has zero negative impact. If anything, I'd ask for using the related gcc attribute instead of a comment.


Fixing programmers

Posted Mar 14, 2019 18:31 UTC (Thu) by HelloWorld (guest, #56129)
In reply to: Fixing programmers by rweikusat2
Parent article: Cook: security things in Linux v5.0

> This "reminder" that a very vocal group of people has been disagreeing with pretty much any C design decision since 197x isn't useful. A much better idea would be to push for a language extension with the desired semantics, assuming some set of desired semantics can ever be agreed on.
How is a "fallthrough comment" at the end of a case branch not a language extension, assuming that its presence is enforced by the compiler?

Besides, this has been standardized in C++17. The only reason it's not in C is that the C committee is run by a bunch of stick-in-the-muds.


Fixing programmers

Posted Mar 14, 2019 17:53 UTC (Thu) by Cyberax (✭ supporter ✭, #52523)
In reply to: Fixing programmers by rweikusat2
Parent article: Cook: security things in Linux v5.0

No. This is not an insult, it's a statement of fact.

A cavalier attitude of ignoring the simplest safety features has led the industry down the never-ending rabbit hole of security bugs.


Python dictionary "addition" and "subtraction"

Posted Mar 14, 2019 17:17 UTC (Thu) by NYKevin (subscriber, #129325)
In reply to: Python dictionary "addition" and "subtraction" by nybble41
Parent article: Python dictionary "addition" and "subtraction"

That already exists, it's called collections.Counter.


Fixing programmers

Posted Mar 14, 2019 16:34 UTC (Thu) by rweikusat2 (subscriber, #117920)
In reply to: Fixing programmers by dottedmag
Parent article: Cook: security things in Linux v5.0

Could you stop talking about me?

In theory, we're past the point were "Charge and beat 'em!" was an acceptable discussion tactic.


Fixing programmers

Posted Mar 14, 2019 16:31 UTC (Thu) by rweikusat2 (subscriber, #117920)
In reply to: Fixing programmers by Cyberax
Parent article: Cook: security things in Linux v5.0

> Attitude like yours so far led to several decades of unreliable software that crashes at the first opportunity.

Switching the topic of a discussion away from something technical and towards posting speculative, public insults about people who happen to disagree with some opinion is not a strong point in favour of this opinion. Rather the opposite.


Fixing programmers

Posted Mar 14, 2019 16:19 UTC (Thu) by rweikusat2 (subscriber, #117920)
In reply to: Fixing programmers by epa
Parent article: Cook: security things in Linux v5.0

This "reminder" that a very vocal group of people has been disagreeing with pretty much any C design decision since 197x isn't useful. A much better idea would be to push for a language extension with the desired semantics, assuming some set of desired semantics can ever be agreed on. The sorry mess of Perl given/ when which will probably forever have someone's weird ideas about DWIM operators ("dumb matching") tied to its ankles should serve as a warning here. This would help to avoid the problem (if there is a problem) instead of just "keep on nagging for a few more decades!".


Fixing programmers

Posted Mar 14, 2019 15:42 UTC (Thu) by Wol (subscriber, #4433)
In reply to: Fixing programmers by corbet
Parent article: Cook: security things in Linux v5.0

> Fixing the people has never been a workable solution to this kind of security issue; why would you expect this case to be different?

It's not about fixing the people - they've already been fixed. When observing people carrying out a task, if they keep doing the same thing wrong, ask yourself why.

It's a pretty safe bet they're doing EXACTLY what they've been trained to do. It's just that the task they're doing is unusual, and their training is making them do the wrong thing.

Case in point - who was the idiot that decided that in Windows "tab" should step between fields, and "return" should send the completed form back to the program. It took a MAHOUSIVE training effort to fix that programming blunder, and people STILL get it wrong on a regular basis.

If people can't do it right, IT'S BECAUSE THEY'VE BEEN TRAINED TO DO IT WRONG, and you've got to *find* that training and fix it - which may not be possible.

(Another case in point - these latest 737 MAX crashes - the plane avionics have changed, and it seems pilots haven't been told that 20 or 30 years of training will make them instinctively do the wrong thing in a crisis ... - TRUE STORY!)

Cheers,
Wol


Python dictionary "addition" and "subtraction"

Posted Mar 14, 2019 15:41 UTC (Thu) by nybble41 (subscriber, #55106)
In reply to: Python dictionary "addition" and "subtraction" by iabervon
Parent article: Python dictionary "addition" and "subtraction"

My intuition for "a + b", where "a" and "b" are both dictionaries, would be that keys which exist in both "a" and "b" have their values combined recursively with the same "+" operator.

>>> { 'apple': 5, 'pear': 7 } + { 'strawberry': 2, 'pear': 10 }
{ 'apple': 5, 'pear': 17, 'strawberry': 2 }
>>> { 'x': 'abc', 'z': { 'a': 13 } } + { 'x': 'def', 'y': 'ijk', 'z': { 'a': 9, 'b': 10 } }
{ 'x': 'abcdef', 'y': 'ijk', 'z': { 'a': 22, 'b': 10 } }

This would make it similar to the Semigroup operator (<>) in Haskell.


Fixing programmers

Posted Mar 14, 2019 15:31 UTC (Thu) by nilsmeyer (guest, #122604)
In reply to: Fixing programmers by farnz
Parent article: Cook: security things in Linux v5.0

And even after all that it's going to be the carbs that do you in in the long run.


Fixing programmers

Posted Mar 14, 2019 15:27 UTC (Thu) by HelloWorld (guest, #56129)
In reply to: Fixing programmers by rweikusat2
Parent article: Cook: security things in Linux v5.0

> The C switch statements has certain properties. One could argue whether all of these properties are really desirable, but that's not going to change it.
Actually it does. "C with magic comment for fall-through" is a different (albeit similar) language than C, because the compiler actually enforces the comment. And empirically people are less likely to make the fall-through mistake in that language than they are in C.


5.1 Merge window part 1

Posted Mar 14, 2019 13:51 UTC (Thu) by nilsmeyer (guest, #122604)
In reply to: 5.1 Merge window part 1 by anton
Parent article: 5.1 Merge window part 1

> Do the Linux kernel maintainers want to prove that poster right? And that despite giving the guarantee not to break existing code? Of course, binary compatibility problems are not just a kernel issue, but kernel maintainers should do their part in maintaining binary compatibility (as should others).

If that guarantee is broken you can of course demand your money back - you see where I'm going with this?


Fixing programmers

Posted Mar 14, 2019 13:45 UTC (Thu) by dottedmag (subscriber, #18590)
In reply to: Fixing programmers by rweikusat2
Parent article: Cook: security things in Linux v5.0

Could you share a list of software you authored or contribute to?


GMP and assert()

Posted Mar 14, 2019 13:32 UTC (Thu) by mathstuf (subscriber, #69389)
In reply to: GMP and assert() by jezuch
Parent article: GMP and assert()

I'm aware :) . I prefer using error_chain's .chain_err() or failure's .context() before using ? to tag a reason for "what was attempted that caused this error" tracing. Just passing the buck to the parent is an easy way to get errors that are absolutely confounding to end users like git-lfs:

git push
fatal error: no such file: path/to/some/lfs/file/on/another/branch

Note that this particular error is now better worded in that it mentions the object id that it is missing instead.


Fixing programmers

Posted Mar 14, 2019 12:16 UTC (Thu) by jem (subscriber, #24231)
In reply to: Fixing programmers by Cyberax
Parent article: Cook: security things in Linux v5.0

I have learned that checklists are also being applied in surgery. The first item on the list is to check the patient's name.


Python dictionary "addition" and "subtraction"

Posted Mar 14, 2019 10:00 UTC (Thu) by sheepgoesbaaa (guest, #98005)
In reply to: Python dictionary "addition" and "subtraction" by ms-tg
Parent article: Python dictionary "addition" and "subtraction"

Thanks, I enjoyed reading that :)


Fixing programmers

Posted Mar 14, 2019 9:48 UTC (Thu) by dvdeug (guest, #10998)
In reply to: Fixing programmers by rweikusat2
Parent article: Cook: security things in Linux v5.0

Would you accept a new car that has some 90,000 parts and only 20 of them are going to fail in practice? The various Un*x kernels are basically the only remaining large-scale C programs that are examples of how large-scale C programming can actually work; shrugging off 20 bugs are hardly an argument for C as a reasonable implementation language.

There's been other problems like this; Fortran require you to declare variables, so when programmers misspelled variable names, the compiler wouldn't warn the programmer. So those still using Fortran have the option of using "IMPLICIT NONE", not too dissimilar to C programmers having an option to have the compiler complain when they don't use a break or a note comment.


Fixing programmers

Posted Mar 14, 2019 9:30 UTC (Thu) by farnz (subscriber, #17727)
In reply to: Fixing programmers by martinfick
Parent article: Cook: security things in Linux v5.0

Unfortunately, the mechanical mechanisms used for gas safety are based on the idea that you simply permit the flow of gas to run freely when the burner is warm enough; they just stop gas flow when cold, and use pressure on the control knob to open up the flow. The better ones use pressure on the control knob to start a release timer, after which you need to release the control knob and press it again to resume the flow of gas.

As with all safety mechanisms, they're not that hard to get around if you're determined - the point, however, is that a single mistaken decision on its own is not enough to cause a serious problem.


Python dictionary "addition" and "subtraction"

Posted Mar 14, 2019 9:27 UTC (Thu) by NRArnot (subscriber, #3033)
Parent article: Python dictionary "addition" and "subtraction"

I'm very lukewarm. What is wrong with using .copy() and .update() methods? "Explicit is better than implicit" and methods are certainly more explicit.

But if there is support, I'd argue strongly against using + and - operators. This is far more likely to lead to accidents than using |. This latter operator is far less frequently used, and seeing it always alerts one to the fact that something out of the ordinary is going on. Also one can visualize a set as a dict where all values are the same and irrelevant, such as True. In fact back before we had sets, that's what we used to do. So extending the set | operator to apply similarly to dicts makes reasonable sense.

Subtraction I like even less. Non-commutativity I can live with, but subtraction completely ignores the values in the dict being "Subtracted". A much better idea would be a dict.subtract( other) method.


GMP and assert()

Posted Mar 14, 2019 9:26 UTC (Thu) by jezuch (subscriber, #52988)
In reply to: GMP and assert() by mathstuf
Parent article: GMP and assert()

Or you do a ? on it to propagate it up the call stack, which makes it pretty much like exceptions but with the code that potentially throws explicitly marked as such. (The ? operator is actually syntactic sugar for the try! macro which hides pattern matching underneath, but still.)


Fixing programmers

Posted Mar 14, 2019 6:35 UTC (Thu) by adobriyan (subscriber, #30858)
In reply to: Fixing programmers by Cyberax
Parent article: Cook: security things in Linux v5.0

Philosophically, programming is still young profession compared to other professions, often thousands years old.
Programming still have yet to grow up which is (slowly) happening.

Current situation is further complicated by very low barriers to entry.


Fixing programmers

Posted Mar 14, 2019 6:33 UTC (Thu) by epa (subscriber, #39769)
In reply to: Fixing programmers by rweikusat2
Parent article: Cook: security things in Linux v5.0

That would be true if someone were mindlessly adding ‘fall through’ markers in every place the language feature is used. That would indeed be a completely pointless exercise. But as I understand it, before adding the marker you first audit the code to make sure falling through is deliberate and not an oversight. Given the number of bugs that have been found in the past this auditing is a good use of time and likely to uncover and fix more bugs. When new code is written, having to add the marker serves as a reminder to the programmer to think about whether falling through is wanted. If programmers were machines this reminder would not be helpful. But experience shows that even the most highly skilled programmers occasionally make mistakes, and this is one of the more common of then, yet easy to prevent with a bit of tooling.


A kernel unit-testing framework

Posted Mar 14, 2019 3:22 UTC (Thu) by Cyberax (✭ supporter ✭, #52523)
In reply to: A kernel unit-testing framework by pbonzini
Parent article: A kernel unit-testing framework

WiFi is actually quite practical, its control protocols are quite complicated and are a prime target for mock-based unit tests. Integration tests are indeed very complicated, though.


A kernel unit-testing framework

Posted Mar 14, 2019 3:18 UTC (Thu) by jflombera (guest, #100225)
Parent article: A kernel unit-testing framework

Don't stop there, add support for property-based testing.


Fixing programmers

Posted Mar 14, 2019 3:14 UTC (Thu) by Cyberax (✭ supporter ✭, #52523)
In reply to: Fixing programmers by martinfick
Parent article: Cook: security things in Linux v5.0

You really need electronically actuated valves for this, it's impractical to do with purely mechanical valves. So I guess nobody wants to do this.


Turris: secure open-source routers

Posted Mar 14, 2019 3:05 UTC (Thu) by pabs (subscriber, #43278)
In reply to: Turris: secure open-source routers by Cyberax
Parent article: Turris: secure open-source routers


Fixing programmers

Posted Mar 14, 2019 2:00 UTC (Thu) by martinfick (subscriber, #4455)
In reply to: Fixing programmers by farnz
Parent article: Cook: security things in Linux v5.0

Unfortunately, I have yet to see a stove that comes with a timeout on every burner and doesn't continue to burn your food, your pot, and potentially your house if you forget to turn it off. Wait, we are expected to turn it off and not walk away! I would welcome such a safety feature if it existed, surely more than the nagging beep of a microwave that has food getting cold in it!


Turris: secure open-source routers

Posted Mar 13, 2019 23:34 UTC (Wed) by Cyberax (✭ supporter ✭, #52523)
Parent article: Turris: secure open-source routers

I have tried to use Turris software but ended up migrating to vanilla OpenWRT. It works really well since the 18.06 release, even the cellular modem is supported just fine.

You do lose the ability to roll back using BTRFS snapshots and automatic upgrades though. Also some minor stuff (like nice rainbow LEDs) is not supported by the stock kernel.


Leaderless Debian

Posted Mar 13, 2019 23:01 UTC (Wed) by debacle (subscriber, #7114)
In reply to: Leaderless Debian by mfuzzey
Parent article: Leaderless Debian

I wanted to write the same thing. While I'm personally happy with most of Debians leaders and the work they did as DPLs, I'm sure, that Debian can live well with one release cycle (two years) without formal leader. The time can be used to think about a better model, not with one super hero leader, but with a small group.


Fixing programmers

Posted Mar 13, 2019 22:25 UTC (Wed) by roc (subscriber, #30627)
In reply to: Fixing programmers by rweikusat2
Parent article: Cook: security things in Linux v5.0

A moment's searching shows that bread slicing machines routinely come with protective guards, which are legally required in some countries.

Personally I'd support people being free to chop off their own body parts if they insist on using unsafe equipment or unsafe programming languages, except that some of the costs inevitably fall on the community at large. For amputations, it's health care costs. For software, it's a combination of things: a software ecosystem polluted with vulnerable software, and a network ecosystem polluted with compromised devices.

The gas story is a good one.


Fixing programmers

Posted Mar 13, 2019 22:17 UTC (Wed) by farnz (subscriber, #17727)
In reply to: Fixing programmers by rweikusat2
Parent article: Cook: security things in Linux v5.0

And yet both of those examples (bread slicers and kitchen gas) have been changed over the years to reduce the chances of not using them correctly, and to make sure that it takes continued incorrect operation in the face of a machine trying to stop you before you hurt yourself. Unlike C, you have to actively work to hurt yourself with modern designed appliances.

Modern bread slicers are designed such that you need the guard down over the bread to allow the slicing action to run; you can't have your fingers near the bread, but the guard holds the loaf in place when it's held in place. On high speed slicers, the guard is the trigger mechanism - you put the unsliced loaf in, push the guard down, loaf is sliced and machine pushes on the guard to tell you to release it and move onto the next loaf.

This compares to older slicers, where the blades are exposed, and there's no interlocking mechanism in place to stop you cutting your fingers - you put the loaf in, remove your hand, and push the trigger.

Similarly, with kitchen gas, older appliances would run the gas forever once you turned it on; modern appliances cut the gas the moment you let go of the controls unless the burner is hot, and will cut it if the burner cools off too far (implying flame lost). Further, they will stop the gas flow after a fixed time period if the burner remains cold, to reduce the chance of accidentally holding the control down without lighting the gas, and then blowing yourself up. It's thus very, very hard to actually get enough gas out of an appliance to trigger an explosion, even if you're trying to do it.


Python dictionary "addition" and "subtraction"

Posted Mar 13, 2019 22:11 UTC (Wed) by iabervon (subscriber, #722)
In reply to: Python dictionary "addition" and "subtraction" by NYKevin
Parent article: Python dictionary "addition" and "subtraction"

For "a+b", I was thinking that "a+=b" seems like it should do something for every element of b, and what "a.update(b)" does feels like what "a+=b" would most likely do. Last-wins also matches what would happen if you just made a new dict and set all the items from a and b in the order they appear, so it feels right for concatenation.

I'd sort of guess that, if you've got an "or"-like thing, even if it doesn't short-circuit (i.e., evaluates all of its arguments), it'll pick between distinguishable values with the same truth value as if it were short-circuiting.


GMP and assert()

Posted Mar 13, 2019 22:05 UTC (Wed) by Wol (subscriber, #4433)
In reply to: GMP and assert() by sorokin
Parent article: GMP and assert()

> Example 1. Let's say we write a function sqrt. sqrt is not applicable for negative numbers.

Dangerous statement :-) What about i?

Cheers,
Wol


Fixing programmers

Posted Mar 13, 2019 21:59 UTC (Wed) by Cyberax (✭ supporter ✭, #52523)
In reply to: Fixing programmers by rweikusat2
Parent article: Cook: security things in Linux v5.0

Attitude like yours so far led to several decades of unreliable software that crashes at the first opportunity.

In reality people make mistakes. A lot of time.

A good example here is surgery. A surgeon is a highly trained professional, you need almost a decade of intense training for it. In short, a surgeon is the first candidate for somebody who shouldn't make stupid mistakes.

Yet surgeons forgetting instruments inside patients was a common occurrence before a simple check was added - nurses count surgical instruments before and after the surgery.

Aviation? The same issue. Solved by checklists that HAVE to be followed.


Fixing programmers

Posted Mar 13, 2019 21:50 UTC (Wed) by rweikusat2 (subscriber, #117920)
In reply to: Fixing programmers by roc
Parent article: Cook: security things in Linux v5.0

> The ease of detecting and correcting failure is relevant because it explains the difference in expectations that you highlighted.

Just out of curiosity: Have you ever seen a bread slicing machine? Chances are that someone who doesn't get "using that" right every time will end up cutting off a part of his or her fingers. That's a seriously bloody and quite painful experience. Yet, people without a degree in anything are expected to be able to do that.

NB: This is still completely besides the point I was trying to make, it just illustrates that "misues of household devices is harmless !!! but misuse of switch Catastrophical !!1" is an nonsensical assertion despite misuse happend to be harmless for an example I used because it served as illustration for something completely different.

Random story I feel like telling here: A couple of years ago, I read about a guy who was resolved to commit suicide and thus, turned the gas on in his kitchen. After waiting for terminal results for a while, he suddenly changed his mind, turned the gas off again and opened the kitchen window. To celebrate his decision to face this life somewhat more, he then lighted a cigarette. The roof of the house was blown of but he survived with serious burns and was later sentenced for arson.


Fixing programmers

Posted Mar 13, 2019 21:38 UTC (Wed) by rweikusat2 (subscriber, #117920)
In reply to: Fixing programmers by rahulsundaram
Parent article: Cook: security things in Linux v5.0

Clang/ gcc copying features from lint doesn't make these any more interesting than they were before. The idea that programmers should add cute little comments like

/* fallthru */

to express that they were actually planning to use a certain language feature in a machine-readable way is seriously old. The effect of this is that features someone considers particularly disagreeable become somewhat more complicated to use and that the code becomes cluttered (to a degree) with completely useless comments. Presence or absence of such comments doesn't indicate anything about correctness or incorrectness of the code.


Python dictionary "addition" and "subtraction"

Posted Mar 13, 2019 21:35 UTC (Wed) by NYKevin (subscriber, #129325)
In reply to: Python dictionary "addition" and "subtraction" by iabervon
Parent article: Python dictionary "addition" and "subtraction"

Indeed, the problem is that:

1. Single pipe is traditionally commutative (bitwise OR, set union, etc.). It has been used non-commutatively (shell pipelines), but that usage is so far afield that it provides no intuition here.
2. Double pipe (or the "or" keyword) traditionally short-circuits to the left. I've never seen it short-circuit to the right.
3. Plus is sometimes commutative, but its noncommutative uses traditionally preserve the order of items (concatenation) rather than allowing one item to "override" another. So the closest analogue here would be c = ChainMap(a, b) (so that you have c.maps == [a, b]) as Hettinger suggests... but that actually gives precedence to the left! ChainMap.new_child() does give precedence to the "right" in a sense, but it's type-asymmetric (self is a ChainMap, the argument usually isn't), and probably should not be an operator at all.


Fixing programmers

Posted Mar 13, 2019 21:12 UTC (Wed) by roc (subscriber, #30627)
In reply to: Fixing programmers by rweikusat2
Parent article: Cook: security things in Linux v5.0

The ease of detecting and correcting failure is relevant because it explains the difference in expectations that you highlighted.

I don't expect people to put the right key in the right lock first try every single time, just like I don't expect C developers to always remember to put "break" after switch cases. But because the consequences of the former are "it didn't work, try again" (i.e. negligible), it *is* reasonable to expect unskilled people to successfully enter their flat. The goal of the changes reported here, which you apparently oppose, is to change the consequences of omitting a "break" to something similar (whereas currently the consequences can be much more severe and fall on other parties).


TMTOWTDI

Posted Mar 13, 2019 20:53 UTC (Wed) by jccleaver (guest, #127418)
Parent article: Python dictionary "addition" and "subtraction"

There's definitely some overlap between these and and perl6's more arcane operators, but in perl 5 and perl 6 the trivial solution is just:

> %hash2 = (%hash1, %hash2); # %hash2 values will take priority

There are other ways to handle it if you need to watch memory usage in pathological cases, but sometimes simple things should be simple.


Fixing programmers

Posted Mar 13, 2019 20:45 UTC (Wed) by rahulsundaram (subscriber, #21946)
In reply to: Fixing programmers by rweikusat2
Parent article: Cook: security things in Linux v5.0

> JFTR: This was already a feature of the original lint dating back to about 1977.

Lots of tooling existed before but being part of the compiler makes them more readily available and even better if it is the default.


Fixing programmers

Posted Mar 13, 2019 20:38 UTC (Wed) by rweikusat2 (subscriber, #117920)
In reply to: Fixing programmers by rahulsundaram
Parent article: Cook: security things in Linux v5.0

JFTR: This was already a feature of the original lint dating back to about 1977.


Fixing programmers

Posted Mar 13, 2019 20:35 UTC (Wed) by rweikusat2 (subscriber, #117920)
In reply to: Fixing programmers by roc
Parent article: Cook: security things in Linux v5.0

> Putting the wrong key in the wrong lock of your flat is immediately detected and has no lasting consequences.

That I happened to use an example to illustrate something specific (complicatedness of a procedure) doesn't mean any side properties of said example are relevant to the discussion because they exist (or are believed to exist).


Fixing programmers

Posted Mar 13, 2019 20:27 UTC (Wed) by roc (subscriber, #30627)
In reply to: Fixing programmers by rweikusat2
Parent article: Cook: security things in Linux v5.0

Putting the wrong key in the wrong lock of your flat is immediately detected and has no lasting consequences.

Absent the kind of work described here that you are objecting to, omitting a "break" is not immediately detected and can have lasting consequences up to and including users you don't even know having their systems compromised by hostile forces.

It would be a better analogy if every time you touched a lock with the wrong key you got an electric shock. It would be interesting to see how long you tolerated that situation because "human beings without any qualifications should be able to do this".


Fixing programmers

Posted Mar 13, 2019 19:43 UTC (Wed) by rahulsundaram (subscriber, #21946)
In reply to: Fixing programmers by rweikusat2
Parent article: Cook: security things in Linux v5.0

> What about "fixing" people writing code in C (the language is not that complicated, mind you)

All the empirical evidence including plenty of research and billions of dollars spent on fixing bugs in such code clearly indicates otherwise.

> And adding /** I really disagree **/ comments to source code doesn't improve that (the code).

That's not really what is happening here though. The specific comment here is being parsed by the compiler and therefore really is part of the code.


Fixing programmers

Posted Mar 13, 2019 19:40 UTC (Wed) by Cyberax (✭ supporter ✭, #52523)
In reply to: Fixing programmers by rweikusat2
Parent article: Cook: security things in Linux v5.0

> "Humans just can't learn!" wouldn't get anyone very far in a maths test (or any other kind of interview/ examination).
The number of CVEs caused by a missed "break" tends to confirm that people suck at math.


Fixing programmers

Posted Mar 13, 2019 19:35 UTC (Wed) by rweikusat2 (subscriber, #117920)
In reply to: Fixing programmers by corbet
Parent article: Cook: security things in Linux v5.0

"Humans just can't learn!" wouldn't get anyone very far in a maths test (or any other kind of interview/ examination).

The C switch statements has certain properties. One could argue whether all of these properties are really desirable, but that's not going to change it. And adding /** I really disagree **/ comments to source code doesn't improve that (the code).

I have to open three different locks with three different keys when trying to get into my flat. Two of them even look identical and can only be distinguished by knowing their relative positions on the keyring. This is vastly more complicated than remembering that a break needs to be added to the end of 'a switch case 'if execution of code in the corresponding block is supposed to be terminated. Yet, human beings without any higher qualifications are expected to be able to do the former while it is claimed that "nobody" can do the latter. Strange, isn't it?

Whenever people have to make a decision, they'll sometimes get this decision wrong. But they will usually get it right most of the time, as evidenced by the miniscule number of missing breaks (compared to the size of the codebase) found during the course of this (a Linux source I happen to have lying around here contains 45,021 switch statements. 20 missing breaks in n * 45,021 cases, n > 2, is decidedly miniscule).


Python dictionary "addition" and "subtraction"

Posted Mar 13, 2019 19:26 UTC (Wed) by ms-tg (subscriber, #89231)
In reply to: Python dictionary "addition" and "subtraction" by smurf
Parent article: Python dictionary "addition" and "subtraction"

> You can create a subclass of "dict" with extra methods, but you can't do that on "dict" directly. Built-in types are immutable. If you want a language you can do this with, use *Ruby*.

Definitely!

In fact, Ruby provides a way to do it *without monkey-patching* called Refinements:
https://ruby-doc.org/core-2.5.3/doc/syntax/refinements_rd...

So if you wanted to extend the Ruby Hash class (equivalent to Python Dict) in this way with method #+ and #+=, you could create the following refinement module:

module HashWithPlus
refine Hash do
alias_method :+, :merge
alias_method :"+=", :merge!
end
end

Then, in any lexical scope you can say:

using HashWithPlus

{ "a" => 1 } + { "b" => 2}
=> {"a"=>1, "b"=>2}

With no monkey-patching! The refined Hash will only be visible in scopes that explicitly use the refinement.

(just sharing for those interested)


The Thunderclap vulnerabilities

Posted Mar 13, 2019 19:17 UTC (Wed) by rweikusat2 (subscriber, #117920)
In reply to: The Thunderclap vulnerabilities by nybble41
Parent article: The Thunderclap vulnerabilities

>> any driver which supports DMA would need to use its own DMA buffer backing pages cache
> The page cache would need to be separate for each *device*, not each driver.

A driver capable of managing more than one device would obviously need one cache per currently managed device. Do you think somebody wouldn't immediately recognize this if such a driver was under discussion?


Fixing programmers

Posted Mar 13, 2019 19:15 UTC (Wed) by corbet (editor, #1)
In reply to: Cook: security things in Linux v5.0 by rweikusat2
Parent article: Cook: security things in Linux v5.0

Perhaps because humans have this nasty tendency to be ... humans ... who will, when using a language that makes it easy to code certain types of mistakes, make those mistakes? Fixing the people has never been a workable solution to this kind of security issue; why would you expect this case to be different?


Python dictionary "addition" and "subtraction"

Posted Mar 13, 2019 19:14 UTC (Wed) by iabervon (subscriber, #722)
Parent article: Python dictionary "addition" and "subtraction"

My intuition for "a+b" is that the second one takes precedence, while my intuition for "a|b" is that the first one takes precedence (like "a.get(key) or b.get(key)").


Cook: security things in Linux v5.0

Posted Mar 13, 2019 19:12 UTC (Wed) by rweikusat2 (subscriber, #117920)
Parent article: Cook: security things in Linux v5.0

The C language doesn't have "a statement indicating the end a switch case" (seriously bizarre idea) because the C switch statement is not a (Pascal-style) multiway conditional. It's sort-of a computed goto where an expression is evaluated and execution continues at a certain label depending on the outcome.

What about "fixing" people writing code in C (the language is not that complicated, mind you) instead of inventing one bazillion
/*** OMFG !! Not like Pascal !!! ***/ pseudosyntactic tags?


Cook: security things in Linux v5.0

Posted Mar 13, 2019 18:38 UTC (Wed) by zblaxell (subscriber, #26385)
Parent article: Cook: security things in Linux v5.0

> The goal is to be able to add -Wimplicit-fallthrough to the build so that the kernel will stay entirely free of this class of bug going forward.

"-Werror=implicit-fallthrough" would be more effective, but you'd have to get all the way to zero warnings first.


5.1 Merge window part 1

Posted Mar 13, 2019 18:16 UTC (Wed) by anton (subscriber, #25547)
In reply to: 5.1 Merge window part 1 by willy
Parent article: 5.1 Merge window part 1

Unfortunately, I do not have the time to pursue such a project. I can provide binaries and libraries for testing, if someone wants to do it, though.

As for the security excuse: 1) You don't even have any proof of such a vulnerability; is your belief enough justification to break existing code? 2) Even if there was such a vulnerability, the attacker would have to break into my system first before exploiting it. 3) Those who are nervous about such a hypothetical vulnerability can disable the module.


The Linux Foundation's CommunityBridge platform

Posted Mar 13, 2019 17:36 UTC (Wed) by karkhaz (subscriber, #99844)
Parent article: The Linux Foundation's CommunityBridge platform

From the response by Conservancy:

> supports the “BDFL” FOSS governance model, which has already been widely discredited

u wot mate?


Python dictionary "addition" and "subtraction"

Posted Mar 13, 2019 17:17 UTC (Wed) by smurf (subscriber, #17840)
In reply to: Python dictionary "addition" and "subtraction" by pj
Parent article: Python dictionary "addition" and "subtraction"

You can create a subclass of "dict" with extra methods, but you can't do that on "dict" directly. Built-in types are immutable. If you want a language you can do this with, use Ruby.


Python dictionary "addition" and "subtraction"

Posted Mar 13, 2019 16:52 UTC (Wed) by pj (subscriber, #4506)
Parent article: Python dictionary "addition" and "subtraction"

Can't this just be monkey-patched in by anyone who wants it? One of the joys of python, no?


NO TO SYSVINIT - or initscripts, rather!

Posted Mar 13, 2019 16:30 UTC (Wed) by nopsled (guest, #129072)
In reply to: NO TO SYSVINIT - or initscripts, rather! by luto
Parent article: Init system support in Debian

Have you seen https://www.freebsd.org/cgi/man.cgi?query=procctl&sek...

It would be nice if Linux had the PROC_REAP_KILL stuff. I think one could improve the FreeBSD interface a tad bit when incorporating it, but the concept looks sound.

systemd ofcourse has one supervisor per context (system or user), but this will be especially useful for supervisors that have one monitor per service (s6, runit style), and that these can be nested supervisors (so an option to not cross subreaper boundaries where each supervisor is a subreaper, or a way to kill inherited children only, and a way to kill direct children only, and OR the flags to do both). You could get creative, but if done right, this could solve a lot of woes with process management.


The Linux Foundation's CommunityBridge platform

Posted Mar 13, 2019 16:29 UTC (Wed) by keithp (subscriber, #5140)
Parent article: The Linux Foundation's CommunityBridge platform

For those who found the wall-of-text over at conservancy a bit daunting, here's the last bit of that post:

"This new LF system is probably just right for FOSS projects that (a) prefer to use single-point-of-failure, proprietary software rather than FOSS for their infrastructure, (b) do not want to operate in a way that is dedicated to the public good, and (c) have very minimal fiscal sponsorship needs, such as occasional reimbursements of project expenses."

Just another LF attempt to look like a part of our community and failing?


The Thunderclap vulnerabilities

Posted Mar 13, 2019 15:21 UTC (Wed) by nybble41 (subscriber, #55106)
In reply to: The Thunderclap vulnerabilities by rweikusat2
Parent article: The Thunderclap vulnerabilities

> any driver which supports DMA would need to use its own DMA buffer backing pages cache

The page cache would need to be separate for each *device*, not each driver. A device snooping on itself may be harmless, but the same is not necessarily true for snooping on other devices managed by the same driver. Besides the fact that one driver might manage multiple brands and models of devices, some more trustworthy than others, one can also envision e.g. a system with two identical NICs surreptitiously snooping on each other and transmitting internal network data over the external network.


An "i3" is also a window manager.

Posted Mar 13, 2019 4:54 UTC (Wed) by codyharrington (guest, #130219)
In reply to: An "i3" is also a window manager. by gmatht
Parent article: Announcing the release of sway 1.0

Regarding i3, from Wikipedia:

"i3 is a tiling window manager designed for X11, inspired by wmii, and written in C."

Regarding Sway, from their website:

"Sway is a tiling Wayland compositor and a drop-in replacement for the i3 window manager for X11. It works with your existing i3 configuration and supports most of i3's features, plus a few extras.".


Malcolm: Usability improvements in GCC 9

Posted Mar 12, 2019 23:44 UTC (Tue) by simlo (guest, #10866)
In reply to: Malcolm: Usability improvements in GCC 9 by rweikusat2
Parent article: Malcolm: Usability improvements in GCC 9

*laugh*
I am software architect on a product containing Java, C, C++ and a few scripting things around as well. The code with fewest bugs is the C++ - even though we make far the most complicated algorithms in C++.

Some of the previous (lead) developers bought that code close to the hardware has to be C. That code is terrible and impossible to unit test. We recently had to spend a lot of hours patching for a simple memory leak, which simply wouldn't have happened with modern C++ code style (smart pointers).

The Java code is a lot better than the C, but there are way too many treads.

I agree with one huge problem in C++, though: It doesn't scale to large project, since each project around choose their own subset of the language and conventions. When you try merge the projects in one binary it falls apart. Java is much better in that sense.


The Thunderclap vulnerabilities

Posted Mar 12, 2019 21:50 UTC (Tue) by rweikusat2 (subscriber, #117920)
In reply to: The Thunderclap vulnerabilities by westeri
Parent article: The Thunderclap vulnerabilities

> The problem here is that you can essentially plug in any PCIe device to a Thunderbolt enclosure (as they come with one or multiple > PCIe slots). This means that you would need to fix each and every PCI driver

Yes. I thought I already wrote this ("this should really be all kinds of devices"): If this issue is supposed to be mitigated by the IOMMU, any driver which supports DMA would need to use its own DMA buffer backing pages cache. There's no need for individual buffers to span a complete page (or some number of complete pages) provided management information used by a driver isn't kept in the unused parts of some page a part of which is currently used as DMA buffer, at least not in a way where corruption could go unnoticed. Malicious device snooping on itself sounds pretty harmless to me ;-).

Assuming that fixing this is considered desirable (the underlying issue has existed forever --- there's no reason why hardware designed by an unknown entity ought to be trustworthy, especially not if this 'hardware' is in itself complicated enough to contain a general purpose CPU running some decidedly non-trivial software), this cries out for some sort of infrastructure support for DMA buffer allocation drivers could easily make use of.

NB: I understand the benefits of the existing approach. But that's still just life-patching of a more fundamentally deficient (in this respect) memory management model.


The Thunderclap vulnerabilities

Posted Mar 12, 2019 21:01 UTC (Tue) by westeri (subscriber, #62678)
In reply to: The Thunderclap vulnerabilities by rweikusat2
Parent article: The Thunderclap vulnerabilities

The problem here is that you can essentially plug in any PCIe device to a Thunderbolt enclosure (as they come with one or multiple PCIe slots). This means that you would need to fix each and every PCI driver to make sure they only do DMA to/from buffers that fill the whole page (the minimum IOMMU window size). Doing it in the IOMMU driver allows us to prevent the DMA attack now without need to modify all the PCI drivers. Since it only bounces buffers not filling the whole page so when a driver gets "fixed" it won't bounce anymore and eventually we can turn the bouncing off completely.


The Thunderclap vulnerabilities

Posted Mar 12, 2019 19:48 UTC (Tue) by rweikusat2 (subscriber, #117920)
In reply to: The Thunderclap vulnerabilities by westeri
Parent article: The Thunderclap vulnerabilities

"Don't buy devices from the people who wrote the paper"?

Assuming that memory protection/ accesss control with page granularity is available, DMA buffers used by untrusted devices (and this should really be all kinds of devices) must not share memory pages with code whose information said untrusted devices are not supposed to access if the access control is supposed to be used effectively. This means *if* such a facility is to be used in a sensible way, DMA buffer allocation must be per-device and separate from all other allocations, including other DMA buffer allocation.

There are obviously tradeoffs here as most real-world devices won't be untrusted but singling out a certain kind of devices and adding an additional DMA buffer allocation system working on top of the existing DMA buffer allocation systems is a technically seriously unpleasant workaround for a highly unlikely fringe case.


The Thunderclap vulnerabilities

Posted Mar 12, 2019 17:18 UTC (Tue) by k8to (guest, #15413)
In reply to: The Thunderclap vulnerabilities by flussence
Parent article: The Thunderclap vulnerabilities

I think this complexity doesn't prevent categorically the idea of a device which tries to limit the interaction to charging. However, it does make it challenging, and fairly hard to imagine proving it safe.

Which is probably what you were getting at.


Malcolm: Usability improvements in GCC 9

Posted Mar 12, 2019 17:10 UTC (Tue) by k8to (guest, #15413)
In reply to: Malcolm: Usability improvements in GCC 9 by tdz
Parent article: Malcolm: Usability improvements in GCC 9

Imo, C++ without exceeptions works for certain use cases, like embedded codebases. But STL without exceptions sounds very bad.


5.1 Merge window part 1

Posted Mar 12, 2019 16:35 UTC (Tue) by willy (subscriber, #9762)
In reply to: 5.1 Merge window part 1 by anton
Parent article: 5.1 Merge window part 1

I was the one who proposed it be removed entirely.

Continuing to support the a.out format has risks. The initial proposal to remove the a.out coredump support was due to bugs being found in it. Given the amount of testing the a.out code receives as a whole, I have little doubt that a determined attacker could find a security hole to exploit in it.

Since you appear to be a programmer yourself, how would you like to take up Alan Cox's suggestion of writing an a.out loader entirely in userspace?


The Thunderclap vulnerabilities

Posted Mar 12, 2019 16:16 UTC (Tue) by westeri (subscriber, #62678)
In reply to: The Thunderclap vulnerabilities by rweikusat2
Parent article: The Thunderclap vulnerabilities

Feel free to propose a better one that does not involve fixing all the possible PCI drivers using DMA ;-)


Leaderless Debian

Posted Mar 12, 2019 14:58 UTC (Tue) by liw (subscriber, #6379)
In reply to: Leaderless Debian by lamby
Parent article: Leaderless Debian

Chris, thank you for all the work you've done for Debian, and continue to do. I for one understand being reluctant to continue as DPL, and to not begrudge you the chance to step out of the spotlight, for some peace and quiet.


5.1 Merge window part 1

Posted Mar 12, 2019 14:34 UTC (Tue) by anton (subscriber, #25547)
Parent article: 5.1 Merge window part 1

Support for the ancient a.out executable format has been deprecated, with an eye toward removing it entirely later this year if nobody objects.
Where do I register my objections?

Just today I found that my system can run my good old QMAGIC binaries with a little help from me (I have yet to find out how to do it as non-root, and how to run ZMAGIC binaries). I use this to compare the old stuff to the new one, both in features and in performance, and want to continue to do so in the next decades.

Couldn't the same be achieved by always recompiling from the source? No, for several reasons: 1) One of the things I compare is what the compiler produced. 2) Unlike the Linux kernel maintainers, compiler maintainers usually do not give a guarantee not to break existing code, and consequently, the chances of 20+-year old source code compiling on a current compiler are not that great.

Interestingly, my recent investigation of a.out binaries was in reaction to a posting containing the claim:

So, [Windows has] a window of ~ 25 years where binaries still typically work, vs Linux being "maybe a few years, and only on a single distro".
Do the Linux kernel maintainers want to prove that poster right? And that despite giving the guarantee not to break existing code? Of course, binary compatibility problems are not just a kernel issue, but kernel maintainers should do their part in maintaining binary compatibility (as should others).


The Thunderclap vulnerabilities

Posted Mar 12, 2019 14:25 UTC (Tue) by rweikusat2 (subscriber, #117920)
In reply to: The Thunderclap vulnerabilities by westeri
Parent article: The Thunderclap vulnerabilities

"Copy the data into a dedicated page" is an ugly workaround for the issue.


An "i3" is also a window manager.

Posted Mar 12, 2019 13:22 UTC (Tue) by mathstuf (subscriber, #69389)
In reply to: An "i3" is also a window manager. by gmatht
Parent article: Announcing the release of sway 1.0

> I presume sway is compatible with the i3 window manager

Specifically, the configuration file (mainly bindings, workspace settings, etc.). I assume there are new variables in sway for the bits that Wayland expects compositors to provide over X's requests of window managers.


The Thunderclap vulnerabilities

Posted Mar 12, 2019 11:02 UTC (Tue) by westeri (subscriber, #62678)
In reply to: The Thunderclap vulnerabilities by rweikusat2
Parent article: The Thunderclap vulnerabilities

There is now a patch series from Lu Baolu aiming to fix the remaining issues here:

https://lore.kernel.org/lkml/20190312060005.12189-1-baolu...


An "i3" is also a window manager.

Posted Mar 12, 2019 11:00 UTC (Tue) by mips (guest, #105013)
In reply to: An "i3" is also a window manager. by gmatht
Parent article: Announcing the release of sway 1.0

Funnily enough the first i3 I think of is a BMW.
I can find no statement on whether this is supported by sway.


Leaderless Debian

Posted Mar 12, 2019 9:44 UTC (Tue) by lamby (subscriber, #42621)
Parent article: Leaderless Debian

> Lamb has been conspicuous in his absence from the discussion, with the obvious implication that he does not wish to run for a third term

This has now been made explicit: https://lists.debian.org/debian-vote/2019/03/msg00014.html


Leaderless Debian

Posted Mar 12, 2019 9:22 UTC (Tue) by ulysse68 (guest, #35632)
In reply to: Leaderless Debian by Cyberax
Parent article: Leaderless Debian

Debian first !


Malcolm: Usability improvements in GCC 9

Posted Mar 12, 2019 9:21 UTC (Tue) by tdz (subscriber, #58733)
In reply to: Malcolm: Usability improvements in GCC 9 by rweikusat2
Parent article: Malcolm: Usability improvements in GCC 9

Because it's not a data structure unless it's wrapped in 'struct { }'


Leaderless Debian

Posted Mar 12, 2019 9:12 UTC (Tue) by Karellen (subscriber, #67644)
Parent article: Leaderless Debian

@mjg - as bdale suggested at the end of your talk, are you sure you can't be convinced to run on your "heresies" platform? ;-)


Leaderless Debian

Posted Mar 12, 2019 8:58 UTC (Tue) by andrewsh (subscriber, #71043)
In reply to: Leaderless Debian by Cyberax
Parent article: Leaderless Debian

Are they Debian developers yet?


Leaderless Debian

Posted Mar 12, 2019 8:53 UTC (Tue) by cevin666 (guest, #960)
In reply to: Leaderless Debian by edomaur
Parent article: Leaderless Debian

Still can't stop laughing.


Leaderless Debian

Posted Mar 12, 2019 8:14 UTC (Tue) by Cyberax (✭ supporter ✭, #52523)
Parent article: Leaderless Debian

I nominate Trump + Pence! Make Debian Great Again!


Leaderless Debian

Posted Mar 12, 2019 7:49 UTC (Tue) by mfuzzey (subscriber, #57966)
Parent article: Leaderless Debian

Well Belgium went 589 days without a government, I'm sure Debian will get along for quite a while without a DPL :)


An "i3" is also a window manager.

Posted Mar 12, 2019 7:18 UTC (Tue) by bangert (subscriber, #28342)
In reply to: An "i3" is also a window manager. by gmatht
Parent article: Announcing the release of sway 1.0

And from those of us unaware of the existence of an Intel i3 - thank you for your comment!


Leaderless Debian

Posted Mar 12, 2019 5:05 UTC (Tue) by edomaur (subscriber, #14520)
Parent article: Leaderless Debian

>> Since Debian developers are famously an agreeable and non-argumentative bunch, there should be no problem with that aspect of things.

Woof !


An "i3" is also a window manager.

Posted Mar 12, 2019 2:13 UTC (Tue) by gmatht (subscriber, #58961)
Parent article: Announcing the release of sway 1.0

It is possible that Wayland has become so bloated that scaling down to a lowly Intel i3 has become a newsworthy achievement, but it seems implausible.

For people who are as confused as I was, there is also a lesser known "i3" which is a form of window manger. I presume sway is compatible with the i3 window manager (in addition to Intel i3).


The Thunderclap vulnerabilities

Posted Mar 11, 2019 19:50 UTC (Mon) by rweikusat2 (subscriber, #117920)
In reply to: The Thunderclap vulnerabilities by nix
Parent article: The Thunderclap vulnerabilities

The point was supposed to be that "Linux" doesn't "put function pointers in the same page as network packets" in the way this statement suggests.

Linux has a general purpose kernel memory allocator. This is a power-of-2-freelist allocator sitting atop the page allocator (more precisely it's implemented as set of object caches for objects whose sizes are powers-of-two). As detailed in the paper, the e1000 driver allocates skbs via kmalloc. This means its network buffers will usually occupy some part of a page. An access control mechanism with page granularity thus cannot prevent malicious devices from accessing the remaining part of the page. As that's just one of the pages currently allocated to one of the kmalloc caches, any other part of the kernel which uses kmalloc could end up using this "remaining part of the page".

The gist of this is that a (page-based) IOMMU can only prevent malicious devices from accessing data they're aren't supposed to access if the devices drivers used for such devices do their own memory management based getting complete pages from the page allocator.


Malcolm: Usability improvements in GCC 9

Posted Mar 11, 2019 19:45 UTC (Mon) by xtifr (guest, #143)
In reply to: Malcolm: Usability improvements in GCC 9 by NYKevin
Parent article: Malcolm: Usability improvements in GCC 9

> Doesn't that argument also apply to C++, except that it's always the same ad hoc informally-specified bug-ridden slow implementation of half of Common Lisp?

It's a much *larger* ad-hoc informally specified bug-ridden slow implementation of half of Common Lisp. :) C++11, in particular, adds lambdas to the language, for extra bonus lispiness. :)

(I was actually about ready to give up on C++ until C++11, which returned to the list of languages I don't mind *too* terribly.)


Introducing Season of Docs

Posted Mar 11, 2019 18:13 UTC (Mon) by Zenith (guest, #24899)
Parent article: Introducing Season of Docs

That's great news for everyone. Hopefully it leads to better technical writers, better documentation, and more focus on documentation.
Kudos to Google for this!


Malcolm: Usability improvements in GCC 9

Posted Mar 11, 2019 18:08 UTC (Mon) by rweikusat2 (subscriber, #117920)
In reply to: Malcolm: Usability improvements in GCC 9 by tdz
Parent article: Malcolm: Usability improvements in GCC 9

> While C++'s STL much better than the data structures in C standards,

There are no "data structures" in C standards, there's just a convention for representing strings.



Copyright © 2025, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds