···1338913389NETWORKING DRIVERS1339013390M: "David S. Miller" <davem@davemloft.net>1339113391M: Jakub Kicinski <kuba@kernel.org>1339213392+M: Paolo Abeni <pabeni@redhat.com>1339213393L: netdev@vger.kernel.org1339313394S: Maintained1339413395Q: https://patchwork.kernel.org/project/netdevbpf/list/···1343613435NETWORKING [GENERAL]1343713436M: "David S. Miller" <davem@davemloft.net>1343813437M: Jakub Kicinski <kuba@kernel.org>1343813438+M: Paolo Abeni <pabeni@redhat.com>1343913439L: netdev@vger.kernel.org1344013440S: Maintained1344113441Q: https://patchwork.kernel.org/project/netdevbpf/list/
···2525 SPECTRE_V2_METHOD_LOOP8 = BIT(__SPECTRE_V2_METHOD_LOOP8),2626};27272828+#ifdef CONFIG_GENERIC_CPU_VULNERABILITIES2829void spectre_v2_update_state(unsigned int state, unsigned int methods);3030+#else3131+static inline void spectre_v2_update_state(unsigned int state,3232+ unsigned int methods)3333+{}3434+#endif29353036int spectre_bhb_update_vectors(unsigned int method);3137
···2233config RISCV_ERRATA_ALTERNATIVE44 bool "RISC-V alternative scheme"55+ depends on !XIP_KERNEL56 default y67 help78 This Kconfig allows the kernel to automatically patch the
+2-2
arch/riscv/Kconfig.socs
···1414 select CLK_SIFIVE1515 select CLK_SIFIVE_PRCI1616 select SIFIVE_PLIC1717- select RISCV_ERRATA_ALTERNATIVE1818- select ERRATA_SIFIVE1717+ select RISCV_ERRATA_ALTERNATIVE if !XIP_KERNEL1818+ select ERRATA_SIFIVE if !XIP_KERNEL1919 help2020 This enables support for SiFive SoC platform hardware.2121
+16-5
arch/riscv/kernel/module.c
···1313#include <linux/pgtable.h>1414#include <asm/sections.h>15151616+/*1717+ * The auipc+jalr instruction pair can reach any PC-relative offset1818+ * in the range [-2^31 - 2^11, 2^31 - 2^11)1919+ */2020+static bool riscv_insn_valid_32bit_offset(ptrdiff_t val)2121+{2222+#ifdef CONFIG_32BIT2323+ return true;2424+#else2525+ return (-(1L << 31) - (1L << 11)) <= val && val < ((1L << 31) - (1L << 11));2626+#endif2727+}2828+1629static int apply_r_riscv_32_rela(struct module *me, u32 *location, Elf_Addr v)1730{1831 if (v != (u32)v) {···10895 ptrdiff_t offset = (void *)v - (void *)location;10996 s32 hi20;11097111111- if (offset != (s32)offset) {9898+ if (!riscv_insn_valid_32bit_offset(offset)) {11299 pr_err(113100 "%s: target %016llx can not be addressed by the 32-bit offset from PC = %p\n",114101 me->name, (long long)v, location);···210197 Elf_Addr v)211198{212199 ptrdiff_t offset = (void *)v - (void *)location;213213- s32 fill_v = offset;214200 u32 hi20, lo12;215201216216- if (offset != fill_v) {202202+ if (!riscv_insn_valid_32bit_offset(offset)) {217203 /* Only emit the plt entry if offset over 32-bit range */218204 if (IS_ENABLED(CONFIG_MODULE_SECTIONS)) {219205 offset = module_emit_plt_entry(me, v);···236224 Elf_Addr v)237225{238226 ptrdiff_t offset = (void *)v - (void *)location;239239- s32 fill_v = offset;240227 u32 hi20, lo12;241228242242- if (offset != fill_v) {229229+ if (!riscv_insn_valid_32bit_offset(offset)) {243230 pr_err(244231 "%s: target %016llx can not be addressed by the 32-bit offset from PC = %p\n",245232 me->name, (long long)v, location);
+48-9
arch/x86/kernel/cpu/sgx/encl.c
···1313#include "sgx.h"14141515/*1616+ * Calculate byte offset of a PCMD struct associated with an enclave page. PCMD's1717+ * follow right after the EPC data in the backing storage. In addition to the1818+ * visible enclave pages, there's one extra page slot for SECS, before PCMD1919+ * structs.2020+ */2121+static inline pgoff_t sgx_encl_get_backing_page_pcmd_offset(struct sgx_encl *encl,2222+ unsigned long page_index)2323+{2424+ pgoff_t epc_end_off = encl->size + sizeof(struct sgx_secs);2525+2626+ return epc_end_off + page_index * sizeof(struct sgx_pcmd);2727+}2828+2929+/*3030+ * Free a page from the backing storage in the given page index.3131+ */3232+static inline void sgx_encl_truncate_backing_page(struct sgx_encl *encl, unsigned long page_index)3333+{3434+ struct inode *inode = file_inode(encl->backing);3535+3636+ shmem_truncate_range(inode, PFN_PHYS(page_index), PFN_PHYS(page_index) + PAGE_SIZE - 1);3737+}3838+3939+/*1640 * ELDU: Load an EPC page as unblocked. For more info, see "OS Management of EPC1741 * Pages" in the SDM.1842 */···4622{4723 unsigned long va_offset = encl_page->desc & SGX_ENCL_PAGE_VA_OFFSET_MASK;4824 struct sgx_encl *encl = encl_page->encl;2525+ pgoff_t page_index, page_pcmd_off;4926 struct sgx_pageinfo pginfo;5027 struct sgx_backing b;5151- pgoff_t page_index;2828+ bool pcmd_page_empty;2929+ u8 *pcmd_page;5230 int ret;53315432 if (secs_page)···5832 else5933 page_index = PFN_DOWN(encl->size);60343535+ page_pcmd_off = sgx_encl_get_backing_page_pcmd_offset(encl, page_index);3636+6137 ret = sgx_encl_get_backing(encl, page_index, &b);6238 if (ret)6339 return ret;64406541 pginfo.addr = encl_page->desc & PAGE_MASK;6642 pginfo.contents = (unsigned long)kmap_atomic(b.contents);6767- pginfo.metadata = (unsigned long)kmap_atomic(b.pcmd) +6868- b.pcmd_offset;4343+ pcmd_page = kmap_atomic(b.pcmd);4444+ pginfo.metadata = (unsigned long)pcmd_page + b.pcmd_offset;69457046 if (secs_page)7147 pginfo.secs = (u64)sgx_get_epc_virt_addr(secs_page);···8355 ret = -EFAULT;8456 }85578686- kunmap_atomic((void *)(unsigned long)(pginfo.metadata - b.pcmd_offset));5858+ memset(pcmd_page + b.pcmd_offset, 0, sizeof(struct sgx_pcmd));5959+6060+ /*6161+ * The area for the PCMD in the page was zeroed above. Check if the6262+ * whole page is now empty meaning that all PCMD's have been zeroed:6363+ */6464+ pcmd_page_empty = !memchr_inv(pcmd_page, 0, PAGE_SIZE);6565+6666+ kunmap_atomic(pcmd_page);8767 kunmap_atomic((void *)(unsigned long)pginfo.contents);88688969 sgx_encl_put_backing(&b, false);7070+7171+ sgx_encl_truncate_backing_page(encl, page_index);7272+7373+ if (pcmd_page_empty)7474+ sgx_encl_truncate_backing_page(encl, PFN_DOWN(page_pcmd_off));90759176 return ret;9277}···620579int sgx_encl_get_backing(struct sgx_encl *encl, unsigned long page_index,621580 struct sgx_backing *backing)622581{623623- pgoff_t pcmd_index = PFN_DOWN(encl->size) + 1 + (page_index >> 5);582582+ pgoff_t page_pcmd_off = sgx_encl_get_backing_page_pcmd_offset(encl, page_index);624583 struct page *contents;625584 struct page *pcmd;626585···628587 if (IS_ERR(contents))629588 return PTR_ERR(contents);630589631631- pcmd = sgx_encl_get_backing_page(encl, pcmd_index);590590+ pcmd = sgx_encl_get_backing_page(encl, PFN_DOWN(page_pcmd_off));632591 if (IS_ERR(pcmd)) {633592 put_page(contents);634593 return PTR_ERR(pcmd);···637596 backing->page_index = page_index;638597 backing->contents = contents;639598 backing->pcmd = pcmd;640640- backing->pcmd_offset =641641- (page_index & (PAGE_SIZE / sizeof(struct sgx_pcmd) - 1)) *642642- sizeof(struct sgx_pcmd);599599+ backing->pcmd_offset = page_pcmd_off & (PAGE_SIZE - 1);643600644601 return 0;645602}
···106106 depends on PM107107 select VIDEOMODE_HELPERS108108 select DRM_DP_AUX_BUS109109+ select DRM_DP_HELPER109110 help110111 DRM panel driver for dumb eDP panels that need at most a regulator and111112 a GPIO to be powered up. Optionally a backlight can be attached so
+4-4
drivers/gpu/drm/sun4i/sun8i_mixer.h
···111111/* format 13 is semi-planar YUV411 VUVU */112112#define SUN8I_MIXER_FBFMT_YUV411 14113113/* format 15 doesn't exist */114114-/* format 16 is P010 YVU */115115-#define SUN8I_MIXER_FBFMT_P010_YUV 17116116-/* format 18 is P210 YVU */117117-#define SUN8I_MIXER_FBFMT_P210_YUV 19114114+#define SUN8I_MIXER_FBFMT_P010_YUV 16115115+/* format 17 is P010 YVU */116116+#define SUN8I_MIXER_FBFMT_P210_YUV 18117117+/* format 19 is P210 YVU */118118/* format 20 is packed YVU444 10-bit */119119/* format 21 is packed YUV444 10-bit */120120
···22872287 dma_length_status = status->length_status;22882288 if (dev->features & NETIF_F_RXCSUM) {22892289 rx_csum = (__force __be16)(status->rx_csum & 0xffff);22902290- skb->csum = (__force __wsum)ntohs(rx_csum);22912291- skb->ip_summed = CHECKSUM_COMPLETE;22902290+ if (rx_csum) {22912291+ skb->csum = (__force __wsum)ntohs(rx_csum);22922292+ skb->ip_summed = CHECKSUM_COMPLETE;22932293+ }22922294 }2293229522942296 /* DMA flags and length are still valid no matter how
+14-1
drivers/net/ethernet/intel/iavf/iavf_main.c
···27052705 queue_delayed_work(iavf_wq, &adapter->watchdog_task, HZ * 2);27062706}2707270727082708+/**27092709+ * iavf_disable_vf - disable VF27102710+ * @adapter: board private structure27112711+ *27122712+ * Set communication failed flag and free all resources.27132713+ * NOTE: This function is expected to be called with crit_lock being held.27142714+ **/27082715static void iavf_disable_vf(struct iavf_adapter *adapter)27092716{27102717 struct iavf_mac_filter *f, *ftmp;···27662759 memset(adapter->vf_res, 0, IAVF_VIRTCHNL_VF_RESOURCE_SIZE);27672760 iavf_shutdown_adminq(&adapter->hw);27682761 adapter->netdev->flags &= ~IFF_UP;27692769- mutex_unlock(&adapter->crit_lock);27702762 adapter->flags &= ~IAVF_FLAG_RESET_PENDING;27712763 iavf_change_state(adapter, __IAVF_DOWN);27722764 wake_up(&adapter->down_waitqueue);···47834777 struct iavf_cloud_filter *cf, *cftmp;47844778 struct iavf_hw *hw = &adapter->hw;47854779 int err;47804780+47814781+ /* When reboot/shutdown is in progress no need to do anything47824782+ * as the adapter is already REMOVE state that was set during47834783+ * iavf_shutdown() callback.47844784+ */47854785+ if (adapter->state == __IAVF_REMOVE)47864786+ return;4786478747874788 set_bit(__IAVF_IN_REMOVE_TASK, &adapter->crit_section);47884789 /* Wait until port initialization is complete.
···6161 */6262static int ocelot_chain_to_lookup(int chain)6363{6464+ /* Backwards compatibility with older, single-chain tc-flower6565+ * offload support in Ocelot6666+ */6767+ if (chain == 0)6868+ return 0;6969+6470 return (chain / VCAP_LOOKUP) % 10;6571}6672···7569 */7670static int ocelot_chain_to_pag(int chain)7771{7878- int lookup = ocelot_chain_to_lookup(chain);7272+ int lookup;7373+7474+ /* Backwards compatibility with older, single-chain tc-flower7575+ * offload support in Ocelot7676+ */7777+ if (chain == 0)7878+ return 0;7979+8080+ lookup = ocelot_chain_to_lookup(chain);79818082 /* calculate PAG value as chain index relative to the first PAG */8183 return chain - VCAP_IS2_CHAIN(lookup, 0);
···16871687 int err;1688168816891689 /* Suspend the fiber mode first */16901690- if (!linkmode_test_bit(ETHTOOL_LINK_MODE_FIBRE_BIT,16911691- phydev->supported)) {16901690+ if (linkmode_test_bit(ETHTOOL_LINK_MODE_FIBRE_BIT,16911691+ phydev->supported)) {16921692 err = marvell_set_page(phydev, MII_MARVELL_FIBER_PAGE);16931693 if (err < 0)16941694 goto error;···17221722 int err;1723172317241724 /* Resume the fiber mode first */17251725- if (!linkmode_test_bit(ETHTOOL_LINK_MODE_FIBRE_BIT,17261726- phydev->supported)) {17251725+ if (linkmode_test_bit(ETHTOOL_LINK_MODE_FIBRE_BIT,17261726+ phydev->supported)) {17271727 err = marvell_set_page(phydev, MII_MARVELL_FIBER_PAGE);17281728 if (err < 0)17291729 goto error;
···753753754754 /* Iterating over all connections for all CIDs to find orphans is755755 * inefficient. Room for improvement here. */756756- vsock_for_each_connected_socket(vhost_vsock_reset_orphans);756756+ vsock_for_each_connected_socket(&vhost_transport.transport,757757+ vhost_vsock_reset_orphans);757758758759 /* Don't check the owner, because we are in the release path, so we759760 * need to stop the vsock device in any case.
+8-1
fs/afs/write.c
···703703 struct folio *folio;704704 struct page *head_page;705705 ssize_t ret;706706- int n;706706+ int n, skips = 0;707707708708 _enter("%llx,%llx,", start, end);709709···754754#ifdef CONFIG_AFS_FSCACHE755755 folio_wait_fscache(folio);756756#endif757757+ } else {758758+ start += folio_size(folio);757759 }758760 folio_put(folio);761761+ if (wbc->sync_mode == WB_SYNC_NONE) {762762+ if (skips >= 5 || need_resched())763763+ break;764764+ skips++;765765+ }759766 continue;760767 }761768
+20-3
fs/cachefiles/xattr.c
···2828static const char cachefiles_xattr_cache[] =2929 XATTR_USER_PREFIX "CacheFiles.cache";30303131+struct cachefiles_vol_xattr {3232+ __be32 reserved; /* Reserved, should be 0 */3333+ __u8 data[]; /* netfs volume coherency data */3434+} __packed;3535+3136/*3237 * set the state xattr on a cache file3338 */···190185 */191186bool cachefiles_set_volume_xattr(struct cachefiles_volume *volume)192187{188188+ struct cachefiles_vol_xattr *buf;193189 unsigned int len = volume->vcookie->coherency_len;194190 const void *p = volume->vcookie->coherency;195191 struct dentry *dentry = volume->dentry;···198192199193 _enter("%x,#%d", volume->vcookie->debug_id, len);200194195195+ len += sizeof(*buf);196196+ buf = kmalloc(len, GFP_KERNEL);197197+ if (!buf)198198+ return false;199199+ buf->reserved = cpu_to_be32(0);200200+ memcpy(buf->data, p, len);201201+201202 ret = cachefiles_inject_write_error();202203 if (ret == 0)203204 ret = vfs_setxattr(&init_user_ns, dentry, cachefiles_xattr_cache,204204- p, len, 0);205205+ buf, len, 0);205206 if (ret < 0) {206207 trace_cachefiles_vfs_error(NULL, d_inode(dentry), ret,207208 cachefiles_trace_setxattr_error);···222209 cachefiles_coherency_vol_set_ok);223210 }224211212212+ kfree(buf);225213 _leave(" = %d", ret);226214 return ret == 0;227215}···232218 */233219int cachefiles_check_volume_xattr(struct cachefiles_volume *volume)234220{235235- struct cachefiles_xattr *buf;221221+ struct cachefiles_vol_xattr *buf;236222 struct dentry *dentry = volume->dentry;237223 unsigned int len = volume->vcookie->coherency_len;238224 const void *p = volume->vcookie->coherency;···242228243229 _enter("");244230231231+ len += sizeof(*buf);245232 buf = kmalloc(len, GFP_KERNEL);246233 if (!buf)247234 return -ENOMEM;···260245 "Failed to read xattr with error %zd", xlen);261246 }262247 why = cachefiles_coherency_vol_check_xattr;263263- } else if (memcmp(buf->data, p, len) != 0) {248248+ } else if (buf->reserved != cpu_to_be32(0)) {249249+ why = cachefiles_coherency_vol_check_resv;250250+ } else if (memcmp(buf->data, p, len - sizeof(*buf)) != 0) {264251 why = cachefiles_coherency_vol_check_cmp;265252 } else {266253 why = cachefiles_coherency_vol_check_ok;
+11-11
fs/ocfs2/super.c
···11051105 goto read_super_error;11061106 }1107110711081108- root = d_make_root(inode);11091109- if (!root) {11101110- status = -ENOMEM;11111111- mlog_errno(status);11121112- goto read_super_error;11131113- }11141114-11151115- sb->s_root = root;11161116-11171117- ocfs2_complete_mount_recovery(osb);11181118-11191108 osb->osb_dev_kset = kset_create_and_add(sb->s_id, NULL,11201109 &ocfs2_kset->kobj);11211110 if (!osb->osb_dev_kset) {···11211132 "/sys/fs/ocfs2/%s/filecheck.\n", sb->s_id);11221133 goto read_super_error;11231134 }11351135+11361136+ root = d_make_root(inode);11371137+ if (!root) {11381138+ status = -ENOMEM;11391139+ mlog_errno(status);11401140+ goto read_super_error;11411141+ }11421142+11431143+ sb->s_root = root;11441144+11451145+ ocfs2_complete_mount_recovery(osb);1124114611251147 if (ocfs2_mount_local(osb))11261148 snprintf(nodestr, sizeof(nodestr), "local");
+7-4
fs/pipe.c
···253253 */254254 was_full = pipe_full(pipe->head, pipe->tail, pipe->max_usage);255255 for (;;) {256256- unsigned int head = pipe->head;256256+ /* Read ->head with a barrier vs post_one_notification() */257257+ unsigned int head = smp_load_acquire(&pipe->head);257258 unsigned int tail = pipe->tail;258259 unsigned int mask = pipe->ring_size - 1;259260···832831 int i;833832834833#ifdef CONFIG_WATCH_QUEUE835835- if (pipe->watch_queue) {834834+ if (pipe->watch_queue)836835 watch_queue_clear(pipe->watch_queue);837837- put_watch_queue(pipe->watch_queue);838838- }839836#endif840837841838 (void) account_pipe_buffers(pipe->user, pipe->nr_accounted, 0);···843844 if (buf->ops)844845 pipe_buf_release(pipe, buf);845846 }847847+#ifdef CONFIG_WATCH_QUEUE848848+ if (pipe->watch_queue)849849+ put_watch_queue(pipe->watch_queue);850850+#endif846851 if (pipe->tmp_page)847852 __free_page(pipe->tmp_page);848853 kfree(pipe->bufs);
+1
include/linux/if_arp.h
···5252 case ARPHRD_VOID:5353 case ARPHRD_NONE:5454 case ARPHRD_RAWIP:5555+ case ARPHRD_PIMREG:5556 return false;5657 default:5758 return true;
+2-1
include/linux/watch_queue.h
···2828struct watch_filter {2929 union {3030 struct rcu_head rcu;3131- unsigned long type_filter[2]; /* Bitmask of accepted types */3131+ /* Bitmask of accepted types */3232+ DECLARE_BITMAP(type_filter, WATCH_TYPE__NR);3233 };3334 u32 nr_filters; /* Number of filters */3435 struct watch_type_filter filters[];
···5656 cachefiles_coherency_set_ok,5757 cachefiles_coherency_vol_check_cmp,5858 cachefiles_coherency_vol_check_ok,5959+ cachefiles_coherency_vol_check_resv,5960 cachefiles_coherency_vol_check_xattr,6061 cachefiles_coherency_vol_set_fail,6162 cachefiles_coherency_vol_set_ok,···140139 EM(cachefiles_coherency_set_ok, "SET ok ") \141140 EM(cachefiles_coherency_vol_check_cmp, "VOL BAD cmp ") \142141 EM(cachefiles_coherency_vol_check_ok, "VOL OK ") \142142+ EM(cachefiles_coherency_vol_check_resv, "VOL BAD resv") \143143 EM(cachefiles_coherency_vol_check_xattr,"VOL BAD xatt") \144144 EM(cachefiles_coherency_vol_set_fail, "VOL SET fail") \145145 E_(cachefiles_coherency_vol_set_ok, "VOL SET ok ")
+1
kernel/configs/debug.config
···1616#1717# Compile-time checks and compiler options1818#1919+CONFIG_DEBUG_INFO=y1920CONFIG_DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT=y2021CONFIG_DEBUG_SECTION_MISMATCH=y2122CONFIG_FRAME_WARN=2048
+2-2
kernel/trace/ftrace.c
···7790779077917791/**77927792 * register_ftrace_function - register a function for profiling77937793- * @ops - ops structure that holds the function for profiling.77937793+ * @ops: ops structure that holds the function for profiling.77947794 *77957795 * Register a function to be called by all functions in the77967796 * kernel.···7817781778187818/**78197819 * unregister_ftrace_function - unregister a function for profiling.78207820- * @ops - ops structure that holds the function to unregister78207820+ * @ops: ops structure that holds the function to unregister78217821 *78227822 * Unregister a function that was added to be called by ftrace profiling.78237823 */
+31
kernel/trace/trace_osnoise.c
···13871387 }1388138813891389 /*13901390+ * In some cases, notably when running on a nohz_full CPU with13911391+ * a stopped tick PREEMPT_RCU has no way to account for QSs.13921392+ * This will eventually cause unwarranted noise as PREEMPT_RCU13931393+ * will force preemption as the means of ending the current13941394+ * grace period. We avoid this problem by calling13951395+ * rcu_momentary_dyntick_idle(), which performs a zero duration13961396+ * EQS allowing PREEMPT_RCU to end the current grace period.13971397+ * This call shouldn't be wrapped inside an RCU critical13981398+ * section.13991399+ *14001400+ * Note that in non PREEMPT_RCU kernels QSs are handled through14011401+ * cond_resched()14021402+ */14031403+ if (IS_ENABLED(CONFIG_PREEMPT_RCU)) {14041404+ local_irq_disable();14051405+ rcu_momentary_dyntick_idle();14061406+ local_irq_enable();14071407+ }14081408+14091409+ /*13901410 * For the non-preemptive kernel config: let threads runs, if13911411 * they so wish.13921412 */···22182198 * the last instance, and the workload can stop.22192199 */22202200 if (osnoise_has_registered_instances())22012201+ return;22022202+22032203+ /*22042204+ * If callbacks were already disabled in a previous stop22052205+ * call, there is no need to disable then again.22062206+ *22072207+ * For instance, this happens when tracing is stopped via:22082208+ * echo 0 > tracing_on22092209+ * echo nop > current_tracer.22102210+ */22112211+ if (!trace_osnoise_callback_enabled)22212212 return;2222221322232214 trace_osnoise_callback_enabled = false;
+11-11
kernel/watch_queue.c
···5454 bit += page->index;55555656 set_bit(bit, wqueue->notes_bitmap);5757+ generic_pipe_buf_release(pipe, buf);5758}58595960// No try_steal function => no stealing···113112 buf->offset = offset;114113 buf->len = len;115114 buf->flags = PIPE_BUF_FLAG_WHOLE;116116- pipe->head = head + 1;115115+ smp_store_release(&pipe->head, head + 1); /* vs pipe_read() */117116118117 if (!test_and_clear_bit(note, wqueue->notes_bitmap)) {119118 spin_unlock_irq(&pipe->rd_wait.lock);···220219 struct page **pages;221220 unsigned long *bitmap;222221 unsigned long user_bufs;223223- unsigned int bmsize;224222 int ret, i, nr_pages;225223226224 if (!wqueue)···243243 goto error;244244 }245245246246- ret = pipe_resize_ring(pipe, nr_notes);246246+ nr_notes = nr_pages * WATCH_QUEUE_NOTES_PER_PAGE;247247+ ret = pipe_resize_ring(pipe, roundup_pow_of_two(nr_notes));247248 if (ret < 0)248249 goto error;249250···259258 pages[i]->index = i * WATCH_QUEUE_NOTES_PER_PAGE;260259 }261260262262- bmsize = (nr_notes + BITS_PER_LONG - 1) / BITS_PER_LONG;263263- bmsize *= sizeof(unsigned long);264264- bitmap = kmalloc(bmsize, GFP_KERNEL);261261+ bitmap = bitmap_alloc(nr_notes, GFP_KERNEL);265262 if (!bitmap)266263 goto error_p;267264268268- memset(bitmap, 0xff, bmsize);265265+ bitmap_fill(bitmap, nr_notes);269266 wqueue->notes = pages;270267 wqueue->notes_bitmap = bitmap;271268 wqueue->nr_pages = nr_pages;272272- wqueue->nr_notes = nr_pages * WATCH_QUEUE_NOTES_PER_PAGE;269269+ wqueue->nr_notes = nr_notes;273270 return 0;274271275272error_p:···319320 tf[i].info_mask & WATCH_INFO_LENGTH)320321 goto err_filter;321322 /* Ignore any unknown types */322322- if (tf[i].type >= sizeof(wfilter->type_filter) * 8)323323+ if (tf[i].type >= WATCH_TYPE__NR)323324 continue;324325 nr_filter++;325326 }···335336336337 q = wfilter->filters;337338 for (i = 0; i < filter.nr_filters; i++) {338338- if (tf[i].type >= sizeof(wfilter->type_filter) * BITS_PER_LONG)339339+ if (tf[i].type >= WATCH_TYPE__NR)339340 continue;340341341342 q->type = tf[i].type;···370371371372 for (i = 0; i < wqueue->nr_pages; i++)372373 __free_page(wqueue->notes[i]);374374+ bitmap_free(wqueue->notes_bitmap);373375374376 wfilter = rcu_access_pointer(wqueue->filter);375377 if (wfilter)···566566 rcu_read_lock();567567 spin_lock_bh(&wqueue->lock);568568569569- /* Prevent new additions and prevent notifications from happening */569569+ /* Prevent new notifications from being stored. */570570 wqueue->defunct = true;571571572572 while (!hlist_empty(&wqueue->watches)) {
+1-1
mm/swap_state.c
···478478 * __read_swap_cache_async(), which has set SWAP_HAS_CACHE479479 * in swap_map, but not yet added its page to swap cache.480480 */481481- cond_resched();481481+ schedule_timeout_uninterruptible(1);482482 }483483484484 /*
···494494 goto another_round;495495}496496497497-static bool tuple_force_port_remap(const struct nf_conntrack_tuple *tuple)498498-{499499- u16 sp, dp;500500-501501- switch (tuple->dst.protonum) {502502- case IPPROTO_TCP:503503- sp = ntohs(tuple->src.u.tcp.port);504504- dp = ntohs(tuple->dst.u.tcp.port);505505- break;506506- case IPPROTO_UDP:507507- case IPPROTO_UDPLITE:508508- sp = ntohs(tuple->src.u.udp.port);509509- dp = ntohs(tuple->dst.u.udp.port);510510- break;511511- default:512512- return false;513513- }514514-515515- /* IANA: System port range: 1-1023,516516- * user port range: 1024-49151,517517- * private port range: 49152-65535.518518- *519519- * Linux default ephemeral port range is 32768-60999.520520- *521521- * Enforce port remapping if sport is significantly lower522522- * than dport to prevent NAT port shadowing, i.e.523523- * accidental match of 'new' inbound connection vs.524524- * existing outbound one.525525- */526526- return sp < 16384 && dp >= 32768;527527-}528528-529497/* Manipulate the tuple into the range given. For NF_INET_POST_ROUTING,530498 * we change the source to map into the range. For NF_INET_PRE_ROUTING531499 * and NF_INET_LOCAL_OUT, we change the destination to map into the···507539 struct nf_conn *ct,508540 enum nf_nat_manip_type maniptype)509541{510510- bool random_port = range->flags & NF_NAT_RANGE_PROTO_RANDOM_ALL;511542 const struct nf_conntrack_zone *zone;512543 struct net *net = nf_ct_net(ct);513544514545 zone = nf_ct_zone(ct);515515-516516- if (maniptype == NF_NAT_MANIP_SRC &&517517- !random_port &&518518- !ct->local_origin)519519- random_port = tuple_force_port_remap(orig_tuple);520546521547 /* 1) If this srcip/proto/src-proto-part is currently mapped,522548 * and that same mapping gives a unique tuple within the given···520558 * So far, we don't do local source mappings, so multiple521559 * manips not an issue.522560 */523523- if (maniptype == NF_NAT_MANIP_SRC && !random_port) {561561+ if (maniptype == NF_NAT_MANIP_SRC &&562562+ !(range->flags & NF_NAT_RANGE_PROTO_RANDOM_ALL)) {524563 /* try the original tuple first */525564 if (in_range(orig_tuple, range)) {526565 if (!nf_nat_used_tuple(orig_tuple, ct)) {···545582 */546583547584 /* Only bother mapping if it's not already in range and unique */548548- if (!random_port) {585585+ if (!(range->flags & NF_NAT_RANGE_PROTO_RANDOM_ALL)) {549586 if (range->flags & NF_NAT_RANGE_PROTO_SPECIFIED) {550587 if (!(range->flags & NF_NAT_RANGE_PROTO_OFFSET) &&551588 l4proto_in_range(tuple, maniptype,
+7-2
net/netfilter/nf_tables_api.c
···82878287}82888288EXPORT_SYMBOL_GPL(nf_tables_trans_destroy_flush_work);8289828982908290+static bool nft_expr_reduce(struct nft_regs_track *track,82918291+ const struct nft_expr *expr)82928292+{82938293+ return false;82948294+}82958295+82908296static int nf_tables_commit_chain_prepare(struct net *net, struct nft_chain *chain)82918297{82928298 const struct nft_expr *expr, *last;···83408334 nft_rule_for_each_expr(expr, last, rule) {83418335 track.cur = expr;8342833683438343- if (expr->ops->reduce &&83448344- expr->ops->reduce(&track, expr)) {83378337+ if (nft_expr_reduce(&track, expr)) {83458338 expr = track.cur;83468339 continue;83478340 }
+10-1
net/packet/af_packet.c
···23182318 copy_skb = skb_get(skb);23192319 skb_head = skb->data;23202320 }23212321- if (copy_skb)23212321+ if (copy_skb) {23222322+ memset(&PACKET_SKB_CB(copy_skb)->sa.ll, 0,23232323+ sizeof(PACKET_SKB_CB(copy_skb)->sa.ll));23222324 skb_set_owner_r(copy_skb, sk);23252325+ }23232326 }23242327 snaplen = po->rx_ring.frame_size - macoff;23252328 if ((int)snaplen < 0) {···34673464 sock_recv_ts_and_drops(msg, sk, skb);3468346534693466 if (msg->msg_name) {34673467+ const size_t max_len = min(sizeof(skb->cb),34683468+ sizeof(struct sockaddr_storage));34703469 int copy_len;3471347034723471 /* If the address length field is there to be filled···34903485 0, sizeof(sll->sll_addr));34913486 msg->msg_namelen = sizeof(struct sockaddr_ll);34923487 }34883488+ }34893489+ if (WARN_ON_ONCE(copy_len > max_len)) {34903490+ copy_len = max_len;34913491+ msg->msg_namelen = copy_len;34933492 }34943493 memcpy(msg->msg_name, &PACKET_SKB_CB(skb)->sa, copy_len);34953494 }
+7-2
net/vmw_vsock/af_vsock.c
···334334}335335EXPORT_SYMBOL_GPL(vsock_remove_sock);336336337337-void vsock_for_each_connected_socket(void (*fn)(struct sock *sk))337337+void vsock_for_each_connected_socket(struct vsock_transport *transport,338338+ void (*fn)(struct sock *sk))338339{339340 int i;340341···344343 for (i = 0; i < ARRAY_SIZE(vsock_connected_table); i++) {345344 struct vsock_sock *vsk;346345 list_for_each_entry(vsk, &vsock_connected_table[i],347347- connected_table)346346+ connected_table) {347347+ if (vsk->transport != transport)348348+ continue;349349+348350 fn(sk_vsock(vsk));351351+ }349352 }350353351354 spin_unlock_bh(&vsock_table_lock);
+5-2
net/vmw_vsock/virtio_transport.c
···2424static struct workqueue_struct *virtio_vsock_workqueue;2525static struct virtio_vsock __rcu *the_virtio_vsock;2626static DEFINE_MUTEX(the_virtio_vsock_mutex); /* protects the_virtio_vsock */2727+static struct virtio_transport virtio_transport; /* forward declaration */27282829struct virtio_vsock {2930 struct virtio_device *vdev;···385384 switch (le32_to_cpu(event->id)) {386385 case VIRTIO_VSOCK_EVENT_TRANSPORT_RESET:387386 virtio_vsock_update_guest_cid(vsock);388388- vsock_for_each_connected_socket(virtio_vsock_reset_sock);387387+ vsock_for_each_connected_socket(&virtio_transport.transport,388388+ virtio_vsock_reset_sock);389389 break;390390 }391391}···664662 synchronize_rcu();665663666664 /* Reset all connected sockets when the device disappear */667667- vsock_for_each_connected_socket(virtio_vsock_reset_sock);665665+ vsock_for_each_connected_socket(&virtio_transport.transport,666666+ virtio_vsock_reset_sock);668667669668 /* Stop all work handlers to make sure no one is accessing the device,670669 * so we can safely call virtio_reset_device().
+4-1
net/vmw_vsock/vmci_transport.c
···75757676static int PROTOCOL_OVERRIDE = -1;77777878+static struct vsock_transport vmci_transport; /* forward declaration */7979+7880/* Helper function to convert from a VMCI error code to a VSock error code. */79818082static s32 vmci_transport_error_to_vsock_error(s32 vmci_error)···884882 const struct vmci_event_data *e_data,885883 void *client_data)886884{887887- vsock_for_each_connected_socket(vmci_transport_handle_detach);885885+ vsock_for_each_connected_socket(&vmci_transport,886886+ vmci_transport_handle_detach);888887}889888890889static void vmci_transport_recv_pkt_work(struct work_struct *work)
···204204/* FREE! ( 7*32+10) */205205#define X86_FEATURE_PTI ( 7*32+11) /* Kernel Page Table Isolation enabled */206206#define X86_FEATURE_RETPOLINE ( 7*32+12) /* "" Generic Retpoline mitigation for Spectre variant 2 */207207-#define X86_FEATURE_RETPOLINE_LFENCE ( 7*32+13) /* "" Use LFENCEs for Spectre variant 2 */207207+#define X86_FEATURE_RETPOLINE_LFENCE ( 7*32+13) /* "" Use LFENCE for Spectre variant 2 */208208#define X86_FEATURE_INTEL_PPIN ( 7*32+14) /* Intel Processor Inventory Number */209209#define X86_FEATURE_CDP_L2 ( 7*32+15) /* Code and Data Prioritization L2 */210210#define X86_FEATURE_MSR_SPEC_CTRL ( 7*32+16) /* "" MSR SPEC_CTRL is implemented */
+1-1
tools/perf/bench/epoll-ctl.c
···106106 printinfo("Nesting level(s): %d\n", nested);107107108108 epollfdp = calloc(nested, sizeof(int));109109- if (!epollfd)109109+ if (!epollfdp)110110 err(EXIT_FAILURE, "calloc");111111112112 for (i = 0; i < nested; i++) {
+5-3
tools/perf/util/parse-events.c
···16481648{16491649 struct parse_events_term *term;16501650 struct list_head *list = NULL;16511651+ struct list_head *orig_head = NULL;16511652 struct perf_pmu *pmu = NULL;16521653 int ok = 0;16531654 char *config;···16751674 }16761675 list_add_tail(&term->list, head);1677167616781678-16791677 /* Add it for all PMUs that support the alias */16801678 list = malloc(sizeof(struct list_head));16811679 if (!list)···1687168716881688 list_for_each_entry(alias, &pmu->aliases, list) {16891689 if (!strcasecmp(alias->name, str)) {16901690+ parse_events_copy_term_list(head, &orig_head);16901691 if (!parse_events_add_pmu(parse_state, list,16911691- pmu->name, head,16921692+ pmu->name, orig_head,16921693 true, true)) {16931694 pr_debug("%s -> %s/%s/\n", str,16941695 pmu->name, alias->str);16951696 ok++;16961697 }16981698+ parse_events_terms__delete(orig_head);16971699 }16981700 }16991701 }···21952193 for (i = 0; i < ARRAY_SIZE(symbols); i++, tmp++) {21962194 tmp->type = symbols[i].type;21972195 tmp->symbol = strdup(symbols[i].symbol);21982198- if (!list->symbol)21962196+ if (!tmp->symbol)21992197 goto err_free;22002198 }22012199
+2-3
tools/testing/selftests/netfilter/nft_nat.sh
···880880 return $ksft_skip881881 fi882882883883- # test default behaviour. Packet from ns1 to ns0 is not redirected884884- # due to automatic port translation.885885- test_port_shadow "default" "ROUTER"883883+ # test default behaviour. Packet from ns1 to ns0 is redirected to ns2.884884+ test_port_shadow "default" "CLIENT"886885887886 # test packet filter based mitigation: prevent forwarding of888887 # packets claiming to come from the service port.
+2-4
tools/testing/selftests/vm/Makefile
···11# SPDX-License-Identifier: GPL-2.022# Makefile for vm selftests3344+LOCAL_HDRS += $(selfdir)/vm/local_config.h $(top_srcdir)/mm/gup_test.h55+46include local_config.mk5768uname_M := $(shell uname -m 2>/dev/null || echo not)···141139endif142140143141$(OUTPUT)/mlock-random-test $(OUTPUT)/memfd_secret: LDLIBS += -lcap144144-145145-$(OUTPUT)/gup_test: ../../../../mm/gup_test.h146146-147147-$(OUTPUT)/hmm-tests: local_config.h148142149143# HMM_EXTRA_LIBS may get set in local_config.mk, or it may be left empty.150144$(OUTPUT)/hmm-tests: LDLIBS += $(HMM_EXTRA_LIBS)