public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Paulo Marques <pmarques@grupopie.com>
To: Luca Falavigna <dktrkranz@gmail.com>
Cc: prasanna@in.ibm.com,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] Kprobes: Verify probepoint in register_jprobe()
Date: Thu, 30 Jun 2005 15:13:01 +0100	[thread overview]
Message-ID: <42C3FDED.8080000@grupopie.com> (raw)
In-Reply-To: <42C2BD26.7090209@gmail.com>

Luca Falavigna wrote:
> [...]
>  int register_jprobe(struct jprobe *jp)
>  {
> -	/* Todo: Verify probepoint is a function entry point */
> +	unsigned long size, offset;
> +	char *modname, namebuf[KSYM_NAME_LEN+1];
> +	
> +	kallsyms_lookup((unsigned long)jp->kp.addr, &size,
> +			&offset, &modname, namebuf);
> +	
> +	if(unlikely(offset))
> +		return -EINVAL;

Hmmm, kallsyms_lookup might return NULL if either the address is not 
found or CONFIG_KALLSYMS is not set, and in this case "offset" is not 
initialized at all before this test.

We should either fail in this case, or accept the address as valid 
without confirmation. I don't have sufficient knowledge about kprobes to 
advise either way, but a test should be made nevertheless (or we could 
just initialize "offset" to 0, if we want to accept the address without 
confirmation).

-- 
Paulo Marques - www.grupopie.com

It is a mistake to think you can solve any major problems
just with potatoes.
Douglas Adams

      parent reply	other threads:[~2005-06-30 14:14 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-06-29 15:24 [PATCH] Kprobes: Verify probepoint in register_jprobe() Luca Falavigna
2005-06-29 18:31 ` Andrew Morton
2005-06-30 14:13 ` Paulo Marques [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=42C3FDED.8080000@grupopie.com \
    --to=pmarques@grupopie.com \
    --cc=dktrkranz@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=prasanna@in.ibm.com \
    /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