[driver-core:driver-core-testing] BUILD REGRESSION 7f67ea9c19735222f7999754f3fee922cd8f4781
defconfig arm64allyesconfig arm64 defconfig arm allyesconfig arm allmodconfig i386 randconfig-c001-20211126 powerpc randconfig-c003-20211126 mips randconfig-c004-20211126 armzeus_defconfig arm colibri_pxa300_defconfig arm lpc32xx_defconfig ia64 allyesconfig powerpc bluestone_defconfig powerpc pq2fads_defconfig xtensaxip_kc705_defconfig powerpc canyonlands_defconfig sh ul2_defconfig s390 zfcpdump_defconfig arm omap2plus_defconfig powerpcadder875_defconfig armdove_defconfig m68km5272c3_defconfig armspear3xx_defconfig i386 alldefconfig powerpc mpc8272_ads_defconfig pariscgeneric-32bit_defconfig powerpc akebono_defconfig powerpc mpc83xx_defconfig shedosk7760_defconfig powerpc mpc8560_ads_defconfig m68k sun3x_defconfig arm ep93xx_defconfig arm simpad_defconfig powerpc xes_mpc85xx_defconfig powerpc tqm8540_defconfig sh se7705_defconfig powerpc mpc834x_itxgp_defconfig powerpc g5_defconfig armmvebu_v5_defconfig armhisi_defconfig sh se7750_defconfig arm hackkit_defconfig sh sh03_defconfig powerpc ep8248e_defconfig shtitan_defconfig armxcep_defconfig powerpcsam440ep_defconfig sh se7724_defconfig powerpc eiger_defconfig xtensa defconfig armneponset_defconfig sh j2_defconfig arm64alldefconfig powerpc rainier_defconfig xtensa audio_kc705_defconfig powerpc mpc5200_defconfig sh se7722_defconfig sh sdk7780_defconfig arm pcm027_defconfig powerpcgamecube_defconfig arm moxart_defconfig powerpc mpc832x_rdb_defconfig sparc sparc64_defconfig powerpc iss476-smp_defconfig sh kfr2r09_defconfig m68k apollo_defconfig m68km5407c3_defconfig armpleb_defconfig xtensasmp_lx200_defconfig sh microdev_defconfig shapsh4ad0a_defconfig sh kfr2r09-romimage_defconfig arm eseries_pxa_defconfig arc nsimosci_hs_smp_defconfig sh sh2007_defconfig arm randconfig-c002-20211126 ia64 allmodconfig ia64defconfig m68k allmodconfig m68kdefconfig m68k allyesconfig nios2 defconfig arc allyesconfig nds32 allnoconfig nds32 defconfig nios2allyesconfig cskydefconfig alpha defconfig alphaallyesconfig xtensa allyesconfig h8300allyesconfig arc defconfig sh allmodconfig parisc defconfig s390 allyesconfig s390 allmodconfig parisc allyesconfig s390defconfig i386 allyesconfig sparcallyesconfig sparc defconfig i386defconfig i386 debian-10.3-kselftests i386 debian-10.3 mips allyesconfig mips allmodconfig powerpc allyesconfig powerpc allmodconfig powerpc allnoconfig x86_64
[driver-core:driver-core-testing 5/7] drivers/base/firmware_loader/test-builtin/test-builtin-firmware.bin.gen.S:5: Error: file not found: drivers/base/firmware_loader/test-builtin/test-builtin-firmwar
tree: https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core.git driver-core-testing head: 7f67ea9c19735222f7999754f3fee922cd8f4781 commit: 6a4e0b75cfa09e70c0aa39a03b478641cf2a7974 [5/7] test_firmware: add support for testing built-in firmware config: powerpc-allyesconfig (https://download.01.org/0day-ci/archive/20211127/202111271140.xmh9icbt-...@intel.com/config) compiler: powerpc-linux-gcc (GCC) 11.2.0 reproduce (this is a W=1 build): wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross # https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core.git/commit/?id=6a4e0b75cfa09e70c0aa39a03b478641cf2a7974 git remote add driver-core https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core.git git fetch --no-tags driver-core driver-core-testing git checkout 6a4e0b75cfa09e70c0aa39a03b478641cf2a7974 # save the config file to linux build tree mkdir build_dir COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=powerpc SHELL=/bin/bash If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot All errors (new ones prefixed by >>): drivers/base/firmware_loader/test-builtin/test-builtin-firmware.bin.gen.S: Assembler messages: >> drivers/base/firmware_loader/test-builtin/test-builtin-firmware.bin.gen.S:5: >> Error: file not found: >> drivers/base/firmware_loader/test-builtin/test-builtin-firmware.bin --- 0-DAY CI Kernel Test Service, Intel Corporation https://lists.01.org/hyperkitty/list/kbuild-...@lists.01.org ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v3 1/1] staging: ion: Prevent incorrect reference counting behavour
On Fri, Nov 26, 2021 at 10:33:35AM +, Lee Jones wrote: > Supply additional checks in order to prevent unexpected results. > > Fixes: b892bf75b2034 ("ion: Switch ion to use dma-buf") > Suggested-by: Dan Carpenter > Signed-off-by: Lee Jones > --- > Destined for v4.4.y and v4.9.y Thanks! regards, dan carpenter ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v3 1/1] staging: ion: Prevent incorrect reference counting behavour
Supply additional checks in order to prevent unexpected results. Fixes: b892bf75b2034 ("ion: Switch ion to use dma-buf") Suggested-by: Dan Carpenter Signed-off-by: Lee Jones --- Destined for v4.4.y and v4.9.y drivers/staging/android/ion/ion.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/drivers/staging/android/ion/ion.c b/drivers/staging/android/ion/ion.c index 806e9b30b9dc8..aac9b38b8c25c 100644 --- a/drivers/staging/android/ion/ion.c +++ b/drivers/staging/android/ion/ion.c @@ -489,6 +489,9 @@ static void *ion_buffer_kmap_get(struct ion_buffer *buffer) void *vaddr; if (buffer->kmap_cnt) { + if (buffer->kmap_cnt == INT_MAX) + return ERR_PTR(-EOVERFLOW); + buffer->kmap_cnt++; return buffer->vaddr; } @@ -509,6 +512,9 @@ static void *ion_handle_kmap_get(struct ion_handle *handle) void *vaddr; if (handle->kmap_cnt) { + if (handle->kmap_cnt == INT_MAX) + return ERR_PTR(-EOVERFLOW); + handle->kmap_cnt++; return buffer->vaddr; } -- 2.34.0.rc2.393.gf8c9666880-goog ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 1/1] staging: ion: Prevent incorrect reference counting behavour
On Fri, 26 Nov 2021, Greg KH wrote: > On Fri, Nov 26, 2021 at 08:56:27AM +, Lee Jones wrote: > > On Fri, 26 Nov 2021, Dan Carpenter wrote: > > > > > On Thu, Nov 25, 2021 at 06:18:22PM +0300, Dan Carpenter wrote: > > > > I had thought that ->kmap_cnt was a regular int and not an unsigned > > > > int, but I would have to pull a stable tree to see where I misread the > > > > code. > > > > > > I was looking at (struct ion_buffer)->kmap_cnt but this is > > > (struct ion_handle)->kmap_cnt. I'm not sure how those are related but > > > it makes me nervous that one can go higher than the other. Also both > > > probably need overflow protection. > > > > > > So I guess I would just do something like: > > > > > > diff --git a/drivers/staging/android/ion/ion.c > > > b/drivers/staging/android/ion/ion.c > > > index 806e9b30b9dc8..e8846279b33b5 100644 > > > --- a/drivers/staging/android/ion/ion.c > > > +++ b/drivers/staging/android/ion/ion.c > > > @@ -489,6 +489,8 @@ static void *ion_buffer_kmap_get(struct ion_buffer > > > *buffer) > > > void *vaddr; > > > > > > if (buffer->kmap_cnt) { > > > + if (buffer->kmap_cnt == INT_MAX) > > > + return ERR_PTR(-EOVERFLOW); > > > buffer->kmap_cnt++; > > > return buffer->vaddr; > > > } > > > @@ -509,6 +511,8 @@ static void *ion_handle_kmap_get(struct ion_handle > > > *handle) > > > void *vaddr; > > > > > > if (handle->kmap_cnt) { > > > + if (handle->kmap_cnt == INT_MAX) > > > + return ERR_PTR(-EOVERFLOW); > > > handle->kmap_cnt++; > > > return buffer->vaddr; > > > } > > > > Which is all well and good until somebody changes the type. > > That's hard to do on code that is removed from the kernel tree :) That's a difficult stance to take when reviewing a patch which changes the very code you base your argument on. :D I'll do with Dan's PoV though - no sympathy given. :) v3 to follow. -- Lee Jones [李琼斯] Senior Technical Lead - Developer Services Linaro.org │ Open source software for Arm SoCs Follow Linaro: Facebook | Twitter | Blog ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 1/1] staging: ion: Prevent incorrect reference counting behavour
On Fri, Nov 26, 2021 at 08:56:27AM +, Lee Jones wrote: > On Fri, 26 Nov 2021, Dan Carpenter wrote: > > > On Thu, Nov 25, 2021 at 06:18:22PM +0300, Dan Carpenter wrote: > > > I had thought that ->kmap_cnt was a regular int and not an unsigned > > > int, but I would have to pull a stable tree to see where I misread the > > > code. > > > > I was looking at (struct ion_buffer)->kmap_cnt but this is > > (struct ion_handle)->kmap_cnt. I'm not sure how those are related but > > it makes me nervous that one can go higher than the other. Also both > > probably need overflow protection. > > > > So I guess I would just do something like: > > > > diff --git a/drivers/staging/android/ion/ion.c > > b/drivers/staging/android/ion/ion.c > > index 806e9b30b9dc8..e8846279b33b5 100644 > > --- a/drivers/staging/android/ion/ion.c > > +++ b/drivers/staging/android/ion/ion.c > > @@ -489,6 +489,8 @@ static void *ion_buffer_kmap_get(struct ion_buffer > > *buffer) > > void *vaddr; > > > > if (buffer->kmap_cnt) { > > + if (buffer->kmap_cnt == INT_MAX) > > + return ERR_PTR(-EOVERFLOW); > > buffer->kmap_cnt++; > > return buffer->vaddr; > > } > > @@ -509,6 +511,8 @@ static void *ion_handle_kmap_get(struct ion_handle > > *handle) > > void *vaddr; > > > > if (handle->kmap_cnt) { > > + if (handle->kmap_cnt == INT_MAX) > > + return ERR_PTR(-EOVERFLOW); > > handle->kmap_cnt++; > > return buffer->vaddr; > > } > > Which is all well and good until somebody changes the type. That's hard to do on code that is removed from the kernel tree :) ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 1/1] staging: ion: Prevent incorrect reference counting behavour
On Fri, Nov 26, 2021 at 08:56:27AM +, Lee Jones wrote: > On Fri, 26 Nov 2021, Dan Carpenter wrote: > > > On Thu, Nov 25, 2021 at 06:18:22PM +0300, Dan Carpenter wrote: > > > I had thought that ->kmap_cnt was a regular int and not an unsigned > > > int, but I would have to pull a stable tree to see where I misread the > > > code. > > > > I was looking at (struct ion_buffer)->kmap_cnt but this is > > (struct ion_handle)->kmap_cnt. I'm not sure how those are related but > > it makes me nervous that one can go higher than the other. Also both > > probably need overflow protection. > > > > So I guess I would just do something like: > > > > diff --git a/drivers/staging/android/ion/ion.c > > b/drivers/staging/android/ion/ion.c > > index 806e9b30b9dc8..e8846279b33b5 100644 > > --- a/drivers/staging/android/ion/ion.c > > +++ b/drivers/staging/android/ion/ion.c > > @@ -489,6 +489,8 @@ static void *ion_buffer_kmap_get(struct ion_buffer > > *buffer) > > void *vaddr; > > > > if (buffer->kmap_cnt) { > > + if (buffer->kmap_cnt == INT_MAX) > > + return ERR_PTR(-EOVERFLOW); > > buffer->kmap_cnt++; > > return buffer->vaddr; > > } > > @@ -509,6 +511,8 @@ static void *ion_handle_kmap_get(struct ion_handle > > *handle) > > void *vaddr; > > > > if (handle->kmap_cnt) { > > + if (handle->kmap_cnt == INT_MAX) > > + return ERR_PTR(-EOVERFLOW); > > handle->kmap_cnt++; > > return buffer->vaddr; > > } > > Which is all well and good until somebody changes the type. It would only break if they change it to something smaller than an int. I have zero sympathy for them if they do that. regards, dan carpenter ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 1/1] staging: ion: Prevent incorrect reference counting behavour
On Fri, 26 Nov 2021, Dan Carpenter wrote: > On Thu, Nov 25, 2021 at 06:18:22PM +0300, Dan Carpenter wrote: > > I had thought that ->kmap_cnt was a regular int and not an unsigned > > int, but I would have to pull a stable tree to see where I misread the > > code. > > I was looking at (struct ion_buffer)->kmap_cnt but this is > (struct ion_handle)->kmap_cnt. I'm not sure how those are related but > it makes me nervous that one can go higher than the other. Also both > probably need overflow protection. > > So I guess I would just do something like: > > diff --git a/drivers/staging/android/ion/ion.c > b/drivers/staging/android/ion/ion.c > index 806e9b30b9dc8..e8846279b33b5 100644 > --- a/drivers/staging/android/ion/ion.c > +++ b/drivers/staging/android/ion/ion.c > @@ -489,6 +489,8 @@ static void *ion_buffer_kmap_get(struct ion_buffer > *buffer) > void *vaddr; > > if (buffer->kmap_cnt) { > + if (buffer->kmap_cnt == INT_MAX) > + return ERR_PTR(-EOVERFLOW); > buffer->kmap_cnt++; > return buffer->vaddr; > } > @@ -509,6 +511,8 @@ static void *ion_handle_kmap_get(struct ion_handle > *handle) > void *vaddr; > > if (handle->kmap_cnt) { > + if (handle->kmap_cnt == INT_MAX) > + return ERR_PTR(-EOVERFLOW); > handle->kmap_cnt++; > return buffer->vaddr; > } Which is all well and good until somebody changes the type. -- Lee Jones [李琼斯] Senior Technical Lead - Developer Services Linaro.org │ Open source software for Arm SoCs Follow Linaro: Facebook | Twitter | Blog ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel