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] [thread-next>] [day] [month] [year] [list]
Message-ID: <5503434F.8050800@gmail.com>
Date:	Fri, 13 Mar 2015 22:06:39 +0200
From:	Giedrius Statkevičius 
	<giedrius.statkevicius@...il.com>
To:	Greg KH <gregkh@...uxfoundation.org>
CC:	lidza.louina@...il.com, markh@...pro.net,
	devel@...verdev.osuosl.org, driverdev-devel@...uxdriverproject.org,
	linux-kernel@...r.kernel.org, dan.carpenter@...cle.com
Subject: Re: [PATCH v2] dgnc: Don't save boards in memory that have failed
 to initialize

Hi Greg,

On 2015.03.12 12:08, Greg KH wrote:
> On Mon, Mar 09, 2015 at 06:29:38PM +0200, Giedrius Statkevičius wrote:
>> Remove BOARD_FAILED and don't save dgnc_boards which failed to
>> initialize.
>>
>> Assign the result of kzalloc() to brd in dgnc_found_board() and only put
>> it in the dgnc_Board[] if it successfully initializes. Also, remove
>> BOARD_FAILED enum and all ifs that check for it. Finally, remove one
>> final place where state was set to BOARD_FAILED which was even redundant
>> before this patch.
>>
>> Signed-off-by: Giedrius Statkevičius <giedrius.statkevicius@...il.com>
>> ---
>> v2: Remove "brd = dgnc_Board[dgnc_NumBoards];" line which I forgot to do
>> in the first version
>>
>>  drivers/staging/dgnc/dgnc_driver.c | 20 ++------------------
>>  drivers/staging/dgnc/dgnc_driver.h |  3 +--
>>  drivers/staging/dgnc/dgnc_mgmt.c   |  5 +----
>>  drivers/staging/dgnc/dgnc_tty.c    |  8 --------
>>  4 files changed, 4 insertions(+), 32 deletions(-)
>>
>> diff --git a/drivers/staging/dgnc/dgnc_driver.c b/drivers/staging/dgnc/dgnc_driver.c
>> index fa1ee79..075727d 100644
>> --- a/drivers/staging/dgnc/dgnc_driver.c
>> +++ b/drivers/staging/dgnc/dgnc_driver.c
>> @@ -401,8 +401,7 @@ static int dgnc_found_board(struct pci_dev *pdev, int id)
>>  	unsigned long flags;
>>  
>>  	/* get the board structure and prep it */
>> -	dgnc_Board[dgnc_NumBoards] = kzalloc(sizeof(*brd), GFP_KERNEL);
>> -	brd = dgnc_Board[dgnc_NumBoards];
>> +	brd = kzalloc(sizeof(*brd), GFP_KERNEL);
> 
> You've done a great job here, but...
> 
> Yeah, sorry...
> 
> I really want to see this whole "static list of boards/cards" go away.
> There should not be any need for that in any in-kernel driver.  Your
> patch here is a sign that things are really wrong with this whole static
> array mess.
> 
> So could you do that instead?  I don't want to take patches around this
> whole "board state" mess anymore, as it should all not be needed at all.
> 
> If you need pointers on what needs to be done here, just let me know.
> 
> thanks,
> 
> greg k-h
> 

Hmm,
The only thing I thought of that is relevant is that the one big
file/ioctl that handles getting info of any board could be split into
many and each could return information about that own board
(DIGI_GET_NI_INFO => get non-intelligent state info and DIGI_GETBD =>
get board info). The last ioctl that returns number of boards could be
deduced from special files (of each board) in the system.

I don't know how we can avoid a list of boards because we create sysfs
files for each board, register each board with tty core and poll all the
boards each 20ms.

Could you elaborate more, give some more info?

-- 
Thanks,
Giedrius
--
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