Re: where are __chk_user_ptr and __chk_io_ptr defined?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

ninjaboy <n0b0dyn1nj4@xxxxxxxxx> writes:

> 2008/7/18 Robert P. J. Day <rpjday@xxxxxxxxxxxxxx>:
>>
>>  from <linux/compiler.h>:
>>
>>    extern void __chk_user_ptr(const volatile void __user *);
>>    extern void __chk_io_ptr(const volatile void __iomem *);
>>
>>  ok, so ... where are those routines defined?  i've grep'ped and i
>> don't see the definitions.  am i missing something?
>
> They are not defined, this is a trick to take an error at compile
> time, where there is probably an if(sizeof(something) > {1,2,4,8}).

This is not a linker-trap.

I have this in include/linux/compiler.h:

#ifdef __CHECKER__
[...]
extern void __chk_user_ptr(const volatile void __user *);
extern void __chk_io_ptr(const volatile void __iomem *);
[...]
#else
[...]
# define __chk_user_ptr(x) (void)0
# define __chk_io_ptr(x) (void)0
[...]
#endif

If sparse sees this, it will check the argument types.  In normal
compile runs, this will just be thrown out.

	Hannes, wild guessing

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux