Skip to content

Commit 5282d6e

Browse files
committed
feat: security: Add docs explaining Firewall Exceptions
Add a document to explain when a firewall exception occurs and how to trigger it on purpose, and how to interpret it. Signed-off-by: Suhaas Joshi <s-joshi@ti.com>
1 parent 90f8bce commit 5282d6e

8 files changed

Lines changed: 126 additions & 0 deletions

File tree

configs/AM62AX/AM62AX_linux_toc.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ linux/Foundational_Components/Power_Management/pm_debug
9797
linux/Foundational_Components/System_Security/Security_overview
9898
linux/Foundational_Components/System_Security/SELinux
9999
linux/Foundational_Components/System_Security/Auth_boot
100+
linux/Foundational_Components/System_Security/Firewall_Exception
100101

101102
linux/Foundational_Components_Kernel_Users_Guide
102103
linux/Foundational_Components_Kernel_LTP-DDT_Validation

configs/AM62LX/AM62LX_linux_toc.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ linux/Foundational_Components/Power_Management/pm_am62lx_debug
8383
linux/Foundational_Components/System_Security/Security_overview
8484
#linux/Foundational_Components/System_Security/SELinux
8585
linux/Foundational_Components/System_Security/Auth_boot
86+
linux/Foundational_Components/System_Security/Firewall_Exception
8687

8788
linux/Foundational_Components_Kernel_Users_Guide
8889
linux/Foundational_Components_Kernel_LTP-DDT_Validation

configs/AM62PX/AM62PX_linux_toc.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ linux/Foundational_Components/Power_Management/pm_debug
102102
linux/Foundational_Components/System_Security/Security_overview
103103
linux/Foundational_Components/System_Security/SELinux
104104
linux/Foundational_Components/System_Security/Auth_boot
105+
linux/Foundational_Components/System_Security/Firewall_Exception
105106

106107
linux/Foundational_Components_Kernel_Users_Guide
107108
linux/Foundational_Components_Kernel_LTP-DDT_Validation

configs/AM62X/AM62X_linux_toc.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ linux/Foundational_Components/Power_Management/pm_debug
9999
linux/Foundational_Components/System_Security/Security_overview
100100
linux/Foundational_Components/System_Security/SELinux
101101
linux/Foundational_Components/System_Security/Auth_boot
102+
linux/Foundational_Components/System_Security/Firewall_Exception
102103

103104
linux/Foundational_Components_PRU_Subsystem
104105
linux/Foundational_Components/PRU-ICSS-Linux-Drivers

configs/AM64X/AM64X_linux_toc.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ linux/Foundational_Components_Kernel_LTP-DDT_Validation
8484
linux/Foundational_Components_Kernel_FAQs
8585
linux/Foundational_Components_Security
8686
linux/Foundational_Components/System_Security/Security_overview
87+
linux/Foundational_Components/System_Security/Firewall_Exception
8788
linux/Foundational_Components_Machine_Learning
8889
linux/Foundational_Components/Machine_Learning/arm_compute_library
8990
linux/Foundational_Components/Machine_Learning/armnn
Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
.. _firewall-exception:
2+
3+
******************
4+
Firewall Exception
5+
******************
6+
7+
Overview
8+
========
9+
10+
TI System-on-Chips (SoCs) use hardware-backed firewalls to enforce
11+
access control. Texas Instruments Foundational Security (TIFS)
12+
configures these firewalls to restrict which components can access
13+
specific regions of device-mapped memory. Other components such as
14+
Open Portable Trusted Execution Environment (OP-TEE), Arm Trusted
15+
Firmware (ATF), Linux, U-Boot, and user-space programs can request TIFS
16+
to configure firewalls on their behalf.
17+
18+
Firewalls can restrict access based on:
19+
20+
* **Core**: A53, R5, M4, etc.
21+
* **Privilege level**: privileged or non-privileged
22+
* **Security state**: secure or non-secure
23+
24+
For example, TIFS might configure a firewall to prevent Linux (running
25+
on A53) from accessing a memory region reserved for the secure world.
26+
27+
For more information about firewalls, see the Technical Reference
28+
Manual (TRM) for the specific SoC, the
29+
`TISCI Firewall API <https://software-dl.ti.com/tisci/esd/latest/2_tisci_msgs/security/firewall_api.html>`__,
30+
and the
31+
`TIFS Firewall FAQ <https://software-dl.ti.com/tisci/esd/latest/6_topic_user_guides/firewall_faq.html>`__.
32+
33+
What Happens During a Firewall Violation
34+
========================================
35+
36+
When software attempts an unauthorized access to a memory region that
37+
a firewall protects, the firewall blocks the access and triggers an
38+
exception. The outcome depends on the type of access:
39+
40+
* **Read access**: The firewall blocks the read. The system continues
41+
running.
42+
* **Write access**: The firewall blocks the write and crashes the
43+
Linux kernel. The system halts.
44+
45+
The kernel crash on write violations stops the offending software
46+
immediately, preventing further unauthorized access attempts.
47+
48+
TIFS logs information about every firewall exception. The rest of this
49+
document explains how to trigger exceptions, enable TIFS logs, access
50+
them, and interpret them.
51+
52+
Triggering a Firewall Exception
53+
===============================
54+
55+
To test firewall behavior, use ``k3conf`` to read from or write to a
56+
protected memory region.
57+
58+
Triggering a read exception:
59+
60+
.. code-block:: console
61+
62+
k3conf read <addr> [<size>]
63+
64+
Triggering a write exception (this will crash the kernel):
65+
66+
.. code-block:: console
67+
68+
k3conf write <addr> <value>
69+
70+
Replace ``<addr>`` with the address of a firewall-protected region,
71+
``<size>`` with the number of bytes to read, and ``<value>`` with the
72+
value to write.
73+
74+
Enabling TIFS Logs
75+
==================
76+
77+
TIFS does not output logs by default. Enabling TIFS logging requires
78+
modifying U-Boot source code, recompiling it, and transferring the new
79+
binaries to the boot partition.
80+
81+
Modify U-Boot Configuration
82+
---------------------------
83+
84+
Open :file:`board/ti/<soc_name>/board-cfg.yaml` in the U-Boot source
85+
tree. Locate ``trace_dst_enables`` and ``trace_src_enables``, which
86+
U-Boot sets to ``0x0`` by default. Change these values as follows:
87+
88+
* ``trace_dst_enables``: change from ``0x0`` to ``0xD``
89+
* ``trace_src_enables``: change from ``0x0`` to ``0x3F``
90+
91+
Build and Deploy U-Boot
92+
-----------------------
93+
94+
After making these changes, compile U-Boot and transfer the resulting
95+
binaries to the board's boot partition. See
96+
:ref:`u-boot-build-guide-build-k3` for build instructions.
97+
98+
Accessing TIFS Logs
99+
===================
100+
101+
TIFS outputs logs to a separate serial port from the Linux console.
102+
If the Linux command line appears on :file:`/dev/ttyUSB0`, TIFS logs
103+
typically appear on :file:`/dev/ttyUSB1`. However, the exact device
104+
assignment depends on the hardware setup and the order in which the
105+
host enumerates USB devices.
106+
107+
Open the TIFS serial port with a terminal program such as minicom or
108+
PuTTY to view the logs.
109+
110+
Interpreting TIFS Logs
111+
======================
112+
113+
For information on interpreting firewall exception logs, see the
114+
`TIFS Firewall FAQ <https://software-dl.ti.com/tisci/esd/latest/6_topic_user_guides/firewall_faq.html#how-do-i-debug-firewall-issues>`__.

source/linux/Foundational_Components/System_Security/Security_overview.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@ The following table lists some of the key Security Features:
6161
| | Trusted Execution Environment that enables isolated | :ref:`foundational-components-optee` |
6262
| | execution of security-sensitive applications and services | |
6363
+-------------------------+-----------------------------------------------------------+--------------------------------------+
64+
| **Firewall Exception** | Debugging hardware firewall violations | :ref:`firewall-exception` |
65+
+-------------------------+-----------------------------------------------------------+--------------------------------------+
6466

6567
.. ifconfig:: CONFIG_part_variant in ('AM62X', 'AM62PX', 'AM62AX')
6668

@@ -83,6 +85,8 @@ The following table lists some of the key Security Features:
8385
| | Trusted Execution Environment that enables isolated | :ref:`foundational-components-optee` |
8486
| | execution of security-sensitive applications and services | |
8587
+-------------------------+-----------------------------------------------------------+--------------------------------------+
88+
| **Firewall Exception** | Debugging hardware firewall violations | :ref:`firewall-exception` |
89+
+-------------------------+-----------------------------------------------------------+--------------------------------------+
8690

8791
.. ifconfig:: CONFIG_part_variant not in ('AM62X', 'AM62PX', 'AM62AX', 'AM62LX')
8892

@@ -99,4 +103,6 @@ The following table lists some of the key Security Features:
99103
| | Trusted Execution Environment that enables isolated | :ref:`foundational-components-optee` |
100104
| | execution of security-sensitive applications and services | |
101105
+-------------------------+-----------------------------------------------------------+--------------------------------------+
106+
| **Firewall Exception** | Debugging hardware firewall violations | :ref:`firewall-exception` |
107+
+-------------------------+-----------------------------------------------------------+--------------------------------------+
102108

source/linux/Foundational_Components_Security.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,4 @@ Security
1212
Foundational_Components_Secure_Boot
1313
Foundational_Components/System_Security/SELinux
1414
Foundational_Components/System_Security/Auth_boot
15+
Foundational_Components/System_Security/Firewall_Exception

0 commit comments

Comments
 (0)