Skip to content

Commit 2c0c4cc

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 2c0c4cc

8 files changed

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

6569
.. ifconfig:: CONFIG_part_variant in ('AM62X', 'AM62PX', 'AM62AX')
6670

@@ -83,6 +87,9 @@ The following table lists some of the key Security Features:
8387
| | Trusted Execution Environment that enables isolated | :ref:`foundational-components-optee` |
8488
| | execution of security-sensitive applications and services | |
8589
+-------------------------+-----------------------------------------------------------+--------------------------------------+
90+
| **Memory Firewalls** | Prevents unauthorized access through hardware-enforced | :ref:`memory-firewalls` |
91+
| | security boundaries | |
92+
+-------------------------+-----------------------------------------------------------+--------------------------------------+
8693

8794
.. ifconfig:: CONFIG_part_variant not in ('AM62X', 'AM62PX', 'AM62AX', 'AM62LX')
8895

@@ -99,4 +106,7 @@ The following table lists some of the key Security Features:
99106
| | Trusted Execution Environment that enables isolated | :ref:`foundational-components-optee` |
100107
| | execution of security-sensitive applications and services | |
101108
+-------------------------+-----------------------------------------------------------+--------------------------------------+
109+
| **Memory Firewalls** | Prevents unauthorized access through hardware-enforced | :ref:`memory-firewalls` |
110+
| | security boundaries | |
111+
+-------------------------+-----------------------------------------------------------+--------------------------------------+
102112

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/Memory_Firewalls

0 commit comments

Comments
 (0)