Software Archive
Read-only legacy content
17061 Discussions

mpss-daemon-3.2 bug

Antonio_B_
Beginner
317 Views

All,

Just want to signal this bug we discover yesterday together with Akshay Giridhar Ravichandran (akshay87ATvt.edu).

We are not using the kernel shipped with the MPSS but the one available at http://mpssvt.sf.net. Sometimes micctrl -b is wrongly returns "is not a k1om image" error. So we dig into mpss-daemon-3.2 package and we figure out that there is an error in the code. We propose a quick fix to the problem in the following.

The file to be updated is:
mpss-daemon-3.2/libmpssconfig/verify_bzimage.c

The function to be modified is:
int verify_bzImage(struct mpss_env *menv, char *name, char *tag)

Previous code:
if ((found = memchr(buf, 0x1f, num)) != NULL)
                        if (((unsigned char)found[1] == 0x8b) && (found[2] == 0x8))
                                goto write_tmpfile;

New code:
int offset =0;

recheck:
        if ((found = memchr(buf+offset, 0x1f, num-offset)) != NULL)
                if (((unsigned char)found[1] == 0x8b) && (found[2] == 0x8))
                        goto write_tmpfile;
                else
                        if ((unsigned long) found < (unsigned long)(buf +4096)){
                                offset= (unsigned int) found - (unsigned int) buf +1;
                                goto recheck;
 

Antonio

 

0 Kudos
0 Replies
Reply