Compare commits
16 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 213f323329 | |||
| 876ca389c9 | |||
| a745dda98d | |||
| ffdf9f8550 | |||
| 061fe185e1 | |||
| d3bb68fa8d | |||
| 6d389a66cc | |||
| a71ec88ae6 | |||
| 9f1e27c040 | |||
| 38df15cb4c | |||
| da6f408425 | |||
| a016619f05 | |||
| 1eaed405fc | |||
| a0a91211dd | |||
| 3dede8ebf4 | |||
| 122414e2d2 |
2
Makefile
2
Makefile
@ -1,7 +1,7 @@
|
||||
# SPDX-License-Identifier: GPL-2.0
|
||||
VERSION = 5
|
||||
PATCHLEVEL = 9
|
||||
SUBLEVEL = 0
|
||||
SUBLEVEL = 1
|
||||
EXTRAVERSION =
|
||||
NAME = Kleptomaniac Octopus
|
||||
|
||||
|
||||
@ -2930,7 +2930,6 @@ static int aead_gcm_ccm_setkey(struct crypto_aead *cipher,
|
||||
|
||||
ctx->enckeylen = keylen;
|
||||
ctx->authkeylen = 0;
|
||||
memcpy(ctx->enckey, key, ctx->enckeylen);
|
||||
|
||||
switch (ctx->enckeylen) {
|
||||
case AES_KEYSIZE_128:
|
||||
@ -2946,6 +2945,8 @@ static int aead_gcm_ccm_setkey(struct crypto_aead *cipher,
|
||||
goto badkey;
|
||||
}
|
||||
|
||||
memcpy(ctx->enckey, key, ctx->enckeylen);
|
||||
|
||||
flow_log(" enckeylen:%u authkeylen:%u\n", ctx->enckeylen,
|
||||
ctx->authkeylen);
|
||||
flow_dump(" enc: ", ctx->enckey, ctx->enckeylen);
|
||||
@ -3000,6 +3001,10 @@ static int aead_gcm_esp_setkey(struct crypto_aead *cipher,
|
||||
struct iproc_ctx_s *ctx = crypto_aead_ctx(cipher);
|
||||
|
||||
flow_log("%s\n", __func__);
|
||||
|
||||
if (keylen < GCM_ESP_SALT_SIZE)
|
||||
return -EINVAL;
|
||||
|
||||
ctx->salt_len = GCM_ESP_SALT_SIZE;
|
||||
ctx->salt_offset = GCM_ESP_SALT_OFFSET;
|
||||
memcpy(ctx->salt, key + keylen - GCM_ESP_SALT_SIZE, GCM_ESP_SALT_SIZE);
|
||||
@ -3028,6 +3033,10 @@ static int rfc4543_gcm_esp_setkey(struct crypto_aead *cipher,
|
||||
struct iproc_ctx_s *ctx = crypto_aead_ctx(cipher);
|
||||
|
||||
flow_log("%s\n", __func__);
|
||||
|
||||
if (keylen < GCM_ESP_SALT_SIZE)
|
||||
return -EINVAL;
|
||||
|
||||
ctx->salt_len = GCM_ESP_SALT_SIZE;
|
||||
ctx->salt_offset = GCM_ESP_SALT_OFFSET;
|
||||
memcpy(ctx->salt, key + keylen - GCM_ESP_SALT_SIZE, GCM_ESP_SALT_SIZE);
|
||||
@ -3057,6 +3066,10 @@ static int aead_ccm_esp_setkey(struct crypto_aead *cipher,
|
||||
struct iproc_ctx_s *ctx = crypto_aead_ctx(cipher);
|
||||
|
||||
flow_log("%s\n", __func__);
|
||||
|
||||
if (keylen < CCM_ESP_SALT_SIZE)
|
||||
return -EINVAL;
|
||||
|
||||
ctx->salt_len = CCM_ESP_SALT_SIZE;
|
||||
ctx->salt_offset = CCM_ESP_SALT_OFFSET;
|
||||
memcpy(ctx->salt, key + keylen - CCM_ESP_SALT_SIZE, CCM_ESP_SALT_SIZE);
|
||||
|
||||
@ -828,6 +828,11 @@ static int qat_alg_aead_dec(struct aead_request *areq)
|
||||
struct icp_qat_fw_la_bulk_req *msg;
|
||||
int digst_size = crypto_aead_authsize(aead_tfm);
|
||||
int ret, ctr = 0;
|
||||
u32 cipher_len;
|
||||
|
||||
cipher_len = areq->cryptlen - digst_size;
|
||||
if (cipher_len % AES_BLOCK_SIZE != 0)
|
||||
return -EINVAL;
|
||||
|
||||
ret = qat_alg_sgl_to_bufl(ctx->inst, areq->src, areq->dst, qat_req);
|
||||
if (unlikely(ret))
|
||||
@ -842,7 +847,7 @@ static int qat_alg_aead_dec(struct aead_request *areq)
|
||||
qat_req->req.comn_mid.src_data_addr = qat_req->buf.blp;
|
||||
qat_req->req.comn_mid.dest_data_addr = qat_req->buf.bloutp;
|
||||
cipher_param = (void *)&qat_req->req.serv_specif_rqpars;
|
||||
cipher_param->cipher_length = areq->cryptlen - digst_size;
|
||||
cipher_param->cipher_length = cipher_len;
|
||||
cipher_param->cipher_offset = areq->assoclen;
|
||||
memcpy(cipher_param->u.cipher_IV_array, areq->iv, AES_BLOCK_SIZE);
|
||||
auth_param = (void *)((u8 *)cipher_param + sizeof(*cipher_param));
|
||||
@ -871,6 +876,9 @@ static int qat_alg_aead_enc(struct aead_request *areq)
|
||||
u8 *iv = areq->iv;
|
||||
int ret, ctr = 0;
|
||||
|
||||
if (areq->cryptlen % AES_BLOCK_SIZE != 0)
|
||||
return -EINVAL;
|
||||
|
||||
ret = qat_alg_sgl_to_bufl(ctx->inst, areq->src, areq->dst, qat_req);
|
||||
if (unlikely(ret))
|
||||
return ret;
|
||||
|
||||
@ -796,7 +796,8 @@ static ssize_t amdgpu_set_pp_od_clk_voltage(struct device *dev,
|
||||
tmp_str++;
|
||||
while (isspace(*++tmp_str));
|
||||
|
||||
while ((sub_str = strsep(&tmp_str, delimiter)) != NULL) {
|
||||
while (tmp_str[0]) {
|
||||
sub_str = strsep(&tmp_str, delimiter);
|
||||
ret = kstrtol(sub_str, 0, ¶meter[parameter_size]);
|
||||
if (ret)
|
||||
return -EINVAL;
|
||||
@ -1066,7 +1067,8 @@ static ssize_t amdgpu_read_mask(const char *buf, size_t count, uint32_t *mask)
|
||||
memcpy(buf_cpy, buf, bytes);
|
||||
buf_cpy[bytes] = '\0';
|
||||
tmp = buf_cpy;
|
||||
while ((sub_str = strsep(&tmp, delimiter)) != NULL) {
|
||||
while (tmp[0]) {
|
||||
sub_str = strsep(&tmp, delimiter);
|
||||
if (strlen(sub_str)) {
|
||||
ret = kstrtol(sub_str, 0, &level);
|
||||
if (ret)
|
||||
@ -1695,7 +1697,8 @@ static ssize_t amdgpu_set_pp_power_profile_mode(struct device *dev,
|
||||
i++;
|
||||
memcpy(buf_cpy, buf, count-i);
|
||||
tmp_str = buf_cpy;
|
||||
while ((sub_str = strsep(&tmp_str, delimiter)) != NULL) {
|
||||
while (tmp_str[0]) {
|
||||
sub_str = strsep(&tmp_str, delimiter);
|
||||
ret = kstrtol(sub_str, 0, ¶meter[parameter_size]);
|
||||
if (ret)
|
||||
return -EINVAL;
|
||||
|
||||
@ -113,7 +113,8 @@ static int usbtv_probe(struct usb_interface *intf,
|
||||
|
||||
usbtv_audio_fail:
|
||||
/* we must not free at this point */
|
||||
usb_get_dev(usbtv->udev);
|
||||
v4l2_device_get(&usbtv->v4l2_dev);
|
||||
/* this will undo the v4l2_device_get() */
|
||||
usbtv_video_free(usbtv);
|
||||
|
||||
usbtv_video_fail:
|
||||
|
||||
@ -667,6 +667,9 @@ static int vmk80xx_find_usb_endpoints(struct comedi_device *dev)
|
||||
if (!devpriv->ep_rx || !devpriv->ep_tx)
|
||||
return -ENODEV;
|
||||
|
||||
if (!usb_endpoint_maxp(devpriv->ep_rx) || !usb_endpoint_maxp(devpriv->ep_tx))
|
||||
return -EINVAL;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@ -773,58 +773,21 @@ static int vt_resizex(struct vc_data *vc, struct vt_consize __user *cs)
|
||||
if (copy_from_user(&v, cs, sizeof(struct vt_consize)))
|
||||
return -EFAULT;
|
||||
|
||||
/* FIXME: Should check the copies properly */
|
||||
if (!v.v_vlin)
|
||||
v.v_vlin = vc->vc_scan_lines;
|
||||
|
||||
if (v.v_clin) {
|
||||
int rows = v.v_vlin / v.v_clin;
|
||||
if (v.v_rows != rows) {
|
||||
if (v.v_rows) /* Parameters don't add up */
|
||||
return -EINVAL;
|
||||
v.v_rows = rows;
|
||||
}
|
||||
}
|
||||
|
||||
if (v.v_vcol && v.v_ccol) {
|
||||
int cols = v.v_vcol / v.v_ccol;
|
||||
if (v.v_cols != cols) {
|
||||
if (v.v_cols)
|
||||
return -EINVAL;
|
||||
v.v_cols = cols;
|
||||
}
|
||||
}
|
||||
|
||||
if (v.v_clin > 32)
|
||||
return -EINVAL;
|
||||
if (v.v_vlin)
|
||||
pr_info_once("\"struct vt_consize\"->v_vlin is ignored. Please report if you need this.\n");
|
||||
if (v.v_clin)
|
||||
pr_info_once("\"struct vt_consize\"->v_clin is ignored. Please report if you need this.\n");
|
||||
|
||||
console_lock();
|
||||
for (i = 0; i < MAX_NR_CONSOLES; i++) {
|
||||
struct vc_data *vcp;
|
||||
vc = vc_cons[i].d;
|
||||
|
||||
if (!vc_cons[i].d)
|
||||
continue;
|
||||
console_lock();
|
||||
vcp = vc_cons[i].d;
|
||||
if (vcp) {
|
||||
int ret;
|
||||
int save_scan_lines = vcp->vc_scan_lines;
|
||||
int save_font_height = vcp->vc_font.height;
|
||||
|
||||
if (v.v_vlin)
|
||||
vcp->vc_scan_lines = v.v_vlin;
|
||||
if (v.v_clin)
|
||||
vcp->vc_font.height = v.v_clin;
|
||||
vcp->vc_resize_user = 1;
|
||||
ret = vc_resize(vcp, v.v_cols, v.v_rows);
|
||||
if (ret) {
|
||||
vcp->vc_scan_lines = save_scan_lines;
|
||||
vcp->vc_font.height = save_font_height;
|
||||
console_unlock();
|
||||
return ret;
|
||||
}
|
||||
if (vc) {
|
||||
vc->vc_resize_user = 1;
|
||||
vc_resize(vc, v.v_cols, v.v_rows);
|
||||
}
|
||||
console_unlock();
|
||||
}
|
||||
console_unlock();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -1037,6 +1037,11 @@ static const struct usb_device_id id_table_combined[] = {
|
||||
/* U-Blox devices */
|
||||
{ USB_DEVICE(UBLOX_VID, UBLOX_C099F9P_ZED_PID) },
|
||||
{ USB_DEVICE(UBLOX_VID, UBLOX_C099F9P_ODIN_PID) },
|
||||
/* FreeCalypso USB adapters */
|
||||
{ USB_DEVICE(FTDI_VID, FTDI_FALCONIA_JTAG_BUF_PID),
|
||||
.driver_info = (kernel_ulong_t)&ftdi_jtag_quirk },
|
||||
{ USB_DEVICE(FTDI_VID, FTDI_FALCONIA_JTAG_UNBUF_PID),
|
||||
.driver_info = (kernel_ulong_t)&ftdi_jtag_quirk },
|
||||
{ } /* Terminating entry */
|
||||
};
|
||||
|
||||
|
||||
@ -39,6 +39,13 @@
|
||||
|
||||
#define FTDI_LUMEL_PD12_PID 0x6002
|
||||
|
||||
/*
|
||||
* Custom USB adapters made by Falconia Partners LLC
|
||||
* for FreeCalypso project, ID codes allocated to Falconia by FTDI.
|
||||
*/
|
||||
#define FTDI_FALCONIA_JTAG_BUF_PID 0x7150
|
||||
#define FTDI_FALCONIA_JTAG_UNBUF_PID 0x7151
|
||||
|
||||
/* Sienna Serial Interface by Secyourit GmbH */
|
||||
#define FTDI_SIENNA_PID 0x8348
|
||||
|
||||
|
||||
@ -528,6 +528,7 @@ static void option_instat_callback(struct urb *urb);
|
||||
/* Cellient products */
|
||||
#define CELLIENT_VENDOR_ID 0x2692
|
||||
#define CELLIENT_PRODUCT_MEN200 0x9005
|
||||
#define CELLIENT_PRODUCT_MPL200 0x9025
|
||||
|
||||
/* Hyundai Petatel Inc. products */
|
||||
#define PETATEL_VENDOR_ID 0x1ff4
|
||||
@ -1186,6 +1187,8 @@ static const struct usb_device_id option_ids[] = {
|
||||
.driver_info = NCTRL(2) | RSVD(3) },
|
||||
{ USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x1053, 0xff), /* Telit FN980 (ECM) */
|
||||
.driver_info = NCTRL(0) | RSVD(1) },
|
||||
{ USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x1054, 0xff), /* Telit FT980-KS */
|
||||
.driver_info = NCTRL(2) | RSVD(3) },
|
||||
{ USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_ME910),
|
||||
.driver_info = NCTRL(0) | RSVD(1) | RSVD(3) },
|
||||
{ USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_ME910_DUAL_MODEM),
|
||||
@ -1982,6 +1985,8 @@ static const struct usb_device_id option_ids[] = {
|
||||
{ USB_DEVICE_AND_INTERFACE_INFO(MEDIATEK_VENDOR_ID, MEDIATEK_PRODUCT_DC_4COM2, 0xff, 0x02, 0x01) },
|
||||
{ USB_DEVICE_AND_INTERFACE_INFO(MEDIATEK_VENDOR_ID, MEDIATEK_PRODUCT_DC_4COM2, 0xff, 0x00, 0x00) },
|
||||
{ USB_DEVICE(CELLIENT_VENDOR_ID, CELLIENT_PRODUCT_MEN200) },
|
||||
{ USB_DEVICE(CELLIENT_VENDOR_ID, CELLIENT_PRODUCT_MPL200),
|
||||
.driver_info = RSVD(1) | RSVD(4) },
|
||||
{ USB_DEVICE(PETATEL_VENDOR_ID, PETATEL_PRODUCT_NP10T_600A) },
|
||||
{ USB_DEVICE(PETATEL_VENDOR_ID, PETATEL_PRODUCT_NP10T_600E) },
|
||||
{ USB_DEVICE_AND_INTERFACE_INFO(TPLINK_VENDOR_ID, TPLINK_PRODUCT_LTE, 0xff, 0x00, 0x00) }, /* TP-Link LTE Module */
|
||||
|
||||
@ -100,6 +100,7 @@ static const struct usb_device_id id_table[] = {
|
||||
{ USB_DEVICE(HP_VENDOR_ID, HP_LD220_PRODUCT_ID) },
|
||||
{ USB_DEVICE(HP_VENDOR_ID, HP_LD220TA_PRODUCT_ID) },
|
||||
{ USB_DEVICE(HP_VENDOR_ID, HP_LD381_PRODUCT_ID) },
|
||||
{ USB_DEVICE(HP_VENDOR_ID, HP_LD381GC_PRODUCT_ID) },
|
||||
{ USB_DEVICE(HP_VENDOR_ID, HP_LD960_PRODUCT_ID) },
|
||||
{ USB_DEVICE(HP_VENDOR_ID, HP_LD960TA_PRODUCT_ID) },
|
||||
{ USB_DEVICE(HP_VENDOR_ID, HP_LCM220_PRODUCT_ID) },
|
||||
|
||||
@ -127,6 +127,7 @@
|
||||
|
||||
/* Hewlett-Packard POS Pole Displays */
|
||||
#define HP_VENDOR_ID 0x03f0
|
||||
#define HP_LD381GC_PRODUCT_ID 0x0183
|
||||
#define HP_LM920_PRODUCT_ID 0x026b
|
||||
#define HP_TD620_PRODUCT_ID 0x0956
|
||||
#define HP_LD960_PRODUCT_ID 0x0b39
|
||||
|
||||
@ -1551,11 +1551,7 @@ void reiserfs_read_locked_inode(struct inode *inode,
|
||||
* set version 1, version 2 could be used too, because stat data
|
||||
* key is the same in both versions
|
||||
*/
|
||||
key.version = KEY_FORMAT_3_5;
|
||||
key.on_disk_key.k_dir_id = dirino;
|
||||
key.on_disk_key.k_objectid = inode->i_ino;
|
||||
key.on_disk_key.k_offset = 0;
|
||||
key.on_disk_key.k_type = 0;
|
||||
_make_cpu_key(&key, KEY_FORMAT_3_5, dirino, inode->i_ino, 0, 0, 3);
|
||||
|
||||
/* look for the object's stat data */
|
||||
retval = search_item(inode->i_sb, &key, &path_to_sd);
|
||||
|
||||
@ -674,6 +674,13 @@ reiserfs_xattr_get(struct inode *inode, const char *name, void *buffer,
|
||||
if (get_inode_sd_version(inode) == STAT_DATA_V1)
|
||||
return -EOPNOTSUPP;
|
||||
|
||||
/*
|
||||
* priv_root needn't be initialized during mount so allow initial
|
||||
* lookups to succeed.
|
||||
*/
|
||||
if (!REISERFS_SB(inode->i_sb)->priv_root)
|
||||
return 0;
|
||||
|
||||
dentry = xattr_lookup(inode, name, XATTR_REPLACE);
|
||||
if (IS_ERR(dentry)) {
|
||||
err = PTR_ERR(dentry);
|
||||
|
||||
@ -665,6 +665,8 @@ struct l2cap_ops {
|
||||
struct sk_buff *(*alloc_skb) (struct l2cap_chan *chan,
|
||||
unsigned long hdr_len,
|
||||
unsigned long len, int nb);
|
||||
int (*filter) (struct l2cap_chan * chan,
|
||||
struct sk_buff *skb);
|
||||
};
|
||||
|
||||
struct l2cap_conn {
|
||||
|
||||
@ -226,6 +226,9 @@ static int a2mp_discover_rsp(struct amp_mgr *mgr, struct sk_buff *skb,
|
||||
struct a2mp_info_req req;
|
||||
|
||||
found = true;
|
||||
|
||||
memset(&req, 0, sizeof(req));
|
||||
|
||||
req.id = cl->id;
|
||||
a2mp_send(mgr, A2MP_GETINFO_REQ, __next_ident(mgr),
|
||||
sizeof(req), &req);
|
||||
@ -305,6 +308,8 @@ static int a2mp_getinfo_req(struct amp_mgr *mgr, struct sk_buff *skb,
|
||||
if (!hdev || hdev->dev_type != HCI_AMP) {
|
||||
struct a2mp_info_rsp rsp;
|
||||
|
||||
memset(&rsp, 0, sizeof(rsp));
|
||||
|
||||
rsp.id = req->id;
|
||||
rsp.status = A2MP_STATUS_INVALID_CTRL_ID;
|
||||
|
||||
@ -348,6 +353,8 @@ static int a2mp_getinfo_rsp(struct amp_mgr *mgr, struct sk_buff *skb,
|
||||
if (!ctrl)
|
||||
return -ENOMEM;
|
||||
|
||||
memset(&req, 0, sizeof(req));
|
||||
|
||||
req.id = rsp->id;
|
||||
a2mp_send(mgr, A2MP_GETAMPASSOC_REQ, __next_ident(mgr), sizeof(req),
|
||||
&req);
|
||||
@ -376,6 +383,8 @@ static int a2mp_getampassoc_req(struct amp_mgr *mgr, struct sk_buff *skb,
|
||||
struct a2mp_amp_assoc_rsp rsp;
|
||||
rsp.id = req->id;
|
||||
|
||||
memset(&rsp, 0, sizeof(rsp));
|
||||
|
||||
if (tmp) {
|
||||
rsp.status = A2MP_STATUS_COLLISION_OCCURED;
|
||||
amp_mgr_put(tmp);
|
||||
@ -464,7 +473,6 @@ static int a2mp_createphyslink_req(struct amp_mgr *mgr, struct sk_buff *skb,
|
||||
struct a2mp_cmd *hdr)
|
||||
{
|
||||
struct a2mp_physlink_req *req = (void *) skb->data;
|
||||
|
||||
struct a2mp_physlink_rsp rsp;
|
||||
struct hci_dev *hdev;
|
||||
struct hci_conn *hcon;
|
||||
@ -475,6 +483,8 @@ static int a2mp_createphyslink_req(struct amp_mgr *mgr, struct sk_buff *skb,
|
||||
|
||||
BT_DBG("local_id %d, remote_id %d", req->local_id, req->remote_id);
|
||||
|
||||
memset(&rsp, 0, sizeof(rsp));
|
||||
|
||||
rsp.local_id = req->remote_id;
|
||||
rsp.remote_id = req->local_id;
|
||||
|
||||
@ -553,6 +563,8 @@ static int a2mp_discphyslink_req(struct amp_mgr *mgr, struct sk_buff *skb,
|
||||
|
||||
BT_DBG("local_id %d remote_id %d", req->local_id, req->remote_id);
|
||||
|
||||
memset(&rsp, 0, sizeof(rsp));
|
||||
|
||||
rsp.local_id = req->remote_id;
|
||||
rsp.remote_id = req->local_id;
|
||||
rsp.status = A2MP_STATUS_SUCCESS;
|
||||
@ -675,6 +687,8 @@ static int a2mp_chan_recv_cb(struct l2cap_chan *chan, struct sk_buff *skb)
|
||||
if (err) {
|
||||
struct a2mp_cmd_rej rej;
|
||||
|
||||
memset(&rej, 0, sizeof(rej));
|
||||
|
||||
rej.reason = cpu_to_le16(0);
|
||||
hdr = (void *) skb->data;
|
||||
|
||||
@ -898,6 +912,8 @@ void a2mp_send_getinfo_rsp(struct hci_dev *hdev)
|
||||
|
||||
BT_DBG("%s mgr %p", hdev->name, mgr);
|
||||
|
||||
memset(&rsp, 0, sizeof(rsp));
|
||||
|
||||
rsp.id = hdev->id;
|
||||
rsp.status = A2MP_STATUS_INVALID_CTRL_ID;
|
||||
|
||||
@ -995,6 +1011,8 @@ void a2mp_send_create_phy_link_rsp(struct hci_dev *hdev, u8 status)
|
||||
if (!mgr)
|
||||
return;
|
||||
|
||||
memset(&rsp, 0, sizeof(rsp));
|
||||
|
||||
hs_hcon = hci_conn_hash_lookup_state(hdev, AMP_LINK, BT_CONNECT);
|
||||
if (!hs_hcon) {
|
||||
rsp.status = A2MP_STATUS_UNABLE_START_LINK_CREATION;
|
||||
@ -1027,6 +1045,8 @@ void a2mp_discover_amp(struct l2cap_chan *chan)
|
||||
|
||||
mgr->bredr_chan = chan;
|
||||
|
||||
memset(&req, 0, sizeof(req));
|
||||
|
||||
req.mtu = cpu_to_le16(L2CAP_A2MP_DEFAULT_MTU);
|
||||
req.ext_feat = 0;
|
||||
a2mp_send(mgr, A2MP_DISCOVER_REQ, 1, sizeof(req), &req);
|
||||
|
||||
@ -7301,9 +7301,10 @@ static int l2cap_data_rcv(struct l2cap_chan *chan, struct sk_buff *skb)
|
||||
goto drop;
|
||||
}
|
||||
|
||||
if ((chan->mode == L2CAP_MODE_ERTM ||
|
||||
chan->mode == L2CAP_MODE_STREAMING) && sk_filter(chan->data, skb))
|
||||
goto drop;
|
||||
if (chan->ops->filter) {
|
||||
if (chan->ops->filter(chan, skb))
|
||||
goto drop;
|
||||
}
|
||||
|
||||
if (!control->sframe) {
|
||||
int err;
|
||||
|
||||
@ -1663,6 +1663,19 @@ static void l2cap_sock_suspend_cb(struct l2cap_chan *chan)
|
||||
sk->sk_state_change(sk);
|
||||
}
|
||||
|
||||
static int l2cap_sock_filter(struct l2cap_chan *chan, struct sk_buff *skb)
|
||||
{
|
||||
struct sock *sk = chan->data;
|
||||
|
||||
switch (chan->mode) {
|
||||
case L2CAP_MODE_ERTM:
|
||||
case L2CAP_MODE_STREAMING:
|
||||
return sk_filter(sk, skb);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static const struct l2cap_ops l2cap_chan_ops = {
|
||||
.name = "L2CAP Socket Interface",
|
||||
.new_connection = l2cap_sock_new_connection_cb,
|
||||
@ -1678,6 +1691,7 @@ static const struct l2cap_ops l2cap_chan_ops = {
|
||||
.get_sndtimeo = l2cap_sock_get_sndtimeo_cb,
|
||||
.get_peer_pid = l2cap_sock_get_peer_pid_cb,
|
||||
.alloc_skb = l2cap_sock_alloc_skb_cb,
|
||||
.filter = l2cap_sock_filter,
|
||||
};
|
||||
|
||||
static void l2cap_sock_destruct(struct sock *sk)
|
||||
|
||||
@ -782,7 +782,8 @@ static u32 get_supported_settings(struct hci_dev *hdev)
|
||||
|
||||
if (lmp_ssp_capable(hdev)) {
|
||||
settings |= MGMT_SETTING_SSP;
|
||||
settings |= MGMT_SETTING_HS;
|
||||
if (IS_ENABLED(CONFIG_BT_HS))
|
||||
settings |= MGMT_SETTING_HS;
|
||||
}
|
||||
|
||||
if (lmp_sc_capable(hdev))
|
||||
@ -1815,6 +1816,10 @@ static int set_hs(struct sock *sk, struct hci_dev *hdev, void *data, u16 len)
|
||||
|
||||
bt_dev_dbg(hdev, "sock %p", sk);
|
||||
|
||||
if (!IS_ENABLED(CONFIG_BT_HS))
|
||||
return mgmt_cmd_status(sk, hdev->id, MGMT_OP_SET_HS,
|
||||
MGMT_STATUS_NOT_SUPPORTED);
|
||||
|
||||
status = mgmt_bredr_support(hdev);
|
||||
if (status)
|
||||
return mgmt_cmd_status(sk, hdev->id, MGMT_OP_SET_HS, status);
|
||||
|
||||
Reference in New Issue
Block a user