From: Masami Hiramatsu (Google) <mhiramat@kernel.org>
To: Dan Carpenter <dan.carpenter@linaro.org>
Cc: oe-kbuild@lists.linux.dev, lkp@intel.com,
oe-kbuild-all@lists.linux.dev, linux-kernel@vger.kernel.org,
"Steven Rostedt (Google)" <rostedt@goodmis.org>
Subject: Re: kernel/trace/fprobe.c:59 fprobe_handler() error: uninitialized symbol 'ret'.
Date: Wed, 17 May 2023 20:45:05 +0900 [thread overview]
Message-ID: <20230517204505.f6411ff8ed3f782ae23e1af9@kernel.org> (raw)
In-Reply-To: <d3467332-3d5f-488a-b156-064cbd3d7873@kili.mountain>
Hi Dan,
Sorry, I missed my fix :(
https://lore.kernel.org/all/168100731160.79534.374827110083836722.stgit@devnote2/
That will fix the problem, could you test it?
Thanks,
On Mon, 8 May 2023 08:17:09 +0300
Dan Carpenter <dan.carpenter@linaro.org> wrote:
> tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
> head: 2e1e1337881b0e9844d687982aa54b31b1269b11
> commit: 39d954200bf6ad503c722e44d0be80c7b826fa42 fprobe: Skip exit_handler if entry_handler returns !0
> config: i386-randconfig-m041-20230501 (https://download.01.org/0day-ci/archive/20230506/202305061702.6h3JzCPA-lkp@intel.com/config)
> compiler: gcc-11 (Debian 11.3.0-12) 11.3.0
>
> If you fix the issue, kindly add following tag where applicable
> | Reported-by: kernel test robot <lkp@intel.com>
> | Reported-by: Dan Carpenter <error27@gmail.com>
> | Link: https://lore.kernel.org/r/202305061702.6h3JzCPA-lkp@intel.com/
>
> smatch warnings:
> kernel/trace/fprobe.c:59 fprobe_handler() error: uninitialized symbol 'ret'.
>
> vim +/ret +59 kernel/trace/fprobe.c
>
> cad9931f64dc7f Masami Hiramatsu 2022-03-15 23 static void fprobe_handler(unsigned long ip, unsigned long parent_ip,
> cad9931f64dc7f Masami Hiramatsu 2022-03-15 24 struct ftrace_ops *ops, struct ftrace_regs *fregs)
> cad9931f64dc7f Masami Hiramatsu 2022-03-15 25 {
> 5b0ab78998e325 Masami Hiramatsu 2022-03-15 26 struct fprobe_rethook_node *fpr;
> 76d0de5729c056 Masami Hiramatsu (Google 2023-02-02 27) struct rethook_node *rh = NULL;
> cad9931f64dc7f Masami Hiramatsu 2022-03-15 28 struct fprobe *fp;
> 76d0de5729c056 Masami Hiramatsu (Google 2023-02-02 29) void *entry_data = NULL;
> 39d954200bf6ad Masami Hiramatsu (Google 2023-02-02 30) int bit, ret;
> cad9931f64dc7f Masami Hiramatsu 2022-03-15 31
> cad9931f64dc7f Masami Hiramatsu 2022-03-15 32 fp = container_of(ops, struct fprobe, ops);
> cad9931f64dc7f Masami Hiramatsu 2022-03-15 33 if (fprobe_disabled(fp))
> cad9931f64dc7f Masami Hiramatsu 2022-03-15 34 return;
> cad9931f64dc7f Masami Hiramatsu 2022-03-15 35
> cad9931f64dc7f Masami Hiramatsu 2022-03-15 36 bit = ftrace_test_recursion_trylock(ip, parent_ip);
> cad9931f64dc7f Masami Hiramatsu 2022-03-15 37 if (bit < 0) {
> cad9931f64dc7f Masami Hiramatsu 2022-03-15 38 fp->nmissed++;
> cad9931f64dc7f Masami Hiramatsu 2022-03-15 39 return;
> cad9931f64dc7f Masami Hiramatsu 2022-03-15 40 }
> cad9931f64dc7f Masami Hiramatsu 2022-03-15 41
> 5b0ab78998e325 Masami Hiramatsu 2022-03-15 42 if (fp->exit_handler) {
> 5b0ab78998e325 Masami Hiramatsu 2022-03-15 43 rh = rethook_try_get(fp->rethook);
> 5b0ab78998e325 Masami Hiramatsu 2022-03-15 44 if (!rh) {
> 5b0ab78998e325 Masami Hiramatsu 2022-03-15 45 fp->nmissed++;
> 5b0ab78998e325 Masami Hiramatsu 2022-03-15 46 goto out;
> 5b0ab78998e325 Masami Hiramatsu 2022-03-15 47 }
> 5b0ab78998e325 Masami Hiramatsu 2022-03-15 48 fpr = container_of(rh, struct fprobe_rethook_node, node);
> 5b0ab78998e325 Masami Hiramatsu 2022-03-15 49 fpr->entry_ip = ip;
> 76d0de5729c056 Masami Hiramatsu (Google 2023-02-02 50) if (fp->entry_data_size)
> 76d0de5729c056 Masami Hiramatsu (Google 2023-02-02 51) entry_data = fpr->data;
> 5b0ab78998e325 Masami Hiramatsu 2022-03-15 52 }
> 5b0ab78998e325 Masami Hiramatsu 2022-03-15 53
> 76d0de5729c056 Masami Hiramatsu (Google 2023-02-02 54) if (fp->entry_handler)
> 39d954200bf6ad Masami Hiramatsu (Google 2023-02-02 55) ret = fp->entry_handler(fp, ip, ftrace_get_regs(fregs), entry_data);
> 76d0de5729c056 Masami Hiramatsu (Google 2023-02-02 56)
> 39d954200bf6ad Masami Hiramatsu (Google 2023-02-02 57) /* If entry_handler returns !0, nmissed is not counted. */
> 39d954200bf6ad Masami Hiramatsu (Google 2023-02-02 58) if (rh) {
> 39d954200bf6ad Masami Hiramatsu (Google 2023-02-02 @59) if (ret)
>
> I reported this one earlier. The code assumes that if there is an
> -exit_handler there is also an ->entry_handler(). You had said you
> would just initialized ret = 0;
>
> 39d954200bf6ad Masami Hiramatsu (Google 2023-02-02 60) rethook_recycle(rh);
> 39d954200bf6ad Masami Hiramatsu (Google 2023-02-02 61) else
> 76d0de5729c056 Masami Hiramatsu (Google 2023-02-02 62) rethook_hook(rh, ftrace_get_regs(fregs), true);
> 39d954200bf6ad Masami Hiramatsu (Google 2023-02-02 63) }
> 5b0ab78998e325 Masami Hiramatsu 2022-03-15 64 out:
> cad9931f64dc7f Masami Hiramatsu 2022-03-15 65 ftrace_test_recursion_unlock(bit);
> cad9931f64dc7f Masami Hiramatsu 2022-03-15 66 }
>
> --
> 0-DAY CI Kernel Test Service
> https://github.com/intel/lkp-tests
>
--
Masami Hiramatsu (Google) <mhiramat@kernel.org>
next prev parent reply other threads:[~2023-05-17 11:45 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-08 5:17 kernel/trace/fprobe.c:59 fprobe_handler() error: uninitialized symbol 'ret' Dan Carpenter
2023-05-17 11:45 ` Masami Hiramatsu [this message]
2023-05-17 17:47 ` Dan Carpenter
2023-05-17 22:07 ` Masami Hiramatsu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230517204505.f6411ff8ed3f782ae23e1af9@kernel.org \
--to=mhiramat@kernel.org \
--cc=dan.carpenter@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lkp@intel.com \
--cc=oe-kbuild-all@lists.linux.dev \
--cc=oe-kbuild@lists.linux.dev \
--cc=rostedt@goodmis.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox