From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D4BE8C05027 for ; Fri, 3 Feb 2023 16:55:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233462AbjBCQzr (ORCPT ); Fri, 3 Feb 2023 11:55:47 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45092 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233469AbjBCQzn (ORCPT ); Fri, 3 Feb 2023 11:55:43 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 04BE592ED8; Fri, 3 Feb 2023 08:55:38 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 7B589B82B5D; Fri, 3 Feb 2023 16:55:37 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 67AB0C433D2; Fri, 3 Feb 2023 16:55:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1675443336; bh=B//YUVaIiSV2E2LbWZWR0CqUFx1R9kgHWXA//oVYOPY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=BkABXimJeg2L6LOoJYfXZJzHkkQRBWIYRK3PhqIho3/A8ztv4tFpTnyVEcqnNmMf2 rTHntBckGDws8SYRWPN8XIO0o7cgWwqY7oeXW/wN5lmBcJwJLHVoxuc7zCWc4jGt3c X6QZDqacUsj/8VLWyCJ3Bdd1ZZjhJcTtdZ7B3ATs= Date: Fri, 3 Feb 2023 17:55:32 +0100 From: Greg KH To: "D. Starke" 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 Message-ID: References: <20230203145023.6012-1-daniel.starke@siemens.com> <20230203145023.6012-2-daniel.starke@siemens.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230203145023.6012-2-daniel.starke@siemens.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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