public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Anton Blanchard <anton@samba.org>
To: William Lee Irwin III <wli@holomorphy.com>,
	torvalds@transmeta.com, linux-kernel@vger.kernel.org,
	bjorn_helgaas@hp.com
Subject: Re: [PATCH] Fix CPU bitmask truncation
Date: Sat, 21 Dec 2002 09:57:14 +1100	[thread overview]
Message-ID: <20021220225714.GA10263@krispykreme> (raw)
In-Reply-To: <20021220103028.GB9704@holomorphy.com>


> Linus, this is the 2.5.x version of the same patch originally by Bjorn
> for 2.4.x. This fixes an entire class of critical 64-bit bugs.
> 
> Against 2.5.52-bk as of 2:25AM 20 Dec 2002. Please apply.

Here's one in 2.5, found when adding 64 CPU support to ppc64.

Anton

===== kernel/module.c 1.31 vs edited =====
--- 1.31/kernel/module.c	Mon Dec  2 17:44:11 2002
+++ edited/kernel/module.c	Tue Dec 17 10:29:27 2002
@@ -210,7 +210,7 @@
 	struct sched_param param = { .sched_priority = MAX_RT_PRIO-1 };
 	setscheduler(current->pid, SCHED_FIFO, &param);
 #endif
-	set_cpus_allowed(current, 1 << (unsigned long)cpu);
+	set_cpus_allowed(current, 1UL << (unsigned long)cpu);
 
 	/* Ack: we are alive */
 	atomic_inc(&stopref_thread_ack);
@@ -271,7 +271,7 @@
 
 	/* FIXME: racy with set_cpus_allowed. */
 	old_allowed = current->cpus_allowed;
-	set_cpus_allowed(current, 1 << (unsigned long)cpu);
+	set_cpus_allowed(current, 1UL << (unsigned long)cpu);
 
 	atomic_set(&stopref_thread_ack, 0);
 	stopref_num_threads = 0;

  parent reply	other threads:[~2002-12-20 22:52 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-12-16 19:13 [PATCH] Fix CPU bitmask truncation Bjorn Helgaas
2002-12-20 10:30 ` William Lee Irwin III
2002-12-20 11:15   ` William Lee Irwin III
2002-12-20 17:00     ` Bjorn Helgaas
2002-12-25 21:43       ` Alan Cox
2002-12-25 21:54         ` Linus Torvalds
2002-12-20 12:17   ` Andreas Schwab
2002-12-20 17:12     ` William Lee Irwin III
2002-12-20 18:23     ` Jeremy Fitzhardinge
2002-12-20 20:00       ` Andreas Schwab
2002-12-20 22:57   ` Anton Blanchard [this message]
2002-12-20 23:36     ` William Lee Irwin III
2002-12-20 23:42       ` Anton Blanchard

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20021220225714.GA10263@krispykreme \
    --to=anton@samba.org \
    --cc=bjorn_helgaas@hp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@transmeta.com \
    --cc=wli@holomorphy.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox