mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Pavel Machek <pavel@ucw.cz>
To: dean gaudet <dean@arctic.org>
Cc: linux-kernel@vger.kernel.org, len.brown@intel.com
Subject: Re: [PATCH] off-by-1 in kernel/power/main.c
Date: Sat, 22 Apr 2006 23:37:55 +0200	[thread overview]
Message-ID: <20060422213754.GA23981@elf.ucw.cz> (raw)
In-Reply-To: <Pine.LNX.4.64.0604212055390.24100@twinlark.arctic.org>

Hi!

> there's an off-by-1 in 2.6.16.9 (and 2.6.17-rc2) 
> kernel/power/main.c:state_store() ... if your kernel just happens to have 
> some non-zero data at pm_states[PM_SUSPEND_MAX] (i.e. one past the end of 
> the array) then it'll let you write anything you want to /sys/power/state 
> and in response the box will enter S5.
> 
> i randomly discovered this because i really wanted to put my box into S5 
> (for wake on lan) and tried "echo off >/sys/power/state" and was quite 
> happy that the box entered S5... happy until i compiled a different kernel 
> and this S5 trick stopped working :)
> 
> anyhow, this begs the question, what is the correct way to get a box to 
> shutdown into s5?  on a fc4 box i have here it does that happily, but 
> ubuntu boxes don't seem to go into s5... and i couldn't figure out from 
> fc4 patches if they'd changed anything in this area.  pointers 
> appreciated.
> 
> btw i can whip up a patch making "off" a valid value for /sys/power/state 
> ...

Looks okay to me. Can you add acked-by: Pavel Machek and mail it to
akpm?

Valid way to power off machine is by shutdown -o now, and there's a
syscall to do that. It should not be done by /sys/power/state.

								Pavel

-- 
Thanks for all the (sleeping) penguins.

  reply	other threads:[~2006-04-22 21:38 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-04-22  4:05 dean gaudet
2006-04-22 21:37 ` Pavel Machek [this message]
     [not found]   ` <Pine.LNX.4.64.0604231958020.22072@twinlark.arctic.org>
2006-04-24  7:57     ` Pavel Machek
2006-04-25 21:38       ` dean gaudet
2006-04-25 21:46         ` Pavel Machek

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=20060422213754.GA23981@elf.ucw.cz \
    --to=pavel@ucw.cz \
    --cc=dean@arctic.org \
    --cc=len.brown@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    /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

all inboxes | Powered by JetHome®