* [tty:tty-next 9/39] drivers/staging/dgrp/dgrp_tty.c:3177 dgrp_tty_init() error: potential null dereference 'nd->nd_serial_ttdriver'.
@ 2012-10-07 12:35 Fengguang Wu
2012-10-09 16:46 ` [tty:tty-next 9/39] drivers/staging/dgrp/dgrp_tty.c:3177 Bill Pemberton
2012-10-09 18:42 ` [tty:tty-next 9/39] drivers/staging/dgrp/dgrp_tty.c:3177 dgrp_tty_init() error: potential null dereference 'nd->nd_serial_ttdriver' Alan Cox
0 siblings, 2 replies; 3+ messages in thread
From: Fengguang Wu @ 2012-10-07 12:35 UTC (permalink / raw)
To: Bill Pemberton; +Cc: kernel-janitors, Greg Kroah-Hartman, linux-serial
Hi Bill,
FYI, there are new smatch warnings show up in
tree: git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty.git tty-next
head: 0c57dfcc6c1d037243c2f8fbf62eab3633326ec0
commit: 7b6d45c211a401a9bdeebfa96f8a4c811bd3eeaf [9/39] staging: dgrp: add dgrp to the build
It seems that the dgrp_dpa_ops.c ones are false warnings, while the
'potential null deference' ones are worth looking at.
+ drivers/staging/dgrp/dgrp_dpa_ops.c:377 dgrp_dpa_ioctl() warn: 'vpd' puts 516 bytes on stack
--
+ drivers/staging/dgrp/dgrp_net_ops.c:277 dgrp_input() error: we previously assumed 'ld' could be null (see line 238)
+ drivers/staging/dgrp/dgrp_net_ops.c:3159 dgrp_receive() error: strncpy() 'nd->nd_ps_desc' too small (101 vs 988)
+ drivers/staging/dgrp/dgrp_net_ops.c:3160 dgrp_receive() error: buffer overflow 'nd->nd_ps_desc' 101 <= 988
--
+ drivers/staging/dgrp/dgrp_specproc.c:273 register_proc_table() error: we previously assumed 'table->child' could be null (see line 263)
--
+ drivers/staging/dgrp/dgrp_tty.c:2341 dgrp_set_custom_speed() info: ignoring unreachable code.
+ drivers/staging/dgrp/dgrp_tty.c:3177 dgrp_tty_init() error: potential null dereference 'nd->nd_serial_ttdriver'. (alloc_tty_driver returns null)
+ drivers/staging/dgrp/dgrp_tty.c:3236 dgrp_tty_init() error: potential null dereference 'nd->nd_callout_ttdriver'. (alloc_tty_driver returns null)
+ drivers/staging/dgrp/dgrp_tty.c:3273 dgrp_tty_init() error: potential null dereference 'nd->nd_xprint_ttdriver'. (alloc_tty_driver returns null)
---
0-DAY kernel build testing backend Open Source Technology Center
Fengguang Wu, Yuanhan Liu Intel Corporation
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [tty:tty-next 9/39] drivers/staging/dgrp/dgrp_tty.c:3177
2012-10-07 12:35 [tty:tty-next 9/39] drivers/staging/dgrp/dgrp_tty.c:3177 dgrp_tty_init() error: potential null dereference 'nd->nd_serial_ttdriver' Fengguang Wu
@ 2012-10-09 16:46 ` Bill Pemberton
2012-10-09 18:42 ` [tty:tty-next 9/39] drivers/staging/dgrp/dgrp_tty.c:3177 dgrp_tty_init() error: potential null dereference 'nd->nd_serial_ttdriver' Alan Cox
1 sibling, 0 replies; 3+ messages in thread
From: Bill Pemberton @ 2012-10-09 16:46 UTC (permalink / raw)
To: Fengguang Wu; +Cc: kernel-janitors, Greg Kroah-Hartman, linux-serial
Fengguang Wu writes:
>
> Hi Bill,
>
> FYI, there are new smatch warnings show up in
>
> + drivers/staging/dgrp/dgrp_net_ops.c:277 dgrp_input() error: we previously assumed 'ld' could be null (see line 238)
This one looks fine, if ld is NULL then len is set to 0. ld is then
only dereferenced if len != 0
> --
> + drivers/staging/dgrp/dgrp_specproc.c:273 register_proc_table() error: we previously assumed 'table->child' could be null (see line 263)
It seems weird where smatch is seeing the NULL test vs. the call to
register_proc_table(), but it is correct that register_proc_table will
do bad things if the first arg is a NULL. I'll submit a patch for it.
> --
> + drivers/staging/dgrp/dgrp_tty.c:3177 dgrp_tty_init() error: potential null dereference 'nd->nd_serial_ttdriver'. (alloc_tty_driver returns null)
> + drivers/staging/dgrp/dgrp_tty.c:3236 dgrp_tty_init() error: potential null dereference 'nd->nd_callout_ttdriver'. (alloc_tty_driver returns null)
> + drivers/staging/dgrp/dgrp_tty.c:3273 dgrp_tty_init() error: potential null dereference 'nd->nd_xprint_ttdriver'. (alloc_tty_driver returns null)
>
Yes, the return value of alloc_tty_driver needs to be checked. I'll
fix these.
--
Bill
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [tty:tty-next 9/39] drivers/staging/dgrp/dgrp_tty.c:3177 dgrp_tty_init() error: potential null dereference 'nd->nd_serial_ttdriver'.
2012-10-07 12:35 [tty:tty-next 9/39] drivers/staging/dgrp/dgrp_tty.c:3177 dgrp_tty_init() error: potential null dereference 'nd->nd_serial_ttdriver' Fengguang Wu
2012-10-09 16:46 ` [tty:tty-next 9/39] drivers/staging/dgrp/dgrp_tty.c:3177 Bill Pemberton
@ 2012-10-09 18:42 ` Alan Cox
1 sibling, 0 replies; 3+ messages in thread
From: Alan Cox @ 2012-10-09 18:42 UTC (permalink / raw)
To: Fengguang Wu
Cc: Bill Pemberton, kernel-janitors, Greg Kroah-Hartman, linux-serial
I think thats the tip of the iceberg at best 8)
Alan
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2012-10-09 18:37 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-07 12:35 [tty:tty-next 9/39] drivers/staging/dgrp/dgrp_tty.c:3177 dgrp_tty_init() error: potential null dereference 'nd->nd_serial_ttdriver' Fengguang Wu
2012-10-09 16:46 ` [tty:tty-next 9/39] drivers/staging/dgrp/dgrp_tty.c:3177 Bill Pemberton
2012-10-09 18:42 ` [tty:tty-next 9/39] drivers/staging/dgrp/dgrp_tty.c:3177 dgrp_tty_init() error: potential null dereference 'nd->nd_serial_ttdriver' Alan Cox
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox