You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
Merge branches 'for-3.11/battery', 'for-3.11/elo', 'for-3.11/holtek' and 'for-3.11/i2c-hid-fixed' into for-linus
This commit is contained in:
+2
-2
@@ -871,10 +871,10 @@ void mrp_uninit_applicant(struct net_device *dev, struct mrp_application *appl)
|
||||
*/
|
||||
del_timer_sync(&app->join_timer);
|
||||
|
||||
spin_lock(&app->lock);
|
||||
spin_lock_bh(&app->lock);
|
||||
mrp_mad_event(app, MRP_EVENT_TX);
|
||||
mrp_pdu_queue(app);
|
||||
spin_unlock(&app->lock);
|
||||
spin_unlock_bh(&app->lock);
|
||||
|
||||
mrp_queue_xmit(app);
|
||||
|
||||
|
||||
+18
-37
@@ -562,36 +562,19 @@ static int p9_check_zc_errors(struct p9_client *c, struct p9_req_t *req,
|
||||
|
||||
if (!p9_is_proto_dotl(c)) {
|
||||
/* Error is reported in string format */
|
||||
uint16_t len;
|
||||
/* 7 = header size for RERROR, 2 is the size of string len; */
|
||||
int inline_len = in_hdrlen - (7 + 2);
|
||||
int len;
|
||||
/* 7 = header size for RERROR; */
|
||||
int inline_len = in_hdrlen - 7;
|
||||
|
||||
/* Read the size of error string */
|
||||
err = p9pdu_readf(req->rc, c->proto_version, "w", &len);
|
||||
if (err)
|
||||
goto out_err;
|
||||
|
||||
ename = kmalloc(len + 1, GFP_NOFS);
|
||||
if (!ename) {
|
||||
err = -ENOMEM;
|
||||
len = req->rc->size - req->rc->offset;
|
||||
if (len > (P9_ZC_HDR_SZ - 7)) {
|
||||
err = -EFAULT;
|
||||
goto out_err;
|
||||
}
|
||||
if (len <= inline_len) {
|
||||
/* We have error in protocol buffer itself */
|
||||
if (pdu_read(req->rc, ename, len)) {
|
||||
err = -EFAULT;
|
||||
goto out_free;
|
||||
|
||||
}
|
||||
} else {
|
||||
/*
|
||||
* Part of the data is in user space buffer.
|
||||
*/
|
||||
if (pdu_read(req->rc, ename, inline_len)) {
|
||||
err = -EFAULT;
|
||||
goto out_free;
|
||||
|
||||
}
|
||||
ename = &req->rc->sdata[req->rc->offset];
|
||||
if (len > inline_len) {
|
||||
/* We have error in external buffer */
|
||||
if (kern_buf) {
|
||||
memcpy(ename + inline_len, uidata,
|
||||
len - inline_len);
|
||||
@@ -600,19 +583,19 @@ static int p9_check_zc_errors(struct p9_client *c, struct p9_req_t *req,
|
||||
uidata, len - inline_len);
|
||||
if (err) {
|
||||
err = -EFAULT;
|
||||
goto out_free;
|
||||
goto out_err;
|
||||
}
|
||||
}
|
||||
}
|
||||
ename[len] = 0;
|
||||
if (p9_is_proto_dotu(c)) {
|
||||
/* For dotu we also have error code */
|
||||
err = p9pdu_readf(req->rc,
|
||||
c->proto_version, "d", &ecode);
|
||||
if (err)
|
||||
goto out_free;
|
||||
ename = NULL;
|
||||
err = p9pdu_readf(req->rc, c->proto_version, "s?d",
|
||||
&ename, &ecode);
|
||||
if (err)
|
||||
goto out_err;
|
||||
|
||||
if (p9_is_proto_dotu(c))
|
||||
err = -ecode;
|
||||
}
|
||||
|
||||
if (!err || !IS_ERR_VALUE(err)) {
|
||||
err = p9_errstr2errno(ename, strlen(ename));
|
||||
|
||||
@@ -628,8 +611,6 @@ static int p9_check_zc_errors(struct p9_client *c, struct p9_req_t *req,
|
||||
}
|
||||
return err;
|
||||
|
||||
out_free:
|
||||
kfree(ename);
|
||||
out_err:
|
||||
p9_debug(P9_DEBUG_ERROR, "couldn't parse error%d\n", err);
|
||||
return err;
|
||||
|
||||
@@ -837,6 +837,19 @@ bool batadv_dat_snoop_outgoing_arp_request(struct batadv_priv *bat_priv,
|
||||
|
||||
dat_entry = batadv_dat_entry_hash_find(bat_priv, ip_dst);
|
||||
if (dat_entry) {
|
||||
/* If the ARP request is destined for a local client the local
|
||||
* client will answer itself. DAT would only generate a
|
||||
* duplicate packet.
|
||||
*
|
||||
* Moreover, if the soft-interface is enslaved into a bridge, an
|
||||
* additional DAT answer may trigger kernel warnings about
|
||||
* a packet coming from the wrong port.
|
||||
*/
|
||||
if (batadv_is_my_client(bat_priv, dat_entry->mac_addr)) {
|
||||
ret = true;
|
||||
goto out;
|
||||
}
|
||||
|
||||
skb_new = arp_create(ARPOP_REPLY, ETH_P_ARP, ip_src,
|
||||
bat_priv->soft_iface, ip_dst, hw_src,
|
||||
dat_entry->mac_addr, hw_src);
|
||||
|
||||
+15
-6
@@ -163,16 +163,25 @@ void batadv_mesh_free(struct net_device *soft_iface)
|
||||
batadv_vis_quit(bat_priv);
|
||||
|
||||
batadv_gw_node_purge(bat_priv);
|
||||
batadv_originator_free(bat_priv);
|
||||
batadv_nc_free(bat_priv);
|
||||
|
||||
batadv_tt_free(bat_priv);
|
||||
|
||||
batadv_dat_free(bat_priv);
|
||||
batadv_bla_free(bat_priv);
|
||||
|
||||
batadv_dat_free(bat_priv);
|
||||
/* Free the TT and the originator tables only after having terminated
|
||||
* all the other depending components which may use these structures for
|
||||
* their purposes.
|
||||
*/
|
||||
batadv_tt_free(bat_priv);
|
||||
|
||||
/* Since the originator table clean up routine is accessing the TT
|
||||
* tables as well, it has to be invoked after the TT tables have been
|
||||
* freed and marked as empty. This ensures that no cleanup RCU callbacks
|
||||
* accessing the TT data are scheduled for later execution.
|
||||
*/
|
||||
batadv_originator_free(bat_priv);
|
||||
|
||||
free_percpu(bat_priv->bat_counters);
|
||||
bat_priv->bat_counters = NULL;
|
||||
|
||||
atomic_set(&bat_priv->mesh_state, BATADV_MESH_INACTIVE);
|
||||
}
|
||||
@@ -475,7 +484,7 @@ static int batadv_param_set_ra(const char *val, const struct kernel_param *kp)
|
||||
char *algo_name = (char *)val;
|
||||
size_t name_len = strlen(algo_name);
|
||||
|
||||
if (algo_name[name_len - 1] == '\n')
|
||||
if (name_len > 0 && algo_name[name_len - 1] == '\n')
|
||||
algo_name[name_len - 1] = '\0';
|
||||
|
||||
bat_algo_ops = batadv_algo_get(algo_name);
|
||||
|
||||
@@ -1514,6 +1514,7 @@ batadv_nc_skb_decode_packet(struct batadv_priv *bat_priv, struct sk_buff *skb,
|
||||
struct ethhdr *ethhdr, ethhdr_tmp;
|
||||
uint8_t *orig_dest, ttl, ttvn;
|
||||
unsigned int coding_len;
|
||||
int err;
|
||||
|
||||
/* Save headers temporarily */
|
||||
memcpy(&coded_packet_tmp, skb->data, sizeof(coded_packet_tmp));
|
||||
@@ -1568,8 +1569,11 @@ batadv_nc_skb_decode_packet(struct batadv_priv *bat_priv, struct sk_buff *skb,
|
||||
coding_len);
|
||||
|
||||
/* Resize decoded skb if decoded with larger packet */
|
||||
if (nc_packet->skb->len > coding_len + h_size)
|
||||
pskb_trim_rcsum(skb, coding_len + h_size);
|
||||
if (nc_packet->skb->len > coding_len + h_size) {
|
||||
err = pskb_trim_rcsum(skb, coding_len + h_size);
|
||||
if (err)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* Create decoded unicast packet */
|
||||
unicast_packet = (struct batadv_unicast_packet *)skb->data;
|
||||
|
||||
@@ -156,12 +156,28 @@ static void batadv_orig_node_free_rcu(struct rcu_head *rcu)
|
||||
kfree(orig_node);
|
||||
}
|
||||
|
||||
/**
|
||||
* batadv_orig_node_free_ref - decrement the orig node refcounter and possibly
|
||||
* schedule an rcu callback for freeing it
|
||||
* @orig_node: the orig node to free
|
||||
*/
|
||||
void batadv_orig_node_free_ref(struct batadv_orig_node *orig_node)
|
||||
{
|
||||
if (atomic_dec_and_test(&orig_node->refcount))
|
||||
call_rcu(&orig_node->rcu, batadv_orig_node_free_rcu);
|
||||
}
|
||||
|
||||
/**
|
||||
* batadv_orig_node_free_ref_now - decrement the orig node refcounter and
|
||||
* possibly free it (without rcu callback)
|
||||
* @orig_node: the orig node to free
|
||||
*/
|
||||
void batadv_orig_node_free_ref_now(struct batadv_orig_node *orig_node)
|
||||
{
|
||||
if (atomic_dec_and_test(&orig_node->refcount))
|
||||
batadv_orig_node_free_rcu(&orig_node->rcu);
|
||||
}
|
||||
|
||||
void batadv_originator_free(struct batadv_priv *bat_priv)
|
||||
{
|
||||
struct batadv_hashtable *hash = bat_priv->orig_hash;
|
||||
|
||||
@@ -26,6 +26,7 @@ int batadv_originator_init(struct batadv_priv *bat_priv);
|
||||
void batadv_originator_free(struct batadv_priv *bat_priv);
|
||||
void batadv_purge_orig_ref(struct batadv_priv *bat_priv);
|
||||
void batadv_orig_node_free_ref(struct batadv_orig_node *orig_node);
|
||||
void batadv_orig_node_free_ref_now(struct batadv_orig_node *orig_node);
|
||||
struct batadv_orig_node *batadv_get_orig_node(struct batadv_priv *bat_priv,
|
||||
const uint8_t *addr);
|
||||
struct batadv_neigh_node *
|
||||
|
||||
@@ -505,6 +505,7 @@ unreg_debugfs:
|
||||
batadv_debugfs_del_meshif(dev);
|
||||
free_bat_counters:
|
||||
free_percpu(bat_priv->bat_counters);
|
||||
bat_priv->bat_counters = NULL;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -144,7 +144,12 @@ static void batadv_tt_orig_list_entry_free_rcu(struct rcu_head *rcu)
|
||||
struct batadv_tt_orig_list_entry *orig_entry;
|
||||
|
||||
orig_entry = container_of(rcu, struct batadv_tt_orig_list_entry, rcu);
|
||||
batadv_orig_node_free_ref(orig_entry->orig_node);
|
||||
|
||||
/* We are in an rcu callback here, therefore we cannot use
|
||||
* batadv_orig_node_free_ref() and its call_rcu():
|
||||
* An rcu_barrier() wouldn't wait for that to finish
|
||||
*/
|
||||
batadv_orig_node_free_ref_now(orig_entry->orig_node);
|
||||
kfree(orig_entry);
|
||||
}
|
||||
|
||||
|
||||
@@ -1555,11 +1555,15 @@ static const struct rfkill_ops hci_rfkill_ops = {
|
||||
static void hci_power_on(struct work_struct *work)
|
||||
{
|
||||
struct hci_dev *hdev = container_of(work, struct hci_dev, power_on);
|
||||
int err;
|
||||
|
||||
BT_DBG("%s", hdev->name);
|
||||
|
||||
if (hci_dev_open(hdev->id) < 0)
|
||||
err = hci_dev_open(hdev->id);
|
||||
if (err < 0) {
|
||||
mgmt_set_powered_failed(hdev, err);
|
||||
return;
|
||||
}
|
||||
|
||||
if (test_bit(HCI_AUTO_OFF, &hdev->dev_flags))
|
||||
queue_delayed_work(hdev->req_workqueue, &hdev->power_off,
|
||||
|
||||
+52
-18
@@ -3677,10 +3677,14 @@ static void l2cap_conf_rfc_get(struct l2cap_chan *chan, void *rsp, int len)
|
||||
}
|
||||
|
||||
static inline int l2cap_command_rej(struct l2cap_conn *conn,
|
||||
struct l2cap_cmd_hdr *cmd, u8 *data)
|
||||
struct l2cap_cmd_hdr *cmd, u16 cmd_len,
|
||||
u8 *data)
|
||||
{
|
||||
struct l2cap_cmd_rej_unk *rej = (struct l2cap_cmd_rej_unk *) data;
|
||||
|
||||
if (cmd_len < sizeof(*rej))
|
||||
return -EPROTO;
|
||||
|
||||
if (rej->reason != L2CAP_REJ_NOT_UNDERSTOOD)
|
||||
return 0;
|
||||
|
||||
@@ -3829,11 +3833,14 @@ sendresp:
|
||||
}
|
||||
|
||||
static int l2cap_connect_req(struct l2cap_conn *conn,
|
||||
struct l2cap_cmd_hdr *cmd, u8 *data)
|
||||
struct l2cap_cmd_hdr *cmd, u16 cmd_len, u8 *data)
|
||||
{
|
||||
struct hci_dev *hdev = conn->hcon->hdev;
|
||||
struct hci_conn *hcon = conn->hcon;
|
||||
|
||||
if (cmd_len < sizeof(struct l2cap_conn_req))
|
||||
return -EPROTO;
|
||||
|
||||
hci_dev_lock(hdev);
|
||||
if (test_bit(HCI_MGMT, &hdev->dev_flags) &&
|
||||
!test_and_set_bit(HCI_CONN_MGMT_CONNECTED, &hcon->flags))
|
||||
@@ -3847,7 +3854,8 @@ static int l2cap_connect_req(struct l2cap_conn *conn,
|
||||
}
|
||||
|
||||
static int l2cap_connect_create_rsp(struct l2cap_conn *conn,
|
||||
struct l2cap_cmd_hdr *cmd, u8 *data)
|
||||
struct l2cap_cmd_hdr *cmd, u16 cmd_len,
|
||||
u8 *data)
|
||||
{
|
||||
struct l2cap_conn_rsp *rsp = (struct l2cap_conn_rsp *) data;
|
||||
u16 scid, dcid, result, status;
|
||||
@@ -3855,6 +3863,9 @@ static int l2cap_connect_create_rsp(struct l2cap_conn *conn,
|
||||
u8 req[128];
|
||||
int err;
|
||||
|
||||
if (cmd_len < sizeof(*rsp))
|
||||
return -EPROTO;
|
||||
|
||||
scid = __le16_to_cpu(rsp->scid);
|
||||
dcid = __le16_to_cpu(rsp->dcid);
|
||||
result = __le16_to_cpu(rsp->result);
|
||||
@@ -3952,6 +3963,9 @@ static inline int l2cap_config_req(struct l2cap_conn *conn,
|
||||
struct l2cap_chan *chan;
|
||||
int len, err = 0;
|
||||
|
||||
if (cmd_len < sizeof(*req))
|
||||
return -EPROTO;
|
||||
|
||||
dcid = __le16_to_cpu(req->dcid);
|
||||
flags = __le16_to_cpu(req->flags);
|
||||
|
||||
@@ -3975,7 +3989,7 @@ static inline int l2cap_config_req(struct l2cap_conn *conn,
|
||||
|
||||
/* Reject if config buffer is too small. */
|
||||
len = cmd_len - sizeof(*req);
|
||||
if (len < 0 || chan->conf_len + len > sizeof(chan->conf_req)) {
|
||||
if (chan->conf_len + len > sizeof(chan->conf_req)) {
|
||||
l2cap_send_cmd(conn, cmd->ident, L2CAP_CONF_RSP,
|
||||
l2cap_build_conf_rsp(chan, rsp,
|
||||
L2CAP_CONF_REJECT, flags), rsp);
|
||||
@@ -4053,14 +4067,18 @@ unlock:
|
||||
}
|
||||
|
||||
static inline int l2cap_config_rsp(struct l2cap_conn *conn,
|
||||
struct l2cap_cmd_hdr *cmd, u8 *data)
|
||||
struct l2cap_cmd_hdr *cmd, u16 cmd_len,
|
||||
u8 *data)
|
||||
{
|
||||
struct l2cap_conf_rsp *rsp = (struct l2cap_conf_rsp *)data;
|
||||
u16 scid, flags, result;
|
||||
struct l2cap_chan *chan;
|
||||
int len = le16_to_cpu(cmd->len) - sizeof(*rsp);
|
||||
int len = cmd_len - sizeof(*rsp);
|
||||
int err = 0;
|
||||
|
||||
if (cmd_len < sizeof(*rsp))
|
||||
return -EPROTO;
|
||||
|
||||
scid = __le16_to_cpu(rsp->scid);
|
||||
flags = __le16_to_cpu(rsp->flags);
|
||||
result = __le16_to_cpu(rsp->result);
|
||||
@@ -4161,7 +4179,8 @@ done:
|
||||
}
|
||||
|
||||
static inline int l2cap_disconnect_req(struct l2cap_conn *conn,
|
||||
struct l2cap_cmd_hdr *cmd, u8 *data)
|
||||
struct l2cap_cmd_hdr *cmd, u16 cmd_len,
|
||||
u8 *data)
|
||||
{
|
||||
struct l2cap_disconn_req *req = (struct l2cap_disconn_req *) data;
|
||||
struct l2cap_disconn_rsp rsp;
|
||||
@@ -4169,6 +4188,9 @@ static inline int l2cap_disconnect_req(struct l2cap_conn *conn,
|
||||
struct l2cap_chan *chan;
|
||||
struct sock *sk;
|
||||
|
||||
if (cmd_len != sizeof(*req))
|
||||
return -EPROTO;
|
||||
|
||||
scid = __le16_to_cpu(req->scid);
|
||||
dcid = __le16_to_cpu(req->dcid);
|
||||
|
||||
@@ -4208,12 +4230,16 @@ static inline int l2cap_disconnect_req(struct l2cap_conn *conn,
|
||||
}
|
||||
|
||||
static inline int l2cap_disconnect_rsp(struct l2cap_conn *conn,
|
||||
struct l2cap_cmd_hdr *cmd, u8 *data)
|
||||
struct l2cap_cmd_hdr *cmd, u16 cmd_len,
|
||||
u8 *data)
|
||||
{
|
||||
struct l2cap_disconn_rsp *rsp = (struct l2cap_disconn_rsp *) data;
|
||||
u16 dcid, scid;
|
||||
struct l2cap_chan *chan;
|
||||
|
||||
if (cmd_len != sizeof(*rsp))
|
||||
return -EPROTO;
|
||||
|
||||
scid = __le16_to_cpu(rsp->scid);
|
||||
dcid = __le16_to_cpu(rsp->dcid);
|
||||
|
||||
@@ -4243,11 +4269,15 @@ static inline int l2cap_disconnect_rsp(struct l2cap_conn *conn,
|
||||
}
|
||||
|
||||
static inline int l2cap_information_req(struct l2cap_conn *conn,
|
||||
struct l2cap_cmd_hdr *cmd, u8 *data)
|
||||
struct l2cap_cmd_hdr *cmd, u16 cmd_len,
|
||||
u8 *data)
|
||||
{
|
||||
struct l2cap_info_req *req = (struct l2cap_info_req *) data;
|
||||
u16 type;
|
||||
|
||||
if (cmd_len != sizeof(*req))
|
||||
return -EPROTO;
|
||||
|
||||
type = __le16_to_cpu(req->type);
|
||||
|
||||
BT_DBG("type 0x%4.4x", type);
|
||||
@@ -4294,11 +4324,15 @@ static inline int l2cap_information_req(struct l2cap_conn *conn,
|
||||
}
|
||||
|
||||
static inline int l2cap_information_rsp(struct l2cap_conn *conn,
|
||||
struct l2cap_cmd_hdr *cmd, u8 *data)
|
||||
struct l2cap_cmd_hdr *cmd, u16 cmd_len,
|
||||
u8 *data)
|
||||
{
|
||||
struct l2cap_info_rsp *rsp = (struct l2cap_info_rsp *) data;
|
||||
u16 type, result;
|
||||
|
||||
if (cmd_len != sizeof(*rsp))
|
||||
return -EPROTO;
|
||||
|
||||
type = __le16_to_cpu(rsp->type);
|
||||
result = __le16_to_cpu(rsp->result);
|
||||
|
||||
@@ -5164,16 +5198,16 @@ static inline int l2cap_bredr_sig_cmd(struct l2cap_conn *conn,
|
||||
|
||||
switch (cmd->code) {
|
||||
case L2CAP_COMMAND_REJ:
|
||||
l2cap_command_rej(conn, cmd, data);
|
||||
l2cap_command_rej(conn, cmd, cmd_len, data);
|
||||
break;
|
||||
|
||||
case L2CAP_CONN_REQ:
|
||||
err = l2cap_connect_req(conn, cmd, data);
|
||||
err = l2cap_connect_req(conn, cmd, cmd_len, data);
|
||||
break;
|
||||
|
||||
case L2CAP_CONN_RSP:
|
||||
case L2CAP_CREATE_CHAN_RSP:
|
||||
err = l2cap_connect_create_rsp(conn, cmd, data);
|
||||
err = l2cap_connect_create_rsp(conn, cmd, cmd_len, data);
|
||||
break;
|
||||
|
||||
case L2CAP_CONF_REQ:
|
||||
@@ -5181,15 +5215,15 @@ static inline int l2cap_bredr_sig_cmd(struct l2cap_conn *conn,
|
||||
break;
|
||||
|
||||
case L2CAP_CONF_RSP:
|
||||
err = l2cap_config_rsp(conn, cmd, data);
|
||||
err = l2cap_config_rsp(conn, cmd, cmd_len, data);
|
||||
break;
|
||||
|
||||
case L2CAP_DISCONN_REQ:
|
||||
err = l2cap_disconnect_req(conn, cmd, data);
|
||||
err = l2cap_disconnect_req(conn, cmd, cmd_len, data);
|
||||
break;
|
||||
|
||||
case L2CAP_DISCONN_RSP:
|
||||
err = l2cap_disconnect_rsp(conn, cmd, data);
|
||||
err = l2cap_disconnect_rsp(conn, cmd, cmd_len, data);
|
||||
break;
|
||||
|
||||
case L2CAP_ECHO_REQ:
|
||||
@@ -5200,11 +5234,11 @@ static inline int l2cap_bredr_sig_cmd(struct l2cap_conn *conn,
|
||||
break;
|
||||
|
||||
case L2CAP_INFO_REQ:
|
||||
err = l2cap_information_req(conn, cmd, data);
|
||||
err = l2cap_information_req(conn, cmd, cmd_len, data);
|
||||
break;
|
||||
|
||||
case L2CAP_INFO_RSP:
|
||||
err = l2cap_information_rsp(conn, cmd, data);
|
||||
err = l2cap_information_rsp(conn, cmd, cmd_len, data);
|
||||
break;
|
||||
|
||||
case L2CAP_CREATE_CHAN_REQ:
|
||||
|
||||
+22
-1
@@ -2700,7 +2700,7 @@ static int start_discovery(struct sock *sk, struct hci_dev *hdev,
|
||||
break;
|
||||
|
||||
case DISCOV_TYPE_LE:
|
||||
if (!lmp_host_le_capable(hdev)) {
|
||||
if (!test_bit(HCI_LE_ENABLED, &hdev->dev_flags)) {
|
||||
err = cmd_status(sk, hdev->id, MGMT_OP_START_DISCOVERY,
|
||||
MGMT_STATUS_NOT_SUPPORTED);
|
||||
mgmt_pending_remove(cmd);
|
||||
@@ -3418,6 +3418,27 @@ new_settings:
|
||||
return err;
|
||||
}
|
||||
|
||||
int mgmt_set_powered_failed(struct hci_dev *hdev, int err)
|
||||
{
|
||||
struct pending_cmd *cmd;
|
||||
u8 status;
|
||||
|
||||
cmd = mgmt_pending_find(MGMT_OP_SET_POWERED, hdev);
|
||||
if (!cmd)
|
||||
return -ENOENT;
|
||||
|
||||
if (err == -ERFKILL)
|
||||
status = MGMT_STATUS_RFKILLED;
|
||||
else
|
||||
status = MGMT_STATUS_FAILED;
|
||||
|
||||
err = cmd_status(cmd->sk, hdev->id, MGMT_OP_SET_POWERED, status);
|
||||
|
||||
mgmt_pending_remove(cmd);
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
int mgmt_discoverable(struct hci_dev *hdev, u8 discoverable)
|
||||
{
|
||||
struct cmd_lookup match = { NULL, hdev };
|
||||
|
||||
+2
-2
@@ -770,7 +770,7 @@ int smp_conn_security(struct hci_conn *hcon, __u8 sec_level)
|
||||
|
||||
BT_DBG("conn %p hcon %p level 0x%2.2x", conn, hcon, sec_level);
|
||||
|
||||
if (!lmp_host_le_capable(hcon->hdev))
|
||||
if (!test_bit(HCI_LE_ENABLED, &hcon->hdev->dev_flags))
|
||||
return 1;
|
||||
|
||||
if (sec_level == BT_SECURITY_LOW)
|
||||
@@ -851,7 +851,7 @@ int smp_sig_channel(struct l2cap_conn *conn, struct sk_buff *skb)
|
||||
__u8 reason;
|
||||
int err = 0;
|
||||
|
||||
if (!lmp_host_le_capable(conn->hcon->hdev)) {
|
||||
if (!test_bit(HCI_LE_ENABLED, &conn->hcon->hdev->dev_flags)) {
|
||||
err = -ENOTSUPP;
|
||||
reason = SMP_PAIRING_NOTSUPP;
|
||||
goto done;
|
||||
|
||||
@@ -72,13 +72,12 @@ print_ports(const struct sk_buff *skb, uint8_t protocol, int offset)
|
||||
}
|
||||
|
||||
static void
|
||||
ebt_log_packet(u_int8_t pf, unsigned int hooknum,
|
||||
const struct sk_buff *skb, const struct net_device *in,
|
||||
const struct net_device *out, const struct nf_loginfo *loginfo,
|
||||
const char *prefix)
|
||||
ebt_log_packet(struct net *net, u_int8_t pf, unsigned int hooknum,
|
||||
const struct sk_buff *skb, const struct net_device *in,
|
||||
const struct net_device *out, const struct nf_loginfo *loginfo,
|
||||
const char *prefix)
|
||||
{
|
||||
unsigned int bitmask;
|
||||
struct net *net = dev_net(in ? in : out);
|
||||
|
||||
/* FIXME: Disabled from containers until syslog ns is supported */
|
||||
if (!net_eq(net, &init_net))
|
||||
@@ -191,7 +190,7 @@ ebt_log_tg(struct sk_buff *skb, const struct xt_action_param *par)
|
||||
nf_log_packet(net, NFPROTO_BRIDGE, par->hooknum, skb,
|
||||
par->in, par->out, &li, "%s", info->prefix);
|
||||
else
|
||||
ebt_log_packet(NFPROTO_BRIDGE, par->hooknum, skb, par->in,
|
||||
ebt_log_packet(net, NFPROTO_BRIDGE, par->hooknum, skb, par->in,
|
||||
par->out, &li, info->prefix);
|
||||
return EBT_CONTINUE;
|
||||
}
|
||||
|
||||
@@ -131,14 +131,16 @@ static struct sk_buff *ulog_alloc_skb(unsigned int size)
|
||||
return skb;
|
||||
}
|
||||
|
||||
static void ebt_ulog_packet(unsigned int hooknr, const struct sk_buff *skb,
|
||||
const struct net_device *in, const struct net_device *out,
|
||||
const struct ebt_ulog_info *uloginfo, const char *prefix)
|
||||
static void ebt_ulog_packet(struct net *net, unsigned int hooknr,
|
||||
const struct sk_buff *skb,
|
||||
const struct net_device *in,
|
||||
const struct net_device *out,
|
||||
const struct ebt_ulog_info *uloginfo,
|
||||
const char *prefix)
|
||||
{
|
||||
ebt_ulog_packet_msg_t *pm;
|
||||
size_t size, copy_len;
|
||||
struct nlmsghdr *nlh;
|
||||
struct net *net = dev_net(in ? in : out);
|
||||
struct ebt_ulog_net *ebt = ebt_ulog_pernet(net);
|
||||
unsigned int group = uloginfo->nlgroup;
|
||||
ebt_ulog_buff_t *ub = &ebt->ulog_buffers[group];
|
||||
@@ -233,7 +235,7 @@ unlock:
|
||||
}
|
||||
|
||||
/* this function is registered with the netfilter core */
|
||||
static void ebt_log_packet(u_int8_t pf, unsigned int hooknum,
|
||||
static void ebt_log_packet(struct net *net, u_int8_t pf, unsigned int hooknum,
|
||||
const struct sk_buff *skb, const struct net_device *in,
|
||||
const struct net_device *out, const struct nf_loginfo *li,
|
||||
const char *prefix)
|
||||
@@ -252,13 +254,15 @@ static void ebt_log_packet(u_int8_t pf, unsigned int hooknum,
|
||||
strlcpy(loginfo.prefix, prefix, sizeof(loginfo.prefix));
|
||||
}
|
||||
|
||||
ebt_ulog_packet(hooknum, skb, in, out, &loginfo, prefix);
|
||||
ebt_ulog_packet(net, hooknum, skb, in, out, &loginfo, prefix);
|
||||
}
|
||||
|
||||
static unsigned int
|
||||
ebt_ulog_tg(struct sk_buff *skb, const struct xt_action_param *par)
|
||||
{
|
||||
ebt_ulog_packet(par->hooknum, skb, par->in, par->out,
|
||||
struct net *net = dev_net(par->in ? par->in : par->out);
|
||||
|
||||
ebt_ulog_packet(net, par->hooknum, skb, par->in, par->out,
|
||||
par->targinfo, NULL);
|
||||
return EBT_CONTINUE;
|
||||
}
|
||||
|
||||
@@ -1204,6 +1204,7 @@ void ceph_osdc_unregister_linger_request(struct ceph_osd_client *osdc,
|
||||
mutex_lock(&osdc->request_mutex);
|
||||
if (req->r_linger) {
|
||||
__unregister_linger_request(osdc, req);
|
||||
req->r_linger = 0;
|
||||
ceph_osdc_put_request(req);
|
||||
}
|
||||
mutex_unlock(&osdc->request_mutex);
|
||||
@@ -1674,13 +1675,13 @@ static void kick_requests(struct ceph_osd_client *osdc, int force_resend)
|
||||
__register_request(osdc, req);
|
||||
__unregister_linger_request(osdc, req);
|
||||
}
|
||||
reset_changed_osds(osdc);
|
||||
mutex_unlock(&osdc->request_mutex);
|
||||
|
||||
if (needmap) {
|
||||
dout("%d requests for down osds, need new map\n", needmap);
|
||||
ceph_monc_request_next_osdmap(&osdc->client->monc);
|
||||
}
|
||||
reset_changed_osds(osdc);
|
||||
}
|
||||
|
||||
|
||||
@@ -2120,7 +2121,9 @@ int ceph_osdc_start_request(struct ceph_osd_client *osdc,
|
||||
down_read(&osdc->map_sem);
|
||||
mutex_lock(&osdc->request_mutex);
|
||||
__register_request(osdc, req);
|
||||
WARN_ON(req->r_sent);
|
||||
req->r_sent = 0;
|
||||
req->r_got_reply = 0;
|
||||
req->r_completed = 0;
|
||||
rc = __map_request(osdc, req, 0);
|
||||
if (rc < 0) {
|
||||
if (nofail) {
|
||||
|
||||
+11
-2
@@ -734,19 +734,25 @@ static unsigned char nas[21] = {
|
||||
|
||||
asmlinkage long compat_sys_sendmsg(int fd, struct compat_msghdr __user *msg, unsigned int flags)
|
||||
{
|
||||
return sys_sendmsg(fd, (struct msghdr __user *)msg, flags | MSG_CMSG_COMPAT);
|
||||
if (flags & MSG_CMSG_COMPAT)
|
||||
return -EINVAL;
|
||||
return __sys_sendmsg(fd, (struct msghdr __user *)msg, flags | MSG_CMSG_COMPAT);
|
||||
}
|
||||
|
||||
asmlinkage long compat_sys_sendmmsg(int fd, struct compat_mmsghdr __user *mmsg,
|
||||
unsigned int vlen, unsigned int flags)
|
||||
{
|
||||
if (flags & MSG_CMSG_COMPAT)
|
||||
return -EINVAL;
|
||||
return __sys_sendmmsg(fd, (struct mmsghdr __user *)mmsg, vlen,
|
||||
flags | MSG_CMSG_COMPAT);
|
||||
}
|
||||
|
||||
asmlinkage long compat_sys_recvmsg(int fd, struct compat_msghdr __user *msg, unsigned int flags)
|
||||
{
|
||||
return sys_recvmsg(fd, (struct msghdr __user *)msg, flags | MSG_CMSG_COMPAT);
|
||||
if (flags & MSG_CMSG_COMPAT)
|
||||
return -EINVAL;
|
||||
return __sys_recvmsg(fd, (struct msghdr __user *)msg, flags | MSG_CMSG_COMPAT);
|
||||
}
|
||||
|
||||
asmlinkage long compat_sys_recv(int fd, void __user *buf, size_t len, unsigned int flags)
|
||||
@@ -768,6 +774,9 @@ asmlinkage long compat_sys_recvmmsg(int fd, struct compat_mmsghdr __user *mmsg,
|
||||
int datagrams;
|
||||
struct timespec ktspec;
|
||||
|
||||
if (flags & MSG_CMSG_COMPAT)
|
||||
return -EINVAL;
|
||||
|
||||
if (COMPAT_USE_64BIT_TIME)
|
||||
return __sys_recvmmsg(fd, (struct mmsghdr __user *)mmsg, vlen,
|
||||
flags | MSG_CMSG_COMPAT,
|
||||
|
||||
@@ -39,6 +39,7 @@ static int __hw_addr_create_ex(struct netdev_hw_addr_list *list,
|
||||
ha->refcount = 1;
|
||||
ha->global_use = global;
|
||||
ha->synced = sync;
|
||||
ha->sync_cnt = 0;
|
||||
list_add_tail_rcu(&ha->list, &list->list);
|
||||
list->count++;
|
||||
|
||||
@@ -66,7 +67,7 @@ static int __hw_addr_add_ex(struct netdev_hw_addr_list *list,
|
||||
}
|
||||
if (sync) {
|
||||
if (ha->synced)
|
||||
return 0;
|
||||
return -EEXIST;
|
||||
else
|
||||
ha->synced = true;
|
||||
}
|
||||
@@ -139,10 +140,13 @@ static int __hw_addr_sync_one(struct netdev_hw_addr_list *to_list,
|
||||
|
||||
err = __hw_addr_add_ex(to_list, ha->addr, addr_len, ha->type,
|
||||
false, true);
|
||||
if (err)
|
||||
if (err && err != -EEXIST)
|
||||
return err;
|
||||
ha->sync_cnt++;
|
||||
ha->refcount++;
|
||||
|
||||
if (!err) {
|
||||
ha->sync_cnt++;
|
||||
ha->refcount++;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -159,7 +163,8 @@ static void __hw_addr_unsync_one(struct netdev_hw_addr_list *to_list,
|
||||
if (err)
|
||||
return;
|
||||
ha->sync_cnt--;
|
||||
__hw_addr_del_entry(from_list, ha, false, true);
|
||||
/* address on from list is not marked synced */
|
||||
__hw_addr_del_entry(from_list, ha, false, false);
|
||||
}
|
||||
|
||||
static int __hw_addr_sync_multiple(struct netdev_hw_addr_list *to_list,
|
||||
@@ -796,7 +801,7 @@ int dev_mc_sync_multiple(struct net_device *to, struct net_device *from)
|
||||
return -EINVAL;
|
||||
|
||||
netif_addr_lock_nested(to);
|
||||
err = __hw_addr_sync(&to->mc, &from->mc, to->addr_len);
|
||||
err = __hw_addr_sync_multiple(&to->mc, &from->mc, to->addr_len);
|
||||
if (!err)
|
||||
__dev_set_rx_mode(to);
|
||||
netif_addr_unlock(to);
|
||||
|
||||
+1
-1
@@ -778,7 +778,7 @@ int sk_detach_filter(struct sock *sk)
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(sk_detach_filter);
|
||||
|
||||
static void sk_decode_filter(struct sock_filter *filt, struct sock_filter *to)
|
||||
void sk_decode_filter(struct sock_filter *filt, struct sock_filter *to)
|
||||
{
|
||||
static const u16 decodes[] = {
|
||||
[BPF_S_ALU_ADD_K] = BPF_ALU|BPF_ADD|BPF_K,
|
||||
|
||||
@@ -73,31 +73,6 @@ int verify_iovec(struct msghdr *m, struct iovec *iov, struct sockaddr_storage *a
|
||||
return err;
|
||||
}
|
||||
|
||||
/*
|
||||
* Copy kernel to iovec. Returns -EFAULT on error.
|
||||
*
|
||||
* Note: this modifies the original iovec.
|
||||
*/
|
||||
|
||||
int memcpy_toiovec(struct iovec *iov, unsigned char *kdata, int len)
|
||||
{
|
||||
while (len > 0) {
|
||||
if (iov->iov_len) {
|
||||
int copy = min_t(unsigned int, iov->iov_len, len);
|
||||
if (copy_to_user(iov->iov_base, kdata, copy))
|
||||
return -EFAULT;
|
||||
kdata += copy;
|
||||
len -= copy;
|
||||
iov->iov_len -= copy;
|
||||
iov->iov_base += copy;
|
||||
}
|
||||
iov++;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL(memcpy_toiovec);
|
||||
|
||||
/*
|
||||
* Copy kernel to iovec. Returns -EFAULT on error.
|
||||
*/
|
||||
@@ -124,31 +99,6 @@ int memcpy_toiovecend(const struct iovec *iov, unsigned char *kdata,
|
||||
}
|
||||
EXPORT_SYMBOL(memcpy_toiovecend);
|
||||
|
||||
/*
|
||||
* Copy iovec to kernel. Returns -EFAULT on error.
|
||||
*
|
||||
* Note: this modifies the original iovec.
|
||||
*/
|
||||
|
||||
int memcpy_fromiovec(unsigned char *kdata, struct iovec *iov, int len)
|
||||
{
|
||||
while (len > 0) {
|
||||
if (iov->iov_len) {
|
||||
int copy = min_t(unsigned int, len, iov->iov_len);
|
||||
if (copy_from_user(kdata, iov->iov_base, copy))
|
||||
return -EFAULT;
|
||||
len -= copy;
|
||||
kdata += copy;
|
||||
iov->iov_base += copy;
|
||||
iov->iov_len -= copy;
|
||||
}
|
||||
iov++;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL(memcpy_fromiovec);
|
||||
|
||||
/*
|
||||
* Copy iovec from kernel. Returns -EFAULT on error.
|
||||
*/
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user