gitee.com/mysnapcore/mysnapd@v0.1.0/interfaces/builtin/tee.go (about)

     1  // -*- Mode: Go; indent-tabs-mode: t -*-
     2  
     3  /*
     4   * Copyright (C) 2021 Canonical Ltd
     5   *
     6   * This program is free software: you can redistribute it and/or modify
     7   * it under the terms of the GNU General Public License version 3 as
     8   * published by the Free Software Foundation.
     9   *
    10   * This program is distributed in the hope that it will be useful,
    11   * but WITHOUT ANY WARRANTY; without even the implied warranty of
    12   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    13   * GNU General Public License for more details.
    14   *
    15   * You should have received a copy of the GNU General Public License
    16   * along with this program.  If not, see <http://www.gnu.org/licenses/>.
    17   *
    18   */
    19  
    20  package builtin
    21  
    22  const teeSummary = `allows access to Trusted Execution Environment devices`
    23  
    24  const teeBaseDeclarationSlots = `
    25    tee:
    26      allow-installation:
    27        slot-snap-type:
    28          - core
    29      deny-auto-connection: true
    30  `
    31  
    32  const teeBaseDeclarationPlugs = `
    33    tee:
    34      allow-installation: false
    35      deny-auto-connection: true
    36  `
    37  
    38  const teeConnectedPlugAppArmor = `
    39  # Description: for those who need to talk to the TEE subsystem over
    40  # /dev/tee[0-9]* and/or /dev/teepriv[0-0]*
    41  
    42  /dev/tee[0-9]* rw,
    43  /dev/teepriv[0-9]* rw,
    44  
    45  # Qualcomm equivalent qseecom (Qualcomm Secure Execution Environment Communicator)
    46  /dev/qseecom rw,
    47  `
    48  
    49  var teeConnectedPlugUDev = []string{
    50  	`KERNEL=="tee[0-9]*"`,
    51  	`KERNEL=="teepriv[0-9]*"`,
    52  	`KERNEL=="qseecom"`,
    53  }
    54  
    55  func init() {
    56  	registerIface(&commonInterface{
    57  		name:                  "tee",
    58  		summary:               teeSummary,
    59  		implicitOnCore:        true,
    60  		implicitOnClassic:     true,
    61  		baseDeclarationSlots:  teeBaseDeclarationSlots,
    62  		baseDeclarationPlugs:  teeBaseDeclarationPlugs,
    63  		connectedPlugAppArmor: teeConnectedPlugAppArmor,
    64  		connectedPlugUDev:     teeConnectedPlugUDev,
    65  	})
    66  }