Re: [PATCH v2] scsi: 3w-xxxx: fix a missing-check bug

2018-05-07 Thread adam radford
ile) > > dprintk(KERN_WARNING "3w-: tw_ioctl_open()\n"); > > + if (!capable(CAP_SYS_ADMIN)) > + return -EACCES; > + > minor_number = iminor(inode); > if (minor_number >= tw_device_extension_count) > return -ENODEV; > -- > 2.7.4 > Acked-by: Adam Radford <aradf...@gmail.com>

Re: [PATCH v2] scsi: 3w-xxxx: fix a missing-check bug

2018-05-07 Thread adam radford
intk(KERN_WARNING "3w-: tw_ioctl_open()\n"); > > + if (!capable(CAP_SYS_ADMIN)) > + return -EACCES; > + > minor_number = iminor(inode); > if (minor_number >= tw_device_extension_count) > return -ENODEV; > -- > 2.7.4 > Acked-by: Adam Radford

Re: [PATCH v2] scsi: 3w-9xxx: fix a missing-check bug

2018-05-07 Thread adam radford
mber; > int retval = TW_IOCTL_ERROR_OS_ENODEV; > > + if (!capable(CAP_SYS_ADMIN)) { > + retval = -EACCES; > + goto out; > + } > + > minor_number = iminor(inode); > if (minor_number >= twa_device_extension_count) > goto out; > -- > 2.7.4 > Acked-by: Adam Radford <aradf...@gmail.com>

Re: [PATCH v2] scsi: 3w-9xxx: fix a missing-check bug

2018-05-07 Thread adam radford
NODEV; > > + if (!capable(CAP_SYS_ADMIN)) { > + retval = -EACCES; > + goto out; > + } > + > minor_number = iminor(inode); > if (minor_number >= twa_device_extension_count) > goto out; > -- > 2.7.4 > Acked-by: Adam Radford

Re: [PATCH] scsi: 3w-xxxx: fix a missing-check bug

2018-05-07 Thread adam radford
On Sat, May 5, 2018 at 10:48 PM, Wenwen Wang wrote: > In tw_chrdev_ioctl(), the length of the data buffer is firstly copied from > the userspace pointer 'argp' and saved to the kernel object > 'data_buffer_length'. Then a security check is performed on it to make sure > that the

Re: [PATCH] scsi: 3w-xxxx: fix a missing-check bug

2018-05-07 Thread adam radford
On Sat, May 5, 2018 at 10:48 PM, Wenwen Wang wrote: > In tw_chrdev_ioctl(), the length of the data buffer is firstly copied from > the userspace pointer 'argp' and saved to the kernel object > 'data_buffer_length'. Then a security check is performed on it to make sure > that the length is not

Re: [PATCH] scsi: 3w-9xxx: fix a missing-check bug

2018-05-07 Thread adam radford
On Sat, May 5, 2018 at 8:43 PM, Wenwen Wang wrote: > In twa_chrdev_ioctl(), the ioctl driver command is firstly copied from the > userspace pointer 'argp' and saved to the kernel object 'driver_command'. > Then a security check is performed on the data buffer size indicated by >

Re: [PATCH] scsi: 3w-9xxx: fix a missing-check bug

2018-05-07 Thread adam radford
On Sat, May 5, 2018 at 8:43 PM, Wenwen Wang wrote: > In twa_chrdev_ioctl(), the ioctl driver command is firstly copied from the > userspace pointer 'argp' and saved to the kernel object 'driver_command'. > Then a security check is performed on the data buffer size indicated by > 'driver_command',

Re: [PATCH] scsi: 3ware: fix a missing-check bug

2018-05-07 Thread adam radford
On Sat, May 5, 2018 at 10:50 PM, Wenwen Wang wrote: > In twl_chrdev_ioctl(), the ioctl driver command is firstly copied from the > userspace pointer 'argp' and saved to the kernel object 'driver_command'. > Then a security check is performed on the data buffer size indicated by

Re: [PATCH] scsi: 3ware: fix a missing-check bug

2018-05-07 Thread adam radford
On Sat, May 5, 2018 at 10:50 PM, Wenwen Wang wrote: > In twl_chrdev_ioctl(), the ioctl driver command is firstly copied from the > userspace pointer 'argp' and saved to the kernel object 'driver_command'. > Then a security check is performed on the data buffer size indicated by >

Re: [PATCH 2/3] scsi: 3ware: use 64-bit times for FW time sync

2017-11-10 Thread adam radford
ime = (ktime_get_real_seconds() - (sys_tz.tz_minuteswest * > 60)); > + div_u64_rem(local_time - (3 * 86400), 604800, ); > + schedulertime = cpu_to_le32(schedulertime); > > memcpy(param->data, , sizeof(u32)); > > -- > 2.9.0 > Acked-by: Adam Radford <aradf...@gmail.com>

Re: [PATCH 2/3] scsi: 3ware: use 64-bit times for FW time sync

2017-11-10 Thread adam radford
12:00AM */ > - do_gettimeofday(); > - local_time = (u32)(utc.tv_sec - (sys_tz.tz_minuteswest * 60)); > - schedulertime = local_time - (3 * 86400); > - schedulertime = cpu_to_le32(schedulertime % 604800); > + local_time = (ktime_get_real_seconds() - (sys_tz.tz_minuteswest * > 60)); > + div_u64_rem(local_time - (3 * 86400), 604800, ); > + schedulertime = cpu_to_le32(schedulertime); > > memcpy(param->data, , sizeof(u32)); > > -- > 2.9.0 > Acked-by: Adam Radford

Re: [PATCH 1/3] scsi: 3ware: fix 32-bit time calculations

2017-11-10 Thread adam radford
ent->time_stamp_sec overflows in y2106 */ > + local_time = (u32)(ktime_get_real_seconds() - (sys_tz.tz_minuteswest > * 60)); > event->time_stamp_sec = local_time; > event->aen_code = aen; > event->retrieved = TW_AEN_NOT_RETRIEVED; > -- > 2.9.0 > Acked-by: Adam Radford <aradf...@gmail.com>

Re: [PATCH 1/3] scsi: 3ware: fix 32-bit time calculations

2017-11-10 Thread adam radford
+ local_time = (u32)(ktime_get_real_seconds() - (sys_tz.tz_minuteswest > * 60)); > event->time_stamp_sec = local_time; > event->aen_code = aen; > event->retrieved = TW_AEN_NOT_RETRIEVED; > -- > 2.9.0 > Acked-by: Adam Radford

Re: [PATCH 3/3] scsi: 3w-9xxx: rework lock timeouts

2017-11-10 Thread adam radford
-666,7 +666,7 @@ typedef struct TAG_TW_Device_Extension { > unsigned char event_queue_wrapped; > unsigned interror_sequence_id; > int ioctl_sem_lock; > - u32 ioctl_msec; > + ktime_t ioctl_time; > int chrdev_request_id; > wait_queue_head_t ioctl_wqueue; > struct mutexioctl_lock; > -- > 2.9.0 > Looks good... Thanks for this fix! Acked-by: Adam Radford <aradf...@gmail.com>

Re: [PATCH 3/3] scsi: 3w-9xxx: rework lock timeouts

2017-11-10 Thread adam radford
Device_Extension { > unsigned char event_queue_wrapped; > unsigned interror_sequence_id; > int ioctl_sem_lock; > - u32 ioctl_msec; > + ktime_t ioctl_time; > int chrdev_request_id; > wait_queue_head_t ioctl_wqueue; > struct mutexioctl_lock; > -- > 2.9.0 > Looks good... Thanks for this fix! Acked-by: Adam Radford

Re: 4.6.4, 3w_sas: timeout too small?

2016-10-18 Thread adam radford
>> Oct 16 06:41:33 nasl003b kernel: [4903207.577484] 3w-sas: scsi0: ERROR: >> (0x06:0x000D): Microcontroller Error: clearing. Microcontroller Error = FW crashed and will be reset on the next I/O timeout or ioctl() timeout, whichever happens first. It could be the iSCSI target code or initiator

Re: 4.6.4, 3w_sas: timeout too small?

2016-10-18 Thread adam radford
>> Oct 16 06:41:33 nasl003b kernel: [4903207.577484] 3w-sas: scsi0: ERROR: >> (0x06:0x000D): Microcontroller Error: clearing. Microcontroller Error = FW crashed and will be reset on the next I/O timeout or ioctl() timeout, whichever happens first. It could be the iSCSI target code or initiator

Re: [PATCH] scsi: 3w-9xxx.c: Cleaning up missing null-terminate in conjunction with strncpy

2014-12-22 Thread adam radford
On Mon, Dec 22, 2014 at 2:52 PM, Rickard Strandqvist wrote: > 2014-08-01 0:19 GMT+02:00 adam radford : >> On Sun, Jul 27, 2014 at 8:11 AM, Rickard Strandqvist >> wrote: >>> Replacing strncpy with strlcpy to avoid strings that lacks null terminate. >>> And use t

Re: [PATCH] scsi: 3w-9xxx.c: Cleaning up missing null-terminate in conjunction with strncpy

2014-12-22 Thread adam radford
On Mon, Dec 22, 2014 at 2:52 PM, Rickard Strandqvist rickard_strandqv...@spectrumdigital.se wrote: 2014-08-01 0:19 GMT+02:00 adam radford aradf...@gmail.com: On Sun, Jul 27, 2014 at 8:11 AM, Rickard Strandqvist rickard_strandqv...@spectrumdigital.se wrote: Replacing strncpy with strlcpy

Re: [PATCH] scsi: 3w-9xxx.c: Cleaning up missing null-terminate in conjunction with strncpy

2014-07-31 Thread adam radford
.driver_build_high = TW_CURRENT_DRIVER_BUILD; > -- > 1.7.10.4 > > -- > To unsubscribe from this list: send the line "unsubscribe linux-kernel" in > the body of a message to majord...@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.

Re: [PATCH] scsi: 3w-9xxx.c: Cleaning up missing null-terminate in conjunction with strncpy

2014-07-31 Thread adam radford
-by: Adam Radford aradf...@gmail.com -Adam -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/

Re: [PATCH 13/39] megaraid: simplify internal command handling

2014-03-20 Thread adam radford
_mask); > - scsi_put_host_cmd_pool(gfp_mask); > -} > -EXPORT_SYMBOL(scsi_free_command); > - > -/** > * scsi_setup_command_freelist - Setup the command freelist for a scsi host. > * @shost: host to allocate the freelist for. > * > diff --git a/include/sc

Re: [PATCH 13/39] megaraid: simplify internal command handling

2014-03-20 Thread adam radford
/ Christoph/James, I have reviewed this patch, and it looks good to me. Please consider this ACK'd by the Megaraid driver team. Acked-by: Adam Radford aradf...@gmail.com -Adam -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord

Re: [PATCH 0/3] [SCSI] megaraid: Remove local (struct pci_dev) pdev's

2013-07-22 Thread adam radford
On Tue, Jul 9, 2013 at 11:10 PM, James Bottomley wrote: > On Tue, 2013-07-09 at 15:12 -0700, adam radford wrote: >> On Tue, Jul 9, 2013 at 2:18 PM, James Bottomley >> > Adam, you do drive by coding on this for LSI ... ack or reject, please. > >> I have just now located

Re: [PATCH 0/3] [SCSI] megaraid: Remove local (struct pci_dev) pdev's

2013-07-22 Thread adam radford
On Tue, Jul 9, 2013 at 11:10 PM, James Bottomley james.bottom...@hansenpartnership.com wrote: On Tue, 2013-07-09 at 15:12 -0700, adam radford wrote: On Tue, Jul 9, 2013 at 2:18 PM, James Bottomley Adam, you do drive by coding on this for LSI ... ack or reject, please. I have just now located

Re: [PATCH 0/3] [SCSI] megaraid: Remove local (struct pci_dev) pdev's

2013-07-09 Thread adam radford
On Tue, Jul 9, 2013 at 2:18 PM, James Bottomley wrote: > On Tue, 2013-07-09 at 14:39 -0600, Myron Stowe wrote: >> Is the "megaraid" driver still actively used and maintained? I originally >> posted this series on 06.07.2013 and after receiving no comments, pinged >> the list again on 06.17.2013

Re: [PATCH 0/3] [SCSI] megaraid: Remove local (struct pci_dev) pdev's

2013-07-09 Thread adam radford
On Tue, Jul 9, 2013 at 2:18 PM, James Bottomley james.bottom...@hansenpartnership.com wrote: On Tue, 2013-07-09 at 14:39 -0600, Myron Stowe wrote: Is the megaraid driver still actively used and maintained? I originally posted this series on 06.07.2013 and after receiving no comments, pinged

Re: "WRITE SAME failed. Manually zeroing" with 3w-xxxx driver

2013-05-21 Thread adam radford
eration is queued. This will cause the SCSI layer to stop issuing the > offending command. > > Reported-by: Florian Westphal > CC: adam radford > Signed-off-by: Martin K. Petersen > > diff --git a/drivers/scsi/3w-.c b/drivers/scsi/3w-.c > index 56662ae..b9276d1 100644

Re: WRITE SAME failed. Manually zeroing with 3w-xxxx driver

2013-05-21 Thread adam radford
...@strlen.de CC: adam radford aradf...@gmail.com Signed-off-by: Martin K. Petersen martin.peter...@oracle.com diff --git a/drivers/scsi/3w-.c b/drivers/scsi/3w-.c index 56662ae..b9276d1 100644 --- a/drivers/scsi/3w-.c +++ b/drivers/scsi/3w-.c @@ -216,6 +216,7 @@ #include scsi

Re: [patch,v3,repost 07/10] megaraid_sas: use scsi_host_alloc_node

2012-12-03 Thread adam radford
sizeof(struct megasas_instance), > + dev_to_node(>dev)); > > if (!host) { > printk(KERN_DEBUG "megasas: scsi_host_alloc failed\n"); Acked-by: Adam Radford -- To unsubscribe from this list: send the line "unsubscribe linux-

Re: [PATCH 4/6] scsi: megaraid: remove a useless call to memset().

2012-12-03 Thread adam radford
>sense_buffer, 0, > - SCSI_SENSE_BUFFERSIZE); > memcpy(cmd->scmd->sense_buffer, cmd->sense, >SCSI_SENSE_BUFFERSIZE); > cmd->scmd->result |= DRIVER_SENSE << 24; > --

Re: [PATCH 4/6] scsi: megaraid: remove a useless call to memset().

2012-12-03 Thread adam radford
); memcpy(cmd-scmd-sense_buffer, cmd-sense, SCSI_SENSE_BUFFERSIZE); cmd-scmd-result |= DRIVER_SENSE 24; -- Acked-by: Adam Radford aradf...@gmail.com -- To unsubscribe from this list: send the line unsubscribe linux

Re: [patch,v3,repost 07/10] megaraid_sas: use scsi_host_alloc_node

2012-12-03 Thread adam radford
), + dev_to_node(pdev-dev)); if (!host) { printk(KERN_DEBUG megasas: scsi_host_alloc failed\n); Acked-by: Adam Radford aradf...@gmail.com -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord

Re: [PATCH] megaraid_sas: combine kmalloc+memset into kzalloc

2012-08-24 Thread adam radford
for (i = 0; i < max_cmd; i++) { > fusion->cmd_list[i] = kmalloc(sizeof(struct > megasas_cmd_fusion), Acked-by: Adam Radford -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/

Re: [PATCH] megaraid_sas: combine kmalloc+memset into kzalloc

2012-08-24 Thread adam radford
-by: Adam Radford aradf...@gmail.com -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/

Re: [PATCH] [RFC] [SCSI] mpt fusion: add support for 0x1000/0x0055

2012-07-27 Thread adam radford
On 7/27/12, Jiri Kosina wrote: ... > > So, what is the alternative? > > The only thing I know is that it works at least in basic mode (haven't > tested performance at all). The driver for your card is a closed source driver called 'megasr'. Here is a link to the LSI download page for this

Re: [PATCH] [RFC] [SCSI] mpt fusion: add support for 0x1000/0x0055

2012-07-27 Thread adam radford
On 7/27/12, Jiri Kosina wrote: > On Sat, 21 Jul 2012, Jiri Kosina wrote: > >> The device identifies itself as >> >> 0d:05.0 SCSI storage controller: LSI Logic / Symbios Logic SAS1068 PCI-X >> Fusion-MPT SAS (rev 01) Subsystem: NEC Corporation SAS1068 >> >> and seems to be functionally compatible

Re: [PATCH] [RFC] [SCSI] mpt fusion: add support for 0x1000/0x0055

2012-07-27 Thread adam radford
On 7/27/12, Jiri Kosina jkos...@suse.cz wrote: On Sat, 21 Jul 2012, Jiri Kosina wrote: The device identifies itself as 0d:05.0 SCSI storage controller: LSI Logic / Symbios Logic SAS1068 PCI-X Fusion-MPT SAS (rev 01) Subsystem: NEC Corporation SAS1068 and seems to be functionally compatible

Re: [PATCH] [RFC] [SCSI] mpt fusion: add support for 0x1000/0x0055

2012-07-27 Thread adam radford
On 7/27/12, Jiri Kosina jkos...@suse.cz wrote: ... So, what is the alternative? The only thing I know is that it works at least in basic mode (haven't tested performance at all). The driver for your card is a closed source driver called 'megasr'. Here is a link to the LSI download page for

Re: Kernel crash with lspci -vv and SAS Controller LSI Logic / Symbios Logic MegaRAID SAS 9240

2012-07-18 Thread adam radford
On 7/18/12, stepping stone GmbH wrote: ... > > a tail of lspci -vv http://pastebin.com/kjh8ig9q > PCI Config reads from lspci -vvv don't go through the megaraid_sas driver itself. It looks like your system hung up while trying to do a PCI Config read of Capabilities 0xd0: VPD (Vital Product

Re: Kernel crash with lspci -vv and SAS Controller LSI Logic / Symbios Logic MegaRAID SAS 9240

2012-07-18 Thread adam radford
On 7/18/12, stepping stone GmbH supp...@stepping-stone.ch wrote: ... a tail of lspci -vv http://pastebin.com/kjh8ig9q PCI Config reads from lspci -vvv don't go through the megaraid_sas driver itself. It looks like your system hung up while trying to do a PCI Config read of Capabilities 0xd0:

Re: Patch submission question [not in the FAQ]

2007-12-06 Thread adam radford
On Dec 5, 2007 3:36 AM, Gabriele Gorla <[EMAIL PROTECTED]> wrote: > Hello, > I have submitted a patch for the 3x- driver on > alpha several months ago to both the driver maintainer > and the linux-scsi mailing list. > I have read all the FAQ and I tried to stick to the > instructions to the

Re: Patch submission question [not in the FAQ]

2007-12-06 Thread adam radford
On Dec 5, 2007 3:36 AM, Gabriele Gorla [EMAIL PROTECTED] wrote: Hello, I have submitted a patch for the 3x- driver on alpha several months ago to both the driver maintainer and the linux-scsi mailing list. I have read all the FAQ and I tried to stick to the instructions to the letter.

Re: SCSI opcode 0x80 and 3ware Escalade 7000 ATA RAID

2005-04-15 Thread adam radford
Make sure you are are using the 3ware character ioctl interface at /dev/twe0 (dynamic major, controller number minor) for your smartmontools, not /dev/sda. i.e. smartctl -a -d 3ware,X /dev/tweY where X = port # of the drive whose information you want, Y=controller #. The old interface from

Re: SCSI opcode 0x80 and 3ware Escalade 7000 ATA RAID

2005-04-15 Thread adam radford
Make sure you are are using the 3ware character ioctl interface at /dev/twe0 (dynamic major, controller number minor) for your smartmontools, not /dev/sda. i.e. smartctl -a -d 3ware,X /dev/tweY where X = port # of the drive whose information you want, Y=controller #. The old interface from

RE: Bug in 3w-xxxx.c (Notifiers STILL broken)

2000-09-15 Thread Adam Radford
is mounted through the driver will also have this problem), i.e. DAC960.c (Mylex) and gdth.c (ICP). The fix for now is to modify kernel/sys.c, the function "notifier_chain_unregister", and remove the write_lock(_lock), and write_unlock(_lock) calls from this function and recompile your kernel

RE: Bug in 3w-xxxx.c (Notifiers STILL broken)

2000-09-15 Thread Adam Radford
mpile your kernel. -- Adam Radford Software Engineer 3ware, Inc. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Friday, September 15, 2000 12:49 AM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: Bug in 3w-.c Hi, i have discovered a problem with a