Code Monkey home page Code Monkey logo

Comments (4)

hpo14 avatar hpo14 commented on July 28, 2024

i add log on

main.c :: write_range()
    for (i = res->start; i <= res->end; i += is) {
        DBG("write_range: i = 0x%lx", (long) i);

and get this log

[LiME] write_range: i = 0x1d43e000
[LiME] write_range: i = 0x1d43f000
[LiME] write_range: i = 0x1d440000
[LiME] PAGE_SIZE = 4096, (res->end - i + 1) = 45875200, is = 4096, s = -14
[LiME] Error writing page: vaddr dd440000 ret: -14

i checked vfs_write()
return code -14 means -EFAILT

523 ssize_t vfs_write(struct file *file, const char __user *buf, size_t count, loff_t *pos)
524 {
525         ssize_t ret;
526 
527         if (!(file->f_mode & FMODE_WRITE))
528                 return -EBADF;
529         if (!(file->f_mode & FMODE_CAN_WRITE))
530                 return -EINVAL;
531         if (unlikely(!access_ok(VERIFY_READ, buf, count)))
532                 return -EFAULT;

so, device memory has some read restrict ?

from lime.

jiuweigui avatar jiuweigui commented on July 28, 2024

I'm experiencing exact same problem. When I insmod the module it does write at least a partial memory dump but it will give out (Bad address) at some point and stop writing. All the memory dumps I've been able to make are the exact same size 375M (392429632) even though the device has a lot more memory available (Samsung Galaxy Note 3 with CM-12.1-userdebug). I've tried to dump at least 5-6 times after different periods of use and every time the dump size is identical despite the usage amount.

root@hltexx:/sdcard/Download # insmod lime-goldfish.ko "path=/sdcard/Download/ram3.lime format=lime"
insmod: init_module 'lime-goldfish.ko' failed (Bad address)

My build environment differs a bit:

- ubuntu 14.04
- 3.13.0-57-generic #95-Ubuntu SMP Fri Jun 19 09:28:15 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux

KDIR_GOLD := /home/<username>/android/system/out/target/product/hlte/obj/KERNEL_OBJ/
CCPATH := /home/<username>/android/arm-eabi-4.6/bin
$(MAKE) ARCH=arm CROSS_COMPILE=$(CCPATH)/arm-eabi- -C $(KDIR_GOLD) M=$(PWD) modules (<- I've tried this with and without EXTRA_CFLAGS=-fno-pic but didn't notice any difference)

Device and module info:

~$ adb shell uname -a
Linux localhost 3.4.0-g7db381d-dirty #1 SMP PREEMPT Mon Jul 13 02:26:19 EEST 2015 armv7l GNU/Linux

~$ adb shell modinfo /sdcard/Download/lime-goldfish.ko
filename:       /sdcard/Download/lime-goldfish.ko
license:        GPL
depends:
vermagic:       3.4.0-g7db381d-dirty SMP preempt mod_unload mod versions ARMv7
~$

Funny thing is that when I use volatility I can see that the lime.ko is loaded at least for some time (obviously since it does write a partial dump):

$ python vol.py --profile LinuxGoldfish-3_4_0ARM -f ./ram3.lime linux_lsmod -P
Volatility Foundation Volatility Framework 2.4
bf002000 lime 20213
    format=lime
    dio=0
    path=/sdcard/Download/ram3.lime

Also noticed this one every time i'm trying to insmod (each are from a single insmod attempt):

<6>[165714.469813] insmod (9446): undefined instruction: pc=b6e2abc8
<6>[166004.430517] insmod (9487): undefined instruction: pc=b6e0abc8
<6>[166011.337362] insmod (9489): undefined instruction: pc=b6dc3bc8
<6>[166032.809413] insmod (9492): undefined instruction: pc=b6e62bc8
<6>[166056.799305] insmod (9503): undefined instruction: pc=b6e2fbc8
<6>[166177.938787] insmod (9541): undefined instruction: pc=b6e58bc8
<6>[167271.448792] insmod (9570): undefined instruction: pc=b6e81bc8
<6>[167369.909499] insmod (9582): undefined instruction: pc=b6e66bc8
<6>[167570.530328] insmod (9608): undefined instruction: pc=b6de6bc8
<6>[167625.469710] insmod (9642): undefined instruction: pc=b6e39bc8

from lime.

jtsylve avatar jtsylve commented on July 28, 2024

I've got a fix for this in progress. Hopefully I'll get it out this weekend.

from lime.

jtsylve avatar jtsylve commented on July 28, 2024

This should be fixed in commit 17e7502

from lime.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.