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

core: firewall: add dedicated firewall configuration APIs #6946

Closed
wants to merge 3 commits into from

Conversation

GseoC
Copy link
Contributor

@GseoC GseoC commented Jul 16, 2024

Add dedicated firewall device APIs for handling firewall configurations from the device tree. Firewall configurations are inseparable sets of one or more firewall queries.
These APIs are based on the ".*(?<=)-access-conf$" property. This property will be proposed in the Linux kernel.

While there, remove the check for foreign entities API as it seems unlikely it'll be used.

Edit: Link to kernel patch: https://lkml.org/lkml/2024/7/16/849

Remove firewall checking APIs as the use case for checking a firewall
controller for another entity seems unlikely.

Signed-off-by: Gatien Chevallier <[email protected]>
Add dt_driver_count_devices() to count the number of elements
referring to a provider in a property.

Signed-off-by: Gatien Chevallier <[email protected]>
Add a firewall_conf structure to differentiate individual firewall
queries from firewall configuration that groups inseparable firewall
queries. A firewall configuration is expected to be set as a whole
and could group queries to different firewall controllers.

As a firewall configuration is composed of one or more queries: the
"[conf_name]-access-conf" property relies on the same cells as
"access-controllers".

Signed-off-by: Gatien Chevallier <[email protected]>
Copy link
Contributor

@etienne-lms etienne-lms left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

some nitpicking comments. The overall looks ok to me.

return TEE_ERROR_DEFER_DRIVER_INIT;

prv_cells = dt_driver_provider_cells(prv);
*nb_element += 1;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nitpicking: maybe (*nb_element)++

#include <trace.h>

/* The firewall framework requires device tree support */
static_assert(IS_ENABLED(CFG_DT));

static TEE_Result firewall_get(struct dt_pargs *parg, void *data,
struct firewall_query **out_fw)
struct firewall_query *out_fw)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes in firewall_get()/firewall_dt_get_by_index() deserves a specific commit IMHO.
As for the main change, since it modifies existing firewall_set_configuration(), I think it should be stated in the commit log.

/*
* In case of error, report it to the caller. Note that
* the firewall configurations may be partially loaded. In such
* case, it is the caller responsibility to decide what to do.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This description should be also found in firewall_set_configuration() inline description comment.

@GseoC
Copy link
Contributor Author

GseoC commented Aug 2, 2024

Keep alive (waiting for Linux feedback on the binding)

Copy link

github-actions bot commented Sep 2, 2024

This pull request has been marked as a stale pull request because it has been open (more than) 30 days with no activity. Remove the stale label or add a comment, otherwise this pull request will automatically be closed in 5 days. Note, that you can always re-open a closed issue at any time.

@github-actions github-actions bot added the Stale label Sep 2, 2024
@GseoC
Copy link
Contributor Author

GseoC commented Sep 4, 2024

keep alive

Copy link

github-actions bot commented Oct 5, 2024

This pull request has been marked as a stale pull request because it has been open (more than) 30 days with no activity. Remove the stale label or add a comment, otherwise this pull request will automatically be closed in 5 days. Note, that you can always re-open a closed issue at any time.

@github-actions github-actions bot added the Stale label Oct 5, 2024
@github-actions github-actions bot closed this Oct 10, 2024
intel-lab-lkp pushed a commit to intel-lab-lkp/linux that referenced this pull request Oct 30, 2024
Add a pattern property to allow a device to request an alternate
access rights configuration to one or more firewall controllers.
It allows run-time controller reconfiguration of access rights
to an authorized entity as use in OP-TEE OS [1].

Signed-off-by: Gatien Chevallier <[email protected]>
Link: OP-TEE/optee_os#6946 [1]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants