惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

T
The Exploit Database - CXSecurity.com
J
Java Code Geeks
H
Help Net Security
B
Blog RSS Feed
G
Google Developers Blog
博客园 - 司徒正美
MongoDB | Blog
MongoDB | Blog
量子位
博客园 - 三生石上(FineUI控件)
The Cloudflare Blog
P
Proofpoint News Feed
小众软件
小众软件
人人都是产品经理
人人都是产品经理
云风的 BLOG
云风的 BLOG
V
V2EX
月光博客
月光博客
C
Check Point Blog
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
A
Arctic Wolf
Help Net Security
Help Net Security
Schneier on Security
Schneier on Security
D
DataBreaches.Net
酷 壳 – CoolShell
酷 壳 – CoolShell
博客园_首页
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
P
Palo Alto Networks Blog
T
Tenable Blog
L
LangChain Blog
Attack and Defense Labs
Attack and Defense Labs
Google DeepMind News
Google DeepMind News
N
News and Events Feed by Topic
Forbes - Security
Forbes - Security
F
Fortinet All Blogs
Recent Announcements
Recent Announcements
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
大猫的无限游戏
大猫的无限游戏
www.infosecurity-magazine.com
www.infosecurity-magazine.com
Y
Y Combinator Blog
WordPress大学
WordPress大学
Stack Overflow Blog
Stack Overflow Blog
V
Visual Studio Blog
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Engineering at Meta
Engineering at Meta
NISL@THU
NISL@THU
GbyAI
GbyAI
博客园 - Franky
S
Secure Thoughts
有赞技术团队
有赞技术团队
PCI Perspectives
PCI Perspectives
U
Unit 42

LWN.net comments

tcmalloc's weird hack [LWN.net] Fixed? [LWN.net] mpd [LWN.net] Userspace AX.25 [LWN.net] RIP [LWN.net] My two cents... [LWN.net] pipx [LWN.net] Tragedy [LWN.net] A young man destined for glory [LWN.net] And 'less' won't let you search [LWN.net] A great loss [LWN.net] Sad and shocking news [LWN.net] Easy migration from Clementine [LWN.net] Sad coincidence [LWN.net] GNOME is actually usable thanks to Seth et al [LWN.net] Sad news :( [LWN.net] armhf supports preempt_rt [LWN.net] MusicBrainz accurracy [LWN.net] On open source maintainership [LWN.net] Let's stop here [LWN.net] Not a new thing [LWN.net] uv is indeed great pgmoneta Some comments on this on a Postgres blog feed [LWN.net] uv [LWN.net] going to Debian [LWN.net] Upgrading 64-bit-capable systems to 64-bit kernels? [LWN.net] Free Software foundations Maintainers can wait for code review but not for publish review? A reasonably extreme point of view [LWN.net] Maintaining old code Varieties of filesystems and schedulers, so why not for IPC mechanisms too? [LWN.net] AI and documentation [LWN.net] Delegating the work to a subsidiary [LWN.net] Maybe they should provide their reviews to the world [LWN.net] Something can be a bug but not a vulnerability [LWN.net] History is a little backwards ... [LWN.net] A reasonably extreme point of view [LWN.net] Let’s stop here [LWN.net] authd [LWN.net] Suggestion for bug report [LWN.net] Software pain points for long-term equipment [LWN.net] Wrong direction [LWN.net] mjg59 has lost the plot there [LWN.net] Role of German law in this? [LWN.net] Without beer? [LWN.net] Feels soul destroying [LWN.net] No zswap in Debian cloud kernel [LWN.net] No Beer?!? [LWN.net] The other fam [LWN.net] Thank you Andrew [LWN.net] Brave! [LWN.net] I second the cost factor [LWN.net] cassandra [LWN.net] Proprietary tools [LWN.net] familiar [LWN.net] ... is also staging. [LWN.net] Python package managers [LWN.net] Pour one out for AX.25... [LWN.net] tun/tap? [LWN.net] Another article at gnulinux.ch [LWN.net] Transitive checks [LWN.net] Just execute from stdin [LWN.net] Cross-compile Vacation [LWN.net] Concrete steps toward RFC 3550 (new Range types) You can rip with Windows apps too! Have the tempfile issues raised in the release notes been fixed? onlyoffice tried to add stuff in the fine print, and failed Work w/o publication is not science Removing art like offensive fortunes is a mistake. [LWN.net] De-googling (was Wtf) [LWN.net] I liked pdfmark [LWN.net] Juice then tag [LWN.net] why did PREEMPT_LAZY caused more preemptions than PREEMPT_NONE with THP disabled? [LWN.net] x86-64 was first introduced in 2003 [LWN.net] no memory safety? [LWN.net] False positive identification rate [LWN.net] "Defensive" AI use [LWN.net] LTS release? [LWN.net] ironic (ugly, good) [LWN.net] Moving away from LLVM [LWN.net] ironic (ugly, good) [LWN.net] Abandoning vim(1) ASAP [LWN.net] "Picard" naming [LWN.net] circular reasoning is a potential source of unsoundness [LWN.net] Nice to see an update [LWN.net] Writable THPs [LWN.net] Whole network messages [LWN.net] I'll fix my code ... [LWN.net] Can also recommend beets [LWN.net] Jack the CD ripper [LWN.net] How about the bad CDs? [LWN.net] systemd-boot [LWN.net] Significant raise of reports [LWN.net] IMO, it's appropriate [LWN.net] How about the bad CDs? [LWN.net] Update to include Part 4? [LWN.net] Pandoc also is invauable for a cheap-and-dirty retrieval augmented generation. [LWN.net] Whole network messages [LWN.net]
Why does x32 need kernel support? [LWN.net]
linuxrocks12 · 2026-06-02 · via LWN.net comments

Why does x32 need kernel support?

Posted Jun 1, 2026 17:49 UTC (Mon) by linuxrocks123 (subscriber, #34648)
In reply to: Why does x32 need kernel support? by corbet
Parent article: Reconsidering x32 — again
to post comments

Why does x32 need kernel support?

Posted Jun 3, 2026 3:30 UTC (Wed) by jrtc27 (subscriber, #107748) [Link]

Eh, not really. Consider readv as specified by POSIX:

ssize_t readv(int fildes, const struct iovec *iov, int iovcnt);

where POSIX specifies that struct iovec has at least the following members:

void   *iov_base  Base address of a memory region for input or output.
size_t  iov_len   The size of the memory pointed to by iov_base.

That unambiguously states that typeof/sizeof/alignof(((struct iovec *)0)->iov_base/len) are that of void */size_t, not my_magic_64_but_32_ptr/my_magic_64_but_32_size_t. But yet they need to do something special. Now maybe you do some horrible thing where you pretend to C that they're the 32-bit types, but really under the hood they end up as the 64-bit ones, and pray people aren't doing things using those types (e.g. typedef typeof(((struct iovec *)0)->iov_base) my_void_ptr; my_void_ptr *p = malloc(sizeof(my_void_ptr)); *p = ... would presumably get very out-of-bounds-y very quickly, but by the letter of POSIX should be completely legal).

Maybe though in practice that's all ok, and you even go as far as making sure they're magic for the purposes of C++ overloading, templates, name mangling, etc., so you can't tell they're not the 32-bit ones. But then msgsnd and msgrcv (NB: *not* the more typical sendmsg and recvmsg) come along and make everyone even sadder. Take msgsnd for example (msgrcv is the same fundamental API); POSIX defines it like so:

int msgsnd(int msqid, const void *msgp, size_t msgsz, int msgflg);

where it has this to say:

The application shall ensure that the argument msgp points to a user-defined buffer that contains first a field of type long specifying the type of the message, and then a data portion that holds the data bytes of the message. The structure below is an example of what this user-defined buffer might look like:

struct mymsg {
    long   mtype;       /* Message type. */
    char   mtext[1];    /* Message text. */
}

There's no fudging with magic types in system headers you can do to get around this one. As a programmer POSIX says you are the one who has to write the type of the first field as long, in a structure passed to the kernel. So you really are stuck with having the kernel know to differentiate x32 from standard x86_64.

Also mmap and things like shmat need to return pointers in the first 4 GiB of the address space, but I suppose implicitly adding MAP_32BIT to every request for certain processes isn't as heavyweight as having separate types floating around.

As for why I know this? Because Linux got it wrong and used the 64-bit syscall msgsnd/msgrcv. It broke fakeroot on x32, I went down the rabbit hole, and submitted https://lore.kernel.org/all/20201012014837.14305-1-jrtc27@jrtc27.com/ to fix it. Seems that never got merged in the end though so it's still broken... just shows you how little x32 and/or those APIs are used.