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] [day] [month] [year] [list]
Date:	Thu, 9 Oct 2014 23:28:14 +0200
From:	Frans Klaver <fransklaver@...il.com>
To:	Chuck Ebbert <cebbert.lkml@...il.com>
Cc:	Marc Burkhardt <marc@...nowledge.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: acpitool - /proc/acpi/wakeup

On Thu, Oct 9, 2014 at 10:27 PM, Chuck Ebbert <cebbert.lkml@...il.com> wrote:
> On Thu, 9 Oct 2014 22:16:11 +0200
> Frans Klaver <fransklaver@...il.com> wrote:
>
>> On Thu, Oct 9, 2014 at 9:58 PM, Marc Burkhardt <marc@...nowledge.org> wrote:
>> >
>> >
>> >>On Thu, Oct 9, 2014 at 9:42 PM, Marc Burkhardt <marc@...nowledge.org>
>> >>wrote:
>> >>> I upgraded from 3.10 on that machine. 3.12 didn't work for me due to
>> >>a hibernation bug. The rest was left out...  :/
>> >>
>> >>If you still have the 3.12 kernel around, could you test if acpitool
>> >>-e worked there?
>> >
>> > Let me ask you a question: does it make sense to test 3.12 again because you know there's something changed regarding /proc/acpi/... or because it's the kernel I broke up on upgrading?
>>
>> Never mind. It broke after 3.14. I'll bisect.
>>
>
> The below patch fixes it for me. Looks like the line sizes changed
> and some are now exactly the right length to make it loop forever
> reading /proc/acpi/wakeup:
>
>
> --- a/src/acpitool.cpp
> +++ b/src/acpitool.cpp
> @@ -417,7 +417,7 @@ int Do_Fan_Info(int verbose)
>  int Show_WakeUp_Devices(int verbose)
>  {
>      ifstream file_in;
> -    char *filename, str[40];
> +    char *filename, str[80];
>
>      filename = "/proc/acpi/wakeup";
>
> @@ -438,13 +438,13 @@ int Show_WakeUp_Devices(int verbose)
>      }
>      else
>      {
> -       file_in.getline(str, 40);           // first line are just headers //
> +       file_in.getline(str, 80);           // first line are just headers //
>         cout<<"   "<<str<<endl;
>         cout<<"  ---------------------------------------"<<endl;
>          int t = 1;
>         while(!file_in.eof())
>         {
> -           file_in.getline(str, 40);
> +           file_in.getline(str, 80);
>             if (strlen(str)!=0)                     // avoid printing last empty line //
>             {
>                 cout<<"  "<<t<<". "<<str<<endl;

Oh my. Why not use the std::string version of getline?

I doubt we should count this as "breaking userspace"..
--
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ