Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

block not-script put several NUL characters in physical-device-path xenstore entry #8708

Closed
marmarek opened this issue Nov 13, 2023 · 0 comments · Fixed by QubesOS/qubes-linux-utils#107
Labels
affects-4.2 This issue affects Qubes OS 4.2. C: core diagnosed Technical diagnosis has been performed (see issue comments). P: default Priority: default. Default priority for new issues, to be replaced given sufficient information. pr submitted A pull request has been submitted for this issue. T: bug Type: bug report. A problem or defect resulting in unintended behavior in something that exists.
Milestone

Comments

@marmarek
Copy link
Member

How to file a helpful issue

Qubes OS release

R4.2

Brief summary

xenstore physical-device-path entry includes NUL bytes, it shouldn't.

Steps to reproduce

  1. Start a qube
  2. List xenstore entries xenstore-ls -fp |grep physical-device-path

Expected behavior

/local/domain/0/backend/vbd/55/51760/physical-device-path = "/dev/loop7"   (n0,r55)

Actual behavior

Some physical-device-path have NUL bytes (looks like all related to modules.img)

/local/domain/0/backend/vbd/55/51760/physical-device-path = "/dev/loop7\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"   (n0,r55)

My guess is this part:

https://github.com/QubesOS/qubes-linux-utils/blob/96698e24834d7e5d11ffff8648853ce53e721587/not-script/not-script.c#L489-L494

    if (major(dev) == LOOP_MAJOR) {
        if ((unsigned)snprintf(buf, sizeof buf, "/dev/loop%" PRIu32,
                               (unsigned)minor(dev)) >= sizeof buf)
            abort();
        physdev_path = buf;
    }

It updates physdev_path, but not path_len.

@marmarek marmarek added T: bug Type: bug report. A problem or defect resulting in unintended behavior in something that exists. C: core P: default Priority: default. Default priority for new issues, to be replaced given sufficient information. affects-4.2 This issue affects Qubes OS 4.2. labels Nov 13, 2023
@andrewdavidwong andrewdavidwong added diagnosed Technical diagnosis has been performed (see issue comments). pr submitted A pull request has been submitted for this issue. labels Nov 13, 2023
@andrewdavidwong andrewdavidwong added this to the Release 4.2 milestone Dec 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects-4.2 This issue affects Qubes OS 4.2. C: core diagnosed Technical diagnosis has been performed (see issue comments). P: default Priority: default. Default priority for new issues, to be replaced given sufficient information. pr submitted A pull request has been submitted for this issue. T: bug Type: bug report. A problem or defect resulting in unintended behavior in something that exists.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants