abcz316/rwProcMem33

该驱动是否不支持编译到内核工作

Opened this issue · 4 comments

我用-y的方式把驱动编译到内核里了,dev/里存在rwProcMem37驱动,lsmod里没有
我尝试了OpenProcess发现能正常与驱动通信,但是read和write会失败,我查看了一下源码实现,代码中在读写时并没有用到控制码,而是用的
ssize_t realRead = read(nDriverLink, buf, nSize);
我查看了一下驱动中读写时用到了这个结构体
MY_STATIC const struct my_file_operations rwProcMem_fops =
{
.owner = THIS_MODULE,
.llseek = rwProcMem_llseek,

.read = rwProcMem_read,
.write = rwProcMem_write,

}
貌似驱动读写时需要 THIS_MODULE
是否用这种方式读写只能以-m的方式编译驱动?

补充一下,我的内核版本是5.15

测试完了,未兼容5.15

[ 144.490353] find mmap_lock offset failed [ 144.490354] init_map_count_offset -40:56:0000000057ac2ec7:-604495872 [ 144.490356] init_map_count_offset -39:57:00000000a3aa65dd:2145122336 [ 144.490359] init_map_count_offset -38:58:0000000034a01b73:8379384 [ 144.490361] init_map_count_offset -37:59:00000000bc829402:32731 [ 144.490363] init_map_count_offset -36:60:000000006f0dc8b7:127 [ 144.490366] init_map_count_offset -35:61:00000000e63fe649:0 [ 144.490368] init_map_count_offset -34:62:000000008e0ea15c:-1610612736 [ 144.490370] init_map_count_offset -33:63:000000009965453a:413138944 [ 144.490373] init_map_count_offset -32:64:00000000ab1f3124:-2061983744 [ 144.490375] init_map_count_offset -31:65:0000000085208a1f:-1987766112 [ 144.490377] init_map_count_offset -30:66:000000009f3f7e33:-7764712 [ 144.490380] init_map_count_offset -29:67:00000000f2336126:-30331 [ 144.490382] init_map_count_offset -28:68:00000000012ecce7:-119 [ 144.490385] init_map_count_offset -27:69:00000000255ce50a:16777215 [ 144.490387] init_map_count_offset -26:70:00000000e1aff4d4:65535 [ 144.490390] init_map_count_offset -25:71:0000000089168192:255 [ 144.490392] init_map_count_offset -24:72:00000000e7a5856e:0 [ 144.490394] init_map_count_offset -23:73:000000000faa8c56:33554432 [ 144.490397] init_map_count_offset -22:74:000000005cb58f50:131072 [ 144.490399] init_map_count_offset -21:75:0000000099d28f2c:512 [ 144.490402] init_map_count_offset -20:76:00000000831c809b:2 [ 144.490404] init_map_count_offset -19:77:000000004fae7c3b:16777216 [ 144.490407] init_map_count_offset -18:78:00000000e49a0fab:65536 [ 144.490409] init_map_count_offset -17:79:000000003f90abf0:256 [ 144.490411] init_map_count_offset -16:80:00000000769be7f0:1 [ 144.490414] init_map_count_offset -15:81:000000004772503f:0 [ 144.490416] init_map_count_offset -14:82:000000003fd5c666:0 [ 144.490418] init_map_count_offset -13:83:000000006beee883:0 [ 144.490421] init_map_count_offset -12:84:00000000c080b0f0:0 [ 144.490423] init_map_count_offset -11:85:00000000394ce3d0:0 [ 144.490425] init_map_count_offset -10:86:00000000e2d511b4:-1342177280 [ 144.490428] init_map_count_offset -9:87:00000000036df2d6:28311552 [ 144.490430] init_map_count_offset -8:88:00000000f1d1d090:110592 [ 144.490433] init_map_count_offset -7:89:0000000007992780:432 [ 144.490435] init_map_count_offset -6:90:00000000d33c47cb:1 [ 144.490437] init_map_count_offset -5:91:00000000de620c0c:0 [ 144.490440] init_map_count_offset -4:92:0000000042d2b3d0:0 [ 144.490442] init_map_count_offset -3:93:0000000005476e8a:1811939328 [ 144.490445] init_map_count_offset -2:94:00000000c9b9e93b:7077888 [ 144.490447] init_map_count_offset -1:95:0000000095e4f866:27648 [ 144.490450] init_map_count_offset 0:96:000000001e24ff15:108 [ 144.490452] init_map_count_offset 1:97:00000000a7a1e304:0 [ 144.490454] init_map_count_offset 2:98:000000000efdd8da:0 [ 144.490457] init_map_count_offset 3:99:000000006eacb03b:0 [ 144.490459] init_map_count_offset 4:100:00000000dd3e25e6:0 [ 144.490461] init_map_count_offset 5:101:00000000cb9cd3c3:0 [ 144.490464] init_map_count_offset 6:102:00000000ab3e5e58:0 [ 144.490466] init_map_count_offset 7:103:00000000a1628850:0 [ 144.490468] init_map_count_offset 8:104:00000000cc31c591:0 [ 144.490471] init_map_count_offset 9:105:00000000d1e72fc1:0 [ 144.490473] init_map_count_offset 10:106:00000000f702cb6e:0 [ 144.490476] init_map_count_offset 11:107:000000007822c12b:0 [ 144.490478] init_map_count_offset 12:108:00000000c4b96348:0 [ 144.490480] init_map_count_offset 13:109:00000000c5d8b602:16777216 [ 144.490483] init_map_count_offset 14:110:0000000036670175:-1845428224 [ 144.490485] init_map_count_offset 15:111:0000000084954a51:-292421376 [ 144.490488] init_map_count_offset 16:112:0000000052d4bfe6:116298241 [ 144.490490] init_map_count_offset 17:113:0000000087feb383:-2147029358 [ 144.490492] init_map_count_offset 18:114:000000000b7452a4:-8386834 [ 144.490519] init_map_count_offset 19:115:00000000494757f9:-32762 [ 144.490522] init_map_count_offset 20:116:000000008913d4af:-128 [ 144.490524] init_map_count_offset 21:117:00000000f04d6e2c:16777215 [ 144.490527] init_map_count_offset 22:118:00000000ede75a7e:65535 [ 144.490530] init_map_count_offset 23:119:00000000dc5d51ec:255 [ 144.490532] init_map_count_offset 24:120:0000000013e1ee7d:0 [ 144.490534] init_map_count_offset 25:121:000000003f63df32:0 [ 144.490537] init_map_count_offset 26:122:0000000073360f85:0 [ 144.490539] init_map_count_offset 27:123:00000000938700b7:0 [ 144.490542] init_map_count_offset 28:124:00000000e61917d9:0 [ 144.490544] init_map_count_offset 29:125:00000000209a830a:-2147483648 [ 144.490546] init_map_count_offset 30:126:000000006736dbb9:746586112 [ 144.490549] init_map_count_offset 31:127:00000000f28cae99:-567508992 [ 144.490552] init_map_count_offset 32:128:00000000556cc177:115223680 [ 144.490554] init_map_count_offset 33:129:000000005f840b3a:-2147033556 [ 144.490557] init_map_count_offset 34:130:00000000b32162c1:-8386850 [ 144.490559] init_map_count_offset 35:131:000000001b4d34bd:-32762 [ 144.490562] init_map_count_offset 36:132:00000000b4ceb9fd:-128 [ 144.490564] init_map_count_offset 37:133:00000000a76f4116:-2130706433 [ 144.490567] init_map_count_offset 38:134:0000000086a9b477:746651647 [ 144.490569] init_map_count_offset 39:135:0000000069ec5ee1:-567508737 [ 144.490572] init_map_count_offset 40:136:0000000097758465:115223680 [ 144.490574] find map_count offset failed [ 144.490575] get_task_proc_cmdline_addr g_arg_start_offset_proc_cmdline -64 [ 144.490576] get_task_proc_cmdline_addr g_arg_start_offset_proc_cmdline -63 [ 144.490577] get_task_proc_cmdline_addr g_arg_start_offset_proc_cmdline -62 [ 144.490578] get_task_proc_cmdline_addr g_arg_start_offset_proc_cmdline -61 [ 144.490579] get_task_proc_cmdline_addr g_arg_start_offset_proc_cmdline -60 [ 144.490580] get_task_proc_cmdline_addr g_arg_start_offset_proc_cmdline -59 [ 144.490581] get_task_proc_cmdline_addr g_arg_start_offset_proc_cmdline -58 [ 144.490582] get_task_proc_cmdline_addr g_arg_start_offset_proc_cmdline -57 [ 144.490582] get_task_proc_cmdline_addr g_arg_start_offset_proc_cmdline -56 [ 144.490583] get_task_proc_cmdline_addr g_arg_start_offset_proc_cmdline -55 [ 144.490584] get_task_proc_cmdline_addr g_arg_start_offset_proc_cmdline -54 [ 144.490585] get_task_proc_cmdline_addr g_arg_start_offset_proc_cmdline -53 [ 144.490586] get_task_proc_cmdline_addr g_arg_start_offset_proc_cmdline -52 [ 144.490587] get_task_proc_cmdline_addr g_arg_start_offset_proc_cmdline -51 [ 144.490588] get_task_proc_cmdline_addr g_arg_start_offset_proc_cmdline -50 [ 144.490588] get_task_proc_cmdline_addr g_arg_start_offset_proc_cmdline -49 [ 144.490589] get_task_proc_cmdline_addr g_arg_start_offset_proc_cmdline -48 [ 144.490590] get_task_proc_cmdline_addr g_arg_start_offset_proc_cmdline -47 [ 144.490591] get_task_proc_cmdline_addr g_arg_start_offset_proc_cmdline -46 [ 144.490592] get_task_proc_cmdline_addr g_arg_start_offset_proc_cmdline -45 [ 144.490593] get_task_proc_cmdline_addr g_arg_start_offset_proc_cmdline -44 [ 144.490594] get_task_proc_cmdline_addr g_arg_start_offset_proc_cmdline -43 [ 144.490595] get_task_proc_cmdline_addr g_arg_start_offset_proc_cmdline -42 [ 144.490595] get_task_proc_cmdline_addr g_arg_start_offset_proc_cmdline -41 [ 144.490596] get_task_proc_cmdline_addr g_arg_start_offset_proc_cmdline -40 [ 144.490597] get_task_proc_cmdline_addr g_arg_start_offset_proc_cmdline -39 [ 144.490598] get_task_proc_cmdline_addr g_arg_start_offset_proc_cmdline -38 [ 144.490599] get_task_proc_cmdline_addr g_arg_start_offset_proc_cmdline -37 [ 144.490600] get_task_proc_cmdline_addr g_arg_start_offset_proc_cmdline -36 [ 144.490600] get_task_proc_cmdline_addr g_arg_start_offset_proc_cmdline -35 [ 144.490602] get_task_proc_cmdline_addr g_arg_start_offset_proc_cmdline -34 [ 144.490602] get_task_proc_cmdline_addr g_arg_start_offset_proc_cmdline -33 [ 144.490603] get_task_proc_cmdline_addr g_arg_start_offset_proc_cmdline -32 [ 144.490604] get_task_proc_cmdline_addr g_arg_start_offset_proc_cmdline -31 [ 144.490605] get_task_proc_cmdline_addr g_arg_start_offset_proc_cmdline -30 [ 144.490606] get_task_proc_cmdline_addr g_arg_start_offset_proc_cmdline -29 [ 144.490606] get_task_proc_cmdline_addr g_arg_start_offset_proc_cmdline -28 [ 144.490607] get_task_proc_cmdline_addr g_arg_start_offset_proc_cmdline -27 [ 144.490608] get_task_proc_cmdline_addr g_arg_start_offset_proc_cmdline -26 [ 144.490609] get_task_proc_cmdline_addr g_arg_start_offset_proc_cmdline -25 [ 144.490610] get_task_proc_cmdline_addr g_arg_start_offset_proc_cmdline -24 [ 144.490611] get_task_proc_cmdline_addr g_arg_start_offset_proc_cmdline -23 [ 144.490612] get_task_proc_cmdline_addr g_arg_start_offset_proc_cmdline -22 [ 144.490612] get_task_proc_cmdline_addr g_arg_start_offset_proc_cmdline -21 [ 144.490613] get_task_proc_cmdline_addr g_arg_start_offset_proc_cmdline -20 [ 144.490614] get_task_proc_cmdline_addr g_arg_start_offset_proc_cmdline -19 [ 144.490615] get_task_proc_cmdline_addr g_arg_start_offset_proc_cmdline -18 [ 144.490616] get_task_proc_cmdline_addr g_arg_start_offset_proc_cmdline -17 [ 144.490617] get_task_proc_cmdline_addr g_arg_start_offset_proc_cmdline -16 [ 144.490617] get_task_proc_cmdline_addr g_arg_start_offset_proc_cmdline -15 [ 144.490618] get_task_proc_cmdline_addr g_arg_start_offset_proc_cmdline -14 [ 144.490619] get_task_proc_cmdline_addr g_arg_start_offset_proc_cmdline -13 [ 144.490620] get_task_proc_cmdline_addr g_arg_start_offset_proc_cmdline -12 [ 144.490621] get_task_proc_cmdline_addr g_arg_start_offset_proc_cmdline -11 [ 144.490622] get_task_proc_cmdline_addr g_arg_start_offset_proc_cmdline -10 [ 144.490623] get_task_proc_cmdline_addr g_arg_start_offset_proc_cmdline -9 [ 144.490623] get_task_proc_cmdline_addr g_arg_start_offset_proc_cmdline -8 [ 144.490624] get_task_proc_cmdline_addr g_arg_start_offset_proc_cmdline -7 [ 144.490625] get_task_proc_cmdline_addr g_arg_start_offset_proc_cmdline -6 [ 144.490626] get_task_proc_cmdline_addr g_arg_start_offset_proc_cmdline -5 [ 144.490627] get_task_proc_cmdline_addr g_arg_start_offset_proc_cmdline -4 [ 144.490627] get_task_proc_cmdline_addr g_arg_start_offset_proc_cmdline -3 [ 144.490628] get_task_proc_cmdline_addr g_arg_start_offset_proc_cmdline -2 [ 144.490629] get_task_proc_cmdline_addr g_arg_start_offset_proc_cmdline -1 [ 144.490630] get_task_proc_cmdline_addr g_arg_start_offset_proc_cmdline 0 [ 144.490631] get_task_proc_cmdline_addr g_arg_start_offset_proc_cmdline 1 [ 144.490632] get_task_proc_cmdline_addr g_arg_start_offset_proc_cmdline 2 [ 144.490632] get_task_proc_cmdline_addr g_arg_start_offset_proc_cmdline 3 [ 144.490633] get_task_proc_cmdline_addr g_arg_start_offset_proc_cmdline 4 [ 144.490634] get_task_proc_cmdline_addr g_arg_start_offset_proc_cmdline 5 [ 144.490635] get_task_proc_cmdline_addr g_arg_start_offset_proc_cmdline 6 [ 144.490635] get_task_proc_cmdline_addr g_arg_start_offset_proc_cmdline 7 [ 144.490636] get_task_proc_cmdline_addr g_arg_start_offset_proc_cmdline 8 [ 144.490637] get_task_proc_cmdline_addr g_arg_start_offset_proc_cmdline 9 [ 144.490638] get_task_proc_cmdline_addr g_arg_start_offset_proc_cmdline 10 [ 144.490639] get_task_proc_cmdline_addr g_arg_start_offset_proc_cmdline 11 [ 144.490640] get_task_proc_cmdline_addr g_arg_start_offset_proc_cmdline 12 [ 144.490640] get_task_proc_cmdline_addr g_arg_start_offset_proc_cmdline 13 [ 144.490641] get_task_proc_cmdline_addr g_arg_start_offset_proc_cmdline 14 [ 144.490642] get_task_proc_cmdline_addr g_arg_start_offset_proc_cmdline 15 [ 144.490643] get_task_proc_cmdline_addr g_arg_start_offset_proc_cmdline 16 [ 144.490644] get_task_proc_cmdline_addr g_arg_start_offset_proc_cmdline 17 [ 144.490645] get_task_proc_cmdline_addr g_arg_start_offset_proc_cmdline 18 [ 144.490645] get_task_proc_cmdline_addr g_arg_start_offset_proc_cmdline 19 [ 144.490646] get_task_proc_cmdline_addr g_arg_start_offset_proc_cmdline 20 [ 144.490647] get_task_proc_cmdline_addr g_arg_start_offset_proc_cmdline 21 [ 144.490648] get_task_proc_cmdline_addr g_arg_start_offset_proc_cmdline 22 [ 144.490649] get_task_proc_cmdline_addr g_arg_start_offset_proc_cmdline 23 [ 144.490649] get_task_proc_cmdline_addr g_arg_start_offset_proc_cmdline 24 [ 144.490650] get_task_proc_cmdline_addr g_arg_start_offset_proc_cmdline 25 [ 144.490651] get_task_proc_cmdline_addr g_arg_start_offset_proc_cmdline 26 [ 144.490652] get_task_proc_cmdline_addr g_arg_start_offset_proc_cmdline 27 [ 144.490653] get_task_proc_cmdline_addr g_arg_start_offset_proc_cmdline 28 [ 144.490653] get_task_proc_cmdline_addr g_arg_start_offset_proc_cmdline 29 [ 144.490654] get_task_proc_cmdline_addr g_arg_start_offset_proc_cmdline 30 [ 144.490655] get_task_proc_cmdline_addr g_arg_start_offset_proc_cmdline 31 [ 144.490656] get_task_proc_cmdline_addr g_arg_start_offset_proc_cmdline 32 [ 144.490657] get_task_proc_cmdline_addr g_arg_start_offset_proc_cmdline 33 [ 144.490657] get_task_proc_cmdline_addr g_arg_start_offset_proc_cmdline 34 [ 144.490658] get_task_proc_cmdline_addr g_arg_start_offset_proc_cmdline 35 [ 144.490659] get_task_proc_cmdline_addr g_arg_start_offset_proc_cmdline 36 [ 144.490660] get_task_proc_cmdline_addr g_arg_start_offset_proc_cmdline 37 [ 144.490661] get_task_proc_cmdline_addr g_arg_start_offset_proc_cmdline 38 [ 144.490661] get_task_proc_cmdline_addr g_arg_start_offset_proc_cmdline 39 [ 144.490662] get_task_proc_cmdline_addr g_arg_start_offset_proc_cmdline 40 [ 144.490663] get_task_proc_cmdline_addr g_arg_start_offset_proc_cmdline 41 [ 144.490664] get_task_proc_cmdline_addr g_arg_start_offset_proc_cmdline 42 [ 144.490665] get_task_proc_cmdline_addr g_arg_start_offset_proc_cmdline 43 [ 144.490666] get_task_proc_cmdline_addr g_arg_start_offset_proc_cmdline 44 [ 144.490666] get_task_proc_cmdline_addr g_arg_start_offset_proc_cmdline 45 [ 144.490667] get_task_proc_cmdline_addr g_arg_start_offset_proc_cmdline 46 [ 144.490668] get_task_proc_cmdline_addr g_arg_start_offset_proc_cmdline 47 [ 144.490669] get_task_proc_cmdline_addr g_arg_start_offset_proc_cmdline 48 [ 144.490670] get_task_proc_cmdline_addr g_arg_start_offset_proc_cmdline 49 [ 144.490670] get_task_proc_cmdline_addr g_arg_start_offset_proc_cmdline 50 [ 144.490671] get_task_proc_cmdline_addr g_arg_start_offset_proc_cmdline 51 [ 144.490672] get_task_proc_cmdline_addr g_arg_start_offset_proc_cmdline 52 [ 144.490673] get_task_proc_cmdline_addr g_arg_start_offset_proc_cmdline 53 [ 144.490674] get_task_proc_cmdline_addr g_arg_start_offset_proc_cmdline 54 [ 144.490675] get_task_proc_cmdline_addr g_arg_start_offset_proc_cmdline 55 [ 144.490676] get_task_proc_cmdline_addr g_arg_start_offset_proc_cmdline 56 [ 144.490677] get_task_proc_cmdline_addr g_arg_start_offset_proc_cmdline 57 [ 144.490677] get_task_proc_cmdline_addr g_arg_start_offset_proc_cmdline 58 [ 144.490678] get_task_proc_cmdline_addr g_arg_start_offset_proc_cmdline 59 [ 144.490679] get_task_proc_cmdline_addr g_arg_start_offset_proc_cmdline 60 [ 144.490680] get_task_proc_cmdline_addr g_arg_start_offset_proc_cmdline 61 [ 144.490681] get_task_proc_cmdline_addr g_arg_start_offset_proc_cmdline 62 [ 144.490682] get_task_proc_cmdline_addr g_arg_start_offset_proc_cmdline 63 [ 144.490683] get_task_proc_cmdline_addr g_arg_start_offset_proc_cmdline 64 [ 144.490683] find cmdline offset failed

解决了吗?