Skip to contentSkip to conversation

[2.5.47]Add exported valid_kernel_address()

PATCH Andi Kleen 2 participants 3 messages Nov 13, 2002 2 messages not in the archive

lore
Share & tools
lore

Andi Kleen

author
#2 lore raw
In reply to a message not in the archive
Quoted 2 lines · Arjan van de Ven

it is customary that people who ask for an export explain why they need it.... would you mind explaining that ?

For modular lkcd I guess. Make a lot of sense to do it modular.

-Andi

#3 lore raw

I had a need for it in a sample kprobes driver where I wanted to verify that some address
was a valid kernel space address before I handed a probe to kprobes.

So I would do something like:

if (!valid_kernel_address(probe->addr)) {
    ret = -EINVAL;
    goto out;
}

register_kprobe(probe);

and then kpboes will go and attempt to set *(probe->addr) = BREAK_POINT;

-rustyl
----- Original Message -----
From: "Andi Kleen" <[email protected]>
To: "Arjan van de Ven" <[email protected]>
Cc: <[email protected]>; <[email protected]>
Sent: Wednesday, November 13, 2002 1:14 PM
Subject: Re: [PATCH][2.5.47]Add exported valid_kernel_address()

Quoted 8 lines
Quoted 2 lines · Arjan van de Ven

it is customary that people who ask for an export explain why they need it.... would you mind explaining that ?

For modular lkcd I guess. Make a lot of sense to do it modular.

-Andi

#4 lore raw

To clarify further, I am talking about the sample driver I submitted earlier at
http://marc.theaimsgroup.com/?l=linux-kernel&m=103721364225087&w=2

The patch implements a char device that enables arbitrary printk's to be inserted at in arbitrary kernel addresses. It is used by writing strings of the
form "0xADDRESS MESSAGE" to the device.

I was looking for a way to verify the address passed in was valid before creating and inserting a new probe.

Maybe there is a better way to verify a kernel address is valid before messing
with it?

-rusty
----- Original Message -----
From: "Rusty Lynch" <[email protected]>
To: "Arjan van de Ven" <[email protected]>; "Andi Kleen" <[email protected]>
Cc: <[email protected]>; <[email protected]>
Sent: Wednesday, November 13, 2002 1:24 PM
Subject: Re: [PATCH][2.5.47]Add exported valid_kernel_address()

Quoted 1 line

I had a need for it in a sample kprobes driver where I wanted to verify

that

Quoted 14 lines

some address
was a valid kernel space address before I handed a probe to kprobes.

So I would do something like:

if (!valid_kernel_address(probe->addr)) {
    ret = -EINVAL;
    goto out;
}

register_kprobe(probe);

and then kpboes will go and attempt to set *(probe->addr) = BREAK_POINT;

Quoted 12 lines

-rustyl
----- Original Message -----
From: "Andi Kleen" <[email protected]>
To: "Arjan van de Ven" <[email protected]>
Cc: <[email protected]>; <[email protected]>
Sent: Wednesday, November 13, 2002 1:14 PM
Subject: Re: [PATCH][2.5.47]Add exported valid_kernel_address()

Quoted 3 lines
Quoted 1 line · Arjan van de Ven

it is customary that people who ask for an export explain why they

need

Quoted 11 lines
Quoted 5 lines
Quoted 1 line

it.... would you mind explaining that ?

For modular lkcd I guess. Make a lot of sense to do it modular.

-Andi

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/