btrfs: do not free data reservation in fallback from inline due to -ENOSPC
In the Linux kernel, the following vulnerability has been resolved:
dmaengine: stm32: dmamux: fix device leak on route allocation
Make sure to drop the reference taken when looking up the DMA mux platform device during route allocation.
Note that holding a reference to a device does not prevent its driver data from going away so there is no point in keeping the reference.
In the Linux kernel, the following vulnerability has been resolved:
mptcp: fallback earlier on simult connection
Syzkaller reports a simult-connect race leading to inconsistent fallback status:
WARNING: CPU: 3 PID: 33 at net/mptcp/subflow.c:1515 subflowdataready+0x40b/0x7c0 net/mptcp/subflow.c:1515 Modules linked in: CPU: 3 UID: 0 PID: 33 Comm: ksoftirqd/3 Not tainted syzkaller #0 PREEMPT(full) Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2~bpo12+1 04/01/2014 RIP: 0010:subflowdataready+0x40b/0x7c0 net/mptcp/subflow.c:1515 Code: 89 ee e8 78 61 3c f6 40 84 ed 75 21 e8 8e 66 3c f6 44 89 fe bf 07 00 00 00 e8 c1 61 3c f6 41 83 ff 07 74 09 e8 76 66 3c f6 90 <0f> 0b 90 e8 6d 66 3c f6 48 89 df e8 e5 ad ff ff 31 ff 89 c5 89 c6 RSP: 0018:ffffc900006cf338 EFLAGS: 00010246 RAX: 0000000000000000 RBX: ffff888031acd100 RCX: ffffffff8b7f2abf RDX: ffff88801e6ea440 RSI: ffffffff8b7f2aca RDI: 0000000000000005 RBP: 0000000000000000 R08: 0000000000000005 R09: 0000000000000007 R10: 0000000000000004 R11: 0000000000002c10 R12: ffff88802ba69900 R13: 1ffff920000d9e67 R14: ffff888046f81800 R15: 0000000000000004 FS: 0000000000000000(0000) GS:ffff8880d69bc000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000560fc0ca1670 CR3: 0000000032c3a000 CR4: 0000000000352ef0 Call Trace: <TASK> tcpdataqueue+0x13b0/0x4f90 net/ipv4/tcpinput.c:5197 tcprcvstateprocess+0xfdf/0x4ec0 net/ipv4/tcpinput.c:6922 tcpv6dorcv+0x492/0x1740 net/ipv6/tcpipv6.c:1672 tcpv6rcv+0x2976/0x41e0 net/ipv6/tcpipv6.c:1918 ip6protocoldeliverrcu+0x188/0x1520 net/ipv6/ip6input.c:438 ip6inputfinish+0x1e4/0x4b0 net/ipv6/ip6input.c:489 NFHOOK include/linux/netfilter.h:318 [inline] NFHOOK include/linux/netfilter.h:312 [inline] ip6input+0x105/0x2f0 net/ipv6/ip6input.c:500 dstinput include/net/dst.h:471 [inline] ip6rcvfinish net/ipv6/ip6input.c:79 [inline] NFHOOK include/linux/netfilter.h:318 [inline] NFHOOK include/linux/netfilter.h:312 [inline] ipv6rcv+0x264/0x650 net/ipv6/ip6input.c:311 netifreceiveskbonecore+0x12d/0x1e0 net/core/dev.c:5979 netifreceiveskb+0x1d/0x160 net/core/dev.c:6092 processbacklog+0x442/0x15e0 net/core/dev.c:6444 napipoll.constprop.0+0xba/0x550 net/core/dev.c:7494 napipoll net/core/dev.c:7557 [inline] netrxaction+0xa9f/0xfe0 net/core/dev.c:7684 handlesoftirqs+0x216/0x8e0 kernel/softirq.c:579 runksoftirqd kernel/softirq.c:968 [inline] runksoftirqd+0x3a/0x60 kernel/softirq.c:960 smpbootthreadfn+0x3f7/0xae0 kernel/smpboot.c:160 kthread+0x3c2/0x780 kernel/kthread.c:463 retfromfork+0x5d7/0x6f0 arch/x86/kernel/process.c:148 retfromforkasm+0x1a/0x30 arch/x86/entry/entry64.S:245 </TASK>
The TCP subflow can process the simult-connect syn-ack packet after transitioning to TCPFIN1 state, bypassing the MPTCP fallback check, as the skstatechange() callback is not invoked for -> FINWAIT1 transitions.
That will move the msk socket to an inconsistent status and the next incoming data will hit the reported splat.
Close the race moving the simult-fallback check at the earliest possible stage - that is at syn-ack generation time.
About the fixes tags: [2] was supposed to also fix this issue introduced by [3]. [1] is required as a dependence: it was not explicitly marked as a fix, but it is one and it has already been backported before [3]. In other words, this commit should be backported up to [3], including [2] and [1] if that's not already there.
In the Linux kernel, the following vulnerability has been resolved:
drm/xe/oa: Fix potential UAF in xeoaaddconfigioctl()
In xeoaaddconfigioctl(), we accessed oaconfig->id after dropping metricslock. Since this lock protects the lifetime of oaconfig, an attacker could guess the id and call xeoaremoveconfigioctl() with perfect timing, freeing oaconfig before we dereference it, leading to a potential use-after-free.
Fix this by caching the id in a local variable while holding the lock.
v2: (Matt A) - Dropped mutexunlock(&oa->metricslock) ordering change from xeoaremoveconfigioctl()
(cherry picked from commit 28aeaed130e8e587fd1b73b6d66ca41ccc5a1a31)
In the Linux kernel, the following vulnerability has been resolved:
irqchip/mchp-eic: Fix error code in mchpeicdomainalloc()
If irqdomaintranslatetwocell() sets "hwirq" to >= MCHPEICNIRQ (2) then it results in an out of bounds access.
The code checks for invalid values, but doesn't set the error code. Return -EINVAL in that case, instead of returning success.
In the Linux kernel, the following vulnerability has been resolved:
ftrace: Fix softlockup in ftracemoduleenable
A soft lockup was observed when loading amdgpu module. If a module has a lot of tracable functions, multiple calls to kallsymslookup can spend too much time in RCU critical section and with disabled preemption, causing kernel panic. This is the same issue that was fixed in commit d0b24b4e91fc ("ftrace: Prevent RCU stall on PREEMPTVOLUNTARY kernels") and commit 42ea22e754ba ("ftrace: Add condresched() to ftracegraphsethash()").
Fix it the same way by adding condresched() in ftracemoduleenable.
In the Linux kernel, the following vulnerability has been resolved:
refscale: Fix uninitalized use of waitqueueheadt
Running the refscale test occasionally crashes the kernel with the following error:
[ 8569.952896] BUG: unable to handle page fault for address: ffffffffffffffe8 [ 8569.952900] #PF: supervisor read access in kernel mode [ 8569.952902] #PF: errorcode(0x0000) - not-present page [ 8569.952904] PGD c4b048067 P4D c4b049067 PUD c4b04b067 PMD 0 [ 8569.952910] Oops: 0000 [#1] PREEMPTRT SMP NOPTI [ 8569.952916] Hardware name: Dell Inc. PowerEdge R750/0WMWCR, BIOS 1.2.4 05/28/2021 [ 8569.952917] RIP: 0010:preparetowaitevent+0x101/0x190 : [ 8569.952940] Call Trace: [ 8569.952941] <TASK> [ 8569.952944] refscalereader+0x380/0x4a0 [refscale] [ 8569.952959] kthread+0x10e/0x130 [ 8569.952966] retfromfork+0x1f/0x30 [ 8569.952973] </TASK>
The likely cause is that initwaitqueuehead() is called after the call to the torturecreatekthread() function that creates the refscalereader kthread. Although this initwaitqueuehead() call will very likely complete before this kthread is created and starts running, it is possible that the calling kthread will be delayed between the calls to torturecreatekthread() and initwaitqueuehead(). In this case, the new kthread will use the waitqueue head before it is properly initialized, which is not good for the kernel's health and well-being.
The above crash happened here:
static inline void addwaitqueue(...) { : if (!(wq->flags & WQFLAGPRIORITY)) <=== Crash here
The offset of flags from listhead entry in waitqueueentry is -0x18. If readertasks[i].wq.head.next is NULL as allocated readertask structure is zero initialized, the instruction will try to access address 0xffffffffffffffe8, which is exactly the fault address listed above.
This commit therefore invokes initwaitqueuehead() before creating the kthread.
In the Linux kernel, the following vulnerability has been resolved:
drm/amd/display: fix mapping to non-allocated address
[Why] There is an issue mapping non-allocated location of memory. It would allocate gpio registers from an array out of bounds.
[How] Patch correct numbers of bounds for using.
In the Linux kernel, the following vulnerability has been resolved:
of: unittest: fix null pointer dereferencing in ofunittestfindnodebyname()
when kmalloc() fail to allocate memory in kasprintf(), name or fullname will be NULL, strcmp() will cause null pointer dereference.
In the Linux kernel, the following vulnerability has been resolved:
tracing: Fix memory leak of iter->temp when reading tracepipe
kmemleak reports: unreferenced object 0xffff88814d14e200 (size 256): comm "cat", pid 336, jiffies 4294871818 (age 779.490s) hex dump (first 32 bytes): 04 00 01 03 00 00 00 00 08 00 00 00 00 00 00 00 ................ 0c d8 c8 9b ff ff ff ff 04 5a ca 9b ff ff ff ff .........Z...... backtrace: [<ffffffff9bdff18f>] kmalloc+0x4f/0x140 [<ffffffff9bc9238b>] tracefindnextentry+0xbb/0x1d0 [<ffffffff9bc9caef>] traceprintlatcontext+0xaf/0x4e0 [<ffffffff9bc94490>] printtraceline+0x3e0/0x950 [<ffffffff9bc95499>] tracingreadpipe+0x2d9/0x5a0 [<ffffffff9bf03a43>] vfsread+0x143/0x520 [<ffffffff9bf04c2d>] ksysread+0xbd/0x160 [<ffffffff9d0f0edf>] dosyscall64+0x3f/0x90 [<ffffffff9d2000aa>] entrySYSCALL64afterhwframe+0x6e/0xd8
when reading file 'tracepipe', 'iter->temp' is allocated or relocated in tracefindnextentry() but not freed before 'tracepipe' is closed.
To fix it, free 'iter->temp' in tracingreleasepipe().
In the Linux kernel, the following vulnerability has been resolved:
regulator: raa215300: Fix resource leak in case of error
The clkregisterclkdev() allocates memory by calling vclkdevalloc() and this memory is not freed in the error path. Similarly, resources allocated by clkregisterfixedrate() are not freed in the error path.
Fix these issues by using devmclkhwregisterfixedrate() and devmclkhwregisterclkdev().
After this, the static variable clk is not needed. Replace it with local variable hw in probe() and drop calling clkunregisterfixedrate() from raa215300rtcunregisterdevice().
In the Linux kernel, the following vulnerability has been resolved:
dm: fix a race condition in retrievedeps
There's a race condition in the multipath target when retrievedeps races with multipathmessage calling dmgetdevice and dmputdevice. retrievedeps walks the list of open devices without holding any lock but multipath may add or remove devices to the list while it is running. The end result may be memory corruption or use-after-free memory access.
See this description of a UAF with multipathmessage(): https://listman.redhat.com/archives/dm-devel/2022-October/052373.html
Fix this bug by introducing a new rw semaphore "deviceslock". We grab deviceslock for read in retrievedeps and we grab it for write in dmgetdevice and dmputdevice.
In the Linux kernel, the following vulnerability has been resolved:
platform/x86: toshibahaps: Fix memory leaks in add/remove routines
toshibahapsadd() leaks the haps object allocated by it if it returns an error after allocating that object successfully.
toshibahapsremove() does not free the object pointed to by toshibahaps before clearing that pointer, so it becomes unreachable allocated memory.
Address these memory leaks by using devmkzalloc() for allocating the memory in question.
In the Linux kernel, the following vulnerability has been resolved:
nullblk: fix kmemleak by releasing references to fault configfs items
When CONFIGBLKDEVNULLBLKFAULTINJECTION is enabled, the null-blk driver sets up fault injection support by creating the timeoutinject, requeueinject, and inithctxfaultinject configfs items as children of the top-level nullbX configfs group.
However, when the nullbX device is removed, the references taken to these fault-config configfs items are not released. As a result, kmemleak reports a memory leak, for example:
unreferenced object 0xc00000021ff25c40 (size 32): comm "mkdir", pid 10665, jiffies 4322121578 hex dump (first 32 bytes): 69 6e 69 74 5f 68 63 74 78 5f 66 61 75 6c 74 5f inithctxfault 69 6e 6a 65 63 74 00 88 00 00 00 00 00 00 00 00 inject.......... backtrace (crc 1a018c86): kmallocnodetrackcallernoprof+0x494/0xbd8 kvasprintf+0x74/0xf4 configitemsetname+0xf0/0x104 configgroupinittypename+0x48/0xfc faultconfiginit+0x48/0xf0 0xc0080000180559e4 configfsmkdir+0x304/0x814 vfsmkdir+0x49c/0x604 domkdirat+0x314/0x3d0 sysmkdir+0xa0/0xd8 systemcallexception+0x1b0/0x4f0 systemcallvectoredcommon+0x15c/0x2ec
Fix this by explicitly releasing the references to the fault-config configfs items when dropping the reference to the top-level nullbX configfs group.
In the Linux kernel, the following vulnerability has been resolved:
timers: Fix NULL function pointer race in timershutdownsync()
There is a race condition between timershutdownsync() and timer expiration that can lead to hitting a WARNON in expiretimers().
The issue occurs when timershutdownsync() clears the timer function to NULL while the timer is still running on another CPU. The race scenario looks like this:
CPU0 CPU1 <SOFTIRQ> locktimerbase() expiretimers() base->runningtimer = timer; unlocktimerbase() [calltimerfn enter] modtimer() ... timershutdownsync() locktimerbase() // For now, will not detach the timer but only clear its function to NULL if (base->runningtimer != timer) ret = detachifpending(timer, base, true); if (shutdown) timer->function = NULL; unlocktimerbase() [calltimerfn exit] locktimerbase() base->runningtimer = NULL; unlocktimerbase() ... // Now timer is pending while its function set to NULL. // next timer trigger <SOFTIRQ> expiretimers() WARNONONCE(!fn) // hit ... locktimerbase() // Now timer will detach if (base->runningtimer != timer) ret = detachifpending(timer, base, true); if (shutdown) timer->function = NULL; unlocktimerbase()
The problem is that timershutdownsync() clears the timer function regardless of whether the timer is currently running. This can leave a pending timer with a NULL function pointer, which triggers the WARNONONCE(!fn) check in expiretimers().
Fix this by only clearing the timer function when actually detaching the timer. If the timer is running, leave the function pointer intact, which is safe because the timer will be properly detached when it finishes running.
In the Linux kernel, the following vulnerability has been resolved:
ASoC: codecs: wcd-mbhc-v2: fix resource leaks on component remove
The MBHC resources must be released on component probe failure and removal so can not be tied to the lifetime of the component device.
This is specifically needed to allow probe deferrals of the sound card which otherwise fails when reprobing the codec component:
snd-sc8280xp sound: ASoC: failed to instantiate card -517 genirq: Flags mismatch irq 299. 00002001 (mbhc sw intr) vs. 00002001 (mbhc sw intr) wcd938xcodec audio-codec: Failed to request mbhc interrupts -16 wcd938xcodec audio-codec: mbhc initialization failed wcd938xcodec audio-codec: ASoC: error at sndsoccomponentprobe on audio-codec: -16 snd-sc8280xp sound: ASoC: failed to instantiate card -16
In the Linux kernel, the following vulnerability has been resolved:
hwrng: virtio - Fix race on dataavail and actual data
The virtio rng device kicks off a new entropy request whenever the data available reaches zero. When a new request occurs at the end of a read operation, that is, when the result of that request is only needed by the next reader, then there is a race between the writing of the new data and the next reader.
This is because there is no synchronisation whatsoever between the writer and the reader.
Fix this by writing dataavail with smpstorerelease and reading it with smploadacquire when we first enter read. The subsequent reads are safe because they're either protected by the first load acquire, or by the completion mechanism.
Also remove the redundant zeroing of dataidx in randomrecvdone (dataidx must already be zero at this point) and dataavail in requestentropy (ditto).
In the Linux kernel, the following vulnerability has been resolved:
clk: st: Fix memory leak in stofquadfssetup()
If stclkregisterquadfspll() fails, @lock should be freed before goto @errexit, otherwise will cause meory leak issue, fix it.
In the Linux kernel, the following vulnerability has been resolved:
mmc: mxcmmc: fix return value check of mmcaddhost()
mmcaddhost() may return error, if we ignore its return value, the memory that allocated in mmcallochost() will be leaked and it will lead a kernel crash because of deleting not added device in the remove path.
So fix this by checking the return value and goto error path which will call mmcfreehost().
In the Linux kernel, the following vulnerability has been resolved:
mailbox: zynq-ipi: fix error handling while deviceregister() fails
If deviceregister() fails, it has two issues: 1. The name allocated by devsetname() is leaked. 2. The parent of device is not NULL, deviceunregister() is called in zynqmpipifreemboxes(), it will lead a kernel crash because of removing not added device.
Call putdevice() to give up the reference, so the name is freed in kobjectcleanup(). Add device registered check in zynqmpipifreemboxes() to avoid null-ptr-deref.
In the Linux kernel, the following vulnerability has been resolved:
ipc: mqueue: fix possible memory leak in initmqueuefs()
commit db7cfc380900 ("ipc: Free mqsysctls if ipc namespace creation failed")
Here's a similar memory leak to the one fixed by the patch above. retiremqsysctls need to be called when initmqueuefs fails after setupmqsysctls.
In the Linux kernel, the following vulnerability has been resolved:
btrfs: call btrfsremovefreespacecachelocked on cache load failure
Now that lockdep is staying enabled through our entire CI runs I started seeing the following stack in generic/475
------------[ cut here ]------------ WARNING: CPU: 1 PID: 2171864 at fs/btrfs/discard.c:604 btrfsdiscardupdatediscardable+0x98/0xb0 CPU: 1 PID: 2171864 Comm: kworker/u4:0 Not tainted 5.19.0-rc8+ #789 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.13.0-2.fc32 04/01/2014 Workqueue: btrfs-cache btrfsworkhelper RIP: 0010:btrfsdiscardupdatediscardable+0x98/0xb0 RSP: 0018:ffffb857c2f7bad0 EFLAGS: 00010246 RAX: 0000000000000000 RBX: ffff8c85c605c200 RCX: 0000000000000001 RDX: 0000000000000000 RSI: ffffffff86807c5b RDI: ffffffff868a831e RBP: ffff8c85c4c54000 R08: 0000000000000000 R09: 0000000000000000 R10: ffff8c85c66932f0 R11: 0000000000000001 R12: ffff8c85c3899010 R13: ffff8c85d5be4f40 R14: ffff8c85c4c54000 R15: ffff8c86114bfa80 FS: 0000000000000000(0000) GS:ffff8c863bd00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007f2e7f168160 CR3: 000000010289a004 CR4: 0000000000370ee0 Call Trace:
btrfsremovefreespacecache+0x27/0x30 loadfreespacecache+0xad2/0xaf0 cachingthread+0x40b/0x650 ? lockrelease+0x137/0x2d0 btrfsworkhelper+0xf2/0x3e0 ? lockisheldtype+0xe2/0x140 processonework+0x271/0x590 ? processonework+0x590/0x590 workerthread+0x52/0x3b0 ? processonework+0x590/0x590 kthread+0xf0/0x120 ? kthreadcompleteandexit+0x20/0x20 retfromfork+0x1f/0x30
This is the code
ctl = blockgroup->freespacectl; discardctl = &blockgroup->fsinfo->discardctl;
lockdepassertheld(&ctl->treelock);
We have a temporary free space ctl for loading the free space cache in order to avoid having allocations happening while we're loading the cache. When we hit an error we free it all up, however this also calls btrfsdiscardupdatediscardable, which requires blockgroup->freespacectl->treelock to be held. However this is our temporary ctl so this lock isn't held. Fix this by calling btrfsremovefreespacecachelocked instead so that we only clean up the entries and do not mess with the discardable stats.
In the Linux kernel, the following vulnerability has been resolved:
iommu/sprd: Release dma buffer to avoid memory leak
When attaching to a domain, the driver would alloc a DMA buffer which is used to store address mapping table, and it need to be released when the IOMMU domain is freed.
In the Linux kernel, the following vulnerability has been resolved:
misc: ocxl: fix possible name leak in ocxlfileregisterafu()
If deviceregister() returns error in ocxlfileregisterafu(), the name allocated by devsetname() need be freed. As comment of deviceregister() says, it should use putdevice() to give up the reference in the error path. So fix this by calling putdevice(), then the name can be freed in kobjectcleanup(), and info is freed in inforelease().
In the Linux kernel, the following vulnerability has been resolved:
pstore: Avoid kcore oops by vmap()ing with VMIOREMAP
An oops can be induced by running 'cat /proc/kcore > /dev/null' on devices using pstore with the ram backend because kmapatomic() assumes lowmem pages are accessible with va().
Unable to handle kernel paging request at virtual address ffffff807ff2b000 Mem abort info: ESR = 0x96000006 EC = 0x25: DABT (current EL), IL = 32 bits SET = 0, FnV = 0 EA = 0, S1PTW = 0 FSC = 0x06: level 2 translation fault Data abort info: ISV = 0, ISS = 0x00000006 CM = 0, WnR = 0 swapper pgtable: 4k pages, 39-bit VAs, pgdp=0000000081d87000 [ffffff807ff2b000] pgd=180000017fe18003, p4d=180000017fe18003, pud=180000017fe18003, pmd=0000000000000000 Internal error: Oops: 96000006 [#1] PREEMPT SMP Modules linked in: dmintegrity CPU: 7 PID: 21179 Comm: perf Not tainted 5.15.67-10882-ge4eb2eb988cd #1 baa443fb8e8477896a370b31a821eb2009f9bfba Hardware name: Google Lazor (rev3 - 8) (DT) pstate: a0400009 (NzCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--) pc : memcpy+0x110/0x260 lr : vread+0x194/0x294 sp : ffffffc013ee39d0 x29: ffffffc013ee39f0 x28: 0000000000001000 x27: ffffff807ff2b000 x26: 0000000000001000 x25: ffffffc0085a2000 x24: ffffff802d4b3000 x23: ffffff80f8a60000 x22: ffffff802d4b3000 x21: ffffffc0085a2000 x20: ffffff8080b7bc68 x19: 0000000000001000 x18: 0000000000000000 x17: 0000000000000000 x16: 0000000000000000 x15: ffffffd3073f2e60 x14: ffffffffad588000 x13: 0000000000000000 x12: 0000000000000001 x11: 00000000000001a2 x10: 00680000fff2bf0b x9 : 03fffffff807ff2b x8 : 0000000000000001 x7 : 0000000000000000 x6 : 0000000000000000 x5 : ffffff802d4b4000 x4 : ffffff807ff2c000 x3 : ffffffc013ee3a78 x2 : 0000000000001000 x1 : ffffff807ff2b000 x0 : ffffff802d4b3000 Call trace: memcpy+0x110/0x260 readkcore+0x584/0x778 procregread+0xb4/0xe4
During early boot, memblock reserves the pages for the ramoops reserved memory node in DT that would otherwise be part of the direct lowmem mapping. Pstore's ram backend reuses those reserved pages to change the memory type (writeback or non-cached) by passing the pages to vmap() (see pfntopage() usage in persistentramvmap() for more details) with specific flags. When readkcore() starts iterating over the vmalloc region, it runs over the virtual address that vmap() returned for ramoops. In alignedvread() the virtual address is passed to vmalloctopage() which returns the page struct for the reserved lowmem area. That lowmem page is passed to kmapatomic(), which effectively calls pagetovirt() that assumes a lowmem page struct must be directly accessible with va() and friends. These pages are mapped via vmap() though, and the lowmem mapping was never made, so accessing them via the lowmem virtual address oopses like above.
Let's side-step this problem by passing VMIOREMAP to vmap(). This will tell vread() to not include the ramoops region in the kcore. Instead the area will look like a bunch of zeros. The alternative is to teach kmap() about vmalloc areas that intersect with lowmem. Presumably such a change isn't a one-liner, and there isn't much interest in inspecting the ramoops region in kcore files anyway, so the most expedient route is taken for now.
In the Linux kernel, the following vulnerability has been resolved:
ksmbd: Fix resource leak in ksmbdsessionrpcopen()
When ksmbdrpcopen() fails then it must call ksmbdrpcidfree() to undo the result of ksmbdipcidalloc().
In the Linux kernel, the following vulnerability has been resolved:
drivers: dio: fix possible memory leak in dioinit()
If deviceregister() returns error, the 'dev' and name needs be freed. Add a release function, and then call putdevice() in the error path, so the name is freed in kobjectcleanup() and to the 'dev' is freed in release function.
In the Linux kernel, the following vulnerability has been resolved:
rapidio: devices: fix missing putdevice in mportcdevopen
When kfifoalloc fails, the refcount of chdev->dev is left incremental. We should use putdevice(&chdev->dev) to decrease the ref count of chdev->dev to avoid refcount leak.
In the Linux kernel, the following vulnerability has been resolved:
mmc: toshsd: fix return value check of mmcaddhost()
mmcaddhost() may return error, if we ignore its return value, the memory that allocated in mmcallochost() will be leaked and it will lead a kernel crash because of deleting not added device in the remove path.
So fix this by checking the return value and goto error path which will call mmcfreehost(), besides, freeirq() also needs be called.
In the Linux kernel, the following vulnerability has been resolved:
can: mcbausb: mcbausbreadbulkcallback(): fix URB memory leak
Fix similar memory leak as in commit 7352e1d5932a ("can: gsusb: gsusbreceivebulkcallback(): fix URB memory leak").
In mcbausbprobe() -> mcbausbstart(), the URBs for USB-in transfers are allocated, added to the priv->rxsubmitted anchor and submitted. In the complete callback mcbausbreadbulkcallback(), the URBs are processed and resubmitted. In mcbausbclose() -> mcbaurbunlink() the URBs are freed by calling usbkillanchoredurbs(&priv->rxsubmitted).
However, this does not take into account that the USB framework unanchors the URB before the complete function is called. This means that once an in-URB has been completed, it is no longer anchored and is ultimately not released in usbkillanchoredurbs().
Fix the memory leak by anchoring the URB in the mcbausbreadbulkcallback()to the priv->rxsubmitted anchor.