| Age | Commit message (Collapse) | Author |
|
Use atomic_load_consume or atomic_load_relaxed where necessary.
Comment on why unlocked nonatomic access is valid where it is done.
|
|
Not sure if this should truncate the result or just fail with nonzero
error code (ENOBUFS?). Feel free to change this the other way if you
know better!
Reported-by: syzbot+54c34f25d1e4124eb85d@syzkaller.appspotmail.com
|
|
write buffer associated with the file descriptor is empty. This is
currently implemented only for sockets, and is intended primarily to
provide visibility to applications that all previously written data
has been acknowledged by the TCP layer on the receiver. Compatible
with the same filter in FreeBSD.
|
|
holding the kq_lock of that note's kq. Rather than exposing this directly,
add new knote_set_eof() and knote_clear_eof() functions that handle the
necessary locking and don't leak as many implementation details to modules.
NetBSD 9.99.91
|
|
|
|
true if the last knote was removed and there are no more knotes
on the selinfo.
- Use this new return value in filt_sordetach(), filt_sowdetach(),
filt_fifordetach(), and filt_fifowdetach() to know when to clear
SB_KOTE without having to know select/kqueue implementation details.
|
|
define a flag FILTEROP_ISFD that has the meaning of the prior f_isfd.
Field and flag name aligned with OpenBSD.
This does not constitute a functional or ABI change, as the field location
and size, and the value placed in that field, are the same as the previous
code, but we're bumping __NetBSD_Version__ so 3rd-party module source code
can adapt, as needed.
NetBSD 9.99.89
|
|
the implicit padding is initialized. this avoids later copying uninitialized
memory out to user space. detected by KMSAN.
|
|
|
|
change that was done to fix poll(POLLPRI | POLLRDBAND) and instead
add a separate flag to track when poll() should indicate that a
MSG_OOB byte is available. Re-fixes PR 54435 properly.
|
|
prevent this behaviour. The default is not changed.
|
|
|
|
In sockopt_alloc(), 'sopt' may already have been initialized with
'sopt->sopt_data = sopt->sopt_buf'. If the allocation fails, we
end up with 'sopt->sopt_data = NULL', and later try to free this
NULL pointer in sockopt_destroy().
Fix that by not modifying 'sopt_data' if the allocation failed.
Difficult to reproduce in normal times, but fault(4) makes it
easy.
Reported-by: syzbot+380cb5d518742f063ad2@syzkaller.appspotmail.com
|
|
Adding these seems to improve the SCTP situation.
|
|
to userland. Found by kMSan.
Reported-by: syzbot+8134380511a82c8f5fd7@syzkaller.appspotmail.com
|
|
not necessarily the same size. Don't cast pointers to bool, check for
NULL instead.
|
|
that poll(2) works.
|
|
second argument, and the compiler is free to perform optimizations knowing
that this argument is never NULL.
In this particular case, it was harmless. But still good to fix.
Reported-by: syzbot+6f504255accb795eb6b7@syzkaller.appspotmail.com
|
|
rather than discarding-after-assignment. Introduced from the
[pgoyette-compat] branch work.
Welcome to 9.99.14 !!! (Module hook routine prototype changed.)
Found by the lgtm bot, reported via private Email from maxv@
|
|
|
|
|
|
Without this, a rumpkernel (appropriately modified) built with SCTP
enabled will try to assign the function pointers, but the targets
are only available in rumpnet. We cannot link the rumpkernel against
rumpnet because rumpnet is already linked against rumpkernel and we
would end up with a circular dependency.
As reported in private Email by rjs@
|
|
|
|
getsockopt(2) does not silently truncate returned optval
|
|
handled correctly whether or not the compat_50 module is loaded.
|
|
|
|
|
|
and into its own source file, which is now included in the compat_50
module.
(Not sure how this got missed during the original [pgoyette-compat] work)
|
|
timeout.
Reported-by: syzbot+662dbeb526303f458255@syzkaller.appspotmail.com
|
|
in pcblist, and we don't want a future lookup (via eg netstat) to read
freed data.
Detected by KASAN, reported by Alexander Nasonov.
|
|
is possible to get an MT_CONTROL if we sleep in MSG_WAITALL. The other BSDs
do the same.
Reported-by: syzbot+e8aa26ad551c649227b4@syzkaller.appspotmail.com
|
|
|
|
|
|
|
|
|
|
return and clear so->so_rerror if so->so_error is zero.
Ok: christos@
|
|
receive overflow errors re-instating the default behavior to
silently ignore them as before 2018-03-19.
- Introduce a new kern.sooptions sysctl to control the default
behavior of socket options. Setting this to 0x4000 (SO_RERROR),
turns on receive overflow error reporting for all sockets.
- Change dhcpcd to turn on SO_RERROR on all its sockets.
As discussed in tech-net.
|
|
These functions are defined on unsigned int. The generic name
min/max should not silently truncate to 32 bits on 64-bit systems.
This is purely a name change -- no functional change intended.
HOWEVER! Some subsystems have
#define min(a, b) ((a) < (b) ? (a) : (b))
#define max(a, b) ((a) > (b) ? (a) : (b))
even though our standard name for that is MIN/MAX. Although these
may invite multiple evaluation bugs, these do _not_ cause integer
truncation.
To avoid `fixing' these cases, I first changed the name in libkern,
and then compile-tested every file where min/max occurred in order to
confirm that it failed -- and thus confirm that nothing shadowed
min/max -- before changing it.
I have left a handful of bootloaders that are too annoying to
compile-test, and some dead code:
cobalt ews4800mips hp300 hppa ia64 luna68k vax
acorn32/if_ie.c (not included in any kernels)
macppc/if_gm.c (superseded by gem(4))
It should be easy to fix the fallout once identified -- this way of
doing things fails safe, and the goal here, after all, is to _avoid_
silent integer truncations, not introduce them.
Maybe one day we can reintroduce min/max as type-generic things that
never silently truncate. But we should avoid doing that for a while,
so that existing code has a chance to be detected by the compiler for
conversion to uimin/uimax without changing the semantics until we can
properly audit it all. (Who knows, maybe in some cases integer
truncation is actually intended!)
|
|
|
|
undocumented and confusing.
|
|
|
|
As it can be affected by route(4) sockets which are raw.
|
|
The error has already been reported and it's pointless requiring another
recv(2) call just to clear it.
|
|
that should be returned to the caller in getsockopt(2).
(Tom Ivar Helbekkmo)
|
|
(Tom Ivar Helbekkmo)
|
|
Mostly done with spatch with touchups for indentation
@@
expression a;
identifier b,c,d;
identifier p;
@@
const struct filterops p =
- { a, b, c, d
+ {
+ .f_isfd = a,
+ .f_attach = b,
+ .f_detach = c,
+ .f_event = d,
};
|
|
includes.
|
|
CAN stands for Controller Area Network, a broadcast network used
in automation and automotive fields. For example, the NMEA2000 standard
developped for marine devices uses a CAN network as the link layer.
This is an implementation of the linux socketcan API:
https://www.kernel.org/doc/Documentation/networking/can.txt
you can also see can(4).
This adds a new socket family (AF_CAN) and protocol (PF_CAN),
as well as the canconfig(8) utility, used to set timing parameter of
CAN hardware. Also inclued is a driver for the CAN controller
found in the allwinner A20 SoC (I tested it with an Olimex lime2 board,
connected with PIC18-based CAN devices).
There is also the canloop(4) pseudo-device, which allows to use
the socketcan API without CAN hardware.
At this time the CANFD part of the linux socketcan API is not implemented.
Error frames are not implemented either. But I could get the cansend and
canreceive utilities from the canutils package to build and run with minimal
changes. tcpudmp(8) can also be used to record frames, which can be
decoded with etherreal.
|
|
|
|
|