mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Masami Hiramatsu <mhiramat@kernel.org>
To: Al Viro <viro@ZenIV.linux.org.uk>
Cc: mhiramat@kernel.org, Steven Rostedt <rostedt@goodmis.org>,
	Dmitry Safonov <0x7f454c46@gmail.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [RFC] apparent bogosity in unregister_ftrace_function_probe_func()
Date: Mon, 29 Jan 2018 22:49:44 +0900	[thread overview]
Message-ID: <20180129224944.8d706976e6bcda761905ac0f@kernel.org> (raw)
In-Reply-To: <20180127031706.GE13338@ZenIV.linux.org.uk>

On Sat, 27 Jan 2018 03:17:06 +0000
Al Viro <viro@ZenIV.linux.org.uk> wrote:

> It contains something very odd:
> 
>                 func_g.type = filter_parse_regex(glob, strlen(glob),
>                                                  &func_g.search, &not);
>                 func_g.len = strlen(func_g.search);
>                 func_g.search = glob;
> 
>                 /* we do not support '!' for function probes */
>                 if (WARN_ON(not))
>                         return -EINVAL;
> 
> What the hell is the last assignment for?  After that call of
> filter_parse_regex() we could have func_g.search not equal to glob
> only if glob started with '!' or '*'.  In the former case we would've
> buggered off with -EINVAL (not = 1).  In the latter we would've set
> func_g.search equal to glob + 1, calculated the length of that thing
> in func_g.len and proceeded to reset func_g.search back to glob.

Ah, right. It must be a bug! func_g.search should be assigned in
filter_parse_regex(), and it should be "glob" without "!" if
it is MATCH_GLOB. Of course above assignment should be removed.

Thank you,

-- 
Masami Hiramatsu <mhiramat@kernel.org>

      parent reply	other threads:[~2018-01-29 13:49 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-27  3:17 Al Viro
2018-01-27 13:59 ` Dmitry Safonov
2018-01-27 17:07   ` Al Viro
2018-01-28 10:31     ` Steven Rostedt
2018-01-29 13:59     ` Masami Hiramatsu
2018-02-05 22:54       ` Steven Rostedt
2018-02-06  1:25         ` Dmitry Safonov
2018-02-06  2:26         ` Masami Hiramatsu
2018-02-06  2:40           ` Steven Rostedt
2018-02-06  2:44             ` Dmitry Safonov
2018-02-06  2:48               ` Steven Rostedt
2018-02-06  2:53                 ` Dmitry Safonov
2018-01-29 13:49 ` Masami Hiramatsu [this message]

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=20180129224944.8d706976e6bcda761905ac0f@kernel.org \
    --to=mhiramat@kernel.org \
    --cc=0x7f454c46@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rostedt@goodmis.org \
    --cc=viro@ZenIV.linux.org.uk \
    /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

all inboxes | Powered by JetHome®