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>] [day] [month] [year] [list]
Message-ID: <CBDC0F1D.ED30%vikas.chaudhary@qlogic.com>
Date:	Fri, 18 May 2012 02:29:39 -0700
From:	Vikas Chaudhary <vikas.chaudhary@...gic.com>
To:	James Bottomley <James.Bottomley@...senPartnership.com>,
	Mike Christie <michaelc@...wisc.edu>,
	linux-kernel <linux-kernel@...r.kernel.org>
CC:	"linux-scsi@...r.kernel.org" <linux-scsi@...r.kernel.org>,
	Lalit Chandivade <lalit.chandivade@...gic.com>,
	Ravi Anand <ravi.anand@...gic.com>,
	Tej Parkash <tej.parkash@...gic.com>,
	Shyam Sundar <shyam.sundar@...gic.com>
Subject: Re: [PATCH 5/6] qla4xxx: Capture minidump for ISP82XX on firmware
 failure



-----Original Message-----
From: James Bottomley <James.Bottomley@...senPartnership.com>
To: Mike Christie <michaelc@...wisc.edu>
Cc: Admin <vikas.chaudhary@...gic.com>, scsi <linux-scsi@...r.kernel.org>,
Lalit Chandivade <lalit.chandivade@...gic.com>, Ravi Anand
<ravi.anand@...gic.com>, Tej Parkash <tej.parkash@...gic.com>, Shyam
Sundar <shyam.sundar@...gic.com>
Subject: Re: [PATCH 5/6] qla4xxx: Capture minidump for ISP82XX on firmware
failure

>On Fri, 2012-04-27 at 11:05 -0500, Mike Christie wrote:
>> On 04/24/2012 12:32 AM, vikas.chaudhary@...gic.com wrote:
>> > +
>> > +static ssize_t
>> > +qla4_8xxx_sysfs_write_fw_dump(struct file *filep, struct kobject
>>*kobj,
>> > +                        struct bin_attribute *ba, char *buf, loff_t off,
>> > +                        size_t count)
>> > +{
>> > +  struct scsi_qla_host *ha =
>>to_qla_host(dev_to_shost(container_of(kobj,
>> > +                                         struct device, kobj)));
>> > +  uint32_t dev_state;
>> > +  int reading;
>> > +
>> > +  if (!is_qla8022(ha))
>> > +          return -EINVAL;
>> > +
>> > +  if (off != 0)
>> > +          return 0;
>> > +
>> > +  reading = simple_strtol(buf, NULL, 10);
>>
>> I think we are supposed to be using kstrtol now.
>
>We are.  Checkpatch even warns about this, please fix.

We have posted updated patch to scsi-list here:-
http://marc.info/?l=linux-scsi&m=133733192809849&w=2

In 1st version of patch we used simple_strtol() as sysfs attribute buffer
is not NULL terminated string and
it include some garbage characters because of this kstrtol() fails.

If I write "5" to sysfs attribute I am getting following string in buf:-

-------------------------------------------
May 18 12:07:54 magana kernel: buf: 5
May 18 12:07:54 magana kernel: ter-|   Receive
                   |  Transmit
May 18 12:07:54 magana kernel: face |bytes    packets errs drop fifo frame
compressed multicast|bytes    packets errs drop fifo colls carrier
compressed
May 18 12:07:54 magana kernel:  eth2:  520166    5418    0    0    0     0
         0       325   393879    1978    0    0    0     0       0
 0
May 18 12:07:54 magana kernel:  eth3:       0       0    0    0    0     0
         0         0        0       0    0    0    0     0       0
 0
May 18 12:07:54 magana kernel:  eth4: 1398425   18696    0    0    0     0
         0         0     7631      39    0    0    0     0       0
 0
May 18 12:07:54 magana kernel:  eth5: 1394451   18678    0    0    0     0
         0         0     6427      30    0    0    0     0       0
 0
May 18 12:07:54 magana kernel:    lo:  361420    1082    0    0    0     0
         0         0   361420    1082    0    0    0     0       0
 0
May 18 12:07:54 magana kernel: virbr0-nic:       0       0    0    0    0
   0          0         0        0       0    0    0    0     0       0
      0
May 18 12:07:54 magana kernel: virbr0:       0       0    0    0    0
0          0         0        0
-------------------------------------------

As we are getting garbage characters after "5", kstrtol() fails but
simple_strtol() works well.

I posted email for same to scsi-list here:-
http://marc.info/?l=linux-scsi&m=133612575603304&w=2

For now in updated patch I am writing "0" at sysfs attribute buf[1] as we
are interested only in buf[0] and after this change kstrtol() works well.

I am interested to know if the behavior of sysfs attribute is correct or
is it an issue?




This message and any attached documents contain information from QLogic Corporation or its wholly-owned subsidiaries that may be confidential. If you are not the intended recipient, you may not read, copy, distribute, or use this information. If you have received this transmission in error, please notify the sender immediately by reply e-mail and then delete this message.

--
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