{"id":60210,"date":"2024-11-08T22:25:28","date_gmt":"2024-11-08T19:25:28","guid":{"rendered":"https:\/\/packetstormsecurity.com\/files\/182547\/LSN-0107-1.txt"},"modified":"2024-11-08T22:25:28","modified_gmt":"2024-11-08T19:25:28","slug":"kernel-live-patch-security-notice-lsn-0107-1","status":"publish","type":"post","link":"https:\/\/afaghhosting.net\/blog\/kernel-live-patch-security-notice-lsn-0107-1\/","title":{"rendered":"Kernel Live Patch Security Notice LSN-0107-1"},"content":{"rendered":"<p>Linux kernel vulnerabilities<\/p>\n<p>A security issue affects these releases of Ubuntu and its derivatives:<\/p>\n<p>&#8211; Ubuntu 20.04 LTS<br \/>&#8211; Ubuntu 18.04 LTS<br \/>&#8211; Ubuntu 16.04 LTS<br \/>&#8211; Ubuntu 22.04 LTS<br \/>&#8211; Ubuntu 14.04 LTS<\/p>\n<p>Summary<\/p>\n<p>Several security issues were fixed in the kernel.<\/p>\n<p>Software Description<\/p>\n<p>&#8211; linux &#8211; Linux kernel<br \/>&#8211; linux-aws &#8211; Linux kernel for Amazon Web Services (AWS) systems<br \/>&#8211; linux-azure &#8211; Linux kernel for Microsoft Azure Cloud systems<br \/>&#8211; linux-gcp &#8211; Linux kernel for Google Cloud Platform (GCP) systems<br \/>&#8211; linux-gke &#8211; Linux kernel for Google Container Engine (GKE) systems<br \/>&#8211; linux-gkeop &#8211; Linux kernel for Google Container Engine (GKE) systems<br \/>&#8211; linux-ibm &#8211; Linux kernel for IBM cloud systems<br \/>&#8211; linux-oracle &#8211; Linux kernel for Oracle Cloud systems<\/p>\n<p>Details<\/p>\n<p>In the Linux kernel, the following vulnerability has been resolved:<br \/>inet: inet_defrag: prevent sk release while still in use ip_local_out()<br \/>and other functions can pass skb-&gt;sk as function argument. If the skb is<br \/>a fragment and reassembly happens before such function call returns, the<br \/>sk must not be released. This affects skb fragments reassembled via<br \/>netfilter or similar modules, e.g. openvswitch or ct_act.c, when run as<br \/>part of tx pipeline. Eric Dumazet made an initial analysis of this bug.<br \/>Quoting Eric: Calling ip_defrag() in output path is also implying<br \/>skb_orphan(), which is buggy because output path relies on sk not<br \/>disappearing. A relevant old patch about the issue was : 8282f27449bf<br \/>(\u201cinet: frag: Always orphan skbs inside ip_defrag()\u201d) [..<br \/>net\/ipv4\/ip_output.c depends on skb-&gt;sk being set, and probably to an<br \/>inet socket, not an arbitrary one. If we orphan the packet in ipvlan,<br \/>then downstream things like FQ packet scheduler will not work properly.<br \/>We need to change ip_defrag() to only use skb_orphan() when really<br \/>needed, ie whenever frag_list is going to be used. Eric suggested to<br \/>stash sk in fragment queue and made an initial patch. However there is a<br \/>problem with this: If skb is refragmented again right after,<br \/>ip_do_fragment() will copy head-&gt;sk to the new fragments, and sets up<br \/>destructor to sock_wfree. IOW, we have no choice but to fix up sk_wmem<br \/>accouting to reflect the fully reassembled skb, else wmem will<br \/>underflow. This change moves the orphan down into the core, to last<br \/>possible moment. As ip_defrag_offset is aliased with sk_buff-&gt;sk member,<br \/>we must move the offset into the FRAG_CB, else skb-&gt;sk gets clobbered.<br \/>This allows to delay the orphaning long enough to learn if the skb has<br \/>to be queued or if the skb is completing the reasm queue. In the former<br \/>case, things work as before, skb is orphaned. This is safe because skb<br \/>gets queued\/stolen and won\u2019t continue past reasm engine. In the latter<br \/>case, we will steal the skb-&gt;sk reference, reattach it to the head skb,<br \/>and fix up wmem accouting when inet_frag inflates truesize.<br \/>(CVE-2024-26921)<\/p>\n<p>In the Linux kernel, the following vulnerability has been resolved:<br \/>af_unix: Fix garbage collector racing against connect() Garbage<br \/>collector does not take into account the risk of embryo getting enqueued<br \/>during the garbage collection. If such embryo has a peer that carries<br \/>SCM_RIGHTS, two consecutive passes of scan_children() may see a<br \/>different set of children. Leading to an incorrectly elevated inflight<br \/>count, and then a dangling pointer within the gc_inflight_list. sockets<br \/>are AF_UNIX\/SOCK_STREAM S is an unconnected socket L is a listening<br \/>in-flight socket bound to addr, not in fdtable V\u2019s fd will be passed via<br \/>sendmsg(), gets inflight count bumped connect(S, addr) sendmsg(S, [V]);<br \/>close(V) __unix_gc() \u2014\u2014\u2014\u2014\u2014- \u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014- \u2014\u2014\u2014\u2013 NS = unix_create1() skb1 =<br \/>sock_wmalloc(NS) L = unix_find_other(addr) unix_state_lock(L)<br \/>unix_peer(S) = NS \/\/ V count=1 inflight=0 NS = unix_peer(S) skb2 =<br \/>sock_alloc() skb_queue_tail(NS, skb2[V]) \/\/ V became in-flight \/\/ V<br \/>count=2 inflight=1 close(V) \/\/ V count=1 inflight=1 \/\/ GC candidate<br \/>condition met for u in gc_inflight_list: if (total_refs ==<br \/>inflight_refs) add u to gc_candidates \/\/ gc_candidates={L, V} for u in<br \/>gc_candidates: scan_children(u, dec_inflight) \/\/ embryo (skb1) was not<br \/>\/\/ reachable from L yet, so V\u2019s \/\/ inflight remains unchanged<br \/>__skb_queue_tail(L, skb1) unix_state_unlock(L) for u in gc_candidates:<br \/>if (u.inflight) scan_children(u, inc_inflight_move_tail) \/\/ V count=1<br \/>inflight=2 (!) If there is a GC-candidate listening socket, lock\/unlock<br \/>its state. This makes GC wait until the end of any ongoing connect() to<br \/>that socket. After flipping the lock, a possibly SCM-laden embryo is<br \/>already enqueued. And if there is another embryo coming, it can not<br \/>possibly carry SCM_RIGHTS. At this point, unix_inflight() can not happen<br \/>because unix_gc_lock is already taken. Inflight graph remains<br \/>unaffected. (CVE-2024-26923)<\/p>\n<p>In the Linux kernel, the following vulnerability has been resolved: mm:<br \/>swap: fix race between free_swap_and_cache() and swapoff() There was<br \/>previously a theoretical window where swapoff() could run and teardown a<br \/>swap_info_struct while a call to free_swap_and_cache() was running in<br \/>another thread. This could cause, amongst other bad possibilities,<br \/>swap_page_trans_huge_swapped() (called by free_swap_and_cache()) to<br \/>access the freed memory for swap_map. This is a theoretical problem and<br \/>I haven\u2019t been able to provoke it from a test case. But there has been<br \/>agreement based on code review that this is possible (see link below).<br \/>Fix it by using get_swap_device()\/put_swap_device(), which will stall<br \/>swapoff(). There was an extra check in _swap_info_get() to confirm that<br \/>the swap entry was not free. This isn\u2019t present in get_swap_device()<br \/>because it doesn\u2019t make sense in general due to the race between getting<br \/>the reference and swapoff. So I\u2019ve added an equivalent check directly in<br \/>free_swap_and_cache(). Details of how to provoke one possible issue<br \/>(thanks to David Hildenbrand for deriving this): \u20138&lt;\u2014\u2013<br \/>__swap_entry_free() might be the last user and result in \u201ccount ==<br \/>SWAP_HAS_CACHE\u201d. swapoff-&gt;try_to_unuse() will stop as soon as soon as<br \/>si-&gt;inuse_pages==0. So the question is: could someone reclaim the folio<br \/>and turn si-&gt;inuse_pages==0, before we completed<br \/>swap_page_trans_huge_swapped(). Imagine the following: 2 MiB folio in<br \/>the swapcache. Only 2 subpages are still references by swap entries.<br \/>Process 1 still references subpage 0 via swap entry. Process 2 still<br \/>references subpage 1 via swap entry. Process 1 quits. Calls<br \/>free_swap_and_cache(). -&gt; count == SWAP_HAS_CACHE [then, preempted in<br \/>the hypervisor etc.] Process 2 quits. Calls free_swap_and_cache(). -&gt;<br \/>count == SWAP_HAS_CACHE Process 2 goes ahead, passes<br \/>swap_page_trans_huge_swapped(), and calls __try_to_reclaim_swap().<br \/>__try_to_reclaim_swap()-&gt;folio_free_swap()-&gt;delete_from_swap_cache()-&gt;<br \/>put_swap_folio()-&gt;free_swap_slot()-&gt;swapcache_free_entries()-&gt;<br \/>swap_entry_free()-&gt;swap_range_free()-&gt; \u2026 WRITE_ONCE(si-&gt;inuse_pages,<br \/>si-&gt;inuse_pages &#8211; nr_entries); What stops swapoff to succeed after<br \/>process 2 reclaimed the swap cache but before process1 finished its call<br \/>to swap_page_trans_huge_swapped()? \u20138&lt;\u2014\u2013 (CVE-2024-26960)<\/p>\n<p>In the Linux kernel, the following vulnerability has been resolved:<br \/>Bluetooth: Fix use-after-free bugs caused by sco_sock_timeout When the<br \/>sco connection is established and then, the sco socket is releasing,<br \/>timeout_work will be scheduled to judge whether the sco disconnection is<br \/>timeout. The sock will be deallocated later, but it is dereferenced<br \/>again in sco_sock_timeout. As a result, the use-after-free bugs will<br \/>happen. The root cause is shown below: Cleanup Thread | Worker Thread<br \/>sco_sock_release | sco_sock_close | __sco_sock_close |<br \/>sco_sock_set_timer | schedule_delayed_work | sco_sock_kill | (wait a<br \/>time) sock_put(sk) \/\/FREE | sco_sock_timeout | sock_hold(sk) \/\/USE The<br \/>KASAN report triggered by POC is shown below: [ 95.890016<br \/>================================================================== [<br \/>95.890496] BUG: KASAN: slab-use-after-free in<br \/>sco_sock_timeout+0x5e\/0x1c0 [ 95.890755] Write of size 4 at addr<br \/>ffff88800c388080 by task kworker\/0:0\/7 \u2026 [ 95.890755] Workqueue: events<br \/>sco_sock_timeout [ 95.890755] Call Trace: [ 95.890755][ 95.890755] dump_stack_lvl+0x45\/0x110 [ 95.890755]print_address_description+0x78\/0x390 [ 95.890755<br \/>print_report+0x11b\/0x250 [ 95.890755] ? __virt_addr_valid+0xbe\/0xf0 [<br \/>95.890755] ? sco_sock_timeout+0x5e\/0x1c0 [ 95.890755<br \/>kasan_report+0x139\/0x170 [ 95.890755] ? update_load_avg+0xe5\/0x9f0 [<br \/>95.890755] ? sco_sock_timeout+0x5e\/0x1c0 [ 95.890755<br \/>kasan_check_range+0x2c3\/0x2e0 [ 95.890755] sco_sock_timeout+0x5e\/0x1c0 [<br \/>95.890755] process_one_work+0x561\/0xc50 [ 95.890755<br \/>worker_thread+0xab2\/0x13c0 [ 95.890755] ? pr_cont_work+0x490\/0x490 [<br \/>95.890755] kthread+0x279\/0x300 [ 95.890755] ? pr_cont_work+0x490\/0x490 [<br \/>95.890755] ? kthread_blkcg+0xa0\/0xa0 [ 95.890755]ret_from_fork+0x34\/0x60 [ 95.890755] ? kthread_blkcg+0xa0\/0xa0 [<br \/>95.890755 ret_from_fork_asm+0x11\/0x20 [ 95.890755][ 95.890755] [ 95.890755 Allocated by task 506: [ 95.890755]kasan_save_track+0x3f\/0x70 [ 95.890755 __kasan_kmalloc+0x86\/0x90 [<br \/>95.890755] __kmalloc+0x17f\/0x360 [ 95.890755 sk_prot_alloc+0xe1\/0x1a0 [<br \/>95.890755] sk_alloc+0x31\/0x4e0 [ 95.890755 bt_sock_alloc+0x2b\/0x2a0 [<br \/>95.890755] sco_sock_create+0xad\/0x320 [ 95.890755]bt_sock_create+0x145\/0x320 [ 95.890755 __sock_create+0x2e1\/0x650 [<br \/>95.890755] __sys_socket+0xd0\/0x280 [ 95.890755<br \/>__x64_sys_socket+0x75\/0x80 [ 95.890755] do_syscall_64+0xc4\/0x1b0 [<br \/>95.890755] entry_SYSCALL_64_after_hwframe+0x67\/0x6f [ 95.890755] [<br \/>95.890755] Freed by task 506: [ 95.890755] kasan_save_track+0x3f\/0x70 [<br \/>95.890755] kasan_save_free_info+0x40\/0x50 [ 95.890755<br \/>poison_slab_object+0x118\/0x180 [ 95.890755] __kasan_slab_free+0x12\/0x30<br \/>[ 95.890755] kfree+0xb2\/0x240 [ 95.890755] __sk_destruct+0x317\/0x410 [<br \/>95.890755] sco_sock_release+0x232\/0x280 [ 95.890755]sock_close+0xb2\/0x210 [ 95.890755] __fput+0x37f\/0x770 [ 95.890755]task_work_run+0x1ae\/0x210 [ 95.890755] get_signal+0xe17\/0xf70 [<br \/>95.890755 arch_do_signal_or_restart+0x3f\/0x520 [ 95.890755<br \/>syscall_exit_to_user_mode+0x55\/0x120 [ 95.890755]do_syscall_64+0xd1\/0x1b0 [ 95.890755]entry_SYSCALL_64_after_hwframe+0x67\/0x6f [ 95.890755] [ 95.890755] The<br \/>buggy address belongs to the object at ffff88800c388000 [ 95.890755]which belongs to the cache kmalloc-1k of size 1024 [ 95.890755 The buggy<br \/>address is located 128 bytes inside of [ 95.890755] freed 1024-byte<br \/>region [ffff88800c388000, ffff88800c388400) [ 95.890755] [ 95.890755]The buggy address belongs to the physical page: [ 95.890755 page:<br \/>refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff88800c38a800<br \/>pfn:0xc388 [ 95.890755] head: order:3 entire_mapcount:0<br \/>nr_pages_mapped:0 pincount:0 [ 95.890755] ano \u2014truncated\u2014<br \/>(CVE-2024-27398)<\/p>\n<p>In the Linux kernel, the following vulnerability has been resolved:<br \/>watchdog: cpu5wdt.c: Fix use-after-free bug caused by cpu5wdt_trigger<br \/>When the cpu5wdt module is removing, the origin code uses del_timer() to<br \/>de-activate the timer. If the timer handler is running, del_timer()<br \/>could not stop it and will return directly. If the port region is<br \/>released by release_region() and then the timer handler<br \/>cpu5wdt_trigger() calls outb() to write into the region that is<br \/>released, the use-after-free bug will happen. Change del_timer() to<br \/>timer_shutdown_sync() in order that the timer handler could be finished<br \/>before the port region is released. (CVE-2024-38630)<\/p>\n<p>Update instructions<\/p>\n<p>The problem can be corrected by updating your kernel livepatch to the<br \/>following versions:<\/p>\n<p>Ubuntu 20.04 LTS<br \/>aws &#8211; 107.1<br \/>aws &#8211; 107.2<br \/>azure &#8211; 107.1<br \/>azure &#8211; 107.2<br \/>gcp &#8211; 107.1<br \/>gcp &#8211; 107.2<br \/>generic &#8211; 107.1<br \/>generic &#8211; 107.2<br \/>gke &#8211; 107.1<br \/>gkeop &#8211; 107.1<br \/>gkeop &#8211; 107.2<br \/>ibm &#8211; 107.1<br \/>ibm &#8211; 107.2<br \/>lowlatency &#8211; 107.1<br \/>lowlatency &#8211; 107.2<br \/>oracle &#8211; 107.1<br \/>oracle &#8211; 107.2<\/p>\n<p>Ubuntu 18.04 LTS<br \/>aws &#8211; 107.1<br \/>aws &#8211; 107.2<br \/>azure &#8211; 107.1<br \/>azure &#8211; 107.2<br \/>gcp &#8211; 107.1<br \/>gcp &#8211; 107.2<br \/>generic &#8211; 107.1<br \/>generic &#8211; 107.2<br \/>lowlatency &#8211; 107.1<br \/>lowlatency &#8211; 107.2<br \/>oracle &#8211; 107.1<br \/>oracle &#8211; 107.2<\/p>\n<p>Ubuntu 16.04 LTS<br \/>aws &#8211; 107.1<br \/>aws &#8211; 107.2<br \/>azure &#8211; 107.1<br \/>azure &#8211; 107.2<br \/>gcp &#8211; 107.1<br \/>gcp &#8211; 107.2<br \/>generic &#8211; 107.1<br \/>generic &#8211; 107.2<br \/>lowlatency &#8211; 107.1<br \/>lowlatency &#8211; 107.2<\/p>\n<p>Ubuntu 22.04 LTS<br \/>aws &#8211; 107.1<br \/>aws &#8211; 107.2<br \/>azure &#8211; 107.1<br \/>azure &#8211; 107.2<br \/>gcp &#8211; 107.1<br \/>gcp &#8211; 107.2<br \/>generic &#8211; 107.1<br \/>generic &#8211; 107.2<br \/>gke &#8211; 107.1<br \/>gke &#8211; 107.2<br \/>ibm &#8211; 107.1<br \/>ibm &#8211; 107.2<br \/>oracle &#8211; 107.1<\/p>\n<p>Ubuntu 14.04 LTS<br \/>generic &#8211; 107.1<br \/>lowlatency &#8211; 107.1<\/p>\n<p>Support Information<\/p>\n<p>Livepatches for supported LTS kernels will receive upgrades for a period<br \/>of up to 13 months after the build date of the kernel.<\/p>\n<p>Livepatches for supported HWE kernels which are not based on an LTS<br \/>kernel version will receive upgrades for a period of up to 9 months<br \/>after the build date of the kernel, or until the end of support for that<br \/>kernel\u2019s non-LTS distro release version, whichever is sooner.<\/p>\n<p>References<\/p>\n<p>&#8211; CVE-2024-26921<br \/>&#8211; CVE-2024-26923<br \/>&#8211; CVE-2024-26960<br \/>&#8211; CVE-2024-27398<br \/>&#8211; CVE-2024-38630<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Linux kernel vulnerabilities A security issue affects these releases of Ubuntu and its derivatives: &#8211; Ubuntu 20.04 LTS&#8211; Ubuntu 18.04 LTS&#8211; Ubuntu 16.04 LTS&#8211; Ubuntu 22.04 LTS&#8211; Ubuntu 14.04 LTS Summary Several security issues were fixed in the kernel. Software Description &#8211; linux &#8211; Linux kernel&#8211; linux-aws &#8211; Linux kernel for Amazon Web Services (AWS) &hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[26],"tags":[],"class_list":["post-60210","post","type-post","status-publish","format-standard","hentry","category-vulnerability"],"_links":{"self":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts\/60210","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/comments?post=60210"}],"version-history":[{"count":0,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts\/60210\/revisions"}],"wp:attachment":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/media?parent=60210"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/categories?post=60210"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/tags?post=60210"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}