-
Notifications
You must be signed in to change notification settings - Fork 717
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Networking with CAN-J1939 support (Ubuntu Linux) ./testj1939 #159
Comments
Hi @josemic, thank you for testing!
So, lets do it one by one:
|
Hi @olerem, If you are refferring with 3. to the following, then I get the same result as before (except of the timestamp): On terminal 2:
On terminal 3: Output on terminal 1:
Output on terminal 3:
If you are referring with 3. to something else, please let me know to what you are refferring. |
Hi @josemic ,
Int this line you are missing FF on the end ^
On this line you are spotted real bug ^ |
Hi @olerem, to 1: to 3:
This was not my copy and paste error. This comes directly from "can-j1939-kickstart.md". Please note that this occurs twice in "can-j1939-kickstart.md". Could you please patch "can-j1939-kickstart.md"? |
@josemic |
@marckleinebudde |
I am trying the address claiming daemon jacd and I get the following result:
I have CAN initilized with:
What am I doing wrong? |
I have upgraded to kernel 5.4rc5. Still the same errors. Jacd also fails:
|
…end with the total message size set We were sending malformed EOMA messageswith total message size set to 0. This patch fixes the bug. Reported-by: linux-can/can-utils#159 Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de> Acked-by: Kurt Van Dijck <dev.kurt@vandijck-laurijssen.be> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
…end with the total message size set We were sending malformed EOMA messageswith total message size set to 0. This patch fixes the bug. Reported-by: linux-can/can-utils#159 Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de> Acked-by: Kurt Van Dijck <dev.kurt@vandijck-laurijssen.be> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
I have upgraded to kernel 5.4rc6. Still the same errors. |
Works for me:
Do you actually have can0 interface? is it configured? |
Hi @olerem, I have configured can0 as following, is this sufficient?
I have updated can-utils/jacd to the latest version.
and with -v option:
|
Hm.. i reproduced it after switching to not root mode. @marckleinebudde, we need to think about permissions |
@olerem:
Result is:
and with -v option:
and with -v option and previous temp file:
and strangely the prompt returns and candump output is empty:
prompt does not return and candump output is:
|
@josemic , sorry, i can't confirm it:
|
@olerem: Now it looks a little bit different (note: I changed vcan0 to can0): On terminal 1: On terminal 2:
No output on terminal 1. Looks still like a permission problem. Could it be that the signal handler in jacd is running without su rights? |
@olerem:
Sometimes also "success" is printed, but noting else and no candump output is generated. Also the prompt returns immediately:
Terminal 1:
Somehow the address claim seems to be doubled. Terminal 2: Terminal 3: |
I have upgraded to kernel 5.4rc8. Still the same errors. @olerem: Thus this patch is missing for j1939.h: and networking/j1939.rst needs to be changed as following:
|
I have upgraded to kernel 5.4. Still the same errors. |
@josemic , we have limited resources to fix all found bugs. For now I was able to spend a fix to respond on critical issues reported by google syzbot. Now I need to work on other projects and will be able to spends some time once a week. It is not match, but if you provide effective bug reports, I'll be able to handle them. Please, separate different issues to different bug reports. I already lost a track of what is actually not working for you. If I answer you that I'm not able to reproduce it, then it is really the case. And I will need a help to reproduce it. Doing regular status report of kernel x.y.z will not help. Only in case I or some one else will write here, this bug was solved by patch X, then it will be time to test it. If you have time to fix your issue, please do it. It is opensource project and it works only if all who use it participate in fixing bugs and extend functionality. |
This refers to usage of testj1939.c and especially to you following message.
I have upgraded to kernel 5.4. Still the same errors: 1., 2. & 3. I expected that you have fixed 1. Let this bug #159 refer only to the above testj1939.c issues, I have for the other issue created the bugs #173 and #174. |
Hi @olerem, |
When testing the priorities, I noticed, that for the priorities 0 and 1, the message occurs, that setting the priority is not permitted:
Works ok.
I am not aware that the priorities 0 & 1 are not permitted. |
Priorities 0 and 1 are only permitted for https://elixir.bootlin.com/linux/latest/source/net/can/j1939/socket.c#L705 I think this limit is arbitrary and we can discuss if this makes sense at all or add this to the documentation. |
@marckleinebudde : |
On github a question[1] about j1939 priorities popped up:
On 12/2/19 11:53 PM, josemic wrote:
At least in the ISOBUS standard I am not aware the the priorities 0 an 1
require special handling compared to the other priorities 2-7. I am not
aware, if this is the case for the other J1939 based standards. However
if this is not the case, I recommend to remove the root requirements and
capabilities requirement CAP_NET_ADMIN for the priorities 0 and 1.
As I am not familiar with the usage of capabilities, could you please
explain how to set the capabilities CAP_NET_ADMIN for the command line
or any userspace program.
[1]
#159 (comment)
Marc
|
During development the define J1939_PGN_ADDRESS_REQUEST was renamed to J1939_PGN_REQUEST. It was forgotten to adjust the documentation accordingly. This patch fixes the name of the symbol. Reported-by: linux-can/can-utils#159 (comment) Fixes: 9d71dd0 ("can: add support of SAE J1939 protocol") Cc: Oleksij Rempel <o.rempel@pengutronix.de> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
During development the define J1939_PGN_ADDRESS_REQUEST was renamed to J1939_PGN_REQUEST. It was forgotten to adjust the documentation accordingly. This patch fixes the name of the symbol. Reported-by: linux-can/can-utils#159 (comment) Fixes: 9d71dd0 ("can: add support of SAE J1939 protocol") Cc: Oleksij Rempel <o.rempel@pengutronix.de> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
During development the define J1939_PGN_ADDRESS_REQUEST was renamed to J1939_PGN_REQUEST. It was forgotten to adjust the documentation accordingly. This patch fixes the name of the symbol. Reported-by: linux-can/can-utils#159 (comment) Fixes: 9d71dd0 ("can: add support of SAE J1939 protocol") Cc: Oleksij Rempel <o.rempel@pengutronix.de> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
commit 8ac9d71 upstream. During development the define J1939_PGN_ADDRESS_REQUEST was renamed to J1939_PGN_REQUEST. It was forgotten to adjust the documentation accordingly. This patch fixes the name of the symbol. Reported-by: linux-can/can-utils#159 (comment) Fixes: 9d71dd0 ("can: add support of SAE J1939 protocol") Cc: Oleksij Rempel <o.rempel@pengutronix.de> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
I have retested with Ubuntu 20.04, the procedures described in can-j1939-kickstart.md. They are working now.
|
…end with the total message size set mainline inclusion from mainline-v5.4-rc7 commit eaa654f category: bugfix bugzilla: 38684 CVE: NA --------------------------- We were sending malformed EOMA messageswith total message size set to 0. This patch fixes the bug. Reported-by: linux-can/can-utils#159 Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de> Acked-by: Kurt Van Dijck <dev.kurt@vandijck-laurijssen.be> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> Signed-off-by: Zhang Changzhong <zhangchangzhong@huawei.com> Reviewed-by: YueHaibing <yuehaibing@huawei.com> Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
mainline inclusion from mainline-v5.5-rc3 commit 8ac9d71 category: feature bugzilla: 38684 CVE: NA --------------------------- During development the define J1939_PGN_ADDRESS_REQUEST was renamed to J1939_PGN_REQUEST. It was forgotten to adjust the documentation accordingly. This patch fixes the name of the symbol. Reported-by: linux-can/can-utils#159 (comment) Fixes: 9d71dd0 ("can: add support of SAE J1939 protocol") Cc: Oleksij Rempel <o.rempel@pengutronix.de> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> Signed-off-by: Zhang Changzhong <zhangchangzhong@huawei.com> Reviewed-by: Yue Haibing <yuehaibing@huawei.com> Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
I have installed linux kernel 5.4rc4, as described in this link on Ubuntu 19.10.
I go forward as desribed in can-j1939-kickstart.md.
On terminal 1:
./testj1939 -r can0:
On terminal 2:
cansend can0 1823ff40#0123
Result:
No output on terminal 1.
On terminal 2:
cansend can0 18234140#0123
Result (on terminal1):
No output.
On terminal 1:
./testj1939 -r can0:0x80
On terminal 2:
cansend can0 18238040#0123
Result (on terminal 1):
40 02300: 01 23
Which was expected.
On terminal 1:
candump -L can0
On terminal 2:
./testj1939 -s can0:0x80,0x3ffff
Result (on terminal 2):
./testj1939: sendto: Permission denied
On terminal 2:
./testj1939 -s can0:0x90,0x3ffff
Result (on terminal 2):
./testj1939: sendto: Permission denied
On terminal 2:
./testj1939 -s can0:0x80,0x12345
Result (on terminal 2):
./testj1939: bind(): Invalid argument
On terminal 2:
./testj1939 -s can0:,0x12300 :0x40
Result (on terminal 2):
./testj1939: sendto: File descriptor in bad state
On terminal 2:
./testj1939 -s can0:0x80,0x12300 :,0x32100
Result (on terminal 2):
./testj1939: sendto: Permission denied
On terminal 2:
./testj1939 -s can0:0x80,0x12300 :0x40,0x32100
Result (on terminal 1):
(1571942859.574852) can0 1B214080#0123456789ABCDEF
Which was beside the timestamp expected.
On terminal 2:
./testj1939 -s20 can0:0x80 :,0x12300
Result (on terminal 2):
./testj1939: sendto: Permission denied
On terminal 2:
./testj1939 -w1.0 -s20 can0:0x80 :,0x12300
Result (on terminal 2):
./testj1939: sendto: Permission denied
On terminal 3:
./testj1939 can0:0x90 -r &
Result (on terminal 3):
[1] 27414
On terminal 2:
./testj1939 -s20 can0:0x80 :0x90,0x12300
Result (on terminal 3):
Result (on terminal 1 (candump)):
However, besides the timestamps expected was:
On terminal 2:
./testj1939 -s can0:0x80,0x0100
Result (on terminal 2):
./testj1939: sendto: Permission denied
On terminal 2:
./testj1939 -s -p3 can0:0x80,0x0200
Result (on terminal 2):
./testj1939: sendto: Permission denied
The text was updated successfully, but these errors were encountered: