1. 09 Jan, 2017 1 commit
    • Willem de Bruijn's avatar
      xtables: add xt_match, xt_target and data copy_to_user functions · f32815d2
      Willem de Bruijn authored
      xt_entry_target, xt_entry_match and their private data may contain
      kernel data.
      
      Introduce helper functions xt_match_to_user, xt_target_to_user and
      xt_data_to_user that copy only the expected fields. These replace
      existing logic that calls copy_to_user on entire structs, then
      overwrites select fields.
      
      Private data is defined in xt_match and xt_target. All matches and
      targets that maintain kernel data store this at the tail of their
      private structure. Extend xt_match and xt_target with .usersize to
      limit how many bytes of data are copied. The remainder is cleared.
      
      If compatsize is specified, usersize can only safely be used if all
      fields up to usersize use platform-independent types. Otherwise, the
      compat_to_user callback must be defined.
      
      This patch does not yet enable the support logic.
      Signed-off-by: default avatarWillem de Bruijn <willemb@google.com>
      Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
      f32815d2
  2. 05 Jan, 2017 3 commits
  3. 03 Jan, 2017 4 commits
  4. 02 Jan, 2017 32 commits