4a9dda1c | 01-Apr-2022 |
Matt Johnston <matt@codeconstruct.com.au> |
mctp: Use output netdev to allocate skb headroom
Previously the skb was allocated with headroom MCTP_HEADER_MAXLEN, but that isn't sufficient if we are using devs that are not MCTP specific.
This a
mctp: Use output netdev to allocate skb headroom
Previously the skb was allocated with headroom MCTP_HEADER_MAXLEN, but that isn't sufficient if we are using devs that are not MCTP specific.
This also adds a check that the smctp_halen provided to sendmsg for extended addressing is the correct size for the netdev.
Fixes: 833ef3b91de6 ("mctp: Populate socket implementation") Reported-by: Matthew Rinaldi <mjrinal@g.clemson.edu> Signed-off-by: Matt Johnston <matt@codeconstruct.com.au> Signed-off-by: David S. Miller <davem@davemloft.net>
show more ...
|
8d783197 | 22-Feb-2022 |
Matt Johnston <matt@codeconstruct.com.au> |
mctp: Fix warnings reported by clang-analyzer
net/mctp/device.c:140:11: warning: Assigned value is garbage or undefined [clang-analyzer-core.uninitialized.Assign] mcb->idx = idx;
- Not a re
mctp: Fix warnings reported by clang-analyzer
net/mctp/device.c:140:11: warning: Assigned value is garbage or undefined [clang-analyzer-core.uninitialized.Assign] mcb->idx = idx;
- Not a real problem due to how the callback runs, fix the warning.
net/mctp/route.c:458:4: warning: Value stored to 'msk' is never read [clang-analyzer-deadcode.DeadStores] msk = container_of(key->sk, struct mctp_sock, sk);
- 'msk' dead assignment can be removed here.
Signed-off-by: Matt Johnston <matt@codeconstruct.com.au> Signed-off-by: David S. Miller <davem@davemloft.net>
show more ...
|
e297db3e | 22-Feb-2022 |
Matt Johnston <matt@codeconstruct.com.au> |
mctp: Fix incorrect netdev unref for extended addr
In the extended addressing local route output codepath dev_get_by_index_rcu() doesn't take a dev_hold() so we shouldn't dev_put().
Signed-off-by:
mctp: Fix incorrect netdev unref for extended addr
In the extended addressing local route output codepath dev_get_by_index_rcu() doesn't take a dev_hold() so we shouldn't dev_put().
Signed-off-by: Matt Johnston <matt@codeconstruct.com.au> Signed-off-by: David S. Miller <davem@davemloft.net>
show more ...
|
86cdfd63 | 18-Feb-2022 |
Jeremy Kerr <jk@codeconstruct.com.au> |
mctp: add address validity checking for packet receive
This change adds some basic sanity checks for the source and dest headers of packets on initial receive.
Signed-off-by: Jeremy Kerr <jk@codeco
mctp: add address validity checking for packet receive
This change adds some basic sanity checks for the source and dest headers of packets on initial receive.
Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
show more ...
|
63ed1aab | 09-Feb-2022 |
Matt Johnston <matt@codeconstruct.com.au> |
mctp: Add SIOCMCTP{ALLOC,DROP}TAG ioctls for tag control
This change adds a couple of new ioctls for mctp sockets: SIOCMCTPALLOCTAG and SIOCMCTPDROPTAG. These ioctls provide facilities for explicit
mctp: Add SIOCMCTP{ALLOC,DROP}TAG ioctls for tag control
This change adds a couple of new ioctls for mctp sockets: SIOCMCTPALLOCTAG and SIOCMCTPDROPTAG. These ioctls provide facilities for explicit allocation / release of tags, overriding the automatic allocate-on-send/release-on-reply and timeout behaviours. This allows userspace more control over messages that may not fit a simple request/response model.
In order to indicate a pre-allocated tag to the sendmsg() syscall, we introduce a new flag to the struct sockaddr_mctp.smctp_tag value: MCTP_TAG_PREALLOC.
Additional changes from Jeremy Kerr <jk@codeconstruct.com.au>.
Contains a fix that was: Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Matt Johnston <matt@codeconstruct.com.au> Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au> Signed-off-by: David S. Miller <davem@davemloft.net>
show more ...
|
0de55a7d | 09-Feb-2022 |
Jeremy Kerr <jk@codeconstruct.com.au> |
mctp: Allow keys matching any local address
Currently, we require an exact match on an incoming packet's dest address, and the key's local_addr field.
In a future change, we may want to set up a ke
mctp: Allow keys matching any local address
Currently, we require an exact match on an incoming packet's dest address, and the key's local_addr field.
In a future change, we may want to set up a key before packets are routed, meaning we have no local address to match on.
This change allows key lookups to match on local_addr = MCTP_ADDR_ANY.
Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au> Signed-off-by: David S. Miller <davem@davemloft.net>
show more ...
|
8069b22d | 09-Feb-2022 |
Jeremy Kerr <jk@codeconstruct.com.au> |
mctp: Add helper for address match checking
Currently, we have a couple of paths that check that an EID matches, or the match value is MCTP_ADDR_ANY.
Rather than open coding this, add a little help
mctp: Add helper for address match checking
Currently, we have a couple of paths that check that an EID matches, or the match value is MCTP_ADDR_ANY.
Rather than open coding this, add a little helper.
Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au> Signed-off-by: David S. Miller <davem@davemloft.net>
show more ...
|
c5755214 | 09-Feb-2022 |
Jeremy Kerr <jk@codeconstruct.com.au> |
mctp: tests: Add key state tests
This change adds a few more tests to check the key/tag lookups on route input. We add a specific entry to the keys lists, route a packet with specific header values,
mctp: tests: Add key state tests
This change adds a few more tests to check the key/tag lookups on route input. We add a specific entry to the keys lists, route a packet with specific header values, and check for key match/mismatch.
Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au> Signed-off-by: David S. Miller <davem@davemloft.net>
show more ...
|