Date: Tue, 03 Nov 2026 11:31:16 -0800
On Tuesday, 3 November 2026 10:48:55 Pacific Standard Time Rainer Deyke via
Std-Proposals wrote:
> > 2b) The correct image size is not known beforehand, but the overall system
> > development group/team should have made sure that only working images are
> > loaded. So it is neither the responsibility of the caller, nor the
> > callee, but of the organisation.
> The program should not make assumptions about its environment (beyond
> "the CPU is working" and "memory bits don't flip randomly"). Correctly
> sized externally stored images can and should be checked, ideally before
> the plane takes off.
Going off into the weeds here, but there are images and there are images.
If the images being handled are all trusted, such as they all having been
installed with the application or found in privileged paths, then some
assumptions about their correctness are acceptable and could be implemented as
preconditions in software. Content that is installed with the application can
be trusted to be as secure as the code itself - if you can't trust the storage
to retain integrity of the images, then you can't trust the storage to retain
integrity of your code or constants in the first place. Heck, the Win32 API
calls the executable format structs "IMAGE_SOMETHING" :-)
If they are not trusted, then things change considerably.
Std-Proposals wrote:
> > 2b) The correct image size is not known beforehand, but the overall system
> > development group/team should have made sure that only working images are
> > loaded. So it is neither the responsibility of the caller, nor the
> > callee, but of the organisation.
> The program should not make assumptions about its environment (beyond
> "the CPU is working" and "memory bits don't flip randomly"). Correctly
> sized externally stored images can and should be checked, ideally before
> the plane takes off.
Going off into the weeds here, but there are images and there are images.
If the images being handled are all trusted, such as they all having been
installed with the application or found in privileged paths, then some
assumptions about their correctness are acceptable and could be implemented as
preconditions in software. Content that is installed with the application can
be trusted to be as secure as the code itself - if you can't trust the storage
to retain integrity of the images, then you can't trust the storage to retain
integrity of your code or constants in the first place. Heck, the Win32 API
calls the executable format structs "IMAGE_SOMETHING" :-)
If they are not trusted, then things change considerably.
-- Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org Principal Engineer - Intel Data Center - Platform & Sys. Eng.
Received on 2026-11-03 19:31:31
