All of lore.kernel.org
 help / color / mirror / Atom feed
* [mhiramat:kprobes/kretprobe-stackfix 8/10] kernel/kprobes.c:1901:32: warning: passing argument 2 of 'instruction_pointer_set' makes integer from pointer without a cast
@ 2021-03-16 18:59 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2021-03-16 18:59 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 6088 bytes --]

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/mhiramat/linux.git kprobes/kretprobe-stackfix
head:   6e2b8966c87adc1be0fb4a386fb24ae438f4cb79
commit: 663b1b4caed9e4b0ad1be80b30851e68fb9a40eb [8/10] kprobes: Setup instruction pointer in __kretprobe_trampoline_handler
config: parisc-randconfig-r006-20210316 (attached as .config)
compiler: hppa-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://git.kernel.org/pub/scm/linux/kernel/git/mhiramat/linux.git/commit/?id=663b1b4caed9e4b0ad1be80b30851e68fb9a40eb
        git remote add mhiramat https://git.kernel.org/pub/scm/linux/kernel/git/mhiramat/linux.git
        git fetch --no-tags mhiramat kprobes/kretprobe-stackfix
        git checkout 663b1b4caed9e4b0ad1be80b30851e68fb9a40eb
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=parisc 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

   kernel/kprobes.c:1847:12: warning: no previous prototype for 'kprobe_exceptions_notify' [-Wmissing-prototypes]
    1847 | int __weak kprobe_exceptions_notify(struct notifier_block *self,
         |            ^~~~~~~~~~~~~~~~~~~~~~~~
   kernel/kprobes.c: In function '__kretprobe_trampoline_handler':
>> kernel/kprobes.c:1901:32: warning: passing argument 2 of 'instruction_pointer_set' makes integer from pointer without a cast [-Wint-conversion]
    1901 |  instruction_pointer_set(regs, correct_ret_addr);
         |                                ^~~~~~~~~~~~~~~~
         |                                |
         |                                kprobe_opcode_t * {aka unsigned int *}
   In file included from arch/parisc/include/asm/processor.h:18,
                    from arch/parisc/include/asm/spinlock.h:7,
                    from arch/parisc/include/asm/atomic.h:22,
                    from include/linux/atomic.h:7,
                    from arch/parisc/include/asm/bitops.h:13,
                    from include/linux/bitops.h:32,
                    from include/linux/kernel.h:11,
                    from include/linux/list.h:9,
                    from include/linux/kprobes.h:21,
                    from kernel/kprobes.c:21:
   arch/parisc/include/asm/ptrace.h:29:21: note: expected 'long unsigned int' but argument is of type 'kprobe_opcode_t *' {aka 'unsigned int *'}
      29 |       unsigned long val)
         |       ~~~~~~~~~~~~~~^~~


vim +/instruction_pointer_set +1901 kernel/kprobes.c

  1846	
> 1847	int __weak kprobe_exceptions_notify(struct notifier_block *self,
  1848						unsigned long val, void *data)
  1849	{
  1850		return NOTIFY_DONE;
  1851	}
  1852	NOKPROBE_SYMBOL(kprobe_exceptions_notify);
  1853	
  1854	static struct notifier_block kprobe_exceptions_nb = {
  1855		.notifier_call = kprobe_exceptions_notify,
  1856		.priority = 0x7fffffff /* we need to be notified first */
  1857	};
  1858	
  1859	#ifdef CONFIG_KRETPROBES
  1860	
  1861	/* This assumes the tsk is current or the task which is not running. */
  1862	unsigned long kretprobe_find_ret_addr(struct task_struct *tsk,
  1863					      struct llist_node **cur)
  1864	{
  1865		struct kretprobe_instance *ri = NULL;
  1866		struct llist_node *node = *cur;
  1867	
  1868		if (!node)
  1869			node = tsk->kretprobe_instances.first;
  1870		else
  1871			node = node->next;
  1872	
  1873		while (node) {
  1874			ri = container_of(node, struct kretprobe_instance, llist);
  1875			if (ri->ret_addr != kretprobe_trampoline_addr()) {
  1876				*cur = node;
  1877				return (unsigned long)ri->ret_addr;
  1878			}
  1879			node = node->next;
  1880		}
  1881		return 0;
  1882	}
  1883	NOKPROBE_SYMBOL(kretprobe_find_ret_addr);
  1884	
  1885	unsigned long __kretprobe_trampoline_handler(struct pt_regs *regs,
  1886						     void *frame_pointer)
  1887	{
  1888		kprobe_opcode_t *correct_ret_addr = NULL;
  1889		struct kretprobe_instance *ri = NULL;
  1890		struct llist_node *first, *node = NULL;
  1891		struct kretprobe *rp;
  1892	
  1893		/* Find correct address and all nodes for this frame. */
  1894		correct_ret_addr = (void *)kretprobe_find_ret_addr(current, &node);
  1895		if (!correct_ret_addr) {
  1896			pr_err("Oops! Kretprobe fails to find correct return address.\n");
  1897			BUG_ON(1);
  1898		}
  1899	
  1900		/* Set the instruction pointer to the correct address */
> 1901		instruction_pointer_set(regs, correct_ret_addr);
  1902	
  1903		/* Run them. */
  1904		first = current->kretprobe_instances.first;
  1905		while (first) {
  1906			ri = container_of(first, struct kretprobe_instance, llist);
  1907	
  1908			BUG_ON(ri->fp != frame_pointer);
  1909	
  1910			rp = get_kretprobe(ri);
  1911			if (rp && rp->handler) {
  1912				struct kprobe *prev = kprobe_running();
  1913	
  1914				__this_cpu_write(current_kprobe, &rp->kp);
  1915				ri->ret_addr = correct_ret_addr;
  1916				rp->handler(ri, regs);
  1917				__this_cpu_write(current_kprobe, prev);
  1918			}
  1919			if (first == node)
  1920				break;
  1921	
  1922			first = first->next;
  1923		}
  1924	
  1925		/* Unlink all nodes for this frame. */
  1926		first = current->kretprobe_instances.first;
  1927		current->kretprobe_instances.first = node->next;
  1928		node->next = NULL;
  1929	
  1930		/* Recycle them.  */
  1931		while (first) {
  1932			ri = container_of(first, struct kretprobe_instance, llist);
  1933			first = first->next;
  1934	
  1935			recycle_rp_inst(ri);
  1936		}
  1937	
  1938		return (unsigned long)correct_ret_addr;
  1939	}
  1940	NOKPROBE_SYMBOL(__kretprobe_trampoline_handler)
  1941	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 33917 bytes --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-03-16 18:59 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-03-16 18:59 [mhiramat:kprobes/kretprobe-stackfix 8/10] kernel/kprobes.c:1901:32: warning: passing argument 2 of 'instruction_pointer_set' makes integer from pointer without a cast kernel test robot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.