[LNA] Make old LNA permission policy forward compatible [chromium/src : main]

0 views
Skip to first unread message

Chris Thompson (Gerrit)

unread,
Dec 18, 2025, 6:16:24 PM (2 days ago) Dec 18
to Hubert Chao, Chromium LUCI CQ, James Maclean, AyeAye, Chromium Metrics Reviews, chromium...@chromium.org, devtools...@chromium.org, asvitkine...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, devtools-re...@chromium.org, ipc-securi...@chromium.org, network-ser...@chromium.org
Attention needed from Hubert Chao

Chris Thompson added 1 comment

Patchset-level comments
File-level comment, Patchset 4 (Latest):
Chris Thompson . resolved

hchao@ could you PTAL for initial review? Thanks!

Open in Gerrit

Related details

Attention is currently required from:
  • Hubert Chao
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Ifc5a65c350a3621f5f77d2ef0088f54c88378619
Gerrit-Change-Number: 7262373
Gerrit-PatchSet: 4
Gerrit-Owner: Chris Thompson <cth...@chromium.org>
Gerrit-Reviewer: Chris Thompson <cth...@chromium.org>
Gerrit-Reviewer: Hubert Chao <hc...@chromium.org>
Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
Gerrit-CC: James Maclean <wjma...@chromium.org>
Gerrit-Attention: Hubert Chao <hc...@chromium.org>
Gerrit-Comment-Date: Thu, 18 Dec 2025 23:16:14 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Hubert Chao (Gerrit)

unread,
Dec 18, 2025, 7:50:57 PM (2 days ago) Dec 18
to Chris Thompson, Chromium LUCI CQ, James Maclean, AyeAye, Chromium Metrics Reviews, chromium...@chromium.org, devtools...@chromium.org, asvitkine...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, devtools-re...@chromium.org, ipc-securi...@chromium.org, network-ser...@chromium.org
Attention needed from Chris Thompson

Hubert Chao added 4 comments

File services/network/public/cpp/permissions_policy/permissions_policy.cc
Line 439, Patchset 4 (Latest): // Permissions-Policy: local-network-access=(self)
// Permissions-Policy: loopback-network=()
Hubert Chao . unresolved

is it also true that

```
Permissions-Policy: local-network-access=()
Permissions-Policy: loopback-network=(self)
```

would be equivalent to
```
Permissions-Policy: local-network-access=()
Permissions-Policy: loopback-network=()
Permissions-Policy: local-network=()
```

?

Also, I thought you mentioned in the meeting that ordering here matters; does

```
Permissions-Policy: local-network-access=(self)
Permissions-Policy: loopback-network=()
```

still behave differently from

```
Permissions-Policy: loopback-network=()
Permissions-Policy: local-network-access=(self)
```
?

Line 445, Patchset 4 (Latest): if (feature ==
network::mojom::PermissionsPolicyFeature::kLocalNetworkAccess) {
allow_lists_and_reporting_endpoints.allowlists_.emplace(
network::mojom::PermissionsPolicyFeature::kLocalNetwork,
Allowlist::FromDeclaration(parsed_declaration));
allow_lists_and_reporting_endpoints.allowlists_.emplace(
network::mojom::PermissionsPolicyFeature::kLoopbackNetwork,
Allowlist::FromDeclaration(parsed_declaration));
}
Hubert Chao . unresolved

should this be feature-flag guarded? (I think the answer is that its not necessary, but I'm not 100% sure, especially because they are flag-guarded in services/network/public/cpp/permissions_policy/permissions_policy_features.json5)

Line 652, Patchset 4 (Latest): // allow="local-network-access; local-network 'none';"
Hubert Chao . unresolved

Is it worth calling out that

`allow="local-network-access none; local-network;"`

will still result in `local-network` being enabled?

(at least I think that's what would happen)

Line 657, Patchset 4 (Latest): if (feature ==
network::mojom::PermissionsPolicyFeature::kLocalNetworkAccess) {
inherited_policies.Add(
network::mojom::PermissionsPolicyFeature::kLocalNetwork);
inherited_policies.Add(
network::mojom::PermissionsPolicyFeature::kLoopbackNetwork);
}
Hubert Chao . unresolved

same question as above (i suspect the answer is the same for both, whatever the answer is)

Open in Gerrit

Related details

Attention is currently required from:
  • Chris Thompson
Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    • requirement is not satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: Ifc5a65c350a3621f5f77d2ef0088f54c88378619
    Gerrit-Change-Number: 7262373
    Gerrit-PatchSet: 4
    Gerrit-Owner: Chris Thompson <cth...@chromium.org>
    Gerrit-Reviewer: Chris Thompson <cth...@chromium.org>
    Gerrit-Reviewer: Hubert Chao <hc...@chromium.org>
    Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
    Gerrit-CC: James Maclean <wjma...@chromium.org>
    Gerrit-Attention: Chris Thompson <cth...@chromium.org>
    Gerrit-Comment-Date: Fri, 19 Dec 2025 00:50:51 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Chris Thompson (Gerrit)

    unread,
    Dec 19, 2025, 12:09:21 AM (yesterday) Dec 19
    to Hubert Chao, Chromium LUCI CQ, James Maclean, AyeAye, Chromium Metrics Reviews, chromium...@chromium.org, devtools...@chromium.org, asvitkine...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, devtools-re...@chromium.org, ipc-securi...@chromium.org, network-ser...@chromium.org
    Attention needed from Hubert Chao

    Chris Thompson added 4 comments

    File services/network/public/cpp/permissions_policy/permissions_policy.cc
    Line 439, Patchset 4: // Permissions-Policy: local-network-access=(self)
    // Permissions-Policy: loopback-network=()
    Hubert Chao . unresolved

    is it also true that

    ```
    Permissions-Policy: local-network-access=()
    Permissions-Policy: loopback-network=(self)
    ```

    would be equivalent to
    ```
    Permissions-Policy: local-network-access=()
    Permissions-Policy: loopback-network=()
    Permissions-Policy: local-network=()
    ```

    ?

    Also, I thought you mentioned in the meeting that ordering here matters; does

    ```
    Permissions-Policy: local-network-access=(self)
    Permissions-Policy: loopback-network=()
    ```

    still behave differently from

    ```
    Permissions-Policy: loopback-network=()
    Permissions-Policy: local-network-access=(self)
    ```
    ?

    Chris Thompson

    First one: Yes. The empty declaration gets copied to the key for "loopback-network" and "local-network" first. Then the explicit `loopback-network` declaration is processed and does not get added because the key is already set in the map.

    Second one: Yes. The first would result in all three being set to self. The second would result in "loopback-network" being set to none, and "local-network-access" and "local-network" being set to self.

    Line 445, Patchset 4: if (feature ==

    network::mojom::PermissionsPolicyFeature::kLocalNetworkAccess) {
    allow_lists_and_reporting_endpoints.allowlists_.emplace(
    network::mojom::PermissionsPolicyFeature::kLocalNetwork,
    Allowlist::FromDeclaration(parsed_declaration));
    allow_lists_and_reporting_endpoints.allowlists_.emplace(
    network::mojom::PermissionsPolicyFeature::kLoopbackNetwork,
    Allowlist::FromDeclaration(parsed_declaration));
    }
    Hubert Chao . resolved

    should this be feature-flag guarded? (I think the answer is that its not necessary, but I'm not 100% sure, especially because they are flag-guarded in services/network/public/cpp/permissions_policy/permissions_policy_features.json5)

    Chris Thompson

    Yeah good idea to guard this (and the block in CreateFromParentPolicy()), since I can't convince myself that it isn't necessary either (these reference the Mojo enums which exist regardless of the depends_on state, but there might be some weird interaction if these are out of sync). Done.

    Line 652, Patchset 4: // allow="local-network-access; local-network 'none';"
    Hubert Chao . resolved

    Is it worth calling out that

    `allow="local-network-access none; local-network;"`

    will still result in `local-network` being enabled?

    (at least I think that's what would happen)

    Chris Thompson

    Yeah that's a good idea, since it is a subtlety of iframe allowlists. (And I added another unit test for this case.)

    Line 657, Patchset 4: if (feature ==

    network::mojom::PermissionsPolicyFeature::kLocalNetworkAccess) {
    inherited_policies.Add(
    network::mojom::PermissionsPolicyFeature::kLocalNetwork);
    inherited_policies.Add(
    network::mojom::PermissionsPolicyFeature::kLoopbackNetwork);
    }
    Hubert Chao . resolved

    same question as above (i suspect the answer is the same for both, whatever the answer is)

    Chris Thompson

    Done

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Hubert Chao
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    • requirement is not satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: Ifc5a65c350a3621f5f77d2ef0088f54c88378619
    Gerrit-Change-Number: 7262373
    Gerrit-PatchSet: 4
    Gerrit-Owner: Chris Thompson <cth...@chromium.org>
    Gerrit-Reviewer: Chris Thompson <cth...@chromium.org>
    Gerrit-Reviewer: Hubert Chao <hc...@chromium.org>
    Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
    Gerrit-CC: James Maclean <wjma...@chromium.org>
    Gerrit-Attention: Hubert Chao <hc...@chromium.org>
    Gerrit-Comment-Date: Fri, 19 Dec 2025 05:09:07 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Hubert Chao <hc...@chromium.org>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Hubert Chao (Gerrit)

    unread,
    Dec 19, 2025, 12:59:39 PM (16 hours ago) Dec 19
    to Chris Thompson, Chromium LUCI CQ, James Maclean, AyeAye, Chromium Metrics Reviews, chromium...@chromium.org, devtools...@chromium.org, asvitkine...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, devtools-re...@chromium.org, ipc-securi...@chromium.org, network-ser...@chromium.org
    Attention needed from Chris Thompson

    Hubert Chao voted and added 1 comment

    Votes added by Hubert Chao

    Code-Review+1

    1 comment

    File services/network/public/cpp/permissions_policy/permissions_policy.cc
    Line 439, Patchset 4: // Permissions-Policy: local-network-access=(self)
    // Permissions-Policy: loopback-network=()
    Hubert Chao . unresolved

    is it also true that

    ```
    Permissions-Policy: local-network-access=()
    Permissions-Policy: loopback-network=(self)
    ```

    would be equivalent to
    ```
    Permissions-Policy: local-network-access=()
    Permissions-Policy: loopback-network=()
    Permissions-Policy: local-network=()
    ```

    ?

    Also, I thought you mentioned in the meeting that ordering here matters; does

    ```
    Permissions-Policy: local-network-access=(self)
    Permissions-Policy: loopback-network=()
    ```

    still behave differently from

    ```
    Permissions-Policy: loopback-network=()
    Permissions-Policy: local-network-access=(self)
    ```
    ?

    Chris Thompson

    First one: Yes. The empty declaration gets copied to the key for "loopback-network" and "local-network" first. Then the explicit `loopback-network` declaration is processed and does not get added because the key is already set in the map.

    Second one: Yes. The first would result in all three being set to self. The second would result in "loopback-network" being set to none, and "local-network-access" and "local-network" being set to self.

    Hubert Chao

    is it worth writing down these nuances somewhere (for both the header and the allow attribute)? I'd guess that no matter how much we say "don't use them together" someone is going to and then going to ask why something doesn't work, and writing these nuances might save us investigative time a few months down the line.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Chris Thompson
    Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement is not satisfiedCode-Owners
      • requirement satisfiedCode-Review
      • requirement is not satisfiedNo-Unresolved-Comments
      • requirement satisfiedReview-Enforcement
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: comment
      Gerrit-Project: chromium/src
      Gerrit-Branch: main
      Gerrit-Change-Id: Ifc5a65c350a3621f5f77d2ef0088f54c88378619
      Gerrit-Change-Number: 7262373
      Gerrit-PatchSet: 5
      Gerrit-Owner: Chris Thompson <cth...@chromium.org>
      Gerrit-Reviewer: Chris Thompson <cth...@chromium.org>
      Gerrit-Reviewer: Hubert Chao <hc...@chromium.org>
      Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
      Gerrit-CC: James Maclean <wjma...@chromium.org>
      Gerrit-Attention: Chris Thompson <cth...@chromium.org>
      Gerrit-Comment-Date: Fri, 19 Dec 2025 17:59:33 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: Yes
      Comment-In-Reply-To: Chris Thompson <cth...@chromium.org>
      Comment-In-Reply-To: Hubert Chao <hc...@chromium.org>
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Chris Thompson (Gerrit)

      unread,
      Dec 19, 2025, 1:53:59 PM (15 hours ago) Dec 19
      to Hubert Chao, Chromium LUCI CQ, James Maclean, AyeAye, Chromium Metrics Reviews, chromium...@chromium.org, devtools...@chromium.org, asvitkine...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, devtools-re...@chromium.org, ipc-securi...@chromium.org, network-ser...@chromium.org

      Chris Thompson added 2 comments

      File services/network/public/cpp/permissions_policy/permissions_policy.cc
      Line 439, Patchset 4: // Permissions-Policy: local-network-access=(self)
      // Permissions-Policy: loopback-network=()
      Hubert Chao . resolved

      is it also true that

      ```
      Permissions-Policy: local-network-access=()
      Permissions-Policy: loopback-network=(self)
      ```

      would be equivalent to
      ```
      Permissions-Policy: local-network-access=()
      Permissions-Policy: loopback-network=()
      Permissions-Policy: local-network=()
      ```

      ?

      Also, I thought you mentioned in the meeting that ordering here matters; does

      ```
      Permissions-Policy: local-network-access=(self)
      Permissions-Policy: loopback-network=()
      ```

      still behave differently from

      ```
      Permissions-Policy: loopback-network=()
      Permissions-Policy: local-network-access=(self)
      ```
      ?

      Chris Thompson

      First one: Yes. The empty declaration gets copied to the key for "loopback-network" and "local-network" first. Then the explicit `loopback-network` declaration is processed and does not get added because the key is already set in the map.

      Second one: Yes. The first would result in all three being set to self. The second would result in "loopback-network" being set to none, and "local-network-access" and "local-network" being set to self.

      Hubert Chao

      is it worth writing down these nuances somewhere (for both the header and the allow attribute)? I'd guess that no matter how much we say "don't use them together" someone is going to and then going to ask why something doesn't work, and writing these nuances might save us investigative time a few months down the line.

      Chris Thompson

      Fleshed out the comment with these additional examples, which is probably sufficient for posterity. We could also add test cases for these, but meh.

      Line 652, Patchset 4: // allow="local-network-access; local-network 'none';"
      Hubert Chao . resolved

      Is it worth calling out that

      `allow="local-network-access none; local-network;"`

      will still result in `local-network` being enabled?

      (at least I think that's what would happen)

      Chris Thompson

      Yeah that's a good idea, since it is a subtlety of iframe allowlists. (And I added another unit test for this case.)

      Chris Thompson

      (And added a bit to the comment for this case as well.)

      Open in Gerrit

      Related details

      Attention set is empty
      Submit Requirements:
        • requirement satisfiedCode-Coverage
        • requirement is not satisfiedCode-Owners
        • requirement satisfiedCode-Review
        • requirement satisfiedReview-Enforcement
        Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
        Gerrit-MessageType: comment
        Gerrit-Project: chromium/src
        Gerrit-Branch: main
        Gerrit-Change-Id: Ifc5a65c350a3621f5f77d2ef0088f54c88378619
        Gerrit-Change-Number: 7262373
        Gerrit-PatchSet: 5
        Gerrit-Owner: Chris Thompson <cth...@chromium.org>
        Gerrit-Reviewer: Chris Thompson <cth...@chromium.org>
        Gerrit-Reviewer: Hubert Chao <hc...@chromium.org>
        Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
        Gerrit-CC: James Maclean <wjma...@chromium.org>
        Gerrit-Comment-Date: Fri, 19 Dec 2025 18:53:47 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: No
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        Chris Thompson (Gerrit)

        unread,
        Dec 19, 2025, 1:58:21 PM (15 hours ago) Dec 19
        to Ian Clelland, Hubert Chao, Chromium LUCI CQ, James Maclean, AyeAye, Chromium Metrics Reviews, chromium...@chromium.org, devtools...@chromium.org, asvitkine...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, devtools-re...@chromium.org, ipc-securi...@chromium.org, network-ser...@chromium.org
        Attention needed from Ian Clelland

        Chris Thompson added 1 comment

        Patchset-level comments
        File-level comment, Patchset 6 (Latest):
        Chris Thompson . resolved

        iclelland@ could you PTAL as permissions policy owner? This implements the proposed plan from go/split-lna-permission-dd. Thanks!

        Open in Gerrit

        Related details

        Attention is currently required from:
        • Ian Clelland
        Submit Requirements:
        • requirement satisfiedCode-Coverage
        • requirement is not satisfiedCode-Owners
        • requirement satisfiedCode-Review
        • requirement satisfiedReview-Enforcement
        Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
        Gerrit-MessageType: comment
        Gerrit-Project: chromium/src
        Gerrit-Branch: main
        Gerrit-Change-Id: Ifc5a65c350a3621f5f77d2ef0088f54c88378619
        Gerrit-Change-Number: 7262373
        Gerrit-PatchSet: 6
        Gerrit-Owner: Chris Thompson <cth...@chromium.org>
        Gerrit-Reviewer: Chris Thompson <cth...@chromium.org>
        Gerrit-Reviewer: Hubert Chao <hc...@chromium.org>
        Gerrit-Reviewer: Ian Clelland <icle...@chromium.org>
        Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
        Gerrit-CC: James Maclean <wjma...@chromium.org>
        Gerrit-Attention: Ian Clelland <icle...@chromium.org>
        Gerrit-Comment-Date: Fri, 19 Dec 2025 18:58:11 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: No
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy
        Reply all
        Reply to author
        Forward
        0 new messages