netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Richard Cochran <richardcochran@gmail.com>
To: <netdev@vger.kernel.org>
Cc: David Miller <davem@davemloft.net>
Subject: [PATCH net-next 0/1] net: validate HWTSTAMP ioctl parameters
Date: Fri, 14 Oct 2011 11:37:47 +0200	[thread overview]
Message-ID: <cover.1318584677.git.richard.cochran@omicron.at> (raw)
In-Reply-To: <20110926.160443.1205173553442138535.davem@davemloft.net>

Okay, here is a patch to check the ioctl.

I took the liberty to check both the Rx and Tx fields. I coded the
check rather pedantically, using a switch/case over the enumerated
values. The advantage of this style is that the compiler will warn
if someone adds a new enum into net_tstamp.h without fixing the
checking function in dev.c.

Richard Cochran (1):
  net: validate HWTSTAMP ioctl parameters

 include/linux/net_tstamp.h |    4 +-
 net/core/dev.c             |   58 ++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 60 insertions(+), 2 deletions(-)

-- 
1.7.2.5

  parent reply	other threads:[~2011-10-14  9:37 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-20 11:43 [PATCH net-next 0/3] ptp: feature enhancements Richard Cochran
2011-09-20 11:43 ` [PATCH net-next 1/3] dp83640: enable six external events and one periodic output Richard Cochran
2011-09-20 11:43 ` [PATCH net-next 2/3] net: introduce ptp one step time stamp mode for sync packets Richard Cochran
2011-09-20 11:43 ` [PATCH net-next 3/3] dp83640: add time stamp insertion for sync messages Richard Cochran
2011-09-26 20:04 ` [PATCH net-next 0/3] ptp: feature enhancements David Miller
2011-09-28  8:00   ` Richard Cochran
2011-09-28  8:17     ` David Miller
2011-10-14  9:37   ` Richard Cochran [this message]
2011-10-14  9:37   ` [PATCH net-next 1/1] net: validate HWTSTAMP ioctl parameters Richard Cochran
2011-10-19 21:01     ` David Miller
2011-10-19 21:16     ` Ben Hutchings
2011-10-20 16:35       ` Richard Cochran

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=cover.1318584677.git.richard.cochran@omicron.at \
    --to=richardcochran@gmail.com \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.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;
as well as URLs for NNTP newsgroup(s).