From: Mika Kuoppala <mika.kuoppala@linux.intel.com>
To: Kees Cook <keescook@chromium.org>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 1/1] drm/i915: shorten i915_next_seqno debugfs output
Date: Fri, 12 Apr 2013 12:15:54 +0300 [thread overview]
Message-ID: <878v4oxg6t.fsf@gaia.fi.intel.com> (raw)
In-Reply-To: <CAGXu5jLUkYwcDdvXe+-24CQPxGDOZm_SjT_4ab7Z0YZRVfqPPQ@mail.gmail.com>
Kees Cook <keescook@chromium.org> writes:
> On Thu, Apr 11, 2013 at 9:15 AM, Mika Kuoppala
> <mika.kuoppala@linux.intel.com> wrote:
>> Kees Cook <keescook@chromium.org> writes:
>>
>>> On Thu, Apr 11, 2013 at 6:22 AM, Mika Kuoppala
>>> <mika.kuoppala@linux.intel.com> wrote:
>>>> commit 647416f9eefe7699754b01b9fc82758fde83248c
>>>> Author: Kees Cook <keescook@chromium.org>
>>>> Date: Sun Mar 10 14:10:06 2013 -0700
>>>>
>>>> drm/i915: use simple attribute in debugfs routines
>>>>
>>>> made i915_next_seqno debugfs entry to crop it's output
>>>> if returned value was large enough. Using simple_attr
>>>> will limit the output to 24 bytes. Fix this by returning
>>>> only the value and nothing else.
>>>>
>>>> Cc: Kees Cook <keescook@chromium.org>
>>>> Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com>
>>>
>>> Oh! Thanks for catching that. What a weird limitation.
>>>
>>> What about max freq, min freq, and wedged? Do those run the risk of
>>> truncation too?
>>
>> max and min freq should be safe, and wedged too on 32bit platforms.
>> But if gpu is declared wedged on host with 64bit atomic_t,
>> it will crop the output.
>
> Should we consider proposing an increase in the size of the simple
> attr buffer? It seems silly to provide an arbitrary format string but
> leave the buffer so small.
That or dynamic allocation to attr->get_buf. But that would need
extra pass with snprintf and I don't know if that qualifies as 'simple'
anymore.
I have posted a patch which fixes all i915 debugfs simple attributes
to fit into the simple_attr by removing everything except the fmt to
value. I didn't find any testcases which would rely on preample
being there.
--Mika
next prev parent reply other threads:[~2013-04-12 9:16 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-04-11 13:22 [PATCH 1/1] drm/i915: shorten i915_next_seqno debugfs output Mika Kuoppala
2013-04-11 16:02 ` Kees Cook
2013-04-11 16:15 ` Mika Kuoppala
2013-04-11 16:42 ` Kees Cook
2013-04-12 9:15 ` Mika Kuoppala [this message]
2013-04-12 17:57 ` Kees Cook
2013-04-12 9:10 ` [PATCH] drm/i915: shorten debugfs output simple attributes Mika Kuoppala
2013-04-12 18:00 ` Kees Cook
2013-04-16 7:33 ` Daniel Vetter
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=878v4oxg6t.fsf@gaia.fi.intel.com \
--to=mika.kuoppala@linux.intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=keescook@chromium.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