It is infact the SMF that assigns the IP address to the UE during PDU session establishment. However, SMF and UE cannot communicate directly. All the UE signalling to the core network is with/or via AMF. So SMF uses 5G Session Management (5GSM) protocol to assign the IP address to UE via AMF.