OSDN Git Service

xfrm/compat: Attach xfrm dumps to 64=>32 bit translator
authorDmitry Safonov <dima@arista.com>
Mon, 21 Sep 2020 14:36:53 +0000 (15:36 +0100)
committerSteffen Klassert <steffen.klassert@secunet.com>
Thu, 24 Sep 2020 06:53:03 +0000 (08:53 +0200)
commit5f3eea6b7e8f58cf5c8a9d4b9679dc19e9e67ba3
treea95b9ecbbd9032044bfcdf9abc5199421b1b4848
parent5461fc0c8d9f23956b99f5907f69726a293ccb67
xfrm/compat: Attach xfrm dumps to 64=>32 bit translator

Currently nlmsg_unicast() is used by functions that dump structures that
can be different in size for compat tasks, see dump_one_state() and
dump_one_policy().

The following nlmsg_unicast() users exist today in xfrm:

         Function                          |    Message can be different
                                           |       in size on compat
-------------------------------------------|------------------------------
    xfrm_get_spdinfo()                     |               N
    xfrm_get_sadinfo()                     |               N
    xfrm_get_sa()                          |               Y
    xfrm_alloc_userspi()                   |               Y
    xfrm_get_policy()                      |               Y
    xfrm_get_ae()                          |               N

Besides, dump_one_state() and dump_one_policy() can be used by filtered
netlink dump for XFRM_MSG_GETSA, XFRM_MSG_GETPOLICY.

Just as for xfrm multicast, allocate frag_list for compat skb journey
down to recvmsg() which will give user the desired skb according to
syscall bitness.

Signed-off-by: Dmitry Safonov <dima@arista.com>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
net/xfrm/xfrm_user.c