Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…le/linux into Mystic-4.4

Changes in 4.4.299: (15 commits)
        bpf, test: fix ld_abs + vlan push/pop stress test
        Bluetooth: btusb: Apply QCA Rome patches for some ATH3012 models
        ieee802154: atusb: fix uninit value in atusb_set_extended_addr
        mac80211: initialize variable have_higher_than_11mbit
        i40e: Fix incorrect netdev's real number of RX/TX queues
        sch_qfq: prevent shift-out-of-bounds in qfq_init_qdisc
        xfs: map unwritten blocks in XFS_IOC_{ALLOC,FREE}SP just like fallocate
        rndis_host: support Hytera digital radios
        phonet: refcount leak in pep_sock_accep
        scsi: libiscsi: Fix UAF in iscsi_conn_get_param()/iscsi_conn_teardown()
        ip6_vti: initialize __ip6_tnl_parm struct in vti6_siocdevprivate
        net: udp: fix alignment problem in udp4_seq_show()
        mISDN: change function names to avoid conflicts
        power: reset: ltc2952: Fix use of floating point literals
        Linux 4.4.299

Signed-off-by: Oktapra Amtono <oktapra.amtono@gmail.com>
  • Loading branch information
okta-10 committed Jan 12, 2022
2 parents 55f9dff + b0ee523 commit 2a548e5
Show file tree
Hide file tree
Showing 17 changed files with 85 additions and 38 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
VERSION = 4
PATCHLEVEL = 4
SUBLEVEL = 298
SUBLEVEL = 299
EXTRAVERSION =
NAME = Blurry Fish Butt

Expand Down
32 changes: 25 additions & 7 deletions drivers/bluetooth/btusb.c
Original file line number Diff line number Diff line change
Expand Up @@ -2489,11 +2489,9 @@ static const struct qca_device_info qca_devices_table[] = {
{ 0x00000302, 28, 4, 18 }, /* Rome 3.2 */
};

static int btusb_qca_send_vendor_req(struct hci_dev *hdev, u8 request,
static int btusb_qca_send_vendor_req(struct usb_device *udev, u8 request,
void *data, u16 size)
{
struct btusb_data *btdata = hci_get_drvdata(hdev);
struct usb_device *udev = btdata->udev;
int pipe, err;
u8 *buf;

Expand All @@ -2508,7 +2506,7 @@ static int btusb_qca_send_vendor_req(struct hci_dev *hdev, u8 request,
err = usb_control_msg(udev, pipe, request, USB_TYPE_VENDOR | USB_DIR_IN,
0, 0, buf, size, USB_CTRL_SET_TIMEOUT);
if (err < 0) {
BT_ERR("%s: Failed to access otp area (%d)", hdev->name, err);
dev_err(&udev->dev, "Failed to access otp area (%d)", err);
goto done;
}

Expand Down Expand Up @@ -2664,20 +2662,38 @@ static int btusb_setup_qca_load_nvm(struct hci_dev *hdev,
return err;
}

/* identify the ROM version and check whether patches are needed */
static bool btusb_qca_need_patch(struct usb_device *udev)
{
struct qca_version ver;

if (btusb_qca_send_vendor_req(udev, QCA_GET_TARGET_VERSION, &ver,
sizeof(ver)) < 0)
return false;
/* only low ROM versions need patches */
return !(le32_to_cpu(ver.rom_version) & ~0xffffU);
}

static int btusb_setup_qca(struct hci_dev *hdev)
{
struct btusb_data *btdata = hci_get_drvdata(hdev);
struct usb_device *udev = btdata->udev;
const struct qca_device_info *info = NULL;
struct qca_version ver;
u32 ver_rom;
u8 status;
int i, err;

err = btusb_qca_send_vendor_req(hdev, QCA_GET_TARGET_VERSION, &ver,
err = btusb_qca_send_vendor_req(udev, QCA_GET_TARGET_VERSION, &ver,
sizeof(ver));
if (err < 0)
return err;

ver_rom = le32_to_cpu(ver.rom_version);
/* Don't care about high ROM versions */
if (ver_rom & ~0xffffU)
return 0;

for (i = 0; i < ARRAY_SIZE(qca_devices_table); i++) {
if (ver_rom == qca_devices_table[i].rom_version)
info = &qca_devices_table[i];
Expand All @@ -2688,7 +2704,7 @@ static int btusb_setup_qca(struct hci_dev *hdev)
return -ENODEV;
}

err = btusb_qca_send_vendor_req(hdev, QCA_CHECK_STATUS, &status,
err = btusb_qca_send_vendor_req(udev, QCA_CHECK_STATUS, &status,
sizeof(status));
if (err < 0)
return err;
Expand Down Expand Up @@ -2834,7 +2850,8 @@ static int btusb_probe(struct usb_interface *intf,

/* Old firmware would otherwise let ath3k driver load
* patch and sysconfig files */
if (le16_to_cpu(udev->descriptor.bcdDevice) <= 0x0001)
if (le16_to_cpu(udev->descriptor.bcdDevice) <= 0x0001 &&
!btusb_qca_need_patch(udev))
return -ENODEV;
}

Expand Down Expand Up @@ -2981,6 +2998,7 @@ static int btusb_probe(struct usb_interface *intf,
}

if (id->driver_info & BTUSB_ATH3012) {
data->setup_on_usb = btusb_setup_qca;
hdev->set_bdaddr = btusb_set_bdaddr_ath3012;
set_bit(HCI_QUIRK_SIMULTANEOUS_DISCOVERY, &hdev->quirks);
set_bit(HCI_QUIRK_STRICT_DUPLICATE_FILTER, &hdev->quirks);
Expand Down
6 changes: 3 additions & 3 deletions drivers/isdn/mISDN/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ mISDNInit(void)
err = mISDN_inittimer(&debug);
if (err)
goto error2;
err = l1_init(&debug);
err = Isdnl1_Init(&debug);
if (err)
goto error3;
err = Isdnl2_Init(&debug);
Expand All @@ -404,7 +404,7 @@ mISDNInit(void)
error5:
Isdnl2_cleanup();
error4:
l1_cleanup();
Isdnl1_cleanup();
error3:
mISDN_timer_cleanup();
error2:
Expand All @@ -417,7 +417,7 @@ static void mISDN_cleanup(void)
{
misdn_sock_cleanup();
Isdnl2_cleanup();
l1_cleanup();
Isdnl1_cleanup();
mISDN_timer_cleanup();
class_unregister(&mISDN_class);

Expand Down
4 changes: 2 additions & 2 deletions drivers/isdn/mISDN/core.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ struct Bprotocol *get_Bprotocol4id(u_int);
extern int mISDN_inittimer(u_int *);
extern void mISDN_timer_cleanup(void);

extern int l1_init(u_int *);
extern void l1_cleanup(void);
extern int Isdnl1_Init(u_int *);
extern void Isdnl1_cleanup(void);
extern int Isdnl2_Init(u_int *);
extern void Isdnl2_cleanup(void);

Expand Down
4 changes: 2 additions & 2 deletions drivers/isdn/mISDN/layer1.c
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@ create_l1(struct dchannel *dch, dchannel_l1callback *dcb) {
EXPORT_SYMBOL(create_l1);

int
l1_init(u_int *deb)
Isdnl1_Init(u_int *deb)
{
debug = deb;
l1fsm_s.state_count = L1S_STATE_COUNT;
Expand All @@ -419,7 +419,7 @@ l1_init(u_int *deb)
}

void
l1_cleanup(void)
Isdnl1_cleanup(void)
{
mISDN_FsmFree(&l1fsm_s);
}
32 changes: 25 additions & 7 deletions drivers/net/ethernet/intel/i40e/i40e_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -5360,6 +5360,27 @@ int i40e_open(struct net_device *netdev)
return 0;
}

/**
* i40e_netif_set_realnum_tx_rx_queues - Update number of tx/rx queues
* @vsi: vsi structure
*
* This updates netdev's number of tx/rx queues
*
* Returns status of setting tx/rx queues
**/
static int i40e_netif_set_realnum_tx_rx_queues(struct i40e_vsi *vsi)
{
int ret;

ret = netif_set_real_num_rx_queues(vsi->netdev,
vsi->num_queue_pairs);
if (ret)
return ret;

return netif_set_real_num_tx_queues(vsi->netdev,
vsi->num_queue_pairs);
}

/**
* i40e_vsi_open -
* @vsi: the VSI to open
Expand Down Expand Up @@ -5394,13 +5415,7 @@ int i40e_vsi_open(struct i40e_vsi *vsi)
goto err_setup_rx;

/* Notify the stack of the actual queue counts. */
err = netif_set_real_num_tx_queues(vsi->netdev,
vsi->num_queue_pairs);
if (err)
goto err_set_queues;

err = netif_set_real_num_rx_queues(vsi->netdev,
vsi->num_queue_pairs);
err = i40e_netif_set_realnum_tx_rx_queues(vsi);
if (err)
goto err_set_queues;

Expand Down Expand Up @@ -9413,6 +9428,9 @@ struct i40e_vsi *i40e_vsi_setup(struct i40e_pf *pf, u8 type,
case I40E_VSI_VMDQ2:
case I40E_VSI_FCOE:
ret = i40e_config_netdev(vsi);
if (ret)
goto err_netdev;
ret = i40e_netif_set_realnum_tx_rx_queues(vsi);
if (ret)
goto err_netdev;
ret = register_netdev(vsi->netdev);
Expand Down
10 changes: 6 additions & 4 deletions drivers/net/ieee802154/atusb.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,9 @@ static int atusb_control_msg(struct atusb *atusb, unsigned int pipe,

ret = usb_control_msg(usb_dev, pipe, request, requesttype,
value, index, data, size, timeout);
if (ret < 0) {
if (ret < size) {
ret = ret < 0 ? ret : -ENODATA;

atusb->err = ret;
dev_err(&usb_dev->dev,
"atusb_control_msg: req 0x%02x val 0x%x idx 0x%x, error %d\n",
Expand Down Expand Up @@ -567,9 +569,9 @@ static int atusb_get_and_show_build(struct atusb *atusb)
if (!build)
return -ENOMEM;

ret = atusb_control_msg(atusb, usb_rcvctrlpipe(usb_dev, 0),
ATUSB_BUILD, ATUSB_REQ_FROM_DEV, 0, 0,
build, ATUSB_BUILD_SIZE, 1000);
/* We cannot call atusb_control_msg() here, since this request may read various length data */
ret = usb_control_msg(atusb->usb_dev, usb_rcvctrlpipe(usb_dev, 0), ATUSB_BUILD,
ATUSB_REQ_FROM_DEV, 0, 0, build, ATUSB_BUILD_SIZE, 1000);
if (ret >= 0) {
build[ret] = 0;
dev_info(&usb_dev->dev, "Firmware: build %s\n", build);
Expand Down
5 changes: 5 additions & 0 deletions drivers/net/usb/rndis_host.c
Original file line number Diff line number Diff line change
Expand Up @@ -615,6 +615,11 @@ static const struct usb_device_id products [] = {
USB_DEVICE_AND_INTERFACE_INFO(0x1630, 0x0042,
USB_CLASS_COMM, 2 /* ACM */, 0x0ff),
.driver_info = (unsigned long) &rndis_poll_status_info,
}, {
/* Hytera Communications DMR radios' "Radio to PC Network" */
USB_VENDOR_AND_INTERFACE_INFO(0x238b,
USB_CLASS_COMM, 2 /* ACM */, 0x0ff),
.driver_info = (unsigned long)&rndis_info,
}, {
/* RNDIS is MSFT's un-official variant of CDC ACM */
USB_INTERFACE_INFO(USB_CLASS_COMM, 2 /* ACM */, 0x0ff),
Expand Down
4 changes: 2 additions & 2 deletions drivers/power/reset/ltc2952-poweroff.c
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,8 @@ static void ltc2952_poweroff_kill(void)

static void ltc2952_poweroff_default(struct ltc2952_poweroff *data)
{
data->wde_interval = ktime_set(0, 300L*1E6L);
data->trigger_delay = ktime_set(2, 500L*1E6L);
data->wde_interval = ktime_set(0, 300L * NSEC_PER_MSEC);
data->trigger_delay = ktime_set(2, 500L * NSEC_PER_MSEC);

hrtimer_init(&data->timer_trigger, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
data->timer_trigger.function = ltc2952_poweroff_timer_trigger;
Expand Down
6 changes: 4 additions & 2 deletions drivers/scsi/libiscsi.c
Original file line number Diff line number Diff line change
Expand Up @@ -2994,6 +2994,8 @@ void iscsi_conn_teardown(struct iscsi_cls_conn *cls_conn)
{
struct iscsi_conn *conn = cls_conn->dd_data;
struct iscsi_session *session = conn->session;
char *tmp_persistent_address = conn->persistent_address;
char *tmp_local_ipaddr = conn->local_ipaddr;

del_timer_sync(&conn->transport_timer);

Expand All @@ -3015,8 +3017,6 @@ void iscsi_conn_teardown(struct iscsi_cls_conn *cls_conn)
spin_lock_bh(&session->frwd_lock);
free_pages((unsigned long) conn->data,
get_order(ISCSI_DEF_MAX_RECV_SEG_LEN));
kfree(conn->persistent_address);
kfree(conn->local_ipaddr);
/* regular RX path uses back_lock */
spin_lock_bh(&session->back_lock);
kfifo_in(&session->cmdpool.queue, (void*)&conn->login_task,
Expand All @@ -3028,6 +3028,8 @@ void iscsi_conn_teardown(struct iscsi_cls_conn *cls_conn)
mutex_unlock(&session->eh_mutex);

iscsi_destroy_conn(cls_conn);
kfree(tmp_persistent_address);
kfree(tmp_local_ipaddr);
}
EXPORT_SYMBOL_GPL(iscsi_conn_teardown);

Expand Down
3 changes: 2 additions & 1 deletion fs/xfs/xfs_ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -729,7 +729,8 @@ xfs_ioc_space(
flags |= XFS_PREALLOC_CLEAR;
if (bf->l_start > XFS_ISIZE(ip)) {
error = xfs_alloc_file_space(ip, XFS_ISIZE(ip),
bf->l_start - XFS_ISIZE(ip), 0);
bf->l_start - XFS_ISIZE(ip),
XFS_BMAPI_PREALLOC);
if (error)
goto out_unlock;
}
Expand Down
2 changes: 1 addition & 1 deletion lib/test_bpf.c
Original file line number Diff line number Diff line change
Expand Up @@ -4661,7 +4661,7 @@ static struct bpf_test tests[] = {
{ },
INTERNAL,
{ 0x34 },
{ { 1, 0xbef } },
{ { ETH_HLEN, 0xbef } },
.fill_helper = bpf_fill_ld_abs_vlan_push_pop,
},
/*
Expand Down
2 changes: 1 addition & 1 deletion net/ipv4/udp.c
Original file line number Diff line number Diff line change
Expand Up @@ -2567,7 +2567,7 @@ int udp4_seq_show(struct seq_file *seq, void *v)
{
seq_setwidth(seq, 127);
if (v == SEQ_START_TOKEN)
seq_puts(seq, " sl local_address rem_address st tx_queue "
seq_puts(seq, " sl local_address rem_address st tx_queue "
"rx_queue tr tm->when retrnsmt uid timeout "
"inode ref pointer drops");
else {
Expand Down
2 changes: 2 additions & 0 deletions net/ipv6/ip6_vti.c
Original file line number Diff line number Diff line change
Expand Up @@ -760,6 +760,8 @@ vti6_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
struct net *net = dev_net(dev);
struct vti6_net *ip6n = net_generic(net, vti6_net_id);

memset(&p1, 0, sizeof(p1));

switch (cmd) {
case SIOCGETTUNNEL:
if (dev == ip6n->fb_tnl_dev) {
Expand Down
2 changes: 1 addition & 1 deletion net/mac80211/mlme.c
Original file line number Diff line number Diff line change
Expand Up @@ -4431,7 +4431,7 @@ static int ieee80211_prep_connection(struct ieee80211_sub_if_data *sdata,

if (new_sta) {
u32 rates = 0, basic_rates = 0;
bool have_higher_than_11mbit;
bool have_higher_than_11mbit = false;
int min_rate = INT_MAX, min_rate_index = -1;
struct ieee80211_chanctx_conf *chanctx_conf;
const struct cfg80211_bss_ies *ies;
Expand Down
1 change: 1 addition & 0 deletions net/phonet/pep.c
Original file line number Diff line number Diff line change
Expand Up @@ -878,6 +878,7 @@ static struct sock *pep_sock_accept(struct sock *sk, int flags, int *errp)

err = pep_accept_conn(newsk, skb);
if (err) {
__sock_put(sk);
sock_put(newsk);
newsk = NULL;
goto drop;
Expand Down
6 changes: 2 additions & 4 deletions net/sched/sch_qfq.c
Original file line number Diff line number Diff line change
Expand Up @@ -1479,10 +1479,8 @@ static int qfq_init_qdisc(struct Qdisc *sch, struct nlattr *opt)
if (err < 0)
return err;

if (qdisc_dev(sch)->tx_queue_len + 1 > QFQ_MAX_AGG_CLASSES)
max_classes = QFQ_MAX_AGG_CLASSES;
else
max_classes = qdisc_dev(sch)->tx_queue_len + 1;
max_classes = min_t(u64, (u64)qdisc_dev(sch)->tx_queue_len + 1,
QFQ_MAX_AGG_CLASSES);
/* max_cl_shift = floor(log_2(max_classes)) */
max_cl_shift = __fls(max_classes);
q->max_agg_classes = 1<<max_cl_shift;
Expand Down

0 comments on commit 2a548e5

Please sign in to comment.