<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/drivers/gpu/drm/radeon, branch v5.4.251</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v5.4.251</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v5.4.251'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2023-07-27T06:37:15+00:00</updated>
<entry>
<title>drm/radeon: fix possible division-by-zero errors</title>
<updated>2023-07-27T06:37:15+00:00</updated>
<author>
<name>Nikita Zhandarovich</name>
<email>n.zhandarovich@fintech.ru</email>
</author>
<published>2023-05-19T15:33:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=262db3ff58e235b316db53148f1c5335fa20a7b7'/>
<id>urn:sha1:262db3ff58e235b316db53148f1c5335fa20a7b7</id>
<content type='text'>
[ Upstream commit 1becc57cd1a905e2aa0e1eca60d2a37744525c4a ]

Function rv740_get_decoded_reference_divider() may return 0 due to
unpredictable reference divider value calculated in
radeon_atom_get_clock_dividers(). This will lead to
division-by-zero error once that value is used as a divider
in calculating 'clk_s'.
While unlikely, this issue should nonetheless be prevented so add a
sanity check for such cases by testing 'decoded_ref' value against 0.

Found by Linux Verification Center (linuxtesting.org) with static
analysis tool SVACE.

v2: minor coding style fixes (Alex)
In practice this should actually happen as the vbios should be
properly populated.

Fixes: 66229b200598 ("drm/radeon/kms: add dpm support for rv7xx (v4)")
Signed-off-by: Nikita Zhandarovich &lt;n.zhandarovich@fintech.ru&gt;
Signed-off-by: Alex Deucher &lt;alexander.deucher@amd.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>radeon: avoid double free in ci_dpm_init()</title>
<updated>2023-07-27T06:37:12+00:00</updated>
<author>
<name>Nikita Zhandarovich</name>
<email>n.zhandarovich@fintech.ru</email>
</author>
<published>2023-04-13T15:12:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=3e789aee218bf3547f9bed1ea848a789008c3b35'/>
<id>urn:sha1:3e789aee218bf3547f9bed1ea848a789008c3b35</id>
<content type='text'>
[ Upstream commit 20c3dffdccbd494e0dd631d1660aeecbff6775f2 ]

Several calls to ci_dpm_fini() will attempt to free resources that
either have been freed before or haven't been allocated yet. This
may lead to undefined or dangerous behaviour.

For instance, if r600_parse_extended_power_table() fails, it might
call r600_free_extended_power_table() as will ci_dpm_fini() later
during error handling.

Fix this by only freeing pointers to objects previously allocated.

Found by Linux Verification Center (linuxtesting.org) with static
analysis tool SVACE.

Fixes: cc8dbbb4f62a ("drm/radeon: add dpm support for CI dGPUs (v2)")
Co-developed-by: Natalia Petrova &lt;n.petrova@fintech.ru&gt;
Signed-off-by: Nikita Zhandarovich &lt;n.zhandarovich@fintech.ru&gt;
Signed-off-by: Alex Deucher &lt;alexander.deucher@amd.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>drm/radeon: fix race condition UAF in radeon_gem_set_domain_ioctl</title>
<updated>2023-06-28T08:18:41+00:00</updated>
<author>
<name>Min Li</name>
<email>lm0963hack@gmail.com</email>
</author>
<published>2023-06-03T07:43:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=a43c763f9cbeed4ac3daf31fd38687f759d79e3f'/>
<id>urn:sha1:a43c763f9cbeed4ac3daf31fd38687f759d79e3f</id>
<content type='text'>
[ Upstream commit 982b173a6c6d9472730c3116051977e05d17c8c5 ]

Userspace can race to free the gobj(robj converted from), robj should not
be accessed again after drm_gem_object_put, otherwith it will result in
use-after-free.

Reviewed-by: Christian König &lt;christian.koenig@amd.com&gt;
Signed-off-by: Min Li &lt;lm0963hack@gmail.com&gt;
Signed-off-by: Alex Deucher &lt;alexander.deucher@amd.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>drm/radeon: Fix eDP for single-display iMac11,2</title>
<updated>2023-03-11T15:44:07+00:00</updated>
<author>
<name>Mark Hawrylak</name>
<email>mark.hawrylak@gmail.com</email>
</author>
<published>2023-02-19T05:02:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=96a8424a27edd9c8943185da98e006e25e71b96b'/>
<id>urn:sha1:96a8424a27edd9c8943185da98e006e25e71b96b</id>
<content type='text'>
commit 05eacc198c68cbb35a7281ce4011f8899ee1cfb8 upstream.

Apple iMac11,2 (mid 2010) also with Radeon HD-4670 that has the same
issue as iMac10,1 (late 2009) where the internal eDP panel stays dark on
driver load.  This patch treats iMac11,2 the same as iMac10,1,
so the eDP panel stays active.

Additional steps:
Kernel boot parameter radeon.nomodeset=0 required to keep the eDP
panel active.

This patch is an extension of
commit 564d8a2cf3ab ("drm/radeon: Fix eDP for single-display iMac10,1 (v2)")
Link: https://lore.kernel.org/all/lsq.1507553064.833262317@decadent.org.uk/
Signed-off-by: Mark Hawrylak &lt;mark.hawrylak@gmail.com&gt;
Signed-off-by: Alex Deucher &lt;alexander.deucher@amd.com&gt;
Cc: stable@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>drm/radeon: free iio for atombios when driver shutdown</title>
<updated>2023-03-11T15:43:57+00:00</updated>
<author>
<name>Liwei Song</name>
<email>liwei.song@windriver.com</email>
</author>
<published>2023-01-06T09:47:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=f9f55fc64928b5e30d78f861c5fc76db9e769ebb'/>
<id>urn:sha1:f9f55fc64928b5e30d78f861c5fc76db9e769ebb</id>
<content type='text'>
[ Upstream commit 4773fadedca918faec443daaca5e4ea1c0ced144 ]

Fix below kmemleak when unload radeon driver:

unreferenced object 0xffff9f8608ede200 (size 512):
  comm "systemd-udevd", pid 326, jiffies 4294682822 (age 716.338s)
  hex dump (first 32 bytes):
    00 00 00 00 c4 aa ec aa 14 ab 00 00 00 00 00 00  ................
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
  backtrace:
    [&lt;0000000062fadebe&gt;] kmem_cache_alloc_trace+0x2f1/0x500
    [&lt;00000000b6883cea&gt;] atom_parse+0x117/0x230 [radeon]
    [&lt;00000000158c23fd&gt;] radeon_atombios_init+0xab/0x170 [radeon]
    [&lt;00000000683f672e&gt;] si_init+0x57/0x750 [radeon]
    [&lt;00000000566cc31f&gt;] radeon_device_init+0x559/0x9c0 [radeon]
    [&lt;0000000046efabb3&gt;] radeon_driver_load_kms+0xc1/0x1a0 [radeon]
    [&lt;00000000b5155064&gt;] drm_dev_register+0xdd/0x1d0
    [&lt;0000000045fec835&gt;] radeon_pci_probe+0xbd/0x100 [radeon]
    [&lt;00000000e69ecca3&gt;] pci_device_probe+0xe1/0x160
    [&lt;0000000019484b76&gt;] really_probe.part.0+0xc1/0x2c0
    [&lt;000000003f2649da&gt;] __driver_probe_device+0x96/0x130
    [&lt;00000000231c5bb1&gt;] driver_probe_device+0x24/0xf0
    [&lt;0000000000a42377&gt;] __driver_attach+0x77/0x190
    [&lt;00000000d7574da6&gt;] bus_for_each_dev+0x7f/0xd0
    [&lt;00000000633166d2&gt;] driver_attach+0x1e/0x30
    [&lt;00000000313b05b8&gt;] bus_add_driver+0x12c/0x1e0

iio was allocated in atom_index_iio() called by atom_parse(),
but it doesn't got released when the dirver is shutdown.
Fix this kmemleak by free it in radeon_atombios_fini().

Signed-off-by: Liwei Song &lt;liwei.song@windriver.com&gt;
Signed-off-by: Alex Deucher &lt;alexander.deucher@amd.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>drm/radeon: Fix PCI device refcount leak in radeon_atrm_get_bios()</title>
<updated>2023-01-18T10:41:07+00:00</updated>
<author>
<name>Xiongfeng Wang</name>
<email>wangxiongfeng2@huawei.com</email>
</author>
<published>2022-11-22T11:30:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=470a77989037c3ab2b08bf2d026d2c0ddc35ff5b'/>
<id>urn:sha1:470a77989037c3ab2b08bf2d026d2c0ddc35ff5b</id>
<content type='text'>
[ Upstream commit 725a521a18734f65de05b8d353b5bd0d3ca4c37a ]

As comment of pci_get_class() says, it returns a pci_device with its
refcount increased and decreased the refcount for the input parameter
@from if it is not NULL.

If we break the loop in radeon_atrm_get_bios() with 'pdev' not NULL, we
need to call pci_dev_put() to decrease the refcount. Add the missing
pci_dev_put() to avoid refcount leak.

Fixes: d8ade3526b2a ("drm/radeon: handle non-VGA class pci devices with ATRM")
Fixes: c61e2775873f ("drm/radeon: split ATRM support out from the ATPX handler (v3)")
Signed-off-by: Xiongfeng Wang &lt;wangxiongfeng2@huawei.com&gt;
Signed-off-by: Alex Deucher &lt;alexander.deucher@amd.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>drm/radeon: Add the missed acpi_put_table() to fix memory leak</title>
<updated>2023-01-18T10:41:02+00:00</updated>
<author>
<name>Hanjun Guo</name>
<email>guohanjun@huawei.com</email>
</author>
<published>2022-11-04T09:50:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=a0f26560be2c566b62331cb0eeffa52929aa4d44'/>
<id>urn:sha1:a0f26560be2c566b62331cb0eeffa52929aa4d44</id>
<content type='text'>
[ Upstream commit 10276a20be1115e1f76c189330da2992df980eee ]

When the radeon driver reads the bios information from ACPI
table in radeon_acpi_vfct_bios(), it misses to call acpi_put_table()
to release the ACPI memory after the init, so add acpi_put_table()
properly to fix the memory leak.

v2: fix text formatting (Alex)

Fixes: 268ba0a99f89 ("drm/radeon: implement ACPI VFCT vbios fetch (v3)")
Signed-off-by: Hanjun Guo &lt;guohanjun@huawei.com&gt;
Signed-off-by: Alex Deucher &lt;alexander.deucher@amd.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>drm/radeon: add a force flush to delay work when radeon</title>
<updated>2022-09-15T10:04:53+00:00</updated>
<author>
<name>Zhenneng Li</name>
<email>lizhenneng@kylinos.cn</email>
</author>
<published>2022-08-11T07:25:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=c72d97146fc5a4dff381b1737f6167e89860430d'/>
<id>urn:sha1:c72d97146fc5a4dff381b1737f6167e89860430d</id>
<content type='text'>
[ Upstream commit f461950fdc374a3ada5a63c669d997de4600dffe ]

Although radeon card fence and wait for gpu to finish processing current batch rings,
there is still a corner case that radeon lockup work queue may not be fully flushed,
and meanwhile the radeon_suspend_kms() function has called pci_set_power_state() to
put device in D3hot state.
Per PCI spec rev 4.0 on 5.3.1.4.1 D3hot State.
&gt; Configuration and Message requests are the only TLPs accepted by a Function in
&gt; the D3hot state. All other received Requests must be handled as Unsupported Requests,
&gt; and all received Completions may optionally be handled as Unexpected Completions.
This issue will happen in following logs:
Unable to handle kernel paging request at virtual address 00008800e0008010
CPU 0 kworker/0:3(131): Oops 0
pc = [&lt;ffffffff811bea5c&gt;]  ra = [&lt;ffffffff81240844&gt;]  ps = 0000 Tainted: G        W
pc is at si_gpu_check_soft_reset+0x3c/0x240
ra is at si_dma_is_lockup+0x34/0xd0
v0 = 0000000000000000  t0 = fff08800e0008010  t1 = 0000000000010000
t2 = 0000000000008010  t3 = fff00007e3c00000  t4 = fff00007e3c00258
t5 = 000000000000ffff  t6 = 0000000000000001  t7 = fff00007ef078000
s0 = fff00007e3c016e8  s1 = fff00007e3c00000  s2 = fff00007e3c00018
s3 = fff00007e3c00000  s4 = fff00007fff59d80  s5 = 0000000000000000
s6 = fff00007ef07bd98
a0 = fff00007e3c00000  a1 = fff00007e3c016e8  a2 = 0000000000000008
a3 = 0000000000000001  a4 = 8f5c28f5c28f5c29  a5 = ffffffff810f4338
t8 = 0000000000000275  t9 = ffffffff809b66f8  t10 = ff6769c5d964b800
t11= 000000000000b886  pv = ffffffff811bea20  at = 0000000000000000
gp = ffffffff81d89690  sp = 00000000aa814126
Disabling lock debugging due to kernel taint
Trace:
[&lt;ffffffff81240844&gt;] si_dma_is_lockup+0x34/0xd0
[&lt;ffffffff81119610&gt;] radeon_fence_check_lockup+0xd0/0x290
[&lt;ffffffff80977010&gt;] process_one_work+0x280/0x550
[&lt;ffffffff80977350&gt;] worker_thread+0x70/0x7c0
[&lt;ffffffff80977410&gt;] worker_thread+0x130/0x7c0
[&lt;ffffffff80982040&gt;] kthread+0x200/0x210
[&lt;ffffffff809772e0&gt;] worker_thread+0x0/0x7c0
[&lt;ffffffff80981f8c&gt;] kthread+0x14c/0x210
[&lt;ffffffff80911658&gt;] ret_from_kernel_thread+0x18/0x20
[&lt;ffffffff80981e40&gt;] kthread+0x0/0x210
 Code: ad3e0008  43f0074a  ad7e0018  ad9e0020  8c3001e8  40230101
 &lt;88210000&gt; 4821ed21
So force lockup work queue flush to fix this problem.

Acked-by: Christian König &lt;christian.koenig@amd.com&gt;
Signed-off-by: Zhenneng Li &lt;lizhenneng@kylinos.cn&gt;
Signed-off-by: Alex Deucher &lt;alexander.deucher@amd.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>drm/radeon: fix potential buffer overflow in ni_set_mc_special_registers()</title>
<updated>2022-08-25T09:17:38+00:00</updated>
<author>
<name>Alexey Kodanev</name>
<email>aleksei.kodanev@bell-sw.com</email>
</author>
<published>2022-06-06T13:50:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=db1a9add3f90ff1c641974d5bb910c16b87af4ef'/>
<id>urn:sha1:db1a9add3f90ff1c641974d5bb910c16b87af4ef</id>
<content type='text'>
[ Upstream commit 136f614931a2bb73616b292cf542da3a18daefd5 ]

The last case label can write two buffers 'mc_reg_address[j]' and
'mc_data[j]' with 'j' offset equal to SMC_NISLANDS_MC_REGISTER_ARRAY_SIZE
since there are no checks for this value in both case labels after the
last 'j++'.

Instead of changing '&gt;' to '&gt;=' there, add the bounds check at the start
of the second 'case' (the first one already has it).

Also, remove redundant last checks for 'j' index bigger than array size.
The expression is always false. Moreover, before or after the patch
'table-&gt;last' can be equal to SMC_NISLANDS_MC_REGISTER_ARRAY_SIZE and it
seems it can be a valid value.

Detected using the static analysis tool - Svace.
Fixes: 69e0b57a91ad ("drm/radeon/kms: add dpm support for cayman (v5)")
Signed-off-by: Alexey Kodanev &lt;aleksei.kodanev@bell-sw.com&gt;
Signed-off-by: Alex Deucher &lt;alexander.deucher@amd.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>drm/radeon: fix a possible null pointer dereference</title>
<updated>2022-06-14T16:12:01+00:00</updated>
<author>
<name>Gong Yuanjun</name>
<email>ruc_gongyuanjun@163.com</email>
</author>
<published>2022-05-17T09:57:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=28fd384c78d7d8ed8af0d086d778c3e438ba7f60'/>
<id>urn:sha1:28fd384c78d7d8ed8af0d086d778c3e438ba7f60</id>
<content type='text'>
[ Upstream commit a2b28708b645c5632dc93669ab06e97874c8244f ]

In radeon_fp_native_mode(), the return value of drm_mode_duplicate()
is assigned to mode, which will lead to a NULL pointer dereference
on failure of drm_mode_duplicate(). Add a check to avoid npd.

The failure status of drm_cvt_mode() on the other path is checked too.

Signed-off-by: Gong Yuanjun &lt;ruc_gongyuanjun@163.com&gt;
Signed-off-by: Alex Deucher &lt;alexander.deucher@amd.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
</feed>
