lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <202310241246.dzzRFPr2-lkp@intel.com>
Date:   Tue, 24 Oct 2023 12:25:01 +0800
From:   kernel test robot <lkp@...el.com>
To:     David Howells <dhowells@...hat.com>
Cc:     oe-kbuild-all@...ts.linux.dev, linux-kernel@...r.kernel.org
Subject: fs/proc/proc_net.c:130: warning: Function parameter or member
 'state_size' not described in 'proc_create_net_data_write'

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   84186fcb834ecc55604efaf383e17e6b5e9baa50
commit: 564def71765caf65040f926c0783b9c27cc6c087 proc: Add a way to make network proc files writable
date:   5 years ago
config: x86_64-randconfig-x012-20230629 (https://download.01.org/0day-ci/archive/20231024/202310241246.dzzRFPr2-lkp@intel.com/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231024/202310241246.dzzRFPr2-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@...el.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202310241246.dzzRFPr2-lkp@intel.com/

All warnings (new ones prefixed by >>):

   In file included from arch/x86/include/asm/bug.h:83,
                    from include/linux/bug.h:5,
                    from arch/x86/include/asm/paravirt.h:15,
                    from arch/x86/include/asm/irqflags.h:65,
                    from include/linux/irqflags.h:16,
                    from include/linux/rcupdate.h:39,
                    from include/linux/rculist.h:11,
                    from include/linux/pid.h:5,
                    from include/linux/sched.h:14,
                    from include/linux/uaccess.h:5,
                    from fs/proc/proc_net.c:11:
   fs/proc/proc_net.c: In function 'seq_open_net':
   fs/proc/proc_net.c:47:33: warning: comparison is always false due to limited range of data type [-Wtype-limits]
      47 |         WARN_ON_ONCE(state_size < sizeof(*p));
         |                                 ^
   include/asm-generic/bug.h:69:32: note: in definition of macro 'WARN_ON_ONCE'
      69 |         int __ret_warn_on = !!(condition);                      \
         |                                ^~~~~~~~~
>> fs/proc/proc_net.c:130: warning: Function parameter or member 'state_size' not described in 'proc_create_net_data_write'
   fs/proc/proc_net.o: warning: objtool: get_proc_task_net()+0x110: sibling call from callable instruction with modified stack frame


vim +130 fs/proc/proc_net.c

    99	
   100	/**
   101	 * proc_create_net_data_write - Create a writable net_ns-specific proc file
   102	 * @name: The name of the file.
   103	 * @mode: The file's access mode.
   104	 * @parent: The parent directory in which to create.
   105	 * @ops: The seq_file ops with which to read the file.
   106	 * @write: The write method which which to 'modify' the file.
   107	 * @data: Data for retrieval by PDE_DATA().
   108	 *
   109	 * Create a network namespaced proc file in the @parent directory with the
   110	 * specified @name and @mode that allows reading of a file that displays a
   111	 * series of elements and also provides for the file accepting writes that have
   112	 * some arbitrary effect.
   113	 *
   114	 * The functions in the @ops table are used to iterate over items to be
   115	 * presented and extract the readable content using the seq_file interface.
   116	 *
   117	 * The @write function is called with the data copied into a kernel space
   118	 * scratch buffer and has a NUL appended for convenience.  The buffer may be
   119	 * modified by the @write function.  @write should return 0 on success.
   120	 *
   121	 * The @data value is accessible from the @show and @write functions by calling
   122	 * PDE_DATA() on the file inode.  The network namespace must be accessed by
   123	 * calling seq_file_net() on the seq_file struct.
   124	 */
   125	struct proc_dir_entry *proc_create_net_data_write(const char *name, umode_t mode,
   126							  struct proc_dir_entry *parent,
   127							  const struct seq_operations *ops,
   128							  proc_write_t write,
   129							  unsigned int state_size, void *data)
 > 130	{
   131		struct proc_dir_entry *p;
   132	
   133		p = proc_create_reg(name, mode, &parent, data);
   134		if (!p)
   135			return NULL;
   136		p->proc_fops = &proc_net_seq_fops;
   137		p->seq_ops = ops;
   138		p->state_size = state_size;
   139		p->write = write;
   140		return proc_register(parent, p);
   141	}
   142	EXPORT_SYMBOL_GPL(proc_create_net_data_write);
   143	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ