Skip to content
This repository has been archived by the owner on Jun 19, 2024. It is now read-only.

Commit

Permalink
Merge 4.14.282 into android-4.14-q
Browse files Browse the repository at this point in the history
Changes in 4.14.282
	x86/pci/xen: Disable PCI/MSI[-X] masking for XEN_HVM guests
	staging: rtl8723bs: prevent ->Ssid overflow in rtw_wx_set_scan()
	tcp: change source port randomizarion at connect() time
	secure_seq: use the 64 bits of the siphash for port offset calculation
	ACPI: sysfs: Make sparse happy about address space in use
	ACPI: sysfs: Fix BERT error region memory mapping
	net: af_key: check encryption module availability consistency
	net: ftgmac100: Disable hardware checksum on AST2600
	drivers: i2c: thunderx: Allow driver to work with ACPI defined TWSI controllers
	assoc_array: Fix BUG_ON during garbage collect
	drm/i915: Fix -Wstringop-overflow warning in call to intel_read_wm_latency()
	block-map: add __GFP_ZERO flag for alloc_page in function bio_copy_kern
	exec: Force single empty string when argv is empty
	netfilter: conntrack: re-fetch conntrack after insertion
	zsmalloc: fix races between asynchronous zspage free and page migration
	dm integrity: fix error code in dm_integrity_ctr()
	dm crypt: make printing of the key constant-time
	dm stats: add cond_resched when looping over entries
	dm verity: set DM_TARGET_IMMUTABLE feature flag
	tpm: ibmvtpm: Correct the return value in tpm_ibmvtpm_probe()
	docs: submitting-patches: Fix crossref to 'The canonical patch format'
	NFSD: Fix possible sleep during nfsd4_release_lockowner()
	bpf: Enlarge offset check value to INT_MAX in bpf_skb_{load,store}_bytes
	Linux 4.14.282

Signed-off-by: Greg Kroah-Hartman <[email protected]>
Change-Id: Ie93bea657ec190d5e68fa00882d032f6fc4f7708
  • Loading branch information
gregkh committed Jun 6, 2022
2 parents d66ebc2 + b8f3be2 commit dcd651c
Show file tree
Hide file tree
Showing 26 changed files with 159 additions and 48 deletions.
2 changes: 1 addition & 1 deletion Documentation/process/submitting-patches.rst
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ as you intend it to.

The maintainer will thank you if you write your patch description in a
form which can be easily pulled into Linux's source code management
system, ``git``, as a "commit log". See :ref:`explicit_in_reply_to`.
system, ``git``, as a "commit log". See :ref:`the_canonical_patch_format`.

Solve only one problem per patch. If your description starts to get
long, that's a sign that you probably need to split up your patch.
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# SPDX-License-Identifier: GPL-2.0
VERSION = 4
PATCHLEVEL = 14
SUBLEVEL = 281
SUBLEVEL = 282
EXTRAVERSION =
NAME = Petit Gorille

Expand Down
5 changes: 5 additions & 0 deletions arch/x86/pci/xen.c
Original file line number Diff line number Diff line change
Expand Up @@ -442,6 +442,11 @@ void __init xen_msi_init(void)

x86_msi.setup_msi_irqs = xen_hvm_setup_msi_irqs;
x86_msi.teardown_msi_irq = xen_teardown_msi_irq;
/*
* With XEN PIRQ/Eventchannels in use PCI/MSI[-X] masking is solely
* controlled by the hypervisor.
*/
pci_msi_ignore_mask = 1;
}
#endif

Expand Down
2 changes: 1 addition & 1 deletion block/bio.c
Original file line number Diff line number Diff line change
Expand Up @@ -1657,7 +1657,7 @@ struct bio *bio_copy_kern(struct request_queue *q, void *data, unsigned int len,
if (bytes > len)
bytes = len;

page = alloc_page(q->bounce_gfp | gfp_mask);
page = alloc_page(q->bounce_gfp | __GFP_ZERO | gfp_mask);
if (!page)
goto cleanup;

Expand Down
23 changes: 17 additions & 6 deletions drivers/acpi/sysfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -438,18 +438,29 @@ static ssize_t acpi_data_show(struct file *filp, struct kobject *kobj,
{
struct acpi_data_attr *data_attr;
void __iomem *base;
ssize_t rc;
ssize_t size;

data_attr = container_of(bin_attr, struct acpi_data_attr, attr);
size = data_attr->attr.size;

if (offset < 0)
return -EINVAL;

if (offset >= size)
return 0;

base = acpi_os_map_memory(data_attr->addr, data_attr->attr.size);
if (count > size - offset)
count = size - offset;

base = acpi_os_map_iomem(data_attr->addr, size);
if (!base)
return -ENOMEM;
rc = memory_read_from_buffer(buf, count, &offset, base,
data_attr->attr.size);
acpi_os_unmap_memory(base, data_attr->attr.size);

return rc;
memcpy_fromio(buf, base + offset, count);

acpi_os_unmap_iomem(base, size);

return count;
}

static int acpi_bert_data_init(void *th, struct acpi_data_attr *data_attr)
Expand Down
1 change: 1 addition & 0 deletions drivers/char/tpm/tpm_ibmvtpm.c
Original file line number Diff line number Diff line change
Expand Up @@ -692,6 +692,7 @@ static int tpm_ibmvtpm_probe(struct vio_dev *vio_dev,
if (!wait_event_timeout(ibmvtpm->crq_queue.wq,
ibmvtpm->rtce_buf != NULL,
HZ)) {
rc = -ENODEV;
dev_err(dev, "CRQ response timed out\n");
goto init_irq_cleanup;
}
Expand Down
2 changes: 1 addition & 1 deletion drivers/gpu/drm/i915/intel_pm.c
Original file line number Diff line number Diff line change
Expand Up @@ -2793,7 +2793,7 @@ hsw_compute_linetime_wm(const struct intel_crtc_state *cstate)
}

static void intel_read_wm_latency(struct drm_i915_private *dev_priv,
uint16_t wm[8])
uint16_t wm[])
{
if (INTEL_GEN(dev_priv) >= 9) {
uint32_t val;
Expand Down
1 change: 1 addition & 0 deletions drivers/i2c/busses/i2c-thunderx-pcidrv.c
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,7 @@ static int thunder_i2c_probe_pci(struct pci_dev *pdev,
i2c->adap.bus_recovery_info = &octeon_i2c_recovery_info;
i2c->adap.dev.parent = dev;
i2c->adap.dev.of_node = pdev->dev.of_node;
i2c->adap.dev.fwnode = dev->fwnode;
snprintf(i2c->adap.name, sizeof(i2c->adap.name),
"Cavium ThunderX i2c adapter at %s", dev_name(dev));
i2c_set_adapdata(&i2c->adap, i2c);
Expand Down
14 changes: 11 additions & 3 deletions drivers/md/dm-crypt.c
Original file line number Diff line number Diff line change
Expand Up @@ -2951,6 +2951,11 @@ static int crypt_map(struct dm_target *ti, struct bio *bio)
return DM_MAPIO_SUBMITTED;
}

static char hex2asc(unsigned char c)
{
return c + '0' + ((unsigned)(9 - c) >> 4 & 0x27);
}

static void crypt_status(struct dm_target *ti, status_type_t type,
unsigned status_flags, char *result, unsigned maxlen)
{
Expand All @@ -2969,9 +2974,12 @@ static void crypt_status(struct dm_target *ti, status_type_t type,
if (cc->key_size > 0) {
if (cc->key_string)
DMEMIT(":%u:%s", cc->key_size, cc->key_string);
else
for (i = 0; i < cc->key_size; i++)
DMEMIT("%02x", cc->key[i]);
else {
for (i = 0; i < cc->key_size; i++) {
DMEMIT("%c%c", hex2asc(cc->key[i] >> 4),
hex2asc(cc->key[i] & 0xf));
}
}
} else
DMEMIT("-");

Expand Down
2 changes: 0 additions & 2 deletions drivers/md/dm-integrity.c
Original file line number Diff line number Diff line change
Expand Up @@ -3156,8 +3156,6 @@ static int dm_integrity_ctr(struct dm_target *ti, unsigned argc, char **argv)
}

if (should_write_sb) {
int r;

init_journal(ic, 0, ic->journal_sections, 0);
r = dm_integrity_failed(ic);
if (unlikely(r)) {
Expand Down
8 changes: 8 additions & 0 deletions drivers/md/dm-stats.c
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,7 @@ void dm_stats_cleanup(struct dm_stats *stats)
atomic_read(&shared->in_flight[READ]),
atomic_read(&shared->in_flight[WRITE]));
}
cond_resched();
}
dm_stat_free(&s->rcu_head);
}
Expand Down Expand Up @@ -312,6 +313,7 @@ static int dm_stats_create(struct dm_stats *stats, sector_t start, sector_t end,
for (ni = 0; ni < n_entries; ni++) {
atomic_set(&s->stat_shared[ni].in_flight[READ], 0);
atomic_set(&s->stat_shared[ni].in_flight[WRITE], 0);
cond_resched();
}

if (s->n_histogram_entries) {
Expand All @@ -324,6 +326,7 @@ static int dm_stats_create(struct dm_stats *stats, sector_t start, sector_t end,
for (ni = 0; ni < n_entries; ni++) {
s->stat_shared[ni].tmp.histogram = hi;
hi += s->n_histogram_entries + 1;
cond_resched();
}
}

Expand All @@ -344,6 +347,7 @@ static int dm_stats_create(struct dm_stats *stats, sector_t start, sector_t end,
for (ni = 0; ni < n_entries; ni++) {
p[ni].histogram = hi;
hi += s->n_histogram_entries + 1;
cond_resched();
}
}
}
Expand Down Expand Up @@ -473,6 +477,7 @@ static int dm_stats_list(struct dm_stats *stats, const char *program,
}
DMEMIT("\n");
}
cond_resched();
}
mutex_unlock(&stats->mutex);

Expand Down Expand Up @@ -749,6 +754,7 @@ static void __dm_stat_clear(struct dm_stat *s, size_t idx_start, size_t idx_end,
local_irq_enable();
}
}
cond_resched();
}
}

Expand Down Expand Up @@ -864,6 +870,8 @@ static int dm_stats_print(struct dm_stats *stats, int id,

if (unlikely(sz + 1 >= maxlen))
goto buffer_overflow;

cond_resched();
}

if (clear)
Expand Down
1 change: 1 addition & 0 deletions drivers/md/dm-verity-target.c
Original file line number Diff line number Diff line change
Expand Up @@ -1238,6 +1238,7 @@ int verity_ctr(struct dm_target *ti, unsigned argc, char **argv)

static struct target_type verity_target = {
.name = "verity",
.features = DM_TARGET_IMMUTABLE,
.version = {1, 4, 0},
.module = THIS_MODULE,
.ctr = verity_ctr,
Expand Down
5 changes: 5 additions & 0 deletions drivers/net/ethernet/faraday/ftgmac100.c
Original file line number Diff line number Diff line change
Expand Up @@ -1845,6 +1845,11 @@ static int ftgmac100_probe(struct platform_device *pdev)
/* AST2400 doesn't have working HW checksum generation */
if (np && (of_device_is_compatible(np, "aspeed,ast2400-mac")))
netdev->hw_features &= ~NETIF_F_HW_CSUM;

/* AST2600 tx checksum with NCSI is broken */
if (priv->use_ncsi && of_device_is_compatible(np, "aspeed,ast2600-mac"))
netdev->hw_features &= ~NETIF_F_HW_CSUM;

if (np && of_get_property(np, "no-hw-checksum", NULL))
netdev->hw_features &= ~(NETIF_F_HW_CSUM | NETIF_F_RXCSUM);
netdev->features |= netdev->hw_features;
Expand Down
6 changes: 4 additions & 2 deletions drivers/staging/rtl8723bs/os_dep/ioctl_linux.c
Original file line number Diff line number Diff line change
Expand Up @@ -1438,9 +1438,11 @@ static int rtw_wx_set_scan(struct net_device *dev, struct iw_request_info *a,

sec_len = *(pos++); len-= 1;

if (sec_len>0 && sec_len<=len) {
if (sec_len > 0 &&
sec_len <= len &&
sec_len <= 32) {
ssid[ssid_index].SsidLength = sec_len;
memcpy(ssid[ssid_index].Ssid, pos, ssid[ssid_index].SsidLength);
memcpy(ssid[ssid_index].Ssid, pos, sec_len);
/* DBG_871X("%s COMBO_SCAN with specific ssid:%s, %d\n", __func__ */
/* , ssid[ssid_index].Ssid, ssid[ssid_index].SsidLength); */
ssid_index++;
Expand Down
17 changes: 17 additions & 0 deletions fs/exec.c
Original file line number Diff line number Diff line change
Expand Up @@ -1788,6 +1788,9 @@ static int do_execveat_common(int fd, struct filename *filename,
goto out_unmark;

bprm->argc = count(argv, MAX_ARG_STRINGS);
if (bprm->argc == 0)
pr_warn_once("process '%s' launched '%s' with NULL argv: empty string added\n",
current->comm, bprm->filename);
if ((retval = bprm->argc) < 0)
goto out;

Expand All @@ -1812,6 +1815,20 @@ static int do_execveat_common(int fd, struct filename *filename,
if (retval < 0)
goto out;

/*
* When argv is empty, add an empty string ("") as argv[0] to
* ensure confused userspace programs that start processing
* from argv[1] won't end up walking envp. See also
* bprm_stack_limits().
*/
if (bprm->argc == 0) {
const char *argv[] = { "", NULL };
retval = copy_strings_kernel(1, argv, bprm);
if (retval < 0)
goto out;
bprm->argc = 1;
}

retval = exec_binprm(bprm);
if (retval < 0)
goto out;
Expand Down
12 changes: 4 additions & 8 deletions fs/nfsd/nfs4state.c
Original file line number Diff line number Diff line change
Expand Up @@ -6351,16 +6351,12 @@ nfsd4_release_lockowner(struct svc_rqst *rqstp,
if (sop->so_is_open_owner || !same_owner_str(sop, owner))
continue;

/* see if there are still any locks associated with it */
lo = lockowner(sop);
list_for_each_entry(stp, &sop->so_stateids, st_perstateowner) {
if (check_for_locks(stp->st_stid.sc_file, lo)) {
status = nfserr_locks_held;
spin_unlock(&clp->cl_lock);
return status;
}
if (atomic_read(&sop->so_count) != 1) {
spin_unlock(&clp->cl_lock);
return nfserr_locks_held;
}

lo = lockowner(sop);
nfs4_get_stateowner(sop);
break;
}
Expand Down
2 changes: 1 addition & 1 deletion include/net/inet_hashtables.h
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ static inline void sk_rcv_saddr_set(struct sock *sk, __be32 addr)
}

int __inet_hash_connect(struct inet_timewait_death_row *death_row,
struct sock *sk, u32 port_offset,
struct sock *sk, u64 port_offset,
int (*check_established)(struct inet_timewait_death_row *,
struct sock *, __u16,
struct inet_timewait_sock **));
Expand Down
7 changes: 6 additions & 1 deletion include/net/netfilter/nf_conntrack_core.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,13 @@ static inline int nf_conntrack_confirm(struct sk_buff *skb)
int ret = NF_ACCEPT;

if (ct) {
if (!nf_ct_is_confirmed(ct))
if (!nf_ct_is_confirmed(ct)) {
ret = __nf_conntrack_confirm(skb);

if (ret == NF_ACCEPT)
ct = (struct nf_conn *)skb_nfct(skb);
}

if (likely(ret == NF_ACCEPT))
nf_ct_deliver_cached_events(ct);
}
Expand Down
4 changes: 2 additions & 2 deletions include/net/secure_seq.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

#include <linux/types.h>

u32 secure_ipv4_port_ephemeral(__be32 saddr, __be32 daddr, __be16 dport);
u32 secure_ipv6_port_ephemeral(const __be32 *saddr, const __be32 *daddr,
u64 secure_ipv4_port_ephemeral(__be32 saddr, __be32 daddr, __be16 dport);
u64 secure_ipv6_port_ephemeral(const __be32 *saddr, const __be32 *daddr,
__be16 dport);
u32 secure_tcp_seq(__be32 saddr, __be32 daddr,
__be16 sport, __be16 dport);
Expand Down
8 changes: 8 additions & 0 deletions lib/assoc_array.c
Original file line number Diff line number Diff line change
Expand Up @@ -1478,6 +1478,7 @@ int assoc_array_gc(struct assoc_array *array,
struct assoc_array_ptr *cursor, *ptr;
struct assoc_array_ptr *new_root, *new_parent, **new_ptr_pp;
unsigned long nr_leaves_on_tree;
bool retained;
int keylen, slot, nr_free, next_slot, i;

pr_devel("-->%s()\n", __func__);
Expand Down Expand Up @@ -1554,6 +1555,7 @@ int assoc_array_gc(struct assoc_array *array,
goto descend;
}

retry_compress:
pr_devel("-- compress node %p --\n", new_n);

/* Count up the number of empty slots in this node and work out the
Expand All @@ -1571,6 +1573,7 @@ int assoc_array_gc(struct assoc_array *array,
pr_devel("free=%d, leaves=%lu\n", nr_free, new_n->nr_leaves_on_branch);

/* See what we can fold in */
retained = false;
next_slot = 0;
for (slot = 0; slot < ASSOC_ARRAY_FAN_OUT; slot++) {
struct assoc_array_shortcut *s;
Expand Down Expand Up @@ -1620,9 +1623,14 @@ int assoc_array_gc(struct assoc_array *array,
pr_devel("[%d] retain node %lu/%d [nx %d]\n",
slot, child->nr_leaves_on_branch, nr_free + 1,
next_slot);
retained = true;
}
}

if (retained && new_n->nr_leaves_on_branch <= ASSOC_ARRAY_FAN_OUT) {
pr_devel("internal nodes remain despite enough space, retrying\n");
goto retry_compress;
}
pr_devel("after: %lu\n", new_n->nr_leaves_on_branch);

nr_leaves_on_tree = new_n->nr_leaves_on_branch;
Expand Down
37 changes: 33 additions & 4 deletions mm/zsmalloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -953,11 +953,40 @@ static void reset_page(struct page *page)
*/
void lock_zspage(struct zspage *zspage)
{
struct page *page = get_first_page(zspage);
struct page *curr_page, *page;

do {
lock_page(page);
} while ((page = get_next_page(page)) != NULL);
/*
* Pages we haven't locked yet can be migrated off the list while we're
* trying to lock them, so we need to be careful and only attempt to
* lock each page under migrate_read_lock(). Otherwise, the page we lock
* may no longer belong to the zspage. This means that we may wait for
* the wrong page to unlock, so we must take a reference to the page
* prior to waiting for it to unlock outside migrate_read_lock().
*/
while (1) {
migrate_read_lock(zspage);
page = get_first_page(zspage);
if (trylock_page(page))
break;
get_page(page);
migrate_read_unlock(zspage);
wait_on_page_locked(page);
put_page(page);
}

curr_page = page;
while ((page = get_next_page(curr_page))) {
if (trylock_page(page)) {
curr_page = page;
} else {
get_page(page);
migrate_read_unlock(zspage);
wait_on_page_locked(page);
put_page(page);
migrate_read_lock(zspage);
}
}
migrate_read_unlock(zspage);
}

int trylock_zspage(struct zspage *zspage)
Expand Down
Loading

0 comments on commit dcd651c

Please sign in to comment.