Thierry needs fd70c7755bf0 ("drm/bridge: tc358767: fix max_tu_symbol value") to be able to merge his dp_link patch series. Some adjacent changes conflicts, plus some clashes in i915 due to cherry-picking and git trying to be helpful and leaving both versions in.
Showing the changes to include/linux (19 of 706 files). Show all
Unified · Split
| @@ -326,10 +326,11 @@ static inline int bitmap_equal(const unsigned long *src1, · 325 unmodified lines | |||
| 326 | } | 326 | } |
| 327 | 327 | ||
| 328 | /** | 328 | /** |
| 329 | * bitmap_or_equal - Check whether the or of two bitnaps is equal to a third | 329 | * bitmap_or_equal - Check whether the or of two bitmaps is equal to a third |
| 330 | * @src1: Pointer to bitmap 1 | 330 | * @src1: Pointer to bitmap 1 |
| 331 | * @src2: Pointer to bitmap 2 will be or'ed with bitmap 1 | 331 | * @src2: Pointer to bitmap 2 will be or'ed with bitmap 1 |
| 332 | * @src3: Pointer to bitmap 3. Compare to the result of *@src1 | *@src2 | 332 | * @src3: Pointer to bitmap 3. Compare to the result of *@src1 | *@src2 |
| 333 | * @nbits: number of bits in each of these bitmaps | ||
| 333 | * | 334 | * |
| 334 | * Returns: True if (*@src1 | *@src2) == *@src3, false otherwise | 335 | * Returns: True if (*@src1 | *@src2) == *@src3, false otherwise |
| 335 | */ | 336 | */ |
| @@ -40,6 +40,7 @@ · 39 unmodified lines | |||
| 40 | # define __GCC4_has_attribute___noclone__ 1 | 40 | # define __GCC4_has_attribute___noclone__ 1 |
| 41 | # define __GCC4_has_attribute___nonstring__ 0 | 41 | # define __GCC4_has_attribute___nonstring__ 0 |
| 42 | # define __GCC4_has_attribute___no_sanitize_address__ (__GNUC_MINOR__ >= 8) | 42 | # define __GCC4_has_attribute___no_sanitize_address__ (__GNUC_MINOR__ >= 8) |
| 43 | # define __GCC4_has_attribute___fallthrough__ 0 | ||
| 43 | #endif | 44 | #endif |
| 44 | 45 | ||
| 45 | /* | 46 | /* |
| @@ -185,6 +186,22 @@ · 139 unmodified lines | |||
| 185 | # define __noclone | 186 | # define __noclone |
| 186 | #endif | 187 | #endif |
| 187 | 188 | ||
| 189 | /* | ||
| 190 | * Add the pseudo keyword 'fallthrough' so case statement blocks | ||
| 191 | * must end with any of these keywords: | ||
| 192 | * break; | ||
| 193 | * fallthrough; | ||
| 194 | * goto <label>; | ||
| 195 | * return [expression]; | ||
| 196 | * | ||
| 197 | * gcc: https://gcc.gnu.org/onlinedocs/gcc/Statement-Attributes.html#Statement-Attributes | ||
| 198 | */ | ||
| 199 | #if __has_attribute(__fallthrough__) | ||
| 200 | # define fallthrough __attribute__((__fallthrough__)) | ||
| 201 | #else | ||
| 202 | # define fallthrough do {} while (0) /* fallthrough */ | ||
| 203 | #endif | ||
| 204 | |||
| 188 | /* | 205 | /* |
| 189 | * Note the missing underscores. | 206 | * Note the missing underscores. |
| 190 | * | 207 | * |
| @@ -52,10 +52,10 @@ extern struct module __this_module; · 51 unmodified lines | |||
| 52 | __ADDRESSABLE(sym) \ | 52 | __ADDRESSABLE(sym) \ |
| 53 | asm(" .section \"___ksymtab" sec "+" #sym "\", \"a\" \n" \ | 53 | asm(" .section \"___ksymtab" sec "+" #sym "\", \"a\" \n" \ |
| 54 | " .balign 4 \n" \ | 54 | " .balign 4 \n" \ |
| 55 | "__ksymtab_" #sym NS_SEPARATOR #ns ": \n" \ | 55 | "__ksymtab_" #ns NS_SEPARATOR #sym ": \n" \ |
| 56 | " .long " #sym "- . \n" \ | 56 | " .long " #sym "- . \n" \ |
| 57 | " .long __kstrtab_" #sym "- . \n" \ | 57 | " .long __kstrtab_" #sym "- . \n" \ |
| 58 | " .long __kstrtab_ns_" #sym "- . \n" \ | 58 | " .long __kstrtabns_" #sym "- . \n" \ |
| 59 | " .previous \n") | 59 | " .previous \n") |
| 60 | 60 | ||
| 61 | #define __KSYMTAB_ENTRY(sym, sec) \ | 61 | #define __KSYMTAB_ENTRY(sym, sec) \ |
| @@ -76,10 +76,10 @@ struct kernel_symbol { · 14 unmodified lines | |||
| 76 | #else | 76 | #else |
| 77 | #define __KSYMTAB_ENTRY_NS(sym, sec, ns) \ | 77 | #define __KSYMTAB_ENTRY_NS(sym, sec, ns) \ |
| 78 | static const struct kernel_symbol __ksymtab_##sym##__##ns \ | 78 | static const struct kernel_symbol __ksymtab_##sym##__##ns \ |
| 79 | asm("__ksymtab_" #sym NS_SEPARATOR #ns) \ | 79 | asm("__ksymtab_" #ns NS_SEPARATOR #sym) \ |
| 80 | __attribute__((section("___ksymtab" sec "+" #sym), used)) \ | 80 | __attribute__((section("___ksymtab" sec "+" #sym), used)) \ |
| 81 | __aligned(sizeof(void *)) \ | 81 | __aligned(sizeof(void *)) \ |
| 82 | = { (unsigned long)&sym, __kstrtab_##sym, __kstrtab_ns_##sym } | 82 | = { (unsigned long)&sym, __kstrtab_##sym, __kstrtabns_##sym } |
| 83 | 83 | ||
| 84 | #define __KSYMTAB_ENTRY(sym, sec) \ | 84 | #define __KSYMTAB_ENTRY(sym, sec) \ |
| 85 | static const struct kernel_symbol __ksymtab_##sym \ | 85 | static const struct kernel_symbol __ksymtab_##sym \ |
| @@ -112,7 +112,7 @@ struct kernel_symbol { · 26 unmodified lines | |||
| 112 | /* For every exported symbol, place a struct in the __ksymtab section */ | 112 | /* For every exported symbol, place a struct in the __ksymtab section */ |
| 113 | #define ___EXPORT_SYMBOL_NS(sym, sec, ns) \ | 113 | #define ___EXPORT_SYMBOL_NS(sym, sec, ns) \ |
| 114 | ___export_symbol_common(sym, sec); \ | 114 | ___export_symbol_common(sym, sec); \ |
| 115 | static const char __kstrtab_ns_##sym[] \ | 115 | static const char __kstrtabns_##sym[] \ |
| 116 | __attribute__((section("__ksymtab_strings"), used, aligned(1))) \ | 116 | __attribute__((section("__ksymtab_strings"), used, aligned(1))) \ |
| 117 | = #ns; \ | 117 | = #ns; \ |
| 118 | __KSYMTAB_ENTRY_NS(sym, sec, ns) | 118 | __KSYMTAB_ENTRY_NS(sym, sec, ns) |
| @@ -201,6 +201,14 @@ struct gpio_irq_chip { · 200 unmodified lines | |||
| 201 | */ | 201 | */ |
| 202 | bool threaded; | 202 | bool threaded; |
| 203 | 203 | ||
| 204 | /** | ||
| 205 | * @init_hw: optional routine to initialize hardware before | ||
| 206 | * an IRQ chip will be added. This is quite useful when | ||
| 207 | * a particular driver wants to clear IRQ related registers | ||
| 208 | * in order to avoid undesired events. | ||
| 209 | */ | ||
| 210 | int (*init_hw)(struct gpio_chip *chip); | ||
| 211 | |||
| 204 | /** | 212 | /** |
| 205 | * @init_valid_mask: optional routine to initialize @valid_mask, to be | 213 | * @init_valid_mask: optional routine to initialize @valid_mask, to be |
| 206 | * used if not all GPIO lines are valid interrupts. Sometimes some | 214 | * used if not all GPIO lines are valid interrupts. Sometimes some |
| @@ -235,7 +235,7 @@ enum hwmon_power_attributes { · 234 unmodified lines | |||
| 235 | #define HWMON_P_LABEL BIT(hwmon_power_label) | 235 | #define HWMON_P_LABEL BIT(hwmon_power_label) |
| 236 | #define HWMON_P_ALARM BIT(hwmon_power_alarm) | 236 | #define HWMON_P_ALARM BIT(hwmon_power_alarm) |
| 237 | #define HWMON_P_CAP_ALARM BIT(hwmon_power_cap_alarm) | 237 | #define HWMON_P_CAP_ALARM BIT(hwmon_power_cap_alarm) |
| 238 | #define HWMON_P_MIN_ALARM BIT(hwmon_power_max_alarm) | 238 | #define HWMON_P_MIN_ALARM BIT(hwmon_power_min_alarm) |
| 239 | #define HWMON_P_MAX_ALARM BIT(hwmon_power_max_alarm) | 239 | #define HWMON_P_MAX_ALARM BIT(hwmon_power_max_alarm) |
| 240 | #define HWMON_P_LCRIT_ALARM BIT(hwmon_power_lcrit_alarm) | 240 | #define HWMON_P_LCRIT_ALARM BIT(hwmon_power_lcrit_alarm) |
| 241 | #define HWMON_P_CRIT_ALARM BIT(hwmon_power_crit_alarm) | 241 | #define HWMON_P_CRIT_ALARM BIT(hwmon_power_crit_alarm) |
| @@ -247,7 +247,7 @@ extern void led_set_brightness(struct led_classdev *led_cdev, · 246 unmodified lines | |||
| 247 | /** | 247 | /** |
| 248 | * led_set_brightness_sync - set LED brightness synchronously | 248 | * led_set_brightness_sync - set LED brightness synchronously |
| 249 | * @led_cdev: the LED to set | 249 | * @led_cdev: the LED to set |
| 250 | * @brightness: the brightness to set it to | 250 | * @value: the brightness to set it to |
| 251 | * | 251 | * |
| 252 | * Set an LED's brightness immediately. This function will block | 252 | * Set an LED's brightness immediately. This function will block |
| 253 | * the caller for the time required for accessing device registers, | 253 | * the caller for the time required for accessing device registers, |
| @@ -301,8 +301,7 @@ extern void led_sysfs_enable(struct led_classdev *led_cdev); · 47 unmodified lines | |||
| 301 | /** | 301 | /** |
| 302 | * led_compose_name - compose LED class device name | 302 | * led_compose_name - compose LED class device name |
| 303 | * @dev: LED controller device object | 303 | * @dev: LED controller device object |
| 304 | * @child: child fwnode_handle describing a LED or a group of synchronized LEDs; | 304 | * @init_data: the LED class device initialization data |
| 305 | * it must be provided only for fwnode based LEDs | ||
| 306 | * @led_classdev_name: composed LED class device name | 305 | * @led_classdev_name: composed LED class device name |
| 307 | * | 306 | * |
| 308 | * Create LED class device name basing on the provided init_data argument. | 307 | * Create LED class device name basing on the provided init_data argument. |
| @@ -356,6 +356,19 @@ static inline bool mem_cgroup_disabled(void) · 355 unmodified lines | |||
| 356 | return !cgroup_subsys_enabled(memory_cgrp_subsys); | 356 | return !cgroup_subsys_enabled(memory_cgrp_subsys); |
| 357 | } | 357 | } |
| 358 | 358 | ||
| 359 | static inline unsigned long mem_cgroup_protection(struct mem_cgroup *memcg, | ||
| 360 | bool in_low_reclaim) | ||
| 361 | { | ||
| 362 | if (mem_cgroup_disabled()) | ||
| 363 | return 0; | ||
| 364 | |||
| 365 | if (in_low_reclaim) | ||
| 366 | return READ_ONCE(memcg->memory.emin); | ||
| 367 | |||
| 368 | return max(READ_ONCE(memcg->memory.emin), | ||
| 369 | READ_ONCE(memcg->memory.elow)); | ||
| 370 | } | ||
| 371 | |||
| 359 | enum mem_cgroup_protection mem_cgroup_protected(struct mem_cgroup *root, | 372 | enum mem_cgroup_protection mem_cgroup_protected(struct mem_cgroup *root, |
| 360 | struct mem_cgroup *memcg); | 373 | struct mem_cgroup *memcg); |
| 361 | 374 | ||
| @@ -537,6 +550,8 @@ void mem_cgroup_handle_over_high(void); · 175 unmodified lines | |||
| 537 | 550 | ||
| 538 | unsigned long mem_cgroup_get_max(struct mem_cgroup *memcg); | 551 | unsigned long mem_cgroup_get_max(struct mem_cgroup *memcg); |
| 539 | 552 | ||
| 553 | unsigned long mem_cgroup_size(struct mem_cgroup *memcg); | ||
| 554 | |||
| 540 | void mem_cgroup_print_oom_context(struct mem_cgroup *memcg, | 555 | void mem_cgroup_print_oom_context(struct mem_cgroup *memcg, |
| 541 | struct task_struct *p); | 556 | struct task_struct *p); |
| 542 | 557 | ||
| @@ -829,6 +844,12 @@ static inline void memcg_memory_event_mm(struct mm_struct *mm, · 286 unmodified lines | |||
| 829 | { | 844 | { |
| 830 | } | 845 | } |
| 831 | 846 | ||
| 847 | static inline unsigned long mem_cgroup_protection(struct mem_cgroup *memcg, | ||
| 848 | bool in_low_reclaim) | ||
| 849 | { | ||
| 850 | return 0; | ||
| 851 | } | ||
| 852 | |||
| 832 | static inline enum mem_cgroup_protection mem_cgroup_protected( | 853 | static inline enum mem_cgroup_protection mem_cgroup_protected( |
| 833 | struct mem_cgroup *root, struct mem_cgroup *memcg) | 854 | struct mem_cgroup *root, struct mem_cgroup *memcg) |
| 834 | { | 855 | { |
| @@ -968,6 +989,11 @@ static inline unsigned long mem_cgroup_get_max(struct mem_cgroup *memcg) · 133 unmodified lines | |||
| 968 | return 0; | 989 | return 0; |
| 969 | } | 990 | } |
| 970 | 991 | ||
| 992 | static inline unsigned long mem_cgroup_size(struct mem_cgroup *memcg) | ||
| 993 | { | ||
| 994 | return 0; | ||
| 995 | } | ||
| 996 | |||
| 971 | static inline void | 997 | static inline void |
| 972 | mem_cgroup_print_oom_context(struct mem_cgroup *memcg, struct task_struct *p) | 998 | mem_cgroup_print_oom_context(struct mem_cgroup *memcg, struct task_struct *p) |
| 973 | { | 999 | { |
| @@ -1264,6 +1290,9 @@ void mem_cgroup_track_foreign_dirty_slowpath(struct page *page, · 290 unmodified lines | |||
| 1264 | static inline void mem_cgroup_track_foreign_dirty(struct page *page, | 1290 | static inline void mem_cgroup_track_foreign_dirty(struct page *page, |
| 1265 | struct bdi_writeback *wb) | 1291 | struct bdi_writeback *wb) |
| 1266 | { | 1292 | { |
| 1293 | if (mem_cgroup_disabled()) | ||
| 1294 | return; | ||
| 1295 | |||
| 1267 | if (unlikely(&page->mem_cgroup->css != wb->memcg_css)) | 1296 | if (unlikely(&page->mem_cgroup->css != wb->memcg_css)) |
| 1268 | mem_cgroup_track_foreign_dirty_slowpath(page, wb); | 1297 | mem_cgroup_track_foreign_dirty_slowpath(page, wb); |
| 1269 | } | 1298 | } |
| @@ -31,7 +31,7 @@ · 30 unmodified lines | |||
| 31 | #define PHY_ID_KSZ886X 0x00221430 | 31 | #define PHY_ID_KSZ886X 0x00221430 |
| 32 | #define PHY_ID_KSZ8863 0x00221435 | 32 | #define PHY_ID_KSZ8863 0x00221435 |
| 33 | 33 | ||
| 34 | #define PHY_ID_KSZ8795 0x00221550 | 34 | #define PHY_ID_KSZ87XX 0x00221550 |
| 35 | 35 | ||
| 36 | #define PHY_ID_KSZ9477 0x00221631 | 36 | #define PHY_ID_KSZ9477 0x00221631 |
| 37 | 37 | ||
| @@ -18,7 +18,7 @@ struct page_ext_operations { · 17 unmodified lines | |||
| 18 | 18 | ||
| 19 | enum page_ext_flags { | 19 | enum page_ext_flags { |
| 20 | PAGE_EXT_OWNER, | 20 | PAGE_EXT_OWNER, |
| 21 | PAGE_EXT_OWNER_ACTIVE, | 21 | PAGE_EXT_OWNER_ALLOCATED, |
| 22 | #if defined(CONFIG_IDLE_PAGE_TRACKING) && !defined(CONFIG_64BIT) | 22 | #if defined(CONFIG_IDLE_PAGE_TRACKING) && !defined(CONFIG_64BIT) |
| 23 | PAGE_EXT_YOUNG, | 23 | PAGE_EXT_YOUNG, |
| 24 | PAGE_EXT_IDLE, | 24 | PAGE_EXT_IDLE, |
| @@ -36,6 +36,7 @@ struct page_ext { · 11 unmodified lines | |||
| 36 | unsigned long flags; | 36 | unsigned long flags; |
| 37 | }; | 37 | }; |
| 38 | 38 | ||
| 39 | extern unsigned long page_ext_size; | ||
| 39 | extern void pgdat_page_ext_init(struct pglist_data *pgdat); | 40 | extern void pgdat_page_ext_init(struct pglist_data *pgdat); |
| 40 | 41 | ||
| 41 | #ifdef CONFIG_SPARSEMEM | 42 | #ifdef CONFIG_SPARSEMEM |
| @@ -52,6 +53,13 @@ static inline void page_ext_init(void) · 10 unmodified lines | |||
| 52 | 53 | ||
| 53 | struct page_ext *lookup_page_ext(const struct page *page); | 54 | struct page_ext *lookup_page_ext(const struct page *page); |
| 54 | 55 | ||
| 56 | static inline struct page_ext *page_ext_next(struct page_ext *curr) | ||
| 57 | { | ||
| 58 | void *next = curr; | ||
| 59 | next += page_ext_size; | ||
| 60 | return next; | ||
| 61 | } | ||
| 62 | |||
| 55 | #else /* !CONFIG_PAGE_EXTENSION */ | 63 | #else /* !CONFIG_PAGE_EXTENSION */ |
| 56 | struct page_ext; | 64 | struct page_ext; |
| 57 | 65 | ||
| @@ -64,6 +64,8 @@ extern struct resource *platform_get_resource_byname(struct platform_device *, · 63 unmodified lines | |||
| 64 | unsigned int, | 64 | unsigned int, |
| 65 | const char *); | 65 | const char *); |
| 66 | extern int platform_get_irq_byname(struct platform_device *, const char *); | 66 | extern int platform_get_irq_byname(struct platform_device *, const char *); |
| 67 | extern int platform_get_irq_byname_optional(struct platform_device *dev, | ||
| 68 | const char *name); | ||
| 67 | extern int platform_add_devices(struct platform_device **, int); | 69 | extern int platform_add_devices(struct platform_device **, int); |
| 68 | 70 | ||
| 69 | struct platform_device_info { | 71 | struct platform_device_info { |
| @@ -223,6 +223,7 @@ extern long schedule_timeout_uninterruptible(long timeout); · 222 unmodified lines | |||
| 223 | extern long schedule_timeout_idle(long timeout); | 223 | extern long schedule_timeout_idle(long timeout); |
| 224 | asmlinkage void schedule(void); | 224 | asmlinkage void schedule(void); |
| 225 | extern void schedule_preempt_disabled(void); | 225 | extern void schedule_preempt_disabled(void); |
| 226 | asmlinkage void preempt_schedule_irq(void); | ||
| 226 | 227 | ||
| 227 | extern int __must_check io_schedule_prepare(void); | 228 | extern int __must_check io_schedule_prepare(void); |
| 228 | extern void io_schedule_finish(int token); | 229 | extern void io_schedule_finish(int token); |
| @@ -3510,8 +3510,9 @@ int skb_ensure_writable(struct sk_buff *skb, int write_len); · 3509 unmodified lines | |||
| 3510 | int __skb_vlan_pop(struct sk_buff *skb, u16 *vlan_tci); | 3510 | int __skb_vlan_pop(struct sk_buff *skb, u16 *vlan_tci); |
| 3511 | int skb_vlan_pop(struct sk_buff *skb); | 3511 | int skb_vlan_pop(struct sk_buff *skb); |
| 3512 | int skb_vlan_push(struct sk_buff *skb, __be16 vlan_proto, u16 vlan_tci); | 3512 | int skb_vlan_push(struct sk_buff *skb, __be16 vlan_proto, u16 vlan_tci); |
| 3513 | int skb_mpls_push(struct sk_buff *skb, __be32 mpls_lse, __be16 mpls_proto); | 3513 | int skb_mpls_push(struct sk_buff *skb, __be32 mpls_lse, __be16 mpls_proto, |
| 3514 | int skb_mpls_pop(struct sk_buff *skb, __be16 next_proto); | 3514 | int mac_len); |
| 3515 | int skb_mpls_pop(struct sk_buff *skb, __be16 next_proto, int mac_len); | ||
| 3515 | int skb_mpls_update_lse(struct sk_buff *skb, __be32 mpls_lse); | 3516 | int skb_mpls_update_lse(struct sk_buff *skb, __be32 mpls_lse); |
| 3516 | int skb_mpls_dec_ttl(struct sk_buff *skb); | 3517 | int skb_mpls_dec_ttl(struct sk_buff *skb); |
| 3517 | struct sk_buff *pskb_extract(struct sk_buff *skb, int off, int to_copy, | 3518 | struct sk_buff *pskb_extract(struct sk_buff *skb, int off, int to_copy, |
| @@ -493,6 +493,10 @@ static __always_inline void *kmalloc_large(size_t size, gfp_t flags) · 492 unmodified lines | |||
| 493 | * kmalloc is the normal method of allocating memory | 493 | * kmalloc is the normal method of allocating memory |
| 494 | * for objects smaller than page size in the kernel. | 494 | * for objects smaller than page size in the kernel. |
| 495 | * | 495 | * |
| 496 | * The allocated object address is aligned to at least ARCH_KMALLOC_MINALIGN | ||
| 497 | * bytes. For @size of power of two bytes, the alignment is also guaranteed | ||
| 498 | * to be at least to the size. | ||
| 499 | * | ||
| 496 | * The @flags argument may be one of the GFP flags defined at | 500 | * The @flags argument may be one of the GFP flags defined at |
| 497 | * include/linux/gfp.h and described at | 501 | * include/linux/gfp.h and described at |
| 498 | * :ref:`Documentation/core-api/mm-api.rst <mm-api-gfp-flags>` | 502 | * :ref:`Documentation/core-api/mm-api.rst <mm-api-gfp-flags>` |
| @@ -227,7 +227,26 @@ static inline bool strstarts(const char *str, const char *prefix) · 226 unmodified lines | |||
| 227 | } | 227 | } |
| 228 | 228 | ||
| 229 | size_t memweight(const void *ptr, size_t bytes); | 229 | size_t memweight(const void *ptr, size_t bytes); |
| 230 | void memzero_explicit(void *s, size_t count); | 230 | |
| 231 | /** | ||
| 232 | * memzero_explicit - Fill a region of memory (e.g. sensitive | ||
| 233 | * keying data) with 0s. | ||
| 234 | * @s: Pointer to the start of the area. | ||
| 235 | * @count: The size of the area. | ||
| 236 | * | ||
| 237 | * Note: usually using memset() is just fine (!), but in cases | ||
| 238 | * where clearing out _local_ data at the end of a scope is | ||
| 239 | * necessary, memzero_explicit() should be used instead in | ||
| 240 | * order to prevent the compiler from optimising away zeroing. | ||
| 241 | * | ||
| 242 | * memzero_explicit() doesn't need an arch-specific version as | ||
| 243 | * it just invokes the one of memset() implicitly. | ||
| 244 | */ | ||
| 245 | static inline void memzero_explicit(void *s, size_t count) | ||
| 246 | { | ||
| 247 | memset(s, 0, count); | ||
| 248 | barrier_data(s); | ||
| 249 | } | ||
| 231 | 250 | ||
| 232 | /** | 251 | /** |
| 233 | * kbasename - return the last part of a pathname. | 252 | * kbasename - return the last part of a pathname. |
| @@ -61,6 +61,7 @@ struct sock_xprt { · 60 unmodified lines | |||
| 61 | struct mutex recv_mutex; | 61 | struct mutex recv_mutex; |
| 62 | struct sockaddr_storage srcaddr; | 62 | struct sockaddr_storage srcaddr; |
| 63 | unsigned short srcport; | 63 | unsigned short srcport; |
| 64 | int xprt_err; | ||
| 64 | 65 | ||
| 65 | /* | 66 | /* |
| 66 | * UDP socket buffer size parameters | 67 | * UDP socket buffer size parameters |
| @@ -393,7 +393,7 @@ struct tcp_sock { · 392 unmodified lines | |||
| 393 | /* fastopen_rsk points to request_sock that resulted in this big | 393 | /* fastopen_rsk points to request_sock that resulted in this big |
| 394 | * socket. Used to retransmit SYNACKs etc. | 394 | * socket. Used to retransmit SYNACKs etc. |
| 395 | */ | 395 | */ |
| 396 | struct request_sock *fastopen_rsk; | 396 | struct request_sock __rcu *fastopen_rsk; |
| 397 | u32 *saved_syn; | 397 | u32 *saved_syn; |
| 398 | }; | 398 | }; |
| 399 | 399 | ||
| @@ -447,8 +447,8 @@ static inline struct tcp_timewait_sock *tcp_twsk(const struct sock *sk) · 47 unmodified lines | |||
| 447 | 447 | ||
| 448 | static inline bool tcp_passive_fastopen(const struct sock *sk) | 448 | static inline bool tcp_passive_fastopen(const struct sock *sk) |
| 449 | { | 449 | { |
| 450 | return (sk->sk_state == TCP_SYN_RECV && | 450 | return sk->sk_state == TCP_SYN_RECV && |
| 451 | tcp_sk(sk)->fastopen_rsk != NULL); | 451 | rcu_access_pointer(tcp_sk(sk)->fastopen_rsk) != NULL; |
| 452 | } | 452 | } |
| 453 | 453 | ||
| 454 | static inline void fastopen_queue_tune(struct sock *sk, int backlog) | 454 | static inline void fastopen_queue_tune(struct sock *sk, int backlog) |
| @@ -152,7 +152,7 @@ struct tcg_algorithm_info { · 151 unmodified lines | |||
| 152 | * total. Once we've done this we know the offset of the data length field, | 152 | * total. Once we've done this we know the offset of the data length field, |
| 153 | * and can calculate the total size of the event. | 153 | * and can calculate the total size of the event. |
| 154 | * | 154 | * |
| 155 | * Return: size of the event on success, <0 on failure | 155 | * Return: size of the event on success, 0 on failure |
| 156 | */ | 156 | */ |
| 157 | 157 | ||
| 158 | static inline int __calc_tpm2_event_size(struct tcg_pcr_event2_head *event, | 158 | static inline int __calc_tpm2_event_size(struct tcg_pcr_event2_head *event, |
| @@ -170,6 +170,7 @@ static inline int __calc_tpm2_event_size(struct tcg_pcr_event2_head *event, · 11 unmodified lines | |||
| 170 | u16 halg; | 170 | u16 halg; |
| 171 | int i; | 171 | int i; |
| 172 | int j; | 172 | int j; |
| 173 | u32 count, event_type; | ||
| 173 | 174 | ||
| 174 | marker = event; | 175 | marker = event; |
| 175 | marker_start = marker; | 176 | marker_start = marker; |
| @@ -190,16 +191,22 @@ static inline int __calc_tpm2_event_size(struct tcg_pcr_event2_head *event, · 14 unmodified lines | |||
| 190 | } | 191 | } |
| 191 | 192 | ||
| 192 | event = (struct tcg_pcr_event2_head *)mapping; | 193 | event = (struct tcg_pcr_event2_head *)mapping; |
| 194 | /* | ||
| 195 | * The loop below will unmap these fields if the log is larger than | ||
| 196 | * one page, so save them here for reference: | ||
| 197 | */ | ||
| 198 | count = READ_ONCE(event->count); | ||
| 199 | event_type = READ_ONCE(event->event_type); | ||
| 193 | 200 | ||
| 194 | efispecid = (struct tcg_efi_specid_event_head *)event_header->event; | 201 | efispecid = (struct tcg_efi_specid_event_head *)event_header->event; |
| 195 | 202 | ||
| 196 | /* Check if event is malformed. */ | 203 | /* Check if event is malformed. */ |
| 197 | if (event->count > efispecid->num_algs) { | 204 | if (count > efispecid->num_algs) { |
| 198 | size = 0; | 205 | size = 0; |
| 199 | goto out; | 206 | goto out; |
| 200 | } | 207 | } |
| 201 | 208 | ||
| 202 | for (i = 0; i < event->count; i++) { | 209 | for (i = 0; i < count; i++) { |
| 203 | halg_size = sizeof(event->digests[i].alg_id); | 210 | halg_size = sizeof(event->digests[i].alg_id); |
| 204 | 211 | ||
| 205 | /* Map the digest's algorithm identifier */ | 212 | /* Map the digest's algorithm identifier */ |
| @@ -256,8 +263,9 @@ static inline int __calc_tpm2_event_size(struct tcg_pcr_event2_head *event, · 50 unmodified lines | |||
| 256 | + event_field->event_size; | 263 | + event_field->event_size; |
| 257 | size = marker - marker_start; | 264 | size = marker - marker_start; |
| 258 | 265 | ||
| 259 | if ((event->event_type == 0) && (event_field->event_size == 0)) | 266 | if (event_type == 0 && event_field->event_size == 0) |
| 260 | size = 0; | 267 | size = 0; |
| 268 | |||
| 261 | out: | 269 | out: |
| 262 | if (do_mapping) | 270 | if (do_mapping) |
| 263 | TPM_MEMUNMAP(mapping, mapping_size); | 271 | TPM_MEMUNMAP(mapping, mapping_size); |
| @@ -355,8 +355,10 @@ extern long strnlen_unsafe_user(const void __user *unsafe_addr, long count); · 354 unmodified lines | |||
| 355 | #ifndef user_access_begin | 355 | #ifndef user_access_begin |
| 356 | #define user_access_begin(ptr,len) access_ok(ptr, len) | 356 | #define user_access_begin(ptr,len) access_ok(ptr, len) |
| 357 | #define user_access_end() do { } while (0) | 357 | #define user_access_end() do { } while (0) |
| 358 | #define unsafe_get_user(x, ptr, err) do { if (unlikely(__get_user(x, ptr))) goto err; } while (0) | 358 | #define unsafe_op_wrap(op, err) do { if (unlikely(op)) goto err; } while (0) |
| 359 | #define unsafe_put_user(x, ptr, err) do { if (unlikely(__put_user(x, ptr))) goto err; } while (0) | 359 | #define unsafe_get_user(x,p,e) unsafe_op_wrap(__get_user(x,p),e) |
| 360 | #define unsafe_put_user(x,p,e) unsafe_op_wrap(__put_user(x,p),e) | ||
| 361 | #define unsafe_copy_to_user(d,s,l,e) unsafe_op_wrap(__copy_to_user(d,s,l),e) | ||
| 360 | static inline unsigned long user_access_save(void) { return 0UL; } | 362 | static inline unsigned long user_access_save(void) { return 0UL; } |
| 361 | static inline void user_access_restore(unsigned long flags) { } | 363 | static inline void user_access_restore(unsigned long flags) { } |
| 362 | #endif | 364 | #endif |
| @@ -230,8 +230,8 @@ static inline int xa_err(void *entry) · 229 unmodified lines | |||
| 230 | * This structure is used either directly or via the XA_LIMIT() macro | 230 | * This structure is used either directly or via the XA_LIMIT() macro |
| 231 | * to communicate the range of IDs that are valid for allocation. | 231 | * to communicate the range of IDs that are valid for allocation. |
| 232 | * Two common ranges are predefined for you: | 232 | * Two common ranges are predefined for you: |
| 233 | * * xa_limit_32b - [0 - UINT_MAX] | 233 | * * xa_limit_32b - [0 - UINT_MAX] |
| 234 | * * xa_limit_31b - [0 - INT_MAX] | 234 | * * xa_limit_31b - [0 - INT_MAX] |
| 235 | */ | 235 | */ |
| 236 | struct xa_limit { | 236 | struct xa_limit { |
| 237 | u32 max; | 237 | u32 max; |