Re: [PATCH] fix error handling in drivers/staging/rtl8192u/ieee80211/ieee80211_module.c

2018-09-26 Thread Kees Cook
etnieks Reviewed-by: Kees Cook (And this seems to be the only case of this -- I don't see this code trivially copy/pasted in other 80211 stacks.) -Kees > --- > diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_module.c > b/drivers/staging/rtl8192u/ieee80211/ieee

Re: [PATCH] fix error handling in drivers/staging/rtl8192u/ieee80211/ieee80211_module.c

2018-09-27 Thread Kees Cook
*ieee; + struct ieee80211_device *ieee = NULL; struct net_device *dev; int i, err; @@ -180,6 +180,7 @@ struct net_device *alloc_ieee80211(int sizeof_priv) return dev; failed: + ieee80211_networks_free(ieee); if (dev) free_netdev(dev); Valdis, can you respin the patch? -Kees -- Kees Cook Pixel Security ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

Re: Re: Re: Re: [PATCH 2/2] binder: Use receive_fd() to receive file from another process

2021-04-02 Thread Kees Cook
; > > > > > Why? this is internal things, why does seccomp come into play here? > > > > > > > We already have security_binder_transfer_file() to control the sender > > process. So for the receiver process, do we need the seccomp too? Or > > do I miss something here? > > I do not know, is this something that is a requirement that seccomp > handle all filesystem handles sent to a process? I do not know the > seccomp "guarantee" that well, sorry. This is an extremely confused thread. seccomp _uses_ the receive_fd() API. receive_fd() calls the security_file_receive() LSM hook. The security_binder_*() LSM hooks are different yet. Please, let's wait for Christian to clarify his idea first. -- Kees Cook ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

[PATCH] staging: rtl8192e: Avoid field-overflowing memcpy()

2021-08-06 Thread Kees Cook
u8 reserved; struct rtllib_qos_ac_parameter ac_params_record[QOS_QUEUE_NUM]; } __packed; Cc: Darshan D V Cc: Aditya Srivastava Cc: de...@driverdev.osuosl.org Cc: Larry Finger Signed-off-by: Kees Cook --- drivers/staging/rtl8192e/rtllib_crypt_ccmp.c | 4 +- drivers/staging/rtl8192e/rtllib

[PATCH] staging: rtl8192u: Avoid field-overflowing memcpy()

2021-08-06 Thread Kees Cook
d-off-by: Kees Cook --- .../staging/rtl8192u/ieee80211/ieee80211.h| 4 +- .../rtl8192u/ieee80211/ieee80211_crypt_ccmp.c | 4 +- .../staging/rtl8192u/ieee80211/ieee80211_rx.c | 49 ++- 3 files changed, 19 insertions(+), 38 deletions(-) diff --git a/drivers/staging/rtl

[PATCH] staging: rtl8723bs: Avoid field-overflowing memcpy()

2021-08-06 Thread Kees Cook
() to correctly reason about the size. "objdump -d" shows no object code changes. Cc: Ross Schmidt Cc: Joe Perches Cc: de...@driverdev.osuosl.org Signed-off-by: Kees Cook --- Hi Greg, since I've split out some other patches from my series, it made sense to send this one di

Re: [RFC PATCH 07/11] drivers/android/binder: convert stats, transaction_log to counter_atomic

2020-09-23 Thread Kees Cook
truct counter_atomic br[_IOC_NR(BR_FAILED_REPLY) + 1]; > > + struct counter_atomic bc[_IOC_NR(BC_REPLY_SG) + 1]; > > + struct counter_atomic obj_created[BINDER_STAT_COUNT]; > > + struct counter_atomic obj_deleted[BINDER_STAT_COUNT]; > > Th

Re: [RFC PATCH 07/11] drivers/android/binder: convert stats, transaction_log to counter_atomic

2020-09-23 Thread Kees Cook
On Wed, Sep 23, 2020 at 09:31:34PM +0200, Greg KH wrote: > On Wed, Sep 23, 2020 at 12:04:58PM -0700, Kees Cook wrote: > > On Wed, Sep 23, 2020 at 07:10:27AM +0200, Greg KH wrote: > > > On Tue, Sep 22, 2020 at 07:43:36PM -0600, Shuah Khan wrote: > >

Re: [PATCH 00/11] Introduce Simple atomic and non-atomic counters

2020-09-25 Thread Kees Cook
it can never be used to guard object lifetimes > and state management. I left _return ops for now, inc_return > is necessary for now as per the discussion we had on this topic. I still *really* do not want dec_return() to exist. That is asking for trouble. I'd prefer inc_retur

Re: [PATCH 00/11] Introduce Simple atomic and non-atomic counters

2020-09-26 Thread Kees Cook
s [1] https://github.com/KSPP/linux/issues/104 -- Kees Cook ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

Re: [PATCH 00/11] Introduce Simple atomic and non-atomic counters

2020-09-26 Thread Kees Cook
c/html/latest/dev-tools/kunit/ Though I see the docs are still not updated[1] to reflect the Kconfig (CONFIG_foo_KUNIT_TEST) and file naming conventions (foo_kunit.c). -Kees [1] https://lore.kernel.org/lkml/20200911042404.3598910-1-david...@google.com/ -- Kee

Re: [PATCH 00/11] Introduce Simple atomic and non-atomic counters

2020-09-26 Thread Kees Cook
On Fri, Sep 25, 2020 at 06:13:37PM -0600, Shuah Khan wrote: > On 9/25/20 5:52 PM, Kees Cook wrote: > > On Fri, Sep 25, 2020 at 05:47:14PM -0600, Shuah Khan wrote: > > > -- Addressed Kees's comments: > > > 1. Non-atomic counters renamed to counter_simp

Re: [PATCH 00/11] Introduce Simple atomic and non-atomic counters

2020-09-28 Thread Kees Cook
the atomic and atomic64 naming currently used (i.e. dropping the '32'). > However that is just my opinion and I am ok with either naming. I had asked that they be size-named to avoid any confusion (i.e. we're making a new API). -- Kees Cook ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

Re: [PATCH 00/11] Introduce Simple atomic and non-atomic counters

2020-09-28 Thread Kees Cook
On Mon, Sep 28, 2020 at 04:41:47PM -0600, Shuah Khan wrote: > On 9/26/20 10:29 AM, Kees Cook wrote: > > On Fri, Sep 25, 2020 at 05:47:14PM -0600, Shuah Khan wrote: > > > 7. Verified that the test module compiles in kunit env. and test > > >module ca

Re: [PATCH v2 07/11] drivers/android/binder: convert stats, transaction_log to counter_atomic32

2020-10-07 Thread Kees Cook
version doesn't change the overflow wrap around behavior. > > Reviewed-by: Joel Fernandes (Google) > Signed-off-by: Shuah Khan Yup, seems to be stats-only. Reviewed-by: Kees Cook -- Kees Cook ___ devel mailing list de...@linuxdriv

Re: [PATCH v2 00/11] Introduce Simple atomic counters

2020-10-07 Thread Kees Cook
? (Originally I thought this was going through Greg's tree since it was touching a lot of drivers.) -- Kees Cook ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

Re: [PATCH v3 00/11] Introduce Simple atomic counters

2020-10-09 Thread Kees Cook
to take this through mine. I'd mentioned this in the v2, but yes, please take via your trees. :) I'm glad to see this landing! -- Kees Cook ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

Re: [PATCH v3 00/11] Introduce Simple atomic counters

2020-10-09 Thread Kees Cook
tomics, which means we have a much lower chance of introducing new flaws (and maybe we'll fix flaws during the conversion, which we've certainly seen before when doing this stricter type/language changes). I don't see why this is an objectionable goal. -- Kees Cook __

Re: [PATCH v3 00/11] Introduce Simple atomic counters

2020-10-14 Thread Kees Cook
27;s happening here. But as it turns out, it's easier to do this by employing both the process of elimination (mark the counters) and direct identification (mark the refcount_t). Then the pool of "unannotated" atomic_t instances continues to shrink. -- Kees Cook ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

Re: [PATCH v3 00/11] Introduce Simple atomic counters

2020-10-16 Thread Kees Cook
angerous code pattern, but it can mask finding them. Then, at the end of the day, only the corner cases remain, and those can be seen clearly as they change over time. Since we can never have a one-time audit be anything other than advisory, we need to make it EASY to do those kinds of audits so they c

Re: [PATCH 000/141] Fix fall-through warnings for Clang

2020-11-20 Thread Kees Cook
ngs are supposed to warn about issues that could > be bugs. Falling through to default: break; can hardly be a bug?! It's certainly a place where the intent is not always clear. I think this makes all the cases unambiguous, and doesn't impact the machine code, since the compiler will happily

Re: [PATCH 000/141] Fix fall-through warnings for Clang

2020-11-20 Thread Kees Cook
On Fri, Nov 20, 2020 at 11:51:42AM -0800, Jakub Kicinski wrote: > On Fri, 20 Nov 2020 11:30:40 -0800 Kees Cook wrote: > > On Fri, Nov 20, 2020 at 10:53:44AM -0800, Jakub Kicinski wrote: > > > On Fri, 20 Nov 2020 12:21:39 -0600 Gustavo A. R. Silva wrote: > > > > This

Re: [PATCH 000/141] Fix fall-through warnings for Clang

2020-11-22 Thread Kees Cook
On Fri, Nov 20, 2020 at 11:51:42AM -0800, Jakub Kicinski wrote: > On Fri, 20 Nov 2020 11:30:40 -0800 Kees Cook wrote: > > On Fri, Nov 20, 2020 at 10:53:44AM -0800, Jakub Kicinski wrote: > > > On Fri, 20 Nov 2020 12:21:39 -0600 Gustavo A. R. Silva wrote: > > > > This

Re: [PATCH 000/141] Fix fall-through warnings for Clang

2020-11-24 Thread Kees Cook
On Mon, Nov 23, 2020 at 05:32:51PM -0800, Nick Desaulniers wrote: > On Sun, Nov 22, 2020 at 8:17 AM Kees Cook wrote: > > > > On Fri, Nov 20, 2020 at 11:51:42AM -0800, Jakub Kicinski wrote: > > > If none of the 140 patches here fix a real bug, and there is no change >

Re: [PATCH RFC v1 02/12] mm/usercopy.c: Prepare check_page_span() for PG_reserved changes

2019-10-23 Thread Kees Cook
7;t change. Once we no > > longer set these pages to reserved, we can rework this function to > > perform separate checks for ZONE_DEVICE (split from PG_reserved checks). > > > > Cc: Kees Cook > > Cc: Andrew Morton > > Cc: Kate Stewart > > Cc: Allison

[PATCH] staging: rtl*: Remove tasklet callback casts

2019-11-14 Thread Kees Cook
otype). Many of these cases can be found with -Wcast-function-type, which found that the rtl wifi drivers had a bunch of needless function casts. Remove function casts for tasklet callbacks in the various drivers. Signed-off-by: Kees Cook --- drivers/staging/rtl8188eu/hal/rtl8188eu_rec

Re: [PATCH] staging: rtl*: Remove tasklet callback casts

2019-11-15 Thread Kees Cook
On Fri, Nov 15, 2019 at 10:42:35AM +0300, Dan Carpenter wrote: > On Fri, Nov 15, 2019 at 10:40:03AM +0300, Dan Carpenter wrote: > > On Thu, Nov 14, 2019 at 09:39:00PM -0800, Kees Cook wrote: > > > In order to make the entire kernel usable under Clang's Control Flow >

Re: [PATCH] staging: rtl*: Remove tasklet callback casts

2019-11-15 Thread Kees Cook
On Fri, Nov 15, 2019 at 02:16:10PM +0800, Greg Kroah-Hartman wrote: > On Thu, Nov 14, 2019 at 09:39:00PM -0800, Kees Cook wrote: > > In order to make the entire kernel usable under Clang's Control Flow > > Integrity protections, function prototype casts need to be avoided &

[PATCH v2] staging: rtl*: Remove tasklet callback casts

2019-11-15 Thread Kees Cook
otype). Many of these cases can be found with -Wcast-function-type, which found that the rtl wifi drivers had a bunch of needless function casts. Remove function casts for tasklet callbacks in the various drivers. Signed-off-by: Kees Cook Reviewed-by: Dan Carpenter --- v2: rebased to staging-next,

Re: [PATCH 1/4] [v2] structleak: disable STRUCTLEAK_BYREF in combination with KASAN_STACK

2019-06-28 Thread Kees Cook
rning, but presumably the overall stack usage is still > significantly higher than in other configurations, so this would not > address the full problem. > > I could not test this with CONFIG_INIT_STACK_ALL, which may or may not > suffer from a similar problem. > > Fixes: 81a

[PATCH v2 13/31] timer: Remove meaningless .data/.function assignments

2017-09-20 Thread Kees Cook
: Jens Axboe Cc: net...@vger.kernel.org Cc: linux-wirel...@vger.kernel.org Cc: de...@driverdev.osuosl.org Signed-off-by: Kees Cook Acked-by: Greg Kroah-Hartman # for staging Acked-by: Krzysztof Halasa # for wan/hdlc* Acked-by: Jens Axboe # for amiflop --- drivers/block/amiflop.c

[PATCH v2 26/31] staging/comedi/das16: Make timer initialization unconditional

2017-09-20 Thread Kees Cook
With timer initialization made unconditional, there is no reason to make del_timer_sync() calls conditionally, there by removing the test of the .data field. Cc: Ian Abbott Cc: H Hartley Sweeten Cc: Greg Kroah-Hartman Cc: de...@driverdev.osuosl.org Signed-off-by: Kees Cook --- drivers

[PATCH] staging/wilc1000: Convert timers to use timer_setup()

2017-10-04 Thread Kees Cook
wirel...@vger.kernel.org Cc: de...@driverdev.osuosl.org Cc: Thomas Gleixner Signed-off-by: Kees Cook --- This requires commit 686fef928bba ("timer: Prepare to change timer callback argument type") in v4.14-rc3, but should be otherwise stand-alone. --- drivers/staging/wilc1000/host_i

[PATCH] staging: rtl8712: Convert timers to use timer_setup()

2017-10-04 Thread Kees Cook
Cc: Varsha Rao Cc: Julia Lawall Cc: Aleksey Kurbatov Cc: Vijai Kumar K Cc: Wei Yongjun Cc: "Raphaël Beamonte" Cc: Jannik Becher Cc: Joseph Wright Cc: de...@driverdev.osuosl.org Cc: Thomas Gleixner Signed-off-by: Kees Cook --- This requires commit 686fef928bba ("timer: Pr

[PATCH] staging: rtl8192u: Convert timers to use timer_setup()

2017-10-04 Thread Kees Cook
...@driverdev.osuosl.org Cc: Thomas Gleixner Signed-off-by: Kees Cook --- This requires commit 686fef928bba ("timer: Prepare to change timer callback argument type") in v4.14-rc3, but should be otherwise stand-alone. --- drivers/staging/rtl8192u/ieee80211/ieee80211.h | 6 +-- .../staging/rtl8192u

[PATCH] staging/atomisp: Convert timers to use timer_setup()

2017-10-04 Thread Kees Cook
: linux-me...@vger.kernel.org Cc: de...@driverdev.osuosl.org Cc: Thomas Gleixner Signed-off-by: Kees Cook --- This requires commit 686fef928bba ("timer: Prepare to change timer callback argument type") in v4.14-rc3, but should be otherwise stand-alone. --- drivers/staging/media/atomisp/pc

[PATCH] staging: rtl8188eu: Convert timers to use timer_setup()

2017-10-04 Thread Kees Cook
: Yamanappagouda Patil Cc: Luca Ceresoli Cc: Victor Carvajal Cc: Sebastian Haas Cc: de...@driverdev.osuosl.org Cc: Thomas Gleixner Signed-off-by: Kees Cook --- This requires commit 686fef928bba ("timer: Prepare to change timer callback argument type") in v4.14-rc3, but should be other

[PATCH] staging: rtl8192e: Convert timers to use timer_setup()

2017-10-04 Thread Kees Cook
: Julia Lawall Cc: "David S. Miller" Cc: Johannes Berg Cc: Yamanappagouda Patil Cc: Georgiana Rodica Chelu Cc: Colin Ian King Cc: Baoyou Xie Cc: de...@driverdev.osuosl.org Cc: Thomas Gleixner Signed-off-by: Kees Cook --- This requires commit 686fef928bba ("timer: Prepare

[PATCH] timer: Remove meaningless .data/.function assignments

2017-10-09 Thread Kees Cook
: Jens Axboe Cc: net...@vger.kernel.org Cc: linux-wirel...@vger.kernel.org Cc: de...@driverdev.osuosl.org Signed-off-by: Kees Cook Acked-by: Greg Kroah-Hartman # for staging Acked-by: Krzysztof Halasa # for wan/hdlc* Acked-by: Jens Axboe # for amiflop --- This should go via the timer/core tree

[PATCH] staging: rtl8712: Convert timers to use timer_setup()

2017-10-16 Thread Kees Cook
Cc: Varsha Rao Cc: Julia Lawall Cc: Aleksey Kurbatov Cc: Vijai Kumar K Cc: Wei Yongjun Cc: "Raphaël Beamonte" Cc: Jannik Becher Cc: Joseph Wright Cc: de...@driverdev.osuosl.org Signed-off-by: Kees Cook --- drivers/staging/rtl8712/mlme_linux.c

[PATCH] staging/wilc1000: Convert timers to use timer_setup()

2017-10-16 Thread Kees Cook
wirel...@vger.kernel.org Cc: de...@driverdev.osuosl.org Signed-off-by: Kees Cook --- drivers/staging/wilc1000/host_interface.c | 39 +-- drivers/staging/wilc1000/host_interface.h | 5 +++ drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 4 +-- 3 files change

[PATCH] staging: rtl8192u: Convert timers to use timer_setup()

2017-10-16 Thread Kees Cook
: Arnd Bergmann Cc: Baoyou Xie Cc: Tuomo Rinne Cc: Colin Ian King Cc: de...@driverdev.osuosl.org Signed-off-by: Kees Cook --- drivers/staging/rtl8192u/ieee80211/ieee80211.h | 6 +-- .../staging/rtl8192u/ieee80211/ieee80211_crypt.c | 4 +- .../staging/rtl8192u/ieee80211

[PATCH] staging/fwserial: Convert timers to use timer_setup()

2017-10-16 Thread Kees Cook
-transaction. Cc: Greg Kroah-Hartman Cc: Bhumika Goyal Cc: de...@driverdev.osuosl.org Signed-off-by: Kees Cook --- drivers/staging/fwserial/fwserial.c | 16 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/drivers/staging/fwserial/fwserial.c b/drivers/staging/fwserial

[PATCH] staging: rtl8188eu: Convert timers to use timer_setup()

2017-10-16 Thread Kees Cook
: Yamanappagouda Patil Cc: Luca Ceresoli Cc: Victor Carvajal Cc: Sebastian Haas Cc: de...@driverdev.osuosl.org Signed-off-by: Kees Cook --- drivers/staging/rtl8188eu/core/rtw_led.c | 7 +++ drivers/staging/rtl8188eu/core/rtw_mlme.c| 15 +-- drivers/staging

[PATCH] staging: dgnc: Convert timers to use timer_setup()

2017-10-16 Thread Kees Cook
Cc: de...@driverdev.osuosl.org Signed-off-by: Kees Cook --- drivers/staging/dgnc/dgnc_driver.c | 8 +++- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/staging/dgnc/dgnc_driver.c b/drivers/staging/dgnc/dgnc_driver.c index c1b6079384e9..d9bf5da1b8e5 100644 --- a/drivers

[PATCH] staging: rtl8192e: Convert timers to use timer_setup()

2017-10-16 Thread Kees Cook
Lawall Cc: Yamanappagouda Patil Cc: "David S. Miller" Cc: Johannes Berg Cc: Georgiana Rodica Chelu Cc: Colin Ian King Cc: Baoyou Xie Cc: de...@driverdev.osuosl.org Signed-off-by: Kees Cook --- drivers/staging/rtl8192e/rtl8192e/rtl_core.c | 25 ++--- drivers/staging/rtl8192e

[PATCH] staging/comedi: Convert timers to use timer_setup()

2017-10-16 Thread Kees Cook
Kroah-Hartman Cc: de...@driverdev.osuosl.org Signed-off-by: Kees Cook --- drivers/staging/comedi/drivers/comedi_test.c | 18 ++ drivers/staging/comedi/drivers/das16.c | 11 ++- drivers/staging/comedi/drivers/jr3_pci.c | 10 ++ 3 files changed, 22 insertions

[PATCH] staging/atomisp: Convert timers to use timer_setup()

2017-10-16 Thread Kees Cook
: linux-me...@vger.kernel.org Cc: de...@driverdev.osuosl.org Signed-off-by: Kees Cook --- drivers/staging/media/atomisp/pci/atomisp2/atomisp_cmd.c | 13 - drivers/staging/media/atomisp/pci/atomisp2/atomisp_cmd.h | 6 +- .../media/atomisp/pci/atomisp2/atomisp_compat_css20.c | 2

[PATCH] staging: rtlwifi: Convert timers to use timer_setup()

2017-10-16 Thread Kees Cook
Shih Cc: shaofu Cc: de...@driverdev.osuosl.org Signed-off-by: Kees Cook --- drivers/staging/rtlwifi/base.c | 21 +++-- drivers/staging/rtlwifi/base.h | 4 ++-- drivers/staging/rtlwifi/core.c | 2 +- drivers/staging/rtlwifi/phydm

Re: [PATCH] staging/atomisp: Convert timers to use timer_setup()

2017-10-17 Thread Kees Cook
On Tue, Oct 17, 2017 at 1:23 AM, Sakari Ailus wrote: > On Mon, Oct 16, 2017 at 04:24:56PM -0700, Kees Cook wrote: >> In preparation for unconditionally passing the struct timer_list pointer to >> all timer callbacks, switch to using the new timer_setup() and from_timer() >&

[PATCH] staging: wlan-ng: Convert timers to use timer_setup()

2017-10-18 Thread Kees Cook
...@driverdev.osuosl.org Signed-off-by: Kees Cook --- drivers/staging/wlan-ng/hfa384x_usb.c | 29 + drivers/staging/wlan-ng/prism2mgmt.h | 2 +- drivers/staging/wlan-ng/prism2sta.c | 4 ++-- 3 files changed, 16 insertions(+), 19 deletions(-) diff --git a/drivers/staging

[PATCH] staging: atomisp: i2c: Convert timers to use timer_setup()

2017-10-24 Thread Kees Cook
In preparation for unconditionally passing the struct timer_list pointer to all timer callbacks, switch to using the new timer_setup() and from_timer() to pass the timer pointer explicitly. Signed-off-by: Kees Cook --- drivers/staging/media/atomisp/i2c/lm3554.c | 8 +++- 1 file changed, 3

[PATCH] staging: ks7010: Convert timers to use timer_setup()

2017-10-24 Thread Kees Cook
In preparation for unconditionally passing the struct timer_list pointer to all timer callbacks, switch to using the new timer_setup() and from_timer() to pass the timer pointer explicitly. Cc: Greg Kroah-Hartman Cc: "Tobin C. Harding" Cc: de...@driverdev.osuosl.org Signed-off-by:

[PATCH] staging: greybus: Convert timers to use timer_setup()

2017-10-24 Thread Kees Cook
er Cc: greybus-...@lists.linaro.org Cc: de...@driverdev.osuosl.org Signed-off-by: Kees Cook --- drivers/staging/greybus/loopback.c | 14 -- drivers/staging/greybus/operation.c | 7 +++ 2 files changed, 7 insertions(+), 14 deletions(-) diff --git a/drivers/staging/greybus/loopback.c b/

[PATCH] staging: vc04_services: Convert timers to use timer_setup()

2017-10-24 Thread Kees Cook
-rpi-ker...@lists.infradead.org Cc: linux-arm-ker...@lists.infradead.org Cc: de...@driverdev.osuosl.org Signed-off-by: Kees Cook --- .../staging/vc04_services/interface/vchiq_arm/vchiq_arm.c | 13 +++-- .../staging/vc04_services/interface/vchiq_arm/vchiq_arm.h | 1 + 2 files changed

[PATCH] staging: rtl8723bs: Convert timers to use timer_setup()

2017-10-24 Thread Kees Cook
org Signed-off-by: Kees Cook --- drivers/staging/rtl8723bs/core/rtw_mlme.c | 10 +-- drivers/staging/rtl8723bs/core/rtw_mlme_ext.c | 15 +++--- drivers/staging/rtl8723bs/core/rtw_pwrctrl.c | 23 +++ drivers/staging/rtl8723bs/core/rtw_recv.c

Re: [PATCH] staging: greybus: Convert timers to use timer_setup()

2017-10-24 Thread Kees Cook
On Tue, Oct 24, 2017 at 2:40 AM, Bryan O'Donoghue wrote: > On 24/10/17 10:35, Bryan O'Donoghue wrote: >> >> On 24/10/17 09:25, Kees Cook wrote: >>> >>> In preparation for unconditionally passing the struct timer_list pointer >>> to >>

Re: [PATCH] staging: greybus: Convert timers to use timer_setup()

2017-10-24 Thread Kees Cook
On Tue, Oct 24, 2017 at 5:52 AM, Bryan O'Donoghue wrote: > On 24/10/17 13:47, Kees Cook wrote: >> >> On Tue, Oct 24, 2017 at 2:40 AM, Bryan O'Donoghue >> wrote: >>> >>> On 24/10/17 10:35, Bryan O'Donoghue wrote: >>>> >>>

Re: [PATCH] staging: greybus: Convert timers to use timer_setup()

2017-10-24 Thread Kees Cook
On Tue, Oct 24, 2017 at 6:30 AM, Bryan O'Donoghue wrote: > On 24/10/17 14:14, Kees Cook wrote: >> >> On Tue, Oct 24, 2017 at 5:52 AM, Bryan O'Donoghue >> wrote: >>> >>> On 24/10/17 13:47, Kees Cook wrote: >>>> >>&g

[PATCH v2] staging: greybus: Convert timers to use timer_setup()

2017-10-24 Thread Kees Cook
er Cc: greybus-...@lists.linaro.org Cc: de...@driverdev.osuosl.org Signed-off-by: Kees Cook --- v2: Added back "get" in timer code, thanks to Bryan. :) --- drivers/staging/greybus/loopback.c | 19 +-- drivers/staging/greybus/operation.c | 7 +++ 2 files changed, 12 insertions(

Re: [PATCH v2] staging: greybus: Convert timers to use timer_setup()

2017-10-30 Thread Kees Cook
ns. > > That's correct. > >> I'll probably need at least a day to look at that, so it'll be the >> weekend before I can really allocate time. > > Cool. I'm quite sure I just rebased your loopback conversion patch on my > core timeout handli

[PATCH v2] staging: vc04_services: Convert timers to use timer_setup()

2017-10-30 Thread Kees Cook
Anholt Cc: Stefan Wahren Cc: Michael Zoran Cc: Keerthi Reddy Cc: linux-rpi-ker...@lists.infradead.org Cc: linux-arm-ker...@lists.infradead.org Cc: de...@driverdev.osuosl.org Signed-off-by: Kees Cook Tested-by: Stefan Wahren --- .../vc04_services/interface/vchiq_arm/vchiq_arm.c | 17

Re: [PATCH v2] staging: greybus: Convert timers to use timer_setup()

2017-10-30 Thread Kees Cook
On Mon, Oct 30, 2017 at 5:01 PM, wrote: > On 30 October 2017 9:37:37 p.m. GMT+00:00, Kees Cook > wrote: >>On Mon, Oct 30, 2017 at 4:48 AM, Johan Hovold wrote: >>> On Mon, Oct 30, 2017 at 11:44:22AM +, Bryan O'Donoghue wrote: >>>> >>>> >

Re: [PATCH] staging: rtlwifi: remove an unused variable

2017-11-02 Thread Kees Cook
watchdog_wq_callback(void *data) > void rtl_watch_dog_timer_callback(struct timer_list *t) > { > struct rtl_priv *rtlpriv = from_timer(rtlpriv, t, > works.watchdog_timer); > - struct ieee80211_hw *hw = rtlpriv->hw; > > queue_delayed_work(rtlpriv->works.r

Re: [PATCH v2] staging: greybus: Convert timers to use timer_setup()

2017-11-03 Thread Kees Cook
On Mon, Oct 30, 2017 at 5:05 PM, Kees Cook wrote: > On Mon, Oct 30, 2017 at 5:01 PM, wrote: >> There's a separate change to loopback.c an old patch ARAIR that will >> subtract use of the timer from loopback.c so you can skip that bit. > > Okay, cool. Since the ope

Re: [PATCH v2] staging: greybus: Convert timers to use timer_setup()

2017-11-03 Thread Kees Cook
On Fri, Nov 3, 2017 at 2:49 PM, Bryan O'Donoghue wrote: > > > On 03/11/17 20:21, Kees Cook wrote: >> >> On Mon, Oct 30, 2017 at 5:05 PM, Kees Cook wrote: >>> >>> On Mon, Oct 30, 2017 at 5:01 PM, wrote: >>>> >>>> There's a

[PATCH] staging/irda/net: Drop extraneous parentheses around test

2017-11-22 Thread Kees Cook
Noticed during Clang builds. This drops the redundant parentheses. Cc: Samuel Ortiz Cc: Greg Kroah-Hartman Cc: de...@driverdev.osuosl.org Signed-off-by: Kees Cook --- drivers/staging/irda/net/irlmp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/irda

[PATCH] drivers/staging/gasket: Use 2-factor allocator calls

2018-07-04 Thread Kees Cook
As already done treewide, switch from open-coded multiplication to using 2-factor allocator helpers. Signed-off-by: Kees Cook --- drivers/staging/gasket/gasket_core.c | 6 +++--- drivers/staging/gasket/gasket_interrupt.c | 15 +-- drivers/staging/gasket/gasket_page_table.c

[PATCH v6 01/18] crypto: xcbc: Remove VLA usage

2018-07-24 Thread Kees Cook
aFzCG-zNmZwX4A2FQpadafLfEzK6CC=qpxydaacu1rq...@mail.gmail.com Signed-off-by: Kees Cook --- crypto/xcbc.c | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/crypto/xcbc.c b/crypto/xcbc.c index 25c75af50d3f..c055f57fab11 100644 --- a/crypto/xcbc.c +++ b/crypto/xcbc.c @@ -57,15 +57,17 @@ s

[PATCH v6 11/18] dm crypt: Convert essiv from ahash to shash

2018-07-24 Thread Kees Cook
reduces stack usage. The stack allocation will be made a fixed size in a later patch to the crypto subsystem. [1] https://lkml.kernel.org/r/CA+55aFzCG-zNmZwX4A2FQpadafLfEzK6CC=qpxydaacu1rq...@mail.gmail.com Signed-off-by: Kees Cook Reviewed-by: Eric Biggers --- drivers/md/dm-crypt.c | 31

[PATCH v6 00/18] crypto: Remove VLA usage

2018-07-24 Thread Kees Cook
K6CC=qpxydaacu1rq...@mail.gmail.com Ard Biesheuvel (1): crypto: ccm: Remove VLA usage Kees Cook (17): crypto: xcbc: Remove VLA usage crypto: cbc: Remove VLA usage crypto: hash: Remove VLA usage dm: Remove VLA usage from hashes crypto alg: Introduce generic max blocksize and alignmask crypt

[PATCH v6 08/18] crypto: skcipher: Remove VLA usage for SKCIPHER_REQUEST_ON_STACK

2018-07-24 Thread Kees Cook
crypto_skcipher_set_reqsize: 88 crypto_skcipher_set_reqsize: 472 [1] https://lkml.kernel.org/r/CA+55aFzCG-zNmZwX4A2FQpadafLfEzK6CC=qpxydaacu1rq...@mail.gmail.com Signed-off-by: Kees Cook --- include/crypto/internal/skcipher.h | 1 + include/crypto/skcipher.h | 4

[PATCH v6 06/18] crypto: qat: Remove VLA usage

2018-07-24 Thread Kees Cook
In the quest to remove all stack VLA usage from the kernel[1], this uses the new upper bound for the stack buffer. Also adds a sanity check. [1] https://lkml.kernel.org/r/CA+55aFzCG-zNmZwX4A2FQpadafLfEzK6CC=qpxydaacu1rq...@mail.gmail.com Signed-off-by: Kees Cook --- drivers/crypto/qat

[PATCH v6 07/18] crypto: shash: Remove VLA usage in unaligned hashing

2018-07-24 Thread Kees Cook
this helper was the only user. [1] https://lkml.kernel.org/r/CA+55aFzCG-zNmZwX4A2FQpadafLfEzK6CC=qpxydaacu1rq...@mail.gmail.com Signed-off-by: Kees Cook --- crypto/shash.c | 27 --- include/linux/compiler-gcc.h | 1 - 2 files changed, 16 insertions(+), 12

[PATCH v6 16/18] rxrpc: Reuse SKCIPHER_REQUEST_ON_STACK buffer

2018-07-24 Thread Kees Cook
frame size of 1152 bytes is larger than 1024 bytes [-Wframe-larger-than=] This passes the initial SKCIPHER_REQUEST_ON_STACK allocation to the leaf functions for reuse. Two requests allocated on the stack is not needed when only one is used at a time. Signed-off-by: Kees Cook Acked-by: Arnd Bergmann

[PATCH v6 03/18] crypto: hash: Remove VLA usage

2018-07-24 Thread Kees Cook
...@mail.gmail.com Signed-off-by: Kees Cook --- crypto/ahash.c| 4 ++-- crypto/algif_hash.c | 2 +- crypto/shash.c| 6 +++--- include/crypto/hash.h | 6 +- 4 files changed, 11 insertions(+), 7 deletions(-) diff --git a/crypto/ahash.c b/crypto/ahash.c index a64c143165b1..78aaf2158c43

[PATCH v6 17/18] crypto: ccm: Remove VLA usage

2018-07-24 Thread Kees Cook
=qpxydaacu1rq...@mail.gmail.com Signed-off-by: Ard Biesheuvel Signed-off-by: Kees Cook --- crypto/ccm.c | 9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/crypto/ccm.c b/crypto/ccm.c index 0a083342ec8c..b242fd0d3262 100644 --- a/crypto/ccm.c +++ b/crypto/ccm.c @@ -50,7 +50,10

[PATCH v6 18/18] crypto: Remove AHASH_REQUEST_ON_STACK

2018-07-24 Thread Kees Cook
All users of AHASH_REQUEST_ON_STACK have been removed from the kernel, so drop it entirely so no VLAs get reintroduced by future users. Signed-off-by: Kees Cook --- include/crypto/hash.h | 5 - 1 file changed, 5 deletions(-) diff --git a/include/crypto/hash.h b/include/crypto/hash.h index

[PATCH v6 05/18] crypto alg: Introduce generic max blocksize and alignmask

2018-07-24 Thread Kees Cook
cra_blocksize is 144 (SHA3_224_BLOCK_SIZE, 18 8-byte words). For the new blocksize limit, I went with 160 (20 8-byte words). [1] https://lkml.kernel.org/r/CA+55aFzCG-zNmZwX4A2FQpadafLfEzK6CC=qpxydaacu1rq...@mail.gmail.com Signed-off-by: Kees Cook --- crypto/algapi.c | 7 ++- include

[PATCH v6 09/18] ppp: mppe: Remove VLA usage

2018-07-24 Thread Kees Cook
+55aFzCG-zNmZwX4A2FQpadafLfEzK6CC=qpxydaacu1rq...@mail.gmail.com Signed-off-by: Kees Cook Acked-by: Arnd Bergmann --- drivers/net/ppp/ppp_mppe.c | 56 -- 1 file changed, 30 insertions(+), 26 deletions(-) diff --git a/drivers/net/ppp/ppp_mppe.c b/drivers/net/ppp

[PATCH v6 10/18] x86/power/64: Remove VLA usage

2018-07-24 Thread Kees Cook
/r/CA+55aFzCG-zNmZwX4A2FQpadafLfEzK6CC=qpxydaacu1rq...@mail.gmail.com Signed-off-by: Kees Cook Acked-by: Pavel Machek --- arch/x86/power/hibernate_64.c | 36 --- 1 file changed, 21 insertions(+), 15 deletions(-) diff --git a/arch/x86/power/hibernate_64.c b/arch

[PATCH v6 02/18] crypto: cbc: Remove VLA usage

2018-07-24 Thread Kees Cook
: Kees Cook --- include/crypto/cbc.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/include/crypto/cbc.h b/include/crypto/cbc.h index f5b8bfc22e6d..47db0aac2ab9 100644 --- a/include/crypto/cbc.h +++ b/include/crypto/cbc.h @@ -113,7 +113,9 @@ static inline int

[PATCH v6 15/18] staging: rtl8192e: ieee80211: Convert from ahash to shash

2018-07-24 Thread Kees Cook
removing a layer of indirection this both improves performance and reduces stack usage. The stack allocation will be made a fixed size in a later patch to the crypto subsystem. [1] https://lkml.kernel.org/r/CA+55aFzCG-zNmZwX4A2FQpadafLfEzK6CC=qpxydaacu1rq...@mail.gmail.com Signed-off-by: Kees Cook

[PATCH v6 14/18] staging: rtl8192u: ieee80211: Convert from ahash to shash

2018-07-24 Thread Kees Cook
removing a layer of indirection this both improves performance and reduces stack usage. The stack allocation will be made a fixed size in a later patch to the crypto subsystem. [1] https://lkml.kernel.org/r/CA+55aFzCG-zNmZwX4A2FQpadafLfEzK6CC=qpxydaacu1rq...@mail.gmail.com Signed-off-by: Kees Cook

[PATCH v6 12/18] drbd: Convert from ahash to shash

2018-07-24 Thread Kees Cook
reduces stack usage. The stack allocation will be made a fixed size in a later patch to the crypto subsystem. [1] https://lkml.kernel.org/r/CA+55aFzCG-zNmZwX4A2FQpadafLfEzK6CC=qpxydaacu1rq...@mail.gmail.com Signed-off-by: Kees Cook --- drivers/block/drbd/drbd_int.h | 13 +++ drivers/block

[PATCH v6 13/18] wireless/lib80211: Convert from ahash to shash

2018-07-24 Thread Kees Cook
reduces stack usage. The stack allocation will be made a fixed size in a later patch to the crypto subsystem. [1] https://lkml.kernel.org/r/CA+55aFzCG-zNmZwX4A2FQpadafLfEzK6CC=qpxydaacu1rq...@mail.gmail.com Signed-off-by: Kees Cook --- net/wireless/lib80211_crypt_tkip.c | 58

[PATCH v6 04/18] dm: Remove VLA usage from hashes

2018-07-24 Thread Kees Cook
In the quest to remove all stack VLA usage from the kernel[1], this uses the new HASH_MAX_DIGESTSIZE from the crypto layer to allocate the upper bounds on stack usage. [1] https://lkml.kernel.org/r/CA+55aFzCG-zNmZwX4A2FQpadafLfEzK6CC=qpxydaacu1rq...@mail.gmail.com Signed-off-by: Kees Cook

Re: [PATCH v6 17/18] crypto: ccm: Remove VLA usage

2018-07-24 Thread Kees Cook
On Tue, Jul 24, 2018 at 9:57 AM, Ard Biesheuvel wrote: > On 24 July 2018 at 18:49, Kees Cook wrote: >> From: Ard Biesheuvel >> >> In the quest to remove all stack VLA usage from the kernel[1], this >> drops AHASH_REQUEST_ON_STACK by preallocated the ahash request are

Re: [PATCH v6 18/18] crypto: Remove AHASH_REQUEST_ON_STACK

2018-07-24 Thread Kees Cook
On Tue, Jul 24, 2018 at 10:31 AM, Joe Perches wrote: > On Tue, 2018-07-24 at 09:49 -0700, Kees Cook wrote: >> All users of AHASH_REQUEST_ON_STACK have been removed from the kernel, so >> drop it entirely so no VLAs get reintroduced by future users. > > checkpatch has a test

Re: [PATCH v6 10/18] x86/power/64: Remove VLA usage

2018-07-25 Thread Kees Cook
On Wed, Jul 25, 2018 at 4:32 AM, Rafael J. Wysocki wrote: > On Tue, Jul 24, 2018 at 6:49 PM, Kees Cook wrote: >> In the quest to remove all stack VLA usage from the kernel[1], this >> removes the discouraged use of AHASH_REQUEST_ON_STACK by switching to >> shash direct

Re: [PATCH v2 3/5] pci: set msi_domain_ops as __ro_after_init

2017-02-15 Thread Kees Cook
t;> init. >> This protects the data structure from accidental corruption. >> >> Suggested-by: Kees Cook >> Signed-off-by: Jess Frazelle >> --- >> drivers/pci/host/pci-hyperv.c | 2 +- >> drivers/pci/host/vmd.c| 2 +- >> drivers/pci/ms

Re: [PATCH v2] staging: rtl8192u: add error handling for usb_alloc_urb

2018-06-15 Thread Kees Cook
); kfree(priv->rx_urb); I think you need some kind of helper to do this, and you can call into it from your error paths... -Kees > {sigh} > > No, you are still leaking memory on all of these changes that you just > made :( > > greg k-h -- Kees Cook Pixel Security ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

Re: [PATCH v2] staging: rtl8192u: add error handling for usb_alloc_urb

2018-06-15 Thread Kees Cook
On Fri, Jun 15, 2018 at 9:47 AM, Kees Cook wrote: > On Fri, Jun 15, 2018 at 9:33 AM, Greg Kroah-Hartman > wrote: >> On Sat, Jun 16, 2018 at 12:25:23AM +0800, Zhouyang Jia wrote: >>> When usb_alloc_urb fails, the lack of error-handling code may >>> cause unexpect

Re: [PATCH v3] staging: rtl8192u: add error handling for usb_alloc_urb

2018-06-15 Thread Kees Cook
x_urb = NULL; > - > DMESGE("Endpoint Alloc Failure"); > - return -ENOMEM; > + goto out_release_mem; > } > > netdev_dbg(dev, "End of initendpoints\n"); >

[PATCH] staging: unisys: drop format string in kthread_run

2015-06-04 Thread Kees Cook
Calling kthread_run with a single name parameter causes it to be handled as a format string. Since the uisthread interface lacks format parameters, use "%s" to avoid any potential accidents from callers passing in dynamic string content. Signed-off-by: Kees Cook --- drivers/stag

Re: [PATCH 1/3] compiler.h: define __do_not_initialize

2020-02-24 Thread Kees Cook
t; +#ifndef __do_not_initialize > +#define __do_not_initialize > +#endif > + > /* > * The below symbols may be defined for one or more, but not ALL, of the > above > * compilers. We don't consider that to be an error, so set them to nothing. > -- > 2.25.0.265.g

Re: [PATCH 2/3] binder: do not initialize locals passed to copy_from_user()

2020-02-24 Thread Kees Cook
lp keep these markings in sync... -Kees > > Cc: Kees Cook > Cc: Greg Kroah-Hartman > Signed-off-by: Alexander Potapenko > --- > drivers/android/binder.c | 12 ++-- > 1 file changed, 6 insertions(+), 6 deletions(-) > > diff --git a/drivers/android/binder.c b/d

Re: [PATCH 2/3] binder: do not initialize locals passed to copy_from_user()

2020-02-26 Thread Kees Cook
On Wed, Feb 26, 2020 at 03:58:41PM +0100, Alexander Potapenko wrote: > On Tue, Feb 25, 2020 at 4:24 PM Alexander Potapenko wrote: > > > > On Tue, Feb 25, 2020 at 5:18 AM Kees Cook wrote: > > > > > > On Mon, Feb 24, 2020 at 04:35:00PM +0100, gli...@google.com wrot

Re: [PATCH v2 2/3] binder: do not initialize locals passed to copy_from_user()

2020-03-04 Thread Kees Cook
"Oh, I love that patch." https://lore.kernel.org/lkml/CA+55aFykZL+cSBJjBBts7ebEFfyGPdMzTmLSxKnT_29=j94...@mail.gmail.com/ -- Kees Cook ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

Re: [PATCH v2 2/3] binder: do not initialize locals passed to copy_from_user()

2020-03-05 Thread Kees Cook
On Thu, Mar 05, 2020 at 11:07:56AM +0300, Dan Carpenter wrote: > On Wed, Mar 04, 2020 at 10:13:40AM -0800, Kees Cook wrote: > > On Tue, Mar 03, 2020 at 12:38:32PM +0300, Dan Carpenter wrote: > > > The real fix is to initialize everything manually, the automated > > > ini

  1   2   >