GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Remove accesses to private field bio->num · Issue #864 · netty/netty-tcnative

Remove accesses to private field bio->num #864

New issue
Copy link
New issue
Copy link
Closed
#865
Closed
Remove accesses to private field bio->num#864
#865
Copy link
Milestone
2.0.66.Final

Description

@davidben
davidben
opened on Mar 25, 2024
Issue body actions

It looks like #731 added access to the private bio->num field in netty-tcnative. As documented, BIO is a private struct. We hadn't gotten around to making it opaque at the time, but we will do so in the future.

Looking at the PR, this change is totally incoherent. A bytebuffer BIO doesn't use the file descriptor in the first place!

It seems this was done to be compatible with some code that reaches into internal structures and tries to grab the rbio output, and the further peeks around there to pull a file descriptor out of bio->num.
https://github.com/pixie-io/pixie/blob/294d3f36214dece583dd499ebd578cecb7cc7425/src/stirling/source_connectors/socket_tracer/bcc_bpf/openssl_trace.c#L59-L78

This is broken for many, many reasons. First, these offsets are not part of BoringSSL (or OpenSSL's) public API and thus digging into offsets like this is not supported. Second, in both OpenSSL and BoringSSL, there is no guarantee that rbio is based on file descriptors. Indeed, in netty-tcnative, they are not.

As this kind of thing is not remotely supported by BoringSSL, we won't take it into account when making changes, namely hiding BIO and adjusting offsets. We do have a few more things to clear before making BIO opaque, so your build is not in immediate danger of breaking, but it will happen eventually.

Please revert #731, or at least remove BoringSSL from the ifdefs. (I imagine bioSetFd can't be removed due to API stability reasons, but I recommend turning it into a no-op.)

Activity

  1. davidben commented on Mar 25, 2024

    @davidben
    davidben
    on Mar 25, 2024
    ContributorAuthor
    More actions

    BTW if you all really need to support this thing, you can stash the fd, well, just about anywhere else. :-) There are no end of APIs to stick data onto things. For instance, you could have allocated some data and used BIO_set_data.

    Of course, the design of this tool seems fundamentally unsupportable since it reaches into internal structs, but if you don't mind that tool potentially breaking on every update, I suppose that fine. But accessing bio->num will result in it breaking for everyone later.

  2. normanmaurer commented on Mar 26, 2024

    @normanmaurer
    normanmaurer
    on Mar 26, 2024
    Member
    More actions

    Will have a look

  3. normanmaurer
    added this to the 2.0.66.Final milestone on Mar 26, 2024
  4. normanmaurer
    added a commit that references this issue on Mar 27, 2024

    Deprecate bioSetFd and make it a no op

    46626a4
  5. normanmaurer
    closed this as completedin #865on Mar 27, 2024
  6. normanmaurer
    added a commit that references this issue on Mar 27, 2024

    Deprecate bioSetFd and make it a no op (#865)

    4e93eba
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      • 2.0.66.Final

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402775 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.