Received: by 2002:a05:7412:f589:b0:e2:908c:2ebd with SMTP id eh9csp1148028rdb; Wed, 1 Nov 2023 12:42:04 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFiDMZjHYLo5ktV72pmjNXdO9xddxHbUoUZKhs40EigHoerksv8jhhuhUcmz2sSWAyGn8gb X-Received: by 2002:a05:6a20:9189:b0:156:e1ce:d4a1 with SMTP id v9-20020a056a20918900b00156e1ced4a1mr17082663pzd.9.1698867723773; Wed, 01 Nov 2023 12:42:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698867723; cv=none; d=google.com; s=arc-20160816; b=Pfarw7PfelANxdpgQwW+gEaIaUkNpfVh7JtxvK3/riCXg4Gs75+UcgdshVreXSqP5C HKvyHmI8MxF7++BJtfw5pcb2oYQQFu9794qiv4cNe/+OIqNa712xnAWu3FSC8HIasysO /RXNwm67mQbZW1vD2c41G8co3Srd1d8zVie4QTf3NkW2NR/79JBGIER20HS9oSRPlyAz M/ZYXAtxFYXC8AbCXHRwHxzzEruOrPfM+lyoIyOOcDotIfyoDx4j9RBHGu7ocxsmmczS ICBe316jiywNzMTgxmNjbEyAk+GKJrrO3wpf9VxxDrP9Sq1yy4xpaN//MsnYF4l7O7fN HzXA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:message-id:content-transfer-encoding :mime-version:subject:date:from:dkim-signature; bh=Fr9tumZCcNcjPS9MRqgoMhcJW8WAY/B2NZrSK3jkH0I=; fh=gcZfINLf3WZTb4Z6s2y3641pf9xlvT2zfmZlaAaHFsg=; b=Tw/x8ezc0RXB27HYqgqfvybLXE3fSiTT8RuwDaWgacSfKYL0WszhCwJoP3Mn3mLBcf EoAKf4OsLmoA+BnVza6ipnGJPvUICsi8qeGyMZmK9m5PriFxO7BN9i23colbB174Ty8w YBllPVbAKvDSsp4Xj0yKYKRP5yd/9KJGVfilLYfRxHZvnMluWvnOFloqxOIPiQoW5IXD W3STYo0DOTW9PjfgdLj4af9WBZ3/R3Uh+Jq7JOoNOs38kgPX2dTd/vr5RsfCeLG/CHWq RhIahb3eqbEw7BdaQcphuWIusbT+1htD6wkl/SKNEBhNGgvs6uYZx2UF8wujXCwLAOUN U4yg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@weissschuh.net header.s=mail header.b=RgKkttjK; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id bi4-20020a056a02024400b005b8a29aae85si600972pgb.78.2023.11.01.12.42.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Nov 2023 12:42:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@weissschuh.net header.s=mail header.b=RgKkttjK; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 7F077807EA3A; Wed, 1 Nov 2023 12:41:55 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347915AbjKATlz (ORCPT + 52 others); Wed, 1 Nov 2023 15:41:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34624 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346179AbjKATlz (ORCPT ); Wed, 1 Nov 2023 15:41:55 -0400 Received: from todd.t-8ch.de (todd.t-8ch.de [159.69.126.157]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9CC4FBD; Wed, 1 Nov 2023 12:41:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=weissschuh.net; s=mail; t=1698867702; bh=6kOOEsQgA20o02ni+Bbcpima7j16ISpDSfIVR3lmAHo=; h=From:Date:Subject:To:Cc:From; b=RgKkttjK6JHbUkNCJEGKwSUQBo2D1LVV/CtJA/BRdiAsNkuvWgT6mc1CrYE1EBw+T JDfPyoDOK7LpDXTsVsBEHmLc55HZpiHWgHv1Hg09HxHobbPMFTnwWzpJyyRkzOmBCq H7uX0orZAkqBQSWVtQ1Rlo5aSIiV+UnbFeXwktDs= From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= Date: Wed, 01 Nov 2023 20:41:38 +0100 Subject: [PATCH] rfkill: return ENOTTY on invalid ioctl MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Message-Id: <20231101-rfkill-ioctl-enosys-v1-1-5bf374fabffe@weissschuh.net> X-B4-Tracking: v=1; b=H4sIAPGpQmUC/x3MwQqDMAyA4VeRnBdIqqe9iuzQ1tQFSzuaMSbiu 1s8fof/P8CkqRg8hwOa/NS0lg5+DBDfvqyCunSDIzcyE2NLm+aMWuM3o5RquyGRdyGQn3xg6OW nSdL/fZ1f53kBxrK472UAAAA= To: Johannes Berg , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni Cc: linux-wireless@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Mailer: b4 0.12.4 X-Developer-Signature: v=1; a=ed25519-sha256; t=1698867702; l=1027; i=linux@weissschuh.net; s=20221212; h=from:subject:message-id; bh=6kOOEsQgA20o02ni+Bbcpima7j16ISpDSfIVR3lmAHo=; b=PCouzUkWjCX8b4EyQv4Oh3mGh+icPABvcaSCwi8ZKWWfm0MN7wtPhGOZZZJDZDHZZRhHXGuo9 tX5Sr1txgKVDl411lumTlUJq0mY1eBz57bA4bczvxT3dg+jVfF8vYW3 X-Developer-Key: i=linux@weissschuh.net; a=ed25519; pk=KcycQgFPX2wGR5azS7RhpBqedglOZVgRPfdFSPB1LNw= X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Wed, 01 Nov 2023 12:41:55 -0700 (PDT) For unknown ioctls the correct error is ENOTTY "Inappropriate ioctl for device". ENOSYS as returned before should only be used to indicate that a syscall is not available at all. Signed-off-by: Thomas Weißschuh --- net/rfkill/core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/net/rfkill/core.c b/net/rfkill/core.c index 14cc8fe8584b..c3feb4f49d09 100644 --- a/net/rfkill/core.c +++ b/net/rfkill/core.c @@ -1351,11 +1351,11 @@ static long rfkill_fop_ioctl(struct file *file, unsigned int cmd, unsigned long arg) { struct rfkill_data *data = file->private_data; - int ret = -ENOSYS; + int ret = -ENOTTY; u32 size; if (_IOC_TYPE(cmd) != RFKILL_IOC_MAGIC) - return -ENOSYS; + return -ENOTTY; mutex_lock(&data->mtx); switch (_IOC_NR(cmd)) { --- base-commit: 7d461b291e65938f15f56fe58da2303b07578a76 change-id: 20231101-rfkill-ioctl-enosys-00a2bb0a4ab1 Best regards, -- Thomas Weißschuh