From: Richard Leitner <me@g0hl1n.net>
To: dmitry.torokhov@gmail.com
Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org,
richard.leitner@skidata.com
Subject: [RFC] avoid (theoretical) conflicts of input device file names
Date: Wed, 8 Oct 2014 22:49:29 +0200 [thread overview]
Message-ID: <20141008224929.290e6403@frodo> (raw)
In-Reply-To: <20141008224245.601a1339@frodo>
Hi,
currently I discovered the possibility that device file numbers of the input
subsystem could go negative when the signed int "border" is passed. To fix
this behaviour I sent a patch a few minutes ago.
But as the subject says there is currently the (theoretical) possibility that
the same input device file name is given out twice. This can happen if the
"input_no" variable had an overflow (due to the fact this is at least at 2^32
I call the issue theoretical). If such a case occurs a -EEXISTS is returned at
the creation of the file.
IMHO it would be a good idea to check if the chosen input device file name
is valid at the point it is created (which is currently input_allocate_device).
So you can just increment and check it again until there's a valid number/name
found for it.
I'm pretty new to the input subsystem, so what do you think about it?
Any comments/ideas? Would there be a better place to do such checking?
regards,
richard
next prev parent reply other threads:[~2014-10-08 20:49 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-08 20:42 [PATCH] input: avoid negative input device numbers Richard Leitner
2014-10-08 20:49 ` Richard Leitner [this message]
2014-10-08 21:30 ` [RFC] avoid (theoretical) conflicts of input device file names Dmitry Torokhov
2014-10-08 21:25 ` [PATCH] input: avoid negative input device numbers Dmitry Torokhov
2014-10-08 21:30 ` Dmitry Torokhov
2014-10-08 21:49 ` Richard Leitner
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=20141008224929.290e6403@frodo \
--to=me@g0hl1n.net \
--cc=dmitry.torokhov@gmail.com \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=richard.leitner@skidata.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;
as well as URLs for NNTP newsgroup(s).