Snap for 8027220 from b0de5d3c49 to android12-5.10-keystone-qcom-release

Change-Id: I917b0ca2fca66ae7541704cfb9c06fef44fcdc7c
This commit is contained in:
Android Build Coastguard Worker
2021-12-24 01:00:23 +00:00
4 changed files with 20 additions and 5 deletions

View File

@@ -246,13 +246,17 @@ static void *__arm_v7s_alloc_table(int lvl, gfp_t gfp,
__GFP_ZERO | ARM_V7S_TABLE_GFP_DMA, get_order(size)); __GFP_ZERO | ARM_V7S_TABLE_GFP_DMA, get_order(size));
else if (lvl == 2) else if (lvl == 2)
table = kmem_cache_zalloc(data->l2_tables, gfp); table = kmem_cache_zalloc(data->l2_tables, gfp);
if (!table)
return NULL;
phys = virt_to_phys(table); phys = virt_to_phys(table);
if (phys != (arm_v7s_iopte)phys) { if (phys != (arm_v7s_iopte)phys) {
/* Doesn't fit in PTE */ /* Doesn't fit in PTE */
dev_err(dev, "Page table does not fit in PTE: %pa", &phys); dev_err(dev, "Page table does not fit in PTE: %pa", &phys);
goto out_free; goto out_free;
} }
if (table && !cfg->coherent_walk) { if (!cfg->coherent_walk) {
dma = dma_map_single(dev, table, size, DMA_TO_DEVICE); dma = dma_map_single(dev, table, size, DMA_TO_DEVICE);
if (dma_mapping_error(dev, dma)) if (dma_mapping_error(dev, dma))
goto out_free; goto out_free;

View File

@@ -64,7 +64,8 @@ static inline int stack_map_data_size(struct bpf_map *map)
static int prealloc_elems_and_freelist(struct bpf_stack_map *smap) static int prealloc_elems_and_freelist(struct bpf_stack_map *smap)
{ {
u32 elem_size = sizeof(struct stack_map_bucket) + smap->map.value_size; u64 elem_size = sizeof(struct stack_map_bucket) +
(u64)smap->map.value_size;
int err; int err;
smap->elems = bpf_map_area_alloc(elem_size * smap->map.max_entries, smap->elems = bpf_map_area_alloc(elem_size * smap->map.max_entries,

View File

@@ -1168,6 +1168,9 @@ static struct sctp_association *__sctp_rcv_asconf_lookup(
union sctp_addr_param *param; union sctp_addr_param *param;
union sctp_addr paddr; union sctp_addr paddr;
if (ntohs(ch->length) < sizeof(*asconf) + sizeof(struct sctp_paramhdr))
return NULL;
/* Skip over the ADDIP header and find the Address parameter */ /* Skip over the ADDIP header and find the Address parameter */
param = (union sctp_addr_param *)(asconf + 1); param = (union sctp_addr_param *)(asconf + 1);

View File

@@ -2150,10 +2150,17 @@ static enum sctp_ierror sctp_verify_param(struct net *net,
break; break;
case SCTP_PARAM_SET_PRIMARY: case SCTP_PARAM_SET_PRIMARY:
if (ep->asconf_enable) if (!ep->asconf_enable)
break;
goto unhandled; goto unhandled;
if (ntohs(param.p->length) < sizeof(struct sctp_addip_param) +
sizeof(struct sctp_paramhdr)) {
sctp_process_inv_paramlength(asoc, param.p,
chunk, err_chunk);
retval = SCTP_IERROR_ABORT;
}
break;
case SCTP_PARAM_HOST_NAME_ADDRESS: case SCTP_PARAM_HOST_NAME_ADDRESS:
/* Tell the peer, we won't support this param. */ /* Tell the peer, we won't support this param. */
sctp_process_hn_param(asoc, param, chunk, err_chunk); sctp_process_hn_param(asoc, param, chunk, err_chunk);