Bug 2704 - Avoid passing pointers between processes
Summary: Avoid passing pointers between processes
Status: CLOSED FIXED
Alias: None
Product: Portable OpenSSH
Classification: Unclassified
Component: sshd (show other bugs)
Version: -current
Hardware: Other All
: P5 enhancement
Assignee: Damien Miller
URL:
Keywords:
Depends on:
Blocks: V_7_6
  Show dependency treegraph
 
Reported: 2017-04-06 11:48 AEST by Brooks Davis
Modified: 2021-04-23 15:09 AEST (History)
2 users (show)

See Also:


Attachments
Patch to pass ciphers by name rather than by virtual address (3.20 KB, application/octet-stream)
2017-04-06 11:48 AEST, Brooks Davis
no flags Details
revised diff (1.69 KB, patch)
2017-06-23 13:35 AEST, Damien Miller
dtucker: ok+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Brooks Davis 2017-04-06 11:48:34 AEST
Created attachment 2972 [details]
Patch to pass ciphers by name rather than by virtual address

The newkeys_(from|to)_blob() functions currently pass a pointer to the static cipher structure between processes.  This works as long as pointers are opaque integer data.  With upcoming pointer integrity schemes such as CHERI (which ensures pointer derivations are valid with hardware tags) this no longer works and the pointer is instantiated out of thin air from the perspective of the receiving process.  Given the current structure of the cipher code, it's trivial to pass the name instead as is done in the attached patch.

This change appears to be sufficient to run OpenSSH with hardware enforced memory bounds on CHERI.
Comment 1 Damien Miller 2017-06-23 13:35:58 AEST
Created attachment 2997 [details]
revised diff

enc->name already contains the cipher name, so I don't think it's necessary to pass it again. It probably was on the version that you based your patch on, but we've since removed SSHv1 support and with it all ciphers that were not explicitly identified by name.
Comment 2 Damien Miller 2017-06-24 16:38:31 AEST
Patch applied. This will be in openssh-7.6
Comment 3 Damien Miller 2021-04-23 15:09:59 AEST
closing resolved bugs as of 8.6p1 release