lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Sun, 11 Mar 2012 12:09:46 +0800
From:	Hillf Danton <dhillf@...il.com>
To:	Fawzi Mohamed <fawzi@....ch>
Cc:	linux-kernel@...r.kernel.org,
	Thomas Dargel <td@...mie.hu-berlin.de>
Subject: Re: bug in thread_group_times (+possible patch)

Hello Fawzi,

On Sun, Mar 11, 2012 at 7:11 AM, Fawzi Mohamed <fawzi@....ch> wrote:
> Hi,
>
> a friend of mine asked me about a kernel crash that he was having on a linux cluster (always after long compute intensive task).
> I found the bug causing it, and patched it (in an imperfect way), and as I have seen that in the current git the bug is still there, I am writing it here.
> I am not into kernel development, so I did not subscribe to the list, please CC me if you want me to answer.
> Sorry if this is not the correct way, but I hope this might help to squash just another little bug.
>
> Now the bug is in kernel/sched/core.c in thread_group_times which if CONFIG_VIRT_CPU_ACCOUNTING is not defined looks like this
>
> void thread_group_times(struct task_struct *p, cputime_t *ut, cputime_t *st)
> {
>        struct signal_struct *sig = p->signal;
>        struct task_cputime cputime;
>        cputime_t rtime, utime, total;
>
>        thread_group_cputime(p, &cputime);
>
>        total = cputime.utime + cputime.stime;
>        rtime = nsecs_to_cputime(cputime.sum_exec_runtime);
>
>        if (total) {
>                u64 temp = (__force u64) rtime;
>
>                temp *= (__force u64) cputime.utime;

Would you please try the tiny change?

-                do_div(temp, (__force u32) total);
+                temp = div64_u64(temp, (__force u64) total);

>                utime = (__force cputime_t) temp;
>        } else
>                utime = rtime;
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists