<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-toradex.git/drivers/macintosh, branch v6.0-rc4</title>
<subtitle>Linux kernel for Apalis and Colibri modules</subtitle>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/'/>
<entry>
<title>macintosh/adb: fix oob read in do_adb_query() function</title>
<updated>2022-07-20T12:06:30+00:00</updated>
<author>
<name>Ning Qiang</name>
<email>sohu0106@126.com</email>
</author>
<published>2022-07-13T15:37:34+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=fd97e4ad6d3b0c9fce3bca8ea8e6969d9ce7423b'/>
<id>fd97e4ad6d3b0c9fce3bca8ea8e6969d9ce7423b</id>
<content type='text'>
In do_adb_query() function of drivers/macintosh/adb.c, req-&gt;data is copied
form userland. The parameter "req-&gt;data[2]" is missing check, the array
size of adb_handler[] is 16, so adb_handler[req-&gt;data[2]].original_address and
adb_handler[req-&gt;data[2]].handler_id will lead to oob read.

Cc: stable &lt;stable@kernel.org&gt;
Signed-off-by: Ning Qiang &lt;sohu0106@126.com&gt;
Reviewed-by: Kees Cook &lt;keescook@chromium.org&gt;
Reviewed-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Acked-by: Benjamin Herrenschmidt &lt;benh@kernel.crashing.org&gt;
Signed-off-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
Link: https://lore.kernel.org/r/20220713153734.2248-1-sohu0106@126.com
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In do_adb_query() function of drivers/macintosh/adb.c, req-&gt;data is copied
form userland. The parameter "req-&gt;data[2]" is missing check, the array
size of adb_handler[] is 16, so adb_handler[req-&gt;data[2]].original_address and
adb_handler[req-&gt;data[2]].handler_id will lead to oob read.

Cc: stable &lt;stable@kernel.org&gt;
Signed-off-by: Ning Qiang &lt;sohu0106@126.com&gt;
Reviewed-by: Kees Cook &lt;keescook@chromium.org&gt;
Reviewed-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Acked-by: Benjamin Herrenschmidt &lt;benh@kernel.crashing.org&gt;
Signed-off-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
Link: https://lore.kernel.org/r/20220713153734.2248-1-sohu0106@126.com
</pre>
</div>
</content>
</entry>
<entry>
<title>macintosh: via-pmu and via-cuda need RTC_LIB</title>
<updated>2022-05-22T05:58:30+00:00</updated>
<author>
<name>Randy Dunlap</name>
<email>rdunlap@infradead.org</email>
</author>
<published>2022-04-10T16:10:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=9a9c5ff5fff87eb1a43db0d899473554e408fd7b'/>
<id>9a9c5ff5fff87eb1a43db0d899473554e408fd7b</id>
<content type='text'>
Fix build when RTC_LIB is not set/enabled.
Eliminates these build errors:

m68k-linux-ld: drivers/macintosh/via-pmu.o: in function `pmu_set_rtc_time':
drivers/macintosh/via-pmu.c:1769: undefined reference to `rtc_tm_to_time64'
m68k-linux-ld: drivers/macintosh/via-cuda.o: in function `cuda_set_rtc_time':
drivers/macintosh/via-cuda.c:797: undefined reference to `rtc_tm_to_time64'

Fixes: 0792a2c8e0bb ("macintosh: Use common code to access RTC")
Reported-by: kernel test robot &lt;lkp@intel.com&gt;
Suggested-by: Christophe Leroy &lt;christophe.leroy@csgroup.eu&gt;
Signed-off-by: Randy Dunlap &lt;rdunlap@infradead.org&gt;
Acked-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
Signed-off-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
Link: https://lore.kernel.org/r/20220410161035.592-1-rdunlap@infradead.org

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fix build when RTC_LIB is not set/enabled.
Eliminates these build errors:

m68k-linux-ld: drivers/macintosh/via-pmu.o: in function `pmu_set_rtc_time':
drivers/macintosh/via-pmu.c:1769: undefined reference to `rtc_tm_to_time64'
m68k-linux-ld: drivers/macintosh/via-cuda.o: in function `cuda_set_rtc_time':
drivers/macintosh/via-cuda.c:797: undefined reference to `rtc_tm_to_time64'

Fixes: 0792a2c8e0bb ("macintosh: Use common code to access RTC")
Reported-by: kernel test robot &lt;lkp@intel.com&gt;
Suggested-by: Christophe Leroy &lt;christophe.leroy@csgroup.eu&gt;
Signed-off-by: Randy Dunlap &lt;rdunlap@infradead.org&gt;
Acked-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
Signed-off-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
Link: https://lore.kernel.org/r/20220410161035.592-1-rdunlap@infradead.org

</pre>
</div>
</content>
</entry>
<entry>
<title>macintosh/via-pmu: Fix build failure when CONFIG_INPUT is disabled</title>
<updated>2022-05-22T05:58:30+00:00</updated>
<author>
<name>Finn Thain</name>
<email>fthain@linux-m68k.org</email>
</author>
<published>2022-04-07T10:11:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=86ce436e30d86327c9f5260f718104ae7b21f506'/>
<id>86ce436e30d86327c9f5260f718104ae7b21f506</id>
<content type='text'>
drivers/macintosh/via-pmu-event.o: In function `via_pmu_event':
via-pmu-event.c:(.text+0x44): undefined reference to `input_event'
via-pmu-event.c:(.text+0x68): undefined reference to `input_event'
via-pmu-event.c:(.text+0x94): undefined reference to `input_event'
via-pmu-event.c:(.text+0xb8): undefined reference to `input_event'
drivers/macintosh/via-pmu-event.o: In function `via_pmu_event_init':
via-pmu-event.c:(.init.text+0x20): undefined reference to `input_allocate_device'
via-pmu-event.c:(.init.text+0xc4): undefined reference to `input_register_device'
via-pmu-event.c:(.init.text+0xd4): undefined reference to `input_free_device'
make[1]: *** [Makefile:1155: vmlinux] Error 1
make: *** [Makefile:350: __build_one_by_one] Error 2

Don't call into the input subsystem unless CONFIG_INPUT is built-in.

Reported-by: kernel test robot &lt;lkp@intel.com&gt;
Signed-off-by: Finn Thain &lt;fthain@linux-m68k.org&gt;
Tested-by: Randy Dunlap &lt;rdunlap@infradead.org&gt;
Reviewed-by: Christophe Leroy &lt;christophe.leroy@csgroup.eu&gt;
Acked-by: Randy Dunlap &lt;rdunlap@infradead.org&gt;
Signed-off-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
Link: https://lore.kernel.org/r/5edbe76ce68227f71e09af4614cc4c1bd61c7ec8.1649326292.git.fthain@linux-m68k.org

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
drivers/macintosh/via-pmu-event.o: In function `via_pmu_event':
via-pmu-event.c:(.text+0x44): undefined reference to `input_event'
via-pmu-event.c:(.text+0x68): undefined reference to `input_event'
via-pmu-event.c:(.text+0x94): undefined reference to `input_event'
via-pmu-event.c:(.text+0xb8): undefined reference to `input_event'
drivers/macintosh/via-pmu-event.o: In function `via_pmu_event_init':
via-pmu-event.c:(.init.text+0x20): undefined reference to `input_allocate_device'
via-pmu-event.c:(.init.text+0xc4): undefined reference to `input_register_device'
via-pmu-event.c:(.init.text+0xd4): undefined reference to `input_free_device'
make[1]: *** [Makefile:1155: vmlinux] Error 1
make: *** [Makefile:350: __build_one_by_one] Error 2

Don't call into the input subsystem unless CONFIG_INPUT is built-in.

Reported-by: kernel test robot &lt;lkp@intel.com&gt;
Signed-off-by: Finn Thain &lt;fthain@linux-m68k.org&gt;
Tested-by: Randy Dunlap &lt;rdunlap@infradead.org&gt;
Reviewed-by: Christophe Leroy &lt;christophe.leroy@csgroup.eu&gt;
Acked-by: Randy Dunlap &lt;rdunlap@infradead.org&gt;
Signed-off-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
Link: https://lore.kernel.org/r/5edbe76ce68227f71e09af4614cc4c1bd61c7ec8.1649326292.git.fthain@linux-m68k.org

</pre>
</div>
</content>
</entry>
<entry>
<title>macintosh: Prepare cleanup of powerpc's asm/prom.h</title>
<updated>2022-05-11T13:06:39+00:00</updated>
<author>
<name>Christophe Leroy</name>
<email>christophe.leroy@csgroup.eu</email>
</author>
<published>2022-04-01T17:15:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=a486e512d1f3fb93b0406ab125f35777d22b47ba'/>
<id>a486e512d1f3fb93b0406ab125f35777d22b47ba</id>
<content type='text'>
powerpc's asm/prom.h brings some headers that it doesn't
need itself.

In order to clean it up, first add missing headers in
users of asm/prom.h

Signed-off-by: Christophe Leroy &lt;christophe.leroy@csgroup.eu&gt;
Signed-off-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
Link: https://lore.kernel.org/r/04961364547fe4556e30cb302b0e20a939b83426.1648833027.git.christophe.leroy@csgroup.eu

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
powerpc's asm/prom.h brings some headers that it doesn't
need itself.

In order to clean it up, first add missing headers in
users of asm/prom.h

Signed-off-by: Christophe Leroy &lt;christophe.leroy@csgroup.eu&gt;
Signed-off-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
Link: https://lore.kernel.org/r/04961364547fe4556e30cb302b0e20a939b83426.1648833027.git.christophe.leroy@csgroup.eu

</pre>
</div>
</content>
</entry>
<entry>
<title>macintosh: Use for_each_child_of_node() macro</title>
<updated>2022-05-04T09:37:46+00:00</updated>
<author>
<name>Zou Wei</name>
<email>zou_wei@huawei.com</email>
</author>
<published>2021-06-07T03:01:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=6c1e5600b7c305fe2b7c4967c14c4d0cc5a13fae'/>
<id>6c1e5600b7c305fe2b7c4967c14c4d0cc5a13fae</id>
<content type='text'>
Use for_each_child_of_node() macro instead of open coding it.

Reported-by: Hulk Robot &lt;hulkci@huawei.com&gt;
Signed-off-by: Zou Wei &lt;zou_wei@huawei.com&gt;
Signed-off-by: Christophe Leroy &lt;christophe.leroy@csgroup.eu&gt;
Signed-off-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
Link: https://lore.kernel.org/r/1623034908-30525-1-git-send-email-zou_wei@huawei.com

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Use for_each_child_of_node() macro instead of open coding it.

Reported-by: Hulk Robot &lt;hulkci@huawei.com&gt;
Signed-off-by: Zou Wei &lt;zou_wei@huawei.com&gt;
Signed-off-by: Christophe Leroy &lt;christophe.leroy@csgroup.eu&gt;
Signed-off-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
Link: https://lore.kernel.org/r/1623034908-30525-1-git-send-email-zou_wei@huawei.com

</pre>
</div>
</content>
</entry>
<entry>
<title>macintosh: Fix warning comparing pointer to 0</title>
<updated>2022-05-04T09:37:45+00:00</updated>
<author>
<name>Yang Li</name>
<email>yang.lee@linux.alibaba.com</email>
</author>
<published>2022-02-14T01:05:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=928b39645ec4985ea02dc3e3b45720d1456e190b'/>
<id>928b39645ec4985ea02dc3e3b45720d1456e190b</id>
<content type='text'>
Fix the following coccicheck warnings:
./drivers/macintosh/via-cuda.c:240:16-17: WARNING comparing pointer to 0
./drivers/macintosh/via-cuda.c:243:16-17: WARNING comparing pointer to
0, suggest !E
./drivers/macintosh/via-cuda.c:521:23-24: WARNING comparing pointer to 0

Reported-by: Abaci Robot &lt;abaci@linux.alibaba.com&gt;
Signed-off-by: Yang Li &lt;yang.lee@linux.alibaba.com&gt;
Signed-off-by: Christophe Leroy &lt;christophe.leroy@csgroup.eu&gt;
Signed-off-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
Link: https://lore.kernel.org/r/20220214010558.130201-1-yang.lee@linux.alibaba.com

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fix the following coccicheck warnings:
./drivers/macintosh/via-cuda.c:240:16-17: WARNING comparing pointer to 0
./drivers/macintosh/via-cuda.c:243:16-17: WARNING comparing pointer to
0, suggest !E
./drivers/macintosh/via-cuda.c:521:23-24: WARNING comparing pointer to 0

Reported-by: Abaci Robot &lt;abaci@linux.alibaba.com&gt;
Signed-off-by: Yang Li &lt;yang.lee@linux.alibaba.com&gt;
Signed-off-by: Christophe Leroy &lt;christophe.leroy@csgroup.eu&gt;
Signed-off-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
Link: https://lore.kernel.org/r/20220214010558.130201-1-yang.lee@linux.alibaba.com

</pre>
</div>
</content>
</entry>
<entry>
<title>macintosh/ams: Remove unneeded result variable</title>
<updated>2022-05-04T09:37:45+00:00</updated>
<author>
<name>Minghao Chi</name>
<email>chi.minghao@zte.com.cn</email>
</author>
<published>2022-01-18T07:52:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=e9bb94cde12d14e460b954f468af1200856564cf'/>
<id>e9bb94cde12d14e460b954f468af1200856564cf</id>
<content type='text'>
Return the value from i2c_add_driver() directly instead of storing it in
another redundant variable.

Reported-by: Zeal Robot &lt;zealci@zte.com.cn&gt;
Signed-off-by: Minghao Chi &lt;chi.minghao@zte.com.cn&gt;
Signed-off-by: CGEL ZTE &lt;cgel.zte@gmail.com&gt;
Signed-off-by: Christophe Leroy &lt;christophe.leroy@csgroup.eu&gt;
Signed-off-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
Link: https://lore.kernel.org/r/20220118075252.925616-1-chi.minghao@zte.com.cn

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Return the value from i2c_add_driver() directly instead of storing it in
another redundant variable.

Reported-by: Zeal Robot &lt;zealci@zte.com.cn&gt;
Signed-off-by: Minghao Chi &lt;chi.minghao@zte.com.cn&gt;
Signed-off-by: CGEL ZTE &lt;cgel.zte@gmail.com&gt;
Signed-off-by: Christophe Leroy &lt;christophe.leroy@csgroup.eu&gt;
Signed-off-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
Link: https://lore.kernel.org/r/20220118075252.925616-1-chi.minghao@zte.com.cn

</pre>
</div>
</content>
</entry>
<entry>
<title>macintosh/adb: Use swap() to make code cleaner</title>
<updated>2022-05-04T09:37:45+00:00</updated>
<author>
<name>Yang Guang</name>
<email>yang.guang5@zte.com.cn</email>
</author>
<published>2021-11-04T01:14:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=6130ed79decc38b873deb582678ac81caefd5555'/>
<id>6130ed79decc38b873deb582678ac81caefd5555</id>
<content type='text'>
Use the macro 'swap()' defined in 'include/linux/minmax.h' to avoid
opencoding it.

Reported-by: Zeal Robot &lt;zealci@zte.com.cn&gt;
Signed-off-by: Yang Guang &lt;yang.guang5@zte.com.cn&gt;
Signed-off-by: Christophe Leroy &lt;christophe.leroy@csgroup.eu&gt;
Signed-off-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
Link: https://lore.kernel.org/r/20211104011456.1027830-1-yang.guang5@zte.com.cn

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Use the macro 'swap()' defined in 'include/linux/minmax.h' to avoid
opencoding it.

Reported-by: Zeal Robot &lt;zealci@zte.com.cn&gt;
Signed-off-by: Yang Guang &lt;yang.guang5@zte.com.cn&gt;
Signed-off-by: Christophe Leroy &lt;christophe.leroy@csgroup.eu&gt;
Signed-off-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
Link: https://lore.kernel.org/r/20211104011456.1027830-1-yang.guang5@zte.com.cn

</pre>
</div>
</content>
</entry>
<entry>
<title>macintosh/ams: Replace snprintf in show functions with sysfs_emit</title>
<updated>2022-05-04T09:37:45+00:00</updated>
<author>
<name>Qing Wang</name>
<email>wangqing@vivo.com</email>
</author>
<published>2021-10-15T06:49:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=cc4639989e93f5be6445e1466937e0a455f9bd88'/>
<id>cc4639989e93f5be6445e1466937e0a455f9bd88</id>
<content type='text'>
show() must not use snprintf() when formatting the value to be returned
to user space.

Fix the following coccicheck warning:
  drivers/macintosh/ams/ams-core.c:53: WARNING: use scnprintf or sprintf.

Use sysfs_emit instead of scnprintf or sprintf makes more sense.

Signed-off-by: Qing Wang &lt;wangqing@vivo.com&gt;
Signed-off-by: Christophe Leroy &lt;christophe.leroy@csgroup.eu&gt;
Signed-off-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
Link: https://lore.kernel.org/r/1634280544-4581-1-git-send-email-wangqing@vivo.com

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
show() must not use snprintf() when formatting the value to be returned
to user space.

Fix the following coccicheck warning:
  drivers/macintosh/ams/ams-core.c:53: WARNING: use scnprintf or sprintf.

Use sysfs_emit instead of scnprintf or sprintf makes more sense.

Signed-off-by: Qing Wang &lt;wangqing@vivo.com&gt;
Signed-off-by: Christophe Leroy &lt;christophe.leroy@csgroup.eu&gt;
Signed-off-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
Link: https://lore.kernel.org/r/1634280544-4581-1-git-send-email-wangqing@vivo.com

</pre>
</div>
</content>
</entry>
<entry>
<title>macintosh/smu: Fix warning comparing pointer to 0</title>
<updated>2022-05-04T09:37:44+00:00</updated>
<author>
<name>Jing Yangyang</name>
<email>jing.yangyang@zte.com.cn</email>
</author>
<published>2021-08-25T06:18:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=8cd1d2e9d08654b66c17432eccd404de9137ac08'/>
<id>8cd1d2e9d08654b66c17432eccd404de9137ac08</id>
<content type='text'>
Fix the following coccicheck warning:
  ./drivers/macintosh/smu.c:1089: 11-12:
   WARNING comparing pointer to 0, suggest !E
  ./drivers/macintosh/smu.c:1256:11-12:
  WARNING comparing pointer to 0

Reported-by: Zeal Robot &lt;zealci@zte.com.cn&gt;
Signed-off-by: Jing Yangyang &lt;jing.yangyang@zte.com.cn&gt;
Signed-off-by: Christophe Leroy &lt;christophe.leroy@csgroup.eu&gt;
Signed-off-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
Link: https://lore.kernel.org/r/20210825061838.69746-1-deng.changcheng@zte.com.cn

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fix the following coccicheck warning:
  ./drivers/macintosh/smu.c:1089: 11-12:
   WARNING comparing pointer to 0, suggest !E
  ./drivers/macintosh/smu.c:1256:11-12:
  WARNING comparing pointer to 0

Reported-by: Zeal Robot &lt;zealci@zte.com.cn&gt;
Signed-off-by: Jing Yangyang &lt;jing.yangyang@zte.com.cn&gt;
Signed-off-by: Christophe Leroy &lt;christophe.leroy@csgroup.eu&gt;
Signed-off-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
Link: https://lore.kernel.org/r/20210825061838.69746-1-deng.changcheng@zte.com.cn

</pre>
</div>
</content>
</entry>
</feed>
