mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: "D. Starke" <daniel.starke@siemens.com>
Cc: linux-serial@vger.kernel.org, jirislaby@kernel.org,
	ilpo.jarvinen@linux.intel.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 2/4] tty: n_gsm: add keep alive support
Date: Fri, 3 Feb 2023 17:55:32 +0100	[thread overview]
Message-ID: <Y908hEeZdDw/0Wkp@kroah.com> (raw)
In-Reply-To: <20230203145023.6012-2-daniel.starke@siemens.com>

On Fri, Feb 03, 2023 at 03:50:21PM +0100, D. Starke wrote:
> +struct gsm_config_ext {
> +	__u32 keep_alive;	/* Control channel keep-alive in 1/100th of a
> +				 * second (0 to disable)
> +				 */
> +	__u32 reserved[7];	/* For future use */

You are not checking these fields, so this means any future use of them
will not be allowed (like the problem you have which required this new
structure.)

Please, always verify that the values here are 0, and if not, error out
with -EINVAL.  That's the only way you can properly reserve this for
future use.  The kernel documentation about "how to write an ioctl"
should describe all of this, right?

thanks,

greg k-h

  reply	other threads:[~2023-02-03 16:55 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-03 14:50 [PATCH v3 1/4] tty: n_gsm: mark unusable ioctl structure fields accordingly D. Starke
2023-02-03 14:50 ` [PATCH v3 2/4] tty: n_gsm: add keep alive support D. Starke
2023-02-03 16:55   ` Greg KH [this message]
2023-02-06  6:40     ` Starke, Daniel
2023-02-06 10:25   ` Greg KH
2023-02-06 10:32     ` Starke, Daniel
2023-02-03 14:50 ` [PATCH v3 3/4] tty: n_gsm: add RING/CD control support D. Starke
2023-02-03 14:50 ` [PATCH v3 4/4] tty: n_gsm: add TIOCMIWAIT support D. Starke

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=Y908hEeZdDw/0Wkp@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=daniel.starke@siemens.com \
    --cc=ilpo.jarvinen@linux.intel.com \
    --cc=jirislaby@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@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

all inboxes | Powered by JetHome®