From: Laura Abbott <labbott@redhat.com>
To: "Tobin C. Harding" <me@tobin.cc>, Joe Perches <joe@perches.com>
Cc: Dan Carpenter <error27@gmail.com>,
Kees Cook <keescook@chromium.org>,
Jonathan Corbet <corbet@lwn.net>,
Randy Dunlap <rdunlap@infradead.org>,
Andrew Murray <amurray@mpc-data.co.uk>,
linux-doc@vger.kernel.org, LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] doc: convert printk-formats.txt to rst
Date: Mon, 11 Dec 2017 10:40:54 -0800 [thread overview]
Message-ID: <6ccb79e1-bf1b-0862-ec79-2f3f7763db62@redhat.com> (raw)
In-Reply-To: <20171209063335.GD2191@eros>
On 12/08/2017 10:33 PM, Tobin C. Harding wrote:
> [Adding Laura]
>
> On Fri, Dec 08, 2017 at 06:18:45PM -0800, Joe Perches wrote:
>> On Sat, 2017-12-09 at 12:27 +1100, Tobin C. Harding wrote:
>>> On Fri, Dec 08, 2017 at 01:22:37PM -0800, Joe Perches wrote:
>>
>>>> Outside of the documentation, what could be useful is for
>>>> someone to add a tool to verify %p<foo> extension to
>>>> the typeof address actually passed as an argument.
>>>
>>> This sounds interesting to work no. At first glance I have no idea how
>>> one would go about this. Some form of static analysis would be a good
>>> place to start, right? I'd like to allocate some cycles to this, any
>>> pointers most appreciated.
>>
>> A gcc-plugin would likely work best.
>
> What's the learning curve like in your opinion to do a gcc-plugin. I
> recall reading someplace 'deep understanding of how the compiler works'
> or some such thing. I suppose reading the Dragon book would be a good
> place to start?
>
The hardest part of doing a gcc-plugin is understanding the gccisms.
There isn't much documentation and most of what there is ends up
being "here's how you hook into the compiler at point X" without
showing how you do anything with it. The Dragon book (also known
as "Compilers: Principles, Techniques, and Tools" for those who
haven't heard of it before) is a great resource for general compiler
concepts but it's not helpful for gcc-specific work.
Writing about some of my experiments on my gcc-plugins has been
on my TODO list for a while. 2018 resolution on actually finishing
it perhaps.
> We could also catch pointers being cast to longs and printed with %x
> (and %u) or so I would guess.
>
>> There was some discussion about such a thing here:
>> http://www.openwall.com/lists/kernel-hardening/2017/02/14/38
>
> Did you make much progress with this Laura?
>
Not particularly. I wanted to re-use the kernel's print functionality
in the plugin to automatically check new formats but I went
down a rathole trying to make it work and got side tracked with
other things and never picked it up again.
>> I vaguely recall someone else doing a broader use tool
>> which I believe was not smatch, but my google-fu isn't
>> finding it.
>>
>> It might have been coccinelle based.
>
> thanks,
> Tobin.
>
Thanks,
Laura
next prev parent reply other threads:[~2017-12-11 18:41 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-12-06 1:45 Tobin C. Harding
2017-12-06 7:11 ` Markus Heiser
2017-12-06 7:35 ` Joe Perches
2017-12-06 17:55 ` Randy Dunlap
2017-12-06 18:18 ` Randy Dunlap
2017-12-06 21:16 ` Tobin C. Harding
2017-12-07 0:39 ` Randy Dunlap
2017-12-07 5:25 ` Tobin C. Harding
2017-12-06 22:11 ` Tobin C. Harding
2017-12-06 18:23 ` Jonathan Corbet
2017-12-06 21:30 ` Tobin C. Harding
2017-12-07 22:50 ` Kees Cook
2017-12-07 23:01 ` Jonathan Corbet
2017-12-07 23:50 ` Tobin C. Harding
2017-12-07 23:44 ` Tobin C. Harding
2017-12-08 0:19 ` Kees Cook
2017-12-08 0:46 ` Tobin C. Harding
2017-12-08 21:06 ` Kees Cook
2017-12-08 21:22 ` Joe Perches
2017-12-09 1:27 ` Tobin C. Harding
2017-12-09 2:18 ` Joe Perches
2017-12-09 6:33 ` Tobin C. Harding
2017-12-11 18:40 ` Laura Abbott [this message]
2017-12-09 11:48 ` Dan Carpenter
2017-12-11 0:51 ` Kees Cook
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=6ccb79e1-bf1b-0862-ec79-2f3f7763db62@redhat.com \
--to=labbott@redhat.com \
--cc=amurray@mpc-data.co.uk \
--cc=corbet@lwn.net \
--cc=error27@gmail.com \
--cc=joe@perches.com \
--cc=keescook@chromium.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=me@tobin.cc \
--cc=rdunlap@infradead.org \
/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
Powered by JetHome