漏洞

漏洞

自从我拥有 Dasung 设备几天以来Paperlike HD,在使用它一天后,我担心它附带的实用程序做了一些不应该做的事情。

热插拔事件

首先,它似乎不再通过 HDMI 接收热插拔信息。所谓的HPD(热插拔检测)信号通过pin 19(参见维基百科)似乎没有到达。

手动启用

我们可以重写它(我们的接口是DP-1):

echo 'on-digital' | sudo tee /sys/class/drm/card0-DP-1/status

现在我们可以EDID通过以下方式读取信息edid-decode /sys/class/drm/card0-DP-1/edid

edid-decode (hex):

00 ff ff ff ff ff ff 00 12 63 01 00 00 00 00 00 
0a 1d 01 03 80 14 0f 78 2a 08 a5 a2 57 4f a2 28 
0f 50 54 00 00 00 01 01 01 01 01 01 01 01 01 01 
01 01 01 01 01 01 c1 3e 98 a8 80 72 2e 60 38 20 
36 00 c8 96 00 00 00 1e 00 00 00 10 00 00 00 00 
00 00 00 00 00 00 00 00 00 00 00 00 00 fc 00 50 
61 70 65 72 6c 69 6b 65 20 48 20 44 48 3f 40 30 
62 b0 32 40 40 c0 13 00 6d 55 21 00 00 1e 00 d1 

----------------

EDID version: 1.3
Manufacturer: DSC Model 1 Serial Number 0
Made in week 10 of 2019
Digital display
Maximum image size: 20 cm x 15 cm
Gamma: 2.20
DPMS levels: Off
RGB color display
First detailed timing is preferred timing
Color Characteristics
  Red:   0.6328, 0.3398
  Green: 0.3105, 0.6328
  Blue:  0.1582, 0.0605
  White: 0.3134, 0.3291
Established Timings I & II: none
Standard Timings: none
Detailed mode: Clock 160.650 MHz, 200 mm x 150 mm
               2200 2256 2288 2368 ( 56  32  80)
               1650 1653 1659 1696 (  3   6  37)
               +hsync +vsync
               VertFreq: 40.001 Hz, HorFreq: 67.842 kHz
Dummy Descriptor
Display Product Name: Paperlike H D
Detailed mode: Clock 162.000 MHz, 621 mm x 341 mm
               1600 1664 1856 2160 ( 64 192 304)
               1200 1201 1204 1250 (  1   3  46)
               +hsync +vsync
               VertFreq: 60.000 Hz, HorFreq: 75.000 kHz
Checksum: 0xd1

校验和正确。我们使用指定的模型行来手动配置接口

xrandr --newmode "Low-res" 162.000 1600 1664 1856 2160 1200 1201 1204 1250 +hsync +vsync
xrandr --addmode DP-1 "Low-res"
xrandr --output DP-1 --mode "Low-res"

漏洞

这导致以下跟踪(带有dmesg -w):

[  760.510138] ------------[ cut here ]------------
[  760.510140] WARN_ON(len <= 0)
[  760.510208] WARNING: CPU: 2 PID: 1418 at drivers/gpu/drm/i915/display/intel_dp.c:1801 intel_dp_max_link_rate+0x53/0x60 [i915]
[  760.510212] Modules linked in: rfcomm ccm msr cmac algif_hash algif_skcipher af_alg bnep btusb btrtl btbcm btintel bluetooth ecdh_generic ecc uvcvideo binfmt_misc nls_iso8859_1 snd_hda_codec_hdmi snd_hda_codec_realtek snd_hda_codec_generic ledtrig_audio snd_hda_intel mei_hdcp snd_intel_dspcfg intel_rapl_msr x86_pkg_temp_thermal snd_hda_codec intel_powerclamp snd_hda_core snd_hwdep kvm_intel snd_pcm kvm crct10dif_pclmul ghash_clmulni_intel snd_seq_midi snd_seq_midi_event snd_rawmidi snd_seq aesni_intel iwlmvm crypto_simd snd_seq_device cryptd mac80211 snd_timer glue_helper libarc4 snd i915 intel_cstate intel_rapl_perf input_leds iwlwifi intel_wmi_thunderbolt wmi_bmof serio_raw soundcore hid_sensor_magn_3d drm_kms_helper cfg80211 hid_sensor_incl_3d hid_sensor_gyro_3d hid_sensor_als mei_me processor_thermal_device hid_sensor_accel_3d hid_sensor_rotation joydev hid_multitouch mei intel_rapl_common i2c_algo_bit hid_sensor_trigger industrialio_triggered_buffer kfifo_buf int340x_thermal_zone
[  760.510243]  hid_sensor_iio_common fb_sys_fops intel_soc_dts_iosf industrialio syscopyarea sysfillrect intel_xhci_usb_role_switch sysimgblt roles intel_pch_thermal ideapad_laptop sparse_keymap int3400_thermal mac_hid acpi_thermal_rel acpi_pad sch_fq_codel coretemp parport_pc ppdev lp sunrpc parport drm ip_tables x_tables autofs4 usbhid hid_rmi rmi_core videobuf2_vmalloc videobuf2_memops videobuf2_v4l2 videobuf2_common hid_sensor_custom videodev mc hid_sensor_hub hid_generic sdhci_pci crc32_pclmul cqhci i2c_i801 sdhci ahci intel_lpss_pci libahci intel_lpss i2c_hid idma64 virt_dma wmi hid video pinctrl_sunrisepoint pinctrl_intel
[  760.510265] CPU: 2 PID: 1418 Comm: Xorg Tainted: G        W         5.4.0-34-generic #38-Ubuntu
[  760.510266] Hardware name: LENOVO 80MK/VIUU4, BIOS C6CN39WW 10/11/2016
[  760.510304] RIP: 0010:intel_dp_max_link_rate+0x53/0x60 [i915]
[  760.510312] Code: 74 11 3b 0a 7c f3 83 e8 01 48 98 8b 84 87 84 00 00 00 c3 55 48 c7 c6 f3 0e b6 c0 48 c7 c7 ec 0a b6 c0 48 89 e5 e8 18 b6 9e c6 <0f> 0b b8 d0 78 02 00 5d c3 0f 1f 40 00 0f 1f 44 00 00 55 48 89 e5
[  760.510316] RSP: 0018:ffffacbf40ebbb40 EFLAGS: 00010286
[  760.510318] RAX: 0000000000000000 RBX: ffff98275e83a000 RCX: 0000000000000000
[  760.510319] RDX: 0000000000000011 RSI: ffffffff88f945b1 RDI: 0000000000000246
[  760.510320] RBP: ffffacbf40ebbb40 R08: ffffffff88f945a0 R09: 0000000000000011
[  760.510321] R10: ffffffff88f94980 R11: 0000000088f9459f R12: ffff9826fda56800
[  760.510322] R13: 00000000000a4cb8 R14: ffff982766680000 R15: 00000000000278d0
[  760.510324] FS:  00007f8f40701a80(0000) GS:ffff98276b300000(0000) knlGS:0000000000000000
[  760.510325] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[  760.510326] CR2: 00007f0bb409b703 CR3: 0000000228540002 CR4: 00000000003606e0
[  760.510329] Call Trace:
[  760.510369]  intel_dp_mode_valid+0xb6/0x240 [i915]
[  760.510383]  drm_helper_probe_single_connector_modes+0x412/0x740 [drm_kms_helper]
[  760.510406]  drm_mode_getconnector+0x47d/0x4b0 [drm]
[  760.510409]  ? radix_tree_lookup+0xd/0x10
[  760.510428]  ? drm_connector_property_set_ioctl+0x60/0x60 [drm]
[  760.510440]  drm_ioctl_kernel+0xae/0xf0 [drm]
[  760.510451]  drm_ioctl+0x234/0x3d0 [drm]
[  760.510471]  ? drm_connector_property_set_ioctl+0x60/0x60 [drm]
[  760.510476]  ? __fsnotify_parent+0x9f/0x140
[  760.510478]  do_vfs_ioctl+0x407/0x670
[  760.510482]  ksys_ioctl+0x67/0x90
[  760.510484]  __x64_sys_ioctl+0x1a/0x20
[  760.510487]  do_syscall_64+0x57/0x190
[  760.510490]  entry_SYSCALL_64_after_hwframe+0x44/0xa9
[  760.510491] RIP: 0033:0x7f8f40a6137b
[  760.510493] Code: 0f 1e fa 48 8b 05 15 3b 0d 00 64 c7 00 26 00 00 00 48 c7 c0 ff ff ff ff c3 66 0f 1f 44 00 00 f3 0f 1e fa b8 10 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d e5 3a 0d 00 f7 d8 64 89 01 48
[  760.510494] RSP: 002b:00007ffd3eb26108 EFLAGS: 00003246 ORIG_RAX: 0000000000000010
[  760.510497] RAX: ffffffffffffffda RBX: 00007ffd3eb26150 RCX: 00007f8f40a6137b
[  760.510498] RDX: 00007ffd3eb26150 RSI: 00000000c05064a7 RDI: 000000000000000e
[  760.510499] RBP: 00000000c05064a7 R08: 0000000000000007 R09: 0000000000000190
[  760.510500] R10: 0000000000000140 R11: 0000000000003246 R12: 0000000000000001
[  760.510501] R13: 000000000000000e R14: 00007ffd3eb26150 R15: 0000000000000000
[  760.510503] ---[ end trace 706fd3d45f136b1f ]---

显然,在以下函数中,i915模块确实收到了等于或小于0的返回值intel_dp_common_len_rate_limit

int
intel_dp_max_link_rate(struct intel_dp *intel_dp)
{
    int len;

    len = intel_dp_common_len_rate_limit(intel_dp, intel_dp->max_link_rate);
    if (WARN_ON(len <= 0))
        return 162000;

    return intel_dp->common_rates[len - 1];
}

我还将edid数据复制到/lib/firmware/edid/paperlike.bin并添加了内核命令行参数drm_kms_helper.edid_firmware=edid/paperlike.bin。然而,这并没有多大区别。我认为这是合乎逻辑的。并不是说EDID信息不可用。就是没有设置热插拔引脚,所以不认为整个屏幕已连接。通过手动设置连接EDID即可检索信息。然而,实际上向它发送数据是行不通的。我的猜测是我必须做一些其他事情来覆盖热插拔行为,但是什么?

现在的情况

目前的情况是Paperlike HD屏幕一片空白。什么都没发生。但它的一部分USB可以工作(它是触摸屏)。

当设置outputwith xrandr(如上所述)时,它给出:

xrandr: Configure crtc 1 failed

感觉我已经接近解决这个谜题了,但是,我确实需要帮助。

相关内容