mirror of
https://github.com/torvalds/linux.git
synced 2026-10-16 12:50:02 +02:00
The QAT driver exposes a character device (qat_adf_ctl) with IOCTLs
for device configuration, start, stop, status query and enumeration.
These IOCTLs are not part of any public uAPI header and have no known
in-tree or out-of-tree users. Device lifecycle is already managed via
sysfs.
The ioctl interface also increases the attack surface and is the
subject of a number of bug reports.
Remove the character device, the IOCTL definitions, and the related
data structures (adf_dev_status_info, adf_user_cfg_key_val,
adf_user_cfg_section, adf_user_cfg_ctl_data). Drop the now-unused
adf_cfg_user.h header and strip adf_ctl_drv.c down to the minimal
module_init/module_exit hooks for workqueue, AER, and crypto/compression
algorithm registration.
Clean up leftover dead code that was only reachable from the removed
IOCTL paths: adf_cfg_del_all(), adf_devmgr_verify_id(),
adf_devmgr_get_num_dev(), adf_devmgr_get_dev_by_id(),
adf_get_vf_real_id() and the unused ADF_CFG macros.
Additionally, drop the entry associated to QAT IOCTLs in
ioctl-number.rst.
Cc: stable@vger.kernel.org
Fixes: d8cba25d2c ("crypto: qat - Intel(R) QAT driver framework")
Reported-by: Zhi Wang <wangzhi@stu.xidian.edu.cn>
Reported-by: Bin Yu <byu@xidian.edu.cn>
Reported-by: MingYu Wang <w15303746062@163.com>
Closes: https://lore.kernel.org/all/61d6d499.ab89.19b9b7f3186.Coremail.wangzhi_xd@stu.xidian.edu.cn/
Link: https://lore.kernel.org/all/20260508034841.256794-1-w15303746062@163.com/
Link: https://lore.kernel.org/all/20260508023542.256299-1-w15303746062@163.com/
Link: https://lore.kernel.org/all/20260504025120.98242-1-w15303746062@163.com/
Signed-off-by: Giovanni Cabiddu <giovanni.cabiddu@intel.com>
Reviewed-by: Ahsan Atta <ahsan.atta@intel.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
47 lines
1.4 KiB
C
47 lines
1.4 KiB
C
/* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0-only) */
|
|
/* Copyright(c) 2014 - 2020 Intel Corporation */
|
|
#ifndef ADF_CFG_H_
|
|
#define ADF_CFG_H_
|
|
|
|
#include <linux/list.h>
|
|
#include <linux/rwsem.h>
|
|
#include <linux/debugfs.h>
|
|
#include "adf_accel_devices.h"
|
|
#include "adf_cfg_common.h"
|
|
#include "adf_cfg_strings.h"
|
|
|
|
struct adf_cfg_key_val {
|
|
char key[ADF_CFG_MAX_KEY_LEN_IN_BYTES];
|
|
char val[ADF_CFG_MAX_VAL_LEN_IN_BYTES];
|
|
enum adf_cfg_val_type type;
|
|
struct list_head list;
|
|
};
|
|
|
|
struct adf_cfg_section {
|
|
char name[ADF_CFG_MAX_SECTION_LEN_IN_BYTES];
|
|
struct list_head list;
|
|
struct list_head param_head;
|
|
};
|
|
|
|
struct adf_cfg_device_data {
|
|
struct list_head sec_list;
|
|
struct dentry *debug;
|
|
struct rw_semaphore lock;
|
|
};
|
|
|
|
int adf_cfg_dev_add(struct adf_accel_dev *accel_dev);
|
|
void adf_cfg_dev_remove(struct adf_accel_dev *accel_dev);
|
|
void adf_cfg_dev_dbgfs_add(struct adf_accel_dev *accel_dev);
|
|
void adf_cfg_dev_dbgfs_rm(struct adf_accel_dev *accel_dev);
|
|
int adf_cfg_section_add(struct adf_accel_dev *accel_dev, const char *name);
|
|
void adf_cfg_del_all_except(struct adf_accel_dev *accel_dev,
|
|
const char *section_name);
|
|
int adf_cfg_add_key_value_param(struct adf_accel_dev *accel_dev,
|
|
const char *section_name,
|
|
const char *key, const void *val,
|
|
enum adf_cfg_val_type type);
|
|
int adf_cfg_get_param_value(struct adf_accel_dev *accel_dev,
|
|
const char *section, const char *name, char *value);
|
|
|
|
#endif
|