Lines Matching defs:extack

39 			  struct netlink_ext_ack *extack)
49 NL_SET_ERR_MSG(extack, "Invalid AUTH/CRYPT/COMP attribute length");
60 NL_SET_ERR_MSG(extack, "Invalid algorithm attribute type");
69 struct netlink_ext_ack *extack)
79 NL_SET_ERR_MSG(extack, "Invalid AUTH_TRUNC attribute length");
87 static int verify_aead(struct nlattr **attrs, struct netlink_ext_ack *extack)
97 NL_SET_ERR_MSG(extack, "Invalid AEAD attribute length");
114 static inline int verify_sec_ctx_len(struct nlattr **attrs, struct netlink_ext_ack *extack)
125 NL_SET_ERR_MSG(extack, "Invalid security context length");
134 struct netlink_ext_ack *extack)
141 NL_SET_ERR_MSG(extack, "Missing required attribute for ESN");
150 NL_SET_ERR_MSG(extack, "ESN bitmap length must be <= 128");
156 NL_SET_ERR_MSG(extack, "ESN attribute is too short to fit the full bitmap length");
162 NL_SET_ERR_MSG(extack, "ESN only supported for ESP and AH");
167 NL_SET_ERR_MSG(extack, "ESN not compatible with legacy replay_window");
176 struct netlink_ext_ack *extack)
190 NL_SET_ERR_MSG(extack, "IPv6 support disabled");
195 NL_SET_ERR_MSG(extack, "Invalid address family");
205 NL_SET_ERR_MSG(extack, "Invalid prefix length in selector (must be <= 32 for IPv4)");
214 NL_SET_ERR_MSG(extack, "Invalid prefix length in selector (must be <= 128 for IPv6)");
220 NL_SET_ERR_MSG(extack, "IPv6 support disabled");
226 NL_SET_ERR_MSG(extack, "Invalid address family in selector");
235 NL_SET_ERR_MSG(extack, "Missing required attribute for AH: AUTH_TRUNC or AUTH");
243 NL_SET_ERR_MSG(extack, "Invalid attributes for AH: AEAD, CRYPT, COMP, TFCPAD");
250 NL_SET_ERR_MSG(extack, "Invalid attribute for ESP: COMP");
258 NL_SET_ERR_MSG(extack, "Missing required attribute for ESP: at least one of AUTH, AUTH_TRUNC, CRYPT, AEAD");
266 NL_SET_ERR_MSG(extack, "Invalid attribute combination for ESP: AEAD can't be used with AUTH, AUTH_TRUNC, CRYPT");
272 NL_SET_ERR_MSG(extack, "TFC padding can only be used in tunnel mode");
279 NL_SET_ERR_MSG(extack, "Missing required attribute for COMP: COMP");
288 NL_SET_ERR_MSG(extack, "Invalid attributes for COMP: AEAD, AUTH, AUTH_TRUNC, CRYPT, TFCPAD");
293 NL_SET_ERR_MSG(extack, "SPI is too large for COMP (must be < 0x10000)");
309 NL_SET_ERR_MSG(extack, "Invalid attributes for DSTOPTS/ROUTING");
314 NL_SET_ERR_MSG(extack, "Missing required COADDR attribute for DSTOPTS/ROUTING");
321 NL_SET_ERR_MSG(extack, "Unsupported protocol");
325 if ((err = verify_aead(attrs, extack)))
327 if ((err = verify_auth_trunc(attrs, extack)))
329 if ((err = verify_one_alg(attrs, XFRMA_ALG_AUTH, extack)))
331 if ((err = verify_one_alg(attrs, XFRMA_ALG_CRYPT, extack)))
333 if ((err = verify_one_alg(attrs, XFRMA_ALG_COMP, extack)))
335 if ((err = verify_sec_ctx_len(attrs, extack)))
337 if ((err = verify_replay(p, attrs, extack)))
349 NL_SET_ERR_MSG(extack, "Unsupported mode");
357 NL_SET_ERR_MSG(extack, "MTIMER_THRESH attribute can only be set on ENCAP states");
369 struct nlattr *rta, struct netlink_ext_ack *extack)
381 NL_SET_ERR_MSG(extack, "Requested COMP algorithm not found");
396 struct netlink_ext_ack *extack)
408 NL_SET_ERR_MSG(extack, "Requested CRYPT algorithm not found");
424 struct nlattr *rta, struct netlink_ext_ack *extack)
437 NL_SET_ERR_MSG(extack, "Requested AUTH algorithm not found");
456 struct nlattr *rta, struct netlink_ext_ack *extack)
468 NL_SET_ERR_MSG(extack, "Requested AUTH_TRUNC algorithm not found");
472 NL_SET_ERR_MSG(extack, "Invalid length requested for truncated ICV");
490 struct netlink_ext_ack *extack)
502 NL_SET_ERR_MSG(extack, "Requested AEAD algorithm not found");
519 struct netlink_ext_ack *extack)
533 NL_SET_ERR_MSG(extack, "ESN attribute is too short");
538 NL_SET_ERR_MSG(extack, "New ESN size doesn't match the existing SA's ESN size");
543 NL_SET_ERR_MSG(extack, "New ESN bitmap size doesn't match the existing SA's ESN bitmap");
548 NL_SET_ERR_MSG(extack, "ESN replay window is longer than the bitmap");
683 struct netlink_ext_ack *extack)
710 if ((err = attach_aead(x, attrs[XFRMA_ALG_AEAD], extack)))
713 attrs[XFRMA_ALG_AUTH_TRUNC], extack)))
717 attrs[XFRMA_ALG_AUTH], extack)))
720 if ((err = attach_crypt(x, attrs[XFRMA_ALG_CRYPT], extack)))
724 attrs[XFRMA_ALG_COMP], extack)))
737 err = __xfrm_init_state(x, false, attrs[XFRMA_OFFLOAD_DEV], extack);
757 if ((err = xfrm_init_replay(x, extack)))
767 extack);
783 struct nlattr **attrs, struct netlink_ext_ack *extack)
791 err = verify_newsa_info(p, attrs, extack);
795 x = xfrm_state_construct(net, p, attrs, &err, extack);
862 struct nlattr **attrs, struct netlink_ext_ack *extack)
878 NL_SET_ERR_MSG(extack, "SA is in use by tunnels");
1261 xfrma_policy, cb->extack);
1410 struct netlink_ext_ack *extack)
1421 NL_SET_ERR_MSG(extack, "Invalid SPD_IPV4_HTHRESH attribute length");
1426 NL_SET_ERR_MSG(extack, "Invalid hash threshold (must be <= 32 for IPv4)");
1434 NL_SET_ERR_MSG(extack, "Invalid SPD_IPV6_HTHRESH attribute length");
1439 NL_SET_ERR_MSG(extack, "Invalid hash threshold (must be <= 128 for IPv6)");
1464 struct netlink_ext_ack *extack)
1524 struct netlink_ext_ack *extack)
1544 struct nlattr **attrs, struct netlink_ext_ack *extack)
1569 struct netlink_ext_ack *extack)
1584 err = verify_spi_info(p->info.id.proto, p->min, p->max, extack);
1613 NL_SET_ERR_MSG(extack, "Target ACQUIRE not found");
1617 err = xfrm_alloc_spi(x, p->min, p->max, extack);
1646 static int verify_policy_dir(u8 dir, struct netlink_ext_ack *extack)
1655 NL_SET_ERR_MSG(extack, "Invalid policy direction");
1662 static int verify_policy_type(u8 type, struct netlink_ext_ack *extack)
1672 NL_SET_ERR_MSG(extack, "Invalid policy type");
1680 struct netlink_ext_ack *extack)
1692 NL_SET_ERR_MSG(extack, "Invalid policy share");
1702 NL_SET_ERR_MSG(extack, "Invalid policy action");
1709 NL_SET_ERR_MSG(extack, "Invalid prefix length in selector (must be <= 32 for IPv4)");
1718 NL_SET_ERR_MSG(extack, "Invalid prefix length in selector (must be <= 128 for IPv6)");
1724 NL_SET_ERR_MSG(extack, "IPv6 support disabled");
1729 NL_SET_ERR_MSG(extack, "Invalid selector family");
1733 ret = verify_policy_dir(p->dir, extack);
1737 NL_SET_ERR_MSG(extack, "Policy index doesn't match direction");
1782 int dir, struct netlink_ext_ack *extack)
1788 NL_SET_ERR_MSG(extack, "Template count must be <= XFRM_MAX_DEPTH (" __stringify(XFRM_MAX_DEPTH) ")");
1809 NL_SET_ERR_MSG(extack, "Mode in optional template not allowed in outbound policy");
1815 NL_SET_ERR_MSG(extack, "Mode in template doesn't support a family change");
1821 NL_SET_ERR_MSG(extack, "Mode in template must be < XFRM_MODE_MAX (" __stringify(XFRM_MODE_MAX) ")");
1835 NL_SET_ERR_MSG(extack, "Invalid family in template");
1840 NL_SET_ERR_MSG(extack, "Invalid XFRM protocol in template");
1849 int dir, struct netlink_ext_ack *extack)
1860 err = validate_tmpl(nr, utmpl, pol->family, dir, extack);
1870 struct netlink_ext_ack *extack)
1882 err = verify_policy_type(type, extack);
1921 struct netlink_ext_ack *extack)
1933 err = copy_from_user_policy_type(&xp->type, attrs, extack);
1937 if (!(err = copy_from_user_tmpl(xp, attrs, p->dir, extack)))
1951 p->dir, extack);
1966 struct netlink_ext_ack *extack)
1975 err = verify_newpolicy_info(p, extack);
1978 err = verify_sec_ctx_len(attrs, extack);
1982 xp = xfrm_policy_construct(net, p, attrs, &err, extack);
2231 struct nlattr **attrs, struct netlink_ext_ack *extack)
2252 struct nlattr **attrs, struct netlink_ext_ack *extack)
2283 struct netlink_ext_ack *extack)
2298 err = copy_from_user_policy_type(&type, attrs, extack);
2302 err = verify_policy_dir(p->dir, extack);
2318 err = verify_sec_ctx_len(attrs, extack);
2368 struct netlink_ext_ack *extack)
2468 struct nlattr **attrs, struct netlink_ext_ack *extack)
2512 struct nlattr **attrs, struct netlink_ext_ack *extack)
2528 NL_SET_ERR_MSG(extack, "Missing required attribute for AE");
2534 NL_SET_ERR_MSG(extack, "NLM_F_REPLACE flag is required");
2545 NL_SET_ERR_MSG(extack, "SA must be in VALID state");
2549 err = xfrm_replay_verify_len(x->replay_esn, re, extack);
2570 struct netlink_ext_ack *extack)
2577 err = copy_from_user_policy_type(&type, attrs, extack);
2599 struct netlink_ext_ack *extack)
2610 err = copy_from_user_policy_type(&type, attrs, extack);
2614 err = verify_policy_dir(p->dir, extack);
2630 err = verify_sec_ctx_len(attrs, extack);
2666 struct netlink_ext_ack *extack)
2685 NL_SET_ERR_MSG(extack, "SA must be in VALID state");
2704 struct netlink_ext_ack *extack)
2722 err = verify_newpolicy_info(&ua->policy, extack);
2725 err = verify_sec_ctx_len(attrs, extack);
2730 xp = xfrm_policy_construct(net, &ua->policy, attrs, &err, extack);
2769 struct netlink_ext_ack *extack)
2789 NL_SET_ERR_MSG(extack, "Invalid number of SAs to migrate, must be 0 < num <= XFRM_MAX_DEPTH (6)");
2812 struct nlattr **attrs, struct netlink_ext_ack *extack)
2825 NL_SET_ERR_MSG(extack, "Missing required MIGRATE attribute");
2831 err = copy_from_user_policy_type(&type, attrs, extack);
2835 err = copy_from_user_migrate(m, kmp, attrs, &n, extack);
2853 if_id, extack);
2861 struct nlattr **attrs, struct netlink_ext_ack *extack)
3098 struct netlink_ext_ack *extack)
3124 link->nla_pol, extack);
3152 link->nla_pol ? : xfrma_policy, extack);
3161 err = link->doit(skb, nlh, attrs, extack);