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

Re: [Xen-devel] [PATCH v2] vsprintf: Make sure argument to %pX specifier is valid



On 02/12/2015 11:33 AM, Boris Ostrovsky wrote:


Also, for %*ph format, if we just go with falling through to plain format and not marking somehow that we are printing a bad pointer:

    unsigned badval = 0xab;
    unsigned *badptr = &badval;
    printk("badptr = %*ph\n", 1, badptr);

console:
    badptr = ab

We don't know here whether badptr was pointing to 0xab or it itself was 0xab.


Ugh, bad example. Here is what I meant:

    unsigned badval = 0xab;
    unsigned *badptr = &badval;
    unsigned *badvalptr = (void *)0xab;
    printk("badvalptr = %*ph badptr = %*ph\n", 1, badvalptr, 1, badptr);

console:
    badvalptr = ab badptr = ab


Sorry.

-boris


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.