mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel@ffwll.ch>
To: Nicolas Iooss <nicolas.iooss_linux@m4x.org>
Cc: "Emil Velikov" <emil.l.velikov@gmail.com>,
	"Terje Bergström" <tbergstrom@nvidia.com>,
	"Alison Wang" <alison.wang@freescale.com>,
	"Stephen Warren" <swarren@wwwdotorg.org>,
	"Linux-Kernel@Vger. Kernel. Org" <linux-kernel@vger.kernel.org>,
	"ML dri-devel" <dri-devel@lists.freedesktop.org>,
	linux-tegra@vger.kernel.org
Subject: Re: [PATCH 1/2] drm: make drm_dev_set_unique() not use a format string
Date: Fri, 11 Dec 2015 09:12:26 +0100	[thread overview]
Message-ID: <20151211081226.GV20822@phenom.ffwll.local> (raw)
In-Reply-To: <56676D5A.6060605@m4x.org>

On Wed, Dec 09, 2015 at 12:52:58AM +0100, Nicolas Iooss wrote:
> On 12/09/2015 12:28 AM, Emil Velikov wrote:
> > On 8 December 2015 at 22:12, Nicolas Iooss <nicolas.iooss_linux@m4x.org> wrote:
> >> drm_dev_set_unique() uses a format string to define the unique name of a
> >> device.  This feature is not used as currently all the calls to this
> >> function either use "%s" as a format string or directly use
> >> dev_name().
> >>
> >> Even though this second kind of call does not introduce security
> >> problems, because there cannot be "%" characters in dev_name() results,
> >> gcc issues a warning when building with -Wformat-security flag
> >> ("warning: format string is not a string literal (potentially
> >> insecure)").  This warning is useful to find real bugs like the one
> >> fixed by commit 3958b79266b1 ("configfs: fix kernel infoleak through
> >> user-controlled format string").  False positives which do not bring
> >> an extra value make the work of finding real bugs harder.
> >>
> >> Therefore remove the format-string feature from drm_dev_set_unique().
> >>
> >> Signed-off-by: Nicolas Iooss <nicolas.iooss_linux@m4x.org>
> >> ---
> >>  drivers/gpu/drm/drm_drv.c                   | 11 +++--------
> >>  drivers/gpu/drm/nouveau/nouveau_drm.c       |  2 +-
> >>  drivers/gpu/drm/rockchip/rockchip_drm_drv.c |  2 +-
> >>  include/drm/drmP.h                          |  2 +-
> >>  4 files changed, 6 insertions(+), 11 deletions(-)
> >>
> >> diff --git a/drivers/gpu/drm/drm_drv.c b/drivers/gpu/drm/drm_drv.c
> >> index 7dd6728dd092..20eaa0aae205 100644
> >> --- a/drivers/gpu/drm/drm_drv.c
> >> +++ b/drivers/gpu/drm/drm_drv.c
> >> @@ -797,7 +797,7 @@ EXPORT_SYMBOL(drm_dev_unregister);
> >>  /**
> >>   * drm_dev_set_unique - Set the unique name of a DRM device
> >>   * @dev: device of which to set the unique name
> >> - * @fmt: format string for unique name
> >> + * @name: unique name
> >>   *
> >>   * Sets the unique name of a DRM device using the specified format string and
> >>   * a variable list of arguments. Drivers can use this at driver probe time if
> > You might want to also update the above hunk :-)
> 
> Indeed, thanks! I will wait a little bit for other feedbacks, read all
> the comments/documentation to see if anything else needs an update and
> submit a v2.

fyi 4.5 window for drm is closing in the next few days (because holidays
and all that). Please resend soon, otherwise it might miss and get delayed
to 4.6.
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch

  reply	other threads:[~2015-12-11  8:12 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-08 22:12 Nicolas Iooss
2015-12-08 22:12 ` [PATCH 2/2] drm: use dev_name as default unique name in drm_dev_alloc() Nicolas Iooss
2015-12-09 13:25   ` Boris Brezillon
2015-12-08 23:28 ` [PATCH 1/2] drm: make drm_dev_set_unique() not use a format string Emil Velikov
2015-12-08 23:52   ` Nicolas Iooss
2015-12-11  8:12     ` Daniel Vetter [this message]
2015-12-11 10:20       ` [PATCH v2 " Nicolas Iooss
2015-12-11 10:20         ` [PATCH v2 2/2] drm: use dev_name as default unique name in drm_dev_alloc() Nicolas Iooss
2015-12-15 13:10           ` 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=20151211081226.GV20822@phenom.ffwll.local \
    --to=daniel@ffwll.ch \
    --cc=alison.wang@freescale.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=emil.l.velikov@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tegra@vger.kernel.org \
    --cc=nicolas.iooss_linux@m4x.org \
    --cc=swarren@wwwdotorg.org \
    --cc=tbergstrom@nvidia.com \
    /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