Better HN
topnewbestaskshowjobs
Log inSign up

bkallus

827 karma · joined Sep 1, 2020 (6y ago) · 119 submissions

https://kallus.org
Submissions

comment 1w ago · link · parent

I just set up an Apache a couple days ago. I had an old PHP site that used mod_auth_cas, and I needed to migrate to OIDC. The site was running on Nginx, but Nginx's OIDC module only works on Nginx+. There's a free OIDC module for Apache, so I switched. Wasn't hard.

Also, Nginx's maintainers are weird about standards. e.g., last time I checked, tabs in header field line whitespace were rejected by the Nginx parser, even though the RFC says to allow it. The maintainers at the time didn't care and wouldn't fix, reasoning that Nginx had been behaving this way for so long that anything sending tabs in header field lines would have stopped by now. I don't love that attitude.

Apache is way better in this regard. (Though I think Nginx may have cleaned up its act recently?)

comment 2w ago · link · parent

> The good malloc impls (jemalloc, mimalloc) don't do this.

I agree.

> This is mostly describing a kind of obsolete allocator

I disagree. glibc malloc is still extremely relevant and sees a lot of development, and uses exactly this strategy (unless an allocation request is too big, in which case it mmaps, just like the allocator described in the article).

comment 3w ago · link · parent

According to [1], the kernel has flip-flopped a few times on this, but the original behavior was to ignore the upper 32 bits.

[1] https://lore.kernel.org/all/20210518191303.4135296-5-hpa@zyt...

comment 3w ago · link · parent

On x86_64 and x32, the syscall number goes in eax, not rax. The upper 32 bits of rax are ignored and can be anything.

comment 1mo ago · link · parent

> Don't ask me which

There are many. Two big ones are Alpha and PA-RISC. NetBSD and Linux continue to support both. Linux distro choices are pretty much limited to Gentoo though.

comment 2mo ago · link · parent

I lent Greg a Minivac 601 for a week or so last month. He returned it in a big zippered bag, which I stole because it was pouring rain and I needed to bring the Minivac back to my car.

I was going to return it at the MIT swapfest in a week, but I think he can't make it anymore. Sorry Greg!

comment 4mo ago · link · parent

I have seen it firsthand in the CS department here at Dartmouth. It is bad.

We're currently designing a new intro systems curriculum, and we're thinking of it as an adversarial problem. That is, we're designing the course to ensure that a student optimizing for the best grade per unit work still meets our learning objectives. That means, as everyone else is saying, paper exams, but also 1-on-1 interviews to check that students understand each assignment they turn in. These interviews feature both factual questions ("You're using this macro from that library. What does it do?", "Please describe what this function does and how it works.") and conceptual questions ("Why is this code structured this way instead of $whatever?", "How else did you try solving this?", etc.) This doesn't stop students from generating code, but at least they have to understand that code in detail.

This is not as good as writing the code yourself, but how much worse is it? For math classes, this gap is gigantic. Obviously, understanding someone else's proof is much easier than writing your own. For programming classes, I think (without evidence) that the gap is somewhat smaller.

My experience from the past is that when this kind of evaluation is made clear up front, the students know what to expect and either do fine or drop the class in the first week. If you start with take-home exams and then spring paper exams on them halfway through the course, then half the class is cheating and won't be able to recover, as we read in the article.

In general, our students are somewhat motivated by an abstract desire to learn, but are much more motivated by grades. If there exists a straightforward path through your course that leads to a good grade without doing much work, most students will take it. (Our undergrads' course review website is literally called "Layup List." They are actually this shameless.) It's our job as instructors to ensure that all paths leading to a good grade either require learning the material or are more difficult to pull off than just learning the material.

It's best not to blame the students. They are good at optimizing metrics; that's how they ended up here in the first place. We just need to better align the evaluation metrics with the outcomes that we're looking for.

8.

Weird Design Choices in HPACK Strings(kallus.org ↗)

2 points · by bkallus · 5mo ago · discuss

comment 6mo ago · link · parent

> the OpenBSD project has not been very receptive in the past for bug reports, my sense of “this is probably fine, in practice”, and that if OpenBSD wants to weed out UB from their code base, then that’s a major project that should be done in a better way than me just being the middle man between the LLM and them for a patch here and there.

Part of the reason for all the UB in OpenBSD is that UBSan doesn't run on that platform. When I ported OpenBSD's httpd to Linux, I found that UBSan tripped before the server even came up because the config flag parsing shifts into the MSB of a signed integer.

I tried to contribute back a patch (just make the flag bitfield unsigned), but it was ignored. I think if UBSan ran natively on OpenBSD, then there would be a lot more of these patches, and the maintainers would have to take an official stance on whether they think these bugs matter.

10.

How cross-thread double free detection could work in glibc malloc(kallus.org ↗)

3 points · by bkallus · 8mo ago · discuss

comment 11mo ago · link · parent

I hope he ends up covering integer division by constants. The chapter on this in Hacker's Delight is really good but a little dense for casual readers.

comment 1y ago · link · parent

ABISan. Think of it like UBSan, but for assembly.

It's a custom assembler built on top of the LLVM assembler (llvm-mc) that emits instrumentation code to catch ABI violations at runtime. Stuff like clobbering nonvolatile registers, misaligning the stack pointer, misusing the redzone, assuming volatile registers don't change across a function call, etc.

Hoping to finish up basic x86_64 support within the next few days. I can now reliably assemble and run unoptimized gcc output without hitting false positives, but I still have to iron out some false positives triggered by OpenSSL's handwritten assembly routines.

TODO items for the near future include porting the runtime support library into a kernel module so I can instrument Linux, and beginning ports other architectures (ideally something semi-obscure like POWER or RISC-V). I also need to figure out how to support dynamic linking, because the tool currently needs static linking to access its thread-local variables.

https://github.com/kenballus/llvm-project/tree/abisan/llvm/t...

13.

Bash Username $PS1 Command Injection(kallus.org ↗)

2 points · by bkallus · 1y ago · 1 comment

14.

x86_64 Syscall Numbers Go Where?(kallus.org ↗)

3 points · by bkallus · 1y ago · discuss

comment 1y ago · link · parent

Cache poisoning is also possible.

See https://youtu.be/aKPAX00ft5s?feature=shared&t=8730 for a relevant demo.

You can also (in principle) steal responses intended for other clients, and control responses that get delivered to other clients.

comment 1y ago · link · parent

I have been working on this :)

https://github.com/narfindustries/http-garden

comment 1y ago · link · parent

We encourage students to use their own machines. We even loan out old ThinkPads and MacBooks for students to run Linux on. Very few (3-5 per term) take us up on this offer. Most of our students would rather we do the sysadmin stuff for them.

The only requirement is that the code needs to run on our server, which they can easily check before submission.

comment 1y ago · link · parent

Learning to use a real SSH client is part of the curriculum. If they graduate without this knowledge, we have failed as teachers.

comment 1y ago · link · parent

I too have these fond memories, and I enjoy passing it on to the next generation :)

comment 1y ago · link · parent

SSH is a fundamental protocol. If students can get through our program without learning what SSH is and how to use it, that's a problem.

comment 1y ago · link · parent

I ran the servers for our networks, binary exploitation, and intro systems programming classes, and this thing is a major annoyance. It is because of this stupid RAT that students do not understand how to use the OpenSSH client.

I've tried a few things to fix this: 1., I set a motd on our class servers asking the students not to use the VSCode remote server plugin. 2. I ran `ncdu /home` in front of the class and demonstrated how, without exception, everyone with >100MB of disk usage on the class server was a VSCode user. 3. I set a user process limit of 45, because the VSCode RAT (somehow) uses ~50 Node processes. When students inevitably ignored the motd and the in-class warning, they hit the process cap and had to ask us to kill their processes in order to get back onto the system. 4. I replaced the process limit with a script that kills all the .vscode-server RATs every 10 seconds.

comment 1y ago · link · parent

I went with SIGINT because it's more fun to press ctrl-c than to pgrep and kill. If you'd rather use SIGUSR1, just change SIGINT to SIGUSR1 line 654.

23.

Show HN: Heap Explorer(github.com ↗)

73 points · by bkallus · 1y ago · 5 comments

comment 2y ago · link · parent

My experience participating in Google's program has been pretty good. The reward money is a nice supplement to my grad student stipend. I got a free trip to DEFCON out of it, too.

comment 2y ago · link · parent

Search for local tech-oriented flea markets. If you're in the Boston area, this is a good one: https://w1mx.mit.edu/flea-at-mit/

comment 2y ago · link · parent

This almost entirely skips the role of the dynamic linker, which is arguably the true entry point of the program.

If you are interested in that argument, see https://gist.github.com/kenballus/c7eff5db56aa8e4810d39021b2....

comment 2y ago · link · parent

Yuzu is free software, so its source code is already available: https://github.com/yuzu-emu/yuzu
1234