act_pedit.c 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627
  1. // SPDX-License-Identifier: GPL-2.0-or-later
  2. /*
  3. * net/sched/act_pedit.c Generic packet editor
  4. *
  5. * Authors: Jamal Hadi Salim (2002-4)
  6. */
  7. #include <linux/types.h>
  8. #include <linux/kernel.h>
  9. #include <linux/string.h>
  10. #include <linux/errno.h>
  11. #include <linux/skbuff.h>
  12. #include <linux/rtnetlink.h>
  13. #include <linux/module.h>
  14. #include <linux/init.h>
  15. #include <linux/ip.h>
  16. #include <linux/ipv6.h>
  17. #include <linux/slab.h>
  18. #include <net/ipv6.h>
  19. #include <net/netlink.h>
  20. #include <net/pkt_sched.h>
  21. #include <linux/tc_act/tc_pedit.h>
  22. #include <net/tc_act/tc_pedit.h>
  23. #include <uapi/linux/tc_act/tc_pedit.h>
  24. #include <net/pkt_cls.h>
  25. static struct tc_action_ops act_pedit_ops;
  26. static const struct nla_policy pedit_policy[TCA_PEDIT_MAX + 1] = {
  27. [TCA_PEDIT_PARMS] = { .len = sizeof(struct tc_pedit) },
  28. [TCA_PEDIT_PARMS_EX] = { .len = sizeof(struct tc_pedit) },
  29. [TCA_PEDIT_KEYS_EX] = { .type = NLA_NESTED },
  30. };
  31. static const struct nla_policy pedit_key_ex_policy[TCA_PEDIT_KEY_EX_MAX + 1] = {
  32. [TCA_PEDIT_KEY_EX_HTYPE] = { .type = NLA_U16 },
  33. [TCA_PEDIT_KEY_EX_CMD] = { .type = NLA_U16 },
  34. };
  35. static struct tcf_pedit_key_ex *tcf_pedit_keys_ex_parse(struct nlattr *nla,
  36. u8 n)
  37. {
  38. struct tcf_pedit_key_ex *keys_ex;
  39. struct tcf_pedit_key_ex *k;
  40. const struct nlattr *ka;
  41. int err = -EINVAL;
  42. int rem;
  43. if (!nla)
  44. return NULL;
  45. keys_ex = kcalloc(n, sizeof(*k), GFP_KERNEL);
  46. if (!keys_ex)
  47. return ERR_PTR(-ENOMEM);
  48. k = keys_ex;
  49. nla_for_each_nested(ka, nla, rem) {
  50. struct nlattr *tb[TCA_PEDIT_KEY_EX_MAX + 1];
  51. if (!n) {
  52. err = -EINVAL;
  53. goto err_out;
  54. }
  55. n--;
  56. if (nla_type(ka) != TCA_PEDIT_KEY_EX) {
  57. err = -EINVAL;
  58. goto err_out;
  59. }
  60. err = nla_parse_nested_deprecated(tb, TCA_PEDIT_KEY_EX_MAX,
  61. ka, pedit_key_ex_policy,
  62. NULL);
  63. if (err)
  64. goto err_out;
  65. if (!tb[TCA_PEDIT_KEY_EX_HTYPE] ||
  66. !tb[TCA_PEDIT_KEY_EX_CMD]) {
  67. err = -EINVAL;
  68. goto err_out;
  69. }
  70. k->htype = nla_get_u16(tb[TCA_PEDIT_KEY_EX_HTYPE]);
  71. k->cmd = nla_get_u16(tb[TCA_PEDIT_KEY_EX_CMD]);
  72. if (k->htype > TCA_PEDIT_HDR_TYPE_MAX ||
  73. k->cmd > TCA_PEDIT_CMD_MAX) {
  74. err = -EINVAL;
  75. goto err_out;
  76. }
  77. k++;
  78. }
  79. if (n) {
  80. err = -EINVAL;
  81. goto err_out;
  82. }
  83. return keys_ex;
  84. err_out:
  85. kfree(keys_ex);
  86. return ERR_PTR(err);
  87. }
  88. static int tcf_pedit_key_ex_dump(struct sk_buff *skb,
  89. struct tcf_pedit_key_ex *keys_ex, int n)
  90. {
  91. struct nlattr *keys_start = nla_nest_start_noflag(skb,
  92. TCA_PEDIT_KEYS_EX);
  93. if (!keys_start)
  94. goto nla_failure;
  95. for (; n > 0; n--) {
  96. struct nlattr *key_start;
  97. key_start = nla_nest_start_noflag(skb, TCA_PEDIT_KEY_EX);
  98. if (!key_start)
  99. goto nla_failure;
  100. if (nla_put_u16(skb, TCA_PEDIT_KEY_EX_HTYPE, keys_ex->htype) ||
  101. nla_put_u16(skb, TCA_PEDIT_KEY_EX_CMD, keys_ex->cmd))
  102. goto nla_failure;
  103. nla_nest_end(skb, key_start);
  104. keys_ex++;
  105. }
  106. nla_nest_end(skb, keys_start);
  107. return 0;
  108. nla_failure:
  109. nla_nest_cancel(skb, keys_start);
  110. return -EINVAL;
  111. }
  112. static void tcf_pedit_cleanup_rcu(struct rcu_head *head)
  113. {
  114. struct tcf_pedit_parms *parms =
  115. container_of(head, struct tcf_pedit_parms, rcu);
  116. kfree(parms->tcfp_keys_ex);
  117. kfree(parms->tcfp_keys);
  118. kfree(parms);
  119. }
  120. static int tcf_pedit_init(struct net *net, struct nlattr *nla,
  121. struct nlattr *est, struct tc_action **a,
  122. struct tcf_proto *tp, u32 flags,
  123. struct netlink_ext_ack *extack)
  124. {
  125. struct tc_action_net *tn = net_generic(net, act_pedit_ops.net_id);
  126. bool bind = flags & TCA_ACT_FLAGS_BIND;
  127. struct tcf_chain *goto_ch = NULL;
  128. struct tcf_pedit_parms *oparms, *nparms;
  129. struct nlattr *tb[TCA_PEDIT_MAX + 1];
  130. struct tc_pedit *parm;
  131. struct nlattr *pattr;
  132. struct tcf_pedit *p;
  133. int ret = 0, err;
  134. int i, ksize;
  135. u32 index;
  136. if (!nla) {
  137. NL_SET_ERR_MSG_MOD(extack, "Pedit requires attributes to be passed");
  138. return -EINVAL;
  139. }
  140. err = nla_parse_nested_deprecated(tb, TCA_PEDIT_MAX, nla,
  141. pedit_policy, NULL);
  142. if (err < 0)
  143. return err;
  144. pattr = tb[TCA_PEDIT_PARMS];
  145. if (!pattr)
  146. pattr = tb[TCA_PEDIT_PARMS_EX];
  147. if (!pattr) {
  148. NL_SET_ERR_MSG_MOD(extack, "Missing required TCA_PEDIT_PARMS or TCA_PEDIT_PARMS_EX pedit attribute");
  149. return -EINVAL;
  150. }
  151. parm = nla_data(pattr);
  152. index = parm->index;
  153. err = tcf_idr_check_alloc(tn, &index, a, bind);
  154. if (!err) {
  155. ret = tcf_idr_create_from_flags(tn, index, est, a,
  156. &act_pedit_ops, bind, flags);
  157. if (ret) {
  158. tcf_idr_cleanup(tn, index);
  159. return ret;
  160. }
  161. ret = ACT_P_CREATED;
  162. } else if (err > 0) {
  163. if (bind)
  164. return 0;
  165. if (!(flags & TCA_ACT_FLAGS_REPLACE)) {
  166. ret = -EEXIST;
  167. goto out_release;
  168. }
  169. } else {
  170. return err;
  171. }
  172. if (!parm->nkeys) {
  173. NL_SET_ERR_MSG_MOD(extack, "Pedit requires keys to be passed");
  174. ret = -EINVAL;
  175. goto out_release;
  176. }
  177. ksize = parm->nkeys * sizeof(struct tc_pedit_key);
  178. if (nla_len(pattr) < sizeof(*parm) + ksize) {
  179. NL_SET_ERR_MSG_ATTR(extack, pattr, "Length of TCA_PEDIT_PARMS or TCA_PEDIT_PARMS_EX pedit attribute is invalid");
  180. ret = -EINVAL;
  181. goto out_release;
  182. }
  183. nparms = kzalloc(sizeof(*nparms), GFP_KERNEL);
  184. if (!nparms) {
  185. ret = -ENOMEM;
  186. goto out_release;
  187. }
  188. nparms->tcfp_keys_ex =
  189. tcf_pedit_keys_ex_parse(tb[TCA_PEDIT_KEYS_EX], parm->nkeys);
  190. if (IS_ERR(nparms->tcfp_keys_ex)) {
  191. ret = PTR_ERR(nparms->tcfp_keys_ex);
  192. goto out_free;
  193. }
  194. err = tcf_action_check_ctrlact(parm->action, tp, &goto_ch, extack);
  195. if (err < 0) {
  196. ret = err;
  197. goto out_free_ex;
  198. }
  199. nparms->tcfp_off_max_hint = 0;
  200. nparms->tcfp_flags = parm->flags;
  201. nparms->tcfp_nkeys = parm->nkeys;
  202. nparms->tcfp_keys = kmalloc(ksize, GFP_KERNEL);
  203. if (!nparms->tcfp_keys) {
  204. ret = -ENOMEM;
  205. goto put_chain;
  206. }
  207. memcpy(nparms->tcfp_keys, parm->keys, ksize);
  208. for (i = 0; i < nparms->tcfp_nkeys; ++i) {
  209. u32 cur = nparms->tcfp_keys[i].off;
  210. /* sanitize the shift value for any later use */
  211. nparms->tcfp_keys[i].shift = min_t(size_t,
  212. BITS_PER_TYPE(int) - 1,
  213. nparms->tcfp_keys[i].shift);
  214. /* The AT option can read a single byte, we can bound the actual
  215. * value with uchar max.
  216. */
  217. cur += (0xff & nparms->tcfp_keys[i].offmask) >> nparms->tcfp_keys[i].shift;
  218. /* Each key touches 4 bytes starting from the computed offset */
  219. nparms->tcfp_off_max_hint =
  220. max(nparms->tcfp_off_max_hint, cur + 4);
  221. }
  222. p = to_pedit(*a);
  223. spin_lock_bh(&p->tcf_lock);
  224. goto_ch = tcf_action_set_ctrlact(*a, parm->action, goto_ch);
  225. oparms = rcu_replace_pointer(p->parms, nparms, 1);
  226. spin_unlock_bh(&p->tcf_lock);
  227. if (oparms)
  228. call_rcu(&oparms->rcu, tcf_pedit_cleanup_rcu);
  229. if (goto_ch)
  230. tcf_chain_put_by_act(goto_ch);
  231. return ret;
  232. put_chain:
  233. if (goto_ch)
  234. tcf_chain_put_by_act(goto_ch);
  235. out_free_ex:
  236. kfree(nparms->tcfp_keys_ex);
  237. out_free:
  238. kfree(nparms);
  239. out_release:
  240. tcf_idr_release(*a, bind);
  241. return ret;
  242. }
  243. static void tcf_pedit_cleanup(struct tc_action *a)
  244. {
  245. struct tcf_pedit *p = to_pedit(a);
  246. struct tcf_pedit_parms *parms;
  247. parms = rcu_dereference_protected(p->parms, 1);
  248. if (parms)
  249. call_rcu(&parms->rcu, tcf_pedit_cleanup_rcu);
  250. }
  251. static bool offset_valid(struct sk_buff *skb, int offset)
  252. {
  253. if (offset > 0 && offset > skb->len)
  254. return false;
  255. if (offset < 0 && -offset > skb_headroom(skb))
  256. return false;
  257. return true;
  258. }
  259. static int pedit_l4_skb_offset(struct sk_buff *skb, int *hoffset, const int header_type)
  260. {
  261. const int noff = skb_network_offset(skb);
  262. int ret = -EINVAL;
  263. struct iphdr _iph;
  264. switch (skb->protocol) {
  265. case htons(ETH_P_IP): {
  266. const struct iphdr *iph = skb_header_pointer(skb, noff, sizeof(_iph), &_iph);
  267. if (!iph)
  268. goto out;
  269. *hoffset = noff + iph->ihl * 4;
  270. ret = 0;
  271. break;
  272. }
  273. case htons(ETH_P_IPV6):
  274. ret = ipv6_find_hdr(skb, hoffset, header_type, NULL, NULL) == header_type ? 0 : -EINVAL;
  275. break;
  276. }
  277. out:
  278. return ret;
  279. }
  280. static int pedit_skb_hdr_offset(struct sk_buff *skb,
  281. enum pedit_header_type htype, int *hoffset)
  282. {
  283. int ret = -EINVAL;
  284. /* 'htype' is validated in the netlink parsing */
  285. switch (htype) {
  286. case TCA_PEDIT_KEY_EX_HDR_TYPE_ETH:
  287. if (skb_mac_header_was_set(skb)) {
  288. *hoffset = skb_mac_offset(skb);
  289. ret = 0;
  290. }
  291. break;
  292. case TCA_PEDIT_KEY_EX_HDR_TYPE_NETWORK:
  293. case TCA_PEDIT_KEY_EX_HDR_TYPE_IP4:
  294. case TCA_PEDIT_KEY_EX_HDR_TYPE_IP6:
  295. *hoffset = skb_network_offset(skb);
  296. ret = 0;
  297. break;
  298. case TCA_PEDIT_KEY_EX_HDR_TYPE_TCP:
  299. ret = pedit_l4_skb_offset(skb, hoffset, IPPROTO_TCP);
  300. break;
  301. case TCA_PEDIT_KEY_EX_HDR_TYPE_UDP:
  302. ret = pedit_l4_skb_offset(skb, hoffset, IPPROTO_UDP);
  303. break;
  304. default:
  305. break;
  306. }
  307. return ret;
  308. }
  309. static int tcf_pedit_act(struct sk_buff *skb, const struct tc_action *a,
  310. struct tcf_result *res)
  311. {
  312. enum pedit_header_type htype = TCA_PEDIT_KEY_EX_HDR_TYPE_NETWORK;
  313. enum pedit_cmd cmd = TCA_PEDIT_KEY_EX_CMD_SET;
  314. struct tcf_pedit *p = to_pedit(a);
  315. struct tcf_pedit_key_ex *tkey_ex;
  316. struct tcf_pedit_parms *parms;
  317. struct tc_pedit_key *tkey;
  318. u32 max_offset;
  319. int i;
  320. parms = rcu_dereference_bh(p->parms);
  321. max_offset = (skb_transport_header_was_set(skb) ?
  322. skb_transport_offset(skb) :
  323. skb_network_offset(skb)) +
  324. parms->tcfp_off_max_hint;
  325. if (skb_ensure_writable(skb, min(skb->len, max_offset)))
  326. goto done;
  327. tcf_lastuse_update(&p->tcf_tm);
  328. tcf_action_update_bstats(&p->common, skb);
  329. tkey = parms->tcfp_keys;
  330. tkey_ex = parms->tcfp_keys_ex;
  331. for (i = parms->tcfp_nkeys; i > 0; i--, tkey++) {
  332. int offset = tkey->off;
  333. int hoffset = 0;
  334. u32 *ptr, hdata;
  335. u32 val;
  336. int rc;
  337. if (tkey_ex) {
  338. htype = tkey_ex->htype;
  339. cmd = tkey_ex->cmd;
  340. tkey_ex++;
  341. }
  342. rc = pedit_skb_hdr_offset(skb, htype, &hoffset);
  343. if (rc) {
  344. pr_info_ratelimited("tc action pedit unable to extract header offset for header type (0x%x)\n", htype);
  345. goto bad;
  346. }
  347. if (tkey->offmask) {
  348. u8 *d, _d;
  349. if (!offset_valid(skb, hoffset + tkey->at)) {
  350. pr_info("tc action pedit 'at' offset %d out of bounds\n",
  351. hoffset + tkey->at);
  352. goto bad;
  353. }
  354. d = skb_header_pointer(skb, hoffset + tkey->at,
  355. sizeof(_d), &_d);
  356. if (!d)
  357. goto bad;
  358. offset += (*d & tkey->offmask) >> tkey->shift;
  359. }
  360. if (offset % 4) {
  361. pr_info("tc action pedit offset must be on 32 bit boundaries\n");
  362. goto bad;
  363. }
  364. if (!offset_valid(skb, hoffset + offset)) {
  365. pr_info("tc action pedit offset %d out of bounds\n",
  366. hoffset + offset);
  367. goto bad;
  368. }
  369. ptr = skb_header_pointer(skb, hoffset + offset,
  370. sizeof(hdata), &hdata);
  371. if (!ptr)
  372. goto bad;
  373. /* just do it, baby */
  374. switch (cmd) {
  375. case TCA_PEDIT_KEY_EX_CMD_SET:
  376. val = tkey->val;
  377. break;
  378. case TCA_PEDIT_KEY_EX_CMD_ADD:
  379. val = (*ptr + tkey->val) & ~tkey->mask;
  380. break;
  381. default:
  382. pr_info("tc action pedit bad command (%d)\n",
  383. cmd);
  384. goto bad;
  385. }
  386. *ptr = ((*ptr & tkey->mask) ^ val);
  387. if (ptr == &hdata)
  388. skb_store_bits(skb, hoffset + offset, ptr, 4);
  389. }
  390. goto done;
  391. bad:
  392. spin_lock(&p->tcf_lock);
  393. p->tcf_qstats.overlimits++;
  394. spin_unlock(&p->tcf_lock);
  395. done:
  396. return p->tcf_action;
  397. }
  398. static void tcf_pedit_stats_update(struct tc_action *a, u64 bytes, u64 packets,
  399. u64 drops, u64 lastuse, bool hw)
  400. {
  401. struct tcf_pedit *d = to_pedit(a);
  402. struct tcf_t *tm = &d->tcf_tm;
  403. tcf_action_update_stats(a, bytes, packets, drops, hw);
  404. tm->lastuse = max_t(u64, tm->lastuse, lastuse);
  405. }
  406. static int tcf_pedit_dump(struct sk_buff *skb, struct tc_action *a,
  407. int bind, int ref)
  408. {
  409. unsigned char *b = skb_tail_pointer(skb);
  410. struct tcf_pedit *p = to_pedit(a);
  411. struct tcf_pedit_parms *parms;
  412. struct tc_pedit *opt;
  413. struct tcf_t t;
  414. int s;
  415. spin_lock_bh(&p->tcf_lock);
  416. parms = rcu_dereference_protected(p->parms, 1);
  417. s = struct_size(opt, keys, parms->tcfp_nkeys);
  418. opt = kzalloc(s, GFP_ATOMIC);
  419. if (unlikely(!opt)) {
  420. spin_unlock_bh(&p->tcf_lock);
  421. return -ENOBUFS;
  422. }
  423. memcpy(opt->keys, parms->tcfp_keys,
  424. flex_array_size(opt, keys, parms->tcfp_nkeys));
  425. opt->index = p->tcf_index;
  426. opt->nkeys = parms->tcfp_nkeys;
  427. opt->flags = parms->tcfp_flags;
  428. opt->action = p->tcf_action;
  429. opt->refcnt = refcount_read(&p->tcf_refcnt) - ref;
  430. opt->bindcnt = atomic_read(&p->tcf_bindcnt) - bind;
  431. if (parms->tcfp_keys_ex) {
  432. if (tcf_pedit_key_ex_dump(skb, parms->tcfp_keys_ex,
  433. parms->tcfp_nkeys))
  434. goto nla_put_failure;
  435. if (nla_put(skb, TCA_PEDIT_PARMS_EX, s, opt))
  436. goto nla_put_failure;
  437. } else {
  438. if (nla_put(skb, TCA_PEDIT_PARMS, s, opt))
  439. goto nla_put_failure;
  440. }
  441. tcf_tm_dump(&t, &p->tcf_tm);
  442. if (nla_put_64bit(skb, TCA_PEDIT_TM, sizeof(t), &t, TCA_PEDIT_PAD))
  443. goto nla_put_failure;
  444. spin_unlock_bh(&p->tcf_lock);
  445. kfree(opt);
  446. return skb->len;
  447. nla_put_failure:
  448. spin_unlock_bh(&p->tcf_lock);
  449. nlmsg_trim(skb, b);
  450. kfree(opt);
  451. return -1;
  452. }
  453. static int tcf_pedit_offload_act_setup(struct tc_action *act, void *entry_data,
  454. u32 *index_inc, bool bind,
  455. struct netlink_ext_ack *extack)
  456. {
  457. if (bind) {
  458. struct flow_action_entry *entry = entry_data;
  459. int k;
  460. for (k = 0; k < tcf_pedit_nkeys(act); k++) {
  461. switch (tcf_pedit_cmd(act, k)) {
  462. case TCA_PEDIT_KEY_EX_CMD_SET:
  463. entry->id = FLOW_ACTION_MANGLE;
  464. break;
  465. case TCA_PEDIT_KEY_EX_CMD_ADD:
  466. entry->id = FLOW_ACTION_ADD;
  467. break;
  468. default:
  469. NL_SET_ERR_MSG_MOD(extack, "Unsupported pedit command offload");
  470. return -EOPNOTSUPP;
  471. }
  472. entry->mangle.htype = tcf_pedit_htype(act, k);
  473. entry->mangle.mask = tcf_pedit_mask(act, k);
  474. entry->mangle.val = tcf_pedit_val(act, k);
  475. entry->mangle.offset = tcf_pedit_offset(act, k);
  476. entry->hw_stats = tc_act_hw_stats(act->hw_stats);
  477. entry++;
  478. }
  479. *index_inc = k;
  480. } else {
  481. return -EOPNOTSUPP;
  482. }
  483. return 0;
  484. }
  485. static struct tc_action_ops act_pedit_ops = {
  486. .kind = "pedit",
  487. .id = TCA_ID_PEDIT,
  488. .owner = THIS_MODULE,
  489. .act = tcf_pedit_act,
  490. .stats_update = tcf_pedit_stats_update,
  491. .dump = tcf_pedit_dump,
  492. .cleanup = tcf_pedit_cleanup,
  493. .init = tcf_pedit_init,
  494. .offload_act_setup = tcf_pedit_offload_act_setup,
  495. .size = sizeof(struct tcf_pedit),
  496. };
  497. static __net_init int pedit_init_net(struct net *net)
  498. {
  499. struct tc_action_net *tn = net_generic(net, act_pedit_ops.net_id);
  500. return tc_action_net_init(net, tn, &act_pedit_ops);
  501. }
  502. static void __net_exit pedit_exit_net(struct list_head *net_list)
  503. {
  504. tc_action_net_exit(net_list, act_pedit_ops.net_id);
  505. }
  506. static struct pernet_operations pedit_net_ops = {
  507. .init = pedit_init_net,
  508. .exit_batch = pedit_exit_net,
  509. .id = &act_pedit_ops.net_id,
  510. .size = sizeof(struct tc_action_net),
  511. };
  512. MODULE_AUTHOR("Jamal Hadi Salim(2002-4)");
  513. MODULE_DESCRIPTION("Generic Packet Editor actions");
  514. MODULE_LICENSE("GPL");
  515. static int __init pedit_init_module(void)
  516. {
  517. return tcf_register_action(&act_pedit_ops, &pedit_net_ops);
  518. }
  519. static void __exit pedit_cleanup_module(void)
  520. {
  521. tcf_unregister_action(&act_pedit_ops, &pedit_net_ops);
  522. }
  523. module_init(pedit_init_module);
  524. module_exit(pedit_cleanup_module);