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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Date:	Tue, 14 Feb 2012 21:36:52 +0900
From:	Masami Hiramatsu <masami.hiramatsu.pt@...achi.com>
To:	Prashanth Nageshappa <prashanth@...ux.vnet.ibm.com>
Cc:	linux-kernel@...r.kernel.org, ananth@...ibm.com,
	akpm@...ux-foundation.org, jbaron@...hat.com, rostedt@...dmis.org,
	srikar@...ux.vnet.ibm.com, stable@...r.kernel.org
Subject: Re: [PATCH] Return proper error code from register_kprobe()

(2012/02/14 19:53), Prashanth Nageshappa wrote:
> register_kprobe() aborts if the address of the new request falls in a prohibited
> area (such as ftrace pouch, __kprobes annotated functions, non-kernel text
> addresses, jump label text). We however don't return the right error on this
> abort, resulting in incorrect adding/reporting of kprobes (Ex: 'perf probe
> do_fork+18' or 'perf probe mcount')

OK, I see.

> 
> This patch fixes it by returning -EINVAL upon failure.
> 
> Signed-off-by: Ananth N Mavinakayanahalli <ananth@...ibm.com>
> Signed-off-by: Prashanth K Nageshappa<prashanth@...ux.vnet.ibm.com>

However, I can't agree with this change :(, because this
ignores possibilities of -ENOENT error code in other error
paths.

What I'm expecting is, setup an error code where the error
occurs, as below;

        jump_label_lock();
        preempt_disable();
        if (!kernel_text_address((unsigned long) p->addr) ||
            in_kprobes_functions((unsigned long) p->addr) ||
            ftrace_text_reserved(p->addr, p->addr) ||
-           jump_label_text_reserved(p->addr, p->addr))
+           jump_label_text_reserved(p->addr, p->addr)) {
+		ret = -EINVAL;
                goto fail_with_jump_label;
+	}

IMHO, we should change the label name too...

Thank you,

-- 
Masami HIRAMATSU
Software Platform Research Dept. Linux Technology Center
Hitachi, Ltd., Yokohama Research Laboratory
E-mail: masami.hiramatsu.pt@...achi.com
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ