Better HN
topnewbestaskshowjobs
Log inSign up

dwattttt

2,355 karma · joined Dec 14, 2020 (5y ago) · 1,116 submissions

Submissions

comment 20h ago · link · parent

> I feel like you're not understanding what I mean by easier.

> Suppose there is a point in the code where the compiler can't verify that it's safe to access the object but you want to do it anyway. You've transferred ownership of it to e.g. a third party library, while still keeping and using a naughty reference to it. Avoiding this would require you to restructure the code, which could be a lot of work. But the boss wants you to do it now instead of all the refactoring needed to do it right.

That's exactly what I thought every time I added 'unsafe' where I "knew" it was fine, even though the compiler told me I couldn't. And the vast majority of those times, within a day, I had to track down "the program now segfaults erratically". It's not _every_ time, but the vast majority of them. Certainly enough that when I now get into the same situation, the easier option is to make it certain that the object isn't being freed (wrap it in a refcount and call it a day, no unsafe in sight).

comment 1d ago · link · parent

Just to be clear, the problem you want Microsoft to solve is other people writing bad drivers?

I could see driver certification becoming much more restrictive & expensive as a way to raise their quality, but short of that what solutions could exist?

comment 1d ago · link · parent

> just write "unsafe" once inside a function that you can call in 500 different places

It's usually the opposite. If you're being forced to write unsafe, odds are there's a crash bug about to appear (the word "forced" was very specifically chosen, I've been in both of these positions quite a few times).

And if you're not being forced to write unsafe, not writing it really is easier. Precedence of operations means that if you want to call a method/access a field of a raw pointer, it's a minimum of `(*a).` to access it. A reference is just the `.`.

comment 1d ago · link · parent

Crowdstrike doesn't make the NT kernel, they made a proprietary driver that blew up (on bad data ingest IIRC, not even on a driver update).

comment 1d ago · link · parent

It's not perfect or absolute, but the unsafe way in Rust is often harder. As the simplest example, raw pointer operations have less syntactic sugar, so using them is less ergonomic.

Other avenues for bad are still there though.

comment 3d ago · link · parent

> You're intentionally being obtuse. I already provided examples. An SQL injection for example does not (at least typically) lead to RCE.

You've described something that's not "code execution", and I've agreed several times. I'm making fun of the fact that a "local privilege escalation" is turned into a "remote" attack if it's emailed and run/executed/parsed, much like an email signature.

comment 3d ago · link · parent

You're calling "trick someone into running an executable" an RCE? I can work with this definition, but like I said, it makes this a very low bar, very valueless definition. Everything is RCE. Which is why it's hard to answer my question "what _isn't_ RCE".

comment 3d ago · link · parent

And if I leave a USB with a malicious executable in a parking lot, and someone runs it, it sounds like I'll have a remote code execution vulnerability too. Sounds like a very low bar, I guess RCE must be a basic, "everything gets this marker" thing.

comment 3d ago · link · parent

Are you suggesting the existence of exploits outside of the definition of "attacker controlled"?

If not, and all exploits are attacker controlled, it sounds like all exploits are RCE.

EDIT I guess I have to weaken the last condition since we haven't proved all exploits are "code execution", but we have at least proved all exploits are "remote".

comment 3d ago · link · parent

What is not "remote" code execution under this definition?

comment 3d ago · link · parent

Their homework could also turn out to be learning "why not to trust the first thing AI tells you", another valuable lesson.

comment 4d ago · link · parent

Everything seems right until the last sentence; banks, insurance, finance, a small start-up (that may or may not be tech focused, I'd guess not), they aren't getting Windows because it's a downgraded UX for their purposes. And they aren't all (or even any in some cases) bean counters.

They are getting _something_ that they're happy about, and they're not all blind to alternatives.

comment 4d ago · link · parent

Using Gemini isn't the same as "happy that search puts AI summaries up top". "I would be surprised" addresses the point, but it's not "proof".

comment 4d ago · link · parent

Not Safari & macOS! Next they'll come for the iOS!

comment 4d ago · link · parent

Other people mentioned it, but since it was what I did; I didn't commit the day before/that morning. I didn't realise I'd need that morning's version, I only realised that after mutating it.

So it's the "oh no, I realise now that I needed to commit before I made all those changes" situation, but since the workspace gets snapshot/committed on every jj command, nothing was lost.

comment 4d ago · link · parent

I have a good story around these features.

At the start of the day, I resumed working on a feature; there's no staging, so modifications I make are all stored as the current change.

Later that day I realised I needed to actually save the version of the feature that existed when I started work that morning.

So into the evolog I go (`jj evolog`). It's a record of all commits that a change has been; I could scroll back through the recorded changes, find the first change made that day, and then 'jj new' to create a change that represents that work.

It felt magical, to just be able to jump back to a project state that I didn't explicitly record, then save it.

comment 4d ago · link · parent

In practice I end up producing a branch where the commits are the kind of "ideal"; units of work that build on each other, but not interspersed with "fix something we didn't in notice in the commit a week ago".

comment 5d ago · link · parent

An excellent source, Kurzgesagt covered the use of virology to cure cancer recently: https://youtu.be/0NY2gAftzJE?si=yeYfT4yc8_ffGmDD

comment 5d ago · link · parent

As is tradition, Raymond Chen has had something to say about this. The windows-1252 code page was introduced with Windows 1.0, and according to Wikipedia its final version shipped with Win98. String operations are just plain too hard.

https://devblogs.microsoft.com/oldnewthing/20200804-00/?p=10...

https://devblogs.microsoft.com/oldnewthing/20241007-00/?p=11...

comment 5d ago · link · parent

If it doesn't raise enough for the smart money to cash out, it stops looking so smart.

comment 6d ago · link · parent

You're arguing that there's been bugs before, and there aren't more of them now? It sure seems like there's more failures now.

comment 1w ago · link · parent

> https://www.countryside-alliance.org/resources/politics/alli...

Their opening point was concern about solar power displacing agricultural use for land, while comments here talk about using it to provide shade to cattle. Doesn't seem like a particularly good argument.

comment 1w ago · link · parent

Every company has their own standard setup, but not every company has the same setup as every other company. That's what GP is referring to.

comment 1w ago · link · parent

I'm not a C++ expert, but I don't see anything in the shown snippet that would cause a language server crash, so I imagine the server is crashing on something off screen.

I could understand them showing off crash recovery by using code deliberately written to crash the language server, and so not being something you can "fix".

comment 1w ago · link · parent

> > Finding the company had accessed Android users' photographs and videos without obtaining their consent or informing them.

> I think it's clear consent was given at some point

That's not what was found. I don't know the facts of the case, but it's possible that "consent" mechanisms were found to be insufficient. As an example, if you ask for permission for one purpose, then use it for another, that would probably not meet the "inform users" bar.

comment 1w ago · link · parent

And it sounds like the fault conditions only occur when you do scale up.

comment 1w ago · link · parent

And then you have the common reality: "a piece of code has been working in production with known faults & known costs". And you have to weigh up costs and risks.

comment 1w ago · link · parent

Sure hope they're not writing the safety cutoffs as well. Some of those systems do not take kindly to bad control inputs, and determining if a controlled system is stable can be absurdly hard.

comment 1w ago · link · parent

The faster you are, the more systems you're able to control directly. At ~30ms per "choice"/output, you can choose what lower level motors/servos/systems drive towards, but you can't generate the signals that drive them. You're looking at 1kHz and maybe higher there.

comment 1w ago · link · parent

I don't remember Commander Keen using Nintendo/Mario art assets either though.
12345
38