USB: Solving path traversal issue in USB HAL AppendNodeMapper

Currently the string comes from the HIDL interface and
attackers can access this HAL via HWBinder once escalated
they can cause this path traversal by sending any string
such as "../../../data/local/temp". In this patch, a condition
is added that looks specifically for '/' & '..' and returns a
empty string if it is found otherwise string will be append to
"/sys/class/typec/" to map the portName we receive from HIDL interface.

Change-Id: Id9c6cd0fc2360da5ffe31dbecc2bf4978b085b58
1 file changed
tree: e8f74559cdd5619e93c56cb801fdfcde83a63ec4
  1. etc/
  2. hal/
  3. vendor_product.mk